@hatchet-dev/typescript-sdk 1.28.2 → 1.29.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.
- package/clients/rest/generated/Api.d.ts +65 -1
- package/clients/rest/generated/Api.js +53 -0
- package/clients/rest/generated/data-contracts.d.ts +99 -3
- package/clients/rest/generated/data-contracts.js +7 -1
- package/package.json +1 -1
- package/v1/client/client.d.ts +1 -1
- package/v1/client/client.js +1 -1
- package/v1/client/features/tenant.d.ts +0 -3
- package/v1/client/worker/context.d.ts +1 -1
- package/v1/client/worker/context.js +2 -2
- package/v1/declaration.js +1 -1
- package/v1/embedded.d.ts +71 -0
- package/v1/embedded.js +344 -0
- package/v1/examples/embedded/worker.d.ts +2 -0
- package/v1/examples/embedded/worker.js +76 -0
- package/v1/examples/migration-guides/temporal.d.ts +76 -0
- package/v1/examples/migration-guides/temporal.js +280 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIErrors, APIMeta, AcceptInviteRequest, BulkCreateEventRequest, CancelEventRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreateCronWorkflowTriggerRequest, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, CronWorkflows, CronWorkflowsList, CronWorkflowsOrderByField, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, Events, FeatureFlagEvaluationResult, FeatureFlagId, ListAPIMetaIntegration, ListAPITokensResponse, ListSNSIntegrations, ListSlackWebhooks, OtelSpanList, RateLimitList, RateLimitOrderByDirection, RateLimitOrderByField, RejectInviteRequest, ReplayEventRequest, ReplayWorkflowRunsRequest, ReplayWorkflowRunsResponse, RerunStepRunRequest, SNSIntegration, ScheduleWorkflowRunRequest, ScheduledRunStatus, ScheduledWorkflows, ScheduledWorkflowsBulkDeleteRequest, ScheduledWorkflowsBulkDeleteResponse, ScheduledWorkflowsBulkUpdateRequest, ScheduledWorkflowsBulkUpdateResponse, ScheduledWorkflowsList, ScheduledWorkflowsOrderByField, StepRun, StepRunArchiveList, StepRunEventList, TaskStats, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TenantStepRunQueueMetrics, TriggerRunResult, TriggerWorkflowRunRequest, UpdateCronWorkflowTriggerRequest, UpdateScheduledWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantMemberRequest, UpdateTenantRequest, UpdateWorkerRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, V1AdditionalMetadataOperator, V1BranchDurableTaskRequest, V1BranchDurableTaskResponse, V1CELDebugRequest, V1CELDebugResponse, V1CancelTaskRequest, V1CancelledTasks, V1CreateFilterRequest, V1CreateWebhookRequest, V1DagChildren, V1DurableEventLogList, V1Event, V1EventList, V1Filter, V1FilterList, V1LogLineLevel, V1LogLineList, V1LogLineOrderByDirection, V1LogsPointMetrics, V1ReplayTaskRequest, V1ReplayedTasks, V1RestoreTaskResponse, V1RunningFilter, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummary, V1TaskSummaryList, V1TaskTimingList, V1TriggerWorkflowRunRequest, V1UpdateFilterRequest, V1UpdateWebhookRequest, V1Webhook, V1WebhookList, V1WebhookResponse, V1WebhookSourceName, V1WorkflowRunDetails, V1WorkflowRunDisplayNameList, V1WorkflowRunExternalIdList, WebhookWorkerCreateRequest, WebhookWorkerCreated, WebhookWorkerListResponse, WebhookWorkerRequestListResponse, Worker, WorkerList, WorkerStatus, Workflow, WorkflowID, WorkflowKindList, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunOrderByDirection, WorkflowRunOrderByField, WorkflowRunShape, WorkflowRunStatus, WorkflowRunStatusList, WorkflowRunsCancelRequest, WorkflowRunsMetrics, WorkflowUpdateRequest, WorkflowVersion, WorkflowWorkersCount } from './data-contracts';
|
|
1
|
+
import { APIErrors, APIMeta, AcceptInviteRequest, BulkCreateEventRequest, CancelEventRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreateCronWorkflowTriggerRequest, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, CronWorkflows, CronWorkflowsList, CronWorkflowsOrderByField, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, Events, FeatureFlagEvaluationResult, FeatureFlagId, ListAPIMetaIntegration, ListAPITokensResponse, ListSNSIntegrations, ListSlackWebhooks, OtelSpanList, RateLimitList, RateLimitOrderByDirection, RateLimitOrderByField, RejectInviteRequest, ReplayEventRequest, ReplayWorkflowRunsRequest, ReplayWorkflowRunsResponse, RerunStepRunRequest, SNSIntegration, ScheduleWorkflowRunRequest, ScheduledRunStatus, ScheduledWorkflows, ScheduledWorkflowsBulkDeleteRequest, ScheduledWorkflowsBulkDeleteResponse, ScheduledWorkflowsBulkUpdateRequest, ScheduledWorkflowsBulkUpdateResponse, ScheduledWorkflowsList, ScheduledWorkflowsOrderByField, StepRun, StepRunArchiveList, StepRunEventList, TaskStats, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TenantStepRunQueueMetrics, TriggerRunResult, TriggerWorkflowRunRequest, UpdateCronWorkflowTriggerRequest, UpdateScheduledWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantMemberRequest, UpdateTenantRequest, UpdateWorkerRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, V1AdditionalMetadataOperator, V1BranchDurableTaskRequest, V1BranchDurableTaskResponse, V1CELDebugRequest, V1CELDebugResponse, V1CancelTaskRequest, V1CancelledTasks, V1CreateFilterRequest, V1CreateHTTPOperatorRequest, V1CreateWebhookRequest, V1DagChildren, V1DurableEventLogList, V1Event, V1EventList, V1Filter, V1FilterList, V1HTTPOperator, V1HTTPOperatorList, V1LogLineLevel, V1LogLineList, V1LogLineOrderByDirection, V1LogsPointMetrics, V1ReplayTaskRequest, V1ReplayedTasks, V1RestoreTaskResponse, V1RunningFilter, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummary, V1TaskSummaryList, V1TaskTimingList, V1TriggerWorkflowRunRequest, V1UpdateFilterRequest, V1UpdateHTTPOperatorRequest, V1UpdateWebhookRequest, V1Webhook, V1WebhookList, V1WebhookResponse, V1WebhookSourceName, V1WorkflowRunDetails, V1WorkflowRunDisplayNameList, V1WorkflowRunExternalIdList, WebhookWorkerCreateRequest, WebhookWorkerCreated, WebhookWorkerListResponse, WebhookWorkerRequestListResponse, Worker, WorkerList, WorkerStatus, Workflow, WorkflowID, WorkflowKindList, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunOrderByDirection, WorkflowRunOrderByField, WorkflowRunShape, WorkflowRunStatus, WorkflowRunStatusList, WorkflowRunsCancelRequest, WorkflowRunsMetrics, WorkflowUpdateRequest, WorkflowVersion, WorkflowWorkersCount } from './data-contracts';
|
|
2
2
|
import { HttpClient, RequestParams } from './http-client';
|
|
3
3
|
export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
4
4
|
/**
|
|
@@ -601,6 +601,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
601
601
|
*
|
|
602
602
|
* @tags Filter
|
|
603
603
|
* @name V1FilterDelete
|
|
604
|
+
* @summary Delete a filter
|
|
604
605
|
* @request DELETE:/api/v1/stable/tenants/{tenant}/filters/{v1-filter}
|
|
605
606
|
* @secure
|
|
606
607
|
*/
|
|
@@ -610,6 +611,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
610
611
|
*
|
|
611
612
|
* @tags Filter
|
|
612
613
|
* @name V1FilterUpdate
|
|
614
|
+
* @summary Update a filter
|
|
613
615
|
* @request PATCH:/api/v1/stable/tenants/{tenant}/filters/{v1-filter}
|
|
614
616
|
* @secure
|
|
615
617
|
*/
|
|
@@ -664,6 +666,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
664
666
|
*
|
|
665
667
|
* @tags Webhook
|
|
666
668
|
* @name V1WebhookDelete
|
|
669
|
+
* @summary Delete a webhook
|
|
667
670
|
* @request DELETE:/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}
|
|
668
671
|
* @secure
|
|
669
672
|
*/
|
|
@@ -687,6 +690,67 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
687
690
|
* @secure
|
|
688
691
|
*/
|
|
689
692
|
v1WebhookUpdate: (tenant: string, v1Webhook: string, data: V1UpdateWebhookRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1Webhook, any, {}>>;
|
|
693
|
+
/**
|
|
694
|
+
* @description Lists all HTTP operators for a tenant.
|
|
695
|
+
*
|
|
696
|
+
* @tags Operator
|
|
697
|
+
* @name V1HttpOperatorList
|
|
698
|
+
* @summary List HTTP operators
|
|
699
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/operators/http
|
|
700
|
+
* @secure
|
|
701
|
+
*/
|
|
702
|
+
v1HttpOperatorList: (tenant: string, query?: {
|
|
703
|
+
/**
|
|
704
|
+
* The number to skip
|
|
705
|
+
* @format int64
|
|
706
|
+
*/
|
|
707
|
+
offset?: number;
|
|
708
|
+
/**
|
|
709
|
+
* The number to limit by
|
|
710
|
+
* @format int64
|
|
711
|
+
*/
|
|
712
|
+
limit?: number;
|
|
713
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1HTTPOperatorList, any, {}>>;
|
|
714
|
+
/**
|
|
715
|
+
* @description Create a new HTTP operator
|
|
716
|
+
*
|
|
717
|
+
* @tags Operator
|
|
718
|
+
* @name V1HttpOperatorCreate
|
|
719
|
+
* @summary Create an HTTP operator
|
|
720
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/operators/http
|
|
721
|
+
* @secure
|
|
722
|
+
*/
|
|
723
|
+
v1HttpOperatorCreate: (tenant: string, data: V1CreateHTTPOperatorRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1HTTPOperator, any, {}>>;
|
|
724
|
+
/**
|
|
725
|
+
* @description Get an HTTP operator by its id
|
|
726
|
+
*
|
|
727
|
+
* @tags Operator
|
|
728
|
+
* @name V1HttpOperatorGet
|
|
729
|
+
* @summary Get an HTTP operator
|
|
730
|
+
* @request GET:/api/v1/stable/operators/http/{v1-http-operator}
|
|
731
|
+
* @secure
|
|
732
|
+
*/
|
|
733
|
+
v1HttpOperatorGet: (v1HttpOperator: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1HTTPOperator, any, {}>>;
|
|
734
|
+
/**
|
|
735
|
+
* @description Update an HTTP operator
|
|
736
|
+
*
|
|
737
|
+
* @tags Operator
|
|
738
|
+
* @name V1HttpOperatorUpdate
|
|
739
|
+
* @summary Update an HTTP operator
|
|
740
|
+
* @request PATCH:/api/v1/stable/operators/http/{v1-http-operator}
|
|
741
|
+
* @secure
|
|
742
|
+
*/
|
|
743
|
+
v1HttpOperatorUpdate: (v1HttpOperator: string, data: V1UpdateHTTPOperatorRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1HTTPOperator, any, {}>>;
|
|
744
|
+
/**
|
|
745
|
+
* @description Delete an HTTP operator
|
|
746
|
+
*
|
|
747
|
+
* @tags Operator
|
|
748
|
+
* @name V1HttpOperatorDelete
|
|
749
|
+
* @summary Delete an HTTP operator
|
|
750
|
+
* @request DELETE:/api/v1/stable/operators/http/{v1-http-operator}
|
|
751
|
+
* @secure
|
|
752
|
+
*/
|
|
753
|
+
v1HttpOperatorDelete: (v1HttpOperator: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1HTTPOperator, any, {}>>;
|
|
690
754
|
/**
|
|
691
755
|
* @description Evaluate a CEL expression against provided input data.
|
|
692
756
|
*
|
|
@@ -301,6 +301,7 @@ class Api extends http_client_1.HttpClient {
|
|
|
301
301
|
*
|
|
302
302
|
* @tags Filter
|
|
303
303
|
* @name V1FilterDelete
|
|
304
|
+
* @summary Delete a filter
|
|
304
305
|
* @request DELETE:/api/v1/stable/tenants/{tenant}/filters/{v1-filter}
|
|
305
306
|
* @secure
|
|
306
307
|
*/
|
|
@@ -310,6 +311,7 @@ class Api extends http_client_1.HttpClient {
|
|
|
310
311
|
*
|
|
311
312
|
* @tags Filter
|
|
312
313
|
* @name V1FilterUpdate
|
|
314
|
+
* @summary Update a filter
|
|
313
315
|
* @request PATCH:/api/v1/stable/tenants/{tenant}/filters/{v1-filter}
|
|
314
316
|
* @secure
|
|
315
317
|
*/
|
|
@@ -349,6 +351,7 @@ class Api extends http_client_1.HttpClient {
|
|
|
349
351
|
*
|
|
350
352
|
* @tags Webhook
|
|
351
353
|
* @name V1WebhookDelete
|
|
354
|
+
* @summary Delete a webhook
|
|
352
355
|
* @request DELETE:/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}
|
|
353
356
|
* @secure
|
|
354
357
|
*/
|
|
@@ -372,6 +375,56 @@ class Api extends http_client_1.HttpClient {
|
|
|
372
375
|
* @secure
|
|
373
376
|
*/
|
|
374
377
|
this.v1WebhookUpdate = (tenant, v1Webhook, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/webhooks/${v1Webhook}`, method: 'PATCH', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
378
|
+
/**
|
|
379
|
+
* @description Lists all HTTP operators for a tenant.
|
|
380
|
+
*
|
|
381
|
+
* @tags Operator
|
|
382
|
+
* @name V1HttpOperatorList
|
|
383
|
+
* @summary List HTTP operators
|
|
384
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/operators/http
|
|
385
|
+
* @secure
|
|
386
|
+
*/
|
|
387
|
+
this.v1HttpOperatorList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/operators/http`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
388
|
+
/**
|
|
389
|
+
* @description Create a new HTTP operator
|
|
390
|
+
*
|
|
391
|
+
* @tags Operator
|
|
392
|
+
* @name V1HttpOperatorCreate
|
|
393
|
+
* @summary Create an HTTP operator
|
|
394
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/operators/http
|
|
395
|
+
* @secure
|
|
396
|
+
*/
|
|
397
|
+
this.v1HttpOperatorCreate = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/operators/http`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
398
|
+
/**
|
|
399
|
+
* @description Get an HTTP operator by its id
|
|
400
|
+
*
|
|
401
|
+
* @tags Operator
|
|
402
|
+
* @name V1HttpOperatorGet
|
|
403
|
+
* @summary Get an HTTP operator
|
|
404
|
+
* @request GET:/api/v1/stable/operators/http/{v1-http-operator}
|
|
405
|
+
* @secure
|
|
406
|
+
*/
|
|
407
|
+
this.v1HttpOperatorGet = (v1HttpOperator, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/operators/http/${v1HttpOperator}`, method: 'GET', secure: true, format: 'json' }, params));
|
|
408
|
+
/**
|
|
409
|
+
* @description Update an HTTP operator
|
|
410
|
+
*
|
|
411
|
+
* @tags Operator
|
|
412
|
+
* @name V1HttpOperatorUpdate
|
|
413
|
+
* @summary Update an HTTP operator
|
|
414
|
+
* @request PATCH:/api/v1/stable/operators/http/{v1-http-operator}
|
|
415
|
+
* @secure
|
|
416
|
+
*/
|
|
417
|
+
this.v1HttpOperatorUpdate = (v1HttpOperator, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/operators/http/${v1HttpOperator}`, method: 'PATCH', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
418
|
+
/**
|
|
419
|
+
* @description Delete an HTTP operator
|
|
420
|
+
*
|
|
421
|
+
* @tags Operator
|
|
422
|
+
* @name V1HttpOperatorDelete
|
|
423
|
+
* @summary Delete an HTTP operator
|
|
424
|
+
* @request DELETE:/api/v1/stable/operators/http/{v1-http-operator}
|
|
425
|
+
* @secure
|
|
426
|
+
*/
|
|
427
|
+
this.v1HttpOperatorDelete = (v1HttpOperator, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/operators/http/${v1HttpOperator}`, method: 'DELETE', secure: true, format: 'json' }, params));
|
|
375
428
|
/**
|
|
376
429
|
* @description Evaluate a CEL expression against provided input data.
|
|
377
430
|
*
|
|
@@ -141,6 +141,10 @@ export declare enum ScheduledWorkflowsMethod {
|
|
|
141
141
|
DEFAULT = "DEFAULT",
|
|
142
142
|
API = "API"
|
|
143
143
|
}
|
|
144
|
+
export declare enum WorkflowPauseScheduledCronRunQueueBehavior {
|
|
145
|
+
DROP = "DROP",
|
|
146
|
+
QUEUE = "QUEUE"
|
|
147
|
+
}
|
|
144
148
|
export declare enum RateLimitOrderByDirection {
|
|
145
149
|
Asc = "asc",
|
|
146
150
|
Desc = "desc"
|
|
@@ -169,7 +173,8 @@ export declare enum WorkflowRunStatus {
|
|
|
169
173
|
export declare enum TenantMemberRole {
|
|
170
174
|
OWNER = "OWNER",
|
|
171
175
|
ADMIN = "ADMIN",
|
|
172
|
-
MEMBER = "MEMBER"
|
|
176
|
+
MEMBER = "MEMBER",
|
|
177
|
+
VIEWER = "VIEWER"
|
|
173
178
|
}
|
|
174
179
|
export declare enum TenantResource {
|
|
175
180
|
WORKER = "WORKER",
|
|
@@ -415,6 +420,8 @@ export interface V1TaskSummary {
|
|
|
415
420
|
parentTaskExternalId?: string;
|
|
416
421
|
/** The idempotency key that was claimed by the task run */
|
|
417
422
|
idempotencyKey?: string;
|
|
423
|
+
/** True when input, output, and event payload fields were omitted because the caller cannot view payloads. Additional metadata is still included. */
|
|
424
|
+
payloadsRestricted?: boolean;
|
|
418
425
|
}
|
|
419
426
|
export interface APIError {
|
|
420
427
|
/**
|
|
@@ -638,6 +645,8 @@ export interface V1WorkflowRun {
|
|
|
638
645
|
* @maxLength 36
|
|
639
646
|
*/
|
|
640
647
|
parentTaskExternalId?: string;
|
|
648
|
+
/** True when input, output, and event payload fields were omitted because the caller cannot view payloads. Additional metadata is still included. */
|
|
649
|
+
payloadsRestricted?: boolean;
|
|
641
650
|
}
|
|
642
651
|
export interface WorkflowRunShapeItemForWorkflowRunDetails {
|
|
643
652
|
/**
|
|
@@ -957,6 +966,8 @@ export interface V1Event {
|
|
|
957
966
|
triggeredRuns?: V1EventTriggeredRun[];
|
|
958
967
|
/** The name of the webhook that triggered this event, if applicable. */
|
|
959
968
|
triggeringWebhookName?: string;
|
|
969
|
+
/** True when the event payload was omitted because the caller cannot view payloads. Additional metadata is still included. */
|
|
970
|
+
payloadsRestricted?: boolean;
|
|
960
971
|
}
|
|
961
972
|
export interface V1EventList {
|
|
962
973
|
pagination?: PaginationResponse;
|
|
@@ -1104,6 +1115,58 @@ export interface V1UpdateWebhookRequest {
|
|
|
1104
1115
|
/** Whether to return the triggered event as the response payload when this webhook is triggered */
|
|
1105
1116
|
returnEventAsResponsePayload?: boolean;
|
|
1106
1117
|
}
|
|
1118
|
+
export interface V1HTTPOperator {
|
|
1119
|
+
metadata: APIResourceMeta;
|
|
1120
|
+
/**
|
|
1121
|
+
* The ID of the tenant associated with this operator.
|
|
1122
|
+
* @format uuid
|
|
1123
|
+
*/
|
|
1124
|
+
tenantId: string;
|
|
1125
|
+
/** The name of the operator. */
|
|
1126
|
+
name: string;
|
|
1127
|
+
/** The HTTPS endpoint (https, port 443) that assigned tasks are delivered to. */
|
|
1128
|
+
triggerEndpoint: string;
|
|
1129
|
+
/** The HTTPS endpoint polled periodically to discover the actions this operator handles. */
|
|
1130
|
+
healthcheckEndpoint: string;
|
|
1131
|
+
/**
|
|
1132
|
+
* The per-request timeout backstop, in seconds.
|
|
1133
|
+
* @format int32
|
|
1134
|
+
*/
|
|
1135
|
+
requestTimeoutSeconds: number;
|
|
1136
|
+
}
|
|
1137
|
+
export interface V1HTTPOperatorList {
|
|
1138
|
+
pagination?: PaginationResponse;
|
|
1139
|
+
rows?: V1HTTPOperator[];
|
|
1140
|
+
}
|
|
1141
|
+
export interface V1CreateHTTPOperatorRequest {
|
|
1142
|
+
/** The name of the operator. */
|
|
1143
|
+
name: string;
|
|
1144
|
+
/** The HTTPS endpoint (https, port 443) that assigned tasks are delivered to. */
|
|
1145
|
+
triggerEndpoint: string;
|
|
1146
|
+
/** The HTTPS endpoint polled periodically to discover the actions this operator handles. */
|
|
1147
|
+
healthcheckEndpoint: string;
|
|
1148
|
+
/** The secret used to HMAC-sign delivered requests (sent in the X-Hatchet-Signature header). Write-only: it is never returned in responses. */
|
|
1149
|
+
signingSecret: string;
|
|
1150
|
+
/**
|
|
1151
|
+
* The per-request timeout backstop, in seconds.
|
|
1152
|
+
* @format int32
|
|
1153
|
+
*/
|
|
1154
|
+
requestTimeoutSeconds: number;
|
|
1155
|
+
}
|
|
1156
|
+
/** Fields to update on an HTTP operator. Omitted fields are left unchanged. */
|
|
1157
|
+
export interface V1UpdateHTTPOperatorRequest {
|
|
1158
|
+
/** The HTTPS endpoint (https, port 443) that assigned tasks are delivered to. */
|
|
1159
|
+
triggerEndpoint?: string;
|
|
1160
|
+
/** An optional HTTPS endpoint polled to verify the operator endpoint is reachable. */
|
|
1161
|
+
healthcheckEndpoint?: string;
|
|
1162
|
+
/** The secret used to HMAC-sign delivered requests. Write-only: it is never returned in responses. Provide a new value to rotate it. */
|
|
1163
|
+
signingSecret?: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* Optional override for the per-request timeout backstop, in seconds.
|
|
1166
|
+
* @format int32
|
|
1167
|
+
*/
|
|
1168
|
+
requestTimeoutSeconds?: number;
|
|
1169
|
+
}
|
|
1107
1170
|
export interface V1CELDebugRequest {
|
|
1108
1171
|
/** The CEL expression to evaluate */
|
|
1109
1172
|
expression: string;
|
|
@@ -1189,6 +1252,11 @@ export interface APIMeta {
|
|
|
1189
1252
|
* @example "eyJhbGciOiJFUzI1NiIs..."
|
|
1190
1253
|
*/
|
|
1191
1254
|
authDisabledToken?: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* whether this instance is running in embedded mode
|
|
1257
|
+
* @example false
|
|
1258
|
+
*/
|
|
1259
|
+
embedded?: boolean;
|
|
1192
1260
|
}
|
|
1193
1261
|
export interface APIMetaIntegration {
|
|
1194
1262
|
/**
|
|
@@ -1336,6 +1404,8 @@ export interface TenantMember {
|
|
|
1336
1404
|
user: UserTenantPublic;
|
|
1337
1405
|
/** The role of the user in the tenant. */
|
|
1338
1406
|
role: TenantMemberRole;
|
|
1407
|
+
/** Whether this member can view task, event, and log payloads in the dashboard and REST API. OWNER and ADMIN always can, regardless of this flag. Defaults to true. */
|
|
1408
|
+
canViewPayloads?: boolean;
|
|
1339
1409
|
/** The tenant associated with this tenant member. */
|
|
1340
1410
|
tenant?: Tenant;
|
|
1341
1411
|
/** Whether this membership was explicitly granted (as opposed to synced via user-group tags). Only explicit members can have their role edited or be removed. */
|
|
@@ -1351,6 +1421,8 @@ export interface TenantInvite {
|
|
|
1351
1421
|
email: string;
|
|
1352
1422
|
/** The role of the user in the tenant. */
|
|
1353
1423
|
role: TenantMemberRole;
|
|
1424
|
+
/** Whether the invited user can view payloads. Defaults to true. */
|
|
1425
|
+
canViewPayloads?: boolean;
|
|
1354
1426
|
/** The tenant id associated with this tenant invite. */
|
|
1355
1427
|
tenantId: string;
|
|
1356
1428
|
/** The tenant name for the tenant. */
|
|
@@ -1434,10 +1506,14 @@ export interface CreateTenantInviteRequest {
|
|
|
1434
1506
|
email: string;
|
|
1435
1507
|
/** The role of the user in the tenant. */
|
|
1436
1508
|
role: TenantMemberRole;
|
|
1509
|
+
/** Whether the invited user can view payloads. Defaults to true. */
|
|
1510
|
+
canViewPayloads?: boolean;
|
|
1437
1511
|
}
|
|
1438
1512
|
export interface UpdateTenantInviteRequest {
|
|
1439
1513
|
/** The role of the user in the tenant. */
|
|
1440
1514
|
role: TenantMemberRole;
|
|
1515
|
+
/** Whether the invited user can view payloads. */
|
|
1516
|
+
canViewPayloads?: boolean;
|
|
1441
1517
|
}
|
|
1442
1518
|
export interface APIToken {
|
|
1443
1519
|
metadata: APIResourceMeta;
|
|
@@ -1597,6 +1673,8 @@ export interface TenantMemberList {
|
|
|
1597
1673
|
export interface UpdateTenantMemberRequest {
|
|
1598
1674
|
/** The role of the user in the tenant. */
|
|
1599
1675
|
role: TenantMemberRole;
|
|
1676
|
+
/** Whether this member can view payloads. Ignored for OWNER and ADMIN, who always can. */
|
|
1677
|
+
canViewPayloads?: boolean;
|
|
1600
1678
|
}
|
|
1601
1679
|
export interface EventData {
|
|
1602
1680
|
/** The data for the event (JSON bytes). */
|
|
@@ -1610,6 +1688,10 @@ export interface Workflow {
|
|
|
1610
1688
|
description?: string;
|
|
1611
1689
|
/** Whether the workflow is paused. */
|
|
1612
1690
|
isPaused?: boolean;
|
|
1691
|
+
/** The behavior of cron runs triggered while the workflow is paused. */
|
|
1692
|
+
pausedWorkflowCronRunQueueBehavior?: WorkflowPauseScheduledCronRunQueueBehavior;
|
|
1693
|
+
/** The behavior of scheduled runs triggered while the workflow is paused. */
|
|
1694
|
+
pausedWorkflowScheduledRunQueueBehavior?: WorkflowPauseScheduledCronRunQueueBehavior;
|
|
1613
1695
|
versions?: WorkflowVersionMeta[];
|
|
1614
1696
|
/** The tags of the workflow. */
|
|
1615
1697
|
tags?: WorkflowTag[];
|
|
@@ -1831,9 +1913,23 @@ export interface UpdateCronWorkflowTriggerRequest {
|
|
|
1831
1913
|
export interface WorkflowRunsCancelRequest {
|
|
1832
1914
|
workflowRunIds: string[];
|
|
1833
1915
|
}
|
|
1916
|
+
export interface PauseWorkflowRequestPause {
|
|
1917
|
+
/** Discriminator indicating this request pauses the workflow. */
|
|
1918
|
+
action: 'pause';
|
|
1919
|
+
/** The behavior of cron runs triggered while the workflow is paused. */
|
|
1920
|
+
pausedWorkflowCronRunQueueBehavior: WorkflowPauseScheduledCronRunQueueBehavior;
|
|
1921
|
+
/** The behavior of scheduled runs triggered while the workflow is paused. */
|
|
1922
|
+
pausedWorkflowScheduledRunQueueBehavior: WorkflowPauseScheduledCronRunQueueBehavior;
|
|
1923
|
+
/** The TTL for queued runs while the workflow is paused before they get dropped, expressed as a Go-style duration string (e.g. "1d7h30m"). */
|
|
1924
|
+
pausedWorkflowQueueTTL: string;
|
|
1925
|
+
}
|
|
1926
|
+
export interface PauseWorkflowRequestUnpause {
|
|
1927
|
+
/** Discriminator indicating this request unpauses the workflow. */
|
|
1928
|
+
action: 'unpause';
|
|
1929
|
+
}
|
|
1930
|
+
export type PauseWorkflowRequest = PauseWorkflowRequestPause | PauseWorkflowRequestUnpause;
|
|
1834
1931
|
export interface WorkflowUpdateRequest {
|
|
1835
|
-
|
|
1836
|
-
isPaused?: boolean;
|
|
1932
|
+
pause?: PauseWorkflowRequest;
|
|
1837
1933
|
}
|
|
1838
1934
|
export interface WorkflowConcurrency {
|
|
1839
1935
|
/**
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* ---------------------------------------------------------------
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.V1TaskStatus = exports.V1WorkflowType = exports.V1TaskEventType = exports.V1LogLineLevel = exports.V1LogLineOrderByDirection = exports.V1AdditionalMetadataOperator = exports.V1RunningFilter = exports.V1DurableEventLogKind = exports.V1DurableWaitConditionKind = exports.OtelSpanKind = exports.OtelStatusCode = exports.TenantVersion = exports.TenantEnvironment = exports.V1WebhookSourceName = exports.V1WebhookAuthType = exports.V1WebhookHMACAlgorithm = exports.V1WebhookHMACEncoding = exports.V1CELDebugResponseStatus = exports.TenantResource = exports.TenantMemberRole = exports.WorkflowRunStatus = exports.EventOrderByField = exports.EventOrderByDirection = exports.RateLimitOrderByField = exports.RateLimitOrderByDirection = exports.ScheduledWorkflowsMethod = exports.ScheduledWorkflowsOrderByField = exports.WorkflowRunOrderByDirection = exports.ScheduledRunStatus = exports.CronWorkflowsMethod = exports.CronWorkflowsOrderByField = exports.ConcurrencyLimitStrategy = exports.ConcurrencyScope = exports.StepRunStatus = exports.JobRunStatus = exports.StepRunEventReason = exports.StepRunEventSeverity = exports.WorkflowKind = exports.WorkflowRunOrderByField = exports.WorkerStatus = exports.WorkerType = exports.WorkerRuntimeSDKs = exports.WebhookWorkerRequestMethod = exports.FeatureFlagId = exports.PullRequestState = exports.LogLineLevel = exports.LogLineOrderByField = exports.LogLineOrderByDirection = exports.V1TaskRunStatus = void 0;
|
|
14
|
+
exports.V1TaskStatus = exports.V1WorkflowType = exports.V1TaskEventType = exports.V1LogLineLevel = exports.V1LogLineOrderByDirection = exports.V1AdditionalMetadataOperator = exports.V1RunningFilter = exports.V1DurableEventLogKind = exports.V1DurableWaitConditionKind = exports.OtelSpanKind = exports.OtelStatusCode = exports.TenantVersion = exports.TenantEnvironment = exports.V1WebhookSourceName = exports.V1WebhookAuthType = exports.V1WebhookHMACAlgorithm = exports.V1WebhookHMACEncoding = exports.V1CELDebugResponseStatus = exports.TenantResource = exports.TenantMemberRole = exports.WorkflowRunStatus = exports.EventOrderByField = exports.EventOrderByDirection = exports.RateLimitOrderByField = exports.RateLimitOrderByDirection = exports.WorkflowPauseScheduledCronRunQueueBehavior = exports.ScheduledWorkflowsMethod = exports.ScheduledWorkflowsOrderByField = exports.WorkflowRunOrderByDirection = exports.ScheduledRunStatus = exports.CronWorkflowsMethod = exports.CronWorkflowsOrderByField = exports.ConcurrencyLimitStrategy = exports.ConcurrencyScope = exports.StepRunStatus = exports.JobRunStatus = exports.StepRunEventReason = exports.StepRunEventSeverity = exports.WorkflowKind = exports.WorkflowRunOrderByField = exports.WorkerStatus = exports.WorkerType = exports.WorkerRuntimeSDKs = exports.WebhookWorkerRequestMethod = exports.FeatureFlagId = exports.PullRequestState = exports.LogLineLevel = exports.LogLineOrderByField = exports.LogLineOrderByDirection = exports.V1TaskRunStatus = void 0;
|
|
15
15
|
var V1TaskRunStatus;
|
|
16
16
|
(function (V1TaskRunStatus) {
|
|
17
17
|
V1TaskRunStatus["PENDING"] = "PENDING";
|
|
@@ -179,6 +179,11 @@ var ScheduledWorkflowsMethod;
|
|
|
179
179
|
ScheduledWorkflowsMethod["DEFAULT"] = "DEFAULT";
|
|
180
180
|
ScheduledWorkflowsMethod["API"] = "API";
|
|
181
181
|
})(ScheduledWorkflowsMethod || (exports.ScheduledWorkflowsMethod = ScheduledWorkflowsMethod = {}));
|
|
182
|
+
var WorkflowPauseScheduledCronRunQueueBehavior;
|
|
183
|
+
(function (WorkflowPauseScheduledCronRunQueueBehavior) {
|
|
184
|
+
WorkflowPauseScheduledCronRunQueueBehavior["DROP"] = "DROP";
|
|
185
|
+
WorkflowPauseScheduledCronRunQueueBehavior["QUEUE"] = "QUEUE";
|
|
186
|
+
})(WorkflowPauseScheduledCronRunQueueBehavior || (exports.WorkflowPauseScheduledCronRunQueueBehavior = WorkflowPauseScheduledCronRunQueueBehavior = {}));
|
|
182
187
|
var RateLimitOrderByDirection;
|
|
183
188
|
(function (RateLimitOrderByDirection) {
|
|
184
189
|
RateLimitOrderByDirection["Asc"] = "asc";
|
|
@@ -214,6 +219,7 @@ var TenantMemberRole;
|
|
|
214
219
|
TenantMemberRole["OWNER"] = "OWNER";
|
|
215
220
|
TenantMemberRole["ADMIN"] = "ADMIN";
|
|
216
221
|
TenantMemberRole["MEMBER"] = "MEMBER";
|
|
222
|
+
TenantMemberRole["VIEWER"] = "VIEWER";
|
|
217
223
|
})(TenantMemberRole || (exports.TenantMemberRole = TenantMemberRole = {}));
|
|
218
224
|
var TenantResource;
|
|
219
225
|
(function (TenantResource) {
|
package/package.json
CHANGED
package/v1/client/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This is the TypeScript SDK reference, documenting methods available for interacting with Hatchet resources.
|
|
3
|
-
* Check out the [user guide](https://docs.hatchet.run/
|
|
3
|
+
* Check out the [user guide](https://docs.hatchet.run/v1) for an introduction to getting your first tasks running.
|
|
4
4
|
*
|
|
5
5
|
* @module Hatchet TypeScript SDK Reference
|
|
6
6
|
*/
|
package/v1/client/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* This is the TypeScript SDK reference, documenting methods available for interacting with Hatchet resources.
|
|
4
|
-
* Check out the [user guide](https://docs.hatchet.run/
|
|
4
|
+
* Check out the [user guide](https://docs.hatchet.run/v1) for an introduction to getting your first tasks running.
|
|
5
5
|
*
|
|
6
6
|
* @module Hatchet TypeScript SDK Reference
|
|
7
7
|
*/
|
|
@@ -87,7 +87,7 @@ export declare class Context<T, K = {}> {
|
|
|
87
87
|
worker: ContextWorker;
|
|
88
88
|
overridesData: Record<string, any>;
|
|
89
89
|
_logger: Logger;
|
|
90
|
-
/** @deprecated
|
|
90
|
+
/** @deprecated Kept for backward compat; prefer {@link nextChildIndex}. */
|
|
91
91
|
spawnIndex: number;
|
|
92
92
|
streamIndex: number;
|
|
93
93
|
protected nextChildIndex(n?: number): number;
|
|
@@ -89,7 +89,7 @@ class Context {
|
|
|
89
89
|
// @deprecated use ctx.abortController instead
|
|
90
90
|
this.controller = new AbortController();
|
|
91
91
|
this.overridesData = {};
|
|
92
|
-
/** @deprecated
|
|
92
|
+
/** @deprecated Kept for backward compat; prefer {@link nextChildIndex}. */
|
|
93
93
|
this.spawnIndex = 0;
|
|
94
94
|
this.streamIndex = 0;
|
|
95
95
|
try {
|
|
@@ -139,7 +139,7 @@ class Context {
|
|
|
139
139
|
var _a, _b;
|
|
140
140
|
if (this.action.batchId) {
|
|
141
141
|
// Batch tasks share one context across every buffered member, so there is no single
|
|
142
|
-
// task-run id to cancel
|
|
142
|
+
// task-run id to cancel, so cancel every member of the batch instead. `this.data` is
|
|
143
143
|
// the raw batch-items map for a START_BATCH action, keyed by each member's
|
|
144
144
|
// task-run external id.
|
|
145
145
|
const memberIds = Object.keys((_a = this.data) !== null && _a !== void 0 ? _a : {});
|
package/v1/declaration.js
CHANGED
|
@@ -93,7 +93,7 @@ class BaseWorkflowDeclaration {
|
|
|
93
93
|
: undefined,
|
|
94
94
|
warn: (message) => this.client.admin.logger.warn(message),
|
|
95
95
|
});
|
|
96
|
-
// Snapshot childIndex before incrementing
|
|
96
|
+
// Snapshot childIndex before incrementing (shared with Context.spawnIndex)
|
|
97
97
|
// via parentRunContextManager so both spawning APIs produce unique indices.
|
|
98
98
|
const baseChildIndex = parentRunContext === null || parentRunContext === void 0 ? void 0 : parentRunContext.childIndex;
|
|
99
99
|
const inputCount = Array.isArray(input) ? input.length : 1;
|
package/v1/embedded.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import type { ClientConfig, HatchetClientOptions } from '../clients/hatchet-client';
|
|
3
|
+
import { HatchetClient } from './client/client';
|
|
4
|
+
export interface EmbeddedOptions {
|
|
5
|
+
/**
|
|
6
|
+
* hatchet-embedded release tag to download (defaults to HATCHET_CLIENT_EMBEDDED_VERSION or
|
|
7
|
+
* latest). Tags correspond to the Hatchet engine version baked into the sidecar,
|
|
8
|
+
* so pinning this pins the engine.
|
|
9
|
+
*/
|
|
10
|
+
version?: string;
|
|
11
|
+
/** path to an existing sidecar binary, skips the download (or HATCHET_CLIENT_EMBEDDED_BINARY_PATH) */
|
|
12
|
+
binaryPath?: string;
|
|
13
|
+
/**
|
|
14
|
+
* expected sha256 hex digest of the sidecar binary. When set, it replaces the
|
|
15
|
+
* release's checksums.txt as the trust anchor, so a compromised release
|
|
16
|
+
* channel cannot substitute the binary. Pin it together with `version`.
|
|
17
|
+
*/
|
|
18
|
+
checksum?: string;
|
|
19
|
+
/** use an existing Postgres instead of the bundled one */
|
|
20
|
+
databaseUrl?: string;
|
|
21
|
+
/** store the bundled Postgres runtime and data under this directory */
|
|
22
|
+
postgresDataDir?: string;
|
|
23
|
+
grpcPort?: number;
|
|
24
|
+
apiPort?: number;
|
|
25
|
+
/** set to false to start only the engine + gRPC, no REST API */
|
|
26
|
+
startApi?: boolean;
|
|
27
|
+
/** set to false to skip running migrations on startup */
|
|
28
|
+
runMigrations?: boolean;
|
|
29
|
+
/** use RabbitMQ instead of the Postgres message queue */
|
|
30
|
+
rabbitmqUrl?: string;
|
|
31
|
+
logLevel?: string;
|
|
32
|
+
readyTimeoutMs?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface EmbeddedSidecar {
|
|
35
|
+
token: string;
|
|
36
|
+
tenantId: string;
|
|
37
|
+
grpcAddress: string;
|
|
38
|
+
apiUrl: string;
|
|
39
|
+
stop: () => Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Gracefully stops every sidecar started in this process by
|
|
43
|
+
* `HatchetEmbeddedClient.init()` (or `startEmbeddedSidecar`) and resolves once
|
|
44
|
+
* they have fully exited, including their bundled Postgres. Call this before
|
|
45
|
+
* your process exits so the engine's shutdown output does not print after
|
|
46
|
+
* your program has returned.
|
|
47
|
+
*/
|
|
48
|
+
export declare function stopEmbeddedSidecar(): Promise<void>;
|
|
49
|
+
export declare function startEmbeddedSidecar(opts?: EmbeddedOptions): Promise<EmbeddedSidecar>;
|
|
50
|
+
export declare class HatchetEmbeddedClient {
|
|
51
|
+
/**
|
|
52
|
+
* Runs a full Hatchet engine locally via the hatchet-embedded sidecar (downloaded
|
|
53
|
+
* on first use) and returns a client wired to it. By default the sidecar starts a
|
|
54
|
+
* bundled Postgres; pass `databaseUrl` to point it at your own instead.
|
|
55
|
+
* @param embeddedOpts - Options for the embedded engine (version, ports, database, ...).
|
|
56
|
+
* @param config - Optional configuration overrides for the client.
|
|
57
|
+
* @param options - Optional client options.
|
|
58
|
+
* @param axiosConfig - Optional Axios configuration for HTTP requests.
|
|
59
|
+
* @returns A new Hatchet client instance connected to the embedded engine.
|
|
60
|
+
*/
|
|
61
|
+
static init<T extends Record<string, any> = {}, U extends Record<string, any> = {}>(embeddedOpts?: EmbeddedOptions, config?: Omit<Partial<ClientConfig>, 'middleware'>, options?: HatchetClientOptions, axiosConfig?: AxiosRequestConfig): Promise<EmbeddedClient<T, U>>;
|
|
62
|
+
}
|
|
63
|
+
export type EmbeddedClient<T extends Record<string, any> = {}, U extends Record<string, any> = {}> = HatchetClient<T, U> & {
|
|
64
|
+
/**
|
|
65
|
+
* Gracefully stops the embedded engine sidecar and resolves once it has
|
|
66
|
+
* fully exited, including its bundled Postgres. Call this before your
|
|
67
|
+
* process exits so the engine's shutdown output does not print after your
|
|
68
|
+
* program has returned.
|
|
69
|
+
*/
|
|
70
|
+
stopEmbedded: () => Promise<void>;
|
|
71
|
+
};
|