@asapjs/sequelize 0.2.4 → 0.2.5
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/dbml/index.d.ts +1 -1
- package/dist/dbml/index.d.ts.map +1 -1
- package/dist/dto/ExtendableDto.d.ts +22 -0
- package/dist/dto/ExtendableDto.d.ts.map +1 -0
- package/dist/dto/ExtendableDto.js +133 -0
- package/dist/dto/ExtendableDto.js.map +1 -0
- package/dist/dto/PaginationQueryDto.d.ts +6 -0
- package/dist/dto/PaginationQueryDto.d.ts.map +1 -0
- package/dist/dto/PaginationQueryDto.js +25 -0
- package/dist/dto/PaginationQueryDto.js.map +1 -0
- package/dist/dto/index.d.ts +2 -36
- package/dist/dto/index.d.ts.map +1 -1
- package/dist/dto/index.js +8 -169
- package/dist/dto/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -7
- package/dist/index.js.map +1 -1
- package/dist/table/index.d.ts +2 -1
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/index.js +22 -26
- package/dist/table/index.js.map +1 -1
- package/dist/types/array.d.ts +7 -0
- package/dist/types/array.d.ts.map +1 -0
- package/dist/types/array.js +42 -0
- package/dist/types/array.js.map +1 -0
- package/dist/types/base64.d.ts +10 -0
- package/dist/types/base64.d.ts.map +1 -0
- package/dist/types/base64.js +20 -0
- package/dist/types/base64.js.map +1 -0
- package/dist/types/belongsto.d.ts +6 -0
- package/dist/types/belongsto.d.ts.map +1 -0
- package/dist/types/belongsto.js +27 -0
- package/dist/types/belongsto.js.map +1 -0
- package/dist/types/binary.d.ts +10 -0
- package/dist/types/binary.d.ts.map +1 -0
- package/dist/types/binary.js +20 -0
- package/dist/types/binary.js.map +1 -0
- package/dist/types/boolean.d.ts +9 -0
- package/dist/types/boolean.d.ts.map +1 -0
- package/dist/types/boolean.js +27 -0
- package/dist/types/boolean.js.map +1 -0
- package/dist/types/dateonly.d.ts +8 -0
- package/dist/types/dateonly.d.ts.map +1 -0
- package/dist/types/dateonly.js +20 -0
- package/dist/types/dateonly.js.map +1 -0
- package/dist/types/datetime.d.ts +8 -0
- package/dist/types/datetime.d.ts.map +1 -0
- package/dist/types/datetime.js +20 -0
- package/dist/types/datetime.js.map +1 -0
- package/dist/types/decemal.d.ts +11 -0
- package/dist/types/decemal.d.ts.map +1 -0
- package/dist/types/decemal.js +30 -0
- package/dist/types/decemal.js.map +1 -0
- package/dist/types/double.d.ts +11 -0
- package/dist/types/double.d.ts.map +1 -0
- package/dist/types/double.js +27 -0
- package/dist/types/double.js.map +1 -0
- package/dist/types/dto.d.ts +10 -0
- package/dist/types/dto.d.ts.map +1 -0
- package/dist/types/dto.js +22 -0
- package/dist/types/dto.js.map +1 -0
- package/dist/types/enum.d.ts +9 -0
- package/dist/types/enum.d.ts.map +1 -0
- package/dist/types/enum.js +26 -0
- package/dist/types/enum.js.map +1 -0
- package/dist/types/float.d.ts +11 -0
- package/dist/types/float.d.ts.map +1 -0
- package/dist/types/float.js +27 -0
- package/dist/types/float.js.map +1 -0
- package/dist/types/foreignkey.d.ts +6 -0
- package/dist/types/foreignkey.d.ts.map +1 -0
- package/dist/types/foreignkey.js +33 -0
- package/dist/types/foreignkey.js.map +1 -0
- package/dist/types/generators/toSequelizeGenerator.d.ts +3 -0
- package/dist/types/generators/toSequelizeGenerator.d.ts.map +1 -0
- package/dist/types/generators/toSequelizeGenerator.js +6 -0
- package/dist/types/generators/toSequelizeGenerator.js.map +1 -0
- package/dist/types/generators/toSwaggerGenerator.d.ts +9 -0
- package/dist/types/generators/toSwaggerGenerator.d.ts.map +1 -0
- package/dist/types/generators/toSwaggerGenerator.js +6 -0
- package/dist/types/generators/toSwaggerGenerator.js.map +1 -0
- package/dist/types/generators/typeGenerator.d.ts +15 -0
- package/dist/types/generators/typeGenerator.d.ts.map +1 -0
- package/dist/types/generators/typeGenerator.js +38 -0
- package/dist/types/generators/typeGenerator.js.map +1 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +53 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/int.d.ts +12 -0
- package/dist/types/int.d.ts.map +1 -0
- package/dist/types/int.js +27 -0
- package/dist/types/int.js.map +1 -0
- package/dist/types/json.d.ts +9 -0
- package/dist/types/json.d.ts.map +1 -0
- package/dist/types/json.js +31 -0
- package/dist/types/json.js.map +1 -0
- package/dist/types/long.d.ts +12 -0
- package/dist/types/long.d.ts.map +1 -0
- package/dist/types/long.js +27 -0
- package/dist/types/long.js.map +1 -0
- package/dist/types/paging.d.ts +6 -0
- package/dist/types/paging.d.ts.map +1 -0
- package/dist/types/paging.js +65 -0
- package/dist/types/paging.js.map +1 -0
- package/dist/types/password.d.ts +6 -0
- package/dist/types/password.d.ts.map +1 -0
- package/dist/types/password.js +20 -0
- package/dist/types/password.js.map +1 -0
- package/dist/types/query.d.ts +20 -0
- package/dist/types/query.d.ts.map +1 -0
- package/dist/types/query.js +31 -0
- package/dist/types/query.js.map +1 -0
- package/dist/types/string.d.ts +11 -0
- package/dist/types/string.d.ts.map +1 -0
- package/dist/types/string.js +26 -0
- package/dist/types/string.js.map +1 -0
- package/dist/types/text.d.ts +9 -0
- package/dist/types/text.d.ts.map +1 -0
- package/dist/types/text.js +16 -0
- package/dist/types/text.js.map +1 -0
- package/dist/types/type.d.ts +7 -0
- package/dist/types/type.d.ts.map +1 -0
- package/dist/types/type.js +3 -0
- package/dist/types/type.js.map +1 -0
- package/package.json +1 -1
- package/dist/type/index.d.ts +0 -110
- package/dist/type/index.d.ts.map +0 -1
- package/dist/type/index.js +0 -345
- package/dist/type/index.js.map +0 -1
package/dist/table/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":";;;AACA,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":";;;AACA,+DAA8E;AAC9E,kDAA8D;AAC9D,oDAA+D;AAC/D,kCAAmC;AACnC,oCAAmD;AAEnD,SAAgB,KAAK,CAAC,OAAqB;IACzC,OAAO,UAA+B,MAAS;QAC7C,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC;QACnD,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,MAAM,CAAC,CAAC;QAEnC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;YAC5C,IAAI,IAAI,CAAC,MAAM,KAAK,YAAY,EAAE;gBAChC,IAAA,qCAAwB,EAAI,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;aAChD;iBAAM,IAAI,IAAI,CAAC,MAAM,KAAK,WAAW,EAAE;gBACtC,IAAA,oCAAwB,EAAI,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;aAChD;iBAAM;gBACL,IAAA,mCAAY,EAAC,MAAM,CAAC,SAAS,EAAE,GAAG,EAAG,IAAY,CAAC,WAAW,EAAE,CAAC,CAAC;aAClE;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,MAAK,KAAK,EAAE;YACjC,IAAA,iCAAU,EAAC,MAAM,CAAC,SAAS,EAAE;gBAC3B,SAAS,EAAE,YAAY;gBACvB,UAAU,EAAE,IAAI;aACjB,CAAC,CAAC;YAEH,IAAA,iCAAU,EAAC,MAAM,CAAC,SAAS,EAAE;gBAC3B,SAAS,EAAE,YAAY;gBACvB,UAAU,EAAE,IAAI;aACjB,CAAC,CAAC;SACJ;QAED,gCAAgC;QAChC,IAAA,eAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAExC,uBAAuB;QACvB,IAAA,mCAAY,EAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC1C,IAAA,iCAAU,EAAC,MAAM,CAAC,SAAS,kCACtB,OAAO,KACV,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,oBAAoB,IAC7B,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAtCD,sBAsCC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DtoOrTypeIs } from './index';
|
|
2
|
+
import { TypeIsData } from './generators/typeGenerator';
|
|
3
|
+
export declare const TypeIsArrayToSwagger: (options?: (DtoOrTypeIs & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
4
|
+
export declare const TypeIsArrayFixValue: (o: any) => any;
|
|
5
|
+
declare const TypeIsArray: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | DtoOrTypeIs)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & TypeIsData;
|
|
6
|
+
export default TypeIsArray;
|
|
7
|
+
//# sourceMappingURL=array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/types/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAiB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAKvE,eAAO,MAAM,oBAAoB,oMAe/B,CAAC;AAEH,eAAO,MAAM,mBAAmB,MAAO,GAAG,QAOzC,CAAC;AAEF,QAAA,MAAM,WAAW,iQAId,CAAC;AAEJ,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TypeIsArrayFixValue = exports.TypeIsArrayToSwagger = void 0;
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
const isClass_1 = __importDefault(require("../utils/isClass"));
|
|
9
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
10
|
+
exports.TypeIsArrayToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
let items = {};
|
|
13
|
+
const isDto = (0, isClass_1.default)(options);
|
|
14
|
+
if (isDto) {
|
|
15
|
+
items = new options().swagger();
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
items = (_b = (_a = options()).toSwagger) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
type: 'array',
|
|
22
|
+
items,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
const TypeIsArrayFixValue = (o) => {
|
|
26
|
+
try {
|
|
27
|
+
if (typeof o === 'string')
|
|
28
|
+
return JSON.parse(String(o));
|
|
29
|
+
return o;
|
|
30
|
+
}
|
|
31
|
+
catch (_a) {
|
|
32
|
+
return o;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.TypeIsArrayFixValue = TypeIsArrayFixValue;
|
|
36
|
+
const TypeIsArray = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
37
|
+
__name: 'array',
|
|
38
|
+
toSwagger: () => (0, exports.TypeIsArrayToSwagger)(options),
|
|
39
|
+
fixValue: exports.TypeIsArrayFixValue,
|
|
40
|
+
}));
|
|
41
|
+
exports.default = TypeIsArray;
|
|
42
|
+
//# sourceMappingURL=array.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/types/array.ts"],"names":[],"mappings":";;;;;;AACA,8DAAuE;AACvE,+DAAuC;AAEvC,wEAAqE;AAExD,QAAA,oBAAoB,GAAG,IAAA,uCAAkB,EAAc,CAAC,OAAO,EAAE,EAAE;;IAC9E,IAAI,KAAK,GAAG,EAAE,CAAC;IAEf,MAAM,KAAK,GAAG,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;IAE/B,IAAI,KAAK,EAAE;QACT,KAAK,GAAG,IAAK,OAAgC,EAAE,CAAC,OAAO,EAAE,CAAC;KAC3D;SAAM;QACL,KAAK,GAAG,MAAA,MAAC,OAA4B,EAAE,EAAC,SAAS,kDAAI,CAAC;KACvD;IAED,OAAO;QACL,IAAI,EAAE,OAAO;QACb,KAAK;KACN,CAAC;AACJ,CAAC,CAAC,CAAC;AAEI,MAAM,mBAAmB,GAAG,CAAC,CAAM,EAAE,EAAE;IAC5C,IAAI;QACF,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,CAAC;KACV;IAAC,WAAM;QACN,OAAO,CAAC,CAAC;KACV;AACH,CAAC,CAAC;AAPW,QAAA,mBAAmB,uBAO9B;AAEF,MAAM,WAAW,GAAG,IAAA,6BAAa,EAAc,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3D,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,4BAAoB,EAAC,OAAO,CAAC;IAC9C,QAAQ,EAAE,2BAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlobSize } from 'sequelize/types';
|
|
2
|
+
export interface TypeIsBase64Option {
|
|
3
|
+
length?: BlobSize;
|
|
4
|
+
comment?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TypeIsBase64ToSwagger: (options?: (TypeIsBase64Option & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
7
|
+
export declare const TypeIsBase64ToSequelize: (options?: (TypeIsBase64Option & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
8
|
+
declare const TypeIsBase64: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsBase64Option)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
9
|
+
export default TypeIsBase64;
|
|
10
|
+
//# sourceMappingURL=base64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/types/base64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,iBAAiB,CAAC;AAKtD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,qBAAqB,2MAI/B,CAAC;AAEJ,eAAO,MAAM,uBAAuB,qPAIjC,CAAC;AAEJ,QAAA,MAAM,YAAY,6SAIf,CAAC;AAEJ,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsBase64ToSequelize = exports.TypeIsBase64ToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsBase64ToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'string',
|
|
10
|
+
format: 'byte',
|
|
11
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
+
}));
|
|
13
|
+
exports.TypeIsBase64ToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.BLOB(options === null || options === void 0 ? void 0 : options.length), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
14
|
+
const TypeIsBase64 = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
15
|
+
__name: 'base64',
|
|
16
|
+
toSwagger: () => (0, exports.TypeIsBase64ToSwagger)(options),
|
|
17
|
+
toSequelize: () => (0, exports.TypeIsBase64ToSequelize)(options),
|
|
18
|
+
}));
|
|
19
|
+
exports.default = TypeIsBase64;
|
|
20
|
+
//# sourceMappingURL=base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src/types/base64.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AACtD,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAO9C,QAAA,qBAAqB,GAAG,IAAA,uCAAkB,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxF,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,uBAAuB,GAAG,IAAA,2CAAoB,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,iCACxF,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,IAAI,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,EACrC,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEJ,MAAM,YAAY,GAAG,IAAA,6BAAa,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACnE,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,6BAAqB,EAAC,OAAO,CAAC;IAC/C,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,+BAAuB,EAAC,OAAO,CAAC;CACpD,CAAC,CAAC,CAAC;AAEJ,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ClassType } from './index';
|
|
2
|
+
import { TypeIsData } from './generators/typeGenerator';
|
|
3
|
+
export declare const TypeIsBelongsToAddColumn: <T extends ClassType>(target: T, type: TypeIsData, key: string) => void;
|
|
4
|
+
declare const TypeIsBelongsTo: (...options: any[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & TypeIsData;
|
|
5
|
+
export default TypeIsBelongsTo;
|
|
6
|
+
//# sourceMappingURL=belongsto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"belongsto.d.ts","sourceRoot":"","sources":["../../src/types/belongsto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAiB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEvE,eAAO,MAAM,wBAAwB,yCAA0C,UAAU,OAAO,MAAM,SASrG,CAAC;AAEF,QAAA,MAAM,eAAe,oJAMlB,CAAC;AAEJ,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsBelongsToAddColumn = void 0;
|
|
4
|
+
const core_1 = require("@asapjs/core");
|
|
5
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
6
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
7
|
+
const TypeIsBelongsToAddColumn = (target, type, key) => {
|
|
8
|
+
if (!type.toSequelize) {
|
|
9
|
+
core_1.logger.error('@asapjs/sequelize :: TypeIs.BELONGSTO에 toSequelize가 정의되지 않았습니다.');
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
const { associatedClassGetter, optionsOrForeignKey } = type.toSequelize();
|
|
13
|
+
const options = (0, sequelize_typescript_1.getPreparedAssociationOptions)(optionsOrForeignKey);
|
|
14
|
+
if (!options.as)
|
|
15
|
+
options.as = key;
|
|
16
|
+
(0, sequelize_typescript_1.addAssociation)(target.prototype, new sequelize_typescript_1.BelongsToAssociation(associatedClassGetter, options));
|
|
17
|
+
};
|
|
18
|
+
exports.TypeIsBelongsToAddColumn = TypeIsBelongsToAddColumn;
|
|
19
|
+
const TypeIsBelongsTo = (0, typeGenerator_1.typeGenerator)((associatedClassGetter, optionsOrForeignKey) => ({
|
|
20
|
+
__name: 'belongsto',
|
|
21
|
+
toSequelize: () => ({
|
|
22
|
+
associatedClassGetter,
|
|
23
|
+
optionsOrForeignKey,
|
|
24
|
+
}),
|
|
25
|
+
}));
|
|
26
|
+
exports.default = TypeIsBelongsTo;
|
|
27
|
+
//# sourceMappingURL=belongsto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"belongsto.js","sourceRoot":"","sources":["../../src/types/belongsto.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AACtC,+DAA2G;AAE3G,8DAAuE;AAEhE,MAAM,wBAAwB,GAAG,CAAsB,MAAS,EAAE,IAAgB,EAAE,GAAW,EAAE,EAAE;IACxG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QACrB,aAAM,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC1E,MAAM,OAAO,GAAG,IAAA,oDAA6B,EAAC,mBAAmB,CAAC,CAAC;IACnE,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,GAAG,CAAC;IAClC,IAAA,qCAAc,EAAC,MAAM,CAAC,SAAS,EAAE,IAAI,2CAAoB,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC,CAAC;AATW,QAAA,wBAAwB,4BASnC;AAEF,MAAM,eAAe,GAAG,IAAA,6BAAa,EAAC,CAAC,qBAA0B,EAAE,mBAAyB,EAAE,EAAE,CAAC,CAAC;IAChG,MAAM,EAAE,WAAW;IACnB,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;QAClB,qBAAqB;QACrB,mBAAmB;KACpB,CAAC;CACH,CAAC,CAAC,CAAC;AAEJ,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BlobSize } from 'sequelize/types';
|
|
2
|
+
export interface TypeIsBinaryOption {
|
|
3
|
+
length?: BlobSize;
|
|
4
|
+
comment?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TypeIsBinaryToSwagger: (options?: (TypeIsBinaryOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
7
|
+
export declare const TypeIsBinaryToSequelize: (options?: (TypeIsBinaryOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
8
|
+
declare const TypeIsBinary: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsBinaryOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
9
|
+
export default TypeIsBinary;
|
|
10
|
+
//# sourceMappingURL=binary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../src/types/binary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,iBAAiB,CAAC;AAKtD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,qBAAqB,2MAI/B,CAAC;AAEJ,eAAO,MAAM,uBAAuB,qPAIjC,CAAC;AAEJ,QAAA,MAAM,YAAY,6SAIf,CAAC;AAEJ,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsBinaryToSequelize = exports.TypeIsBinaryToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsBinaryToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'string',
|
|
10
|
+
format: 'binary',
|
|
11
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
+
}));
|
|
13
|
+
exports.TypeIsBinaryToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.BLOB(options === null || options === void 0 ? void 0 : options.length), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
14
|
+
const TypeIsBinary = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
15
|
+
__name: 'binary',
|
|
16
|
+
toSwagger: () => (0, exports.TypeIsBinaryToSwagger)(options),
|
|
17
|
+
toSequelize: () => (0, exports.TypeIsBinaryToSequelize)(options),
|
|
18
|
+
}));
|
|
19
|
+
exports.default = TypeIsBinary;
|
|
20
|
+
//# sourceMappingURL=binary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../src/types/binary.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AACtD,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAO9C,QAAA,qBAAqB,GAAG,IAAA,uCAAkB,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxF,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,uBAAuB,GAAG,IAAA,2CAAoB,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,iCACxF,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,IAAI,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,EACrC,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEJ,MAAM,YAAY,GAAG,IAAA,6BAAa,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACnE,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,6BAAqB,EAAC,OAAO,CAAC;IAC/C,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,+BAAuB,EAAC,OAAO,CAAC;CACpD,CAAC,CAAC,CAAC;AAEJ,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface TypeIsBooleanOption {
|
|
2
|
+
comment?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const TypeIsBooleanToSwagger: (options?: (TypeIsBooleanOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
5
|
+
export declare const TypeIsBooleanToSequelize: (options?: (TypeIsBooleanOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
6
|
+
export declare const TypeIsBooleanFixValue: (o: any) => any;
|
|
7
|
+
declare const TypeIsBoolean: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsBooleanOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
8
|
+
export default TypeIsBoolean;
|
|
9
|
+
//# sourceMappingURL=boolean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../src/types/boolean.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,4MAGhC,CAAC;AAEJ,eAAO,MAAM,wBAAwB,sPAIlC,CAAC;AAEJ,eAAO,MAAM,qBAAqB,MAAO,GAAG,QAI3C,CAAC;AAEF,QAAA,MAAM,aAAa,8SAKhB,CAAC;AAEJ,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsBooleanFixValue = exports.TypeIsBooleanToSequelize = exports.TypeIsBooleanToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsBooleanToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'boolean',
|
|
10
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
11
|
+
}));
|
|
12
|
+
exports.TypeIsBooleanToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.BOOLEAN, comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
13
|
+
const TypeIsBooleanFixValue = (o) => {
|
|
14
|
+
if (o === undefined || o === null)
|
|
15
|
+
return o;
|
|
16
|
+
const v = String(o) === 'true' ? true : String(o) === 'false' ? false : !!o;
|
|
17
|
+
return Boolean(v);
|
|
18
|
+
};
|
|
19
|
+
exports.TypeIsBooleanFixValue = TypeIsBooleanFixValue;
|
|
20
|
+
const TypeIsBoolean = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
21
|
+
__name: 'boolean',
|
|
22
|
+
toSwagger: () => (0, exports.TypeIsBooleanToSwagger)(options),
|
|
23
|
+
toSequelize: () => (0, exports.TypeIsBooleanToSequelize)(options),
|
|
24
|
+
fixValue: exports.TypeIsBooleanFixValue,
|
|
25
|
+
}));
|
|
26
|
+
exports.default = TypeIsBoolean;
|
|
27
|
+
//# sourceMappingURL=boolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../src/types/boolean.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAM9C,QAAA,sBAAsB,GAAG,IAAA,uCAAkB,EAAsB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1F,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,wBAAwB,GAAG,IAAA,2CAAoB,EAAsB,CAAC,OAAO,EAAE,EAAE,CAAC,iCAC1F,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,OAAO,EACvB,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEG,MAAM,qBAAqB,GAAG,CAAC,CAAM,EAAE,EAAE;IAC9C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC;AAEF,MAAM,aAAa,GAAG,IAAA,6BAAa,EAAsB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACrE,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,8BAAsB,EAAC,OAAO,CAAC;IAChD,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,gCAAwB,EAAC,OAAO,CAAC;IACpD,QAAQ,EAAE,6BAAqB;CAChC,CAAC,CAAC,CAAC;AAEJ,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TypeIsDateOnlyOption {
|
|
2
|
+
comment?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const TypeIsDateOnlyToSwagger: (options?: (TypeIsDateOnlyOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
5
|
+
export declare const TypeIsDateOnlyToSequelize: (options?: (TypeIsDateOnlyOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
6
|
+
declare const TypeIsDateOnly: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsDateOnlyOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
7
|
+
export default TypeIsDateOnly;
|
|
8
|
+
//# sourceMappingURL=dateonly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateonly.d.ts","sourceRoot":"","sources":["../../src/types/dateonly.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,uBAAuB,6MAIjC,CAAC;AAEJ,eAAO,MAAM,yBAAyB,uPAInC,CAAC;AAEJ,QAAA,MAAM,cAAc,+SAIjB,CAAC;AAEJ,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsDateOnlyToSequelize = exports.TypeIsDateOnlyToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsDateOnlyToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'string',
|
|
10
|
+
format: 'date',
|
|
11
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
+
}));
|
|
13
|
+
exports.TypeIsDateOnlyToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.DATEONLY(), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
14
|
+
const TypeIsDateOnly = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
15
|
+
__name: 'date',
|
|
16
|
+
toSwagger: () => (0, exports.TypeIsDateOnlyToSwagger)(options),
|
|
17
|
+
toSequelize: () => (0, exports.TypeIsDateOnlyToSequelize)(options),
|
|
18
|
+
}));
|
|
19
|
+
exports.default = TypeIsDateOnly;
|
|
20
|
+
//# sourceMappingURL=dateonly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateonly.js","sourceRoot":"","sources":["../../src/types/dateonly.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAM9C,QAAA,uBAAuB,GAAG,IAAA,uCAAkB,EAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5F,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,yBAAyB,GAAG,IAAA,2CAAoB,EAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,iCAC5F,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,QAAQ,EAAE,EAC1B,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEJ,MAAM,cAAc,GAAG,IAAA,6BAAa,EAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACvE,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,+BAAuB,EAAC,OAAO,CAAC;IACjD,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,iCAAyB,EAAC,OAAO,CAAC;CACtD,CAAC,CAAC,CAAC;AAEJ,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TypeIsDateTimeOption {
|
|
2
|
+
comment?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const TypeIsDateTimeToSwagger: (options?: (TypeIsDateTimeOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
5
|
+
export declare const TypeIsDateTimeToSequelize: (options?: (TypeIsDateTimeOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
6
|
+
declare const TypeIsDateTime: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsDateTimeOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
7
|
+
export default TypeIsDateTime;
|
|
8
|
+
//# sourceMappingURL=datetime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../src/types/datetime.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,uBAAuB,6MAIjC,CAAC;AAEJ,eAAO,MAAM,yBAAyB,uPAInC,CAAC;AAEJ,QAAA,MAAM,cAAc,+SAIjB,CAAC;AAEJ,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsDateTimeToSequelize = exports.TypeIsDateTimeToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsDateTimeToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'string',
|
|
10
|
+
format: 'date-time',
|
|
11
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
+
}));
|
|
13
|
+
exports.TypeIsDateTimeToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.DATE(), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
14
|
+
const TypeIsDateTime = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
15
|
+
__name: 'datetime',
|
|
16
|
+
toSwagger: () => (0, exports.TypeIsDateTimeToSwagger)(options),
|
|
17
|
+
toSequelize: () => (0, exports.TypeIsDateTimeToSequelize)(options),
|
|
18
|
+
}));
|
|
19
|
+
exports.default = TypeIsDateTime;
|
|
20
|
+
//# sourceMappingURL=datetime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetime.js","sourceRoot":"","sources":["../../src/types/datetime.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAM9C,QAAA,uBAAuB,GAAG,IAAA,uCAAkB,EAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5F,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,WAAW;IACnB,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,yBAAyB,GAAG,IAAA,2CAAoB,EAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,iCAC5F,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,IAAI,EAAE,EACtB,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEJ,MAAM,cAAc,GAAG,IAAA,6BAAa,EAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACvE,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,+BAAuB,EAAC,OAAO,CAAC;IACjD,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,iCAAyB,EAAC,OAAO,CAAC;CACtD,CAAC,CAAC,CAAC;AAEJ,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TypeIsDecemalOption {
|
|
2
|
+
precision: number;
|
|
3
|
+
scale: number;
|
|
4
|
+
comment?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TypeIsDecemalToSwagger: (options?: (TypeIsDecemalOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
7
|
+
export declare const TypeIsDecemalToSequelize: (options?: (TypeIsDecemalOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
8
|
+
export declare const TypeIsDecemalFixValue: (o: any) => any;
|
|
9
|
+
declare const TypeIsDecemal: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsDecemalOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
10
|
+
export default TypeIsDecemal;
|
|
11
|
+
//# sourceMappingURL=decemal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decemal.d.ts","sourceRoot":"","sources":["../../src/types/decemal.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,4MAIhC,CAAC;AAEJ,eAAO,MAAM,wBAAwB,sPAOlC,CAAC;AAEJ,eAAO,MAAM,qBAAqB,MAAO,GAAG,QAG3C,CAAC;AAEF,QAAA,MAAM,aAAa,8SAKhB,CAAC;AAEJ,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsDecemalFixValue = exports.TypeIsDecemalToSequelize = exports.TypeIsDecemalToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsDecemalToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'integer',
|
|
10
|
+
format: 'float',
|
|
11
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
+
}));
|
|
13
|
+
exports.TypeIsDecemalToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.DECIMAL({
|
|
14
|
+
precision: options === null || options === void 0 ? void 0 : options.precision,
|
|
15
|
+
scale: options === null || options === void 0 ? void 0 : options.scale,
|
|
16
|
+
}), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
17
|
+
const TypeIsDecemalFixValue = (o) => {
|
|
18
|
+
if (o === undefined || o === null)
|
|
19
|
+
return o;
|
|
20
|
+
return parseFloat(String(o));
|
|
21
|
+
};
|
|
22
|
+
exports.TypeIsDecemalFixValue = TypeIsDecemalFixValue;
|
|
23
|
+
const TypeIsDecemal = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
24
|
+
__name: 'decimal',
|
|
25
|
+
toSwagger: () => (0, exports.TypeIsDecemalToSwagger)(options),
|
|
26
|
+
toSequelize: () => (0, exports.TypeIsDecemalToSequelize)(options),
|
|
27
|
+
fixValue: exports.TypeIsDecemalFixValue,
|
|
28
|
+
}));
|
|
29
|
+
exports.default = TypeIsDecemal;
|
|
30
|
+
//# sourceMappingURL=decemal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decemal.js","sourceRoot":"","sources":["../../src/types/decemal.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAQ9C,QAAA,sBAAsB,GAAG,IAAA,uCAAkB,EAAsB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1F,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,wBAAwB,GAAG,IAAA,2CAAoB,EAAsB,CAAC,OAAO,EAAE,EAAE,CAAC,iCAC1F,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,OAAO,CAAC;QACtB,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS;QAC7B,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK;KACtB,CAAC,EACF,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEG,MAAM,qBAAqB,GAAG,CAAC,CAAM,EAAE,EAAE;IAC9C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAHW,QAAA,qBAAqB,yBAGhC;AAEF,MAAM,aAAa,GAAG,IAAA,6BAAa,EAAsB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACrE,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,8BAAsB,EAAC,OAAO,CAAC;IAChD,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,gCAAwB,EAAC,OAAO,CAAC;IACpD,QAAQ,EAAE,6BAAqB;CAChC,CAAC,CAAC,CAAC;AAEJ,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TypeIsDoubleOption {
|
|
2
|
+
length?: number;
|
|
3
|
+
decimals?: number;
|
|
4
|
+
comment?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TypeIsDoubleToSwagger: (options?: (TypeIsDoubleOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
7
|
+
export declare const TypeIsDoubleToSequelize: (options?: (TypeIsDoubleOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
8
|
+
export declare const TypeIsDoubleFixValue: (o: any) => any;
|
|
9
|
+
declare const TypeIsDouble: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsDoubleOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
10
|
+
export default TypeIsDouble;
|
|
11
|
+
//# sourceMappingURL=double.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"double.d.ts","sourceRoot":"","sources":["../../src/types/double.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,qBAAqB,2MAI/B,CAAC;AAEJ,eAAO,MAAM,uBAAuB,qPAIjC,CAAC;AAEJ,eAAO,MAAM,oBAAoB,MAAO,GAAG,QAG1C,CAAC;AAEF,QAAA,MAAM,YAAY,6SAKf,CAAC;AAEJ,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsDoubleFixValue = exports.TypeIsDoubleToSequelize = exports.TypeIsDoubleToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsDoubleToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'number',
|
|
10
|
+
format: 'double',
|
|
11
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
+
}));
|
|
13
|
+
exports.TypeIsDoubleToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.DOUBLE(options === null || options === void 0 ? void 0 : options.length, options === null || options === void 0 ? void 0 : options.decimals), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
14
|
+
const TypeIsDoubleFixValue = (o) => {
|
|
15
|
+
if (o === undefined || o === null)
|
|
16
|
+
return o;
|
|
17
|
+
return parseFloat(String(o));
|
|
18
|
+
};
|
|
19
|
+
exports.TypeIsDoubleFixValue = TypeIsDoubleFixValue;
|
|
20
|
+
const TypeIsDouble = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
21
|
+
__name: 'double',
|
|
22
|
+
toSwagger: () => (0, exports.TypeIsDoubleToSwagger)(options),
|
|
23
|
+
toSequelize: () => (0, exports.TypeIsDoubleToSequelize)(options),
|
|
24
|
+
fixValue: exports.TypeIsDoubleFixValue,
|
|
25
|
+
}));
|
|
26
|
+
exports.default = TypeIsDouble;
|
|
27
|
+
//# sourceMappingURL=double.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"double.js","sourceRoot":"","sources":["../../src/types/double.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAQ9C,QAAA,qBAAqB,GAAG,IAAA,uCAAkB,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxF,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,uBAAuB,GAAG,IAAA,2CAAoB,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,iCACxF,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC,EAC1D,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEG,MAAM,oBAAoB,GAAG,CAAC,CAAM,EAAE,EAAE;IAC7C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAHW,QAAA,oBAAoB,wBAG/B;AAEF,MAAM,YAAY,GAAG,IAAA,6BAAa,EAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACnE,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,6BAAqB,EAAC,OAAO,CAAC;IAC/C,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,+BAAuB,EAAC,OAAO,CAAC;IACnD,QAAQ,EAAE,4BAAoB;CAC/B,CAAC,CAAC,CAAC;AAEJ,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExtendableDto } from 'src/dto';
|
|
2
|
+
export interface TypeIsDtoOption {
|
|
3
|
+
dto: typeof ExtendableDto;
|
|
4
|
+
as: string;
|
|
5
|
+
comment?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const TypeIsDtoToSwagger: (options?: (TypeIsDtoOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
8
|
+
declare const TypeIsDto: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsDtoOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
9
|
+
export default TypeIsDto;
|
|
10
|
+
//# sourceMappingURL=dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../src/types/dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,OAAO,aAAa,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,kBAAkB,wMAO7B,CAAC;AAEH,QAAA,MAAM,SAAS,0SAIZ,CAAC;AAEJ,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsDtoToSwagger = void 0;
|
|
4
|
+
const core_1 = require("@asapjs/core");
|
|
5
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
6
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
7
|
+
exports.TypeIsDtoToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => {
|
|
8
|
+
var _a;
|
|
9
|
+
if (!options) {
|
|
10
|
+
core_1.logger.error(`@asapjs/sequelize :: @TypeIs.DTO - DTO가 지정되지 않았습니다.`);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
const data = (_a = new options.dto()) === null || _a === void 0 ? void 0 : _a.swagger();
|
|
14
|
+
return Object.assign(Object.assign({}, data), { comment: options === null || options === void 0 ? void 0 : options.comment });
|
|
15
|
+
});
|
|
16
|
+
const TypeIsDto = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
17
|
+
__name: 'dto',
|
|
18
|
+
toSequelize: () => ({ dto: options === null || options === void 0 ? void 0 : options.dto, as: options === null || options === void 0 ? void 0 : options.as }),
|
|
19
|
+
toSwagger: () => (0, exports.TypeIsDtoToSwagger)(options),
|
|
20
|
+
}));
|
|
21
|
+
exports.default = TypeIsDto;
|
|
22
|
+
//# sourceMappingURL=dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/types/dto.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAEtC,wEAAqE;AACrE,8DAA2D;AAQ9C,QAAA,kBAAkB,GAAG,IAAA,uCAAkB,EAAkB,CAAC,OAAO,EAAE,EAAE;;IAChF,IAAI,CAAC,OAAO,EAAE;QACZ,aAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,MAAM,IAAI,GAAG,MAAA,IAAI,OAAO,CAAC,GAAG,EAAE,0CAAE,OAAO,EAAE,CAAC;IAC1C,uCAAY,IAAI,KAAE,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IAAG;AAChD,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAA,6BAAa,EAAkB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC7D,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,EAAE,EAAE,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,EAAE,CAAC;IAC3D,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,0BAAkB,EAAC,OAAO,CAAC;CAC7C,CAAC,CAAC,CAAC;AAEJ,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface TypeIsEnumOption {
|
|
2
|
+
values: string[];
|
|
3
|
+
comment?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const TypeIsEnumToSwagger: (options?: (TypeIsEnumOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
6
|
+
export declare const TypeIsEnumToSequelize: (options?: (TypeIsEnumOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
7
|
+
declare const TypeIsEnum: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsEnumOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
8
|
+
export default TypeIsEnum;
|
|
9
|
+
//# sourceMappingURL=enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/types/enum.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,mBAAmB,yMAI7B,CAAC;AAEJ,eAAO,MAAM,qBAAqB,mPAI/B,CAAC;AAEJ,QAAA,MAAM,UAAU,2SAQb,CAAC;AAEJ,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsEnumToSequelize = exports.TypeIsEnumToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsEnumToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'string',
|
|
10
|
+
enum: options === null || options === void 0 ? void 0 : options.values,
|
|
11
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
+
}));
|
|
13
|
+
exports.TypeIsEnumToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.ENUM({ values: options.values }), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
14
|
+
const TypeIsEnum = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
15
|
+
__name: 'enum',
|
|
16
|
+
toSwagger: () => (0, exports.TypeIsEnumToSwagger)(options),
|
|
17
|
+
toSequelize: () => (0, exports.TypeIsEnumToSequelize)(options),
|
|
18
|
+
fixValue: (o) => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (o === undefined || o === null)
|
|
21
|
+
return o;
|
|
22
|
+
return ((_b = (_a = options === null || options === void 0 ? void 0 : options.values) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, String(o))) ? String(o) : undefined;
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
exports.default = TypeIsEnum;
|
|
26
|
+
//# sourceMappingURL=enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../src/types/enum.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAO9C,QAAA,mBAAmB,GAAG,IAAA,uCAAkB,EAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACpF,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM;IACrB,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,qBAAqB,GAAG,IAAA,2CAAoB,EAAC,CAAC,OAA0B,EAAE,EAAE,CAAC,iCACrF,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAQ,CAAC,MAAM,EAAE,CAAC,EACjD,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEJ,MAAM,UAAU,GAAG,IAAA,6BAAa,EAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,2BAAmB,EAAC,OAAO,CAAC;IAC7C,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,6BAAqB,EAAC,OAAO,CAAC;IACjD,QAAQ,EAAE,CAAC,CAAM,EAAE,EAAE;;QACnB,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;YAAE,OAAO,CAAC,CAAC;QAC5C,OAAO,CAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,0CAAE,QAAQ,mDAAG,MAAM,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxE,CAAC;CACF,CAAC,CAAC,CAAC;AAEJ,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TypeIsFloatOption {
|
|
2
|
+
length?: number;
|
|
3
|
+
decimals?: number;
|
|
4
|
+
comment?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TypeIsFloatToSwagger: (options?: (TypeIsFloatOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
7
|
+
export declare const TypeIsFloatToSequelize: (options?: (TypeIsFloatOption & import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>) | undefined) => import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>>;
|
|
8
|
+
export declare const TypeIsFloatFixValue: (o: any) => any;
|
|
9
|
+
declare const TypeIsFloat: (...options: (import("sequelize/types").ModelAttributeColumnOptions<import("sequelize/types").Model<any, any>> | TypeIsFloatOption)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & import("./generators/typeGenerator").TypeIsData;
|
|
10
|
+
export default TypeIsFloat;
|
|
11
|
+
//# sourceMappingURL=float.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"float.d.ts","sourceRoot":"","sources":["../../src/types/float.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,oBAAoB,0MAI9B,CAAC;AAEJ,eAAO,MAAM,sBAAsB,oPAIhC,CAAC;AAEJ,eAAO,MAAM,mBAAmB,MAAO,GAAG,QAGzC,CAAC;AAEF,QAAA,MAAM,WAAW,4SAKd,CAAC;AAEJ,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeIsFloatFixValue = exports.TypeIsFloatToSequelize = exports.TypeIsFloatToSwagger = void 0;
|
|
4
|
+
const types_1 = require("sequelize/types");
|
|
5
|
+
const toSequelizeGenerator_1 = require("./generators/toSequelizeGenerator");
|
|
6
|
+
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
7
|
+
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
8
|
+
exports.TypeIsFloatToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => ({
|
|
9
|
+
type: 'integer',
|
|
10
|
+
format: 'float',
|
|
11
|
+
description: options === null || options === void 0 ? void 0 : options.comment,
|
|
12
|
+
}));
|
|
13
|
+
exports.TypeIsFloatToSequelize = (0, toSequelizeGenerator_1.toSequelizeGenerator)((options) => (Object.assign(Object.assign({}, options), { type: types_1.DataTypes.FLOAT(options === null || options === void 0 ? void 0 : options.length, options === null || options === void 0 ? void 0 : options.decimals), comment: options === null || options === void 0 ? void 0 : options.comment })));
|
|
14
|
+
const TypeIsFloatFixValue = (o) => {
|
|
15
|
+
if (o === undefined || o === null)
|
|
16
|
+
return o;
|
|
17
|
+
return parseFloat(String(o));
|
|
18
|
+
};
|
|
19
|
+
exports.TypeIsFloatFixValue = TypeIsFloatFixValue;
|
|
20
|
+
const TypeIsFloat = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
21
|
+
__name: 'float',
|
|
22
|
+
toSwagger: () => (0, exports.TypeIsFloatToSwagger)(options),
|
|
23
|
+
toSequelize: () => (0, exports.TypeIsFloatToSequelize)(options),
|
|
24
|
+
fixValue: exports.TypeIsFloatFixValue,
|
|
25
|
+
}));
|
|
26
|
+
exports.default = TypeIsFloat;
|
|
27
|
+
//# sourceMappingURL=float.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"float.js","sourceRoot":"","sources":["../../src/types/float.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,4EAAyE;AACzE,wEAAqE;AACrE,8DAA2D;AAQ9C,QAAA,oBAAoB,GAAG,IAAA,uCAAkB,EAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACtF,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;CAC9B,CAAC,CAAC,CAAC;AAES,QAAA,sBAAsB,GAAG,IAAA,2CAAoB,EAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,iCACtF,OAAO,KACV,IAAI,EAAE,iBAAS,CAAC,KAAK,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC,EACzD,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,IACzB,CAAC,CAAC;AAEG,MAAM,mBAAmB,GAAG,CAAC,CAAM,EAAE,EAAE;IAC5C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAHW,QAAA,mBAAmB,uBAG9B;AAEF,MAAM,WAAW,GAAG,IAAA,6BAAa,EAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACjE,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,GAAG,EAAE,CAAC,IAAA,4BAAoB,EAAC,OAAO,CAAC;IAC9C,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,8BAAsB,EAAC,OAAO,CAAC;IAClD,QAAQ,EAAE,2BAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TypeIsData } from './generators/typeGenerator';
|
|
2
|
+
import { ClassType } from './index';
|
|
3
|
+
export declare const TypeIsForienKeyAddColumn: <T extends ClassType>(target: T, type: TypeIsData, key: string) => void;
|
|
4
|
+
declare const TypeIsForeignKey: (...options: any[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & TypeIsData;
|
|
5
|
+
export default TypeIsForeignKey;
|
|
6
|
+
//# sourceMappingURL=foreignkey.d.ts.map
|