@hatchet-dev/typescript-sdk 1.1.3 → 1.1.6
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.
|
@@ -321,7 +321,7 @@ export interface TenantQueueMetrics {
|
|
|
321
321
|
queues?: Record<string, number>;
|
|
322
322
|
}
|
|
323
323
|
export interface TenantStepRunQueueMetrics {
|
|
324
|
-
queues?:
|
|
324
|
+
queues?: object;
|
|
325
325
|
}
|
|
326
326
|
export interface AcceptInviteRequest {
|
|
327
327
|
/**
|
|
@@ -1271,6 +1271,8 @@ export interface V1WorkflowRunDisplayNameList {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
export interface V1TaskSummary {
|
|
1273
1273
|
metadata: APIResourceMeta;
|
|
1274
|
+
/** The action ID of the task. */
|
|
1275
|
+
actionId: string;
|
|
1274
1276
|
/** Additional metadata for the task run. */
|
|
1275
1277
|
additionalMetadata?: object;
|
|
1276
1278
|
/** The list of children tasks */
|
|
@@ -1454,6 +1456,12 @@ export interface V1WorkflowRun {
|
|
|
1454
1456
|
* @format date-time
|
|
1455
1457
|
*/
|
|
1456
1458
|
createdAt?: string;
|
|
1459
|
+
/**
|
|
1460
|
+
* @format uuid
|
|
1461
|
+
* @minLength 36
|
|
1462
|
+
* @maxLength 36
|
|
1463
|
+
*/
|
|
1464
|
+
parentTaskExternalId?: string;
|
|
1457
1465
|
}
|
|
1458
1466
|
export interface V1WorkflowRunDetails {
|
|
1459
1467
|
run: V1WorkflowRun;
|
package/package.json
CHANGED
|
@@ -54,8 +54,7 @@ export declare class RunsClient {
|
|
|
54
54
|
tenantId: string;
|
|
55
55
|
workflows: WorkflowsClient;
|
|
56
56
|
constructor(client: HatchetClient);
|
|
57
|
-
get<T = any>(run: string | WorkflowRunRef<T>): Promise<import("../../../clients/rest/generated/data-contracts").
|
|
58
|
-
getDetails<T = any>(run: string | WorkflowRunRef<T>): Promise<import("../../../clients/rest/generated/data-contracts").WorkflowRunShape>;
|
|
57
|
+
get<T = any>(run: string | WorkflowRunRef<T>): Promise<import("../../../clients/rest/generated/data-contracts").V1WorkflowRunDetails>;
|
|
59
58
|
list(opts?: Partial<ListRunsOpts>): Promise<import("../../../clients/rest/generated/data-contracts").V1TaskSummaryList>;
|
|
60
59
|
cancel(opts: CancelRunOpts): Promise<import("axios").AxiosResponse<void, any>>;
|
|
61
60
|
replay(opts: ReplayRunOpts): Promise<import("axios").AxiosResponse<void, any>>;
|
|
@@ -22,14 +22,7 @@ class RunsClient {
|
|
|
22
22
|
get(run) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
const runId = typeof run === 'string' ? run : yield run.getWorkflowRunId();
|
|
25
|
-
const { data } = yield this.api.
|
|
26
|
-
return data;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
getDetails(run) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const runId = typeof run === 'string' ? run : yield run.getWorkflowRunId();
|
|
32
|
-
const { data } = yield this.api.workflowRunGetShape(this.tenantId, runId);
|
|
25
|
+
const { data } = yield this.api.v1WorkflowRunGet(runId);
|
|
33
26
|
return data;
|
|
34
27
|
});
|
|
35
28
|
}
|
|
@@ -44,7 +37,7 @@ class RunsClient {
|
|
|
44
37
|
const filter = yield this.prepareFilter(opts.filters || {});
|
|
45
38
|
return this.api.v1TaskCancel(this.tenantId, {
|
|
46
39
|
externalIds: opts.ids,
|
|
47
|
-
filter,
|
|
40
|
+
filter: !opts.ids ? filter : undefined,
|
|
48
41
|
});
|
|
49
42
|
});
|
|
50
43
|
}
|
|
@@ -53,7 +46,7 @@ class RunsClient {
|
|
|
53
46
|
const filter = yield this.prepareFilter(opts.filters || {});
|
|
54
47
|
return this.api.v1TaskReplay(this.tenantId, {
|
|
55
48
|
externalIds: opts.ids,
|
|
56
|
-
filter,
|
|
49
|
+
filter: !opts.ids ? filter : undefined,
|
|
57
50
|
});
|
|
58
51
|
});
|
|
59
52
|
}
|
|
@@ -21,15 +21,18 @@ const hatchet_client_1 = require("../hatchet-client");
|
|
|
21
21
|
function main() {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
const run = workflow_1.cancellation.runNoWait({});
|
|
24
|
+
const run1 = workflow_1.cancellation.runNoWait({});
|
|
24
25
|
yield (0, sleep_1.default)(1000);
|
|
25
26
|
yield run.cancel();
|
|
26
27
|
const res = yield run.output;
|
|
27
|
-
|
|
28
|
+
const res1 = yield run1.output;
|
|
29
|
+
console.log('canceled', res);
|
|
30
|
+
console.log('completed', res1);
|
|
28
31
|
yield (0, sleep_1.default)(1000);
|
|
29
32
|
yield run.replay();
|
|
30
33
|
const resReplay = yield run.output;
|
|
31
34
|
console.log(resReplay);
|
|
32
|
-
const run2 = workflow_1.cancellation.runNoWait({}, { additionalMetadata: { test: '
|
|
35
|
+
const run2 = workflow_1.cancellation.runNoWait({}, { additionalMetadata: { test: 'abc' } });
|
|
33
36
|
const run4 = workflow_1.cancellation.runNoWait({}, { additionalMetadata: { test: 'test' } });
|
|
34
37
|
yield (0, sleep_1.default)(1000);
|
|
35
38
|
yield hatchet_client_1.hatchet.runs.cancel({
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.1.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.1.6";
|
package/version.js
CHANGED