@lafken/state-machine 0.11.13 → 0.11.15

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.
@@ -14,6 +14,7 @@ export declare class Schema {
14
14
  private unresolvedDependency;
15
15
  private bucketPermissions;
16
16
  private lambdaResources;
17
+ private handlerStateNames;
17
18
  constructor(scope: Construct, resource: ClassResource, props?: SchemaProps);
18
19
  get definition(): DefinitionSchema;
19
20
  get resources(): TerraformResource[];
@@ -17,6 +17,7 @@ class Schema {
17
17
  unresolvedDependency = false;
18
18
  bucketPermissions = {};
19
19
  lambdaResources = [];
20
+ handlerStateNames = new Map();
20
21
  constructor(scope, resource, props = {}) {
21
22
  this.scope = scope;
22
23
  this.resource = resource;
@@ -302,10 +303,12 @@ class Schema {
302
303
  };
303
304
  }
304
305
  addTaskState(handler) {
305
- const stateName = this.stateNames.createName(handler.name);
306
- if (this.states[stateName]) {
307
- return stateName;
306
+ const existingName = this.handlerStateNames.get(handler.name);
307
+ if (existingName) {
308
+ return existingName;
308
309
  }
310
+ const stateName = this.stateNames.createName(handler.name);
311
+ this.handlerStateNames.set(handler.name, stateName);
309
312
  const task = {
310
313
  Type: 'Task',
311
314
  Resource: '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lafken/state-machine",
3
- "version": "0.11.13",
3
+ "version": "0.11.15",
4
4
  "private": false,
5
5
  "description": "Build Step Functions workflows with TypeScript decorators - declarative orchestration with Lafken",
6
6
  "keywords": [
@@ -50,7 +50,7 @@
50
50
  ],
51
51
  "dependencies": {
52
52
  "reflect-metadata": "^0.2.2",
53
- "@lafken/resolver": "0.11.13"
53
+ "@lafken/resolver": "0.11.15"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@cdktn/provider-aws": "^23.9.0",
@@ -63,13 +63,13 @@
63
63
  "typescript": "6.0.3",
64
64
  "unplugin-swc": "^1.5.9",
65
65
  "vitest": "^4.1.5",
66
- "@lafken/common": "0.11.13"
66
+ "@lafken/common": "0.11.15"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@cdktn/provider-aws": ">=23.0.0",
70
70
  "cdktn": ">=0.22.0",
71
71
  "constructs": "^10.4.5",
72
- "@lafken/common": "0.11.13"
72
+ "@lafken/common": "0.11.15"
73
73
  },
74
74
  "engines": {
75
75
  "node": ">=20.19"