@dbos-inc/dbos-sdk 1.12.13-preview.g7a8a447e44 → 1.13.2-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/schemas/system_db_schema.d.ts +2 -0
- package/dist/schemas/system_db_schema.d.ts.map +1 -1
- package/dist/src/communicator.d.ts +1 -1
- package/dist/src/communicator.d.ts.map +1 -1
- package/dist/src/communicator.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +27 -11
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +139 -46
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/debugger/debug_workflow.d.ts +14 -5
- package/dist/src/debugger/debug_workflow.d.ts.map +1 -1
- package/dist/src/debugger/debug_workflow.js +74 -18
- package/dist/src/debugger/debug_workflow.js.map +1 -1
- package/dist/src/decorators.d.ts +19 -2
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.js +104 -27
- package/dist/src/decorators.js.map +1 -1
- package/dist/src/httpServer/handler.d.ts +22 -15
- package/dist/src/httpServer/handler.d.ts.map +1 -1
- package/dist/src/httpServer/handler.js +44 -35
- package/dist/src/httpServer/handler.js.map +1 -1
- package/dist/src/httpServer/handlerTypes.d.ts +4 -1
- package/dist/src/httpServer/handlerTypes.d.ts.map +1 -1
- package/dist/src/httpServer/handlerTypes.js +3 -0
- package/dist/src/httpServer/handlerTypes.js.map +1 -1
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/httpServer/server.js +34 -10
- package/dist/src/httpServer/server.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/kafka/kafka.d.ts +2 -3
- package/dist/src/kafka/kafka.d.ts.map +1 -1
- package/dist/src/kafka/kafka.js +2 -13
- package/dist/src/kafka/kafka.js.map +1 -1
- package/dist/src/scheduler/scheduler.d.ts +4 -8
- package/dist/src/scheduler/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler/scheduler.js +2 -9
- package/dist/src/scheduler/scheduler.js.map +1 -1
- package/dist/src/system_database.d.ts +2 -0
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +61 -4
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts +9 -5
- package/dist/src/testing/testing_runtime.d.ts.map +1 -1
- package/dist/src/testing/testing_runtime.js +24 -12
- 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/utils.d.ts +1 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +5 -1
- package/dist/src/utils.js.map +1 -1
- package/dist/src/workflow.d.ts +46 -10
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +72 -20
- package/dist/src/workflow.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/migrations/20240517000000_status_class_config.js +18 -0
- package/package.json +2 -2
@@ -3,7 +3,9 @@ import { Transaction } from "../transaction";
|
|
3
3
|
import { Communicator } from "../communicator";
|
4
4
|
import { UserDatabaseClient } from "../user_database";
|
5
5
|
import { DBOSContextImpl } from "../context";
|
6
|
-
import {
|
6
|
+
import { ConfiguredInstance } from "../decorators";
|
7
|
+
import { WFInvokeFuncs, WfInvokeWfs, WfInvokeWfsAsync, Workflow, WorkflowConfig, WorkflowContext, WorkflowHandle } from "../workflow";
|
8
|
+
import { InvokeFuncsInst } from "../httpServer/handler";
|
7
9
|
interface RecordedResult<R> {
|
8
10
|
output: R;
|
9
11
|
txn_snapshot: string;
|
@@ -19,16 +21,23 @@ export declare class WorkflowContextDebug extends DBOSContextImpl implements Wor
|
|
19
21
|
readonly isTempWorkflow: boolean;
|
20
22
|
constructor(dbosExec: DBOSExecutor, parentCtx: DBOSContextImpl | undefined, workflowUUID: string, workflowConfig: WorkflowConfig, workflowName: string);
|
21
23
|
functionIDGetIncrement(): number;
|
22
|
-
invoke<T extends object>(object: T): WFInvokeFuncs<T>;
|
24
|
+
invoke<T extends object>(object: T | ConfiguredInstance): WFInvokeFuncs<T> | InvokeFuncsInst<T>;
|
23
25
|
checkExecution<R>(client: UserDatabaseClient, funcID: number): Promise<RecordedResult<R> | Error>;
|
24
26
|
/**
|
25
27
|
* Execute a transactional function in debug mode.
|
26
28
|
* If a debug proxy is provided, it connects to a debug proxy and everything should be read-only.
|
27
29
|
*/
|
28
|
-
transaction<T extends
|
29
|
-
external<T extends
|
30
|
+
transaction<T extends unknown[], R>(txn: Transaction<T, R>, clsinst: ConfiguredInstance | null, ...args: T): Promise<R>;
|
31
|
+
external<T extends unknown[], R>(commFn: Communicator<T, R>, _clsinst: ConfiguredInstance | null, ..._args: T): Promise<R>;
|
30
32
|
startChildWorkflow<T extends any[], R>(wf: Workflow<T, R>, ...args: T): Promise<WorkflowHandle<R>>;
|
31
|
-
invokeChildWorkflow<T extends
|
33
|
+
invokeChildWorkflow<T extends unknown[], R>(wf: Workflow<T, R>, ...args: T): Promise<R>;
|
34
|
+
/**
|
35
|
+
* Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
|
36
|
+
* to use WorkflowContext.Transaction(OpClass.someMethod, param);
|
37
|
+
*/
|
38
|
+
proxyInvokeWF<T extends object>(object: T, workflowUUID: string | undefined, asyncWf: boolean, configuredInstance: ConfiguredInstance | null): WfInvokeWfsAsync<T>;
|
39
|
+
startWorkflow<T extends object>(target: T, workflowUUID?: string): WfInvokeWfsAsync<T>;
|
40
|
+
invokeWorkflow<T extends object>(target: T, workflowUUID?: string): WfInvokeWfs<T>;
|
32
41
|
childWorkflow<T extends any[], R>(wf: Workflow<T, R>, ...args: T): Promise<WorkflowHandle<R>>;
|
33
42
|
send<T>(_destinationUUID: string, _message: T, _topic?: string | undefined): Promise<void>;
|
34
43
|
recv<T>(_topic?: string | undefined, _timeoutSeconds?: number | undefined): Promise<T | null>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"debug_workflow.d.ts","sourceRoot":"","sources":["../../../src/debugger/debug_workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAE,WAAW,EAA0B,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"debug_workflow.d.ts","sourceRoot":"","sources":["../../../src/debugger/debug_workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAE,WAAW,EAA0B,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAA2B,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AACtJ,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,UAAU,cAAc,CAAC,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC;IACV,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,eAAgB,YAAW,eAAe;;IAKgB,QAAQ,CAAC,cAAc,EAAE,cAAc;IAJzI,UAAU,EAAE,MAAM,CAAK;IAEvB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;gBAErB,QAAQ,EA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U,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC;IAMpD,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtC"}
|
@@ -35,19 +35,35 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
35
35
|
return this.functionID++;
|
36
36
|
}
|
37
37
|
invoke(object) {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
38
|
+
if (typeof object === 'function') {
|
39
|
+
const ops = (0, decorators_1.getRegisteredOperations)(object);
|
40
|
+
const proxy = {};
|
41
|
+
for (const op of ops) {
|
42
|
+
proxy[op.name] = op.txnConfig
|
43
|
+
?
|
44
|
+
(...args) => this.transaction(op.registeredFunction, null, ...args)
|
45
|
+
: op.commConfig
|
46
|
+
?
|
47
|
+
(...args) => this.external(op.registeredFunction, null, ...args)
|
48
|
+
: undefined;
|
49
|
+
}
|
50
|
+
return proxy;
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
const targetInst = object;
|
54
|
+
const ops = (0, decorators_1.getRegisteredOperations)(targetInst);
|
55
|
+
const proxy = {};
|
56
|
+
for (const op of ops) {
|
57
|
+
proxy[op.name] = op.txnConfig
|
58
|
+
?
|
59
|
+
(...args) => this.transaction(op.registeredFunction, targetInst, ...args)
|
60
|
+
: op.commConfig
|
61
|
+
?
|
62
|
+
(...args) => this.external(op.registeredFunction, targetInst, ...args)
|
63
|
+
: undefined;
|
64
|
+
}
|
65
|
+
return proxy;
|
49
66
|
}
|
50
|
-
return proxy;
|
51
67
|
}
|
52
68
|
async checkExecution(client, funcID) {
|
53
69
|
// Note: we read the recorded snapshot and transaction ID!
|
@@ -75,8 +91,8 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
75
91
|
* Execute a transactional function in debug mode.
|
76
92
|
* If a debug proxy is provided, it connects to a debug proxy and everything should be read-only.
|
77
93
|
*/
|
78
|
-
async transaction(txn, ...args) {
|
79
|
-
const txnInfo = this.#dbosExec.
|
94
|
+
async transaction(txn, clsinst, ...args) {
|
95
|
+
const txnInfo = this.#dbosExec.getTransactionInfo(txn);
|
80
96
|
if (txnInfo === undefined) {
|
81
97
|
throw new error_1.DBOSDebuggerError(`Transaction ${txn.name} not registered!`);
|
82
98
|
}
|
@@ -109,7 +125,7 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
109
125
|
return check.output;
|
110
126
|
}
|
111
127
|
// If we have a proxy, then execute the user's transaction.
|
112
|
-
const result = await txn(tCtxt, ...args);
|
128
|
+
const result = await txn.call(clsinst, tCtxt, ...args);
|
113
129
|
return result;
|
114
130
|
};
|
115
131
|
let result;
|
@@ -133,8 +149,8 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
133
149
|
}
|
134
150
|
return check.output; // Always return the recorded result.
|
135
151
|
}
|
136
|
-
async external(commFn, ..._args) {
|
137
|
-
const commConfig = this.#dbosExec.
|
152
|
+
async external(commFn, _clsinst, ..._args) {
|
153
|
+
const commConfig = this.#dbosExec.getCommunicatorInfo(commFn);
|
138
154
|
if (commConfig === undefined) {
|
139
155
|
throw new error_1.DBOSDebuggerError(`Communicator ${commFn.name} not registered!`);
|
140
156
|
}
|
@@ -157,7 +173,47 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
157
173
|
async invokeChildWorkflow(wf, ...args) {
|
158
174
|
return this.startChildWorkflow(wf, ...args).then((handle) => handle.getResult());
|
159
175
|
}
|
160
|
-
|
176
|
+
/**
|
177
|
+
* Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
|
178
|
+
* to use WorkflowContext.Transaction(OpClass.someMethod, param);
|
179
|
+
*/
|
180
|
+
proxyInvokeWF(object, workflowUUID, asyncWf, configuredInstance) {
|
181
|
+
const ops = (0, decorators_1.getRegisteredOperations)(object);
|
182
|
+
const proxy = {};
|
183
|
+
const funcId = this.functionIDGetIncrement();
|
184
|
+
const childUUID = workflowUUID || (this.workflowUUID + "-" + funcId);
|
185
|
+
const params = { workflowUUID: childUUID, parentCtx: this, configuredInstance };
|
186
|
+
for (const op of ops) {
|
187
|
+
if (asyncWf) {
|
188
|
+
proxy[op.name] = op.workflowConfig
|
189
|
+
? (...args) => this.#dbosExec.debugWorkflow(op.registeredFunction, params, this.workflowUUID, funcId, ...args)
|
190
|
+
: undefined;
|
191
|
+
}
|
192
|
+
else {
|
193
|
+
proxy[op.name] = op.workflowConfig
|
194
|
+
? (...args) => this.#dbosExec.debugWorkflow(op.registeredFunction, params, this.workflowUUID, funcId, ...args)
|
195
|
+
.then((handle) => handle.getResult())
|
196
|
+
: undefined;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
return proxy;
|
200
|
+
}
|
201
|
+
startWorkflow(target, workflowUUID) {
|
202
|
+
if (typeof target === 'function') {
|
203
|
+
return this.proxyInvokeWF(target, workflowUUID, true, null);
|
204
|
+
}
|
205
|
+
else {
|
206
|
+
return this.proxyInvokeWF(target, workflowUUID, true, target);
|
207
|
+
}
|
208
|
+
}
|
209
|
+
invokeWorkflow(target, workflowUUID) {
|
210
|
+
if (typeof target === 'function') {
|
211
|
+
return this.proxyInvokeWF(target, workflowUUID, false, null);
|
212
|
+
}
|
213
|
+
else {
|
214
|
+
return this.proxyInvokeWF(target, workflowUUID, false, target);
|
215
|
+
}
|
216
|
+
}
|
161
217
|
async childWorkflow(wf, ...args) {
|
162
218
|
return this.startChildWorkflow(wf, ...args);
|
163
219
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"debug_workflow.js","sourceRoot":"","sources":["../../../src/debugger/debug_workflow.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,oDAAmF;AAEnF,gDAAqE;AAErE,oCAA6C;AAC7C,qDAAmD;AAInD,wCAA6C;AAC7C,8CAAwD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C,sBAAsB,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,CAAS;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,GAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF;AArTD,oDAqTC;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;IAAI,CAAC;IAEvJ,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,CAAC;YACvB,MAAM,IAAI,yBAAiB,CAAC,uEAAuE,CAAC,CAAC;QACvG,CAAC;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"}
|
package/dist/src/decorators.d.ts
CHANGED
@@ -47,22 +47,26 @@ export interface RegistrationDefaults {
|
|
47
47
|
}
|
48
48
|
export interface MethodRegistrationBase {
|
49
49
|
name: string;
|
50
|
+
className: string;
|
50
51
|
args: MethodParameter[];
|
51
52
|
defaults?: RegistrationDefaults;
|
52
53
|
getRequiredRoles(): string[];
|
53
54
|
workflowConfig?: WorkflowConfig;
|
54
55
|
txnConfig?: TransactionConfig;
|
55
56
|
commConfig?: CommunicatorConfig;
|
57
|
+
isInstance: boolean;
|
56
58
|
registeredFunction: Function | undefined;
|
57
59
|
invoke(pthis: unknown, args: unknown[]): unknown;
|
58
60
|
}
|
59
61
|
export declare class MethodRegistration<This, Args extends unknown[], Return> implements MethodRegistrationBase {
|
60
62
|
defaults?: RegistrationDefaults | undefined;
|
61
63
|
name: string;
|
64
|
+
className: string;
|
62
65
|
requiredRole: string[] | undefined;
|
63
66
|
args: MethodParameter[];
|
64
|
-
constructor(origFunc: (this: This, ...args: Args) => Promise<Return
|
67
|
+
constructor(origFunc: (this: This, ...args: Args) => Promise<Return>, isInstance: boolean);
|
65
68
|
needInitialized: boolean;
|
69
|
+
isInstance: boolean;
|
66
70
|
origFunction: (this: This, ...args: Args) => Promise<Return>;
|
67
71
|
registeredFunction: ((this: This, ...args: Args) => Promise<Return>) | undefined;
|
68
72
|
workflowConfig?: WorkflowConfig;
|
@@ -72,6 +76,11 @@ export declare class MethodRegistration<This, Args extends unknown[], Return> im
|
|
72
76
|
invoke(pthis: This, args: Args): Promise<Return>;
|
73
77
|
getRequiredRoles(): string[];
|
74
78
|
}
|
79
|
+
export declare abstract class ConfiguredInstance {
|
80
|
+
readonly name: string;
|
81
|
+
constructor(name: string);
|
82
|
+
abstract initialize(ctx: InitContext): Promise<void>;
|
83
|
+
}
|
75
84
|
export declare class ClassRegistration<CT extends {
|
76
85
|
new (...args: unknown[]): object;
|
77
86
|
}> implements RegistrationDefaults {
|
@@ -80,18 +89,24 @@ export declare class ClassRegistration<CT extends {
|
|
80
89
|
defaultArgRequired: ArgRequiredOptions;
|
81
90
|
needsInitialized: boolean;
|
82
91
|
ormEntities: Function[];
|
92
|
+
registeredOperations: Map<string, MethodRegistrationBase>;
|
93
|
+
configuredInstances: Map<string, ConfiguredInstance>;
|
83
94
|
ctor: CT;
|
84
95
|
constructor(ctor: CT);
|
85
96
|
}
|
97
|
+
export declare function getRegisteredMethodClassName(func: unknown): string;
|
98
|
+
export declare function getRegisteredMethodName(func: unknown): string;
|
86
99
|
export declare function getRegisteredOperations(target: object): ReadonlyArray<MethodRegistrationBase>;
|
100
|
+
export declare function getConfiguredInstance(clsname: string, cfgname: string): ConfiguredInstance | null;
|
87
101
|
export declare function getOrCreateMethodArgsRegistration(target: object, propertyKey: string | symbol): MethodParameter[];
|
88
102
|
export declare function registerAndWrapFunction<This, Args extends unknown[], Return>(target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(this: This, ...args: Args) => Promise<Return>>): {
|
89
103
|
descriptor: TypedPropertyDescriptor<(this: This, ...args: Args) => Promise<Return>>;
|
90
104
|
registration: MethodRegistration<This, Args, Return>;
|
91
105
|
};
|
106
|
+
type AnyConstructor = new (...args: unknown[]) => object;
|
92
107
|
export declare function getOrCreateClassRegistration<CT extends {
|
93
108
|
new (...args: unknown[]): object;
|
94
|
-
}>(ctor: CT): ClassRegistration<
|
109
|
+
}>(ctor: CT): ClassRegistration<AnyConstructor>;
|
95
110
|
export declare function ArgRequired(target: object, propertyKey: string | symbol, parameterIndex: number): void;
|
96
111
|
export declare function ArgOptional(target: object, propertyKey: string | symbol, parameterIndex: number): void;
|
97
112
|
export declare function SkipLogging(target: object, propertyKey: string | symbol, parameterIndex: number): void;
|
@@ -106,6 +121,7 @@ export declare function DefaultArgRequired<T extends {
|
|
106
121
|
export declare function DefaultArgOptional<T extends {
|
107
122
|
new (...args: unknown[]): object;
|
108
123
|
}>(ctor: T): void;
|
124
|
+
export declare function configureInstance<R extends ConfiguredInstance, T extends unknown[]>(cls: new (name: string, ...args: T) => R, name: string, ...args: T): R;
|
109
125
|
export declare function RequiredRole(anyOf: string[]): <This, Ctx extends DBOSContext, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: Ctx, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: Ctx, ...args: Args) => Promise<Return>>;
|
110
126
|
export declare function Workflow(config?: WorkflowConfig): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: WorkflowContext, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: WorkflowContext, ...args: Args) => Promise<Return>>;
|
111
127
|
export declare function Transaction(config?: TransactionConfig): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: TransactionContext<any>, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: TransactionContext<any>, ...args: Args) => Promise<Return>>;
|
@@ -113,4 +129,5 @@ export declare function Communicator(config?: CommunicatorConfig): <This, Args e
|
|
113
129
|
export declare function OrmEntities(entities: Function[]): <T extends new (...args: unknown[]) => object>(ctor: T) => void;
|
114
130
|
export declare function DBOSInitializer(): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: InitContext, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: InitContext, ...args: Args) => Promise<Return>>;
|
115
131
|
export declare function DBOSDeploy(): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: InitContext, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: InitContext, ...args: Args) => Promise<Return>>;
|
132
|
+
export {};
|
116
133
|
//# sourceMappingURL=decorators.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAmB,WAAW,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,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AgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,4BAEJ,OAAO,EAAE,KAAI,MAAM,QAAU,CAAC,UAMzE;AAED,wBAAgB,eAAe,mDAEnB,MAAM,eACD,MAAM,gBACL,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,QAAQ,MAAM,CAAC,CAAC,+FAO1G;AAGD,wBAAgB,UAAU,mDAEd,MAAM,eACD,MAAM,gBACL,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,QAAQ,MAAM,CAAC,CAAC,+FAO1G"}
|
package/dist/src/decorators.js
CHANGED
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.DBOSDeploy = exports.DBOSInitializer = exports.OrmEntities = exports.Communicator = exports.Transaction = exports.Workflow = exports.RequiredRole = exports.DefaultArgOptional = exports.DefaultArgRequired = exports.DefaultRequiredRole = exports.ArgVarchar = exports.ArgDate = exports.ArgName = exports.LogMask = exports.SkipLogging = exports.ArgOptional = exports.ArgRequired = exports.getOrCreateClassRegistration = exports.registerAndWrapFunction = exports.getOrCreateMethodArgsRegistration = exports.getRegisteredOperations = exports.ClassRegistration = exports.MethodRegistration = exports.MethodParameter = exports.ArgRequiredOptions = exports.LogMasks = exports.DBOSDataType = void 0;
|
26
|
+
exports.DBOSDeploy = exports.DBOSInitializer = exports.OrmEntities = exports.Communicator = exports.Transaction = exports.Workflow = exports.RequiredRole = exports.configureInstance = exports.DefaultArgOptional = exports.DefaultArgRequired = exports.DefaultRequiredRole = exports.ArgVarchar = exports.ArgDate = exports.ArgName = exports.LogMask = exports.SkipLogging = exports.ArgOptional = exports.ArgRequired = exports.getOrCreateClassRegistration = exports.registerAndWrapFunction = exports.getOrCreateMethodArgsRegistration = exports.getConfiguredInstance = exports.getRegisteredOperations = exports.getRegisteredMethodName = exports.getRegisteredMethodClassName = exports.ClassRegistration = exports.ConfiguredInstance = exports.MethodRegistration = exports.MethodParameter = exports.ArgRequiredOptions = exports.LogMasks = exports.DBOSDataType = void 0;
|
27
27
|
require("reflect-metadata");
|
28
28
|
const crypto = __importStar(require("crypto"));
|
29
29
|
const error_1 = require("./error");
|
@@ -87,8 +87,6 @@ class DBOSDataType {
|
|
87
87
|
}
|
88
88
|
exports.DBOSDataType = DBOSDataType;
|
89
89
|
const paramMetadataKey = Symbol.for("dbos:parameter");
|
90
|
-
const methodMetadataKey = Symbol.for("dbos:method");
|
91
|
-
const classMetadataKey = Symbol.for("dbos:class");
|
92
90
|
/* Arguments parsing heuristic:
|
93
91
|
* - Convert the function to a string
|
94
92
|
* - Minify the function
|
@@ -135,12 +133,15 @@ exports.MethodParameter = MethodParameter;
|
|
135
133
|
class MethodRegistration {
|
136
134
|
defaults;
|
137
135
|
name = "";
|
136
|
+
className = "";
|
138
137
|
requiredRole = undefined;
|
139
138
|
args = [];
|
140
|
-
constructor(origFunc) {
|
139
|
+
constructor(origFunc, isInstance) {
|
141
140
|
this.origFunction = origFunc;
|
141
|
+
this.isInstance = isInstance;
|
142
142
|
}
|
143
143
|
needInitialized = true;
|
144
|
+
isInstance;
|
144
145
|
origFunction;
|
145
146
|
registeredFunction;
|
146
147
|
workflowConfig;
|
@@ -158,6 +159,13 @@ class MethodRegistration {
|
|
158
159
|
}
|
159
160
|
}
|
160
161
|
exports.MethodRegistration = MethodRegistration;
|
162
|
+
class ConfiguredInstance {
|
163
|
+
name;
|
164
|
+
constructor(name) {
|
165
|
+
this.name = name;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
exports.ConfiguredInstance = ConfiguredInstance;
|
161
169
|
class ClassRegistration {
|
162
170
|
name = "";
|
163
171
|
requiredRole;
|
@@ -165,36 +173,75 @@ class ClassRegistration {
|
|
165
173
|
needsInitialized = true;
|
166
174
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
167
175
|
ormEntities = [];
|
176
|
+
registeredOperations = new Map();
|
177
|
+
configuredInstances = new Map();
|
168
178
|
ctor;
|
169
179
|
constructor(ctor) {
|
170
180
|
this.ctor = ctor;
|
171
181
|
}
|
172
182
|
}
|
173
183
|
exports.ClassRegistration = ClassRegistration;
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
184
|
+
// This is a bit ugly, if we got the class / instance it would help avoid this auxiliary structure
|
185
|
+
const methodToRegistration = new Map();
|
186
|
+
function getRegisteredMethodClassName(func) {
|
187
|
+
let rv = "";
|
188
|
+
if (methodToRegistration.has(func)) {
|
189
|
+
rv = methodToRegistration.get(func).className;
|
190
|
+
}
|
191
|
+
return rv;
|
192
|
+
}
|
193
|
+
exports.getRegisteredMethodClassName = getRegisteredMethodClassName;
|
194
|
+
function getRegisteredMethodName(func) {
|
195
|
+
let rv = "";
|
196
|
+
if (methodToRegistration.has(func)) {
|
197
|
+
rv = methodToRegistration.get(func).name;
|
198
|
+
}
|
199
|
+
return rv;
|
200
|
+
}
|
201
|
+
exports.getRegisteredMethodName = getRegisteredMethodName;
|
180
202
|
function getRegisteredOperations(target) {
|
181
203
|
const registeredOperations = [];
|
182
|
-
|
183
|
-
const
|
184
|
-
|
185
|
-
|
204
|
+
if (typeof target === 'function') { // Constructor case
|
205
|
+
const classReg = classesByName.get(target.name);
|
206
|
+
classReg?.registeredOperations?.forEach((m) => registeredOperations.push(m));
|
207
|
+
}
|
208
|
+
else {
|
209
|
+
let current = target;
|
210
|
+
while (current) {
|
211
|
+
const cname = current.constructor.name;
|
212
|
+
if (classesByName.has(cname)) {
|
213
|
+
registeredOperations.push(...getRegisteredOperations(current.constructor));
|
214
|
+
}
|
215
|
+
current = Object.getPrototypeOf(current);
|
186
216
|
}
|
187
217
|
}
|
188
218
|
return registeredOperations;
|
189
219
|
}
|
190
220
|
exports.getRegisteredOperations = getRegisteredOperations;
|
221
|
+
function getConfiguredInstance(clsname, cfgname) {
|
222
|
+
const classReg = classesByName.get(clsname);
|
223
|
+
if (!classReg)
|
224
|
+
return null;
|
225
|
+
return classReg.configuredInstances.get(cfgname) ?? null;
|
226
|
+
}
|
227
|
+
exports.getConfiguredInstance = getConfiguredInstance;
|
228
|
+
////////////////////////////////////////////////////////////////////////////////
|
229
|
+
// DECORATOR REGISTRATION
|
230
|
+
// These manage registration objects, creating them at decorator evaluation time
|
231
|
+
// and making wrapped methods available for function registration at runtime
|
232
|
+
// initialization time.
|
233
|
+
////////////////////////////////////////////////////////////////////////////////
|
191
234
|
function getOrCreateMethodArgsRegistration(target, propertyKey) {
|
192
|
-
let
|
235
|
+
let regtarget = target;
|
236
|
+
if (typeof regtarget !== 'function') {
|
237
|
+
regtarget = regtarget.constructor;
|
238
|
+
}
|
239
|
+
let mParameters = Reflect.getOwnMetadata(paramMetadataKey, regtarget, propertyKey) || [];
|
193
240
|
if (!mParameters.length) {
|
194
241
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
195
242
|
const designParamTypes = Reflect.getMetadata("design:paramtypes", target, propertyKey);
|
196
243
|
mParameters = designParamTypes.map((value, index) => new MethodParameter(index, value));
|
197
|
-
Reflect.defineMetadata(paramMetadataKey, mParameters,
|
244
|
+
Reflect.defineMetadata(paramMetadataKey, mParameters, regtarget, propertyKey);
|
198
245
|
}
|
199
246
|
return mParameters;
|
200
247
|
}
|
@@ -205,9 +252,28 @@ function generateSaltedHash(data, salt) {
|
|
205
252
|
return hash.digest("hex");
|
206
253
|
}
|
207
254
|
function getOrCreateMethodRegistration(target, propertyKey, descriptor) {
|
208
|
-
|
255
|
+
let regtarget;
|
256
|
+
let isInstance = false;
|
257
|
+
if (typeof target === 'function') {
|
258
|
+
// Static method case
|
259
|
+
regtarget = target;
|
260
|
+
}
|
261
|
+
else {
|
262
|
+
// Instance method case
|
263
|
+
regtarget = target.constructor;
|
264
|
+
isInstance = true;
|
265
|
+
}
|
266
|
+
const classReg = getOrCreateClassRegistration(regtarget);
|
267
|
+
const fname = propertyKey.toString();
|
268
|
+
if (!classReg.registeredOperations.has(fname)) {
|
269
|
+
classReg.registeredOperations.set(fname, new MethodRegistration(descriptor.value, isInstance));
|
270
|
+
}
|
271
|
+
const methReg = classReg.registeredOperations.get(fname);
|
209
272
|
if (methReg.needInitialized) {
|
210
|
-
methReg.
|
273
|
+
methReg.needInitialized = false;
|
274
|
+
methReg.name = fname;
|
275
|
+
methReg.className = classReg.name;
|
276
|
+
methReg.defaults = classReg;
|
211
277
|
methReg.args = getOrCreateMethodArgsRegistration(target, propertyKey);
|
212
278
|
const argNames = getArgNames(descriptor.value);
|
213
279
|
methReg.args.forEach((e) => {
|
@@ -221,7 +287,6 @@ function getOrCreateMethodRegistration(target, propertyKey, descriptor) {
|
|
221
287
|
// TODO else warn/log something
|
222
288
|
}
|
223
289
|
});
|
224
|
-
Reflect.defineMetadata(methodMetadataKey, methReg, target, propertyKey);
|
225
290
|
const wrappedMethod = async function (...rawArgs) {
|
226
291
|
let opCtx = undefined;
|
227
292
|
// Validate the user authentication and populate the role field
|
@@ -281,7 +346,8 @@ function getOrCreateMethodRegistration(target, propertyKey, descriptor) {
|
|
281
346
|
});
|
282
347
|
descriptor.value = wrappedMethod;
|
283
348
|
methReg.registeredFunction = wrappedMethod;
|
284
|
-
methReg.
|
349
|
+
methodToRegistration.set(methReg.registeredFunction, methReg);
|
350
|
+
methodToRegistration.set(methReg.origFunction, methReg);
|
285
351
|
}
|
286
352
|
return methReg;
|
287
353
|
}
|
@@ -293,15 +359,16 @@ function registerAndWrapFunction(target, propertyKey, descriptor) {
|
|
293
359
|
return { descriptor, registration };
|
294
360
|
}
|
295
361
|
exports.registerAndWrapFunction = registerAndWrapFunction;
|
362
|
+
const classesByName = new Map();
|
296
363
|
function getOrCreateClassRegistration(ctor) {
|
297
|
-
const
|
364
|
+
const name = ctor.name;
|
365
|
+
if (!classesByName.has(name)) {
|
366
|
+
classesByName.set(name, new ClassRegistration(ctor));
|
367
|
+
}
|
368
|
+
const clsReg = classesByName.get(name);
|
298
369
|
if (clsReg.needsInitialized) {
|
299
|
-
clsReg.name =
|
300
|
-
|
301
|
-
const ops = getRegisteredOperations(ctor);
|
302
|
-
ops.forEach((op) => {
|
303
|
-
op.defaults = clsReg;
|
304
|
-
});
|
370
|
+
clsReg.name = name;
|
371
|
+
clsReg.needsInitialized = false;
|
305
372
|
}
|
306
373
|
return clsReg;
|
307
374
|
}
|
@@ -380,6 +447,16 @@ function DefaultArgOptional(ctor) {
|
|
380
447
|
clsreg.defaultArgRequired = ArgRequiredOptions.OPTIONAL;
|
381
448
|
}
|
382
449
|
exports.DefaultArgOptional = DefaultArgOptional;
|
450
|
+
function configureInstance(cls, name, ...args) {
|
451
|
+
const inst = new cls(name, ...args);
|
452
|
+
const creg = getOrCreateClassRegistration(cls);
|
453
|
+
if (creg.configuredInstances.has(name)) {
|
454
|
+
throw new error_1.DBOSError(`Registration: Class ${cls.name} configuration ${name} is not unique`);
|
455
|
+
}
|
456
|
+
creg.configuredInstances.set(name, inst);
|
457
|
+
return inst;
|
458
|
+
}
|
459
|
+
exports.configureInstance = configureInstance;
|
383
460
|
///////////////////////
|
384
461
|
/* METHOD DECORATORS */
|
385
462
|
///////////////////////
|