@venizia/ignis-kernel 0.4.8-14 → 0.4.8-16

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 (93) hide show
  1. package/dist/esm/base/applications/artifact-index.d.ts +3 -3
  2. package/dist/esm/base/applications/artifact-index.js.map +1 -1
  3. package/dist/esm/base/applications/body-limit.js +1 -1
  4. package/dist/esm/base/applications/body-limit.js.map +1 -1
  5. package/dist/esm/base/applications/common/types/application.d.ts +2 -2
  6. package/dist/esm/base/applications/common/types/application.js.map +1 -1
  7. package/dist/esm/base/applications/common/types/middlewares.d.ts +2 -2
  8. package/dist/esm/base/applications/common/types/middlewares.js.map +1 -1
  9. package/dist/esm/base/applications/rest.js.map +1 -1
  10. package/dist/esm/base/auth/authenticate/common/types/jwt.d.ts +1 -1
  11. package/dist/esm/base/auth/authenticate/common/types/jwt.js.map +1 -1
  12. package/dist/esm/base/auth/authenticate/common/types/strategy.d.ts +2 -3
  13. package/dist/esm/base/auth/authenticate/common/types/strategy.js.map +1 -1
  14. package/dist/esm/base/auth/authorize/providers/request-domain.js +2 -1
  15. package/dist/esm/base/auth/authorize/providers/request-domain.js.map +1 -1
  16. package/dist/esm/base/controllers/common/types/route.d.ts +13 -4
  17. package/dist/esm/base/controllers/common/types/route.js.map +1 -1
  18. package/dist/esm/base/controllers/factory/controller.d.ts +3 -4
  19. package/dist/esm/base/controllers/factory/controller.js +0 -1
  20. package/dist/esm/base/controllers/factory/controller.js.map +1 -1
  21. package/dist/esm/base/controllers/factory/crud/abstract.d.ts +3 -4
  22. package/dist/esm/base/controllers/factory/crud/abstract.js.map +1 -1
  23. package/dist/esm/base/controllers/factory/index.d.ts +1 -0
  24. package/dist/esm/base/controllers/factory/index.js +1 -0
  25. package/dist/esm/base/controllers/factory/index.js.map +1 -1
  26. package/dist/esm/base/controllers/factory/injection.d.ts +38 -0
  27. package/dist/esm/base/controllers/factory/injection.js +54 -0
  28. package/dist/esm/base/controllers/factory/injection.js.map +1 -0
  29. package/dist/esm/base/controllers/rest/base.d.ts +3 -3
  30. package/dist/esm/base/controllers/rest/base.js.map +1 -1
  31. package/dist/esm/base/datasources/common/types.d.ts +2 -2
  32. package/dist/esm/base/datasources/common/types.js.map +1 -1
  33. package/dist/esm/base/datasources/root.d.ts +2 -2
  34. package/dist/esm/base/datasources/root.js.map +1 -1
  35. package/dist/esm/base/events/event-bus.js.map +1 -1
  36. package/dist/esm/base/metadata/index.d.ts +1 -1
  37. package/dist/esm/base/metadata/index.js +1 -1
  38. package/dist/esm/base/metadata/injectors.d.ts +1 -1
  39. package/dist/esm/base/metadata/persistents/datasource.d.ts +21 -0
  40. package/dist/esm/base/metadata/persistents/datasource.js +46 -0
  41. package/dist/esm/base/metadata/persistents/datasource.js.map +1 -0
  42. package/dist/esm/base/metadata/persistents/index.d.ts +5 -0
  43. package/dist/esm/base/metadata/persistents/index.js +5 -0
  44. package/dist/esm/base/metadata/persistents/index.js.map +1 -0
  45. package/dist/esm/base/metadata/persistents/model.d.ts +18 -0
  46. package/dist/esm/base/metadata/persistents/model.js +64 -0
  47. package/dist/esm/base/metadata/persistents/model.js.map +1 -0
  48. package/dist/esm/base/metadata/persistents/repository/index.d.ts +19 -0
  49. package/dist/esm/base/metadata/persistents/repository/index.js +32 -0
  50. package/dist/esm/base/metadata/persistents/repository/index.js.map +1 -0
  51. package/dist/esm/base/metadata/persistents/repository/injection.d.ts +15 -0
  52. package/dist/esm/base/metadata/persistents/repository/injection.js +64 -0
  53. package/dist/esm/base/metadata/persistents/repository/injection.js.map +1 -0
  54. package/dist/esm/base/metadata/persistents/repository/resolve.d.ts +15 -0
  55. package/dist/esm/base/metadata/persistents/repository/resolve.js +76 -0
  56. package/dist/esm/base/metadata/persistents/repository/resolve.js.map +1 -0
  57. package/dist/esm/base/metadata/persistents/repository/validate.d.ts +15 -0
  58. package/dist/esm/base/metadata/persistents/repository/validate.js +50 -0
  59. package/dist/esm/base/metadata/persistents/repository/validate.js.map +1 -0
  60. package/dist/esm/base/models/common/utilities.d.ts +1 -1
  61. package/dist/esm/base/repositories/common/types/options.d.ts +2 -2
  62. package/dist/esm/base/repositories/common/types/options.js.map +1 -1
  63. package/dist/esm/base/repositories/common/types/query.d.ts +6 -15
  64. package/dist/esm/base/repositories/common/types/query.js.map +1 -1
  65. package/dist/esm/base/repositories/query-schemas/index.js +7 -0
  66. package/dist/esm/base/repositories/query-schemas/index.js.map +1 -1
  67. package/dist/esm/helpers/inversion/common/types/model.d.ts +1 -1
  68. package/dist/esm/helpers/inversion/common/types/model.js.map +1 -1
  69. package/dist/esm/helpers/inversion/mixins/artifact.mixin.d.ts +3 -3
  70. package/dist/esm/helpers/inversion/mixins/controllers/controller.d.ts +3 -3
  71. package/dist/esm/helpers/inversion/mixins/controllers/grpc.d.ts +3 -3
  72. package/dist/esm/helpers/inversion/mixins/controllers/rest.d.ts +3 -3
  73. package/dist/esm/helpers/inversion/mixins/datasource.mixin.d.ts +3 -3
  74. package/dist/esm/helpers/inversion/mixins/model.mixin.d.ts +3 -3
  75. package/dist/esm/helpers/inversion/mixins/repository.mixin.d.ts +8 -8
  76. package/dist/esm/helpers/inversion/mixins/repository.mixin.js +5 -6
  77. package/dist/esm/helpers/inversion/mixins/repository.mixin.js.map +1 -1
  78. package/dist/esm/helpers/inversion/registry.d.ts +26 -26
  79. package/dist/esm/helpers/inversion/registry.js.map +1 -1
  80. package/dist/esm/helpers/singleton-realm.js +5 -4
  81. package/dist/esm/helpers/singleton-realm.js.map +1 -1
  82. package/dist/esm/metadata.d.ts +1 -1
  83. package/dist/esm/metadata.js +1 -1
  84. package/dist/esm/utilities/index.d.ts +1 -0
  85. package/dist/esm/utilities/index.js +1 -0
  86. package/dist/esm/utilities/index.js.map +1 -1
  87. package/dist/esm/utilities/toggle.utility.d.ts +22 -0
  88. package/dist/esm/utilities/toggle.utility.js +16 -0
  89. package/dist/esm/utilities/toggle.utility.js.map +1 -0
  90. package/package.json +5 -5
  91. package/dist/esm/base/metadata/persistents.d.ts +0 -55
  92. package/dist/esm/base/metadata/persistents.js +0 -303
  93. package/dist/esm/base/metadata/persistents.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injection.js","sourceRoot":"","sources":["../../../../../../src/base/metadata/persistents/repository/injection.ts"],"names":[],"mappings":"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","sourcesContent":["import 'reflect-metadata';\n\nimport { BindingNamespaces } from '@/common/bindings';\nimport type { TRepositoryMetadata } from '@/helpers/inversion';\nimport { BindingKeys, MetadataKeys } from '@/helpers/inversion';\nimport type { MetadataRegistry } from '@/helpers/inversion';\nimport { ResolverUtility } from '@venizia/ignis-helpers/common';\nimport type { IInjectMetadata } from '@venizia/ignis-inversion';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport { isDataSourceClass } from '../../../datasources';\nimport { validateFirstConstructorParameter } from './validate';\n\n/**\n * Auto-injects dataSource at constructor param[0] unless explicit @inject exists. A class is injected\n * by the class itself, so the container reads the key its registration recorded: a pinned\n * `binding` and a minified class name both resolve. Only a string reference is a key.\n */\nexport const registerDataSourceInjection = (opts: {\n target: Function;\n registry: MetadataRegistry;\n dataSourceRef: TRepositoryMetadata['dataSource'];\n resolvedDataSource: string | Function;\n}): void => {\n const { target, registry, dataSourceRef, resolvedDataSource } = opts;\n\n // Own metadata only: `getInjectMetadata` walks the prototype chain, so a repository extending another @repository class would see the BASE's injection at param[0] and silently resolve the base's dataSource.\n const ownInjects: IInjectMetadata[] | undefined = Reflect.getOwnMetadata(\n MetadataKeys.INJECT,\n target,\n );\n const injectAtIndex0 = ownInjects?.find((entry) => entry?.index === 0);\n\n if (injectAtIndex0) {\n // `@inject({ target })` carries no key; read the one recorded on the class. The function form\n // resolves through the same helper the container uses, so both paths read one class.\n const injectedTarget = injectAtIndex0.target\n ? ResolverUtility.resolveInjectTarget({ target: injectAtIndex0.target })\n : undefined;\n const injectKey =\n injectAtIndex0.key ??\n (injectedTarget ? registry.getBindingKey({ target: injectedTarget }) : undefined);\n\n // A class is judged by its brand: its key may sit under any namespace a `binding` pinned, and\n // a provisional key may still change at registration. Only a bare key is judged by its prefix.\n const isDataSourceTarget = injectedTarget\n ? isDataSourceClass(injectedTarget)\n : typeof injectKey === 'string' && injectKey.startsWith(`${BindingNamespaces.DATASOURCE}.`);\n\n if (!isDataSourceTarget) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | First parameter must be a DataSource | Found @inject with key: '${String(injectKey)}' | Expected a key starting with '${BindingNamespaces.DATASOURCE}.' or a DataSource class`,\n });\n }\n\n return;\n }\n\n // Checked only when this decorator writes the injection: an explicit @inject decides for itself.\n // An interface emits `Object` and a type-only class import emits `Function` under tsc (`Object`\n // under bun); neither names the class, so neither is judged.\n const firstParamType = Reflect.getMetadata('design:paramtypes', target)?.[0];\n\n if (firstParamType && firstParamType !== Object && firstParamType !== Function) {\n validateFirstConstructorParameter({ target, firstParamType, resolvedDataSource });\n }\n\n // The inherited list is the base repository's own, and setInjectMetadata may write straight into it.\n if (!ownInjects) {\n Reflect.defineMetadata(\n MetadataKeys.INJECT,\n [...(registry.getInjectMetadata({ target }) ?? [])],\n target,\n );\n }\n\n const derivedKey = BindingKeys.build({\n namespace: BindingNamespaces.DATASOURCE,\n key: typeof resolvedDataSource === 'string' ? resolvedDataSource : resolvedDataSource.name,\n });\n\n // The class first, decided when the repository is resolved: by then any registration - decorated,\n // `bindingList()`, or `dataSource(X, { binding })` - has recorded its key on the class. The derived\n // key is the fallback for a class nothing recorded, bound by hand under exactly that key.\n registry.setInjectMetadata({\n target,\n index: 0,\n metadata:\n typeof dataSourceRef === 'string'\n ? { key: derivedKey, index: 0, isOptional: false }\n : { target: dataSourceRef, key: derivedKey, index: 0, isOptional: false },\n });\n};\n"]}
@@ -0,0 +1,15 @@
1
+ import type { IArtifactRegistrationOptions, MetadataRegistry, TRepositoryMetadata } from '../../../../helpers/inversion/index.js';
2
+ import type { IDataSource } from '../../../datasources/index.js';
3
+ import type { AbstractEntity } from '../../../models/index.js';
4
+ /** A bare `@repository()` on a subclass reuses the type, model and datasource its nearest decorated parent declared; the registration options (`binding`, `when`, ...) are never inherited, so the subclass registers under its own name. */
5
+ export declare const inheritRepositoryMetadata: (opts: {
6
+ target: Function;
7
+ registry: MetadataRegistry;
8
+ }) => TRepositoryMetadata;
9
+ export declare const applyRepositoryMetadata: <Model extends AbstractEntity = AbstractEntity, DataSource extends IDataSource = IDataSource>(opts: {
10
+ metadata: TRepositoryMetadata<Model, DataSource>;
11
+ registration: IArtifactRegistrationOptions;
12
+ target: Function;
13
+ registry: MetadataRegistry;
14
+ }) => void;
15
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1,76 @@
1
+ import { ArtifactTypes } from '../../../../helpers/inversion/index.js';
2
+ import { ClassResolver, ResolverUtility } from '@venizia/ignis-helpers/common';
3
+ import { getError } from '@venizia/ignis-helpers/core';
4
+ import { RepositoryTypes } from '../../../repositories/common/constants.js';
5
+ import { injectable, InjectableUtility } from '../../injectable.js';
6
+ import { registerDataSourceInjection } from './injection.js';
7
+ import { validateRepositoryMetadata } from './validate.js';
8
+ /** Resolves repository metadata and registers bindings for schema auto-discovery. */
9
+ const resolveRepositoryMetadata = (opts) => {
10
+ const { metadata, target, registry } = opts;
11
+ validateRepositoryMetadata({ metadata, target });
12
+ const resolvedDataSource = ClassResolver.resolveClass({ ref: metadata.dataSource });
13
+ if (!resolvedDataSource) {
14
+ throw getError({
15
+ message: `[@repository][${target.name}] The dataSource resolver returned nothing at decoration time | An import cycle leaves the datasource class undefined here; import it without the cycle, or name it as a string`,
16
+ });
17
+ }
18
+ // No model, so no binding: the datasource owns no schema through this repository.
19
+ if (metadata.type === RepositoryTypes.REMOTE) {
20
+ registerDataSourceInjection({
21
+ target,
22
+ registry,
23
+ dataSourceRef: metadata.dataSource,
24
+ resolvedDataSource,
25
+ });
26
+ return {
27
+ type: RepositoryTypes.REMOTE,
28
+ dataSource: resolvedDataSource,
29
+ operationScope: metadata.operationScope,
30
+ };
31
+ }
32
+ const resolvedModel = ResolverUtility.resolveValue({ value: metadata.model });
33
+ registry.registerRepositoryBinding({
34
+ repository: target,
35
+ model: resolvedModel,
36
+ dataSource: resolvedDataSource,
37
+ });
38
+ registerDataSourceInjection({
39
+ target,
40
+ registry,
41
+ dataSourceRef: metadata.dataSource,
42
+ resolvedDataSource,
43
+ });
44
+ return {
45
+ type: RepositoryTypes.MODEL,
46
+ model: resolvedModel,
47
+ dataSource: resolvedDataSource,
48
+ operationScope: metadata.operationScope,
49
+ };
50
+ };
51
+ /** A bare `@repository()` on a subclass reuses the type, model and datasource its nearest decorated parent declared; the registration options (`binding`, `when`, ...) are never inherited, so the subclass registers under its own name. */
52
+ export const inheritRepositoryMetadata = (opts) => {
53
+ // Own metadata does not exist yet at decoration time, so this read walks the prototype chain.
54
+ const inherited = opts.registry.getRepositoryMetadata({ target: opts.target });
55
+ if (!inherited) {
56
+ throw getError({
57
+ message: `[@repository][${opts.target.name}] No metadata given and no decorated repository above it in the prototype chain | pass { model, dataSource } or decorate the parent`,
58
+ });
59
+ }
60
+ if (inherited.type === RepositoryTypes.REMOTE) {
61
+ const { type, dataSource, operationScope } = inherited;
62
+ return { type, dataSource, operationScope };
63
+ }
64
+ const { type, model: parentModel, dataSource, operationScope } = inherited;
65
+ return { type, model: parentModel, dataSource, operationScope };
66
+ };
67
+ export const applyRepositoryMetadata = (opts) => {
68
+ const { metadata, registration, target, registry } = opts;
69
+ injectable({
70
+ type: ArtifactTypes.REPOSITORY,
71
+ ...InjectableUtility.pickRegistrationOptions({ metadata: registration }),
72
+ })(target);
73
+ const resolved = resolveRepositoryMetadata({ metadata, target, registry });
74
+ registry.setRepositoryMetadata({ target, metadata: { ...metadata, _resolved: resolved } });
75
+ };
76
+ //# sourceMappingURL=resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../../../src/base/metadata/persistents/repository/resolve.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,qFAAqF;AACrF,MAAM,yBAAyB,GAAG,CAGhC,IAID,EAAkD,EAAE;IACnD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE5C,0BAA0B,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAEjD,MAAM,kBAAkB,GAAG,aAAa,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAEpF,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,QAAQ,CAAC;YACb,OAAO,EAAE,iBAAiB,MAAM,CAAC,IAAI,iLAAiL;SACvN,CAAC,CAAC;IACL,CAAC;IAED,kFAAkF;IAClF,IAAI,QAAQ,CAAC,IAAI,KAAK,eAAe,CAAC,MAAM,EAAE,CAAC;QAC7C,2BAA2B,CAAC;YAC1B,MAAM;YACN,QAAQ;YACR,aAAa,EAAE,QAAQ,CAAC,UAAU;YAClC,kBAAkB;SACnB,CAAC,CAAC;QAEH,OAAO;YACL,IAAI,EAAE,eAAe,CAAC,MAAM;YAC5B,UAAU,EAAE,kBAAkB;YAC9B,cAAc,EAAE,QAAQ,CAAC,cAAc;SACxC,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,eAAe,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAE9E,QAAQ,CAAC,yBAAyB,CAAC;QACjC,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,aAAa;QACpB,UAAU,EAAE,kBAAkB;KAC/B,CAAC,CAAC;IAEH,2BAA2B,CAAC;QAC1B,MAAM;QACN,QAAQ;QACR,aAAa,EAAE,QAAQ,CAAC,UAAU;QAClC,kBAAkB;KACnB,CAAC,CAAC;IAEH,OAAO;QACL,IAAI,EAAE,eAAe,CAAC,KAAK;QAC3B,KAAK,EAAE,aAAa;QACpB,UAAU,EAAE,kBAAkB;QAC9B,cAAc,EAAE,QAAQ,CAAC,cAAc;KACxC,CAAC;AACJ,CAAC,CAAC;AAEF,6OAA6O;AAC7O,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,IAGzC,EAAuB,EAAE;IACxB,8FAA8F;IAC9F,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAE/E,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,QAAQ,CAAC;YACb,OAAO,EAAE,iBAAiB,IAAI,CAAC,MAAM,CAAC,IAAI,qIAAqI;SAChL,CAAC,CAAC;IACL,CAAC;IAED,IAAI,SAAS,CAAC,IAAI,KAAK,eAAe,CAAC,MAAM,EAAE,CAAC;QAC9C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;QAEvD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;IAC9C,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IAE3E,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;AAClE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAGrC,IAKD,EAAQ,EAAE;IACT,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE1D,UAAU,CAAC;QACT,IAAI,EAAE,aAAa,CAAC,UAAU;QAC9B,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;KACzE,CAAC,CAAC,MAAM,CAAC,CAAC;IAEX,MAAM,QAAQ,GAAG,yBAAyB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE3E,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC7F,CAAC,CAAC","sourcesContent":["import type {\n IArtifactRegistrationOptions,\n IResolvedRepositoryMetadata,\n MetadataRegistry,\n TRepositoryMetadata,\n} from '@/helpers/inversion';\nimport { ArtifactTypes } from '@/helpers/inversion';\nimport { ClassResolver, ResolverUtility } from '@venizia/ignis-helpers/common';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport type { IDataSource } from '../../../datasources';\nimport type { AbstractEntity } from '../../../models';\nimport { RepositoryTypes } from '../../../repositories/common/constants';\nimport { injectable, InjectableUtility } from '../../injectable';\nimport { registerDataSourceInjection } from './injection';\nimport { validateRepositoryMetadata } from './validate';\n\n/** Resolves repository metadata and registers bindings for schema auto-discovery. */\nconst resolveRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n target: Function;\n registry: MetadataRegistry;\n}): IResolvedRepositoryMetadata<Model, DataSource> => {\n const { metadata, target, registry } = opts;\n\n validateRepositoryMetadata({ metadata, target });\n\n const resolvedDataSource = ClassResolver.resolveClass({ ref: metadata.dataSource });\n\n if (!resolvedDataSource) {\n throw getError({\n message: `[@repository][${target.name}] The dataSource resolver returned nothing at decoration time | An import cycle leaves the datasource class undefined here; import it without the cycle, or name it as a string`,\n });\n }\n\n // No model, so no binding: the datasource owns no schema through this repository.\n if (metadata.type === RepositoryTypes.REMOTE) {\n registerDataSourceInjection({\n target,\n registry,\n dataSourceRef: metadata.dataSource,\n resolvedDataSource,\n });\n\n return {\n type: RepositoryTypes.REMOTE,\n dataSource: resolvedDataSource,\n operationScope: metadata.operationScope,\n };\n }\n\n const resolvedModel = ResolverUtility.resolveValue({ value: metadata.model });\n\n registry.registerRepositoryBinding({\n repository: target,\n model: resolvedModel,\n dataSource: resolvedDataSource,\n });\n\n registerDataSourceInjection({\n target,\n registry,\n dataSourceRef: metadata.dataSource,\n resolvedDataSource,\n });\n\n return {\n type: RepositoryTypes.MODEL,\n model: resolvedModel,\n dataSource: resolvedDataSource,\n operationScope: metadata.operationScope,\n };\n};\n\n/** A bare `@repository()` on a subclass reuses the type, model and datasource its nearest decorated parent declared; the registration options (`binding`, `when`, ...) are never inherited, so the subclass registers under its own name. */\nexport const inheritRepositoryMetadata = (opts: {\n target: Function;\n registry: MetadataRegistry;\n}): TRepositoryMetadata => {\n // Own metadata does not exist yet at decoration time, so this read walks the prototype chain.\n const inherited = opts.registry.getRepositoryMetadata({ target: opts.target });\n\n if (!inherited) {\n throw getError({\n message: `[@repository][${opts.target.name}] No metadata given and no decorated repository above it in the prototype chain | pass { model, dataSource } or decorate the parent`,\n });\n }\n\n if (inherited.type === RepositoryTypes.REMOTE) {\n const { type, dataSource, operationScope } = inherited;\n\n return { type, dataSource, operationScope };\n }\n\n const { type, model: parentModel, dataSource, operationScope } = inherited;\n\n return { type, model: parentModel, dataSource, operationScope };\n};\n\nexport const applyRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n registration: IArtifactRegistrationOptions;\n target: Function;\n registry: MetadataRegistry;\n}): void => {\n const { metadata, registration, target, registry } = opts;\n\n injectable({\n type: ArtifactTypes.REPOSITORY,\n ...InjectableUtility.pickRegistrationOptions({ metadata: registration }),\n })(target);\n\n const resolved = resolveRepositoryMetadata({ metadata, target, registry });\n\n registry.setRepositoryMetadata({ target, metadata: { ...metadata, _resolved: resolved } });\n};\n"]}
@@ -0,0 +1,15 @@
1
+ import type { TRepositoryMetadata } from '../../../../helpers/inversion/index.js';
2
+ import type { IDataSource } from '../../../datasources/index.js';
3
+ import type { AbstractEntity } from '../../../models/index.js';
4
+ /** Mirrors the `TRepositoryMetadata` union for JavaScript callers: a known type, a dataSource always, a model exactly when the type is RepositoryTypes.MODEL. */
5
+ export declare const validateRepositoryMetadata: <Model extends AbstractEntity = AbstractEntity, DataSource extends IDataSource = IDataSource>(opts: {
6
+ metadata: TRepositoryMetadata<Model, DataSource>;
7
+ target: Function;
8
+ }) => void;
9
+ /** Asserts the constructor's first parameter is a datasource class (`AbstractDataSource` or the `DataSourceRoot` it extends) compatible with what @repository declared. */
10
+ export declare const validateFirstConstructorParameter: (opts: {
11
+ target: Function;
12
+ firstParamType: Function;
13
+ resolvedDataSource: string | Function;
14
+ }) => void;
15
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1,50 @@
1
+ import { getError } from '@venizia/ignis-helpers/core';
2
+ import { isDataSourceClass } from '../../../datasources/index.js';
3
+ import { RepositoryTypes } from '../../../repositories/common/constants.js';
4
+ /** Mirrors the `TRepositoryMetadata` union for JavaScript callers: a known type, a dataSource always, a model exactly when the type is RepositoryTypes.MODEL. */
5
+ export const validateRepositoryMetadata = (opts) => {
6
+ const { metadata, target } = opts;
7
+ const type = metadata.type ?? RepositoryTypes.MODEL;
8
+ if (!RepositoryTypes.isValid(type)) {
9
+ throw getError({
10
+ message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Unknown 'type': ${type} | Expected one of: ${[...RepositoryTypes.SCHEME_SET].join(', ')}`,
11
+ });
12
+ }
13
+ if (type === RepositoryTypes.MODEL && !metadata.model) {
14
+ throw getError({
15
+ message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Missing 'model'`,
16
+ });
17
+ }
18
+ if (type === RepositoryTypes.REMOTE && metadata.model) {
19
+ throw getError({
20
+ message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | A '${RepositoryTypes.REMOTE}' repository takes no 'model'`,
21
+ });
22
+ }
23
+ if (!metadata.dataSource) {
24
+ throw getError({
25
+ message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Missing 'dataSource'`,
26
+ });
27
+ }
28
+ };
29
+ /** Asserts the constructor's first parameter is a datasource class (`AbstractDataSource` or the `DataSourceRoot` it extends) compatible with what @repository declared. */
30
+ export const validateFirstConstructorParameter = (opts) => {
31
+ const { target, firstParamType, resolvedDataSource } = opts;
32
+ // NOT `instanceof`: two copies of this package give two `DataSourceRoot` classes and the
33
+ // check would be false across them, rejecting a perfectly valid repository at import time.
34
+ const isDataSourceType = isDataSourceClass(firstParamType);
35
+ if (!isDataSourceType) {
36
+ throw getError({
37
+ message: `[@repository][${target.name}] Invalid constructor | First parameter must extend AbstractDataSource (or DataSourceRoot) | Received: '${firstParamType.name}'`,
38
+ });
39
+ }
40
+ if (typeof resolvedDataSource !== 'function') {
41
+ return;
42
+ }
43
+ const isCompatible = firstParamType === resolvedDataSource || resolvedDataSource.prototype instanceof firstParamType;
44
+ if (!isCompatible) {
45
+ throw getError({
46
+ message: `[@repository][${target.name}] Invalid constructor | Type mismatch | Constructor expects '${firstParamType.name}' but @repository specifies '${resolvedDataSource.name}'`,
47
+ });
48
+ }
49
+ };
50
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../../src/base/metadata/persistents/repository/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAEzE,iKAAiK;AACjK,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAGxC,IAGD,EAAQ,EAAE;IACT,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,eAAe,CAAC,KAAK,CAAC;IAEpD,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,QAAQ,CAAC;YACb,OAAO,EAAE,6CAA6C,MAAM,CAAC,IAAI,wCAAwC,IAAI,uBAAuB,CAAC,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SACjL,CAAC,CAAC;IACL,CAAC;IAED,IAAI,IAAI,KAAK,eAAe,CAAC,KAAK,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtD,MAAM,QAAQ,CAAC;YACb,OAAO,EAAE,6CAA6C,MAAM,CAAC,IAAI,sCAAsC;SACxG,CAAC,CAAC;IACL,CAAC;IAED,IAAI,IAAI,KAAK,eAAe,CAAC,MAAM,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtD,MAAM,QAAQ,CAAC;YACb,OAAO,EAAE,6CAA6C,MAAM,CAAC,IAAI,2BAA2B,eAAe,CAAC,MAAM,+BAA+B;SAClJ,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,QAAQ,CAAC;YACb,OAAO,EAAE,6CAA6C,MAAM,CAAC,IAAI,2CAA2C;SAC7G,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAEF,2KAA2K;AAC3K,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,IAIjD,EAAQ,EAAE;IACT,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC;IAE5D,yFAAyF;IACzF,2FAA2F;IAC3F,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAE3D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,QAAQ,CAAC;YACb,OAAO,EAAE,iBAAiB,MAAM,CAAC,IAAI,2GAA2G,cAAc,CAAC,IAAI,GAAG;SACvK,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO,kBAAkB,KAAK,UAAU,EAAE,CAAC;QAC7C,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAChB,cAAc,KAAK,kBAAkB,IAAI,kBAAkB,CAAC,SAAS,YAAY,cAAc,CAAC;IAElG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,QAAQ,CAAC;YACb,OAAO,EAAE,iBAAiB,MAAM,CAAC,IAAI,gEAAgE,cAAc,CAAC,IAAI,gCAAgC,kBAAkB,CAAC,IAAI,GAAG;SACnL,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { TRepositoryMetadata } from '@/helpers/inversion';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport type { IDataSource } from '../../../datasources';\nimport { isDataSourceClass } from '../../../datasources';\nimport type { AbstractEntity } from '../../../models';\nimport { RepositoryTypes } from '../../../repositories/common/constants';\n\n/** Mirrors the `TRepositoryMetadata` union for JavaScript callers: a known type, a dataSource always, a model exactly when the type is RepositoryTypes.MODEL. */\nexport const validateRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n target: Function;\n}): void => {\n const { metadata, target } = opts;\n const type = metadata.type ?? RepositoryTypes.MODEL;\n\n if (!RepositoryTypes.isValid(type)) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Unknown 'type': ${type} | Expected one of: ${[...RepositoryTypes.SCHEME_SET].join(', ')}`,\n });\n }\n\n if (type === RepositoryTypes.MODEL && !metadata.model) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Missing 'model'`,\n });\n }\n\n if (type === RepositoryTypes.REMOTE && metadata.model) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | A '${RepositoryTypes.REMOTE}' repository takes no 'model'`,\n });\n }\n\n if (!metadata.dataSource) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Missing 'dataSource'`,\n });\n }\n};\n\n/** Asserts the constructor's first parameter is a datasource class (`AbstractDataSource` or the `DataSourceRoot` it extends) compatible with what @repository declared. */\nexport const validateFirstConstructorParameter = (opts: {\n target: Function;\n firstParamType: Function;\n resolvedDataSource: string | Function;\n}): void => {\n const { target, firstParamType, resolvedDataSource } = opts;\n\n // NOT `instanceof`: two copies of this package give two `DataSourceRoot` classes and the\n // check would be false across them, rejecting a perfectly valid repository at import time.\n const isDataSourceType = isDataSourceClass(firstParamType);\n\n if (!isDataSourceType) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | First parameter must extend AbstractDataSource (or DataSourceRoot) | Received: '${firstParamType.name}'`,\n });\n }\n\n if (typeof resolvedDataSource !== 'function') {\n return;\n }\n\n const isCompatible =\n firstParamType === resolvedDataSource || resolvedDataSource.prototype instanceof firstParamType;\n\n if (!isCompatible) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | Type mismatch | Constructor expects '${firstParamType.name}' but @repository specifies '${resolvedDataSource.name}'`,\n });\n }\n};\n"]}
@@ -12,7 +12,7 @@ export declare class ModelUtility {
12
12
  }): TEntityId;
13
13
  static snakeToCamel<T extends z.ZodRawShape>(opts: {
14
14
  shape: T;
15
- }): z.ZodPipe<z.ZodPipe<z.ZodObject<{ -readonly [P in keyof T]: T[P]; }, z.core.$strip>, z.ZodTransform<any, z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>>>, z.ZodObject<TCamelCaseKeys<T> extends infer T_1 ? { -readonly [P_1 in keyof T_1]: T_1[P_1]; } : never, z.core.$strip>>;
15
+ }): z.ZodPipe<z.ZodPipe<z.ZodObject<{ -readonly [P in keyof T]: T[P]; }, z.core.$strip>, z.ZodTransform<Record<string, unknown>, z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>>>, z.ZodObject<TCamelCaseKeys<T> extends infer T_1 ? { -readonly [P_1 in keyof T_1]: T_1[P_1]; } : never, z.core.$strip>>;
16
16
  }
17
17
  export {};
18
18
  //# sourceMappingURL=utilities.d.ts.map
@@ -5,8 +5,8 @@ import type { SQL } from 'drizzle-orm';
5
5
  import type { TLockStrength } from '../constants.js';
6
6
  import type { TDataWithRange } from './results.js';
7
7
  /** Update data supporting both regular fields and JSON path updates via dot notation. */
8
- export type TUpdateData<T = any> = Partial<T> & {
9
- [jsonPath: string]: any;
8
+ export type TUpdateData<T = object> = Partial<T> & {
9
+ [jsonPath: string]: unknown;
10
10
  };
11
11
  /** Options for Drizzle ORM query building, used internally by FilterBuilder. */
12
12
  export type TDrizzleQueryOptions = Partial<{
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../../../src/base/repositories/common/types/options.ts"],"names":[],"mappings":"","sourcesContent":["import type { ITransaction } from '@/base/datasources';\nimport type { IRetryBackoffOptions, TLogLevel } from '@venizia/ignis-helpers/core';\nimport type { TNullable } from '@venizia/ignis-helpers/common';\nimport type { SQL } from 'drizzle-orm';\nimport type { TLockStrength } from '../constants';\nimport type { TDataWithRange } from './results';\n\n/** Update data supporting both regular fields and JSON path updates via dot notation. */\nexport type TUpdateData<T = any> = Partial<T> & {\n [jsonPath: string]: any;\n};\n\n/** Options for Drizzle ORM query building, used internally by FilterBuilder. */\nexport type TDrizzleQueryOptions = Partial<{\n limit: number;\n offset: number;\n orderBy: SQL[];\n where: SQL;\n with: Record<string, true | TDrizzleQueryOptions>;\n columns: Record<string, boolean>;\n}>;\n\n/** Configuration for repository operation logging. */\nexport type TRepositoryLogOptions = {\n use: boolean;\n level?: TLogLevel;\n};\n\n/** Configuration for row-level lock wait behavior. Mutually exclusive: use noWait OR skipLocked. */\nexport type TLockConfig =\n | { noWait: true; skipLocked?: undefined }\n | { noWait?: undefined; skipLocked: true }\n | { noWait?: undefined; skipLocked?: undefined };\n\n/** Row-level locking options for read operations. */\nexport type TLockOptions = {\n strength: TLockStrength;\n config?: TLockConfig;\n};\n\n/** Neutral transaction association - postgres narrows to its own `IDatabaseTransaction` (via `isDatabaseTransaction`) where it needs `.connector`. */\nexport interface IWithTransaction {\n transaction?: ITransaction;\n}\n\n/** Extended options for repository operations with transaction, logging, and default filter bypass. */\nexport interface IExtraOptions extends IWithTransaction {\n log?: TRepositoryLogOptions;\n\n /** If true, bypass the default filter configured in model settings (e.g., soft delete). */\n shouldSkipDefaultFilter?: boolean;\n\n /** Row-level locking. Requires transaction. Incompatible with include/fields (Query API). */\n lock?: TLockOptions;\n}\n\n/**\n * Read-after-write retry for read verbs behind a replicated pool. The read re-executes while\n * `until(result)` returns false; on exhaustion the last result is returned as-is.\n */\nexport interface IReadRetryOptions<TResult> {\n /** @default 3 */\n maxAttempts?: number;\n\n /** Total budget in ms across attempts AND sleeps. Unlimited when omitted. */\n maxTotalMs?: number;\n\n /**\n * Aborts between attempts and during backoff sleeps - pass the request signal so a cancelled\n * request stops retrying.\n */\n signal?: AbortSignal;\n\n /**\n * Backoff between attempts, tuned for replica lag.\n *\n * @default { strategy: RetryBackoffStrategies.EXPONENTIAL, initialDelayMs: 50, maxDelayMs: 500, jitter: RetryJitterModes.EQUAL }\n */\n backoff?: IRetryBackoffOptions;\n\n /**\n * Retry while false. With none given, `findOne` and `findById` retry on a null row and `find` on an empty list.\n */\n until?: (result: TResult) => boolean;\n}\n\n/**\n * Intersected into READ verb signatures only - a write verb's options type has no `retry`, so an\n * inline `{ retry }` fails to compile and a pre-built object carrying it is inert.\n */\nexport interface IWithReadRetry<TResult> {\n retry?: IReadRetryOptions<TResult>;\n}\n\n/** Options for `find` returning a plain array - the retry predicate sees `Array<R>`. */\nexport type TFindOptions<TOptions extends IExtraOptions, R> = TOptions & {\n shouldQueryRange?: false;\n} & IWithReadRetry<Array<R>>;\n\n/** Options for `find` with the range envelope - the retry predicate sees `{ data, range }`. */\nexport type TFindRangeOptions<TOptions extends IExtraOptions, R> = TOptions & {\n shouldQueryRange: true;\n} & IWithReadRetry<TDataWithRange<R>>;\n\n/** Options for `findOne`/`findById` - the retry predicate sees `TNullable<R>`. */\nexport type TFindOneOptions<TOptions extends IExtraOptions, R> = TOptions &\n IWithReadRetry<TNullable<R>>;\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../../../src/base/repositories/common/types/options.ts"],"names":[],"mappings":"","sourcesContent":["import type { ITransaction } from '@/base/datasources';\nimport type { IRetryBackoffOptions, TLogLevel } from '@venizia/ignis-helpers/core';\nimport type { TNullable } from '@venizia/ignis-helpers/common';\nimport type { SQL } from 'drizzle-orm';\nimport type { TLockStrength } from '../constants';\nimport type { TDataWithRange } from './results';\n\n/** Update data supporting both regular fields and JSON path updates via dot notation. */\nexport type TUpdateData<T = object> = Partial<T> & {\n [jsonPath: string]: unknown;\n};\n\n/** Options for Drizzle ORM query building, used internally by FilterBuilder. */\nexport type TDrizzleQueryOptions = Partial<{\n limit: number;\n offset: number;\n orderBy: SQL[];\n where: SQL;\n with: Record<string, true | TDrizzleQueryOptions>;\n columns: Record<string, boolean>;\n}>;\n\n/** Configuration for repository operation logging. */\nexport type TRepositoryLogOptions = {\n use: boolean;\n level?: TLogLevel;\n};\n\n/** Configuration for row-level lock wait behavior. Mutually exclusive: use noWait OR skipLocked. */\nexport type TLockConfig =\n | { noWait: true; skipLocked?: undefined }\n | { noWait?: undefined; skipLocked: true }\n | { noWait?: undefined; skipLocked?: undefined };\n\n/** Row-level locking options for read operations. */\nexport type TLockOptions = {\n strength: TLockStrength;\n config?: TLockConfig;\n};\n\n/** Neutral transaction association - postgres narrows to its own `IDatabaseTransaction` (via `isDatabaseTransaction`) where it needs `.connector`. */\nexport interface IWithTransaction {\n transaction?: ITransaction;\n}\n\n/** Extended options for repository operations with transaction, logging, and default filter bypass. */\nexport interface IExtraOptions extends IWithTransaction {\n log?: TRepositoryLogOptions;\n\n /** If true, bypass the default filter configured in model settings (e.g., soft delete). */\n shouldSkipDefaultFilter?: boolean;\n\n /** Row-level locking. Requires transaction. Incompatible with include/fields (Query API). */\n lock?: TLockOptions;\n}\n\n/**\n * Read-after-write retry for read verbs behind a replicated pool. The read re-executes while\n * `until(result)` returns false; on exhaustion the last result is returned as-is.\n */\nexport interface IReadRetryOptions<TResult> {\n /** @default 3 */\n maxAttempts?: number;\n\n /** Total budget in ms across attempts AND sleeps. Unlimited when omitted. */\n maxTotalMs?: number;\n\n /**\n * Aborts between attempts and during backoff sleeps - pass the request signal so a cancelled\n * request stops retrying.\n */\n signal?: AbortSignal;\n\n /**\n * Backoff between attempts, tuned for replica lag.\n *\n * @default { strategy: RetryBackoffStrategies.EXPONENTIAL, initialDelayMs: 50, maxDelayMs: 500, jitter: RetryJitterModes.EQUAL }\n */\n backoff?: IRetryBackoffOptions;\n\n /**\n * Retry while false. With none given, `findOne` and `findById` retry on a null row and `find` on an empty list.\n */\n until?: (result: TResult) => boolean;\n}\n\n/**\n * Intersected into READ verb signatures only - a write verb's options type has no `retry`, so an\n * inline `{ retry }` fails to compile and a pre-built object carrying it is inert.\n */\nexport interface IWithReadRetry<TResult> {\n retry?: IReadRetryOptions<TResult>;\n}\n\n/** Options for `find` returning a plain array - the retry predicate sees `Array<R>`. */\nexport type TFindOptions<TOptions extends IExtraOptions, R> = TOptions & {\n shouldQueryRange?: false;\n} & IWithReadRetry<Array<R>>;\n\n/** Options for `find` with the range envelope - the retry predicate sees `{ data, range }`. */\nexport type TFindRangeOptions<TOptions extends IExtraOptions, R> = TOptions & {\n shouldQueryRange: true;\n} & IWithReadRetry<TDataWithRange<R>>;\n\n/** Options for `findOne`/`findById` - the retry predicate sees `TNullable<R>`. */\nexport type TFindOneOptions<TOptions extends IExtraOptions, R> = TOptions &\n IWithReadRetry<TNullable<R>>;\n"]}
@@ -1,18 +1,9 @@
1
- import type { AnyType } from '@venizia/ignis-helpers/common';
2
- import type { Column, SQL } from 'drizzle-orm';
3
- /** Options passed to query operator handler functions. */
4
- export interface IQueryHandlerOptions<T = any> {
5
- column: Column;
1
+ import type { SQL, SQLWrapper } from 'drizzle-orm';
2
+ /** Options passed to query operator handler functions. `column` is a `Column` or, on the JSON-path branch, a raw `#>>` extraction expression: both are `SQLWrapper`. */
3
+ export interface IQueryHandlerOptions<T = unknown> {
4
+ column: SQLWrapper;
6
5
  value: T;
7
6
  }
8
- /**
9
- * Operator-name to SQL-handler table a relational dialect translates with, so a second SQL engine
10
- * swaps the whole table without touching the walk that reaches it. `column` is wider than
11
- * `IQueryHandlerOptions` names it: the JSON-path branch hands handlers a raw `#>>` extraction
12
- * expression, not a `Column`.
13
- */
14
- export type TQueryOperatorHandlers = Record<string, (opts: {
15
- column: AnyType;
16
- value: AnyType;
17
- }) => SQL | undefined>;
7
+ /** Operator-name to SQL-handler table a relational dialect translates with, so a second SQL engine swaps the whole table without touching the walk that reaches it. */
8
+ export type TQueryOperatorHandlers = Record<string, (opts: IQueryHandlerOptions) => SQL | undefined>;
18
9
  //# sourceMappingURL=query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../../../src/base/repositories/common/types/query.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnyType } from '@venizia/ignis-helpers/common';\nimport type { Column, SQL } from 'drizzle-orm';\n\n/** Options passed to query operator handler functions. */\nexport interface IQueryHandlerOptions<T = any> {\n column: Column;\n value: T;\n}\n\n/**\n * Operator-name to SQL-handler table a relational dialect translates with, so a second SQL engine\n * swaps the whole table without touching the walk that reaches it. `column` is wider than\n * `IQueryHandlerOptions` names it: the JSON-path branch hands handlers a raw `#>>` extraction\n * expression, not a `Column`.\n */\nexport type TQueryOperatorHandlers = Record<\n string,\n (opts: { column: AnyType; value: AnyType }) => SQL | undefined\n>;\n"]}
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../../../src/base/repositories/common/types/query.ts"],"names":[],"mappings":"","sourcesContent":["import type { SQL, SQLWrapper } from 'drizzle-orm';\n\n/** Options passed to query operator handler functions. `column` is a `Column` or, on the JSON-path branch, a raw `#>>` extraction expression: both are `SQLWrapper`. */\nexport interface IQueryHandlerOptions<T = unknown> {\n column: SQLWrapper;\n value: T;\n}\n\n/** Operator-name to SQL-handler table a relational dialect translates with, so a second SQL engine swaps the whole table without touching the walk that reaches it. */\nexport type TQueryOperatorHandlers = Record<\n string,\n (opts: IQueryHandlerOptions) => SQL | undefined\n>;\n"]}
@@ -1,8 +1,15 @@
1
1
  import { QuerySchemaFactory } from '@venizia/ignis-filter/schemas';
2
2
  /** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `QuerySchemaFactory.build` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */
3
3
  import { z } from '@hono/zod-openapi';
4
+ import { getError } from '@venizia/ignis-helpers/core';
4
5
  /** The schemas themselves live in `@venizia/ignis-filter`, built with plain `zod` so a browser can use them. Documentation metadata is injected here because it is a server concern - `.openapi()` returns a new schema rather than mutating, and three of the decorations sit on inner nodes, so they cannot be applied after the tree is composed. */
5
6
  const openApiDecorator = (schema, metadata) => {
7
+ // `.openapi` is patched onto the zod prototype this module loaded; a schema from another copy of zod has none.
8
+ if (!(schema instanceof z.ZodType) || typeof Reflect.get(schema, 'openapi') !== 'function') {
9
+ throw getError({
10
+ message: '[openApiDecorator] Only a zod schema carrying .openapi() can take OpenAPI metadata | Pass a schema built with the zod copy @hono/zod-openapi extends',
11
+ });
12
+ }
6
13
  return schema.openapi(metadata);
7
14
  };
8
15
  const schemas = QuerySchemaFactory.build({ decorate: openApiDecorator });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAyB,MAAM,+BAA+B,CAAC;AAE1F,gbAAgb;AAChb,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,wVAAwV;AACxV,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;IAC9D,OAAQ,MAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAEzE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAEjD,6HAA6H;AAC7H,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAEjD,iGAAiG;AACjG,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;AAEvD,sDAAsD;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AAE/C,wDAAwD;AACxD,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAEjD,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEnD,sDAAsD;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;AAE7C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC;IAC1E,WAAW,EAAE,wDAAwD;CACtE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC;IAClF,WAAW,EAAE,mBAAmB;CACjC,CAAC,CAAC","sourcesContent":["import { QuerySchemaFactory, type TSchemaDecorator } from '@venizia/ignis-filter/schemas';\n\n/** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `QuerySchemaFactory.build` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */\nimport { z } from '@hono/zod-openapi';\n\n/** The schemas themselves live in `@venizia/ignis-filter`, built with plain `zod` so a browser can use them. Documentation metadata is injected here because it is a server concern - `.openapi()` returns a new schema rather than mutating, and three of the decorations sit on inner nodes, so they cannot be applied after the tree is composed. */\nconst openApiDecorator: TSchemaDecorator = (schema, metadata) => {\n return (schema as any).openapi(metadata);\n};\n\nconst schemas = QuerySchemaFactory.build({ decorate: openApiDecorator });\n\n/** Selected fields: an array of names to include, or a name-to-boolean map. */\nexport const FieldsSchema = schemas.FieldsSchema;\n\n/** The whole `filter` query: an object of where, fields, include, order, limit, offset and skip, or a JSON string of one. */\nexport const FilterSchema = schemas.FilterSchema;\n\n/** Relations to include: an array of `{ relation, scope? }` where `scope` is a nested filter. */\nexport const InclusionSchema = schemas.InclusionSchema;\n\n/** Maximum number of rows; a non-negative integer. */\nexport const LimitSchema = schemas.LimitSchema;\n\n/** Number of rows to offset; a non-negative integer. */\nexport const OffsetSchema = schemas.OffsetSchema;\n\n/** Sort order: an array of strings such as `'createdAt ASC'`. */\nexport const OrderBySchema = schemas.OrderBySchema;\n\n/** Number of rows to skip; a non-negative integer. */\nexport const SkipSchema = schemas.SkipSchema;\n\n/** Query conditions, with nested AND/OR. */\nexport const WhereSchema = schemas.WhereSchema;\n\n/**\n * The query shape of a route that accepts a `filter`. The framework's own `find`, `findById` and\n * `findOne` use it, and a hand-written route gets the same contract by naming it.\n *\n * `filter` needs no `.optional()` at the call site - {@link FilterSchema} already carries one, so a\n * second is a no-op and so is a trailing `.partial()`.\n *\n * Extend it rather than rebuilding it when a route takes more than `filter`:\n * `FilterQuerySchema.extend({ q: z.string().optional() })`.\n */\nexport const FilterQuerySchema = z.object({ filter: FilterSchema }).openapi({\n description: 'Filter with where, fields, limit, skip, order, include',\n});\n\n/**\n * The query shape of a route that accepts conditions and nothing else - `count` and anything shaped\n * like it. `where` is OPTIONAL here.\n *\n * `updateBy` and `deleteBy` deliberately do not use this. Their `where` is optional in the query\n * because it may ride in the body instead; the handler refuses a request that carries it in neither\n * place - a missing one there rewrites or deletes every row in the table.\n */\nexport const WhereQuerySchema = z.object({ where: WhereSchema.optional() }).openapi({\n description: 'Filter conditions',\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAyB,MAAM,+BAA+B,CAAC;AAE1F,gbAAgb;AAChb,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,wVAAwV;AACxV,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;IAC9D,+GAA+G;IAC/G,IAAI,CAAC,CAAC,MAAM,YAAY,CAAC,CAAC,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,UAAU,EAAE,CAAC;QAC3F,MAAM,QAAQ,CAAC;YACb,OAAO,EACL,sJAAsJ;SACzJ,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAEzE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAEjD,6HAA6H;AAC7H,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAEjD,iGAAiG;AACjG,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;AAEvD,sDAAsD;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AAE/C,wDAAwD;AACxD,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAEjD,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEnD,sDAAsD;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;AAE7C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC;IAC1E,WAAW,EAAE,wDAAwD;CACtE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC;IAClF,WAAW,EAAE,mBAAmB;CACjC,CAAC,CAAC","sourcesContent":["import { QuerySchemaFactory, type TSchemaDecorator } from '@venizia/ignis-filter/schemas';\n\n/** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `QuerySchemaFactory.build` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */\nimport { z } from '@hono/zod-openapi';\nimport { getError } from '@venizia/ignis-helpers/core';\n\n/** The schemas themselves live in `@venizia/ignis-filter`, built with plain `zod` so a browser can use them. Documentation metadata is injected here because it is a server concern - `.openapi()` returns a new schema rather than mutating, and three of the decorations sit on inner nodes, so they cannot be applied after the tree is composed. */\nconst openApiDecorator: TSchemaDecorator = (schema, metadata) => {\n // `.openapi` is patched onto the zod prototype this module loaded; a schema from another copy of zod has none.\n if (!(schema instanceof z.ZodType) || typeof Reflect.get(schema, 'openapi') !== 'function') {\n throw getError({\n message:\n '[openApiDecorator] Only a zod schema carrying .openapi() can take OpenAPI metadata | Pass a schema built with the zod copy @hono/zod-openapi extends',\n });\n }\n\n return schema.openapi(metadata);\n};\n\nconst schemas = QuerySchemaFactory.build({ decorate: openApiDecorator });\n\n/** Selected fields: an array of names to include, or a name-to-boolean map. */\nexport const FieldsSchema = schemas.FieldsSchema;\n\n/** The whole `filter` query: an object of where, fields, include, order, limit, offset and skip, or a JSON string of one. */\nexport const FilterSchema = schemas.FilterSchema;\n\n/** Relations to include: an array of `{ relation, scope? }` where `scope` is a nested filter. */\nexport const InclusionSchema = schemas.InclusionSchema;\n\n/** Maximum number of rows; a non-negative integer. */\nexport const LimitSchema = schemas.LimitSchema;\n\n/** Number of rows to offset; a non-negative integer. */\nexport const OffsetSchema = schemas.OffsetSchema;\n\n/** Sort order: an array of strings such as `'createdAt ASC'`. */\nexport const OrderBySchema = schemas.OrderBySchema;\n\n/** Number of rows to skip; a non-negative integer. */\nexport const SkipSchema = schemas.SkipSchema;\n\n/** Query conditions, with nested AND/OR. */\nexport const WhereSchema = schemas.WhereSchema;\n\n/**\n * The query shape of a route that accepts a `filter`. The framework's own `find`, `findById` and\n * `findOne` use it, and a hand-written route gets the same contract by naming it.\n *\n * `filter` needs no `.optional()` at the call site - {@link FilterSchema} already carries one, so a\n * second is a no-op and so is a trailing `.partial()`.\n *\n * Extend it rather than rebuilding it when a route takes more than `filter`:\n * `FilterQuerySchema.extend({ q: z.string().optional() })`.\n */\nexport const FilterQuerySchema = z.object({ filter: FilterSchema }).openapi({\n description: 'Filter with where, fields, limit, skip, order, include',\n});\n\n/**\n * The query shape of a route that accepts conditions and nothing else - `count` and anything shaped\n * like it. `where` is OPTIONAL here.\n *\n * `updateBy` and `deleteBy` deliberately do not use this. Their `where` is optional in the query\n * because it may ride in the body instead; the handler refuses a request that carries it in neither\n * place - a missing one there rewrites or deletes every row in the table.\n */\nexport const WhereQuerySchema = z.object({ where: WhereSchema.optional() }).openapi({\n description: 'Filter conditions',\n});\n"]}
@@ -7,7 +7,7 @@ export interface IModelAuthorizeSettings {
7
7
  /** The authorization principal name (resource/subject) for this model. */
8
8
  principal: string;
9
9
  /** Extensible - consumers can add any extra authorization metadata. */
10
- [extra: string | symbol]: any;
10
+ [extra: string | symbol]: unknown;
11
11
  }
12
12
  /** What a restricted caller may write to the scope columns (`@model` settings.access.write). */
13
13
  export interface IModelAccessWriteSettings {
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/model.ts"],"names":[],"mappings":"","sourcesContent":["import type { AbstractEntity, TModelType } from '@/base/models';\nimport type {\n ScopeFilters,\n ScopeThrough,\n TFilter,\n TScopeFilterMissingBehavior,\n TScopeOperation,\n TScopeWriteGuard,\n TWhere,\n} from '@/base/repositories';\nimport type { TClass, TNullable, TValueOrResolver } from '@venizia/ignis-helpers/common';\nimport type { IArtifactRegistrationOptions } from './artifact';\n\n/** The `authorize` settings of a model. */\nexport interface IModelAuthorizeSettings {\n /** The authorization principal name (resource/subject) for this model. */\n principal: string;\n /** Extensible - consumers can add any extra authorization metadata. */\n [extra: string | symbol]: any;\n}\n\n/** What a restricted caller may write to the scope columns (`@model` settings.access.write). */\nexport interface IModelAccessWriteSettings {\n /**\n * What a create, createAll or an update payload that names a scope column does when its value\n * disagrees with the resolved scope. `reject` refuses the write and writes nothing - for\n * `createAll` not even the valid rows. `assign` also fills a scope column that is ABSENT from a\n * created row, when the scope is a single equality; a value that is present and disagrees is\n * still refused.\n *\n * The scope's columns and allowed values are read from the resolved `where` (equality, `eq`, `inq`\n * and arrays, `and`, and an `or` over one column). Any other shape cannot be checked, and the write\n * is refused with its own message - never skipped. `ScopeFilters.UNRESTRICTED` bypasses the guard\n * too, which is the deliberate way to write across scopes (system scope, an admin role).\n *\n * Not checked: an update that does not name the scope column (the row was already selected through\n * the scoped `where`), and raw statements that bypass the repository.\n *\n * @default 'reject'\n */\n mode?: TScopeWriteGuard;\n\n /**\n * `true` lets a restricted caller write `null` to a scope column, or leave it out on create: the\n * row has no owner and is shared. Without it, `null` is refused like any other value\n * outside the scope, even when the resolved scope has a `null` branch (that branch lets the caller\n * READ shared rows, a separate permission). Reads are scoped as before.\n *\n * @default false\n */\n sharedRows?: boolean;\n}\n\n/**\n * Row access for `@model` settings.access - resolved per query, so it can depend on the current\n * request (tenant, org, membership). Framework-internal escape hatches aside, nothing short of\n * removing this setting from the model turns scoping off.\n *\n * @example\n * ```typescript\n * import { model, ScopeWriteGuards } from '@venizia/ignis';\n * import { ModelFactory } from '@venizia/ignis-connectors/postgres';\n * import { pgTable, serial, text } from 'drizzle-orm/pg-core';\n *\n * const productTable = pgTable('Product', { id: serial('id').primaryKey(), merchantId: text('merchant_id') });\n *\n * export @model({ settings: { access: {\n * resolve: () => ({ merchantId: 'm-1' }),\n * write: { mode: ScopeWriteGuards.ASSIGN },\n * } } })\n * class Product extends ModelFactory.defineEntity({ table: productTable }) {}\n * ```\n */\nexport interface IModelAccessSettings {\n /** A model declares a resolver or a `through`, never both. */\n through?: never;\n\n /**\n * Returns the scope `where`; `ScopeFilters.UNRESTRICTED` to apply no scope for THIS call (an\n * internal operator, a caller the application has decided sees everything); or null/undefined\n * when this caller's scope cannot be determined at all.\n *\n * Receives `{ operation }`: the one concrete operation the call performs (`ScopeOperations.READ`,\n * `CREATE`, `UPDATE` or `DELETE`, never a group), so one function can answer a wide scope for a\n * read and a narrow one for a write. A read, and an included relation, pass `READ`; a create passes\n * `CREATE`; an update passes `UPDATE` for the payload check and for choosing the rows to update; a\n * delete, a soft delete included, passes `DELETE` for both; a restore passes `UPDATE`. A read with a\n * row `lock` passes `READ`. A resolver that takes no argument keeps working. An `or` over different\n * columns is still refused on a write, so return the narrow scope for a write operation.\n */\n resolve: (context: {\n operation: TScopeOperation;\n }) => TNullable<TWhere> | typeof ScopeFilters.UNRESTRICTED;\n\n /**\n * What `applyScopeFilter` does when `resolve()` returns null/undefined - no request context, no\n * tenant, a background job. With `deny`, an unresolved scope matches zero rows, never\n * every row. `allow` is an explicit, reviewed opt-out for migrations and background jobs, declared\n * per MODEL - it cannot express a per-USER bypass; use `ScopeFilters.UNRESTRICTED` for that.\n *\n * @default 'deny'\n */\n onMissing?: TScopeFilterMissingBehavior;\n\n /**\n * The property names the write guard checks. Optional: with none declared the guard checks every\n * column the resolved scope constrains. When declared, each name must exist on the model (checked\n * at boot), and a resolved scope that constrains any other column is refused as unverifiable.\n */\n columns?: string[];\n\n /** What a restricted caller may write to the scope columns. See {@link IModelAccessWriteSettings}. */\n write?: IModelAccessWriteSettings;\n}\n\n/**\n * Row access for a child model that has no scope columns of its own: it inherits the scope of the parent a `one`\n * relation points at. A parent that resolves no scope always denies the child: `onMissing` is not offered here, because\n * `'allow'` would show the child's rows of every tenant while the parent shows none.\n *\n * @example\n * ```typescript\n * import { model, ScopeThrough } from '@venizia/ignis';\n * import { ModelFactory, one } from '@venizia/ignis-connectors/postgres';\n * import { integer, pgTable, serial } from 'drizzle-orm/pg-core';\n * const productTable = pgTable('Product', { id: serial('id').primaryKey() });\n * const variantTable = pgTable('Variant', {\n * id: serial('id').primaryKey(),\n * productId: integer('product_id').references(() => productTable.id),\n * });\n * const VariantBase = ModelFactory.defineEntity({ table: variantTable, relations: () => ({ product: one(productTable) }) });\n * export @model({ settings: { access: { through: ScopeThrough.of({ entity: VariantBase, relation: 'product' }) } } })\n * class Variant extends VariantBase {}\n * ```\n *\n * @example\n * ```typescript\n * // A hand-written entity declares the same relation by hand.\n * import { ScopeThrough } from '@venizia/ignis';\n * import { BaseEntity, one, RelationDeclarations } from '@venizia/ignis-connectors/postgres';\n * import { integer, pgTable, serial } from 'drizzle-orm/pg-core';\n * const productTable = pgTable('Product', { id: serial('id').primaryKey() });\n * const variantTable = pgTable('Variant', { id: serial('id').primaryKey(), productId: integer('product_id').references(() => productTable.id) });\n * const relations = { product: one(productTable) };\n * class VariantBase extends BaseEntity<typeof variantTable> {\n * static override schema = variantTable;\n * static readonly relationDefinitions = relations;\n * static override relations = () => RelationDeclarations.toRelationConfigs({ relations });\n * }\n * const through = ScopeThrough.of({ entity: VariantBase, relation: 'product' });\n * ```\n */\nexport interface IModelAccessThroughSettings {\n through: ScopeThrough;\n onMissing?: never;\n resolve?: never;\n columns?: never;\n write?: never;\n}\n\n/** The two shapes of `@model` settings.access: a resolver, or a `through`. */\nexport type TModelAccessSettings = IModelAccessSettings | IModelAccessThroughSettings;\n\n/** What a query runs with when it names nothing (`@model` settings.query). */\nexport interface IModelQuerySettings {\n /** Default filter auto-applied to all repository operations. Bypassable via shouldSkipDefaultFilter. */\n filter?: TFilter;\n\n limit?: {\n /**\n * Row limit when a query omits `limit`. Must be a positive integer.\n *\n * @default DEFAULT_LIMIT\n */\n default?: number;\n\n /**\n * Largest `limit` a CALLER may ask for. Must be a positive integer.\n *\n * Policy, not capacity - the engine's own ceiling sits far above it. The number is chosen so\n * that reaching it means the caller is doing something unusual, and raising it is how a model\n * says so deliberately.\n *\n * @default DEFAULT_MAX_LIMIT\n */\n max?: number;\n };\n}\n\n/** Property groups of `@model` settings. */\nexport interface IModelProperties {\n /** Properties excluded from all query results at SQL level. */\n hidden?: string[];\n\n /**\n * Properties the server fills on every write, which a generated create or update body leaves out.\n *\n * @default AuditFields.SCHEME_SET\n */\n stamped?: ReadonlyArray<string> | ReadonlySet<string>;\n}\n\n/** Per-model settings passed to `@model` as `settings`. */\nexport interface IModelSettings {\n properties?: IModelProperties;\n\n /** Default filter and limits of a query: `filter`, `limit.default`, `limit.max`. */\n query?: IModelQuerySettings;\n\n /**\n * Row access: the scope ANDed into every read and write whose scope is expressible as a filter\n * clause, NOT removable by `shouldSkipDefaultFilter`, and the guard that holds writes to it.\n * Ownership resolved per row or through a polymorphic reference is NOT expressible here - that\n * check is still the application's to perform.\n *\n * Relational repositories only - a search-backed model (Typesense, Meilisearch) never reads\n * this setting, so mirroring a scoped entity into a search index needs its own query-time scope.\n */\n access?: TModelAccessSettings;\n\n /** Authorization settings for this model (principal name, etc.). */\n authorize?: IModelAuthorizeSettings;\n}\n\n/** Whether tooling that reads the model registry should migrate this model (`@model({ migration })`). */\nexport interface IModelMigrationSettings {\n /**\n * `false` marks the model as one a migration tool leaves alone. IGNIS generates no migrations itself.\n *\n * @default true\n */\n use?: boolean;\n}\n\n/** Metadata accepted by `@model`. */\nexport interface IModelMetadata extends IArtifactRegistrationOptions {\n /**\n * `ModelTypes.ENTITY` is the only value.\n *\n * @default ModelTypes.ENTITY\n */\n type?: TModelType;\n tableName?: string;\n\n /** Migration marker for consumer tooling that reads the public registry. */\n migration?: IModelMigrationSettings;\n\n settings?: IModelSettings;\n}\n\n/** Static members an entity class carries: its `schema` and its `relations` (value or resolver). */\nexport interface IEntityStatics {\n schema?: unknown;\n relations?: TValueOrResolver<Array<unknown>>;\n}\n\n/** A model class together with its entity statics. */\nexport type TModelClass<Model extends AbstractEntity = AbstractEntity> = TClass<Model> &\n IEntityStatics;\n\n/** Decorator target for model classes (supports both strongly typed and ClassDecorator patterns). */\nexport type TDecoratorModelTarget<Model extends AbstractEntity = AbstractEntity> =\n | TModelClass<Model>\n | (Function & IEntityStatics);\n\n/** One model as stored in the metadata registry: class, metadata and schema, with lazily resolved relations. */\nexport interface IModelRegistryEntry<Model extends AbstractEntity = AbstractEntity> {\n target: TValueOrResolver<TClass<Model>>;\n metadata: IModelMetadata;\n schema: unknown;\n\n /** Lazy resolver to avoid circular deps. Resolved when DataSource builds schema. */\n relationsResolver?: TValueOrResolver<Array<unknown>>;\n\n /** Cache populated on first buildSchema() call. */\n _builtRelations?: unknown;\n}\n"]}
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/model.ts"],"names":[],"mappings":"","sourcesContent":["import type { AbstractEntity, TModelType } from '@/base/models';\nimport type {\n ScopeFilters,\n ScopeThrough,\n TFilter,\n TScopeFilterMissingBehavior,\n TScopeOperation,\n TScopeWriteGuard,\n TWhere,\n} from '@/base/repositories';\nimport type { TClass, TNullable, TValueOrResolver } from '@venizia/ignis-helpers/common';\nimport type { IArtifactRegistrationOptions } from './artifact';\n\n/** The `authorize` settings of a model. */\nexport interface IModelAuthorizeSettings {\n /** The authorization principal name (resource/subject) for this model. */\n principal: string;\n /** Extensible - consumers can add any extra authorization metadata. */\n [extra: string | symbol]: unknown;\n}\n\n/** What a restricted caller may write to the scope columns (`@model` settings.access.write). */\nexport interface IModelAccessWriteSettings {\n /**\n * What a create, createAll or an update payload that names a scope column does when its value\n * disagrees with the resolved scope. `reject` refuses the write and writes nothing - for\n * `createAll` not even the valid rows. `assign` also fills a scope column that is ABSENT from a\n * created row, when the scope is a single equality; a value that is present and disagrees is\n * still refused.\n *\n * The scope's columns and allowed values are read from the resolved `where` (equality, `eq`, `inq`\n * and arrays, `and`, and an `or` over one column). Any other shape cannot be checked, and the write\n * is refused with its own message - never skipped. `ScopeFilters.UNRESTRICTED` bypasses the guard\n * too, which is the deliberate way to write across scopes (system scope, an admin role).\n *\n * Not checked: an update that does not name the scope column (the row was already selected through\n * the scoped `where`), and raw statements that bypass the repository.\n *\n * @default 'reject'\n */\n mode?: TScopeWriteGuard;\n\n /**\n * `true` lets a restricted caller write `null` to a scope column, or leave it out on create: the\n * row has no owner and is shared. Without it, `null` is refused like any other value\n * outside the scope, even when the resolved scope has a `null` branch (that branch lets the caller\n * READ shared rows, a separate permission). Reads are scoped as before.\n *\n * @default false\n */\n sharedRows?: boolean;\n}\n\n/**\n * Row access for `@model` settings.access - resolved per query, so it can depend on the current\n * request (tenant, org, membership). Framework-internal escape hatches aside, nothing short of\n * removing this setting from the model turns scoping off.\n *\n * @example\n * ```typescript\n * import { model, ScopeWriteGuards } from '@venizia/ignis';\n * import { ModelFactory } from '@venizia/ignis-connectors/postgres';\n * import { pgTable, serial, text } from 'drizzle-orm/pg-core';\n *\n * const productTable = pgTable('Product', { id: serial('id').primaryKey(), merchantId: text('merchant_id') });\n *\n * export @model({ settings: { access: {\n * resolve: () => ({ merchantId: 'm-1' }),\n * write: { mode: ScopeWriteGuards.ASSIGN },\n * } } })\n * class Product extends ModelFactory.defineEntity({ table: productTable }) {}\n * ```\n */\nexport interface IModelAccessSettings {\n /** A model declares a resolver or a `through`, never both. */\n through?: never;\n\n /**\n * Returns the scope `where`; `ScopeFilters.UNRESTRICTED` to apply no scope for THIS call (an\n * internal operator, a caller the application has decided sees everything); or null/undefined\n * when this caller's scope cannot be determined at all.\n *\n * Receives `{ operation }`: the one concrete operation the call performs (`ScopeOperations.READ`,\n * `CREATE`, `UPDATE` or `DELETE`, never a group), so one function can answer a wide scope for a\n * read and a narrow one for a write. A read, and an included relation, pass `READ`; a create passes\n * `CREATE`; an update passes `UPDATE` for the payload check and for choosing the rows to update; a\n * delete, a soft delete included, passes `DELETE` for both; a restore passes `UPDATE`. A read with a\n * row `lock` passes `READ`. A resolver that takes no argument keeps working. An `or` over different\n * columns is still refused on a write, so return the narrow scope for a write operation.\n */\n resolve: (context: {\n operation: TScopeOperation;\n }) => TNullable<TWhere> | typeof ScopeFilters.UNRESTRICTED;\n\n /**\n * What `applyScopeFilter` does when `resolve()` returns null/undefined - no request context, no\n * tenant, a background job. With `deny`, an unresolved scope matches zero rows, never\n * every row. `allow` is an explicit, reviewed opt-out for migrations and background jobs, declared\n * per MODEL - it cannot express a per-USER bypass; use `ScopeFilters.UNRESTRICTED` for that.\n *\n * @default 'deny'\n */\n onMissing?: TScopeFilterMissingBehavior;\n\n /**\n * The property names the write guard checks. Optional: with none declared the guard checks every\n * column the resolved scope constrains. When declared, each name must exist on the model (checked\n * at boot), and a resolved scope that constrains any other column is refused as unverifiable.\n */\n columns?: string[];\n\n /** What a restricted caller may write to the scope columns. See {@link IModelAccessWriteSettings}. */\n write?: IModelAccessWriteSettings;\n}\n\n/**\n * Row access for a child model that has no scope columns of its own: it inherits the scope of the parent a `one`\n * relation points at. A parent that resolves no scope always denies the child: `onMissing` is not offered here, because\n * `'allow'` would show the child's rows of every tenant while the parent shows none.\n *\n * @example\n * ```typescript\n * import { model, ScopeThrough } from '@venizia/ignis';\n * import { ModelFactory, one } from '@venizia/ignis-connectors/postgres';\n * import { integer, pgTable, serial } from 'drizzle-orm/pg-core';\n * const productTable = pgTable('Product', { id: serial('id').primaryKey() });\n * const variantTable = pgTable('Variant', {\n * id: serial('id').primaryKey(),\n * productId: integer('product_id').references(() => productTable.id),\n * });\n * const VariantBase = ModelFactory.defineEntity({ table: variantTable, relations: () => ({ product: one(productTable) }) });\n * export @model({ settings: { access: { through: ScopeThrough.of({ entity: VariantBase, relation: 'product' }) } } })\n * class Variant extends VariantBase {}\n * ```\n *\n * @example\n * ```typescript\n * // A hand-written entity declares the same relation by hand.\n * import { ScopeThrough } from '@venizia/ignis';\n * import { BaseEntity, one, RelationDeclarations } from '@venizia/ignis-connectors/postgres';\n * import { integer, pgTable, serial } from 'drizzle-orm/pg-core';\n * const productTable = pgTable('Product', { id: serial('id').primaryKey() });\n * const variantTable = pgTable('Variant', { id: serial('id').primaryKey(), productId: integer('product_id').references(() => productTable.id) });\n * const relations = { product: one(productTable) };\n * class VariantBase extends BaseEntity<typeof variantTable> {\n * static override schema = variantTable;\n * static readonly relationDefinitions = relations;\n * static override relations = () => RelationDeclarations.toRelationConfigs({ relations });\n * }\n * const through = ScopeThrough.of({ entity: VariantBase, relation: 'product' });\n * ```\n */\nexport interface IModelAccessThroughSettings {\n through: ScopeThrough;\n onMissing?: never;\n resolve?: never;\n columns?: never;\n write?: never;\n}\n\n/** The two shapes of `@model` settings.access: a resolver, or a `through`. */\nexport type TModelAccessSettings = IModelAccessSettings | IModelAccessThroughSettings;\n\n/** What a query runs with when it names nothing (`@model` settings.query). */\nexport interface IModelQuerySettings {\n /** Default filter auto-applied to all repository operations. Bypassable via shouldSkipDefaultFilter. */\n filter?: TFilter;\n\n limit?: {\n /**\n * Row limit when a query omits `limit`. Must be a positive integer.\n *\n * @default DEFAULT_LIMIT\n */\n default?: number;\n\n /**\n * Largest `limit` a CALLER may ask for. Must be a positive integer.\n *\n * Policy, not capacity - the engine's own ceiling sits far above it. The number is chosen so\n * that reaching it means the caller is doing something unusual, and raising it is how a model\n * says so deliberately.\n *\n * @default DEFAULT_MAX_LIMIT\n */\n max?: number;\n };\n}\n\n/** Property groups of `@model` settings. */\nexport interface IModelProperties {\n /** Properties excluded from all query results at SQL level. */\n hidden?: string[];\n\n /**\n * Properties the server fills on every write, which a generated create or update body leaves out.\n *\n * @default AuditFields.SCHEME_SET\n */\n stamped?: ReadonlyArray<string> | ReadonlySet<string>;\n}\n\n/** Per-model settings passed to `@model` as `settings`. */\nexport interface IModelSettings {\n properties?: IModelProperties;\n\n /** Default filter and limits of a query: `filter`, `limit.default`, `limit.max`. */\n query?: IModelQuerySettings;\n\n /**\n * Row access: the scope ANDed into every read and write whose scope is expressible as a filter\n * clause, NOT removable by `shouldSkipDefaultFilter`, and the guard that holds writes to it.\n * Ownership resolved per row or through a polymorphic reference is NOT expressible here - that\n * check is still the application's to perform.\n *\n * Relational repositories only - a search-backed model (Typesense, Meilisearch) never reads\n * this setting, so mirroring a scoped entity into a search index needs its own query-time scope.\n */\n access?: TModelAccessSettings;\n\n /** Authorization settings for this model (principal name, etc.). */\n authorize?: IModelAuthorizeSettings;\n}\n\n/** Whether tooling that reads the model registry should migrate this model (`@model({ migration })`). */\nexport interface IModelMigrationSettings {\n /**\n * `false` marks the model as one a migration tool leaves alone. IGNIS generates no migrations itself.\n *\n * @default true\n */\n use?: boolean;\n}\n\n/** Metadata accepted by `@model`. */\nexport interface IModelMetadata extends IArtifactRegistrationOptions {\n /**\n * `ModelTypes.ENTITY` is the only value.\n *\n * @default ModelTypes.ENTITY\n */\n type?: TModelType;\n tableName?: string;\n\n /** Migration marker for consumer tooling that reads the public registry. */\n migration?: IModelMigrationSettings;\n\n settings?: IModelSettings;\n}\n\n/** Static members an entity class carries: its `schema` and its `relations` (value or resolver). */\nexport interface IEntityStatics {\n schema?: unknown;\n relations?: TValueOrResolver<Array<unknown>>;\n}\n\n/** A model class together with its entity statics. */\nexport type TModelClass<Model extends AbstractEntity = AbstractEntity> = TClass<Model> &\n IEntityStatics;\n\n/** Decorator target for model classes (supports both strongly typed and ClassDecorator patterns). */\nexport type TDecoratorModelTarget<Model extends AbstractEntity = AbstractEntity> =\n | TModelClass<Model>\n | (Function & IEntityStatics);\n\n/** One model as stored in the metadata registry: class, metadata and schema, with lazily resolved relations. */\nexport interface IModelRegistryEntry<Model extends AbstractEntity = AbstractEntity> {\n target: TValueOrResolver<TClass<Model>>;\n metadata: IModelMetadata;\n schema: unknown;\n\n /** Lazy resolver to avoid circular deps. Resolved when DataSource builds schema. */\n relationsResolver?: TValueOrResolver<Array<unknown>>;\n\n /** Cache populated on first buildSchema() call. */\n _builtRelations?: unknown;\n}\n"]}
@@ -26,12 +26,12 @@ export declare const ArtifactMetadataMixin: <BaseClass extends TMixinTarget<_Met
26
26
  getProvideMetadata<Target extends object = object>(opts: {
27
27
  target: Target;
28
28
  }): IProvideMetadata[];
29
- define: <Target extends object = object, Value = any>(opts: {
29
+ define: <Target extends object = object, Value = unknown>(opts: {
30
30
  target: Target;
31
31
  key: import("@venizia/ignis-inversion").TBindingKey;
32
32
  value: Value;
33
33
  }) => void;
34
- get: <Target extends object = object, Value_1 = any>(opts: {
34
+ get: <Target extends object = object, Value_1 = unknown>(opts: {
35
35
  target: Target;
36
36
  key: import("@venizia/ignis-inversion").TBindingKey;
37
37
  }) => Value_1 | undefined;
@@ -46,7 +46,7 @@ export declare const ArtifactMetadataMixin: <BaseClass extends TMixinTarget<_Met
46
46
  getKeys: <Target extends object = object>(opts: {
47
47
  target: Target;
48
48
  }) => import("@venizia/ignis-inversion").TBindingKey[];
49
- getMethodNames: <T = any>(opts: {
49
+ getMethodNames: <T = unknown>(opts: {
50
50
  target: import("@venizia/ignis-inversion").TClass<T>;
51
51
  }) => string[];
52
52
  clearMetadata: <T extends object = object>(opts: {
@@ -17,12 +17,12 @@ export declare const ControllerMetadataMixin: <BaseClass extends TMixinTarget<_M
17
17
  getGrpcControllerMetadata<Target extends object = object>(opts: {
18
18
  target: Target;
19
19
  }): IGrpcControllerMetadata | undefined;
20
- define: <Target extends object = object, Value = any>(opts: {
20
+ define: <Target extends object = object, Value = unknown>(opts: {
21
21
  target: Target;
22
22
  key: import("@venizia/ignis-inversion").TBindingKey;
23
23
  value: Value;
24
24
  }) => void;
25
- get: <Target extends object = object, Value_1 = any>(opts: {
25
+ get: <Target extends object = object, Value_1 = unknown>(opts: {
26
26
  target: Target;
27
27
  key: import("@venizia/ignis-inversion").TBindingKey;
28
28
  }) => Value_1 | undefined;
@@ -37,7 +37,7 @@ export declare const ControllerMetadataMixin: <BaseClass extends TMixinTarget<_M
37
37
  getKeys: <Target extends object = object>(opts: {
38
38
  target: Target;
39
39
  }) => import("@venizia/ignis-inversion").TBindingKey[];
40
- getMethodNames: <T = any>(opts: {
40
+ getMethodNames: <T = unknown>(opts: {
41
41
  target: import("@venizia/ignis-inversion").TClass<T>;
42
42
  }) => string[];
43
43
  clearMetadata: <T extends object = object>(opts: {
@@ -19,12 +19,12 @@ export declare const GrpcControllerMetadataMixin: <BaseClass extends TMixinTarge
19
19
  hasRpcs<Target extends object = object>(opts: {
20
20
  target: Target;
21
21
  }): boolean;
22
- define: <Target extends object = object, Value = any>(opts: {
22
+ define: <Target extends object = object, Value = unknown>(opts: {
23
23
  target: Target;
24
24
  key: import("@venizia/ignis-inversion").TBindingKey;
25
25
  value: Value;
26
26
  }) => void;
27
- get: <Target extends object = object, Value_1 = any>(opts: {
27
+ get: <Target extends object = object, Value_1 = unknown>(opts: {
28
28
  target: Target;
29
29
  key: import("@venizia/ignis-inversion").TBindingKey;
30
30
  }) => Value_1 | undefined;
@@ -39,7 +39,7 @@ export declare const GrpcControllerMetadataMixin: <BaseClass extends TMixinTarge
39
39
  getKeys: <Target extends object = object>(opts: {
40
40
  target: Target;
41
41
  }) => import("@venizia/ignis-inversion").TBindingKey[];
42
- getMethodNames: <T = any>(opts: {
42
+ getMethodNames: <T = unknown>(opts: {
43
43
  target: import("@venizia/ignis-inversion").TClass<T>;
44
44
  }) => string[];
45
45
  clearMetadata: <T extends object = object>(opts: {
@@ -19,12 +19,12 @@ export declare const RestControllerMetadataMixin: <BaseClass extends TMixinTarge
19
19
  methodName: string | symbol;
20
20
  configs: IAuthRouteConfig;
21
21
  }): void;
22
- define: <Target extends object = object, Value = any>(opts: {
22
+ define: <Target extends object = object, Value = unknown>(opts: {
23
23
  target: Target;
24
24
  key: import("@venizia/ignis-inversion").TBindingKey;
25
25
  value: Value;
26
26
  }) => void;
27
- get: <Target extends object = object, Value_1 = any>(opts: {
27
+ get: <Target extends object = object, Value_1 = unknown>(opts: {
28
28
  target: Target;
29
29
  key: import("@venizia/ignis-inversion").TBindingKey;
30
30
  }) => Value_1 | undefined;
@@ -39,7 +39,7 @@ export declare const RestControllerMetadataMixin: <BaseClass extends TMixinTarge
39
39
  getKeys: <Target extends object = object>(opts: {
40
40
  target: Target;
41
41
  }) => import("@venizia/ignis-inversion").TBindingKey[];
42
- getMethodNames: <T = any>(opts: {
42
+ getMethodNames: <T = unknown>(opts: {
43
43
  target: import("@venizia/ignis-inversion").TClass<T>;
44
44
  }) => string[];
45
45
  clearMetadata: <T extends object = object>(opts: {
@@ -11,12 +11,12 @@ export declare const DatasourceMetadataMixin: <BaseClass extends TMixinTarget<_M
11
11
  getDataSourceMetadata<Target extends object = object>(opts: {
12
12
  target: Target;
13
13
  }): IDataSourceMetadata | undefined;
14
- define: <Target extends object = object, Value = any>(opts: {
14
+ define: <Target extends object = object, Value = unknown>(opts: {
15
15
  target: Target;
16
16
  key: import("@venizia/ignis-inversion").TBindingKey;
17
17
  value: Value;
18
18
  }) => void;
19
- get: <Target extends object = object, Value_1 = any>(opts: {
19
+ get: <Target extends object = object, Value_1 = unknown>(opts: {
20
20
  target: Target;
21
21
  key: import("@venizia/ignis-inversion").TBindingKey;
22
22
  }) => Value_1 | undefined;
@@ -31,7 +31,7 @@ export declare const DatasourceMetadataMixin: <BaseClass extends TMixinTarget<_M
31
31
  getKeys: <Target extends object = object>(opts: {
32
32
  target: Target;
33
33
  }) => import("@venizia/ignis-inversion").TBindingKey[];
34
- getMethodNames: <T = any>(opts: {
34
+ getMethodNames: <T = unknown>(opts: {
35
35
  target: import("@venizia/ignis-inversion").TClass<T>;
36
36
  }) => string[];
37
37
  clearMetadata: <T extends object = object>(opts: {
@@ -50,12 +50,12 @@ export declare const ModelMetadataMixin: <BaseClass extends TMixinTarget<_Metada
50
50
  authorize: IModelAuthorizeSettings;
51
51
  entry: IModelRegistryEntry;
52
52
  }>;
53
- define: <Target extends object = object, Value = any>(opts: {
53
+ define: <Target extends object = object, Value = unknown>(opts: {
54
54
  target: Target;
55
55
  key: import("@venizia/ignis-inversion").TBindingKey;
56
56
  value: Value;
57
57
  }) => void;
58
- get: <Target extends object = object, Value_1 = any>(opts: {
58
+ get: <Target extends object = object, Value_1 = unknown>(opts: {
59
59
  target: Target;
60
60
  key: import("@venizia/ignis-inversion").TBindingKey;
61
61
  }) => Value_1 | undefined;
@@ -70,7 +70,7 @@ export declare const ModelMetadataMixin: <BaseClass extends TMixinTarget<_Metada
70
70
  getKeys: <Target extends object = object>(opts: {
71
71
  target: Target;
72
72
  }) => import("@venizia/ignis-inversion").TBindingKey[];
73
- getMethodNames: <T = any>(opts: {
73
+ getMethodNames: <T = unknown>(opts: {
74
74
  target: import("@venizia/ignis-inversion").TClass<T>;
75
75
  }) => string[];
76
76
  clearMetadata: <T extends object = object>(opts: {