@hatchet-dev/typescript-sdk 1.6.2 → 1.7.1

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.
Files changed (50) hide show
  1. package/clients/admin/admin-client.d.ts +1 -0
  2. package/clients/admin/admin-client.js +5 -11
  3. package/clients/event/event-client.js +3 -4
  4. package/clients/hatchet-client/hatchet-client.d.ts +0 -4
  5. package/clients/hatchet-client/hatchet-client.js +0 -5
  6. package/clients/rest/generated/Api.d.ts +62 -1
  7. package/clients/rest/generated/Api.js +39 -0
  8. package/clients/rest/generated/data-contracts.d.ts +201 -161
  9. package/clients/rest/generated/data-contracts.js +168 -168
  10. package/clients/worker/worker.d.ts +1 -1
  11. package/clients/worker/worker.js +5 -4
  12. package/package.json +2 -2
  13. package/protoc/v1/workflows.d.ts +11 -0
  14. package/protoc/v1/workflows.js +105 -3
  15. package/step.js +3 -2
  16. package/util/apply-namespace.d.ts +1 -0
  17. package/util/apply-namespace.js +9 -0
  18. package/util/config-loader/config-loader.js +5 -2
  19. package/util/uuid.d.ts +1 -0
  20. package/util/uuid.js +7 -0
  21. package/v1/client/admin.js +3 -8
  22. package/v1/client/client.d.ts +20 -5
  23. package/v1/client/client.interface.d.ts +4 -0
  24. package/v1/client/client.js +48 -11
  25. package/{clients/hatchet-client/features/cron-client.d.ts → v1/client/features/crons.d.ts} +13 -19
  26. package/{clients/hatchet-client/features/cron-client.js → v1/client/features/crons.js} +31 -16
  27. package/v1/client/features/filters.d.ts +1 -0
  28. package/v1/client/features/filters.js +6 -0
  29. package/v1/client/features/index.d.ts +2 -0
  30. package/v1/client/features/index.js +2 -0
  31. package/v1/client/features/runs.d.ts +1 -0
  32. package/v1/client/features/runs.js +7 -0
  33. package/{clients/hatchet-client/features/schedule-client.d.ts → v1/client/features/schedules.d.ts} +12 -18
  34. package/{clients/hatchet-client/features/schedule-client.js → v1/client/features/schedules.js} +31 -16
  35. package/v1/client/features/tenant.d.ts +15 -0
  36. package/v1/client/features/tenant.js +31 -0
  37. package/v1/client/features/workflows.d.ts +10 -3
  38. package/v1/client/features/workflows.js +43 -1
  39. package/v1/client/worker/context.js +3 -2
  40. package/v1/client/worker/worker-internal.d.ts +1 -2
  41. package/v1/client/worker/worker-internal.js +11 -5
  42. package/v1/declaration.d.ts +7 -2
  43. package/v1/declaration.js +5 -3
  44. package/v1/examples/cancellations/workflow.js +2 -2
  45. package/v1/examples/on_event/workflow.d.ts +1 -0
  46. package/v1/examples/on_event/workflow.js +27 -1
  47. package/v1/examples/simple/cron.js +1 -1
  48. package/v1/examples/simple/schedule.js +3 -3
  49. package/version.d.ts +1 -1
  50. package/version.js +1 -1
@@ -1,164 +1,3 @@
1
- export declare enum V1LogLineLevel {
2
- DEBUG = "DEBUG",
3
- INFO = "INFO",
4
- WARN = "WARN",
5
- ERROR = "ERROR"
6
- }
7
- export declare enum V1TaskRunStatus {
8
- PENDING = "PENDING",
9
- RUNNING = "RUNNING",
10
- COMPLETED = "COMPLETED",
11
- FAILED = "FAILED",
12
- CANCELLED = "CANCELLED"
13
- }
14
- export declare enum V1TaskStatus {
15
- QUEUED = "QUEUED",
16
- RUNNING = "RUNNING",
17
- COMPLETED = "COMPLETED",
18
- CANCELLED = "CANCELLED",
19
- FAILED = "FAILED"
20
- }
21
- export declare enum WebhookWorkerRequestMethod {
22
- GET = "GET",
23
- POST = "POST",
24
- PUT = "PUT"
25
- }
26
- export declare enum LogLineOrderByDirection {
27
- Asc = "asc",
28
- Desc = "desc"
29
- }
30
- export declare enum LogLineOrderByField {
31
- CreatedAt = "createdAt"
32
- }
33
- export declare enum LogLineLevel {
34
- DEBUG = "DEBUG",
35
- INFO = "INFO",
36
- WARN = "WARN",
37
- ERROR = "ERROR"
38
- }
39
- export declare enum PullRequestState {
40
- Open = "open",
41
- Closed = "closed"
42
- }
43
- export declare enum WorkerRuntimeSDKs {
44
- GOLANG = "GOLANG",
45
- PYTHON = "PYTHON",
46
- TYPESCRIPT = "TYPESCRIPT"
47
- }
48
- export declare enum StepRunEventSeverity {
49
- INFO = "INFO",
50
- WARNING = "WARNING",
51
- CRITICAL = "CRITICAL"
52
- }
53
- export declare enum StepRunEventReason {
54
- REQUEUED_NO_WORKER = "REQUEUED_NO_WORKER",
55
- REQUEUED_RATE_LIMIT = "REQUEUED_RATE_LIMIT",
56
- SCHEDULING_TIMED_OUT = "SCHEDULING_TIMED_OUT",
57
- ASSIGNED = "ASSIGNED",
58
- STARTED = "STARTED",
59
- ACKNOWLEDGED = "ACKNOWLEDGED",
60
- FINISHED = "FINISHED",
61
- FAILED = "FAILED",
62
- RETRYING = "RETRYING",
63
- CANCELLED = "CANCELLED",
64
- TIMEOUT_REFRESHED = "TIMEOUT_REFRESHED",
65
- REASSIGNED = "REASSIGNED",
66
- TIMED_OUT = "TIMED_OUT",
67
- SLOT_RELEASED = "SLOT_RELEASED",
68
- RETRIED_BY_USER = "RETRIED_BY_USER",
69
- WORKFLOW_RUN_GROUP_KEY_SUCCEEDED = "WORKFLOW_RUN_GROUP_KEY_SUCCEEDED",
70
- WORKFLOW_RUN_GROUP_KEY_FAILED = "WORKFLOW_RUN_GROUP_KEY_FAILED"
71
- }
72
- export declare enum StepRunStatus {
73
- PENDING = "PENDING",
74
- PENDING_ASSIGNMENT = "PENDING_ASSIGNMENT",
75
- ASSIGNED = "ASSIGNED",
76
- RUNNING = "RUNNING",
77
- SUCCEEDED = "SUCCEEDED",
78
- FAILED = "FAILED",
79
- CANCELLED = "CANCELLED",
80
- CANCELLING = "CANCELLING",
81
- BACKOFF = "BACKOFF"
82
- }
83
- export declare enum JobRunStatus {
84
- PENDING = "PENDING",
85
- RUNNING = "RUNNING",
86
- SUCCEEDED = "SUCCEEDED",
87
- FAILED = "FAILED",
88
- CANCELLED = "CANCELLED",
89
- BACKOFF = "BACKOFF"
90
- }
91
- export declare enum WorkflowKind {
92
- FUNCTION = "FUNCTION",
93
- DURABLE = "DURABLE",
94
- DAG = "DAG"
95
- }
96
- export declare enum WorkflowRunStatus {
97
- PENDING = "PENDING",
98
- RUNNING = "RUNNING",
99
- SUCCEEDED = "SUCCEEDED",
100
- FAILED = "FAILED",
101
- CANCELLED = "CANCELLED",
102
- QUEUED = "QUEUED",
103
- BACKOFF = "BACKOFF"
104
- }
105
- export declare enum WorkflowRunOrderByDirection {
106
- ASC = "ASC",
107
- DESC = "DESC"
108
- }
109
- export declare enum WorkflowRunOrderByField {
110
- CreatedAt = "createdAt",
111
- StartedAt = "startedAt",
112
- FinishedAt = "finishedAt",
113
- Duration = "duration"
114
- }
115
- export declare enum CronWorkflowsOrderByField {
116
- Name = "name",
117
- CreatedAt = "createdAt"
118
- }
119
- export declare enum ScheduledRunStatus {
120
- PENDING = "PENDING",
121
- RUNNING = "RUNNING",
122
- SUCCEEDED = "SUCCEEDED",
123
- FAILED = "FAILED",
124
- CANCELLED = "CANCELLED",
125
- QUEUED = "QUEUED",
126
- SCHEDULED = "SCHEDULED"
127
- }
128
- export declare enum ScheduledWorkflowsOrderByField {
129
- TriggerAt = "triggerAt",
130
- CreatedAt = "createdAt"
131
- }
132
- export declare enum RateLimitOrderByDirection {
133
- Asc = "asc",
134
- Desc = "desc"
135
- }
136
- export declare enum RateLimitOrderByField {
137
- Key = "key",
138
- Value = "value",
139
- LimitValue = "limitValue"
140
- }
141
- export declare enum EventOrderByDirection {
142
- Asc = "asc",
143
- Desc = "desc"
144
- }
145
- export declare enum EventOrderByField {
146
- CreatedAt = "createdAt"
147
- }
148
- export declare enum TenantResource {
149
- WORKER = "WORKER",
150
- WORKER_SLOT = "WORKER_SLOT",
151
- EVENT = "EVENT",
152
- WORKFLOW_RUN = "WORKFLOW_RUN",
153
- TASK_RUN = "TASK_RUN",
154
- CRON = "CRON",
155
- SCHEDULE = "SCHEDULE"
156
- }
157
- export declare enum TenantMemberRole {
158
- OWNER = "OWNER",
159
- ADMIN = "ADMIN",
160
- MEMBER = "MEMBER"
161
- }
162
1
  export interface APIMeta {
163
2
  auth?: APIMetaAuth;
164
3
  /**
@@ -352,6 +191,8 @@ export interface Tenant {
352
191
  alertMemberEmails?: boolean;
353
192
  /** The version of the tenant. */
354
193
  version: 'V0' | 'V1';
194
+ /** The UI of the tenant. */
195
+ uiVersion?: 'V0' | 'V1';
355
196
  }
356
197
  export interface TenantMember {
357
198
  metadata: APIResourceMeta;
@@ -366,6 +207,20 @@ export interface TenantMemberList {
366
207
  pagination?: PaginationResponse;
367
208
  rows?: TenantMember[];
368
209
  }
210
+ export declare enum TenantMemberRole {
211
+ OWNER = "OWNER",
212
+ ADMIN = "ADMIN",
213
+ MEMBER = "MEMBER"
214
+ }
215
+ export declare enum TenantResource {
216
+ WORKER = "WORKER",
217
+ WORKER_SLOT = "WORKER_SLOT",
218
+ EVENT = "EVENT",
219
+ WORKFLOW_RUN = "WORKFLOW_RUN",
220
+ TASK_RUN = "TASK_RUN",
221
+ CRON = "CRON",
222
+ SCHEDULE = "SCHEDULE"
223
+ }
369
224
  export interface TenantResourceLimit {
370
225
  metadata: APIResourceMeta;
371
226
  /** The resource associated with this limit. */
@@ -495,6 +350,10 @@ export interface CreateTenantRequest {
495
350
  name: string;
496
351
  /** The slug of the tenant. */
497
352
  slug: string;
353
+ /** The UI version of the tenant. Defaults to V0. */
354
+ uiVersion?: any;
355
+ /** The engine version of the tenant. Defaults to V0. */
356
+ engineVersion?: any;
498
357
  }
499
358
  export interface UpdateTenantRequest {
500
359
  /** The name of the tenant. */
@@ -513,6 +372,8 @@ export interface UpdateTenantRequest {
513
372
  maxAlertingFrequency?: string;
514
373
  /** The version of the tenant. */
515
374
  version?: any;
375
+ /** The UI of the tenant. */
376
+ uiVersion?: any;
516
377
  }
517
378
  export interface Event {
518
379
  metadata: APIResourceMeta;
@@ -586,6 +447,13 @@ export interface EventWorkflowRunSummary {
586
447
  */
587
448
  cancelled?: number;
588
449
  }
450
+ export declare enum EventOrderByField {
451
+ CreatedAt = "createdAt"
452
+ }
453
+ export declare enum EventOrderByDirection {
454
+ Asc = "asc",
455
+ Desc = "desc"
456
+ }
589
457
  export type EventSearch = string;
590
458
  export interface EventKeyList {
591
459
  pagination?: PaginationResponse;
@@ -639,6 +507,30 @@ export interface V1EventList {
639
507
  };
640
508
  /** Additional metadata for the event. */
641
509
  additionalMetadata?: object;
510
+ /** The payload of the event, which can be any JSON-serializable object. */
511
+ payload?: object;
512
+ /** The scope of the event, which can be used to filter or categorize events. */
513
+ scope?: string;
514
+ /**
515
+ * The timestamp when the event was seen.
516
+ * @format date-time
517
+ */
518
+ seenAt?: string;
519
+ /** The external IDs of the runs that were triggered by this event. */
520
+ triggeredRuns?: {
521
+ /**
522
+ * The external ID of the triggered run.
523
+ * @format uuid
524
+ * @minLength 36
525
+ * @maxLength 36
526
+ */
527
+ workflowRunId: string;
528
+ /**
529
+ * The ID of the filter that triggered the run, if applicable.
530
+ * @format uuid
531
+ */
532
+ filterId?: string;
533
+ }[];
642
534
  }[];
643
535
  }
644
536
  export interface V1FilterList {
@@ -685,6 +577,15 @@ export interface RateLimitList {
685
577
  pagination?: PaginationResponse;
686
578
  rows?: RateLimit[];
687
579
  }
580
+ export declare enum RateLimitOrderByField {
581
+ Key = "key",
582
+ Value = "value",
583
+ LimitValue = "limitValue"
584
+ }
585
+ export declare enum RateLimitOrderByDirection {
586
+ Asc = "asc",
587
+ Desc = "desc"
588
+ }
688
589
  export interface ReplayEventRequest {
689
590
  eventIds: string[];
690
591
  }
@@ -920,6 +821,19 @@ export interface ScheduledWorkflowsList {
920
821
  rows?: ScheduledWorkflows[];
921
822
  pagination?: PaginationResponse;
922
823
  }
824
+ export declare enum ScheduledWorkflowsOrderByField {
825
+ TriggerAt = "triggerAt",
826
+ CreatedAt = "createdAt"
827
+ }
828
+ export declare enum ScheduledRunStatus {
829
+ PENDING = "PENDING",
830
+ RUNNING = "RUNNING",
831
+ SUCCEEDED = "SUCCEEDED",
832
+ FAILED = "FAILED",
833
+ CANCELLED = "CANCELLED",
834
+ QUEUED = "QUEUED",
835
+ SCHEDULED = "SCHEDULED"
836
+ }
923
837
  export interface CronWorkflows {
924
838
  metadata: APIResourceMeta;
925
839
  tenantId: string;
@@ -943,6 +857,20 @@ export interface CronWorkflowsList {
943
857
  rows?: CronWorkflows[];
944
858
  pagination?: PaginationResponse;
945
859
  }
860
+ export declare enum CronWorkflowsOrderByField {
861
+ Name = "name",
862
+ CreatedAt = "createdAt"
863
+ }
864
+ export declare enum WorkflowRunOrderByField {
865
+ CreatedAt = "createdAt",
866
+ StartedAt = "startedAt",
867
+ FinishedAt = "finishedAt",
868
+ Duration = "duration"
869
+ }
870
+ export declare enum WorkflowRunOrderByDirection {
871
+ ASC = "ASC",
872
+ DESC = "DESC"
873
+ }
946
874
  export interface WorkflowRunsMetrics {
947
875
  counts?: WorkflowRunsMetricsCounts;
948
876
  }
@@ -954,11 +882,44 @@ export interface WorkflowRunsMetricsCounts {
954
882
  QUEUED?: number;
955
883
  CANCELLED?: number;
956
884
  }
885
+ export declare enum WorkflowRunStatus {
886
+ PENDING = "PENDING",
887
+ RUNNING = "RUNNING",
888
+ SUCCEEDED = "SUCCEEDED",
889
+ FAILED = "FAILED",
890
+ CANCELLED = "CANCELLED",
891
+ QUEUED = "QUEUED",
892
+ BACKOFF = "BACKOFF"
893
+ }
957
894
  export type WorkflowRunStatusList = WorkflowRunStatus[];
895
+ export declare enum WorkflowKind {
896
+ FUNCTION = "FUNCTION",
897
+ DURABLE = "DURABLE",
898
+ DAG = "DAG"
899
+ }
958
900
  export type WorkflowKindList = WorkflowKind[];
959
901
  export interface WorkflowRunsCancelRequest {
960
902
  workflowRunIds: string[];
961
903
  }
904
+ export declare enum JobRunStatus {
905
+ PENDING = "PENDING",
906
+ RUNNING = "RUNNING",
907
+ SUCCEEDED = "SUCCEEDED",
908
+ FAILED = "FAILED",
909
+ CANCELLED = "CANCELLED",
910
+ BACKOFF = "BACKOFF"
911
+ }
912
+ export declare enum StepRunStatus {
913
+ PENDING = "PENDING",
914
+ PENDING_ASSIGNMENT = "PENDING_ASSIGNMENT",
915
+ ASSIGNED = "ASSIGNED",
916
+ RUNNING = "RUNNING",
917
+ SUCCEEDED = "SUCCEEDED",
918
+ FAILED = "FAILED",
919
+ CANCELLED = "CANCELLED",
920
+ CANCELLING = "CANCELLING",
921
+ BACKOFF = "BACKOFF"
922
+ }
962
923
  export interface JobRun {
963
924
  metadata: APIResourceMeta;
964
925
  tenantId: string;
@@ -1021,6 +982,30 @@ export interface StepRun {
1021
982
  cancelledReason?: string;
1022
983
  cancelledError?: string;
1023
984
  }
985
+ export declare enum StepRunEventReason {
986
+ REQUEUED_NO_WORKER = "REQUEUED_NO_WORKER",
987
+ REQUEUED_RATE_LIMIT = "REQUEUED_RATE_LIMIT",
988
+ SCHEDULING_TIMED_OUT = "SCHEDULING_TIMED_OUT",
989
+ ASSIGNED = "ASSIGNED",
990
+ STARTED = "STARTED",
991
+ ACKNOWLEDGED = "ACKNOWLEDGED",
992
+ FINISHED = "FINISHED",
993
+ FAILED = "FAILED",
994
+ RETRYING = "RETRYING",
995
+ CANCELLED = "CANCELLED",
996
+ TIMEOUT_REFRESHED = "TIMEOUT_REFRESHED",
997
+ REASSIGNED = "REASSIGNED",
998
+ TIMED_OUT = "TIMED_OUT",
999
+ SLOT_RELEASED = "SLOT_RELEASED",
1000
+ RETRIED_BY_USER = "RETRIED_BY_USER",
1001
+ WORKFLOW_RUN_GROUP_KEY_SUCCEEDED = "WORKFLOW_RUN_GROUP_KEY_SUCCEEDED",
1002
+ WORKFLOW_RUN_GROUP_KEY_FAILED = "WORKFLOW_RUN_GROUP_KEY_FAILED"
1003
+ }
1004
+ export declare enum StepRunEventSeverity {
1005
+ INFO = "INFO",
1006
+ WARNING = "WARNING",
1007
+ CRITICAL = "CRITICAL"
1008
+ }
1024
1009
  export interface StepRunEvent {
1025
1010
  id: number;
1026
1011
  /** @format date-time */
@@ -1074,6 +1059,11 @@ export interface WorkerRuntimeInfo {
1074
1059
  os?: string;
1075
1060
  runtimeExtra?: string;
1076
1061
  }
1062
+ export declare enum WorkerRuntimeSDKs {
1063
+ GOLANG = "GOLANG",
1064
+ PYTHON = "PYTHON",
1065
+ TYPESCRIPT = "TYPESCRIPT"
1066
+ }
1077
1067
  export interface WorkerList {
1078
1068
  pagination?: PaginationResponse;
1079
1069
  rows?: Worker[];
@@ -1261,6 +1251,10 @@ export interface PullRequest {
1261
1251
  pullRequestBaseBranch: string;
1262
1252
  pullRequestState: PullRequestState;
1263
1253
  }
1254
+ export declare enum PullRequestState {
1255
+ Open = "open",
1256
+ Closed = "closed"
1257
+ }
1264
1258
  export interface LogLine {
1265
1259
  /**
1266
1260
  * The creation date of the log line.
@@ -1272,10 +1266,23 @@ export interface LogLine {
1272
1266
  /** The log metadata. */
1273
1267
  metadata: object;
1274
1268
  }
1269
+ export declare enum LogLineLevel {
1270
+ DEBUG = "DEBUG",
1271
+ INFO = "INFO",
1272
+ WARN = "WARN",
1273
+ ERROR = "ERROR"
1274
+ }
1275
1275
  export interface LogLineList {
1276
1276
  pagination?: PaginationResponse;
1277
1277
  rows?: LogLine[];
1278
1278
  }
1279
+ export declare enum LogLineOrderByField {
1280
+ CreatedAt = "createdAt"
1281
+ }
1282
+ export declare enum LogLineOrderByDirection {
1283
+ Asc = "asc",
1284
+ Desc = "desc"
1285
+ }
1279
1286
  export type LogLineSearch = string;
1280
1287
  export type LogLineLevelField = LogLineLevel[];
1281
1288
  export interface SNSIntegration {
@@ -1331,6 +1338,11 @@ export interface WebhookWorker {
1331
1338
  /** The webhook url. */
1332
1339
  url: string;
1333
1340
  }
1341
+ export declare enum WebhookWorkerRequestMethod {
1342
+ GET = "GET",
1343
+ POST = "POST",
1344
+ PUT = "PUT"
1345
+ }
1334
1346
  export interface WebhookWorkerRequest {
1335
1347
  /**
1336
1348
  * The date and time the request was created.
@@ -1497,6 +1509,13 @@ export interface V1TaskEventList {
1497
1509
  attempt?: number;
1498
1510
  }[];
1499
1511
  }
1512
+ export declare enum V1TaskStatus {
1513
+ QUEUED = "QUEUED",
1514
+ RUNNING = "RUNNING",
1515
+ COMPLETED = "COMPLETED",
1516
+ CANCELLED = "CANCELLED",
1517
+ FAILED = "FAILED"
1518
+ }
1500
1519
  export type V1TaskRunMetrics = {
1501
1520
  status: V1TaskStatus;
1502
1521
  count: number;
@@ -1603,6 +1622,13 @@ export interface V1WorkflowRunDetails {
1603
1622
  }[];
1604
1623
  tasks: V1TaskSummary[];
1605
1624
  }
1625
+ export declare enum V1TaskRunStatus {
1626
+ PENDING = "PENDING",
1627
+ RUNNING = "RUNNING",
1628
+ COMPLETED = "COMPLETED",
1629
+ FAILED = "FAILED",
1630
+ CANCELLED = "CANCELLED"
1631
+ }
1606
1632
  export interface V1TriggerWorkflowRunRequest {
1607
1633
  /** The name of the workflow. */
1608
1634
  workflowName: string;
@@ -1628,6 +1654,12 @@ export interface V1LogLine {
1628
1654
  /** The log level. */
1629
1655
  level?: V1LogLineLevel;
1630
1656
  }
1657
+ export declare enum V1LogLineLevel {
1658
+ DEBUG = "DEBUG",
1659
+ INFO = "INFO",
1660
+ WARN = "WARN",
1661
+ ERROR = "ERROR"
1662
+ }
1631
1663
  export interface V1LogLineList {
1632
1664
  pagination?: PaginationResponse;
1633
1665
  rows?: V1LogLine[];
@@ -1713,3 +1745,11 @@ export interface V1CreateFilterRequest {
1713
1745
  /** The payload for the filter */
1714
1746
  payload?: object;
1715
1747
  }
1748
+ export interface V1UpdateFilterRequest {
1749
+ /** The expression for the filter */
1750
+ expression?: string;
1751
+ /** The scope associated with this filter. Used for subsetting candidate filters at evaluation time */
1752
+ scope?: string;
1753
+ /** The payload for the filter */
1754
+ payload?: object;
1755
+ }