@decaf-ts/db-decorators 0.11.0 → 0.13.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 (203) hide show
  1. package/lib/cjs/identity/decorators.cjs +5 -4
  2. package/lib/cjs/identity/decorators.cjs.map +1 -0
  3. package/lib/cjs/identity/index.cjs +1 -0
  4. package/lib/cjs/identity/index.cjs.map +1 -0
  5. package/lib/cjs/index.cjs +2 -1
  6. package/lib/cjs/index.cjs.map +1 -0
  7. package/lib/cjs/interfaces/BulkCrudOperator.cjs +1 -0
  8. package/lib/cjs/interfaces/BulkCrudOperator.cjs.map +1 -0
  9. package/lib/cjs/interfaces/Contextual.cjs +1 -0
  10. package/lib/cjs/interfaces/Contextual.cjs.map +1 -0
  11. package/lib/cjs/interfaces/CrudOperator.cjs +1 -0
  12. package/lib/cjs/interfaces/CrudOperator.cjs.map +1 -0
  13. package/lib/cjs/interfaces/IRepository.cjs +1 -0
  14. package/lib/cjs/interfaces/IRepository.cjs.map +1 -0
  15. package/lib/cjs/interfaces/index.cjs +1 -0
  16. package/lib/cjs/interfaces/index.cjs.map +1 -0
  17. package/lib/cjs/model/constants.cjs +1 -0
  18. package/lib/cjs/model/constants.cjs.map +1 -0
  19. package/lib/cjs/model/decorators.cjs +25 -24
  20. package/lib/cjs/model/decorators.cjs.map +1 -0
  21. package/lib/cjs/model/index.cjs +1 -0
  22. package/lib/cjs/model/index.cjs.map +1 -0
  23. package/lib/cjs/model/model.cjs +1 -0
  24. package/lib/cjs/model/model.cjs.map +1 -0
  25. package/lib/cjs/model/validation.cjs +1 -0
  26. package/lib/cjs/model/validation.cjs.map +1 -0
  27. package/lib/cjs/operations/Operations.cjs +6 -5
  28. package/lib/cjs/operations/Operations.cjs.map +1 -0
  29. package/lib/cjs/operations/OperationsRegistry.cjs +1 -0
  30. package/lib/cjs/operations/OperationsRegistry.cjs.map +1 -0
  31. package/lib/cjs/operations/constants.cjs +15 -39
  32. package/lib/cjs/operations/constants.cjs.map +1 -0
  33. package/lib/cjs/operations/decorators.cjs +42 -41
  34. package/lib/cjs/operations/decorators.cjs.map +1 -0
  35. package/lib/cjs/operations/index.cjs +1 -0
  36. package/lib/cjs/operations/index.cjs.map +1 -0
  37. package/lib/cjs/operations/types.cjs +1 -0
  38. package/lib/cjs/operations/types.cjs.map +1 -0
  39. package/lib/cjs/overrides/Metadata.cjs +1 -0
  40. package/lib/cjs/overrides/Metadata.cjs.map +1 -0
  41. package/lib/cjs/overrides/Model.cjs +1 -0
  42. package/lib/cjs/overrides/Model.cjs.map +1 -0
  43. package/lib/cjs/overrides/ModelBuilderExtensions.cjs +8 -7
  44. package/lib/cjs/overrides/ModelBuilderExtensions.cjs.map +1 -0
  45. package/lib/cjs/overrides/index.cjs +1 -0
  46. package/lib/cjs/overrides/index.cjs.map +1 -0
  47. package/lib/cjs/overrides/overrides.cjs +21 -20
  48. package/lib/cjs/overrides/overrides.cjs.map +1 -0
  49. package/lib/cjs/repository/Context.cjs +3 -2
  50. package/lib/cjs/repository/Context.cjs.map +1 -0
  51. package/lib/cjs/repository/Repository.cjs +42 -41
  52. package/lib/cjs/repository/Repository.cjs.map +1 -0
  53. package/lib/cjs/repository/constants.cjs +1 -0
  54. package/lib/cjs/repository/constants.cjs.map +1 -0
  55. package/lib/cjs/repository/errors.cjs +1 -0
  56. package/lib/cjs/repository/errors.cjs.map +1 -0
  57. package/lib/cjs/repository/index.cjs +1 -0
  58. package/lib/cjs/repository/index.cjs.map +1 -0
  59. package/lib/cjs/repository/types.cjs +1 -0
  60. package/lib/cjs/repository/types.cjs.map +1 -0
  61. package/lib/cjs/repository/utils.cjs +10 -9
  62. package/lib/cjs/repository/utils.cjs.map +1 -0
  63. package/lib/cjs/repository/wrappers.cjs +8 -7
  64. package/lib/cjs/repository/wrappers.cjs.map +1 -0
  65. package/lib/cjs/validation/constants.cjs +4 -3
  66. package/lib/cjs/validation/constants.cjs.map +1 -0
  67. package/lib/cjs/validation/decorators.cjs +22 -21
  68. package/lib/cjs/validation/decorators.cjs.map +1 -0
  69. package/lib/cjs/validation/index.cjs +1 -0
  70. package/lib/cjs/validation/index.cjs.map +1 -0
  71. package/lib/cjs/validation/validation.cjs +3 -2
  72. package/lib/cjs/validation/validation.cjs.map +1 -0
  73. package/lib/cjs/validation/validators/ReadOnlyValidator.cjs +14 -8
  74. package/lib/cjs/validation/validators/ReadOnlyValidator.cjs.map +1 -0
  75. package/lib/cjs/validation/validators/TimestampValidator.cjs +14 -8
  76. package/lib/cjs/validation/validators/TimestampValidator.cjs.map +1 -0
  77. package/lib/cjs/validation/validators/UpdateValidator.cjs +1 -0
  78. package/lib/cjs/validation/validators/UpdateValidator.cjs.map +1 -0
  79. package/lib/cjs/validation/validators/index.cjs +1 -0
  80. package/lib/cjs/validation/validators/index.cjs.map +1 -0
  81. package/lib/esm/index.js +1 -1
  82. package/lib/types/identity/decorators.d.cts +8 -0
  83. package/lib/types/identity/decorators.d.mts +8 -0
  84. package/lib/types/identity/index.d.cts +6 -0
  85. package/lib/types/identity/index.d.mts +6 -0
  86. package/lib/types/index.d.cts +15 -0
  87. package/lib/types/index.d.mts +15 -0
  88. package/lib/types/index.d.ts +1 -1
  89. package/lib/types/interfaces/BulkCrudOperator.d.cts +47 -0
  90. package/lib/types/interfaces/BulkCrudOperator.d.mts +47 -0
  91. package/lib/types/interfaces/Contextual.d.cts +23 -0
  92. package/lib/types/interfaces/Contextual.d.mts +23 -0
  93. package/lib/types/interfaces/CrudOperator.d.cts +46 -0
  94. package/lib/types/interfaces/CrudOperator.d.mts +46 -0
  95. package/lib/types/interfaces/IRepository.d.cts +19 -0
  96. package/lib/types/interfaces/IRepository.d.mts +19 -0
  97. package/lib/types/interfaces/index.d.cts +9 -0
  98. package/lib/types/interfaces/index.d.mts +9 -0
  99. package/lib/types/model/constants.d.cts +37 -0
  100. package/lib/types/model/constants.d.mts +37 -0
  101. package/lib/types/model/decorators.d.cts +145 -0
  102. package/lib/types/model/decorators.d.mts +145 -0
  103. package/lib/types/model/index.d.cts +9 -0
  104. package/lib/types/model/index.d.mts +9 -0
  105. package/lib/types/model/model.d.cts +6 -0
  106. package/lib/types/model/model.d.mts +6 -0
  107. package/lib/types/model/validation.d.cts +57 -0
  108. package/lib/types/model/validation.d.mts +57 -0
  109. package/lib/types/operations/Operations.d.cts +80 -0
  110. package/lib/types/operations/Operations.d.mts +80 -0
  111. package/lib/types/operations/OperationsRegistry.d.cts +72 -0
  112. package/lib/types/operations/OperationsRegistry.d.mts +72 -0
  113. package/lib/types/operations/constants.d.cts +106 -0
  114. package/lib/types/operations/constants.d.mts +106 -0
  115. package/lib/types/operations/decorators.d.cts +348 -0
  116. package/lib/types/operations/decorators.d.mts +348 -0
  117. package/lib/types/operations/index.d.cts +10 -0
  118. package/lib/types/operations/index.d.mts +10 -0
  119. package/lib/types/operations/types.d.cts +60 -0
  120. package/lib/types/operations/types.d.mts +60 -0
  121. package/lib/types/overrides/Metadata.d.cts +54 -0
  122. package/lib/types/overrides/Metadata.d.mts +54 -0
  123. package/lib/types/overrides/Model.d.cts +84 -0
  124. package/lib/types/overrides/Model.d.mts +84 -0
  125. package/lib/types/overrides/ModelBuilderExtensions.d.cts +15 -0
  126. package/lib/types/overrides/ModelBuilderExtensions.d.mts +15 -0
  127. package/lib/types/overrides/index.d.cts +10 -0
  128. package/lib/types/overrides/index.d.mts +10 -0
  129. package/lib/types/overrides/overrides.d.cts +1 -0
  130. package/lib/types/overrides/overrides.d.mts +1 -0
  131. package/lib/types/repository/Context.d.cts +112 -0
  132. package/lib/types/repository/Context.d.mts +112 -0
  133. package/lib/types/repository/Repository.d.cts +352 -0
  134. package/lib/types/repository/Repository.d.mts +352 -0
  135. package/lib/types/repository/constants.d.cts +9 -0
  136. package/lib/types/repository/constants.d.mts +9 -0
  137. package/lib/types/repository/errors.d.cts +126 -0
  138. package/lib/types/repository/errors.d.mts +126 -0
  139. package/lib/types/repository/index.d.cts +12 -0
  140. package/lib/types/repository/index.d.mts +12 -0
  141. package/lib/types/repository/types.d.cts +62 -0
  142. package/lib/types/repository/types.d.mts +62 -0
  143. package/lib/types/repository/utils.d.cts +34 -0
  144. package/lib/types/repository/utils.d.mts +34 -0
  145. package/lib/types/repository/wrappers.d.cts +39 -0
  146. package/lib/types/repository/wrappers.d.mts +39 -0
  147. package/lib/types/validation/constants.d.cts +45 -0
  148. package/lib/types/validation/constants.d.mts +45 -0
  149. package/lib/types/validation/decorators.d.cts +143 -0
  150. package/lib/types/validation/decorators.d.mts +143 -0
  151. package/lib/types/validation/index.d.cts +4 -0
  152. package/lib/types/validation/index.d.mts +4 -0
  153. package/lib/types/validation/validation.d.cts +41 -0
  154. package/lib/types/validation/validation.d.mts +41 -0
  155. package/lib/types/validation/validators/ReadOnlyValidator.d.cts +47 -0
  156. package/lib/types/validation/validators/ReadOnlyValidator.d.mts +47 -0
  157. package/lib/types/validation/validators/TimestampValidator.d.cts +48 -0
  158. package/lib/types/validation/validators/TimestampValidator.d.mts +48 -0
  159. package/lib/types/validation/validators/UpdateValidator.d.cts +40 -0
  160. package/lib/types/validation/validators/UpdateValidator.d.mts +40 -0
  161. package/lib/types/validation/validators/index.d.cts +3 -0
  162. package/lib/types/validation/validators/index.d.mts +3 -0
  163. package/package.json +4 -4
  164. package/lib/cjs/identity/decorators.js.map +0 -1
  165. package/lib/cjs/identity/index.js.map +0 -1
  166. package/lib/cjs/index.js.map +0 -1
  167. package/lib/cjs/interfaces/BulkCrudOperator.js.map +0 -1
  168. package/lib/cjs/interfaces/Contextual.js.map +0 -1
  169. package/lib/cjs/interfaces/CrudOperator.js.map +0 -1
  170. package/lib/cjs/interfaces/IRepository.js.map +0 -1
  171. package/lib/cjs/interfaces/index.js.map +0 -1
  172. package/lib/cjs/model/constants.js.map +0 -1
  173. package/lib/cjs/model/decorators.js.map +0 -1
  174. package/lib/cjs/model/index.js.map +0 -1
  175. package/lib/cjs/model/model.js.map +0 -1
  176. package/lib/cjs/model/validation.js.map +0 -1
  177. package/lib/cjs/operations/Operations.js.map +0 -1
  178. package/lib/cjs/operations/OperationsRegistry.js.map +0 -1
  179. package/lib/cjs/operations/constants.js.map +0 -1
  180. package/lib/cjs/operations/decorators.js.map +0 -1
  181. package/lib/cjs/operations/index.js.map +0 -1
  182. package/lib/cjs/operations/types.js.map +0 -1
  183. package/lib/cjs/overrides/Metadata.js.map +0 -1
  184. package/lib/cjs/overrides/Model.js.map +0 -1
  185. package/lib/cjs/overrides/ModelBuilderExtensions.js.map +0 -1
  186. package/lib/cjs/overrides/index.js.map +0 -1
  187. package/lib/cjs/overrides/overrides.js.map +0 -1
  188. package/lib/cjs/repository/Context.js.map +0 -1
  189. package/lib/cjs/repository/Repository.js.map +0 -1
  190. package/lib/cjs/repository/constants.js.map +0 -1
  191. package/lib/cjs/repository/errors.js.map +0 -1
  192. package/lib/cjs/repository/index.js.map +0 -1
  193. package/lib/cjs/repository/types.js.map +0 -1
  194. package/lib/cjs/repository/utils.js.map +0 -1
  195. package/lib/cjs/repository/wrappers.js.map +0 -1
  196. package/lib/cjs/validation/constants.js.map +0 -1
  197. package/lib/cjs/validation/decorators.js.map +0 -1
  198. package/lib/cjs/validation/index.js.map +0 -1
  199. package/lib/cjs/validation/validation.js.map +0 -1
  200. package/lib/cjs/validation/validators/ReadOnlyValidator.js.map +0 -1
  201. package/lib/cjs/validation/validators/TimestampValidator.js.map +0 -1
  202. package/lib/cjs/validation/validators/UpdateValidator.js.map +0 -1
  203. package/lib/cjs/validation/validators/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.js"],"names":[],"mappings":";;AAAA,yEAA6D;AAC7D,iDAAsD;AACtD;;;;;;;GAOG;AACH,iCAAU,CAAC,SAAS,GAAG,UAAU,GAAG;IAChC,OAAO,mCAAoB,CAAC,OAAO,GAAG,GAAG,CAAC;AAC9C,CAAC,CAAC;AACF,sCAAsC"}
@@ -1,17 +1,22 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReadOnlyValidator = void 0;
2
4
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
5
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
7
+ r = Reflect.decorate(decorators, target, key, desc);
8
+ else
9
+ for (var i = decorators.length - 1; i >= 0; i--)
10
+ if (d = decorators[i])
11
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
12
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
13
  };
8
14
  var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
16
+ return Reflect.metadata(k, v);
10
17
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ReadOnlyValidator = void 0;
13
18
  const decorator_validation_1 = require("@decaf-ts/decorator-validation");
14
- const constants_1 = require("./../constants.cjs");
19
+ const constants_js_1 = require("./../constants.cjs");
15
20
  const decorator_validation_2 = require("@decaf-ts/decorator-validation");
16
21
  /**
17
22
  * @description A validator that ensures properties marked as readonly cannot be modified during updates.
@@ -41,7 +46,7 @@ const decorator_validation_2 = require("@decaf-ts/decorator-validation");
41
46
  */
42
47
  let ReadOnlyValidator = class ReadOnlyValidator extends decorator_validation_1.Validator {
43
48
  constructor() {
44
- super(constants_1.DEFAULT_ERROR_MESSAGES.READONLY.INVALID);
49
+ super(constants_js_1.DEFAULT_ERROR_MESSAGES.READONLY.INVALID);
45
50
  }
46
51
  /**
47
52
  * @description Implementation of the base validator's hasErrors method.
@@ -72,7 +77,8 @@ let ReadOnlyValidator = class ReadOnlyValidator extends decorator_validation_1.V
72
77
  };
73
78
  exports.ReadOnlyValidator = ReadOnlyValidator;
74
79
  exports.ReadOnlyValidator = ReadOnlyValidator = __decorate([
75
- (0, decorator_validation_1.validator)(constants_1.UpdateValidationKeys.READONLY),
80
+ (0, decorator_validation_1.validator)(constants_js_1.UpdateValidationKeys.READONLY),
76
81
  __metadata("design:paramtypes", [])
77
82
  ], ReadOnlyValidator);
83
+ //# sourceMappingURL=ReadOnlyValidator.js.map
78
84
  //# sourceMappingURL=ReadOnlyValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReadOnlyValidator.js","sourceRoot":"","sources":["ReadOnlyValidator.js"],"names":[],"mappings":";;;AAAA,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI;IACjF,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7H,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;QAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;;QAC1H,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;gBAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;IAClJ,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAClE,CAAC,CAAC;AACF,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC;IACxD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;QAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7G,CAAC,CAAC;AACF,yEAAsE;AACtE,oDAAiF;AACjF,yEAAyD;AACzD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,IAAI,iBAAiB,GAAG,MAAM,iBAAkB,SAAQ,gCAAS;IAC7D;QACI,KAAK,CAAC,qCAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IACD;;;;;;OAMG;IACH,6DAA6D;IAC7D,SAAS,CAAC,KAAK,EAAE,GAAG,IAAI;QACpB,OAAO,SAAS,CAAC;IACrB,CAAC;IACD;;;;;;;OAOG;IACH,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO;QACpC,IAAI,KAAK,KAAK,SAAS;YACnB,OAAO;QACX,OAAO,IAAA,8BAAO,EAAC,KAAK,EAAE,QAAQ,CAAC;YAC3B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CACJ,CAAC;AAKO,8CAAiB;AAJ1B,4BAAA,iBAAiB,GAAG,UAAU,CAAC;IAC3B,IAAA,gCAAS,EAAC,mCAAoB,CAAC,QAAQ,CAAC;IACxC,UAAU,CAAC,mBAAmB,EAAE,EAAE,CAAC;CACtC,EAAE,iBAAiB,CAAC,CAAC;AAEtB,6CAA6C"}
@@ -1,17 +1,22 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimestampValidator = void 0;
2
4
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
5
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
7
+ r = Reflect.decorate(decorators, target, key, desc);
8
+ else
9
+ for (var i = decorators.length - 1; i >= 0; i--)
10
+ if (d = decorators[i])
11
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
12
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
13
  };
8
14
  var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
16
+ return Reflect.metadata(k, v);
10
17
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.TimestampValidator = void 0;
13
18
  const decorator_validation_1 = require("@decaf-ts/decorator-validation");
14
- const constants_1 = require("./../constants.cjs");
19
+ const constants_js_1 = require("./../constants.cjs");
15
20
  /**
16
21
  * @description A validator that ensures timestamp values are only updated with newer timestamps.
17
22
  * @summary Validates the update of a timestamp by comparing the new timestamp with the old one, ensuring the new timestamp is more recent.
@@ -41,7 +46,7 @@ const constants_1 = require("./../constants.cjs");
41
46
  */
42
47
  let TimestampValidator = class TimestampValidator extends decorator_validation_1.Validator {
43
48
  constructor() {
44
- super(constants_1.DEFAULT_ERROR_MESSAGES.TIMESTAMP.INVALID);
49
+ super(constants_js_1.DEFAULT_ERROR_MESSAGES.TIMESTAMP.INVALID);
45
50
  }
46
51
  /**
47
52
  * @description Implementation of the base validator's hasErrors method.
@@ -79,7 +84,8 @@ let TimestampValidator = class TimestampValidator extends decorator_validation_1
79
84
  };
80
85
  exports.TimestampValidator = TimestampValidator;
81
86
  exports.TimestampValidator = TimestampValidator = __decorate([
82
- (0, decorator_validation_1.validator)(constants_1.UpdateValidationKeys.TIMESTAMP),
87
+ (0, decorator_validation_1.validator)(constants_js_1.UpdateValidationKeys.TIMESTAMP),
83
88
  __metadata("design:paramtypes", [])
84
89
  ], TimestampValidator);
90
+ //# sourceMappingURL=TimestampValidator.js.map
85
91
  //# sourceMappingURL=TimestampValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimestampValidator.js","sourceRoot":"","sources":["TimestampValidator.js"],"names":[],"mappings":"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"}
@@ -35,4 +35,5 @@ class UpdateValidator extends decorator_validation_1.Validator {
35
35
  }
36
36
  }
37
37
  exports.UpdateValidator = UpdateValidator;
38
+ //# sourceMappingURL=UpdateValidator.js.map
38
39
  //# sourceMappingURL=UpdateValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpdateValidator.js","sourceRoot":"","sources":["UpdateValidator.js"],"names":[],"mappings":";;;AAAA,yEAAyG;AACzG;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,eAAgB,SAAQ,gCAAS;IAC1C,YAAY,OAAO,GAAG,6CAAiB,CAAC,OAAO,EAAE,GAAG,aAAa;QAC7D,KAAK,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC;IACrC,CAAC;CACJ;AAJD,0CAIC;AACD,2CAA2C"}
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ReadOnlyValidator.cjs"), exports);
18
18
  __exportStar(require("./TimestampValidator.cjs"), exports);
19
19
  __exportStar(require("./UpdateValidator.cjs"), exports);
20
+ //# sourceMappingURL=index.js.map
20
21
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,0DAAwC;AACxC,uDAAqC;AACrC,iCAAiC"}
package/lib/esm/index.js CHANGED
@@ -17,7 +17,7 @@ export * from "./validation/index.js";
17
17
  * @const VERSION
18
18
  * @memberOf module:db-decorators
19
19
  */
20
- export const VERSION = "0.10.0";
20
+ export const VERSION = "0.12.0";
21
21
  export const PACKAGE_NAME = "@decaf-ts/db-decorators";
22
22
  Metadata.registerLibrary(PACKAGE_NAME, VERSION);
23
23
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @description Decorator that marks a property as an ID field
3
+ * @summary Creates a composite decorator that marks a property as required, readonly, and as the ID field for database operations
4
+ * @return {PropertyDecorator} A decorator that can be applied to class properties
5
+ * @function id
6
+ * @category Property Decorators
7
+ */
8
+ export declare function id(): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @description Decorator that marks a property as an ID field
3
+ * @summary Creates a composite decorator that marks a property as required, readonly, and as the ID field for database operations
4
+ * @return {PropertyDecorator} A decorator that can be applied to class properties
5
+ * @function id
6
+ * @category Property Decorators
7
+ */
8
+ export declare function id(): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @description Exports for the identity module.
3
+ * @summary This file exports all the necessary components for the identity functionality, including decorators.
4
+ * @module db-decorators/identity
5
+ */
6
+ export * from "./decorators.cjs";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @description Exports for the identity module.
3
+ * @summary This file exports all the necessary components for the identity functionality, including decorators.
4
+ * @module db-decorators/identity
5
+ */
6
+ export * from "./decorators.js";
@@ -0,0 +1,15 @@
1
+ export * from "./identity/index.cjs";
2
+ export * from "./interfaces/index.cjs";
3
+ export * from "./model/index.cjs";
4
+ export * from "./operations/index.cjs";
5
+ export * from "./overrides/index.cjs";
6
+ export * from "./repository/index.cjs";
7
+ export * from "./validation/index.cjs";
8
+ /**
9
+ * @description Current version of the reflection package
10
+ * @summary Stores the semantic version number of the package
11
+ * @const VERSION
12
+ * @memberOf module:db-decorators
13
+ */
14
+ export declare const VERSION = "0.12.0";
15
+ export declare const PACKAGE_NAME = "@decaf-ts/db-decorators";
@@ -0,0 +1,15 @@
1
+ export * from "./identity/index.js";
2
+ export * from "./interfaces/index.js";
3
+ export * from "./model/index.js";
4
+ export * from "./operations/index.js";
5
+ export * from "./overrides/index.js";
6
+ export * from "./repository/index.js";
7
+ export * from "./validation/index.js";
8
+ /**
9
+ * @description Current version of the reflection package
10
+ * @summary Stores the semantic version number of the package
11
+ * @const VERSION
12
+ * @memberOf module:db-decorators
13
+ */
14
+ export declare const VERSION = "0.12.0";
15
+ export declare const PACKAGE_NAME = "@decaf-ts/db-decorators";
@@ -11,5 +11,5 @@ export * from "./validation";
11
11
  * @const VERSION
12
12
  * @memberOf module:db-decorators
13
13
  */
14
- export declare const VERSION = "0.10.0";
14
+ export declare const VERSION = "0.12.0";
15
15
  export declare const PACKAGE_NAME = "@decaf-ts/db-decorators";
@@ -0,0 +1,47 @@
1
+ import { CrudOperator } from "./CrudOperator.cjs";
2
+ import { PrimaryKeyType } from "../repository/index.cjs";
3
+ /**
4
+ * @description Interface for bulk CRUD operations
5
+ * @summary Extends the basic CRUD operations to support bulk operations on multiple models at once
6
+ * @template M - The model type
7
+ * @interface BulkCrudOperator
8
+ * @memberOf module:db-decorators
9
+ */
10
+ export interface BulkCrudOperator<M> extends CrudOperator<M> {
11
+ /**
12
+ * @description Creates multiple model instances in the database
13
+ * @summary Bulk operation to create multiple models at once
14
+ * @template M - The model type
15
+ * @param {M[]} models - Array of model instances to create
16
+ * @param {...any[]} args - Additional arguments
17
+ * @return {Promise<M[]>} Promise resolving to the created model instances
18
+ */
19
+ createAll(models: M[], ...args: any[]): Promise<M[]>;
20
+ /**
21
+ * @description Retrieves multiple model instances from the database by their keys
22
+ * @summary Bulk operation to read multiple models at once
23
+ * @template M - The model type
24
+ * @param {(PrimaryKeyType[])} keys - Array of primary keys to retrieve
25
+ * @param {...any[]} args - Additional arguments
26
+ * @return {Promise<M[]>} Promise resolving to the retrieved model instances
27
+ */
28
+ readAll(keys: PrimaryKeyType[], ...args: any[]): Promise<M[]>;
29
+ /**
30
+ * @description Updates multiple model instances in the database
31
+ * @summary Bulk operation to update multiple models at once
32
+ * @template M - The model type
33
+ * @param {M[]} models - Array of model instances to update
34
+ * @param {...any[]} args - Additional arguments
35
+ * @return {Promise<M[]>} Promise resolving to the updated model instances
36
+ */
37
+ updateAll(models: M[], ...args: any[]): Promise<M[]>;
38
+ /**
39
+ * @description Deletes multiple model instances from the database by their keys
40
+ * @summary Bulk operation to delete multiple models at once
41
+ * @template M - The model type
42
+ * @param {(PrimaryKeyType[])} keys - Array of primary keys to delete
43
+ * @param {...any[]} args - Additional arguments
44
+ * @return {Promise<M[]>} Promise resolving to the deleted model instances
45
+ */
46
+ deleteAll(keys: PrimaryKeyType[], ...args: any[]): Promise<M[]>;
47
+ }
@@ -0,0 +1,47 @@
1
+ import { CrudOperator } from "./CrudOperator.js";
2
+ import { PrimaryKeyType } from "../repository/index.js";
3
+ /**
4
+ * @description Interface for bulk CRUD operations
5
+ * @summary Extends the basic CRUD operations to support bulk operations on multiple models at once
6
+ * @template M - The model type
7
+ * @interface BulkCrudOperator
8
+ * @memberOf module:db-decorators
9
+ */
10
+ export interface BulkCrudOperator<M> extends CrudOperator<M> {
11
+ /**
12
+ * @description Creates multiple model instances in the database
13
+ * @summary Bulk operation to create multiple models at once
14
+ * @template M - The model type
15
+ * @param {M[]} models - Array of model instances to create
16
+ * @param {...any[]} args - Additional arguments
17
+ * @return {Promise<M[]>} Promise resolving to the created model instances
18
+ */
19
+ createAll(models: M[], ...args: any[]): Promise<M[]>;
20
+ /**
21
+ * @description Retrieves multiple model instances from the database by their keys
22
+ * @summary Bulk operation to read multiple models at once
23
+ * @template M - The model type
24
+ * @param {(PrimaryKeyType[])} keys - Array of primary keys to retrieve
25
+ * @param {...any[]} args - Additional arguments
26
+ * @return {Promise<M[]>} Promise resolving to the retrieved model instances
27
+ */
28
+ readAll(keys: PrimaryKeyType[], ...args: any[]): Promise<M[]>;
29
+ /**
30
+ * @description Updates multiple model instances in the database
31
+ * @summary Bulk operation to update multiple models at once
32
+ * @template M - The model type
33
+ * @param {M[]} models - Array of model instances to update
34
+ * @param {...any[]} args - Additional arguments
35
+ * @return {Promise<M[]>} Promise resolving to the updated model instances
36
+ */
37
+ updateAll(models: M[], ...args: any[]): Promise<M[]>;
38
+ /**
39
+ * @description Deletes multiple model instances from the database by their keys
40
+ * @summary Bulk operation to delete multiple models at once
41
+ * @template M - The model type
42
+ * @param {(PrimaryKeyType[])} keys - Array of primary keys to delete
43
+ * @param {...any[]} args - Additional arguments
44
+ * @return {Promise<M[]>} Promise resolving to the deleted model instances
45
+ */
46
+ deleteAll(keys: PrimaryKeyType[], ...args: any[]): Promise<M[]>;
47
+ }
@@ -0,0 +1,23 @@
1
+ import { OperationKeys } from "../operations/index.cjs";
2
+ import { Context } from "../repository/index.cjs";
3
+ export type FlagsOf<C extends Context<any>> = C extends Context<infer T> ? T : never;
4
+ /**
5
+ * @description Interface for context-aware operations
6
+ * @summary Provides context management for database operations
7
+ * @template F - Type extending RepositoryFlags, defaults to RepositoryFlags
8
+ * @template C - Type extending Context<F>, defaults to Context<F>
9
+ * @interface Contextual
10
+ * @memberOf module:db-decorators
11
+ */
12
+ export interface Contextual<C extends Context<any> = Context<any>> {
13
+ /**
14
+ * @description Creates a context for a specific operation
15
+ * @summary Generates an operation-specific context with custom flags
16
+ * @param {(OperationKeys.CREATE|OperationKeys.READ|OperationKeys.UPDATE|OperationKeys.DELETE)} operation - The operation type
17
+ * @template F - Type extending RepositoryFlags, defaults to RepositoryFlags
18
+ * @param {Partial<F>} overrides - Custom flag overrides for this context
19
+ * @param {...any[]} args - Additional arguments
20
+ * @return {Promise<C>} Promise resolving to the created context
21
+ */
22
+ context(operation: ((...args: any[]) => any) | OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE | string, overrides: Partial<FlagsOf<C>>, ...args: any[]): Promise<C>;
23
+ }
@@ -0,0 +1,23 @@
1
+ import { OperationKeys } from "../operations/index.js";
2
+ import { Context } from "../repository/index.js";
3
+ export type FlagsOf<C extends Context<any>> = C extends Context<infer T> ? T : never;
4
+ /**
5
+ * @description Interface for context-aware operations
6
+ * @summary Provides context management for database operations
7
+ * @template F - Type extending RepositoryFlags, defaults to RepositoryFlags
8
+ * @template C - Type extending Context<F>, defaults to Context<F>
9
+ * @interface Contextual
10
+ * @memberOf module:db-decorators
11
+ */
12
+ export interface Contextual<C extends Context<any> = Context<any>> {
13
+ /**
14
+ * @description Creates a context for a specific operation
15
+ * @summary Generates an operation-specific context with custom flags
16
+ * @param {(OperationKeys.CREATE|OperationKeys.READ|OperationKeys.UPDATE|OperationKeys.DELETE)} operation - The operation type
17
+ * @template F - Type extending RepositoryFlags, defaults to RepositoryFlags
18
+ * @param {Partial<F>} overrides - Custom flag overrides for this context
19
+ * @param {...any[]} args - Additional arguments
20
+ * @return {Promise<C>} Promise resolving to the created context
21
+ */
22
+ context(operation: ((...args: any[]) => any) | OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE | string, overrides: Partial<FlagsOf<C>>, ...args: any[]): Promise<C>;
23
+ }
@@ -0,0 +1,46 @@
1
+ import { PrimaryKeyType } from "../repository/index.cjs";
2
+ /**
3
+ * @description Basic CRUD operations interface
4
+ * @summary Exposes a standard Create, Read, Update, Delete API for database operations
5
+ * @template M - The model type
6
+ * @interface CrudOperator
7
+ * @memberOf module:db-decorators
8
+ */
9
+ export interface CrudOperator<M> {
10
+ /**
11
+ * @description Creates a new model instance in the database
12
+ * @summary Create a new model
13
+ * @template M - The model type
14
+ * @param {M} model - The model instance to create
15
+ * @param {...any[]} args - Additional arguments
16
+ * @return {Promise<M>} Promise resolving to the created model instance
17
+ */
18
+ create(model: M, ...args: any[]): Promise<M>;
19
+ /**
20
+ * @description Retrieves a model instance from the database by its key
21
+ * @summary Read a model
22
+ * @template M - The model type
23
+ * @param {PrimaryKeyType} key - The primary key of the model to retrieve
24
+ * @param {...any[]} args - Additional arguments
25
+ * @return {Promise<M>} Promise resolving to the retrieved model instance
26
+ */
27
+ read(key: PrimaryKeyType, ...args: any[]): Promise<M>;
28
+ /**
29
+ * @description Updates a model instance in the database
30
+ * @summary Update a model
31
+ * @template M - The model type
32
+ * @param {M} model - The model instance to update
33
+ * @param {...any[]} args - Additional arguments
34
+ * @return {Promise<M>} Promise resolving to the updated model instance
35
+ */
36
+ update(model: M, ...args: any[]): Promise<M>;
37
+ /**
38
+ * @description Deletes a model instance from the database by its key
39
+ * @summary Delete a model
40
+ * @template M - The model type
41
+ * @param {PrimaryKeyType} key - The primary key of the model to delete
42
+ * @param {...any[]} args - Additional arguments
43
+ * @return {Promise<M>} Promise resolving to the deleted model instance
44
+ */
45
+ delete(key: PrimaryKeyType, ...args: any[]): Promise<M>;
46
+ }
@@ -0,0 +1,46 @@
1
+ import { PrimaryKeyType } from "../repository/index.js";
2
+ /**
3
+ * @description Basic CRUD operations interface
4
+ * @summary Exposes a standard Create, Read, Update, Delete API for database operations
5
+ * @template M - The model type
6
+ * @interface CrudOperator
7
+ * @memberOf module:db-decorators
8
+ */
9
+ export interface CrudOperator<M> {
10
+ /**
11
+ * @description Creates a new model instance in the database
12
+ * @summary Create a new model
13
+ * @template M - The model type
14
+ * @param {M} model - The model instance to create
15
+ * @param {...any[]} args - Additional arguments
16
+ * @return {Promise<M>} Promise resolving to the created model instance
17
+ */
18
+ create(model: M, ...args: any[]): Promise<M>;
19
+ /**
20
+ * @description Retrieves a model instance from the database by its key
21
+ * @summary Read a model
22
+ * @template M - The model type
23
+ * @param {PrimaryKeyType} key - The primary key of the model to retrieve
24
+ * @param {...any[]} args - Additional arguments
25
+ * @return {Promise<M>} Promise resolving to the retrieved model instance
26
+ */
27
+ read(key: PrimaryKeyType, ...args: any[]): Promise<M>;
28
+ /**
29
+ * @description Updates a model instance in the database
30
+ * @summary Update a model
31
+ * @template M - The model type
32
+ * @param {M} model - The model instance to update
33
+ * @param {...any[]} args - Additional arguments
34
+ * @return {Promise<M>} Promise resolving to the updated model instance
35
+ */
36
+ update(model: M, ...args: any[]): Promise<M>;
37
+ /**
38
+ * @description Deletes a model instance from the database by its key
39
+ * @summary Delete a model
40
+ * @template M - The model type
41
+ * @param {PrimaryKeyType} key - The primary key of the model to delete
42
+ * @param {...any[]} args - Additional arguments
43
+ * @return {Promise<M>} Promise resolving to the deleted model instance
44
+ */
45
+ delete(key: PrimaryKeyType, ...args: any[]): Promise<M>;
46
+ }
@@ -0,0 +1,19 @@
1
+ import { Model, ModelConstructor } from "@decaf-ts/decorator-validation";
2
+ import { BulkCrudOperator } from "./BulkCrudOperator.cjs";
3
+ import { Context, RepositoryFlags } from "../repository/index.cjs";
4
+ /**
5
+ * @description Repository interface for database operations
6
+ * @summary Interface holding basic CRUD APIs for database models, providing standard operations and metadata
7
+ * @template M - Type extending Model
8
+ * @template F - Type extending RepositoryFlags, defaults to RepositoryFlags
9
+ * @template C - Type extending Context<F>, defaults to Context<F>
10
+ * @interface IRepository
11
+ * @memberOf module:db-decorators
12
+ */
13
+ export interface IRepository<M extends Model<boolean>, C extends Context<any> = Context<RepositoryFlags>> extends BulkCrudOperator<M> {
14
+ /**
15
+ * @description The constructor of the model class
16
+ * @summary Reference to the model class constructor used to create new instances
17
+ */
18
+ readonly class: ModelConstructor<M>;
19
+ }
@@ -0,0 +1,19 @@
1
+ import { Model, ModelConstructor } from "@decaf-ts/decorator-validation";
2
+ import { BulkCrudOperator } from "./BulkCrudOperator.js";
3
+ import { Context, RepositoryFlags } from "../repository/index.js";
4
+ /**
5
+ * @description Repository interface for database operations
6
+ * @summary Interface holding basic CRUD APIs for database models, providing standard operations and metadata
7
+ * @template M - Type extending Model
8
+ * @template F - Type extending RepositoryFlags, defaults to RepositoryFlags
9
+ * @template C - Type extending Context<F>, defaults to Context<F>
10
+ * @interface IRepository
11
+ * @memberOf module:db-decorators
12
+ */
13
+ export interface IRepository<M extends Model<boolean>, C extends Context<any> = Context<RepositoryFlags>> extends BulkCrudOperator<M> {
14
+ /**
15
+ * @description The constructor of the model class
16
+ * @summary Reference to the model class constructor used to create new instances
17
+ */
18
+ readonly class: ModelConstructor<M>;
19
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description Exports for the interfaces module.
3
+ * @summary This file exports all the necessary components for the interfaces functionality, including BulkCrudOperator, Contextual, CrudOperator, and IRepository.
4
+ * @module db-decorators/interfaces
5
+ */
6
+ export * from "./BulkCrudOperator.cjs";
7
+ export * from "./Contextual.cjs";
8
+ export * from "./CrudOperator.cjs";
9
+ export * from "./IRepository.cjs";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description Exports for the interfaces module.
3
+ * @summary This file exports all the necessary components for the interfaces functionality, including BulkCrudOperator, Contextual, CrudOperator, and IRepository.
4
+ * @module db-decorators/interfaces
5
+ */
6
+ export * from "./BulkCrudOperator.js";
7
+ export * from "./Contextual.js";
8
+ export * from "./CrudOperator.js";
9
+ export * from "./IRepository.js";
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @description Database reflection keys
3
+ * @summary Collection of keys used for reflection metadata in database operations
4
+ * @const DBKeys
5
+ * @memberOf module:db-decorators
6
+ */
7
+ export declare const DBKeys: {
8
+ REFLECT: string;
9
+ REPOSITORY: string;
10
+ CLASS: string;
11
+ ID: string;
12
+ INDEX: string;
13
+ UNIQUE: string;
14
+ SERIALIZE: string;
15
+ READONLY: string;
16
+ TIMESTAMP: string;
17
+ TRANSIENT: string;
18
+ HASH: string;
19
+ COMPOSED: string;
20
+ GENERATED: string;
21
+ VERSION: string;
22
+ ORIGINAL: string;
23
+ };
24
+ /**
25
+ * @description Default separator character for composite indexes
26
+ * @summary The default separator character used when concatenating multiple fields into a single index
27
+ * @const DefaultSeparator
28
+ * @memberOf module:db-decorators
29
+ */
30
+ export declare const DefaultSeparator = "_";
31
+ /**
32
+ * @description Default format for timestamp fields
33
+ * @summary Standard date format string used for timestamp fields in database models
34
+ * @const DEFAULT_TIMESTAMP_FORMAT
35
+ * @memberOf module:db-decorators
36
+ */
37
+ export declare const DEFAULT_TIMESTAMP_FORMAT = "dd/MM/yyyy HH:mm:ss:S";
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @description Database reflection keys
3
+ * @summary Collection of keys used for reflection metadata in database operations
4
+ * @const DBKeys
5
+ * @memberOf module:db-decorators
6
+ */
7
+ export declare const DBKeys: {
8
+ REFLECT: string;
9
+ REPOSITORY: string;
10
+ CLASS: string;
11
+ ID: string;
12
+ INDEX: string;
13
+ UNIQUE: string;
14
+ SERIALIZE: string;
15
+ READONLY: string;
16
+ TIMESTAMP: string;
17
+ TRANSIENT: string;
18
+ HASH: string;
19
+ COMPOSED: string;
20
+ GENERATED: string;
21
+ VERSION: string;
22
+ ORIGINAL: string;
23
+ };
24
+ /**
25
+ * @description Default separator character for composite indexes
26
+ * @summary The default separator character used when concatenating multiple fields into a single index
27
+ * @const DefaultSeparator
28
+ * @memberOf module:db-decorators
29
+ */
30
+ export declare const DefaultSeparator = "_";
31
+ /**
32
+ * @description Default format for timestamp fields
33
+ * @summary Standard date format string used for timestamp fields in database models
34
+ * @const DEFAULT_TIMESTAMP_FORMAT
35
+ * @memberOf module:db-decorators
36
+ */
37
+ export declare const DEFAULT_TIMESTAMP_FORMAT = "dd/MM/yyyy HH:mm:ss:S";