@decaf-ts/core 0.5.1 → 0.5.3

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 (206) hide show
  1. package/LICENSE.md +21 -157
  2. package/README.md +652 -15
  3. package/dist/core.cjs +2111 -133
  4. package/dist/core.esm.cjs +2112 -134
  5. package/lib/esm/identity/decorators.d.ts +52 -7
  6. package/lib/esm/identity/decorators.js +58 -13
  7. package/lib/esm/identity/index.js +3 -3
  8. package/lib/esm/identity/utils.d.ts +19 -0
  9. package/lib/esm/identity/utils.js +22 -3
  10. package/lib/esm/index.d.ts +10 -3
  11. package/lib/esm/index.js +19 -12
  12. package/lib/esm/interfaces/ErrorParser.d.ts +12 -0
  13. package/lib/esm/interfaces/ErrorParser.js +1 -1
  14. package/lib/esm/interfaces/Executor.d.ts +13 -0
  15. package/lib/esm/interfaces/Executor.js +1 -1
  16. package/lib/esm/interfaces/Observable.d.ts +27 -0
  17. package/lib/esm/interfaces/Observable.js +1 -1
  18. package/lib/esm/interfaces/Observer.d.ts +12 -0
  19. package/lib/esm/interfaces/Observer.js +1 -1
  20. package/lib/esm/interfaces/Paginatable.d.ts +15 -0
  21. package/lib/esm/interfaces/Paginatable.js +1 -1
  22. package/lib/esm/interfaces/Queriable.d.ts +34 -9
  23. package/lib/esm/interfaces/Queriable.js +1 -1
  24. package/lib/esm/interfaces/RawExecutor.d.ts +14 -0
  25. package/lib/esm/interfaces/RawExecutor.js +1 -1
  26. package/lib/esm/interfaces/SequenceOptions.d.ts +52 -0
  27. package/lib/esm/interfaces/SequenceOptions.js +19 -1
  28. package/lib/esm/interfaces/index.js +8 -8
  29. package/lib/esm/model/BaseModel.d.ts +31 -0
  30. package/lib/esm/model/BaseModel.js +24 -1
  31. package/lib/esm/model/construction.d.ts +433 -0
  32. package/lib/esm/model/construction.js +444 -5
  33. package/lib/esm/model/decorators.d.ts +159 -29
  34. package/lib/esm/model/decorators.js +167 -37
  35. package/lib/esm/model/index.js +5 -5
  36. package/lib/esm/model/types.d.ts +9 -0
  37. package/lib/esm/model/types.js +1 -1
  38. package/lib/esm/persistence/Adapter.d.ts +358 -17
  39. package/lib/esm/persistence/Adapter.js +292 -24
  40. package/lib/esm/persistence/Dispatch.d.ts +114 -1
  41. package/lib/esm/persistence/Dispatch.js +104 -6
  42. package/lib/esm/persistence/ObserverHandler.d.ts +95 -0
  43. package/lib/esm/persistence/ObserverHandler.js +96 -1
  44. package/lib/esm/persistence/Sequence.d.ts +89 -0
  45. package/lib/esm/persistence/Sequence.js +71 -2
  46. package/lib/esm/persistence/constants.d.ts +22 -0
  47. package/lib/esm/persistence/constants.js +23 -1
  48. package/lib/esm/persistence/decorators.d.ts +10 -0
  49. package/lib/esm/persistence/decorators.js +13 -3
  50. package/lib/esm/persistence/errors.d.ts +23 -0
  51. package/lib/esm/persistence/errors.js +24 -1
  52. package/lib/esm/persistence/index.js +9 -9
  53. package/lib/esm/persistence/types.d.ts +18 -0
  54. package/lib/esm/persistence/types.js +1 -1
  55. package/lib/esm/query/Condition.d.ts +78 -31
  56. package/lib/esm/query/Condition.js +134 -55
  57. package/lib/esm/query/Paginator.d.ts +56 -0
  58. package/lib/esm/query/Paginator.js +58 -2
  59. package/lib/esm/query/Statement.d.ts +51 -0
  60. package/lib/esm/query/Statement.js +55 -4
  61. package/lib/esm/query/constants.d.ts +25 -0
  62. package/lib/esm/query/constants.js +26 -1
  63. package/lib/esm/query/errors.d.ts +14 -0
  64. package/lib/esm/query/errors.js +15 -1
  65. package/lib/esm/query/index.js +8 -8
  66. package/lib/esm/query/options.d.ts +21 -3
  67. package/lib/esm/query/options.js +1 -1
  68. package/lib/esm/query/selectors.d.ts +26 -0
  69. package/lib/esm/query/selectors.js +1 -1
  70. package/lib/esm/ram/RamAdapter.d.ts +311 -0
  71. package/lib/esm/ram/RamAdapter.js +319 -8
  72. package/lib/esm/ram/RamContext.d.ts +16 -1
  73. package/lib/esm/ram/RamContext.js +18 -3
  74. package/lib/esm/ram/RamPaginator.d.ts +43 -0
  75. package/lib/esm/ram/RamPaginator.js +55 -3
  76. package/lib/esm/ram/RamSequence.d.ts +61 -0
  77. package/lib/esm/ram/RamSequence.js +66 -5
  78. package/lib/esm/ram/RamStatement.d.ts +74 -0
  79. package/lib/esm/ram/RamStatement.js +78 -4
  80. package/lib/esm/ram/constants.d.ts +8 -0
  81. package/lib/esm/ram/constants.js +9 -1
  82. package/lib/esm/ram/handlers.d.ts +19 -0
  83. package/lib/esm/ram/handlers.js +21 -2
  84. package/lib/esm/ram/index.js +11 -11
  85. package/lib/esm/ram/model/RamSequence.d.ts +25 -0
  86. package/lib/esm/ram/model/RamSequence.js +21 -3
  87. package/lib/esm/ram/model/index.js +2 -2
  88. package/lib/esm/ram/types.d.ts +42 -0
  89. package/lib/esm/ram/types.js +1 -1
  90. package/lib/esm/repository/Repository.d.ts +363 -8
  91. package/lib/esm/repository/Repository.js +369 -24
  92. package/lib/esm/repository/constants.d.ts +25 -0
  93. package/lib/esm/repository/constants.js +26 -1
  94. package/lib/esm/repository/decorators.d.ts +27 -0
  95. package/lib/esm/repository/decorators.js +29 -2
  96. package/lib/esm/repository/errors.d.ts +12 -5
  97. package/lib/esm/repository/errors.js +13 -6
  98. package/lib/esm/repository/index.js +8 -8
  99. package/lib/esm/repository/injectables.d.ts +18 -0
  100. package/lib/esm/repository/injectables.js +23 -5
  101. package/lib/esm/repository/types.d.ts +15 -0
  102. package/lib/esm/repository/types.js +1 -1
  103. package/lib/esm/repository/utils.d.ts +11 -0
  104. package/lib/esm/repository/utils.js +15 -4
  105. package/lib/esm/utils/decorators.d.ts +8 -0
  106. package/lib/esm/utils/decorators.js +9 -1
  107. package/lib/esm/utils/errors.d.ts +46 -0
  108. package/lib/esm/utils/errors.js +47 -1
  109. package/lib/esm/utils/index.js +3 -3
  110. package/lib/identity/decorators.cjs +53 -8
  111. package/lib/identity/decorators.d.ts +52 -7
  112. package/lib/identity/utils.cjs +20 -1
  113. package/lib/identity/utils.d.ts +19 -0
  114. package/lib/index.cjs +11 -4
  115. package/lib/index.d.ts +10 -3
  116. package/lib/interfaces/ErrorParser.cjs +1 -1
  117. package/lib/interfaces/ErrorParser.d.ts +12 -0
  118. package/lib/interfaces/Executor.cjs +1 -1
  119. package/lib/interfaces/Executor.d.ts +13 -0
  120. package/lib/interfaces/Observable.cjs +1 -1
  121. package/lib/interfaces/Observable.d.ts +27 -0
  122. package/lib/interfaces/Observer.cjs +1 -1
  123. package/lib/interfaces/Observer.d.ts +12 -0
  124. package/lib/interfaces/Paginatable.cjs +1 -1
  125. package/lib/interfaces/Paginatable.d.ts +15 -0
  126. package/lib/interfaces/Queriable.cjs +1 -1
  127. package/lib/interfaces/Queriable.d.ts +34 -9
  128. package/lib/interfaces/RawExecutor.cjs +1 -1
  129. package/lib/interfaces/RawExecutor.d.ts +14 -0
  130. package/lib/interfaces/SequenceOptions.cjs +19 -1
  131. package/lib/interfaces/SequenceOptions.d.ts +52 -0
  132. package/lib/model/BaseModel.cjs +24 -1
  133. package/lib/model/BaseModel.d.ts +31 -0
  134. package/lib/model/construction.cjs +441 -2
  135. package/lib/model/construction.d.ts +433 -0
  136. package/lib/model/decorators.cjs +160 -30
  137. package/lib/model/decorators.d.ts +159 -29
  138. package/lib/model/types.cjs +1 -1
  139. package/lib/model/types.d.ts +9 -0
  140. package/lib/persistence/Adapter.cjs +287 -19
  141. package/lib/persistence/Adapter.d.ts +358 -17
  142. package/lib/persistence/Dispatch.cjs +102 -4
  143. package/lib/persistence/Dispatch.d.ts +114 -1
  144. package/lib/persistence/ObserverHandler.cjs +96 -1
  145. package/lib/persistence/ObserverHandler.d.ts +95 -0
  146. package/lib/persistence/Sequence.cjs +70 -1
  147. package/lib/persistence/Sequence.d.ts +89 -0
  148. package/lib/persistence/constants.cjs +23 -1
  149. package/lib/persistence/constants.d.ts +22 -0
  150. package/lib/persistence/decorators.cjs +11 -1
  151. package/lib/persistence/decorators.d.ts +10 -0
  152. package/lib/persistence/errors.cjs +24 -1
  153. package/lib/persistence/errors.d.ts +23 -0
  154. package/lib/persistence/types.cjs +1 -1
  155. package/lib/persistence/types.d.ts +18 -0
  156. package/lib/query/Condition.cjs +132 -53
  157. package/lib/query/Condition.d.ts +78 -31
  158. package/lib/query/Paginator.cjs +57 -1
  159. package/lib/query/Paginator.d.ts +56 -0
  160. package/lib/query/Statement.cjs +52 -1
  161. package/lib/query/Statement.d.ts +51 -0
  162. package/lib/query/constants.cjs +26 -1
  163. package/lib/query/constants.d.ts +25 -0
  164. package/lib/query/errors.cjs +15 -1
  165. package/lib/query/errors.d.ts +14 -0
  166. package/lib/query/options.cjs +1 -1
  167. package/lib/query/options.d.ts +21 -3
  168. package/lib/query/selectors.cjs +1 -1
  169. package/lib/query/selectors.d.ts +26 -0
  170. package/lib/ram/RamAdapter.cjs +312 -1
  171. package/lib/ram/RamAdapter.d.ts +311 -0
  172. package/lib/ram/RamContext.cjs +18 -3
  173. package/lib/ram/RamContext.d.ts +16 -1
  174. package/lib/ram/RamPaginator.cjs +54 -2
  175. package/lib/ram/RamPaginator.d.ts +43 -0
  176. package/lib/ram/RamSequence.cjs +63 -2
  177. package/lib/ram/RamSequence.d.ts +61 -0
  178. package/lib/ram/RamStatement.cjs +75 -1
  179. package/lib/ram/RamStatement.d.ts +74 -0
  180. package/lib/ram/constants.cjs +9 -1
  181. package/lib/ram/constants.d.ts +8 -0
  182. package/lib/ram/handlers.cjs +20 -1
  183. package/lib/ram/handlers.d.ts +19 -0
  184. package/lib/ram/model/RamSequence.cjs +19 -1
  185. package/lib/ram/model/RamSequence.d.ts +25 -0
  186. package/lib/ram/types.cjs +1 -1
  187. package/lib/ram/types.d.ts +42 -0
  188. package/lib/repository/Repository.cjs +360 -15
  189. package/lib/repository/Repository.d.ts +363 -8
  190. package/lib/repository/constants.cjs +26 -1
  191. package/lib/repository/constants.d.ts +25 -0
  192. package/lib/repository/decorators.cjs +28 -1
  193. package/lib/repository/decorators.d.ts +27 -0
  194. package/lib/repository/errors.cjs +13 -6
  195. package/lib/repository/errors.d.ts +12 -5
  196. package/lib/repository/injectables.cjs +19 -1
  197. package/lib/repository/injectables.d.ts +18 -0
  198. package/lib/repository/types.cjs +1 -1
  199. package/lib/repository/types.d.ts +15 -0
  200. package/lib/repository/utils.cjs +12 -1
  201. package/lib/repository/utils.d.ts +11 -0
  202. package/lib/utils/decorators.cjs +9 -1
  203. package/lib/utils/decorators.d.ts +8 -0
  204. package/lib/utils/errors.cjs +47 -1
  205. package/lib/utils/errors.d.ts +46 -0
  206. package/package.json +5 -5
@@ -1,7 +1,32 @@
1
1
  import type { ModelArg } from "@decaf-ts/decorator-validation";
2
2
  import { BaseModel } from "../../model";
3
+ /**
4
+ * @description RAM sequence model for auto-incrementing values
5
+ * @summary A model class that represents a sequence in the RAM adapter. It stores the current value
6
+ * of a sequence that can be used for generating sequential identifiers for entities.
7
+ * The sequence is identified by its ID and maintains the current value.
8
+ * @param {ModelArg<Sequence>} seq - Initial sequence data
9
+ * @class Sequence
10
+ * @category Ram
11
+ * @example
12
+ * ```typescript
13
+ * // Create a new sequence
14
+ * const orderSequence = new Sequence({ id: 'order_seq', current: 1 });
15
+ *
16
+ * // Use the sequence to get the next value
17
+ * const nextOrderId = parseInt(orderSequence.current.toString()) + 1;
18
+ * orderSequence.current = nextOrderId;
19
+ * ```
20
+ */
3
21
  export declare class Sequence extends BaseModel {
22
+ /**
23
+ * @description Primary key identifier for the sequence
24
+ */
4
25
  id: string;
26
+ /**
27
+ * @description Current value of the sequence
28
+ * Used to generate the next sequential value
29
+ */
5
30
  current: string | number;
6
31
  constructor(seq?: ModelArg<Sequence>);
7
32
  }
package/lib/ram/types.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcm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UZsYWdzIGV4dGVuZHMgUmVwb3NpdG9yeUZsYWdzIHtcbiAgVVVJRDogc3RyaW5nO1xufVxuXG4vKipcbiAqIEBkZXNjcmlwdGlvbiBUeXBlIGRlZmluaXRpb24gZm9yIFJBTS1zcGVjaWZpYyByZXBvc2l0b3J5XG4gKiBAc3VtbWFyeSBBIHNwZWNpYWxpemVkIHJlcG9zaXRvcnkgdHlwZSBmb3Igd29ya2luZyB3aXRoIG1vZGVscyBpbiB0aGUgUkFNIGFkYXB0ZXIuXG4gKiBJdCBjb21iaW5lcyB0aGUgbW9kZWwgdHlwZSB3aXRoIFJBTS1zcGVjaWZpYyBxdWVyeSwgYWRhcHRlciwgZmxhZ3MsIGFuZCBjb250ZXh0IHR5cGVzLlxuICogQHRlbXBsYXRlIE0gLSBUaGUgbW9kZWwgdHlwZSBtYW5hZ2VkIGJ5IHRoZSByZXBvc2l0b3J5XG4gKiBAdHlwZWRlZiB7UmVwb3NpdG9yeTxNLCBSYXdSYW1RdWVyeTxhbnk+LCBSYW1BZGFwdGVyLCBSYW1GbGFncywgQ29udGV4dDxSYW1GbGFncz4+fSBSYW1SZXBvc2l0b3J5XG4gKiBAbWVtYmVyT2YgbW9kdWxlOmNvcmVcbiAqIEBjYXRlZ29yeSBSYW1cbiAqL1xuZXhwb3J0IHR5cGUgUmFtUmVwb3NpdG9yeTxNIGV4dGVuZHMgTW9kZWw+ID0gUmVwb3NpdG9yeTxcbiAgTSxcbiAgUmF3UmFtUXVlcnk8YW55PixcbiAgUmFtQWRhcHRlcixcbiAgUmFtRmxhZ3MsXG4gIENvbnRleHQ8UmFtRmxhZ3M+XG4+O1xuIl19
@@ -2,7 +2,31 @@ import { Constructor, Model } from "@decaf-ts/decorator-validation";
2
2
  import { Repository } from "../repository";
3
3
  import { Context, RepositoryFlags } from "@decaf-ts/db-decorators";
4
4
  import { RamAdapter } from "./RamAdapter";
5
+ /**
6
+ * @description In-memory storage structure for the RAM adapter
7
+ * @summary A nested Map structure that stores all entities by their table name and primary key.
8
+ * The outer Map uses table names as keys, while the inner Map uses entity IDs as keys and entity instances as values.
9
+ * @typedef {Map<string, Map<string | number, any>>} RamStorage
10
+ * @memberOf module:core
11
+ * @category Ram
12
+ */
5
13
  export type RamStorage = Map<string, Map<string | number, any>>;
14
+ /**
15
+ * @description Query specification for RAM adapter
16
+ * @summary Defines the structure of a query for retrieving data from the in-memory storage.
17
+ * It specifies what fields to select, which model to query, filtering conditions,
18
+ * sorting criteria, and pagination options.
19
+ * @template M - The model type being queried
20
+ * @typedef {Object} RawRamQuery
21
+ * @property select - Fields to select from the model, or undefined for all fields
22
+ * @property {Constructor<M>} from - The model constructor to query
23
+ * @property {function(M): boolean} where - Predicate function for filtering entities
24
+ * @property {function(M, M): number} [sort] - Optional comparator function for sorting results
25
+ * @property {number} [limit] - Optional maximum number of results to return
26
+ * @property {number} [skip] - Optional number of results to skip (for pagination)
27
+ * @memberOf module:core
28
+ * @category Ram
29
+ */
6
30
  export type RawRamQuery<M extends Model> = {
7
31
  select: undefined | (keyof M)[];
8
32
  from: Constructor<M>;
@@ -11,7 +35,25 @@ export type RawRamQuery<M extends Model> = {
11
35
  limit?: number;
12
36
  skip?: number;
13
37
  };
38
+ /**
39
+ * @description Flags for RAM adapter operations
40
+ * @summary Interface that extends the base repository flags with RAM-specific flags.
41
+ * Contains user identification information needed for tracking entity creation and updates.
42
+ * @interface RamFlags
43
+ * @property {string} UUID - Unique identifier for the current user
44
+ * @memberOf module:core
45
+ * @category Ram
46
+ */
14
47
  export interface RamFlags extends RepositoryFlags {
15
48
  UUID: string;
16
49
  }
50
+ /**
51
+ * @description Type definition for RAM-specific repository
52
+ * @summary A specialized repository type for working with models in the RAM adapter.
53
+ * It combines the model type with RAM-specific query, adapter, flags, and context types.
54
+ * @template M - The model type managed by the repository
55
+ * @typedef {Repository<M, RawRamQuery<any>, RamAdapter, RamFlags, Context<RamFlags>>} RamRepository
56
+ * @memberOf module:core
57
+ * @category Ram
58
+ */
17
59
  export type RamRepository<M extends Model> = Repository<M, RawRamQuery<any>, RamAdapter, RamFlags, Context<RamFlags>>;