@acmekit/workflow-engine-inmemory 2.13.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 (79) hide show
  1. package/README.md +1 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +10 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/loaders/index.d.ts +2 -0
  7. package/dist/loaders/index.d.ts.map +1 -0
  8. package/dist/loaders/index.js +9 -0
  9. package/dist/loaders/index.js.map +1 -0
  10. package/dist/loaders/utils.d.ts +5 -0
  11. package/dist/loaders/utils.d.ts.map +1 -0
  12. package/dist/loaders/utils.js +10 -0
  13. package/dist/loaders/utils.js.map +1 -0
  14. package/dist/migrations/Migration20231228143900.d.ts +6 -0
  15. package/dist/migrations/Migration20231228143900.d.ts.map +1 -0
  16. package/dist/migrations/Migration20231228143900.js +40 -0
  17. package/dist/migrations/Migration20231228143900.js.map +1 -0
  18. package/dist/migrations/Migration20241206101446.d.ts +5 -0
  19. package/dist/migrations/Migration20241206101446.d.ts.map +1 -0
  20. package/dist/migrations/Migration20241206101446.js +19 -0
  21. package/dist/migrations/Migration20241206101446.js.map +1 -0
  22. package/dist/migrations/Migration20250128174331.d.ts +6 -0
  23. package/dist/migrations/Migration20250128174331.d.ts.map +1 -0
  24. package/dist/migrations/Migration20250128174331.js +24 -0
  25. package/dist/migrations/Migration20250128174331.js.map +1 -0
  26. package/dist/migrations/Migration20250505092459.d.ts +6 -0
  27. package/dist/migrations/Migration20250505092459.d.ts.map +1 -0
  28. package/dist/migrations/Migration20250505092459.js +40 -0
  29. package/dist/migrations/Migration20250505092459.js.map +1 -0
  30. package/dist/migrations/Migration20250819104213.d.ts +6 -0
  31. package/dist/migrations/Migration20250819104213.d.ts.map +1 -0
  32. package/dist/migrations/Migration20250819104213.js +14 -0
  33. package/dist/migrations/Migration20250819104213.js.map +1 -0
  34. package/dist/migrations/Migration20250819110924.d.ts +6 -0
  35. package/dist/migrations/Migration20250819110924.d.ts.map +1 -0
  36. package/dist/migrations/Migration20250819110924.js +16 -0
  37. package/dist/migrations/Migration20250819110924.js.map +1 -0
  38. package/dist/migrations/Migration20250908080305.d.ts +6 -0
  39. package/dist/migrations/Migration20250908080305.d.ts.map +1 -0
  40. package/dist/migrations/Migration20250908080305.js +20 -0
  41. package/dist/migrations/Migration20250908080305.js.map +1 -0
  42. package/dist/models/index.d.ts +2 -0
  43. package/dist/models/index.d.ts.map +1 -0
  44. package/dist/models/index.js +6 -0
  45. package/dist/models/index.js.map +1 -0
  46. package/dist/models/workflow-execution.d.ts +12 -0
  47. package/dist/models/workflow-execution.d.ts.map +1 -0
  48. package/dist/models/workflow-execution.js +60 -0
  49. package/dist/models/workflow-execution.js.map +1 -0
  50. package/dist/schema/index.d.ts +3 -0
  51. package/dist/schema/index.d.ts.map +1 -0
  52. package/dist/schema/index.js +27 -0
  53. package/dist/schema/index.js.map +1 -0
  54. package/dist/services/index.d.ts +3 -0
  55. package/dist/services/index.d.ts.map +1 -0
  56. package/dist/services/index.js +19 -0
  57. package/dist/services/index.js.map +1 -0
  58. package/dist/services/workflow-orchestrator.d.ts +86 -0
  59. package/dist/services/workflow-orchestrator.d.ts.map +1 -0
  60. package/dist/services/workflow-orchestrator.js +563 -0
  61. package/dist/services/workflow-orchestrator.js.map +1 -0
  62. package/dist/services/workflows-module.d.ts +163 -0
  63. package/dist/services/workflows-module.d.ts.map +1 -0
  64. package/dist/services/workflows-module.js +208 -0
  65. package/dist/services/workflows-module.js.map +1 -0
  66. package/dist/tsconfig.tsbuildinfo +1 -0
  67. package/dist/types/index.d.ts +11 -0
  68. package/dist/types/index.d.ts.map +1 -0
  69. package/dist/types/index.js +3 -0
  70. package/dist/types/index.js.map +1 -0
  71. package/dist/utils/index.d.ts +2 -0
  72. package/dist/utils/index.d.ts.map +1 -0
  73. package/dist/utils/index.js +18 -0
  74. package/dist/utils/index.js.map +1 -0
  75. package/dist/utils/workflow-orchestrator-storage.d.ts +43 -0
  76. package/dist/utils/workflow-orchestrator-storage.d.ts.map +1 -0
  77. package/dist/utils/workflow-orchestrator-storage.js +541 -0
  78. package/dist/utils/workflow-orchestrator-storage.js.map +1 -0
  79. package/package.json +49 -0
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Workflow Orchestrator
@@ -0,0 +1,6 @@
1
+ import { WorkflowsModuleService } from "./services";
2
+ declare const _default: import("@acmekit/types").ModuleExports<typeof WorkflowsModuleService> & {
3
+ linkable: Record<string, any>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;;;;AAGlD,wBAGE"}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@acmekit/framework/utils");
4
+ const _services_1 = require("./services");
5
+ const loaders_1 = require("./loaders");
6
+ exports.default = (0, utils_1.Module)(utils_1.Modules.WORKFLOW_ENGINE, {
7
+ service: _services_1.WorkflowsModuleService,
8
+ loaders: [loaders_1.loadUtils],
9
+ });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,oDAA0D;AAC1D,yCAAkD;AAClD,uCAAqC;AAErC,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,eAAe,EAAE;IAC7C,OAAO,EAAE,kCAAsB;IAC/B,OAAO,EAAE,CAAC,mBAAS,CAAC;CACrB,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default as loadUtils } from "./utils";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,9 @@
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
+ exports.loadUtils = void 0;
7
+ var utils_1 = require("./utils");
8
+ Object.defineProperty(exports, "loadUtils", { enumerable: true, get: function () { return __importDefault(utils_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAA8C;AAArC,mHAAA,OAAO,OAAa"}
@@ -0,0 +1,5 @@
1
+ declare const _default: ({ container }: {
2
+ container: any;
3
+ }) => Promise<void>;
4
+ export default _default;
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/loaders/utils.ts"],"names":[],"mappings":"yBAGsB;;CAAa,KAAG,OAAO,CAAC,IAAI,CAAC;AAAnD,wBAMC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const awilix_1 = require("@acmekit/framework/awilix");
4
+ const utils_1 = require("../utils");
5
+ exports.default = async ({ container }) => {
6
+ container.register({
7
+ inMemoryDistributedTransactionStorage: (0, awilix_1.asClass)(utils_1.InMemoryDistributedTransactionStorage).singleton(),
8
+ });
9
+ };
10
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/loaders/utils.ts"],"names":[],"mappings":";;AAAA,sDAAmD;AACnD,oCAAgE;AAEhE,kBAAe,KAAK,EAAE,EAAE,SAAS,EAAE,EAAiB,EAAE;IACpD,SAAS,CAAC,QAAQ,CAAC;QACjB,qCAAqC,EAAE,IAAA,gBAAO,EAC5C,6CAAqC,CACtC,CAAC,SAAS,EAAE;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
+ export declare class Migration20231221104256 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20231228143900.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20231228143900.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20231228143900.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAY5B"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20231221104256 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20231221104256 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ CREATE TABLE IF NOT EXISTS workflow_execution
9
+ (
10
+ id character varying NOT NULL,
11
+ workflow_id character varying NOT NULL,
12
+ transaction_id character varying NOT NULL,
13
+ execution jsonb NULL,
14
+ context jsonb NULL,
15
+ state character varying NOT NULL,
16
+ created_at timestamp WITHOUT time zone NOT NULL DEFAULT Now(),
17
+ updated_at timestamp WITHOUT time zone NOT NULL DEFAULT Now(),
18
+ deleted_at timestamp WITHOUT time zone NULL,
19
+ CONSTRAINT "PK_workflow_execution_workflow_id_transaction_id" PRIMARY KEY ("workflow_id", "transaction_id")
20
+ );
21
+
22
+ CREATE UNIQUE INDEX IF NOT EXISTS "IDX_workflow_execution_id" ON "workflow_execution" ("id");
23
+ CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id" ON "workflow_execution" ("workflow_id") WHERE deleted_at IS NULL;
24
+ CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_transaction_id" ON "workflow_execution" ("transaction_id") WHERE deleted_at IS NULL;
25
+ CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_state" ON "workflow_execution" ("state") WHERE deleted_at IS NULL;
26
+ `);
27
+ }
28
+ async down() {
29
+ this.addSql(`
30
+ DROP INDEX "IDX_workflow_execution_id";
31
+ DROP INDEX "IDX_workflow_execution_workflow_id";
32
+ DROP INDEX "IDX_workflow_execution_transaction_id";
33
+ DROP INDEX "IDX_workflow_execution_state";
34
+
35
+ DROP TABLE IF EXISTS workflow_execution;
36
+ `);
37
+ }
38
+ }
39
+ exports.Migration20231221104256 = Migration20231221104256;
40
+ //# sourceMappingURL=Migration20231228143900.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20231228143900.js","sourceRoot":"","sources":["../../src/migrations/Migration20231228143900.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT;;;;;;;;;;;;;;;;;;;OAmBC,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CACT;;;;;;;OAOC,CACF,CAAA;IACH,CAAC;CACF;AAtCD,0DAsCC"}
@@ -0,0 +1,5 @@
1
+ import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
+ export declare class Migration20241206101446 extends Migration {
3
+ up(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=Migration20241206101446.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20241206101446.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20241206101446.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;CAuB1B"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20241206101446 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20241206101446 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`DROP INDEX IF EXISTS "IDX_workflow_execution_id";
8
+ DROP INDEX IF EXISTS "IDX_workflow_execution_workflow_id";
9
+ DROP INDEX IF EXISTS "IDX_workflow_execution_transaction_id";
10
+ DROP INDEX IF EXISTS "IDX_workflow_execution_state";`);
11
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_deleted_at" ON "workflow_execution" (deleted_at) WHERE deleted_at IS NULL;');
12
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_id" ON "workflow_execution" (id) WHERE deleted_at IS NULL;');
13
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id" ON "workflow_execution" (workflow_id) WHERE deleted_at IS NULL;');
14
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_transaction_id" ON "workflow_execution" (transaction_id) WHERE deleted_at IS NULL;');
15
+ this.addSql('CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_state" ON "workflow_execution" (state) WHERE deleted_at IS NULL;');
16
+ }
17
+ }
18
+ exports.Migration20241206101446 = Migration20241206101446;
19
+ //# sourceMappingURL=Migration20241206101446.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20241206101446.js","sourceRoot":"","sources":["../../src/migrations/Migration20241206101446.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CACT;;;2DAGqD,CACtD,CAAA;QACD,IAAI,CAAC,MAAM,CACT,+HAA+H,CAChI,CAAA;QACD,IAAI,CAAC,MAAM,CACT,+GAA+G,CAChH,CAAA;QACD,IAAI,CAAC,MAAM,CACT,iIAAiI,CAClI,CAAA;QACD,IAAI,CAAC,MAAM,CACT,uIAAuI,CACxI,CAAA;QACD,IAAI,CAAC,MAAM,CACT,qHAAqH,CACtH,CAAA;IACH,CAAC;CACF;AAxBD,0DAwBC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
+ export declare class Migration20250128174331 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250128174331.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250128174331.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250128174331.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAKrC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20250128174331 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20250128174331 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`alter table if exists "workflow_execution" add column if not exists "retention_time" integer null;`);
8
+ this.addSql(`
9
+ UPDATE workflow_execution
10
+ SET retention_time = (
11
+ SELECT COALESCE(
12
+ (execution->'options'->>'retentionTime')::integer,
13
+ 0
14
+ )
15
+ )
16
+ WHERE execution->'options' ? 'retentionTime';
17
+ `);
18
+ }
19
+ async down() {
20
+ this.addSql(`alter table if exists "workflow_execution" drop column if exists "retention_time";`);
21
+ }
22
+ }
23
+ exports.Migration20250128174331 = Migration20250128174331;
24
+ //# sourceMappingURL=Migration20250128174331.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250128174331.js","sourceRoot":"","sources":["../../src/migrations/Migration20250128174331.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,oGAAoG,CACrG,CAAA;QACD,IAAI,CAAC,MAAM,CAAC;;;;;;;;;KASX,CAAC,CAAA;IACJ,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,oFAAoF,CACrF,CAAA;IACH,CAAC;CACF;AAtBD,0DAsBC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
+ export declare class Migration20250505092459 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250505092459.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250505092459.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250505092459.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGnE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAwCnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAkBrC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20250505092459 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ const ulid_1 = require("ulid");
6
+ class Migration20250505092459 extends migrations_1.Migration {
7
+ async up() {
8
+ this.addSql(`alter table if exists "workflow_execution" drop constraint if exists "workflow_execution_workflow_id_transaction_id_run_id_unique";`);
9
+ this.addSql(`drop index if exists "IDX_workflow_execution_workflow_id_transaction_id_unique";`);
10
+ this.addSql(`alter table if exists "workflow_execution" drop constraint if exists "PK_workflow_execution_workflow_id_transaction_id";`);
11
+ this.addSql(`alter table if exists "workflow_execution" add column if not exists "run_id" text not null default '${(0, ulid_1.ulid)()}';`);
12
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id_transaction_id_run_id_unique" ON "workflow_execution" (workflow_id, transaction_id, run_id) WHERE deleted_at IS NULL;`);
13
+ /*
14
+ * We mistakenly named this migration differently in the workflow engines; this has caused issues with the migrations. Switching between engines will fail because the primary key is attempted to be set twice.
15
+ * The issue happens in the following scenario:
16
+ * 1. In memory engine is used
17
+ * 2. Migration is run
18
+ * 3. Primary is key added
19
+ * 3. Redis engine is used
20
+ * 4. Migration is run
21
+ * 5. Same primary key is attempted to be set again
22
+ * 6. Migration fails
23
+ *
24
+ * The same scenario can happen if you go from Redis to In memory.
25
+ *
26
+ * With this fix, we ensure the primary key is only ever set once.
27
+ */
28
+ this.addSql(`alter table if exists "workflow_execution" drop constraint if exists "workflow_execution_pkey";`);
29
+ this.addSql(`alter table if exists "workflow_execution" add constraint "workflow_execution_pkey" primary key ("workflow_id", "transaction_id", "run_id");`);
30
+ }
31
+ async down() {
32
+ this.addSql(`drop index if exists "IDX_workflow_execution_workflow_id_transaction_id_run_id_unique";`);
33
+ this.addSql(`alter table if exists "workflow_execution" drop constraint if exists "workflow_execution_pkey";`);
34
+ this.addSql(`alter table if exists "workflow_execution" drop column if exists "run_id";`);
35
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id_transaction_id_unique" ON "workflow_execution" (workflow_id, transaction_id) WHERE deleted_at IS NULL;`);
36
+ this.addSql(`alter table if exists "workflow_execution" add constraint "workflow_execution_pkey" primary key ("workflow_id", "transaction_id");`);
37
+ }
38
+ }
39
+ exports.Migration20250505092459 = Migration20250505092459;
40
+ //# sourceMappingURL=Migration20250505092459.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250505092459.js","sourceRoot":"","sources":["../../src/migrations/Migration20250505092459.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AACnE,+BAA2B;AAE3B,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,qIAAqI,CACtI,CAAA;QACD,IAAI,CAAC,MAAM,CACT,kFAAkF,CACnF,CAAA;QACD,IAAI,CAAC,MAAM,CACT,0HAA0H,CAC3H,CAAA;QAED,IAAI,CAAC,MAAM,CACT,uGAAuG,IAAA,WAAI,GAAE,IAAI,CAClH,CAAA;QACD,IAAI,CAAC,MAAM,CACT,6LAA6L,CAC9L,CAAA;QACD;;;;;;;;;;;;;;WAcG;QACH,IAAI,CAAC,MAAM,CACT,iGAAiG,CAClG,CAAA;QACD,IAAI,CAAC,MAAM,CACT,8IAA8I,CAC/I,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,yFAAyF,CAC1F,CAAA;QACD,IAAI,CAAC,MAAM,CACT,iGAAiG,CAClG,CAAA;QACD,IAAI,CAAC,MAAM,CACT,4EAA4E,CAC7E,CAAA;QAED,IAAI,CAAC,MAAM,CACT,8KAA8K,CAC/K,CAAA;QACD,IAAI,CAAC,MAAM,CACT,oIAAoI,CACrI,CAAA;IACH,CAAC;CACF;AA3DD,0DA2DC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
+ export declare class Migration20250819104213 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250819104213.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250819104213.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250819104213.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAGrC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20250819104213 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20250819104213 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_run_id" ON "workflow_execution" (run_id) WHERE deleted_at IS NULL;`);
8
+ }
9
+ async down() {
10
+ this.addSql(`drop index if exists "IDX_workflow_execution_run_id";`);
11
+ }
12
+ }
13
+ exports.Migration20250819104213 = Migration20250819104213;
14
+ //# sourceMappingURL=Migration20250819104213.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250819104213.js","sourceRoot":"","sources":["../../src/migrations/Migration20250819104213.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,uHAAuH,CACxH,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,uDAAuD,CAAC,CAAA;IACtE,CAAC;CACF;AAVD,0DAUC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
+ export declare class Migration20250819110924 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250819110924.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250819110924.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250819110924.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAUnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAOrC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20250819110924 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20250819110924 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id_transaction_id" ON "workflow_execution" (workflow_id, transaction_id) WHERE deleted_at IS NULL;`);
8
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_run_id" ON "workflow_execution" (run_id) WHERE deleted_at IS NULL;`);
9
+ }
10
+ async down() {
11
+ this.addSql(`drop index if exists "IDX_workflow_execution_workflow_id_transaction_id";`);
12
+ this.addSql(`drop index if exists "IDX_workflow_execution_run_id";`);
13
+ }
14
+ }
15
+ exports.Migration20250819110924 = Migration20250819110924;
16
+ //# sourceMappingURL=Migration20250819110924.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250819110924.js","sourceRoot":"","sources":["../../src/migrations/Migration20250819110924.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AAEnE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,gKAAgK,CACjK,CAAA;QAED,IAAI,CAAC,MAAM,CACT,uHAAuH,CACxH,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,2EAA2E,CAC5E,CAAA;QAED,IAAI,CAAC,MAAM,CAAC,uDAAuD,CAAC,CAAA;IACtE,CAAC;CACF;AAlBD,0DAkBC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@acmekit/deps/mikro-orm/migrations";
2
+ export declare class Migration20250908080305 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250908080305.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250908080305.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250908080305.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAE9D,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAenB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAcrC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20250908080305 = void 0;
4
+ const migrations_1 = require("@acmekit/deps/mikro-orm/migrations");
5
+ class Migration20250908080305 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_workflow_id_transaction_id" ON "workflow_execution" (workflow_id, transaction_id) WHERE deleted_at IS NULL;`);
8
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_state_updated_at" ON "workflow_execution" (state, updated_at) WHERE deleted_at IS NULL;`);
9
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_retention_time_updated_at_state" ON "workflow_execution" (retention_time, updated_at, state) WHERE deleted_at IS NULL AND retention_time IS NOT NULL;`);
10
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_workflow_execution_updated_at_retention_time" ON "workflow_execution" (updated_at, retention_time) WHERE deleted_at IS NULL AND retention_time IS NOT NULL AND state IN ('done', 'failed', 'reverted');`);
11
+ }
12
+ async down() {
13
+ this.addSql(`drop index if exists "IDX_workflow_execution_workflow_id_transaction_id";`);
14
+ this.addSql(`drop index if exists "IDX_workflow_execution_state_updated_at";`);
15
+ this.addSql(`drop index if exists "IDX_workflow_execution_retention_time_updated_at_state";`);
16
+ this.addSql(`drop index if exists "IDX_workflow_execution_updated_at_retention_time";`);
17
+ }
18
+ }
19
+ exports.Migration20250908080305 = Migration20250908080305;
20
+ //# sourceMappingURL=Migration20250908080305.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250908080305.js","sourceRoot":"","sources":["../../src/migrations/Migration20250908080305.ts"],"names":[],"mappings":";;;AAAA,mEAA8D;AAE9D,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,gKAAgK,CACjK,CAAA;QACD,IAAI,CAAC,MAAM,CACT,4IAA4I,CAC7I,CAAA;QACD,IAAI,CAAC,MAAM,CACT,0MAA0M,CAC3M,CAAA;QACD,IAAI,CAAC,MAAM,CACT,yOAAyO,CAC1O,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,2EAA2E,CAC5E,CAAA;QACD,IAAI,CAAC,MAAM,CACT,iEAAiE,CAClE,CAAA;QACD,IAAI,CAAC,MAAM,CACT,gFAAgF,CACjF,CAAA;QACD,IAAI,CAAC,MAAM,CACT,0EAA0E,CAC3E,CAAA;IACH,CAAC;CACF;AA9BD,0DA8BC"}
@@ -0,0 +1,2 @@
1
+ export { WorkflowExecution } from "./workflow-execution";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkflowExecution = void 0;
4
+ var workflow_execution_1 = require("./workflow-execution");
5
+ Object.defineProperty(exports, "WorkflowExecution", { enumerable: true, get: function () { return workflow_execution_1.WorkflowExecution; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,2DAAwD;AAA/C,uHAAA,iBAAiB,OAAA"}
@@ -0,0 +1,12 @@
1
+ import { TransactionState } from "@acmekit/framework/orchestration";
2
+ export declare const WorkflowExecution: import("@acmekit/framework/utils").DmlEntity<import("@acmekit/framework/utils").DMLEntitySchemaBuilder<{
3
+ id: import("@acmekit/framework/utils").IdProperty;
4
+ workflow_id: import("@acmekit/framework/utils").PrimaryKeyModifier<string, import("@acmekit/framework/utils").TextProperty>;
5
+ transaction_id: import("@acmekit/framework/utils").PrimaryKeyModifier<string, import("@acmekit/framework/utils").TextProperty>;
6
+ run_id: import("@acmekit/framework/utils").PrimaryKeyModifier<string, import("@acmekit/framework/utils").TextProperty>;
7
+ execution: import("@acmekit/framework/utils").NullableModifier<Record<string, unknown>, import("@acmekit/framework/utils").JSONProperty>;
8
+ context: import("@acmekit/framework/utils").NullableModifier<Record<string, unknown>, import("@acmekit/framework/utils").JSONProperty>;
9
+ state: import("@acmekit/framework/utils").EnumProperty<typeof TransactionState>;
10
+ retention_time: import("@acmekit/framework/utils").NullableModifier<number, import("@acmekit/framework/utils").NumberProperty>;
11
+ }>, "workflow_execution">;
12
+ //# sourceMappingURL=workflow-execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-execution.d.ts","sourceRoot":"","sources":["../../src/models/workflow-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAGnE,eAAO,MAAM,iBAAiB;;;;;;;;;yBAsD1B,CAAA"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkflowExecution = void 0;
4
+ const orchestration_1 = require("@acmekit/framework/orchestration");
5
+ const utils_1 = require("@acmekit/framework/utils");
6
+ exports.WorkflowExecution = utils_1.model
7
+ .define("workflow_execution", {
8
+ id: utils_1.model.id({ prefix: "wf_exec" }),
9
+ workflow_id: utils_1.model.text().primaryKey(),
10
+ transaction_id: utils_1.model.text().primaryKey(),
11
+ run_id: utils_1.model.text().primaryKey(),
12
+ execution: utils_1.model.json().nullable(),
13
+ context: utils_1.model.json().nullable(),
14
+ state: utils_1.model.enum(orchestration_1.TransactionState),
15
+ retention_time: utils_1.model.number().nullable(),
16
+ })
17
+ .indexes([
18
+ {
19
+ on: ["id"],
20
+ where: "deleted_at IS NULL",
21
+ },
22
+ {
23
+ on: ["workflow_id"],
24
+ where: "deleted_at IS NULL",
25
+ },
26
+ {
27
+ on: ["transaction_id"],
28
+ where: "deleted_at IS NULL",
29
+ },
30
+ {
31
+ on: ["workflow_id", "transaction_id", "run_id"],
32
+ unique: true,
33
+ where: "deleted_at IS NULL",
34
+ },
35
+ {
36
+ on: ["state"],
37
+ where: "deleted_at IS NULL",
38
+ },
39
+ {
40
+ on: ["run_id"],
41
+ where: "deleted_at IS NULL",
42
+ },
43
+ {
44
+ on: ["workflow_id", "transaction_id"],
45
+ where: "deleted_at IS NULL",
46
+ },
47
+ {
48
+ on: ["state", "updated_at"],
49
+ where: "deleted_at IS NULL",
50
+ },
51
+ {
52
+ on: ["retention_time", "updated_at", "state"],
53
+ where: "deleted_at IS NULL AND retention_time IS NOT NULL",
54
+ },
55
+ {
56
+ on: ["updated_at", "retention_time"],
57
+ where: "deleted_at IS NULL AND retention_time IS NOT NULL AND state IN ('done', 'failed', 'reverted')",
58
+ },
59
+ ]);
60
+ //# sourceMappingURL=workflow-execution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-execution.js","sourceRoot":"","sources":["../../src/models/workflow-execution.ts"],"names":[],"mappings":";;;AAAA,oEAAmE;AACnE,oDAAgD;AAEnC,QAAA,iBAAiB,GAAG,aAAK;KACnC,MAAM,CAAC,oBAAoB,EAAE;IAC5B,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACnC,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACtC,cAAc,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACzC,MAAM,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACjC,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAChC,KAAK,EAAE,aAAK,CAAC,IAAI,CAAC,gCAAgB,CAAC;IACnC,cAAc,EAAE,aAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,IAAI,CAAC;QACV,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,aAAa,CAAC;QACnB,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,gBAAgB,CAAC;QACtB,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,aAAa,EAAE,gBAAgB,EAAE,QAAQ,CAAC;QAC/C,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,OAAO,CAAC;QACb,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,QAAQ,CAAC;QACd,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,aAAa,EAAE,gBAAgB,CAAC;QACrC,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC;QAC3B,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,EAAE,EAAE,CAAC,gBAAgB,EAAE,YAAY,EAAE,OAAO,CAAC;QAC7C,KAAK,EAAE,mDAAmD;KAC3D;IACD;QACE,EAAE,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;QACpC,KAAK,EACH,+FAA+F;KAClG;CACF,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ declare const _default: "\nenum TransactionState {\n NOT_STARTED\n INVOKING\n WAITING_TO_COMPENSATE\n COMPENSATING\n DONE\n REVERTED\n FAILED\n}\n\ntype WorkflowExecution {\n id: ID!\n created_at: DateTime!\n updated_at: DateTime!\n deleted_at: DateTime\n workflow_id: string\n transaction_id: string\n run_id: string\n execution: JSON\n context: JSON\n state: TransactionState\n}\n";
2
+ export default _default;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":";AAAA,wBAuBC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = `
4
+ enum TransactionState {
5
+ NOT_STARTED
6
+ INVOKING
7
+ WAITING_TO_COMPENSATE
8
+ COMPENSATING
9
+ DONE
10
+ REVERTED
11
+ FAILED
12
+ }
13
+
14
+ type WorkflowExecution {
15
+ id: ID!
16
+ created_at: DateTime!
17
+ updated_at: DateTime!
18
+ deleted_at: DateTime
19
+ workflow_id: string
20
+ transaction_id: string
21
+ run_id: string
22
+ execution: JSON
23
+ context: JSON
24
+ state: TransactionState
25
+ }
26
+ `;
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":";;AAAA,kBAAe;;;;;;;;;;;;;;;;;;;;;;;CAuBd,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./workflow-orchestrator";
2
+ export * from "./workflows-module";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./workflow-orchestrator"), exports);
18
+ __exportStar(require("./workflows-module"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC;AACvC,qDAAkC"}