Changeset 0.37.17 (#229)
Co-authored-by: gobha <jasafpro@gmail.com> Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
@@ -140,13 +140,17 @@ export function createDomains(restClient) {
|
||||
notes: (id) => rc.get(`/api/v1/projects/${id}/notes`),
|
||||
addNote: (id, noteId) => rc.post(`/api/v1/projects/${id}/notes`, { note_id: noteId }),
|
||||
removeNote: (id, noteId) => rc.del(`/api/v1/projects/${id}/notes/${noteId}`),
|
||||
files: (id) => rc.get(`/api/v1/projects/${id}/files`),
|
||||
uploadFile: (id, file) => rc.upload(`/api/v1/projects/${id}/files`, file),
|
||||
files: (id, opts) => rc.get(`/api/v1/projects/${id}/files` + _qs(opts)),
|
||||
uploadFile: (id, file, path) => rc.upload(`/api/v1/projects/${id}/files` + (path ? _qs({ path }) : ''), file),
|
||||
deleteFile: (id, path) => rc.del(`/api/v1/projects/${id}/files` + _qs({ path })),
|
||||
mkdir: (id, path) => rc.post(`/api/v1/projects/${id}/files/mkdir`, { path }),
|
||||
uploadArchive: (id, file) => rc.upload(`/api/v1/projects/${id}/archive/upload`, file),
|
||||
},
|
||||
|
||||
// ── 7. Workspaces ──────────────────────
|
||||
workspaces: {
|
||||
...crud(rc, '/api/v1/workspaces'),
|
||||
update: (id, data) => rc.patch(`/api/v1/workspaces/${id}`, data),
|
||||
files: (id, opts) => rc.get(`/api/v1/workspaces/${id}/files` + _qs(opts)),
|
||||
readFile: (id, path) => rc.get(`/api/v1/workspaces/${id}/files/read` + _qs({ path })),
|
||||
writeFile: (id, path, content) => rc.put(`/api/v1/workspaces/${id}/files/write` + _qs({ path }), content),
|
||||
@@ -187,11 +191,12 @@ export function createDomains(restClient) {
|
||||
notifications: {
|
||||
list: (opts) => rc.get('/api/v1/notifications' + _qs(opts)),
|
||||
unreadCount: () => rc.get('/api/v1/notifications/unread-count'),
|
||||
markRead: (id) => rc.post(`/api/v1/notifications/${id}/read`, {}),
|
||||
markRead: (id) => rc.patch(`/api/v1/notifications/${id}/read`, {}),
|
||||
markAllRead: () => rc.post('/api/v1/notifications/mark-all-read', {}),
|
||||
prefs: () => rc.get('/api/v1/notifications/preferences'),
|
||||
setPref: (type, data) => rc.put(`/api/v1/notifications/preferences/${encodeURIComponent(type)}`, data),
|
||||
delPref: (type) => rc.del(`/api/v1/notifications/preferences/${encodeURIComponent(type)}`),
|
||||
del: (id) => rc.del(`/api/v1/notifications/${id}`),
|
||||
},
|
||||
|
||||
// ── 12. Extensions ─────────────────────
|
||||
@@ -272,6 +277,8 @@ export function createDomains(restClient) {
|
||||
// ── 15. Workflows ──────────────────────
|
||||
workflows: {
|
||||
...crud(rc, '/api/v1/workflows'),
|
||||
update: (id, data) => rc.patch(`/api/v1/workflows/${id}`, data),
|
||||
stages: (id) => rc.get(`/api/v1/workflows/${id}/stages`),
|
||||
instances: (id, opts) => rc.get(`/api/v1/workflows/${id}/instances` + _qs(opts)),
|
||||
advance: (id, data) => rc.post(`/api/v1/workflows/${id}/advance`, data),
|
||||
reject: (id, data) => rc.post(`/api/v1/workflows/${id}/reject`, data),
|
||||
@@ -294,8 +301,8 @@ export function createDomains(restClient) {
|
||||
tasks: {
|
||||
...crud(rc, '/api/v1/tasks'),
|
||||
runs: (id, opts) => rc.get(`/api/v1/tasks/${id}/runs` + _qs(opts)),
|
||||
start: (id, data) => rc.post(`/api/v1/tasks/${id}/start`, data || {}),
|
||||
stop: (id) => rc.post(`/api/v1/tasks/${id}/stop`, {}),
|
||||
start: (id, data) => rc.post(`/api/v1/tasks/${id}/run`, data || {}),
|
||||
stop: (id) => rc.post(`/api/v1/tasks/${id}/kill`, {}),
|
||||
},
|
||||
|
||||
// ── 17. Surfaces ───────────────────────
|
||||
@@ -522,13 +529,9 @@ export function createDomains(restClient) {
|
||||
del: (id) => rc.del(`/api/v1/folders/${id}`),
|
||||
},
|
||||
|
||||
notifications: {
|
||||
list: (params) => rc.get('/api/v1/notifications', params),
|
||||
unreadCount: () => rc.get('/api/v1/notifications/unread-count'),
|
||||
markRead: (id) => rc.patch(`/api/v1/notifications/${id}/read`),
|
||||
markAllRead: () => rc.post('/api/v1/notifications/mark-all-read'),
|
||||
del: (id) => rc.del(`/api/v1/notifications/${id}`),
|
||||
},
|
||||
// NOTE: notifications is defined in the main domain block above (§11).
|
||||
// The duplicate here was overwriting prefs/setPref/delPref methods.
|
||||
// Removed — see line ~190 for the canonical definition.
|
||||
|
||||
files: {
|
||||
get: (id) => rc.get(`/api/v1/files/${id}`),
|
||||
|
||||
Reference in New Issue
Block a user