@decaf-ts/transactional-decorators 0.1.5 → 0.2.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/README.md +1 -1
- package/dist/transactional-decorators.cjs +1 -1
- package/dist/transactional-decorators.cjs.map +1 -1
- package/dist/transactional-decorators.js +1 -1
- package/dist/transactional-decorators.js.map +1 -1
- package/lib/Transaction.cjs +254 -56
- package/lib/Transaction.d.ts +44 -18
- package/lib/Transaction.js.map +1 -1
- package/lib/constants.cjs +0 -1
- package/lib/constants.js.map +1 -1
- package/lib/decorators.cjs +60 -146
- package/lib/decorators.d.ts +1 -11
- package/lib/decorators.js.map +1 -1
- package/lib/errors.cjs +11 -0
- package/lib/errors.d.ts +4 -0
- package/lib/errors.js.map +1 -0
- package/lib/esm/Transaction.d.ts +44 -18
- package/lib/esm/Transaction.js +254 -56
- package/lib/esm/Transaction.js.map +1 -1
- package/lib/esm/constants.js +0 -1
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/decorators.d.ts +1 -11
- package/lib/esm/decorators.js +60 -145
- package/lib/esm/decorators.js.map +1 -1
- package/lib/esm/errors.d.ts +4 -0
- package/lib/esm/errors.js +7 -0
- package/lib/esm/errors.js.map +1 -0
- package/lib/esm/index.d.ts +4 -1
- package/lib/esm/index.js +6 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/TransactionLock.d.ts +2 -2
- package/lib/esm/locks/{SyncronousLock.d.ts → SynchronousLock.d.ts} +10 -6
- package/lib/esm/locks/SynchronousLock.js +131 -0
- package/lib/esm/locks/SynchronousLock.js.map +1 -0
- package/lib/esm/locks/index.d.ts +1 -1
- package/lib/esm/locks/index.js +1 -1
- package/lib/esm/locks/index.js.map +1 -1
- package/lib/esm/overrides/Metadata.d.ts +8 -0
- package/lib/esm/overrides/Metadata.js +2 -0
- package/lib/esm/overrides/Metadata.js.map +1 -0
- package/lib/esm/overrides/index.d.ts +2 -0
- package/lib/esm/overrides/index.js +3 -0
- package/lib/esm/overrides/index.js.map +1 -0
- package/lib/esm/overrides/overrides.d.ts +1 -0
- package/lib/esm/overrides/overrides.js +12 -0
- package/lib/esm/overrides/overrides.js.map +1 -0
- package/lib/esm/types.d.ts +0 -10
- package/lib/esm/types.js +11 -0
- package/lib/esm/types.js.map +1 -1
- package/lib/index.cjs +7 -2
- package/lib/index.d.ts +4 -1
- package/lib/index.js.map +1 -1
- package/lib/interfaces/TransactionLock.d.ts +2 -2
- package/lib/locks/SynchronousLock.cjs +135 -0
- package/lib/locks/{SyncronousLock.d.ts → SynchronousLock.d.ts} +10 -6
- package/lib/locks/SynchronousLock.js.map +1 -0
- package/lib/locks/index.cjs +1 -1
- package/lib/locks/index.d.ts +1 -1
- package/lib/locks/index.js.map +1 -1
- package/lib/overrides/Metadata.cjs +4 -0
- package/lib/overrides/Metadata.d.ts +8 -0
- package/lib/overrides/Metadata.js.map +1 -0
- package/lib/overrides/index.cjs +19 -0
- package/lib/overrides/index.d.ts +2 -0
- package/lib/overrides/index.js.map +1 -0
- package/lib/overrides/overrides.cjs +14 -0
- package/lib/overrides/overrides.d.ts +1 -0
- package/lib/overrides/overrides.js.map +1 -0
- package/lib/types.cjs +11 -0
- package/lib/types.d.ts +0 -10
- package/lib/types.js.map +1 -1
- package/package.json +4 -6
- package/lib/esm/locks/SyncronousLock.js +0 -128
- package/lib/esm/locks/SyncronousLock.js.map +0 -1
- package/lib/esm/utils.d.ts +0 -1
- package/lib/esm/utils.js +0 -14
- package/lib/esm/utils.js.map +0 -1
- package/lib/locks/SyncronousLock.cjs +0 -132
- package/lib/locks/SyncronousLock.js.map +0 -1
- package/lib/utils.cjs +0 -17
- package/lib/utils.d.ts +0 -1
- package/lib/utils.js.map +0 -1
package/lib/esm/Transaction.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { SynchronousLock } from "./locks/SynchronousLock.js";
|
|
2
|
+
import { DBKeys } from "@decaf-ts/db-decorators";
|
|
3
|
+
import "./overrides/index.js";
|
|
4
|
+
import { Metadata } from "@decaf-ts/decoration";
|
|
5
|
+
import { LoggedClass, getObjectName, Logging } from "@decaf-ts/logging";
|
|
6
|
+
import { TimeoutError } from "./errors.js";
|
|
7
|
+
const objectNameCache = new WeakMap();
|
|
6
8
|
/**
|
|
7
9
|
* @description Core transaction management class
|
|
8
10
|
* @summary Manages transaction lifecycle, including creation, execution, and cleanup. Provides mechanisms for binding transactions to objects and methods, ensuring proper transaction context propagation.
|
|
@@ -47,36 +49,109 @@ import { TransactionalKeys } from "./constants.js";
|
|
|
47
49
|
* T->>L: release(error?)
|
|
48
50
|
* L-->>C: Return result/error
|
|
49
51
|
*/
|
|
50
|
-
export class Transaction {
|
|
52
|
+
export class Transaction extends LoggedClass {
|
|
53
|
+
static { this.debug = false; }
|
|
54
|
+
static { this.globalTimeout = -1; }
|
|
55
|
+
static { this.metadataCache = new WeakMap(); }
|
|
56
|
+
static { this.log = new Proxy(Logging.for(Transaction), {
|
|
57
|
+
get(target, prop, receiver) {
|
|
58
|
+
if (prop !== "log" || Transaction.debug)
|
|
59
|
+
return Reflect.get(target, prop, receiver);
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
61
|
+
return (...args) => {
|
|
62
|
+
// do nothing. ignore the log message the Transaction is not in debug mode
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
}); }
|
|
66
|
+
get log() {
|
|
67
|
+
if (!this["_log"]) {
|
|
68
|
+
this["_log"] = Transaction.log;
|
|
69
|
+
}
|
|
70
|
+
return this["_log"];
|
|
71
|
+
}
|
|
72
|
+
static { this.contexts = new WeakMap(); }
|
|
51
73
|
constructor(source, method, action, metadata) {
|
|
74
|
+
super();
|
|
75
|
+
this.initialFireDispatched = false;
|
|
76
|
+
this.released = false;
|
|
52
77
|
this.id = Date.now();
|
|
53
78
|
this.action = action;
|
|
54
79
|
this.method = method;
|
|
55
|
-
this.
|
|
80
|
+
this.logs = [[this.id, source, method].join(" | ")];
|
|
56
81
|
this.source = source;
|
|
57
82
|
this.metadata = metadata;
|
|
83
|
+
this.completion = new Promise((resolve, reject) => {
|
|
84
|
+
this.resolveCompletion = resolve;
|
|
85
|
+
this.rejectCompletion = reject;
|
|
86
|
+
});
|
|
58
87
|
}
|
|
59
88
|
/**
|
|
60
89
|
* @description Queues a transaction for execution
|
|
61
90
|
* @summary Pushes a transaction to the queue and waits for its resolution. Creates a new transaction with the provided issuer and callback method, then submits it to the transaction lock.
|
|
62
91
|
* @param {any} issuer - Any class instance that will be used as 'this' when calling the callbackMethod
|
|
63
|
-
* @param {Function}
|
|
92
|
+
* @param {Function} method - function containing the transaction logic, will be called with the issuer as 'this'
|
|
64
93
|
* @param {any[]} args - Arguments to pass to the method. Last one must be the callback function
|
|
65
94
|
* @return {void}
|
|
66
95
|
*/
|
|
67
|
-
static push(issuer,
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
96
|
+
static async push(issuer, method, ...args) {
|
|
97
|
+
const log = this.log.for(this.push);
|
|
98
|
+
const issuerName = Transaction.describeTarget(issuer);
|
|
99
|
+
const methodName = Transaction.describeTarget(method);
|
|
100
|
+
const transaction = new Transaction(issuerName, methodName, async () => {
|
|
101
|
+
const l = log.for(transaction.id.toString());
|
|
102
|
+
try {
|
|
103
|
+
l.verbose(`Executing transaction method ${methodName}`);
|
|
104
|
+
l.debug(`With arguments: ${JSON.stringify(args)}`);
|
|
105
|
+
const result = await Promise.resolve(method.call(transaction.bindToTransaction(issuer), ...args));
|
|
106
|
+
l.verbose(`Transaction method ${methodName} executed successfully`);
|
|
107
|
+
l.debug(`Result: ${JSON.stringify(result)}`);
|
|
108
|
+
await transaction.release();
|
|
109
|
+
l.debug("lock released");
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
await transaction.release(e);
|
|
114
|
+
throw e;
|
|
115
|
+
}
|
|
78
116
|
});
|
|
79
|
-
|
|
117
|
+
log.debug(`Pushing transaction ${transaction.id} for method ${methodName} on issuer ${issuerName}`);
|
|
118
|
+
return Transaction.submit(transaction);
|
|
119
|
+
}
|
|
120
|
+
static async run(contextOrRunnable, runnableOrMetadata, maybeMetadata) {
|
|
121
|
+
const contextProvided = typeof contextOrRunnable !== "function";
|
|
122
|
+
const context = (contextProvided ? contextOrRunnable : undefined);
|
|
123
|
+
const runnable = (contextProvided ? runnableOrMetadata : contextOrRunnable);
|
|
124
|
+
if (typeof runnable !== "function") {
|
|
125
|
+
throw new Error("Transaction.run requires an async function");
|
|
126
|
+
}
|
|
127
|
+
const rawMetadata = contextProvided ? maybeMetadata : runnableOrMetadata;
|
|
128
|
+
const metadataValue = Array.isArray(rawMetadata) && rawMetadata.length
|
|
129
|
+
? rawMetadata
|
|
130
|
+
: undefined;
|
|
131
|
+
const sourceName = context
|
|
132
|
+
? Transaction.describeTarget(context)
|
|
133
|
+
: Transaction.describeTarget(runnable);
|
|
134
|
+
const methodName = Transaction.describeTarget(runnable);
|
|
135
|
+
// eslint-disable-next-line prefer-const
|
|
136
|
+
let transaction;
|
|
137
|
+
const action = async () => {
|
|
138
|
+
let caughtError;
|
|
139
|
+
try {
|
|
140
|
+
const boundContext = context
|
|
141
|
+
? transaction.bindToTransaction(context)
|
|
142
|
+
: undefined;
|
|
143
|
+
return await runnable.call((boundContext ?? transaction));
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
caughtError = error;
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
await transaction.release(caughtError instanceof Error ? caughtError : undefined);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
transaction = new Transaction(sourceName, methodName, action, metadataValue);
|
|
154
|
+
return Transaction.submit(transaction);
|
|
80
155
|
}
|
|
81
156
|
/**
|
|
82
157
|
* @description Configures the transaction lock implementation
|
|
@@ -94,7 +169,7 @@ export class Transaction {
|
|
|
94
169
|
*/
|
|
95
170
|
static getLock() {
|
|
96
171
|
if (!this.lock)
|
|
97
|
-
this.lock = new
|
|
172
|
+
this.lock = new SynchronousLock();
|
|
98
173
|
return this.lock;
|
|
99
174
|
}
|
|
100
175
|
/**
|
|
@@ -104,7 +179,7 @@ export class Transaction {
|
|
|
104
179
|
* @return {void}
|
|
105
180
|
*/
|
|
106
181
|
static submit(transaction) {
|
|
107
|
-
Transaction.getLock().submit(transaction);
|
|
182
|
+
return Transaction.getLock().submit(transaction);
|
|
108
183
|
}
|
|
109
184
|
/**
|
|
110
185
|
* @description Releases the transaction lock
|
|
@@ -115,6 +190,18 @@ export class Transaction {
|
|
|
115
190
|
static async release(err) {
|
|
116
191
|
return Transaction.getLock().release(err);
|
|
117
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* @description Releases the transaction instance once
|
|
195
|
+
* @summary Ensures the underlying lock is released at most a single time for the transaction
|
|
196
|
+
* @param {Error} [err] - Optional error to propagate to the lock implementation
|
|
197
|
+
* @return {Promise<void>} Resolves once the lock release call finishes or immediately when already released
|
|
198
|
+
*/
|
|
199
|
+
async release(err) {
|
|
200
|
+
if (this.released)
|
|
201
|
+
return;
|
|
202
|
+
this.released = true;
|
|
203
|
+
await Transaction.release(err);
|
|
204
|
+
}
|
|
118
205
|
/**
|
|
119
206
|
* @description Retrieves transaction metadata
|
|
120
207
|
* @summary Returns a copy of the metadata associated with this transaction, ensuring the original metadata remains unmodified
|
|
@@ -123,6 +210,26 @@ export class Transaction {
|
|
|
123
210
|
getMetadata() {
|
|
124
211
|
return this.metadata ? [...this.metadata] : undefined;
|
|
125
212
|
}
|
|
213
|
+
static getTransactionalMetadata(target) {
|
|
214
|
+
let cached = this.metadataCache.get(target);
|
|
215
|
+
if (cached)
|
|
216
|
+
return cached;
|
|
217
|
+
const reservedProps = new Set([
|
|
218
|
+
"__transactionProxy",
|
|
219
|
+
"__transactionTarget",
|
|
220
|
+
typeof DBKeys.ORIGINAL === "string" ? DBKeys.ORIGINAL : "__originalObj",
|
|
221
|
+
]);
|
|
222
|
+
const methods = Metadata.transactionals(target) ?? [];
|
|
223
|
+
const propertyKeys = (Metadata.properties(target) || []).filter((prop) => !reservedProps.has(prop));
|
|
224
|
+
const propertyDesignTypes = new Map();
|
|
225
|
+
propertyKeys.forEach((prop) => {
|
|
226
|
+
const type = Metadata.type(target, prop);
|
|
227
|
+
propertyDesignTypes.set(prop, !!type && Metadata.isTransactional(type));
|
|
228
|
+
});
|
|
229
|
+
cached = { methods, propertyKeys, propertyDesignTypes };
|
|
230
|
+
this.metadataCache.set(target, cached);
|
|
231
|
+
return cached;
|
|
232
|
+
}
|
|
126
233
|
/**
|
|
127
234
|
* @description Links a new transaction to the current one
|
|
128
235
|
* @summary Binds a new transaction operation to the current transaction, transferring logs and binding methods to maintain transaction context
|
|
@@ -130,8 +237,10 @@ export class Transaction {
|
|
|
130
237
|
* @return {void}
|
|
131
238
|
*/
|
|
132
239
|
bindTransaction(nextTransaction) {
|
|
133
|
-
|
|
134
|
-
|
|
240
|
+
this.log
|
|
241
|
+
.for(this.bindTransaction)
|
|
242
|
+
.verbose(`Binding the ${nextTransaction.toString()} to ${this}`);
|
|
243
|
+
this.logs.push(...nextTransaction.logs);
|
|
135
244
|
nextTransaction.bindTransaction = this.bindToTransaction.bind(this);
|
|
136
245
|
nextTransaction.bindToTransaction = this.bindToTransaction.bind(this);
|
|
137
246
|
this.action = nextTransaction.action;
|
|
@@ -143,36 +252,94 @@ export class Transaction {
|
|
|
143
252
|
* @return {any} The bound object with transaction-aware method wrappers
|
|
144
253
|
*/
|
|
145
254
|
bindToTransaction(obj) {
|
|
146
|
-
const
|
|
147
|
-
|
|
255
|
+
const log = this.log.for(this.bindToTransaction);
|
|
256
|
+
log.verbose(`Binding object ${getObjectName(obj)} to transaction ${this.id}`);
|
|
257
|
+
const metadata = Transaction.getTransactionalMetadata(obj.constructor);
|
|
258
|
+
const transactionalMethods = metadata.methods;
|
|
259
|
+
if (!transactionalMethods.length)
|
|
148
260
|
return obj;
|
|
149
261
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
150
262
|
const self = this;
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
263
|
+
const reservedProps = new Set([
|
|
264
|
+
"__transactionProxy",
|
|
265
|
+
"__transactionTarget",
|
|
266
|
+
typeof DBKeys.ORIGINAL === "string" ? DBKeys.ORIGINAL : "__originalObj",
|
|
267
|
+
]);
|
|
268
|
+
const props = new Set(metadata.propertyKeys);
|
|
269
|
+
Object.getOwnPropertyNames(obj).forEach((prop) => {
|
|
270
|
+
if (!reservedProps.has(prop))
|
|
271
|
+
props.add(prop);
|
|
272
|
+
});
|
|
273
|
+
const transactionProps = Array.from(props).filter((p) => {
|
|
274
|
+
if (metadata.propertyDesignTypes.get(p))
|
|
275
|
+
return true;
|
|
276
|
+
const value = obj[p];
|
|
277
|
+
if (value &&
|
|
278
|
+
(typeof value === "object" || typeof value === "function") &&
|
|
279
|
+
Metadata.isTransactional(value.constructor)) {
|
|
280
|
+
return true;
|
|
165
281
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
282
|
+
return false;
|
|
283
|
+
});
|
|
284
|
+
log.debug(`found transaction methods: ${transactionalMethods.join(", ")} and properties: ${transactionProps.join(", ")}`);
|
|
285
|
+
const boundObj = new Proxy(obj, {
|
|
286
|
+
get(target, prop, receiver) {
|
|
287
|
+
if (transactionalMethods.includes(prop))
|
|
288
|
+
return new Proxy(target[prop], {
|
|
289
|
+
apply(methodTarget, thisArg, argArray) {
|
|
290
|
+
return Reflect.apply(methodTarget, thisArg, [self, ...argArray]);
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
if (transactionProps.includes(prop))
|
|
294
|
+
return self.bindToTransaction(target[prop]);
|
|
295
|
+
return Reflect.get(target, prop, receiver);
|
|
296
|
+
},
|
|
297
|
+
});
|
|
298
|
+
boundObj[DBKeys.ORIGINAL] =
|
|
299
|
+
obj[DBKeys.ORIGINAL] || obj;
|
|
171
300
|
boundObj.toString = () => getObjectName(boundObj[DBKeys.ORIGINAL]) +
|
|
172
301
|
" proxy for transaction " +
|
|
173
302
|
this.id;
|
|
303
|
+
boundObj.__transactionProxy = true;
|
|
304
|
+
boundObj.__transactionTarget =
|
|
305
|
+
obj.__transactionTarget || obj;
|
|
306
|
+
Transaction.contexts.set(boundObj, self);
|
|
174
307
|
return boundObj;
|
|
175
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* @description Applies the global timeout to the provided Promise, if configured
|
|
311
|
+
* @param {Promise<R>} execution - Transaction execution promise
|
|
312
|
+
* @return {Promise<R>} Promise that respects the configured global timeout
|
|
313
|
+
* @private
|
|
314
|
+
*/
|
|
315
|
+
applyGlobalTimeout(execution) {
|
|
316
|
+
if (Transaction.globalTimeout <= 0)
|
|
317
|
+
return execution;
|
|
318
|
+
const timeoutMs = Transaction.globalTimeout;
|
|
319
|
+
const log = this.log.for(this.applyGlobalTimeout);
|
|
320
|
+
return new Promise((resolve, reject) => {
|
|
321
|
+
let settled = false;
|
|
322
|
+
const timer = setTimeout(() => {
|
|
323
|
+
if (settled)
|
|
324
|
+
return;
|
|
325
|
+
const error = new TimeoutError(`Transaction ${this.toString()} exceeded timeout of ${timeoutMs}ms`);
|
|
326
|
+
log.warn(error.message);
|
|
327
|
+
this.release(error).catch((releaseErr) => log.error(releaseErr));
|
|
328
|
+
reject(error);
|
|
329
|
+
}, timeoutMs);
|
|
330
|
+
execution
|
|
331
|
+
.then((value) => {
|
|
332
|
+
settled = true;
|
|
333
|
+
clearTimeout(timer);
|
|
334
|
+
resolve(value);
|
|
335
|
+
})
|
|
336
|
+
.catch((err) => {
|
|
337
|
+
settled = true;
|
|
338
|
+
clearTimeout(timer);
|
|
339
|
+
reject(err);
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
}
|
|
176
343
|
/**
|
|
177
344
|
* @description Executes the transaction action
|
|
178
345
|
* @summary Fires the transaction by executing its associated action function, throwing an error if no action is defined
|
|
@@ -181,7 +348,26 @@ export class Transaction {
|
|
|
181
348
|
fire() {
|
|
182
349
|
if (!this.action)
|
|
183
350
|
throw new Error(`Missing the method`);
|
|
184
|
-
|
|
351
|
+
const executeAction = async () => {
|
|
352
|
+
return this.action ? await this.action() : undefined;
|
|
353
|
+
};
|
|
354
|
+
const baseExecution = executeAction();
|
|
355
|
+
const execution = Transaction.globalTimeout > 0
|
|
356
|
+
? this.applyGlobalTimeout(baseExecution)
|
|
357
|
+
: baseExecution;
|
|
358
|
+
if (!this.initialFireDispatched) {
|
|
359
|
+
this.initialFireDispatched = true;
|
|
360
|
+
execution
|
|
361
|
+
.then((result) => {
|
|
362
|
+
this.resolveCompletion?.(result);
|
|
363
|
+
return result;
|
|
364
|
+
})
|
|
365
|
+
.catch((err) => {
|
|
366
|
+
this.rejectCompletion?.(err);
|
|
367
|
+
throw err;
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
return execution;
|
|
185
371
|
}
|
|
186
372
|
/**
|
|
187
373
|
* @description Provides a string representation of the transaction
|
|
@@ -191,17 +377,29 @@ export class Transaction {
|
|
|
191
377
|
* @return {string} A string representation of the transaction
|
|
192
378
|
*/
|
|
193
379
|
toString(withId = true, withLog = false) {
|
|
194
|
-
return `${withId ? `[${this.id}]` : ""}[Transaction][${this.source}.${this.method}${withLog ? `]\nTransaction Log:\n${this.
|
|
380
|
+
return `${withId ? `[${this.id}]` : ""}[Transaction][${this.source}.${this.method}${withLog ? `]\nTransaction Log:\n${this.logs.join("\n")}` : "]"}`;
|
|
195
381
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
382
|
+
static contextTransaction(context) {
|
|
383
|
+
if (!context || !context.__transactionProxy) {
|
|
384
|
+
return undefined;
|
|
385
|
+
}
|
|
386
|
+
return this.contexts.get(context);
|
|
387
|
+
}
|
|
388
|
+
wait() {
|
|
389
|
+
return this.completion;
|
|
390
|
+
}
|
|
391
|
+
static describeTarget(target) {
|
|
392
|
+
if (target === null ||
|
|
393
|
+
(typeof target !== "object" && typeof target !== "function")) {
|
|
394
|
+
return getObjectName(target);
|
|
395
|
+
}
|
|
396
|
+
const key = target;
|
|
397
|
+
let cached = objectNameCache.get(key);
|
|
398
|
+
if (!cached) {
|
|
399
|
+
cached = getObjectName(target);
|
|
400
|
+
objectNameCache.set(key, cached);
|
|
401
|
+
}
|
|
402
|
+
return cached;
|
|
205
403
|
}
|
|
206
404
|
}
|
|
207
405
|
//# sourceMappingURL=Transaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../src/Transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,kCAA+B;AACxD,OAAO,EACL,MAAM,EACN,iCAAiC,GAClC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,mBAAgB;AACxC,OAAO,EAAE,iBAAiB,EAAE,uBAAoB;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,WAAW;IAUtB,YACE,MAAc,EACd,MAAe,EACf,MAAkB,EAClB,QAAgB;QAEhB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CA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CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
package/lib/esm/constants.js
CHANGED
package/lib/esm/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,aAAa,EAAE,eAAe;CAC/B,CAAC"}
|
package/lib/esm/decorators.d.ts
CHANGED
|
@@ -30,14 +30,4 @@
|
|
|
30
30
|
* T-->>C: Return result/error
|
|
31
31
|
* @category Decorators
|
|
32
32
|
*/
|
|
33
|
-
export declare function transactional(...data: any[]): (target: any, propertyKey?: any, descriptor?:
|
|
34
|
-
/**
|
|
35
|
-
* @description Utility for handling super calls in transactional methods
|
|
36
|
-
* @summary Wraps super method calls with the current transaction context when the super's method is also transactional, ensuring transaction continuity through the inheritance chain
|
|
37
|
-
* @param {Function} method - The super method (must be bound to the proper this), e.g., super.create.bind(this)
|
|
38
|
-
* @param {any[]} args - The arguments to call the method with
|
|
39
|
-
* @return {any} The result of the super method call
|
|
40
|
-
* @function transactionalSuperCall
|
|
41
|
-
* @memberOf module:transactions
|
|
42
|
-
*/
|
|
43
|
-
export declare function transactionalSuperCall(method: any, ...args: any): any;
|
|
33
|
+
export declare function transactional(...data: any[]): (target: any, propertyKey?: any, descriptor?: any) => any;
|