@hatchet-dev/typescript-sdk 0.20.2 → 1.0.0-alpha0
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/hatchet-client/features/cron-client.d.ts +0 -1
- package/clients/hatchet-client/features/cron-client.js +6 -3
- package/clients/hatchet-client/hatchet-client.d.ts +8 -7
- package/clients/hatchet-client/hatchet-client.js +9 -8
- package/clients/hatchet-client/hatchet-logger.js +2 -2
- package/clients/listener/listener-client.js +1 -0
- package/clients/rest/generated/Api.d.ts +201 -1
- package/clients/rest/generated/Api.js +108 -0
- package/clients/rest/generated/data-contracts.d.ts +270 -8
- package/clients/rest/generated/data-contracts.js +20 -1
- package/clients/worker/handler.d.ts +2 -2
- package/clients/worker/worker.d.ts +4 -4
- package/clients/worker/worker.js +3 -3
- package/examples/api.js +1 -1
- package/examples/example-event-with-results.js +1 -1
- package/examples/stream-by-additional-meta.js +1 -1
- package/index.d.ts +3 -1
- package/index.js +5 -3
- package/package.json +2 -2
- package/protoc/dispatcher/dispatcher.d.ts +2 -0
- package/protoc/dispatcher/dispatcher.js +17 -1
- package/protoc/workflows/v1-admin.d.ts +79 -0
- package/protoc/workflows/v1-admin.js +529 -0
- package/sdk.d.ts +1 -1
- package/sdk.js +2 -2
- package/step.d.ts +75 -9
- package/step.js +65 -2
- package/util/hatchet-promise/hatchet-promise.js +1 -0
- package/v1/client/client.d.ts +81 -0
- package/v1/client/client.interface.d.ts +4 -0
- package/v1/client/client.interface.js +2 -0
- package/v1/client/client.js +134 -0
- package/v1/client/worker.d.ts +82 -0
- package/v1/client/worker.js +125 -0
- package/v1/examples/child_workflows/run.d.ts +1 -0
- package/v1/examples/child_workflows/run.js +30 -0
- package/v1/examples/child_workflows/worker.d.ts +1 -0
- package/v1/examples/child_workflows/worker.js +24 -0
- package/v1/examples/child_workflows/workflow.d.ts +19 -0
- package/v1/examples/child_workflows/workflow.js +43 -0
- package/v1/examples/client.d.ts +2 -0
- package/v1/examples/client.js +5 -0
- package/v1/examples/concurrency-rr/load.d.ts +1 -0
- package/v1/examples/concurrency-rr/load.js +54 -0
- package/v1/examples/concurrency-rr/run.d.ts +1 -0
- package/v1/examples/concurrency-rr/run.js +39 -0
- package/v1/examples/concurrency-rr/worker.d.ts +1 -0
- package/v1/examples/concurrency-rr/worker.js +24 -0
- package/v1/examples/concurrency-rr/workflow.d.ts +11 -0
- package/v1/examples/concurrency-rr/workflow.js +35 -0
- package/v1/examples/dag/run.d.ts +1 -0
- package/v1/examples/dag/run.js +24 -0
- package/v1/examples/dag/worker.d.ts +1 -0
- package/v1/examples/dag/worker.js +24 -0
- package/v1/examples/dag/workflow.d.ts +11 -0
- package/v1/examples/dag/workflow.js +35 -0
- package/v1/examples/deep/run.d.ts +1 -0
- package/v1/examples/deep/run.js +28 -0
- package/v1/examples/deep/worker.d.ts +1 -0
- package/v1/examples/deep/worker.js +25 -0
- package/v1/examples/deep/workflow.d.ts +18 -0
- package/v1/examples/deep/workflow.js +110 -0
- package/v1/examples/legacy/run.d.ts +1 -0
- package/v1/examples/legacy/run.js +25 -0
- package/v1/examples/legacy/worker.d.ts +1 -0
- package/v1/examples/legacy/worker.js +24 -0
- package/v1/examples/legacy/workflow.d.ts +2 -0
- package/v1/examples/legacy/workflow.js +36 -0
- package/v1/examples/on_event/event.d.ts +1 -0
- package/v1/examples/on_event/event.js +25 -0
- package/v1/examples/on_event/worker.d.ts +1 -0
- package/v1/examples/on_event/worker.js +24 -0
- package/v1/examples/on_event/workflow.d.ts +17 -0
- package/v1/examples/on_event/workflow.js +33 -0
- package/v1/examples/simple/cron.d.ts +1 -0
- package/v1/examples/simple/cron.js +26 -0
- package/v1/examples/simple/delay.d.ts +1 -0
- package/v1/examples/simple/delay.js +27 -0
- package/v1/examples/simple/run.d.ts +1 -0
- package/v1/examples/simple/run.js +24 -0
- package/v1/examples/simple/schedule.d.ts +1 -0
- package/v1/examples/simple/schedule.js +27 -0
- package/v1/examples/simple/worker.d.ts +1 -0
- package/v1/examples/simple/worker.js +24 -0
- package/v1/examples/simple/workflow.d.ts +5 -0
- package/v1/examples/simple/workflow.js +15 -0
- package/v1/index.d.ts +0 -0
- package/v1/index.js +1 -0
- package/v1/task.d.ts +51 -0
- package/v1/task.js +2 -0
- package/v1/workflow.d.ts +152 -0
- package/v1/workflow.js +145 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/workflow.d.ts +3 -0
|
@@ -4,7 +4,6 @@ import { CronWorkflows, CronWorkflowsList } from '../../rest/generated/data-cont
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { Workflow } from '../../../workflow';
|
|
6
6
|
import { ClientConfig } from '../client-config';
|
|
7
|
-
export declare const CronRegex: RegExp;
|
|
8
7
|
/**
|
|
9
8
|
* Schema for creating a Cron Trigger.
|
|
10
9
|
*/
|
|
@@ -9,16 +9,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CronClient = exports.CreateCronTriggerSchema =
|
|
12
|
+
exports.CronClient = exports.CreateCronTriggerSchema = void 0;
|
|
13
13
|
const zod_1 = require("zod");
|
|
14
14
|
const axios_1 = require("axios");
|
|
15
|
-
exports.CronRegex = /^(\*|([0-9]|[1-5][0-9])(,([0-9]|[1-5][0-9]))*|([0-9]|[1-5][0-9])-([0-9]|[1-5][0-9])|\*\/([0-9]|[1-5][0-9])) (\*|([0-9]|1[0-9]|2[0-3])(,([0-9]|1[0-9]|2[0-3]))*|([0-9]|1[0-9]|2[0-3])-([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|[12][0-9]|3[01])(,([1-9]|[12][0-9]|3[01]))*|([1-9]|[12][0-9]|3[01])-([1-9]|[12][0-9]|3[01])|\*\/([1-9]|[12][0-9]|3[01])) (\*|([1-9]|1[0-2])(,([1-9]|1[0-2]))*|([1-9]|1[0-2])-([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-7])(,([0-7]))*|([0-7])-([0-7])|\*\/([0-7]))$/;
|
|
16
15
|
/**
|
|
17
16
|
* Schema for creating a Cron Trigger.
|
|
18
17
|
*/
|
|
19
18
|
exports.CreateCronTriggerSchema = zod_1.z.object({
|
|
20
19
|
name: zod_1.z.string(),
|
|
21
|
-
expression: zod_1.z.string().refine((val) =>
|
|
20
|
+
expression: zod_1.z.string().refine((val) => {
|
|
21
|
+
// Basic cron validation regex
|
|
22
|
+
const cronRegex = /^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$/;
|
|
23
|
+
return cronRegex.test(val);
|
|
24
|
+
}, 'Invalid cron expression'),
|
|
22
25
|
input: zod_1.z.record(zod_1.z.any()).optional(),
|
|
23
26
|
additionalMetadata: zod_1.z.record(zod_1.z.string()).optional(),
|
|
24
27
|
});
|
|
@@ -2,10 +2,11 @@ import { EventClient } from '../event/event-client';
|
|
|
2
2
|
import { DispatcherClient } from '../dispatcher/dispatcher-client';
|
|
3
3
|
import { AdminClient } from '../admin/admin-client';
|
|
4
4
|
import { CallOptions, ChannelCredentials, ClientMiddlewareCall } from 'nice-grpc';
|
|
5
|
-
import { Workflow } from '../../workflow';
|
|
6
|
-
import {
|
|
5
|
+
import { Workflow as V0Workflow } from '../../workflow';
|
|
6
|
+
import { V0Worker, WorkerOpts } from '../worker';
|
|
7
7
|
import { AxiosRequestConfig } from 'axios';
|
|
8
8
|
import { Logger } from '../../util/logger';
|
|
9
|
+
import { Workflow as V1Workflow } from '../../v1/workflow';
|
|
9
10
|
import { ClientConfig } from './client-config';
|
|
10
11
|
import { ListenerClient } from '../listener/listener-client';
|
|
11
12
|
import { Api } from '../rest/generated/Api';
|
|
@@ -17,7 +18,7 @@ export interface HatchetClientOptions {
|
|
|
17
18
|
}
|
|
18
19
|
export declare const channelFactory: (config: ClientConfig, credentials: ChannelCredentials) => import("nice-grpc").Channel;
|
|
19
20
|
export declare const addTokenMiddleware: (token: string) => <Request, Response>(call: ClientMiddlewareCall<Request, Response>, options: CallOptions) => AsyncGenerator<Awaited<Response>, Awaited<Response> | undefined, undefined>;
|
|
20
|
-
export declare class
|
|
21
|
+
export declare class InternalHatchetClient {
|
|
21
22
|
config: ClientConfig;
|
|
22
23
|
credentials: ChannelCredentials;
|
|
23
24
|
event: EventClient;
|
|
@@ -30,8 +31,8 @@ export declare class HatchetClient {
|
|
|
30
31
|
cron: CronClient;
|
|
31
32
|
schedule: ScheduleClient;
|
|
32
33
|
constructor(config?: Partial<ClientConfig>, options?: HatchetClientOptions, axiosOpts?: AxiosRequestConfig);
|
|
33
|
-
static init(config?: Partial<ClientConfig>, options?: HatchetClientOptions, axiosConfig?: AxiosRequestConfig):
|
|
34
|
-
run(workflow: string |
|
|
35
|
-
worker(workflow: string |
|
|
36
|
-
webhooks(workflows:
|
|
34
|
+
static init(config?: Partial<ClientConfig>, options?: HatchetClientOptions, axiosConfig?: AxiosRequestConfig): InternalHatchetClient;
|
|
35
|
+
run(workflow: string | V0Workflow): Promise<V0Worker>;
|
|
36
|
+
worker(workflow: string | V0Workflow, opts?: Omit<WorkerOpts, 'name'> | number): Promise<V0Worker>;
|
|
37
|
+
webhooks(workflows: Array<V1Workflow<any, any> | V0Workflow>): import("../worker/handler").WebhookHandler;
|
|
37
38
|
}
|
|
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.
|
|
40
|
+
exports.InternalHatchetClient = exports.addTokenMiddleware = exports.channelFactory = void 0;
|
|
41
41
|
const zod_1 = require("zod");
|
|
42
42
|
const config_loader_1 = require("../../util/config-loader");
|
|
43
43
|
const event_client_1 = require("../event/event-client");
|
|
@@ -46,6 +46,7 @@ const admin_client_1 = require("../admin/admin-client");
|
|
|
46
46
|
const nice_grpc_1 = require("nice-grpc");
|
|
47
47
|
const worker_1 = require("../worker");
|
|
48
48
|
const hatchet_logger_1 = require("./hatchet-logger");
|
|
49
|
+
const worker_2 = require("../../v1/client/worker");
|
|
49
50
|
const client_config_1 = require("./client-config");
|
|
50
51
|
const listener_client_1 = require("../listener/listener-client");
|
|
51
52
|
const rest_1 = __importDefault(require("../rest"));
|
|
@@ -88,7 +89,7 @@ const addTokenMiddleware = (token) => function _(call, options) {
|
|
|
88
89
|
});
|
|
89
90
|
};
|
|
90
91
|
exports.addTokenMiddleware = addTokenMiddleware;
|
|
91
|
-
class
|
|
92
|
+
class InternalHatchetClient {
|
|
92
93
|
constructor(config, options, axiosOpts) {
|
|
93
94
|
// Initializes a new Client instance.
|
|
94
95
|
// Loads config in the following order: config param > yaml file > env vars
|
|
@@ -120,13 +121,13 @@ class HatchetClient {
|
|
|
120
121
|
this.listener = new listener_client_1.ListenerClient(this.config, (0, exports.channelFactory)(this.config, this.credentials), clientFactory, this.api);
|
|
121
122
|
this.admin = new admin_client_1.AdminClient(this.config, (0, exports.channelFactory)(this.config, this.credentials), clientFactory, this.api, this.tenantId, this.listener);
|
|
122
123
|
this.logger = this.config.logger('HatchetClient', this.config.log_level);
|
|
123
|
-
this.logger.
|
|
124
|
+
this.logger.debug(`Initialized HatchetClient`);
|
|
124
125
|
// Feature Clients
|
|
125
126
|
this.cron = new cron_client_1.CronClient(this.tenantId, this.config, this.api, this.admin);
|
|
126
127
|
this.schedule = new schedule_client_1.ScheduleClient(this.tenantId, this.config, this.api, this.admin);
|
|
127
128
|
}
|
|
128
129
|
static init(config, options, axiosConfig) {
|
|
129
|
-
return new
|
|
130
|
+
return new InternalHatchetClient(config, options, axiosConfig);
|
|
130
131
|
}
|
|
131
132
|
// @deprecated
|
|
132
133
|
run(workflow) {
|
|
@@ -150,7 +151,7 @@ class HatchetClient {
|
|
|
150
151
|
else {
|
|
151
152
|
options = Object.assign(Object.assign({}, options), opts);
|
|
152
153
|
}
|
|
153
|
-
const worker = new worker_1.
|
|
154
|
+
const worker = new worker_1.V0Worker(this, options);
|
|
154
155
|
if (typeof workflow !== 'string') {
|
|
155
156
|
yield worker.registerWorkflow(workflow);
|
|
156
157
|
return worker;
|
|
@@ -159,10 +160,10 @@ class HatchetClient {
|
|
|
159
160
|
});
|
|
160
161
|
}
|
|
161
162
|
webhooks(workflows) {
|
|
162
|
-
const worker = new worker_1.
|
|
163
|
+
const worker = new worker_1.V0Worker(this, {
|
|
163
164
|
name: 'webhook-worker',
|
|
164
165
|
});
|
|
165
|
-
return worker.getHandler(workflows);
|
|
166
|
+
return worker.getHandler(workflows.map(worker_2.toV0Workflow));
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
|
-
exports.
|
|
169
|
+
exports.InternalHatchetClient = InternalHatchetClient;
|
|
@@ -9,7 +9,7 @@ class HatchetLogger {
|
|
|
9
9
|
this.logLevel = logLevel;
|
|
10
10
|
this.context = context;
|
|
11
11
|
}
|
|
12
|
-
log(level, message, color) {
|
|
12
|
+
log(level, message, color = '37') {
|
|
13
13
|
if (logger_1.LogLevelEnum[level] >= logger_1.LogLevelEnum[this.logLevel]) {
|
|
14
14
|
const time = new Date().toLocaleString('en-US', {
|
|
15
15
|
month: '2-digit',
|
|
@@ -20,7 +20,7 @@ class HatchetLogger {
|
|
|
20
20
|
second: '2-digit',
|
|
21
21
|
});
|
|
22
22
|
// eslint-disable-next-line no-console
|
|
23
|
-
console.log(`🪓 ${process.pid} | ${time} ${color && `\x1b[${color}m`} [${level}/${this.context}] ${message}\x1b[0m`);
|
|
23
|
+
console.log(`🪓 ${process.pid} | ${time} ${color && `\x1b[${color || ''}m`} [${level}/${this.context}] ${message}\x1b[0m`);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
debug(message) {
|
|
@@ -92,6 +92,7 @@ const workflowStatusMap = {
|
|
|
92
92
|
[data_contracts_1.WorkflowRunStatus.PENDING]: undefined,
|
|
93
93
|
[data_contracts_1.WorkflowRunStatus.RUNNING]: undefined,
|
|
94
94
|
[data_contracts_1.WorkflowRunStatus.QUEUED]: undefined,
|
|
95
|
+
[data_contracts_1.WorkflowRunStatus.BACKOFF]: undefined,
|
|
95
96
|
};
|
|
96
97
|
class RunEventListener {
|
|
97
98
|
constructor(client) {
|
|
@@ -1,6 +1,195 @@
|
|
|
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, 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';
|
|
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, V1ReplayTaskRequest, V1Task, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummaryList, V1WorkflowRunDetails, 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
|
+
/**
|
|
5
|
+
* @description Get a task by id
|
|
6
|
+
*
|
|
7
|
+
* @tags Task
|
|
8
|
+
* @name V1TaskGet
|
|
9
|
+
* @summary Get a task
|
|
10
|
+
* @request GET:/api/v1/stable/tasks/{task}
|
|
11
|
+
* @secure
|
|
12
|
+
*/
|
|
13
|
+
v1TaskGet: (task: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1Task, any>>;
|
|
14
|
+
/**
|
|
15
|
+
* @description List events for a task
|
|
16
|
+
*
|
|
17
|
+
* @tags Task
|
|
18
|
+
* @name V1TaskEventList
|
|
19
|
+
* @summary List events for a task
|
|
20
|
+
* @request GET:/api/v1/stable/tasks/{task}/task-events
|
|
21
|
+
* @secure
|
|
22
|
+
*/
|
|
23
|
+
v1TaskEventList: (task: string, query?: {
|
|
24
|
+
/**
|
|
25
|
+
* The number to skip
|
|
26
|
+
* @format int64
|
|
27
|
+
*/
|
|
28
|
+
offset?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The number to limit by
|
|
31
|
+
* @format int64
|
|
32
|
+
*/
|
|
33
|
+
limit?: number;
|
|
34
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskEventList, any>>;
|
|
35
|
+
/**
|
|
36
|
+
* @description Cancel tasks
|
|
37
|
+
*
|
|
38
|
+
* @tags Task
|
|
39
|
+
* @name V1TaskCancel
|
|
40
|
+
* @summary Cancel tasks
|
|
41
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/tasks/cancel
|
|
42
|
+
* @secure
|
|
43
|
+
*/
|
|
44
|
+
v1TaskCancel: (tenant: string, data: V1CancelTaskRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
45
|
+
/**
|
|
46
|
+
* @description Replay tasks
|
|
47
|
+
*
|
|
48
|
+
* @tags Task
|
|
49
|
+
* @name V1TaskReplay
|
|
50
|
+
* @summary Replay tasks
|
|
51
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/tasks/replay
|
|
52
|
+
* @secure
|
|
53
|
+
*/
|
|
54
|
+
v1TaskReplay: (tenant: string, data: V1ReplayTaskRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
55
|
+
/**
|
|
56
|
+
* @description Lists all tasks that belong a specific list of dags
|
|
57
|
+
*
|
|
58
|
+
* @tags Task
|
|
59
|
+
* @name V1DagListTasks
|
|
60
|
+
* @summary List tasks
|
|
61
|
+
* @request GET:/api/v1/stable/dags/tasks
|
|
62
|
+
* @secure
|
|
63
|
+
*/
|
|
64
|
+
v1DagListTasks: (query: {
|
|
65
|
+
/** The external id of the DAG */
|
|
66
|
+
dag_ids: string[];
|
|
67
|
+
/**
|
|
68
|
+
* The tenant id
|
|
69
|
+
* @format uuid
|
|
70
|
+
* @minLength 36
|
|
71
|
+
* @maxLength 36
|
|
72
|
+
*/
|
|
73
|
+
tenant: string;
|
|
74
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1DagChildren[], any>>;
|
|
75
|
+
/**
|
|
76
|
+
* @description Lists workflow runs for a tenant.
|
|
77
|
+
*
|
|
78
|
+
* @tags Workflow Runs
|
|
79
|
+
* @name V1WorkflowRunList
|
|
80
|
+
* @summary List workflow runs
|
|
81
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/workflow-runs
|
|
82
|
+
* @secure
|
|
83
|
+
*/
|
|
84
|
+
v1WorkflowRunList: (tenant: string, query: {
|
|
85
|
+
/**
|
|
86
|
+
* The number to skip
|
|
87
|
+
* @format int64
|
|
88
|
+
*/
|
|
89
|
+
offset?: number;
|
|
90
|
+
/**
|
|
91
|
+
* The number to limit by
|
|
92
|
+
* @format int64
|
|
93
|
+
*/
|
|
94
|
+
limit?: number;
|
|
95
|
+
/** A list of statuses to filter by */
|
|
96
|
+
statuses?: V1TaskStatus[];
|
|
97
|
+
/**
|
|
98
|
+
* The earliest date to filter by
|
|
99
|
+
* @format date-time
|
|
100
|
+
*/
|
|
101
|
+
since: string;
|
|
102
|
+
/**
|
|
103
|
+
* The latest date to filter by
|
|
104
|
+
* @format date-time
|
|
105
|
+
*/
|
|
106
|
+
until?: string;
|
|
107
|
+
/** Additional metadata k-v pairs to filter by */
|
|
108
|
+
additional_metadata?: string[];
|
|
109
|
+
/** The workflow ids to find runs for */
|
|
110
|
+
workflow_ids?: string[];
|
|
111
|
+
/**
|
|
112
|
+
* The worker id to filter by
|
|
113
|
+
* @format uuid
|
|
114
|
+
* @minLength 36
|
|
115
|
+
* @maxLength 36
|
|
116
|
+
*/
|
|
117
|
+
worker_id?: string;
|
|
118
|
+
/** Whether to include DAGs or only to include tasks */
|
|
119
|
+
only_tasks: boolean;
|
|
120
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskSummaryList, any>>;
|
|
121
|
+
/**
|
|
122
|
+
* @description Get a workflow run and its metadata to display on the "detail" page
|
|
123
|
+
*
|
|
124
|
+
* @tags Workflow Runs
|
|
125
|
+
* @name V1WorkflowRunGet
|
|
126
|
+
* @summary List tasks
|
|
127
|
+
* @request GET:/api/v1/stable/workflow-runs/{v1-workflow-run}
|
|
128
|
+
* @secure
|
|
129
|
+
*/
|
|
130
|
+
v1WorkflowRunGet: (v1WorkflowRun: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1WorkflowRunDetails, any>>;
|
|
131
|
+
/**
|
|
132
|
+
* @description List all tasks for a workflow run
|
|
133
|
+
*
|
|
134
|
+
* @tags Workflow Runs
|
|
135
|
+
* @name V1WorkflowRunTaskEventsList
|
|
136
|
+
* @summary List tasks
|
|
137
|
+
* @request GET:/api/v1/stable/workflow-runs/{v1-workflow-run}/task-events
|
|
138
|
+
* @secure
|
|
139
|
+
*/
|
|
140
|
+
v1WorkflowRunTaskEventsList: (v1WorkflowRun: string, query?: {
|
|
141
|
+
/**
|
|
142
|
+
* The number to skip
|
|
143
|
+
* @format int64
|
|
144
|
+
*/
|
|
145
|
+
offset?: number;
|
|
146
|
+
/**
|
|
147
|
+
* The number to limit by
|
|
148
|
+
* @format int64
|
|
149
|
+
*/
|
|
150
|
+
limit?: number;
|
|
151
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskEventList, any>>;
|
|
152
|
+
/**
|
|
153
|
+
* @description Get a summary of task run metrics for a tenant
|
|
154
|
+
*
|
|
155
|
+
* @tags Task
|
|
156
|
+
* @name V1TaskListStatusMetrics
|
|
157
|
+
* @summary Get task metrics
|
|
158
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/task-metrics
|
|
159
|
+
* @secure
|
|
160
|
+
*/
|
|
161
|
+
v1TaskListStatusMetrics: (tenant: string, query: {
|
|
162
|
+
/**
|
|
163
|
+
* The start time to get metrics for
|
|
164
|
+
* @format date-time
|
|
165
|
+
*/
|
|
166
|
+
since: string;
|
|
167
|
+
/** The workflow id to find runs for */
|
|
168
|
+
workflow_ids?: string[];
|
|
169
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskRunMetrics, any>>;
|
|
170
|
+
/**
|
|
171
|
+
* @description Get a minute by minute breakdown of task metrics for a tenant
|
|
172
|
+
*
|
|
173
|
+
* @tags Task
|
|
174
|
+
* @name V1TaskGetPointMetrics
|
|
175
|
+
* @summary Get task point metrics
|
|
176
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/task-point-metrics
|
|
177
|
+
* @secure
|
|
178
|
+
*/
|
|
179
|
+
v1TaskGetPointMetrics: (tenant: string, query?: {
|
|
180
|
+
/**
|
|
181
|
+
* The time after the task was created
|
|
182
|
+
* @format date-time
|
|
183
|
+
* @example "2021-01-01T00:00:00Z"
|
|
184
|
+
*/
|
|
185
|
+
createdAfter?: string;
|
|
186
|
+
/**
|
|
187
|
+
* The time before the task was completed
|
|
188
|
+
* @format date-time
|
|
189
|
+
* @example "2021-01-01T00:00:00Z"
|
|
190
|
+
*/
|
|
191
|
+
finishedBefore?: string;
|
|
192
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskPointMetrics, any>>;
|
|
4
193
|
/**
|
|
5
194
|
* @description Gets the readiness status
|
|
6
195
|
*
|
|
@@ -1247,4 +1436,15 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
1247
1436
|
* @secure
|
|
1248
1437
|
*/
|
|
1249
1438
|
monitoringPostRunProbe: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
1439
|
+
/**
|
|
1440
|
+
* @description Get the version of the server
|
|
1441
|
+
*
|
|
1442
|
+
* @name InfoGetVersion
|
|
1443
|
+
* @summary We return the version for the currently running server
|
|
1444
|
+
* @request GET:/api/v1/version
|
|
1445
|
+
*/
|
|
1446
|
+
infoGetVersion: (params?: RequestParams) => Promise<import("axios").AxiosResponse<{
|
|
1447
|
+
/** @example "1.0.0" */
|
|
1448
|
+
version: string;
|
|
1449
|
+
}, any>>;
|
|
1250
1450
|
}
|
|
@@ -15,6 +15,106 @@ const http_client_1 = require("./http-client");
|
|
|
15
15
|
class Api extends http_client_1.HttpClient {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
+
/**
|
|
19
|
+
* @description Get a task by id
|
|
20
|
+
*
|
|
21
|
+
* @tags Task
|
|
22
|
+
* @name V1TaskGet
|
|
23
|
+
* @summary Get a task
|
|
24
|
+
* @request GET:/api/v1/stable/tasks/{task}
|
|
25
|
+
* @secure
|
|
26
|
+
*/
|
|
27
|
+
this.v1TaskGet = (task, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tasks/${task}`, method: 'GET', secure: true, format: 'json' }, params));
|
|
28
|
+
/**
|
|
29
|
+
* @description List events for a task
|
|
30
|
+
*
|
|
31
|
+
* @tags Task
|
|
32
|
+
* @name V1TaskEventList
|
|
33
|
+
* @summary List events for a task
|
|
34
|
+
* @request GET:/api/v1/stable/tasks/{task}/task-events
|
|
35
|
+
* @secure
|
|
36
|
+
*/
|
|
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 Cancel tasks
|
|
40
|
+
*
|
|
41
|
+
* @tags Task
|
|
42
|
+
* @name V1TaskCancel
|
|
43
|
+
* @summary Cancel tasks
|
|
44
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/tasks/cancel
|
|
45
|
+
* @secure
|
|
46
|
+
*/
|
|
47
|
+
this.v1TaskCancel = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/tasks/cancel`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json }, params));
|
|
48
|
+
/**
|
|
49
|
+
* @description Replay tasks
|
|
50
|
+
*
|
|
51
|
+
* @tags Task
|
|
52
|
+
* @name V1TaskReplay
|
|
53
|
+
* @summary Replay tasks
|
|
54
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/tasks/replay
|
|
55
|
+
* @secure
|
|
56
|
+
*/
|
|
57
|
+
this.v1TaskReplay = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/tasks/replay`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json }, params));
|
|
58
|
+
/**
|
|
59
|
+
* @description Lists all tasks that belong a specific list of dags
|
|
60
|
+
*
|
|
61
|
+
* @tags Task
|
|
62
|
+
* @name V1DagListTasks
|
|
63
|
+
* @summary List tasks
|
|
64
|
+
* @request GET:/api/v1/stable/dags/tasks
|
|
65
|
+
* @secure
|
|
66
|
+
*/
|
|
67
|
+
this.v1DagListTasks = (query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/dags/tasks`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
68
|
+
/**
|
|
69
|
+
* @description Lists workflow runs for a tenant.
|
|
70
|
+
*
|
|
71
|
+
* @tags Workflow Runs
|
|
72
|
+
* @name V1WorkflowRunList
|
|
73
|
+
* @summary List workflow runs
|
|
74
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/workflow-runs
|
|
75
|
+
* @secure
|
|
76
|
+
*/
|
|
77
|
+
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));
|
|
78
|
+
/**
|
|
79
|
+
* @description Get a workflow run and its metadata to display on the "detail" page
|
|
80
|
+
*
|
|
81
|
+
* @tags Workflow Runs
|
|
82
|
+
* @name V1WorkflowRunGet
|
|
83
|
+
* @summary List tasks
|
|
84
|
+
* @request GET:/api/v1/stable/workflow-runs/{v1-workflow-run}
|
|
85
|
+
* @secure
|
|
86
|
+
*/
|
|
87
|
+
this.v1WorkflowRunGet = (v1WorkflowRun, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/workflow-runs/${v1WorkflowRun}`, method: 'GET', secure: true, format: 'json' }, params));
|
|
88
|
+
/**
|
|
89
|
+
* @description List all tasks for a workflow run
|
|
90
|
+
*
|
|
91
|
+
* @tags Workflow Runs
|
|
92
|
+
* @name V1WorkflowRunTaskEventsList
|
|
93
|
+
* @summary List tasks
|
|
94
|
+
* @request GET:/api/v1/stable/workflow-runs/{v1-workflow-run}/task-events
|
|
95
|
+
* @secure
|
|
96
|
+
*/
|
|
97
|
+
this.v1WorkflowRunTaskEventsList = (v1WorkflowRun, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/workflow-runs/${v1WorkflowRun}/task-events`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
98
|
+
/**
|
|
99
|
+
* @description Get a summary of task run metrics for a tenant
|
|
100
|
+
*
|
|
101
|
+
* @tags Task
|
|
102
|
+
* @name V1TaskListStatusMetrics
|
|
103
|
+
* @summary Get task metrics
|
|
104
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/task-metrics
|
|
105
|
+
* @secure
|
|
106
|
+
*/
|
|
107
|
+
this.v1TaskListStatusMetrics = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/task-metrics`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
108
|
+
/**
|
|
109
|
+
* @description Get a minute by minute breakdown of task metrics for a tenant
|
|
110
|
+
*
|
|
111
|
+
* @tags Task
|
|
112
|
+
* @name V1TaskGetPointMetrics
|
|
113
|
+
* @summary Get task point metrics
|
|
114
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/task-point-metrics
|
|
115
|
+
* @secure
|
|
116
|
+
*/
|
|
117
|
+
this.v1TaskGetPointMetrics = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/task-point-metrics`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
18
118
|
/**
|
|
19
119
|
* @description Gets the readiness status
|
|
20
120
|
*
|
|
@@ -927,6 +1027,14 @@ class Api extends http_client_1.HttpClient {
|
|
|
927
1027
|
* @secure
|
|
928
1028
|
*/
|
|
929
1029
|
this.monitoringPostRunProbe = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/monitoring/${tenant}/probe`, method: 'POST', secure: true }, params));
|
|
1030
|
+
/**
|
|
1031
|
+
* @description Get the version of the server
|
|
1032
|
+
*
|
|
1033
|
+
* @name InfoGetVersion
|
|
1034
|
+
* @summary We return the version for the currently running server
|
|
1035
|
+
* @request GET:/api/v1/version
|
|
1036
|
+
*/
|
|
1037
|
+
this.infoGetVersion = (params = {}) => this.request(Object.assign({ path: `/api/v1/version`, method: 'GET', format: 'json' }, params));
|
|
930
1038
|
}
|
|
931
1039
|
}
|
|
932
1040
|
exports.Api = Api;
|