@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.
@@ -1,6 +1,6 @@
1
1
  import { applyDecorators } from '@nestjs/common';
2
2
  import { Column } from 'typeorm';
3
- import { TypeormTimeTransformer } from '@appwise/time';
3
+ import { TypeormTimeTransformer } from '@wisemen/time';
4
4
  export function TimeColumn(options) {
5
5
  return applyDecorators(Column({
6
6
  ...options,
@@ -0,0 +1,2 @@
1
+ export * from './migrate.js';
2
+ export * from './ssl.js';
@@ -0,0 +1,3 @@
1
+ export * from './migrate.js';
2
+ export * from './ssl.js';
3
+ //# sourceMappingURL=index.js.map
@@ -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,2 @@
1
+ import { DataSource } from 'typeorm';
2
+ export declare function migrate(source: DataSource): Promise<void>;
@@ -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,2 @@
1
+ import { TlsOptions } from 'tls';
2
+ export declare function sslHelper(type?: string): boolean | TlsOptions;
@@ -0,0 +1,10 @@
1
+ export function sslHelper(type) {
2
+ if (type === 'ignore')
3
+ return { rejectUnauthorized: false };
4
+ if (type === 'false')
5
+ return false;
6
+ if (type === 'true')
7
+ return true;
8
+ return false;
9
+ }
10
+ //# sourceMappingURL=ssl.js.map
@@ -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
@@ -4,3 +4,4 @@ export * from './columns/index.js';
4
4
  export * from './operators/index.js';
5
5
  export * from './types/index.js';
6
6
  export * from './naming/index.js';
7
+ export * from './helpers/index.js';
package/dist/index.js CHANGED
@@ -4,4 +4,5 @@ export * from './columns/index.js';
4
4
  export * from './operators/index.js';
5
5
  export * from './types/index.js';
6
6
  export * from './naming/index.js';
7
+ export * from './helpers/index.js';
7
8
  //# sourceMappingURL=index.js.map
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",
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:appwise-labs/node-core.git"
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": {