@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.
Files changed (74) hide show
  1. package/examples/affinity-workers.js +4 -4
  2. package/examples/byo-logger.js +2 -2
  3. package/examples/crons/cron-worker.js +2 -2
  4. package/examples/logger.js +2 -2
  5. package/examples/on-failure.js +4 -4
  6. package/examples/retries-with-backoff.js +2 -2
  7. package/examples/sticky-worker.js +4 -4
  8. package/package.json +1 -1
  9. package/step.js +2 -2
  10. package/util/workflow-run-ref.d.ts +2 -2
  11. package/util/workflow-run-ref.js +6 -7
  12. package/v1/client/admin.d.ts +2 -0
  13. package/v1/client/admin.js +6 -2
  14. package/v1/client/worker/context.js +5 -4
  15. package/v1/declaration.d.ts +2 -0
  16. package/v1/declaration.js +40 -46
  17. package/v1/examples/cancellations/run.js +1 -1
  18. package/v1/examples/cancellations/worker.js +1 -1
  19. package/v1/examples/cancellations/workflow.js +2 -2
  20. package/v1/examples/child_workflows/workflow.js +1 -1
  21. package/v1/examples/concurrency-rr/workflow.js +2 -2
  22. package/v1/examples/dag/interface-workflow.js +1 -1
  23. package/v1/examples/dag/workflow.js +1 -1
  24. package/v1/examples/dag_match_condition/complex-workflow.js +7 -7
  25. package/v1/examples/durable-event/workflow.js +2 -2
  26. package/v1/examples/durable-sleep/workflow.js +1 -1
  27. package/v1/examples/hatchet-client.d.ts +1 -1
  28. package/v1/examples/hatchet-client.js +2 -2
  29. package/v1/examples/landing_page/durable-excution.js +2 -2
  30. package/v1/examples/landing_page/event-signaling.js +1 -1
  31. package/v1/examples/landing_page/flow-control.js +1 -1
  32. package/v1/examples/landing_page/queues.js +2 -2
  33. package/v1/examples/landing_page/scheduling.js +1 -1
  34. package/v1/examples/landing_page/task-routing.js +1 -1
  35. package/v1/examples/migration-guides/mergent.js +5 -5
  36. package/v1/examples/multiple_wf_concurrency/workflow.js +1 -1
  37. package/v1/examples/non_retryable/workflow.js +1 -1
  38. package/v1/examples/on_cron/workflow.js +1 -1
  39. package/v1/examples/on_event/event.js +1 -1
  40. package/v1/examples/on_event/workflow.js +1 -1
  41. package/v1/examples/on_failure/workflow.js +1 -1
  42. package/v1/examples/on_success/workflow.js +1 -1
  43. package/v1/examples/priority/run.js +2 -2
  44. package/v1/examples/priority/workflow.js +2 -2
  45. package/v1/examples/quickstart/hatchet-client.d.ts +2 -0
  46. package/v1/examples/quickstart/hatchet-client.js +9 -0
  47. package/v1/examples/{on_event copy/event.js → quickstart/run.js} +7 -8
  48. package/v1/examples/{on_event copy/worker.js → quickstart/worker.js} +4 -3
  49. package/v1/examples/quickstart/workflows/first-task.d.ts +8 -0
  50. package/v1/examples/quickstart/workflows/first-task.js +12 -0
  51. package/v1/examples/rate_limit/workflow.js +3 -3
  52. package/v1/examples/retries/workflow.js +4 -4
  53. package/v1/examples/simple/bulk.js +2 -2
  54. package/v1/examples/simple/client-run.js +1 -1
  55. package/v1/examples/simple/cron.js +3 -3
  56. package/v1/examples/simple/enqueue.js +2 -2
  57. package/v1/examples/simple/run.js +7 -3
  58. package/v1/examples/simple/schedule.js +9 -1
  59. package/v1/examples/simple/stub-workflow.js +1 -1
  60. package/v1/examples/simple/worker.js +1 -1
  61. package/v1/examples/simple/workflow-with-child.d.ts +5 -1
  62. package/v1/examples/simple/workflow-with-child.js +18 -5
  63. package/v1/examples/simple/workflow.js +13 -3
  64. package/v1/examples/sticky/workflow.js +1 -1
  65. package/v1/examples/timeouts/run.js +1 -1
  66. package/v1/examples/timeouts/worker.js +1 -1
  67. package/v1/examples/timeouts/workflow.js +1 -1
  68. package/v1/examples/with_timeouts/workflow.js +3 -3
  69. package/version.d.ts +1 -1
  70. package/version.js +1 -1
  71. package/v1/examples/on_event copy/workflow.d.ts +0 -16
  72. package/v1/examples/on_event copy/workflow.js +0 -35
  73. /package/v1/examples/{on_event copy/event.d.ts → quickstart/run.d.ts} +0 -0
  74. /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
- // Declaring a Task
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
- // Declaring a Task
16
+ // > Declaring a Task
17
17
  const sleep_1 = __importDefault(require("../../../util/sleep"));
18
18
  const hatchet_client_1 = require("../hatchet-client");
19
- // Execution Timeout
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
- // Refresh Timeout
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.0";
1
+ export declare const HATCHET_VERSION = "1.5.2";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HATCHET_VERSION = void 0;
4
- exports.HATCHET_VERSION = '1.5.0';
4
+ exports.HATCHET_VERSION = '1.5.2';
@@ -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
- });