@acmekit/workflow-engine-redis 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 (87) hide show
  1. package/README.md +1 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +11 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/loaders/index.d.ts +3 -0
  7. package/dist/loaders/index.d.ts.map +1 -0
  8. package/dist/loaders/index.js +11 -0
  9. package/dist/loaders/index.js.map +1 -0
  10. package/dist/loaders/redis.d.ts +4 -0
  11. package/dist/loaders/redis.d.ts.map +1 -0
  12. package/dist/loaders/redis.js +113 -0
  13. package/dist/loaders/redis.js.map +1 -0
  14. package/dist/loaders/utils.d.ts +6 -0
  15. package/dist/loaders/utils.d.ts.map +1 -0
  16. package/dist/loaders/utils.js +11 -0
  17. package/dist/loaders/utils.js.map +1 -0
  18. package/dist/migrations/Migration20231228143900.d.ts +6 -0
  19. package/dist/migrations/Migration20231228143900.d.ts.map +1 -0
  20. package/dist/migrations/Migration20231228143900.js +40 -0
  21. package/dist/migrations/Migration20231228143900.js.map +1 -0
  22. package/dist/migrations/Migration20241206123341.d.ts +5 -0
  23. package/dist/migrations/Migration20241206123341.d.ts.map +1 -0
  24. package/dist/migrations/Migration20241206123341.js +19 -0
  25. package/dist/migrations/Migration20241206123341.js.map +1 -0
  26. package/dist/migrations/Migration20250120111059.d.ts +6 -0
  27. package/dist/migrations/Migration20250120111059.d.ts.map +1 -0
  28. package/dist/migrations/Migration20250120111059.js +14 -0
  29. package/dist/migrations/Migration20250120111059.js.map +1 -0
  30. package/dist/migrations/Migration20250128174354.d.ts +6 -0
  31. package/dist/migrations/Migration20250128174354.d.ts.map +1 -0
  32. package/dist/migrations/Migration20250128174354.js +24 -0
  33. package/dist/migrations/Migration20250128174354.js.map +1 -0
  34. package/dist/migrations/Migration20250505101505.d.ts +6 -0
  35. package/dist/migrations/Migration20250505101505.d.ts.map +1 -0
  36. package/dist/migrations/Migration20250505101505.js +40 -0
  37. package/dist/migrations/Migration20250505101505.js.map +1 -0
  38. package/dist/migrations/Migration20250819110923.d.ts +6 -0
  39. package/dist/migrations/Migration20250819110923.d.ts.map +1 -0
  40. package/dist/migrations/Migration20250819110923.js +14 -0
  41. package/dist/migrations/Migration20250819110923.js.map +1 -0
  42. package/dist/migrations/Migration20250819110924.d.ts +6 -0
  43. package/dist/migrations/Migration20250819110924.d.ts.map +1 -0
  44. package/dist/migrations/Migration20250819110924.js +16 -0
  45. package/dist/migrations/Migration20250819110924.js.map +1 -0
  46. package/dist/migrations/Migration20250908080326.d.ts +6 -0
  47. package/dist/migrations/Migration20250908080326.d.ts.map +1 -0
  48. package/dist/migrations/Migration20250908080326.js +20 -0
  49. package/dist/migrations/Migration20250908080326.js.map +1 -0
  50. package/dist/models/index.d.ts +2 -0
  51. package/dist/models/index.d.ts.map +1 -0
  52. package/dist/models/index.js +6 -0
  53. package/dist/models/index.js.map +1 -0
  54. package/dist/models/workflow-execution.d.ts +12 -0
  55. package/dist/models/workflow-execution.d.ts.map +1 -0
  56. package/dist/models/workflow-execution.js +60 -0
  57. package/dist/models/workflow-execution.js.map +1 -0
  58. package/dist/schema/index.d.ts +3 -0
  59. package/dist/schema/index.d.ts.map +1 -0
  60. package/dist/schema/index.js +26 -0
  61. package/dist/schema/index.js.map +1 -0
  62. package/dist/services/index.d.ts +3 -0
  63. package/dist/services/index.d.ts.map +1 -0
  64. package/dist/services/index.js +19 -0
  65. package/dist/services/index.js.map +1 -0
  66. package/dist/services/workflow-orchestrator.d.ts +101 -0
  67. package/dist/services/workflow-orchestrator.d.ts.map +1 -0
  68. package/dist/services/workflow-orchestrator.js +660 -0
  69. package/dist/services/workflow-orchestrator.js.map +1 -0
  70. package/dist/services/workflows-module.d.ts +165 -0
  71. package/dist/services/workflows-module.d.ts.map +1 -0
  72. package/dist/services/workflows-module.js +212 -0
  73. package/dist/services/workflows-module.js.map +1 -0
  74. package/dist/tsconfig.tsbuildinfo +1 -0
  75. package/dist/types/index.d.ts +138 -0
  76. package/dist/types/index.d.ts.map +1 -0
  77. package/dist/types/index.js +3 -0
  78. package/dist/types/index.js.map +1 -0
  79. package/dist/utils/index.d.ts +2 -0
  80. package/dist/utils/index.d.ts.map +1 -0
  81. package/dist/utils/index.js +18 -0
  82. package/dist/utils/index.js.map +1 -0
  83. package/dist/utils/workflow-orchestrator-storage.d.ts +72 -0
  84. package/dist/utils/workflow-orchestrator-storage.d.ts.map +1 -0
  85. package/dist/utils/workflow-orchestrator-storage.js +621 -0
  86. package/dist/utils/workflow-orchestrator-storage.js.map +1 -0
  87. package/package.json +50 -0
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Workflow Orchestrator
@@ -0,0 +1,7 @@
1
+ import "./types";
2
+ import { WorkflowsModuleService } from "./services";
3
+ declare const _default: import("@acmekit/types").ModuleExports<typeof WorkflowsModuleService> & {
4
+ linkable: Record<string, any>;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAA;AAEhB,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;;;;AAGlD,wBAGE"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./types");
4
+ const utils_1 = require("@acmekit/framework/utils");
5
+ const _services_1 = require("./services");
6
+ const loaders_1 = require("./loaders");
7
+ exports.default = (0, utils_1.Module)(utils_1.Modules.WORKFLOW_ENGINE, {
8
+ service: _services_1.WorkflowsModuleService,
9
+ loaders: [loaders_1.loadUtils, loaders_1.redisConnection],
10
+ });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,mBAAgB;AAChB,oDAA0D;AAC1D,yCAAkD;AAClD,uCAAsD;AAEtD,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,eAAe,EAAE;IAC7C,OAAO,EAAE,kCAAsB;IAC/B,OAAO,EAAE,CAAC,mBAAS,EAAE,yBAAe,CAAU;CAC/C,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { default as redisConnection } from "./redis";
2
+ export { default as loadUtils } from "./utils";
3
+ //# 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,eAAe,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,11 @@
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 = exports.redisConnection = void 0;
7
+ var redis_1 = require("./redis");
8
+ Object.defineProperty(exports, "redisConnection", { enumerable: true, get: function () { return __importDefault(redis_1).default; } });
9
+ var utils_1 = require("./utils");
10
+ Object.defineProperty(exports, "loadUtils", { enumerable: true, get: function () { return __importDefault(utils_1).default; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAoD;AAA3C,yHAAA,OAAO,OAAmB;AACnC,iCAA8C;AAArC,mHAAA,OAAO,OAAa"}
@@ -0,0 +1,4 @@
1
+ import { InternalModuleDeclaration, LoaderOptions } from "@acmekit/framework/types";
2
+ declare const _default: ({ container, logger, options, dataLoaderOnly }: LoaderOptions, moduleDeclaration: InternalModuleDeclaration) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=redis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/loaders/redis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACd,MAAM,0BAA0B,CAAA;yBAM/B,gDAAgD,aAAa,EAC7D,mBAAmB,yBAAyB,KAC3C,OAAO,CAAC,IAAI,CAAC;AAHhB,wBAqIC"}
@@ -0,0 +1,113 @@
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 awilix_1 = require("@acmekit/framework/awilix");
7
+ const ioredis_1 = __importDefault(require("ioredis"));
8
+ exports.default = async ({ container, logger, options, dataLoaderOnly }, moduleDeclaration) => {
9
+ const { url, redisUrl, options: deprecatedRedisOptions, redisOptions: newRedisOptions, jobQueueName, queueName,
10
+ // Shared options
11
+ queueOptions, workerOptions,
12
+ // Per-queue options
13
+ mainQueueOptions, mainWorkerOptions, jobQueueOptions, jobWorkerOptions, cleanerQueueOptions, cleanerWorkerOptions, pubsub, } = options?.redis;
14
+ // Handle backward compatibility for deprecated options
15
+ const resolvedUrl = redisUrl ?? url;
16
+ const redisOptions = newRedisOptions ?? deprecatedRedisOptions;
17
+ // Log deprecation warnings
18
+ if (url && !redisUrl) {
19
+ logger?.warn("[Workflow-engine-redis] The `url` option is deprecated. Please use `redisUrl` instead for consistency with other modules.");
20
+ }
21
+ if (deprecatedRedisOptions && !newRedisOptions) {
22
+ logger?.warn("[Workflow-engine-redis] The `options` option is deprecated. Please use `redisOptions` instead for consistency with other modules.");
23
+ }
24
+ // TODO: get default from ENV VAR
25
+ if (!resolvedUrl) {
26
+ throw Error("No `redis.redisUrl` (or deprecated `redis.url`) provided in `workflowOrchestrator` module options. It is required for the Workflow Orchestrator Redis.");
27
+ }
28
+ const cnnPubSub = pubsub ?? { url: resolvedUrl, options: redisOptions };
29
+ const queueName_ = queueName ?? "acmekit-workflows";
30
+ const jobQueueName_ = jobQueueName ?? "acmekit-workflows-jobs";
31
+ // Resolve per-queue options by merging shared defaults with per-queue overrides
32
+ const resolvedMainQueueOptions = {
33
+ ...(queueOptions ?? {}),
34
+ ...(mainQueueOptions ?? {}),
35
+ };
36
+ const resolvedMainWorkerOptions = {
37
+ ...(workerOptions ?? {}),
38
+ ...(mainWorkerOptions ?? {}),
39
+ };
40
+ const resolvedJobQueueOptions = {
41
+ ...(queueOptions ?? {}),
42
+ ...(jobQueueOptions ?? {}),
43
+ };
44
+ const resolvedJobWorkerOptions = {
45
+ ...(workerOptions ?? {}),
46
+ ...(jobWorkerOptions ?? {}),
47
+ };
48
+ const resolvedCleanerQueueOptions = {
49
+ ...(queueOptions ?? {}),
50
+ ...(cleanerQueueOptions ?? {}),
51
+ };
52
+ const resolvedCleanerWorkerOptions = {
53
+ ...(workerOptions ?? {}),
54
+ ...(cleanerWorkerOptions ?? {}),
55
+ };
56
+ let connection;
57
+ let redisPublisher;
58
+ let redisSubscriber;
59
+ let workerConnection;
60
+ try {
61
+ connection = await getConnection(resolvedUrl, redisOptions);
62
+ workerConnection = await getConnection(resolvedUrl, {
63
+ ...(redisOptions ?? {}),
64
+ maxRetriesPerRequest: null,
65
+ });
66
+ logger?.info(`[Workflow-engine-redis] Connection to Redis in module 'workflow-engine-redis' established`);
67
+ }
68
+ catch (err) {
69
+ logger?.error(`[Workflow-engine-redis] An error occurred while connecting to Redis in module 'workflow-engine-redis': ${err}`);
70
+ }
71
+ try {
72
+ redisPublisher = await getConnection(cnnPubSub.url, cnnPubSub.options);
73
+ redisSubscriber = await getConnection(cnnPubSub.url, cnnPubSub.options);
74
+ logger?.info(`[Workflow-engine-redis] Connection to Redis PubSub in module 'workflow-engine-redis' established`);
75
+ }
76
+ catch (err) {
77
+ logger?.error(`[Workflow-engine-redis] An error occurred while connecting to Redis PubSub in module 'workflow-engine-redis': ${err}`);
78
+ }
79
+ container.register({
80
+ isWorkerMode: (0, awilix_1.asValue)(moduleDeclaration.worker_mode !== "server"),
81
+ partialLoading: (0, awilix_1.asValue)(true),
82
+ redisConnection: (0, awilix_1.asValue)(connection),
83
+ redisWorkerConnection: (0, awilix_1.asValue)(workerConnection),
84
+ redisPublisher: (0, awilix_1.asValue)(redisPublisher),
85
+ redisSubscriber: (0, awilix_1.asValue)(redisSubscriber),
86
+ redisQueueName: (0, awilix_1.asValue)(queueName_),
87
+ redisJobQueueName: (0, awilix_1.asValue)(jobQueueName_),
88
+ // Per-queue resolved options
89
+ redisMainQueueOptions: (0, awilix_1.asValue)(resolvedMainQueueOptions),
90
+ redisMainWorkerOptions: (0, awilix_1.asValue)(resolvedMainWorkerOptions),
91
+ redisJobQueueOptions: (0, awilix_1.asValue)(resolvedJobQueueOptions),
92
+ redisJobWorkerOptions: (0, awilix_1.asValue)(resolvedJobWorkerOptions),
93
+ redisCleanerQueueOptions: (0, awilix_1.asValue)(resolvedCleanerQueueOptions),
94
+ redisCleanerWorkerOptions: (0, awilix_1.asValue)(resolvedCleanerWorkerOptions),
95
+ redisDisconnectHandler: (0, awilix_1.asValue)(async () => {
96
+ connection.disconnect();
97
+ workerConnection.disconnect();
98
+ redisPublisher.disconnect();
99
+ redisSubscriber.disconnect();
100
+ }),
101
+ });
102
+ };
103
+ async function getConnection(url, redisOptions) {
104
+ const connection = new ioredis_1.default(url, {
105
+ lazyConnect: true,
106
+ ...(redisOptions ?? {}),
107
+ });
108
+ await new Promise(async (resolve) => {
109
+ await connection.connect(resolve);
110
+ });
111
+ return connection;
112
+ }
113
+ //# sourceMappingURL=redis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.js","sourceRoot":"","sources":["../../src/loaders/redis.ts"],"names":[],"mappings":";;;;;AAIA,sDAAmD;AACnD,sDAA2B;AAG3B,kBAAe,KAAK,EAClB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAi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AY;IAC5C,MAAM,UAAU,GAAG,IAAI,iBAAK,CAAC,GAAG,EAAE;QAChC,WAAW,EAAE,IAAI;QACjB,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;KACxB,CAAC,CAAA;IAEF,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QAClC,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAA;AACnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare const _default: ({ container, dataLoaderOnly }: {
2
+ container: any;
3
+ dataLoaderOnly: any;
4
+ }) => Promise<void>;
5
+ export default _default;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/loaders/utils.ts"],"names":[],"mappings":"yBAGsB;;;CAA6B,KAAG,OAAO,CAAC,IAAI,CAAC;AAAnE,wBAOC"}
@@ -0,0 +1,11 @@
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, dataLoaderOnly }) => {
6
+ container.register({
7
+ redisDistributedTransactionStorage: (0, awilix_1.asClass)(utils_1.RedisDistributedTransactionStorage).singleton(),
8
+ dataLoaderOnly: (0, awilix_1.asValue)(!!dataLoaderOnly),
9
+ });
10
+ };
11
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/loaders/utils.ts"],"names":[],"mappings":";;AAAA,sDAA4D;AAC5D,oCAA6D;AAE7D,kBAAe,KAAK,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,EAAiB,EAAE;IACpE,SAAS,CAAC,QAAQ,CAAC;QACjB,kCAAkC,EAAE,IAAA,gBAAO,EACzC,0CAAkC,CACnC,CAAC,SAAS,EAAE;QACb,cAAc,EAAE,IAAA,gBAAO,EAAC,CAAC,CAAC,cAAc,CAAC;KAC1C,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 Migration20241206123341 extends Migration {
3
+ up(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=Migration20241206123341.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20241206123341.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20241206123341.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.Migration20241206123341 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20241206123341 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.Migration20241206123341 = Migration20241206123341;
19
+ //# sourceMappingURL=Migration20241206123341.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20241206123341.js","sourceRoot":"","sources":["../../src/migrations/Migration20241206123341.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 Migration20250120111059 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250120111059.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250120111059.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250120111059.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAE9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAInB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAI5B"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20250120111059 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20250120111059 extends migrations_1.Migration {
6
+ async up() {
7
+ 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;');
8
+ }
9
+ async down() {
10
+ this.addSql('drop index if exists "IDX_workflow_execution_workflow_id_transaction_id_unique";');
11
+ }
12
+ }
13
+ exports.Migration20250120111059 = Migration20250120111059;
14
+ //# sourceMappingURL=Migration20250120111059.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250120111059.js","sourceRoot":"","sources":["../../src/migrations/Migration20250120111059.ts"],"names":[],"mappings":";;;AAAA,wEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAEpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC,8KAA8K,CAAC,CAAC;IAC9L,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC,kFAAkF,CAAC,CAAC;IAClG,CAAC;CAEF;AAVD,0DAUC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@acmekit/framework/mikro-orm/migrations";
2
+ export declare class Migration20250128174354 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250128174354.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250128174354.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250128174354.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.Migration20250128174354 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20250128174354 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.Migration20250128174354 = Migration20250128174354;
24
+ //# sourceMappingURL=Migration20250128174354.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250128174354.js","sourceRoot":"","sources":["../../src/migrations/Migration20250128174354.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 Migration20250505101505 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250505101505.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250505101505.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250505101505.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.Migration20250505101505 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ const ulid_1 = require("ulid");
6
+ class Migration20250505101505 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.Migration20250505101505 = Migration20250505101505;
40
+ //# sourceMappingURL=Migration20250505101505.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250505101505.js","sourceRoot":"","sources":["../../src/migrations/Migration20250505101505.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 Migration20250819110923 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250819110923.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250819110923.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250819110923.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAErC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAInB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAIrC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20250819110923 = void 0;
4
+ const migrations_1 = require("@acmekit/framework/mikro-orm/migrations");
5
+ class Migration20250819110923 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.Migration20250819110923 = Migration20250819110923;
14
+ //# sourceMappingURL=Migration20250819110923.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250819110923.js","sourceRoot":"","sources":["../../src/migrations/Migration20250819110923.ts"],"names":[],"mappings":";;;AAAA,wEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAE3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,uHAAuH,CAAC,CAAC;IACvI,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,uDAAuD,CAAC,CAAC;IACvE,CAAC;CAEF;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 Migration20250908080326 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20250908080326.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250908080326.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20250908080326.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.Migration20250908080326 = void 0;
4
+ const migrations_1 = require("@acmekit/deps/mikro-orm/migrations");
5
+ class Migration20250908080326 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.Migration20250908080326 = Migration20250908080326;
20
+ //# sourceMappingURL=Migration20250908080326.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20250908080326.js","sourceRoot":"","sources":["../../src/migrations/Migration20250908080326.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"}