mintly-lib 1.0.1 → 1.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 (193) hide show
  1. package/build/clients/auth-client.d.ts +18 -0
  2. package/build/clients/auth-client.d.ts.map +1 -0
  3. package/build/clients/auth-client.js +38 -0
  4. package/build/clients/auth-client.js.map +1 -0
  5. package/build/clients/financial-account-client.d.ts +6 -0
  6. package/build/clients/financial-account-client.d.ts.map +1 -0
  7. package/build/clients/financial-account-client.js +11 -0
  8. package/build/clients/financial-account-client.js.map +1 -0
  9. package/build/clients/financial-category-client.d.ts +6 -0
  10. package/build/clients/financial-category-client.d.ts.map +1 -0
  11. package/build/clients/financial-category-client.js +11 -0
  12. package/build/clients/financial-category-client.js.map +1 -0
  13. package/build/clients/index.d.ts +4 -0
  14. package/build/clients/index.d.ts.map +1 -1
  15. package/build/clients/index.js +9 -1
  16. package/build/clients/index.js.map +1 -1
  17. package/build/clients/person-client.d.ts +2 -5
  18. package/build/clients/person-client.d.ts.map +1 -1
  19. package/build/clients/person-client.js +1 -1
  20. package/build/clients/person-client.js.map +1 -1
  21. package/build/clients/restaurant-client.d.ts +6 -0
  22. package/build/clients/restaurant-client.d.ts.map +1 -0
  23. package/build/clients/restaurant-client.js +11 -0
  24. package/build/clients/restaurant-client.js.map +1 -0
  25. package/build/core/client/master-client.d.ts +5 -1
  26. package/build/core/client/master-client.d.ts.map +1 -1
  27. package/build/core/client/master-client.js +4 -0
  28. package/build/core/client/master-client.js.map +1 -1
  29. package/build/core/data/auth/auth-response.d.ts +17 -0
  30. package/build/core/data/auth/auth-response.d.ts.map +1 -0
  31. package/build/{aurora/types/infer-type.js → core/data/auth/auth-response.js} +1 -1
  32. package/build/core/data/auth/auth-response.js.map +1 -0
  33. package/build/core/data/auth/index.d.ts +7 -0
  34. package/build/core/data/auth/index.d.ts.map +1 -0
  35. package/build/core/data/auth/index.js +10 -0
  36. package/build/core/data/auth/index.js.map +1 -0
  37. package/build/core/data/auth/login-schema.d.ts +17 -0
  38. package/build/core/data/auth/login-schema.d.ts.map +1 -0
  39. package/build/core/data/auth/login-schema.js +14 -0
  40. package/build/core/data/auth/login-schema.js.map +1 -0
  41. package/build/core/data/auth/password-policy.d.ts +7 -0
  42. package/build/core/data/auth/password-policy.d.ts.map +1 -0
  43. package/build/core/data/auth/password-policy.js +14 -0
  44. package/build/core/data/auth/password-policy.js.map +1 -0
  45. package/build/core/data/auth/signup-schema.d.ts +199 -0
  46. package/build/core/data/auth/signup-schema.d.ts.map +1 -0
  47. package/build/core/data/auth/signup-schema.js +21 -0
  48. package/build/core/data/auth/signup-schema.js.map +1 -0
  49. package/build/core/data/common/audit.d.ts +24 -0
  50. package/build/core/data/common/audit.d.ts.map +1 -0
  51. package/build/core/data/common/audit.js +17 -0
  52. package/build/core/data/common/audit.js.map +1 -0
  53. package/build/core/data/common/index.d.ts +4 -0
  54. package/build/core/data/common/index.d.ts.map +1 -0
  55. package/build/core/data/common/index.js +8 -0
  56. package/build/core/data/common/index.js.map +1 -0
  57. package/build/core/data/common/status.d.ts +5 -0
  58. package/build/core/data/common/status.d.ts.map +1 -0
  59. package/build/core/data/common/status.js +9 -0
  60. package/build/core/data/common/status.js.map +1 -0
  61. package/build/core/data/financial/financial-account-entity.d.ts +5 -0
  62. package/build/core/data/financial/financial-account-entity.d.ts.map +1 -0
  63. package/build/core/data/financial/financial-account-entity.js +3 -0
  64. package/build/core/data/financial/financial-account-entity.js.map +1 -0
  65. package/build/core/data/financial/financial-account-schema.d.ts +81 -0
  66. package/build/core/data/financial/financial-account-schema.d.ts.map +1 -0
  67. package/build/core/data/financial/financial-account-schema.js +25 -0
  68. package/build/core/data/financial/financial-account-schema.js.map +1 -0
  69. package/build/core/data/financial/financial-category-entity.d.ts +5 -0
  70. package/build/core/data/financial/financial-category-entity.d.ts.map +1 -0
  71. package/build/core/data/financial/financial-category-entity.js +3 -0
  72. package/build/core/data/financial/financial-category-entity.js.map +1 -0
  73. package/build/core/data/financial/financial-category-schema.d.ts +87 -0
  74. package/build/core/data/financial/financial-category-schema.d.ts.map +1 -0
  75. package/build/core/data/financial/financial-category-schema.js +33 -0
  76. package/build/core/data/financial/financial-category-schema.js.map +1 -0
  77. package/build/core/data/financial/index.d.ts +5 -0
  78. package/build/core/data/financial/index.d.ts.map +1 -0
  79. package/build/core/data/financial/index.js +12 -0
  80. package/build/core/data/financial/index.js.map +1 -0
  81. package/build/core/data/index.d.ts +5 -0
  82. package/build/core/data/index.d.ts.map +1 -1
  83. package/build/core/data/index.js +5 -0
  84. package/build/core/data/index.js.map +1 -1
  85. package/build/core/data/person/index.d.ts +3 -1
  86. package/build/core/data/person/index.d.ts.map +1 -1
  87. package/build/core/data/person/index.js +5 -3
  88. package/build/core/data/person/index.js.map +1 -1
  89. package/build/core/data/person/person-entity.d.ts +3 -2
  90. package/build/core/data/person/person-entity.d.ts.map +1 -1
  91. package/build/core/data/person/person-ref-schema.d.ts +18 -0
  92. package/build/core/data/person/person-ref-schema.d.ts.map +1 -0
  93. package/build/core/data/person/person-ref-schema.js +15 -0
  94. package/build/core/data/person/person-ref-schema.js.map +1 -0
  95. package/build/core/data/person/person-schema.d.ts +59 -0
  96. package/build/core/data/person/person-schema.d.ts.map +1 -0
  97. package/build/core/data/person/person-schema.js +12 -0
  98. package/build/core/data/person/person-schema.js.map +1 -0
  99. package/build/core/data/restaurant/index.d.ts +3 -0
  100. package/build/core/data/restaurant/index.d.ts.map +1 -0
  101. package/build/core/data/restaurant/index.js +6 -0
  102. package/build/core/data/restaurant/index.js.map +1 -0
  103. package/build/core/data/restaurant/restaurant-entity.d.ts +5 -0
  104. package/build/core/data/restaurant/restaurant-entity.d.ts.map +1 -0
  105. package/build/core/data/restaurant/restaurant-entity.js +3 -0
  106. package/build/core/data/restaurant/restaurant-entity.js.map +1 -0
  107. package/build/core/data/restaurant/restaurant-schema.d.ts +56 -0
  108. package/build/core/data/restaurant/restaurant-schema.d.ts.map +1 -0
  109. package/build/core/data/restaurant/restaurant-schema.js +11 -0
  110. package/build/core/data/restaurant/restaurant-schema.js.map +1 -0
  111. package/build/core/data/user/index.d.ts +3 -0
  112. package/build/core/data/user/index.d.ts.map +1 -0
  113. package/build/core/data/user/index.js +8 -0
  114. package/build/core/data/user/index.js.map +1 -0
  115. package/build/core/data/user/user-entity.d.ts +5 -0
  116. package/build/core/data/user/user-entity.d.ts.map +1 -0
  117. package/build/{aurora/interfaces/field.js → core/data/user/user-entity.js} +1 -1
  118. package/build/core/data/user/user-entity.js.map +1 -0
  119. package/build/core/data/user/user-schema.d.ts +118 -0
  120. package/build/core/data/user/user-schema.d.ts.map +1 -0
  121. package/build/core/data/user/user-schema.js +35 -0
  122. package/build/core/data/user/user-schema.js.map +1 -0
  123. package/build/index.d.ts +0 -1
  124. package/build/index.d.ts.map +1 -1
  125. package/build/index.js +0 -1
  126. package/build/index.js.map +1 -1
  127. package/package.json +2 -1
  128. package/build/aurora/core/array.d.ts +0 -18
  129. package/build/aurora/core/array.d.ts.map +0 -1
  130. package/build/aurora/core/array.js +0 -63
  131. package/build/aurora/core/array.js.map +0 -1
  132. package/build/aurora/core/boolean.d.ts +0 -14
  133. package/build/aurora/core/boolean.d.ts.map +0 -1
  134. package/build/aurora/core/boolean.js +0 -36
  135. package/build/aurora/core/boolean.js.map +0 -1
  136. package/build/aurora/core/date.d.ts +0 -14
  137. package/build/aurora/core/date.d.ts.map +0 -1
  138. package/build/aurora/core/date.js +0 -43
  139. package/build/aurora/core/date.js.map +0 -1
  140. package/build/aurora/core/index.d.ts +0 -9
  141. package/build/aurora/core/index.d.ts.map +0 -1
  142. package/build/aurora/core/index.js +0 -20
  143. package/build/aurora/core/index.js.map +0 -1
  144. package/build/aurora/core/number.d.ts +0 -15
  145. package/build/aurora/core/number.d.ts.map +0 -1
  146. package/build/aurora/core/number.js +0 -37
  147. package/build/aurora/core/number.js.map +0 -1
  148. package/build/aurora/core/object.d.ts +0 -17
  149. package/build/aurora/core/object.d.ts.map +0 -1
  150. package/build/aurora/core/object.js +0 -53
  151. package/build/aurora/core/object.js.map +0 -1
  152. package/build/aurora/core/string.d.ts +0 -16
  153. package/build/aurora/core/string.d.ts.map +0 -1
  154. package/build/aurora/core/string.js +0 -52
  155. package/build/aurora/core/string.js.map +0 -1
  156. package/build/aurora/core/type.d.ts +0 -11
  157. package/build/aurora/core/type.d.ts.map +0 -1
  158. package/build/aurora/core/type.js +0 -21
  159. package/build/aurora/core/type.js.map +0 -1
  160. package/build/aurora/core/union.d.ts +0 -16
  161. package/build/aurora/core/union.d.ts.map +0 -1
  162. package/build/aurora/core/union.js +0 -38
  163. package/build/aurora/core/union.js.map +0 -1
  164. package/build/aurora/index.d.ts +0 -6
  165. package/build/aurora/index.d.ts.map +0 -1
  166. package/build/aurora/index.js +0 -25
  167. package/build/aurora/index.js.map +0 -1
  168. package/build/aurora/interfaces/field.d.ts +0 -9
  169. package/build/aurora/interfaces/field.d.ts.map +0 -1
  170. package/build/aurora/interfaces/field.js.map +0 -1
  171. package/build/aurora/lib/aurora.d.ts +0 -22
  172. package/build/aurora/lib/aurora.d.ts.map +0 -1
  173. package/build/aurora/lib/aurora.js +0 -155
  174. package/build/aurora/lib/aurora.js.map +0 -1
  175. package/build/aurora/lib/validation-error.d.ts +0 -5
  176. package/build/aurora/lib/validation-error.d.ts.map +0 -1
  177. package/build/aurora/lib/validation-error.js +0 -12
  178. package/build/aurora/lib/validation-error.js.map +0 -1
  179. package/build/aurora/types/index.d.ts +0 -3
  180. package/build/aurora/types/index.d.ts.map +0 -1
  181. package/build/aurora/types/index.js +0 -6
  182. package/build/aurora/types/index.js.map +0 -1
  183. package/build/aurora/types/infer-type.d.ts +0 -13
  184. package/build/aurora/types/infer-type.d.ts.map +0 -1
  185. package/build/aurora/types/infer-type.js.map +0 -1
  186. package/build/aurora/types/orm.d.ts +0 -4
  187. package/build/aurora/types/orm.d.ts.map +0 -1
  188. package/build/aurora/types/orm.js +0 -8
  189. package/build/aurora/types/orm.js.map +0 -1
  190. package/build/core/data/person/person-orm.d.ts +0 -5
  191. package/build/core/data/person/person-orm.d.ts.map +0 -1
  192. package/build/core/data/person/person-orm.js +0 -10
  193. package/build/core/data/person/person-orm.js.map +0 -1
@@ -0,0 +1,59 @@
1
+ export declare const personSchema: import("@ascendance-hub/sapphire-core").ObjectField<{
2
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
3
+ phone: import("@ascendance-hub/sapphire-core").StringField<string, string>;
4
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
5
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
6
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
7
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
8
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
9
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
10
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
11
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
12
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
13
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
14
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
15
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
16
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
17
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
18
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
19
+ }>>;
20
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
21
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
22
+ phone: import("@ascendance-hub/sapphire-core").StringField<string, string>;
23
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
24
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
25
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
26
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
27
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
28
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
29
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
30
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
31
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
32
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
33
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
34
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
35
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
36
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
37
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
38
+ }>>;
39
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
40
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
41
+ phone: import("@ascendance-hub/sapphire-core").StringField<string, string>;
42
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
43
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
44
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
45
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
46
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
47
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
48
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
49
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
50
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
51
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
52
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
53
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
54
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
55
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
56
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
57
+ }>>;
58
+ }>>;
59
+ //# sourceMappingURL=person-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person-schema.d.ts","sourceRoot":"","sources":["../../../../src/core/data/person/person-schema.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIvB,CAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.personSchema = void 0;
4
+ const sapphire_core_1 = require("@ascendance-hub/sapphire-core");
5
+ const audit_1 = require("../common/audit");
6
+ const s = new sapphire_core_1.Sapphire();
7
+ exports.personSchema = s.object({
8
+ name: s.string(),
9
+ phone: s.string(),
10
+ audit: audit_1.auditSchema,
11
+ });
12
+ //# sourceMappingURL=person-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person-schema.js","sourceRoot":"","sources":["../../../../src/core/data/person/person-schema.ts"],"names":[],"mappings":";;;AAAA,iEAAwD;AACxD,2CAA6C;AAE7C,MAAM,CAAC,GAAG,IAAI,wBAAQ,EAAE,CAAA;AAEX,QAAA,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,mBAAW;CACnB,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { Restaurant } from './restaurant-entity';
2
+ export { restaurantSchema } from './restaurant-schema';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/data/restaurant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.restaurantSchema = void 0;
4
+ var restaurant_schema_1 = require("./restaurant-schema");
5
+ Object.defineProperty(exports, "restaurantSchema", { enumerable: true, get: function () { return restaurant_schema_1.restaurantSchema; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/data/restaurant/index.ts"],"names":[],"mappings":";;;AACA,yDAAsD;AAA7C,qHAAA,gBAAgB,OAAA"}
@@ -0,0 +1,5 @@
1
+ import type { Infer } from '@ascendance-hub/sapphire-core';
2
+ import { Entity } from '../api/entity';
3
+ import { restaurantSchema } from './restaurant-schema';
4
+ export type Restaurant = Infer<typeof restaurantSchema> & Entity;
5
+ //# sourceMappingURL=restaurant-entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restaurant-entity.d.ts","sourceRoot":"","sources":["../../../../src/core/data/restaurant/restaurant-entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,GAAG,MAAM,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=restaurant-entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restaurant-entity.js","sourceRoot":"","sources":["../../../../src/core/data/restaurant/restaurant-entity.ts"],"names":[],"mappings":""}
@@ -0,0 +1,56 @@
1
+ export declare const restaurantSchema: import("@ascendance-hub/sapphire-core").ObjectField<{
2
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
3
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
4
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
5
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
6
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
7
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
8
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
9
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
10
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
11
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
12
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
13
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
14
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
15
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
16
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
17
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
18
+ }>>;
19
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
20
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
21
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
22
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
23
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
24
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
25
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
26
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
27
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
28
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
29
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
30
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
31
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
32
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
33
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
34
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
35
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
36
+ }>>;
37
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
38
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
39
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
40
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
41
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
42
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
43
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
44
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
45
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
46
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
47
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
48
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
49
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
50
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
51
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
52
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
53
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
54
+ }>>;
55
+ }>>;
56
+ //# sourceMappingURL=restaurant-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restaurant-schema.d.ts","sourceRoot":"","sources":["../../../../src/core/data/restaurant/restaurant-schema.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAG3B,CAAA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.restaurantSchema = void 0;
4
+ const sapphire_core_1 = require("@ascendance-hub/sapphire-core");
5
+ const audit_1 = require("../common/audit");
6
+ const s = new sapphire_core_1.Sapphire();
7
+ exports.restaurantSchema = s.object({
8
+ name: s.string(),
9
+ audit: audit_1.auditSchema,
10
+ });
11
+ //# sourceMappingURL=restaurant-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restaurant-schema.js","sourceRoot":"","sources":["../../../../src/core/data/restaurant/restaurant-schema.ts"],"names":[],"mappings":";;;AAAA,iEAAwD;AACxD,2CAA6C;AAE7C,MAAM,CAAC,GAAG,IAAI,wBAAQ,EAAE,CAAA;AAEX,QAAA,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,mBAAW;CACnB,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { User } from './user-entity';
2
+ export { userSchema, UserStatus, UserRole } from './user-schema';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/data/user/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserRole = exports.UserStatus = exports.userSchema = void 0;
4
+ var user_schema_1 = require("./user-schema");
5
+ Object.defineProperty(exports, "userSchema", { enumerable: true, get: function () { return user_schema_1.userSchema; } });
6
+ Object.defineProperty(exports, "UserStatus", { enumerable: true, get: function () { return user_schema_1.UserStatus; } });
7
+ Object.defineProperty(exports, "UserRole", { enumerable: true, get: function () { return user_schema_1.UserRole; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/data/user/index.ts"],"names":[],"mappings":";;;AACA,6CAAgE;AAAvD,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,uGAAA,QAAQ,OAAA"}
@@ -0,0 +1,5 @@
1
+ import type { Infer } from '@ascendance-hub/sapphire-core';
2
+ import { Entity } from '../api/entity';
3
+ import { userSchema } from './user-schema';
4
+ export type User = Infer<typeof userSchema> & Entity;
5
+ //# sourceMappingURL=user-entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-entity.d.ts","sourceRoot":"","sources":["../../../../src/core/data/user/user-entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,UAAU,CAAC,GAAG,MAAM,CAAA"}
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=field.js.map
3
+ //# sourceMappingURL=user-entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-entity.js","sourceRoot":"","sources":["../../../../src/core/data/user/user-entity.ts"],"names":[],"mappings":""}
@@ -0,0 +1,118 @@
1
+ export declare enum UserStatus {
2
+ Active = "active",
3
+ Inactive = "inactive",
4
+ Blocked = "blocked"
5
+ }
6
+ export declare enum UserRole {
7
+ Owner = "owner",
8
+ Member = "member"
9
+ }
10
+ /**
11
+ * Usuário autenticável. O `person` é um Extended Reference ({ _id, name })
12
+ * para o documento em `people`; o e-mail é a credencial e vive aqui (índice
13
+ * único na API).
14
+ */
15
+ export declare const userSchema: import("@ascendance-hub/sapphire-core").ObjectField<{
16
+ person: import("@ascendance-hub/sapphire-core").ObjectField<{
17
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
18
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
19
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
20
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
21
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
22
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
23
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
24
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
25
+ }>>;
26
+ email: import("@ascendance-hub/sapphire-core").StringField<string, string>;
27
+ passwordHash: import("@ascendance-hub/sapphire-core").StringField<string, string>;
28
+ status: import("@ascendance-hub/sapphire-core").EnumField<UserStatus, UserStatus, UserStatus>;
29
+ role: import("@ascendance-hub/sapphire-core").EnumField<UserRole, UserRole, UserRole>;
30
+ restaurantId: import("@ascendance-hub/sapphire-core").StringField<string, string>;
31
+ termsAcceptedAt: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
32
+ lastAccessAt: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
33
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
34
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
35
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
36
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
37
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
38
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
39
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
40
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
41
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
42
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
43
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
44
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
45
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
46
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
47
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
48
+ }>>;
49
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
50
+ person: import("@ascendance-hub/sapphire-core").ObjectField<{
51
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
52
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
53
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
54
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
55
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
56
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
57
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
58
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
59
+ }>>;
60
+ email: import("@ascendance-hub/sapphire-core").StringField<string, string>;
61
+ passwordHash: import("@ascendance-hub/sapphire-core").StringField<string, string>;
62
+ status: import("@ascendance-hub/sapphire-core").EnumField<UserStatus, UserStatus, UserStatus>;
63
+ role: import("@ascendance-hub/sapphire-core").EnumField<UserRole, UserRole, UserRole>;
64
+ restaurantId: import("@ascendance-hub/sapphire-core").StringField<string, string>;
65
+ termsAcceptedAt: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
66
+ lastAccessAt: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
67
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
68
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
69
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
70
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
71
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
72
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
73
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
74
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
75
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
76
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
77
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
78
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
79
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
80
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
81
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
82
+ }>>;
83
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
84
+ person: import("@ascendance-hub/sapphire-core").ObjectField<{
85
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
86
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
87
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
88
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
89
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
90
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
91
+ _id: import("@ascendance-hub/sapphire-core").StringField<string, string>;
92
+ name: import("@ascendance-hub/sapphire-core").StringField<string, string>;
93
+ }>>;
94
+ email: import("@ascendance-hub/sapphire-core").StringField<string, string>;
95
+ passwordHash: import("@ascendance-hub/sapphire-core").StringField<string, string>;
96
+ status: import("@ascendance-hub/sapphire-core").EnumField<UserStatus, UserStatus, UserStatus>;
97
+ role: import("@ascendance-hub/sapphire-core").EnumField<UserRole, UserRole, UserRole>;
98
+ restaurantId: import("@ascendance-hub/sapphire-core").StringField<string, string>;
99
+ termsAcceptedAt: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
100
+ lastAccessAt: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
101
+ audit: import("@ascendance-hub/sapphire-core").ObjectField<{
102
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
103
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
104
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
105
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
106
+ }, import("@ascendance-hub/sapphire-core").ObjectOutput<{
107
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
108
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
109
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
110
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
111
+ }>, import("@ascendance-hub/sapphire-core").ObjectInput<{
112
+ createdAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
113
+ updatedAt: import("@ascendance-hub/sapphire-core").StringField<string, string>;
114
+ createdBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
115
+ updatedBy: import("@ascendance-hub/sapphire-core").StringField<string | undefined, string | undefined>;
116
+ }>>;
117
+ }>>;
118
+ //# sourceMappingURL=user-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-schema.d.ts","sourceRoot":"","sources":["../../../../src/core/data/user/user-schema.ts"],"names":[],"mappings":"AAMA,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED,oBAAY,QAAQ;IAClB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUrB,CAAA"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.userSchema = exports.UserRole = exports.UserStatus = void 0;
4
+ const sapphire_core_1 = require("@ascendance-hub/sapphire-core");
5
+ const person_ref_schema_1 = require("../person/person-ref-schema");
6
+ const audit_1 = require("../common/audit");
7
+ const s = new sapphire_core_1.Sapphire();
8
+ var UserStatus;
9
+ (function (UserStatus) {
10
+ UserStatus["Active"] = "active";
11
+ UserStatus["Inactive"] = "inactive";
12
+ UserStatus["Blocked"] = "blocked";
13
+ })(UserStatus || (exports.UserStatus = UserStatus = {}));
14
+ var UserRole;
15
+ (function (UserRole) {
16
+ UserRole["Owner"] = "owner";
17
+ UserRole["Member"] = "member";
18
+ })(UserRole || (exports.UserRole = UserRole = {}));
19
+ /**
20
+ * Usuário autenticável. O `person` é um Extended Reference ({ _id, name })
21
+ * para o documento em `people`; o e-mail é a credencial e vive aqui (índice
22
+ * único na API).
23
+ */
24
+ exports.userSchema = s.object({
25
+ person: person_ref_schema_1.personRefSchema,
26
+ email: s.string().email({ message: 'Informe um e-mail válido.' }),
27
+ passwordHash: s.string(),
28
+ status: s.type().enum(UserStatus),
29
+ role: s.type().enum(UserRole),
30
+ restaurantId: s.string(),
31
+ termsAcceptedAt: s.string().optional(),
32
+ lastAccessAt: s.string().optional(),
33
+ audit: audit_1.auditSchema,
34
+ });
35
+ //# sourceMappingURL=user-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-schema.js","sourceRoot":"","sources":["../../../../src/core/data/user/user-schema.ts"],"names":[],"mappings":";;;AAAA,iEAAwD;AACxD,mEAA6D;AAC7D,2CAA6C;AAE7C,MAAM,CAAC,GAAG,IAAI,wBAAQ,EAAE,CAAA;AAExB,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;AACrB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,6BAAiB,CAAA;AACnB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;;;GAIG;AACU,QAAA,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,mCAAe;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC;IACjE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,mBAAW;CACnB,CAAC,CAAA"}
package/build/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from './aurora';
2
1
  export * from './core';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
package/build/index.js CHANGED
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./aurora"), exports);
18
17
  __exportStar(require("./core"), exports);
19
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,yCAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mintly-lib",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "Mintly Library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -40,6 +40,7 @@
40
40
  "author": "",
41
41
  "license": "ISC",
42
42
  "dependencies": {
43
+ "@ascendance-hub/sapphire-core": "^1.2.0",
43
44
  "axios": "^1.13.5",
44
45
  "http-status-codes": "^2.3.0"
45
46
  },
@@ -1,18 +0,0 @@
1
- import { Field, ValidationResult } from '../interfaces/field';
2
- import { InferSchema, ORM } from '../types';
3
- export declare class ArrayField<T extends Array<Field>, IsOptional extends boolean = false> implements Field {
4
- private readonly orm;
5
- private readonly arr;
6
- constructor(orm: ORM, arr: T);
7
- private readonly schema;
8
- private required;
9
- getSchema(): {
10
- type: string;
11
- required: boolean;
12
- properties: Field[];
13
- };
14
- getType(): InferSchema<T>;
15
- optional(): ArrayField<T, true>;
16
- validate(value: any): ValidationResult;
17
- }
18
- //# sourceMappingURL=array.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/aurora/core/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI3C,qBAAa,UAAU,CACrB,CAAC,SAAS,KAAK,CAAC,KAAK,CAAC,EAGtB,UAAU,SAAS,OAAO,GAAG,KAAK,CAClC,YAAW,KAAK;IAGd,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBADH,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,CAAC;IAGzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAgB;IAEhC,SAAS;;;;;IAWT,OAAO,IAAK,WAAW,CAAC,CAAC,CAAC;IAI1B,QAAQ,IAAK,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC;IAKhC,QAAQ,CAAE,KAAK,EAAE,GAAG,GAAG,gBAAgB;CA0BxC"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ArrayField = void 0;
4
- // @ts-ignore
5
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
- class ArrayField {
7
- constructor(
8
- // @ts-ignore
9
- orm, arr) {
10
- this.orm = orm;
11
- this.arr = arr;
12
- this.schema = [];
13
- this.required = true;
14
- }
15
- getSchema() {
16
- for (const item of this.arr) {
17
- if (typeof item.getSchema === 'function') {
18
- this.schema.push(item.getSchema());
19
- }
20
- else {
21
- this.schema.push(item);
22
- }
23
- }
24
- return { type: 'array', required: this.required, properties: this.schema };
25
- }
26
- getType() {
27
- return null;
28
- }
29
- optional() {
30
- this.required = false;
31
- return this;
32
- }
33
- validate(value) {
34
- const required = this.required;
35
- if (value === undefined || value === null) {
36
- if (required)
37
- return { value, error: 'Field is required' };
38
- return { value };
39
- }
40
- if (!Array.isArray(value)) {
41
- return { value, error: 'Expected array' };
42
- }
43
- const errors = {};
44
- const validated = [];
45
- for (let i = 0; i < this.arr.length; i++) {
46
- const field = this.arr[i];
47
- if (!field)
48
- continue;
49
- const result = typeof field.validate === 'function'
50
- ? field.validate(value[i])
51
- : { value: value[i] };
52
- validated[i] = result.value;
53
- if (result.error)
54
- errors[i] = result.error;
55
- }
56
- if (Object.keys(errors).length > 0) {
57
- return { value: validated, error: JSON.stringify(errors) };
58
- }
59
- return { value: validated };
60
- }
61
- }
62
- exports.ArrayField = ArrayField;
63
- //# sourceMappingURL=array.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src/aurora/core/array.ts"],"names":[],"mappings":";;;AAGA,aAAa;AACb,6DAA6D;AAC7D,MAAa,UAAU;IAMrB;IACE,aAAa;IACI,GAAQ,EACR,GAAM;QADN,QAAG,GAAH,GAAG,CAAK;QACR,QAAG,GAAH,GAAG,CAAG;QAGR,WAAM,GAAiB,EAAE,CAAA;QAClC,aAAQ,GAAY,IAAI,CAAA;IAH5B,CAAC;IAKL,SAAS;QACP,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YAC5B,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;gBACzC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA;YACpC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACxB,CAAC;QACH,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,CAAA;IAC5E,CAAC;IAED,OAAO;QACL,OAAO,IAAW,CAAA;IACpB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;QACrB,OAAO,IAAsC,CAAA;IAC/C,CAAC;IAED,QAAQ,CAAE,KAAU;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC9B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAC1C,IAAI,QAAQ;gBAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAA;YAC1D,OAAO,EAAE,KAAK,EAAE,CAAA;QAClB,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAA;QAC3C,CAAC;QACD,MAAM,MAAM,GAA2B,EAAE,CAAA;QACzC,MAAM,SAAS,GAAU,EAAE,CAAA;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;YACzB,IAAI,CAAC,KAAK;gBAAE,SAAQ;YACpB,MAAM,MAAM,GACV,OAAO,KAAK,CAAC,QAAQ,KAAK,UAAU;gBAClC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC1B,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;YACzB,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAA;YAC3B,IAAI,MAAM,CAAC,KAAK;gBAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAA;QAC5C,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAA;QAC5D,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;IAC7B,CAAC;CACF;AA7DD,gCA6DC"}
@@ -1,14 +0,0 @@
1
- import { Field, ValidationResult } from '../interfaces/field';
2
- import { ORM } from '../types';
3
- export declare class BooleanField<IsOptional extends boolean = false> implements Field {
4
- private readonly orm;
5
- constructor(orm: ORM);
6
- private readonly schema;
7
- getSchema(): {
8
- type: BooleanConstructor;
9
- required: boolean;
10
- };
11
- optional(): BooleanField<true>;
12
- validate(value: any): ValidationResult;
13
- }
14
- //# sourceMappingURL=boolean.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src/aurora/core/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,qBAAa,YAAY,CAAC,UAAU,SAAS,OAAO,GAAG,KAAK,CAAE,YAAW,KAAK;IAC/D,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,GAAG;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IAEjD,SAAS;;;;IAOT,QAAQ,IAAK,YAAY,CAAC,IAAI,CAAC;IAK/B,QAAQ,CAAE,KAAK,EAAE,GAAG,GAAG,gBAAgB;CAWxC"}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BooleanField = void 0;
4
- const types_1 = require("../types");
5
- // @ts-ignore
6
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
- class BooleanField {
8
- constructor(orm) {
9
- this.orm = orm;
10
- this.schema = {};
11
- }
12
- getSchema() {
13
- if (this.orm === types_1.ORM.MONGO) {
14
- return { type: Boolean, required: true, ...this.schema };
15
- }
16
- throw new Error('not supported ORM');
17
- }
18
- optional() {
19
- this.schema.required = false;
20
- return this;
21
- }
22
- validate(value) {
23
- const required = this.schema.required !== false;
24
- if (value === undefined || value === null) {
25
- if (required)
26
- return { value, error: 'Field is required' };
27
- return { value };
28
- }
29
- if (typeof value !== 'boolean') {
30
- return { value, error: 'Expected boolean' };
31
- }
32
- return { value };
33
- }
34
- }
35
- exports.BooleanField = BooleanField;
36
- //# sourceMappingURL=boolean.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src/aurora/core/boolean.ts"],"names":[],"mappings":";;;AACA,oCAA8B;AAE9B,aAAa;AACb,6DAA6D;AAC7D,MAAa,YAAY;IACvB,YAA8B,GAAQ;QAAR,QAAG,GAAH,GAAG,CAAK;QACrB,WAAM,GAAwB,EAAE,CAAA;IADR,CAAC;IAG1C,SAAS;QACP,IAAI,IAAI,CAAC,GAAG,KAAK,WAAG,CAAC,KAAK,EAAE,CAAC;YAC3B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAA;QAC1D,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACtC,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAqC,CAAA;IAC9C,CAAC;IAED,QAAQ,CAAE,KAAU;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,KAAK,CAAA;QAC/C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAC1C,IAAI,QAAQ;gBAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAA;YAC1D,OAAO,EAAE,KAAK,EAAE,CAAA;QAClB,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAA;QAC7C,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,CAAA;IAClB,CAAC;CACF;AA3BD,oCA2BC"}