@hatchet-dev/typescript-sdk 0.1.12 → 0.1.14
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 +72 -1
- package/clients/admin/admin-client.js +93 -2
- package/clients/admin/index.d.ts +1 -0
- package/clients/admin/index.js +17 -0
- package/clients/hatchet-client/client-config.d.ts +6 -0
- package/clients/hatchet-client/client-config.js +2 -0
- package/clients/hatchet-client/hatchet-client.d.ts +6 -2
- package/clients/hatchet-client/hatchet-client.js +7 -4
- package/clients/listener/listener-client.js +1 -1
- package/clients/rest/api.d.ts +4 -0
- package/clients/rest/api.js +13 -0
- package/clients/rest/generated/Api.d.ts +538 -0
- package/clients/rest/generated/Api.js +481 -0
- package/clients/rest/generated/data-contracts.d.ts +599 -0
- package/clients/rest/generated/data-contracts.js +59 -0
- package/clients/rest/generated/http-client.d.ts +41 -0
- package/clients/rest/generated/http-client.js +99 -0
- package/clients/rest/index.d.ts +8 -0
- package/clients/rest/index.js +35 -0
- package/clients/worker/worker.d.ts +3 -2
- package/clients/worker/worker.js +5 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +12 -2
- package/protoc/dispatcher/dispatcher.d.ts +57 -0
- package/protoc/dispatcher/dispatcher.js +157 -2
- package/protoc/workflows/workflows.d.ts +4 -0
- package/protoc/workflows/workflows.js +30 -2
- package/step.d.ts +13 -7
- package/step.js +7 -2
- package/util/config-loader/config-loader.js +13 -4
- package/util/config-loader/token.d.ts +1 -0
- package/util/config-loader/token.js +6 -1
- package/workflow.d.ts +9 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/*
|
|
5
|
+
* ---------------------------------------------------------------
|
|
6
|
+
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
7
|
+
* ## ##
|
|
8
|
+
* ## AUTHOR: acacode ##
|
|
9
|
+
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
10
|
+
* ---------------------------------------------------------------
|
|
11
|
+
*/
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
+
t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HttpClient = exports.ContentType = void 0;
|
|
37
|
+
const axios_1 = __importDefault(require("axios"));
|
|
38
|
+
var ContentType;
|
|
39
|
+
(function (ContentType) {
|
|
40
|
+
ContentType["Json"] = "application/json";
|
|
41
|
+
ContentType["FormData"] = "multipart/form-data";
|
|
42
|
+
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
|
|
43
|
+
ContentType["Text"] = "text/plain";
|
|
44
|
+
})(ContentType || (exports.ContentType = ContentType = {}));
|
|
45
|
+
class HttpClient {
|
|
46
|
+
constructor(_a = {}) {
|
|
47
|
+
var { securityWorker, secure, format } = _a, axiosConfig = __rest(_a, ["securityWorker", "secure", "format"]);
|
|
48
|
+
this.securityData = null;
|
|
49
|
+
this.setSecurityData = (data) => {
|
|
50
|
+
this.securityData = data;
|
|
51
|
+
};
|
|
52
|
+
this.request = (_b) => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
var { secure, path, type, query, format, body } = _b, params = __rest(_b, ["secure", "path", "type", "query", "format", "body"]);
|
|
54
|
+
const secureParams = ((typeof secure === 'boolean' ? secure : this.secure) &&
|
|
55
|
+
this.securityWorker &&
|
|
56
|
+
(yield this.securityWorker(this.securityData))) ||
|
|
57
|
+
{};
|
|
58
|
+
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
59
|
+
const responseFormat = format || this.format || undefined;
|
|
60
|
+
if (type === ContentType.FormData && body && body !== null && typeof body === 'object') {
|
|
61
|
+
body = this.createFormData(body);
|
|
62
|
+
}
|
|
63
|
+
if (type === ContentType.Text && body && body !== null && typeof body !== 'string') {
|
|
64
|
+
body = JSON.stringify(body);
|
|
65
|
+
}
|
|
66
|
+
return this.instance.request(Object.assign(Object.assign({}, requestParams), { headers: Object.assign(Object.assign({}, (requestParams.headers || {})), (type && type !== ContentType.FormData ? { 'Content-Type': type } : {})), params: query, responseType: responseFormat, data: body, url: path }));
|
|
67
|
+
});
|
|
68
|
+
this.instance = axios_1.default.create(Object.assign(Object.assign({}, axiosConfig), { baseURL: axiosConfig.baseURL || '' }));
|
|
69
|
+
this.secure = secure;
|
|
70
|
+
this.format = format;
|
|
71
|
+
this.securityWorker = securityWorker;
|
|
72
|
+
}
|
|
73
|
+
mergeRequestParams(params1, params2) {
|
|
74
|
+
const method = params1.method || (params2 && params2.method);
|
|
75
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, this.instance.defaults), params1), (params2 || {})), { headers: Object.assign(Object.assign(Object.assign({}, ((method &&
|
|
76
|
+
this.instance.defaults.headers[method.toLowerCase()]) ||
|
|
77
|
+
{})), (params1.headers || {})), ((params2 && params2.headers) || {})) });
|
|
78
|
+
}
|
|
79
|
+
stringifyFormItem(formItem) {
|
|
80
|
+
if (typeof formItem === 'object' && formItem !== null) {
|
|
81
|
+
return JSON.stringify(formItem);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
return `${formItem}`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
createFormData(input) {
|
|
88
|
+
return Object.keys(input || {}).reduce((formData, key) => {
|
|
89
|
+
const property = input[key];
|
|
90
|
+
const propertyContent = property instanceof Array ? property : [property];
|
|
91
|
+
for (const formItem of propertyContent) {
|
|
92
|
+
const isFileType = formItem instanceof Blob || formItem instanceof File;
|
|
93
|
+
formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
|
|
94
|
+
}
|
|
95
|
+
return formData;
|
|
96
|
+
}, new FormData());
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.HttpClient = HttpClient;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import api from './api';
|
|
2
|
+
import { Api } from './generated/Api';
|
|
3
|
+
import { Worker as _Worker, Workflow as _Workflow } from './generated/data-contracts';
|
|
4
|
+
import * as APIContracts from './generated/data-contracts';
|
|
5
|
+
type ApiWorker = _Worker;
|
|
6
|
+
type ApiWorkflow = _Workflow;
|
|
7
|
+
export { ApiWorker, ApiWorkflow, APIContracts, Api };
|
|
8
|
+
export default api;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Api = exports.APIContracts = void 0;
|
|
30
|
+
const api_1 = __importDefault(require("./api"));
|
|
31
|
+
const Api_1 = require("./generated/Api");
|
|
32
|
+
Object.defineProperty(exports, "Api", { enumerable: true, get: function () { return Api_1.Api; } });
|
|
33
|
+
const APIContracts = __importStar(require("./generated/data-contracts"));
|
|
34
|
+
exports.APIContracts = APIContracts;
|
|
35
|
+
exports.default = api_1.default;
|
|
@@ -4,7 +4,7 @@ import { StepActionEvent, StepActionEventType, GroupKeyActionEvent, GroupKeyActi
|
|
|
4
4
|
import HatchetPromise from '../../util/hatchet-promise/hatchet-promise';
|
|
5
5
|
import { Workflow } from '../../workflow';
|
|
6
6
|
import { Logger } from '../../util/logger';
|
|
7
|
-
import { Context } from '../../step';
|
|
7
|
+
import { Context, StepRunFunction } from '../../step';
|
|
8
8
|
export type ActionRegistry = Record<Action['actionId'], Function>;
|
|
9
9
|
export declare class Worker {
|
|
10
10
|
serviceName: string;
|
|
@@ -15,13 +15,14 @@ export declare class Worker {
|
|
|
15
15
|
action_registry: ActionRegistry;
|
|
16
16
|
listener: ActionListener | undefined;
|
|
17
17
|
futures: Record<Action['stepRunId'], HatchetPromise<any>>;
|
|
18
|
-
contexts: Record<Action['stepRunId'], Context<any>>;
|
|
18
|
+
contexts: Record<Action['stepRunId'], Context<any, any>>;
|
|
19
19
|
logger: Logger;
|
|
20
20
|
constructor(client: HatchetClient, options: {
|
|
21
21
|
name: string;
|
|
22
22
|
handleKill?: boolean;
|
|
23
23
|
});
|
|
24
24
|
registerWorkflow(workflow: Workflow): Promise<void>;
|
|
25
|
+
registerAction<T, K>(actionId: string, action: StepRunFunction<T, K>): void;
|
|
25
26
|
handleStartStepRun(action: Action): void;
|
|
26
27
|
handleStartGroupKeyRun(action: Action): void;
|
|
27
28
|
getStepActionEvent(action: Action, eventType: StepActionEventType, payload?: any): StepActionEvent;
|
package/clients/worker/worker.js
CHANGED
|
@@ -73,6 +73,8 @@ class Worker {
|
|
|
73
73
|
timeout: step.timeout || '60s',
|
|
74
74
|
inputs: '{}',
|
|
75
75
|
parents: (_a = step.parents) !== null && _a !== void 0 ? _a : [],
|
|
76
|
+
userData: '{}',
|
|
77
|
+
retries: step.retries || 0,
|
|
76
78
|
});
|
|
77
79
|
}),
|
|
78
80
|
},
|
|
@@ -90,6 +92,9 @@ class Worker {
|
|
|
90
92
|
? Object.assign(Object.assign({}, this.action_registry), { [`${this.serviceName}:${workflow.concurrency.name}`]: workflow.concurrency.key }) : Object.assign({}, this.action_registry);
|
|
91
93
|
});
|
|
92
94
|
}
|
|
95
|
+
registerAction(actionId, action) {
|
|
96
|
+
this.action_registry[actionId] = action;
|
|
97
|
+
}
|
|
93
98
|
handleStartStepRun(action) {
|
|
94
99
|
const { actionId } = action;
|
|
95
100
|
const context = new step_1.Context(action.actionPayload);
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -18,4 +18,6 @@ const hatchet_client_1 = require("./clients/hatchet-client");
|
|
|
18
18
|
__exportStar(require("./workflow"), exports);
|
|
19
19
|
__exportStar(require("./step"), exports);
|
|
20
20
|
__exportStar(require("./clients/worker"), exports);
|
|
21
|
+
__exportStar(require("./clients/rest"), exports);
|
|
22
|
+
__exportStar(require("./clients/admin"), exports);
|
|
21
23
|
exports.default = hatchet_client_1.HatchetClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,14 +33,19 @@
|
|
|
33
33
|
"worker:dag": "npm run exec -- ./examples/dag-worker.ts",
|
|
34
34
|
"worker:concurrency": "npm run exec -- ./examples/concurrency/concurrency-worker.ts",
|
|
35
35
|
"event:concurrency": "npm run exec -- ./examples/concurrency/concurrency-event.ts",
|
|
36
|
+
"worker:retries": "npm run exec -- ./examples/retries-worker.ts",
|
|
37
|
+
"api": "npm run exec -- ./examples/api.ts",
|
|
36
38
|
"prepublish": "cp package.json dist/package.json;",
|
|
37
|
-
"publish:ci": "rm -rf ./dist && npm run tsc:build && npm run prepublish && cd dist && npm publish --access public --no-git-checks"
|
|
39
|
+
"publish:ci": "rm -rf ./dist && npm run tsc:build && npm run prepublish && cd dist && npm publish --access public --no-git-checks",
|
|
40
|
+
"generate-docs": "typedoc"
|
|
38
41
|
},
|
|
39
42
|
"keywords": [],
|
|
40
43
|
"author": "",
|
|
41
44
|
"license": "MIT",
|
|
42
45
|
"devDependencies": {
|
|
46
|
+
"@types/node": "^20.11.16",
|
|
43
47
|
"@types/jest": "^29.5.11",
|
|
48
|
+
"@types/node": "^20.11.16",
|
|
44
49
|
"@typescript-eslint/eslint-plugin": "^6.4.0",
|
|
45
50
|
"autoprefixer": "^10.4.16",
|
|
46
51
|
"dotenv-cli": "^7.3.0",
|
|
@@ -62,13 +67,18 @@
|
|
|
62
67
|
"ts-jest": "^29.1.1",
|
|
63
68
|
"ts-node": "^10.9.2",
|
|
64
69
|
"ts-proto": "^1.167.0",
|
|
70
|
+
"typedoc": "^0.25.7",
|
|
71
|
+
"typedoc-plugin-markdown": "^3.17.1",
|
|
65
72
|
"typescript": "^5.3.3"
|
|
66
73
|
},
|
|
67
74
|
"dependencies": {
|
|
75
|
+
"@types/qs": "^6.9.11",
|
|
76
|
+
"axios": "^1.6.7",
|
|
68
77
|
"long": "^5.2.3",
|
|
69
78
|
"nice-grpc": "^2.1.7",
|
|
70
79
|
"nice-grpc-common": "^2.0.2",
|
|
71
80
|
"protobufjs": "^7.2.6",
|
|
81
|
+
"qs": "^6.11.2",
|
|
72
82
|
"yaml": "^2.3.4",
|
|
73
83
|
"zod": "^3.22.4"
|
|
74
84
|
}
|
|
@@ -152,6 +152,23 @@ export interface WorkflowEvent {
|
|
|
152
152
|
eventTimestamp: Date | undefined;
|
|
153
153
|
/** the event payload */
|
|
154
154
|
eventPayload: string;
|
|
155
|
+
/**
|
|
156
|
+
* whether this is the last event for the workflow run - server
|
|
157
|
+
* will hang up the connection but clients might want to case
|
|
158
|
+
*/
|
|
159
|
+
hangup: boolean;
|
|
160
|
+
}
|
|
161
|
+
export interface OverridesData {
|
|
162
|
+
/** the step run id */
|
|
163
|
+
stepRunId: string;
|
|
164
|
+
/** the path of the data to set */
|
|
165
|
+
path: string;
|
|
166
|
+
/** the value to set */
|
|
167
|
+
value: string;
|
|
168
|
+
/** the filename of the caller */
|
|
169
|
+
callerFilename: string;
|
|
170
|
+
}
|
|
171
|
+
export interface OverridesDataResponse {
|
|
155
172
|
}
|
|
156
173
|
export declare const WorkerRegisterRequest: {
|
|
157
174
|
encode(message: WorkerRegisterRequest, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -241,6 +258,22 @@ export declare const WorkflowEvent: {
|
|
|
241
258
|
create(base?: DeepPartial<WorkflowEvent>): WorkflowEvent;
|
|
242
259
|
fromPartial(object: DeepPartial<WorkflowEvent>): WorkflowEvent;
|
|
243
260
|
};
|
|
261
|
+
export declare const OverridesData: {
|
|
262
|
+
encode(message: OverridesData, writer?: _m0.Writer): _m0.Writer;
|
|
263
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OverridesData;
|
|
264
|
+
fromJSON(object: any): OverridesData;
|
|
265
|
+
toJSON(message: OverridesData): unknown;
|
|
266
|
+
create(base?: DeepPartial<OverridesData>): OverridesData;
|
|
267
|
+
fromPartial(object: DeepPartial<OverridesData>): OverridesData;
|
|
268
|
+
};
|
|
269
|
+
export declare const OverridesDataResponse: {
|
|
270
|
+
encode(_: OverridesDataResponse, writer?: _m0.Writer): _m0.Writer;
|
|
271
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OverridesDataResponse;
|
|
272
|
+
fromJSON(_: any): OverridesDataResponse;
|
|
273
|
+
toJSON(_: OverridesDataResponse): unknown;
|
|
274
|
+
create(base?: DeepPartial<OverridesDataResponse>): OverridesDataResponse;
|
|
275
|
+
fromPartial(_: DeepPartial<OverridesDataResponse>): OverridesDataResponse;
|
|
276
|
+
};
|
|
244
277
|
export type DispatcherDefinition = typeof DispatcherDefinition;
|
|
245
278
|
export declare const DispatcherDefinition: {
|
|
246
279
|
readonly name: "Dispatcher";
|
|
@@ -356,6 +389,28 @@ export declare const DispatcherDefinition: {
|
|
|
356
389
|
readonly responseStream: false;
|
|
357
390
|
readonly options: {};
|
|
358
391
|
};
|
|
392
|
+
readonly putOverridesData: {
|
|
393
|
+
readonly name: "PutOverridesData";
|
|
394
|
+
readonly requestType: {
|
|
395
|
+
encode(message: OverridesData, writer?: _m0.Writer): _m0.Writer;
|
|
396
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OverridesData;
|
|
397
|
+
fromJSON(object: any): OverridesData;
|
|
398
|
+
toJSON(message: OverridesData): unknown;
|
|
399
|
+
create(base?: DeepPartial<OverridesData>): OverridesData;
|
|
400
|
+
fromPartial(object: DeepPartial<OverridesData>): OverridesData;
|
|
401
|
+
};
|
|
402
|
+
readonly requestStream: false;
|
|
403
|
+
readonly responseType: {
|
|
404
|
+
encode(_: OverridesDataResponse, writer?: _m0.Writer): _m0.Writer;
|
|
405
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OverridesDataResponse;
|
|
406
|
+
fromJSON(_: any): OverridesDataResponse;
|
|
407
|
+
toJSON(_: OverridesDataResponse): unknown;
|
|
408
|
+
create(base?: DeepPartial<OverridesDataResponse>): OverridesDataResponse;
|
|
409
|
+
fromPartial(_: DeepPartial<OverridesDataResponse>): OverridesDataResponse;
|
|
410
|
+
};
|
|
411
|
+
readonly responseStream: false;
|
|
412
|
+
readonly options: {};
|
|
413
|
+
};
|
|
359
414
|
readonly unsubscribe: {
|
|
360
415
|
readonly name: "Unsubscribe";
|
|
361
416
|
readonly requestType: {
|
|
@@ -386,6 +441,7 @@ export interface DispatcherServiceImplementation<CallContextExt = {}> {
|
|
|
386
441
|
subscribeToWorkflowEvents(request: SubscribeToWorkflowEventsRequest, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<WorkflowEvent>>;
|
|
387
442
|
sendStepActionEvent(request: StepActionEvent, context: CallContext & CallContextExt): Promise<DeepPartial<ActionEventResponse>>;
|
|
388
443
|
sendGroupKeyActionEvent(request: GroupKeyActionEvent, context: CallContext & CallContextExt): Promise<DeepPartial<ActionEventResponse>>;
|
|
444
|
+
putOverridesData(request: OverridesData, context: CallContext & CallContextExt): Promise<DeepPartial<OverridesDataResponse>>;
|
|
389
445
|
unsubscribe(request: WorkerUnsubscribeRequest, context: CallContext & CallContextExt): Promise<DeepPartial<WorkerUnsubscribeResponse>>;
|
|
390
446
|
}
|
|
391
447
|
export interface DispatcherClient<CallOptionsExt = {}> {
|
|
@@ -394,6 +450,7 @@ export interface DispatcherClient<CallOptionsExt = {}> {
|
|
|
394
450
|
subscribeToWorkflowEvents(request: DeepPartial<SubscribeToWorkflowEventsRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<WorkflowEvent>;
|
|
395
451
|
sendStepActionEvent(request: DeepPartial<StepActionEvent>, options?: CallOptions & CallOptionsExt): Promise<ActionEventResponse>;
|
|
396
452
|
sendGroupKeyActionEvent(request: DeepPartial<GroupKeyActionEvent>, options?: CallOptions & CallOptionsExt): Promise<ActionEventResponse>;
|
|
453
|
+
putOverridesData(request: DeepPartial<OverridesData>, options?: CallOptions & CallOptionsExt): Promise<OverridesDataResponse>;
|
|
397
454
|
unsubscribe(request: DeepPartial<WorkerUnsubscribeRequest>, options?: CallOptions & CallOptionsExt): Promise<WorkerUnsubscribeResponse>;
|
|
398
455
|
}
|
|
399
456
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.DispatcherDefinition = exports.WorkflowEvent = exports.SubscribeToWorkflowEventsRequest = exports.ActionEventResponse = exports.StepActionEvent = exports.GroupKeyActionEvent = exports.WorkerUnsubscribeResponse = exports.WorkerUnsubscribeRequest = exports.WorkerListenRequest = exports.AssignedAction = exports.WorkerRegisterResponse = exports.WorkerRegisterRequest = exports.resourceEventTypeToJSON = exports.resourceEventTypeFromJSON = exports.ResourceEventType = exports.resourceTypeToJSON = exports.resourceTypeFromJSON = exports.ResourceType = exports.stepActionEventTypeToJSON = exports.stepActionEventTypeFromJSON = exports.StepActionEventType = exports.groupKeyActionEventTypeToJSON = exports.groupKeyActionEventTypeFromJSON = exports.GroupKeyActionEventType = exports.actionTypeToJSON = exports.actionTypeFromJSON = exports.ActionType = exports.protobufPackage = void 0;
|
|
26
|
+
exports.DispatcherDefinition = exports.OverridesDataResponse = exports.OverridesData = exports.WorkflowEvent = exports.SubscribeToWorkflowEventsRequest = exports.ActionEventResponse = exports.StepActionEvent = exports.GroupKeyActionEvent = exports.WorkerUnsubscribeResponse = exports.WorkerUnsubscribeRequest = exports.WorkerListenRequest = exports.AssignedAction = exports.WorkerRegisterResponse = exports.WorkerRegisterRequest = exports.resourceEventTypeToJSON = exports.resourceEventTypeFromJSON = exports.ResourceEventType = exports.resourceTypeToJSON = exports.resourceTypeFromJSON = exports.ResourceType = exports.stepActionEventTypeToJSON = exports.stepActionEventTypeFromJSON = exports.StepActionEventType = exports.groupKeyActionEventTypeToJSON = exports.groupKeyActionEventTypeFromJSON = exports.GroupKeyActionEventType = exports.actionTypeToJSON = exports.actionTypeFromJSON = exports.ActionType = exports.protobufPackage = void 0;
|
|
27
27
|
const _m0 = __importStar(require("protobufjs/minimal"));
|
|
28
28
|
const timestamp_1 = require("../google/protobuf/timestamp");
|
|
29
29
|
exports.protobufPackage = "";
|
|
@@ -1235,6 +1235,7 @@ function createBaseWorkflowEvent() {
|
|
|
1235
1235
|
resourceId: "",
|
|
1236
1236
|
eventTimestamp: undefined,
|
|
1237
1237
|
eventPayload: "",
|
|
1238
|
+
hangup: false,
|
|
1238
1239
|
};
|
|
1239
1240
|
}
|
|
1240
1241
|
exports.WorkflowEvent = {
|
|
@@ -1257,6 +1258,9 @@ exports.WorkflowEvent = {
|
|
|
1257
1258
|
if (message.eventPayload !== "") {
|
|
1258
1259
|
writer.uint32(50).string(message.eventPayload);
|
|
1259
1260
|
}
|
|
1261
|
+
if (message.hangup === true) {
|
|
1262
|
+
writer.uint32(56).bool(message.hangup);
|
|
1263
|
+
}
|
|
1260
1264
|
return writer;
|
|
1261
1265
|
},
|
|
1262
1266
|
decode(input, length) {
|
|
@@ -1302,6 +1306,12 @@ exports.WorkflowEvent = {
|
|
|
1302
1306
|
}
|
|
1303
1307
|
message.eventPayload = reader.string();
|
|
1304
1308
|
continue;
|
|
1309
|
+
case 7:
|
|
1310
|
+
if (tag !== 56) {
|
|
1311
|
+
break;
|
|
1312
|
+
}
|
|
1313
|
+
message.hangup = reader.bool();
|
|
1314
|
+
continue;
|
|
1305
1315
|
}
|
|
1306
1316
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1307
1317
|
break;
|
|
@@ -1318,6 +1328,7 @@ exports.WorkflowEvent = {
|
|
|
1318
1328
|
resourceId: isSet(object.resourceId) ? globalThis.String(object.resourceId) : "",
|
|
1319
1329
|
eventTimestamp: isSet(object.eventTimestamp) ? fromJsonTimestamp(object.eventTimestamp) : undefined,
|
|
1320
1330
|
eventPayload: isSet(object.eventPayload) ? globalThis.String(object.eventPayload) : "",
|
|
1331
|
+
hangup: isSet(object.hangup) ? globalThis.Boolean(object.hangup) : false,
|
|
1321
1332
|
};
|
|
1322
1333
|
},
|
|
1323
1334
|
toJSON(message) {
|
|
@@ -1340,13 +1351,16 @@ exports.WorkflowEvent = {
|
|
|
1340
1351
|
if (message.eventPayload !== "") {
|
|
1341
1352
|
obj.eventPayload = message.eventPayload;
|
|
1342
1353
|
}
|
|
1354
|
+
if (message.hangup === true) {
|
|
1355
|
+
obj.hangup = message.hangup;
|
|
1356
|
+
}
|
|
1343
1357
|
return obj;
|
|
1344
1358
|
},
|
|
1345
1359
|
create(base) {
|
|
1346
1360
|
return exports.WorkflowEvent.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1347
1361
|
},
|
|
1348
1362
|
fromPartial(object) {
|
|
1349
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1363
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1350
1364
|
const message = createBaseWorkflowEvent();
|
|
1351
1365
|
message.workflowRunId = (_a = object.workflowRunId) !== null && _a !== void 0 ? _a : "";
|
|
1352
1366
|
message.resourceType = (_b = object.resourceType) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -1354,6 +1368,139 @@ exports.WorkflowEvent = {
|
|
|
1354
1368
|
message.resourceId = (_d = object.resourceId) !== null && _d !== void 0 ? _d : "";
|
|
1355
1369
|
message.eventTimestamp = (_e = object.eventTimestamp) !== null && _e !== void 0 ? _e : undefined;
|
|
1356
1370
|
message.eventPayload = (_f = object.eventPayload) !== null && _f !== void 0 ? _f : "";
|
|
1371
|
+
message.hangup = (_g = object.hangup) !== null && _g !== void 0 ? _g : false;
|
|
1372
|
+
return message;
|
|
1373
|
+
},
|
|
1374
|
+
};
|
|
1375
|
+
function createBaseOverridesData() {
|
|
1376
|
+
return { stepRunId: "", path: "", value: "", callerFilename: "" };
|
|
1377
|
+
}
|
|
1378
|
+
exports.OverridesData = {
|
|
1379
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1380
|
+
if (message.stepRunId !== "") {
|
|
1381
|
+
writer.uint32(10).string(message.stepRunId);
|
|
1382
|
+
}
|
|
1383
|
+
if (message.path !== "") {
|
|
1384
|
+
writer.uint32(18).string(message.path);
|
|
1385
|
+
}
|
|
1386
|
+
if (message.value !== "") {
|
|
1387
|
+
writer.uint32(26).string(message.value);
|
|
1388
|
+
}
|
|
1389
|
+
if (message.callerFilename !== "") {
|
|
1390
|
+
writer.uint32(34).string(message.callerFilename);
|
|
1391
|
+
}
|
|
1392
|
+
return writer;
|
|
1393
|
+
},
|
|
1394
|
+
decode(input, length) {
|
|
1395
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1396
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1397
|
+
const message = createBaseOverridesData();
|
|
1398
|
+
while (reader.pos < end) {
|
|
1399
|
+
const tag = reader.uint32();
|
|
1400
|
+
switch (tag >>> 3) {
|
|
1401
|
+
case 1:
|
|
1402
|
+
if (tag !== 10) {
|
|
1403
|
+
break;
|
|
1404
|
+
}
|
|
1405
|
+
message.stepRunId = reader.string();
|
|
1406
|
+
continue;
|
|
1407
|
+
case 2:
|
|
1408
|
+
if (tag !== 18) {
|
|
1409
|
+
break;
|
|
1410
|
+
}
|
|
1411
|
+
message.path = reader.string();
|
|
1412
|
+
continue;
|
|
1413
|
+
case 3:
|
|
1414
|
+
if (tag !== 26) {
|
|
1415
|
+
break;
|
|
1416
|
+
}
|
|
1417
|
+
message.value = reader.string();
|
|
1418
|
+
continue;
|
|
1419
|
+
case 4:
|
|
1420
|
+
if (tag !== 34) {
|
|
1421
|
+
break;
|
|
1422
|
+
}
|
|
1423
|
+
message.callerFilename = reader.string();
|
|
1424
|
+
continue;
|
|
1425
|
+
}
|
|
1426
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1427
|
+
break;
|
|
1428
|
+
}
|
|
1429
|
+
reader.skipType(tag & 7);
|
|
1430
|
+
}
|
|
1431
|
+
return message;
|
|
1432
|
+
},
|
|
1433
|
+
fromJSON(object) {
|
|
1434
|
+
return {
|
|
1435
|
+
stepRunId: isSet(object.stepRunId) ? globalThis.String(object.stepRunId) : "",
|
|
1436
|
+
path: isSet(object.path) ? globalThis.String(object.path) : "",
|
|
1437
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
1438
|
+
callerFilename: isSet(object.callerFilename) ? globalThis.String(object.callerFilename) : "",
|
|
1439
|
+
};
|
|
1440
|
+
},
|
|
1441
|
+
toJSON(message) {
|
|
1442
|
+
const obj = {};
|
|
1443
|
+
if (message.stepRunId !== "") {
|
|
1444
|
+
obj.stepRunId = message.stepRunId;
|
|
1445
|
+
}
|
|
1446
|
+
if (message.path !== "") {
|
|
1447
|
+
obj.path = message.path;
|
|
1448
|
+
}
|
|
1449
|
+
if (message.value !== "") {
|
|
1450
|
+
obj.value = message.value;
|
|
1451
|
+
}
|
|
1452
|
+
if (message.callerFilename !== "") {
|
|
1453
|
+
obj.callerFilename = message.callerFilename;
|
|
1454
|
+
}
|
|
1455
|
+
return obj;
|
|
1456
|
+
},
|
|
1457
|
+
create(base) {
|
|
1458
|
+
return exports.OverridesData.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1459
|
+
},
|
|
1460
|
+
fromPartial(object) {
|
|
1461
|
+
var _a, _b, _c, _d;
|
|
1462
|
+
const message = createBaseOverridesData();
|
|
1463
|
+
message.stepRunId = (_a = object.stepRunId) !== null && _a !== void 0 ? _a : "";
|
|
1464
|
+
message.path = (_b = object.path) !== null && _b !== void 0 ? _b : "";
|
|
1465
|
+
message.value = (_c = object.value) !== null && _c !== void 0 ? _c : "";
|
|
1466
|
+
message.callerFilename = (_d = object.callerFilename) !== null && _d !== void 0 ? _d : "";
|
|
1467
|
+
return message;
|
|
1468
|
+
},
|
|
1469
|
+
};
|
|
1470
|
+
function createBaseOverridesDataResponse() {
|
|
1471
|
+
return {};
|
|
1472
|
+
}
|
|
1473
|
+
exports.OverridesDataResponse = {
|
|
1474
|
+
encode(_, writer = _m0.Writer.create()) {
|
|
1475
|
+
return writer;
|
|
1476
|
+
},
|
|
1477
|
+
decode(input, length) {
|
|
1478
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1479
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1480
|
+
const message = createBaseOverridesDataResponse();
|
|
1481
|
+
while (reader.pos < end) {
|
|
1482
|
+
const tag = reader.uint32();
|
|
1483
|
+
switch (tag >>> 3) {
|
|
1484
|
+
}
|
|
1485
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1486
|
+
break;
|
|
1487
|
+
}
|
|
1488
|
+
reader.skipType(tag & 7);
|
|
1489
|
+
}
|
|
1490
|
+
return message;
|
|
1491
|
+
},
|
|
1492
|
+
fromJSON(_) {
|
|
1493
|
+
return {};
|
|
1494
|
+
},
|
|
1495
|
+
toJSON(_) {
|
|
1496
|
+
const obj = {};
|
|
1497
|
+
return obj;
|
|
1498
|
+
},
|
|
1499
|
+
create(base) {
|
|
1500
|
+
return exports.OverridesDataResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1501
|
+
},
|
|
1502
|
+
fromPartial(_) {
|
|
1503
|
+
const message = createBaseOverridesDataResponse();
|
|
1357
1504
|
return message;
|
|
1358
1505
|
},
|
|
1359
1506
|
};
|
|
@@ -1401,6 +1548,14 @@ exports.DispatcherDefinition = {
|
|
|
1401
1548
|
responseStream: false,
|
|
1402
1549
|
options: {},
|
|
1403
1550
|
},
|
|
1551
|
+
putOverridesData: {
|
|
1552
|
+
name: "PutOverridesData",
|
|
1553
|
+
requestType: exports.OverridesData,
|
|
1554
|
+
requestStream: false,
|
|
1555
|
+
responseType: exports.OverridesDataResponse,
|
|
1556
|
+
responseStream: false,
|
|
1557
|
+
options: {},
|
|
1558
|
+
},
|
|
1404
1559
|
unsubscribe: {
|
|
1405
1560
|
name: "Unsubscribe",
|
|
1406
1561
|
requestType: exports.WorkerUnsubscribeRequest,
|
|
@@ -62,6 +62,10 @@ export interface CreateWorkflowStepOpts {
|
|
|
62
62
|
inputs: string;
|
|
63
63
|
/** (optional) the step parents. if none are passed in, this is a root step */
|
|
64
64
|
parents: string[];
|
|
65
|
+
/** (optional) the custom step user data, assuming string representation of JSON */
|
|
66
|
+
userData: string;
|
|
67
|
+
/** (optional) the number of retries for the step, default 0 */
|
|
68
|
+
retries: number;
|
|
65
69
|
}
|
|
66
70
|
/** ListWorkflowsRequest is the request for ListWorkflows. */
|
|
67
71
|
export interface ListWorkflowsRequest {
|
|
@@ -470,7 +470,7 @@ exports.CreateWorkflowJobOpts = {
|
|
|
470
470
|
},
|
|
471
471
|
};
|
|
472
472
|
function createBaseCreateWorkflowStepOpts() {
|
|
473
|
-
return { readableId: "", action: "", timeout: "", inputs: "", parents: [] };
|
|
473
|
+
return { readableId: "", action: "", timeout: "", inputs: "", parents: [], userData: "", retries: 0 };
|
|
474
474
|
}
|
|
475
475
|
exports.CreateWorkflowStepOpts = {
|
|
476
476
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -489,6 +489,12 @@ exports.CreateWorkflowStepOpts = {
|
|
|
489
489
|
for (const v of message.parents) {
|
|
490
490
|
writer.uint32(42).string(v);
|
|
491
491
|
}
|
|
492
|
+
if (message.userData !== "") {
|
|
493
|
+
writer.uint32(50).string(message.userData);
|
|
494
|
+
}
|
|
495
|
+
if (message.retries !== 0) {
|
|
496
|
+
writer.uint32(56).int32(message.retries);
|
|
497
|
+
}
|
|
492
498
|
return writer;
|
|
493
499
|
},
|
|
494
500
|
decode(input, length) {
|
|
@@ -528,6 +534,18 @@ exports.CreateWorkflowStepOpts = {
|
|
|
528
534
|
}
|
|
529
535
|
message.parents.push(reader.string());
|
|
530
536
|
continue;
|
|
537
|
+
case 6:
|
|
538
|
+
if (tag !== 50) {
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
message.userData = reader.string();
|
|
542
|
+
continue;
|
|
543
|
+
case 7:
|
|
544
|
+
if (tag !== 56) {
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
message.retries = reader.int32();
|
|
548
|
+
continue;
|
|
531
549
|
}
|
|
532
550
|
if ((tag & 7) === 4 || tag === 0) {
|
|
533
551
|
break;
|
|
@@ -543,6 +561,8 @@ exports.CreateWorkflowStepOpts = {
|
|
|
543
561
|
timeout: isSet(object.timeout) ? globalThis.String(object.timeout) : "",
|
|
544
562
|
inputs: isSet(object.inputs) ? globalThis.String(object.inputs) : "",
|
|
545
563
|
parents: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.parents) ? object.parents.map((e) => globalThis.String(e)) : [],
|
|
564
|
+
userData: isSet(object.userData) ? globalThis.String(object.userData) : "",
|
|
565
|
+
retries: isSet(object.retries) ? globalThis.Number(object.retries) : 0,
|
|
546
566
|
};
|
|
547
567
|
},
|
|
548
568
|
toJSON(message) {
|
|
@@ -563,19 +583,27 @@ exports.CreateWorkflowStepOpts = {
|
|
|
563
583
|
if ((_a = message.parents) === null || _a === void 0 ? void 0 : _a.length) {
|
|
564
584
|
obj.parents = message.parents;
|
|
565
585
|
}
|
|
586
|
+
if (message.userData !== "") {
|
|
587
|
+
obj.userData = message.userData;
|
|
588
|
+
}
|
|
589
|
+
if (message.retries !== 0) {
|
|
590
|
+
obj.retries = Math.round(message.retries);
|
|
591
|
+
}
|
|
566
592
|
return obj;
|
|
567
593
|
},
|
|
568
594
|
create(base) {
|
|
569
595
|
return exports.CreateWorkflowStepOpts.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
570
596
|
},
|
|
571
597
|
fromPartial(object) {
|
|
572
|
-
var _a, _b, _c, _d, _e;
|
|
598
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
573
599
|
const message = createBaseCreateWorkflowStepOpts();
|
|
574
600
|
message.readableId = (_a = object.readableId) !== null && _a !== void 0 ? _a : "";
|
|
575
601
|
message.action = (_b = object.action) !== null && _b !== void 0 ? _b : "";
|
|
576
602
|
message.timeout = (_c = object.timeout) !== null && _c !== void 0 ? _c : "";
|
|
577
603
|
message.inputs = (_d = object.inputs) !== null && _d !== void 0 ? _d : "";
|
|
578
604
|
message.parents = ((_e = object.parents) === null || _e === void 0 ? void 0 : _e.map((e) => e)) || [];
|
|
605
|
+
message.userData = (_f = object.userData) !== null && _f !== void 0 ? _f : "";
|
|
606
|
+
message.retries = (_g = object.retries) !== null && _g !== void 0 ? _g : 0;
|
|
579
607
|
return message;
|
|
580
608
|
},
|
|
581
609
|
};
|