@parall/sdk 1.47.0 → 1.49.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 +118 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +180 -5
- package/dist/constants.d.ts +13 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +19 -0
- package/dist/types.d.ts +261 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/client.ts +272 -6
- package/src/constants.ts +25 -0
- package/src/types.ts +277 -0
package/dist/types.d.ts
CHANGED
|
@@ -93,6 +93,12 @@ export interface TransferChatOwnershipRequest {
|
|
|
93
93
|
export interface UnreadEntry {
|
|
94
94
|
count: number;
|
|
95
95
|
mentions: number;
|
|
96
|
+
/** Share of `count` contributed by unread thread replies (only present when
|
|
97
|
+
* the unread fetch opted into `include_thread_replies`). Top-level timeline
|
|
98
|
+
* unread = count - (thread_count ?? 0). */
|
|
99
|
+
thread_count?: number;
|
|
100
|
+
/** Share of `mentions` contributed by unread thread replies. */
|
|
101
|
+
thread_mentions?: number;
|
|
96
102
|
since?: string;
|
|
97
103
|
}
|
|
98
104
|
export interface ThreadUnreadEntry {
|
|
@@ -211,6 +217,12 @@ export interface Message {
|
|
|
211
217
|
* absent from the stack. A reload re-derives it from the server's view.
|
|
212
218
|
*/
|
|
213
219
|
recent_repliers?: User[];
|
|
220
|
+
/**
|
|
221
|
+
* Per-viewer count of thread replies newer than the viewer's thread read
|
|
222
|
+
* cursor, excluding the viewer's own replies (root only). Populated on
|
|
223
|
+
* top-level list responses; omitted when zero.
|
|
224
|
+
*/
|
|
225
|
+
unread_reply_count?: number;
|
|
214
226
|
edited_at: string | null;
|
|
215
227
|
deleted_at: string | null;
|
|
216
228
|
created_at: string;
|
|
@@ -219,6 +231,25 @@ export interface Message {
|
|
|
219
231
|
agent_session_id?: string | null;
|
|
220
232
|
hints?: MessageHints | null;
|
|
221
233
|
attachments?: Attachment[];
|
|
234
|
+
reactions?: ReactionSummary[];
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Aggregated reactions for one emoji on a message.
|
|
238
|
+
*
|
|
239
|
+
* `has_reacted` is viewer-relative in REST responses. In
|
|
240
|
+
* `message.reaction.updated` WS broadcasts it is computed for the ACTOR who
|
|
241
|
+
* triggered the toggle — subscribers must recompute their own state from
|
|
242
|
+
* `user_ids` (see docs/engineering-design/ws-protocol.md).
|
|
243
|
+
*/
|
|
244
|
+
export interface ReactionSummary {
|
|
245
|
+
emoji: string;
|
|
246
|
+
count: number;
|
|
247
|
+
user_ids: string[];
|
|
248
|
+
has_reacted: boolean;
|
|
249
|
+
}
|
|
250
|
+
export interface ToggleReactionResponse {
|
|
251
|
+
added: boolean;
|
|
252
|
+
reactions: ReactionSummary[];
|
|
222
253
|
}
|
|
223
254
|
export interface Attachment {
|
|
224
255
|
id: string;
|
|
@@ -913,6 +944,13 @@ export interface Task {
|
|
|
913
944
|
seq_number: number | null;
|
|
914
945
|
identifier: string | null;
|
|
915
946
|
sort_order: number;
|
|
947
|
+
/**
|
|
948
|
+
* Planned start date, YYYY-MM-DD (calendar date, timezone-free) — the
|
|
949
|
+
* planned schedule's left edge, independent of started_at (when work
|
|
950
|
+
* actually began). Absent on servers older than migration 145. When both
|
|
951
|
+
* dates are set, planned_start_date <= due_date.
|
|
952
|
+
*/
|
|
953
|
+
planned_start_date?: string | null;
|
|
916
954
|
/** Planned completion date, YYYY-MM-DD (calendar date, timezone-free). */
|
|
917
955
|
due_date: string | null;
|
|
918
956
|
assignee?: User;
|
|
@@ -992,6 +1030,8 @@ export interface CreateTaskRequest {
|
|
|
992
1030
|
project_id?: string;
|
|
993
1031
|
source_chat_id?: string;
|
|
994
1032
|
sort_order?: number;
|
|
1033
|
+
/** Planned start date, YYYY-MM-DD. Must be <= due_date when both are set. */
|
|
1034
|
+
planned_start_date?: string;
|
|
995
1035
|
/** Planned completion date, YYYY-MM-DD. */
|
|
996
1036
|
due_date?: string;
|
|
997
1037
|
}
|
|
@@ -1011,6 +1051,12 @@ export interface UpdateTaskRequest {
|
|
|
1011
1051
|
* full column. Mutually exclusive with sort_order.
|
|
1012
1052
|
*/
|
|
1013
1053
|
placement?: 'end';
|
|
1054
|
+
/**
|
|
1055
|
+
* Planned start date, YYYY-MM-DD; explicit null clears it. The post-patch
|
|
1056
|
+
* state must satisfy planned_start_date <= due_date when both are set
|
|
1057
|
+
* (400 INVALID_DATE_RANGE otherwise).
|
|
1058
|
+
*/
|
|
1059
|
+
planned_start_date?: string | null;
|
|
1014
1060
|
/** Planned completion date, YYYY-MM-DD; explicit null clears it. */
|
|
1015
1061
|
due_date?: string | null;
|
|
1016
1062
|
/**
|
|
@@ -1767,6 +1813,19 @@ export interface MessageDeleteData {
|
|
|
1767
1813
|
chat_id: string;
|
|
1768
1814
|
thread_root_id?: string;
|
|
1769
1815
|
}
|
|
1816
|
+
/**
|
|
1817
|
+
* Payload of the `message.reaction.updated` WS broadcast. `reactions` is the
|
|
1818
|
+
* full aggregated snapshot for the message; its `has_reacted` flags are
|
|
1819
|
+
* actor-relative (see {@link ReactionSummary}) — recompute from `user_ids`.
|
|
1820
|
+
*/
|
|
1821
|
+
export interface ReactionUpdatedData {
|
|
1822
|
+
message_id: string;
|
|
1823
|
+
chat_id: string;
|
|
1824
|
+
emoji: string;
|
|
1825
|
+
user_id: string;
|
|
1826
|
+
added: boolean;
|
|
1827
|
+
reactions: ReactionSummary[];
|
|
1828
|
+
}
|
|
1770
1829
|
export interface TypingUpdateData {
|
|
1771
1830
|
chat_id: string;
|
|
1772
1831
|
thread_root_id: string | null;
|
|
@@ -2014,6 +2073,14 @@ export interface InboxItem {
|
|
|
2014
2073
|
grouping_priority: number;
|
|
2015
2074
|
/** Number of events in this group. Populated by the grouped list query. */
|
|
2016
2075
|
group_count: number;
|
|
2076
|
+
/**
|
|
2077
|
+
* True when ANY row in this item's group is unread — the same group-level
|
|
2078
|
+
* definition the unread-count badge uses. The representative row's own
|
|
2079
|
+
* `read_at` can be set while older rows in its group are still unread, so
|
|
2080
|
+
* read-state display must key off this field. Optional: absent on locally
|
|
2081
|
+
* cached rows written before the field shipped (fall back to `read_at`).
|
|
2082
|
+
*/
|
|
2083
|
+
group_unread?: boolean;
|
|
2017
2084
|
read_at: string | null;
|
|
2018
2085
|
archived_at: string | null;
|
|
2019
2086
|
snoozed_until: string | null;
|
|
@@ -2502,6 +2569,12 @@ export interface ReadPositionUpdateData {
|
|
|
2502
2569
|
chat_id: string;
|
|
2503
2570
|
last_read_message_id: string;
|
|
2504
2571
|
}
|
|
2572
|
+
/** Per-thread read cursor sync across the user's devices. */
|
|
2573
|
+
export interface ThreadReadPositionUpdateData {
|
|
2574
|
+
chat_id: string;
|
|
2575
|
+
thread_root_id: string;
|
|
2576
|
+
last_read_reply_id: string;
|
|
2577
|
+
}
|
|
2505
2578
|
export interface NotificationAlertData {
|
|
2506
2579
|
title: string;
|
|
2507
2580
|
body: string;
|
|
@@ -2515,6 +2588,7 @@ export type WsEventMap = {
|
|
|
2515
2588
|
'message.patch': MessagePatchData;
|
|
2516
2589
|
'message.edit': MessageEditData;
|
|
2517
2590
|
'message.delete': MessageDeleteData;
|
|
2591
|
+
'message.reaction.updated': ReactionUpdatedData;
|
|
2518
2592
|
'typing.update': TypingUpdateData;
|
|
2519
2593
|
'chat.created': ChatCreatedData;
|
|
2520
2594
|
'chat.update': ChatUpdateData;
|
|
@@ -2561,6 +2635,7 @@ export type WsEventMap = {
|
|
|
2561
2635
|
'inbox.update': InboxUpdateData;
|
|
2562
2636
|
'inbox.bulk_update': InboxBulkUpdateData;
|
|
2563
2637
|
'read_position.updated': ReadPositionUpdateData;
|
|
2638
|
+
'thread_read_position.updated': ThreadReadPositionUpdateData;
|
|
2564
2639
|
'dispatch.new': DispatchNewData;
|
|
2565
2640
|
'dispatch.received': DispatchReceivedData;
|
|
2566
2641
|
'dispatch.resolved': DispatchResolvedData;
|
|
@@ -2727,6 +2802,40 @@ export interface BacklinksResponse {
|
|
|
2727
2802
|
backlinks: BacklinkItem[];
|
|
2728
2803
|
next_cursor?: string;
|
|
2729
2804
|
}
|
|
2805
|
+
/**
|
|
2806
|
+
* Request for POST /orgs/{orgId}/refs/outbound — two mutually exclusive
|
|
2807
|
+
* forms, modeled as a union so an invalid mixed shape fails at compile time:
|
|
2808
|
+
* `thread_root_id` resolves a thread's message set server-side (root + ALL
|
|
2809
|
+
* non-deleted replies — the client's reply window may be partial), while
|
|
2810
|
+
* `source_type` + `source_ids` lists explicit sources (max 500; v1 accepts
|
|
2811
|
+
* only `message` sources).
|
|
2812
|
+
*/
|
|
2813
|
+
export type OutboundRefsRequest = {
|
|
2814
|
+
thread_root_id: string;
|
|
2815
|
+
source_type?: never;
|
|
2816
|
+
source_ids?: never;
|
|
2817
|
+
} | {
|
|
2818
|
+
source_type: string;
|
|
2819
|
+
source_ids: string[];
|
|
2820
|
+
thread_root_id?: never;
|
|
2821
|
+
};
|
|
2822
|
+
/** One raw ref_links row; dedupe/grouping is a client concern. */
|
|
2823
|
+
export interface OutboundRefItem {
|
|
2824
|
+
uri: string;
|
|
2825
|
+
target_type: string;
|
|
2826
|
+
target_id: string;
|
|
2827
|
+
target_path?: string;
|
|
2828
|
+
target_frag?: string;
|
|
2829
|
+
context?: string;
|
|
2830
|
+
source_type: string;
|
|
2831
|
+
source_id: string;
|
|
2832
|
+
position: number;
|
|
2833
|
+
}
|
|
2834
|
+
export interface OutboundRefsResponse {
|
|
2835
|
+
data: OutboundRefItem[];
|
|
2836
|
+
/** Set when the server-side sanity cap dropped the tail of the row set. */
|
|
2837
|
+
truncated?: boolean;
|
|
2838
|
+
}
|
|
2730
2839
|
/**
|
|
2731
2840
|
* One entity in a multi-hop ref-graph traversal (GET /refs/graph). `id`/`uri` are
|
|
2732
2841
|
* the ref_links endpoint identifier: a bare prll:// entity id for most nodes
|
|
@@ -3261,6 +3370,27 @@ export interface BrowserViewerCommandResponse {
|
|
|
3261
3370
|
*/
|
|
3262
3371
|
result: Record<string, unknown> | null;
|
|
3263
3372
|
}
|
|
3373
|
+
/**
|
|
3374
|
+
* Cloud Edge live viewer (V1b, design §6). Same request/reply shape as the v2
|
|
3375
|
+
* browser-profile viewer — the transport-agnostic `BrowserViewer` client drives
|
|
3376
|
+
* either — but a distinct type so the edge viewer surface never depends on the
|
|
3377
|
+
* v2 browser-profile viewer symbols.
|
|
3378
|
+
*/
|
|
3379
|
+
export interface EdgeViewerCommandRequest {
|
|
3380
|
+
/** Correlates a viewer session. Omit on `stream.start`; the server returns one. */
|
|
3381
|
+
session_id?: string;
|
|
3382
|
+
command: string;
|
|
3383
|
+
input?: Record<string, unknown>;
|
|
3384
|
+
}
|
|
3385
|
+
export interface EdgeViewerCommandResponse {
|
|
3386
|
+
session_id: string;
|
|
3387
|
+
/**
|
|
3388
|
+
* Command-specific result. For `stream.start`:
|
|
3389
|
+
* `{ offer_sdp, candidates, ice_servers, streamed_tab_id }`. May be `null` on
|
|
3390
|
+
* the wire (a nil Go result map serializes as JSON null); coalesce to `{}`.
|
|
3391
|
+
*/
|
|
3392
|
+
result: Record<string, unknown> | null;
|
|
3393
|
+
}
|
|
3264
3394
|
export interface GrantBrowserProfileConsentRequest {
|
|
3265
3395
|
clip_id: string;
|
|
3266
3396
|
}
|
|
@@ -3412,6 +3542,8 @@ export type EdgePlacement = 'byoc' | 'hosted';
|
|
|
3412
3542
|
* several minutes.
|
|
3413
3543
|
*/
|
|
3414
3544
|
export type EdgeHostedState = 'idle' | 'deleting';
|
|
3545
|
+
/** Stable API error codes returned by the BYOC unregister contract. */
|
|
3546
|
+
export type EdgeDeviceUnregisterErrorCode = 'JWT_REQUIRED' | 'HUMAN_REQUIRED' | 'FORBIDDEN' | 'EDGE_PLACEMENT_UNSUPPORTED' | 'EDGE_ONLINE' | 'EDGE_INTEGRITY_ERROR';
|
|
3415
3547
|
export interface EdgeDevice {
|
|
3416
3548
|
id: string;
|
|
3417
3549
|
org_id: string;
|
|
@@ -3446,6 +3578,43 @@ export interface EdgeBrowserProfile {
|
|
|
3446
3578
|
is_default: boolean;
|
|
3447
3579
|
created_at: string;
|
|
3448
3580
|
updated_at: string;
|
|
3581
|
+
/**
|
|
3582
|
+
* True when the profile has a fixed egress proxy configured (hosted Cloud
|
|
3583
|
+
* Profiles). Presence flag only — endpoint/username/password are readable
|
|
3584
|
+
* exclusively by managers via the dedicated proxy endpoint, and the password
|
|
3585
|
+
* never leaves the server.
|
|
3586
|
+
*/
|
|
3587
|
+
proxy_configured?: boolean;
|
|
3588
|
+
}
|
|
3589
|
+
/**
|
|
3590
|
+
* Sanitized per-profile egress proxy status (hosted Cloud Profiles) — the GET
|
|
3591
|
+
* response and the PUT/DELETE result. NEVER carries the password; `password_set`
|
|
3592
|
+
* is the only trace of it.
|
|
3593
|
+
*/
|
|
3594
|
+
export interface EdgeProfileProxyStatus {
|
|
3595
|
+
configured: boolean;
|
|
3596
|
+
server?: string;
|
|
3597
|
+
username?: string;
|
|
3598
|
+
password_set: boolean;
|
|
3599
|
+
/** Opaque compare-and-swap token for conditional PUT/DELETE. */
|
|
3600
|
+
version: string;
|
|
3601
|
+
/** Authoritative mutation gate; false whenever a non-released lease exists. */
|
|
3602
|
+
can_mutate: boolean;
|
|
3603
|
+
/** Actual lease state blocking a mutation (never inferred from device status). */
|
|
3604
|
+
lease_status?: 'pending' | 'assigned' | 'active' | 'releasing' | 'repair';
|
|
3605
|
+
/** Suggested delay before re-reading authoritative state. */
|
|
3606
|
+
retry_after_seconds?: number;
|
|
3607
|
+
}
|
|
3608
|
+
/**
|
|
3609
|
+
* PUT body for a profile's egress proxy: the FULL triple every time (no
|
|
3610
|
+
* tri-state merge — the stored blob is encrypted, so replace always re-supplies
|
|
3611
|
+
* complete credentials). Clearing is DELETE, never an empty PUT. Username and
|
|
3612
|
+
* password go together or not at all.
|
|
3613
|
+
*/
|
|
3614
|
+
export interface SetEdgeProfileProxyRequest {
|
|
3615
|
+
server: string;
|
|
3616
|
+
username?: string;
|
|
3617
|
+
password?: string;
|
|
3449
3618
|
}
|
|
3450
3619
|
export interface ClipConnection {
|
|
3451
3620
|
id: string;
|
|
@@ -3459,6 +3628,98 @@ export interface ClipConnection {
|
|
|
3459
3628
|
created_at: string;
|
|
3460
3629
|
updated_at: string;
|
|
3461
3630
|
}
|
|
3631
|
+
/**
|
|
3632
|
+
* A clip in the api-server org registry (`crg_…`, table `clip_registry`) — the
|
|
3633
|
+
* v3 registry that install and clip connections operate on. Distinct from
|
|
3634
|
+
* {@link RegistryClipInfo}, which is the clip-service → Pinix Hub catalog proxy
|
|
3635
|
+
* and carries no registry id.
|
|
3636
|
+
*/
|
|
3637
|
+
export interface ClipRegistryEntry {
|
|
3638
|
+
id: string;
|
|
3639
|
+
org_id: string;
|
|
3640
|
+
name: string;
|
|
3641
|
+
description?: string;
|
|
3642
|
+
visibility: 'public' | 'private';
|
|
3643
|
+
version?: string;
|
|
3644
|
+
/** clip.json manifest. `type` absent/null means browser (predates the field). */
|
|
3645
|
+
manifest: Record<string, unknown> | null;
|
|
3646
|
+
author_id: string;
|
|
3647
|
+
/** Reviewed snapshot served cross-org. Absent = never approved. */
|
|
3648
|
+
approved_version_id?: string;
|
|
3649
|
+
created_at: string;
|
|
3650
|
+
updated_at: string;
|
|
3651
|
+
/** Author-org-only computed fields (state of the latest submitted version). */
|
|
3652
|
+
review_status?: string;
|
|
3653
|
+
review_note?: string;
|
|
3654
|
+
}
|
|
3655
|
+
export interface InstallRegistryClipResponse {
|
|
3656
|
+
ok: boolean;
|
|
3657
|
+
clip_id: string;
|
|
3658
|
+
name: string;
|
|
3659
|
+
}
|
|
3660
|
+
/**
|
|
3661
|
+
* Execute a registry (Edge) clip command on an Edge device
|
|
3662
|
+
* (`POST /orgs/{orgId}/edge/exec`).
|
|
3663
|
+
*
|
|
3664
|
+
* Routing is EXPLICIT — exactly one of:
|
|
3665
|
+
* - `connection`: a clip connection id (`ccn_…`) or its org-local alias. The
|
|
3666
|
+
* ONLY route to a hosted (Cloud Profile) device: the connection its
|
|
3667
|
+
* maintainer bound IS the org-wide authorization. Also valid for BYOC.
|
|
3668
|
+
* - `edge_id`: a BYOC desktop device the CALLER owns. Naming a hosted device
|
|
3669
|
+
* here is refused (`400 HOSTED_CONNECTION_REQUIRED`).
|
|
3670
|
+
* - neither: legacy BYOC fallback — resolves only to the caller's OWN online
|
|
3671
|
+
* desktop device, never to a hosted one.
|
|
3672
|
+
*/
|
|
3673
|
+
export interface ExecEdgeClipRequest {
|
|
3674
|
+
/**
|
|
3675
|
+
* Clip name in the org's clip registry (or an installed marketplace clip).
|
|
3676
|
+
* Exactly ONE of `clip` or `clip_id` is required — same identity contract as
|
|
3677
|
+
* clip invoke: bare names keep the fail-closed collision behavior (own-org
|
|
3678
|
+
* shadows installs; two installed namesakes → `409 CLIP_NAME_AMBIGUOUS`).
|
|
3679
|
+
*/
|
|
3680
|
+
clip?: string;
|
|
3681
|
+
/**
|
|
3682
|
+
* Exact registry Clip id (`crg_…`). Selects the exact object without
|
|
3683
|
+
* weakening execution trust (cross-org still requires public + approved +
|
|
3684
|
+
* installed and runs only the approved snapshot).
|
|
3685
|
+
*/
|
|
3686
|
+
clip_id?: string;
|
|
3687
|
+
/** Command to run — resolves to `<command>.js` in the clip's files. */
|
|
3688
|
+
command: string;
|
|
3689
|
+
/** Command arguments, forwarded verbatim to the clip. */
|
|
3690
|
+
args?: unknown;
|
|
3691
|
+
/** Connection id (`ccn_…`) or alias. Required for hosted devices. */
|
|
3692
|
+
connection?: string;
|
|
3693
|
+
/** Owned BYOC device id. Mutually exclusive with `connection`. */
|
|
3694
|
+
edge_id?: string;
|
|
3695
|
+
/**
|
|
3696
|
+
* Browser profile name. With `connection` it may only restate the profile
|
|
3697
|
+
* that connection grants (`400 CONNECTION_PROFILE_MISMATCH` otherwise).
|
|
3698
|
+
*/
|
|
3699
|
+
profile?: string;
|
|
3700
|
+
/** Execution timeout in MILLISECONDS (default 30000, max 120000). */
|
|
3701
|
+
timeout?: number;
|
|
3702
|
+
/**
|
|
3703
|
+
* Optional audit tag (≤128 chars). Keep the SAME id across an
|
|
3704
|
+
* EDGE_ACTIVATING retry loop so the server's audit log reads the retries as
|
|
3705
|
+
* one logical call. It is NOT an idempotency key — it deduplicates nothing.
|
|
3706
|
+
*/
|
|
3707
|
+
correlation_id?: string;
|
|
3708
|
+
}
|
|
3709
|
+
/**
|
|
3710
|
+
* A completed execution's result envelope (HTTP 200). Every non-success is
|
|
3711
|
+
* thrown as a typed {@link ApiError} instead — see
|
|
3712
|
+
* {@link ParallClient.execEdgeClip} for the full code table and, critically,
|
|
3713
|
+
* which codes are safe to retry.
|
|
3714
|
+
*/
|
|
3715
|
+
export interface EdgeClipExecResult {
|
|
3716
|
+
request_id: string;
|
|
3717
|
+
success: boolean;
|
|
3718
|
+
data?: unknown;
|
|
3719
|
+
error?: string;
|
|
3720
|
+
error_code?: string;
|
|
3721
|
+
duration_ms: number;
|
|
3722
|
+
}
|
|
3462
3723
|
/**
|
|
3463
3724
|
* Two INDEPENDENT onboarding journeys. The original fields mean what they always
|
|
3464
3725
|
* meant — "has this org set up the desktop journey?" — and hosted-backed state
|