@steroidsjs/nest 3.0.3 → 3.2.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.
Files changed (200) hide show
  1. package/infrastructure/adapters/QueryAdapterTypeORM.js +2 -2
  2. package/infrastructure/adapters/QueryAdapterTypeORM.js.map +1 -1
  3. package/infrastructure/applications/rest/RestApplication.js +1 -0
  4. package/infrastructure/applications/rest/RestApplication.js.map +1 -1
  5. package/infrastructure/base/ModelTableStorage.d.ts +4 -0
  6. package/infrastructure/base/ModelTableStorage.js +21 -0
  7. package/infrastructure/base/ModelTableStorage.js.map +1 -0
  8. package/infrastructure/commands/entity-generator/templates/TableTemplate.txt +2 -2
  9. package/infrastructure/decorators/fields/BaseField.d.ts +2 -2
  10. package/infrastructure/decorators/fields/BaseField.js +68 -80
  11. package/infrastructure/decorators/fields/BaseField.js.map +1 -1
  12. package/infrastructure/decorators/fields/BooleanField.js +1 -9
  13. package/infrastructure/decorators/fields/BooleanField.js.map +1 -1
  14. package/infrastructure/decorators/fields/ComputableField.js +1 -1
  15. package/infrastructure/decorators/fields/ComputableField.js.map +1 -1
  16. package/infrastructure/decorators/fields/CoordinateField.js +0 -8
  17. package/infrastructure/decorators/fields/CoordinateField.js.map +1 -1
  18. package/infrastructure/decorators/fields/CreateTimeField.js +1 -23
  19. package/infrastructure/decorators/fields/CreateTimeField.js.map +1 -1
  20. package/infrastructure/decorators/fields/DateField.js +0 -6
  21. package/infrastructure/decorators/fields/DateField.js.map +1 -1
  22. package/infrastructure/decorators/fields/DateTimeField.js +6 -16
  23. package/infrastructure/decorators/fields/DateTimeField.js.map +1 -1
  24. package/infrastructure/decorators/fields/DecimalField.js +0 -8
  25. package/infrastructure/decorators/fields/DecimalField.js.map +1 -1
  26. package/infrastructure/decorators/fields/DecimalNumberField.js +3 -12
  27. package/infrastructure/decorators/fields/DecimalNumberField.js.map +1 -1
  28. package/infrastructure/decorators/fields/DeleteDateField.js +0 -5
  29. package/infrastructure/decorators/fields/DeleteDateField.js.map +1 -1
  30. package/infrastructure/decorators/fields/EmailField.js +0 -7
  31. package/infrastructure/decorators/fields/EmailField.js.map +1 -1
  32. package/infrastructure/decorators/fields/EnumField.js +2 -9
  33. package/infrastructure/decorators/fields/EnumField.js.map +1 -1
  34. package/infrastructure/decorators/fields/ExtendField.d.ts +1 -1
  35. package/infrastructure/decorators/fields/ExtendField.js +3 -2
  36. package/infrastructure/decorators/fields/ExtendField.js.map +1 -1
  37. package/infrastructure/decorators/fields/FileField.js +0 -6
  38. package/infrastructure/decorators/fields/FileField.js.map +1 -1
  39. package/infrastructure/decorators/fields/HtmlField.js +0 -5
  40. package/infrastructure/decorators/fields/HtmlField.js.map +1 -1
  41. package/infrastructure/decorators/fields/ImageField.js.map +1 -1
  42. package/infrastructure/decorators/fields/IntegerField.js +0 -7
  43. package/infrastructure/decorators/fields/IntegerField.js.map +1 -1
  44. package/infrastructure/decorators/fields/JSONBField.d.ts +1 -2
  45. package/infrastructure/decorators/fields/JSONBField.js +0 -8
  46. package/infrastructure/decorators/fields/JSONBField.js.map +1 -1
  47. package/infrastructure/decorators/fields/PasswordField.js +0 -6
  48. package/infrastructure/decorators/fields/PasswordField.js.map +1 -1
  49. package/infrastructure/decorators/fields/PhoneField.js +0 -8
  50. package/infrastructure/decorators/fields/PhoneField.js.map +1 -1
  51. package/infrastructure/decorators/fields/PrimaryKeyField.js +1 -2
  52. package/infrastructure/decorators/fields/PrimaryKeyField.js.map +1 -1
  53. package/infrastructure/decorators/fields/RelationField.js +4 -51
  54. package/infrastructure/decorators/fields/RelationField.js.map +1 -1
  55. package/infrastructure/decorators/fields/RelationIdField.js +8 -16
  56. package/infrastructure/decorators/fields/RelationIdField.js.map +1 -1
  57. package/infrastructure/decorators/fields/StringField.js +0 -9
  58. package/infrastructure/decorators/fields/StringField.js.map +1 -1
  59. package/infrastructure/decorators/fields/TextField.js +0 -7
  60. package/infrastructure/decorators/fields/TextField.js.map +1 -1
  61. package/infrastructure/decorators/fields/TimeField.js +1 -8
  62. package/infrastructure/decorators/fields/TimeField.js.map +1 -1
  63. package/infrastructure/decorators/fields/UidField.d.ts +0 -1
  64. package/infrastructure/decorators/fields/UidField.js +2 -28
  65. package/infrastructure/decorators/fields/UidField.js.map +1 -1
  66. package/infrastructure/decorators/fields/UpdateTimeField.js +2 -26
  67. package/infrastructure/decorators/fields/UpdateTimeField.js.map +1 -1
  68. package/infrastructure/decorators/fields/index.d.ts +57 -16
  69. package/infrastructure/decorators/fields/index.js +110 -54
  70. package/infrastructure/decorators/fields/index.js.map +1 -1
  71. package/infrastructure/decorators/typeorm/TypeOrmDecoratorFactory.d.ts +2 -0
  72. package/infrastructure/decorators/typeorm/TypeOrmDecoratorFactory.js +65 -0
  73. package/infrastructure/decorators/typeorm/TypeOrmDecoratorFactory.js.map +1 -0
  74. package/infrastructure/decorators/typeorm/TypeOrmTableFromModel.d.ts +6 -0
  75. package/infrastructure/decorators/typeorm/TypeOrmTableFromModel.js +29 -0
  76. package/infrastructure/decorators/typeorm/TypeOrmTableFromModel.js.map +1 -0
  77. package/infrastructure/decorators/typeorm/fields/TypeOrmBooleanField/index.d.ts +3 -0
  78. package/infrastructure/decorators/typeorm/fields/TypeOrmBooleanField/index.js +14 -0
  79. package/infrastructure/decorators/typeorm/fields/TypeOrmBooleanField/index.js.map +1 -0
  80. package/infrastructure/decorators/typeorm/fields/TypeOrmCoordinateField/index.d.ts +3 -0
  81. package/infrastructure/decorators/typeorm/fields/TypeOrmCoordinateField/index.js +13 -0
  82. package/infrastructure/decorators/typeorm/fields/TypeOrmCoordinateField/index.js.map +1 -0
  83. package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/TypeOrmCreateTimeBehaviour.d.ts +1 -0
  84. package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/TypeOrmCreateTimeBehaviour.js +22 -0
  85. package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/TypeOrmCreateTimeBehaviour.js.map +1 -0
  86. package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/index.d.ts +3 -0
  87. package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/index.js +17 -0
  88. package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/index.js.map +1 -0
  89. package/infrastructure/decorators/typeorm/fields/TypeOrmDateField/index.d.ts +3 -0
  90. package/infrastructure/decorators/typeorm/fields/TypeOrmDateField/index.js +11 -0
  91. package/infrastructure/decorators/typeorm/fields/TypeOrmDateField/index.js.map +1 -0
  92. package/infrastructure/decorators/typeorm/fields/TypeOrmDateTimeField/index.d.ts +3 -0
  93. package/infrastructure/decorators/typeorm/fields/TypeOrmDateTimeField/index.js +12 -0
  94. package/infrastructure/decorators/typeorm/fields/TypeOrmDateTimeField/index.js.map +1 -0
  95. package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalField/index.d.ts +3 -0
  96. package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalField/index.js +13 -0
  97. package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalField/index.js.map +1 -0
  98. package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalNumberField/index.d.ts +3 -0
  99. package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalNumberField/index.js +13 -0
  100. package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalNumberField/index.js.map +1 -0
  101. package/infrastructure/decorators/typeorm/fields/TypeOrmDeleteDateColumn/index.d.ts +2 -0
  102. package/infrastructure/decorators/typeorm/fields/TypeOrmDeleteDateColumn/index.js +10 -0
  103. package/infrastructure/decorators/typeorm/fields/TypeOrmDeleteDateColumn/index.js.map +1 -0
  104. package/infrastructure/decorators/typeorm/fields/TypeOrmEmailField/index.d.ts +3 -0
  105. package/infrastructure/decorators/typeorm/fields/TypeOrmEmailField/index.js +12 -0
  106. package/infrastructure/decorators/typeorm/fields/TypeOrmEmailField/index.js.map +1 -0
  107. package/infrastructure/decorators/typeorm/fields/TypeOrmEnumField/index.d.ts +3 -0
  108. package/infrastructure/decorators/typeorm/fields/TypeOrmEnumField/index.js +12 -0
  109. package/infrastructure/decorators/typeorm/fields/TypeOrmEnumField/index.js.map +1 -0
  110. package/infrastructure/decorators/typeorm/fields/TypeOrmFileField/index.d.ts +3 -0
  111. package/infrastructure/decorators/typeorm/fields/TypeOrmFileField/index.js +11 -0
  112. package/infrastructure/decorators/typeorm/fields/TypeOrmFileField/index.js.map +1 -0
  113. package/infrastructure/decorators/typeorm/fields/TypeOrmHtmlField/index.d.ts +3 -0
  114. package/infrastructure/decorators/typeorm/fields/TypeOrmHtmlField/index.js +11 -0
  115. package/infrastructure/decorators/typeorm/fields/TypeOrmHtmlField/index.js.map +1 -0
  116. package/infrastructure/decorators/typeorm/fields/TypeOrmImageField/index.d.ts +3 -0
  117. package/infrastructure/decorators/typeorm/fields/TypeOrmImageField/index.js +11 -0
  118. package/infrastructure/decorators/typeorm/fields/TypeOrmImageField/index.js.map +1 -0
  119. package/infrastructure/decorators/typeorm/fields/TypeOrmIntegerField/index.d.ts +3 -0
  120. package/infrastructure/decorators/typeorm/fields/TypeOrmIntegerField/index.js +12 -0
  121. package/infrastructure/decorators/typeorm/fields/TypeOrmIntegerField/index.js.map +1 -0
  122. package/infrastructure/decorators/typeorm/fields/TypeOrmJSONBField/index.d.ts +3 -0
  123. package/infrastructure/decorators/typeorm/fields/TypeOrmJSONBField/index.js +13 -0
  124. package/infrastructure/decorators/typeorm/fields/TypeOrmJSONBField/index.js.map +1 -0
  125. package/infrastructure/decorators/typeorm/fields/TypeOrmPasswordField/index.d.ts +3 -0
  126. package/infrastructure/decorators/typeorm/fields/TypeOrmPasswordField/index.js +12 -0
  127. package/infrastructure/decorators/typeorm/fields/TypeOrmPasswordField/index.js.map +1 -0
  128. package/infrastructure/decorators/typeorm/fields/TypeOrmPhoneField/index.d.ts +3 -0
  129. package/infrastructure/decorators/typeorm/fields/TypeOrmPhoneField/index.js +13 -0
  130. package/infrastructure/decorators/typeorm/fields/TypeOrmPhoneField/index.js.map +1 -0
  131. package/infrastructure/decorators/typeorm/fields/TypeOrmPrimaryKeyField/index.d.ts +2 -0
  132. package/infrastructure/decorators/typeorm/fields/TypeOrmPrimaryKeyField/index.js +7 -0
  133. package/infrastructure/decorators/typeorm/fields/TypeOrmPrimaryKeyField/index.js.map +1 -0
  134. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.d.ts +4 -0
  135. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.js +30 -0
  136. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.js.map +1 -0
  137. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/index.d.ts +3 -0
  138. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/index.js +17 -0
  139. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/index.js.map +1 -0
  140. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationIdField/index.d.ts +3 -0
  141. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationIdField/index.js +10 -0
  142. package/infrastructure/decorators/typeorm/fields/TypeOrmRelationIdField/index.js.map +1 -0
  143. package/infrastructure/decorators/typeorm/fields/TypeOrmStringField/index.d.ts +3 -0
  144. package/infrastructure/decorators/typeorm/fields/TypeOrmStringField/index.js +14 -0
  145. package/infrastructure/decorators/typeorm/fields/TypeOrmStringField/index.js.map +1 -0
  146. package/infrastructure/decorators/typeorm/fields/TypeOrmTextField/index.d.ts +3 -0
  147. package/infrastructure/decorators/typeorm/fields/TypeOrmTextField/index.js +12 -0
  148. package/infrastructure/decorators/typeorm/fields/TypeOrmTextField/index.js.map +1 -0
  149. package/infrastructure/decorators/typeorm/fields/TypeOrmTimeField/index.d.ts +3 -0
  150. package/infrastructure/decorators/typeorm/fields/TypeOrmTimeField/index.js +12 -0
  151. package/infrastructure/decorators/typeorm/fields/TypeOrmTimeField/index.js.map +1 -0
  152. package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/TypeOrmUidBehaviour.d.ts +2 -0
  153. package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/TypeOrmUidBehaviour.js +26 -0
  154. package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/TypeOrmUidBehaviour.js.map +1 -0
  155. package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/index.d.ts +3 -0
  156. package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/index.js +14 -0
  157. package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/index.js.map +1 -0
  158. package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/TypeOrmUpdateTimeBehaviour.d.ts +1 -0
  159. package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/TypeOrmUpdateTimeBehaviour.js +24 -0
  160. package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/TypeOrmUpdateTimeBehaviour.js.map +1 -0
  161. package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/index.d.ts +3 -0
  162. package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/index.js +17 -0
  163. package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/index.js.map +1 -0
  164. package/infrastructure/repositories/CrudRepository.d.ts +5 -0
  165. package/infrastructure/repositories/CrudRepository.js +13 -4
  166. package/infrastructure/repositories/CrudRepository.js.map +1 -1
  167. package/infrastructure/tests/app/tables/ArticleTable.js +2 -2
  168. package/infrastructure/tests/app/tables/ArticleTable.js.map +1 -1
  169. package/infrastructure/tests/app/tables/CommentTable.js +2 -2
  170. package/infrastructure/tests/app/tables/CommentTable.js.map +1 -1
  171. package/infrastructure/tests/app/tables/FileTable.js +2 -2
  172. package/infrastructure/tests/app/tables/FileTable.js.map +1 -1
  173. package/infrastructure/tests/app/tables/ImageTable.js +2 -2
  174. package/infrastructure/tests/app/tables/ImageTable.js.map +1 -1
  175. package/infrastructure/tests/app/tables/TagTable.js +2 -2
  176. package/infrastructure/tests/app/tables/TagTable.js.map +1 -1
  177. package/infrastructure/tests/app/tables/UserInfoTable.js +2 -2
  178. package/infrastructure/tests/app/tables/UserInfoTable.js.map +1 -1
  179. package/infrastructure/tests/app/tables/UserTable.js +2 -2
  180. package/infrastructure/tests/app/tables/UserTable.js.map +1 -1
  181. package/package.json +1 -1
  182. package/tsconfig.tsbuildinfo +1 -1
  183. package/usecases/exceptions/ClassValidatorException.d.ts +5 -0
  184. package/usecases/exceptions/ClassValidatorException.js +10 -0
  185. package/usecases/exceptions/ClassValidatorException.js.map +1 -0
  186. package/usecases/helpers/DataMapper.js +2 -2
  187. package/usecases/helpers/DataMapper.js.map +1 -1
  188. package/usecases/helpers/ValidationHelper.d.ts +1 -0
  189. package/usecases/helpers/ValidationHelper.js +57 -6
  190. package/usecases/helpers/ValidationHelper.js.map +1 -1
  191. package/usecases/interfaces/ICrudRepository.d.ts +1 -0
  192. package/usecases/services/ReadService.d.ts +5 -0
  193. package/usecases/services/ReadService.js +7 -0
  194. package/usecases/services/ReadService.js.map +1 -1
  195. package/usecases/validators/Validator.d.ts +5 -5
  196. package/usecases/validators/Validator.js +16 -8
  197. package/usecases/validators/Validator.js.map +1 -1
  198. package/infrastructure/decorators/TableFromModel.d.ts +0 -9
  199. package/infrastructure/decorators/TableFromModel.js +0 -44
  200. package/infrastructure/decorators/TableFromModel.js.map +0 -1
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => {
5
+ var _a, _b;
6
+ return [
7
+ (0, typeorm_1.Column)({
8
+ type: options.dbType || 'boolean',
9
+ default: (_a = options.defaultValue) !== null && _a !== void 0 ? _a : false,
10
+ nullable: (_b = options.nullable) !== null && _b !== void 0 ? _b : false,
11
+ }),
12
+ ];
13
+ };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmBooleanField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE;;IAAC,OAAA;QAC3C,IAAA,gBAAM,EAAC;YACH,IAAI,EAAE,OAAO,CAAC,MAAM,IAAI,SAAS;YACjC,OAAO,EAAE,MAAA,OAAO,CAAC,YAAY,mCAAI,KAAK;YACtC,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK;SACtC,CAAC;KACL,CAAA;CAAA,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ICoordinateFieldOptions } from '../../../fields/CoordinateField';
2
+ declare const _default: (options: ICoordinateFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'decimal',
7
+ default: options.defaultValue,
8
+ nullable: options.nullable,
9
+ precision: options.precision || 12,
10
+ scale: options.scale || 9,
11
+ }),
12
+ ];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmCoordinateField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAgC,EAAE,EAAE,CAAC;IACjD,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;KAC5B,CAAC;CACL,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const TypeOrmCreateTimeBehaviour: (object: any, propertyName: any) => void;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeOrmCreateTimeBehaviour = void 0;
4
+ const typeorm_1 = require("@steroidsjs/typeorm");
5
+ const EventListenerTypes_1 = require("@steroidsjs/typeorm/metadata/types/EventListenerTypes");
6
+ const DateTimeField_1 = require("../../../fields/DateTimeField");
7
+ const TypeOrmCreateTimeBehaviour = (object, propertyName) => {
8
+ const methodName = propertyName + '__createTimeBehaviour';
9
+ if (!object[methodName]) {
10
+ // eslint-disable-next-line func-names
11
+ object[methodName] = function () {
12
+ this[propertyName] = (0, DateTimeField_1.normalizeDateTime)(new Date(), false);
13
+ };
14
+ }
15
+ (0, typeorm_1.getMetadataArgsStorage)().entityListeners.push({
16
+ target: object.constructor,
17
+ propertyName: methodName,
18
+ type: EventListenerTypes_1.EventListenerTypes.BEFORE_INSERT,
19
+ });
20
+ };
21
+ exports.TypeOrmCreateTimeBehaviour = TypeOrmCreateTimeBehaviour;
22
+ //# sourceMappingURL=TypeOrmCreateTimeBehaviour.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeOrmCreateTimeBehaviour.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/TypeOrmCreateTimeBehaviour.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAC3D,8FAAyF;AACzF,iEAAgE;AAEzD,MAAM,0BAA0B,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE;IAC/D,MAAM,UAAU,GAAG,YAAY,GAAG,uBAAuB,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;QACrB,sCAAsC;QACtC,MAAM,CAAC,UAAU,CAAC,GAAG;YACjB,IAAI,CAAC,YAAY,CAAC,GAAG,IAAA,iCAAiB,EAAC,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;QAC9D,CAAC,CAAC;KACL;IAED,IAAA,gCAAsB,GAAE,CAAC,eAAe,CAAC,IAAI,CAAC;QAC1C,MAAM,EAAE,MAAM,CAAC,WAAW;QAC1B,YAAY,EAAE,UAAU;QACxB,IAAI,EAAE,uCAAkB,CAAC,aAAa;KACzC,CAAC,CAAC;AACP,CAAC,CAAC;AAdW,QAAA,0BAA0B,8BAcrC"}
@@ -0,0 +1,3 @@
1
+ import { ICreateTimeFieldOptions } from '../../../fields/CreateTimeField';
2
+ declare const _default: (options: ICreateTimeFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ const TypeOrmCreateTimeBehaviour_1 = require("./TypeOrmCreateTimeBehaviour");
5
+ exports.default = (options) => {
6
+ var _a;
7
+ return [
8
+ (0, typeorm_1.Column)({
9
+ type: 'timestamp',
10
+ precision: options.precision || 0,
11
+ default: options.defaultValue,
12
+ nullable: (_a = options.nullable) !== null && _a !== void 0 ? _a : false,
13
+ }),
14
+ TypeOrmCreateTimeBehaviour_1.TypeOrmCreateTimeBehaviour,
15
+ ];
16
+ };
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAC3C,6EAAwE;AAGxE,kBAAe,CAAC,OAAgC,EAAE,EAAE;;IAAC,OAAA;QACjD,IAAA,gBAAM,EAAC;YACH,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,CAAC;YACjC,OAAO,EAAE,OAAO,CAAC,YAAY;YAC7B,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK;SACtC,CAAC;QACF,uDAA0B;KAC7B,CAAA;CAAA,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IDateFieldOptions } from '../../../fields/DateField';
2
+ declare const _default: (options: IDateFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'date',
7
+ default: options.defaultValue,
8
+ nullable: options.nullable,
9
+ }),
10
+ ];
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDateField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IDateTimeFieldColumnOptions } from '../../../fields/DateTimeField';
2
+ declare const _default: (options: IDateTimeFieldColumnOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'timestamp',
7
+ precision: options.precision || 0,
8
+ default: options.defaultValue,
9
+ nullable: options.nullable,
10
+ }),
11
+ ];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDateTimeField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAoC,EAAE,EAAE,CAAC;IACrD,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,CAAC;QACjC,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IDecimalFieldOptions } from '../../../fields/DecimalField';
2
+ declare const _default: (options: IDecimalFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'decimal',
7
+ default: options.defaultValue,
8
+ nullable: options.nullable,
9
+ precision: options.precision || 10,
10
+ scale: options.scale || 2,
11
+ }),
12
+ ];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDecimalField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA6B,EAAE,EAAE,CAAC;IAC9C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;KAC5B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IDecimalFieldOptions } from '../../../fields/DecimalField';
2
+ declare const _default: (options: IDecimalFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'decimal',
7
+ default: options.defaultValue,
8
+ nullable: options.nullable,
9
+ precision: options.precision || 10,
10
+ scale: options.scale || 2,
11
+ }),
12
+ ];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDecimalNumberField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA6B,EAAE,EAAE,CAAC;IAC9C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;KAC5B,CAAC;CACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare const _default: () => PropertyDecorator[];
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = () => [
5
+ (0, typeorm_1.DeleteDateColumn)({
6
+ type: 'date',
7
+ nullable: true,
8
+ }),
9
+ ];
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDeleteDateColumn/index.ts"],"names":[],"mappings":";;AAAA,iDAAqD;AAErD,kBAAe,GAAG,EAAE,CAAC;IACjB,IAAA,0BAAgB,EAAC;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACjB,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IEmailFieldOptions } from '../../../fields/EmailField';
2
+ declare const _default: (options: IEmailFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'varchar',
7
+ default: options.defaultValue,
8
+ unique: options.unique,
9
+ nullable: options.nullable,
10
+ }),
11
+ ];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmEmailField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA2B,EAAE,EAAE,CAAC;IAC5C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IEnumFieldOptions } from '../../../fields/EnumField';
2
+ declare const _default: (options: IEnumFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'varchar',
7
+ default: options.defaultValue,
8
+ nullable: options.nullable,
9
+ array: options.isArray,
10
+ }),
11
+ ];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmEnumField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IFileField } from '../../../fields/FileField';
2
+ declare const _default: (options: IFileField) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: options.multiple ? 'simple-array' : 'integer',
7
+ default: options.defaultValue,
8
+ nullable: options.nullable,
9
+ }),
10
+ ];
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmFileField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAmB,EAAE,EAAE,CAAC;IACpC,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;QACnD,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IBaseFieldOptions } from '../../../fields/BaseField';
2
+ declare const _default: (options: IBaseFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'text',
7
+ default: options.defaultValue,
8
+ nullable: options.nullable,
9
+ }),
10
+ ];
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmHtmlField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IFileField } from '../../../fields/ImageField';
2
+ declare const _default: (options: IFileField) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: options.multiple ? 'simple-array' : 'integer',
7
+ default: options.defaultValue,
8
+ nullable: options.nullable,
9
+ }),
10
+ ];
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmImageField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAmB,EAAE,EAAE,CAAC;IACpC,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;QACnD,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IAllFieldOptions } from '../../../fields';
2
+ declare const _default: (options: IAllFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'integer',
7
+ default: options.defaultValue,
8
+ unique: options.unique,
9
+ nullable: options.nullable,
10
+ }),
11
+ ];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmIntegerField/index.ts"],"names":[],"mappings":";;AACA,iDAA2C;AAE3C,kBAAe,CAAC,OAAyB,EAAE,EAAE,CAAC;IAC1C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IJSONBFieldOptions } from '../../../fields/JSONBField';
2
+ declare const _default: (options: IJSONBFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'jsonb',
7
+ length: options.max,
8
+ default: options.defaultValue,
9
+ nullable: options.nullable,
10
+ array: options.isArray,
11
+ }),
12
+ ];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmJSONBField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA2B,EAAE,EAAE,CAAC;IAC5C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IBaseFieldOptions } from '../../../fields/BaseField';
2
+ declare const _default: (options: IBaseFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'text',
7
+ length: options.max,
8
+ default: options.defaultValue,
9
+ nullable: options.nullable,
10
+ }),
11
+ ];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmPasswordField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IPhoneFieldOptions } from '../../../fields/PhoneField';
2
+ declare const _default: (options: IPhoneFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'varchar',
7
+ length: options.max || 16,
8
+ default: options.defaultValue,
9
+ unique: options.unique,
10
+ nullable: options.nullable,
11
+ }),
12
+ ];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmPhoneField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA2B,EAAE,EAAE,CAAC;IAC5C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE;QACzB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare const _default: () => PropertyDecorator[];
2
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = () => [
5
+ (0, typeorm_1.PrimaryGeneratedColumn)({ type: 'integer' }),
6
+ ];
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmPrimaryKeyField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAE3D,kBAAe,GAAG,EAAE,CAAC;IACjB,IAAA,gCAAsB,EAAC,EAAC,IAAI,EAAE,SAAS,EAAC,CAAC;CAC5C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { JoinTable } from '@steroidsjs/typeorm';
2
+ import { IRelationFieldManyToManyOptions, IRelationFieldOneToOneOptions } from '../../../fields/RelationField';
3
+ export declare const getRelationDecorator: (relation: any) => any;
4
+ export declare const getOwningDecorator: (options: IRelationFieldOneToOneOptions | IRelationFieldManyToManyOptions) => typeof JoinTable;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOwningDecorator = exports.getRelationDecorator = void 0;
4
+ const typeorm_1 = require("@steroidsjs/typeorm");
5
+ const getRelationDecorator = (relation) => {
6
+ switch (relation) {
7
+ case 'OneToOne':
8
+ return typeorm_1.OneToOne;
9
+ case 'ManyToMany':
10
+ return typeorm_1.ManyToMany;
11
+ case 'OneToMany':
12
+ return typeorm_1.OneToMany;
13
+ case 'ManyToOne':
14
+ return typeorm_1.ManyToOne;
15
+ default:
16
+ throw new Error('Wrong relation type: ' + relation);
17
+ }
18
+ };
19
+ exports.getRelationDecorator = getRelationDecorator;
20
+ const getOwningDecorator = (options) => {
21
+ if (options.type === 'ManyToMany' && options.isOwningSide) {
22
+ return typeorm_1.JoinTable;
23
+ }
24
+ if (options.type === 'OneToOne' && options.isOwningSide) {
25
+ return typeorm_1.JoinColumn;
26
+ }
27
+ return null;
28
+ };
29
+ exports.getOwningDecorator = getOwningDecorator;
30
+ //# sourceMappingURL=TypeOrmRelationBehaviour.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeOrmRelationBehaviour.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.ts"],"names":[],"mappings":";;;AAAA,iDAAsG;AAG/F,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAO,EAAE;IAClD,QAAQ,QAAQ,EAAE;QACd,KAAK,UAAU;YACX,OAAO,kBAAQ,CAAC;QACpB,KAAK,YAAY;YACb,OAAO,oBAAU,CAAC;QACtB,KAAK,WAAW;YACZ,OAAO,mBAAS,CAAC;QACrB,KAAK,WAAW;YACZ,OAAO,mBAAS,CAAC;QACrB;YACI,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,QAAQ,CAAC,CAAC;KAC3D;AACL,CAAC,CAAC;AAbW,QAAA,oBAAoB,wBAa/B;AAEK,MAAM,kBAAkB,GAAG,CAAC,OAAwE,EAAE,EAAE;IAC3G,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE;QACvD,OAAO,mBAAS,CAAC;KACpB;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE;QACrD,OAAO,oBAAU,CAAC;KACrB;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B"}
@@ -0,0 +1,3 @@
1
+ import { IRelationFieldOptions } from '../../../fields/RelationField';
2
+ declare const _default: (options: IRelationFieldOptions) => any[];
3
+ export default _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const TypeOrmRelationBehaviour_1 = require("./TypeOrmRelationBehaviour");
4
+ const ModelTableStorage_1 = require("../../../../base/ModelTableStorage");
5
+ exports.default = (options) => {
6
+ const OwningDecorator = (0, TypeOrmRelationBehaviour_1.getOwningDecorator)(options);
7
+ let owningDecoratorOptions;
8
+ if ('tableName' in options) {
9
+ owningDecoratorOptions = { name: options.tableName };
10
+ }
11
+ return [
12
+ (0, TypeOrmRelationBehaviour_1.getRelationDecorator)(options.type)(() => (0, ModelTableStorage_1.getTableFromModel)(options.relationClass()), options.inverseSide, { cascade: ['insert', 'update'],
13
+ onUpdate: 'CASCADE' }),
14
+ OwningDecorator && OwningDecorator(owningDecoratorOptions),
15
+ ].filter(Boolean);
16
+ };
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/index.ts"],"names":[],"mappings":";;AAAA,yEAAoF;AACpF,0EAAqE;AAGrE,kBAAe,CAAC,OAA8B,EAAE,EAAE;IAC9C,MAAM,eAAe,GAAG,IAAA,6CAAkB,EAAC,OAAc,CAAC,CAAC;IAC3D,IAAI,sBAAsB,CAAC;IAC3B,IAAI,WAAW,IAAI,OAAO,EAAE;QACxB,sBAAsB,GAAG,EAAC,IAAI,EAAE,OAAO,CAAC,SAAS,EAAC,CAAC;KACtD;IACD,OAAO;QACH,IAAA,+CAAoB,EAAC,OAAO,CAAC,IAAI,CAAC,CAC9B,GAAG,EAAE,CAAC,IAAA,qCAAiB,EAAC,OAAO,CAAC,aAAa,EAAE,CAAC,EAC/C,OAAe,CAAC,WAAW,EAC5B,EAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAC1B,QAAQ,EAAE,SAAS,EAAC,CAC3B;QACD,eAAe,IAAI,eAAe,CAAC,sBAAsB,CAAC;KAC7D,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { IRelationIdFieldOptions } from '../../../fields/RelationIdField';
2
+ declare const _default: (options: IRelationIdFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ !options.isArray && (0, typeorm_1.Column)({
6
+ type: 'int',
7
+ nullable: options.nullable,
8
+ }),
9
+ ].filter(Boolean);
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmRelationIdField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAgC,EAAE,EAAE,CAAC;IACjD,CAAC,OAAO,CAAC,OAAO,IAAI,IAAA,gBAAM,EAAC;QACvB,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IStringFieldOptions } from '../../../fields/StringField';
2
+ declare const _default: (options: IStringFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'varchar',
7
+ length: options.max,
8
+ default: options.defaultValue,
9
+ unique: options.unique,
10
+ nullable: options.nullable,
11
+ array: options.isArray,
12
+ }),
13
+ ];
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmStringField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA4B,EAAE,EAAE,CAAC;IAC7C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ITextFieldOptions } from '../../../fields/TextField';
2
+ declare const _default: (options: ITextFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'text',
7
+ length: options.max,
8
+ default: options.defaultValue,
9
+ nullable: options.nullable,
10
+ }),
11
+ ];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmTextField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IBaseFieldOptions } from '../../../fields/BaseField';
2
+ declare const _default: (options: IBaseFieldOptions) => PropertyDecorator[];
3
+ export default _default;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const typeorm_1 = require("@steroidsjs/typeorm");
4
+ exports.default = (options) => [
5
+ (0, typeorm_1.Column)({
6
+ type: 'varchar',
7
+ length: 5,
8
+ default: options.defaultValue,
9
+ nullable: options.nullable,
10
+ }),
11
+ ];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmTimeField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}