@parall/sdk 1.53.0 → 1.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +80 -68
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +140 -119
- package/dist/constants.d.ts +21 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +31 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/project-task-client.d.ts +69 -0
- package/dist/project-task-client.d.ts.map +1 -0
- package/dist/project-task-client.js +117 -0
- package/dist/subject.d.ts +25 -0
- package/dist/subject.d.ts.map +1 -0
- package/dist/subject.js +54 -0
- package/dist/task-label-client.d.ts +13 -0
- package/dist/task-label-client.d.ts.map +1 -0
- package/dist/task-label-client.js +24 -0
- package/dist/task-label-types.d.ts +33 -0
- package/dist/task-label-types.d.ts.map +1 -0
- package/dist/task-label-types.js +1 -0
- package/dist/types.d.ts +250 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -3
- package/package.json +1 -1
- package/src/client.ts +406 -453
- package/src/constants.ts +42 -5
- package/src/index.ts +2 -0
- package/src/project-task-client.ts +249 -0
- package/src/subject.ts +66 -0
- package/src/task-label-client.ts +37 -0
- package/src/task-label-types.ts +51 -0
- package/src/types.ts +282 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-task-client.d.ts","sourceRoot":"","sources":["../src/project-task-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,0BAA0B,EAC1B,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,sBAAsB,EACtB,0BAA0B,EAC1B,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AA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,WAAW,CAAC;IAIjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlF,iBAAiB,CACrB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAIrC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1E,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAK9C,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAIzE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9D,aAAa,CACjB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,OAAO,CAAC;IAIb,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ENDPOINTS } from './constants.js';
|
|
2
|
+
/** Project and task REST methods shared by every ParallClient instance. */
|
|
3
|
+
export class ProjectTaskClient {
|
|
4
|
+
async createTask(orgId, data) {
|
|
5
|
+
return this.request('POST', ENDPOINTS.TASKS(orgId), data);
|
|
6
|
+
}
|
|
7
|
+
async getTasks(orgId, params) {
|
|
8
|
+
return this.request('GET', ENDPOINTS.TASKS(orgId), undefined, params);
|
|
9
|
+
}
|
|
10
|
+
async getTaskSubtaskSummary(orgId, params) {
|
|
11
|
+
return this.request('GET', ENDPOINTS.TASK_SUBTASK_SUMMARY(orgId), undefined, params);
|
|
12
|
+
}
|
|
13
|
+
async getTask(orgId, taskId) {
|
|
14
|
+
return this.request('GET', ENDPOINTS.TASK(orgId, taskId));
|
|
15
|
+
}
|
|
16
|
+
async updateTask(orgId, taskId, data) {
|
|
17
|
+
return this.request('PATCH', ENDPOINTS.TASK(orgId, taskId), data);
|
|
18
|
+
}
|
|
19
|
+
async deleteTask(orgId, taskId, opts) {
|
|
20
|
+
return this.request('DELETE', ENDPOINTS.TASK(orgId, taskId), undefined, opts?.force ? { force: 'true' } : undefined);
|
|
21
|
+
}
|
|
22
|
+
async archiveTask(orgId, taskId) {
|
|
23
|
+
return this.request('POST', ENDPOINTS.TASK_ARCHIVE(orgId, taskId));
|
|
24
|
+
}
|
|
25
|
+
async restoreTask(orgId, taskId) {
|
|
26
|
+
return this.request('POST', ENDPOINTS.TASK_RESTORE(orgId, taskId));
|
|
27
|
+
}
|
|
28
|
+
async watchTask(orgId, taskId) {
|
|
29
|
+
return this.request('POST', ENDPOINTS.TASK_WATCH(orgId, taskId));
|
|
30
|
+
}
|
|
31
|
+
async unwatchTask(orgId, taskId) {
|
|
32
|
+
return this.request('DELETE', ENDPOINTS.TASK_WATCH(orgId, taskId));
|
|
33
|
+
}
|
|
34
|
+
async getTaskWatchers(orgId, taskId) {
|
|
35
|
+
const res = await this.request('GET', ENDPOINTS.TASK_WATCHERS(orgId, taskId));
|
|
36
|
+
return res.data;
|
|
37
|
+
}
|
|
38
|
+
async subscribeTaskMember(orgId, taskId, userId) {
|
|
39
|
+
return this.request('PUT', ENDPOINTS.TASK_SUBSCRIBER(orgId, taskId, userId));
|
|
40
|
+
}
|
|
41
|
+
async unsubscribeTaskMember(orgId, taskId, userId) {
|
|
42
|
+
return this.request('DELETE', ENDPOINTS.TASK_SUBSCRIBER(orgId, taskId, userId));
|
|
43
|
+
}
|
|
44
|
+
async watchThread(threadRootId) {
|
|
45
|
+
return this.request('POST', ENDPOINTS.MESSAGE_WATCH(threadRootId));
|
|
46
|
+
}
|
|
47
|
+
async unwatchThread(threadRootId) {
|
|
48
|
+
return this.request('DELETE', ENDPOINTS.MESSAGE_WATCH(threadRootId));
|
|
49
|
+
}
|
|
50
|
+
async getThreadWatchers(threadRootId) {
|
|
51
|
+
const res = await this.request('GET', ENDPOINTS.MESSAGE_WATCHERS(threadRootId));
|
|
52
|
+
return res.data;
|
|
53
|
+
}
|
|
54
|
+
async isWatchingThread(threadRootId) {
|
|
55
|
+
const res = await this.request('GET', ENDPOINTS.MESSAGE_WATCHING(threadRootId));
|
|
56
|
+
return res.watching;
|
|
57
|
+
}
|
|
58
|
+
async getSubtasks(orgId, taskId) {
|
|
59
|
+
const res = await this.request('GET', ENDPOINTS.TASK_SUBTASKS(orgId, taskId));
|
|
60
|
+
return res.data;
|
|
61
|
+
}
|
|
62
|
+
async createTaskRelation(orgId, taskId, data) {
|
|
63
|
+
return this.request('POST', ENDPOINTS.TASK_RELATIONS(orgId, taskId), data);
|
|
64
|
+
}
|
|
65
|
+
async getTaskRelations(orgId, taskId) {
|
|
66
|
+
const res = await this.request('GET', ENDPOINTS.TASK_RELATIONS(orgId, taskId));
|
|
67
|
+
return res.data;
|
|
68
|
+
}
|
|
69
|
+
async listTaskRelationsByTarget(orgId, params) {
|
|
70
|
+
const query = new URLSearchParams({
|
|
71
|
+
target_type: params.target_type,
|
|
72
|
+
target_id: params.target_id,
|
|
73
|
+
});
|
|
74
|
+
const res = await this.request('GET', `${ENDPOINTS.TASK_RELATIONS_BY_TARGET(orgId)}?${query.toString()}`);
|
|
75
|
+
return res.data;
|
|
76
|
+
}
|
|
77
|
+
async deleteTaskRelation(orgId, taskId, relationId) {
|
|
78
|
+
return this.request('DELETE', ENDPOINTS.TASK_RELATION(orgId, taskId, relationId));
|
|
79
|
+
}
|
|
80
|
+
async getTaskComments(orgId, taskId, params) {
|
|
81
|
+
return this.request('GET', ENDPOINTS.TASK_COMMENTS(orgId, taskId), undefined, params);
|
|
82
|
+
}
|
|
83
|
+
async getTaskComment(orgId, taskId, commentId) {
|
|
84
|
+
return this.request('GET', ENDPOINTS.TASK_COMMENT(orgId, taskId, commentId));
|
|
85
|
+
}
|
|
86
|
+
async createTaskComment(orgId, taskId, data) {
|
|
87
|
+
return this.request('POST', ENDPOINTS.TASK_COMMENTS(orgId, taskId), data);
|
|
88
|
+
}
|
|
89
|
+
async updateTaskComment(orgId, taskId, commentId, data) {
|
|
90
|
+
return this.request('PATCH', ENDPOINTS.TASK_COMMENT(orgId, taskId, commentId), data);
|
|
91
|
+
}
|
|
92
|
+
async deleteTaskComment(orgId, taskId, commentId) {
|
|
93
|
+
return this.request('DELETE', ENDPOINTS.TASK_COMMENT(orgId, taskId, commentId));
|
|
94
|
+
}
|
|
95
|
+
async getTaskActivities(orgId, taskId, params) {
|
|
96
|
+
return this.request('GET', ENDPOINTS.TASK_ACTIVITIES(orgId, taskId), undefined, params);
|
|
97
|
+
}
|
|
98
|
+
async createProject(orgId, data) {
|
|
99
|
+
return this.request('POST', ENDPOINTS.PROJECTS(orgId), data);
|
|
100
|
+
}
|
|
101
|
+
async getProjects(orgId) {
|
|
102
|
+
const res = await this.request('GET', ENDPOINTS.PROJECTS(orgId));
|
|
103
|
+
return res.data;
|
|
104
|
+
}
|
|
105
|
+
async getProjectTaskSummary(orgId) {
|
|
106
|
+
return this.request('GET', ENDPOINTS.PROJECT_TASK_SUMMARY(orgId));
|
|
107
|
+
}
|
|
108
|
+
async getProject(orgId, projectId) {
|
|
109
|
+
return this.request('GET', ENDPOINTS.PROJECT(orgId, projectId));
|
|
110
|
+
}
|
|
111
|
+
async updateProject(orgId, projectId, data) {
|
|
112
|
+
return this.request('PATCH', ENDPOINTS.PROJECT(orgId, projectId), data);
|
|
113
|
+
}
|
|
114
|
+
async deleteProject(orgId, projectId) {
|
|
115
|
+
return this.request('DELETE', ENDPOINTS.PROJECT(orgId, projectId));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Shared ACL subject token helpers for clients that edit permission rosters. */
|
|
2
|
+
export type SubjectKind = 'wildcard' | 'user' | 'team';
|
|
3
|
+
export interface ParsedSubject {
|
|
4
|
+
kind: SubjectKind;
|
|
5
|
+
/** Empty for wildcard, user ID for user, and slug without `@` for team. */
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function isValidTeamSlug(slug: string): boolean;
|
|
9
|
+
export declare function formatTeamSubject(slug: string): string;
|
|
10
|
+
export declare function parseSubjectToken(token: string): ParsedSubject;
|
|
11
|
+
/**
|
|
12
|
+
* Maximum distinct team references one ACL row may carry. Mirrors
|
|
13
|
+
* `subject.MaxTeamSubjectsPerWrite` on the server, which enforces it.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MAX_TEAM_SUBJECTS_PER_WRITE = 200;
|
|
16
|
+
/**
|
|
17
|
+
* Returns unique team slugs in first-seen order for batched write validation.
|
|
18
|
+
*
|
|
19
|
+
* Syntactically invalid slugs are included rather than skipped, matching the
|
|
20
|
+
* server's `subject.TeamSlugs`: a mistyped `@Finance` must reach the existence
|
|
21
|
+
* check and be reported missing, so the write fails with a legible error
|
|
22
|
+
* instead of storing a token that matches nobody.
|
|
23
|
+
*/
|
|
24
|
+
export declare function teamSlugsFromSubjects(subjects: readonly string[]): string[];
|
|
25
|
+
//# sourceMappingURL=subject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../src/subject.ts"],"names":[],"mappings":"AAAA,iFAAiF;AAEjF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;CACf;AAID,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAe9D;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAW3E"}
|
package/dist/subject.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Shared ACL subject token helpers for clients that edit permission rosters. */
|
|
2
|
+
const TEAM_SLUG = /^[a-z0-9][a-z0-9-]*$/;
|
|
3
|
+
export function isValidTeamSlug(slug) {
|
|
4
|
+
return TEAM_SLUG.test(slug);
|
|
5
|
+
}
|
|
6
|
+
export function formatTeamSubject(slug) {
|
|
7
|
+
if (!isValidTeamSlug(slug)) {
|
|
8
|
+
throw new Error(`Invalid team slug: ${slug}`);
|
|
9
|
+
}
|
|
10
|
+
return `@${slug}`;
|
|
11
|
+
}
|
|
12
|
+
export function parseSubjectToken(token) {
|
|
13
|
+
if (token === '*') {
|
|
14
|
+
return { kind: 'wildcard', value: '' };
|
|
15
|
+
}
|
|
16
|
+
if (token.startsWith('@')) {
|
|
17
|
+
const slug = token.slice(1);
|
|
18
|
+
if (!isValidTeamSlug(slug)) {
|
|
19
|
+
throw new Error(`Invalid team subject: ${token}`);
|
|
20
|
+
}
|
|
21
|
+
return { kind: 'team', value: slug };
|
|
22
|
+
}
|
|
23
|
+
if (!token) {
|
|
24
|
+
throw new Error('Subject token is empty');
|
|
25
|
+
}
|
|
26
|
+
return { kind: 'user', value: token };
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Maximum distinct team references one ACL row may carry. Mirrors
|
|
30
|
+
* `subject.MaxTeamSubjectsPerWrite` on the server, which enforces it.
|
|
31
|
+
*/
|
|
32
|
+
export const MAX_TEAM_SUBJECTS_PER_WRITE = 200;
|
|
33
|
+
/**
|
|
34
|
+
* Returns unique team slugs in first-seen order for batched write validation.
|
|
35
|
+
*
|
|
36
|
+
* Syntactically invalid slugs are included rather than skipped, matching the
|
|
37
|
+
* server's `subject.TeamSlugs`: a mistyped `@Finance` must reach the existence
|
|
38
|
+
* check and be reported missing, so the write fails with a legible error
|
|
39
|
+
* instead of storing a token that matches nobody.
|
|
40
|
+
*/
|
|
41
|
+
export function teamSlugsFromSubjects(subjects) {
|
|
42
|
+
const seen = new Set();
|
|
43
|
+
const slugs = [];
|
|
44
|
+
for (const token of subjects) {
|
|
45
|
+
if (!token.startsWith('@'))
|
|
46
|
+
continue;
|
|
47
|
+
const slug = token.slice(1);
|
|
48
|
+
if (!slug || seen.has(slug))
|
|
49
|
+
continue;
|
|
50
|
+
seen.add(slug);
|
|
51
|
+
slugs.push(slug);
|
|
52
|
+
}
|
|
53
|
+
return slugs;
|
|
54
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ProjectTaskClient } from './project-task-client.js';
|
|
2
|
+
import type { AddTaskLabelsRequest, CreateLabelRequest, Label, UpdateLabelRequest } from './task-label-types.js';
|
|
3
|
+
import type { Task } from './types.js';
|
|
4
|
+
/** Organization label vocabulary and incremental Task attachment methods. */
|
|
5
|
+
export declare abstract class TaskLabelClient extends ProjectTaskClient {
|
|
6
|
+
getLabels(orgId: string): Promise<Label[]>;
|
|
7
|
+
createLabel(orgId: string, data: CreateLabelRequest): Promise<Label>;
|
|
8
|
+
updateLabel(orgId: string, labelId: string, data: UpdateLabelRequest): Promise<Label>;
|
|
9
|
+
deleteLabel(orgId: string, labelId: string): Promise<void>;
|
|
10
|
+
addTaskLabels(orgId: string, taskId: string, data: AddTaskLabelsRequest): Promise<Task>;
|
|
11
|
+
removeTaskLabel(orgId: string, taskId: string, labelId: string): Promise<Task>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=task-label-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-label-client.d.ts","sourceRoot":"","sources":["../src/task-label-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,EACL,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,6EAA6E;AAC7E,8BAAsB,eAAgB,SAAQ,iBAAiB;IACvD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAK1C,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC;IAIpE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC;IAIrF,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1D,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvF,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ENDPOINTS } from './constants.js';
|
|
2
|
+
import { ProjectTaskClient } from './project-task-client.js';
|
|
3
|
+
/** Organization label vocabulary and incremental Task attachment methods. */
|
|
4
|
+
export class TaskLabelClient extends ProjectTaskClient {
|
|
5
|
+
async getLabels(orgId) {
|
|
6
|
+
const response = await this.request('GET', ENDPOINTS.LABELS(orgId));
|
|
7
|
+
return response.data;
|
|
8
|
+
}
|
|
9
|
+
async createLabel(orgId, data) {
|
|
10
|
+
return this.request('POST', ENDPOINTS.LABELS(orgId), data);
|
|
11
|
+
}
|
|
12
|
+
async updateLabel(orgId, labelId, data) {
|
|
13
|
+
return this.request('PATCH', ENDPOINTS.LABEL(orgId, labelId), data);
|
|
14
|
+
}
|
|
15
|
+
async deleteLabel(orgId, labelId) {
|
|
16
|
+
return this.request('DELETE', ENDPOINTS.LABEL(orgId, labelId));
|
|
17
|
+
}
|
|
18
|
+
async addTaskLabels(orgId, taskId, data) {
|
|
19
|
+
return this.request('POST', ENDPOINTS.TASK_LABELS(orgId, taskId), data);
|
|
20
|
+
}
|
|
21
|
+
async removeTaskLabel(orgId, taskId, labelId) {
|
|
22
|
+
return this.request('DELETE', ENDPOINTS.TASK_LABEL(orgId, taskId, labelId));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type LabelColor = 'default' | 'red' | 'green' | 'yellow' | 'blue' | 'lilac' | 'orange' | 'magenta' | 'sand' | 'fuchsia' | 'cerulean' | 'teal' | 'lime';
|
|
2
|
+
export interface Label {
|
|
3
|
+
id: string;
|
|
4
|
+
org_id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
color: LabelColor;
|
|
7
|
+
/** Optional agent-readable guidance for when this label applies. */
|
|
8
|
+
description?: string | null;
|
|
9
|
+
created_by: string;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateLabelRequest {
|
|
14
|
+
name: string;
|
|
15
|
+
color?: LabelColor;
|
|
16
|
+
description?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface UpdateLabelRequest {
|
|
19
|
+
name?: string;
|
|
20
|
+
color?: LabelColor;
|
|
21
|
+
/** Explicit null clears the description. */
|
|
22
|
+
description?: string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface AddTaskLabelsRequest {
|
|
25
|
+
label_ids: string[];
|
|
26
|
+
}
|
|
27
|
+
export type LabelCreatedData = Label;
|
|
28
|
+
export type LabelUpdatedData = Label;
|
|
29
|
+
export interface LabelDeletedData {
|
|
30
|
+
label_id: string;
|
|
31
|
+
org_id: string;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=task-label-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-label-types.d.ts","sourceRoot":"","sources":["../src/task-label-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,KAAK,GACL,OAAO,GACP,QAAQ,GACR,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,GACT,MAAM,GACN,SAAS,GACT,UAAU,GACV,MAAM,GACN,MAAM,CAAC;AAEX,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC;AACrC,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Label, LabelCreatedData, LabelDeletedData, LabelUpdatedData } from './task-label-types.js';
|
|
1
2
|
export type UserType = 'human' | 'agent';
|
|
2
3
|
export type UserStatus = 'active' | 'disabled';
|
|
3
4
|
export interface User {
|
|
@@ -79,6 +80,8 @@ export interface ChatMember {
|
|
|
79
80
|
pinned: boolean;
|
|
80
81
|
hidden: boolean;
|
|
81
82
|
joined_at: string;
|
|
83
|
+
/** Org-scoped public title. Omitted by older servers and for former DM peers. */
|
|
84
|
+
title?: string;
|
|
82
85
|
user?: User;
|
|
83
86
|
}
|
|
84
87
|
export interface UpdateChatMemberRequest {
|
|
@@ -373,6 +376,7 @@ export interface UpdateAgentInstructionsRequest {
|
|
|
373
376
|
instructions: string;
|
|
374
377
|
expected_version: number;
|
|
375
378
|
}
|
|
379
|
+
export type TeamRole = 'member' | 'manager';
|
|
376
380
|
export interface Team {
|
|
377
381
|
id: string;
|
|
378
382
|
org_id: string;
|
|
@@ -382,6 +386,45 @@ export interface Team {
|
|
|
382
386
|
created_at: string;
|
|
383
387
|
updated_at: string;
|
|
384
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* Display fields a roster listing carries for each member. The server projects
|
|
391
|
+
* only these columns, so this is deliberately narrower than `User`: no email,
|
|
392
|
+
* phone, or last_seen_at reaches a roster response.
|
|
393
|
+
*
|
|
394
|
+
* `avatar_url` is optional rather than nullable because the server omits the
|
|
395
|
+
* field when unset.
|
|
396
|
+
*/
|
|
397
|
+
export interface RosterUser {
|
|
398
|
+
id: string;
|
|
399
|
+
type: UserType;
|
|
400
|
+
display_name: string;
|
|
401
|
+
avatar_url?: string;
|
|
402
|
+
status: UserStatus;
|
|
403
|
+
}
|
|
404
|
+
export interface TeamMember {
|
|
405
|
+
team_id: string;
|
|
406
|
+
user_id: string;
|
|
407
|
+
role: TeamRole;
|
|
408
|
+
added_by: string;
|
|
409
|
+
added_at: string;
|
|
410
|
+
user?: RosterUser;
|
|
411
|
+
}
|
|
412
|
+
export interface CreateTeamRequest {
|
|
413
|
+
name: string;
|
|
414
|
+
slug: string;
|
|
415
|
+
}
|
|
416
|
+
export interface UpdateTeamRequest {
|
|
417
|
+
name: string;
|
|
418
|
+
/** Team slugs are immutable because wiki ACL rows store them as @slug. */
|
|
419
|
+
slug?: never;
|
|
420
|
+
}
|
|
421
|
+
export interface AddTeamMemberRequest {
|
|
422
|
+
user_id: string;
|
|
423
|
+
role?: TeamRole;
|
|
424
|
+
}
|
|
425
|
+
export interface UpdateTeamMemberRequest {
|
|
426
|
+
role: TeamRole;
|
|
427
|
+
}
|
|
385
428
|
export type InvitationStatus = 'pending' | 'accepted' | 'declined' | 'revoked';
|
|
386
429
|
export interface OrgInvitation {
|
|
387
430
|
id: string;
|
|
@@ -592,7 +635,20 @@ export interface DeployTemplateRequest {
|
|
|
592
635
|
/** Hire-time per-agent adjustments (onboarding wizard S2). Keys are the
|
|
593
636
|
* template's agent keys; omitted agents keep template defaults. */
|
|
594
637
|
agent_overrides?: Record<string, DeployAgentOverride>;
|
|
638
|
+
/** Explicit onboarding S4 intent. Each ref must be an effective dependency
|
|
639
|
+
* of this team whose selected_agents restriction was established in S3.
|
|
640
|
+
* Deploy additively grants only the newly-created Agents that declare it. */
|
|
641
|
+
dependency_access_refs?: string[];
|
|
642
|
+
}
|
|
643
|
+
export interface TemplateDeploymentStatus {
|
|
644
|
+
deployment_id: string;
|
|
645
|
+
status: 'queued' | 'deploying' | 'failed';
|
|
646
|
+
error?: {
|
|
647
|
+
code: string;
|
|
648
|
+
message: string;
|
|
649
|
+
};
|
|
595
650
|
}
|
|
651
|
+
export type TemplateDeploymentResult = TemplateDeploymentReport | TemplateDeploymentStatus;
|
|
596
652
|
/** Per-agent hire-time override. Substitutes values within the platform-legal
|
|
597
653
|
* surface; never adds capability. Dependencies may only disable (false)
|
|
598
654
|
* declared optional deps — required deps and undeclared refs are rejected. */
|
|
@@ -1214,6 +1270,11 @@ export interface Task {
|
|
|
1214
1270
|
* gate subscriber-management UI — do not re-derive the rule client-side.
|
|
1215
1271
|
*/
|
|
1216
1272
|
can_manage_subscribers?: boolean;
|
|
1273
|
+
/**
|
|
1274
|
+
* Always present on label-aware HTTP/WS responses. Optional here only so
|
|
1275
|
+
* persisted Task rows from older clients can be read during migration.
|
|
1276
|
+
*/
|
|
1277
|
+
labels?: Label[];
|
|
1217
1278
|
}
|
|
1218
1279
|
export interface TaskWatcher {
|
|
1219
1280
|
task_id: string;
|
|
@@ -1279,6 +1340,7 @@ export interface CreateTaskRequest {
|
|
|
1279
1340
|
planned_start_date?: string;
|
|
1280
1341
|
/** Planned completion date, YYYY-MM-DD. */
|
|
1281
1342
|
due_date?: string;
|
|
1343
|
+
label_ids?: string[];
|
|
1282
1344
|
}
|
|
1283
1345
|
export interface UpdateTaskRequest {
|
|
1284
1346
|
title?: string;
|
|
@@ -1304,6 +1366,11 @@ export interface UpdateTaskRequest {
|
|
|
1304
1366
|
planned_start_date?: string | null;
|
|
1305
1367
|
/** Planned completion date, YYYY-MM-DD; explicit null clears it. */
|
|
1306
1368
|
due_date?: string | null;
|
|
1369
|
+
/**
|
|
1370
|
+
* Full-set replacement: absent leaves labels unchanged; [] or null clears.
|
|
1371
|
+
* Concurrent writers should prefer addTaskLabels/removeTaskLabel.
|
|
1372
|
+
*/
|
|
1373
|
+
label_ids?: string[] | null;
|
|
1307
1374
|
/**
|
|
1308
1375
|
* Dispatch lane binding (agent senders during a typed dispatch turn).
|
|
1309
1376
|
* dispatch_lane + dispatch_event_id bind the update to the claimed typed
|
|
@@ -1351,6 +1418,35 @@ export interface UpdateProjectRequest {
|
|
|
1351
1418
|
color?: string | null;
|
|
1352
1419
|
sort_order?: number;
|
|
1353
1420
|
}
|
|
1421
|
+
export interface ProjectTaskStatusCounts {
|
|
1422
|
+
todo: number;
|
|
1423
|
+
in_progress: number;
|
|
1424
|
+
in_review: number;
|
|
1425
|
+
done: number;
|
|
1426
|
+
canceled: number;
|
|
1427
|
+
}
|
|
1428
|
+
export interface ProjectTaskSummary {
|
|
1429
|
+
project_id: string;
|
|
1430
|
+
status_counts: ProjectTaskStatusCounts;
|
|
1431
|
+
completed_series: number[];
|
|
1432
|
+
}
|
|
1433
|
+
export interface ProjectTaskSummaryResponse {
|
|
1434
|
+
workspace_counts: {
|
|
1435
|
+
all_issues: number;
|
|
1436
|
+
my_issues: number;
|
|
1437
|
+
no_project: number;
|
|
1438
|
+
my_status_counts: ProjectTaskStatusCounts;
|
|
1439
|
+
};
|
|
1440
|
+
projects: ProjectTaskSummary[];
|
|
1441
|
+
}
|
|
1442
|
+
export interface TaskSubtaskSummary {
|
|
1443
|
+
task_id: string;
|
|
1444
|
+
total: number;
|
|
1445
|
+
done: number;
|
|
1446
|
+
}
|
|
1447
|
+
export interface TaskSubtaskSummaryResponse {
|
|
1448
|
+
data: TaskSubtaskSummary[];
|
|
1449
|
+
}
|
|
1354
1450
|
export type ScheduleSpecType = 'cron' | 'interval' | 'one_shot';
|
|
1355
1451
|
export type ScheduleStatus = 'active' | 'paused' | 'completed' | 'cancelled';
|
|
1356
1452
|
export type ScheduleCancelReason = 'user_cancel' | 'attached_gone' | 'creator_ineligible';
|
|
@@ -2120,6 +2216,12 @@ export interface OrgMemberRemovedData {
|
|
|
2120
2216
|
org_id: string;
|
|
2121
2217
|
user_id: string;
|
|
2122
2218
|
}
|
|
2219
|
+
/** An org-scoped public member profile changed. */
|
|
2220
|
+
export interface OrgMemberProfileUpdatedData {
|
|
2221
|
+
org_id: string;
|
|
2222
|
+
user_id: string;
|
|
2223
|
+
profile_version: number;
|
|
2224
|
+
}
|
|
2123
2225
|
export type TaskActivityAction = 'created' | 'field_changed' | 'commented';
|
|
2124
2226
|
export interface TaskComment {
|
|
2125
2227
|
id: string;
|
|
@@ -2551,12 +2653,48 @@ export interface SlackChannelsPage {
|
|
|
2551
2653
|
channels: SlackChannelInfo[];
|
|
2552
2654
|
next_cursor?: string;
|
|
2553
2655
|
}
|
|
2554
|
-
/** WeChat
|
|
2656
|
+
/** One WeChat friend resolved with its display name. */
|
|
2657
|
+
export interface WechatContactName {
|
|
2658
|
+
wxid: string;
|
|
2659
|
+
nick_name?: string;
|
|
2660
|
+
remark?: string;
|
|
2661
|
+
alias?: string;
|
|
2662
|
+
/** The label the WeChat app would show: remark > nickName > alias > wxid. */
|
|
2663
|
+
display: string;
|
|
2664
|
+
}
|
|
2665
|
+
/** One WeChat saved chatroom with its display name. */
|
|
2666
|
+
export interface WechatChatroomEntry {
|
|
2667
|
+
chatroom_id: string;
|
|
2668
|
+
nick_name?: string;
|
|
2669
|
+
remark?: string;
|
|
2670
|
+
display: string;
|
|
2671
|
+
}
|
|
2672
|
+
/**
|
|
2673
|
+
* WeChat address book — the vendor's id-only lists enriched with display
|
|
2674
|
+
* names (getBriefInfo for friends, getChatroomInfo per chatroom). System
|
|
2675
|
+
* ids (weixin/fmessage/medianote) are filtered out.
|
|
2676
|
+
*/
|
|
2555
2677
|
export interface WechatContactsPage {
|
|
2556
|
-
friends:
|
|
2557
|
-
chatrooms:
|
|
2678
|
+
friends: WechatContactName[];
|
|
2679
|
+
chatrooms: WechatChatroomEntry[];
|
|
2558
2680
|
ghs: string[];
|
|
2559
2681
|
}
|
|
2682
|
+
/** The connected WeChat account's identity (getProfile + stored app id). */
|
|
2683
|
+
export interface WechatProfileView {
|
|
2684
|
+
wxid: string;
|
|
2685
|
+
alias?: string;
|
|
2686
|
+
nick_name?: string;
|
|
2687
|
+
app_id: string;
|
|
2688
|
+
}
|
|
2689
|
+
/** WeChat connection health: live online probe + identity + offline record. */
|
|
2690
|
+
export interface WechatStatusView {
|
|
2691
|
+
online: boolean;
|
|
2692
|
+
wxid: string;
|
|
2693
|
+
alias?: string;
|
|
2694
|
+
nick_name?: string;
|
|
2695
|
+
app_id: string;
|
|
2696
|
+
last_offline_at?: string;
|
|
2697
|
+
}
|
|
2560
2698
|
export interface SlackUserInfo {
|
|
2561
2699
|
id: string;
|
|
2562
2700
|
name: string;
|
|
@@ -2930,6 +3068,9 @@ export type WsEventMap = {
|
|
|
2930
3068
|
'task.created': TaskCreatedData;
|
|
2931
3069
|
'task.updated': TaskUpdatedData;
|
|
2932
3070
|
'task.deleted': TaskDeletedData;
|
|
3071
|
+
'label.created': LabelCreatedData;
|
|
3072
|
+
'label.updated': LabelUpdatedData;
|
|
3073
|
+
'label.deleted': LabelDeletedData;
|
|
2933
3074
|
'task.assigned': TaskAssignedData;
|
|
2934
3075
|
'task.comment.created': TaskCommentCreatedData;
|
|
2935
3076
|
'task.comment.updated': TaskCommentUpdatedData;
|
|
@@ -2947,6 +3088,7 @@ export type WsEventMap = {
|
|
|
2947
3088
|
'org.join_request.new': OrgJoinRequestNewEventData;
|
|
2948
3089
|
'org.invite_link.joined': OrgInviteLinkJoinedEventData;
|
|
2949
3090
|
'org.member.removed': OrgMemberRemovedData;
|
|
3091
|
+
'org.member.profile.updated': OrgMemberProfileUpdatedData;
|
|
2950
3092
|
'agent_config.update': AgentConfigUpdateData;
|
|
2951
3093
|
'presence.update': PresenceUpdateData;
|
|
2952
3094
|
'wiki.changeset.created': WikiChangesetCreatedData;
|
|
@@ -3981,6 +4123,10 @@ export type MCPOAuthStatus = 'connected' | 'needs_reauth' | 'disconnected';
|
|
|
3981
4123
|
export interface MCPOAuthInitiateRequest {
|
|
3982
4124
|
server_url: string;
|
|
3983
4125
|
auth_type: 'oauth';
|
|
4126
|
+
/** New-connection creates only (POST …/mcp-configs): names the connection. */
|
|
4127
|
+
alias?: string;
|
|
4128
|
+
/** Bring-your-own provider app (see MCPOAuthClientParams). */
|
|
4129
|
+
oauth_client?: MCPOAuthClientParams;
|
|
3984
4130
|
}
|
|
3985
4131
|
/**
|
|
3986
4132
|
* Response of an OAuth-initiating PUT. Nothing is committed yet: an org
|
|
@@ -4014,14 +4160,35 @@ export interface MCPToolInfo {
|
|
|
4014
4160
|
description?: string;
|
|
4015
4161
|
[key: string]: unknown;
|
|
4016
4162
|
}
|
|
4163
|
+
/**
|
|
4164
|
+
* Which registration arm produced an oauth config's client identity
|
|
4165
|
+
* (multi-connection model): `preregistered` = an admin-supplied provider app
|
|
4166
|
+
* (e.g. Google Cloud Console), `cimd` = our self-served client metadata
|
|
4167
|
+
* document, `dcr` = RFC 7591 dynamic registration.
|
|
4168
|
+
*/
|
|
4169
|
+
export type MCPClientMode = 'preregistered' | 'cimd' | 'dcr';
|
|
4170
|
+
/** Where the OAuth client identity is owned. `platform` references a
|
|
4171
|
+
* deployment App; its shared secret is never copied into the org grant. */
|
|
4172
|
+
export type MCPOAuthClientSource = 'embedded' | 'platform';
|
|
4017
4173
|
/**
|
|
4018
4174
|
* Redacted MCP server config of an MCP clip
|
|
4019
|
-
* (`GET /orgs/{orgId}/clip-registry/{clipId}/mcp-config`
|
|
4020
|
-
*
|
|
4021
|
-
*
|
|
4175
|
+
* (`GET /orgs/{orgId}/clip-registry/{clipId}/mcp-config` — the org's DEFAULT
|
|
4176
|
+
* connection — or `GET …/mcp-configs/{configId}`). The whole mcp-config
|
|
4177
|
+
* family also accepts an installed reviewed Official OAuth Clip across orgs;
|
|
4178
|
+
* every other cross-org Clip gets `403 MCP_CROSS_ORG_DISABLED`. The stored credential NEVER
|
|
4022
4179
|
* appears in any response — `credential_set` is the only credential fact.
|
|
4180
|
+
*
|
|
4181
|
+
* Multi-connection model: a clip holds one config row (credential slot) PER
|
|
4182
|
+
* connection. `config_id`/`connection_id`/`alias`/`is_default` identify this
|
|
4183
|
+
* slot's connection — the thing `clip exec --connection` addresses. The
|
|
4184
|
+
* fields are additive; a pre-multi-connection server simply omits them.
|
|
4023
4185
|
*/
|
|
4024
4186
|
export interface MCPConfigResponse {
|
|
4187
|
+
config_id?: string;
|
|
4188
|
+
/** Empty/absent = a legacy orphan config whose connection was deleted. */
|
|
4189
|
+
connection_id?: string;
|
|
4190
|
+
alias?: string;
|
|
4191
|
+
is_default?: boolean;
|
|
4025
4192
|
server_url: string;
|
|
4026
4193
|
auth_type: MCPConfigAuthType;
|
|
4027
4194
|
/** Whether a credential is stored (write-only; the value is never returned). */
|
|
@@ -4031,6 +4198,12 @@ export interface MCPConfigResponse {
|
|
|
4031
4198
|
tools_refreshed_at?: string;
|
|
4032
4199
|
/** Present only when `auth_type` is `oauth`. */
|
|
4033
4200
|
oauth_status?: MCPOAuthStatus;
|
|
4201
|
+
/** Present while an oauth config holds a stored client identity
|
|
4202
|
+
* (connected or needs_reauth); absent once disconnected. */
|
|
4203
|
+
client_mode?: MCPClientMode;
|
|
4204
|
+
client_source?: MCPOAuthClientSource;
|
|
4205
|
+
/** True only when this grant uses the reviewed platform-owned OAuth App. */
|
|
4206
|
+
official_oauth?: boolean;
|
|
4034
4207
|
/**
|
|
4035
4208
|
* Opaque CAS token for If-Match on PUT/DELETE (lost-update protection).
|
|
4036
4209
|
* Version mismatch answers `409 MCP_CONFIG_STALE`.
|
|
@@ -4049,6 +4222,77 @@ export interface MCPConfigPutRequest {
|
|
|
4049
4222
|
auth_type: MCPAuthType;
|
|
4050
4223
|
credential?: string;
|
|
4051
4224
|
}
|
|
4225
|
+
/**
|
|
4226
|
+
* POST body of `…/clip-registry/{clipId}/mcp-configs` — a NEW connection
|
|
4227
|
+
* (credential slot) for the clip. `alias` names it for `clip exec
|
|
4228
|
+
* --connection` (exec always names its MCP connection explicitly — the
|
|
4229
|
+
* legacy connection-less form never routes to MCP); a collision falls back
|
|
4230
|
+
* to no alias (rename later via `PATCH /clip-connections/{connId}`). The new
|
|
4231
|
+
* connection becomes the org default only when no default exists — adding an
|
|
4232
|
+
* account never rewrites which connection the singular config surface (and
|
|
4233
|
+
* the Console lead card) addresses. No If-Match (creation is additive). Flat
|
|
4234
|
+
* auth types answer 201 with MCPConfigResponse; `auth_type: 'oauth'` answers
|
|
4235
|
+
* MCPOAuthInitiateResponse and commits nothing until the browser callback.
|
|
4236
|
+
*/
|
|
4237
|
+
export interface MCPConfigCreateRequest {
|
|
4238
|
+
server_url?: string;
|
|
4239
|
+
auth_type: MCPAuthType | 'oauth';
|
|
4240
|
+
credential?: string;
|
|
4241
|
+
alias?: string;
|
|
4242
|
+
oauth_client?: MCPOAuthClientParams;
|
|
4243
|
+
}
|
|
4244
|
+
/**
|
|
4245
|
+
* A manually pre-registered OAuth client identity (§4 ladder level 1 — e.g. a
|
|
4246
|
+
* Google Cloud Console app). Required when the provider's AS supports neither
|
|
4247
|
+
* CIMD nor dynamic registration (the server answers
|
|
4248
|
+
* `422 MCP_OAUTH_PREREGISTERED_REQUIRED`, whose `details` carry
|
|
4249
|
+
* `authorization_server` + `redirect_uri` for registering the app); always
|
|
4250
|
+
* allowed as an explicit bring-your-own-app choice. The secret is write-only.
|
|
4251
|
+
*/
|
|
4252
|
+
export interface MCPOAuthClientParams {
|
|
4253
|
+
client_id: string;
|
|
4254
|
+
client_secret?: string;
|
|
4255
|
+
}
|
|
4256
|
+
/**
|
|
4257
|
+
* One row of `GET …/clip-registry/{clipId}/mcp-configs` — the org's MCP
|
|
4258
|
+
* connections for the clip, default first. Deliberately WITHOUT the tools
|
|
4259
|
+
* snapshot (bounded at 1MiB per config); `tool_count` summarizes it and the
|
|
4260
|
+
* per-config GET carries the full snapshot.
|
|
4261
|
+
*/
|
|
4262
|
+
export interface MCPConnectionSummary {
|
|
4263
|
+
connection_id: string;
|
|
4264
|
+
config_id: string;
|
|
4265
|
+
alias?: string;
|
|
4266
|
+
is_default: boolean;
|
|
4267
|
+
server_url: string;
|
|
4268
|
+
auth_type: MCPConfigAuthType;
|
|
4269
|
+
credential_set: boolean;
|
|
4270
|
+
tool_count?: number;
|
|
4271
|
+
tools_refreshed_at?: string;
|
|
4272
|
+
oauth_status?: MCPOAuthStatus;
|
|
4273
|
+
client_mode?: MCPClientMode;
|
|
4274
|
+
client_source?: MCPOAuthClientSource;
|
|
4275
|
+
official_oauth?: boolean;
|
|
4276
|
+
version: string;
|
|
4277
|
+
}
|
|
4278
|
+
/** Result of the server-orchestrated Official MCP Clip removal. Local rows
|
|
4279
|
+
* are always removed on success; `revoked: false` warns that the provider may
|
|
4280
|
+
* still hold a grant requiring manual cleanup. */
|
|
4281
|
+
export interface MCPOfficialClipRemovalResponse {
|
|
4282
|
+
removed: boolean;
|
|
4283
|
+
revoked: boolean;
|
|
4284
|
+
}
|
|
4285
|
+
/**
|
|
4286
|
+
* PATCH body of `/clip-connections/{connId}` (MCP connections only, human
|
|
4287
|
+
* org-admin JWT): rename the slot and/or promote it to the org default
|
|
4288
|
+
* (atomic swap with the current default). `is_default: false` is refused —
|
|
4289
|
+
* promote another connection instead. Alias collision answers
|
|
4290
|
+
* `409 ALIAS_TAKEN`.
|
|
4291
|
+
*/
|
|
4292
|
+
export interface UpdateClipConnectionRequest {
|
|
4293
|
+
alias?: string | null;
|
|
4294
|
+
is_default?: true;
|
|
4295
|
+
}
|
|
4052
4296
|
/**
|
|
4053
4297
|
* A clip in the api-server org registry (`crg_…`, table `clip_registry`) — the
|
|
4054
4298
|
* v3 registry that publish, install, and clip connections operate on.
|