@parall/sdk 1.55.4 → 1.56.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.
@@ -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 { WechatClient } from './wechat-client.js';
3
+ import { AttachmentClient } from './attachment-client.js';
4
4
  import type {
5
5
  AddTeamMemberRequest,
6
6
  AgentClip,
@@ -30,6 +30,19 @@ 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,
44
+ BrowserUseOperationRequest,
45
+ BrowserUseOperationReceipt,
33
46
  BrowserRuntimeStatus,
34
47
  BrowserViewerCommandRequest,
35
48
  BrowserViewerCommandResponse,
@@ -63,6 +76,8 @@ import type {
63
76
  CompleteRuntimeAuthSessionRequest,
64
77
  ComputePricing,
65
78
  ComputePricingResponse,
79
+ ManagedBrowserAliasInfo,
80
+ ManagedBrowserAliasSummary,
66
81
  CopyWikiFileRequest,
67
82
  CopyWikiFileResponse,
68
83
  CreateAgentRequest,
@@ -105,6 +120,9 @@ import type {
105
120
  EdgeOnboardingStatus,
106
121
  EdgePlacement,
107
122
  EdgeProfileProxyStatus,
123
+ EdgeProfileOperationConfirmRequest,
124
+ EdgeProfileOperationReceipt,
125
+ EdgeProfileOperationRequest,
108
126
  EdgeViewerCommandRequest,
109
127
  EdgeViewerCommandResponse,
110
128
  ExecEdgeClipRequest,
@@ -119,7 +137,6 @@ import type {
119
137
  ExternalTriggerSchema,
120
138
  FeatureFlagsResponse,
121
139
  FilesystemEntry,
122
- FileUrlResponse,
123
140
  GrantBrowserProfileConsentRequest,
124
141
  InboxItem,
125
142
  InboxUnreadCountResponse,
@@ -161,8 +178,6 @@ import type {
161
178
  PaginatedResponse,
162
179
  PlatformConfigResponse,
163
180
  PlatformModelsResponse,
164
- PresignResponse,
165
- PresignUploadRequest,
166
181
  PublishRegistryClipRequest,
167
182
  PushSubscribeRequest,
168
183
  ReactionSummary,
@@ -234,6 +249,8 @@ import type {
234
249
  UpdateWikiChangesetRequest,
235
250
  User,
236
251
  Wiki,
252
+ WikiAccessPolicy,
253
+ WikiAccessPolicyMember,
237
254
  WikiAccessStatus,
238
255
  WikiAnchorResolveRequest,
239
256
  WikiAnchorResolveResponse,
@@ -279,7 +296,7 @@ export interface ParallClientOptions {
279
296
  getFeatureFlagOverrides?: () => string | null | undefined;
280
297
  }
281
298
 
282
- export class ParallClient extends WechatClient {
299
+ export class ParallClient extends AttachmentClient {
283
300
  private baseUrl: string;
284
301
  private wikiBaseUrl: string;
285
302
  private token: string | null;
@@ -1251,25 +1268,6 @@ export class ParallClient extends WechatClient {
1251
1268
  return res.reactions;
1252
1269
  }
1253
1270
 
1254
- // ---- File Upload ----
1255
-
1256
- async getUploadPresignUrl(orgId: string, req: PresignUploadRequest): Promise<PresignResponse> {
1257
- return this.request('POST', ENDPOINTS.UPLOAD_PRESIGN(orgId), req);
1258
- }
1259
-
1260
- async completeUpload(orgId: string, attachmentId: string): Promise<{ attachment_id: string }> {
1261
- return this.request('POST', ENDPOINTS.UPLOAD_COMPLETE(orgId), { attachment_id: attachmentId });
1262
- }
1263
-
1264
- async getFileUrl(id: string, opts?: { download?: boolean }): Promise<FileUrlResponse> {
1265
- return this.request(
1266
- 'GET',
1267
- ENDPOINTS.FILE(id),
1268
- undefined,
1269
- opts?.download ? { download: true } : undefined,
1270
- );
1271
- }
1272
-
1273
1271
  // ---- Approvals ----
1274
1272
 
1275
1273
  async getApproval(id: string): Promise<Approval> {
@@ -1280,8 +1278,22 @@ export class ParallClient extends WechatClient {
1280
1278
  return this.request('POST', ENDPOINTS.APPROVAL_REQUESTS(orgId), req);
1281
1279
  }
1282
1280
 
1283
- async decideApproval(id: string, decision: 'approve' | 'reject'): Promise<Approval> {
1284
- return this.request('POST', ENDPOINTS.APPROVAL_DECIDE(id), { decision });
1281
+ async decideApproval(
1282
+ id: string,
1283
+ decision: 'approve' | 'reject',
1284
+ reason?: string,
1285
+ ): Promise<Approval> {
1286
+ if (decision === 'approve' && reason?.trim()) {
1287
+ throw new ApiError(
1288
+ 400,
1289
+ 'Approval reason is only allowed for rejection decisions',
1290
+ 'INVALID_DECISION_REASON',
1291
+ );
1292
+ }
1293
+ return this.request('POST', ENDPOINTS.APPROVAL_DECIDE(id), {
1294
+ decision,
1295
+ ...(decision === 'reject' && reason !== undefined ? { reason } : {}),
1296
+ });
1285
1297
  }
1286
1298
 
1287
1299
  async cancelApproval(id: string): Promise<void> {
@@ -2691,7 +2703,7 @@ export class ParallClient extends WechatClient {
2691
2703
  async getWikiTree(
2692
2704
  orgId: string,
2693
2705
  wikiId: string,
2694
- params?: { ref?: string; path?: string },
2706
+ params?: { ref?: string; path?: string; last_commit?: boolean },
2695
2707
  ): Promise<WikiTreeResponse> {
2696
2708
  return this.request('GET', ENDPOINTS.WIKI_TREE(orgId, wikiId), undefined, params);
2697
2709
  }
@@ -2834,6 +2846,23 @@ export class ParallClient extends WechatClient {
2834
2846
  return res.data.map(normalizeWikiChangeset);
2835
2847
  }
2836
2848
 
2849
+ /** Org-wide changeset listing across every wiki the caller can read.
2850
+ * Server default (no `status`) is the pending set: proposed,
2851
+ * approval_pending, approved. */
2852
+ async getOrgWikiChangesets(
2853
+ orgId: string,
2854
+ opts?: { status?: WikiChangeset['status'][] },
2855
+ ): Promise<WikiChangeset[]> {
2856
+ const params = new URLSearchParams();
2857
+ for (const s of opts?.status ?? []) params.append('status', s);
2858
+ const qs = params.toString();
2859
+ const res = await this.request<{ data: WikiChangeset[] | null }>(
2860
+ 'GET',
2861
+ `${ENDPOINTS.WIKI_ORG_CHANGESETS(orgId)}${qs ? `?${qs}` : ''}`,
2862
+ );
2863
+ return (res.data ?? []).map(normalizeWikiChangeset);
2864
+ }
2865
+
2837
2866
  async getWikiChangeset(
2838
2867
  orgId: string,
2839
2868
  wikiId: string,
@@ -3019,6 +3048,72 @@ export class ParallClient extends WechatClient {
3019
3048
  );
3020
3049
  }
3021
3050
 
3051
+ // ---- Wiki membership projection (who-can-access, invites, join/leave) ----
3052
+
3053
+ async getWikiAccessPolicy(orgId: string, wikiId: string, path = ''): Promise<WikiAccessPolicy> {
3054
+ return this.request(
3055
+ 'GET',
3056
+ ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId),
3057
+ undefined,
3058
+ path ? { path } : undefined,
3059
+ );
3060
+ }
3061
+
3062
+ async putWikiAccessPolicy(
3063
+ orgId: string,
3064
+ wikiId: string,
3065
+ policy: WikiAccessPolicy,
3066
+ ): Promise<WikiAccessPolicy> {
3067
+ return this.request('PUT', ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), policy);
3068
+ }
3069
+
3070
+ /** Add-only invite (viewer/editor); allowed for managers, and for editors
3071
+ * when the library enables editors_can_invite. */
3072
+ async addWikiMember(
3073
+ orgId: string,
3074
+ wikiId: string,
3075
+ subject: string,
3076
+ role?: 'viewer' | 'editor',
3077
+ ): Promise<void> {
3078
+ await this.request('POST', ENDPOINTS.WIKI_ACCESS_POLICY_MEMBERS(orgId, wikiId), {
3079
+ subject,
3080
+ role,
3081
+ });
3082
+ }
3083
+
3084
+ /** Join a PUBLIC library as an explicit member (lands at the library's
3085
+ * default role). Restricted libraries answer 409 JOIN_REQUIRES_REQUEST —
3086
+ * go through createWikiAccessRequest instead. */
3087
+ async joinWiki(orgId: string, wikiId: string): Promise<void> {
3088
+ await this.request('POST', ENDPOINTS.WIKI_MEMBERSHIP_SELF(orgId, wikiId));
3089
+ }
3090
+
3091
+ /** Remove the caller's explicit membership (team-granted membership stays). */
3092
+ async leaveWiki(orgId: string, wikiId: string): Promise<void> {
3093
+ await this.request('DELETE', ENDPOINTS.WIKI_MEMBERSHIP_SELF(orgId, wikiId));
3094
+ }
3095
+
3096
+ /** Star a library for the caller (sidebar Starred group). Idempotent —
3097
+ * re-starring is a 204 no-op. Requires read access; hidden private
3098
+ * libraries answer 404 like absent IDs. */
3099
+ async starWiki(orgId: string, wikiId: string): Promise<void> {
3100
+ await this.request('POST', ENDPOINTS.WIKI_STARS_SELF(orgId, wikiId));
3101
+ }
3102
+
3103
+ /** Remove the caller's star. Idempotent — unstarring a never-starred
3104
+ * library is a 204 no-op. */
3105
+ async unstarWiki(orgId: string, wikiId: string): Promise<void> {
3106
+ await this.request('DELETE', ENDPOINTS.WIKI_STARS_SELF(orgId, wikiId));
3107
+ }
3108
+
3109
+ async getWikiMembers(orgId: string, wikiId: string): Promise<WikiAccessPolicyMember[]> {
3110
+ const res = await this.request<{ data: WikiAccessPolicyMember[] | null }>(
3111
+ 'GET',
3112
+ ENDPOINTS.WIKI_MEMBERS(orgId, wikiId),
3113
+ );
3114
+ return res.data ?? [];
3115
+ }
3116
+
3022
3117
  async createWikiAccessRequest(
3023
3118
  orgId: string,
3024
3119
  wikiId: string,
@@ -3594,8 +3689,12 @@ export class ParallClient extends WechatClient {
3594
3689
  * connections operate on.
3595
3690
  */
3596
3691
  async listOrgRegistryClips(orgId: string): Promise<ClipRegistryEntry[]> {
3597
- // Server default page is 50 (max 100); one max-size page covers today's
3598
- // catalogs revisit with real pagination if registries outgrow it.
3692
+ // ONE page (server max 100), name-ordered a browse surface, not a
3693
+ // resolution surface. The catalog includes every public+approved clip
3694
+ // platform-wide, so "fetch it all" cannot scale; anything that needs a
3695
+ // SPECIFIC clip must point-query instead: `resolveRegistryClip` for an
3696
+ // exact <publisher org, name>, `getRegistryClip` for a `crg_` id, and
3697
+ // `searchOrgRegistryClips` for discovery.
3599
3698
  const resp = await this.request<ClipRegistryEntry[] | null>(
3600
3699
  'GET',
3601
3700
  `${ENDPOINTS.ORG_CLIP_REGISTRY(orgId)}?limit=100`,
@@ -3603,6 +3702,42 @@ export class ParallClient extends WechatClient {
3603
3702
  return resp ?? [];
3604
3703
  }
3605
3704
 
3705
+ /**
3706
+ * Resolve an exact `<publisher org, name>` reference to its registry entry —
3707
+ * the npm-style point read. Deliberately independent of catalog size: no
3708
+ * Search, no pagination, same read-visibility boundary as `getRegistryClip`
3709
+ * (cross-org requires public + approved). 404 `NOT_FOUND` when the publisher
3710
+ * org has no visible clip of that exact name.
3711
+ */
3712
+ async resolveRegistryClip(
3713
+ orgId: string,
3714
+ publisherOrgId: string,
3715
+ name: string,
3716
+ ): Promise<ClipRegistryEntry> {
3717
+ const params = new URLSearchParams({ org_id: publisherOrgId, name });
3718
+ return this.request('GET', `${ENDPOINTS.ORG_CLIP_REGISTRY_RESOLVE(orgId)}?${params}`);
3719
+ }
3720
+
3721
+ /**
3722
+ * Server-side fuzzy discovery over the visible registry (name/description
3723
+ * substring match), paginated. The discovery verb: rows carry the `crg_` id
3724
+ * that {@link installRegistryClip} takes.
3725
+ */
3726
+ async searchOrgRegistryClips(
3727
+ orgId: string,
3728
+ query: string,
3729
+ opts?: { limit?: number; offset?: number },
3730
+ ): Promise<ClipRegistryEntry[]> {
3731
+ const params = new URLSearchParams({ q: query });
3732
+ if (opts?.limit !== undefined) params.set('limit', String(opts.limit));
3733
+ if (opts?.offset !== undefined) params.set('offset', String(opts.offset));
3734
+ const resp = await this.request<ClipRegistryEntry[] | null>(
3735
+ 'GET',
3736
+ `${ENDPOINTS.ORG_CLIP_REGISTRY_SEARCH(orgId)}?${params}`,
3737
+ );
3738
+ return resp ?? [];
3739
+ }
3740
+
3606
3741
  /**
3607
3742
  * Install a registry clip into the org (a reference in `clip_installs`, not a
3608
3743
  * copy). Idempotent: installing an already-installed clip returns the same
@@ -3750,6 +3885,184 @@ export class ParallClient extends WechatClient {
3750
3885
  return this.request('GET', ENDPOINTS.ORG_EDGE_PROFILES(orgId, edgeId));
3751
3886
  }
3752
3887
 
3888
+ /** Start one durable Local BYOC Profile operation. Network-unknown callers
3889
+ * must retry with the same key or recover by operation id; a different body
3890
+ * under the same key is rejected. */
3891
+ async createEdgeProfileOperation(
3892
+ orgId: string,
3893
+ edgeId: string,
3894
+ request: EdgeProfileOperationRequest,
3895
+ idempotencyKey: string,
3896
+ ): Promise<EdgeProfileOperationReceipt> {
3897
+ return this.request(
3898
+ 'POST',
3899
+ ENDPOINTS.ORG_EDGE_PROFILE_OPERATIONS(orgId, edgeId),
3900
+ request,
3901
+ undefined,
3902
+ false,
3903
+ { headers: { 'Idempotency-Key': idempotencyKey } },
3904
+ );
3905
+ }
3906
+
3907
+ /** Strong-confirm the exact durable Delete impact. A changed impact returns
3908
+ * PROFILE_DELETE_IMPACT_CHANGED with a replacement receipt in
3909
+ * `ApiError.extras.details.operation`. */
3910
+ async confirmEdgeProfileOperation(
3911
+ orgId: string,
3912
+ edgeId: string,
3913
+ operationId: string,
3914
+ request: EdgeProfileOperationConfirmRequest,
3915
+ ): Promise<EdgeProfileOperationReceipt> {
3916
+ return this.request(
3917
+ 'POST',
3918
+ ENDPOINTS.ORG_EDGE_PROFILE_OPERATION_CONFIRM(orgId, edgeId, operationId),
3919
+ request,
3920
+ );
3921
+ }
3922
+
3923
+ /** Sole read/recovery surface. The server may reconcile an already durable
3924
+ * dispatch/finalization while returning this receipt. */
3925
+ async getEdgeProfileOperation(
3926
+ orgId: string,
3927
+ edgeId: string,
3928
+ operationId: string,
3929
+ ): Promise<EdgeProfileOperationReceipt> {
3930
+ return this.request('GET', ENDPOINTS.ORG_EDGE_PROFILE_OPERATION(orgId, edgeId, operationId));
3931
+ }
3932
+
3933
+ /** Create and atomically materialize one Local BYOC Browser Alias. A replay
3934
+ * with the same idempotency key and body returns the original stable ccn_. */
3935
+ async createBrowserAlias(
3936
+ orgId: string,
3937
+ request: BrowserAliasCreateRequest,
3938
+ ): Promise<BrowserAlias> {
3939
+ return this.request('POST', ENDPOINTS.ORG_BROWSER_ALIASES(orgId), request);
3940
+ }
3941
+
3942
+ async listBrowserAliases(orgId: string): Promise<BrowserAlias[]> {
3943
+ return this.request('GET', ENDPOINTS.ORG_BROWSER_ALIASES(orgId));
3944
+ }
3945
+
3946
+ async getBrowserAlias(orgId: string, aliasId: string): Promise<BrowserAlias> {
3947
+ return this.request('GET', ENDPOINTS.ORG_BROWSER_ALIAS(orgId, aliasId));
3948
+ }
3949
+
3950
+ async renameBrowserAlias(
3951
+ orgId: string,
3952
+ aliasId: string,
3953
+ request: BrowserAliasRenameRequest,
3954
+ ): Promise<BrowserAlias> {
3955
+ return this.request('PATCH', ENDPOINTS.ORG_BROWSER_ALIAS(orgId, aliasId), request);
3956
+ }
3957
+
3958
+ async deleteBrowserAlias(
3959
+ orgId: string,
3960
+ aliasId: string,
3961
+ request: BrowserAliasDeleteRequest,
3962
+ ): Promise<BrowserAliasDeleteProof> {
3963
+ return this.request('DELETE', ENDPOINTS.ORG_BROWSER_ALIAS(orgId, aliasId), request);
3964
+ }
3965
+
3966
+ /** Start one durable readiness check. The key is carried as the standard
3967
+ * Idempotency-Key header; the request body is intentionally empty. */
3968
+ async createBrowserAliasReadinessCheck(
3969
+ orgId: string,
3970
+ aliasId: string,
3971
+ request: BrowserAliasReadinessCheckRequest,
3972
+ ): Promise<BrowserAliasReadinessCheckReceipt> {
3973
+ return this.request(
3974
+ 'POST',
3975
+ ENDPOINTS.ORG_BROWSER_ALIAS_READINESS_CHECKS(orgId, aliasId),
3976
+ undefined,
3977
+ undefined,
3978
+ false,
3979
+ { headers: { 'Idempotency-Key': request.idempotency_key } },
3980
+ );
3981
+ }
3982
+
3983
+ /** Sole durable recovery surface for one readiness request. */
3984
+ async getBrowserAliasReadinessCheck(
3985
+ orgId: string,
3986
+ aliasId: string,
3987
+ checkId: string,
3988
+ ): Promise<BrowserAliasReadinessCheckReceipt> {
3989
+ return this.request(
3990
+ 'GET',
3991
+ ENDPOINTS.ORG_BROWSER_ALIAS_READINESS_CHECK(orgId, aliasId, checkId),
3992
+ );
3993
+ }
3994
+
3995
+ /** Organization Owner view. Hashes, reviewed snapshots and deltas are
3996
+ * intentionally available only on this human-JWT management surface. */
3997
+ async listBrowserAliasGrants(orgId: string, keyId: string): Promise<BrowserAliasGrantSet[]> {
3998
+ return this.request('GET', ENDPOINTS.ORG_API_KEY_BROWSER_ALIAS_GRANTS(orgId, keyId));
3999
+ }
4000
+
4001
+ async getBrowserAliasGrant(
4002
+ orgId: string,
4003
+ keyId: string,
4004
+ aliasId: string,
4005
+ ): Promise<BrowserAliasGrantSet> {
4006
+ return this.request('GET', ENDPOINTS.ORG_API_KEY_BROWSER_ALIAS_GRANT(orgId, keyId, aliasId));
4007
+ }
4008
+
4009
+ async replaceBrowserAliasGrant(
4010
+ orgId: string,
4011
+ keyId: string,
4012
+ aliasId: string,
4013
+ request: BrowserAliasGrantReplaceRequest,
4014
+ ): Promise<BrowserAliasGrantSet> {
4015
+ return this.request(
4016
+ 'PUT',
4017
+ ENDPOINTS.ORG_API_KEY_BROWSER_ALIAS_GRANT(orgId, keyId, aliasId),
4018
+ request,
4019
+ );
4020
+ }
4021
+
4022
+ /** Managed-key discovery. The response is already grant-filtered and never
4023
+ * carries contract hashes, review snapshots, Edge IDs or Profile IDs. */
4024
+ async listManagedBrowserAliases(orgId: string): Promise<ManagedBrowserAliasSummary[]> {
4025
+ return this.request('GET', ENDPOINTS.ORG_MANAGED_ALIASES(orgId));
4026
+ }
4027
+
4028
+ async getManagedBrowserAlias(orgId: string, aliasName: string): Promise<ManagedBrowserAliasInfo> {
4029
+ return this.request('GET', ENDPOINTS.ORG_MANAGED_ALIAS(orgId, aliasName));
4030
+ }
4031
+
4032
+ /** Accept and dispatch one @alias command. request_id is generated by the
4033
+ * caller before local validation and is also the sole durable recovery key. */
4034
+ async createBrowserAliasExecution(
4035
+ orgId: string,
4036
+ request: BrowserAliasExecutionRequest,
4037
+ ): Promise<BrowserAliasExecutionReceipt> {
4038
+ return this.request('POST', ENDPOINTS.ORG_BROWSER_ALIAS_EXECUTIONS(orgId), request);
4039
+ }
4040
+
4041
+ async getBrowserAliasExecution(
4042
+ orgId: string,
4043
+ requestId: string,
4044
+ ): Promise<BrowserAliasExecutionReceipt> {
4045
+ return this.request('GET', ENDPOINTS.ORG_BROWSER_ALIAS_EXECUTION(orgId, requestId));
4046
+ }
4047
+
4048
+ /** Accept one idempotent Browser Use operation for an explicit Profile.
4049
+ * The Server resolves Profile→Edge; callers never select an Edge directly. */
4050
+ async createBrowserUseOperation(
4051
+ orgId: string,
4052
+ request: BrowserUseOperationRequest,
4053
+ ): Promise<BrowserUseOperationReceipt> {
4054
+ return this.request('POST', ENDPOINTS.ORG_BROWSER_USE_OPERATIONS(orgId), request);
4055
+ }
4056
+
4057
+ /** Recover the durable receipt. Successful data is present only inside the
4058
+ * Server's short encrypted result TTL; terminal proof remains afterwards. */
4059
+ async getBrowserUseOperation(
4060
+ orgId: string,
4061
+ operationId: string,
4062
+ ): Promise<BrowserUseOperationReceipt> {
4063
+ return this.request('GET', ENDPOINTS.ORG_BROWSER_USE_OPERATION(orgId, operationId));
4064
+ }
4065
+
3753
4066
  /**
3754
4067
  * Read a hosted Cloud Profile's egress-proxy status (manager-only: hosted
3755
4068
  * 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
- UPLOAD_PRESIGN: (orgId: string) => `${API_BASE}/orgs/${orgId}/upload/presign`,
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`,
@@ -573,6 +573,7 @@ export const ENDPOINTS = {
573
573
  TASKS: (orgId: string) => `${API_BASE}/orgs/${orgId}/tasks`,
574
574
  TASK_SUBTASK_SUMMARY: (orgId: string) => `${API_BASE}/orgs/${orgId}/tasks/subtask-summary`,
575
575
  TASK: (orgId: string, taskId: string) => `${API_BASE}/orgs/${orgId}/tasks/${taskId}`,
576
+ TASK_MOVE: (orgId: string, taskId: string) => `${API_BASE}/orgs/${orgId}/tasks/${taskId}/move`,
576
577
  TASK_ARCHIVE: (orgId: string, taskId: string) =>
577
578
  `${API_BASE}/orgs/${orgId}/tasks/${taskId}/archive`,
578
579
  TASK_RESTORE: (orgId: string, taskId: string) =>
@@ -718,6 +719,8 @@ export const ENDPOINTS = {
718
719
  // backend router so `deleted` isn't captured as a {wikiId}; the SDK builder
719
720
  // is just a string.
720
721
  WIKIS_DELETED: (orgId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/deleted`,
722
+ // Org-wide changeset listing across readable wikis (Working on tab).
723
+ WIKI_ORG_CHANGESETS: (orgId: string) => `${WIKI_BASE}/orgs/${orgId}/wiki-changesets`,
721
724
  // Detail URL — also reused for DELETE (soft-delete) and `${WIKI}/restore`.
722
725
  WIKI: (orgId: string, wikiId: string) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}`,
723
726
  WIKI_RESTORE: (orgId: string, wikiId: string) =>
@@ -768,6 +771,17 @@ export const ENDPOINTS = {
768
771
  `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/restrictions`,
769
772
  WIKI_RESTRICTION: (orgId: string, wikiId: string, restrictionId: string) =>
770
773
  `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/restrictions/${restrictionId}`,
774
+ WIKI_ACCESS_POLICY: (orgId: string, wikiId: string) =>
775
+ `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/access-policy`,
776
+ WIKI_ACCESS_POLICY_MEMBERS: (orgId: string, wikiId: string) =>
777
+ `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/access-policy/members`,
778
+ WIKI_MEMBERSHIP_SELF: (orgId: string, wikiId: string) =>
779
+ `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/membership/self`,
780
+ // Library-level star (self-scoped bookmark; POST = star, DELETE = unstar).
781
+ WIKI_STARS_SELF: (orgId: string, wikiId: string) =>
782
+ `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/stars/self`,
783
+ WIKI_MEMBERS: (orgId: string, wikiId: string) =>
784
+ `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/members`,
771
785
  WIKI_ACCESS_STATUS: (orgId: string, wikiId: string) =>
772
786
  `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/access-status`,
773
787
  WIKI_ACCESS_REQUESTS: (orgId: string, wikiId: string) =>
@@ -939,6 +953,32 @@ export const ENDPOINTS = {
939
953
  ORG_EDGE_ONBOARDING: (orgId: string) => `/api/v1/orgs/${orgId}/edge/onboarding`,
940
954
  ORG_EDGE_PROFILES: (orgId: string, edgeId: string) =>
941
955
  `/api/v1/orgs/${orgId}/edge/${edgeId}/profiles`,
956
+ ORG_EDGE_PROFILE_OPERATIONS: (orgId: string, edgeId: string) =>
957
+ `/api/v1/orgs/${orgId}/edge/${edgeId}/profile-operations`,
958
+ ORG_EDGE_PROFILE_OPERATION: (orgId: string, edgeId: string, operationId: string) =>
959
+ `/api/v1/orgs/${orgId}/edge/${edgeId}/profile-operations/${operationId}`,
960
+ ORG_EDGE_PROFILE_OPERATION_CONFIRM: (orgId: string, edgeId: string, operationId: string) =>
961
+ `/api/v1/orgs/${orgId}/edge/${edgeId}/profile-operations/${operationId}/confirm`,
962
+ ORG_BROWSER_ALIASES: (orgId: string) => `/api/v1/orgs/${orgId}/browser-aliases`,
963
+ ORG_BROWSER_ALIAS: (orgId: string, aliasId: string) =>
964
+ `/api/v1/orgs/${orgId}/browser-aliases/${aliasId}`,
965
+ ORG_BROWSER_ALIAS_READINESS_CHECKS: (orgId: string, aliasId: string) =>
966
+ `/api/v1/orgs/${orgId}/browser-aliases/${aliasId}/readiness-checks`,
967
+ ORG_BROWSER_ALIAS_READINESS_CHECK: (orgId: string, aliasId: string, checkId: string) =>
968
+ `/api/v1/orgs/${orgId}/browser-aliases/${aliasId}/readiness-checks/${checkId}`,
969
+ ORG_API_KEY_BROWSER_ALIAS_GRANTS: (orgId: string, keyId: string) =>
970
+ `/api/v1/orgs/${orgId}/api-keys/${keyId}/browser-alias-grants`,
971
+ ORG_API_KEY_BROWSER_ALIAS_GRANT: (orgId: string, keyId: string, aliasId: string) =>
972
+ `/api/v1/orgs/${orgId}/api-keys/${keyId}/browser-alias-grants/${aliasId}`,
973
+ ORG_MANAGED_ALIASES: (orgId: string) => `/api/v1/orgs/${orgId}/aliases`,
974
+ ORG_MANAGED_ALIAS: (orgId: string, aliasName: string) =>
975
+ `/api/v1/orgs/${orgId}/aliases/${encodeURIComponent(aliasName)}`,
976
+ ORG_BROWSER_ALIAS_EXECUTIONS: (orgId: string) => `/api/v1/orgs/${orgId}/executions`,
977
+ ORG_BROWSER_ALIAS_EXECUTION: (orgId: string, requestId: string) =>
978
+ `/api/v1/orgs/${orgId}/executions/${encodeURIComponent(requestId)}`,
979
+ ORG_BROWSER_USE_OPERATIONS: (orgId: string) => `/api/v1/orgs/${orgId}/browser-use/operations`,
980
+ ORG_BROWSER_USE_OPERATION: (orgId: string, operationId: string) =>
981
+ `/api/v1/orgs/${orgId}/browser-use/operations/${encodeURIComponent(operationId)}`,
942
982
  // Per-profile egress proxy (hosted Cloud Profiles; manager-only, human-only).
943
983
  ORG_EDGE_PROFILE_PROXY: (orgId: string, edgeId: string, profileName: string) =>
944
984
  `/api/v1/orgs/${orgId}/edge/${edgeId}/profiles/${encodeURIComponent(profileName)}/proxy`,
@@ -959,6 +999,8 @@ export const ENDPOINTS = {
959
999
 
960
1000
  // Clip registry (v3, org-scoped, served by api-server — `crg_` entries)
961
1001
  ORG_CLIP_REGISTRY: (orgId: string) => `/api/v1/orgs/${orgId}/clip-registry`,
1002
+ ORG_CLIP_REGISTRY_RESOLVE: (orgId: string) => `/api/v1/orgs/${orgId}/clip-registry/resolve`,
1003
+ ORG_CLIP_REGISTRY_SEARCH: (orgId: string) => `/api/v1/orgs/${orgId}/clip-registry/search`,
962
1004
  ORG_CLIP_REGISTRY_CLIP: (orgId: string, clipId: string) =>
963
1005
  `/api/v1/orgs/${orgId}/clip-registry/${clipId}`,
964
1006
  ORG_CLIP_REGISTRY_PUBLISH: (orgId: string) => `/api/v1/orgs/${orgId}/clip-registry/publish`,
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
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';
@@ -23,6 +23,7 @@ import type {
23
23
  UpdateProjectMemberRequest,
24
24
  UpdateProjectRequest,
25
25
  UpdateTaskCommentRequest,
26
+ MoveTaskRequest,
26
27
  UpdateTaskRequest,
27
28
  } from './types.js';
28
29
 
@@ -84,6 +85,16 @@ export abstract class ProjectTaskClient {
84
85
  );
85
86
  }
86
87
 
88
+ /**
89
+ * Moves a task and its whole subtree into another project (renumbering it
90
+ * there; old identifiers stay resolvable as aliases). The caller needs
91
+ * update access on the task (source project membership) and read access to
92
+ * the target project.
93
+ */
94
+ async moveTask(orgId: string, taskId: string, data: MoveTaskRequest): Promise<Task> {
95
+ return this.request('POST', ENDPOINTS.TASK_MOVE(orgId, taskId), data);
96
+ }
97
+
87
98
  async archiveTask(orgId: string, taskId: string): Promise<void> {
88
99
  return this.request('POST', ENDPOINTS.TASK_ARCHIVE(orgId, taskId));
89
100
  }