@venizia/ignis-kernel 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/cjs/base/applications/common/constants.d.ts +9 -0
  2. package/dist/cjs/base/applications/common/constants.d.ts.map +1 -1
  3. package/dist/cjs/base/applications/common/constants.js +11 -1
  4. package/dist/cjs/base/applications/common/constants.js.map +1 -1
  5. package/dist/cjs/base/applications/common/types/middlewares.d.ts +2 -2
  6. package/dist/cjs/base/applications/common/types/middlewares.d.ts.map +1 -1
  7. package/dist/cjs/base/applications/common/types/middlewares.js.map +1 -1
  8. package/dist/cjs/base/applications/cors.d.ts +13 -0
  9. package/dist/cjs/base/applications/cors.d.ts.map +1 -0
  10. package/dist/cjs/base/applications/cors.js +43 -0
  11. package/dist/cjs/base/applications/cors.js.map +1 -0
  12. package/dist/cjs/base/applications/deprecations.d.ts +10 -0
  13. package/dist/cjs/base/applications/deprecations.d.ts.map +1 -0
  14. package/dist/cjs/base/applications/deprecations.js +23 -0
  15. package/dist/cjs/base/applications/deprecations.js.map +1 -0
  16. package/dist/cjs/base/applications/rest.d.ts.map +1 -1
  17. package/dist/cjs/base/applications/rest.js +6 -0
  18. package/dist/cjs/base/applications/rest.js.map +1 -1
  19. package/dist/cjs/base/auth/authenticate/common/constants/jose.d.ts +10 -0
  20. package/dist/cjs/base/auth/authenticate/common/constants/jose.d.ts.map +1 -1
  21. package/dist/cjs/base/auth/authenticate/common/constants/jose.js +12 -1
  22. package/dist/cjs/base/auth/authenticate/common/constants/jose.js.map +1 -1
  23. package/dist/cjs/base/auth/authenticate/common/types/jwt.d.ts +1 -2
  24. package/dist/cjs/base/auth/authenticate/common/types/jwt.d.ts.map +1 -1
  25. package/dist/cjs/base/auth/authenticate/common/types/jwt.js.map +1 -1
  26. package/dist/cjs/base/auth/authorize/common/constants/authorization.d.ts +11 -0
  27. package/dist/cjs/base/auth/authorize/common/constants/authorization.d.ts.map +1 -1
  28. package/dist/cjs/base/auth/authorize/common/constants/authorization.js +13 -1
  29. package/dist/cjs/base/auth/authorize/common/constants/authorization.js.map +1 -1
  30. package/dist/cjs/base/auth/authorize/common/types/request.d.ts +2 -1
  31. package/dist/cjs/base/auth/authorize/common/types/request.d.ts.map +1 -1
  32. package/dist/cjs/base/auth/authorize/common/types/request.js.map +1 -1
  33. package/dist/cjs/base/auth/authorize/providers/request-domain.js +4 -4
  34. package/dist/cjs/base/auth/authorize/providers/request-domain.js.map +1 -1
  35. package/dist/cjs/base/controllers/common/constants.d.ts +10 -0
  36. package/dist/cjs/base/controllers/common/constants.d.ts.map +1 -1
  37. package/dist/cjs/base/controllers/common/constants.js +12 -1
  38. package/dist/cjs/base/controllers/common/constants.js.map +1 -1
  39. package/dist/cjs/base/controllers/factory/authorize-guard.d.ts +19 -0
  40. package/dist/cjs/base/controllers/factory/authorize-guard.d.ts.map +1 -0
  41. package/dist/cjs/base/controllers/factory/authorize-guard.js +60 -0
  42. package/dist/cjs/base/controllers/factory/authorize-guard.js.map +1 -0
  43. package/dist/cjs/base/controllers/factory/controller.d.ts +1 -1
  44. package/dist/cjs/base/controllers/factory/controller.d.ts.map +1 -1
  45. package/dist/cjs/base/controllers/factory/controller.js +8 -0
  46. package/dist/cjs/base/controllers/factory/controller.js.map +1 -1
  47. package/dist/cjs/base/controllers/rest/abstract.d.ts +2 -1
  48. package/dist/cjs/base/controllers/rest/abstract.d.ts.map +1 -1
  49. package/dist/cjs/base/controllers/rest/abstract.js +6 -4
  50. package/dist/cjs/base/controllers/rest/abstract.js.map +1 -1
  51. package/dist/cjs/base/metadata/model-metadata.d.ts +17 -0
  52. package/dist/cjs/base/metadata/model-metadata.d.ts.map +1 -0
  53. package/dist/cjs/base/metadata/model-metadata.js +50 -0
  54. package/dist/cjs/base/metadata/model-metadata.js.map +1 -0
  55. package/dist/cjs/base/metadata/model-settings.d.ts +11 -0
  56. package/dist/cjs/base/metadata/model-settings.d.ts.map +1 -0
  57. package/dist/cjs/base/metadata/model-settings.js +34 -0
  58. package/dist/cjs/base/metadata/model-settings.js.map +1 -0
  59. package/dist/cjs/base/metadata/persistents.d.ts +1 -1
  60. package/dist/cjs/base/metadata/persistents.d.ts.map +1 -1
  61. package/dist/cjs/base/metadata/persistents.js +13 -8
  62. package/dist/cjs/base/metadata/persistents.js.map +1 -1
  63. package/dist/cjs/base/models/common/constants.d.ts +17 -0
  64. package/dist/cjs/base/models/common/constants.d.ts.map +1 -1
  65. package/dist/cjs/base/models/common/constants.js +20 -1
  66. package/dist/cjs/base/models/common/constants.js.map +1 -1
  67. package/dist/cjs/base/models/common/schemas.d.ts +1 -1
  68. package/dist/cjs/base/models/common/schemas.d.ts.map +1 -1
  69. package/dist/cjs/base/models/common/schemas.js.map +1 -1
  70. package/dist/cjs/base/models/common/types/id.d.ts +0 -2
  71. package/dist/cjs/base/models/common/types/id.d.ts.map +1 -1
  72. package/dist/cjs/base/models/common/types/id.js.map +1 -1
  73. package/dist/cjs/base/repositories/common/constants.d.ts +18 -1
  74. package/dist/cjs/base/repositories/common/constants.d.ts.map +1 -1
  75. package/dist/cjs/base/repositories/common/constants.js +22 -2
  76. package/dist/cjs/base/repositories/common/constants.js.map +1 -1
  77. package/dist/cjs/base/repositories/core/abstract.d.ts +1 -1
  78. package/dist/cjs/base/repositories/core/abstract.d.ts.map +1 -1
  79. package/dist/cjs/base/repositories/core/abstract.js +4 -4
  80. package/dist/cjs/base/repositories/core/abstract.js.map +1 -1
  81. package/dist/cjs/helpers/inversion/common/constants.d.ts +10 -0
  82. package/dist/cjs/helpers/inversion/common/constants.d.ts.map +1 -1
  83. package/dist/cjs/helpers/inversion/common/constants.js +11 -1
  84. package/dist/cjs/helpers/inversion/common/constants.js.map +1 -1
  85. package/dist/cjs/helpers/inversion/common/types/model.d.ts +85 -25
  86. package/dist/cjs/helpers/inversion/common/types/model.d.ts.map +1 -1
  87. package/dist/cjs/helpers/inversion/common/types/model.js.map +1 -1
  88. package/dist/cjs/helpers/inversion/mixins/model.mixin.d.ts +5 -4
  89. package/dist/cjs/helpers/inversion/mixins/model.mixin.d.ts.map +1 -1
  90. package/dist/cjs/helpers/inversion/mixins/model.mixin.js +5 -4
  91. package/dist/cjs/helpers/inversion/mixins/model.mixin.js.map +1 -1
  92. package/dist/esm/base/applications/common/constants.d.ts +9 -0
  93. package/dist/esm/base/applications/common/constants.d.ts.map +1 -1
  94. package/dist/esm/base/applications/common/constants.js +9 -0
  95. package/dist/esm/base/applications/common/constants.js.map +1 -1
  96. package/dist/esm/base/applications/common/types/middlewares.d.ts +2 -2
  97. package/dist/esm/base/applications/common/types/middlewares.d.ts.map +1 -1
  98. package/dist/esm/base/applications/common/types/middlewares.js.map +1 -1
  99. package/dist/esm/base/applications/cors.d.ts +13 -0
  100. package/dist/esm/base/applications/cors.d.ts.map +1 -0
  101. package/dist/esm/base/applications/cors.js +39 -0
  102. package/dist/esm/base/applications/cors.js.map +1 -0
  103. package/dist/esm/base/applications/deprecations.d.ts +10 -0
  104. package/dist/esm/base/applications/deprecations.d.ts.map +1 -0
  105. package/dist/esm/base/applications/deprecations.js +19 -0
  106. package/dist/esm/base/applications/deprecations.js.map +1 -0
  107. package/dist/esm/base/applications/rest.d.ts.map +1 -1
  108. package/dist/esm/base/applications/rest.js +6 -0
  109. package/dist/esm/base/applications/rest.js.map +1 -1
  110. package/dist/esm/base/auth/authenticate/common/constants/jose.d.ts +10 -0
  111. package/dist/esm/base/auth/authenticate/common/constants/jose.d.ts.map +1 -1
  112. package/dist/esm/base/auth/authenticate/common/constants/jose.js +10 -0
  113. package/dist/esm/base/auth/authenticate/common/constants/jose.js.map +1 -1
  114. package/dist/esm/base/auth/authenticate/common/types/jwt.d.ts +1 -2
  115. package/dist/esm/base/auth/authenticate/common/types/jwt.d.ts.map +1 -1
  116. package/dist/esm/base/auth/authenticate/common/types/jwt.js.map +1 -1
  117. package/dist/esm/base/auth/authorize/common/constants/authorization.d.ts +11 -0
  118. package/dist/esm/base/auth/authorize/common/constants/authorization.d.ts.map +1 -1
  119. package/dist/esm/base/auth/authorize/common/constants/authorization.js +11 -0
  120. package/dist/esm/base/auth/authorize/common/constants/authorization.js.map +1 -1
  121. package/dist/esm/base/auth/authorize/common/types/request.d.ts +2 -1
  122. package/dist/esm/base/auth/authorize/common/types/request.d.ts.map +1 -1
  123. package/dist/esm/base/auth/authorize/common/types/request.js.map +1 -1
  124. package/dist/esm/base/auth/authorize/providers/request-domain.js +5 -5
  125. package/dist/esm/base/auth/authorize/providers/request-domain.js.map +1 -1
  126. package/dist/esm/base/controllers/common/constants.d.ts +10 -0
  127. package/dist/esm/base/controllers/common/constants.d.ts.map +1 -1
  128. package/dist/esm/base/controllers/common/constants.js +10 -0
  129. package/dist/esm/base/controllers/common/constants.js.map +1 -1
  130. package/dist/esm/base/controllers/factory/authorize-guard.d.ts +19 -0
  131. package/dist/esm/base/controllers/factory/authorize-guard.d.ts.map +1 -0
  132. package/dist/esm/base/controllers/factory/authorize-guard.js +56 -0
  133. package/dist/esm/base/controllers/factory/authorize-guard.js.map +1 -0
  134. package/dist/esm/base/controllers/factory/controller.d.ts +1 -1
  135. package/dist/esm/base/controllers/factory/controller.d.ts.map +1 -1
  136. package/dist/esm/base/controllers/factory/controller.js +8 -0
  137. package/dist/esm/base/controllers/factory/controller.js.map +1 -1
  138. package/dist/esm/base/controllers/rest/abstract.d.ts +2 -1
  139. package/dist/esm/base/controllers/rest/abstract.d.ts.map +1 -1
  140. package/dist/esm/base/controllers/rest/abstract.js +6 -4
  141. package/dist/esm/base/controllers/rest/abstract.js.map +1 -1
  142. package/dist/esm/base/metadata/model-metadata.d.ts +17 -0
  143. package/dist/esm/base/metadata/model-metadata.d.ts.map +1 -0
  144. package/dist/esm/base/metadata/model-metadata.js +46 -0
  145. package/dist/esm/base/metadata/model-metadata.js.map +1 -0
  146. package/dist/esm/base/metadata/model-settings.d.ts +11 -0
  147. package/dist/esm/base/metadata/model-settings.d.ts.map +1 -0
  148. package/dist/esm/base/metadata/model-settings.js +30 -0
  149. package/dist/esm/base/metadata/model-settings.js.map +1 -0
  150. package/dist/esm/base/metadata/persistents.d.ts +1 -1
  151. package/dist/esm/base/metadata/persistents.d.ts.map +1 -1
  152. package/dist/esm/base/metadata/persistents.js +13 -8
  153. package/dist/esm/base/metadata/persistents.js.map +1 -1
  154. package/dist/esm/base/models/common/constants.d.ts +17 -0
  155. package/dist/esm/base/models/common/constants.d.ts.map +1 -1
  156. package/dist/esm/base/models/common/constants.js +17 -0
  157. package/dist/esm/base/models/common/constants.js.map +1 -1
  158. package/dist/esm/base/models/common/schemas.d.ts +1 -1
  159. package/dist/esm/base/models/common/schemas.d.ts.map +1 -1
  160. package/dist/esm/base/models/common/schemas.js.map +1 -1
  161. package/dist/esm/base/models/common/types/id.d.ts +0 -2
  162. package/dist/esm/base/models/common/types/id.d.ts.map +1 -1
  163. package/dist/esm/base/models/common/types/id.js.map +1 -1
  164. package/dist/esm/base/repositories/common/constants.d.ts +18 -1
  165. package/dist/esm/base/repositories/common/constants.d.ts.map +1 -1
  166. package/dist/esm/base/repositories/common/constants.js +20 -1
  167. package/dist/esm/base/repositories/common/constants.js.map +1 -1
  168. package/dist/esm/base/repositories/core/abstract.d.ts +1 -1
  169. package/dist/esm/base/repositories/core/abstract.d.ts.map +1 -1
  170. package/dist/esm/base/repositories/core/abstract.js +4 -4
  171. package/dist/esm/base/repositories/core/abstract.js.map +1 -1
  172. package/dist/esm/helpers/inversion/common/constants.d.ts +10 -0
  173. package/dist/esm/helpers/inversion/common/constants.d.ts.map +1 -1
  174. package/dist/esm/helpers/inversion/common/constants.js +9 -0
  175. package/dist/esm/helpers/inversion/common/constants.js.map +1 -1
  176. package/dist/esm/helpers/inversion/common/types/model.d.ts +85 -25
  177. package/dist/esm/helpers/inversion/common/types/model.d.ts.map +1 -1
  178. package/dist/esm/helpers/inversion/common/types/model.js.map +1 -1
  179. package/dist/esm/helpers/inversion/mixins/model.mixin.d.ts +5 -4
  180. package/dist/esm/helpers/inversion/mixins/model.mixin.d.ts.map +1 -1
  181. package/dist/esm/helpers/inversion/mixins/model.mixin.js +5 -4
  182. package/dist/esm/helpers/inversion/mixins/model.mixin.js.map +1 -1
  183. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../../../src/base/repositories/core/abstract.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAYpG,sGAAsG;AACtG,sFAAsF;AACtF,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAU7B;;;;GAIG;AACH,MAAM,OAAgB,kBAKpB,SAAQ,UAAU;IAiBlB,YACE,UAA+B,EAC/B,IAIC;QAED,MAAM,SAAS,GACb,IAAI,EAAE,KAAK;YACX,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE/F,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAlB9B;;;WAGG;QACK,mBAAc,GAAsC,IAAI,CAAC;QAgB/D,IAAI,CAAC,eAAe,GAAG,IAAI,EAAE,cAAc,IAAI,yBAAyB,CAAC,SAAS,CAAC;QAEnF,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAChC,CAAC;QAED,IAAI,IAAI,EAAE,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AAE,GAAG,IAAI,CAAC;QAEhC,IAAI,OAAO,EAAE,YAAY,KAAK,KAAK,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACjF,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF","sourcesContent":["import type { AbstractDataSource } from '@/base/datasources';\nimport type { AbstractEntity, IdType } from '@/base/models';\nimport type { IModelMetadata } from '@/helpers/inversion';\nimport { MetadataRegistry } from '@/helpers/inversion';\nimport type { TClass, TNullable } from '@venizia/ignis-helpers/common';\nimport { BaseHelper, getError } from '@venizia/ignis-helpers/core';\nimport { resolveValue } from '@venizia/ignis-helpers/common';\nimport { RetryBackoffStrategies, RetryHelper, RetryJitterModes } from '@venizia/ignis-helpers/core';\nimport type {\n IExtraOptions,\n IPersistableRepository,\n IWithReadRetry,\n TCount,\n TDataWithRange,\n TFindOneOptions,\n TFindOptions,\n TFindRangeOptions,\n TRepositoryOperationScope,\n} from '../common';\n// The file, not the `../common` barrel: the barrel re-exports the OpenAPI schemas, and this module is\n// on the `./repository` entry, which must load without `@hono/zod-openapi` installed.\nimport {\n DEFAULT_MAX_LIMIT,\n RepositoryErrorCodes,\n RepositoryOperationScopes,\n} from '../common/constants';\nimport type {\n TByIdFilter,\n TFields,\n TFilter,\n TInclusion,\n TRow,\n TWhere,\n} from '@venizia/ignis-filter';\n\n/**\n * Engine-neutral repository plumbing - lazy dataSource/entity resolution, class-keyed `@model`\n * settings, operation scope. `TOptions` defaults to `IExtraOptions` so connectors can narrow it\n * while staying assignable to this base.\n */\nexport abstract class AbstractRepository<\n TDataObject extends object,\n TPersistObject extends object = TDataObject,\n TOptions extends IExtraOptions = IExtraOptions,\n>\n extends BaseHelper\n implements IPersistableRepository<TDataObject, TPersistObject, TOptions>\n{\n protected _operationScope: TRepositoryOperationScope;\n\n /** Lazy-resolved on first access if not provided in constructor. */\n protected _dataSource?: AbstractDataSource;\n\n /** Lazy-resolved from @repository metadata on first access. */\n protected _entity?: AbstractEntity;\n\n /**\n * Memoized @model settings for `this.entity`'s class. `null` means not yet resolved - `undefined`\n * is itself a valid resolved value: the model declares no settings.\n */\n private _modelSettings: IModelMetadata['settings'] | null = null;\n\n constructor(\n dataSource?: AbstractDataSource,\n opts?: {\n scope?: string;\n entityClass?: TClass<AbstractEntity>;\n operationScope?: TRepositoryOperationScope;\n },\n ) {\n const scopeName =\n opts?.scope ??\n (opts?.entityClass?.name ? [opts.entityClass.name, 'Repository'].join('') : new.target.name);\n\n super({ scope: scopeName });\n\n this._operationScope = opts?.operationScope ?? RepositoryOperationScopes.READ_ONLY;\n\n if (dataSource) {\n this._dataSource = dataSource;\n }\n\n if (opts?.entityClass) {\n this._entity = new opts.entityClass();\n }\n }\n\n get dataSource(): AbstractDataSource {\n if (!this._dataSource) {\n throw getError({\n message: `[${this.constructor.name}] DataSource not available. Use @repository({ model: YourModel, dataSource: YourDataSource }) or pass dataSource in constructor.`,\n });\n }\n\n return this._dataSource;\n }\n\n set dataSource(value: AbstractDataSource) {\n this._dataSource = value;\n }\n\n /** Auto-resolves from @repository metadata if not explicitly set. */\n get entity(): AbstractEntity {\n this._entity ??= this.resolveEntity();\n return this._entity;\n }\n\n set entity(value: AbstractEntity) {\n this._entity = value;\n }\n\n get operationScope(): TRepositoryOperationScope {\n return this._operationScope;\n }\n\n setDataSource(opts: { dataSource: AbstractDataSource }): void {\n this._dataSource = opts.dataSource;\n }\n\n getEntity(): AbstractEntity {\n return this.entity;\n }\n\n /**\n * Resolved `@model` settings for `this.entity`'s class, keyed by Reflect target - not by\n * `entity.name`, which can diverge from the `@model` registry key.\n */\n protected get modelSettings(): IModelMetadata['settings'] {\n if (this._modelSettings !== null) {\n return this._modelSettings;\n }\n\n this._modelSettings = MetadataRegistry.getInstance().getModelMetadata({\n target: this.entity.constructor,\n })?.settings;\n\n return this._modelSettings;\n }\n\n protected get hiddenFields(): string[] {\n return this.modelSettings?.hiddenProperties ?? [];\n }\n\n /** Default where from @model settings.defaultFilter.where, AND-merged into every query unless skipped. */\n protected get defaultWhere(): TWhere | undefined {\n return this.modelSettings?.defaultFilter?.where;\n }\n\n protected get defaultLimit(): number | undefined {\n return this.modelSettings?.defaultLimit;\n }\n\n /** Largest `limit` a caller may ask for, when the model declares one; undefined leaves the tier's own default in force. */\n protected get maxLimit(): number | undefined {\n return this.modelSettings?.maxLimit;\n }\n\n /**\n * Both bounds, in one place, for every tier.\n *\n * The upper bound is the point: `@model({ settings: { maxLimit } })` is public and validated at\n * decoration time, but the relational tier read it nowhere, so `maxLimit: 2` still issued\n * `LIMIT 50000000`.\n *\n * The lower bound matters just as much and is easy to miss: a NEGATIVE limit is not a smaller\n * page. Drizzle renders the LIMIT clause only when the value is `>= 0`, so a negative one removes\n * the clause and returns the whole table. The wire schema now rejects it too, but a server-side\n * caller reaches this method without passing through the schema at all.\n */\n protected assertLimitWithinCeiling(opts: { limit?: number; scope?: string }): void {\n const { limit, scope = 'find' } = opts;\n\n if (limit === undefined) {\n return;\n }\n\n // The shape check first, because it needs no metadata at all.\n if (!Number.isInteger(limit) || limit < 0) {\n throw getError({\n message: `[${this.constructor.name}][${scope}] Invalid 'limit' | Expected a non-negative integer | Got: ${limit}`,\n });\n }\n\n // `maxLimit` reaches `modelSettings`, which resolves the entity - and THAT throws for a\n // repository with no `@repository` model binding. Such a repository is a misconfiguration this\n // method has no business reporting, and the caller path that used to reach `getDefaultLimit()`\n // never touched it either, because `??` short-circuits when a limit is given. So the ceiling is\n // consulted only when the binding that makes it resolvable is actually present.\n const hasModelBinding = Boolean(\n MetadataRegistry.getInstance().getRepositoryBinding({ target: this.constructor })?.model,\n );\n const ceiling = (hasModelBinding ? this.maxLimit : undefined) ?? DEFAULT_MAX_LIMIT;\n\n if (limit > ceiling) {\n throw getError({\n message: `[${this.constructor.name}][${scope}] Requested page exceeds this model's limit | requested: ${limit} | maximum: ${ceiling} | raise it with @model settings.maxLimit if larger pages are genuinely needed`,\n });\n }\n }\n\n /**\n * The whole filter, relations included. Checking only the top-level `limit` left the identical\n * defect reachable one level down: a relation scope's negative limit drops Drizzle's LIMIT clause\n * for that relation and loads the entire related table.\n *\n * A relation's limit gets the SHAPE check only, not a ceiling. The ceiling belongs to the\n * relation's own model, which this repository cannot resolve - claiming otherwise would enforce\n * the parent's `maxLimit` on a different entity.\n */\n protected assertFilterLimits(opts: { filter?: TFilter; scope?: string }): void {\n const { filter, scope = 'find' } = opts;\n\n if (!filter) {\n return;\n }\n\n this.assertLimitWithinCeiling({ limit: filter.limit, scope });\n\n const walk = (inclusions: TInclusion[] | undefined, path: string): void => {\n const inclusionsList = inclusions ?? [];\n for (const inclusion of inclusionsList) {\n const relationScope = inclusion.scope;\n if (!relationScope) {\n continue;\n }\n\n const relationPath = `${path}.${inclusion.relation}`;\n const relationLimit = relationScope.limit;\n\n if (\n relationLimit !== undefined &&\n (!Number.isInteger(relationLimit) || relationLimit < 0)\n ) {\n throw getError({\n message: `[${this.constructor.name}][${scope}] Invalid 'limit' on relation scope | relation: ${relationPath} | Expected a non-negative integer | Got: ${relationLimit}`,\n });\n }\n\n walk(relationScope.include, relationPath);\n }\n };\n\n walk(filter.include, scope);\n }\n\n /** Resolves the entity instance from @repository metadata on first access. */\n protected resolveEntity(): AbstractEntity {\n const registry = MetadataRegistry.getInstance();\n const binding = registry.getRepositoryBinding({ target: this.constructor });\n\n if (!binding?.model) {\n throw getError({\n message: `[${this.constructor.name}] Cannot resolve entity. Either pass entityClass in constructor or use @repository decorator with model option.`,\n });\n }\n\n // resolveValue() erases to the resolved value's structural type, not this class-or-resolver\n // union's member - the `@repository` decorator guarantees a class constructor here.\n const ModelClass = resolveValue({ value: binding.model }) as TClass<AbstractEntity>;\n return new ModelClass();\n }\n\n /** Rejects a verb the current operation scope does not permit. */\n protected denyOperation(opts: { methodName: string }): never {\n throw getError({\n messageCode: RepositoryErrorCodes.OPERATION_NOT_ALLOWED,\n message: `[${opts.methodName}] Repository operation is NOT ALLOWED | scope: ${this.operationScope}`,\n });\n }\n\n /**\n * Shared retry orchestration for read verbs. Inside a transaction retry is skipped - the pool\n * routes transactions to the primary, so there is no replica lag to wait out.\n */\n protected executeReadWithRetry<TResult>(opts: {\n operation: string;\n options: IExtraOptions & IWithReadRetry<TResult>;\n defaultUntil: (result: TResult) => boolean;\n execution: () => Promise<TResult>;\n }): Promise<TResult> {\n const { operation, options, defaultUntil, execution } = opts;\n\n if (!options.retry) {\n return execution();\n }\n\n if (options.transaction) {\n this.logger.for(operation).debug('Read retry skipped inside transaction');\n return execution();\n }\n\n const { maxAttempts, maxTotalMs, signal, backoff, until } = options.retry;\n\n return RetryHelper.executeWithRetryUntil<TResult>({\n operation: [this.constructor.name, operation].join('.'),\n execution,\n until: until ?? defaultUntil,\n maxAttempts,\n maxTotalMs,\n signal,\n backoff: backoff ?? {\n strategy: RetryBackoffStrategies.EXPONENTIAL,\n initialDelayMs: 50,\n maxDelayMs: 500,\n jitter: RetryJitterModes.EQUAL,\n },\n logger: this.logger,\n });\n }\n\n /**\n * A copy of `options` without `retry`, so re-entering a read verb takes its non-retry path - this\n * is what keeps the retry recursion single-depth. Copy-then-delete rather than a rest-destructure\n * (lint rejects the unused rest sibling) or `lodash/omit` (its `Omit<>` return type is not\n * assignable back to `TOptions`).\n */\n private omitReadRetry<TReadOptions extends { retry?: unknown }>(\n options: TReadOptions,\n ): TReadOptions {\n const rest = { ...options };\n delete rest.retry;\n return rest;\n }\n\n /** `find`, re-executed until the retry predicate holds - connectors dispatch here from `find` when `options.retry` is set. */\n protected findUntil<R = TDataObject>(opts: {\n filter: TFilter<TDataObject>;\n options: TFindOptions<TOptions, R>;\n }): Promise<Array<R>> {\n const options = this.omitReadRetry(opts.options);\n\n return this.executeReadWithRetry<Array<R>>({\n operation: 'find',\n options: opts.options,\n defaultUntil: (result) => result.length > 0,\n // `R` is named here, so the row is `R`; TypeScript cannot resolve `TRow` for an unresolved `R`.\n execution: () => this.find<R>({ filter: opts.filter, options }) as Promise<Array<R>>,\n });\n }\n\n /** `find` with the range envelope, re-executed until the retry predicate holds - split from `findUntil` so each result shape is checked against its own `find` overload. */\n protected findRangeUntil<R = TDataObject>(opts: {\n filter: TFilter<TDataObject>;\n options: TFindRangeOptions<TOptions, R>;\n }): Promise<TDataWithRange<R>> {\n const options = this.omitReadRetry(opts.options);\n\n return this.executeReadWithRetry<TDataWithRange<R>>({\n operation: 'find',\n options: opts.options,\n defaultUntil: (result) => result.data.length > 0,\n execution: () =>\n this.find<R>({ filter: opts.filter, options }) as unknown as Promise<TDataWithRange<R>>,\n });\n }\n\n /** `findOne`, re-executed until the retry predicate holds - also serves `findById` via its findOne delegation. */\n protected findOneUntil<R = TDataObject>(opts: {\n filter: TFilter<TDataObject>;\n options: TFindOneOptions<TOptions, R>;\n }): Promise<TNullable<R>> {\n const options = this.omitReadRetry(opts.options);\n\n return this.executeReadWithRetry<TNullable<R>>({\n operation: 'findOne',\n options: opts.options,\n defaultUntil: (result) => result !== null && result !== undefined,\n execution: () => this.findOne<R>({ filter: opts.filter, options }) as Promise<TNullable<R>>,\n });\n }\n\n abstract count(opts: { where: TWhere<TDataObject>; options?: TOptions }): Promise<TCount>;\n\n abstract existsWith(opts: { where: TWhere<TDataObject>; options?: TOptions }): Promise<boolean>;\n\n abstract find<R = unknown, const F extends TFields<TDataObject> = TFields<TDataObject>>(opts: {\n filter: TFilter<TDataObject, F>;\n options: TFindRangeOptions<TOptions, TRow<TDataObject, R, F>>;\n }): Promise<TDataWithRange<TRow<TDataObject, R, F>>>;\n\n abstract find<R = unknown, const F extends TFields<TDataObject> = TFields<TDataObject>>(opts: {\n filter: TFilter<TDataObject, F>;\n options?: TFindOptions<TOptions, TRow<TDataObject, R, F>>;\n }): Promise<Array<TRow<TDataObject, R, F>>>;\n\n abstract findOne<R = unknown, const F extends TFields<TDataObject> = TFields<TDataObject>>(opts: {\n filter: TFilter<TDataObject, F>;\n options?: TFindOneOptions<TOptions, TRow<TDataObject, R, F>>;\n }): Promise<TNullable<TRow<TDataObject, R, F>>>;\n\n abstract findById<\n R = unknown,\n const F extends TFields<TDataObject> = TFields<TDataObject>,\n >(opts: {\n id: IdType;\n filter?: TByIdFilter<TDataObject, F>;\n options?: TFindOneOptions<TOptions, TRow<TDataObject, R, F>>;\n }): Promise<TNullable<TRow<TDataObject, R, F>>>;\n\n abstract create(opts: {\n data: TPersistObject;\n options: TOptions & { shouldReturn: false };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract create<R = TDataObject>(opts: {\n data: TPersistObject;\n options?: TOptions & { shouldReturn?: true };\n }): Promise<TCount & { data: R }>;\n\n abstract createAll(opts: {\n data: Array<TPersistObject>;\n options: TOptions & { shouldReturn: false };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract createAll<R = TDataObject>(opts: {\n data: Array<TPersistObject>;\n options?: TOptions & { shouldReturn?: true };\n }): Promise<TCount & { data: Array<R> }>;\n\n abstract updateById(opts: {\n id: IdType;\n data: Partial<TPersistObject>;\n options: TOptions & { shouldReturn: false };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract updateById<R = TDataObject>(opts: {\n id: IdType;\n data: Partial<TPersistObject>;\n options?: TOptions & { shouldReturn?: true };\n }): Promise<TCount & { data: R }>;\n\n abstract updateAll(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options: TOptions & { shouldReturn: false; force?: boolean };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract updateAll<R = TDataObject>(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: true; force?: boolean };\n }): Promise<TCount & { data: Array<R> | null }>;\n\n /** Alias for updateAll. */\n updateBy(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options: TOptions & { shouldReturn: false; force?: boolean };\n }): Promise<TCount & { data: undefined | null }>;\n updateBy<R = TDataObject>(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: true; force?: boolean };\n }): Promise<TCount & { data: Array<R> | null }>;\n updateBy<R = TDataObject>(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: boolean; force?: boolean };\n }): Promise<TCount & { data: TNullable<Array<R>> }> {\n const { data, where, options } = opts;\n\n if (options?.shouldReturn === false) {\n return this.updateAll({ data, where, options: { ...options, shouldReturn: false } });\n }\n\n return this.updateAll<R>({ data, where, options });\n }\n\n abstract deleteById(opts: {\n id: IdType;\n options: TOptions & { shouldReturn: false };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract deleteById<R = TDataObject>(opts: {\n id: IdType;\n options?: TOptions & { shouldReturn?: true };\n }): Promise<TCount & { data: R }>;\n\n abstract deleteAll(opts: {\n where?: TWhere<TDataObject>;\n options: TOptions & { shouldReturn: false; force?: boolean };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract deleteAll<R = TDataObject>(opts: {\n where?: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: true; force?: boolean };\n }): Promise<TCount & { data: Array<R> | null }>;\n\n /** Alias for deleteAll. */\n deleteBy(opts: {\n where: TWhere<TDataObject>;\n options: TOptions & { shouldReturn: false; force?: boolean };\n }): Promise<TCount & { data: undefined | null }>;\n deleteBy<R = TDataObject>(opts: {\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: true; force?: boolean };\n }): Promise<TCount & { data: Array<R> | null }>;\n deleteBy<R = TDataObject>(opts: {\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: boolean; force?: boolean };\n }): Promise<TCount & { data: TNullable<Array<R>> }> {\n const { where, options } = opts;\n\n if (options?.shouldReturn === false) {\n return this.deleteAll({ where, options: { ...options, shouldReturn: false } });\n }\n\n return this.deleteAll<R>({ where, options });\n }\n}\n"]}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AC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACjF,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF","sourcesContent":["import type { AbstractDataSource } from '@/base/datasources';\nimport type { AbstractEntity, IdType } from '@/base/models';\nimport type { IModelMetadata } from '@/helpers/inversion';\nimport { MetadataRegistry } from '@/helpers/inversion';\nimport type { TClass, TNullable } from '@venizia/ignis-helpers/common';\nimport { BaseHelper, getError } from '@venizia/ignis-helpers/core';\nimport { resolveValue } from '@venizia/ignis-helpers/common';\nimport { RetryBackoffStrategies, RetryHelper, RetryJitterModes } from '@venizia/ignis-helpers/core';\nimport type {\n IExtraOptions,\n IPersistableRepository,\n IWithReadRetry,\n TCount,\n TDataWithRange,\n TFindOneOptions,\n TFindOptions,\n TFindRangeOptions,\n TRepositoryOperationScope,\n} from '../common';\n// The file, not the `../common` barrel: the barrel re-exports the OpenAPI schemas, and this module is\n// on the `./repository` entry, which must load without `@hono/zod-openapi` installed.\nimport {\n DEFAULT_MAX_LIMIT,\n RepositoryErrorCodes,\n RepositoryOperationScopes,\n} from '../common/constants';\nimport type {\n TByIdFilter,\n TFields,\n TFilter,\n TInclusion,\n TRow,\n TWhere,\n} from '@venizia/ignis-filter';\n\n/**\n * Engine-neutral repository plumbing - lazy dataSource/entity resolution, class-keyed `@model`\n * settings, operation scope. `TOptions` defaults to `IExtraOptions` so connectors can narrow it\n * while staying assignable to this base.\n */\nexport abstract class AbstractRepository<\n TDataObject extends object,\n TPersistObject extends object = TDataObject,\n TOptions extends IExtraOptions = IExtraOptions,\n>\n extends BaseHelper\n implements IPersistableRepository<TDataObject, TPersistObject, TOptions>\n{\n protected _operationScope: TRepositoryOperationScope;\n\n /** Lazy-resolved on first access if not provided in constructor. */\n protected _dataSource?: AbstractDataSource;\n\n /** Lazy-resolved from @repository metadata on first access. */\n protected _entity?: AbstractEntity;\n\n /**\n * Memoized @model settings for `this.entity`'s class. `null` means not yet resolved - `undefined`\n * is itself a valid resolved value: the model declares no settings.\n */\n private _modelSettings: IModelMetadata['settings'] | null = null;\n\n constructor(\n dataSource?: AbstractDataSource,\n opts?: {\n scope?: string;\n entityClass?: TClass<AbstractEntity>;\n operationScope?: TRepositoryOperationScope;\n },\n ) {\n const scopeName =\n opts?.scope ??\n (opts?.entityClass?.name ? [opts.entityClass.name, 'Repository'].join('') : new.target.name);\n\n super({ scope: scopeName });\n\n this._operationScope = opts?.operationScope ?? RepositoryOperationScopes.READ_ONLY;\n\n if (dataSource) {\n this._dataSource = dataSource;\n }\n\n if (opts?.entityClass) {\n this._entity = new opts.entityClass();\n }\n }\n\n get dataSource(): AbstractDataSource {\n if (!this._dataSource) {\n throw getError({\n message: `[${this.constructor.name}] DataSource not available. Use @repository({ model: YourModel, dataSource: YourDataSource }) or pass dataSource in constructor.`,\n });\n }\n\n return this._dataSource;\n }\n\n set dataSource(value: AbstractDataSource) {\n this._dataSource = value;\n }\n\n /** Auto-resolves from @repository metadata if not explicitly set. */\n get entity(): AbstractEntity {\n this._entity ??= this.resolveEntity();\n return this._entity;\n }\n\n set entity(value: AbstractEntity) {\n this._entity = value;\n }\n\n get operationScope(): TRepositoryOperationScope {\n return this._operationScope;\n }\n\n setDataSource(opts: { dataSource: AbstractDataSource }): void {\n this._dataSource = opts.dataSource;\n }\n\n getEntity(): AbstractEntity {\n return this.entity;\n }\n\n /**\n * Resolved `@model` settings for `this.entity`'s class, keyed by Reflect target - not by\n * `entity.name`, which can diverge from the `@model` registry key.\n */\n protected get modelSettings(): IModelMetadata['settings'] {\n if (this._modelSettings !== null) {\n return this._modelSettings;\n }\n\n this._modelSettings = MetadataRegistry.getInstance().getModelMetadata({\n target: this.entity.constructor,\n })?.settings;\n\n return this._modelSettings;\n }\n\n protected get hiddenFields(): string[] {\n return this.modelSettings?.hiddenProperties ?? [];\n }\n\n /** Default where from @model settings.query.filter.where, AND-merged into every query unless skipped. */\n protected get defaultWhere(): TWhere | undefined {\n return this.modelSettings?.query?.filter?.where;\n }\n\n protected get defaultLimit(): number | undefined {\n return this.modelSettings?.query?.limit?.default;\n }\n\n /** Largest `limit` a caller may ask for, when the model declares one; undefined leaves the tier's own default in force. */\n protected get maxLimit(): number | undefined {\n return this.modelSettings?.query?.limit?.max;\n }\n\n /**\n * Both bounds, in one place, for every tier.\n *\n * The upper bound is the point: `@model({ settings: { maxLimit } })` is public and validated at\n * decoration time, but the relational tier read it nowhere, so `maxLimit: 2` still issued\n * `LIMIT 50000000`.\n *\n * The lower bound matters just as much and is easy to miss: a NEGATIVE limit is not a smaller\n * page. Drizzle renders the LIMIT clause only when the value is `>= 0`, so a negative one removes\n * the clause and returns the whole table. The wire schema now rejects it too, but a server-side\n * caller reaches this method without passing through the schema at all.\n */\n protected assertLimitWithinCeiling(opts: { limit?: number; scope?: string }): void {\n const { limit, scope = 'find' } = opts;\n\n if (limit === undefined) {\n return;\n }\n\n // The shape check first, because it needs no metadata at all.\n if (!Number.isInteger(limit) || limit < 0) {\n throw getError({\n message: `[${this.constructor.name}][${scope}] Invalid 'limit' | Expected a non-negative integer | Got: ${limit}`,\n });\n }\n\n // `maxLimit` reaches `modelSettings`, which resolves the entity - and THAT throws for a\n // repository with no `@repository` model binding. Such a repository is a misconfiguration this\n // method has no business reporting, and the caller path that used to reach `getDefaultLimit()`\n // never touched it either, because `??` short-circuits when a limit is given. So the ceiling is\n // consulted only when the binding that makes it resolvable is actually present.\n const hasModelBinding = Boolean(\n MetadataRegistry.getInstance().getRepositoryBinding({ target: this.constructor })?.model,\n );\n const ceiling = (hasModelBinding ? this.maxLimit : undefined) ?? DEFAULT_MAX_LIMIT;\n\n if (limit > ceiling) {\n throw getError({\n message: `[${this.constructor.name}][${scope}] Requested page exceeds this model's limit | requested: ${limit} | maximum: ${ceiling} | raise it with @model settings.maxLimit if larger pages are genuinely needed`,\n });\n }\n }\n\n /**\n * The whole filter, relations included. Checking only the top-level `limit` left the identical\n * defect reachable one level down: a relation scope's negative limit drops Drizzle's LIMIT clause\n * for that relation and loads the entire related table.\n *\n * A relation's limit gets the SHAPE check only, not a ceiling. The ceiling belongs to the\n * relation's own model, which this repository cannot resolve - claiming otherwise would enforce\n * the parent's `maxLimit` on a different entity.\n */\n protected assertFilterLimits(opts: { filter?: TFilter; scope?: string }): void {\n const { filter, scope = 'find' } = opts;\n\n if (!filter) {\n return;\n }\n\n this.assertLimitWithinCeiling({ limit: filter.limit, scope });\n\n const walk = (inclusions: TInclusion[] | undefined, path: string): void => {\n const inclusionsList = inclusions ?? [];\n for (const inclusion of inclusionsList) {\n const relationScope = inclusion.scope;\n if (!relationScope) {\n continue;\n }\n\n const relationPath = `${path}.${inclusion.relation}`;\n const relationLimit = relationScope.limit;\n\n if (\n relationLimit !== undefined &&\n (!Number.isInteger(relationLimit) || relationLimit < 0)\n ) {\n throw getError({\n message: `[${this.constructor.name}][${scope}] Invalid 'limit' on relation scope | relation: ${relationPath} | Expected a non-negative integer | Got: ${relationLimit}`,\n });\n }\n\n walk(relationScope.include, relationPath);\n }\n };\n\n walk(filter.include, scope);\n }\n\n /** Resolves the entity instance from @repository metadata on first access. */\n protected resolveEntity(): AbstractEntity {\n const registry = MetadataRegistry.getInstance();\n const binding = registry.getRepositoryBinding({ target: this.constructor });\n\n if (!binding?.model) {\n throw getError({\n message: `[${this.constructor.name}] Cannot resolve entity. Either pass entityClass in constructor or use @repository decorator with model option.`,\n });\n }\n\n // resolveValue() erases to the resolved value's structural type, not this class-or-resolver\n // union's member - the `@repository` decorator guarantees a class constructor here.\n const ModelClass = resolveValue({ value: binding.model }) as TClass<AbstractEntity>;\n return new ModelClass();\n }\n\n /** Rejects a verb the current operation scope does not permit. */\n protected denyOperation(opts: { methodName: string }): never {\n throw getError({\n messageCode: RepositoryErrorCodes.OPERATION_NOT_ALLOWED,\n message: `[${opts.methodName}] Repository operation is NOT ALLOWED | scope: ${this.operationScope}`,\n });\n }\n\n /**\n * Shared retry orchestration for read verbs. Inside a transaction retry is skipped - the pool\n * routes transactions to the primary, so there is no replica lag to wait out.\n */\n protected executeReadWithRetry<TResult>(opts: {\n operation: string;\n options: IExtraOptions & IWithReadRetry<TResult>;\n defaultUntil: (result: TResult) => boolean;\n execution: () => Promise<TResult>;\n }): Promise<TResult> {\n const { operation, options, defaultUntil, execution } = opts;\n\n if (!options.retry) {\n return execution();\n }\n\n if (options.transaction) {\n this.logger.for(operation).debug('Read retry skipped inside transaction');\n return execution();\n }\n\n const { maxAttempts, maxTotalMs, signal, backoff, until } = options.retry;\n\n return RetryHelper.executeWithRetryUntil<TResult>({\n operation: [this.constructor.name, operation].join('.'),\n execution,\n until: until ?? defaultUntil,\n maxAttempts,\n maxTotalMs,\n signal,\n backoff: backoff ?? {\n strategy: RetryBackoffStrategies.EXPONENTIAL,\n initialDelayMs: 50,\n maxDelayMs: 500,\n jitter: RetryJitterModes.EQUAL,\n },\n logger: this.logger,\n });\n }\n\n /**\n * A copy of `options` without `retry`, so re-entering a read verb takes its non-retry path - this\n * is what keeps the retry recursion single-depth. Copy-then-delete rather than a rest-destructure\n * (lint rejects the unused rest sibling) or `lodash/omit` (its `Omit<>` return type is not\n * assignable back to `TOptions`).\n */\n private omitReadRetry<TReadOptions extends { retry?: unknown }>(\n options: TReadOptions,\n ): TReadOptions {\n const rest = { ...options };\n delete rest.retry;\n return rest;\n }\n\n /** `find`, re-executed until the retry predicate holds - connectors dispatch here from `find` when `options.retry` is set. */\n protected findUntil<R = TDataObject>(opts: {\n filter: TFilter<TDataObject>;\n options: TFindOptions<TOptions, R>;\n }): Promise<Array<R>> {\n const options = this.omitReadRetry(opts.options);\n\n return this.executeReadWithRetry<Array<R>>({\n operation: 'find',\n options: opts.options,\n defaultUntil: (result) => result.length > 0,\n // `R` is named here, so the row is `R`; TypeScript cannot resolve `TRow` for an unresolved `R`.\n execution: () => this.find<R>({ filter: opts.filter, options }) as Promise<Array<R>>,\n });\n }\n\n /** `find` with the range envelope, re-executed until the retry predicate holds - split from `findUntil` so each result shape is checked against its own `find` overload. */\n protected findRangeUntil<R = TDataObject>(opts: {\n filter: TFilter<TDataObject>;\n options: TFindRangeOptions<TOptions, R>;\n }): Promise<TDataWithRange<R>> {\n const options = this.omitReadRetry(opts.options);\n\n return this.executeReadWithRetry<TDataWithRange<R>>({\n operation: 'find',\n options: opts.options,\n defaultUntil: (result) => result.data.length > 0,\n execution: () =>\n this.find<R>({ filter: opts.filter, options }) as unknown as Promise<TDataWithRange<R>>,\n });\n }\n\n /** `findOne`, re-executed until the retry predicate holds - also serves `findById` via its findOne delegation. */\n protected findOneUntil<R = TDataObject>(opts: {\n filter: TFilter<TDataObject>;\n options: TFindOneOptions<TOptions, R>;\n }): Promise<TNullable<R>> {\n const options = this.omitReadRetry(opts.options);\n\n return this.executeReadWithRetry<TNullable<R>>({\n operation: 'findOne',\n options: opts.options,\n defaultUntil: (result) => result !== null && result !== undefined,\n execution: () => this.findOne<R>({ filter: opts.filter, options }) as Promise<TNullable<R>>,\n });\n }\n\n abstract count(opts: { where: TWhere<TDataObject>; options?: TOptions }): Promise<TCount>;\n\n abstract existsWith(opts: { where: TWhere<TDataObject>; options?: TOptions }): Promise<boolean>;\n\n abstract find<R = unknown, const F extends TFields<TDataObject> = TFields<TDataObject>>(opts: {\n filter: TFilter<TDataObject, F>;\n options: TFindRangeOptions<TOptions, TRow<TDataObject, R, F>>;\n }): Promise<TDataWithRange<TRow<TDataObject, R, F>>>;\n\n abstract find<R = unknown, const F extends TFields<TDataObject> = TFields<TDataObject>>(opts: {\n filter: TFilter<TDataObject, F>;\n options?: TFindOptions<TOptions, TRow<TDataObject, R, F>>;\n }): Promise<Array<TRow<TDataObject, R, F>>>;\n\n abstract findOne<R = unknown, const F extends TFields<TDataObject> = TFields<TDataObject>>(opts: {\n filter: TFilter<TDataObject, F>;\n options?: TFindOneOptions<TOptions, TRow<TDataObject, R, F>>;\n }): Promise<TNullable<TRow<TDataObject, R, F>>>;\n\n abstract findById<\n R = unknown,\n const F extends TFields<TDataObject> = TFields<TDataObject>,\n >(opts: {\n id: IdType;\n filter?: TByIdFilter<TDataObject, F>;\n options?: TFindOneOptions<TOptions, TRow<TDataObject, R, F>>;\n }): Promise<TNullable<TRow<TDataObject, R, F>>>;\n\n abstract create(opts: {\n data: TPersistObject;\n options: TOptions & { shouldReturn: false };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract create<R = TDataObject>(opts: {\n data: TPersistObject;\n options?: TOptions & { shouldReturn?: true };\n }): Promise<TCount & { data: R }>;\n\n abstract createAll(opts: {\n data: Array<TPersistObject>;\n options: TOptions & { shouldReturn: false };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract createAll<R = TDataObject>(opts: {\n data: Array<TPersistObject>;\n options?: TOptions & { shouldReturn?: true };\n }): Promise<TCount & { data: Array<R> }>;\n\n abstract updateById(opts: {\n id: IdType;\n data: Partial<TPersistObject>;\n options: TOptions & { shouldReturn: false };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract updateById<R = TDataObject>(opts: {\n id: IdType;\n data: Partial<TPersistObject>;\n options?: TOptions & { shouldReturn?: true };\n }): Promise<TCount & { data: R }>;\n\n abstract updateAll(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options: TOptions & { shouldReturn: false; force?: boolean };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract updateAll<R = TDataObject>(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: true; force?: boolean };\n }): Promise<TCount & { data: Array<R> | null }>;\n\n /** Alias for updateAll. */\n updateBy(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options: TOptions & { shouldReturn: false; force?: boolean };\n }): Promise<TCount & { data: undefined | null }>;\n updateBy<R = TDataObject>(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: true; force?: boolean };\n }): Promise<TCount & { data: Array<R> | null }>;\n updateBy<R = TDataObject>(opts: {\n data: Partial<TPersistObject>;\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: boolean; force?: boolean };\n }): Promise<TCount & { data: TNullable<Array<R>> }> {\n const { data, where, options } = opts;\n\n if (options?.shouldReturn === false) {\n return this.updateAll({ data, where, options: { ...options, shouldReturn: false } });\n }\n\n return this.updateAll<R>({ data, where, options });\n }\n\n abstract deleteById(opts: {\n id: IdType;\n options: TOptions & { shouldReturn: false };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract deleteById<R = TDataObject>(opts: {\n id: IdType;\n options?: TOptions & { shouldReturn?: true };\n }): Promise<TCount & { data: R }>;\n\n abstract deleteAll(opts: {\n where?: TWhere<TDataObject>;\n options: TOptions & { shouldReturn: false; force?: boolean };\n }): Promise<TCount & { data: undefined | null }>;\n\n abstract deleteAll<R = TDataObject>(opts: {\n where?: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: true; force?: boolean };\n }): Promise<TCount & { data: Array<R> | null }>;\n\n /** Alias for deleteAll. */\n deleteBy(opts: {\n where: TWhere<TDataObject>;\n options: TOptions & { shouldReturn: false; force?: boolean };\n }): Promise<TCount & { data: undefined | null }>;\n deleteBy<R = TDataObject>(opts: {\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: true; force?: boolean };\n }): Promise<TCount & { data: Array<R> | null }>;\n deleteBy<R = TDataObject>(opts: {\n where: TWhere<TDataObject>;\n options?: TOptions & { shouldReturn?: boolean; force?: boolean };\n }): Promise<TCount & { data: TNullable<Array<R>> }> {\n const { where, options } = opts;\n\n if (options?.shouldReturn === false) {\n return this.deleteAll({ where, options: { ...options, shouldReturn: false } });\n }\n\n return this.deleteAll<R>({ where, options });\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { TConstValue } from '@venizia/ignis-helpers/common';
1
2
  /** What a decorated class is to the application - the one fact the artifact generator and the registration methods both read. */
2
3
  export declare class ArtifactTypes {
3
4
  static readonly CONFIGURATION = "configuration";
@@ -10,4 +11,13 @@ export declare class ArtifactTypes {
10
11
  static readonly SCHEME_SET: Set<string>;
11
12
  static isValid(value: string): boolean;
12
13
  }
14
+ /** The `format` of `getAuthorizeModelPrincipals` and `getAuthorizeModelSettings`: ARRAY or RECORD. */
15
+ export declare class AuthorizeModelFormats {
16
+ static readonly ARRAY = "array";
17
+ static readonly RECORD = "record";
18
+ static readonly SCHEME_SET: Set<string>;
19
+ static isValid(value: string): boolean;
20
+ }
21
+ /** Valid authorize model format values. */
22
+ export type TAuthorizeModelFormat = TConstValue<typeof AuthorizeModelFormats>;
13
23
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/inversion/common/constants.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,aAAa,mBAAmB;IAChD,MAAM,CAAC,QAAQ,CAAC,SAAS,eAAe;IACxC,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC1C,MAAM,CAAC,QAAQ,CAAC,OAAO,aAAa;IACpC,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC1C,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC1C,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAEhC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAQvB;IAEH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/inversion/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,iIAAiI;AACjI,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,aAAa,mBAAmB;IAChD,MAAM,CAAC,QAAQ,CAAC,SAAS,eAAe;IACxC,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC1C,MAAM,CAAC,QAAQ,CAAC,OAAO,aAAa;IACpC,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC1C,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC1C,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAEhC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAQvB;IAEH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC;AAED,sGAAsG;AACtG,qBAAa,qBAAqB;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAElC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAA8C;IAExE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC;AAED,2CAA2C;AAC3C,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -20,4 +20,13 @@ export class ArtifactTypes {
20
20
  return this.SCHEME_SET.has(value);
21
21
  }
22
22
  }
23
+ /** The `format` of `getAuthorizeModelPrincipals` and `getAuthorizeModelSettings`: ARRAY or RECORD. */
24
+ export class AuthorizeModelFormats {
25
+ static { this.ARRAY = 'array'; }
26
+ static { this.RECORD = 'record'; }
27
+ static { this.SCHEME_SET = new Set([this.ARRAY, this.RECORD]); }
28
+ static isValid(value) {
29
+ return this.SCHEME_SET.has(value);
30
+ }
31
+ }
23
32
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/helpers/inversion/common/constants.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,MAAM,OAAO,aAAa;aACR,kBAAa,GAAG,eAAe,CAAC;aAChC,cAAS,GAAG,WAAW,CAAC;aACxB,eAAU,GAAG,YAAY,CAAC;aAC1B,YAAO,GAAG,SAAS,CAAC;aACpB,eAAU,GAAG,YAAY,CAAC;aAC1B,eAAU,GAAG,YAAY,CAAC;aAC1B,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAS;QAC3C,IAAI,CAAC,aAAa;QAClB,IAAI,CAAC,SAAS;QACd,IAAI,CAAC,UAAU;QACf,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,UAAU;QACf,IAAI,CAAC,UAAU;QACf,IAAI,CAAC,KAAK;KACX,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC","sourcesContent":["/** What a decorated class is to the application - the one fact the artifact generator and the registration methods both read. */\nexport class ArtifactTypes {\n static readonly CONFIGURATION = 'configuration';\n static readonly COMPONENT = 'component';\n static readonly CONTROLLER = 'controller';\n static readonly SERVICE = 'service';\n static readonly REPOSITORY = 'repository';\n static readonly DATASOURCE = 'datasource';\n static readonly MODEL = 'model';\n\n static readonly SCHEME_SET = new Set<string>([\n this.CONFIGURATION,\n this.COMPONENT,\n this.CONTROLLER,\n this.SERVICE,\n this.REPOSITORY,\n this.DATASOURCE,\n this.MODEL,\n ]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/helpers/inversion/common/constants.ts"],"names":[],"mappings":"AAEA,iIAAiI;AACjI,MAAM,OAAO,aAAa;aACR,kBAAa,GAAG,eAAe,CAAC;aAChC,cAAS,GAAG,WAAW,CAAC;aACxB,eAAU,GAAG,YAAY,CAAC;aAC1B,YAAO,GAAG,SAAS,CAAC;aACpB,eAAU,GAAG,YAAY,CAAC;aAC1B,eAAU,GAAG,YAAY,CAAC;aAC1B,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAS;QAC3C,IAAI,CAAC,aAAa;QAClB,IAAI,CAAC,SAAS;QACd,IAAI,CAAC,UAAU;QACf,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,UAAU;QACf,IAAI,CAAC,UAAU;QACf,IAAI,CAAC,KAAK;KACX,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAGH,sGAAsG;AACtG,MAAM,OAAO,qBAAqB;aAChB,UAAK,GAAG,OAAO,CAAC;aAChB,WAAM,GAAG,QAAQ,CAAC;aAElB,eAAU,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAExE,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC","sourcesContent":["import type { TConstValue } from '@venizia/ignis-helpers/common';\n\n/** What a decorated class is to the application - the one fact the artifact generator and the registration methods both read. */\nexport class ArtifactTypes {\n static readonly CONFIGURATION = 'configuration';\n static readonly COMPONENT = 'component';\n static readonly CONTROLLER = 'controller';\n static readonly SERVICE = 'service';\n static readonly REPOSITORY = 'repository';\n static readonly DATASOURCE = 'datasource';\n static readonly MODEL = 'model';\n\n static readonly SCHEME_SET = new Set<string>([\n this.CONFIGURATION,\n this.COMPONENT,\n this.CONTROLLER,\n this.SERVICE,\n this.REPOSITORY,\n this.DATASOURCE,\n this.MODEL,\n ]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** The `format` of `getAuthorizeModelPrincipals` and `getAuthorizeModelSettings`: ARRAY or RECORD. */\nexport class AuthorizeModelFormats {\n static readonly ARRAY = 'array';\n static readonly RECORD = 'record';\n\n static readonly SCHEME_SET = new Set<string>([this.ARRAY, this.RECORD]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid authorize model format values. */\nexport type TAuthorizeModelFormat = TConstValue<typeof AuthorizeModelFormats>;\n"]}
@@ -1,5 +1,5 @@
1
- import type { AbstractEntity } from '../../../../base/models/index.js';
2
- import type { ScopeFilters, TFilter, TScopeFilterMissingBehavior, TWhere } from '../../../../base/repositories/index.js';
1
+ import type { AbstractEntity, TModelType } from '../../../../base/models/index.js';
2
+ import type { ScopeFilters, TFilter, TScopeFilterMissingBehavior, TScopeWriteGuard, TWhere } from '../../../../base/repositories/index.js';
3
3
  import type { TClass, TNullable, TValueOrResolver } from '@venizia/ignis-helpers/common';
4
4
  import type { IArtifactRegistrationOptions } from './artifact.js';
5
5
  export interface IModelAuthorizeSettings {
@@ -8,12 +8,38 @@ export interface IModelAuthorizeSettings {
8
8
  /** Extensible - consumers can add any extra authorization metadata. */
9
9
  [extra: string | symbol]: any;
10
10
  }
11
+ /** What a restricted caller may write to the scope columns (`@model` settings.access.write). */
12
+ export interface IModelAccessWriteSettings {
13
+ /**
14
+ * What a create, createAll or an update payload that names a scope column does when its value
15
+ * disagrees with the resolved scope. `reject` (default) refuses the write and writes nothing - for
16
+ * `createAll` not even the valid rows. `assign` also fills a scope column that is ABSENT from a
17
+ * created row, when the scope is a single equality; a value that is present and disagrees is
18
+ * still refused.
19
+ *
20
+ * The scope's columns and allowed values are read from the resolved `where` (equality, `eq`, `inq`
21
+ * and arrays, `and`, and an `or` over one column). Any other shape cannot be checked, and the write
22
+ * is refused with its own message - never skipped. `ScopeFilters.UNRESTRICTED` bypasses the guard
23
+ * too, which is the deliberate way to write across scopes (system scope, an admin role).
24
+ *
25
+ * Not checked: an update that does not name the scope column (the row was already selected through
26
+ * the scoped `where`), and raw statements that bypass the repository.
27
+ */
28
+ mode?: TScopeWriteGuard;
29
+ /**
30
+ * `true` lets a restricted caller write `null` to a scope column, or leave it out on create: the
31
+ * row has no owner and is shared. Default `false`, so `null` is refused like any other value
32
+ * outside the scope, even when the resolved scope has a `null` branch (that branch lets the caller
33
+ * READ shared rows, a separate permission). Reads are scoped as before.
34
+ */
35
+ sharedRows?: boolean;
36
+ }
11
37
  /**
12
- * Row-scope resolver for `@model` settings.scopeFilter - resolved per query, so it can depend on
13
- * the current request (tenant, org, membership). Framework-internal escape hatches aside, nothing
14
- * short of removing this setting from the model turns scoping off.
38
+ * Row access for `@model` settings.access - resolved per query, so it can depend on the current
39
+ * request (tenant, org, membership). Framework-internal escape hatches aside, nothing short of
40
+ * removing this setting from the model turns scoping off.
15
41
  */
16
- export interface IScopeFilterSettings {
42
+ export interface IModelAccessSettings {
17
43
  /**
18
44
  * Returns the scope `where`; `ScopeFilters.UNRESTRICTED` to apply no scope for THIS call (an
19
45
  * internal operator, a caller the application has decided sees everything); or null/undefined
@@ -27,41 +53,75 @@ export interface IScopeFilterSettings {
27
53
  * per MODEL - it cannot express a per-USER bypass; use `ScopeFilters.UNRESTRICTED` for that.
28
54
  */
29
55
  onMissing?: TScopeFilterMissingBehavior;
56
+ /**
57
+ * The property names the write guard checks. Optional: with none declared the guard checks every
58
+ * column the resolved scope constrains. When declared, each name must exist on the model (checked
59
+ * at boot), and a resolved scope that constrains any other column is refused as unverifiable.
60
+ */
61
+ columns?: string[];
62
+ /** What a restricted caller may write to the scope columns. See {@link IModelAccessWriteSettings}. */
63
+ write?: IModelAccessWriteSettings;
64
+ }
65
+ /** What a query runs with when it names nothing (`@model` settings.query). */
66
+ export interface IModelQuerySettings {
67
+ /** Default filter auto-applied to all repository operations. Bypassable via shouldSkipDefaultFilter. */
68
+ filter?: TFilter;
69
+ limit?: {
70
+ /** Default row limit when a query omits `limit`. Must be a positive integer. Falls back to DEFAULT_LIMIT (10). */
71
+ default?: number;
72
+ /**
73
+ * Largest `limit` a CALLER may ask for. Must be a positive integer. Falls back to
74
+ * DEFAULT_MAX_LIMIT (1000).
75
+ *
76
+ * Policy, not capacity - the engine's own ceiling sits far above it. The number is chosen so
77
+ * that reaching it means the caller is doing something unusual, and raising it is how a model
78
+ * says so deliberately.
79
+ */
80
+ max?: number;
81
+ };
30
82
  }
31
83
  export interface IModelSettings {
32
84
  /** Properties excluded from all query results at SQL level. */
33
85
  hiddenProperties?: string[];
34
- /** Default filter auto-applied to all repository operations. Bypassable via shouldSkipDefaultFilter. */
35
- defaultFilter?: TFilter;
86
+ /** Default filter and limits of a query: `filter`, `limit.default`, `limit.max`. */
87
+ query?: IModelQuerySettings;
36
88
  /**
37
- * Row scope: ANDed into every read and write whose scope is expressible as a filter clause, and
38
- * NOT removable by `shouldSkipDefaultFilter`. Resolved per query, so it can depend on the current
39
- * request. Ownership resolved per row or through a polymorphic reference is NOT expressible here -
40
- * that check is still the application's to perform.
89
+ * Row access: the scope ANDed into every read and write whose scope is expressible as a filter
90
+ * clause, NOT removable by `shouldSkipDefaultFilter`, and the guard that holds writes to it.
91
+ * Ownership resolved per row or through a polymorphic reference is NOT expressible here - that
92
+ * check is still the application's to perform.
41
93
  *
42
94
  * Relational repositories only - a search-backed model (Typesense, Meilisearch) never reads
43
95
  * this setting, so mirroring a scoped entity into a search index needs its own query-time scope.
44
96
  */
45
- scopeFilter?: IScopeFilterSettings;
46
- /** Default row limit when a query omits `limit`. Must be a positive integer. Falls back to DEFAULT_LIMIT (10). */
47
- defaultLimit?: number;
48
- /**
49
- * Largest `limit` a CALLER may ask for. Must be a positive integer. Falls back to
50
- * DEFAULT_MAX_LIMIT (1000).
51
- *
52
- * Policy, not capacity - the engine's own ceiling sits far above it. The number is chosen so
53
- * that reaching it means the caller is doing something unusual, and raising it is how a model
54
- * says so deliberately.
55
- */
56
- maxLimit?: number;
97
+ access?: IModelAccessSettings;
57
98
  /** Authorization settings for this model (principal name, etc.). */
58
99
  authorize?: IModelAuthorizeSettings;
59
100
  }
101
+ /** Whether tooling that reads the model registry should migrate this model (`@model({ migration })`). */
102
+ export interface IModelMigrationSettings {
103
+ /** Default `true`. `false` marks the model as one a migration tool leaves alone. IGNIS generates no migrations itself. */
104
+ use?: boolean;
105
+ }
106
+ /** One deprecated metadata key a model still uses, and the key that replaces it. */
107
+ export interface IDeprecatedModelMetadata {
108
+ key: string;
109
+ use: string;
110
+ }
60
111
  export interface IModelMetadata extends IArtifactRegistrationOptions {
61
- type: 'entity' | 'view';
112
+ /** Optional: `ModelTypes.ENTITY` is the only value and the default. */
113
+ type?: TModelType;
62
114
  tableName?: string;
115
+ /** Migration marker for consumer tooling that reads the public registry. */
116
+ migration?: IModelMigrationSettings;
117
+ /**
118
+ * @deprecated Use `migration: { use: false }`. Removed in 0.4.4. On a registry entry it is
119
+ * derived (`!migration.use`) so tooling that reads it keeps working this release.
120
+ */
63
121
  skipMigrate?: boolean;
64
122
  settings?: IModelSettings;
123
+ /** Set by the decorator, read by the boot warning; not for application code. */
124
+ deprecatedMetadata?: IDeprecatedModelMetadata[];
65
125
  }
66
126
  export interface IEntityStatics {
67
127
  schema?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,2BAA2B,EAC3B,MAAM,EACP,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,EAAE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Q,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAEhB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAErD,mDAAmD;IACnD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,2BAA2B,EAC3B,gBAAgB,EAChB,MAAM,EACP,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;CAC/B;AAED,gGAAgG;AAChG,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,EAAE,MAAM,SAAS,CAAC,MAAM,CAAC,GAAG,OAAO,YAAY,CAAC,YAAY,CAAC;IAEpE;;;;;OAKG;IACH,SAAS,CAAC,EAAE,2BAA2B,CAAC;IAExC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,sGAAsG;IACtG,KAAK,CAAC,EAAE,yBAAyB,CAAC;CACnC;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,IAAI,MAAM,CAAC,KAAK,CAAC,GACpF,cAAc,CAAC;AAEjB,qGAAqG;AACrG,MAAM,MAAM,qBAAqB,CAAC,KAAK,SAAS,cAAc,GAAG,cAAc,IAC3E,WAAW,CAAC,KAAK,CAAC,GAClB,CAAC,QAAQ,GAAG,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,mBAAmB,CAAC,KAAK,SAAS,cAAc,GAAG,cAAc;IAChF,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACxC,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAEhB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAErD,mDAAmD;IACnD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../../src/helpers/inversion/common/types/model.ts"],"names":[],"mappings":"","sourcesContent":["import type { AbstractEntity } from '@/base/models';\nimport type {\n ScopeFilters,\n TFilter,\n TScopeFilterMissingBehavior,\n TWhere,\n} from '@/base/repositories';\nimport type { TClass, TNullable, TValueOrResolver } from '@venizia/ignis-helpers/common';\nimport type { IArtifactRegistrationOptions } from './artifact';\n\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/**\n * Row-scope resolver for `@model` settings.scopeFilter - resolved per query, so it can depend on\n * the current request (tenant, org, membership). Framework-internal escape hatches aside, nothing\n * short of removing this setting from the model turns scoping off.\n */\nexport interface IScopeFilterSettings {\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 resolve: () => 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. Defaults to `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 onMissing?: TScopeFilterMissingBehavior;\n}\n\nexport interface IModelSettings {\n /** Properties excluded from all query results at SQL level. */\n hiddenProperties?: string[];\n\n /** Default filter auto-applied to all repository operations. Bypassable via shouldSkipDefaultFilter. */\n defaultFilter?: TFilter;\n\n /**\n * Row scope: ANDed into every read and write whose scope is expressible as a filter clause, and\n * NOT removable by `shouldSkipDefaultFilter`. Resolved per query, so it can depend on the current\n * request. Ownership resolved per row or through a polymorphic reference is NOT expressible here -\n * that 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 scopeFilter?: IScopeFilterSettings;\n\n /** Default row limit when a query omits `limit`. Must be a positive integer. Falls back to DEFAULT_LIMIT (10). */\n defaultLimit?: number;\n\n /**\n * Largest `limit` a CALLER may ask for. Must be a positive integer. Falls back to\n * DEFAULT_MAX_LIMIT (1000).\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 maxLimit?: number;\n\n /** Authorization settings for this model (principal name, etc.). */\n authorize?: IModelAuthorizeSettings;\n}\n\nexport interface IModelMetadata extends IArtifactRegistrationOptions {\n type: 'entity' | 'view';\n tableName?: string;\n skipMigrate?: boolean;\n settings?: IModelSettings;\n}\n\nexport interface IEntityStatics {\n schema?: unknown;\n relations?: TValueOrResolver<Array<unknown>>;\n}\n\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\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 TFilter,\n TScopeFilterMissingBehavior,\n TScopeWriteGuard,\n TWhere,\n} from '@/base/repositories';\nimport type { TClass, TNullable, TValueOrResolver } from '@venizia/ignis-helpers/common';\nimport type { IArtifactRegistrationOptions } from './artifact';\n\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` (default) 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 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. Default `false`, so `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 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 */\nexport interface IModelAccessSettings {\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 resolve: () => 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. Defaults to `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 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/** 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 /** Default row limit when a query omits `limit`. Must be a positive integer. Falls back to DEFAULT_LIMIT (10). */\n default?: number;\n\n /**\n * Largest `limit` a CALLER may ask for. Must be a positive integer. Falls back to\n * DEFAULT_MAX_LIMIT (1000).\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 max?: number;\n };\n}\n\nexport interface IModelSettings {\n /** Properties excluded from all query results at SQL level. */\n hiddenProperties?: string[];\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?: IModelAccessSettings;\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 /** Default `true`. `false` marks the model as one a migration tool leaves alone. IGNIS generates no migrations itself. */\n use?: boolean;\n}\n\n/** One deprecated metadata key a model still uses, and the key that replaces it. */\nexport interface IDeprecatedModelMetadata {\n key: string;\n use: string;\n}\n\nexport interface IModelMetadata extends IArtifactRegistrationOptions {\n /** Optional: `ModelTypes.ENTITY` is the only value and the default. */\n type?: TModelType;\n tableName?: string;\n\n /** Migration marker for consumer tooling that reads the public registry. */\n migration?: IModelMigrationSettings;\n\n /**\n * @deprecated Use `migration: { use: false }`. Removed in 0.4.4. On a registry entry it is\n * derived (`!migration.use`) so tooling that reads it keeps working this release.\n */\n skipMigrate?: boolean;\n settings?: IModelSettings;\n\n /** Set by the decorator, read by the boot warning; not for application code. */\n deprecatedMetadata?: IDeprecatedModelMetadata[];\n}\n\nexport interface IEntityStatics {\n schema?: unknown;\n relations?: TValueOrResolver<Array<unknown>>;\n}\n\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\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,6 +1,7 @@
1
1
  import type { AbstractEntity } from '../../../base/models/index.js';
2
2
  import type { TMixinTarget } from '@venizia/ignis-helpers/common';
3
3
  import type { MetadataRegistry as _MetadataRegistry } from '@venizia/ignis-inversion';
4
+ import { AuthorizeModelFormats } from '../common/constants.js';
4
5
  import type { IModelAuthorizeSettings, IModelMetadata, IModelRegistryEntry, TDecoratorModelTarget } from '../common/types/index.js';
5
6
  export declare const ModelMetadataMixin: <BaseClass extends TMixinTarget<_MetadataRegistry>>(baseClass: BaseClass) => {
6
7
  new (...args: any[]): {
@@ -30,20 +31,20 @@ export declare const ModelMetadataMixin: <BaseClass extends TMixinTarget<_Metada
30
31
  }): IModelAuthorizeSettings | undefined;
31
32
  /** Authorization principals across all models that declare an authorize setting. */
32
33
  getAuthorizeModelPrincipals(opts: {
33
- format: "array";
34
+ format: typeof AuthorizeModelFormats.ARRAY;
34
35
  }): string[];
35
36
  getAuthorizeModelPrincipals(opts: {
36
- format: "record";
37
+ format: typeof AuthorizeModelFormats.RECORD;
37
38
  }): Record<string, string>;
38
39
  getAuthorizeModelSettings(opts: {
39
- format: "array";
40
+ format: typeof AuthorizeModelFormats.ARRAY;
40
41
  }): Array<{
41
42
  name: string;
42
43
  authorize: IModelAuthorizeSettings;
43
44
  entry: IModelRegistryEntry;
44
45
  }>;
45
46
  getAuthorizeModelSettings(opts: {
46
- format: "record";
47
+ format: typeof AuthorizeModelFormats.RECORD;
47
48
  }): Record<string, {
48
49
  authorize: IModelAuthorizeSettings;
49
50
  entry: IModelRegistryEntry;
@@ -1 +1 @@
1
- {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C;SAChB,GAAG,cAAc,GAAG,SAAS;QAK9B,kLAAkL;sBACpK,KAAK,SAAS,cAAc;;sBAE9B,cAAc;;4BAqCN;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,GAAG,mBAAmB,GAAG,SAAS;oCAI1C;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,GAAG,mBAAmB,GAAG,SAAS;wBAIhE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC;wCAIhB;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,GAAG,uBAAuB,GAAG,SAAS;QAKtF,oFAAoF;0CAClD;YAAE,MAAM,EAAE,OAAO,qBAAqB,CAAC,KAAK,CAAA;SAAE,GAAG,MAAM,EAAE;0CACzD;YAChC,MAAM,EAAE,OAAO,qBAAqB,CAAC,MAAM,CAAC;SAC7C,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;wCA4BM;YAAE,MAAM,EAAE,OAAO,qBAAqB,CAAC,KAAK,CAAA;SAAE,GAAG,KAAK,CAAC;YACrF,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,uBAAuB,CAAC;YACnC,KAAK,EAAE,mBAAmB,CAAC;SAC5B,CAAC;wCAC8B;YAC9B,MAAM,EAAE,OAAO,qBAAqB,CAAC,MAAM,CAAC;SAC7C,GAAG,MAAM,CAAC,MAAM,EAAE;YAAE,SAAS,EAAE,uBAAuB,CAAC;YAAC,KAAK,EAAE,mBAAmB,CAAA;SAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA1G5E,CAAC;;;;;;;;aAqId,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { getError } from '@venizia/ignis-helpers/core';
2
+ import { AuthorizeModelFormats } from '../common/constants.js';
2
3
  import { MetadataKeys } from '../common/keys.js';
3
4
  /** Registered models that declare an authorize setting, in registry order. */
4
5
  const collectAuthorizeEntries = (opts) => {
@@ -79,10 +80,10 @@ export const ModelMetadataMixin = (baseClass) => {
79
80
  }
80
81
  getAuthorizeModelPrincipals(opts) {
81
82
  switch (opts.format) {
82
- case 'array': {
83
+ case AuthorizeModelFormats.ARRAY: {
83
84
  return collectAuthorizePrincipals({ modelRegistry: this.modelRegistry }).map((item) => item.principal);
84
85
  }
85
- case 'record': {
86
+ case AuthorizeModelFormats.RECORD: {
86
87
  const record = {};
87
88
  const authorizePrincipals = collectAuthorizePrincipals({
88
89
  modelRegistry: this.modelRegistry,
@@ -101,10 +102,10 @@ export const ModelMetadataMixin = (baseClass) => {
101
102
  }
102
103
  getAuthorizeModelSettings(opts) {
103
104
  switch (opts.format) {
104
- case 'array': {
105
+ case AuthorizeModelFormats.ARRAY: {
105
106
  return collectAuthorizeEntries({ modelRegistry: this.modelRegistry });
106
107
  }
107
- case 'record': {
108
+ case AuthorizeModelFormats.RECORD: {
108
109
  const record = {};
109
110
  const authorizeEntries = collectAuthorizeEntries({ modelRegistry: this.modelRegistry });
110
111
  for (const item of authorizeEntries) {
@@ -1 +1 @@
1
- {"version":3,"file":"model.mixin.js","sourceRoot":"","sources":["../../../../../src/helpers/inversion/mixins/model.mixin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS9C,8EAA8E;AAC9E,MAAM,uBAAuB,GAAG,CAAC,IAEhC,EAA2F,EAAE;IAC5F,MAAM,MAAM,GAIP,EAAE,CAAC;IAER,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QAC/C,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;QACrD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAS;QACX,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;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,CAAC,CAAC;oBACxF,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;wBACpC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;oBACvE,CAAC;oBAED,OAAO,MAAM,CAAC;gBAChB,CAAC;gBACD,OAAO,CAAC,CAAC,CAAC;oBACR,MAAM,QAAQ,CAAC;wBACb,OAAO,EAAE,wDAAwD,IAAI,CAAC,MAAM,yBAAyB;qBACtG,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { AbstractEntity } from '@/base/models';\nimport type { TMixinTarget } from '@venizia/ignis-helpers/common';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport type { MetadataRegistry as _MetadataRegistry } from '@venizia/ignis-inversion';\nimport { MetadataKeys } from '../common/keys';\nimport type {\n IModelAuthorizeSettings,\n IModelMetadata,\n IModelRegistryEntry,\n TDecoratorModelTarget,\n TModelClass,\n} from '../common/types';\n\n/** Registered models that declare an authorize setting, in registry order. */\nconst collectAuthorizeEntries = (opts: {\n modelRegistry: Map<string, IModelRegistryEntry>;\n}): Array<{ name: string; authorize: IModelAuthorizeSettings; entry: IModelRegistryEntry }> => {\n const result: Array<{\n name: string;\n authorize: IModelAuthorizeSettings;\n entry: IModelRegistryEntry;\n }> = [];\n\n for (const [name, entry] of opts.modelRegistry) {\n const authorize = entry.metadata.settings?.authorize;\n if (!authorize) {\n continue;\n }\n\n result.push({ name, authorize, entry });\n }\n\n return result;\n};\n\n/** Registered models that declare an authorize principal, in registry order. */\nconst collectAuthorizePrincipals = (opts: {\n modelRegistry: Map<string, IModelRegistryEntry>;\n}): Array<{ name: string; principal: string }> => {\n const result: Array<{ name: string; principal: string }> = [];\n\n for (const [name, entry] of opts.modelRegistry) {\n const principal = entry.metadata.settings?.authorize?.principal;\n if (!principal) {\n continue;\n }\n\n result.push({ name, principal });\n }\n\n return result;\n};\n\nexport const ModelMetadataMixin = <BaseClass extends TMixinTarget<_MetadataRegistry>>(\n baseClass: BaseClass,\n) => {\n return class extends baseClass {\n modelRegistry: Map<string, IModelRegistryEntry>;\n modelsBySchema: WeakMap<object, IModelRegistryEntry>;\n\n setModelMetadata<Target extends object = object>(opts: {\n target: Target;\n metadata: IModelMetadata;\n }): void {\n const { target, metadata } = opts;\n Reflect.defineMetadata(MetadataKeys.MODEL, metadata, target);\n }\n\n getModelMetadata<Target extends object = object>(opts: {\n target: Target;\n }): IModelMetadata | undefined {\n const { target } = opts;\n return Reflect.getMetadata(MetadataKeys.MODEL, target);\n }\n\n /** Registers a model (called by @model) - relations are stored as a resolver, not resolved immediately, so circular references between models resolve lazily in buildSchema(). */\n registerModel<Model extends AbstractEntity = AbstractEntity>(opts: {\n target: TDecoratorModelTarget<Model>;\n metadata: IModelMetadata;\n }) {\n const { target, metadata } = opts;\n\n // Decorator target is always a class constructor at runtime\n const modelClass = target as TModelClass<Model>;\n\n // Table name precedence: explicit metadata > static TABLE_NAME > class name. TABLE_NAME is deliberately outside IEntityStatics (not part of the neutral contract) but still honored here via a local cast.\n const tableName =\n [metadata.tableName, (modelClass as { TABLE_NAME?: string }).TABLE_NAME].find(Boolean) ??\n modelClass.name;\n\n // Resolver, not resolved value - executed lazily in buildSchema() once all models are loaded\n const relationsResolver = modelClass.relations;\n\n const entry: IModelRegistryEntry = {\n target: modelClass,\n metadata,\n schema: modelClass.schema,\n relationsResolver,\n };\n this.modelRegistry.set(tableName, entry);\n\n const { schema } = modelClass;\n if (schema && typeof schema === 'object') {\n const claimed = this.modelsBySchema.get(schema);\n if (claimed && claimed.target !== modelClass) {\n this.modelsBySchema.delete(schema);\n } else {\n this.modelsBySchema.set(schema, entry);\n }\n }\n\n // Also mirrored via Reflect so plain metadata lookups (getModelMetadata) still see it\n this.setModelMetadata({ target, metadata });\n }\n\n getModelEntry(opts: { name: string }): IModelRegistryEntry | undefined {\n return this.modelRegistry.get(opts.name);\n }\n\n getModelEntryBySchema(opts: { schema: object }): IModelRegistryEntry | undefined {\n return this.modelsBySchema.get(opts.schema);\n }\n\n getAllModels(): Map<string, IModelRegistryEntry> {\n return this.modelRegistry;\n }\n\n getModelAuthorizeSettings(opts: { name: string }): IModelAuthorizeSettings | undefined {\n const entry = this.getModelEntry(opts);\n return entry?.metadata?.settings?.authorize;\n }\n\n /** Authorization principals across all models that declare an authorize setting. */\n getAuthorizeModelPrincipals(opts: { format: 'array' }): string[];\n getAuthorizeModelPrincipals(opts: { format: 'record' }): Record<string, string>;\n getAuthorizeModelPrincipals(opts: { format: 'array' | 'record' }) {\n switch (opts.format) {\n case 'array': {\n return collectAuthorizePrincipals({ modelRegistry: this.modelRegistry }).map(\n (item) => item.principal,\n );\n }\n case 'record': {\n const record: Record<string, string> = {};\n\n const authorizePrincipals = collectAuthorizePrincipals({\n modelRegistry: this.modelRegistry,\n });\n for (const item of authorizePrincipals) {\n record[item.name] = item.principal;\n }\n\n return record;\n }\n default: {\n throw getError({\n message: `[getAuthorizeModelPrincipals] Invalid format | format: ${opts.format} | valid: array, record`,\n });\n }\n }\n }\n\n getAuthorizeModelSettings(opts: { format: 'array' }): Array<{\n name: string;\n authorize: IModelAuthorizeSettings;\n entry: IModelRegistryEntry;\n }>;\n getAuthorizeModelSettings(opts: {\n format: 'record';\n }): Record<string, { authorize: IModelAuthorizeSettings; entry: IModelRegistryEntry }>;\n getAuthorizeModelSettings(opts: { format: 'array' | 'record' }) {\n switch (opts.format) {\n case 'array': {\n return collectAuthorizeEntries({ modelRegistry: this.modelRegistry });\n }\n case 'record': {\n const record: Record<\n string,\n { authorize: IModelAuthorizeSettings; entry: IModelRegistryEntry }\n > = {};\n\n const authorizeEntries = collectAuthorizeEntries({ modelRegistry: this.modelRegistry });\n for (const item of authorizeEntries) {\n record[item.name] = { authorize: item.authorize, entry: item.entry };\n }\n\n return record;\n }\n default: {\n throw getError({\n message: `[getAuthorizeModelSettings] Invalid format | format: ${opts.format} | valid: array, record`,\n });\n }\n }\n }\n };\n};\n"]}
1
+ {"version":3,"file":"model.mixin.js","sourceRoot":"","sources":["../../../../../src/helpers/inversion/mixins/model.mixin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAA8B,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS9C,8EAA8E;AAC9E,MAAM,uBAAuB,GAAG,CAAC,IAEhC,EAA2F,EAAE;IAC5F,MAAM,MAAM,GAIP,EAAE,CAAC;IAER,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QAC/C,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;QACrD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAS;QACX,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,gFAAgF;AAChF,MAAM,0BAA0B,GAAG,CAAC,IAEnC,EAA8C,EAAE;IAC/C,MAAM,MAAM,GAA+C,EAAE,CAAC;IAE9D,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QAC/C,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;QAChE,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAS;QACX,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,C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CAAC","sourcesContent":["import type { AbstractEntity } from '@/base/models';\nimport type { TMixinTarget } from '@venizia/ignis-helpers/common';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport type { MetadataRegistry as _MetadataRegistry } from '@venizia/ignis-inversion';\nimport { AuthorizeModelFormats, type TAuthorizeModelFormat } from '../common/constants';\nimport { MetadataKeys } from '../common/keys';\nimport type {\n IModelAuthorizeSettings,\n IModelMetadata,\n IModelRegistryEntry,\n TDecoratorModelTarget,\n TModelClass,\n} from '../common/types';\n\n/** Registered models that declare an authorize setting, in registry order. */\nconst collectAuthorizeEntries = (opts: {\n modelRegistry: Map<string, IModelRegistryEntry>;\n}): Array<{ name: string; authorize: IModelAuthorizeSettings; entry: IModelRegistryEntry }> => {\n const result: Array<{\n name: string;\n authorize: IModelAuthorizeSettings;\n entry: IModelRegistryEntry;\n }> = [];\n\n for (const [name, entry] of opts.modelRegistry) {\n const authorize = entry.metadata.settings?.authorize;\n if (!authorize) {\n continue;\n }\n\n result.push({ name, authorize, entry });\n }\n\n return result;\n};\n\n/** Registered models that declare an authorize principal, in registry order. */\nconst collectAuthorizePrincipals = (opts: {\n modelRegistry: Map<string, IModelRegistryEntry>;\n}): Array<{ name: string; principal: string }> => {\n const result: Array<{ name: string; principal: string }> = [];\n\n for (const [name, entry] of opts.modelRegistry) {\n const principal = entry.metadata.settings?.authorize?.principal;\n if (!principal) {\n continue;\n }\n\n result.push({ name, principal });\n }\n\n return result;\n};\n\nexport const ModelMetadataMixin = <BaseClass extends TMixinTarget<_MetadataRegistry>>(\n baseClass: BaseClass,\n) => {\n return class extends baseClass {\n modelRegistry: Map<string, IModelRegistryEntry>;\n modelsBySchema: WeakMap<object, IModelRegistryEntry>;\n\n setModelMetadata<Target extends object = object>(opts: {\n target: Target;\n metadata: IModelMetadata;\n }): void {\n const { target, metadata } = opts;\n Reflect.defineMetadata(MetadataKeys.MODEL, metadata, target);\n }\n\n getModelMetadata<Target extends object = object>(opts: {\n target: Target;\n }): IModelMetadata | undefined {\n const { target } = opts;\n return Reflect.getMetadata(MetadataKeys.MODEL, target);\n }\n\n /** Registers a model (called by @model) - relations are stored as a resolver, not resolved immediately, so circular references between models resolve lazily in buildSchema(). */\n registerModel<Model extends AbstractEntity = AbstractEntity>(opts: {\n target: TDecoratorModelTarget<Model>;\n metadata: IModelMetadata;\n }) {\n const { target, metadata } = opts;\n\n // Decorator target is always a class constructor at runtime\n const modelClass = target as TModelClass<Model>;\n\n // Table name precedence: explicit metadata > static TABLE_NAME > class name. TABLE_NAME is deliberately outside IEntityStatics (not part of the neutral contract) but still honored here via a local cast.\n const tableName =\n [metadata.tableName, (modelClass as { TABLE_NAME?: string }).TABLE_NAME].find(Boolean) ??\n modelClass.name;\n\n // Resolver, not resolved value - executed lazily in buildSchema() once all models are loaded\n const relationsResolver = modelClass.relations;\n\n const entry: IModelRegistryEntry = {\n target: modelClass,\n metadata,\n schema: modelClass.schema,\n relationsResolver,\n };\n this.modelRegistry.set(tableName, entry);\n\n const { schema } = modelClass;\n if (schema && typeof schema === 'object') {\n const claimed = this.modelsBySchema.get(schema);\n if (claimed && claimed.target !== modelClass) {\n this.modelsBySchema.delete(schema);\n } else {\n this.modelsBySchema.set(schema, entry);\n }\n }\n\n // Also mirrored via Reflect so plain metadata lookups (getModelMetadata) still see it\n this.setModelMetadata({ target, metadata });\n }\n\n getModelEntry(opts: { name: string }): IModelRegistryEntry | undefined {\n return this.modelRegistry.get(opts.name);\n }\n\n getModelEntryBySchema(opts: { schema: object }): IModelRegistryEntry | undefined {\n return this.modelsBySchema.get(opts.schema);\n }\n\n getAllModels(): Map<string, IModelRegistryEntry> {\n return this.modelRegistry;\n }\n\n getModelAuthorizeSettings(opts: { name: string }): IModelAuthorizeSettings | undefined {\n const entry = this.getModelEntry(opts);\n return entry?.metadata?.settings?.authorize;\n }\n\n /** Authorization principals across all models that declare an authorize setting. */\n getAuthorizeModelPrincipals(opts: { format: typeof AuthorizeModelFormats.ARRAY }): string[];\n getAuthorizeModelPrincipals(opts: {\n format: typeof AuthorizeModelFormats.RECORD;\n }): Record<string, string>;\n getAuthorizeModelPrincipals(opts: { format: TAuthorizeModelFormat }) {\n switch (opts.format) {\n case AuthorizeModelFormats.ARRAY: {\n return collectAuthorizePrincipals({ modelRegistry: this.modelRegistry }).map(\n (item) => item.principal,\n );\n }\n case AuthorizeModelFormats.RECORD: {\n const record: Record<string, string> = {};\n\n const authorizePrincipals = collectAuthorizePrincipals({\n modelRegistry: this.modelRegistry,\n });\n for (const item of authorizePrincipals) {\n record[item.name] = item.principal;\n }\n\n return record;\n }\n default: {\n throw getError({\n message: `[getAuthorizeModelPrincipals] Invalid format | format: ${opts.format} | valid: array, record`,\n });\n }\n }\n }\n\n getAuthorizeModelSettings(opts: { format: typeof AuthorizeModelFormats.ARRAY }): Array<{\n name: string;\n authorize: IModelAuthorizeSettings;\n entry: IModelRegistryEntry;\n }>;\n getAuthorizeModelSettings(opts: {\n format: typeof AuthorizeModelFormats.RECORD;\n }): Record<string, { authorize: IModelAuthorizeSettings; entry: IModelRegistryEntry }>;\n getAuthorizeModelSettings(opts: { format: TAuthorizeModelFormat }) {\n switch (opts.format) {\n case AuthorizeModelFormats.ARRAY: {\n return collectAuthorizeEntries({ modelRegistry: this.modelRegistry });\n }\n case AuthorizeModelFormats.RECORD: {\n const record: Record<\n string,\n { authorize: IModelAuthorizeSettings; entry: IModelRegistryEntry }\n > = {};\n\n const authorizeEntries = collectAuthorizeEntries({ modelRegistry: this.modelRegistry });\n for (const item of authorizeEntries) {\n record[item.name] = { authorize: item.authorize, entry: item.entry };\n }\n\n return record;\n }\n default: {\n throw getError({\n message: `[getAuthorizeModelSettings] Invalid format | format: ${opts.format} | valid: array, record`,\n });\n }\n }\n }\n };\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-kernel",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Browser-pure kernel of the IGNIS framework: dependency injection, lifecycle, REST controllers, repository and datasource abstractions, and the authentication and authorization seams. No node builtin and no server-only peer, so the same kernel serves a Bun server and a browser Worker.",
5
5
  "keywords": [
6
6
  "authentication",
@@ -79,14 +79,14 @@
79
79
  "prepublishOnly": "make rebuild"
80
80
  },
81
81
  "dependencies": {
82
- "@venizia/ignis-filter": "0.4.1",
83
- "@venizia/ignis-helpers": "0.4.1",
84
- "@venizia/ignis-inversion": "0.4.1",
82
+ "@venizia/ignis-filter": "0.4.3",
83
+ "@venizia/ignis-helpers": "0.4.3",
84
+ "@venizia/ignis-inversion": "0.4.3",
85
85
  "reflect-metadata": "^0.2.2"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@types/bun": "^1.4.3",
89
- "@venizia/dev-configs": "0.4.1",
89
+ "@venizia/dev-configs": "0.4.3",
90
90
  "casbin": "^5.51.1",
91
91
  "eslint": "^10.13.0",
92
92
  "oxlint": "1.89.0",