@creator.co/wapi 1.2.4 → 1.2.5
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/.github/workflows/npmpublish.yml +1 -1
- package/dist/jest.config.js +1 -1
- package/dist/jest.config.js.map +1 -1
- package/dist/package.json +8 -2
- package/dist/src/BaseEvent/Transaction.d.ts +10 -0
- package/dist/src/BaseEvent/Transaction.js +147 -37
- package/dist/src/BaseEvent/Transaction.js.map +1 -1
- package/dist/src/Database/Database.d.ts +18 -0
- package/dist/src/Database/Database.js +18 -0
- package/dist/src/Database/Database.js.map +1 -0
- package/dist/src/Database/DatabaseManager.d.ts +32 -0
- package/dist/src/Database/DatabaseManager.js +50 -0
- package/dist/src/Database/DatabaseManager.js.map +1 -0
- package/dist/src/Database/DatabaseTransaction.d.ts +65 -0
- package/dist/src/Database/DatabaseTransaction.js +183 -0
- package/dist/src/Database/DatabaseTransaction.js.map +1 -0
- package/dist/src/Database/integrations/knex/KnexDatabase.d.ts +22 -0
- package/dist/src/Database/integrations/knex/KnexDatabase.js +108 -0
- package/dist/src/Database/integrations/knex/KnexDatabase.js.map +1 -0
- package/dist/src/Database/integrations/knex/KnexTransaction.d.ts +37 -0
- package/dist/src/Database/integrations/knex/KnexTransaction.js +60 -0
- package/dist/src/Database/integrations/knex/KnexTransaction.js.map +1 -0
- package/dist/src/Database/integrations/pgsql/PostgresDatabase.d.ts +30 -0
- package/dist/src/Database/integrations/pgsql/PostgresDatabase.js +108 -0
- package/dist/src/Database/integrations/pgsql/PostgresDatabase.js.map +1 -0
- package/dist/src/Database/integrations/pgsql/PostgresTransaction.d.ts +37 -0
- package/dist/src/Database/integrations/pgsql/PostgresTransaction.js +60 -0
- package/dist/src/Database/integrations/pgsql/PostgresTransaction.js.map +1 -0
- package/dist/src/Server/lib/container/Proxy.js +3 -2
- package/dist/src/Server/lib/container/Proxy.js.map +1 -1
- package/jest.config.ts +1 -1
- package/package.json +8 -2
- package/src/BaseEvent/Transaction.ts +48 -18
- package/src/Database/Database.ts +19 -0
- package/src/Database/DatabaseManager.ts +51 -0
- package/src/Database/DatabaseTransaction.ts +118 -0
- package/src/Database/integrations/knex/KnexDatabase.ts +47 -0
- package/src/Database/integrations/knex/KnexTransaction.ts +51 -0
- package/src/Database/integrations/pgsql/PostgresDatabase.ts +49 -0
- package/src/Database/integrations/pgsql/PostgresTransaction.ts +54 -0
- package/src/Database/types.d.ts +49 -0
- package/src/Server/lib/container/Proxy.ts +2 -1
- package/tests/BaseEvent/Transaction.test.ts +59 -0
- package/tests/Database/DatabaseManager.test.ts +55 -0
- package/tests/Database/integrations/knex/KnexDatabase.test.ts +53 -0
- package/tests/Database/integrations/knex/KnexTransaction.test.ts +133 -0
- package/tests/Database/integrations/pg/PostgresDatabase.test.ts +50 -0
- package/tests/Database/integrations/pg/PostgresTransaction.test.ts +51 -0
- package/tsconfig.json +5 -0
package/dist/jest.config.js
CHANGED
|
@@ -20,7 +20,7 @@ var config = {
|
|
|
20
20
|
],
|
|
21
21
|
],
|
|
22
22
|
coverageReporters: ['clover', 'json', 'lcov', ['text', { file: 'coverage.txt' }], 'json-summary'],
|
|
23
|
-
collectCoverageFrom: ['src/**/*.(t|j)s'],
|
|
23
|
+
collectCoverageFrom: ['src/**/*.(t|j)s', '!src/**/*.d.(t|j)s'],
|
|
24
24
|
coverageThreshold: {
|
|
25
25
|
global: {
|
|
26
26
|
branches: 80,
|
package/dist/jest.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":";;AACA,qBAAqB;AACrB,IAAM,MAAM,GAA0B;IACpC,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE;QACT,SAAS;QACT;YACE,YAAY;YACZ;gBACE,eAAe,EAAE,UAAU;gBAC3B,UAAU,EAAE,gBAAgB;gBAC5B,iBAAiB,EAAE,KAAK;gBACxB,gBAAgB,EAAE,OAAO;gBACzB,iBAAiB,EAAE,YAAY;gBAC/B,iBAAiB,EAAE,aAAa;gBAChC,aAAa,EAAE,SAAS;aACzB;SACF;KACF;IACD,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,CAAC;IACjG,mBAAmB,EAAE,CAAC,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":";;AACA,qBAAqB;AACrB,IAAM,MAAM,GAA0B;IACpC,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,MAAM;IACvB,SAAS,EAAE;QACT,SAAS;QACT;YACE,YAAY;YACZ;gBACE,eAAe,EAAE,UAAU;gBAC3B,UAAU,EAAE,gBAAgB;gBAC5B,iBAAiB,EAAE,KAAK;gBACxB,gBAAgB,EAAE,OAAO;gBACzB,iBAAiB,EAAE,YAAY;gBAC/B,iBAAiB,EAAE,aAAa;gBAChC,aAAa,EAAE,SAAS;aACzB;SACF;KACF;IACD,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,CAAC;IACjG,mBAAmB,EAAE,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;IAC9D,iBAAiB,EAAE;QACjB,MAAM,EAAE;YACN,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,EAAE;YACT,UAAU,EAAE,EAAE;SACf;KACF;CACF,CAAA;AACD,kBAAe,MAAM,CAAA"}
|
package/dist/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creator.co/wapi",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "commonjs",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "
|
|
9
|
+
"build": "tsc --build",
|
|
10
10
|
"clean": "tsc --build --clean",
|
|
11
11
|
"lint-fix": "eslint . --ext .ts --fix",
|
|
12
12
|
"lint": "eslint . --ext .ts",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"@aws-sdk/credential-provider-node": "^3.414.0",
|
|
25
25
|
"@types/email-templates": "^10.0.1",
|
|
26
26
|
"@types/nodemailer": "^6.4.10",
|
|
27
|
+
"@types/object-hash": "^3.0.4",
|
|
27
28
|
"abind": "^1.0.5",
|
|
28
29
|
"cors": "^2.8.5",
|
|
29
30
|
"cuid": "^3.0.0",
|
|
@@ -32,18 +33,23 @@
|
|
|
32
33
|
"express": "^4.18.2",
|
|
33
34
|
"json-stringify-safe": "^5.0.1",
|
|
34
35
|
"jsonwebtoken": "^9.0.2",
|
|
36
|
+
"knex": "^3.0.1",
|
|
35
37
|
"node-cache": "^5.1.2",
|
|
38
|
+
"object-hash": "^3.0.0",
|
|
36
39
|
"parse-duration": "^1.1.0",
|
|
40
|
+
"pg": "^8.11.3",
|
|
37
41
|
"sha1": "^1.1.1",
|
|
38
42
|
"stack-trace": "0.0.10",
|
|
39
43
|
"zod": "^3.22.4"
|
|
40
44
|
},
|
|
41
45
|
"devDependencies": {
|
|
42
46
|
"@types/aws-lambda": "^8.10.119",
|
|
47
|
+
"@types/chai": "^4.3.9",
|
|
43
48
|
"@types/express": "^4.17.19",
|
|
44
49
|
"@types/jest": "^29.5.6",
|
|
45
50
|
"@types/jsonwebtoken": "^9.0.3",
|
|
46
51
|
"@types/node": "^20.5.7",
|
|
52
|
+
"@types/pg": "^8.10.5",
|
|
47
53
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
|
48
54
|
"@typescript-eslint/parser": "^6.5.0",
|
|
49
55
|
"aws-lambda": "^1.0.7",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { APIGatewayEvent, Context, SQSEvent } from 'aws-lambda';
|
|
2
2
|
import Request from '../API/Request';
|
|
3
3
|
import Response, { ResponseErrorType } from '../API/Response';
|
|
4
|
+
import type { DatabaseTransactionType, DatabaseType, DbConfig } from '../Database/types';
|
|
4
5
|
import Logger, { LoggerConfig } from '../Logger/Logger';
|
|
5
6
|
import Publisher, { PublisherConfig } from '../Publisher/Publisher';
|
|
6
7
|
export type TransactionExecution<TransactionType, ResponseInnerType, MiscRespType = null> = (transaction: TransactionType) => Promise<Response<ResponseInnerType> | Response<ResponseErrorType> | MiscRespType>;
|
|
@@ -11,6 +12,8 @@ export type TransactionConfig = {
|
|
|
11
12
|
publisher?: PublisherConfig;
|
|
12
13
|
};
|
|
13
14
|
export default class Transaction<InputType = object, ResponseInnerType = null, MiscRespType = null> {
|
|
15
|
+
private databaseManager;
|
|
16
|
+
private transactions;
|
|
14
17
|
private event;
|
|
15
18
|
private context;
|
|
16
19
|
private response;
|
|
@@ -23,6 +26,13 @@ export default class Transaction<InputType = object, ResponseInnerType = null, M
|
|
|
23
26
|
constructor(event: APIGatewayEvent | SQSEvent, context: Context, config?: TransactionConfig);
|
|
24
27
|
execute(executionFunc: TransactionExecution<Transaction<InputType, ResponseInnerType, MiscRespType>, ResponseInnerType, MiscRespType>): Promise<Response<ResponseInnerType | ResponseErrorType> | MiscRespType>;
|
|
25
28
|
private iexecute;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves a database transaction for the specified database configuration.
|
|
31
|
+
* @async
|
|
32
|
+
* @param {DbConfig<S>} config - The configuration object for the database.
|
|
33
|
+
* @returns {Promise<DatabaseTransactionType<S>>} A promise that resolves to the database transaction.
|
|
34
|
+
*/
|
|
35
|
+
getDbTransaction<S extends DatabaseType>(config: DbConfig<S>): Promise<DatabaseTransactionType<S>>;
|
|
26
36
|
private executeDBTransactions;
|
|
27
37
|
private executeLoggerFlush;
|
|
28
38
|
private getErrorResponse;
|
|
@@ -35,15 +35,54 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
63
|
+
var __values = (this && this.__values) || function(o) {
|
|
64
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
65
|
+
if (m) return m.call(o);
|
|
66
|
+
if (o && typeof o.length === "number") return {
|
|
67
|
+
next: function () {
|
|
68
|
+
if (o && i >= o.length) o = void 0;
|
|
69
|
+
return { value: o && o[i++], done: !o };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
73
|
+
};
|
|
38
74
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
75
|
var Request_1 = require("../API/Request");
|
|
40
76
|
var Response_1 = require("../API/Response");
|
|
77
|
+
var DatabaseManager_1 = require("../Database/DatabaseManager");
|
|
41
78
|
var Globals_1 = require("../Globals");
|
|
42
79
|
var Logger_1 = require("../Logger/Logger");
|
|
43
80
|
var Publisher_1 = require("../Publisher/Publisher");
|
|
44
81
|
var Transaction = /** @class */ (function () {
|
|
45
82
|
//
|
|
46
83
|
function Transaction(event, context, config) {
|
|
84
|
+
this.databaseManager = DatabaseManager_1.DatabaseManager.INSTANCE;
|
|
85
|
+
this.transactions = [];
|
|
47
86
|
var transactionId = context.awsRequestId
|
|
48
87
|
? context.awsRequestId
|
|
49
88
|
: event.requestContext
|
|
@@ -161,55 +200,126 @@ var Transaction = /** @class */ (function () {
|
|
|
161
200
|
});
|
|
162
201
|
});
|
|
163
202
|
};
|
|
164
|
-
|
|
203
|
+
/**
|
|
204
|
+
* Retrieves a database transaction for the specified database configuration.
|
|
205
|
+
* @async
|
|
206
|
+
* @param {DbConfig<S>} config - The configuration object for the database.
|
|
207
|
+
* @returns {Promise<DatabaseTransactionType<S>>} A promise that resolves to the database transaction.
|
|
208
|
+
*/
|
|
209
|
+
Transaction.prototype.getDbTransaction = function (config) {
|
|
165
210
|
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
-
var
|
|
211
|
+
var db, dbTrans;
|
|
167
212
|
return __generator(this, function (_a) {
|
|
168
213
|
switch (_a.label) {
|
|
169
214
|
case 0:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
// if (this.db) await this.db.connect();
|
|
173
|
-
// //start transaction
|
|
174
|
-
// if (this.db) await this.db.beginTransaction();
|
|
175
|
-
// //
|
|
176
|
-
// let executionFailed =
|
|
177
|
-
return [4 /*yield*/, safeExecution()
|
|
178
|
-
// //Commit if not failed, rollback if failed
|
|
179
|
-
// if (!executionFailed) {
|
|
180
|
-
// if (this.db) await this.db.commit();
|
|
181
|
-
// } else {
|
|
182
|
-
// this.logger.log("Rolling back DB transactions. Main code failed!");
|
|
183
|
-
// if (this.db) await this.db.rollback();
|
|
184
|
-
// }
|
|
185
|
-
// //Cleanup DB after execution
|
|
186
|
-
// if (this.db) await this.db.cleanup();
|
|
187
|
-
];
|
|
215
|
+
db = this.databaseManager.create(config);
|
|
216
|
+
return [4 /*yield*/, db.transaction()];
|
|
188
217
|
case 1:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
218
|
+
dbTrans = _a.sent();
|
|
219
|
+
this.transactions.push(dbTrans);
|
|
220
|
+
return [2 /*return*/, dbTrans];
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
Transaction.prototype.executeDBTransactions = function (safeExecution) {
|
|
226
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
227
|
+
var execFailed, _a, _b, transaction, e_2, e_3_1, e_4, _c, _d, transaction, e_5, e_6_1;
|
|
228
|
+
var e_3, _e, e_6, _f;
|
|
229
|
+
return __generator(this, function (_g) {
|
|
230
|
+
switch (_g.label) {
|
|
231
|
+
case 0:
|
|
232
|
+
_g.trys.push([0, 12, , 23]);
|
|
233
|
+
return [4 /*yield*/, safeExecution()];
|
|
234
|
+
case 1:
|
|
235
|
+
execFailed = _g.sent();
|
|
236
|
+
_g.label = 2;
|
|
197
237
|
case 2:
|
|
198
|
-
|
|
238
|
+
_g.trys.push([2, 9, 10, 11]);
|
|
239
|
+
_a = __values(__spreadArray([], __read(this.transactions), false).reverse()), _b = _a.next();
|
|
240
|
+
_g.label = 3;
|
|
241
|
+
case 3:
|
|
242
|
+
if (!!_b.done) return [3 /*break*/, 8];
|
|
243
|
+
transaction = _b.value;
|
|
244
|
+
_g.label = 4;
|
|
245
|
+
case 4:
|
|
246
|
+
_g.trys.push([4, 6, , 7]);
|
|
247
|
+
return [4 /*yield*/, transaction[execFailed ? 'closeFailure' : 'closeSuccess']()];
|
|
248
|
+
case 5:
|
|
249
|
+
_g.sent();
|
|
250
|
+
return [3 /*break*/, 7];
|
|
251
|
+
case 6:
|
|
252
|
+
e_2 = _g.sent();
|
|
253
|
+
// TODO: should we keep committing transactions even if one fails?
|
|
254
|
+
this.logger.error('Exception when closing DB transactions after success.');
|
|
255
|
+
this.logger.exception(e_2);
|
|
256
|
+
return [3 /*break*/, 7];
|
|
257
|
+
case 7:
|
|
258
|
+
_b = _a.next();
|
|
259
|
+
return [3 /*break*/, 3];
|
|
260
|
+
case 8: return [3 /*break*/, 11];
|
|
261
|
+
case 9:
|
|
262
|
+
e_3_1 = _g.sent();
|
|
263
|
+
e_3 = { error: e_3_1 };
|
|
264
|
+
return [3 /*break*/, 11];
|
|
265
|
+
case 10:
|
|
266
|
+
try {
|
|
267
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
268
|
+
}
|
|
269
|
+
finally { if (e_3) throw e_3.error; }
|
|
270
|
+
return [7 /*endfinally*/];
|
|
271
|
+
case 11: return [3 /*break*/, 23];
|
|
272
|
+
case 12:
|
|
273
|
+
e_4 = _g.sent();
|
|
274
|
+
_g.label = 13;
|
|
275
|
+
case 13:
|
|
276
|
+
_g.trys.push([13, 20, 21, 22]);
|
|
277
|
+
_c = __values(__spreadArray([], __read(this.transactions), false).reverse()), _d = _c.next();
|
|
278
|
+
_g.label = 14;
|
|
279
|
+
case 14:
|
|
280
|
+
if (!!_d.done) return [3 /*break*/, 19];
|
|
281
|
+
transaction = _d.value;
|
|
282
|
+
_g.label = 15;
|
|
283
|
+
case 15:
|
|
284
|
+
_g.trys.push([15, 17, , 18]);
|
|
285
|
+
return [4 /*yield*/, transaction.closeFailure()];
|
|
286
|
+
case 16:
|
|
287
|
+
_g.sent();
|
|
288
|
+
return [3 /*break*/, 18];
|
|
289
|
+
case 17:
|
|
290
|
+
e_5 = _g.sent();
|
|
291
|
+
this.logger.error('Exception when closing DB transactions after failure.');
|
|
292
|
+
this.logger.exception(e_5);
|
|
293
|
+
return [3 /*break*/, 18];
|
|
294
|
+
case 18:
|
|
295
|
+
_d = _c.next();
|
|
296
|
+
return [3 /*break*/, 14];
|
|
297
|
+
case 19: return [3 /*break*/, 22];
|
|
298
|
+
case 20:
|
|
299
|
+
e_6_1 = _g.sent();
|
|
300
|
+
e_6 = { error: e_6_1 };
|
|
301
|
+
return [3 /*break*/, 22];
|
|
302
|
+
case 21:
|
|
303
|
+
try {
|
|
304
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
305
|
+
}
|
|
306
|
+
finally { if (e_6) throw e_6.error; }
|
|
307
|
+
return [7 /*endfinally*/];
|
|
308
|
+
case 22:
|
|
199
309
|
this.logger.error('Exception when executing DB transactions.');
|
|
200
|
-
this.logger.log(
|
|
310
|
+
this.logger.log(e_4.stack);
|
|
201
311
|
//retrow?
|
|
202
312
|
if (this.retrowErrors)
|
|
203
|
-
throw
|
|
204
|
-
return [3 /*break*/,
|
|
205
|
-
case
|
|
313
|
+
throw e_4;
|
|
314
|
+
return [3 /*break*/, 23];
|
|
315
|
+
case 23: return [2 /*return*/];
|
|
206
316
|
}
|
|
207
317
|
});
|
|
208
318
|
});
|
|
209
319
|
};
|
|
210
320
|
Transaction.prototype.executeLoggerFlush = function (safeExecution) {
|
|
211
321
|
return __awaiter(this, void 0, void 0, function () {
|
|
212
|
-
var
|
|
322
|
+
var e_7;
|
|
213
323
|
return __generator(this, function (_a) {
|
|
214
324
|
switch (_a.label) {
|
|
215
325
|
case 0:
|
|
@@ -219,12 +329,12 @@ var Transaction = /** @class */ (function () {
|
|
|
219
329
|
_a.sent();
|
|
220
330
|
return [3 /*break*/, 4];
|
|
221
331
|
case 2:
|
|
222
|
-
|
|
332
|
+
e_7 = _a.sent();
|
|
223
333
|
this.logger.error('Exception when flushing logs.');
|
|
224
|
-
this.logger.exception(
|
|
334
|
+
this.logger.exception(e_7);
|
|
225
335
|
//retrow?
|
|
226
336
|
if (this.retrowErrors)
|
|
227
|
-
throw
|
|
337
|
+
throw e_7;
|
|
228
338
|
return [3 /*break*/, 4];
|
|
229
339
|
case 3:
|
|
230
340
|
this.logger.debug('Transaction ended');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../src/BaseEvent/Transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../src/BaseEvent/Transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,0CAAoC;AACpC,4CAA6D;AAC7D,+DAA6D;AAG7D,sCAAgC;AAChC,2CAAuD;AACvD,oDAAmE;AAenE;IAkBE,EAAE;IACF,qBAAY,KAAiC,EAAE,OAAgB,EAAE,MAA0B;QAdnF,oBAAe,GAAoB,iCAAe,CAAC,QAAQ,CAAA;QAC3D,iBAAY,GAA0B,EAAE,CAAA;QAc9C,IAAM,aAAa,GAAG,OAAO,CAAC,YAAY;YACxC,CAAC,CAAC,OAAO,CAAC,YAAY;YACtB,CAAC,CAAmB,KAAM,CAAC,cAAc;gBACzC,CAAC,CAAmB,KAAM,CAAC,cAAc,CAAC,SAAS;gBACnD,CAAC,CAAC,SAAS,CAAA;QACb,kBAAkB;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;QACpB,kJAAkJ;QAClJ,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA;QACzB,oBAAoB;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,CAAA,CAAA;QACtC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA,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I,CAAC,MAAM,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAA;wBAC1E,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAC,CAAC,CAAA;;;;;;;;;;;;;;;;;wBAG5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAA;wBAC9D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAC,CAAC,KAAK,CAAC,CAAA;wBACxB,SAAS;wBACT,IAAI,IAAI,CAAC,YAAY;4BAAE,MAAM,GAAC,CAAA;;;;;;KAEjC;IAEa,wCAAkB,GAAhC,UAAiC,aAAa;;;;;;;wBAE1C,qBAAM,aAAa,EAAE,EAAA;;wBAArB,SAAqB,CAAA;;;;wBAErB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;wBAClD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAC,CAAC,CAAA;wBACxB,SAAS;wBACT,IAAI,IAAI,CAAC,YAAY;4BAAE,MAAM,GAAC,CAAA;;;wBAE9B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;;;;;;KAEzC;IAED,sBAAsB;IACd,sCAAgB,GAAxB,UAAyB,KAAa,EAAE,IAAY;QAClD,OAAO,kBAAQ,CAAC,8BAA8B,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAC7D,CAAC;IACH,kBAAC;AAAD,CAAC,AAxKD,IAwKC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DatabaseTransaction } from './DatabaseTransaction';
|
|
2
|
+
import type { DbConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Abstract class representing a database.
|
|
5
|
+
* @template T - The type of database transaction.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class Database<T extends DatabaseTransaction> {
|
|
8
|
+
readonly config: DbConfig<any>;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a database instance, maintaining a reference to the database configuration.
|
|
11
|
+
*/
|
|
12
|
+
protected constructor(config: DbConfig<any>);
|
|
13
|
+
/**
|
|
14
|
+
* Returns a promise resolving to a new instance of the transaction impl.
|
|
15
|
+
* @returns A promise that resolves to a transaction instance.
|
|
16
|
+
*/
|
|
17
|
+
abstract transaction(): Promise<T>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Database = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Abstract class representing a database.
|
|
6
|
+
* @template T - The type of database transaction.
|
|
7
|
+
*/
|
|
8
|
+
var Database = /** @class */ (function () {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a database instance, maintaining a reference to the database configuration.
|
|
11
|
+
*/
|
|
12
|
+
function Database(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
return Database;
|
|
16
|
+
}());
|
|
17
|
+
exports.Database = Database;
|
|
18
|
+
//# sourceMappingURL=Database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Database.js","sourceRoot":"","sources":["../../../src/Database/Database.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH;IACE;;OAEG;IACH,kBAAsC,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAOjE,eAAC;AAAD,CAAC,AAXD,IAWC;AAXqB,4BAAQ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { KnexDatabase } from './integrations/knex/KnexDatabase';
|
|
2
|
+
import { PostgresDatabase } from './integrations/pgsql/PostgresDatabase';
|
|
3
|
+
import type { DatabaseImplType, DatabaseType, DbConfig } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* An object that maps database names to their corresponding database classes.
|
|
6
|
+
* @type {Object}
|
|
7
|
+
* @property {KnexDatabase} knex - The Knex database class.
|
|
8
|
+
* @property {PostgresDatabase} pg - The Postgres database class.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DATABASES: {
|
|
11
|
+
knex: typeof KnexDatabase;
|
|
12
|
+
pg: typeof PostgresDatabase;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A class that manages databases and provides methods for creating and accessing database instances.
|
|
16
|
+
*/
|
|
17
|
+
export declare class DatabaseManager {
|
|
18
|
+
/**
|
|
19
|
+
* The singleton instance of the DatabaseManager class.
|
|
20
|
+
*/
|
|
21
|
+
static readonly INSTANCE: DatabaseManager;
|
|
22
|
+
private databases;
|
|
23
|
+
private instances;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new instance of a database based on the provided configuration.
|
|
26
|
+
* @param {DbConfig<S>} config - The configuration object for the database.
|
|
27
|
+
* @returns {DatabaseImplType<S>} - The created database instance.
|
|
28
|
+
* @template S - The type of the database.
|
|
29
|
+
*/
|
|
30
|
+
create<S extends DatabaseType>(config: DbConfig<S>): DatabaseImplType<S>;
|
|
31
|
+
private instantiateDb;
|
|
32
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseManager = exports.DATABASES = void 0;
|
|
4
|
+
var hash = require("object-hash");
|
|
5
|
+
var KnexDatabase_1 = require("./integrations/knex/KnexDatabase");
|
|
6
|
+
var PostgresDatabase_1 = require("./integrations/pgsql/PostgresDatabase");
|
|
7
|
+
/**
|
|
8
|
+
* An object that maps database names to their corresponding database classes.
|
|
9
|
+
* @type {Object}
|
|
10
|
+
* @property {KnexDatabase} knex - The Knex database class.
|
|
11
|
+
* @property {PostgresDatabase} pg - The Postgres database class.
|
|
12
|
+
*/
|
|
13
|
+
exports.DATABASES = {
|
|
14
|
+
knex: KnexDatabase_1.KnexDatabase,
|
|
15
|
+
pg: PostgresDatabase_1.PostgresDatabase,
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A class that manages databases and provides methods for creating and accessing database instances.
|
|
19
|
+
*/
|
|
20
|
+
var DatabaseManager = /** @class */ (function () {
|
|
21
|
+
function DatabaseManager() {
|
|
22
|
+
this.databases = exports.DATABASES;
|
|
23
|
+
this.instances = {};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new instance of a database based on the provided configuration.
|
|
27
|
+
* @param {DbConfig<S>} config - The configuration object for the database.
|
|
28
|
+
* @returns {DatabaseImplType<S>} - The created database instance.
|
|
29
|
+
* @template S - The type of the database.
|
|
30
|
+
*/
|
|
31
|
+
DatabaseManager.prototype.create = function (config) {
|
|
32
|
+
var configHash = hash(config);
|
|
33
|
+
if (this.instances[configHash]) {
|
|
34
|
+
return this.instances[configHash];
|
|
35
|
+
}
|
|
36
|
+
var instance = this.instantiateDb(config);
|
|
37
|
+
this.instances[configHash] = instance;
|
|
38
|
+
return instance;
|
|
39
|
+
};
|
|
40
|
+
DatabaseManager.prototype.instantiateDb = function (config) {
|
|
41
|
+
return new this.databases[config.type](config);
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The singleton instance of the DatabaseManager class.
|
|
45
|
+
*/
|
|
46
|
+
DatabaseManager.INSTANCE = new DatabaseManager();
|
|
47
|
+
return DatabaseManager;
|
|
48
|
+
}());
|
|
49
|
+
exports.DatabaseManager = DatabaseManager;
|
|
50
|
+
//# sourceMappingURL=DatabaseManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabaseManager.js","sourceRoot":"","sources":["../../../src/Database/DatabaseManager.ts"],"names":[],"mappings":";;;AAAA,kCAAmC;AAEnC,iEAA+D;AAC/D,0EAAwE;AAGxE;;;;;GAKG;AACU,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,2BAAY;IAClB,EAAE,EAAE,mCAAgB;CACrB,CAAA;AAED;;GAEG;AACH;IAAA;QAKU,cAAS,GAAqB,iBAAS,CAAA;QAEvC,cAAS,GAA2C,EAAE,CAAA;IAuBhE,CAAC;IArBC;;;;;OAKG;IACI,gCAAM,GAAb,UAAsC,MAAmB;QACvD,IAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;QAC/B,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;YAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAQ,CAAA;SACzC;QACD,IAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,MAAa,CAAC,CAAA;QAClD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QACrC,OAAO,QAAe,CAAA;IACxB,CAAC;IAEO,uCAAa,GAArB,UACE,MAAyC;QAEzC,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAa,CAAC,CAAA;IACvD,CAAC;IA5BD;;OAEG;IACoB,wBAAQ,GAAG,IAAI,eAAe,EAAE,AAAxB,CAAwB;IA0BzD,sBAAC;CAAA,AA9BD,IA8BC;AA9BY,0CAAe"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Database } from './Database';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract class representing a database transaction.
|
|
4
|
+
* @class DatabaseTransaction
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class DatabaseTransaction {
|
|
7
|
+
private _isOpen;
|
|
8
|
+
protected delegate: any;
|
|
9
|
+
protected database: Database<any>;
|
|
10
|
+
/**
|
|
11
|
+
* Returns a boolean value indicating whether the transaction is open or not.
|
|
12
|
+
* @returns {boolean} - true if the object is open, false otherwise.
|
|
13
|
+
*/
|
|
14
|
+
get isOpen(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a new instance of the class.
|
|
17
|
+
* @param {any} delegate - The delegate object.
|
|
18
|
+
* @param {Database<any>} database - The database object.
|
|
19
|
+
* @protected
|
|
20
|
+
*/
|
|
21
|
+
protected constructor(delegate: any, database: Database<any>);
|
|
22
|
+
/**
|
|
23
|
+
* Wraps an instance of a subclass of DatabaseTransaction with a Proxy object.
|
|
24
|
+
* The Proxy object intercepts method calls and delegates to the target instance.
|
|
25
|
+
* If the method is on the target instance, it is called directly.
|
|
26
|
+
* If the method is not on the target instance and the transaction is open, it is called on the target's delegate implementation.
|
|
27
|
+
* If the method is not on the target instance and the transaction is closed, an error is thrown.
|
|
28
|
+
* @param {T} subclass - The subclass instance to wrap with a Proxy.
|
|
29
|
+
* @returns {T} - The wrapped subclass instance.
|
|
30
|
+
* @throws {Error} - If the target instance is closed.
|
|
31
|
+
*/
|
|
32
|
+
protected static wrapInstance<T extends DatabaseTransaction>(subclass: T): T;
|
|
33
|
+
/**
|
|
34
|
+
* Commits the transaction.
|
|
35
|
+
* @throws {Error} - If the transaction is already closed.
|
|
36
|
+
* @returns None
|
|
37
|
+
*/
|
|
38
|
+
commit(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Rollbacks the current transaction.
|
|
41
|
+
* @throws {Error} - If the transaction is already closed.
|
|
42
|
+
* @returns {Promise<void>} - A promise that resolves once the rollback is complete.
|
|
43
|
+
*/
|
|
44
|
+
rollback(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Closes the transaction after a successful execution.
|
|
47
|
+
* @returns {Promise<void>} - A promise that resolves once the necessary actions are completed.
|
|
48
|
+
*/
|
|
49
|
+
closeSuccess(): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Closes the transaction after a failed execution.
|
|
52
|
+
* @returns {Promise<void>} - A promise that resolves once the necessary actions are completed.
|
|
53
|
+
*/
|
|
54
|
+
closeFailure(): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* An abstract method that performs the commit operation.
|
|
57
|
+
* @returns {Promise<any>} A promise that resolves when the commit operation is completed.
|
|
58
|
+
*/
|
|
59
|
+
protected abstract doCommit(): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* An abstract method that performs a rollback operation.
|
|
62
|
+
* @returns A Promise that resolves when the rollback operation is complete.
|
|
63
|
+
*/
|
|
64
|
+
protected abstract doRollback(): Promise<any>;
|
|
65
|
+
}
|