@wisemen/nestjs-typeorm 0.0.3 → 0.0.4
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/dist/columns/time-column.js +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +3 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/migrate.d.ts +2 -0
- package/dist/helpers/migrate.js +19 -0
- package/dist/helpers/migrate.js.map +1 -0
- package/dist/helpers/ssl.d.ts +2 -0
- package/dist/helpers/ssl.js +10 -0
- package/dist/helpers/ssl.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { applyDecorators } from '@nestjs/common';
|
|
2
2
|
import { Column } from 'typeorm';
|
|
3
|
-
import { TypeormTimeTransformer } from '@
|
|
3
|
+
import { TypeormTimeTransformer } from '@wisemen/time';
|
|
4
4
|
export function TimeColumn(options) {
|
|
5
5
|
return applyDecorators(Column({
|
|
6
6
|
...options,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export async function migrate(source) {
|
|
2
|
+
while (true) {
|
|
3
|
+
try {
|
|
4
|
+
const hasMigrations = await source.showMigrations();
|
|
5
|
+
if (!hasMigrations)
|
|
6
|
+
return;
|
|
7
|
+
await source.query('CREATE TABLE "_lock" ("id" SERIAL NOT NULL, PRIMARY KEY ("id"));');
|
|
8
|
+
break;
|
|
9
|
+
}
|
|
10
|
+
catch (_e) {
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
console.log('Database lock table (_lock) already exists. Waiting for release...');
|
|
13
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
await source.runMigrations({ transaction: 'all' });
|
|
17
|
+
await source.query('DROP TABLE "_lock"');
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../lib/helpers/migrate.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,OAAO,CAAE,MAAkB;IAC/C,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC;YACH,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAA;YAEnD,IAAI,CAAC,aAAa;gBAAE,OAAM;YAE1B,MAAM,MAAM,CAAC,KAAK,CAChB,kEAAkE,CACnE,CAAA;YAED,MAAK;QACP,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,sCAAsC;YACtC,OAAO,CAAC,GAAG,CACT,oEAAoE,CACrE,CAAA;YACD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;QACzD,CAAC;IACH,CAAC;IAED,MAAM,MAAM,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAA;IAClD,MAAM,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssl.js","sourceRoot":"","sources":["../../lib/helpers/ssl.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAE,IAAa;IACtC,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAA;IAC3D,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,KAAK,CAAA;IAClC,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAA;IAEhC,OAAO,KAAK,CAAA;AACd,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AAExB,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AAExB,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wisemen/nestjs-typeorm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"license": "GPL",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "git@github.com:
|
|
28
|
+
"url": "git@github.com:wisemen-digital/node-core.git"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@nestjs/typeorm": "^10.0.2",
|
|
32
|
+
"@wisemen/time": "^0.0.17",
|
|
32
33
|
"change-case": "^5.4.4"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|