@decaf-ts/db-decorators 0.7.3 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +1 -1
  2. package/dist/db-decorators.cjs +1 -1
  3. package/dist/db-decorators.cjs.map +1 -1
  4. package/dist/db-decorators.js +1 -1
  5. package/dist/db-decorators.js.map +1 -1
  6. package/lib/esm/index.d.ts +1 -1
  7. package/lib/esm/index.js +1 -1
  8. package/lib/esm/interfaces/BulkCrudOperator.d.ts +5 -4
  9. package/lib/esm/interfaces/Contextual.d.ts +3 -3
  10. package/lib/esm/interfaces/CrudOperator.d.ts +5 -4
  11. package/lib/esm/interfaces/IRepository.d.ts +2 -4
  12. package/lib/esm/model/decorators.d.ts +4 -5
  13. package/lib/esm/model/decorators.js.map +1 -1
  14. package/lib/esm/operations/Operations.d.ts +3 -7
  15. package/lib/esm/operations/Operations.js +1 -3
  16. package/lib/esm/operations/Operations.js.map +1 -1
  17. package/lib/esm/operations/OperationsRegistry.d.ts +2 -6
  18. package/lib/esm/operations/OperationsRegistry.js +0 -2
  19. package/lib/esm/operations/OperationsRegistry.js.map +1 -1
  20. package/lib/esm/operations/decorators.d.ts +42 -28
  21. package/lib/esm/operations/decorators.js +34 -11
  22. package/lib/esm/operations/decorators.js.map +1 -1
  23. package/lib/esm/operations/types.d.ts +9 -10
  24. package/lib/esm/overrides/Model.d.ts +16 -4
  25. package/lib/esm/overrides/overrides.js +21 -0
  26. package/lib/esm/overrides/overrides.js.map +1 -1
  27. package/lib/esm/repository/BaseRepository.d.ts +16 -27
  28. package/lib/esm/repository/BaseRepository.js +2 -28
  29. package/lib/esm/repository/BaseRepository.js.map +1 -1
  30. package/lib/esm/repository/Context.d.ts +9 -8
  31. package/lib/esm/repository/Context.js +9 -1
  32. package/lib/esm/repository/Context.js.map +1 -1
  33. package/lib/esm/repository/Repository.d.ts +9 -6
  34. package/lib/esm/repository/Repository.js +52 -38
  35. package/lib/esm/repository/Repository.js.map +1 -1
  36. package/lib/esm/repository/constants.d.ts +1 -1
  37. package/lib/esm/repository/constants.js +2 -0
  38. package/lib/esm/repository/constants.js.map +1 -1
  39. package/lib/esm/repository/types.d.ts +16 -2
  40. package/lib/esm/repository/utils.d.ts +6 -32
  41. package/lib/esm/repository/utils.js +9 -106
  42. package/lib/esm/repository/utils.js.map +1 -1
  43. package/lib/esm/validation/decorators.d.ts +4 -5
  44. package/lib/esm/validation/decorators.js.map +1 -1
  45. package/lib/index.cjs +1 -1
  46. package/lib/index.d.ts +1 -1
  47. package/lib/interfaces/BulkCrudOperator.d.ts +5 -4
  48. package/lib/interfaces/Contextual.d.ts +3 -3
  49. package/lib/interfaces/CrudOperator.d.ts +5 -4
  50. package/lib/interfaces/IRepository.d.ts +2 -4
  51. package/lib/model/decorators.d.ts +4 -5
  52. package/lib/model/decorators.js.map +1 -1
  53. package/lib/operations/Operations.cjs +1 -3
  54. package/lib/operations/Operations.d.ts +3 -7
  55. package/lib/operations/Operations.js.map +1 -1
  56. package/lib/operations/OperationsRegistry.cjs +0 -2
  57. package/lib/operations/OperationsRegistry.d.ts +2 -6
  58. package/lib/operations/OperationsRegistry.js.map +1 -1
  59. package/lib/operations/decorators.cjs +36 -12
  60. package/lib/operations/decorators.d.ts +42 -28
  61. package/lib/operations/decorators.js.map +1 -1
  62. package/lib/operations/types.d.ts +9 -10
  63. package/lib/overrides/Model.d.ts +16 -4
  64. package/lib/overrides/overrides.cjs +21 -0
  65. package/lib/overrides/overrides.js.map +1 -1
  66. package/lib/repository/BaseRepository.cjs +2 -28
  67. package/lib/repository/BaseRepository.d.ts +16 -27
  68. package/lib/repository/BaseRepository.js.map +1 -1
  69. package/lib/repository/Context.cjs +9 -1
  70. package/lib/repository/Context.d.ts +9 -8
  71. package/lib/repository/Context.js.map +1 -1
  72. package/lib/repository/Repository.cjs +51 -37
  73. package/lib/repository/Repository.d.ts +9 -6
  74. package/lib/repository/Repository.js.map +1 -1
  75. package/lib/repository/constants.cjs +2 -0
  76. package/lib/repository/constants.d.ts +1 -1
  77. package/lib/repository/constants.js.map +1 -1
  78. package/lib/repository/types.d.ts +16 -2
  79. package/lib/repository/utils.cjs +10 -108
  80. package/lib/repository/utils.d.ts +6 -32
  81. package/lib/repository/utils.js.map +1 -1
  82. package/lib/validation/decorators.d.ts +4 -5
  83. package/lib/validation/decorators.js.map +1 -1
  84. package/package.json +11 -10
@@ -1,7 +1,9 @@
1
1
  import { Context } from "./Context";
2
- import { Model } from "@decaf-ts/decorator-validation";
2
+ import { ExtendedMetadata, Model } from "@decaf-ts/decorator-validation";
3
3
  import { OperationKeys } from "../operations";
4
4
  import { Constructor } from "@decaf-ts/decoration";
5
+ import { Logger } from "@decaf-ts/logging";
6
+ import { IRepository } from "../interfaces/index";
5
7
  /**
6
8
  * @description Type utility for ensuring model extension.
7
9
  * @summary A conditional type that ensures a type extends the Model class.
@@ -28,7 +30,7 @@ export type ModelExtension<M extends Model = Model> = M extends Model ? M : neve
28
30
  * @property {boolean} rebuildWithTransient - Whether to include transient properties when rebuilding models
29
31
  * @memberOf module:db-decorators
30
32
  */
31
- export interface RepositoryFlags {
33
+ export interface RepositoryFlags<LOG extends Logger = Logger> {
32
34
  parentContext?: Context<any>;
33
35
  childContexts?: Context<any>[];
34
36
  callArgs?: any[];
@@ -39,4 +41,16 @@ export interface RepositoryFlags {
39
41
  operation?: OperationKeys;
40
42
  breakOnHandlerError: boolean;
41
43
  rebuildWithTransient: boolean;
44
+ ignoreValidation: boolean;
45
+ ignoreHandlers: boolean | string | RegExp;
46
+ logger: LOG;
47
+ correlationId?: string;
42
48
  }
49
+ export type LoggerOfFlags<R extends RepositoryFlags<any>> = R extends RepositoryFlags<infer L> ? L : never;
50
+ export type FlagsOfContext<C extends Context<any>> = C extends Context<infer F> ? F : never;
51
+ export type LoggerOfContext<C extends Context<any>> = LoggerOfFlags<FlagsOfContext<C>>;
52
+ export type ContextOfRepository<R extends IRepository<any, any>> = R extends IRepository<any, infer C> ? C : never;
53
+ export type LoggerOfRepository<R extends IRepository<any, any>> = LoggerOfContext<ContextOfRepository<R>>;
54
+ export type FlagsOfRepository<R extends IRepository<any, any>> = R extends IRepository<any, infer C> ? FlagsOfContext<C> : never;
55
+ export type PrimaryKeyType = string | number | bigint;
56
+ export type InferredPrimaryKeyType<M extends Model> = ExtendedMetadata<M>;
@@ -1,38 +1,12 @@
1
1
  import { IRepository } from "../interfaces/IRepository";
2
- import { Model } from "@decaf-ts/decorator-validation";
2
+ import { Model, ModelErrorDefinition } from "@decaf-ts/decorator-validation";
3
3
  import { Context } from "./Context";
4
- import { RepositoryFlags } from "./types";
5
- import { Constructor } from "@decaf-ts/decoration";
6
- /**
7
- * @description Context arguments for repository operations.
8
- * @summary Represents the context and arguments for repository operations.
9
- * This type is used to pass context and arguments between repository methods.
10
- * @template F - The repository flags type, defaults to RepositoryFlags
11
- * @template C - The context type, defaults to Context<F>
12
- * @typedef {Object} ContextArgs
13
- * @property {C} context - The operation context
14
- * @property {any[]} args - The operation arguments
15
- * @memberOf module:db-decorators
16
- */
17
- export type ContextArgs<F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>> = {
4
+ import { ContextOfRepository } from "./types";
5
+ export type ContextArgs<C extends Context<any>> = {
18
6
  context: C;
19
- args: any[];
7
+ args: [...any[], C];
20
8
  };
21
- /**
22
- * @summary retrieves the arguments for the handler
23
- * @param {any} dec the decorator
24
- * @param {string} prop the property name
25
- * @param {{}} m the model
26
- * @param {{}} [accum] accumulator used for internal recursiveness
27
- *
28
- * @function getHandlerArgs
29
- * @memberOf module:db-decorators.Repository
30
- */
31
- export declare const getHandlerArgs: (dec: any, prop: string, m: Constructor<any>, accum?: Record<string, {
32
- args: string[];
33
- }>) => Record<string, {
34
- args: string[];
35
- }> | void;
9
+ export declare function reduceErrorsToPrint(errors: (ModelErrorDefinition | undefined)[]): string | undefined;
36
10
  /**
37
11
  *
38
12
  * @param {IRepository<T>} repo
@@ -46,7 +20,7 @@ export declare const getHandlerArgs: (dec: any, prop: string, m: Constructor<any
46
20
  *
47
21
  * @memberOf db-decorators.utils
48
22
  */
49
- export declare function enforceDBDecorators<M extends Model<true | false>, R extends IRepository<M, F, C>, V extends object = object, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>>(repo: R, context: C, model: M, operation: string, prefix: string, oldModel?: M): Promise<void>;
23
+ export declare function enforceDBDecorators<M extends Model<true | false>, R extends IRepository<M, any>, V extends object = object>(repo: R, context: ContextOfRepository<R>, model: M, operation: string, prefix: string, oldModel?: M): Promise<void>;
50
24
  /**
51
25
  * Specific for DB Decorators
52
26
  * @param {T} model
@@ -2,30 +2,16 @@ import { ModelOperations, OperationKeys } from "./../operations/constants.js";
2
2
  import { InternalError } from "./errors.js";
3
3
  import { getHandlersDecorators, groupDecorators, sortDecorators, } from "./../operations/decorators.js";
4
4
  import { Metadata } from "@decaf-ts/decoration";
5
- /**
6
- * @summary retrieves the arguments for the handler
7
- * @param {any} dec the decorator
8
- * @param {string} prop the property name
9
- * @param {{}} m the model
10
- * @param {{}} [accum] accumulator used for internal recursiveness
11
- *
12
- * @function getHandlerArgs
13
- * @memberOf module:db-decorators.Repository
14
- */
15
- export const getHandlerArgs = function (dec, prop, m, accum) {
16
- const name = m.constructor.name;
17
- if (!name)
18
- throw new InternalError("Could not determine model class");
19
- accum = accum || {};
20
- if (dec.props.handlers[name] && dec.props.handlers[name][prop])
21
- accum = { ...dec.props.handlers[name][prop], ...accum };
22
- let proto = Object.getPrototypeOf(m);
23
- if (proto === Object.prototype)
5
+ export function reduceErrorsToPrint(errors) {
6
+ return errors.reduce((accum, e, i) => {
7
+ if (e)
8
+ accum =
9
+ typeof accum === "string"
10
+ ? accum + `\n - ${i}: ${e.toString()}`
11
+ : ` - ${i}: ${e.toString()}`;
24
12
  return accum;
25
- if (proto.constructor.name === name)
26
- proto = Object.getPrototypeOf(proto);
27
- return getHandlerArgs(dec, prop, proto, accum);
28
- };
13
+ }, undefined);
14
+ }
29
15
  /**
30
16
  *
31
17
  * @param {IRepository<T>} repo
@@ -100,87 +86,4 @@ export function getDbDecorators(model, operation, extraPrefix) {
100
86
  return accum;
101
87
  }, undefined);
102
88
  }
103
- // /**
104
- // * @summary Retrieves the decorators for an object's properties prefixed by {@param prefixes} recursively
105
- // * @param model
106
- // * @param accum
107
- // * @param prefixes
108
- // *
109
- // * @function getAllPropertyDecoratorsRecursive
110
- // * @memberOf module:db-decorators.Repository
111
- // */
112
- // export const getAllPropertyDecoratorsRecursive = function <T extends Model>(
113
- // model: T,
114
- // accum: { [indexer: string]: any[] } | undefined,
115
- // ...prefixes: string[]
116
- // ): { [indexer: string]: any[] } | undefined {
117
- // const accumulator = accum || {};
118
- // const mergeDecorators = function (decs: { [indexer: string]: any[] }) {
119
- // const pushOrSquash = (key: string, ...values: any[]) => {
120
- // values.forEach((val) => {
121
- // let match: any;
122
- // if (
123
- // !(match = accumulator[key].find((e) => e.key === val.key)) ||
124
- // match.props.operation !== val.props.operation
125
- // ) {
126
- // accumulator[key].push(val);
127
- // return;
128
- // }
129
- // if (val.key === ModelKeys.TYPE) return;
130
- // const { handlers, operation } = val.props;
131
- // if (
132
- // !operation ||
133
- // !operation.match(
134
- // new RegExp(
135
- // `^(:?${OperationKeys.ON}|${OperationKeys.AFTER})(:?${OperationKeys.CREATE}|${OperationKeys.READ}|${OperationKeys.UPDATE}|${OperationKeys.DELETE})$`
136
- // )
137
- // )
138
- // ) {
139
- // accumulator[key].push(val);
140
- // return;
141
- // }
142
- // const accumHandlers = match.props.handlers;
143
- // Object.entries(handlers).forEach(([clazz, handlerDef]) => {
144
- // if (!(clazz in accumHandlers)) {
145
- // accumHandlers[clazz] = handlerDef;
146
- // return;
147
- // }
148
- // Object.entries(handlerDef as object).forEach(
149
- // ([handlerProp, handler]) => {
150
- // if (!(handlerProp in accumHandlers[clazz])) {
151
- // accumHandlers[clazz][handlerProp] = handler;
152
- // return;
153
- // }
154
- // Object.entries(handler as object).forEach(
155
- // ([handlerKey, argsObj]) => {
156
- // if (!(handlerKey in accumHandlers[clazz][handlerProp])) {
157
- // accumHandlers[clazz][handlerProp][handlerKey] = argsObj;
158
- // return;
159
- // }
160
- // console.warn(
161
- // `Skipping handler registration for ${clazz} under prop ${handlerProp} because handler is the same`
162
- // );
163
- // }
164
- // );
165
- // }
166
- // );
167
- // });
168
- // });
169
- // };
170
- // Object.entries(decs).forEach(([key, value]) => {
171
- // accumulator[key] = accumulator[key] || [];
172
- // pushOrSquash(key, ...value);
173
- // });
174
- // };
175
- // const decs: { [indexer: string]: any[] } | undefined =
176
- // Reflection.getAllPropertyDecorators(model, ...prefixes);
177
- // if (decs) mergeDecorators(decs);
178
- // if (Object.getPrototypeOf(model) === Object.prototype) return accumulator;
179
- // // const name = model.constructor.name;
180
- // const proto = Object.getPrototypeOf(model);
181
- // if (!proto) return accumulator;
182
- // // if (proto.constructor && proto.constructor.name === name)
183
- // // proto = Object.getPrototypeOf(proto)
184
- // return getAllPropertyDecoratorsRecursive(proto, accumulator, ...prefixes);
185
- // };
186
89
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/repository/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,qCAAgC;AACzE,OAAO,EAAE,aAAa,EAAE,oBAAiB;AAIzC,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,cAAc,GACf,sCAAiC;AAElC,OAAO,EAAe,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAqB7D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,UAC5B,GAAQ,EACR,IAAY,EACZ,CAAmB,EACnB,KAA0C;IAE1C,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC;IAChC,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,aAAa,CAAC,iCAAiC,CAAC,CAAC;IACtE,KAAK,GAAG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AS,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,KAAK,MAAM,CAAC,IAAI,GAAG;YAAE,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAE1D,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK;gBAAE,KAAK,GAAG,EAAE,CAAC;YACvB,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;QAC1B,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACD,SAAS,CACV,CAAC;AACJ,CAAC"}
@@ -2,8 +2,7 @@ import "./validation";
2
2
  import { Model } from "@decaf-ts/decorator-validation";
3
3
  import { OperationKeys } from "../operations/constants";
4
4
  import { IRepository } from "../interfaces/IRepository";
5
- import { Context } from "../repository/Context";
6
- import { RepositoryFlags } from "../repository/types";
5
+ import { ContextOfRepository } from "../repository/index";
7
6
  /**
8
7
  * @description Prevents a property from being modified after initial creation.
9
8
  * @summary Marks the property as readonly, causing validation errors if attempts are made to modify it during updates.
@@ -28,7 +27,7 @@ export declare function readonly(message?: string): (target: any, propertyKey?:
28
27
  * @return {Promise<void>} A promise that resolves when the timestamp has been set
29
28
  * @function timestampHandler
30
29
  */
31
- export declare function timestampHandler<M extends Model, R extends IRepository<M, F, C>, V, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>>(this: R, context: C, data: V, key: keyof M, model: M): Promise<void>;
30
+ export declare function timestampHandler<M extends Model, R extends IRepository<M, any>, V>(this: R, context: ContextOfRepository<R>, data: V, key: keyof M, model: M): Promise<void>;
32
31
  /**
33
32
  * @description Automatically manages timestamp properties for tracking creation and update times.
34
33
  * @summary Marks the property as a timestamp, making it required and ensuring it's a valid date. The property will be automatically updated with the current timestamp during specified operations.
@@ -92,7 +91,7 @@ export declare function timestamp(operation?: OperationKeys[], format?: string):
92
91
  * @return {Promise<void>} A promise that resolves when the property has been serialized
93
92
  * @function serializeOnCreateUpdate
94
93
  */
95
- export declare function serializeOnCreateUpdate<M extends Model, R extends IRepository<M, F, C>, V, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>>(this: R, context: C, data: V, key: keyof M, model: M): Promise<void>;
94
+ export declare function serializeOnCreateUpdate<M extends Model, R extends IRepository<M, any>, V>(this: R, context: ContextOfRepository<R>, data: V, key: keyof M, model: M): Promise<void>;
96
95
  /**
97
96
  * @description Handler function that deserializes a property from JSON string after database operations.
98
97
  * @summary Converts a JSON string property back to its original complex object form after retrieving it from the database.
@@ -108,7 +107,7 @@ export declare function serializeOnCreateUpdate<M extends Model, R extends IRepo
108
107
  * @return {Promise<void>} A promise that resolves when the property has been deserialized
109
108
  * @function serializeAfterAll
110
109
  */
111
- export declare function serializeAfterAll<M extends Model, R extends IRepository<M, F, C>, V, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>>(this: R, context: C, data: V, key: keyof M, model: M): Promise<void>;
110
+ export declare function serializeAfterAll<M extends Model, R extends IRepository<M, any>, V>(this: R, context: ContextOfRepository<R>, data: V, key: keyof M, model: M): Promise<void>;
112
111
  /**
113
112
  * @description Enables automatic JSON serialization and deserialization for complex object properties.
114
113
  * @summary Decorator that automatically converts complex objects to JSON strings before storing in the database and back to objects when retrieving them.
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/validation/decorators.ts"],"names":[],"mappings":"AAAA,yBAAsB;AACtB,OAAO,EACL,IAAI,EACJ,wBAAwB,EAExB,QAAQ,EACR,IAAI,EACJ,UAAU,GACX,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,gCAA2B;AACtE,OAAO,EAAE,sBAAsB,EAAE,uBAAoB;AACrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,qCAAgC;AACtE,OAAO,EAAE,KAAK,EAAE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CAAC;QAAE,OAAO;IACxB,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,QAAQ;QAAE,OAAO;IAE3C,IAAI,CAAC;QACH,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,MAAM,IAAI,kBAAkB,CAC1B,yBAAyB,GAAG,CAAC,QAAQ,EAAE,sBAAsB,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,CAC5F,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,KAAK,CACV,cAAc,CAAC,uBAAuB,CAAC,EACvC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,iBAAiB,CAAC,EAC1C,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACtB,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,CAC/B,CAAC;AACJ,CAAC"}
package/lib/index.cjs CHANGED
@@ -34,7 +34,7 @@ __exportStar(require("./validation/index.cjs"), exports);
34
34
  * @const VERSION
35
35
  * @memberOf module:db-decorators
36
36
  */
37
- exports.VERSION = "0.7.3";
37
+ exports.VERSION = "0.7.4";
38
38
  exports.PACKAGE_NAME = "@decaf-ts/db-decorators";
39
39
  decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
40
40
  //# sourceMappingURL=index.js.map
package/lib/index.d.ts CHANGED
@@ -16,5 +16,5 @@ export * from "./validation";
16
16
  * @const VERSION
17
17
  * @memberOf module:db-decorators
18
18
  */
19
- export declare const VERSION = "0.7.3";
19
+ export declare const VERSION = "0.7.4";
20
20
  export declare const PACKAGE_NAME = "@decaf-ts/db-decorators";
@@ -1,4 +1,5 @@
1
1
  import { CrudOperator } from "./CrudOperator";
2
+ import { PrimaryKeyType } from "../repository/index";
2
3
  /**
3
4
  * @description Interface for bulk CRUD operations
4
5
  * @summary Extends the basic CRUD operations to support bulk operations on multiple models at once
@@ -20,11 +21,11 @@ export interface BulkCrudOperator<M> extends CrudOperator<M> {
20
21
  * @description Retrieves multiple model instances from the database by their keys
21
22
  * @summary Bulk operation to read multiple models at once
22
23
  * @template M - The model type
23
- * @param {(string[]|number[])} keys - Array of primary keys to retrieve
24
+ * @param {(PrimaryKeyType[])} keys - Array of primary keys to retrieve
24
25
  * @param {...any[]} args - Additional arguments
25
26
  * @return {Promise<M[]>} Promise resolving to the retrieved model instances
26
27
  */
27
- readAll(keys: string[] | number[], ...args: any[]): Promise<M[]>;
28
+ readAll(keys: PrimaryKeyType[], ...args: any[]): Promise<M[]>;
28
29
  /**
29
30
  * @description Updates multiple model instances in the database
30
31
  * @summary Bulk operation to update multiple models at once
@@ -38,9 +39,9 @@ export interface BulkCrudOperator<M> extends CrudOperator<M> {
38
39
  * @description Deletes multiple model instances from the database by their keys
39
40
  * @summary Bulk operation to delete multiple models at once
40
41
  * @template M - The model type
41
- * @param {(string[]|number[])} keys - Array of primary keys to delete
42
+ * @param {(PrimaryKeyType[])} keys - Array of primary keys to delete
42
43
  * @param {...any[]} args - Additional arguments
43
44
  * @return {Promise<M[]>} Promise resolving to the deleted model instances
44
45
  */
45
- deleteAll(keys: string[] | number[], ...args: any[]): Promise<M[]>;
46
+ deleteAll(keys: PrimaryKeyType[], ...args: any[]): Promise<M[]>;
46
47
  }
@@ -1,6 +1,6 @@
1
1
  import { OperationKeys } from "../operations";
2
2
  import { Context } from "../repository";
3
- import { RepositoryFlags } from "../repository/types";
3
+ export type FlagsOf<C extends Context<any>> = C extends Context<infer T> ? T : never;
4
4
  /**
5
5
  * @description Interface for context-aware operations
6
6
  * @summary Provides context management for database operations
@@ -9,7 +9,7 @@ import { RepositoryFlags } from "../repository/types";
9
9
  * @interface Contextual
10
10
  * @memberOf module:db-decorators
11
11
  */
12
- export interface Contextual<F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>> {
12
+ export interface Contextual<C extends Context<any> = Context<any>> {
13
13
  /**
14
14
  * @description Creates a context for a specific operation
15
15
  * @summary Generates an operation-specific context with custom flags
@@ -19,5 +19,5 @@ export interface Contextual<F extends RepositoryFlags = RepositoryFlags, C exten
19
19
  * @param {...any[]} args - Additional arguments
20
20
  * @return {Promise<C>} Promise resolving to the created context
21
21
  */
22
- context(operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE, overrides: Partial<F>, ...args: any[]): Promise<C>;
22
+ context(operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE | string, overrides: Partial<FlagsOf<C>>, ...args: any[]): Promise<C>;
23
23
  }
@@ -1,3 +1,4 @@
1
+ import { PrimaryKeyType } from "../repository/index";
1
2
  /**
2
3
  * @description Basic CRUD operations interface
3
4
  * @summary Exposes a standard Create, Read, Update, Delete API for database operations
@@ -19,11 +20,11 @@ export interface CrudOperator<M> {
19
20
  * @description Retrieves a model instance from the database by its key
20
21
  * @summary Read a model
21
22
  * @template M - The model type
22
- * @param {(string|number)} key - The primary key of the model to retrieve
23
+ * @param {PrimaryKeyType} key - The primary key of the model to retrieve
23
24
  * @param {...any[]} args - Additional arguments
24
25
  * @return {Promise<M>} Promise resolving to the retrieved model instance
25
26
  */
26
- read(key: string | number, ...args: any[]): Promise<M>;
27
+ read(key: PrimaryKeyType, ...args: any[]): Promise<M>;
27
28
  /**
28
29
  * @description Updates a model instance in the database
29
30
  * @summary Update a model
@@ -37,9 +38,9 @@ export interface CrudOperator<M> {
37
38
  * @description Deletes a model instance from the database by its key
38
39
  * @summary Delete a model
39
40
  * @template M - The model type
40
- * @param {(string|number)} key - The primary key of the model to delete
41
+ * @param {PrimaryKeyType} key - The primary key of the model to delete
41
42
  * @param {...any[]} args - Additional arguments
42
43
  * @return {Promise<M>} Promise resolving to the deleted model instance
43
44
  */
44
- delete(key: string | number, ...args: any[]): Promise<M>;
45
+ delete(key: PrimaryKeyType, ...args: any[]): Promise<M>;
45
46
  }
@@ -1,7 +1,6 @@
1
1
  import { Model, ModelConstructor } from "@decaf-ts/decorator-validation";
2
2
  import { BulkCrudOperator } from "./BulkCrudOperator";
3
- import { RepositoryFlags } from "../repository/types";
4
- import { Context } from "../repository";
3
+ import { Context, RepositoryFlags } from "../repository";
5
4
  /**
6
5
  * @description Repository interface for database operations
7
6
  * @summary Interface holding basic CRUD APIs for database models, providing standard operations and metadata
@@ -11,11 +10,10 @@ import { Context } from "../repository";
11
10
  * @interface IRepository
12
11
  * @memberOf module:db-decorators
13
12
  */
14
- export interface IRepository<M extends Model<true | false>, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>> extends BulkCrudOperator<M> {
13
+ export interface IRepository<M extends Model<boolean>, C extends Context<any> = Context<RepositoryFlags>> extends BulkCrudOperator<M> {
15
14
  /**
16
15
  * @description The constructor of the model class
17
16
  * @summary Reference to the model class constructor used to create new instances
18
17
  */
19
18
  readonly class: ModelConstructor<M>;
20
- readonly pk: keyof M;
21
19
  }
@@ -1,8 +1,7 @@
1
1
  import { Model } from "@decaf-ts/decorator-validation";
2
2
  import { IRepository } from "../interfaces/IRepository";
3
- import { Context } from "../repository/Context";
4
3
  import { CrudOperations, GroupSort } from "../operations";
5
- import { RepositoryFlags } from "../repository/types";
4
+ import { ContextOfRepository } from "../repository/index";
6
5
  /**
7
6
  * @description Hashes a property value during create or update operations
8
7
  * @summary Callback function used by the hash decorator to apply hashing to a property value
@@ -20,7 +19,7 @@ import { RepositoryFlags } from "../repository/types";
20
19
  * @function hashOnCreateUpdate
21
20
  * @memberOf module:db-decorators
22
21
  */
23
- export declare function hashOnCreateUpdate<M extends Model, R extends IRepository<M, F, C>, V extends object, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>>(this: R, context: C, data: V, key: keyof M, model: M, oldModel?: M): void;
22
+ export declare function hashOnCreateUpdate<M extends Model, R extends IRepository<M, any>, V extends object>(this: R, context: ContextOfRepository<R>, data: V, key: keyof M, model: M, oldModel?: M): void;
24
23
  /**
25
24
  * @description Creates a decorator that hashes a property value
26
25
  * @summary Decorator that automatically hashes a property value during create and update operations
@@ -65,7 +64,7 @@ export type ComposedFromMetadata = {
65
64
  * @function composedFromCreateUpdate
66
65
  * @memberOf module:db-decorators
67
66
  */
68
- export declare function composedFromCreateUpdate<M extends Model, R extends IRepository<M, F, C>, V extends ComposedFromMetadata, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>>(this: R, context: C, data: V, key: keyof M, model: M): void;
67
+ export declare function composedFromCreateUpdate<M extends Model, R extends IRepository<M, any>, V extends ComposedFromMetadata>(this: R, context: ContextOfRepository<R>, data: V, key: keyof M, model: M): void;
69
68
  /**
70
69
  * @description Creates a decorator that composes a property value from property keys
71
70
  * @summary Decorator that generates a property value by joining the names of other properties
@@ -124,7 +123,7 @@ export declare function composed(args: string[], separator?: string, hash?: bool
124
123
  * end
125
124
  * versionCreateUpdate-->>Caller: void
126
125
  */
127
- export declare function versionCreateUpdate(operation: CrudOperations): <M extends Model, R extends IRepository<M, F, C>, V extends object, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>>(this: R, context: C, data: V, key: keyof M, model: M) => void;
126
+ export declare function versionCreateUpdate(operation: CrudOperations): <M extends Model, R extends IRepository<M>, V extends object>(this: R, context: ContextOfRepository<R>, data: V, key: keyof M, model: M) => void;
128
127
  /**
129
128
  * @description Creates a decorator for versioning a property in a model
130
129
  * @summary This decorator applies multiple sub-decorators to handle version management during create and update operations
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/model/decorators.ts"],"names":[],"mappings":";;AAgCA,gDAWC;AASD,oBAKC;AAuCD,4DA2BC;AAuDD,4CASC;AAeD,4BAiBC;AAgCD,kDAuBC;AASD,0BAUC;AASD,8BAUC;AAxTD,+CAAuD;AACvD,yEA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I,CAAC,CACxB;SACA,KAAK,EAAE,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,SAAS;IACvB,OAAO,uBAAU,CAAC,GAAG,CAAC,kBAAM,CAAC,SAAS,CAAC;SACpC,MAAM,CAAC,SAAS,SAAS,CAAC,KAAU,EAAE,SAAc;QACnD,IAAA,yBAAY,EAAC,kBAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACxD,IAAA,yBAAY,EAAC,qBAAQ,CAAC,GAAG,CAAC,kBAAM,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CACzD,KAAK,EACL,SAAS,CACV,CAAC;IACJ,CAAC,CAAC;SACD,KAAK,EAAE,CAAC;AACb,CAAC"}
@@ -11,8 +11,6 @@ const constants_1 = require("./constants.cjs");
11
11
  * @template M - Model type
12
12
  * @template R - Repository type
13
13
  * @template V - Metadata type
14
- * @template F - Repository flags
15
- * @template C - Context type
16
14
  * @example
17
15
  * // Register a handler for a create operation
18
16
  * Operations.register(myHandler, OperationKeys.CREATE, targetModel, 'propertyName');
@@ -37,7 +35,7 @@ class Operations {
37
35
  /**
38
36
  * @description Gets a unique name for an operation handler
39
37
  * @summary Returns the name of the handler function or generates a hash if name is not available
40
- * @param {OperationHandler<any, any, any, any, any>} handler - The handler function to get the name for
38
+ * @param {OperationHandler<any, any, any>} handler - The handler function to get the name for
41
39
  * @return {string} The name of the handler or a generated hash
42
40
  */
43
41
  static getHandlerName(handler) {
@@ -2,8 +2,6 @@ import { Model } from "@decaf-ts/decorator-validation";
2
2
  import { OperationHandler } from "./types";
3
3
  import { OperationKeys } from "./constants";
4
4
  import { IRepository } from "../interfaces";
5
- import { Context } from "../repository";
6
- import { RepositoryFlags } from "../repository/types";
7
5
  /**
8
6
  * @description Static utility class for database operation management
9
7
  * @summary Provides functionality for registering, retrieving, and managing database operation handlers
@@ -11,8 +9,6 @@ import { RepositoryFlags } from "../repository/types";
11
9
  * @template M - Model type
12
10
  * @template R - Repository type
13
11
  * @template V - Metadata type
14
- * @template F - Repository flags
15
- * @template C - Context type
16
12
  * @example
17
13
  * // Register a handler for a create operation
18
14
  * Operations.register(myHandler, OperationKeys.CREATE, targetModel, 'propertyName');
@@ -38,10 +34,10 @@ export declare class Operations {
38
34
  /**
39
35
  * @description Gets a unique name for an operation handler
40
36
  * @summary Returns the name of the handler function or generates a hash if name is not available
41
- * @param {OperationHandler<any, any, any, any, any>} handler - The handler function to get the name for
37
+ * @param {OperationHandler<any, any, any>} handler - The handler function to get the name for
42
38
  * @return {string} The name of the handler or a generated hash
43
39
  */
44
- static getHandlerName(handler: OperationHandler<any, any, any, any, any>): any;
40
+ static getHandlerName(handler: OperationHandler<any, any, any>): any;
45
41
  /**
46
42
  * @description Generates a reflection metadata key
47
43
  * @summary Creates a fully qualified metadata key by prefixing with the reflection namespace
@@ -62,7 +58,7 @@ export declare class Operations {
62
58
  * @param {string} operation - The operation key to get handlers for
63
59
  * @return {any} The registered handlers for the specified target, property, and operation
64
60
  */
65
- static get<M extends Model, R extends IRepository<M, F, C>, V = object, F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>>(targetName: string | Record<string, any>, propKey: string, operation: string): OperationHandler<M, R, V, F, C>[] | undefined;
61
+ static get<M extends Model, R extends IRepository<M, any>, V = object>(targetName: string | Record<string, any>, propKey: string, operation: string): OperationHandler<M, R, V>[] | undefined;
66
62
  /**
67
63
  * @description Gets or initializes the operations registry
68
64
  * @summary Returns the existing registry or creates a new one if it doesn't exist
@@ -1 +1 @@
1
- {"version":3,"file":"Operations.js","sourceRoot":"","sources":["../../src/operations/Operations.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;AAEhE,iEAA0D;AAC1D,+CAA4C;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,UAAU;IAGrB,gBAAuB,CAAC;IAExB;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OA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,CAAC;QAEtC,OAAO,CAAC,IAAI,CACV,uHAAuH,CACxH,CAAC;QACF,OAAO,8BAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,GAAG,CAAC,GAAW;QACpB,OAAO,yBAAa,CAAC,OAAO,GAAG,GAAG,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,GAAG,CACR,UAAwC,EACxC,OAAe,EACf,SAAiB;QAEjB,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAU,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,aAAa;QAC1B,IAAI,CAAC,UAAU,CAAC,QAAQ;YAAE,UAAU,CAAC,QAAQ,GAAG,IAAI,uCAAkB,EAAE,CAAC;QACzE,OAAO,UAAU,CAAC,QAAQ,CAAC;IAC7B,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,QAAQ,CACb,OAAsC,EACtC,SAAwB,EACxB,MAAS,EACT,OAAwB;QAExB,UAAU,CAAC,aAAa,EAAE,CAAC,QAAQ,CACjC,OAAc,EACd,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AArFD,gCAqFC"}
@@ -37,8 +37,6 @@ class OperationsRegistry {
37
37
  * @template M - Model type extending Model
38
38
  * @template R - Repository type extending IRepository
39
39
  * @template V - Metadata type
40
- * @template F - Repository flags extending RepositoryFlags
41
- * @template C - Context type extending Context<F>
42
40
  * @param {string | Record<string, any>} target - The target class name or object
43
41
  * @param {string} propKey - The property key to get handlers for
44
42
  * @param {string} operation - The operation key to get handlers for
@@ -2,8 +2,6 @@ import { OperationHandler } from "./types";
2
2
  import { OperationKeys } from "./constants";
3
3
  import { IRepository } from "../interfaces/IRepository";
4
4
  import { Model } from "@decaf-ts/decorator-validation";
5
- import { Context } from "../repository";
6
- import { RepositoryFlags } from "../repository/types";
7
5
  /**
8
6
  * @description Registry for database operation handlers
9
7
  * @summary Manages and stores operation handlers for different model properties and operations
@@ -37,15 +35,13 @@ export declare class OperationsRegistry {
37
35
  * @template M - Model type extending Model
38
36
  * @template R - Repository type extending IRepository
39
37
  * @template V - Metadata type
40
- * @template F - Repository flags extending RepositoryFlags
41
- * @template C - Context type extending Context<F>
42
38
  * @param {string | Record<string, any>} target - The target class name or object
43
39
  * @param {string} propKey - The property key to get handlers for
44
40
  * @param {string} operation - The operation key to get handlers for
45
41
  * @param {OperationHandler[]} [accum] - Accumulator for recursive calls
46
42
  * @return {OperationHandler[] | undefined} Array of handlers or undefined if none found
47
43
  */
48
- get<M extends Model, R extends IRepository<M, F, C>, V, F extends RepositoryFlags, C extends Context<F>>(target: string | Record<string, any>, propKey: string, operation: string, accum?: OperationHandler<M, R, V, F, C>[]): OperationHandler<M, R, V, F, C>[] | undefined;
44
+ get<M extends Model, R extends IRepository<M, any>, V>(target: string | Record<string, any>, propKey: string, operation: string, accum?: OperationHandler<M, R, V>[]): OperationHandler<M, R, V>[] | undefined;
49
45
  /**
50
46
  * @description Registers an operation handler for a specific target and operation
51
47
  * @summary Stores a handler in the registry for a given target, property, and operation
@@ -60,5 +56,5 @@ export declare class OperationsRegistry {
60
56
  * @param {string | symbol} propKey - The property key to register the handler for
61
57
  * @return {void}
62
58
  */
63
- register<M extends Model, R extends IRepository<M, F, C>, V, F extends RepositoryFlags, C extends Context<F>>(handler: OperationHandler<M, R, V, F, C>, operation: OperationKeys, target: M, propKey: string | symbol): void;
59
+ register<M extends Model, R extends IRepository<M, any>, V>(handler: OperationHandler<M, R, V>, operation: OperationKeys, target: M, propKey: string | symbol): void;
64
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OperationsRegistry.js","sourceRoot":"","sources":["../../src/operations/OperationsRegistry.ts"],"names":[],"mappings":";;;AAGA,iDAA0C;AAK1C;;;;;;;;;;;;;;;;;;;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