@asapjs/sequelize 0.10.39 → 0.10.40
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/types/bigint.d.ts +12 -0
- package/dist/types/bigint.d.ts.map +1 -0
- package/dist/types/bigint.js +27 -0
- package/dist/types/bigint.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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;
|
|
3
4
|
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;
|
|
4
5
|
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;
|
|
5
6
|
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":"AAuBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAuBlB,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,6 +5,7 @@ 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"));
|
|
8
9
|
const long_1 = __importDefault(require("./long"));
|
|
9
10
|
const float_1 = __importDefault(require("./float"));
|
|
10
11
|
const decemal_1 = __importDefault(require("./decemal"));
|
|
@@ -27,6 +28,7 @@ const array_1 = __importDefault(require("./array"));
|
|
|
27
28
|
const paging_1 = __importDefault(require("./paging"));
|
|
28
29
|
exports.TypeIs = {
|
|
29
30
|
INT: int_1.default,
|
|
31
|
+
BIGINT: bigint_1.default,
|
|
30
32
|
LONG: long_1.default,
|
|
31
33
|
FLOAT: float_1.default,
|
|
32
34
|
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,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"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA8B;AAC9B,sDAAoC;AACpC,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,MAAM,EAAE,gBAAY;IACpB,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.40",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"winston": "^3.6.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@asapjs/core": "^0.10.
|
|
21
|
+
"@asapjs/core": "^0.10.40",
|
|
22
22
|
"@types/body-parser": "^1.19.2",
|
|
23
23
|
"@types/cors": "^2.8.12",
|
|
24
24
|
"@types/express": "^4.17.13",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"sequelize": "^6.17.0",
|
|
33
33
|
"sequelize-typescript": "^2.1.3"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "ce1e3366807b48da1047c203e330a64f9dd933cd"
|
|
36
36
|
}
|