@hatchet-dev/typescript-sdk 1.5.0 → 1.5.2
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/examples/affinity-workers.js +4 -4
- package/examples/byo-logger.js +2 -2
- package/examples/crons/cron-worker.js +2 -2
- package/examples/logger.js +2 -2
- package/examples/on-failure.js +4 -4
- package/examples/retries-with-backoff.js +2 -2
- package/examples/sticky-worker.js +4 -4
- package/package.json +1 -1
- package/step.js +2 -2
- package/util/workflow-run-ref.d.ts +2 -2
- package/util/workflow-run-ref.js +6 -7
- package/v1/client/admin.d.ts +2 -0
- package/v1/client/admin.js +6 -2
- package/v1/client/worker/context.js +5 -4
- package/v1/declaration.d.ts +2 -0
- package/v1/declaration.js +40 -46
- package/v1/examples/cancellations/run.js +1 -1
- package/v1/examples/cancellations/worker.js +1 -1
- package/v1/examples/cancellations/workflow.js +2 -2
- package/v1/examples/child_workflows/workflow.js +1 -1
- package/v1/examples/concurrency-rr/workflow.js +2 -2
- package/v1/examples/dag/interface-workflow.js +1 -1
- package/v1/examples/dag/workflow.js +1 -1
- package/v1/examples/dag_match_condition/complex-workflow.js +7 -7
- package/v1/examples/durable-event/workflow.js +2 -2
- package/v1/examples/durable-sleep/workflow.js +1 -1
- package/v1/examples/hatchet-client.d.ts +1 -1
- package/v1/examples/hatchet-client.js +2 -2
- package/v1/examples/landing_page/durable-excution.js +2 -2
- package/v1/examples/landing_page/event-signaling.js +1 -1
- package/v1/examples/landing_page/flow-control.js +1 -1
- package/v1/examples/landing_page/queues.js +2 -2
- package/v1/examples/landing_page/scheduling.js +1 -1
- package/v1/examples/landing_page/task-routing.js +1 -1
- package/v1/examples/migration-guides/mergent.js +5 -5
- package/v1/examples/multiple_wf_concurrency/workflow.js +1 -1
- package/v1/examples/non_retryable/workflow.js +1 -1
- package/v1/examples/on_cron/workflow.js +1 -1
- package/v1/examples/on_event/event.js +1 -1
- package/v1/examples/on_event/workflow.js +1 -1
- package/v1/examples/on_failure/workflow.js +1 -1
- package/v1/examples/on_success/workflow.js +1 -1
- package/v1/examples/priority/run.js +2 -2
- package/v1/examples/priority/workflow.js +2 -2
- package/v1/examples/quickstart/hatchet-client.d.ts +2 -0
- package/v1/examples/quickstart/hatchet-client.js +9 -0
- package/v1/examples/{on_event copy/event.js → quickstart/run.js} +7 -8
- package/v1/examples/{on_event copy/worker.js → quickstart/worker.js} +4 -3
- package/v1/examples/quickstart/workflows/first-task.d.ts +8 -0
- package/v1/examples/quickstart/workflows/first-task.js +12 -0
- package/v1/examples/rate_limit/workflow.js +3 -3
- package/v1/examples/retries/workflow.js +4 -4
- package/v1/examples/simple/bulk.js +2 -2
- package/v1/examples/simple/client-run.js +1 -1
- package/v1/examples/simple/cron.js +3 -3
- package/v1/examples/simple/enqueue.js +2 -2
- package/v1/examples/simple/run.js +7 -3
- package/v1/examples/simple/schedule.js +9 -1
- package/v1/examples/simple/stub-workflow.js +1 -1
- package/v1/examples/simple/worker.js +1 -1
- package/v1/examples/simple/workflow-with-child.d.ts +5 -1
- package/v1/examples/simple/workflow-with-child.js +18 -5
- package/v1/examples/simple/workflow.js +13 -3
- package/v1/examples/sticky/workflow.js +1 -1
- package/v1/examples/timeouts/run.js +1 -1
- package/v1/examples/timeouts/worker.js +1 -1
- package/v1/examples/timeouts/workflow.js +1 -1
- package/v1/examples/with_timeouts/workflow.js +3 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/v1/examples/on_event copy/workflow.d.ts +0 -16
- package/v1/examples/on_event copy/workflow.js +0 -35
- /package/v1/examples/{on_event copy/event.d.ts → quickstart/run.d.ts} +0 -0
- /package/v1/examples/{on_event copy → quickstart}/worker.d.ts +0 -0
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.cancellation = void 0;
|
|
16
|
-
//
|
|
16
|
+
// > Declaring a Task
|
|
17
17
|
const sleep_1 = __importDefault(require("../../../util/sleep"));
|
|
18
18
|
const hatchet_client_1 = require("../hatchet-client");
|
|
19
19
|
// (optional) Define the input type for the workflow
|
|
@@ -13,10 +13,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.refreshTimeout = exports.withTimeouts = void 0;
|
|
16
|
-
//
|
|
16
|
+
// > Declaring a Task
|
|
17
17
|
const sleep_1 = __importDefault(require("../../../util/sleep"));
|
|
18
18
|
const hatchet_client_1 = require("../hatchet-client");
|
|
19
|
-
//
|
|
19
|
+
// > Execution Timeout
|
|
20
20
|
exports.withTimeouts = hatchet_client_1.hatchet.task({
|
|
21
21
|
name: 'with-timeouts',
|
|
22
22
|
// time the task can wait in the queue before it is cancelled
|
|
@@ -38,7 +38,7 @@ exports.withTimeouts = hatchet_client_1.hatchet.task({
|
|
|
38
38
|
}),
|
|
39
39
|
});
|
|
40
40
|
// !!
|
|
41
|
-
//
|
|
41
|
+
// > Refresh Timeout
|
|
42
42
|
exports.refreshTimeout = hatchet_client_1.hatchet.task({
|
|
43
43
|
name: 'refresh-timeout',
|
|
44
44
|
executionTimeout: '10s',
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.5.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.5.2";
|
package/version.js
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type Input = {
|
|
2
|
-
Message: string;
|
|
3
|
-
};
|
|
4
|
-
type LowerOutput = {
|
|
5
|
-
lower: {
|
|
6
|
-
TransformedMessage: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export declare const lower: import("../..").WorkflowDeclaration<Input, LowerOutput>;
|
|
10
|
-
type UpperOutput = {
|
|
11
|
-
upper: {
|
|
12
|
-
TransformedMessage: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare const upper: import("../..").WorkflowDeclaration<Input, UpperOutput>;
|
|
16
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upper = exports.lower = void 0;
|
|
4
|
-
const hatchet_client_1 = require("../hatchet-client");
|
|
5
|
-
// ❓ Run workflow on event
|
|
6
|
-
exports.lower = hatchet_client_1.hatchet.workflow({
|
|
7
|
-
name: 'lower',
|
|
8
|
-
on: {
|
|
9
|
-
// 👀 Declare the event that will trigger the workflow
|
|
10
|
-
event: 'simple-event:create',
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
// !!
|
|
14
|
-
exports.lower.task({
|
|
15
|
-
name: 'lower',
|
|
16
|
-
fn: (input) => {
|
|
17
|
-
return {
|
|
18
|
-
TransformedMessage: input.Message.toLowerCase(),
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
exports.upper = hatchet_client_1.hatchet.workflow({
|
|
23
|
-
name: 'upper',
|
|
24
|
-
on: {
|
|
25
|
-
event: 'simple-event:create',
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
exports.upper.task({
|
|
29
|
-
name: 'upper',
|
|
30
|
-
fn: (input) => {
|
|
31
|
-
return {
|
|
32
|
-
TransformedMessage: input.Message.toUpperCase(),
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
});
|
|
File without changes
|
|
File without changes
|