Feat v0.2.3 sdk tasks (#7)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #7.
This commit is contained in:
@@ -283,5 +283,22 @@ export function createDomains(restClient) {
|
||||
},
|
||||
|
||||
health: () => rc.get('/api/v1/health'),
|
||||
|
||||
// ── Extension-scoped client ──────────
|
||||
/**
|
||||
* Scoped API client for an extension's surface routes.
|
||||
* @param {string} packageId — package slug (e.g. 'tasks')
|
||||
* @returns {object} — { get, post, put, del, upload }
|
||||
*/
|
||||
ext(packageId) {
|
||||
const base = '/s/' + packageId + '/api';
|
||||
return {
|
||||
get: (path, opts) => rc.get(base + path + _qs(opts)),
|
||||
post: (path, data) => rc.post(base + path, data),
|
||||
put: (path, data) => rc.put(base + path, data),
|
||||
del: (path) => rc.del(base + path),
|
||||
upload: (path, file) => rc.upload(base + path, file),
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user