@hatchet-dev/typescript-sdk 0.10.1 → 0.12.1

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 (69) hide show
  1. package/clients/admin/admin-client.d.ts +1 -0
  2. package/clients/dispatcher/dispatcher-client.d.ts +3 -0
  3. package/clients/dispatcher/dispatcher-client.js +20 -1
  4. package/clients/hatchet-client/hatchet-client.d.ts +2 -2
  5. package/clients/hatchet-client/hatchet-client.js +11 -4
  6. package/clients/listener/listener-client.d.ts +10 -4
  7. package/clients/listener/listener-client.js +45 -13
  8. package/clients/worker/handler.d.ts +4 -12
  9. package/clients/worker/handler.js +21 -12
  10. package/clients/worker/worker.d.ts +12 -0
  11. package/clients/worker/worker.js +54 -2
  12. package/examples/affinity-workers.d.ts +1 -0
  13. package/examples/affinity-workers.js +93 -0
  14. package/examples/api.d.ts +1 -0
  15. package/examples/api.js +61 -0
  16. package/examples/concurrency/cancel-in-progress/concurrency-event.d.ts +1 -0
  17. package/examples/concurrency/cancel-in-progress/concurrency-event.js +37 -0
  18. package/examples/concurrency/cancel-in-progress/concurrency-worker.d.ts +1 -0
  19. package/examples/concurrency/cancel-in-progress/concurrency-worker.js +66 -0
  20. package/examples/concurrency/group-round-robin/concurrency-event.d.ts +1 -0
  21. package/examples/concurrency/group-round-robin/concurrency-event.js +35 -0
  22. package/examples/concurrency/group-round-robin/concurrency-worker.d.ts +1 -0
  23. package/examples/concurrency/group-round-robin/concurrency-worker.js +61 -0
  24. package/examples/dag-worker.d.ts +1 -0
  25. package/examples/dag-worker.js +76 -0
  26. package/examples/example-event-with-results.d.ts +1 -0
  27. package/examples/example-event-with-results.js +50 -0
  28. package/examples/example-event.d.ts +1 -0
  29. package/examples/example-event.js +10 -0
  30. package/examples/fanout-worker.d.ts +1 -0
  31. package/examples/fanout-worker.js +69 -0
  32. package/examples/logger.d.ts +1 -0
  33. package/examples/logger.js +50 -0
  34. package/examples/manual-trigger.d.ts +1 -0
  35. package/examples/manual-trigger.js +46 -0
  36. package/examples/multi-workflow.d.ts +1 -0
  37. package/examples/multi-workflow.js +55 -0
  38. package/examples/namespaced-worker.d.ts +1 -0
  39. package/examples/namespaced-worker.js +56 -0
  40. package/examples/on-failure.d.ts +1 -0
  41. package/examples/on-failure.js +53 -0
  42. package/examples/playground.d.ts +1 -0
  43. package/examples/playground.js +39 -0
  44. package/examples/rate-limit/events.d.ts +1 -0
  45. package/examples/rate-limit/events.js +16 -0
  46. package/examples/rate-limit/worker.d.ts +1 -0
  47. package/examples/rate-limit/worker.js +43 -0
  48. package/examples/retries-worker.d.ts +1 -0
  49. package/examples/retries-worker.js +60 -0
  50. package/examples/simple-worker.d.ts +1 -0
  51. package/examples/simple-worker.js +55 -0
  52. package/examples/sticky-worker.d.ts +1 -0
  53. package/examples/sticky-worker.js +73 -0
  54. package/examples/stream-by-additional-meta.d.ts +1 -0
  55. package/examples/stream-by-additional-meta.js +55 -0
  56. package/package.json +25 -22
  57. package/protoc/dispatcher/dispatcher.d.ts +109 -2
  58. package/protoc/dispatcher/dispatcher.js +518 -17
  59. package/protoc/events/events.d.ts +1 -1
  60. package/protoc/events/events.js +0 -5
  61. package/protoc/google/protobuf/timestamp.js +0 -8
  62. package/protoc/workflows/workflows.d.ts +82 -1
  63. package/protoc/workflows/workflows.js +404 -9
  64. package/step.d.ts +79 -2
  65. package/step.js +90 -3
  66. package/util/workflow-run-ref.d.ts +3 -0
  67. package/util/workflow-run-ref.js +21 -4
  68. package/workflow.d.ts +116 -1
  69. package/workflow.js +6 -1
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const sdk_1 = __importDefault(require("../sdk"));
16
+ const hatchet = sdk_1.default.init({
17
+ log_level: 'OFF',
18
+ });
19
+ const sleep = (ms) => new Promise((resolve) => {
20
+ setTimeout(resolve, ms);
21
+ });
22
+ const workflow = {
23
+ id: 'on-failure-example',
24
+ description: 'test',
25
+ on: {
26
+ event: 'user:create',
27
+ },
28
+ steps: [
29
+ {
30
+ name: 'dag-step1',
31
+ run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
32
+ console.log('Starting Step 1!');
33
+ yield sleep(1000);
34
+ throw new Error('Step 1 failed');
35
+ }),
36
+ },
37
+ ],
38
+ onFailure: {
39
+ name: 'on-failure-step',
40
+ run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
41
+ console.log('Starting On Failure Step!');
42
+ return { onFailure: 'step' };
43
+ }),
44
+ },
45
+ };
46
+ function main() {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const worker = yield hatchet.worker('example-worker', 1);
49
+ yield worker.registerWorkflow(workflow);
50
+ worker.start();
51
+ });
52
+ }
53
+ main();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const sdk_1 = __importDefault(require("../sdk"));
16
+ const hatchet = sdk_1.default.init();
17
+ function main() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const worker = yield hatchet.worker('test-playground');
20
+ yield worker.registerWorkflow({
21
+ id: 'playground-ts',
22
+ description: 'desc',
23
+ on: {
24
+ event: 'test1',
25
+ },
26
+ steps: [
27
+ {
28
+ name: 'test1-step1',
29
+ run: (ctx) => {
30
+ const playground = ctx.playground('test1', 'default');
31
+ return { step1: playground, name: ctx.stepName(), workflowRunId: ctx.workflowRunId() };
32
+ },
33
+ },
34
+ ],
35
+ });
36
+ yield worker.start();
37
+ });
38
+ }
39
+ main();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const sdk_1 = __importDefault(require("../../sdk"));
7
+ const hatchet = sdk_1.default.init();
8
+ hatchet.event.push('rate-limit:create', {
9
+ test: '1',
10
+ });
11
+ hatchet.event.push('rate-limit:create', {
12
+ test: '2',
13
+ });
14
+ hatchet.event.push('rate-limit:create', {
15
+ test: '3',
16
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const workflows_1 = require("../../protoc/workflows");
16
+ const sdk_1 = __importDefault(require("../../sdk"));
17
+ const hatchet = sdk_1.default.init();
18
+ const workflow = {
19
+ id: 'rate-limit-workflow',
20
+ description: 'test',
21
+ on: {
22
+ event: 'rate-limit:create',
23
+ },
24
+ steps: [
25
+ {
26
+ name: 'step1',
27
+ rate_limits: [{ key: 'test-limit', units: 1 }],
28
+ run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
29
+ console.log('starting step1 with the following input', ctx.workflowInput());
30
+ return { step1: 'step1 results!' };
31
+ }),
32
+ },
33
+ ],
34
+ };
35
+ function main() {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ yield hatchet.admin.putRateLimit('test-limit', 1, workflows_1.RateLimitDuration.MINUTE);
38
+ const worker = yield hatchet.worker('example-worker');
39
+ yield worker.registerWorkflow(workflow);
40
+ worker.start();
41
+ });
42
+ }
43
+ main();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const sdk_1 = __importDefault(require("../sdk"));
16
+ const hatchet = sdk_1.default.init();
17
+ const sleep = (ms) => new Promise((resolve) => {
18
+ setTimeout(resolve, ms);
19
+ });
20
+ let numRetries = 0;
21
+ const workflow = {
22
+ id: 'retries-workflow',
23
+ description: 'test',
24
+ on: {
25
+ event: 'user:create',
26
+ },
27
+ steps: [
28
+ {
29
+ name: 'step1',
30
+ run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
31
+ if (numRetries < 3) {
32
+ numRetries += 1;
33
+ throw new Error('step1 failed');
34
+ }
35
+ console.log('starting step1 with the following input', ctx.workflowInput());
36
+ console.log('waiting 5 seconds...');
37
+ yield sleep(5000);
38
+ console.log('executed step1!');
39
+ return { step1: 'step1 results!' };
40
+ }),
41
+ retries: 3,
42
+ },
43
+ {
44
+ name: 'step2',
45
+ parents: ['step1'],
46
+ run: (ctx) => {
47
+ console.log('executed step2 after step1 returned ', ctx.stepOutput('step1'));
48
+ return { step2: 'step2 results!' };
49
+ },
50
+ },
51
+ ],
52
+ };
53
+ function main() {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ const worker = yield hatchet.worker('example-worker');
56
+ yield worker.registerWorkflow(workflow);
57
+ worker.start();
58
+ });
59
+ }
60
+ main();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const sdk_1 = __importDefault(require("../sdk"));
16
+ const hatchet = sdk_1.default.init();
17
+ const sleep = (ms) => new Promise((resolve) => {
18
+ setTimeout(resolve, ms);
19
+ });
20
+ const workflow = {
21
+ id: 'simple-workflow',
22
+ description: 'test',
23
+ on: {
24
+ event: 'user:create',
25
+ },
26
+ steps: [
27
+ {
28
+ name: 'step1',
29
+ run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
30
+ console.log('starting step1 with the following input', ctx.workflowInput());
31
+ console.log('waiting 5 seconds...');
32
+ yield sleep(5000);
33
+ ctx.putStream('step1 stream');
34
+ console.log('executed step1!');
35
+ return { step1: 'step1 results!' };
36
+ }),
37
+ },
38
+ {
39
+ name: 'step2',
40
+ parents: ['step1'],
41
+ run: (ctx) => {
42
+ console.log('executed step2 after step1 returned ', ctx.stepOutput('step1'));
43
+ return { step2: 'step2 results!' };
44
+ },
45
+ },
46
+ ],
47
+ };
48
+ function main() {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ const worker = yield hatchet.worker('example-worker');
51
+ yield worker.registerWorkflow(workflow);
52
+ worker.start();
53
+ });
54
+ }
55
+ main();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const sdk_1 = __importDefault(require("../sdk"));
16
+ const workflow_1 = require("../workflow");
17
+ const hatchet = sdk_1.default.init();
18
+ const workflow = {
19
+ id: 'sticky-workflow',
20
+ description: 'test',
21
+ steps: [
22
+ {
23
+ name: 'step1',
24
+ run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
25
+ const results = [];
26
+ // eslint-disable-next-line no-plusplus
27
+ for (let i = 0; i < 50; i++) {
28
+ const result = yield ctx.spawnWorkflow(childWorkflow, {}, { sticky: true });
29
+ results.push(result.result());
30
+ }
31
+ console.log('Spawned 50 child workflows');
32
+ console.log('Results:', yield Promise.all(results));
33
+ return { step1: 'step1 results!' };
34
+ }),
35
+ },
36
+ ],
37
+ };
38
+ const childWorkflow = {
39
+ id: 'child-sticky-workflow',
40
+ description: 'test',
41
+ sticky: workflow_1.StickyStrategy.HARD,
42
+ steps: [
43
+ {
44
+ name: 'child-step1',
45
+ run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
46
+ const workerId = ctx.worker.id();
47
+ console.log(`1: Worker ID: ${workerId}`);
48
+ return { childStep1: `${workerId}` };
49
+ }),
50
+ },
51
+ {
52
+ name: 'child-step2',
53
+ run: (ctx) => __awaiter(void 0, void 0, void 0, function* () {
54
+ const workerId = ctx.worker.id();
55
+ console.log(`2: Worker ID: ${workerId}`);
56
+ return { childStep2: `${workerId}` };
57
+ }),
58
+ },
59
+ ],
60
+ };
61
+ function main() {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const worker1 = yield hatchet.worker('sticky-worker-1');
64
+ yield worker1.registerWorkflow(workflow);
65
+ yield worker1.registerWorkflow(childWorkflow);
66
+ worker1.start();
67
+ const worker2 = yield hatchet.worker('sticky-worker-2');
68
+ yield worker2.registerWorkflow(workflow);
69
+ yield worker2.registerWorkflow(childWorkflow);
70
+ worker2.start();
71
+ });
72
+ }
73
+ main();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
12
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
13
+ var m = o[Symbol.asyncIterator], i;
14
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
15
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
16
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
17
+ };
18
+ var __importDefault = (this && this.__importDefault) || function (mod) {
19
+ return (mod && mod.__esModule) ? mod : { "default": mod };
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const sdk_1 = __importDefault(require("../sdk"));
23
+ const hatchet = sdk_1.default.init();
24
+ function main() {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ var _a, e_1, _b, _c;
27
+ // Generate a random stream key to use to track all
28
+ // stream events for this workflow run.
29
+ const streamKey = 'streamKey';
30
+ const streamVal = `sk-${Math.random().toString(36).substring(7)}`;
31
+ // Specify the stream key as additional metadata
32
+ // when running the workflow.
33
+ // This key gets propagated to all child workflows
34
+ // and can have an arbitrary property name.
35
+ yield hatchet.admin.runWorkflow('parent-workflow', {}, { additionalMetadata: { [streamKey]: streamVal } });
36
+ // Stream all events for the additional meta key value
37
+ const stream = yield hatchet.listener.streamByAdditionalMeta(streamKey, streamVal);
38
+ try {
39
+ for (var _d = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield stream_1.next(), _a = stream_1_1.done, !_a; _d = true) {
40
+ _c = stream_1_1.value;
41
+ _d = false;
42
+ const event = _c;
43
+ console.log('event received', event);
44
+ }
45
+ }
46
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
47
+ finally {
48
+ try {
49
+ if (!_d && !_a && (_b = stream_1.return)) yield _b.call(stream_1);
50
+ }
51
+ finally { if (e_1) throw e_1.error; }
52
+ }
53
+ });
54
+ }
55
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "0.10.1",
3
+ "version": "0.12.1",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -31,25 +31,28 @@
31
31
  "prettier:check": "prettier \"src/**/*.{ts,tsx}\" --list-different",
32
32
  "prettier:fix": "prettier \"src/**/*.{ts,tsx}\" --write",
33
33
  "exec": "npx dotenv -- ts-node -r tsconfig-paths/register --project tsconfig.json",
34
- "example:event": "npm run exec -- ./examples/example-event.ts",
35
- "example:event-listen": "npm run exec -- ./examples/example-event-with-results.ts",
36
- "worker:namespaced": "npm run exec -- ./examples/namespaced-worker.ts",
37
- "worker:rate": "npm run exec -- ./examples/rate-limit/worker.ts",
38
- "example:rate": "npm run exec -- ./examples/rate-limit/events.ts",
39
- "worker:fanout": "npm run exec -- ./examples/fanout-worker.ts",
40
- "worker:simple": "npm run exec -- ./examples/simple-worker.ts",
41
- "worker:on-failure": "npm run exec -- ./examples/on-failure.ts",
42
- "manual:trigger": "npm run exec -- ./examples/manual-trigger.ts",
43
- "worker:dag": "npm run exec -- ./examples/dag-worker.ts",
44
- "worker:concurrency": "npm run exec -- ./examples/concurrency/cancel-in-progress/concurrency-worker.ts",
45
- "event:concurrency": "npm run exec -- ./examples/concurrency/cancel-in-progress/concurrency-event.ts",
46
- "worker:concurrency:rr": "npm run exec -- ./examples/concurrency/group-round-robin/concurrency-worker.ts",
47
- "event:concurrency:rr": "npm run exec -- ./examples/concurrency/group-round-robin/concurrency-event.ts",
48
- "worker:playground": "npm run exec -- ./examples/playground.ts",
49
- "worker:retries": "npm run exec -- ./examples/retries-worker.ts",
50
- "worker:multi-workflow": "npm run exec -- ./examples/multi-workflow.ts",
51
- "worker:logger": "npm run exec -- ./examples/logger.ts",
52
- "api": "npm run exec -- ./examples/api.ts",
34
+ "example:event": "npm run exec -- ./src/examples/example-event.ts",
35
+ "example:event-listen": "npm run exec -- ./src/examples/example-event-with-results.ts",
36
+ "worker:namespaced": "npm run exec -- ./src/examples/namespaced-worker.ts",
37
+ "worker:rate": "npm run exec -- ./src/examples/rate-limit/worker.ts",
38
+ "example:rate": "npm run exec -- ./src/examples/rate-limit/events.ts",
39
+ "worker:fanout": "npm run exec -- ./src/examples/fanout-worker.ts",
40
+ "worker:simple": "npm run exec -- ./src/examples/simple-worker.ts",
41
+ "worker:affinity": "npm run exec -- ./src/examples/affinity-workers.ts",
42
+ "worker:sticky": "npm run exec -- ./src/examples/sticky-worker.ts",
43
+ "worker:on-failure": "npm run exec -- ./src/examples/on-failure.ts",
44
+ "manual:trigger": "npm run exec -- ./src/examples/manual-trigger.ts",
45
+ "manual:meta": "npm run exec -- ./src/examples/stream-by-additional-meta.ts",
46
+ "worker:dag": "npm run exec -- ./src/examples/dag-worker.ts",
47
+ "worker:concurrency": "npm run exec -- ./src/examples/concurrency/cancel-in-progress/concurrency-worker.ts",
48
+ "event:concurrency": "npm run exec -- ./src/examples/concurrency/cancel-in-progress/concurrency-event.ts",
49
+ "worker:concurrency:rr": "npm run exec -- ./src/examples/concurrency/group-round-robin/concurrency-worker.ts",
50
+ "event:concurrency:rr": "npm run exec -- ./src/examples/concurrency/group-round-robin/concurrency-event.ts",
51
+ "worker:playground": "npm run exec -- ./src/examples/playground.ts",
52
+ "worker:retries": "npm run exec -- ./src/examples/retries-worker.ts",
53
+ "worker:multi-workflow": "npm run exec -- ./src/examples/multi-workflow.ts",
54
+ "worker:logger": "npm run exec -- ./src/examples/logger.ts",
55
+ "api": "npm run exec -- ./src/examples/api.ts",
53
56
  "prepublish": "cp package.json dist/package.json;",
54
57
  "publish:ci": "rm -rf ./dist && npm run tsc:build && npm run prepublish && cd dist && npm publish --access public --no-git-checks",
55
58
  "generate-docs": "typedoc"
@@ -59,7 +62,7 @@
59
62
  "license": "MIT",
60
63
  "devDependencies": {
61
64
  "@types/jest": "^29.5.11",
62
- "@types/node": "^20.11.16",
65
+ "@types/node": "^22.0.0",
63
66
  "@typescript-eslint/eslint-plugin": "^6.4.0",
64
67
  "autoprefixer": "^10.4.16",
65
68
  "dotenv-cli": "^7.3.0",
@@ -76,7 +79,7 @@
76
79
  "eslint-plugin-react": "^7.34.1",
77
80
  "eslint-plugin-react-hooks": "^4.6.0",
78
81
  "eslint-plugin-react-refresh": "^0.4.6",
79
- "eslint-plugin-unused-imports": "^3.0.0",
82
+ "eslint-plugin-unused-imports": "^4.1.3",
80
83
  "grpc-tools": "^1.12.4",
81
84
  "jest": "^29.7.0",
82
85
  "prettier": "^3.1.1",