@asapjs/sequelize 0.10.40 → 0.10.43
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/sequelize/index.d.ts +0 -1
- package/dist/sequelize/index.d.ts.map +1 -1
- package/dist/sequelize/index.js +3 -29
- package/dist/sequelize/index.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -3
- package/dist/types/bigint.d.ts +0 -12
- package/dist/types/bigint.d.ts.map +0 -1
- package/dist/types/bigint.js +0 -27
- package/dist/types/bigint.js.map +0 -1
- package/dist/utils/promiseTimeout.d.ts +0 -2
- package/dist/utils/promiseTimeout.d.ts.map +0 -1
- package/dist/utils/promiseTimeout.js +0 -12
- package/dist/utils/promiseTimeout.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ExtendableDto, PaginationQueryDto, Dto } from './dto';
|
|
2
|
-
export { initSequelizeModule, getSequelize, modelsSync, generateDBML
|
|
2
|
+
export { initSequelizeModule, getSequelize, modelsSync, generateDBML } from './sequelize';
|
|
3
3
|
export { default as Repository } from './repository';
|
|
4
4
|
export { Table } from './table';
|
|
5
5
|
export { TypeIs, DtoOrTypeIs, getData, TypeIsData } from './types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getConsoleData = exports.getDBMLData = exports.getUserIdInQuery = exports.getData = exports.TypeIs = exports.Table = exports.Repository = exports.
|
|
6
|
+
exports.getConsoleData = exports.getDBMLData = exports.getUserIdInQuery = exports.getData = exports.TypeIs = exports.Table = exports.Repository = exports.generateDBML = exports.modelsSync = exports.getSequelize = exports.initSequelizeModule = exports.Dto = exports.PaginationQueryDto = exports.ExtendableDto = void 0;
|
|
7
7
|
var dto_1 = require("./dto");
|
|
8
8
|
Object.defineProperty(exports, "ExtendableDto", { enumerable: true, get: function () { return dto_1.ExtendableDto; } });
|
|
9
9
|
Object.defineProperty(exports, "PaginationQueryDto", { enumerable: true, get: function () { return dto_1.PaginationQueryDto; } });
|
|
@@ -13,7 +13,6 @@ Object.defineProperty(exports, "initSequelizeModule", { enumerable: true, get: f
|
|
|
13
13
|
Object.defineProperty(exports, "getSequelize", { enumerable: true, get: function () { return sequelize_1.getSequelize; } });
|
|
14
14
|
Object.defineProperty(exports, "modelsSync", { enumerable: true, get: function () { return sequelize_1.modelsSync; } });
|
|
15
15
|
Object.defineProperty(exports, "generateDBML", { enumerable: true, get: function () { return sequelize_1.generateDBML; } });
|
|
16
|
-
Object.defineProperty(exports, "healthCheck", { enumerable: true, get: function () { return sequelize_1.healthCheck; } });
|
|
17
16
|
var repository_1 = require("./repository");
|
|
18
17
|
Object.defineProperty(exports, "Repository", { enumerable: true, get: function () { return __importDefault(repository_1).default; } });
|
|
19
18
|
var table_1 = require("./table");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA+D;AAAtD,oGAAA,aAAa,OAAA;AAAE,yGAAA,kBAAkB,OAAA;AAAE,0FAAA,GAAG,OAAA;AAC/C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA+D;AAAtD,oGAAA,aAAa,OAAA;AAAE,yGAAA,kBAAkB,OAAA;AAAE,0FAAA,GAAG,OAAA;AAC/C,yCAA0F;AAAjF,gHAAA,mBAAmB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,yGAAA,YAAY,OAAA;AACpE,2CAAqD;AAA5C,yHAAA,OAAO,OAAc;AAC9B,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,iCAAmE;AAA1D,+FAAA,MAAM,OAAA;AAAe,gGAAA,OAAO,OAAA;AACrC,6DAA4D;AAAnD,oHAAA,gBAAgB,OAAA;AACzB,+BAAqC;AAA5B,mGAAA,WAAW,OAAA;AACpB,qCAA2C;AAAlC,yGAAA,cAAc,OAAA"}
|
|
@@ -8,5 +8,4 @@ export declare const modelsSync: () => Promise<boolean>;
|
|
|
8
8
|
export declare const getSequelize: () => Sequelize;
|
|
9
9
|
export declare const initSequelizeModule: (dirname: string) => Promise<Sequelize>;
|
|
10
10
|
export declare const generateDBML: () => Promise<void>;
|
|
11
|
-
export declare const healthCheck: () => Promise<boolean>;
|
|
12
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sequelize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAKrF,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sequelize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAKrF,OAAO,kBAAkB,CAAC;AAQ1B,eAAO,MAAM,MAAM,WAAkB,gBAAgB,uBA0CpD,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAgB,MAAM,WAAW,MAAM,kBAgB3D,CAAC;AAEF,eAAO,MAAM,oBAAoB,qBAGhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,qBAc5B,CAAC;AAEF,eAAO,MAAM,UAAU,wBAItB,CAAC;AAEF,eAAO,MAAM,YAAY,iBAAmB,CAAC;AAE7C,eAAO,MAAM,mBAAmB,YAAmB,MAAM,KAAG,QAAQ,SAAS,CAM5E,CAAC;AAEF,eAAO,MAAM,YAAY,qBAAiB,CAAC"}
|
package/dist/sequelize/index.js
CHANGED
|
@@ -12,12 +12,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.generateDBML = exports.initSequelizeModule = exports.getSequelize = exports.modelsSync = exports.addDtosToSwagger = exports.addModelsToSequelize = exports.loadPath = exports.dbInit = void 0;
|
|
16
16
|
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
17
17
|
const fs_1 = __importDefault(require("fs"));
|
|
18
18
|
const core_1 = require("@asapjs/core");
|
|
19
19
|
require("reflect-metadata");
|
|
20
|
-
const promiseTimeout_1 = require("../utils/promiseTimeout");
|
|
21
20
|
let container = null;
|
|
22
21
|
const models = [];
|
|
23
22
|
const dtos = [];
|
|
@@ -62,13 +61,6 @@ const dbInit = (config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
62
61
|
return sequelize;
|
|
63
62
|
});
|
|
64
63
|
exports.dbInit = dbInit;
|
|
65
|
-
const extensions = ['js', 'ts'];
|
|
66
|
-
const extensionInlcude = (includeFileName, fileName) => {
|
|
67
|
-
return extensions
|
|
68
|
-
.map((extension) => `${includeFileName}.${extension}`)
|
|
69
|
-
.map((v) => fileName.includes(v))
|
|
70
|
-
.some((v) => v === true);
|
|
71
|
-
};
|
|
72
64
|
const loadPath = (path, subPath) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
65
|
const files = yield fs_1.default.readdirSync(path + subPath, { withFileTypes: true });
|
|
74
66
|
// const extension = process.env.NODE_ENV === 'production' ? 'js' : 'ts';
|
|
@@ -77,10 +69,10 @@ const loadPath = (path, subPath) => __awaiter(void 0, void 0, void 0, function*
|
|
|
77
69
|
if (file.isDirectory()) {
|
|
78
70
|
yield (0, exports.loadPath)(path, `${subPath}/${file.name}`);
|
|
79
71
|
}
|
|
80
|
-
else if (
|
|
72
|
+
else if (file.name.includes(`Table.${extension}`) && file.name.endsWith('map') === false) {
|
|
81
73
|
models.push(require(`${path}/${subPath}/${file.name}`).default);
|
|
82
74
|
}
|
|
83
|
-
else if (
|
|
75
|
+
else if (file.name.includes(`Dto.${extension}`) && file.name.endsWith('map') === false) {
|
|
84
76
|
const dto = require(`${path}/${subPath}/${file.name}`).default;
|
|
85
77
|
if (dto) {
|
|
86
78
|
dtos.push(dto);
|
|
@@ -125,22 +117,4 @@ const initSequelizeModule = (dirname) => __awaiter(void 0, void 0, void 0, funct
|
|
|
125
117
|
exports.initSequelizeModule = initSequelizeModule;
|
|
126
118
|
const generateDBML = () => __awaiter(void 0, void 0, void 0, function* () { });
|
|
127
119
|
exports.generateDBML = generateDBML;
|
|
128
|
-
const healthCheck = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
129
|
-
const connection = container;
|
|
130
|
-
if (!connection) {
|
|
131
|
-
core_1.logger.error(`@sequelize(health-check) :: Sequelize connection is not initialized`);
|
|
132
|
-
throw Error('Sequelize connection is not initialized');
|
|
133
|
-
}
|
|
134
|
-
try {
|
|
135
|
-
const check = connection.query(`SELECT 1`);
|
|
136
|
-
yield (0, promiseTimeout_1.promiseTimeout)(1000, check);
|
|
137
|
-
core_1.logger.info(`@sequelize(health-check) :: Sequelize connection is healthy`);
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
catch (err) {
|
|
141
|
-
core_1.logger.error(`@sequelize(health-check) :: Sequelize connection is not healthy`);
|
|
142
|
-
throw Error('Sequelize connection is not healthy');
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
exports.healthCheck = healthCheck;
|
|
146
120
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sequelize/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAqF;AACrF,4CAAoB;AAEpB,uCAAiD;AAEjD,4BAA0B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sequelize/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAqF;AACrF,4CAAoB;AAEpB,uCAAiD;AAEjD,4BAA0B;AAE1B,IAAI,SAAS,GAAqB,IAAI,CAAC;AAEvC,MAAM,MAAM,GAAiC,EAAE,CAAC;AAEhD,MAAM,IA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,CAAA,CAAC;AAJW,QAAA,UAAU,cAIrB;AAEK,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,SAAU,CAAC;AAAhC,QAAA,YAAY,gBAAoB;AAEtC,MAAM,mBAAmB,GAAG,CAAO,OAAe,EAAsB,EAAE;IAC/E,MAAM,WAAW,GAAG,MAAM,IAAA,cAAM,EAAE,IAAA,gBAAS,GAAU,CAAC,EAAE,CAAC,CAAC;IAC1D,MAAM,IAAA,gBAAQ,EAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5B,MAAM,IAAA,4BAAoB,GAAE,CAAC;IAC7B,MAAM,IAAA,wBAAgB,GAAE,CAAC;IACzB,OAAO,WAAW,CAAC;AACrB,CAAC,CAAA,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEK,MAAM,YAAY,GAAG,GAAS,EAAE,kDAAE,CAAC,CAAA,CAAC;AAA9B,QAAA,YAAY,gBAAkB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const TypeIs: {
|
|
2
2
|
INT: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | import("./int").TypeIsIntOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
3
|
-
BIGINT: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | import("./bigint").TypeIsBigIntOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
4
3
|
LONG: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | import("./long").TypeIsLongOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
5
4
|
FLOAT: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | import("./float").TypeIsFloatOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
6
5
|
DECIMAL: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | import("./decemal").TypeIsDecemalOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;CAsBlB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getData = exports.getTypesData = exports.TypeIs = void 0;
|
|
7
7
|
const int_1 = __importDefault(require("./int"));
|
|
8
|
-
const bigint_1 = __importDefault(require("./bigint"));
|
|
9
8
|
const long_1 = __importDefault(require("./long"));
|
|
10
9
|
const float_1 = __importDefault(require("./float"));
|
|
11
10
|
const decemal_1 = __importDefault(require("./decemal"));
|
|
@@ -28,7 +27,6 @@ const array_1 = __importDefault(require("./array"));
|
|
|
28
27
|
const paging_1 = __importDefault(require("./paging"));
|
|
29
28
|
exports.TypeIs = {
|
|
30
29
|
INT: int_1.default,
|
|
31
|
-
BIGINT: bigint_1.default,
|
|
32
30
|
LONG: long_1.default,
|
|
33
31
|
FLOAT: float_1.default,
|
|
34
32
|
DECIMAL: decemal_1.default,
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,oDAAkC;AAClC,wDAAsC;AACtC,sDAAoC;AACpC,sDAAoC;AACpC,kDAAgC;AAChC,0DAAwC;AACxC,kDAAgC;AAChC,kDAAgC;AAChC,sDAAoC;AACpC,sDAAoC;AACpC,wDAAsC;AACtC,0DAAwC;AACxC,0DAAwC;AACxC,8DAA4C;AAC5C,4DAA0C;AAC1C,gDAA8B;AAC9B,oDAAkC;AAClC,oDAAkC;AAClC,sDAAoC;AAEvB,QAAA,MAAM,GAAG;IACpB,GAAG,EAAE,aAAS;IACd,IAAI,EAAE,cAAU;IAChB,KAAK,EAAE,eAAW;IAClB,OAAO,EAAE,iBAAa;IACtB,MAAM,EAAE,gBAAY;IACpB,MAAM,EAAE,gBAAY;IACpB,IAAI,EAAE,cAAU;IAChB,QAAQ,EAAE,kBAAc;IACxB,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,cAAU;IAChB,MAAM,EAAE,gBAAY;IACpB,MAAM,EAAE,gBAAY;IACpB,OAAO,EAAE,iBAAa;IACtB,QAAQ,EAAE,kBAAc;IACxB,QAAQ,EAAE,kBAAc;IACxB,UAAU,EAAE,oBAAgB;IAC5B,SAAS,EAAE,mBAAe;IAC1B,GAAG,EAAE,aAAS;IACd,KAAK,EAAE,eAAW;IAClB,KAAK,EAAE,eAAW;IAClB,MAAM,EAAE,gBAAY;CACrB,CAAC;AAGF,4DAA+E;AAA1D,6GAAA,YAAY,OAAA;AAAE,wGAAA,OAAO,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asapjs/sequelize",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.43",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,6 +31,5 @@
|
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"sequelize": "^6.17.0",
|
|
33
33
|
"sequelize-typescript": "^2.1.3"
|
|
34
|
-
}
|
|
35
|
-
"gitHead": "ce1e3366807b48da1047c203e330a64f9dd933cd"
|
|
34
|
+
}
|
|
36
35
|
}
|
package/dist/types/bigint.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface TypeIsBigIntOption {
|
|
2
|
-
decimals?: number;
|
|
3
|
-
precision?: number;
|
|
4
|
-
scale?: number;
|
|
5
|
-
comment?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const TypeIsIntToSwagger: (options?: (TypeIsBigIntOption & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
8
|
-
export declare const TypeIsIntToSequelize: (options?: (TypeIsBigIntOption & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>;
|
|
9
|
-
export declare const TypeIsIntFixValue: (o: any) => any;
|
|
10
|
-
declare const TypeIsInt: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | TypeIsBigIntOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
11
|
-
export default TypeIsInt;
|
|
12
|
-
//# sourceMappingURL=bigint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../src/types/bigint.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,kBAAkB,+LAI5B,CAAC;AAEJ,eAAO,MAAM,oBAAoB,6NAI9B,CAAC;AAEJ,eAAO,MAAM,iBAAiB,MAAO,GAAG,QAGvC,CAAC;AAEF,QAAA,MAAM,SAAS,iSAKZ,CAAC;AAEJ,eAAe,SAAS,CAAC"}
|
package/dist/types/bigint.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeIsIntFixValue = exports.TypeIsIntToSequelize = exports.TypeIsIntToSwagger = void 0;
|
|
4
|
-
const sequelize_1 = require("sequelize");
|
|
5
|
-
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
-
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
-
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
-
exports.TypeIsIntToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
-
type: 'integer',
|
|
10
|
-
format: 'int32',
|
|
11
|
-
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
-
}));
|
|
13
|
-
exports.TypeIsIntToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: sequelize_1.DataTypes.BIGINT(options), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
14
|
-
const TypeIsIntFixValue = (o) => {
|
|
15
|
-
if (o === undefined || o === null)
|
|
16
|
-
return o;
|
|
17
|
-
return parseInt(String(o), 10);
|
|
18
|
-
};
|
|
19
|
-
exports.TypeIsIntFixValue = TypeIsIntFixValue;
|
|
20
|
-
const TypeIsInt = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
21
|
-
__name: 'bigint',
|
|
22
|
-
toSwagger: () => (0, exports.TypeIsIntToSwagger)(options),
|
|
23
|
-
toSequelize: () => (0, exports.TypeIsIntToSequelize)(options),
|
|
24
|
-
fixValue: exports.TypeIsIntFixValue,
|
|
25
|
-
}));
|
|
26
|
-
exports.default = TypeIsInt;
|
|
27
|
-
//# sourceMappingURL=bigint.js.map
|
package/dist/types/bigint.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bigint.js","sourceRoot":"","sources":["../../src/types/bigint.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAS9C,QAAA,kBAAkB,GAAG,IAAA,uCAAkB,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACrF,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,oBAAoB,GAAG,IAAA,2CAAoB,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,iCACrF,OAAO,KACV,IAAI,EAAE,qBAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAC/B,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEG,MAAM,iBAAiB,GAAG,CAAC,CAAM,EAAE,EAAE;IAC1C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B;AAEF,MAAM,SAAS,GAAG,IAAA,6BAAa,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAChE,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,0BAAkB,EAAC,OAAO,CAAC;IAC5C,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,4BAAoB,EAAC,OAAO,CAAC;IAChD,QAAQ,EAAE,yBAAiB;CAC5B,CAAC,CAAC,CAAC;AAEJ,kBAAe,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promiseTimeout.d.ts","sourceRoot":"","sources":["../../src/utils/promiseTimeout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,OAAiB,MAAM,WAAW,QAAQ,GAAG,CAAC,KAAG,QAAQ,GAAG,CAMtF,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.promiseTimeout = void 0;
|
|
4
|
-
const promiseTimeout = function (ms, promise) {
|
|
5
|
-
let timer;
|
|
6
|
-
return Promise.race([
|
|
7
|
-
promise,
|
|
8
|
-
new Promise((_, reject) => (timer = setTimeout(() => reject(`Timed out in ${ms}ms.`), ms))),
|
|
9
|
-
]).finally(() => clearTimeout(timer));
|
|
10
|
-
};
|
|
11
|
-
exports.promiseTimeout = promiseTimeout;
|
|
12
|
-
//# sourceMappingURL=promiseTimeout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promiseTimeout.js","sourceRoot":"","sources":["../../src/utils/promiseTimeout.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,UAAU,EAAU,EAAE,OAAqB;IACvE,IAAI,KAAqB,CAAC;IAC1B,OAAO,OAAO,CAAC,IAAI,CAAC;QAClB,OAAO;QACP,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;KAC5F,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB"}
|