@hatchet-dev/typescript-sdk 1.0.0-alpha1 → 1.0.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/clients/admin/admin-client.d.ts +15 -20
- package/clients/admin/admin-client.js +21 -17
- package/clients/hatchet-client/hatchet-client.d.ts +5 -4
- package/clients/hatchet-client/hatchet-client.js +6 -4
- package/clients/listeners/durable-listener/durable-listener-client.d.ts +25 -0
- package/clients/listeners/durable-listener/durable-listener-client.js +30 -0
- package/clients/listeners/durable-listener/pooled-durable-listener-client.d.ts +43 -0
- package/clients/listeners/durable-listener/pooled-durable-listener-client.js +241 -0
- package/clients/{listener/listener-client.d.ts → listeners/run-listener/child-listener-client.d.ts} +8 -8
- package/clients/{listener/listener-client.js → listeners/run-listener/child-listener-client.js} +8 -19
- package/clients/{listener/child-listener-client.d.ts → listeners/run-listener/pooled-child-listener-client.d.ts} +5 -5
- package/clients/{listener/child-listener-client.js → listeners/run-listener/pooled-child-listener-client.js} +5 -5
- package/clients/rest/generated/Api.d.ts +49 -2
- package/clients/rest/generated/Api.js +30 -0
- package/clients/rest/generated/data-contracts.d.ts +88 -82
- package/clients/rest/generated/data-contracts.js +8 -1
- package/clients/worker/worker.d.ts +5 -1
- package/clients/worker/worker.js +173 -2
- package/examples/affinity-workers.js +5 -1
- package/examples/api.js +1 -1
- package/examples/bulk-fanout-worker.js +1 -1
- package/examples/byo-logger.js +4 -0
- package/examples/concurrency/cancel-in-progress/concurrency-event.js +2 -2
- package/examples/concurrency/group-round-robin/concurrency-event.js +1 -1
- package/examples/crons/programatic-crons.js +4 -4
- package/examples/dag-worker.js +0 -1
- package/examples/example-event.js +2 -2
- package/examples/logger.js +2 -0
- package/examples/on-failure.js +1 -1
- package/examples/rate-limit/events.js +3 -3
- package/examples/scheduled-runs/programatic-schedules.js +4 -4
- package/examples/sticky-worker-with-check.js +2 -2
- package/examples/sticky-worker.js +5 -0
- package/index.d.ts +1 -3
- package/index.js +1 -3
- package/package.json +2 -2
- package/protoc/dispatcher/dispatcher.d.ts +2 -0
- package/protoc/dispatcher/dispatcher.js +1 -1
- package/protoc/events/events.js +1 -1
- package/protoc/google/protobuf/timestamp.js +1 -1
- package/protoc/v1/dispatcher.d.ts +77 -0
- package/protoc/v1/dispatcher.js +341 -0
- package/protoc/v1/shared/condition.d.ts +59 -0
- package/protoc/v1/shared/condition.js +549 -0
- package/protoc/v1/workflows.d.ts +263 -0
- package/protoc/v1/workflows.js +1823 -0
- package/protoc/workflows/workflows.js +1 -1
- package/step.d.ts +173 -47
- package/step.js +208 -64
- package/util/sleep.d.ts +7 -0
- package/util/sleep.js +7 -0
- package/util/workflow-run-ref.d.ts +8 -2
- package/util/workflow-run-ref.js +13 -0
- package/v1/client/client.d.ts +125 -7
- package/v1/client/client.interface.d.ts +9 -1
- package/v1/client/client.js +148 -17
- package/v1/client/duration.d.ts +7 -0
- package/v1/client/duration.js +2 -0
- package/v1/client/features/index.d.ts +5 -0
- package/v1/client/features/index.js +21 -0
- package/v1/client/features/metrics.d.ts +14 -0
- package/v1/client/features/metrics.js +45 -0
- package/v1/client/features/ratelimits.d.ts +20 -0
- package/v1/client/features/ratelimits.js +40 -0
- package/v1/client/features/runs.d.ts +15 -0
- package/v1/client/features/runs.js +60 -0
- package/v1/client/features/workers.d.ts +14 -0
- package/v1/client/features/workers.js +56 -0
- package/v1/client/features/workflows.d.ts +17 -0
- package/v1/client/features/workflows.js +93 -0
- package/v1/client/worker.d.ts +25 -15
- package/v1/client/worker.js +76 -47
- package/v1/conditions/base.d.ts +18 -0
- package/v1/conditions/base.js +18 -0
- package/v1/conditions/index.d.ts +31 -0
- package/v1/conditions/index.js +91 -0
- package/v1/conditions/parent-condition.d.ts +40 -0
- package/v1/conditions/parent-condition.js +36 -0
- package/v1/conditions/sleep-condition.d.ts +47 -0
- package/v1/conditions/sleep-condition.js +38 -0
- package/v1/conditions/transformer.d.ts +5 -0
- package/v1/conditions/transformer.js +52 -0
- package/v1/conditions/user-event-condition.d.ts +50 -0
- package/v1/conditions/user-event-condition.js +39 -0
- package/v1/declaration.d.ts +309 -0
- package/v1/declaration.js +296 -0
- package/v1/examples/child_workflows/worker.js +2 -2
- package/v1/examples/child_workflows/workflow.d.ts +2 -2
- package/v1/examples/child_workflows/workflow.js +5 -3
- package/v1/examples/concurrency-rr/load.js +2 -2
- package/v1/examples/concurrency-rr/worker.js +2 -2
- package/v1/examples/concurrency-rr/workflow.d.ts +1 -1
- package/v1/examples/concurrency-rr/workflow.js +2 -3
- package/v1/examples/dag/worker.js +2 -2
- package/v1/examples/dag/workflow.d.ts +1 -1
- package/v1/examples/dag/workflow.js +3 -3
- package/v1/examples/dag_match_condition/event.js +28 -0
- package/v1/examples/dag_match_condition/run.d.ts +1 -0
- package/v1/examples/dag_match_condition/run.js +25 -0
- package/v1/examples/dag_match_condition/worker.d.ts +1 -0
- package/{examples/playground.js → v1/examples/dag_match_condition/worker.js} +7 -22
- package/v1/examples/dag_match_condition/workflow.d.ts +11 -0
- package/v1/examples/dag_match_condition/workflow.js +41 -0
- package/v1/examples/deep/worker.js +2 -2
- package/v1/examples/deep/workflow.d.ts +6 -6
- package/v1/examples/deep/workflow.js +7 -7
- package/v1/examples/durable-sleep/event.d.ts +1 -0
- package/v1/examples/durable-sleep/event.js +28 -0
- package/v1/examples/durable-sleep/run.d.ts +1 -0
- package/v1/examples/durable-sleep/run.js +30 -0
- package/v1/examples/durable-sleep/worker.d.ts +1 -0
- package/v1/examples/durable-sleep/worker.js +24 -0
- package/v1/examples/durable-sleep/workflow.d.ts +1 -0
- package/v1/examples/durable-sleep/workflow.js +37 -0
- package/v1/examples/inferred-typing/run.d.ts +1 -0
- package/v1/examples/inferred-typing/run.js +41 -0
- package/v1/examples/inferred-typing/worker.d.ts +1 -0
- package/v1/examples/inferred-typing/worker.js +24 -0
- package/v1/examples/inferred-typing/workflow.d.ts +15 -0
- package/v1/examples/inferred-typing/workflow.js +44 -0
- package/v1/examples/landing_page/durable-excution.d.ts +3 -0
- package/v1/examples/landing_page/durable-excution.js +40 -0
- package/v1/examples/landing_page/event-signaling.d.ts +6 -0
- package/v1/examples/landing_page/event-signaling.js +16 -0
- package/v1/examples/landing_page/flow-control.d.ts +6 -0
- package/v1/examples/landing_page/flow-control.js +26 -0
- package/v1/examples/landing_page/queues.d.ts +3 -0
- package/v1/examples/landing_page/queues.js +33 -0
- package/v1/examples/landing_page/scheduling.d.ts +1 -0
- package/v1/examples/landing_page/scheduling.js +12 -0
- package/v1/examples/landing_page/task-routing.d.ts +6 -0
- package/v1/examples/landing_page/task-routing.js +25 -0
- package/v1/examples/legacy/run.js +2 -2
- package/v1/examples/legacy/worker.js +2 -2
- package/v1/examples/on_cron/worker.d.ts +1 -0
- package/v1/examples/on_cron/worker.js +24 -0
- package/v1/examples/on_cron/workflow.d.ts +10 -0
- package/v1/examples/on_cron/workflow.js +21 -0
- package/v1/examples/on_event/event.js +3 -2
- package/v1/examples/on_event/worker.js +2 -2
- package/v1/examples/on_event/workflow.d.ts +4 -4
- package/v1/examples/on_event/workflow.js +6 -3
- package/v1/examples/on_event copy/event.d.ts +1 -0
- package/v1/examples/on_event copy/event.js +26 -0
- package/v1/examples/on_event copy/worker.d.ts +1 -0
- package/v1/examples/on_event copy/worker.js +24 -0
- package/v1/examples/on_event copy/workflow.d.ts +16 -0
- package/v1/examples/on_event copy/workflow.js +35 -0
- package/v1/examples/on_failure/worker.js +2 -2
- package/v1/examples/on_failure/workflow.d.ts +1 -1
- package/v1/examples/on_failure/workflow.js +18 -8
- package/v1/examples/on_success/run.d.ts +1 -0
- package/v1/examples/on_success/run.js +31 -0
- package/v1/examples/on_success/worker.d.ts +1 -0
- package/v1/examples/on_success/worker.js +24 -0
- package/v1/examples/on_success/workflow.d.ts +4 -0
- package/v1/examples/on_success/workflow.js +59 -0
- package/v1/examples/retries/run.d.ts +1 -0
- package/v1/examples/retries/run.js +29 -0
- package/v1/examples/retries/worker.d.ts +1 -0
- package/v1/examples/retries/worker.js +24 -0
- package/v1/examples/retries/workflow.d.ts +5 -0
- package/v1/examples/retries/workflow.js +53 -0
- package/v1/examples/simple/client-run.d.ts +1 -0
- package/v1/examples/simple/client-run.js +16 -0
- package/v1/examples/simple/cron.js +6 -2
- package/v1/examples/simple/delay.js +2 -2
- package/v1/examples/simple/enqueue.d.ts +1 -0
- package/v1/examples/simple/enqueue.js +43 -0
- package/v1/examples/simple/run.js +8 -3
- package/v1/examples/simple/schedule.js +11 -5
- package/v1/examples/simple/stub-workflow.d.ts +9 -0
- package/v1/examples/simple/stub-workflow.js +17 -0
- package/v1/examples/simple/worker.js +7 -2
- package/v1/examples/simple/workflow.d.ts +4 -3
- package/v1/examples/simple/workflow.js +5 -5
- package/v1/examples/sticky/run.d.ts +1 -0
- package/v1/examples/sticky/run.js +29 -0
- package/v1/examples/sticky/worker.d.ts +1 -0
- package/v1/examples/sticky/worker.js +24 -0
- package/v1/examples/sticky/workflow.d.ts +7 -0
- package/v1/examples/sticky/workflow.js +32 -0
- package/v1/examples/with_timeouts/workflow.d.ts +9 -0
- package/v1/examples/with_timeouts/workflow.js +62 -0
- package/v1/index.d.ts +5 -0
- package/v1/index.js +20 -0
- package/v1/task.d.ts +144 -14
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/v1/workflow.d.ts +0 -158
- package/v1/workflow.js +0 -145
- /package/{examples/playground.d.ts → v1/examples/dag_match_condition/event.d.ts} +0 -0
- /package/v1/examples/{client.d.ts → hatchet-client.d.ts} +0 -0
- /package/v1/examples/{client.js → hatchet-client.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { WorkflowRunEvent, SubscribeToWorkflowRunsRequest } from '
|
|
3
|
-
import {
|
|
2
|
+
import { WorkflowRunEvent, SubscribeToWorkflowRunsRequest } from '../../../protoc/dispatcher';
|
|
3
|
+
import { RunListenerClient } from './child-listener-client';
|
|
4
4
|
export declare class Streamable {
|
|
5
5
|
listener: AsyncIterable<WorkflowRunEvent>;
|
|
6
6
|
id: string;
|
|
@@ -8,14 +8,14 @@ export declare class Streamable {
|
|
|
8
8
|
constructor(listener: AsyncIterable<WorkflowRunEvent>, id: string);
|
|
9
9
|
stream(): AsyncGenerator<WorkflowRunEvent, void, unknown>;
|
|
10
10
|
}
|
|
11
|
-
export declare class
|
|
11
|
+
export declare class RunGrpcPooledListener {
|
|
12
12
|
listener: AsyncIterable<WorkflowRunEvent> | undefined;
|
|
13
13
|
requestEmitter: EventEmitter<[never]>;
|
|
14
14
|
signal: AbortController;
|
|
15
|
-
client:
|
|
15
|
+
client: RunListenerClient;
|
|
16
16
|
subscribers: Record<string, Streamable>;
|
|
17
17
|
onFinish: () => void;
|
|
18
|
-
constructor(client:
|
|
18
|
+
constructor(client: RunListenerClient, onFinish: () => void);
|
|
19
19
|
private init;
|
|
20
20
|
subscribe(request: SubscribeToWorkflowRunsRequest): Streamable;
|
|
21
21
|
replayRequests(): void;
|
|
@@ -32,12 +32,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.
|
|
35
|
+
exports.RunGrpcPooledListener = exports.Streamable = void 0;
|
|
36
36
|
// eslint-disable-next-line max-classes-per-file
|
|
37
37
|
const events_1 = require("events");
|
|
38
|
-
const dispatcher_1 = require("
|
|
38
|
+
const dispatcher_1 = require("../../../protoc/dispatcher");
|
|
39
39
|
const abort_controller_x_1 = require("abort-controller-x");
|
|
40
|
-
const sleep_1 = __importDefault(require("
|
|
40
|
+
const sleep_1 = __importDefault(require("../../../util/sleep"));
|
|
41
41
|
class Streamable {
|
|
42
42
|
constructor(listener, id) {
|
|
43
43
|
this.responseEmitter = new events_1.EventEmitter();
|
|
@@ -56,7 +56,7 @@ class Streamable {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
exports.Streamable = Streamable;
|
|
59
|
-
class
|
|
59
|
+
class RunGrpcPooledListener {
|
|
60
60
|
constructor(client, onFinish) {
|
|
61
61
|
this.requestEmitter = new events_1.EventEmitter();
|
|
62
62
|
this.signal = new AbortController();
|
|
@@ -160,4 +160,4 @@ class GrpcPooledListener {
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
exports.
|
|
163
|
+
exports.RunGrpcPooledListener = RunGrpcPooledListener;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AcceptInviteRequest, APIErrors, APIMeta, BulkCreateEventRequest, BulkCreateEventResponse, CancelEventRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreateCronWorkflowTriggerRequest, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, CronWorkflows, CronWorkflowsList, CronWorkflowsOrderByField, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, ListAPIMetaIntegration, ListAPITokensResponse, ListSlackWebhooks, ListSNSIntegrations, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, RateLimitList, RateLimitOrderByDirection, RateLimitOrderByField, RejectInviteRequest, ReplayEventRequest, ReplayWorkflowRunsRequest, ReplayWorkflowRunsResponse, RerunStepRunRequest, ScheduledRunStatus, ScheduledWorkflows, ScheduledWorkflowsList, ScheduledWorkflowsOrderByField, ScheduleWorkflowRunRequest, SNSIntegration, StepRun, StepRunArchiveList, StepRunEventList, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TenantStepRunQueueMetrics, TriggerWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantRequest, UpdateWorkerRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, V1CancelTaskRequest, V1DagChildren,
|
|
1
|
+
import { AcceptInviteRequest, APIErrors, APIMeta, BulkCreateEventRequest, BulkCreateEventResponse, CancelEventRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreateCronWorkflowTriggerRequest, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, CronWorkflows, CronWorkflowsList, CronWorkflowsOrderByField, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, ListAPIMetaIntegration, ListAPITokensResponse, ListSlackWebhooks, ListSNSIntegrations, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, RateLimitList, RateLimitOrderByDirection, RateLimitOrderByField, RejectInviteRequest, ReplayEventRequest, ReplayWorkflowRunsRequest, ReplayWorkflowRunsResponse, RerunStepRunRequest, ScheduledRunStatus, ScheduledWorkflows, ScheduledWorkflowsList, ScheduledWorkflowsOrderByField, ScheduleWorkflowRunRequest, SNSIntegration, StepRun, StepRunArchiveList, StepRunEventList, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TenantStepRunQueueMetrics, TriggerWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantRequest, UpdateWorkerRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, V1CancelTaskRequest, V1DagChildren, V1LogLineList, V1ReplayTaskRequest, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummary, V1TaskSummaryList, V1TriggerWorkflowRunRequest, V1WorkflowRunDetails, V1WorkflowRunDisplayNameList, WebhookWorkerCreated, WebhookWorkerCreateRequest, WebhookWorkerListResponse, WebhookWorkerRequestListResponse, Worker, WorkerList, Workflow, WorkflowID, WorkflowKindList, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunOrderByDirection, WorkflowRunOrderByField, WorkflowRunsCancelRequest, WorkflowRunShape, WorkflowRunsMetrics, WorkflowRunStatus, WorkflowRunStatusList, 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
|
/**
|
|
@@ -10,7 +10,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
10
10
|
* @request GET:/api/v1/stable/tasks/{task}
|
|
11
11
|
* @secure
|
|
12
12
|
*/
|
|
13
|
-
v1TaskGet: (task: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<
|
|
13
|
+
v1TaskGet: (task: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskSummary, any>>;
|
|
14
14
|
/**
|
|
15
15
|
* @description List events for a task
|
|
16
16
|
*
|
|
@@ -32,6 +32,16 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
32
32
|
*/
|
|
33
33
|
limit?: number;
|
|
34
34
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskEventList, any>>;
|
|
35
|
+
/**
|
|
36
|
+
* @description Lists log lines for a task
|
|
37
|
+
*
|
|
38
|
+
* @tags Log
|
|
39
|
+
* @name V1LogLineList
|
|
40
|
+
* @summary List log lines
|
|
41
|
+
* @request GET:/api/v1/stable/tasks/{task}/logs
|
|
42
|
+
* @secure
|
|
43
|
+
*/
|
|
44
|
+
v1LogLineList: (task: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1LogLineList, any>>;
|
|
35
45
|
/**
|
|
36
46
|
* @description Cancel tasks
|
|
37
47
|
*
|
|
@@ -117,7 +127,37 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
117
127
|
worker_id?: string;
|
|
118
128
|
/** Whether to include DAGs or only to include tasks */
|
|
119
129
|
only_tasks: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* The parent task external id to filter by
|
|
132
|
+
* @format uuid
|
|
133
|
+
* @minLength 36
|
|
134
|
+
* @maxLength 36
|
|
135
|
+
*/
|
|
136
|
+
parent_task_external_id?: string;
|
|
120
137
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskSummaryList, any>>;
|
|
138
|
+
/**
|
|
139
|
+
* @description Lists displayable names of workflow runs for a tenant
|
|
140
|
+
*
|
|
141
|
+
* @tags Workflow Runs
|
|
142
|
+
* @name V1WorkflowRunDisplayNamesList
|
|
143
|
+
* @summary List workflow runs
|
|
144
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/workflow-runs/display-names
|
|
145
|
+
* @secure
|
|
146
|
+
*/
|
|
147
|
+
v1WorkflowRunDisplayNamesList: (tenant: string, query: {
|
|
148
|
+
/** The external ids of the workflow runs to get display names for */
|
|
149
|
+
external_ids: string[];
|
|
150
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1WorkflowRunDisplayNameList, any>>;
|
|
151
|
+
/**
|
|
152
|
+
* @description Trigger a new workflow run
|
|
153
|
+
*
|
|
154
|
+
* @tags Workflow Runs
|
|
155
|
+
* @name V1WorkflowRunCreate
|
|
156
|
+
* @summary Create workflow run
|
|
157
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/workflow-runs/trigger
|
|
158
|
+
* @secure
|
|
159
|
+
*/
|
|
160
|
+
v1WorkflowRunCreate: (tenant: string, data: V1TriggerWorkflowRunRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1WorkflowRunDetails, any>>;
|
|
121
161
|
/**
|
|
122
162
|
* @description Get a workflow run and its metadata to display on the "detail" page
|
|
123
163
|
*
|
|
@@ -166,6 +206,13 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
166
206
|
since: string;
|
|
167
207
|
/** The workflow id to find runs for */
|
|
168
208
|
workflow_ids?: string[];
|
|
209
|
+
/**
|
|
210
|
+
* The parent task's external id
|
|
211
|
+
* @format uuid
|
|
212
|
+
* @minLength 36
|
|
213
|
+
* @maxLength 36
|
|
214
|
+
*/
|
|
215
|
+
parent_task_external_id?: string;
|
|
169
216
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskRunMetrics, any>>;
|
|
170
217
|
/**
|
|
171
218
|
* @description Get a minute by minute breakdown of task metrics for a tenant
|
|
@@ -35,6 +35,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
35
35
|
* @secure
|
|
36
36
|
*/
|
|
37
37
|
this.v1TaskEventList = (task, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tasks/${task}/task-events`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
38
|
+
/**
|
|
39
|
+
* @description Lists log lines for a task
|
|
40
|
+
*
|
|
41
|
+
* @tags Log
|
|
42
|
+
* @name V1LogLineList
|
|
43
|
+
* @summary List log lines
|
|
44
|
+
* @request GET:/api/v1/stable/tasks/{task}/logs
|
|
45
|
+
* @secure
|
|
46
|
+
*/
|
|
47
|
+
this.v1LogLineList = (task, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tasks/${task}/logs`, method: 'GET', secure: true, format: 'json' }, params));
|
|
38
48
|
/**
|
|
39
49
|
* @description Cancel tasks
|
|
40
50
|
*
|
|
@@ -75,6 +85,26 @@ class Api extends http_client_1.HttpClient {
|
|
|
75
85
|
* @secure
|
|
76
86
|
*/
|
|
77
87
|
this.v1WorkflowRunList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/workflow-runs`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
88
|
+
/**
|
|
89
|
+
* @description Lists displayable names of workflow runs for a tenant
|
|
90
|
+
*
|
|
91
|
+
* @tags Workflow Runs
|
|
92
|
+
* @name V1WorkflowRunDisplayNamesList
|
|
93
|
+
* @summary List workflow runs
|
|
94
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/workflow-runs/display-names
|
|
95
|
+
* @secure
|
|
96
|
+
*/
|
|
97
|
+
this.v1WorkflowRunDisplayNamesList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/workflow-runs/display-names`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
98
|
+
/**
|
|
99
|
+
* @description Trigger a new workflow run
|
|
100
|
+
*
|
|
101
|
+
* @tags Workflow Runs
|
|
102
|
+
* @name V1WorkflowRunCreate
|
|
103
|
+
* @summary Create workflow run
|
|
104
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/workflow-runs/trigger
|
|
105
|
+
* @secure
|
|
106
|
+
*/
|
|
107
|
+
this.v1WorkflowRunCreate = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/workflow-runs/trigger`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
78
108
|
/**
|
|
79
109
|
* @description Get a workflow run and its metadata to display on the "detail" page
|
|
80
110
|
*
|
|
@@ -114,13 +114,13 @@ export interface APIResourceMeta {
|
|
|
114
114
|
/**
|
|
115
115
|
* the time that this resource was created
|
|
116
116
|
* @format date-time
|
|
117
|
-
* @example "2022-12-
|
|
117
|
+
* @example "2022-12-13T20:06:48.888Z"
|
|
118
118
|
*/
|
|
119
119
|
createdAt: string;
|
|
120
120
|
/**
|
|
121
121
|
* the time that this resource was last updated
|
|
122
122
|
* @format date-time
|
|
123
|
-
* @example "2022-12-
|
|
123
|
+
* @example "2022-12-13T20:06:48.888Z"
|
|
124
124
|
*/
|
|
125
125
|
updatedAt: string;
|
|
126
126
|
}
|
|
@@ -464,7 +464,7 @@ export interface RateLimit {
|
|
|
464
464
|
/**
|
|
465
465
|
* The last time the rate limit was refilled.
|
|
466
466
|
* @format date-time
|
|
467
|
-
* @example "2022-12-
|
|
467
|
+
* @example "2022-12-13T20:06:48.888Z"
|
|
468
468
|
*/
|
|
469
469
|
lastRefill: string;
|
|
470
470
|
}
|
|
@@ -996,13 +996,13 @@ export interface Worker {
|
|
|
996
996
|
/**
|
|
997
997
|
* The time this worker last sent a heartbeat.
|
|
998
998
|
* @format date-time
|
|
999
|
-
* @example "2022-12-
|
|
999
|
+
* @example "2022-12-13T20:06:48.888Z"
|
|
1000
1000
|
*/
|
|
1001
1001
|
lastHeartbeatAt?: string;
|
|
1002
1002
|
/**
|
|
1003
1003
|
* The time this worker last sent a heartbeat.
|
|
1004
1004
|
* @format date-time
|
|
1005
|
-
* @example "2022-12-
|
|
1005
|
+
* @example "2022-12-13T20:06:48.888Z"
|
|
1006
1006
|
*/
|
|
1007
1007
|
lastListenerEstablished?: string;
|
|
1008
1008
|
/** The actions this worker can perform. */
|
|
@@ -1259,22 +1259,42 @@ export interface V1TaskSummaryList {
|
|
|
1259
1259
|
/** The list of tasks */
|
|
1260
1260
|
rows: V1TaskSummary[];
|
|
1261
1261
|
}
|
|
1262
|
+
export interface V1WorkflowRunDisplayNameList {
|
|
1263
|
+
pagination: PaginationResponse;
|
|
1264
|
+
/** The list of display names */
|
|
1265
|
+
rows: {
|
|
1266
|
+
metadata: APIResourceMeta;
|
|
1267
|
+
displayName: string;
|
|
1268
|
+
}[];
|
|
1269
|
+
}
|
|
1262
1270
|
export interface V1TaskSummary {
|
|
1263
1271
|
metadata: APIResourceMeta;
|
|
1264
|
-
/**
|
|
1265
|
-
|
|
1272
|
+
/** Additional metadata for the task run. */
|
|
1273
|
+
additionalMetadata?: object;
|
|
1274
|
+
/** The list of children tasks */
|
|
1275
|
+
children?: V1TaskSummary[];
|
|
1266
1276
|
/**
|
|
1267
|
-
* The
|
|
1268
|
-
* @format
|
|
1269
|
-
* @minLength 36
|
|
1270
|
-
* @maxLength 36
|
|
1277
|
+
* The timestamp the task was created.
|
|
1278
|
+
* @format date-time
|
|
1271
1279
|
*/
|
|
1272
|
-
|
|
1280
|
+
createdAt: string;
|
|
1281
|
+
/** The display name of the task run. */
|
|
1282
|
+
displayName: string;
|
|
1283
|
+
/** The duration of the task run, in milliseconds. */
|
|
1284
|
+
duration?: number;
|
|
1285
|
+
/** The error message of the task run (for the latest run) */
|
|
1286
|
+
errorMessage?: string;
|
|
1273
1287
|
/**
|
|
1274
|
-
* The timestamp the task
|
|
1288
|
+
* The timestamp the task run finished.
|
|
1275
1289
|
* @format date-time
|
|
1276
1290
|
*/
|
|
1277
|
-
|
|
1291
|
+
finishedAt?: string;
|
|
1292
|
+
/** The input of the task run. */
|
|
1293
|
+
input: object;
|
|
1294
|
+
/** The number of spawned children tasks */
|
|
1295
|
+
numSpawnedChildren: number;
|
|
1296
|
+
/** The output of the task run (for the latest run) */
|
|
1297
|
+
output: object;
|
|
1278
1298
|
status: V1TaskStatus;
|
|
1279
1299
|
/**
|
|
1280
1300
|
* The timestamp the task run started.
|
|
@@ -1282,54 +1302,19 @@ export interface V1TaskSummary {
|
|
|
1282
1302
|
*/
|
|
1283
1303
|
startedAt?: string;
|
|
1284
1304
|
/**
|
|
1285
|
-
* The
|
|
1286
|
-
* @format date-time
|
|
1287
|
-
*/
|
|
1288
|
-
finishedAt?: string;
|
|
1289
|
-
/** The duration of the task run, in milliseconds. */
|
|
1290
|
-
duration?: number;
|
|
1291
|
-
/**
|
|
1292
|
-
* The ID of the tenant.
|
|
1305
|
+
* The step ID of the task.
|
|
1293
1306
|
* @format uuid
|
|
1294
1307
|
* @minLength 36
|
|
1295
1308
|
* @maxLength 36
|
|
1296
|
-
* @example "bb214807-246e-43a5-a25d-41761d1cff9e"
|
|
1297
1309
|
*/
|
|
1298
|
-
|
|
1299
|
-
/** Additional metadata for the task run. */
|
|
1300
|
-
additionalMetadata?: object;
|
|
1301
|
-
/** The display name of the task run. */
|
|
1302
|
-
displayName: string;
|
|
1303
|
-
/** @format uuid */
|
|
1304
|
-
workflowId: string;
|
|
1305
|
-
/** The output of the task run (for the latest run) */
|
|
1306
|
-
output: object;
|
|
1307
|
-
/** The error message of the task run (for the latest run) */
|
|
1308
|
-
errorMessage?: string;
|
|
1309
|
-
/** The input of the task run. */
|
|
1310
|
-
input?: object;
|
|
1311
|
-
/** The type of the workflow (whether it's a DAG or a task) */
|
|
1312
|
-
type: 'DAG' | 'TASK';
|
|
1310
|
+
stepId?: string;
|
|
1313
1311
|
/**
|
|
1314
|
-
* The
|
|
1312
|
+
* The external ID of the task.
|
|
1315
1313
|
* @format uuid
|
|
1314
|
+
* @minLength 36
|
|
1315
|
+
* @maxLength 36
|
|
1316
1316
|
*/
|
|
1317
|
-
|
|
1318
|
-
/**
|
|
1319
|
-
* The timestamp the task was created.
|
|
1320
|
-
* @format date-time
|
|
1321
|
-
*/
|
|
1322
|
-
createdAt?: string;
|
|
1323
|
-
/** The list of children tasks */
|
|
1324
|
-
children?: V1TaskSummary[];
|
|
1325
|
-
}
|
|
1326
|
-
export interface V1DagChildren {
|
|
1327
|
-
/** @format uuid */
|
|
1328
|
-
dagId?: string;
|
|
1329
|
-
children?: V1TaskSummary[];
|
|
1330
|
-
}
|
|
1331
|
-
export interface V1Task {
|
|
1332
|
-
metadata: APIResourceMeta;
|
|
1317
|
+
taskExternalId: string;
|
|
1333
1318
|
/** The ID of the task. */
|
|
1334
1319
|
taskId: number;
|
|
1335
1320
|
/**
|
|
@@ -1337,19 +1322,6 @@ export interface V1Task {
|
|
|
1337
1322
|
* @format date-time
|
|
1338
1323
|
*/
|
|
1339
1324
|
taskInsertedAt: string;
|
|
1340
|
-
status: V1TaskStatus;
|
|
1341
|
-
/**
|
|
1342
|
-
* The timestamp the task run started.
|
|
1343
|
-
* @format date-time
|
|
1344
|
-
*/
|
|
1345
|
-
startedAt?: string;
|
|
1346
|
-
/**
|
|
1347
|
-
* The timestamp the task run finished.
|
|
1348
|
-
* @format date-time
|
|
1349
|
-
*/
|
|
1350
|
-
finishedAt?: string;
|
|
1351
|
-
/** The duration of the task run, in milliseconds. */
|
|
1352
|
-
duration?: number;
|
|
1353
1325
|
/**
|
|
1354
1326
|
* The ID of the tenant.
|
|
1355
1327
|
* @format uuid
|
|
@@ -1358,25 +1330,26 @@ export interface V1Task {
|
|
|
1358
1330
|
* @example "bb214807-246e-43a5-a25d-41761d1cff9e"
|
|
1359
1331
|
*/
|
|
1360
1332
|
tenantId: string;
|
|
1361
|
-
/**
|
|
1362
|
-
|
|
1363
|
-
/** The display name of the task run. */
|
|
1364
|
-
displayName: string;
|
|
1333
|
+
/** The type of the workflow (whether it's a DAG or a task) */
|
|
1334
|
+
type: 'DAG' | 'TASK';
|
|
1365
1335
|
/** @format uuid */
|
|
1366
1336
|
workflowId: string;
|
|
1367
|
-
|
|
1368
|
-
input: string;
|
|
1369
|
-
/** The output of the task run (for the latest run) */
|
|
1370
|
-
output?: string;
|
|
1371
|
-
/** The error message of the task run (for the latest run) */
|
|
1372
|
-
errorMessage?: string;
|
|
1337
|
+
workflowName?: string;
|
|
1373
1338
|
/**
|
|
1374
|
-
* The external ID of the workflow run
|
|
1339
|
+
* The external ID of the workflow run
|
|
1375
1340
|
* @format uuid
|
|
1376
|
-
* @minLength 36
|
|
1377
|
-
* @maxLength 36
|
|
1378
1341
|
*/
|
|
1379
1342
|
workflowRunExternalId?: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* The version ID of the workflow
|
|
1345
|
+
* @format uuid
|
|
1346
|
+
*/
|
|
1347
|
+
workflowVersionId?: string;
|
|
1348
|
+
}
|
|
1349
|
+
export interface V1DagChildren {
|
|
1350
|
+
/** @format uuid */
|
|
1351
|
+
dagId?: string;
|
|
1352
|
+
children?: V1TaskSummary[];
|
|
1380
1353
|
}
|
|
1381
1354
|
export interface V1TaskEventList {
|
|
1382
1355
|
pagination?: PaginationResponse;
|
|
@@ -1491,7 +1464,13 @@ export interface V1WorkflowRunDetails {
|
|
|
1491
1464
|
* @maxLength 36
|
|
1492
1465
|
*/
|
|
1493
1466
|
taskExternalId: string;
|
|
1494
|
-
|
|
1467
|
+
/**
|
|
1468
|
+
* @format uuid
|
|
1469
|
+
* @minLength 36
|
|
1470
|
+
* @maxLength 36
|
|
1471
|
+
*/
|
|
1472
|
+
stepId: string;
|
|
1473
|
+
childrenStepIds: string[];
|
|
1495
1474
|
taskName: string;
|
|
1496
1475
|
}[];
|
|
1497
1476
|
tasks: V1TaskSummary[];
|
|
@@ -1503,3 +1482,30 @@ export declare enum V1TaskRunStatus {
|
|
|
1503
1482
|
FAILED = "FAILED",
|
|
1504
1483
|
CANCELLED = "CANCELLED"
|
|
1505
1484
|
}
|
|
1485
|
+
export interface V1TriggerWorkflowRunRequest {
|
|
1486
|
+
/** The name of the workflow. */
|
|
1487
|
+
workflowName: string;
|
|
1488
|
+
input: object;
|
|
1489
|
+
additionalMetadata?: object;
|
|
1490
|
+
}
|
|
1491
|
+
export interface V1LogLine {
|
|
1492
|
+
/**
|
|
1493
|
+
* The creation date of the log line.
|
|
1494
|
+
* @format date-time
|
|
1495
|
+
*/
|
|
1496
|
+
createdAt: string;
|
|
1497
|
+
/** The log message. */
|
|
1498
|
+
message: string;
|
|
1499
|
+
/** The log metadata. */
|
|
1500
|
+
metadata: object;
|
|
1501
|
+
}
|
|
1502
|
+
export declare enum V1LogLineLevel {
|
|
1503
|
+
DEBUG = "DEBUG",
|
|
1504
|
+
INFO = "INFO",
|
|
1505
|
+
WARN = "WARN",
|
|
1506
|
+
ERROR = "ERROR"
|
|
1507
|
+
}
|
|
1508
|
+
export interface V1LogLineList {
|
|
1509
|
+
pagination?: PaginationResponse;
|
|
1510
|
+
rows?: V1LogLine[];
|
|
1511
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* ---------------------------------------------------------------
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.V1TaskRunStatus = exports.V1TaskStatus = exports.WebhookWorkerRequestMethod = exports.LogLineOrderByDirection = exports.LogLineOrderByField = exports.LogLineLevel = exports.PullRequestState = exports.WorkerRuntimeSDKs = exports.StepRunEventSeverity = exports.StepRunEventReason = exports.StepRunStatus = exports.JobRunStatus = exports.WorkflowKind = exports.WorkflowRunStatus = exports.WorkflowRunOrderByDirection = exports.WorkflowRunOrderByField = exports.CronWorkflowsOrderByField = exports.ScheduledRunStatus = exports.ScheduledWorkflowsOrderByField = exports.RateLimitOrderByDirection = exports.RateLimitOrderByField = exports.EventOrderByDirection = exports.EventOrderByField = exports.TenantResource = exports.TenantMemberRole = void 0;
|
|
13
|
+
exports.V1LogLineLevel = exports.V1TaskRunStatus = exports.V1TaskStatus = exports.WebhookWorkerRequestMethod = exports.LogLineOrderByDirection = exports.LogLineOrderByField = exports.LogLineLevel = exports.PullRequestState = exports.WorkerRuntimeSDKs = exports.StepRunEventSeverity = exports.StepRunEventReason = exports.StepRunStatus = exports.JobRunStatus = exports.WorkflowKind = exports.WorkflowRunStatus = exports.WorkflowRunOrderByDirection = exports.WorkflowRunOrderByField = exports.CronWorkflowsOrderByField = exports.ScheduledRunStatus = exports.ScheduledWorkflowsOrderByField = exports.RateLimitOrderByDirection = exports.RateLimitOrderByField = exports.EventOrderByDirection = exports.EventOrderByField = exports.TenantResource = exports.TenantMemberRole = void 0;
|
|
14
14
|
var TenantMemberRole;
|
|
15
15
|
(function (TenantMemberRole) {
|
|
16
16
|
TenantMemberRole["OWNER"] = "OWNER";
|
|
@@ -189,3 +189,10 @@ var V1TaskRunStatus;
|
|
|
189
189
|
V1TaskRunStatus["FAILED"] = "FAILED";
|
|
190
190
|
V1TaskRunStatus["CANCELLED"] = "CANCELLED";
|
|
191
191
|
})(V1TaskRunStatus || (exports.V1TaskRunStatus = V1TaskRunStatus = {}));
|
|
192
|
+
var V1LogLineLevel;
|
|
193
|
+
(function (V1LogLineLevel) {
|
|
194
|
+
V1LogLineLevel["DEBUG"] = "DEBUG";
|
|
195
|
+
V1LogLineLevel["INFO"] = "INFO";
|
|
196
|
+
V1LogLineLevel["WARN"] = "WARN";
|
|
197
|
+
V1LogLineLevel["ERROR"] = "ERROR";
|
|
198
|
+
})(V1LogLineLevel || (exports.V1LogLineLevel = V1LogLineLevel = {}));
|
|
@@ -6,6 +6,7 @@ import { Workflow } from '../../workflow';
|
|
|
6
6
|
import { Logger } from '../../util/logger';
|
|
7
7
|
import { WebhookHandler } from './handler';
|
|
8
8
|
import { WebhookWorkerCreateRequest } from '../rest/generated/data-contracts';
|
|
9
|
+
import { BaseWorkflowDeclaration, WorkflowDefinition } from '../../v1/declaration';
|
|
9
10
|
import { Context, StepRunFunction } from '../../step';
|
|
10
11
|
import { WorkerLabels } from '../dispatcher/dispatcher-client';
|
|
11
12
|
export type ActionRegistry = Record<Action['actionId'], Function>;
|
|
@@ -22,7 +23,7 @@ export declare class V0Worker {
|
|
|
22
23
|
killing: boolean;
|
|
23
24
|
handle_kill: boolean;
|
|
24
25
|
action_registry: ActionRegistry;
|
|
25
|
-
workflow_registry: Workflow
|
|
26
|
+
workflow_registry: Array<WorkflowDefinition | Workflow>;
|
|
26
27
|
listener: ActionListener | undefined;
|
|
27
28
|
futures: Record<Action['stepRunId'], HatchetPromise<any>>;
|
|
28
29
|
contexts: Record<Action['stepRunId'], Context<any, any>>;
|
|
@@ -43,6 +44,9 @@ export declare class V0Worker {
|
|
|
43
44
|
* @deprecated use registerWorkflow instead
|
|
44
45
|
*/
|
|
45
46
|
register_workflow(initWorkflow: Workflow): Promise<void>;
|
|
47
|
+
registerDurableActionsV1(workflow: WorkflowDefinition): void;
|
|
48
|
+
private registerActionsV1;
|
|
49
|
+
registerWorkflowV1(initWorkflow: BaseWorkflowDeclaration<any, any>): Promise<void>;
|
|
46
50
|
registerWorkflow(initWorkflow: Workflow): Promise<void>;
|
|
47
51
|
registerAction<T, K>(actionId: string, action: StepRunFunction<T, K>): void;
|
|
48
52
|
handleStartStepRun(action: Action): Promise<void>;
|