@asapjs/sequelize 0.2.1 → 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.
Files changed (133) hide show
  1. package/dist/dbml/index.d.ts +1 -1
  2. package/dist/dbml/index.d.ts.map +1 -1
  3. package/dist/dbml/index.js +39 -36
  4. package/dist/dbml/index.js.map +1 -1
  5. package/dist/dto/ExtendableDto.d.ts +22 -0
  6. package/dist/dto/ExtendableDto.d.ts.map +1 -0
  7. package/dist/dto/ExtendableDto.js +133 -0
  8. package/dist/dto/ExtendableDto.js.map +1 -0
  9. package/dist/dto/PaginationQueryDto.d.ts +6 -0
  10. package/dist/dto/PaginationQueryDto.d.ts.map +1 -0
  11. package/dist/dto/PaginationQueryDto.js +25 -0
  12. package/dist/dto/PaginationQueryDto.js.map +1 -0
  13. package/dist/dto/index.d.ts +2 -37
  14. package/dist/dto/index.d.ts.map +1 -1
  15. package/dist/dto/index.js +8 -187
  16. package/dist/dto/index.js.map +1 -1
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +3 -7
  20. package/dist/index.js.map +1 -1
  21. package/dist/table/index.d.ts +2 -1
  22. package/dist/table/index.d.ts.map +1 -1
  23. package/dist/table/index.js +22 -21
  24. package/dist/table/index.js.map +1 -1
  25. package/dist/types/array.d.ts +7 -0
  26. package/dist/types/array.d.ts.map +1 -0
  27. package/dist/types/array.js +42 -0
  28. package/dist/types/array.js.map +1 -0
  29. package/dist/types/base64.d.ts +10 -0
  30. package/dist/types/base64.d.ts.map +1 -0
  31. package/dist/types/base64.js +20 -0
  32. package/dist/types/base64.js.map +1 -0
  33. package/dist/types/belongsto.d.ts +6 -0
  34. package/dist/types/belongsto.d.ts.map +1 -0
  35. package/dist/types/belongsto.js +27 -0
  36. package/dist/types/belongsto.js.map +1 -0
  37. package/dist/types/binary.d.ts +10 -0
  38. package/dist/types/binary.d.ts.map +1 -0
  39. package/dist/types/binary.js +20 -0
  40. package/dist/types/binary.js.map +1 -0
  41. package/dist/types/boolean.d.ts +9 -0
  42. package/dist/types/boolean.d.ts.map +1 -0
  43. package/dist/types/boolean.js +27 -0
  44. package/dist/types/boolean.js.map +1 -0
  45. package/dist/types/dateonly.d.ts +8 -0
  46. package/dist/types/dateonly.d.ts.map +1 -0
  47. package/dist/types/dateonly.js +20 -0
  48. package/dist/types/dateonly.js.map +1 -0
  49. package/dist/types/datetime.d.ts +8 -0
  50. package/dist/types/datetime.d.ts.map +1 -0
  51. package/dist/types/datetime.js +20 -0
  52. package/dist/types/datetime.js.map +1 -0
  53. package/dist/types/decemal.d.ts +11 -0
  54. package/dist/types/decemal.d.ts.map +1 -0
  55. package/dist/types/decemal.js +30 -0
  56. package/dist/types/decemal.js.map +1 -0
  57. package/dist/types/double.d.ts +11 -0
  58. package/dist/types/double.d.ts.map +1 -0
  59. package/dist/types/double.js +27 -0
  60. package/dist/types/double.js.map +1 -0
  61. package/dist/types/dto.d.ts +10 -0
  62. package/dist/types/dto.d.ts.map +1 -0
  63. package/dist/types/dto.js +22 -0
  64. package/dist/types/dto.js.map +1 -0
  65. package/dist/types/enum.d.ts +9 -0
  66. package/dist/types/enum.d.ts.map +1 -0
  67. package/dist/types/enum.js +26 -0
  68. package/dist/types/enum.js.map +1 -0
  69. package/dist/types/float.d.ts +11 -0
  70. package/dist/types/float.d.ts.map +1 -0
  71. package/dist/types/float.js +27 -0
  72. package/dist/types/float.js.map +1 -0
  73. package/dist/types/foreignkey.d.ts +6 -0
  74. package/dist/types/foreignkey.d.ts.map +1 -0
  75. package/dist/types/foreignkey.js +33 -0
  76. package/dist/types/foreignkey.js.map +1 -0
  77. package/dist/types/generators/toSequelizeGenerator.d.ts +3 -0
  78. package/dist/types/generators/toSequelizeGenerator.d.ts.map +1 -0
  79. package/dist/types/generators/toSequelizeGenerator.js +6 -0
  80. package/dist/types/generators/toSequelizeGenerator.js.map +1 -0
  81. package/dist/types/generators/toSwaggerGenerator.d.ts +9 -0
  82. package/dist/types/generators/toSwaggerGenerator.d.ts.map +1 -0
  83. package/dist/types/generators/toSwaggerGenerator.js +6 -0
  84. package/dist/types/generators/toSwaggerGenerator.js.map +1 -0
  85. package/dist/types/generators/typeGenerator.d.ts +15 -0
  86. package/dist/types/generators/typeGenerator.d.ts.map +1 -0
  87. package/dist/types/generators/typeGenerator.js +38 -0
  88. package/dist/types/generators/typeGenerator.js.map +1 -0
  89. package/dist/types/index.d.ts +26 -0
  90. package/dist/types/index.d.ts.map +1 -0
  91. package/dist/types/index.js +53 -0
  92. package/dist/types/index.js.map +1 -0
  93. package/dist/types/int.d.ts +12 -0
  94. package/dist/types/int.d.ts.map +1 -0
  95. package/dist/types/int.js +27 -0
  96. package/dist/types/int.js.map +1 -0
  97. package/dist/types/json.d.ts +9 -0
  98. package/dist/types/json.d.ts.map +1 -0
  99. package/dist/types/json.js +31 -0
  100. package/dist/types/json.js.map +1 -0
  101. package/dist/types/long.d.ts +12 -0
  102. package/dist/types/long.d.ts.map +1 -0
  103. package/dist/types/long.js +27 -0
  104. package/dist/types/long.js.map +1 -0
  105. package/dist/types/paging.d.ts +6 -0
  106. package/dist/types/paging.d.ts.map +1 -0
  107. package/dist/types/paging.js +65 -0
  108. package/dist/types/paging.js.map +1 -0
  109. package/dist/types/password.d.ts +6 -0
  110. package/dist/types/password.d.ts.map +1 -0
  111. package/dist/types/password.js +20 -0
  112. package/dist/types/password.js.map +1 -0
  113. package/dist/types/query.d.ts +20 -0
  114. package/dist/types/query.d.ts.map +1 -0
  115. package/dist/types/query.js +31 -0
  116. package/dist/types/query.js.map +1 -0
  117. package/dist/types/string.d.ts +11 -0
  118. package/dist/types/string.d.ts.map +1 -0
  119. package/dist/types/string.js +26 -0
  120. package/dist/types/string.js.map +1 -0
  121. package/dist/types/text.d.ts +9 -0
  122. package/dist/types/text.d.ts.map +1 -0
  123. package/dist/types/text.js +16 -0
  124. package/dist/types/text.js.map +1 -0
  125. package/dist/types/type.d.ts +7 -0
  126. package/dist/types/type.d.ts.map +1 -0
  127. package/dist/types/type.js +3 -0
  128. package/dist/types/type.js.map +1 -0
  129. package/package.json +1 -1
  130. package/dist/type/index.d.ts +0 -159
  131. package/dist/type/index.d.ts.map +0 -1
  132. package/dist/type/index.js +0 -340
  133. package/dist/type/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"}
package/dist/index.js CHANGED
@@ -3,13 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDBMLData = exports.getUserIdInQuery = exports.TypePaging = exports.TypeArray = exports.TypeIs = exports.Table = exports.Repository = exports.generateDBML = exports.modelsSync = exports.getSequelize = exports.initSequelizeModule = exports.DtoQuery = exports.DtoType = exports.Dto = exports.PaginationQueryDto = exports.ExtendableDto = void 0;
6
+ exports.getDBMLData = exports.getUserIdInQuery = exports.TypeIs = exports.Table = exports.Repository = exports.generateDBML = exports.modelsSync = exports.getSequelize = exports.initSequelizeModule = exports.Dto = exports.PaginationQueryDto = exports.ExtendableDto = void 0;
7
7
  var dto_1 = require("./dto");
8
8
  Object.defineProperty(exports, "ExtendableDto", { enumerable: true, get: function () { return dto_1.ExtendableDto; } });
9
9
  Object.defineProperty(exports, "PaginationQueryDto", { enumerable: true, get: function () { return dto_1.PaginationQueryDto; } });
10
10
  Object.defineProperty(exports, "Dto", { enumerable: true, get: function () { return dto_1.Dto; } });
11
- Object.defineProperty(exports, "DtoType", { enumerable: true, get: function () { return dto_1.DtoType; } });
12
- Object.defineProperty(exports, "DtoQuery", { enumerable: true, get: function () { return dto_1.DtoQuery; } });
13
11
  var sequelize_1 = require("./sequelize");
14
12
  Object.defineProperty(exports, "initSequelizeModule", { enumerable: true, get: function () { return sequelize_1.initSequelizeModule; } });
15
13
  Object.defineProperty(exports, "getSequelize", { enumerable: true, get: function () { return sequelize_1.getSequelize; } });
@@ -19,10 +17,8 @@ var repository_1 = require("./repository");
19
17
  Object.defineProperty(exports, "Repository", { enumerable: true, get: function () { return __importDefault(repository_1).default; } });
20
18
  var table_1 = require("./table");
21
19
  Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return table_1.Table; } });
22
- var type_1 = require("./type");
23
- Object.defineProperty(exports, "TypeIs", { enumerable: true, get: function () { return type_1.TypeIs; } });
24
- Object.defineProperty(exports, "TypeArray", { enumerable: true, get: function () { return type_1.TypeArray; } });
25
- Object.defineProperty(exports, "TypePaging", { enumerable: true, get: function () { return type_1.TypePaging; } });
20
+ var types_1 = require("./types");
21
+ Object.defineProperty(exports, "TypeIs", { enumerable: true, get: function () { return types_1.TypeIs; } });
26
22
  var getUserIdInQuery_1 = require("./utils/getUserIdInQuery");
27
23
  Object.defineProperty(exports, "getUserIdInQuery", { enumerable: true, get: function () { return getUserIdInQuery_1.getUserIdInQuery; } });
28
24
  var dbml_1 = require("./dbml");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,6BAAkF;AAAzE,oGAAA,aAAa,OAAA;AAAE,yGAAA,kBAAkB,OAAA;AAAE,0FAAA,GAAG,OAAA;AAAE,8FAAA,OAAO,OAAA;AAAE,+FAAA,QAAQ,OAAA;AAClE,yCAA0F;AAAjF,gHAAA,mBAAmB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,yGAAA,YAAY,OAAA;AACpE,2CAAqD;AAA5C,yHAAA,OAAO,OAAc;AAC9B,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,+BAAoE;AAA3D,8FAAA,MAAM,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,kGAAA,UAAU,OAAA;AACtC,6DAA4D;AAAnD,oHAAA,gBAAgB,OAAA;AACzB,+BAAqC;AAA5B,mGAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA+D;AAAtD,oGAAA,aAAa,OAAA;AAAE,yGAAA,kBAAkB,OAAA;AAAE,0FAAA,GAAG,OAAA;AAC/C,yCAA0F;AAAjF,gHAAA,mBAAmB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,yGAAA,YAAY,OAAA;AACpE,2CAAqD;AAA5C,yHAAA,OAAO,OAAc;AAC9B,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,iCAA8C;AAArC,+FAAA,MAAM,OAAA;AACf,6DAA4D;AAAnD,oHAAA,gBAAgB,OAAA;AACzB,+BAAqC;AAA5B,mGAAA,WAAW,OAAA"}
@@ -1,3 +1,4 @@
1
1
  import { ModelOptions } from 'sequelize';
2
- export declare function Table(options: ModelOptions): <T extends new (...args: any[]) => {}>(target: T) => void;
2
+ import { ClassType } from '../types';
3
+ export declare function Table(options: ModelOptions): <T extends ClassType>(target: T) => void;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,YAAY,EAAE,MAAM,WAAW,CAAC;AAa5F,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY,4BACE,GAAG,EAAE,KAAG,EAAE,qBAgCtD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,EAAgB,SAAS,EAAE,MAAM,UAAU,CAAC;AAEnD,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY,4CAsC1C"}
@@ -2,37 +2,38 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Table = void 0;
4
4
  const sequelize_typescript_1 = require("sequelize-typescript");
5
- const foreign_key_service_1 = require("sequelize-typescript/dist/associations/foreign-key/foreign-key-service");
5
+ const belongsto_1 = require("../types/belongsto");
6
+ const foreignkey_1 = require("../types/foreignkey");
6
7
  const dbml_1 = require("../dbml");
7
- const type_1 = require("../type");
8
+ const types_1 = require("../types");
8
9
  function Table(options) {
9
10
  return function (target) {
10
11
  const modelName = options.tableName || target.name;
11
- const types = (0, type_1.getTypesData)(target);
12
+ const types = (0, types_1.getTypesData)(target);
12
13
  Object.entries(types).forEach(([key, type]) => {
13
- if (!['foreignkey', 'belongsto'].includes(type.__name)) {
14
- (0, sequelize_typescript_1.addAttribute)(target.prototype, key, type.toSequelize());
15
- }
16
- else if (type.__name === 'foreignkey') {
17
- (0, foreign_key_service_1.addForeignKey)(target.prototype, type.toSequelize(), key);
14
+ if (type.__name === 'foreignkey') {
15
+ (0, foreignkey_1.TypeIsForienKeyAddColumn)(target, type, key);
18
16
  }
19
17
  else if (type.__name === 'belongsto') {
20
- const { associatedClassGetter, optionsOrForeignKey } = type.toSequelize();
21
- const options = (0, sequelize_typescript_1.getPreparedAssociationOptions)(optionsOrForeignKey);
22
- if (!options.as)
23
- options.as = key;
24
- (0, sequelize_typescript_1.addAssociation)(target.prototype, new sequelize_typescript_1.BelongsToAssociation(associatedClassGetter, options));
18
+ (0, belongsto_1.TypeIsBelongsToAddColumn)(target, type, key);
19
+ }
20
+ else {
21
+ (0, sequelize_typescript_1.addAttribute)(target.prototype, key, type.toSequelize());
25
22
  }
26
23
  });
24
+ if ((options === null || options === void 0 ? void 0 : options.timestamps) !== false) {
25
+ (0, sequelize_typescript_1.addOptions)(target.prototype, {
26
+ createdAt: 'created_at',
27
+ timestamps: true,
28
+ });
29
+ (0, sequelize_typescript_1.addOptions)(target.prototype, {
30
+ updatedAt: 'updated_at',
31
+ timestamps: true,
32
+ });
33
+ }
34
+ // DBML GENERATE를 위한 Table 정보 저장
27
35
  (0, dbml_1.addTable)(modelName, target.name, types);
28
- (0, sequelize_typescript_1.addOptions)(target.prototype, {
29
- createdAt: 'created_at',
30
- timestamps: true,
31
- });
32
- (0, sequelize_typescript_1.addOptions)(target.prototype, {
33
- updatedAt: 'updated_at',
34
- timestamps: true,
35
- });
36
+ // sequelize-typescript
36
37
  (0, sequelize_typescript_1.setModelName)(target.prototype, modelName);
37
38
  (0, sequelize_typescript_1.addOptions)(target.prototype, Object.assign(Object.assign({}, options), { charset: 'utf8mb4', collate: 'utf8mb4_general_ci' }));
38
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":";;;AACA,+DAO8B;AAC9B,gHAAuG;AACvG,kCAAmC;AACnC,kCAAuC;AAEvC,SAAgB,KAAK,CAAC,OAAqB;IACzC,OAAO,UAAkD,MAAS;QAChE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC;QACnD,MAAM,KAAK,GAAG,IAAA,mBAAY,EAAC,MAAM,CAAC,CAAC;QAEnC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;YAC5C,IAAI,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAE,IAAY,CAAC,MAAM,CAAC,EAAE;gBAC/D,IAAA,mCAAY,EAAC,MAAM,CAAC,SAAS,EAAE,GAAG,EAAG,IAAY,CAAC,WAAW,EAAE,CAAC,CAAC;aAClE;iBAAM,IAAK,IAAY,CAAC,MAAM,KAAK,YAAY,EAAE;gBAChD,IAAA,mCAAa,EAAC,MAAM,CAAC,SAAS,EAAG,IAAY,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,CAAC;aACnE;iBAAM,IAAK,IAAY,CAAC,MAAM,KAAK,WAAW,EAAE;gBAC/C,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,GAAI,IAAY,CAAC,WAAW,EAAE,CAAC;gBACnF,MAAM,OAAO,GAAqB,IAAA,oDAA6B,EAAC,mBAAmB,CAAC,CAAC;gBACrF,IAAI,CAAC,OAAO,CAAC,EAAE;oBAAE,OAAO,CAAC,EAAE,GAAG,GAAG,CAAC;gBAClC,IAAA,qCAAc,EAAC,MAAM,CAAC,SAAS,EAAE,IAAI,2CAAoB,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC,CAAC;aAC5F;QACH,CAAC,CAAC,CAAC;QAEH,IAAA,eAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAExC,IAAA,iCAAU,EAAC,MAAM,CAAC,SAAS,EAAE;YAC3B,SAAS,EAAE,YAAY;YACvB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,IAAA,iCAAU,EAAC,MAAM,CAAC,SAAS,EAAE;YAC3B,SAAS,EAAE,YAAY;YACvB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,IAAA,mCAAY,EAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC1C,IAAA,iCAAU,EAAC,MAAM,CAAC,SAAS,kCAAO,OAAO,KAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,IAAG,CAAC;IAClG,CAAC,CAAC;AACJ,CAAC;AAjCD,sBAiCC"}
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