@parall/sdk 1.20.1 → 1.21.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 +66 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +139 -3
- package/dist/constants.d.ts +19 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +86 -2
- package/dist/types.d.ts +155 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +223 -13
- package/src/constants.ts +96 -3
- package/src/types.ts +188 -10
package/src/types.ts
CHANGED
|
@@ -406,6 +406,11 @@ export interface LoginRequest {
|
|
|
406
406
|
password: string;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
+
export interface ChangePasswordRequest {
|
|
410
|
+
current_password: string;
|
|
411
|
+
new_password: string;
|
|
412
|
+
}
|
|
413
|
+
|
|
409
414
|
export interface CreateChatRequest {
|
|
410
415
|
type: ChatType;
|
|
411
416
|
org_id: string;
|
|
@@ -677,6 +682,123 @@ export interface UpdateProjectRequest {
|
|
|
677
682
|
sort_order?: number;
|
|
678
683
|
}
|
|
679
684
|
|
|
685
|
+
// ============================================================
|
|
686
|
+
// Schedule Types
|
|
687
|
+
// ============================================================
|
|
688
|
+
|
|
689
|
+
export type ScheduleSpecType = 'cron' | 'interval' | 'one_shot';
|
|
690
|
+
export type ScheduleStatus = 'active' | 'paused' | 'completed' | 'cancelled';
|
|
691
|
+
export type ScheduleCancelReason = 'user_cancel' | 'attached_gone' | 'target_ineligible';
|
|
692
|
+
export type ScheduleRunStatus = 'delivered' | 'missed' | 'failed';
|
|
693
|
+
|
|
694
|
+
export interface Schedule {
|
|
695
|
+
id: string;
|
|
696
|
+
org_id: string;
|
|
697
|
+
creator_id: string;
|
|
698
|
+
target_id: string;
|
|
699
|
+
attached_to_uri: string | null;
|
|
700
|
+
name: string;
|
|
701
|
+
description: string;
|
|
702
|
+
spec_type: ScheduleSpecType;
|
|
703
|
+
cron_expr: string | null;
|
|
704
|
+
interval_seconds: number | null;
|
|
705
|
+
run_at: string | null;
|
|
706
|
+
timezone: string;
|
|
707
|
+
start_at: string | null;
|
|
708
|
+
end_at: string | null;
|
|
709
|
+
max_runs: number | null;
|
|
710
|
+
catchup_window_seconds: number;
|
|
711
|
+
status: ScheduleStatus;
|
|
712
|
+
cancel_reason: ScheduleCancelReason | null;
|
|
713
|
+
next_fire_at: string | null;
|
|
714
|
+
last_fire_at: string | null;
|
|
715
|
+
run_count: number;
|
|
716
|
+
created_at: string;
|
|
717
|
+
updated_at: string;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export interface ScheduleRun {
|
|
721
|
+
id: string;
|
|
722
|
+
schedule_id: string;
|
|
723
|
+
scheduled_fire_at: string;
|
|
724
|
+
actual_fired_at: string;
|
|
725
|
+
status: ScheduleRunStatus;
|
|
726
|
+
fired_description: string | null;
|
|
727
|
+
fired_attached_uri: string | null;
|
|
728
|
+
dispatch_event_id: string | null;
|
|
729
|
+
inbox_item_id: string | null;
|
|
730
|
+
error: string | null;
|
|
731
|
+
created_at: string;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
export interface CreateScheduleInput {
|
|
735
|
+
name: string;
|
|
736
|
+
description: string;
|
|
737
|
+
target_id: string;
|
|
738
|
+
attached_to_uri?: string;
|
|
739
|
+
spec_type: ScheduleSpecType;
|
|
740
|
+
cron_expr?: string;
|
|
741
|
+
interval_seconds?: number;
|
|
742
|
+
run_at?: string;
|
|
743
|
+
timezone?: string;
|
|
744
|
+
start_at?: string;
|
|
745
|
+
end_at?: string;
|
|
746
|
+
max_runs?: number;
|
|
747
|
+
catchup_window_seconds?: number;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
export interface UpdateScheduleInput {
|
|
751
|
+
name?: string;
|
|
752
|
+
description?: string;
|
|
753
|
+
target_id?: string;
|
|
754
|
+
attached_to_uri?: string;
|
|
755
|
+
/** Explicitly clear attached_to_uri. Server honors this over `attached_to_uri`. */
|
|
756
|
+
attached_to_uri_clear?: boolean;
|
|
757
|
+
cron_expr?: string;
|
|
758
|
+
interval_seconds?: number;
|
|
759
|
+
run_at?: string;
|
|
760
|
+
timezone?: string;
|
|
761
|
+
start_at?: string;
|
|
762
|
+
/** Explicitly clear start_at. Server honors this over `start_at`. */
|
|
763
|
+
start_at_clear?: boolean;
|
|
764
|
+
end_at?: string;
|
|
765
|
+
/** Explicitly clear end_at. Server honors this over `end_at`. */
|
|
766
|
+
end_at_clear?: boolean;
|
|
767
|
+
max_runs?: number;
|
|
768
|
+
/** Explicitly clear max_runs. Server honors this over `max_runs`. */
|
|
769
|
+
max_runs_clear?: boolean;
|
|
770
|
+
catchup_window_seconds?: number;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export interface ScheduleFilters {
|
|
774
|
+
attached_to?: string;
|
|
775
|
+
target_id?: string;
|
|
776
|
+
creator_id?: string;
|
|
777
|
+
/** Comma-separated list of statuses (e.g. 'active,paused'). */
|
|
778
|
+
status?: string;
|
|
779
|
+
cursor?: string;
|
|
780
|
+
limit?: number;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export interface ScheduleRunFilters {
|
|
784
|
+
cursor?: string;
|
|
785
|
+
limit?: number;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// Schedule WS event data
|
|
789
|
+
export type ScheduleCreatedData = Schedule;
|
|
790
|
+
export type ScheduleUpdatedData = Schedule;
|
|
791
|
+
export interface ScheduleDeletedData {
|
|
792
|
+
schedule_id: string;
|
|
793
|
+
org_id: string;
|
|
794
|
+
}
|
|
795
|
+
export interface ScheduleFiredData {
|
|
796
|
+
schedule_id: string;
|
|
797
|
+
run_id: string;
|
|
798
|
+
scheduled_fire_at: string;
|
|
799
|
+
actual_fired_at: string;
|
|
800
|
+
}
|
|
801
|
+
|
|
680
802
|
// ============================================================
|
|
681
803
|
// Wiki Types
|
|
682
804
|
// ============================================================
|
|
@@ -842,6 +964,34 @@ export interface WikiBrokenRef extends WikiFileRef {
|
|
|
842
964
|
reason: string;
|
|
843
965
|
}
|
|
844
966
|
|
|
967
|
+
// WikiAnchorRef is a (path, rev) pair pointing at a specific blob snapshot
|
|
968
|
+
// the caller wants to check for outdatedness.
|
|
969
|
+
export interface WikiAnchorRef {
|
|
970
|
+
path: string;
|
|
971
|
+
rev: string;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export interface WikiAnchorStatusRequest {
|
|
975
|
+
refs: WikiAnchorRef[];
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
// WikiAnchorStatus reports whether the file at (path, rev) is still byte-
|
|
979
|
+
// identical to HEAD. Refs the caller cannot read are silently dropped from
|
|
980
|
+
// the response, so a missing entry indicates either a forbidden path or a
|
|
981
|
+
// malformed request entry — callers treat both as "unknown" (not outdated).
|
|
982
|
+
export interface WikiAnchorStatus {
|
|
983
|
+
path: string;
|
|
984
|
+
rev: string;
|
|
985
|
+
blob_sha_at_rev?: string;
|
|
986
|
+
blob_sha_at_head?: string;
|
|
987
|
+
outdated: boolean;
|
|
988
|
+
file_exists_at_head: boolean;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
export interface WikiAnchorStatusResponse {
|
|
992
|
+
results: WikiAnchorStatus[];
|
|
993
|
+
}
|
|
994
|
+
|
|
845
995
|
export interface WikiRefsCheckResponse {
|
|
846
996
|
wiki_id: string;
|
|
847
997
|
wiki_slug: string;
|
|
@@ -975,11 +1125,40 @@ export interface WikiBlob {
|
|
|
975
1125
|
path: string;
|
|
976
1126
|
ref: string;
|
|
977
1127
|
resolved_rev?: string;
|
|
978
|
-
line_count: number;
|
|
979
|
-
content: string;
|
|
980
1128
|
size: number;
|
|
981
|
-
|
|
1129
|
+
// Text / inline-binary responses carry `content` + `line_count`.
|
|
1130
|
+
// Binary (LFS pointer or inline blob served as `signed_url`) responses
|
|
1131
|
+
// omit `content` and `line_count` and set `encoding = "signed_url"`
|
|
1132
|
+
// with the two signed_url fields populated. See
|
|
1133
|
+
// docs/engineering-design/wiki-file-storage-design.md §读路径 SSOT.
|
|
1134
|
+
encoding: 'utf-8' | 'base64' | 'signed_url';
|
|
1135
|
+
content?: string;
|
|
1136
|
+
line_count?: number;
|
|
982
1137
|
sha256?: string;
|
|
1138
|
+
// Phase 2 additions for the binary response shape:
|
|
1139
|
+
mime?: string;
|
|
1140
|
+
is_lfs?: boolean;
|
|
1141
|
+
content_sha?: string;
|
|
1142
|
+
signed_url?: string;
|
|
1143
|
+
signed_url_expires_at?: string;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
export type WikiStoredAs = 'git_blob' | 'lfs_pointer';
|
|
1147
|
+
|
|
1148
|
+
/** Response from POST /uploads or POST /changesets/{csId}/files. */
|
|
1149
|
+
export interface WikiFileUploadResponse {
|
|
1150
|
+
path: string;
|
|
1151
|
+
size: number;
|
|
1152
|
+
stored_as: WikiStoredAs;
|
|
1153
|
+
commit_sha: string;
|
|
1154
|
+
content_sha: string;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/** Response from POST /files/preview-url — short-lived signed URL for
|
|
1158
|
+
* browser `<img>`/`<video>`/`<iframe>` src. TTL is 5 minutes by default. */
|
|
1159
|
+
export interface WikiFilePreviewUrlResponse {
|
|
1160
|
+
url: string;
|
|
1161
|
+
expires_at: string;
|
|
983
1162
|
}
|
|
984
1163
|
|
|
985
1164
|
// ============================================================
|
|
@@ -1192,11 +1371,6 @@ export interface CreateAgentStepRequest {
|
|
|
1192
1371
|
projection?: boolean; // project text steps to chat message or task comment (controlled by agent's run_config)
|
|
1193
1372
|
}
|
|
1194
1373
|
|
|
1195
|
-
export interface CreateAgentTaskBackfillCommentRequest {
|
|
1196
|
-
task_id: string;
|
|
1197
|
-
body: string;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
1374
|
export interface UpdateAgentSessionRequest {
|
|
1201
1375
|
status: string;
|
|
1202
1376
|
trigger_message_id?: string;
|
|
@@ -1261,7 +1435,7 @@ export interface CommentDeletedData {
|
|
|
1261
1435
|
export type InboxItemType =
|
|
1262
1436
|
| 'mention' | 'task_assign' | 'task_update'
|
|
1263
1437
|
| 'task_comment' | 'approval_request'
|
|
1264
|
-
| 'agent_alert' | 'invitation';
|
|
1438
|
+
| 'agent_alert' | 'invitation' | 'schedule_fire';
|
|
1265
1439
|
|
|
1266
1440
|
export interface InboxItem {
|
|
1267
1441
|
id: string;
|
|
@@ -1289,7 +1463,7 @@ export interface InboxItem {
|
|
|
1289
1463
|
// Dispatch Types (agent event delivery)
|
|
1290
1464
|
// ============================================================
|
|
1291
1465
|
|
|
1292
|
-
export type DispatchEventType = 'message' | 'task_assign' | 'task_comment';
|
|
1466
|
+
export type DispatchEventType = 'message' | 'task_assign' | 'task_comment' | 'schedule.fire';
|
|
1293
1467
|
export type DispatchStatus = 'pending' | 'acked';
|
|
1294
1468
|
|
|
1295
1469
|
export interface DispatchEvent {
|
|
@@ -1391,6 +1565,10 @@ export type WsEventMap = {
|
|
|
1391
1565
|
'inbox.bulk_update': InboxBulkUpdateData;
|
|
1392
1566
|
'read_position.updated': ReadPositionUpdateData;
|
|
1393
1567
|
'dispatch.new': DispatchNewData;
|
|
1568
|
+
'schedule.created': ScheduleCreatedData;
|
|
1569
|
+
'schedule.updated': ScheduleUpdatedData;
|
|
1570
|
+
'schedule.deleted': ScheduleDeletedData;
|
|
1571
|
+
'schedule.fired': ScheduleFiredData;
|
|
1394
1572
|
};
|
|
1395
1573
|
|
|
1396
1574
|
// Invitation WS event data
|