lakutata 2.0.81 → 2.0.83
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/com/docker.cjs +1 -1
- package/com/docker.mjs +1 -1
- package/decorator/orm.cjs +84 -84
- package/decorator/orm.mjs +42 -128
- package/orm.cjs +873 -1410
- package/orm.mjs +708 -1458
- package/package.json +1 -1
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +230 -239
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +230 -239
- package/src/components/docker/ConnectionOptionsBuilder.cjs +1 -1
- package/src/components/docker/ConnectionOptionsBuilder.mjs +1 -1
- package/src/components/docker/Docker.cjs +4919 -4808
- package/src/components/docker/Docker.mjs +4939 -4828
- package/src/components/docker/lib/DockerContainer.cjs +1 -1
- package/src/components/docker/lib/DockerContainer.mjs +1 -1
- package/src/components/docker/lib/DockerContainerTTY.cjs +1 -1
- package/src/components/docker/lib/DockerContainerTTY.mjs +1 -1
- package/src/components/entrypoint/Entrypoint.cjs +1669 -2159
- package/src/components/entrypoint/Entrypoint.mjs +1629 -2119
- package/src/decorators/orm/AfterInsert.cjs +26 -4
- package/src/decorators/orm/AfterInsert.mjs +25 -5
- package/src/decorators/orm/AfterLoad.cjs +26 -4
- package/src/decorators/orm/AfterLoad.mjs +25 -5
- package/src/decorators/orm/AfterRecover.cjs +26 -4
- package/src/decorators/orm/AfterRecover.mjs +25 -5
- package/src/decorators/orm/AfterRemove.cjs +26 -4
- package/src/decorators/orm/AfterRemove.mjs +25 -5
- package/src/decorators/orm/AfterSoftRemove.cjs +26 -4
- package/src/decorators/orm/AfterSoftRemove.mjs +25 -5
- package/src/decorators/orm/AfterUpdate.cjs +26 -4
- package/src/decorators/orm/AfterUpdate.mjs +25 -5
- package/src/decorators/orm/BeforeInsert.cjs +26 -4
- package/src/decorators/orm/BeforeInsert.mjs +25 -5
- package/src/decorators/orm/BeforeRecover.cjs +26 -4
- package/src/decorators/orm/BeforeRecover.mjs +25 -5
- package/src/decorators/orm/BeforeRemove.cjs +26 -4
- package/src/decorators/orm/BeforeRemove.mjs +25 -5
- package/src/decorators/orm/BeforeSoftRemove.cjs +26 -4
- package/src/decorators/orm/BeforeSoftRemove.mjs +25 -5
- package/src/decorators/orm/BeforeUpdate.cjs +26 -4
- package/src/decorators/orm/BeforeUpdate.mjs +25 -5
- package/src/decorators/orm/Check.cjs +29 -4
- package/src/decorators/orm/Check.mjs +28 -5
- package/src/decorators/orm/ChildEntity.cjs +29 -4
- package/src/decorators/orm/ChildEntity.mjs +28 -5
- package/src/decorators/orm/Column.cjs +61 -4
- package/src/decorators/orm/Column.mjs +61 -6
- package/src/decorators/orm/CreateDateColumn.cjs +25 -4
- package/src/decorators/orm/CreateDateColumn.mjs +24 -5
- package/src/decorators/orm/DeleteDateColumn.cjs +25 -4
- package/src/decorators/orm/DeleteDateColumn.mjs +23 -4
- package/src/decorators/orm/Entity.cjs +35 -4
- package/src/decorators/orm/Entity.mjs +33 -4
- package/src/decorators/orm/EventSubscriber.cjs +22 -4
- package/src/decorators/orm/EventSubscriber.mjs +21 -5
- package/src/decorators/orm/Exclusion.cjs +29 -4
- package/src/decorators/orm/Exclusion.mjs +28 -5
- package/src/decorators/orm/Generated.cjs +24 -4
- package/src/decorators/orm/Generated.mjs +23 -5
- package/src/decorators/orm/Index.cjs +41 -4
- package/src/decorators/orm/Index.mjs +41 -6
- package/src/decorators/orm/JoinColumn.cjs +29 -4
- package/src/decorators/orm/JoinColumn.mjs +28 -5
- package/src/decorators/orm/JoinTable.cjs +30 -4
- package/src/decorators/orm/JoinTable.mjs +28 -4
- package/src/decorators/orm/ManyToMany.cjs +42 -4
- package/src/decorators/orm/ManyToMany.mjs +40 -4
- package/src/decorators/orm/ManyToOne.cjs +42 -4
- package/src/decorators/orm/ManyToOne.mjs +40 -4
- package/src/decorators/orm/ObjectIdColumn.cjs +28 -4
- package/src/decorators/orm/ObjectIdColumn.mjs +27 -5
- package/src/decorators/orm/OneToMany.cjs +34 -4
- package/src/decorators/orm/OneToMany.mjs +34 -6
- package/src/decorators/orm/OneToOne.cjs +42 -4
- package/src/decorators/orm/OneToOne.mjs +40 -4
- package/src/decorators/orm/PrimaryColumn.cjs +49 -4
- package/src/decorators/orm/PrimaryColumn.mjs +49 -6
- package/src/decorators/orm/PrimaryGeneratedColumn.cjs +54 -4
- package/src/decorators/orm/PrimaryGeneratedColumn.mjs +54 -6
- package/src/decorators/orm/RelationId.cjs +26 -4
- package/src/decorators/orm/RelationId.mjs +25 -5
- package/src/decorators/orm/TableInheritance.cjs +26 -4
- package/src/decorators/orm/TableInheritance.mjs +25 -5
- package/src/decorators/orm/Tree.cjs +24 -4
- package/src/decorators/orm/Tree.mjs +23 -5
- package/src/decorators/orm/TreeChildren.cjs +31 -4
- package/src/decorators/orm/TreeChildren.mjs +29 -4
- package/src/decorators/orm/TreeLevelColumn.cjs +25 -4
- package/src/decorators/orm/TreeLevelColumn.mjs +23 -4
- package/src/decorators/orm/TreeParent.cjs +31 -4
- package/src/decorators/orm/TreeParent.mjs +29 -4
- package/src/decorators/orm/Unique.cjs +44 -4
- package/src/decorators/orm/Unique.mjs +44 -6
- package/src/decorators/orm/UpdateDateColumn.cjs +25 -4
- package/src/decorators/orm/UpdateDateColumn.mjs +24 -5
- package/src/decorators/orm/VersionColumn.cjs +25 -4
- package/src/decorators/orm/VersionColumn.mjs +24 -5
- package/src/decorators/orm/ViewColumn.cjs +25 -4
- package/src/decorators/orm/ViewColumn.mjs +24 -5
- package/src/decorators/orm/ViewEntity.cjs +34 -4
- package/src/decorators/orm/ViewEntity.mjs +33 -5
- package/src/decorators/orm/VirtualColumn.cjs +42 -4
- package/src/decorators/orm/VirtualColumn.mjs +40 -4
- package/src/lib/base/EventEmitter.cjs +1193 -1200
- package/src/lib/base/EventEmitter.mjs +1194 -1201
- package/src/lib/base/internal/DataValidator.cjs +185 -174
- package/src/lib/base/internal/DataValidator.mjs +186 -175
- package/src/lib/base/internal/PatternManager.cjs +735 -740
- package/src/lib/base/internal/PatternManager.mjs +740 -745
- package/src/lib/core/Application.cjs +99 -112
- package/src/lib/core/Application.mjs +127 -140
- package/src/lib/helpers/IsHtml.cjs +13 -7
- package/src/lib/helpers/IsHtml.mjs +13 -7
- package/src/lib/helpers/IsXML.cjs +1016 -1158
- package/src/lib/helpers/IsXML.mjs +729 -871
- package/src/lib/helpers/ObjectHash.cjs +371 -378
- package/src/lib/helpers/ObjectHash.mjs +371 -378
- package/src/lib/helpers/RandomString.cjs +146 -167
- package/src/lib/helpers/RandomString.mjs +145 -166
- package/src/lib/helpers/URLBuilder.cjs +355 -355
- package/src/lib/helpers/URLBuilder.mjs +350 -350
- package/src/lib/ioc/ListModules.cjs +5237 -5160
- package/src/lib/ioc/ListModules.mjs +5252 -5175
- package/src/lib/validation/VLD.cjs +3903 -4080
- package/src/lib/validation/VLD.mjs +2793 -2970
- package/src/providers/migration/GenerateMigration.cjs +2 -2
- package/src/providers/migration/GenerateMigration.mjs +2 -2
- package/vendor/Package.112.cjs +38321 -38240
- package/vendor/Package.112.mjs +37720 -37579
- package/vendor/Package.16.cjs +7386 -7268
- package/vendor/Package.16.mjs +6706 -6588
- package/vendor/Package.18.cjs +48229 -20
- package/vendor/Package.18.mjs +48192 -24
- package/vendor/Package.2.cjs +5698 -5727
- package/vendor/Package.2.mjs +5707 -5736
- package/vendor/Package.4.cjs +874 -884
- package/vendor/Package.4.mjs +874 -884
- package/vendor/Package.5.cjs +11 -15
- package/vendor/Package.5.mjs +7 -11
- package/vendor/Package.6.cjs +511 -520
- package/vendor/Package.6.mjs +534 -543
- package/vendor/Package.62.cjs +87 -90
- package/vendor/Package.62.mjs +180 -183
- package/vendor/Package.65.cjs +1285 -1292
- package/vendor/Package.65.mjs +190 -197
- package/vendor/Package.68.cjs +111 -252
- package/vendor/Package.68.mjs +134 -268
- package/vendor/Package.9.cjs +118 -132
- package/vendor/Package.9.mjs +124 -138
- package/vendor/TypeDef.internal.3.d.ts +0 -14
- package/vendor/Package.19.cjs +0 -37
- package/vendor/Package.19.mjs +0 -35
- package/vendor/Package.20.cjs +0 -37
- package/vendor/Package.20.mjs +0 -35
- package/vendor/Package.21.cjs +0 -37
- package/vendor/Package.21.mjs +0 -35
- package/vendor/Package.22.cjs +0 -37
- package/vendor/Package.22.mjs +0 -35
- package/vendor/Package.23.cjs +0 -37
- package/vendor/Package.23.mjs +0 -35
- package/vendor/Package.24.cjs +0 -37
- package/vendor/Package.24.mjs +0 -35
- package/vendor/Package.25.cjs +0 -37
- package/vendor/Package.25.mjs +0 -35
- package/vendor/Package.26.cjs +0 -37
- package/vendor/Package.26.mjs +0 -35
- package/vendor/Package.27.cjs +0 -37
- package/vendor/Package.27.mjs +0 -35
- package/vendor/Package.28.cjs +0 -37
- package/vendor/Package.28.mjs +0 -35
- package/vendor/Package.29.cjs +0 -40
- package/vendor/Package.29.mjs +0 -38
- package/vendor/Package.30.cjs +0 -41
- package/vendor/Package.30.mjs +0 -39
- package/vendor/Package.31.cjs +0 -72
- package/vendor/Package.31.mjs +0 -70
- package/vendor/Package.32.cjs +0 -37
- package/vendor/Package.32.mjs +0 -35
- package/vendor/Package.33.cjs +0 -37
- package/vendor/Package.33.mjs +0 -35
- package/vendor/Package.34.cjs +0 -46
- package/vendor/Package.34.mjs +0 -44
- package/vendor/Package.35.cjs +0 -34
- package/vendor/Package.35.mjs +0 -32
- package/vendor/Package.36.cjs +0 -40
- package/vendor/Package.36.mjs +0 -38
- package/vendor/Package.37.cjs +0 -36
- package/vendor/Package.37.mjs +0 -34
- package/vendor/Package.38.cjs +0 -52
- package/vendor/Package.38.mjs +0 -50
- package/vendor/Package.39.cjs +0 -41
- package/vendor/Package.39.mjs +0 -39
- package/vendor/Package.40.cjs +0 -42
- package/vendor/Package.40.mjs +0 -40
- package/vendor/Package.41.cjs +0 -53
- package/vendor/Package.41.mjs +0 -51
- package/vendor/Package.42.cjs +0 -53
- package/vendor/Package.42.mjs +0 -51
- package/vendor/Package.43.cjs +0 -40
- package/vendor/Package.43.mjs +0 -38
- package/vendor/Package.44.cjs +0 -46
- package/vendor/Package.44.mjs +0 -44
- package/vendor/Package.45.cjs +0 -53
- package/vendor/Package.45.mjs +0 -51
- package/vendor/Package.46.cjs +0 -59
- package/vendor/Package.46.mjs +0 -57
- package/vendor/Package.47.cjs +0 -65
- package/vendor/Package.47.mjs +0 -63
- package/vendor/Package.48.cjs +0 -38
- package/vendor/Package.48.mjs +0 -36
- package/vendor/Package.49.cjs +0 -38
- package/vendor/Package.49.mjs +0 -36
- package/vendor/Package.50.cjs +0 -36
- package/vendor/Package.50.mjs +0 -34
- package/vendor/Package.51.cjs +0 -43
- package/vendor/Package.51.mjs +0 -41
- package/vendor/Package.52.cjs +0 -37
- package/vendor/Package.52.mjs +0 -35
- package/vendor/Package.53.cjs +0 -43
- package/vendor/Package.53.mjs +0 -41
- package/vendor/Package.54.cjs +0 -55
- package/vendor/Package.54.mjs +0 -53
- package/vendor/Package.55.cjs +0 -37
- package/vendor/Package.55.mjs +0 -35
- package/vendor/Package.56.cjs +0 -37
- package/vendor/Package.56.mjs +0 -35
- package/vendor/Package.57.cjs +0 -37
- package/vendor/Package.57.mjs +0 -35
- package/vendor/Package.58.cjs +0 -45
- package/vendor/Package.58.mjs +0 -43
- package/vendor/Package.59.cjs +0 -53
- package/vendor/Package.59.mjs +0 -51
- package/vendor/Package.60.cjs +0 -47649
- package/vendor/Package.60.mjs +0 -47606
|
@@ -16,10 +16,10 @@ const n = require("path");
|
|
|
16
16
|
|
|
17
17
|
const a = require("../../../vendor/Package.11.cjs");
|
|
18
18
|
|
|
19
|
-
const o = require("../../../vendor/Package.5.cjs");
|
|
20
|
-
|
|
21
19
|
const s = require("../../../vendor/Package.112.cjs");
|
|
22
20
|
|
|
21
|
+
const o = require("../../../vendor/Package.5.cjs");
|
|
22
|
+
|
|
23
23
|
const c = require("../../../vendor/Package.12.cjs");
|
|
24
24
|
|
|
25
25
|
require("../../../vendor/Package.8.cjs");
|
|
@@ -40,11 +40,11 @@ const m = require("./Alias.cjs");
|
|
|
40
40
|
|
|
41
41
|
const q = require("../base/internal/BasicInfo.cjs");
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const y = require("../../components/entrypoint/Entrypoint.cjs");
|
|
44
44
|
|
|
45
|
-
const
|
|
45
|
+
const f = require("../../../vendor/Package.16.cjs");
|
|
46
46
|
|
|
47
|
-
const
|
|
47
|
+
const j = require("../../decorators/dto/Accept.cjs");
|
|
48
48
|
|
|
49
49
|
const b = require("fs");
|
|
50
50
|
|
|
@@ -300,110 +300,97 @@ const S = A(u);
|
|
|
300
300
|
|
|
301
301
|
const C = A(x);
|
|
302
302
|
|
|
303
|
-
var D =
|
|
303
|
+
var D = {};
|
|
304
304
|
|
|
305
|
-
|
|
305
|
+
"use strict";
|
|
306
306
|
|
|
307
|
-
|
|
307
|
+
Object.defineProperty(D, "__esModule", {
|
|
308
|
+
value: true
|
|
309
|
+
});
|
|
308
310
|
|
|
309
|
-
|
|
311
|
+
var I = D.CommandUtils = void 0;
|
|
310
312
|
|
|
311
|
-
|
|
313
|
+
const M = c.require$$0;
|
|
312
314
|
|
|
313
|
-
const
|
|
315
|
+
const P = M.__importDefault(S.default);
|
|
314
316
|
|
|
315
|
-
|
|
317
|
+
const T = M.__importDefault(_.default);
|
|
316
318
|
|
|
317
|
-
|
|
319
|
+
const k = s.error;
|
|
318
320
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
class CommandUtils {
|
|
334
|
-
static async loadDataSource(e) {
|
|
335
|
-
let t;
|
|
336
|
-
try {
|
|
337
|
-
[t] = await (0, a.importOrRequireFile)(e);
|
|
338
|
-
} catch (t) {
|
|
339
|
-
throw new Error(`Unable to open file: "${e}". ${t.message}`);
|
|
340
|
-
}
|
|
341
|
-
if (!t || typeof t !== "object") {
|
|
342
|
-
throw new Error(`Given data source file must contain export of a DataSource instance`);
|
|
343
|
-
}
|
|
344
|
-
if (n.InstanceChecker.isDataSource(t)) {
|
|
345
|
-
return t;
|
|
346
|
-
}
|
|
347
|
-
const r = [];
|
|
348
|
-
for (const e in t) {
|
|
349
|
-
const i = t[e];
|
|
350
|
-
const a = await i;
|
|
351
|
-
if (n.InstanceChecker.isDataSource(a)) {
|
|
352
|
-
r.push(a);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
if (r.length === 0) {
|
|
356
|
-
throw new Error(`Given data source file must contain export of a DataSource instance`);
|
|
357
|
-
}
|
|
358
|
-
if (r.length > 1) {
|
|
359
|
-
throw new Error(`Given data source file must contain only one export of DataSource instance`);
|
|
360
|
-
}
|
|
361
|
-
return r[0];
|
|
321
|
+
const R = s.InstanceChecker;
|
|
322
|
+
|
|
323
|
+
const L = s.requireImportUtils();
|
|
324
|
+
|
|
325
|
+
class CommandUtils {
|
|
326
|
+
static async loadDataSource(e) {
|
|
327
|
+
let t;
|
|
328
|
+
try {
|
|
329
|
+
[t] = await (0, L.importOrRequireFile)(e);
|
|
330
|
+
} catch (t) {
|
|
331
|
+
throw new Error(`Unable to open file: "${e}". ${t.message}`);
|
|
332
|
+
}
|
|
333
|
+
if (!t || typeof t !== "object") {
|
|
334
|
+
throw new Error(`Given data source file must contain export of a DataSource instance`);
|
|
362
335
|
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
recursive: true
|
|
366
|
-
});
|
|
336
|
+
if (R.InstanceChecker.isDataSource(t)) {
|
|
337
|
+
return t;
|
|
367
338
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
339
|
+
const r = [];
|
|
340
|
+
for (const e in t) {
|
|
341
|
+
const i = t[e];
|
|
342
|
+
const n = await i;
|
|
343
|
+
if (R.InstanceChecker.isDataSource(n)) {
|
|
344
|
+
r.push(n);
|
|
372
345
|
}
|
|
373
|
-
await t.default.writeFile(e, i);
|
|
374
346
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
return r.toString();
|
|
347
|
+
if (r.length === 0) {
|
|
348
|
+
throw new Error(`Given data source file must contain export of a DataSource instance`);
|
|
378
349
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
await t.default.access(e, t.default.constants.F_OK);
|
|
382
|
-
return true;
|
|
383
|
-
} catch {
|
|
384
|
-
return false;
|
|
385
|
-
}
|
|
350
|
+
if (r.length > 1) {
|
|
351
|
+
throw new Error(`Given data source file must contain only one export of DataSource instance`);
|
|
386
352
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
353
|
+
return r[0];
|
|
354
|
+
}
|
|
355
|
+
static async createDirectories(e) {
|
|
356
|
+
await P.default.mkdir(e, {
|
|
357
|
+
recursive: true
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
static async createFile(e, t, r = true) {
|
|
361
|
+
await CommandUtils.createDirectories(T.default.dirname(e));
|
|
362
|
+
if (r === false && await CommandUtils.fileExists(e)) {
|
|
363
|
+
return;
|
|
392
364
|
}
|
|
365
|
+
await P.default.writeFile(e, t);
|
|
366
|
+
}
|
|
367
|
+
static async readFile(e) {
|
|
368
|
+
const t = await P.default.readFile(e);
|
|
369
|
+
return t.toString();
|
|
370
|
+
}
|
|
371
|
+
static async fileExists(e) {
|
|
372
|
+
try {
|
|
373
|
+
await P.default.access(e, P.default.constants.F_OK);
|
|
374
|
+
return true;
|
|
375
|
+
} catch {
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
static getTimestamp(e) {
|
|
380
|
+
if (e && (isNaN(e) || e < 0)) {
|
|
381
|
+
throw new k.TypeORMError(`timestamp option should be a non-negative number. received: ${e}`);
|
|
382
|
+
}
|
|
383
|
+
return e ? new Date(Number(e)).getTime() : Date.now();
|
|
393
384
|
}
|
|
394
|
-
R.CommandUtils = CommandUtils;
|
|
395
|
-
return R;
|
|
396
385
|
}
|
|
397
386
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
const G = o.getDefaultExportFromCjs(N);
|
|
387
|
+
I = D.CommandUtils = CommandUtils;
|
|
401
388
|
|
|
402
|
-
var
|
|
389
|
+
var B = s.requireAnsis();
|
|
403
390
|
|
|
404
|
-
const
|
|
391
|
+
const N = o.getDefaultExportFromCjs(B);
|
|
405
392
|
|
|
406
|
-
const {Ansis:
|
|
393
|
+
const {Ansis: G, ansi256: F, fg: $, bgAnsi256: U, bg: Q, rgb: J, bgRgb: V, hex: H, bgHex: z, reset: W, inverse: K, hidden: X, visible: Y, bold: Z, dim: ee, italic: te, underline: re, strikethrough: ie, strike: ne, black: ae, red: se, green: oe, yellow: ce, blue: ue, magenta: pe, cyan: le, white: de, grey: he, gray: ge, blackBright: me, redBright: qe, greenBright: ye, yellowBright: fe, blueBright: je, magentaBright: be, cyanBright: xe, whiteBright: ve, bgBlack: Ee, bgRed: we, bgGreen: Oe, bgYellow: Ae, bgBlue: _e, bgMagenta: Se, bgCyan: Ce, bgWhite: De, bgGrey: Ie, bgGray: Me, bgBlackBright: Pe, bgRedBright: Te, bgGreenBright: ke, bgYellowBright: Re, bgBlueBright: Le, bgMagentaBright: Be, bgCyanBright: Ne, bgWhiteBright: Ge} = N;
|
|
407
394
|
|
|
408
395
|
exports.ApplicationState = void 0;
|
|
409
396
|
|
|
@@ -421,10 +408,10 @@ class Application extends l.Module {
|
|
|
421
408
|
this.options = {
|
|
422
409
|
components: {
|
|
423
410
|
log: {
|
|
424
|
-
class:
|
|
411
|
+
class: f.Logger
|
|
425
412
|
},
|
|
426
413
|
entrypoint: {
|
|
427
|
-
class:
|
|
414
|
+
class: y.Entrypoint
|
|
428
415
|
}
|
|
429
416
|
},
|
|
430
417
|
bootstrap: [ "log" ]
|
|
@@ -440,7 +427,7 @@ class Application extends l.Module {
|
|
|
440
427
|
this.aliasDeclarations = [];
|
|
441
428
|
}
|
|
442
429
|
static async getLogger() {
|
|
443
|
-
return this.appInstance ? await this.appInstance.getObject("log") : await (new d.Container).set(
|
|
430
|
+
return this.appInstance ? await this.appInstance.getObject("log") : await (new d.Container).set(f.Logger);
|
|
444
431
|
}
|
|
445
432
|
static env(e) {
|
|
446
433
|
Object.keys(e).forEach((t => this.environmentVariableMap.set(t, e[t])));
|
|
@@ -619,13 +606,13 @@ class Application extends l.Module {
|
|
|
619
606
|
}
|
|
620
607
|
}
|
|
621
608
|
|
|
622
|
-
e.__decorate([
|
|
609
|
+
e.__decorate([ j.Accept(i.DTO.Object().pattern(i.DTO.String(), i.DTO.String()).required()), e.__metadata("design:type", Function), e.__metadata("design:paramtypes", [ Object ]), e.__metadata("design:returntype", Object) ], Application, "env", null);
|
|
623
610
|
|
|
624
|
-
e.__decorate([
|
|
611
|
+
e.__decorate([ j.Accept(i.DTO.Object().pattern(i.DTO.String(), i.DTO.String()).required(), i.DTO.Boolean().optional().default(false)), e.__metadata("design:type", Function), e.__metadata("design:paramtypes", [ Object, Boolean ]), e.__metadata("design:returntype", Object) ], Application, "alias", null);
|
|
625
612
|
|
|
626
|
-
var
|
|
613
|
+
var Fe;
|
|
627
614
|
|
|
628
|
-
exports.GenerateMigration =
|
|
615
|
+
exports.GenerateMigration = Fe = class GenerateMigration extends t.Provider {
|
|
629
616
|
get extension() {
|
|
630
617
|
return this.outputJs ? ".js" : ".ts";
|
|
631
618
|
}
|
|
@@ -656,31 +643,31 @@ exports.GenerateMigration = Qe = class GenerateMigration extends t.Provider {
|
|
|
656
643
|
const r = await this.#t.driver.createSchemaBuilder().log();
|
|
657
644
|
if (this.pretty) {
|
|
658
645
|
r.upQueries.forEach((e => {
|
|
659
|
-
e.query =
|
|
646
|
+
e.query = Fe.prettifyQuery(e.query);
|
|
660
647
|
}));
|
|
661
648
|
r.downQueries.forEach((e => {
|
|
662
|
-
e.query =
|
|
649
|
+
e.query = Fe.prettifyQuery(e.query);
|
|
663
650
|
}));
|
|
664
651
|
}
|
|
665
652
|
r.upQueries.forEach((t => {
|
|
666
|
-
e.push(" await queryRunner.query(`" + t.query.replaceAll("`", "\\`") + "`" +
|
|
653
|
+
e.push(" await queryRunner.query(`" + t.query.replaceAll("`", "\\`") + "`" + Fe.queryParams(t.parameters) + ");");
|
|
667
654
|
}));
|
|
668
655
|
r.downQueries.forEach((e => {
|
|
669
|
-
t.push(" await queryRunner.query(`" + e.query.replaceAll("`", "\\`") + "`" +
|
|
656
|
+
t.push(" await queryRunner.query(`" + e.query.replaceAll("`", "\\`") + "`" + Fe.queryParams(e.parameters) + ");");
|
|
670
657
|
}));
|
|
671
658
|
} finally {
|
|
672
659
|
await this.#t.destroy();
|
|
673
660
|
}
|
|
674
661
|
if (!e.length) {
|
|
675
662
|
if (this.check) {
|
|
676
|
-
console.log(
|
|
663
|
+
console.log(N.green`No changes in database schema were found`);
|
|
677
664
|
if (this.exitProcess) {
|
|
678
665
|
return this.#e.exit(0);
|
|
679
666
|
} else {
|
|
680
667
|
return;
|
|
681
668
|
}
|
|
682
669
|
} else {
|
|
683
|
-
console.log(
|
|
670
|
+
console.log(N.yellow`No changes in database schema were found`);
|
|
684
671
|
if (this.exitProcess) {
|
|
685
672
|
return this.#e.exit(1);
|
|
686
673
|
} else {
|
|
@@ -688,12 +675,12 @@ exports.GenerateMigration = Qe = class GenerateMigration extends t.Provider {
|
|
|
688
675
|
}
|
|
689
676
|
}
|
|
690
677
|
} else if (!this.path) {
|
|
691
|
-
console.log(
|
|
678
|
+
console.log(N.yellow`Please specify a migration path`);
|
|
692
679
|
return this.#e.exit(1);
|
|
693
680
|
}
|
|
694
|
-
const r = this.outputJs ?
|
|
681
|
+
const r = this.outputJs ? Fe.getJavascriptTemplate(_.default.basename(this.path), this.timestamp, e, t.reverse(), this.esm) : Fe.getTemplate(_.default.basename(this.path), this.timestamp, e, t.reverse());
|
|
695
682
|
if (this.check) {
|
|
696
|
-
console.log(
|
|
683
|
+
console.log(N.yellow`Unexpected changes in database schema were found in check mode:\n\n${N.white(r)}`);
|
|
697
684
|
if (this.exitProcess) {
|
|
698
685
|
return this.#e.exit(0);
|
|
699
686
|
} else {
|
|
@@ -701,11 +688,11 @@ exports.GenerateMigration = Qe = class GenerateMigration extends t.Provider {
|
|
|
701
688
|
}
|
|
702
689
|
}
|
|
703
690
|
if (this.dryRun) {
|
|
704
|
-
console.log(
|
|
691
|
+
console.log(N.green(`Migration ${N.blue(this.path + this.extension)} has content:\n\n${N.white(r)}`));
|
|
705
692
|
} else {
|
|
706
693
|
const e = _.default.isAbsolute(this.path) ? _.default.join(this.path, this.filename) : _.default.join(process.cwd(), this.path, this.filename);
|
|
707
|
-
await
|
|
708
|
-
console.log(
|
|
694
|
+
await I.createFile(e, r);
|
|
695
|
+
console.log(N.green`Migration ${N.blue(e)} has been generated successfully.`);
|
|
709
696
|
if (this.exitProcess) {
|
|
710
697
|
return this.#e.exit(0);
|
|
711
698
|
} else {
|
|
@@ -713,7 +700,7 @@ exports.GenerateMigration = Qe = class GenerateMigration extends t.Provider {
|
|
|
713
700
|
}
|
|
714
701
|
}
|
|
715
702
|
} catch (e) {
|
|
716
|
-
|
|
703
|
+
s.PlatformTools.PlatformTools.logCmdErr("Error during migration generation:", e);
|
|
717
704
|
return this.#e.exit(1);
|
|
718
705
|
}
|
|
719
706
|
}
|
|
@@ -724,16 +711,16 @@ exports.GenerateMigration = Qe = class GenerateMigration extends t.Provider {
|
|
|
724
711
|
return `, ${JSON.stringify(e)}`;
|
|
725
712
|
}
|
|
726
713
|
static getTemplate(e, t, r, i) {
|
|
727
|
-
const n = `${
|
|
714
|
+
const n = `${s.camelCase_1(e, true)}${t}`;
|
|
728
715
|
return `import { MigrationInterface, QueryRunner } from "lakutata/orm";\n\nexport class ${n} implements MigrationInterface {\n name = '${n}'\n\n public async up(queryRunner: QueryRunner): Promise<void> {\n${r.join(`\n`)}\n }\n\n public async down(queryRunner: QueryRunner): Promise<void> {\n${i.join(`\n`)}\n }\n\n}\n`;
|
|
729
716
|
}
|
|
730
717
|
static getJavascriptTemplate(e, t, r, i, n) {
|
|
731
|
-
const a = `${
|
|
718
|
+
const a = `${s.camelCase_1(e, true)}${t}`;
|
|
732
719
|
const o = n ? "export" : "module.exports =";
|
|
733
720
|
return `/**\n * @typedef {import('lakutata/orm').MigrationInterface} MigrationInterface\n * @typedef {import('lakutata/orm').QueryRunner} QueryRunner\n */\n\n/**\n * @class\n * @implements {MigrationInterface}\n */\n${o} class ${a} {\n name = '${a}'\n\n /**\n * @param {QueryRunner} queryRunner\n */\n async up(queryRunner) {\n${r.join(`\n`)}\n }\n\n /**\n * @param {QueryRunner} queryRunner\n */\n async down(queryRunner) {\n${i.join(`\n`)}\n }\n}\n`;
|
|
734
721
|
}
|
|
735
722
|
static prettifyQuery(e) {
|
|
736
|
-
const t =
|
|
723
|
+
const t = s.sqlFormatter.format(e, {
|
|
737
724
|
indent: " "
|
|
738
725
|
});
|
|
739
726
|
return "\n" + t.replace(/^/gm, " ") + "\n ";
|
|
@@ -760,6 +747,6 @@ e.__decorate([ r.Configurable(i.DTO.Number().optional().default((() => Date.now(
|
|
|
760
747
|
|
|
761
748
|
e.__decorate([ r.Configurable(i.DTO.Boolean().optional().default(true)), e.__metadata("design:type", Boolean) ], exports.GenerateMigration.prototype, "exitProcess", void 0);
|
|
762
749
|
|
|
763
|
-
exports.GenerateMigration =
|
|
750
|
+
exports.GenerateMigration = Fe = e.__decorate([ p.Transient() ], exports.GenerateMigration);
|
|
764
751
|
|
|
765
752
|
exports.Application = Application;
|