@parall/sdk 1.55.3 → 1.55.5
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/attachment-client.d.ts +14 -0
- package/dist/attachment-client.d.ts.map +1 -0
- package/dist/attachment-client.js +38 -0
- package/dist/attachment-endpoints.d.ts +7 -0
- package/dist/attachment-endpoints.d.ts.map +1 -0
- package/dist/attachment-endpoints.js +8 -0
- package/dist/attachment-types.d.ts +33 -0
- package/dist/attachment-types.d.ts.map +1 -0
- package/dist/attachment-types.js +1 -0
- package/dist/client.d.ts +60 -27
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +125 -41
- package/dist/constants.d.ts +74 -54
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +22 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/types.d.ts +383 -28
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -0
- package/dist/wechat-client.d.ts +15 -0
- package/dist/wechat-client.d.ts.map +1 -0
- package/dist/wechat-client.js +28 -0
- package/dist/wechat-types.d.ts +27 -0
- package/dist/wechat-types.d.ts.map +1 -0
- package/dist/wechat-types.js +1 -0
- package/package.json +1 -1
- package/src/attachment-client.ts +56 -0
- package/src/attachment-endpoints.ts +8 -0
- package/src/attachment-types.ts +36 -0
- package/src/client.ts +273 -61
- package/src/constants.ts +37 -3
- package/src/index.ts +2 -0
- package/src/types.ts +451 -30
- package/src/wechat-client.ts +35 -0
- package/src/wechat-types.ts +28 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CompletedUploadPart,
|
|
3
|
+
FileUrlResponse,
|
|
4
|
+
PresignResponse,
|
|
5
|
+
PresignUploadRequest,
|
|
6
|
+
} from './attachment-types.js';
|
|
7
|
+
import { ENDPOINTS } from './constants.js';
|
|
8
|
+
import { WechatClient } from './wechat-client.js';
|
|
9
|
+
|
|
10
|
+
const COMPLETION_RETRY_DELAYS_MS = [250, 750] as const;
|
|
11
|
+
|
|
12
|
+
function isRetryableCompletionError(error: unknown): boolean {
|
|
13
|
+
if (!error || typeof error !== 'object' || !('status' in error)) return false;
|
|
14
|
+
const status = (error as { status?: unknown }).status;
|
|
15
|
+
return status === 0 || (typeof status === 'number' && status >= 500);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Attachment upload lifecycle and download URL methods. */
|
|
19
|
+
export abstract class AttachmentClient extends WechatClient {
|
|
20
|
+
async getUploadPresignUrl(orgId: string, req: PresignUploadRequest): Promise<PresignResponse> {
|
|
21
|
+
return this.request('POST', ENDPOINTS.UPLOAD_PRESIGN(orgId), req);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async completeUpload(
|
|
25
|
+
orgId: string,
|
|
26
|
+
attachmentId: string,
|
|
27
|
+
parts?: CompletedUploadPart[],
|
|
28
|
+
): Promise<{ attachment_id: string }> {
|
|
29
|
+
const body = {
|
|
30
|
+
attachment_id: attachmentId,
|
|
31
|
+
parts,
|
|
32
|
+
};
|
|
33
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
34
|
+
try {
|
|
35
|
+
return await this.request('POST', ENDPOINTS.UPLOAD_COMPLETE(orgId), body);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
const delay = COMPLETION_RETRY_DELAYS_MS[attempt];
|
|
38
|
+
if (delay === undefined || !isRetryableCompletionError(error)) throw error;
|
|
39
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async abortUpload(orgId: string, attachmentId: string): Promise<void> {
|
|
45
|
+
return this.request('POST', ENDPOINTS.UPLOAD_ABORT(orgId), { attachment_id: attachmentId });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async getFileUrl(id: string, opts?: { download?: boolean }): Promise<FileUrlResponse> {
|
|
49
|
+
return this.request(
|
|
50
|
+
'GET',
|
|
51
|
+
ENDPOINTS.FILE(id),
|
|
52
|
+
undefined,
|
|
53
|
+
opts?.download ? { download: true } : undefined,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function attachmentEndpoints(apiBase: string) {
|
|
2
|
+
return {
|
|
3
|
+
UPLOAD_PRESIGN: (orgId: string) => `${apiBase}/orgs/${orgId}/upload/presign`,
|
|
4
|
+
UPLOAD_COMPLETE: (orgId: string) => `${apiBase}/orgs/${orgId}/upload/complete`,
|
|
5
|
+
UPLOAD_ABORT: (orgId: string) => `${apiBase}/orgs/${orgId}/upload/abort`,
|
|
6
|
+
FILE: (id: string) => `${apiBase}/files/${id}`,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface PresignResponse {
|
|
2
|
+
upload_url?: string;
|
|
3
|
+
upload_type?: 'single' | 'multipart';
|
|
4
|
+
part_size?: number;
|
|
5
|
+
parts?: PresignedUploadPart[];
|
|
6
|
+
attachment_id: string;
|
|
7
|
+
expires_in: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface PresignedUploadPart {
|
|
11
|
+
part_number: number;
|
|
12
|
+
upload_url: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CompletedUploadPart {
|
|
16
|
+
part_number: number;
|
|
17
|
+
etag: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface PresignUploadRequest {
|
|
21
|
+
file_name: string;
|
|
22
|
+
file_size: number;
|
|
23
|
+
mime_type?: string;
|
|
24
|
+
multipart_supported?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface FileUrlResponse {
|
|
28
|
+
url: string;
|
|
29
|
+
is_proxy_url?: boolean;
|
|
30
|
+
expires_in: number;
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
file_name: string;
|
|
34
|
+
file_size: number;
|
|
35
|
+
mime_type: string;
|
|
36
|
+
}
|
package/src/client.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BrowserViewerRequestOptions, browserViewerRequestOptions } from './browser-viewer.js';
|
|
2
2
|
import { API_BASE, ENDPOINTS, WIKI_BASE } from './constants.js';
|
|
3
|
-
import {
|
|
3
|
+
import { AttachmentClient } from './attachment-client.js';
|
|
4
4
|
import type {
|
|
5
5
|
AddTeamMemberRequest,
|
|
6
6
|
AgentClip,
|
|
@@ -30,6 +30,17 @@ import type {
|
|
|
30
30
|
BrowserProfileLifecycleRequest,
|
|
31
31
|
BrowserProfileListItem,
|
|
32
32
|
BrowserProfileStatus,
|
|
33
|
+
BrowserAlias,
|
|
34
|
+
BrowserAliasCreateRequest,
|
|
35
|
+
BrowserAliasDeleteProof,
|
|
36
|
+
BrowserAliasDeleteRequest,
|
|
37
|
+
BrowserAliasRenameRequest,
|
|
38
|
+
BrowserAliasReadinessCheckReceipt,
|
|
39
|
+
BrowserAliasReadinessCheckRequest,
|
|
40
|
+
BrowserAliasExecutionRequest,
|
|
41
|
+
BrowserAliasExecutionReceipt,
|
|
42
|
+
BrowserAliasGrantReplaceRequest,
|
|
43
|
+
BrowserAliasGrantSet,
|
|
33
44
|
BrowserRuntimeStatus,
|
|
34
45
|
BrowserViewerCommandRequest,
|
|
35
46
|
BrowserViewerCommandResponse,
|
|
@@ -63,6 +74,8 @@ import type {
|
|
|
63
74
|
CompleteRuntimeAuthSessionRequest,
|
|
64
75
|
ComputePricing,
|
|
65
76
|
ComputePricingResponse,
|
|
77
|
+
ManagedBrowserAliasInfo,
|
|
78
|
+
ManagedBrowserAliasSummary,
|
|
66
79
|
CopyWikiFileRequest,
|
|
67
80
|
CopyWikiFileResponse,
|
|
68
81
|
CreateAgentRequest,
|
|
@@ -105,6 +118,9 @@ import type {
|
|
|
105
118
|
EdgeOnboardingStatus,
|
|
106
119
|
EdgePlacement,
|
|
107
120
|
EdgeProfileProxyStatus,
|
|
121
|
+
EdgeProfileOperationConfirmRequest,
|
|
122
|
+
EdgeProfileOperationReceipt,
|
|
123
|
+
EdgeProfileOperationRequest,
|
|
108
124
|
EdgeViewerCommandRequest,
|
|
109
125
|
EdgeViewerCommandResponse,
|
|
110
126
|
ExecEdgeClipRequest,
|
|
@@ -119,7 +135,6 @@ import type {
|
|
|
119
135
|
ExternalTriggerSchema,
|
|
120
136
|
FeatureFlagsResponse,
|
|
121
137
|
FilesystemEntry,
|
|
122
|
-
FileUrlResponse,
|
|
123
138
|
GrantBrowserProfileConsentRequest,
|
|
124
139
|
InboxItem,
|
|
125
140
|
InboxUnreadCountResponse,
|
|
@@ -161,8 +176,6 @@ import type {
|
|
|
161
176
|
PaginatedResponse,
|
|
162
177
|
PlatformConfigResponse,
|
|
163
178
|
PlatformModelsResponse,
|
|
164
|
-
PresignResponse,
|
|
165
|
-
PresignUploadRequest,
|
|
166
179
|
PublishRegistryClipRequest,
|
|
167
180
|
PushSubscribeRequest,
|
|
168
181
|
ReactionSummary,
|
|
@@ -233,10 +246,9 @@ import type {
|
|
|
233
246
|
UpdateTeamRequest,
|
|
234
247
|
UpdateWikiChangesetRequest,
|
|
235
248
|
User,
|
|
236
|
-
WechatContactsPage,
|
|
237
|
-
WechatProfileView,
|
|
238
|
-
WechatStatusView,
|
|
239
249
|
Wiki,
|
|
250
|
+
WikiAccessPolicy,
|
|
251
|
+
WikiAccessPolicyMember,
|
|
240
252
|
WikiAccessStatus,
|
|
241
253
|
WikiAnchorResolveRequest,
|
|
242
254
|
WikiAnchorResolveResponse,
|
|
@@ -282,7 +294,7 @@ export interface ParallClientOptions {
|
|
|
282
294
|
getFeatureFlagOverrides?: () => string | null | undefined;
|
|
283
295
|
}
|
|
284
296
|
|
|
285
|
-
export class ParallClient extends
|
|
297
|
+
export class ParallClient extends AttachmentClient {
|
|
286
298
|
private baseUrl: string;
|
|
287
299
|
private wikiBaseUrl: string;
|
|
288
300
|
private token: string | null;
|
|
@@ -1254,25 +1266,6 @@ export class ParallClient extends TaskLabelClient {
|
|
|
1254
1266
|
return res.reactions;
|
|
1255
1267
|
}
|
|
1256
1268
|
|
|
1257
|
-
// ---- File Upload ----
|
|
1258
|
-
|
|
1259
|
-
async getUploadPresignUrl(orgId: string, req: PresignUploadRequest): Promise<PresignResponse> {
|
|
1260
|
-
return this.request('POST', ENDPOINTS.UPLOAD_PRESIGN(orgId), req);
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
async completeUpload(orgId: string, attachmentId: string): Promise<{ attachment_id: string }> {
|
|
1264
|
-
return this.request('POST', ENDPOINTS.UPLOAD_COMPLETE(orgId), { attachment_id: attachmentId });
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
async getFileUrl(id: string, opts?: { download?: boolean }): Promise<FileUrlResponse> {
|
|
1268
|
-
return this.request(
|
|
1269
|
-
'GET',
|
|
1270
|
-
ENDPOINTS.FILE(id),
|
|
1271
|
-
undefined,
|
|
1272
|
-
opts?.download ? { download: true } : undefined,
|
|
1273
|
-
);
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
1269
|
// ---- Approvals ----
|
|
1277
1270
|
|
|
1278
1271
|
async getApproval(id: string): Promise<Approval> {
|
|
@@ -1283,8 +1276,22 @@ export class ParallClient extends TaskLabelClient {
|
|
|
1283
1276
|
return this.request('POST', ENDPOINTS.APPROVAL_REQUESTS(orgId), req);
|
|
1284
1277
|
}
|
|
1285
1278
|
|
|
1286
|
-
async decideApproval(
|
|
1287
|
-
|
|
1279
|
+
async decideApproval(
|
|
1280
|
+
id: string,
|
|
1281
|
+
decision: 'approve' | 'reject',
|
|
1282
|
+
reason?: string,
|
|
1283
|
+
): Promise<Approval> {
|
|
1284
|
+
if (decision === 'approve' && reason?.trim()) {
|
|
1285
|
+
throw new ApiError(
|
|
1286
|
+
400,
|
|
1287
|
+
'Approval reason is only allowed for rejection decisions',
|
|
1288
|
+
'INVALID_DECISION_REASON',
|
|
1289
|
+
);
|
|
1290
|
+
}
|
|
1291
|
+
return this.request('POST', ENDPOINTS.APPROVAL_DECIDE(id), {
|
|
1292
|
+
decision,
|
|
1293
|
+
...(decision === 'reject' && reason !== undefined ? { reason } : {}),
|
|
1294
|
+
});
|
|
1288
1295
|
}
|
|
1289
1296
|
|
|
1290
1297
|
async cancelApproval(id: string): Promise<void> {
|
|
@@ -2541,31 +2548,6 @@ export class ParallClient extends TaskLabelClient {
|
|
|
2541
2548
|
await this.request('POST', ENDPOINTS.SLACK_STATUS(orgId), input);
|
|
2542
2549
|
}
|
|
2543
2550
|
|
|
2544
|
-
/**
|
|
2545
|
-
* WeChat tier-B read verb (agent-only; internal research preview): the
|
|
2546
|
-
* account's address book — friends/chatrooms enriched with display names,
|
|
2547
|
-
* followed official accounts. Same live gate as the send verb.
|
|
2548
|
-
*/
|
|
2549
|
-
async listWechatContacts(orgId: string): Promise<WechatContactsPage> {
|
|
2550
|
-
return this.request('GET', ENDPOINTS.WECHAT_CONTACTS(orgId));
|
|
2551
|
-
}
|
|
2552
|
-
|
|
2553
|
-
/**
|
|
2554
|
-
* WeChat tier-B read verb (agent-only): the connected account's identity
|
|
2555
|
-
* (wxid / alias / nickName / app id).
|
|
2556
|
-
*/
|
|
2557
|
-
async wechatProfile(orgId: string): Promise<WechatProfileView> {
|
|
2558
|
-
return this.request('GET', ENDPOINTS.WECHAT_PROFILE(orgId));
|
|
2559
|
-
}
|
|
2560
|
-
|
|
2561
|
-
/**
|
|
2562
|
-
* WeChat tier-B read verb (agent-only): live online probe + identity +
|
|
2563
|
-
* the platform's offline record.
|
|
2564
|
-
*/
|
|
2565
|
-
async wechatStatus(orgId: string): Promise<WechatStatusView> {
|
|
2566
|
-
return this.request('GET', ENDPOINTS.WECHAT_STATUS(orgId));
|
|
2567
|
-
}
|
|
2568
|
-
|
|
2569
2551
|
async listChannelConversations(
|
|
2570
2552
|
orgId: string,
|
|
2571
2553
|
connectionId: string,
|
|
@@ -2719,7 +2701,7 @@ export class ParallClient extends TaskLabelClient {
|
|
|
2719
2701
|
async getWikiTree(
|
|
2720
2702
|
orgId: string,
|
|
2721
2703
|
wikiId: string,
|
|
2722
|
-
params?: { ref?: string; path?: string },
|
|
2704
|
+
params?: { ref?: string; path?: string; last_commit?: boolean },
|
|
2723
2705
|
): Promise<WikiTreeResponse> {
|
|
2724
2706
|
return this.request('GET', ENDPOINTS.WIKI_TREE(orgId, wikiId), undefined, params);
|
|
2725
2707
|
}
|
|
@@ -2862,6 +2844,23 @@ export class ParallClient extends TaskLabelClient {
|
|
|
2862
2844
|
return res.data.map(normalizeWikiChangeset);
|
|
2863
2845
|
}
|
|
2864
2846
|
|
|
2847
|
+
/** Org-wide changeset listing across every wiki the caller can read.
|
|
2848
|
+
* Server default (no `status`) is the pending set: proposed,
|
|
2849
|
+
* approval_pending, approved. */
|
|
2850
|
+
async getOrgWikiChangesets(
|
|
2851
|
+
orgId: string,
|
|
2852
|
+
opts?: { status?: WikiChangeset['status'][] },
|
|
2853
|
+
): Promise<WikiChangeset[]> {
|
|
2854
|
+
const params = new URLSearchParams();
|
|
2855
|
+
for (const s of opts?.status ?? []) params.append('status', s);
|
|
2856
|
+
const qs = params.toString();
|
|
2857
|
+
const res = await this.request<{ data: WikiChangeset[] | null }>(
|
|
2858
|
+
'GET',
|
|
2859
|
+
`${ENDPOINTS.WIKI_ORG_CHANGESETS(orgId)}${qs ? `?${qs}` : ''}`,
|
|
2860
|
+
);
|
|
2861
|
+
return (res.data ?? []).map(normalizeWikiChangeset);
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2865
2864
|
async getWikiChangeset(
|
|
2866
2865
|
orgId: string,
|
|
2867
2866
|
wikiId: string,
|
|
@@ -3047,6 +3046,59 @@ export class ParallClient extends TaskLabelClient {
|
|
|
3047
3046
|
);
|
|
3048
3047
|
}
|
|
3049
3048
|
|
|
3049
|
+
// ---- Wiki membership projection (who-can-access, invites, join/leave) ----
|
|
3050
|
+
|
|
3051
|
+
async getWikiAccessPolicy(orgId: string, wikiId: string, path = ''): Promise<WikiAccessPolicy> {
|
|
3052
|
+
return this.request(
|
|
3053
|
+
'GET',
|
|
3054
|
+
ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId),
|
|
3055
|
+
undefined,
|
|
3056
|
+
path ? { path } : undefined,
|
|
3057
|
+
);
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
async putWikiAccessPolicy(
|
|
3061
|
+
orgId: string,
|
|
3062
|
+
wikiId: string,
|
|
3063
|
+
policy: WikiAccessPolicy,
|
|
3064
|
+
): Promise<WikiAccessPolicy> {
|
|
3065
|
+
return this.request('PUT', ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), policy);
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3068
|
+
/** Add-only invite (viewer/editor); allowed for managers, and for editors
|
|
3069
|
+
* when the library enables editors_can_invite. */
|
|
3070
|
+
async addWikiMember(
|
|
3071
|
+
orgId: string,
|
|
3072
|
+
wikiId: string,
|
|
3073
|
+
subject: string,
|
|
3074
|
+
role?: 'viewer' | 'editor',
|
|
3075
|
+
): Promise<void> {
|
|
3076
|
+
await this.request('POST', ENDPOINTS.WIKI_ACCESS_POLICY_MEMBERS(orgId, wikiId), {
|
|
3077
|
+
subject,
|
|
3078
|
+
role,
|
|
3079
|
+
});
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
/** Join a PUBLIC library as an explicit member (lands at the library's
|
|
3083
|
+
* default role). Restricted libraries answer 409 JOIN_REQUIRES_REQUEST —
|
|
3084
|
+
* go through createWikiAccessRequest instead. */
|
|
3085
|
+
async joinWiki(orgId: string, wikiId: string): Promise<void> {
|
|
3086
|
+
await this.request('POST', ENDPOINTS.WIKI_MEMBERSHIP_SELF(orgId, wikiId));
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
/** Remove the caller's explicit membership (team-granted membership stays). */
|
|
3090
|
+
async leaveWiki(orgId: string, wikiId: string): Promise<void> {
|
|
3091
|
+
await this.request('DELETE', ENDPOINTS.WIKI_MEMBERSHIP_SELF(orgId, wikiId));
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3094
|
+
async getWikiMembers(orgId: string, wikiId: string): Promise<WikiAccessPolicyMember[]> {
|
|
3095
|
+
const res = await this.request<{ data: WikiAccessPolicyMember[] | null }>(
|
|
3096
|
+
'GET',
|
|
3097
|
+
ENDPOINTS.WIKI_MEMBERS(orgId, wikiId),
|
|
3098
|
+
);
|
|
3099
|
+
return res.data ?? [];
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3050
3102
|
async createWikiAccessRequest(
|
|
3051
3103
|
orgId: string,
|
|
3052
3104
|
wikiId: string,
|
|
@@ -3162,13 +3214,13 @@ export class ParallClient extends TaskLabelClient {
|
|
|
3162
3214
|
async resolveRefs(
|
|
3163
3215
|
orgId: string,
|
|
3164
3216
|
refs: string[],
|
|
3165
|
-
options?: { sourceMessageId?: string },
|
|
3217
|
+
options?: { sourceMessageId?: string; full?: boolean },
|
|
3166
3218
|
): Promise<ResolveRefsResponse> {
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3219
|
+
return this.request('POST', ENDPOINTS.REFS_RESOLVE(orgId), {
|
|
3220
|
+
refs,
|
|
3221
|
+
source_message_id: options?.sourceMessageId,
|
|
3222
|
+
full: options?.full || undefined,
|
|
3223
|
+
});
|
|
3172
3224
|
}
|
|
3173
3225
|
|
|
3174
3226
|
async getBacklinks(
|
|
@@ -3778,6 +3830,166 @@ export class ParallClient extends TaskLabelClient {
|
|
|
3778
3830
|
return this.request('GET', ENDPOINTS.ORG_EDGE_PROFILES(orgId, edgeId));
|
|
3779
3831
|
}
|
|
3780
3832
|
|
|
3833
|
+
/** Start one durable Local BYOC Profile operation. Network-unknown callers
|
|
3834
|
+
* must retry with the same key or recover by operation id; a different body
|
|
3835
|
+
* under the same key is rejected. */
|
|
3836
|
+
async createEdgeProfileOperation(
|
|
3837
|
+
orgId: string,
|
|
3838
|
+
edgeId: string,
|
|
3839
|
+
request: EdgeProfileOperationRequest,
|
|
3840
|
+
idempotencyKey: string,
|
|
3841
|
+
): Promise<EdgeProfileOperationReceipt> {
|
|
3842
|
+
return this.request(
|
|
3843
|
+
'POST',
|
|
3844
|
+
ENDPOINTS.ORG_EDGE_PROFILE_OPERATIONS(orgId, edgeId),
|
|
3845
|
+
request,
|
|
3846
|
+
undefined,
|
|
3847
|
+
false,
|
|
3848
|
+
{ headers: { 'Idempotency-Key': idempotencyKey } },
|
|
3849
|
+
);
|
|
3850
|
+
}
|
|
3851
|
+
|
|
3852
|
+
/** Strong-confirm the exact durable Delete impact. A changed impact returns
|
|
3853
|
+
* PROFILE_DELETE_IMPACT_CHANGED with a replacement receipt in
|
|
3854
|
+
* `ApiError.extras.details.operation`. */
|
|
3855
|
+
async confirmEdgeProfileOperation(
|
|
3856
|
+
orgId: string,
|
|
3857
|
+
edgeId: string,
|
|
3858
|
+
operationId: string,
|
|
3859
|
+
request: EdgeProfileOperationConfirmRequest,
|
|
3860
|
+
): Promise<EdgeProfileOperationReceipt> {
|
|
3861
|
+
return this.request(
|
|
3862
|
+
'POST',
|
|
3863
|
+
ENDPOINTS.ORG_EDGE_PROFILE_OPERATION_CONFIRM(orgId, edgeId, operationId),
|
|
3864
|
+
request,
|
|
3865
|
+
);
|
|
3866
|
+
}
|
|
3867
|
+
|
|
3868
|
+
/** Sole read/recovery surface. The server may reconcile an already durable
|
|
3869
|
+
* dispatch/finalization while returning this receipt. */
|
|
3870
|
+
async getEdgeProfileOperation(
|
|
3871
|
+
orgId: string,
|
|
3872
|
+
edgeId: string,
|
|
3873
|
+
operationId: string,
|
|
3874
|
+
): Promise<EdgeProfileOperationReceipt> {
|
|
3875
|
+
return this.request('GET', ENDPOINTS.ORG_EDGE_PROFILE_OPERATION(orgId, edgeId, operationId));
|
|
3876
|
+
}
|
|
3877
|
+
|
|
3878
|
+
/** Create and atomically materialize one Local BYOC Browser Alias. A replay
|
|
3879
|
+
* with the same idempotency key and body returns the original stable ccn_. */
|
|
3880
|
+
async createBrowserAlias(
|
|
3881
|
+
orgId: string,
|
|
3882
|
+
request: BrowserAliasCreateRequest,
|
|
3883
|
+
): Promise<BrowserAlias> {
|
|
3884
|
+
return this.request('POST', ENDPOINTS.ORG_BROWSER_ALIASES(orgId), request);
|
|
3885
|
+
}
|
|
3886
|
+
|
|
3887
|
+
async listBrowserAliases(orgId: string): Promise<BrowserAlias[]> {
|
|
3888
|
+
return this.request('GET', ENDPOINTS.ORG_BROWSER_ALIASES(orgId));
|
|
3889
|
+
}
|
|
3890
|
+
|
|
3891
|
+
async getBrowserAlias(orgId: string, aliasId: string): Promise<BrowserAlias> {
|
|
3892
|
+
return this.request('GET', ENDPOINTS.ORG_BROWSER_ALIAS(orgId, aliasId));
|
|
3893
|
+
}
|
|
3894
|
+
|
|
3895
|
+
async renameBrowserAlias(
|
|
3896
|
+
orgId: string,
|
|
3897
|
+
aliasId: string,
|
|
3898
|
+
request: BrowserAliasRenameRequest,
|
|
3899
|
+
): Promise<BrowserAlias> {
|
|
3900
|
+
return this.request('PATCH', ENDPOINTS.ORG_BROWSER_ALIAS(orgId, aliasId), request);
|
|
3901
|
+
}
|
|
3902
|
+
|
|
3903
|
+
async deleteBrowserAlias(
|
|
3904
|
+
orgId: string,
|
|
3905
|
+
aliasId: string,
|
|
3906
|
+
request: BrowserAliasDeleteRequest,
|
|
3907
|
+
): Promise<BrowserAliasDeleteProof> {
|
|
3908
|
+
return this.request('DELETE', ENDPOINTS.ORG_BROWSER_ALIAS(orgId, aliasId), request);
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
/** Start one durable readiness check. The key is carried as the standard
|
|
3912
|
+
* Idempotency-Key header; the request body is intentionally empty. */
|
|
3913
|
+
async createBrowserAliasReadinessCheck(
|
|
3914
|
+
orgId: string,
|
|
3915
|
+
aliasId: string,
|
|
3916
|
+
request: BrowserAliasReadinessCheckRequest,
|
|
3917
|
+
): Promise<BrowserAliasReadinessCheckReceipt> {
|
|
3918
|
+
return this.request(
|
|
3919
|
+
'POST',
|
|
3920
|
+
ENDPOINTS.ORG_BROWSER_ALIAS_READINESS_CHECKS(orgId, aliasId),
|
|
3921
|
+
undefined,
|
|
3922
|
+
undefined,
|
|
3923
|
+
false,
|
|
3924
|
+
{ headers: { 'Idempotency-Key': request.idempotency_key } },
|
|
3925
|
+
);
|
|
3926
|
+
}
|
|
3927
|
+
|
|
3928
|
+
/** Sole durable recovery surface for one readiness request. */
|
|
3929
|
+
async getBrowserAliasReadinessCheck(
|
|
3930
|
+
orgId: string,
|
|
3931
|
+
aliasId: string,
|
|
3932
|
+
checkId: string,
|
|
3933
|
+
): Promise<BrowserAliasReadinessCheckReceipt> {
|
|
3934
|
+
return this.request(
|
|
3935
|
+
'GET',
|
|
3936
|
+
ENDPOINTS.ORG_BROWSER_ALIAS_READINESS_CHECK(orgId, aliasId, checkId),
|
|
3937
|
+
);
|
|
3938
|
+
}
|
|
3939
|
+
|
|
3940
|
+
/** Organization Owner view. Hashes, reviewed snapshots and deltas are
|
|
3941
|
+
* intentionally available only on this human-JWT management surface. */
|
|
3942
|
+
async listBrowserAliasGrants(orgId: string, keyId: string): Promise<BrowserAliasGrantSet[]> {
|
|
3943
|
+
return this.request('GET', ENDPOINTS.ORG_API_KEY_BROWSER_ALIAS_GRANTS(orgId, keyId));
|
|
3944
|
+
}
|
|
3945
|
+
|
|
3946
|
+
async getBrowserAliasGrant(
|
|
3947
|
+
orgId: string,
|
|
3948
|
+
keyId: string,
|
|
3949
|
+
aliasId: string,
|
|
3950
|
+
): Promise<BrowserAliasGrantSet> {
|
|
3951
|
+
return this.request('GET', ENDPOINTS.ORG_API_KEY_BROWSER_ALIAS_GRANT(orgId, keyId, aliasId));
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3954
|
+
async replaceBrowserAliasGrant(
|
|
3955
|
+
orgId: string,
|
|
3956
|
+
keyId: string,
|
|
3957
|
+
aliasId: string,
|
|
3958
|
+
request: BrowserAliasGrantReplaceRequest,
|
|
3959
|
+
): Promise<BrowserAliasGrantSet> {
|
|
3960
|
+
return this.request(
|
|
3961
|
+
'PUT',
|
|
3962
|
+
ENDPOINTS.ORG_API_KEY_BROWSER_ALIAS_GRANT(orgId, keyId, aliasId),
|
|
3963
|
+
request,
|
|
3964
|
+
);
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
/** Managed-key discovery. The response is already grant-filtered and never
|
|
3968
|
+
* carries contract hashes, review snapshots, Edge IDs or Profile IDs. */
|
|
3969
|
+
async listManagedBrowserAliases(orgId: string): Promise<ManagedBrowserAliasSummary[]> {
|
|
3970
|
+
return this.request('GET', ENDPOINTS.ORG_MANAGED_ALIASES(orgId));
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3973
|
+
async getManagedBrowserAlias(orgId: string, aliasName: string): Promise<ManagedBrowserAliasInfo> {
|
|
3974
|
+
return this.request('GET', ENDPOINTS.ORG_MANAGED_ALIAS(orgId, aliasName));
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3977
|
+
/** Accept and dispatch one @alias command. request_id is generated by the
|
|
3978
|
+
* caller before local validation and is also the sole durable recovery key. */
|
|
3979
|
+
async createBrowserAliasExecution(
|
|
3980
|
+
orgId: string,
|
|
3981
|
+
request: BrowserAliasExecutionRequest,
|
|
3982
|
+
): Promise<BrowserAliasExecutionReceipt> {
|
|
3983
|
+
return this.request('POST', ENDPOINTS.ORG_BROWSER_ALIAS_EXECUTIONS(orgId), request);
|
|
3984
|
+
}
|
|
3985
|
+
|
|
3986
|
+
async getBrowserAliasExecution(
|
|
3987
|
+
orgId: string,
|
|
3988
|
+
requestId: string,
|
|
3989
|
+
): Promise<BrowserAliasExecutionReceipt> {
|
|
3990
|
+
return this.request('GET', ENDPOINTS.ORG_BROWSER_ALIAS_EXECUTION(orgId, requestId));
|
|
3991
|
+
}
|
|
3992
|
+
|
|
3781
3993
|
/**
|
|
3782
3994
|
* Read a hosted Cloud Profile's egress-proxy status (manager-only: hosted
|
|
3783
3995
|
* human maintainer or org admin). Sanitized — the password never comes back.
|
package/src/constants.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { attachmentEndpoints } from './attachment-endpoints.js';
|
|
2
|
+
|
|
1
3
|
// API base path
|
|
2
4
|
export const API_BASE = '/api/v1';
|
|
3
5
|
|
|
@@ -432,9 +434,7 @@ export const ENDPOINTS = {
|
|
|
432
434
|
`${API_BASE}/messages/${id}/reactions/${encodeURIComponent(emoji)}`,
|
|
433
435
|
|
|
434
436
|
// Upload (org-scoped)
|
|
435
|
-
|
|
436
|
-
UPLOAD_COMPLETE: (orgId: string) => `${API_BASE}/orgs/${orgId}/upload/complete`,
|
|
437
|
-
FILE: (id: string) => `${API_BASE}/files/${id}`,
|
|
437
|
+
...attachmentEndpoints(API_BASE),
|
|
438
438
|
|
|
439
439
|
// Approval requests (org-scoped)
|
|
440
440
|
APPROVAL_REQUESTS: (orgId: string) => `${API_BASE}/orgs/${orgId}/approval-requests`,
|
|
@@ -686,6 +686,7 @@ export const ENDPOINTS = {
|
|
|
686
686
|
SLACK_STATUS: (orgId: string) => `${API_BASE}/orgs/${orgId}/agents/me/slack/status`,
|
|
687
687
|
// WeChat tier-B read verbs (agent-only; internal research preview).
|
|
688
688
|
WECHAT_CONTACTS: (orgId: string) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/contacts`,
|
|
689
|
+
WECHAT_HISTORY: (orgId: string) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/history`,
|
|
689
690
|
WECHAT_PROFILE: (orgId: string) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/profile`,
|
|
690
691
|
WECHAT_STATUS: (orgId: string) => `${API_BASE}/orgs/${orgId}/agents/me/wechat/status`,
|
|
691
692
|
|
|
@@ -717,6 +718,8 @@ export const ENDPOINTS = {
|
|
|
717
718
|
// backend router so `deleted` isn't captured as a {wikiId}; the SDK builder
|
|
718
719
|
// is just a string.
|
|
719
720
|
WIKIS_DELETED: (orgId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/deleted`,
|
|
721
|
+
// Org-wide changeset listing across readable wikis (Working on tab).
|
|
722
|
+
WIKI_ORG_CHANGESETS: (orgId: string) => `${WIKI_BASE}/orgs/${orgId}/wiki-changesets`,
|
|
720
723
|
// Detail URL — also reused for DELETE (soft-delete) and `${WIKI}/restore`.
|
|
721
724
|
WIKI: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}`,
|
|
722
725
|
WIKI_RESTORE: (orgId: string, wikiId: string) =>
|
|
@@ -767,6 +770,14 @@ export const ENDPOINTS = {
|
|
|
767
770
|
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/restrictions`,
|
|
768
771
|
WIKI_RESTRICTION: (orgId: string, wikiId: string, restrictionId: string) =>
|
|
769
772
|
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/restrictions/${restrictionId}`,
|
|
773
|
+
WIKI_ACCESS_POLICY: (orgId: string, wikiId: string) =>
|
|
774
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/access-policy`,
|
|
775
|
+
WIKI_ACCESS_POLICY_MEMBERS: (orgId: string, wikiId: string) =>
|
|
776
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/access-policy/members`,
|
|
777
|
+
WIKI_MEMBERSHIP_SELF: (orgId: string, wikiId: string) =>
|
|
778
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/membership/self`,
|
|
779
|
+
WIKI_MEMBERS: (orgId: string, wikiId: string) =>
|
|
780
|
+
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/members`,
|
|
770
781
|
WIKI_ACCESS_STATUS: (orgId: string, wikiId: string) =>
|
|
771
782
|
`${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/access-status`,
|
|
772
783
|
WIKI_ACCESS_REQUESTS: (orgId: string, wikiId: string) =>
|
|
@@ -938,6 +949,29 @@ export const ENDPOINTS = {
|
|
|
938
949
|
ORG_EDGE_ONBOARDING: (orgId: string) => `/api/v1/orgs/${orgId}/edge/onboarding`,
|
|
939
950
|
ORG_EDGE_PROFILES: (orgId: string, edgeId: string) =>
|
|
940
951
|
`/api/v1/orgs/${orgId}/edge/${edgeId}/profiles`,
|
|
952
|
+
ORG_EDGE_PROFILE_OPERATIONS: (orgId: string, edgeId: string) =>
|
|
953
|
+
`/api/v1/orgs/${orgId}/edge/${edgeId}/profile-operations`,
|
|
954
|
+
ORG_EDGE_PROFILE_OPERATION: (orgId: string, edgeId: string, operationId: string) =>
|
|
955
|
+
`/api/v1/orgs/${orgId}/edge/${edgeId}/profile-operations/${operationId}`,
|
|
956
|
+
ORG_EDGE_PROFILE_OPERATION_CONFIRM: (orgId: string, edgeId: string, operationId: string) =>
|
|
957
|
+
`/api/v1/orgs/${orgId}/edge/${edgeId}/profile-operations/${operationId}/confirm`,
|
|
958
|
+
ORG_BROWSER_ALIASES: (orgId: string) => `/api/v1/orgs/${orgId}/browser-aliases`,
|
|
959
|
+
ORG_BROWSER_ALIAS: (orgId: string, aliasId: string) =>
|
|
960
|
+
`/api/v1/orgs/${orgId}/browser-aliases/${aliasId}`,
|
|
961
|
+
ORG_BROWSER_ALIAS_READINESS_CHECKS: (orgId: string, aliasId: string) =>
|
|
962
|
+
`/api/v1/orgs/${orgId}/browser-aliases/${aliasId}/readiness-checks`,
|
|
963
|
+
ORG_BROWSER_ALIAS_READINESS_CHECK: (orgId: string, aliasId: string, checkId: string) =>
|
|
964
|
+
`/api/v1/orgs/${orgId}/browser-aliases/${aliasId}/readiness-checks/${checkId}`,
|
|
965
|
+
ORG_API_KEY_BROWSER_ALIAS_GRANTS: (orgId: string, keyId: string) =>
|
|
966
|
+
`/api/v1/orgs/${orgId}/api-keys/${keyId}/browser-alias-grants`,
|
|
967
|
+
ORG_API_KEY_BROWSER_ALIAS_GRANT: (orgId: string, keyId: string, aliasId: string) =>
|
|
968
|
+
`/api/v1/orgs/${orgId}/api-keys/${keyId}/browser-alias-grants/${aliasId}`,
|
|
969
|
+
ORG_MANAGED_ALIASES: (orgId: string) => `/api/v1/orgs/${orgId}/aliases`,
|
|
970
|
+
ORG_MANAGED_ALIAS: (orgId: string, aliasName: string) =>
|
|
971
|
+
`/api/v1/orgs/${orgId}/aliases/${encodeURIComponent(aliasName)}`,
|
|
972
|
+
ORG_BROWSER_ALIAS_EXECUTIONS: (orgId: string) => `/api/v1/orgs/${orgId}/executions`,
|
|
973
|
+
ORG_BROWSER_ALIAS_EXECUTION: (orgId: string, requestId: string) =>
|
|
974
|
+
`/api/v1/orgs/${orgId}/executions/${encodeURIComponent(requestId)}`,
|
|
941
975
|
// Per-profile egress proxy (hosted Cloud Profiles; manager-only, human-only).
|
|
942
976
|
ORG_EDGE_PROFILE_PROXY: (orgId: string, edgeId: string, profileName: string) =>
|
|
943
977
|
`/api/v1/orgs/${orgId}/edge/${edgeId}/profiles/${encodeURIComponent(profileName)}/proxy`,
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './browser-viewer.js';
|
|
2
|
+
export * from './attachment-types.js';
|
|
2
3
|
export type { ParallClientOptions } from './client.js';
|
|
3
4
|
export { ApiError, ParallClient } from './client.js';
|
|
4
5
|
export * from './constants.js';
|
|
5
6
|
export * from './subject.js';
|
|
6
7
|
export * from './task-label-types.js';
|
|
7
8
|
export * from './types.js';
|
|
9
|
+
export * from './wechat-types.js';
|
|
8
10
|
export type {
|
|
9
11
|
ParallWsOptions,
|
|
10
12
|
WsClientEventMap,
|