Changeset 0.37.14 (#226)
Co-authored-by: gobha <jasafpro@gmail.com> Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
@@ -73,6 +73,7 @@ export function createDomains(restClient) {
|
||||
complete: (data, signal) => rc.stream('/api/v1/chat/completions', data, signal),
|
||||
regenerate: (id, msgId, data, signal) => rc.stream(`/api/v1/channels/${id}/messages/${msgId}/regenerate`, data, signal),
|
||||
editMessage: (id, msgId, content) => rc.post(`/api/v1/channels/${id}/messages/${msgId}/edit`, { content }),
|
||||
deleteMessage: (id, msgId) => rc.del(`/api/v1/channels/${id}/messages/${msgId}`),
|
||||
siblings: (id, msgId) => rc.get(`/api/v1/channels/${id}/messages/${msgId}/siblings`),
|
||||
path: (id) => rc.get(`/api/v1/channels/${id}/path`),
|
||||
cursor: (id, leafId) => rc.put(`/api/v1/channels/${id}/cursor`, { active_leaf_id: leafId }),
|
||||
@@ -184,11 +185,13 @@ export function createDomains(restClient) {
|
||||
|
||||
// ── 11. Notifications ──────────────────
|
||||
notifications: {
|
||||
list: (opts) => rc.get('/api/v1/notifications' + _qs(opts)),
|
||||
markRead: (id) => rc.post(`/api/v1/notifications/${id}/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)}`),
|
||||
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`, {}),
|
||||
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)}`),
|
||||
},
|
||||
|
||||
// ── 12. Extensions ─────────────────────
|
||||
@@ -443,6 +446,19 @@ export function createDomains(restClient) {
|
||||
del: (id) => rc.del(`/api/v1/admin/extensions/${id}`),
|
||||
},
|
||||
|
||||
packages: {
|
||||
list: (opts) => rc.get('/api/v1/admin/packages' + _qs(opts)),
|
||||
get: (id) => rc.get(`/api/v1/admin/packages/${id}`),
|
||||
install: (file) => rc.upload('/api/v1/admin/packages/install', file),
|
||||
enable: (id) => rc.put(`/api/v1/admin/packages/${id}/enable`, {}),
|
||||
disable: (id) => rc.put(`/api/v1/admin/packages/${id}/disable`, {}),
|
||||
del: (id) => rc.del(`/api/v1/admin/packages/${id}`),
|
||||
settings: (id) => rc.get(`/api/v1/admin/packages/${id}/settings`),
|
||||
updateSettings: (id, data) => rc.put(`/api/v1/admin/packages/${id}/settings`, data),
|
||||
registry: () => rc.get('/api/v1/admin/packages/registry'),
|
||||
registryInstall: (url) => rc.post('/api/v1/admin/packages/registry/install', { url }),
|
||||
},
|
||||
|
||||
tasks: {
|
||||
list: () => rc.get('/api/v1/admin/tasks'),
|
||||
run: (id) => rc.post(`/api/v1/admin/tasks/${id}/run`, {}),
|
||||
@@ -478,11 +494,19 @@ export function createDomains(restClient) {
|
||||
// ── Misc (not domain-specific) ─────────
|
||||
folders: {
|
||||
list: () => rc.get('/api/v1/folders'),
|
||||
create: (name, sort) => rc.post('/api/v1/folders', { name, sort_order: sort || 0 }),
|
||||
create: (name, opts) => rc.post('/api/v1/folders', { name, parent_id: opts?.parent_id || null, sort_order: opts?.sort_order || 0 }),
|
||||
update: (id, data) => rc.put(`/api/v1/folders/${id}`, data),
|
||||
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}`),
|
||||
},
|
||||
|
||||
files: {
|
||||
get: (id) => rc.get(`/api/v1/files/${id}`),
|
||||
del: (id) => rc.del(`/api/v1/files/${id}`),
|
||||
@@ -492,6 +516,11 @@ export function createDomains(restClient) {
|
||||
list: () => rc.get('/api/v1/tools'),
|
||||
},
|
||||
|
||||
// ── Users ──────────────────────────────
|
||||
users: {
|
||||
search: (q) => rc.get('/api/v1/users/search' + _qs({ q })),
|
||||
},
|
||||
|
||||
presence: {
|
||||
heartbeat: () => rc.post('/api/v1/presence/heartbeat', {}),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user