@asapjs/sequelize 0.10.44 → 1.0.0-alpha.0
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/console/index.js +4 -4
- package/dist/console/index.js.map +1 -1
- package/dist/dbml/index.d.ts.map +1 -1
- package/dist/dbml/index.js +2 -2
- package/dist/dbml/index.js.map +1 -1
- package/dist/dto/ExtendableDto.d.ts +1 -1
- package/dist/dto/ExtendableDto.d.ts.map +1 -1
- package/dist/dto/ExtendableDto.js +12 -12
- package/dist/dto/ExtendableDto.js.map +1 -1
- package/dist/dto/PaginationQueryDto.js +4 -4
- package/dist/dto/PaginationQueryDto.js.map +1 -1
- package/dist/dto/index.d.ts.map +1 -1
- package/dist/dto/index.js +2 -2
- package/dist/dto/index.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +59 -0
- package/dist/plugin.js.map +1 -0
- package/dist/repository/index.d.ts +2 -2
- package/dist/repository/index.d.ts.map +1 -1
- package/dist/repository/index.js.map +1 -1
- package/dist/sequelize/index.d.ts.map +1 -1
- package/dist/sequelize/index.js +19 -19
- package/dist/sequelize/index.js.map +1 -1
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/index.js +17 -3
- package/dist/table/index.js.map +1 -1
- package/dist/types/belongsto.d.ts +1 -1
- package/dist/types/belongsto.d.ts.map +1 -1
- package/dist/types/belongsto.js +2 -2
- package/dist/types/belongsto.js.map +1 -1
- package/dist/types/decorators.d.ts +4 -0
- package/dist/types/decorators.d.ts.map +1 -0
- package/dist/types/decorators.js +56 -0
- package/dist/types/decorators.js.map +1 -0
- package/dist/types/foreignkey.d.ts +1 -1
- package/dist/types/foreignkey.d.ts.map +1 -1
- package/dist/types/foreignkey.js +4 -4
- package/dist/types/foreignkey.js.map +1 -1
- package/dist/types/generators/toSequelizeGenerator.d.ts +1 -1
- package/dist/types/generators/toSequelizeGenerator.d.ts.map +1 -1
- package/dist/types/generators/toSwaggerGenerator.d.ts +1 -1
- package/dist/types/generators/toSwaggerGenerator.d.ts.map +1 -1
- package/dist/types/generators/typeGenerator.d.ts +1 -1
- package/dist/types/generators/typeGenerator.d.ts.map +1 -1
- package/dist/types/generators/typeGenerator.js.map +1 -1
- package/dist/types/index.d.ts +5 -23
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -38
- package/dist/types/index.js.map +1 -1
- package/dist/types/paging.d.ts +1 -1
- package/dist/types/paging.d.ts.map +1 -1
- package/dist/types/paging.js +3 -3
- package/dist/types/paging.js.map +1 -1
- package/dist/types/query.d.ts +1 -1
- package/dist/types/query.d.ts.map +1 -1
- package/dist/types/query.js +2 -2
- package/dist/types/query.js.map +1 -1
- package/dist/types/register.d.ts +2 -0
- package/dist/types/register.d.ts.map +1 -0
- package/dist/types/register.js +25 -0
- package/dist/types/register.js.map +1 -0
- package/dist/types/schema-extensions.d.ts +52 -0
- package/dist/types/schema-extensions.d.ts.map +1 -0
- package/dist/types/schema-extensions.js +56 -0
- package/dist/types/schema-extensions.js.map +1 -0
- package/dist/utils/getUserIdInQuery.d.ts.map +1 -1
- package/dist/utils/isClass.d.ts.map +1 -1
- package/dist/utils/promiseTimeout.d.ts.map +1 -1
- package/dist/utils/swagger.d.ts +4 -0
- package/dist/utils/swagger.d.ts.map +1 -0
- package/dist/utils/swagger.js +26 -0
- package/dist/utils/swagger.js.map +1 -0
- package/package.json +18 -8
- package/.yarnrc.yml +0 -1
- package/dist/types/array.d.ts +0 -7
- package/dist/types/array.d.ts.map +0 -1
- package/dist/types/array.js +0 -58
- package/dist/types/array.js.map +0 -1
- package/dist/types/base64.d.ts +0 -10
- package/dist/types/base64.d.ts.map +0 -1
- package/dist/types/base64.js +0 -20
- package/dist/types/base64.js.map +0 -1
- 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/types/binary.d.ts +0 -10
- package/dist/types/binary.d.ts.map +0 -1
- package/dist/types/binary.js +0 -20
- package/dist/types/binary.js.map +0 -1
- package/dist/types/boolean.d.ts +0 -9
- package/dist/types/boolean.d.ts.map +0 -1
- package/dist/types/boolean.js +0 -27
- package/dist/types/boolean.js.map +0 -1
- package/dist/types/dateonly.d.ts +0 -8
- package/dist/types/dateonly.d.ts.map +0 -1
- package/dist/types/dateonly.js +0 -20
- package/dist/types/dateonly.js.map +0 -1
- package/dist/types/datetime.d.ts +0 -8
- package/dist/types/datetime.d.ts.map +0 -1
- package/dist/types/datetime.js +0 -20
- package/dist/types/datetime.js.map +0 -1
- package/dist/types/decemal.d.ts +0 -11
- package/dist/types/decemal.d.ts.map +0 -1
- package/dist/types/decemal.js +0 -30
- package/dist/types/decemal.js.map +0 -1
- package/dist/types/double.d.ts +0 -11
- package/dist/types/double.d.ts.map +0 -1
- package/dist/types/double.js +0 -27
- package/dist/types/double.js.map +0 -1
- package/dist/types/dto.d.ts +0 -10
- package/dist/types/dto.d.ts.map +0 -1
- package/dist/types/dto.js +0 -23
- package/dist/types/dto.js.map +0 -1
- package/dist/types/enum.d.ts +0 -9
- package/dist/types/enum.d.ts.map +0 -1
- package/dist/types/enum.js +0 -26
- package/dist/types/enum.js.map +0 -1
- package/dist/types/float.d.ts +0 -11
- package/dist/types/float.d.ts.map +0 -1
- package/dist/types/float.js +0 -27
- package/dist/types/float.js.map +0 -1
- package/dist/types/int.d.ts +0 -12
- package/dist/types/int.d.ts.map +0 -1
- package/dist/types/int.js +0 -27
- package/dist/types/int.js.map +0 -1
- package/dist/types/json.d.ts +0 -9
- package/dist/types/json.d.ts.map +0 -1
- package/dist/types/json.js +0 -31
- package/dist/types/json.js.map +0 -1
- package/dist/types/long.d.ts +0 -12
- package/dist/types/long.d.ts.map +0 -1
- package/dist/types/long.js +0 -27
- package/dist/types/long.js.map +0 -1
- package/dist/types/password.d.ts +0 -6
- package/dist/types/password.d.ts.map +0 -1
- package/dist/types/password.js +0 -20
- package/dist/types/password.js.map +0 -1
- package/dist/types/string.d.ts +0 -11
- package/dist/types/string.d.ts.map +0 -1
- package/dist/types/string.js +0 -26
- package/dist/types/string.js.map +0 -1
- package/dist/types/text.d.ts +0 -9
- package/dist/types/text.d.ts.map +0 -1
- package/dist/types/text.js +0 -16
- package/dist/types/text.js.map +0 -1
- package/tsconfig.json +0 -21
package/dist/types/paging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paging.js","sourceRoot":"","sources":["../../src/types/paging.ts"],"names":[],"mappings":";;;;;;AACA,8DAAuE;AACvE,+DAAuC;AAEvC,wEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"paging.js","sourceRoot":"","sources":["../../src/types/paging.ts"],"names":[],"mappings":";;;;;;AACA,8DAAuE;AACvE,+DAAuC;AAEvC,wEAAqE;AACrE,8CAA6C;AAEhC,QAAA,qBAAqB,GAAG,IAAA,uCAAkB,EAAc,CAAC,OAAO,EAAE,EAAE;;IAC/E,MAAM,KAAK,GAAG,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;IAE/B,MAAM,cAAc,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC;QACtC,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,OAAO;gBACb,KAAK;aACN;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,OAAO;gBACf,WAAW,EAAE,QAAQ;aACtB;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,OAAO;gBACf,WAAW,EAAE,YAAY;aAC1B;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,OAAO;gBACf,WAAW,EAAE,QAAQ;aACtB;YAC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/dist/types/query.d.ts
CHANGED
|
@@ -15,6 +15,6 @@ export declare const TypeIsQueryToSequelize: (options?: TypeIsQueryOption) => {
|
|
|
15
15
|
type: (() => TypeIsData) | undefined;
|
|
16
16
|
};
|
|
17
17
|
export declare const TypeIsQueryFixValue: (options: TypeIsQueryOption) => (o: any) => any;
|
|
18
|
-
declare const TypeIsQuery: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | TypeIsQueryOption)[]) => (target?: any, propertyName?: string
|
|
18
|
+
declare const TypeIsQuery: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | TypeIsQueryOption)[]) => (target?: any, propertyName?: string, propertyDescriptor?: PropertyDescriptor) => void & TypeIsData;
|
|
19
19
|
export default TypeIsQuery;
|
|
20
20
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/types/query.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IAC/D,IAAI,EAAE,MAAM,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,oBAAoB,8LAM/B,CAAC;AAEH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/types/query.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IAC/D,IAAI,EAAE,MAAM,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,oBAAoB,8LAM/B,CAAC;AAEH,eAAO,MAAM,sBAAsB,GAAI,UAAU,iBAAiB;mBACjD;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE;iBAZvC,UAAU;CActB,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAAI,SAAS,iBAAiB,MAAM,GAAG,GAAG,QAEzE,CAAC;AAEF,QAAA,MAAM,WAAW,iIAGoB,YAAY,EAC/C,qBAAoB,EAAC,uCAGR,sBAFZ,CAAC;AAEJ,eAAe,WAAW,CAAC"}
|
package/dist/types/query.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TypeIsQueryFixValue = exports.TypeIsQueryToSequelize = exports.TypeIsQueryToSwagger = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("@asapjs/common");
|
|
5
5
|
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
|
|
6
6
|
const typeGenerator_1 = require("./generators/typeGenerator");
|
|
7
7
|
exports.TypeIsQueryToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => {
|
|
8
8
|
var _a, _b;
|
|
9
9
|
if (!options) {
|
|
10
|
-
|
|
10
|
+
common_1.logger.error(`@asapjs/sequelize :: @TypeIs.QUERY - options가 전달되지 않았습니다..`);
|
|
11
11
|
process.exit(1);
|
|
12
12
|
}
|
|
13
13
|
return (_b = (_a = options.type()).toSwagger) === null || _b === void 0 ? void 0 : _b.call(_a);
|
package/dist/types/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/types/query.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/types/register.ts"],"names":[],"mappings":"AAwBA,wBAAgB,sBAAsB,SAOrC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerSequelizeTypes = registerSequelizeTypes;
|
|
4
|
+
const schema_1 = require("@asapjs/schema");
|
|
5
|
+
const schema_extensions_1 = require("./schema-extensions");
|
|
6
|
+
// 타입 팩토리 생성
|
|
7
|
+
function createQueryFactory() {
|
|
8
|
+
return (options) => new schema_extensions_1.QueryType(options);
|
|
9
|
+
}
|
|
10
|
+
function createForeignKeyFactory() {
|
|
11
|
+
return (options) => new schema_extensions_1.ForeignKeyType(options);
|
|
12
|
+
}
|
|
13
|
+
function createBelongsToFactory() {
|
|
14
|
+
return (options) => new schema_extensions_1.BelongsToType(options);
|
|
15
|
+
}
|
|
16
|
+
// Sequelize 타입 등록
|
|
17
|
+
function registerSequelizeTypes() {
|
|
18
|
+
// TypeIs 객체에 Sequelize 전용 타입 추가
|
|
19
|
+
(0, schema_1.extendTypeIs)({
|
|
20
|
+
QUERY: createQueryFactory(),
|
|
21
|
+
FOREIGNKEY: createForeignKeyFactory(),
|
|
22
|
+
BELONGSTO: createBelongsToFactory(),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/types/register.ts"],"names":[],"mappings":";;AAwBA,wDAOC;AA/BD,2CAAsD;AACtD,2DAO6B;AAE7B,YAAY;AACZ,SAAS,kBAAkB;IACzB,OAAO,CAAC,OAAqB,EAAE,EAAE,CAAC,IAAI,6BAAS,CAAC,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,uBAAuB;IAC9B,OAAO,CAAC,OAA0B,EAAE,EAAE,CAAC,IAAI,kCAAc,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,sBAAsB;IAC7B,OAAO,CAAC,OAAyB,EAAE,EAAE,CAAC,IAAI,iCAAa,CAAC,OAAO,CAAC,CAAC;AACnE,CAAC;AAED,kBAAkB;AAClB,SAAgB,sBAAsB;IACpC,gCAAgC;IAChC,IAAA,qBAAY,EAAC;QACX,KAAK,EAAE,kBAAkB,EAAE;QAC3B,UAAU,EAAE,uBAAuB,EAAE;QACrC,SAAS,EAAE,sBAAsB,EAAE;KACpC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { SchemaFactory, SchemaOptions, BaseSchemaType } from '@asapjs/schema';
|
|
2
|
+
export interface QueryOptions extends SchemaOptions {
|
|
3
|
+
query: (association: string, user?: any) => string;
|
|
4
|
+
}
|
|
5
|
+
export interface ForeignKeyOptions extends SchemaOptions {
|
|
6
|
+
references: {
|
|
7
|
+
model: string;
|
|
8
|
+
key: string;
|
|
9
|
+
};
|
|
10
|
+
onDelete?: 'CASCADE' | 'SET NULL' | 'NO ACTION' | 'RESTRICT';
|
|
11
|
+
onUpdate?: 'CASCADE' | 'SET NULL' | 'NO ACTION' | 'RESTRICT';
|
|
12
|
+
}
|
|
13
|
+
export interface BelongsToOptions extends SchemaOptions {
|
|
14
|
+
target: any;
|
|
15
|
+
foreignKey?: string;
|
|
16
|
+
as?: string;
|
|
17
|
+
}
|
|
18
|
+
declare module '@asapjs/schema' {
|
|
19
|
+
interface TypeIsInterface {
|
|
20
|
+
QUERY?: SchemaFactory<QueryOptions>;
|
|
21
|
+
FOREIGNKEY?: SchemaFactory<ForeignKeyOptions>;
|
|
22
|
+
BELONGSTO?: SchemaFactory<BelongsToOptions>;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export declare class QueryType extends BaseSchemaType<any> {
|
|
26
|
+
__name: string;
|
|
27
|
+
private queryFn;
|
|
28
|
+
constructor(options: QueryOptions);
|
|
29
|
+
validate(value: any): boolean;
|
|
30
|
+
parse(value: any): any;
|
|
31
|
+
getQuery(association: string, user?: any): string;
|
|
32
|
+
}
|
|
33
|
+
export declare class ForeignKeyType extends BaseSchemaType<number | string> {
|
|
34
|
+
__name: string;
|
|
35
|
+
references: {
|
|
36
|
+
model: string;
|
|
37
|
+
key: string;
|
|
38
|
+
};
|
|
39
|
+
constructor(options: ForeignKeyOptions);
|
|
40
|
+
validate(value: any): boolean;
|
|
41
|
+
parse(value: any): number | string;
|
|
42
|
+
}
|
|
43
|
+
export declare class BelongsToType extends BaseSchemaType<any> {
|
|
44
|
+
__name: string;
|
|
45
|
+
target: any;
|
|
46
|
+
foreignKey?: string;
|
|
47
|
+
as?: string;
|
|
48
|
+
constructor(options: BelongsToOptions);
|
|
49
|
+
validate(value: any): boolean;
|
|
50
|
+
parse(value: any): any;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=schema-extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-extensions.d.ts","sourceRoot":"","sources":["../../src/types/schema-extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG9E,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,KAAK,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;CACpD;AAGD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;IAC7D,QAAQ,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;CAC9D;AAGD,MAAM,WAAW,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,GAAG,OAAO;IAI7B,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG;CAGvB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BelongsToType = exports.ForeignKeyType = exports.QueryType = void 0;
|
|
4
|
+
const schema_1 = require("@asapjs/schema");
|
|
5
|
+
// QUERY 타입 구현
|
|
6
|
+
class QueryType extends schema_1.BaseSchemaType {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
this.__name = 'query';
|
|
10
|
+
this.queryFn = options.query;
|
|
11
|
+
}
|
|
12
|
+
validate(value) {
|
|
13
|
+
// QUERY는 실행 결과를 검증
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
parse(value) {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
getQuery(association, user) {
|
|
20
|
+
return this.queryFn(association, user);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.QueryType = QueryType;
|
|
24
|
+
// FOREIGNKEY 타입 구현
|
|
25
|
+
class ForeignKeyType extends schema_1.BaseSchemaType {
|
|
26
|
+
constructor(options) {
|
|
27
|
+
super(options);
|
|
28
|
+
this.__name = 'foreignkey';
|
|
29
|
+
this.references = options.references;
|
|
30
|
+
}
|
|
31
|
+
validate(value) {
|
|
32
|
+
return typeof value === 'number' || typeof value === 'string';
|
|
33
|
+
}
|
|
34
|
+
parse(value) {
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.ForeignKeyType = ForeignKeyType;
|
|
39
|
+
// BELONGSTO 타입 구현
|
|
40
|
+
class BelongsToType extends schema_1.BaseSchemaType {
|
|
41
|
+
constructor(options) {
|
|
42
|
+
super(options);
|
|
43
|
+
this.__name = 'belongsto';
|
|
44
|
+
this.target = options.target;
|
|
45
|
+
this.foreignKey = options.foreignKey;
|
|
46
|
+
this.as = options.as;
|
|
47
|
+
}
|
|
48
|
+
validate(value) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
parse(value) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.BelongsToType = BelongsToType;
|
|
56
|
+
//# sourceMappingURL=schema-extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-extensions.js","sourceRoot":"","sources":["../../src/types/schema-extensions.ts"],"names":[],"mappings":";;;AAAA,2CAA8E;AAkC9E,cAAc;AACd,MAAa,SAAU,SAAQ,uBAAmB;IAIhD,YAAY,OAAqB;QAC/B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJjB,WAAM,GAAG,OAAO,CAAC;QAKf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC;IAC/B,CAAC;IAED,QAAQ,CAAC,KAAU;QACjB,mBAAmB;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,KAAU;QACd,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ,CAAC,WAAmB,EAAE,IAAU;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AArBD,8BAqBC;AAED,mBAAmB;AACnB,MAAa,cAAe,SAAQ,uBAA+B;IAIjE,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJjB,WAAM,GAAG,YAAY,CAAC;QAKpB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACvC,CAAC;IAED,QAAQ,CAAC,KAAU;QACjB,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,KAAU;QACd,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAhBD,wCAgBC;AAED,kBAAkB;AAClB,MAAa,aAAc,SAAQ,uBAAmB;IAMpD,YAAY,OAAyB;QACnC,KAAK,CAAC,OAAO,CAAC,CAAC;QANjB,WAAM,GAAG,WAAW,CAAC;QAOnB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;IACvB,CAAC;IAED,QAAQ,CAAC,KAAU;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,KAAU;QACd,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AApBD,sCAoBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserIdInQuery.d.ts","sourceRoot":"","sources":["../../src/utils/getUserIdInQuery.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"getUserIdInQuery.d.ts","sourceRoot":"","sources":["../../src/utils/getUserIdInQuery.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,OAAO,GAAG,WAAuC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isClass.d.ts","sourceRoot":"","sources":["../../src/utils/isClass.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isClass.d.ts","sourceRoot":"","sources":["../../src/utils/isClass.ts"],"names":[],"mappings":"yBAAgB,GAAG,GAAG;AAAtB,wBAAmE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promiseTimeout.d.ts","sourceRoot":"","sources":["../../src/utils/promiseTimeout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"promiseTimeout.d.ts","sourceRoot":"","sources":["../../src/utils/promiseTimeout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAa,IAAI,MAAM,EAAE,SAAS,OAAO,CAAC,GAAG,CAAC,KAAG,OAAO,CAAC,GAAG,CAMtF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swagger.d.ts","sourceRoot":"","sources":["../../src/utils/swagger.ts"],"names":[],"mappings":"AAMA,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,EAAE,yBAAyB,EAAE,GAAG,QAGjF;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,OAKlC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,OAKrD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Temporary functions to avoid circular dependency
|
|
3
|
+
// These will be injected by the router plugin at runtime
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.setSwaggerFunctions = setSwaggerFunctions;
|
|
6
|
+
exports.addScheme = addScheme;
|
|
7
|
+
exports.generateSchemeRefWithName = generateSchemeRefWithName;
|
|
8
|
+
let addSchemeFunc;
|
|
9
|
+
let generateSchemeRefWithNameFunc;
|
|
10
|
+
function setSwaggerFunctions(addScheme, generateSchemeRefWithName) {
|
|
11
|
+
addSchemeFunc = addScheme;
|
|
12
|
+
generateSchemeRefWithNameFunc = generateSchemeRefWithName;
|
|
13
|
+
}
|
|
14
|
+
function addScheme(data) {
|
|
15
|
+
if (addSchemeFunc) {
|
|
16
|
+
return addSchemeFunc(data);
|
|
17
|
+
}
|
|
18
|
+
// No-op if not initialized
|
|
19
|
+
}
|
|
20
|
+
function generateSchemeRefWithName(name) {
|
|
21
|
+
if (generateSchemeRefWithNameFunc) {
|
|
22
|
+
return generateSchemeRefWithNameFunc(name);
|
|
23
|
+
}
|
|
24
|
+
return `#/components/schemas/${name}`;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=swagger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swagger.js","sourceRoot":"","sources":["../../src/utils/swagger.ts"],"names":[],"mappings":";AAAA,mDAAmD;AACnD,yDAAyD;;AAKzD,kDAGC;AAED,8BAKC;AAED,8DAKC;AApBD,IAAI,aAAkB,CAAC;AACvB,IAAI,6BAAkC,CAAC;AAEvC,SAAgB,mBAAmB,CAAC,SAAc,EAAE,yBAA8B;IAChF,aAAa,GAAG,SAAS,CAAC;IAC1B,6BAA6B,GAAG,yBAAyB,CAAC;AAC5D,CAAC;AAED,SAAgB,SAAS,CAAC,IAAS;IACjC,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,2BAA2B;AAC7B,CAAC;AAED,SAAgB,yBAAyB,CAAC,IAAY;IACpD,IAAI,6BAA6B,EAAE,CAAC;QAClC,OAAO,6BAA6B,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,wBAAwB,IAAI,EAAE,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asapjs/sequelize",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
|
+
"description": "Sequelize integration for AsapJS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
6
10
|
"scripts": {
|
|
7
11
|
"prebuild": "rm -rf dist",
|
|
8
12
|
"build": "tsc"
|
|
9
13
|
},
|
|
10
14
|
"author": "",
|
|
11
15
|
"license": "ISC",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
12
19
|
"dependencies": {
|
|
20
|
+
"@asapjs/common": "1.0.0-alpha.0",
|
|
21
|
+
"@asapjs/schema": "1.0.0-alpha.0",
|
|
22
|
+
"@asapjs/types": "1.0.0-alpha.0",
|
|
13
23
|
"body-parser": "^1.19.2",
|
|
14
24
|
"cors": "^2.8.5",
|
|
15
25
|
"express": "^4.17.3",
|
|
@@ -17,8 +27,11 @@
|
|
|
17
27
|
"reflect-metadata": "^0.1.13",
|
|
18
28
|
"winston": "^3.6.0"
|
|
19
29
|
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"sequelize": "^6.17.0",
|
|
32
|
+
"sequelize-typescript": "^2.1.3"
|
|
33
|
+
},
|
|
20
34
|
"devDependencies": {
|
|
21
|
-
"@asapjs/core": "^0.10.40",
|
|
22
35
|
"@types/body-parser": "^1.19.2",
|
|
23
36
|
"@types/cors": "^2.8.12",
|
|
24
37
|
"@types/express": "^4.17.13",
|
|
@@ -26,10 +39,7 @@
|
|
|
26
39
|
"@types/sequelize": "^4.28.11",
|
|
27
40
|
"sequelize": "^6.28.0",
|
|
28
41
|
"sequelize-typescript": "^2.1.5",
|
|
29
|
-
"typescript": "^
|
|
42
|
+
"typescript": "^5.8.3"
|
|
30
43
|
},
|
|
31
|
-
"
|
|
32
|
-
"sequelize": "^6.17.0",
|
|
33
|
-
"sequelize-typescript": "^2.1.3"
|
|
34
|
-
}
|
|
44
|
+
"gitHead": "79561e3604dc505813035558d1bfcc6cda0b088a"
|
|
35
45
|
}
|
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|
package/dist/types/array.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DtoOrTypeIs } from './index';
|
|
2
|
-
import { TypeIsData } from './generators/typeGenerator';
|
|
3
|
-
export declare const TypeIsArrayToSwagger: (options?: (DtoOrTypeIs & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
4
|
-
export declare const TypeIsArrayFixValue: (o: any) => any;
|
|
5
|
-
declare const TypeIsArray: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>> | DtoOrTypeIs)[]) => (target?: any, propertyName?: string | undefined, propertyDescriptor?: PropertyDescriptor | undefined) => void & TypeIsData;
|
|
6
|
-
export default TypeIsArray;
|
|
7
|
-
//# sourceMappingURL=array.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAMvE,eAAO,MAAM,oBAAoB,wLA+B/B,CAAC;AAEH,eAAO,MAAM,mBAAmB,MAAO,GAAG,QAOzC,CAAC;AAEF,QAAA,MAAM,WAAW,qPAId,CAAC;AAEJ,eAAe,WAAW,CAAC"}
|
package/dist/types/array.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
const router_1 = require("@asapjs/router");
|
|
11
|
-
exports.TypeIsArrayToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => {
|
|
12
|
-
var _a;
|
|
13
|
-
const isDto = (0, isClass_1.default)(options);
|
|
14
|
-
const generateScheme = (items) => ({
|
|
15
|
-
type: 'array',
|
|
16
|
-
items,
|
|
17
|
-
});
|
|
18
|
-
if (isDto) {
|
|
19
|
-
const dto = new options();
|
|
20
|
-
const name = `${dto.constructor.name}_ARRAY`;
|
|
21
|
-
(0, router_1.addScheme)({
|
|
22
|
-
name,
|
|
23
|
-
data: generateScheme(dto.swagger()),
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
$ref: `#/components/schemas/${name}`,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const type = options();
|
|
31
|
-
const name = `TYPE_${type.__name.toUpperCase()}_ARRAY`;
|
|
32
|
-
(0, router_1.addScheme)({
|
|
33
|
-
name,
|
|
34
|
-
data: generateScheme((_a = type.toSwagger) === null || _a === void 0 ? void 0 : _a.call(type)),
|
|
35
|
-
});
|
|
36
|
-
return {
|
|
37
|
-
$ref: `#/components/schemas/${name}`,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
const TypeIsArrayFixValue = (o) => {
|
|
42
|
-
try {
|
|
43
|
-
if (typeof o === 'string')
|
|
44
|
-
return JSON.parse(String(o));
|
|
45
|
-
return o;
|
|
46
|
-
}
|
|
47
|
-
catch (_a) {
|
|
48
|
-
return o;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
exports.TypeIsArrayFixValue = TypeIsArrayFixValue;
|
|
52
|
-
const TypeIsArray = (0, typeGenerator_1.typeGenerator)((options) => ({
|
|
53
|
-
__name: 'array',
|
|
54
|
-
toSwagger: () => (0, exports.TypeIsArrayToSwagger)(options),
|
|
55
|
-
fixValue: exports.TypeIsArrayFixValue,
|
|
56
|
-
}));
|
|
57
|
-
exports.default = TypeIsArray;
|
|
58
|
-
//# sourceMappingURL=array.js.map
|
package/dist/types/array.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/types/array.ts"],"names":[],"mappings":";;;;;;AACA,8DAAuE;AACvE,+DAAuC;AAEvC,wEAAqE;AACrE,2CAA2C;AAE9B,QAAA,oBAAoB,GAAG,IAAA,uCAAkB,EAAc,CAAC,OAAO,EAAE,EAAE;;IAC9E,MAAM,KAAK,GAAG,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EAAE,CAAC,IAAA,4BAAoB,EAAC,OAAO,CAAC;IAC9C,QAAQ,EAAE,2BAAmB;CAC9B,CAAC,CAAC,CAAC;AAEJ,kBAAe,WAAW,CAAC"}
|
package/dist/types/base64.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BlobSize } from 'sequelize';
|
|
2
|
-
export interface TypeIsBase64Option {
|
|
3
|
-
length?: BlobSize;
|
|
4
|
-
comment?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const TypeIsBase64ToSwagger: (options?: (TypeIsBase64Option & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
7
|
-
export declare const TypeIsBase64ToSequelize: (options?: (TypeIsBase64Option & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>;
|
|
8
|
-
declare const TypeIsBase64: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/types/base64.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,WAAW,CAAC;AAKhD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,qBAAqB,+LAI/B,CAAC;AAEJ,eAAO,MAAM,uBAAuB,6NAIjC,CAAC;AAEJ,QAAA,MAAM,YAAY,iSAIf,CAAC;AAEJ,eAAe,YAAY,CAAC"}
|
package/dist/types/base64.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeIsBase64ToSequelize = exports.TypeIsBase64ToSwagger = 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.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: sequelize_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
|
package/dist/types/base64.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src/types/base64.ts"],"names":[],"mappings":";;;AAAA,yCAAgD;AAChD,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,qBAAS,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"}
|
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"}
|
package/dist/types/binary.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BlobSize } from 'sequelize';
|
|
2
|
-
export interface TypeIsBinaryOption {
|
|
3
|
-
length?: BlobSize;
|
|
4
|
-
comment?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const TypeIsBinaryToSwagger: (options?: (TypeIsBinaryOption & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
7
|
-
export declare const TypeIsBinaryToSequelize: (options?: (TypeIsBinaryOption & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>;
|
|
8
|
-
declare const TypeIsBinary: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../src/types/binary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,WAAW,CAAC;AAKhD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,qBAAqB,+LAI/B,CAAC;AAEJ,eAAO,MAAM,uBAAuB,6NAIjC,CAAC;AAEJ,QAAA,MAAM,YAAY,iSAIf,CAAC;AAEJ,eAAe,YAAY,CAAC"}
|
package/dist/types/binary.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeIsBinaryToSequelize = exports.TypeIsBinaryToSwagger = 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.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: sequelize_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
|
package/dist/types/binary.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../src/types/binary.ts"],"names":[],"mappings":";;;AAAA,yCAAgD;AAChD,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,qBAAS,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"}
|
package/dist/types/boolean.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface TypeIsBooleanOption {
|
|
2
|
-
comment?: string;
|
|
3
|
-
}
|
|
4
|
-
export declare const TypeIsBooleanToSwagger: (options?: (TypeIsBooleanOption & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
5
|
-
export declare const TypeIsBooleanToSequelize: (options?: (TypeIsBooleanOption & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>;
|
|
6
|
-
export declare const TypeIsBooleanFixValue: (o: any) => any;
|
|
7
|
-
declare const TypeIsBoolean: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").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
|
|
@@ -1 +0,0 @@
|
|
|
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,gMAGhC,CAAC;AAEJ,eAAO,MAAM,wBAAwB,8NAIlC,CAAC;AAEJ,eAAO,MAAM,qBAAqB,MAAO,GAAG,QAI3C,CAAC;AAEF,QAAA,MAAM,aAAa,kSAKhB,CAAC;AAEJ,eAAe,aAAa,CAAC"}
|
package/dist/types/boolean.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeIsBooleanFixValue = exports.TypeIsBooleanToSequelize = exports.TypeIsBooleanToSwagger = 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.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: sequelize_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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../src/types/boolean.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,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,qBAAS,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"}
|
package/dist/types/dateonly.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface TypeIsDateOnlyOption {
|
|
2
|
-
comment?: string;
|
|
3
|
-
}
|
|
4
|
-
export declare const TypeIsDateOnlyToSwagger: (options?: (TypeIsDateOnlyOption & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("./generators/toSwaggerGenerator").ISwaggerData;
|
|
5
|
-
export declare const TypeIsDateOnlyToSequelize: (options?: (TypeIsDateOnlyOption & import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>) | undefined) => import("sequelize").ModelAttributeColumnOptions<import("sequelize").Model<any, any>>;
|
|
6
|
-
declare const TypeIsDateOnly: (...options: (import("sequelize").ModelAttributeColumnOptions<import("sequelize").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
|
|
@@ -1 +0,0 @@
|
|
|
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,iMAIjC,CAAC;AAEJ,eAAO,MAAM,yBAAyB,+NAInC,CAAC;AAEJ,QAAA,MAAM,cAAc,mSAIjB,CAAC;AAEJ,eAAe,cAAc,CAAC"}
|