@dbos-inc/dbos-sdk 0.7.25-preview → 0.8.12-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/cloud-cli/applications/configure.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/configure.js +12 -2
- package/dist/src/cloud-cli/applications/configure.js.map +1 -1
- package/dist/src/cloud-cli/applications/delete-app.js +1 -1
- package/dist/src/cloud-cli/applications/delete-app.js.map +1 -1
- package/dist/src/cloud-cli/applications/deploy-app-code.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/deploy-app-code.js +10 -2
- package/dist/src/cloud-cli/applications/deploy-app-code.js.map +1 -1
- package/dist/src/cloud-cli/applications/get-app-logs.js +1 -1
- package/dist/src/cloud-cli/applications/get-app-logs.js.map +1 -1
- package/dist/src/cloud-cli/applications/list-apps.js +1 -1
- package/dist/src/cloud-cli/applications/list-apps.js.map +1 -1
- package/dist/src/cloud-cli/applications/register-app.js +1 -1
- package/dist/src/cloud-cli/applications/register-app.js.map +1 -1
- package/dist/src/cloud-cli/applications/update-app.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/update-app.js +3 -2
- package/dist/src/cloud-cli/applications/update-app.js.map +1 -1
- package/dist/src/cloud-cli/cli.js +19 -7
- package/dist/src/cloud-cli/cli.js.map +1 -1
- package/dist/src/cloud-cli/login.d.ts.map +1 -1
- package/dist/src/cloud-cli/login.js +3 -2
- package/dist/src/cloud-cli/login.js.map +1 -1
- package/dist/src/cloud-cli/register.js +1 -1
- package/dist/src/cloud-cli/register.js.map +1 -1
- package/dist/src/cloud-cli/userdb.d.ts +2 -0
- package/dist/src/cloud-cli/userdb.d.ts.map +1 -1
- package/dist/src/cloud-cli/userdb.js +102 -8
- package/dist/src/cloud-cli/userdb.js.map +1 -1
- package/dist/src/communicator.d.ts +3 -2
- package/dist/src/communicator.d.ts.map +1 -1
- package/dist/src/communicator.js.map +1 -1
- package/dist/src/context.d.ts +3 -3
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +8 -8
- package/dist/src/context.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +19 -7
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +186 -67
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/cli.d.ts +0 -1
- package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
- package/dist/src/dbos-runtime/cli.js +14 -2
- package/dist/src/dbos-runtime/cli.js.map +1 -1
- package/dist/src/dbos-runtime/config.d.ts +3 -0
- package/dist/src/dbos-runtime/config.d.ts.map +1 -1
- package/dist/src/dbos-runtime/config.js +0 -1
- package/dist/src/dbos-runtime/config.js.map +1 -1
- package/dist/src/dbos-runtime/debug.d.ts +4 -0
- package/dist/src/dbos-runtime/debug.d.ts.map +1 -0
- package/dist/src/dbos-runtime/debug.js +23 -0
- package/dist/src/dbos-runtime/debug.js.map +1 -0
- package/dist/src/dbos-runtime/runtime.d.ts +2 -2
- package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
- package/dist/src/dbos-runtime/runtime.js +20 -21
- package/dist/src/dbos-runtime/runtime.js.map +1 -1
- package/dist/src/debugger/debug_workflow.d.ts +8 -8
- package/dist/src/debugger/debug_workflow.d.ts.map +1 -1
- package/dist/src/debugger/debug_workflow.js +107 -36
- package/dist/src/debugger/debug_workflow.js.map +1 -1
- package/dist/src/httpServer/handler.d.ts +1 -1
- package/dist/src/httpServer/handler.d.ts.map +1 -1
- package/dist/src/httpServer/handler.js +14 -14
- package/dist/src/httpServer/handler.js.map +1 -1
- package/dist/src/httpServer/server.d.ts +4 -4
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/httpServer/server.js +17 -17
- package/dist/src/httpServer/server.js.map +1 -1
- package/dist/src/{dbos-runtime → staticAnalysis}/TypeParser.d.ts +4 -0
- package/dist/src/staticAnalysis/TypeParser.d.ts.map +1 -0
- package/dist/src/{dbos-runtime → staticAnalysis}/TypeParser.js +34 -1
- package/dist/src/staticAnalysis/TypeParser.js.map +1 -0
- package/dist/src/{dbos-runtime → staticAnalysis}/openApi.d.ts.map +1 -1
- package/dist/src/{dbos-runtime → staticAnalysis}/openApi.js +1 -31
- package/dist/src/staticAnalysis/openApi.js.map +1 -0
- package/dist/src/staticAnalysis/tsDiagUtil.d.ts.map +1 -0
- package/dist/src/staticAnalysis/tsDiagUtil.js.map +1 -0
- package/dist/src/system_database.d.ts +22 -9
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +44 -42
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/telemetry/collector.d.ts +5 -5
- package/dist/src/telemetry/collector.d.ts.map +1 -1
- package/dist/src/telemetry/collector.js +5 -17
- package/dist/src/telemetry/collector.js.map +1 -1
- package/dist/src/telemetry/exporters.d.ts +11 -24
- package/dist/src/telemetry/exporters.d.ts.map +1 -1
- package/dist/src/telemetry/exporters.js +42 -129
- package/dist/src/telemetry/exporters.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +6 -2
- package/dist/src/telemetry/index.d.ts.map +1 -1
- package/dist/src/telemetry/index.js +16 -0
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/logs.d.ts +35 -11
- package/dist/src/telemetry/logs.d.ts.map +1 -1
- package/dist/src/telemetry/logs.js +158 -53
- package/dist/src/telemetry/logs.js.map +1 -1
- package/dist/src/telemetry/traces.d.ts +1 -6
- package/dist/src/telemetry/traces.d.ts.map +1 -1
- package/dist/src/telemetry/traces.js +2 -34
- package/dist/src/telemetry/traces.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts +1 -1
- package/dist/src/testing/testing_runtime.d.ts.map +1 -1
- package/dist/src/testing/testing_runtime.js +8 -2
- package/dist/src/testing/testing_runtime.js.map +1 -1
- package/dist/src/transaction.d.ts +1 -1
- package/dist/src/transaction.d.ts.map +1 -1
- package/dist/src/workflow.d.ts +16 -1
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +103 -61
- package/dist/src/workflow.js.map +1 -1
- package/examples/hello/README.md +1 -1
- package/examples/hello/dbos-config.yaml +3 -0
- package/package.json +3 -2
- package/dist/src/dbos-runtime/TypeParser.d.ts.map +0 -1
- package/dist/src/dbos-runtime/TypeParser.js.map +0 -1
- package/dist/src/dbos-runtime/openApi.js.map +0 -1
- package/dist/src/dbos-runtime/tsDiagUtil.d.ts.map +0 -1
- package/dist/src/dbos-runtime/tsDiagUtil.js.map +0 -1
- package/dist/src/telemetry/signals.d.ts +0 -20
- package/dist/src/telemetry/signals.d.ts.map +0 -1
- package/dist/src/telemetry/signals.js +0 -11
- package/dist/src/telemetry/signals.js.map +0 -1
- /package/dist/src/{dbos-runtime → staticAnalysis}/openApi.d.ts +0 -0
- /package/dist/src/{dbos-runtime → staticAnalysis}/tsDiagUtil.d.ts +0 -0
- /package/dist/src/{dbos-runtime → staticAnalysis}/tsDiagUtil.js +0 -0
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.WorkflowContextDebug = void 0;
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
5
|
+
const dbos_executor_1 = require("../dbos-executor");
|
4
6
|
const transaction_1 = require("../transaction");
|
5
7
|
const error_1 = require("../error");
|
6
8
|
const serialize_error_1 = require("serialize-error");
|
@@ -12,18 +14,18 @@ const decorators_1 = require("../decorators");
|
|
12
14
|
class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
13
15
|
workflowConfig;
|
14
16
|
functionID = 0;
|
15
|
-
#
|
17
|
+
#dbosExec;
|
16
18
|
isTempWorkflow;
|
17
|
-
constructor(
|
18
|
-
const span =
|
19
|
-
super(workflowName, span,
|
19
|
+
constructor(dbosExec, parentCtx, workflowUUID, workflowConfig, workflowName) {
|
20
|
+
const span = dbosExec.tracer.startSpan(workflowName, { workflowUUID: workflowUUID }, parentCtx?.span);
|
21
|
+
super(workflowName, span, dbosExec.logger, parentCtx);
|
20
22
|
this.workflowConfig = workflowConfig;
|
21
23
|
this.workflowUUID = workflowUUID;
|
22
|
-
this.#
|
23
|
-
this.isTempWorkflow =
|
24
|
-
if (
|
24
|
+
this.#dbosExec = dbosExec;
|
25
|
+
this.isTempWorkflow = dbos_executor_1.DBOSExecutor.tempWorkflowName === workflowName;
|
26
|
+
if (dbosExec.config.application) {
|
25
27
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
26
|
-
this.applicationConfig =
|
28
|
+
this.applicationConfig = dbosExec.config.application;
|
27
29
|
}
|
28
30
|
}
|
29
31
|
functionIDGetIncrement() {
|
@@ -35,11 +37,11 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
35
37
|
for (const op of ops) {
|
36
38
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
37
39
|
proxy[op.name] = op.txnConfig
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
39
|
-
|
40
|
+
? // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
41
|
+
(...args) => this.transaction(op.registeredFunction, ...args)
|
40
42
|
: op.commConfig
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
42
|
-
|
43
|
+
? // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
44
|
+
(...args) => this.external(op.registeredFunction, ...args)
|
43
45
|
: undefined;
|
44
46
|
}
|
45
47
|
return proxy;
|
@@ -47,9 +49,9 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
47
49
|
async checkExecution(client, funcID) {
|
48
50
|
// Note: we read the recorded snapshot and transaction ID!
|
49
51
|
const query = "SELECT output, error, txn_snapshot, txn_id FROM dbos.transaction_outputs WHERE workflow_uuid=$1 AND function_id=$2";
|
50
|
-
const rows = await this.#
|
52
|
+
const rows = await this.#dbosExec.userDatabase.queryWithClient(client, query, this.workflowUUID, funcID);
|
51
53
|
if (rows.length === 0 || rows.length > 1) {
|
52
|
-
this.logger.error("Unexpected! This should never happen during debug. Returned rows: " + rows.toString());
|
54
|
+
this.logger.error("Unexpected! This should never happen during debug. Returned rows: " + rows.toString() + `. WorkflowUUID ${this.workflowUUID}, function ID ${funcID}`);
|
53
55
|
throw new error_1.DBOSDebuggerError(`This should never happen during debug. Returned ${rows.length} rows: ` + rows.toString());
|
54
56
|
}
|
55
57
|
if (JSON.parse(rows[0].error) != null) {
|
@@ -61,8 +63,8 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
61
63
|
txn_id: rows[0].txn_id,
|
62
64
|
};
|
63
65
|
// Send a signal to the debug proxy.
|
64
|
-
// TODO: use the real
|
65
|
-
await this.#
|
66
|
+
// TODO: use the real command once the proxy is fully implemented.
|
67
|
+
await this.#dbosExec.userDatabase.queryWithClient(client, `--proxy:${res.txn_id ?? ''}:${res.txn_snapshot}`);
|
66
68
|
return res;
|
67
69
|
}
|
68
70
|
/**
|
@@ -70,52 +72,121 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
70
72
|
* It connects to a debug proxy and everything should be read-only.
|
71
73
|
*/
|
72
74
|
async transaction(txn, ...args) {
|
73
|
-
const
|
74
|
-
if (
|
75
|
+
const txnInfo = this.#dbosExec.transactionInfoMap.get(txn.name);
|
76
|
+
if (txnInfo === undefined) {
|
75
77
|
throw new error_1.DBOSDebuggerError(`Transaction ${txn.name} not registered!`);
|
76
78
|
}
|
77
79
|
// const readOnly = true; // TODO: eventually, this transaction must be read-only.
|
78
|
-
const
|
79
|
-
const span = this.#
|
80
|
+
const funcID = this.functionIDGetIncrement();
|
81
|
+
const span = this.#dbosExec.tracer.startSpan(txn.name, {}, this.span);
|
80
82
|
let check;
|
81
83
|
const wrappedTransaction = async (client) => {
|
82
84
|
// Original result must exist during replay.
|
83
|
-
const tCtxt = new transaction_1.TransactionContextImpl(this.#
|
84
|
-
check = await this.checkExecution(client,
|
85
|
+
const tCtxt = new transaction_1.TransactionContextImpl(this.#dbosExec.userDatabase.getName(), client, this, span, this.#dbosExec.logger, funcID, txn.name);
|
86
|
+
check = await this.checkExecution(client, funcID);
|
85
87
|
// Execute the user's transaction.
|
86
88
|
const result = await txn(tCtxt, ...args);
|
87
89
|
return result;
|
88
90
|
};
|
89
|
-
const result = await this.#
|
91
|
+
const result = await this.#dbosExec.userDatabase.transaction(wrappedTransaction, txnInfo.config);
|
90
92
|
if (JSON.stringify(check.output) !== JSON.stringify(result)) {
|
91
93
|
this.logger.error(`Detected different transaction output than the original one!\n Expected: ${JSON.stringify(result)}\n Received: ${JSON.stringify(check.output)}`);
|
92
94
|
}
|
93
95
|
return check.output; // Always return the recorded result.
|
94
96
|
}
|
95
|
-
external(commFn, ...
|
96
|
-
|
97
|
+
async external(commFn, ..._args) {
|
98
|
+
const commConfig = this.#dbosExec.communicatorInfoMap.get(commFn.name);
|
99
|
+
if (commConfig === undefined) {
|
100
|
+
throw new error_1.DBOSDebuggerError(`Communicator ${commFn.name} not registered!`);
|
101
|
+
}
|
102
|
+
const funcID = this.functionIDGetIncrement();
|
103
|
+
// Original result must exist during replay.
|
104
|
+
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, funcID);
|
105
|
+
if (check === dbos_executor_1.dbosNull) {
|
106
|
+
throw new error_1.DBOSDebuggerError(`Cannot find recorded communicator output for ${commFn.name}. Shouldn't happen in debug mode!`);
|
107
|
+
}
|
108
|
+
this.logger.debug("Use recorded communicator output.");
|
109
|
+
return check;
|
97
110
|
}
|
98
111
|
// Invoke the debugWorkflow() function instead.
|
99
112
|
async childWorkflow(wf, ...args) {
|
100
113
|
const funcId = this.functionIDGetIncrement();
|
101
114
|
const childUUID = this.workflowUUID + "-" + funcId;
|
102
|
-
return this.#
|
115
|
+
return this.#dbosExec.debugWorkflow(wf, { parentCtx: this, workflowUUID: childUUID }, this.workflowUUID, funcId, ...args);
|
103
116
|
}
|
104
|
-
send(
|
105
|
-
|
117
|
+
async send(_destinationUUID, _message, _topic) {
|
118
|
+
const functionID = this.functionIDGetIncrement();
|
119
|
+
// Original result must exist during replay.
|
120
|
+
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, functionID);
|
121
|
+
if (check === dbos_executor_1.dbosNull) {
|
122
|
+
throw new error_1.DBOSDebuggerError(`Cannot find recorded send. Shouldn't happen in debug mode!`);
|
123
|
+
}
|
124
|
+
this.logger.debug("Use recorded send output.");
|
125
|
+
return;
|
106
126
|
}
|
107
|
-
recv(
|
108
|
-
|
127
|
+
async recv(_topic, _timeoutSeconds) {
|
128
|
+
const functionID = this.functionIDGetIncrement();
|
129
|
+
// Original result must exist during replay.
|
130
|
+
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, functionID);
|
131
|
+
if (check === dbos_executor_1.dbosNull) {
|
132
|
+
throw new error_1.DBOSDebuggerError(`Cannot find recorded recv. Shouldn't happen in debug mode!`);
|
133
|
+
}
|
134
|
+
this.logger.debug("Use recorded recv output.");
|
135
|
+
return check;
|
109
136
|
}
|
110
|
-
setEvent(
|
111
|
-
|
137
|
+
async setEvent(_key, _value) {
|
138
|
+
const functionID = this.functionIDGetIncrement();
|
139
|
+
// Original result must exist during replay.
|
140
|
+
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, functionID);
|
141
|
+
if (check === dbos_executor_1.dbosNull) {
|
142
|
+
throw new error_1.DBOSDebuggerError(`Cannot find recorded setEvent. Shouldn't happen in debug mode!`);
|
143
|
+
}
|
144
|
+
this.logger.debug("Use recorded setEvent output.");
|
112
145
|
}
|
113
|
-
getEvent(
|
114
|
-
|
146
|
+
async getEvent(_workflowUUID, _key, _timeoutSeconds) {
|
147
|
+
const functionID = this.functionIDGetIncrement();
|
148
|
+
// Original result must exist during replay.
|
149
|
+
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, functionID);
|
150
|
+
if (check === dbos_executor_1.dbosNull) {
|
151
|
+
throw new error_1.DBOSDebuggerError(`Cannot find recorded getEvent. Shouldn't happen in debug mode!`);
|
152
|
+
}
|
153
|
+
this.logger.debug("Use recorded getEvent output.");
|
154
|
+
return check;
|
115
155
|
}
|
116
|
-
retrieveWorkflow(
|
117
|
-
|
156
|
+
retrieveWorkflow(targetUUID) {
|
157
|
+
// TODO: write a proper test for this.
|
158
|
+
const functionID = this.functionIDGetIncrement();
|
159
|
+
return new RetrievedHandleDebug(this.#dbosExec.systemDatabase, targetUUID, this.workflowUUID, functionID);
|
118
160
|
}
|
119
161
|
}
|
120
162
|
exports.WorkflowContextDebug = WorkflowContextDebug;
|
163
|
+
/**
|
164
|
+
* The handle returned when retrieving a workflow with Debug workflow's retrieve
|
165
|
+
*/
|
166
|
+
class RetrievedHandleDebug {
|
167
|
+
systemDatabase;
|
168
|
+
workflowUUID;
|
169
|
+
callerUUID;
|
170
|
+
callerFunctionID;
|
171
|
+
constructor(systemDatabase, workflowUUID, callerUUID, callerFunctionID) {
|
172
|
+
this.systemDatabase = systemDatabase;
|
173
|
+
this.workflowUUID = workflowUUID;
|
174
|
+
this.callerUUID = callerUUID;
|
175
|
+
this.callerFunctionID = callerFunctionID;
|
176
|
+
}
|
177
|
+
getWorkflowUUID() {
|
178
|
+
return this.workflowUUID;
|
179
|
+
}
|
180
|
+
async getStatus() {
|
181
|
+
// Must use original result.
|
182
|
+
const check = await this.systemDatabase.checkOperationOutput(this.callerUUID, this.callerFunctionID);
|
183
|
+
if (check === dbos_executor_1.dbosNull) {
|
184
|
+
throw new error_1.DBOSDebuggerError(`Cannot find recorded workflow status. Shouldn't happen in debug mode!`);
|
185
|
+
}
|
186
|
+
return check;
|
187
|
+
}
|
188
|
+
async getResult() {
|
189
|
+
return await this.systemDatabase.getWorkflowResult(this.workflowUUID);
|
190
|
+
}
|
191
|
+
}
|
121
192
|
//# sourceMappingURL=debug_workflow.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"debug_workflow.js","sourceRoot":"","sources":["../../../src/debugger/debug_workflow.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"debug_workflow.js","sourceRoot":"","s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,SAAS,CAAC,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAC5G,CAAC;CACF;AA5KD,oDA4KC;AAED;;GAEG;AACH,MAAM,oBAAoB;IACH;IAAyC;IAA+B;IAA6B;IAA1H,YAAqB,cAA8B,EAAW,YAAoB,EAAW,UAAkB,EAAW,gBAAwB;QAA7H,mBAAc,GAAd,cAAc,CAAgB;QAAW,iBAAY,GAAZ,YAAY,CAAQ;QAAW,eAAU,GAAV,UAAU,CAAQ;QAAW,qBAAgB,GAAhB,gBAAgB,CAAQ;IAAG,CAAC;IAEtJ,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,SAAS;QACb,4BAA4B;QAC5B,MAAM,KAAK,GAAqC,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAwB,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC9J,IAAI,KAAK,KAAK,wBAAQ,EAAE;YACtB,MAAM,IAAI,yBAAiB,CAAC,uEAAuE,CAAC,CAAC;SACtG;QACD,OAAO,KAA8B,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,SAAS;QACb,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAI,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3E,CAAC;CACF"}
|
@@ -21,7 +21,7 @@ export declare class HandlerContextImpl extends DBOSContextImpl implements Handl
|
|
21
21
|
#private;
|
22
22
|
readonly koaContext: Koa.Context;
|
23
23
|
readonly W3CTraceContextPropagator: W3CTraceContextPropagator;
|
24
|
-
constructor(
|
24
|
+
constructor(dbosExec: DBOSExecutor, koaContext: Koa.Context);
|
25
25
|
send<T extends NonNullable<any>>(destinationUUID: string, message: T, topic?: string, idempotencyKey?: string): Promise<void>;
|
26
26
|
getEvent<T extends NonNullable<any>>(workflowUUID: string, key: string, timeoutSeconds?: number): Promise<T | null>;
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EAAE,QAAQ,CAAgB;IACjC,MAAM,EAAE,MAAM,CAAM;IAEpB,IAAI,EAAE,gBAAgB,EAAE,CAAM;gBAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC;CAGrE;AAED,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,SAAS,EAAE,UAAU,CAAsB;gBAG/B,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ;CAGtC;AAMD,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,2EAEtB,MAAM,eACD,MAAM,wLAWtB;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,2EAEvB,MAAM,eACD,MAAM,wLAWtB;AAMD,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,YACjB,MAAM,eAAe,MAAM,GAAG,MAAM,kBAAkB,MAAM,UAMtF"}
|
@@ -20,9 +20,9 @@ function getOrGenerateRequestID(ctx) {
|
|
20
20
|
}
|
21
21
|
class HandlerContextImpl extends context_1.DBOSContextImpl {
|
22
22
|
koaContext;
|
23
|
-
#
|
23
|
+
#dbosExec;
|
24
24
|
W3CTraceContextPropagator;
|
25
|
-
constructor(
|
25
|
+
constructor(dbosExec, koaContext) {
|
26
26
|
// If present, retrieve the trace context from the request
|
27
27
|
const httpTracer = new core_1.W3CTraceContextPropagator();
|
28
28
|
const extractedSpanContext = api_1.trace.getSpanContext(httpTracer.extract(api_1.ROOT_CONTEXT, koaContext.request.headers, api_1.defaultTextMapGetter));
|
@@ -31,13 +31,13 @@ class HandlerContextImpl extends context_1.DBOSContextImpl {
|
|
31
31
|
operationName: koaContext.url,
|
32
32
|
};
|
33
33
|
if (extractedSpanContext === undefined) {
|
34
|
-
span =
|
34
|
+
span = dbosExec.tracer.startSpan(koaContext.url, spanAttributes);
|
35
35
|
}
|
36
36
|
else {
|
37
37
|
extractedSpanContext.isRemote = true;
|
38
|
-
span =
|
38
|
+
span = dbosExec.tracer.startSpanWithContext(extractedSpanContext, koaContext.url, spanAttributes);
|
39
39
|
}
|
40
|
-
super(koaContext.url, span,
|
40
|
+
super(koaContext.url, span, dbosExec.logger);
|
41
41
|
this.koaContext = koaContext;
|
42
42
|
this.W3CTraceContextPropagator = httpTracer;
|
43
43
|
this.request = {
|
@@ -54,23 +54,23 @@ class HandlerContextImpl extends context_1.DBOSContextImpl {
|
|
54
54
|
ip: koaContext.request.ip,
|
55
55
|
requestID: getOrGenerateRequestID(koaContext),
|
56
56
|
};
|
57
|
-
if (
|
57
|
+
if (dbosExec.config.application) {
|
58
58
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
59
|
-
this.applicationConfig =
|
59
|
+
this.applicationConfig = dbosExec.config.application;
|
60
60
|
}
|
61
|
-
this.#
|
61
|
+
this.#dbosExec = dbosExec;
|
62
62
|
}
|
63
63
|
///////////////////////
|
64
64
|
/* PUBLIC INTERFACE */
|
65
65
|
///////////////////////
|
66
66
|
async send(destinationUUID, message, topic, idempotencyKey) {
|
67
|
-
return this.#
|
67
|
+
return this.#dbosExec.send(destinationUUID, message, topic, idempotencyKey);
|
68
68
|
}
|
69
69
|
async getEvent(workflowUUID, key, timeoutSeconds = dbos_executor_1.DBOSExecutor.defaultNotificationTimeoutSec) {
|
70
|
-
return this.#
|
70
|
+
return this.#dbosExec.getEvent(workflowUUID, key, timeoutSeconds);
|
71
71
|
}
|
72
72
|
retrieveWorkflow(workflowUUID) {
|
73
|
-
return this.#
|
73
|
+
return this.#dbosExec.retrieveWorkflow(workflowUUID);
|
74
74
|
}
|
75
75
|
/**
|
76
76
|
* Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
|
@@ -99,13 +99,13 @@ class HandlerContextImpl extends context_1.DBOSContextImpl {
|
|
99
99
|
/* PRIVATE METHODS */
|
100
100
|
/////////////////////
|
101
101
|
async #workflow(wf, params, ...args) {
|
102
|
-
return this.#
|
102
|
+
return this.#dbosExec.workflow(wf, params, ...args);
|
103
103
|
}
|
104
104
|
async #transaction(txn, params, ...args) {
|
105
|
-
return this.#
|
105
|
+
return this.#dbosExec.transaction(txn, params, ...args);
|
106
106
|
}
|
107
107
|
async #external(commFn, params, ...args) {
|
108
|
-
return this.#
|
108
|
+
return this.#dbosExec.external(commFn, params, ...args);
|
109
109
|
}
|
110
110
|
}
|
111
111
|
exports.HandlerContextImpl = HandlerContextImpl;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/httpServer/handler.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,8CAAiL;AACjL,oDAAgD;AAChD,wCAA0D;AAI1D,8CAAgE;AAChE,4CAA+E;AAE/E,+BAAoC;AAmBvB,QAAA,eAAe,GAAG,cAAc,CAAC;AAC9C,SAAS,sBAAsB,CAAC,GAAgB;IAC9C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,uBAAe,CAAC,CAAC;IACvC,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAC;KACd;IACD,MAAM,KAAK,GAAG,IAAA,SAAM,GAAE,CAAC;IACvB,GAAG,CAAC,GAAG,CAAC,uBAAe,EAAE,KAAK,CAAC,CAAC;IAChC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAa,kBAAmB,SAAQ,yBAAe;
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/httpServer/handler.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,8CAAiL;AACjL,oDAAgD;AAChD,wCAA0D;AAI1D,8CAAgE;AAChE,4CAA+E;AAE/E,+BAAoC;AAmBvB,QAAA,eAAe,GAAG,cAAc,CAAC;AAC9C,SAAS,sBAAsB,CAAC,GAAgB;IAC9C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,uBAAe,CAAC,CAAC;IACvC,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAC;KACd;IACD,MAAM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GAAG,CAAC;QACjC,mBAAmB,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC;QAE3C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAdD,wBAcC;AAED,SAAgB,OAAO,CAAC,GAAW;IACjC,SAAS,MAAM,CACb,MAAc,EACd,WAAmB,EACnB,YAA+F;QAE/F,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAA,oCAAuB,EAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QAChG,MAAM,mBAAmB,GAAG,YAAkE,CAAC;QAC/F,mBAAmB,CAAC,MAAM,GAAG,GAAG,CAAC;QACjC,mBAAmB,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC;QAE5C,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAdD,0BAcC;AAED,mCAAmC;AACnC,mCAAmC;AACnC,mCAAmC;AAEnC,SAAgB,SAAS,CAAC,MAAkB;IAC1C,OAAO,UAAU,MAAc,EAAE,WAA4B,EAAE,cAAsB;QACnF,MAAM,kBAAkB,GAAG,IAAA,8CAAiC,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAElF,MAAM,QAAQ,GAAG,kBAAkB,CAAC,cAAc,CAAqB,CAAC;QACxE,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC;IAC9B,CAAC,CAAC;AACJ,CAAC;AAPD,8BAOC"}
|
@@ -5,7 +5,7 @@
|
|
5
5
|
import Koa from 'koa';
|
6
6
|
import Router from '@koa/router';
|
7
7
|
import { DBOSExecutor } from "../dbos-executor";
|
8
|
-
import { Logger } from "
|
8
|
+
import { GlobalLogger as Logger } from "../telemetry/logs";
|
9
9
|
export declare const WorkflowUUIDHeader = "dbos-workflowuuid";
|
10
10
|
export declare const WorkflowRecoveryUrl = "/dbos-workflow-recovery";
|
11
11
|
export declare class DBOSHttpServer {
|
@@ -16,7 +16,7 @@ export declare class DBOSHttpServer {
|
|
16
16
|
/**
|
17
17
|
* Create a Koa app.
|
18
18
|
* @param dbosExec User pass in an DBOS workflow executor instance.
|
19
|
-
* TODO: maybe call
|
19
|
+
* TODO: maybe call dbosExec.init() somewhere in this class?
|
20
20
|
*/
|
21
21
|
constructor(dbosExec: DBOSExecutor, config?: {
|
22
22
|
koa?: Koa;
|
@@ -31,10 +31,10 @@ export declare class DBOSHttpServer {
|
|
31
31
|
* Register workflow recovery endpoint.
|
32
32
|
* Receives a list of executor IDs and returns a list of workflowUUIDs.
|
33
33
|
*/
|
34
|
-
static registerRecoveryEndpoint(
|
34
|
+
static registerRecoveryEndpoint(dbosExec: DBOSExecutor, router: Router): void;
|
35
35
|
/**
|
36
36
|
* Register decorated functions as HTTP endpoints.
|
37
37
|
*/
|
38
|
-
static registerDecoratedEndpoints(
|
38
|
+
static registerDecoratedEndpoints(dbosExec: DBOSExecutor, router: Router): void;
|
39
39
|
}
|
40
40
|
//# sourceMappingURL=server.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/httpServer/server.ts"],"names":[],"mappings":";;;;AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,MAAM,MAAM,aAAa,CAAC;AAkBjC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/httpServer/server.ts"],"names":[],"mappings":";;;;AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,MAAM,MAAM,aAAa,CAAC;AAkBjC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAK3D,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,mBAAmB,4BAA4B,CAAA;AAE5D,qBAAa,cAAc;IAUb,QAAQ,CAAC,QAAQ,EAAE,YAAY;IAT3C,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;;OAIG;gBACkB,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAE;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO;IAuBxF;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM;IAOnB;;;OAGG;IACH,MAAM,CAAC,wBAAwB,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IAmBtE;;OAEG;IACH,MAAM,CAAC,0BAA0B,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;CAwKzE"}
|
@@ -21,7 +21,7 @@ class DBOSHttpServer {
|
|
21
21
|
/**
|
22
22
|
* Create a Koa app.
|
23
23
|
* @param dbosExec User pass in an DBOS workflow executor instance.
|
24
|
-
* TODO: maybe call
|
24
|
+
* TODO: maybe call dbosExec.init() somewhere in this class?
|
25
25
|
*/
|
26
26
|
constructor(dbosExec, config = {}) {
|
27
27
|
this.dbosExec = dbosExec;
|
@@ -57,44 +57,44 @@ class DBOSHttpServer {
|
|
57
57
|
* Register workflow recovery endpoint.
|
58
58
|
* Receives a list of executor IDs and returns a list of workflowUUIDs.
|
59
59
|
*/
|
60
|
-
static registerRecoveryEndpoint(
|
60
|
+
static registerRecoveryEndpoint(dbosExec, router) {
|
61
61
|
// Handler function that parses request for recovery.
|
62
62
|
const recoveryHandler = async (koaCtxt, koaNext) => {
|
63
63
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
64
64
|
const executorIDs = koaCtxt.request.body;
|
65
|
-
|
66
|
-
const recoverHandles = await
|
65
|
+
dbosExec.logger.info("Recovering workflows for executors: " + executorIDs.toString());
|
66
|
+
const recoverHandles = await dbosExec.recoverPendingWorkflows(executorIDs);
|
67
67
|
// Return a list of workflowUUIDs being recovered.
|
68
68
|
koaCtxt.body = await Promise.allSettled(recoverHandles.map((i) => i.getWorkflowUUID())).then((results) => results.filter((i) => i.status === "fulfilled").map((i) => i.value));
|
69
69
|
await koaNext();
|
70
70
|
};
|
71
71
|
router.post(exports.WorkflowRecoveryUrl, recoveryHandler);
|
72
|
-
|
72
|
+
dbosExec.logger.debug(`DBOS Server Registered Recovery POST ${exports.WorkflowRecoveryUrl}`);
|
73
73
|
}
|
74
74
|
/**
|
75
75
|
* Register decorated functions as HTTP endpoints.
|
76
76
|
*/
|
77
|
-
static registerDecoratedEndpoints(
|
77
|
+
static registerDecoratedEndpoints(dbosExec, router) {
|
78
78
|
// Register user declared endpoints, wrap around the endpoint with request parsing and response.
|
79
|
-
|
79
|
+
dbosExec.registeredOperations.forEach((registeredOperation) => {
|
80
80
|
const ro = registeredOperation;
|
81
81
|
if (ro.apiURL) {
|
82
82
|
// Ignore URL with "/dbos-workflow-recovery" prefix.
|
83
83
|
if (ro.apiURL.startsWith(exports.WorkflowRecoveryUrl)) {
|
84
|
-
|
84
|
+
dbosExec.logger.error(`Invalid URL: ${ro.apiURL} -- should not start with ${exports.WorkflowRecoveryUrl}!`);
|
85
85
|
return;
|
86
86
|
}
|
87
87
|
// Check if we need to apply any Koa middleware.
|
88
88
|
const defaults = ro.defaults;
|
89
89
|
if (defaults?.koaMiddlewares) {
|
90
90
|
defaults.koaMiddlewares.forEach((koaMiddleware) => {
|
91
|
-
|
91
|
+
dbosExec.logger.debug(`DBOS Server applying middleware ${koaMiddleware.name} to ${ro.apiURL}`);
|
92
92
|
router.use(ro.apiURL, koaMiddleware);
|
93
93
|
});
|
94
94
|
}
|
95
95
|
// Wrapper function that parses request and send response.
|
96
96
|
const wrappedHandler = async (koaCtxt, koaNext) => {
|
97
|
-
const oc = new handler_1.HandlerContextImpl(
|
97
|
+
const oc = new handler_1.HandlerContextImpl(dbosExec, koaCtxt);
|
98
98
|
try {
|
99
99
|
// Check for auth first
|
100
100
|
if (defaults?.authMiddleware) {
|
@@ -108,7 +108,7 @@ class DBOSHttpServer {
|
|
108
108
|
return oc.getConfig(key, def);
|
109
109
|
},
|
110
110
|
query: (query, ...args) => {
|
111
|
-
return
|
111
|
+
return dbosExec.userDatabase.queryFunction(query, ...args);
|
112
112
|
},
|
113
113
|
});
|
114
114
|
if (res) {
|
@@ -158,13 +158,13 @@ class DBOSHttpServer {
|
|
158
158
|
// - Otherwise, we return 500.
|
159
159
|
const wfParams = { parentCtx: oc, workflowUUID: headerWorkflowUUID };
|
160
160
|
if (ro.txnConfig) {
|
161
|
-
koaCtxt.body = await
|
161
|
+
koaCtxt.body = await dbosExec.transaction(ro.registeredFunction, wfParams, ...args);
|
162
162
|
}
|
163
163
|
else if (ro.workflowConfig) {
|
164
|
-
koaCtxt.body = await (await
|
164
|
+
koaCtxt.body = await (await dbosExec.workflow(ro.registeredFunction, wfParams, ...args)).getResult();
|
165
165
|
}
|
166
166
|
else if (ro.commConfig) {
|
167
|
-
koaCtxt.body = await
|
167
|
+
koaCtxt.body = await dbosExec.external(ro.registeredFunction, wfParams, ...args);
|
168
168
|
}
|
169
169
|
else {
|
170
170
|
// Directly invoke the handler code.
|
@@ -210,7 +210,7 @@ class DBOSHttpServer {
|
|
210
210
|
carrier.context.set(key, value);
|
211
211
|
},
|
212
212
|
});
|
213
|
-
|
213
|
+
dbosExec.tracer.endSpan(oc.span);
|
214
214
|
// Add requestID to response headers.
|
215
215
|
koaCtxt.set(handler_1.RequestIDHeader, oc.request.requestID);
|
216
216
|
await koaNext();
|
@@ -219,11 +219,11 @@ class DBOSHttpServer {
|
|
219
219
|
// Actually register the endpoint.
|
220
220
|
if (ro.apiType === handler_1.APITypes.GET) {
|
221
221
|
router.get(ro.apiURL, wrappedHandler);
|
222
|
-
|
222
|
+
dbosExec.logger.debug(`DBOS Server Registered GET ${ro.apiURL}`);
|
223
223
|
}
|
224
224
|
else if (ro.apiType === handler_1.APITypes.POST) {
|
225
225
|
router.post(ro.apiURL, wrappedHandler);
|
226
|
-
|
226
|
+
dbosExec.logger.debug(`DBOS Server Registered POST ${ro.apiURL}`);
|
227
227
|
}
|
228
228
|
}
|
229
229
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/httpServer/server.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AACtB,yDAAiC;AACjC,gDAA6C;AAC7C,qDAA6B;AAC7B,uCAMmB;AAGnB,oCAKkB;AAIlB,4CAAyE;AAG5D,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AACzC,QAAA,mBAAmB,GAAG,yBAAyB,CAAA;AAE5D,MAAa,cAAc;IAUJ;IATZ,GAAG,CAAM;IACT,MAAM,CAAS;IACf,MAAM,CAAS;IAExB;;;;OAIG;IACH,YAAqB,QAAsB,EAAE,SAAyC,EAAE;QAAnE,aAAQ,GAAR,QAAQ,CAAc;QACzC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAClB,MAAM,CAAC,MAAM,GAAG,IAAI,gBAAM,EAAE,CAAC;SAC9B;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAE9B,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;YACf,MAAM,CAAC,GAAG,GAAG,IAAI,aAAG,EAAE,CAAC;YAEvB,uCAAuC;YACvC,2FAA2F;YAC3F,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAA,uBAAU,GAAE,CAAC,CAAC;YAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;SACxB;QACD,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QAEtB,2BAA2B;QAC3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31
31
|
parse(): readonly ClassInfo[] | undefined;
|
32
32
|
}
|
33
|
+
export declare function findPackageInfo(entrypoints: string[]): Promise<{
|
34
|
+
name: string;
|
35
|
+
version: string;
|
36
|
+
}>;
|
33
37
|
//# sourceMappingURL=TypeParser.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TypeParser.d.ts","sourceRoot":"","sources":["../../../src/staticAnalysis/TypeParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAK5B,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC;IACnB,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC;IAC1B,IAAI,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC;IAC/B,IAAI,CAAC,E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