@acmekit/workflows-sdk 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.
- package/dist/acmekit-workflow.d.ts +3 -0
- package/dist/acmekit-workflow.d.ts.map +1 -0
- package/dist/acmekit-workflow.js +22 -0
- package/dist/acmekit-workflow.js.map +1 -0
- package/dist/helper/index.d.ts +3 -0
- package/dist/helper/index.d.ts.map +1 -0
- package/dist/helper/index.js +19 -0
- package/dist/helper/index.js.map +1 -0
- package/dist/helper/type.d.ts +71 -0
- package/dist/helper/type.d.ts.map +1 -0
- package/dist/helper/type.js +3 -0
- package/dist/helper/type.js.map +1 -0
- package/dist/helper/workflow-export.d.ts +6 -0
- package/dist/helper/workflow-export.d.ts.map +1 -0
- package/dist/helper/workflow-export.js +291 -0
- package/dist/helper/workflow-export.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/_playground.d.ts +2 -0
- package/dist/utils/_playground.d.ts.map +1 -0
- package/dist/utils/_playground.js +40 -0
- package/dist/utils/_playground.js.map +1 -0
- package/dist/utils/composer/create-hook.d.ts +60 -0
- package/dist/utils/composer/create-hook.d.ts.map +1 -0
- package/dist/utils/composer/create-hook.js +97 -0
- package/dist/utils/composer/create-hook.js.map +1 -0
- package/dist/utils/composer/create-step.d.ts +134 -0
- package/dist/utils/composer/create-step.d.ts.map +1 -0
- package/dist/utils/composer/create-step.js +262 -0
- package/dist/utils/composer/create-step.js.map +1 -0
- package/dist/utils/composer/create-workflow.d.ts +71 -0
- package/dist/utils/composer/create-workflow.d.ts.map +1 -0
- package/dist/utils/composer/create-workflow.js +230 -0
- package/dist/utils/composer/create-workflow.js.map +1 -0
- package/dist/utils/composer/helpers/create-step-handler.d.ts +20 -0
- package/dist/utils/composer/helpers/create-step-handler.d.ts.map +1 -0
- package/dist/utils/composer/helpers/create-step-handler.js +95 -0
- package/dist/utils/composer/helpers/create-step-handler.js.map +1 -0
- package/dist/utils/composer/helpers/index.d.ts +3 -0
- package/dist/utils/composer/helpers/index.d.ts.map +1 -0
- package/dist/utils/composer/helpers/index.js +19 -0
- package/dist/utils/composer/helpers/index.js.map +1 -0
- package/dist/utils/composer/helpers/proxy.d.ts +3 -0
- package/dist/utils/composer/helpers/proxy.d.ts.map +1 -0
- package/dist/utils/composer/helpers/proxy.js +18 -0
- package/dist/utils/composer/helpers/proxy.js.map +1 -0
- package/dist/utils/composer/helpers/resolve-value.d.ts +8 -0
- package/dist/utils/composer/helpers/resolve-value.d.ts.map +1 -0
- package/dist/utils/composer/helpers/resolve-value.js +211 -0
- package/dist/utils/composer/helpers/resolve-value.js.map +1 -0
- package/dist/utils/composer/helpers/step-response.d.ts +126 -0
- package/dist/utils/composer/helpers/step-response.d.ts.map +1 -0
- package/dist/utils/composer/helpers/step-response.js +166 -0
- package/dist/utils/composer/helpers/step-response.js.map +1 -0
- package/dist/utils/composer/helpers/workflow-response.d.ts +20 -0
- package/dist/utils/composer/helpers/workflow-response.d.ts.map +1 -0
- package/dist/utils/composer/helpers/workflow-response.js +16 -0
- package/dist/utils/composer/helpers/workflow-response.js.map +1 -0
- package/dist/utils/composer/index.d.ts +11 -0
- package/dist/utils/composer/index.d.ts.map +1 -0
- package/dist/utils/composer/index.js +27 -0
- package/dist/utils/composer/index.js.map +1 -0
- package/dist/utils/composer/parallelize.d.ts +43 -0
- package/dist/utils/composer/parallelize.d.ts.map +1 -0
- package/dist/utils/composer/parallelize.js +57 -0
- package/dist/utils/composer/parallelize.js.map +1 -0
- package/dist/utils/composer/transform.d.ts +79 -0
- package/dist/utils/composer/transform.d.ts.map +1 -0
- package/dist/utils/composer/transform.js +47 -0
- package/dist/utils/composer/transform.js.map +1 -0
- package/dist/utils/composer/type.d.ts +243 -0
- package/dist/utils/composer/type.d.ts.map +1 -0
- package/dist/utils/composer/type.js +3 -0
- package/dist/utils/composer/type.js.map +1 -0
- package/dist/utils/composer/when.d.ts +58 -0
- package/dist/utils/composer/when.d.ts.map +1 -0
- package/dist/utils/composer/when.js +67 -0
- package/dist/utils/composer/when.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acmekit-workflow.d.ts","sourceRoot":"","sources":["../src/acmekit-workflow.ts"],"names":[],"mappings":"AAkCA,QAAA,MAAM,qBAAqB,KAAyB,CAAA;AAEpD,OAAO,EAAE,qBAAqB,IAAI,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AcmeKitWorkflow = void 0;
|
|
4
|
+
class AcmeKitWorkflow {
|
|
5
|
+
static registerWorkflow(workflowId, exportedWorkflow) {
|
|
6
|
+
if (workflowId in AcmeKitWorkflow.workflows) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
AcmeKitWorkflow.workflows[workflowId] = exportedWorkflow;
|
|
10
|
+
}
|
|
11
|
+
static unregisterWorkflow(workflowId) {
|
|
12
|
+
delete AcmeKitWorkflow.workflows[workflowId];
|
|
13
|
+
}
|
|
14
|
+
static getWorkflow(workflowId) {
|
|
15
|
+
return AcmeKitWorkflow.workflows[workflowId];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
AcmeKitWorkflow.workflows = {};
|
|
19
|
+
global.AcmeKitWorkflow ??= AcmeKitWorkflow;
|
|
20
|
+
const GlobalAcmeKitWorkflow = global.AcmeKitWorkflow;
|
|
21
|
+
exports.AcmeKitWorkflow = GlobalAcmeKitWorkflow;
|
|
22
|
+
//# sourceMappingURL=acmekit-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acmekit-workflow.js","sourceRoot":"","sources":["../src/acmekit-workflow.ts"],"names":[],"mappings":";;;AAIA,MAAM,eAAe;IAYnB,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,gBAAgB;QAClD,IAAI,UAAU,IAAI,eAAe,CAAC,SAAS,EAAE,CAAC;YAC5C,OAAM;QACR,CAAC;QAED,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAA;IAC1D,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU;QAClC,OAAO,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;IAC9C,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,UAAU;QAC3B,OAAO,eAAe,CAAC,SAAS,CAAC,UAAU,CAAgC,CAAA;IAC7E,CAAC;;AAzBM,yBAAS,GASZ,EAAE,CAAA;AAmBR,MAAM,CAAC,eAAe,KAAK,eAAe,CAAA;AAC1C,MAAM,qBAAqB,GAAG,MAAM,CAAC,eAAe,CAAA;AAElB,gDAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helper/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,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("./type"), exports);
|
|
18
|
+
__exportStar(require("./workflow-export"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helper/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,oDAAiC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { DistributedTransactionEvents, DistributedTransactionType, LocalWorkflow, TransactionStepError } from "@acmekit/orchestration";
|
|
2
|
+
import { Context, LoadedModule, AcmeKitContainer } from "@acmekit/types";
|
|
3
|
+
type BaseFlowRunOptions = {
|
|
4
|
+
context?: Context;
|
|
5
|
+
resultFrom?: string | Symbol;
|
|
6
|
+
throwOnError?: boolean;
|
|
7
|
+
logOnError?: boolean;
|
|
8
|
+
events?: DistributedTransactionEvents;
|
|
9
|
+
container?: LoadedModule[] | AcmeKitContainer;
|
|
10
|
+
};
|
|
11
|
+
export type FlowRunOptions<TData = unknown> = BaseFlowRunOptions & {
|
|
12
|
+
input?: TData;
|
|
13
|
+
};
|
|
14
|
+
export type FlowRegisterStepSuccessOptions<TData = unknown> = BaseFlowRunOptions & {
|
|
15
|
+
idempotencyKey: string;
|
|
16
|
+
response?: TData;
|
|
17
|
+
};
|
|
18
|
+
export type FlowRetryStepOptions = Omit<BaseFlowRunOptions, "resultFrom"> & {
|
|
19
|
+
idempotencyKey: string;
|
|
20
|
+
};
|
|
21
|
+
export type FlowRegisterStepFailureOptions<TData = unknown> = BaseFlowRunOptions & {
|
|
22
|
+
idempotencyKey: string;
|
|
23
|
+
response?: TData;
|
|
24
|
+
forcePermanentFailure?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type FlowCancelOptions = {
|
|
27
|
+
transaction?: DistributedTransactionType;
|
|
28
|
+
transactionId?: string;
|
|
29
|
+
context?: Context;
|
|
30
|
+
throwOnError?: boolean;
|
|
31
|
+
logOnError?: boolean;
|
|
32
|
+
events?: DistributedTransactionEvents;
|
|
33
|
+
container?: LoadedModule[] | AcmeKitContainer;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The details of a workflow's execution.
|
|
37
|
+
*/
|
|
38
|
+
export type WorkflowResult<TResult = unknown> = {
|
|
39
|
+
/**
|
|
40
|
+
* Any errors that occured in the workflow.
|
|
41
|
+
*/
|
|
42
|
+
errors: TransactionStepError[];
|
|
43
|
+
/**
|
|
44
|
+
* The transaction details of the workflow's execution.
|
|
45
|
+
*/
|
|
46
|
+
transaction: DistributedTransactionType;
|
|
47
|
+
/**
|
|
48
|
+
* The result returned by the workflow.
|
|
49
|
+
*/
|
|
50
|
+
result: TResult;
|
|
51
|
+
};
|
|
52
|
+
export type ExportedWorkflow<TData = unknown, TResult = unknown, TDataOverride = undefined, TResultOverride = undefined> = {
|
|
53
|
+
run: (args?: FlowRunOptions<TDataOverride extends undefined ? TData : TDataOverride>) => Promise<WorkflowResult<TResultOverride extends undefined ? TResult : TResultOverride>>;
|
|
54
|
+
registerStepSuccess: (args?: FlowRegisterStepSuccessOptions<TDataOverride extends undefined ? TData : TDataOverride>) => Promise<WorkflowResult<TResultOverride extends undefined ? TResult : TResultOverride>>;
|
|
55
|
+
registerStepFailure: (args?: FlowRegisterStepFailureOptions<TDataOverride extends undefined ? TData : TDataOverride>) => Promise<WorkflowResult<TResultOverride extends undefined ? TResult : TResultOverride>>;
|
|
56
|
+
retryStep: (args?: FlowRetryStepOptions) => Promise<WorkflowResult>;
|
|
57
|
+
cancel: (args?: FlowCancelOptions) => Promise<WorkflowResult>;
|
|
58
|
+
};
|
|
59
|
+
export type MainExportedWorkflow<TData = unknown, TResult = unknown> = {
|
|
60
|
+
<TDataOverride = undefined, TResultOverride = undefined>(container?: LoadedModule[] | AcmeKitContainer): Omit<LocalWorkflow, "run" | "registerStepSuccess" | "registerStepFailure" | "cancel"> & ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>;
|
|
61
|
+
} & {
|
|
62
|
+
/**
|
|
63
|
+
* You can also directly call run, registerStepSuccess, registerStepFailure and cancel on the exported workflow
|
|
64
|
+
*/
|
|
65
|
+
run<TDataOverride = undefined, TResultOverride = undefined>(args?: FlowRunOptions<TDataOverride extends undefined ? TData : TDataOverride>): Promise<WorkflowResult<TResultOverride extends undefined ? TResult : TResultOverride>>;
|
|
66
|
+
registerStepSuccess<TDataOverride = undefined, TResultOverride = undefined>(args?: FlowRegisterStepSuccessOptions<TDataOverride extends undefined ? TData : TDataOverride>): Promise<WorkflowResult<TResultOverride extends undefined ? TResult : TResultOverride>>;
|
|
67
|
+
registerStepFailure<TDataOverride = undefined, TResultOverride = undefined>(args?: FlowRegisterStepFailureOptions<TDataOverride extends undefined ? TData : TDataOverride>): Promise<WorkflowResult<TResultOverride extends undefined ? TResult : TResultOverride>>;
|
|
68
|
+
cancel(args?: FlowCancelOptions): Promise<WorkflowResult>;
|
|
69
|
+
};
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/helper/type.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,aAAa,EACb,oBAAoB,EACrB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAExE,KAAK,kBAAkB,GAAG;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,4BAA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AAa,GAAG,SAAS,EAAE,eAAe,GAAG,SAAS,EACxD,IAAI,CAAC,EAAE,cAAc,CACnB,aAAa,SAAS,SAAS,GAAG,KAAK,GAAG,aAAa,CACxD,GACA,OAAO,CACR,cAAc,CACZ,eAAe,SAAS,SAAS,GAAG,OAAO,GAAG,eAAe,CAC9D,CACF,CAAA;IAED,mBAAmB,CAAC,aAAa,GAAG,SAAS,EAAE,eAAe,GAAG,SAAS,EACxE,IAAI,CAAC,EAAE,8BAA8B,CACnC,aAAa,SAAS,SAAS,GAAG,KAAK,GAAG,aAAa,CACxD,GACA,OAAO,CACR,cAAc,CACZ,eAAe,SAAS,SAAS,GAAG,OAAO,GAAG,eAAe,CAC9D,CACF,CAAA;IAED,mBAAmB,CAAC,aAAa,GAAG,SAAS,EAAE,eAAe,GAAG,SAAS,EACxE,IAAI,CAAC,EAAE,8BAA8B,CACnC,aAAa,SAAS,SAAS,GAAG,KAAK,GAAG,aAAa,CACxD,GACA,OAAO,CACR,cAAc,CACZ,eAAe,SAAS,SAAS,GAAG,OAAO,GAAG,eAAe,CAC9D,CACF,CAAA;IAED,MAAM,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;CAC1D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/helper/type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MainExportedWorkflow } from "./type";
|
|
2
|
+
export declare const exportWorkflow: <TData = unknown, TResult = unknown>(workflowId: string, defaultResult?: string | Symbol, options?: {
|
|
3
|
+
wrappedInput?: boolean;
|
|
4
|
+
sourcePath?: string;
|
|
5
|
+
}) => MainExportedWorkflow<TData, TResult>;
|
|
6
|
+
//# sourceMappingURL=workflow-export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-export.d.ts","sourceRoot":"","sources":["../../src/helper/workflow-export.ts"],"names":[],"mappings":"AAyBA,OAAO,EAOL,oBAAoB,EAErB,MAAM,QAAQ,CAAA;AA0Xf,eAAO,MAAM,cAAc,GAAI,KAAK,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAC/D,YAAY,MAAM,EAClB,gBAAgB,MAAM,GAAG,MAAM,EAC/B,UAAU;IACR,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,KACA,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAwKrC,CAAA"}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportWorkflow = void 0;
|
|
4
|
+
const modules_sdk_1 = require("@acmekit/modules-sdk");
|
|
5
|
+
const orchestration_1 = require("@acmekit/orchestration");
|
|
6
|
+
const utils_1 = require("@acmekit/utils");
|
|
7
|
+
const os_1 = require("os");
|
|
8
|
+
const ulid_1 = require("ulid");
|
|
9
|
+
const acmekit_workflow_1 = require("../acmekit-workflow");
|
|
10
|
+
const resolve_value_1 = require("../utils/composer/helpers/resolve-value");
|
|
11
|
+
// Cache for loaded modules to avoid repeated traversal
|
|
12
|
+
let cachedLoadedModules = null;
|
|
13
|
+
function getCachedLoadedModules() {
|
|
14
|
+
if (!cachedLoadedModules) {
|
|
15
|
+
cachedLoadedModules = modules_sdk_1.AcmeKitModule.getLoadedModules().map((mod) => Object.values(mod)[0]);
|
|
16
|
+
}
|
|
17
|
+
return cachedLoadedModules;
|
|
18
|
+
}
|
|
19
|
+
function createContextualWorkflowRunner({ workflowId, defaultResult, options, container, }) {
|
|
20
|
+
const flow = new orchestration_1.LocalWorkflow(workflowId, container);
|
|
21
|
+
const originalRun = flow.run.bind(flow);
|
|
22
|
+
const originalRegisterStepSuccess = flow.registerStepSuccess.bind(flow);
|
|
23
|
+
const originalRegisterStepFailure = flow.registerStepFailure.bind(flow);
|
|
24
|
+
const originalCancel = flow.cancel.bind(flow);
|
|
25
|
+
const originalRetryStep = flow.retryStep.bind(flow);
|
|
26
|
+
const originalExecution = async (method, { throwOnError, logOnError = false, resultFrom, isCancel = false, container: executionContainer, forcePermanentFailure, }, transactionOrIdOrIdempotencyKey, input, context, events = {}) => {
|
|
27
|
+
if (!executionContainer) {
|
|
28
|
+
const container_ = flow.container;
|
|
29
|
+
if (!container_ || !(0, utils_1.isPresent)(container_?.registrations)) {
|
|
30
|
+
executionContainer = getCachedLoadedModules();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (executionContainer) {
|
|
34
|
+
flow.container = executionContainer;
|
|
35
|
+
}
|
|
36
|
+
const { eventGroupId, parentStepIdempotencyKey, preventReleaseEvents, cancelingFromParentStep, } = context;
|
|
37
|
+
if (!preventReleaseEvents) {
|
|
38
|
+
attachOnFinishReleaseEvents(events, flow, { logOnError });
|
|
39
|
+
}
|
|
40
|
+
const flowMetadata = {
|
|
41
|
+
eventGroupId,
|
|
42
|
+
parentStepIdempotencyKey,
|
|
43
|
+
sourcePath: options?.sourcePath,
|
|
44
|
+
preventReleaseEvents,
|
|
45
|
+
cancelingFromParentStep,
|
|
46
|
+
};
|
|
47
|
+
context.isCancelling = isCancel;
|
|
48
|
+
const args = [transactionOrIdOrIdempotencyKey, input, context, events];
|
|
49
|
+
if (method === originalRegisterStepFailure) {
|
|
50
|
+
// Only available on registerStepFailure
|
|
51
|
+
args.push(forcePermanentFailure);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
args.push(flowMetadata);
|
|
55
|
+
}
|
|
56
|
+
const transaction = (await method.apply(method, args));
|
|
57
|
+
let errors = transaction.getErrors(utils_1.TransactionHandlerType.INVOKE);
|
|
58
|
+
const failedStatus = [orchestration_1.TransactionState.FAILED, orchestration_1.TransactionState.REVERTED];
|
|
59
|
+
const isCancelled = isCancel && transaction.getState() === orchestration_1.TransactionState.REVERTED;
|
|
60
|
+
const isRegisterStepFailure = method === originalRegisterStepFailure &&
|
|
61
|
+
transaction.getState() === orchestration_1.TransactionState.REVERTED;
|
|
62
|
+
let thrownError = null;
|
|
63
|
+
if (failedStatus.includes(transaction.getState()) &&
|
|
64
|
+
!isCancelled &&
|
|
65
|
+
!isRegisterStepFailure) {
|
|
66
|
+
const firstError = errors?.[0]?.error ?? new Error("Unknown error");
|
|
67
|
+
thrownError = firstError;
|
|
68
|
+
if (throwOnError) {
|
|
69
|
+
throw firstError;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
let result;
|
|
73
|
+
if (options?.wrappedInput) {
|
|
74
|
+
result = (0, resolve_value_1.resolveValue)(resultFrom, transaction.getContext());
|
|
75
|
+
if (result instanceof Promise) {
|
|
76
|
+
result = await result.catch((e) => {
|
|
77
|
+
thrownError = e;
|
|
78
|
+
if (throwOnError) {
|
|
79
|
+
throw e;
|
|
80
|
+
}
|
|
81
|
+
errors ??= [];
|
|
82
|
+
errors.push(e);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
result =
|
|
88
|
+
resultFrom && transaction.getContext().invoke?.[resultFrom.toString()];
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
errors,
|
|
92
|
+
transaction,
|
|
93
|
+
result,
|
|
94
|
+
thrownError,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
const newRun = async ({ input, context: outerContext, throwOnError, logOnError, resultFrom, events, container, } = {}) => {
|
|
98
|
+
resultFrom ??= defaultResult;
|
|
99
|
+
throwOnError ??= true;
|
|
100
|
+
logOnError ??= false;
|
|
101
|
+
const context = {
|
|
102
|
+
...outerContext,
|
|
103
|
+
__type: utils_1.AcmeKitContextType,
|
|
104
|
+
};
|
|
105
|
+
const uniqId = (0, ulid_1.ulid)();
|
|
106
|
+
context.transactionId ??= "auto-" + uniqId;
|
|
107
|
+
context.eventGroupId ??= uniqId;
|
|
108
|
+
return await originalExecution(originalRun, {
|
|
109
|
+
throwOnError,
|
|
110
|
+
resultFrom,
|
|
111
|
+
container,
|
|
112
|
+
logOnError,
|
|
113
|
+
}, context.transactionId, input, context, events);
|
|
114
|
+
};
|
|
115
|
+
flow.run = newRun;
|
|
116
|
+
const newRegisterStepSuccess = async ({ response, idempotencyKey, context: outerContext, throwOnError, logOnError, resultFrom, events, container, } = {
|
|
117
|
+
idempotencyKey: "",
|
|
118
|
+
}) => {
|
|
119
|
+
idempotencyKey ??= "";
|
|
120
|
+
resultFrom ??= defaultResult;
|
|
121
|
+
throwOnError ??= true;
|
|
122
|
+
logOnError ??= false;
|
|
123
|
+
const [, transactionId] = idempotencyKey.split(":");
|
|
124
|
+
const context = {
|
|
125
|
+
...outerContext,
|
|
126
|
+
transactionId,
|
|
127
|
+
__type: utils_1.AcmeKitContextType,
|
|
128
|
+
};
|
|
129
|
+
context.eventGroupId ??= (0, ulid_1.ulid)();
|
|
130
|
+
return await originalExecution(originalRegisterStepSuccess, {
|
|
131
|
+
throwOnError,
|
|
132
|
+
resultFrom,
|
|
133
|
+
container,
|
|
134
|
+
logOnError,
|
|
135
|
+
}, idempotencyKey, response, context, events);
|
|
136
|
+
};
|
|
137
|
+
flow.registerStepSuccess = newRegisterStepSuccess;
|
|
138
|
+
const newRegisterStepFailure = async ({ response, idempotencyKey, context: outerContext, throwOnError, logOnError, resultFrom, events, container, forcePermanentFailure, } = {
|
|
139
|
+
idempotencyKey: "",
|
|
140
|
+
}) => {
|
|
141
|
+
idempotencyKey ??= "";
|
|
142
|
+
resultFrom ??= defaultResult;
|
|
143
|
+
throwOnError ??= true;
|
|
144
|
+
logOnError ??= false;
|
|
145
|
+
const [, transactionId] = idempotencyKey.split(":");
|
|
146
|
+
const context = {
|
|
147
|
+
...outerContext,
|
|
148
|
+
transactionId,
|
|
149
|
+
__type: utils_1.AcmeKitContextType,
|
|
150
|
+
};
|
|
151
|
+
context.eventGroupId ??= (0, ulid_1.ulid)();
|
|
152
|
+
return await originalExecution(originalRegisterStepFailure, {
|
|
153
|
+
throwOnError,
|
|
154
|
+
resultFrom,
|
|
155
|
+
container,
|
|
156
|
+
logOnError,
|
|
157
|
+
forcePermanentFailure,
|
|
158
|
+
}, idempotencyKey, response, context, events);
|
|
159
|
+
};
|
|
160
|
+
flow.registerStepFailure = newRegisterStepFailure;
|
|
161
|
+
const newRetryStep = async ({ idempotencyKey, context: outerContext, throwOnError, logOnError, events, container, } = {
|
|
162
|
+
idempotencyKey: "",
|
|
163
|
+
}) => {
|
|
164
|
+
idempotencyKey ??= "";
|
|
165
|
+
throwOnError ??= true;
|
|
166
|
+
logOnError ??= false;
|
|
167
|
+
const [, transactionId] = idempotencyKey.split(":");
|
|
168
|
+
const context = {
|
|
169
|
+
...outerContext,
|
|
170
|
+
transactionId,
|
|
171
|
+
__type: utils_1.AcmeKitContextType,
|
|
172
|
+
};
|
|
173
|
+
context.eventGroupId ??= (0, ulid_1.ulid)();
|
|
174
|
+
return await originalExecution(originalRetryStep, {
|
|
175
|
+
throwOnError,
|
|
176
|
+
container,
|
|
177
|
+
logOnError,
|
|
178
|
+
}, idempotencyKey, undefined, context, events);
|
|
179
|
+
};
|
|
180
|
+
flow.retryStep = newRetryStep;
|
|
181
|
+
const newCancel = async ({ transaction, transactionId, context: outerContext, throwOnError, logOnError, events, container, } = {}) => {
|
|
182
|
+
throwOnError ??= true;
|
|
183
|
+
logOnError ??= false;
|
|
184
|
+
const context = {
|
|
185
|
+
...outerContext,
|
|
186
|
+
transactionId,
|
|
187
|
+
__type: utils_1.AcmeKitContextType,
|
|
188
|
+
};
|
|
189
|
+
context.eventGroupId ??= (0, ulid_1.ulid)();
|
|
190
|
+
return await originalExecution(originalCancel, {
|
|
191
|
+
throwOnError,
|
|
192
|
+
resultFrom: undefined,
|
|
193
|
+
isCancel: true,
|
|
194
|
+
container,
|
|
195
|
+
logOnError,
|
|
196
|
+
}, transaction ?? transactionId, undefined, context, events);
|
|
197
|
+
};
|
|
198
|
+
flow.cancel = newCancel;
|
|
199
|
+
return flow;
|
|
200
|
+
}
|
|
201
|
+
const exportWorkflow = (workflowId, defaultResult, options) => {
|
|
202
|
+
function exportedWorkflow(
|
|
203
|
+
// TODO: rm when all usage have been migrated
|
|
204
|
+
container) {
|
|
205
|
+
return createContextualWorkflowRunner({
|
|
206
|
+
workflowId,
|
|
207
|
+
defaultResult,
|
|
208
|
+
options,
|
|
209
|
+
container,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
const buildRunnerFn = (action, container) => {
|
|
213
|
+
const contextualRunner = createContextualWorkflowRunner({
|
|
214
|
+
workflowId,
|
|
215
|
+
defaultResult,
|
|
216
|
+
options,
|
|
217
|
+
container,
|
|
218
|
+
});
|
|
219
|
+
return contextualRunner[action];
|
|
220
|
+
};
|
|
221
|
+
exportedWorkflow.run = async (args) => {
|
|
222
|
+
const container = args?.container;
|
|
223
|
+
delete args?.container;
|
|
224
|
+
return await buildRunnerFn("run", container)(args);
|
|
225
|
+
};
|
|
226
|
+
exportedWorkflow.registerStepSuccess = async (args) => {
|
|
227
|
+
const container = args?.container;
|
|
228
|
+
delete args?.container;
|
|
229
|
+
return await buildRunnerFn("registerStepSuccess", container)(args);
|
|
230
|
+
};
|
|
231
|
+
exportedWorkflow.registerStepFailure = async (args) => {
|
|
232
|
+
const container = args?.container;
|
|
233
|
+
delete args?.container;
|
|
234
|
+
return await buildRunnerFn("registerStepFailure", container)(args);
|
|
235
|
+
};
|
|
236
|
+
exportedWorkflow.retryStep = async (args) => {
|
|
237
|
+
const container = args?.container;
|
|
238
|
+
delete args?.container;
|
|
239
|
+
const inputArgs = { ...args };
|
|
240
|
+
return await buildRunnerFn("retryStep", container)(inputArgs);
|
|
241
|
+
};
|
|
242
|
+
exportedWorkflow.cancel = async (args) => {
|
|
243
|
+
const container = args?.container;
|
|
244
|
+
delete args?.container;
|
|
245
|
+
return await buildRunnerFn("cancel", container)(args);
|
|
246
|
+
};
|
|
247
|
+
acmekit_workflow_1.AcmeKitWorkflow.registerWorkflow(workflowId, exportedWorkflow);
|
|
248
|
+
return exportedWorkflow;
|
|
249
|
+
};
|
|
250
|
+
exports.exportWorkflow = exportWorkflow;
|
|
251
|
+
function attachOnFinishReleaseEvents(events = {}, flow, { logOnError, } = {}) {
|
|
252
|
+
const onFinish = events.onFinish;
|
|
253
|
+
const wrappedOnFinish = async (args) => {
|
|
254
|
+
const { transaction } = args;
|
|
255
|
+
const flowEventGroupId = transaction.getFlow().metadata?.eventGroupId;
|
|
256
|
+
const logger = flow.container.resolve(utils_1.ContainerRegistrationKeys.LOGGER, { allowUnregistered: true }) || console;
|
|
257
|
+
if (logOnError) {
|
|
258
|
+
const workflowName = transaction.getFlow().modelId;
|
|
259
|
+
transaction.getErrors().forEach((err) => {
|
|
260
|
+
const errMsg = err?.error?.message ? " - " + err?.error?.message : "";
|
|
261
|
+
logger.error(`${workflowName}:${err?.action}:${err?.handlerType}${errMsg}${os_1.EOL}${err?.error?.stack}`);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
const eventBusService = flow.container.resolve(utils_1.Modules.EVENT_BUS, {
|
|
265
|
+
allowUnregistered: true,
|
|
266
|
+
});
|
|
267
|
+
if (!eventBusService || !flowEventGroupId) {
|
|
268
|
+
await onFinish?.(args);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const failedStatus = [orchestration_1.TransactionState.FAILED, orchestration_1.TransactionState.REVERTED];
|
|
272
|
+
if (failedStatus.includes(transaction.getState())) {
|
|
273
|
+
return await eventBusService
|
|
274
|
+
.clearGroupedEvents(flowEventGroupId)
|
|
275
|
+
.catch(() => {
|
|
276
|
+
logger.warn(`Failed to clear events for eventGroupId - ${flowEventGroupId}`);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
await eventBusService
|
|
280
|
+
.releaseGroupedEvents(flowEventGroupId)
|
|
281
|
+
.then(async () => {
|
|
282
|
+
await onFinish?.(args);
|
|
283
|
+
})
|
|
284
|
+
.catch((e) => {
|
|
285
|
+
logger.error(`Failed to release grouped events for eventGroupId: ${flowEventGroupId}`, e);
|
|
286
|
+
return flow.cancel(transaction);
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
events.onFinish = wrappedOnFinish;
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=workflow-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-export.js","sourceRoot":"","sources":["../../src/helper/workflow-export.ts"],"names":[],"mappings":";;;AAAA,sDAAoD;AACpD,0DAK+B;AAQ/B,0CAMuB;AACvB,2BAAwB;AACxB,+BAA2B;AAC3B,0DAAqD;AACrD,2EAAsE;AAYtE,uDAAuD;AACvD,IAAI,mBAAmB,GAA0B,IAAI,CAAA;AAErD,SAAS,sBAAsB;IAC7B,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzB,mBAAmB,GAAG,2BAAa,CAAC,gBAAgB,EAAE,CAAC,GAAG,CACxD,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAC/B,CAAA;IACH,CAAC;IACD,OAAO,mBAAmB,CAAA;AAC5B,CAAC;AAED,SAAS,8BAA8B,CAKrC,EACA,UAAU,EACV,aAAa,EACb,OAAO,EACP,SAAS,GASV;IAKC,MAAM,IAAI,GAAG,IAAI,6BAAa,CAAC,UAAU,EAAE,SAAU,CAAC,CAAA;IAEtD,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,2BAA2B,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACvE,MAAM,2BAA2B,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACvE,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC7C,MAAM,iBAAiB,GAAG,IAAI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AAA;QACN,CAAC;QAED,MAAM,eAAe;aAClB,oBAAoB,CAAC,gBAAgB,CAAC;aACtC,IAAI,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,MAAM,CAAC,KAAK,CACV,sDAAsD,gBAAgB,EAAE,EACxE,CAAC,CACF,CAAA;YAED,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;IACN,CAAC,CAAA;IAED,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAA;AACnC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Composer = void 0;
|
|
40
|
+
__exportStar(require("./helper"), exports);
|
|
41
|
+
__exportStar(require("./acmekit-workflow"), exports);
|
|
42
|
+
__exportStar(require("./utils/composer"), exports);
|
|
43
|
+
exports.Composer = __importStar(require("./utils/composer"));
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,qDAAkC;AAClC,mDAAgC;AAChC,6DAA4C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/acmekit-workflow.ts","../src/index.ts","../src/helper/index.ts","../src/helper/type.ts","../src/helper/workflow-export.ts","../src/utils/_playground.ts","../src/utils/composer/create-hook.ts","../src/utils/composer/create-step.ts","../src/utils/composer/create-workflow.ts","../src/utils/composer/index.ts","../src/utils/composer/parallelize.ts","../src/utils/composer/transform.ts","../src/utils/composer/type.ts","../src/utils/composer/when.ts","../src/utils/composer/__tests__/compose.spec.ts","../src/utils/composer/__tests__/index.spec.ts","../src/utils/composer/helpers/create-step-handler.ts","../src/utils/composer/helpers/index.ts","../src/utils/composer/helpers/proxy.ts","../src/utils/composer/helpers/resolve-value.ts","../src/utils/composer/helpers/step-response.ts","../src/utils/composer/helpers/workflow-response.ts"],"version":"5.9.3"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_playground.d.ts","sourceRoot":"","sources":["../../src/utils/_playground.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const composer_1 = require("./composer");
|
|
4
|
+
const create_hook_1 = require("./composer/create-hook");
|
|
5
|
+
const workflow_response_1 = require("./composer/helpers/workflow-response");
|
|
6
|
+
const step1 = (0, composer_1.createStep)("step1", () => {
|
|
7
|
+
return new composer_1.StepResponse("step1");
|
|
8
|
+
}, () => {
|
|
9
|
+
console.log("compensate step1");
|
|
10
|
+
});
|
|
11
|
+
const step2 = (0, composer_1.createStep)("step2", (input) => {
|
|
12
|
+
return new composer_1.StepResponse(input);
|
|
13
|
+
}, (input) => {
|
|
14
|
+
console.log("compensate step2", input);
|
|
15
|
+
});
|
|
16
|
+
const workflow = (0, composer_1.createWorkflow)("workflow", () => {
|
|
17
|
+
const step1Result = step1();
|
|
18
|
+
const step2Input = (0, composer_1.transform)({ step1Result }, (input) => {
|
|
19
|
+
return input;
|
|
20
|
+
});
|
|
21
|
+
const step2Result = step2(step2Input);
|
|
22
|
+
const hook = (0, create_hook_1.createHook)("hook", {
|
|
23
|
+
step2Result,
|
|
24
|
+
});
|
|
25
|
+
return new workflow_response_1.WorkflowResponse(void 0, {
|
|
26
|
+
hooks: [hook],
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
workflow.hooks.hook(() => {
|
|
30
|
+
throw new Error("hook failed");
|
|
31
|
+
});
|
|
32
|
+
workflow()
|
|
33
|
+
.run()
|
|
34
|
+
.then((res) => {
|
|
35
|
+
console.log(res);
|
|
36
|
+
})
|
|
37
|
+
.catch((e) => {
|
|
38
|
+
console.log(e);
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=_playground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_playground.js","sourceRoot":"","sources":["../../src/utils/_playground.ts"],"names":[],"mappings":";;AAAA,yCAAgF;AAChF,wDAAmD;AACnD,4EAAuE;AAEvE,MAAM,KAAK,GAAG,IAAA,qBAAU,EACtB,OAAO,EACP,GAAG,EAAE;IACH,OAAO,IAAI,uBAAY,CAAC,OAAO,CAAC,CAAA;AAClC,CAAC,EACD,GAAG,EAAE;IACH,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;AACjC,CAAC,CACF,CAAA;AAED,MAAM,KAAK,GAAG,IAAA,qBAAU,EACtB,OAAO,EACP,CAAC,KAAU,EAAE,EAAE;IACb,OAAO,IAAI,uBAAY,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAA;AACxC,CAAC,CACF,CAAA;AAED,MAAM,QAAQ,GAAG,IAAA,yBAAc,EAAC,UAAU,EAAE,GAAG,EAAE;IAC/C,MAAM,WAAW,GAAG,KAAK,EAAE,CAAA;IAE3B,MAAM,UAAU,GAAG,IAAA,oBAAS,EAAC,EAAE,WAAW,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE;QACtD,OAAO,KAAK,CAAA;IACd,CAAC,CAA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