@hatchet-dev/typescript-sdk 0.4.1 → 0.4.3

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.
@@ -201,8 +201,8 @@ class Worker {
201
201
  const future = new hatchet_promise_1.default(run().then(success).catch(failure));
202
202
  this.futures[action.getGroupKeyRunId] = future;
203
203
  // Send the action event to the dispatcher
204
- const event = this.getStepActionEvent(action, dispatcher_1.StepActionEventType.STEP_EVENT_TYPE_STARTED);
205
- this.client.dispatcher.sendStepActionEvent(event);
204
+ const event = this.getGroupKeyActionEvent(action, dispatcher_1.GroupKeyActionEventType.GROUP_KEY_EVENT_TYPE_STARTED);
205
+ this.client.dispatcher.sendGroupKeyActionEvent(event);
206
206
  }
207
207
  catch (e) {
208
208
  this.logger.error(`Could not send action event: ${e.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -34,10 +34,8 @@
34
34
  "example:event": "npm run exec -- ./examples/example-event.ts",
35
35
  "example:event-listen": "npm run exec -- ./examples/example-event-with-results.ts",
36
36
  "worker:namespaced": "npm run exec -- ./examples/namespaced-worker.ts",
37
-
38
37
  "worker:rate": "npm run exec -- ./examples/rate-limit/worker.ts",
39
38
  "example:rate": "npm run exec -- ./examples/rate-limit/events.ts",
40
-
41
39
  "worker:fanout": "npm run exec -- ./examples/fanout-worker.ts",
42
40
  "worker:simple": "npm run exec -- ./examples/simple-worker.ts",
43
41
  "manual:trigger": "npm run exec -- ./examples/manual-trigger.ts",
package/step.d.ts CHANGED
@@ -82,6 +82,7 @@ export declare class Context<T, K> {
82
82
  stepOutput(step: string): NextStep;
83
83
  triggeredByEvent(): boolean;
84
84
  workflowInput(): T;
85
+ workflowName(): string;
85
86
  userData(): K;
86
87
  stepName(): string;
87
88
  workflowRunId(): string;
package/step.js CHANGED
@@ -157,6 +157,9 @@ class Context {
157
157
  workflowInput() {
158
158
  return this.input;
159
159
  }
160
+ workflowName() {
161
+ return this.action.jobName;
162
+ }
160
163
  userData() {
161
164
  var _a;
162
165
  return (_a = this.data) === null || _a === void 0 ? void 0 : _a.user_data;