@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
@@ -5,26 +5,31 @@ import { getError } from '@venizia/ignis-helpers/core';
5
5
  import { isDataSourceClass } from '../datasources/index.js';
6
6
  import { RepositoryTypes } from '../repositories/common/constants.js';
7
7
  import { injectable, pickRegistrationOptions } from './injectable.js';
8
+ import { normalizeModelMetadata } from './model-metadata.js';
9
+ import { assertNoRemovedModelSettings } from './model-settings.js';
8
10
  /** Registers a model class with its static schema and relations. */
9
- export const model = (metadata) => {
11
+ export const model = (input = {}) => {
10
12
  return (target) => {
11
- injectable({ type: ArtifactTypes.MODEL, ...pickRegistrationOptions({ metadata }) })(target);
12
- const defaultLimit = metadata.settings?.defaultLimit;
13
+ injectable({ type: ArtifactTypes.MODEL, ...pickRegistrationOptions({ metadata: input }) })(target);
14
+ const metadata = normalizeModelMetadata({ model: target.name, metadata: input });
15
+ assertNoRemovedModelSettings({ model: target.name, settings: metadata.settings });
16
+ const { settings } = metadata;
17
+ const defaultLimit = settings?.query?.limit?.default;
13
18
  if (defaultLimit !== undefined && (!Number.isInteger(defaultLimit) || defaultLimit <= 0)) {
14
19
  throw getError({
15
- message: `[model][${target.name}] Invalid 'defaultLimit' | Expected a positive integer | Got: ${defaultLimit}`,
20
+ message: `[model][${target.name}] Invalid 'query.limit.default' | Expected a positive integer | Got: ${defaultLimit}`,
16
21
  });
17
22
  }
18
- // Validated at DECORATION time, like defaultLimit: a bad ceiling is a wiring mistake, and
23
+ // Validated at DECORATION time, like the default limit: a bad ceiling is a wiring mistake, and
19
24
  // catching it at boot beats catching it on the one request that happens to reach the limit.
20
- const maxLimit = metadata.settings?.maxLimit;
25
+ const maxLimit = settings?.query?.limit?.max;
21
26
  if (maxLimit !== undefined && (!Number.isInteger(maxLimit) || maxLimit <= 0)) {
22
27
  throw getError({
23
- message: `[model][${target.name}] Invalid 'maxLimit' | Expected a positive integer | Got: ${maxLimit}`,
28
+ message: `[model][${target.name}] Invalid 'query.limit.max' | Expected a positive integer | Got: ${maxLimit}`,
24
29
  });
25
30
  }
26
31
  // Auto-populate AUTHORIZATION_SUBJECT from authorize.principal if not already set
27
- const principal = metadata.settings?.authorize?.principal;
32
+ const principal = settings?.authorize?.principal;
28
33
  if (principal && !Object.hasOwn(target, 'AUTHORIZATION_SUBJECT')) {
29
34
  target.AUTHORIZATION_SUBJECT = principal;
30
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"persistents.js","sourceRoot":"","sources":["../../../../src/base/metadata/persistents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAStD,OAAO,EACL,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEnE,oEAAoE;AACpE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAwB,EAAkB,EAAE;IAChE,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,GAAG,uBAAuB,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;QAE5F,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;QACrD,IAAI,YAAY,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM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,CAAC","sourcesContent":["import { BindingNamespaces } from '@/common/bindings';\nimport type {\n IArtifactRegistrationOptions,\n IDataSourceMetadata,\n IInjectMetadata,\n IModelMetadata,\n IResolvedRepositoryMetadata,\n TRepositoryMetadata,\n} from '@/helpers/inversion';\nimport {\n ArtifactTypes,\n BindingKeys,\n MetadataKeys,\n MetadataRegistry,\n resolveInjectTarget,\n} from '@/helpers/inversion';\nimport { resolveClass, resolveValue } from '@venizia/ignis-helpers/common';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport type { IDataSource } from '../datasources';\nimport { isDataSourceClass } from '../datasources';\nimport type { AbstractEntity } from '../models';\nimport { RepositoryTypes } from '../repositories/common/constants';\nimport { injectable, pickRegistrationOptions } from './injectable';\n\n/** Registers a model class with its static schema and relations. */\nexport const model = (metadata: IModelMetadata): ClassDecorator => {\n return (target) => {\n injectable({ type: ArtifactTypes.MODEL, ...pickRegistrationOptions({ metadata }) })(target);\n\n const defaultLimit = metadata.settings?.defaultLimit;\n if (defaultLimit !== undefined && (!Number.isInteger(defaultLimit) || defaultLimit <= 0)) {\n throw getError({\n message: `[model][${target.name}] Invalid 'defaultLimit' | Expected a positive integer | Got: ${defaultLimit}`,\n });\n }\n\n // Validated at DECORATION time, like defaultLimit: a bad ceiling is a wiring mistake, and\n // catching it at boot beats catching it on the one request that happens to reach the limit.\n const maxLimit = metadata.settings?.maxLimit;\n if (maxLimit !== undefined && (!Number.isInteger(maxLimit) || maxLimit <= 0)) {\n throw getError({\n message: `[model][${target.name}] Invalid 'maxLimit' | Expected a positive integer | Got: ${maxLimit}`,\n });\n }\n\n // Auto-populate AUTHORIZATION_SUBJECT from authorize.principal if not already set\n const principal = metadata.settings?.authorize?.principal;\n if (principal && !Object.hasOwn(target, 'AUTHORIZATION_SUBJECT')) {\n (target as Record<string, unknown>).AUTHORIZATION_SUBJECT = principal;\n }\n\n MetadataRegistry.getInstance().registerModel({ target, metadata });\n };\n};\n\n/** Registers a datasource with driver and auto-discovery settings. */\nexport const datasource = (metadata?: IDataSourceMetadata): ClassDecorator => {\n return (target) => {\n injectable({\n type: ArtifactTypes.DATASOURCE,\n ...pickRegistrationOptions({ metadata: metadata ?? {} }),\n })(target);\n MetadataRegistry.getInstance().setDataSourceMetadata({ target, metadata });\n };\n};\n\n/** Mirrors the `TRepositoryMetadata` union for JavaScript callers: a known type, a dataSource always, a model exactly when the type is RepositoryTypes.MODEL. */\nconst validateRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n target: Function;\n}): void => {\n const { metadata, target } = opts;\n const type = metadata.type ?? RepositoryTypes.MODEL;\n\n if (!RepositoryTypes.isValid(type)) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Unknown 'type': ${type} | Expected one of: ${[...RepositoryTypes.SCHEME_SET].join(', ')}`,\n });\n }\n\n if (type === RepositoryTypes.MODEL && !metadata.model) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Missing 'model'`,\n });\n }\n\n if (type === RepositoryTypes.REMOTE && metadata.model) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | A '${RepositoryTypes.REMOTE}' repository takes no 'model'`,\n });\n }\n\n if (!metadata.dataSource) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Missing 'dataSource'`,\n });\n }\n};\n\n/** Asserts the constructor's first parameter is an AbstractDataSource compatible with what @repository declared. */\nconst validateFirstConstructorParameter = (opts: {\n target: Function;\n firstParamType: Function;\n resolvedDataSource: string | Function;\n}): void => {\n const { target, firstParamType, resolvedDataSource } = opts;\n\n // NOT `instanceof`: two copies of this package give two `AbstractDataSource` classes and the\n // check would be false across them, rejecting a perfectly valid repository at import time.\n const isDataSourceType = isDataSourceClass(firstParamType);\n\n if (!isDataSourceType) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | First parameter must extend AbstractDataSource | Received: '${firstParamType.name}'`,\n });\n }\n\n if (typeof resolvedDataSource !== 'function') {\n return;\n }\n\n const isCompatible =\n firstParamType === resolvedDataSource || resolvedDataSource.prototype instanceof firstParamType;\n\n if (!isCompatible) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | Type mismatch | Constructor expects '${firstParamType.name}' but @repository specifies '${resolvedDataSource.name}'`,\n });\n }\n};\n\n/**\n * Auto-injects dataSource at constructor param[0] unless explicit @inject exists. A class is injected\n * by the class itself, so the container reads the key its registration recorded: a pinned\n * `binding` and a minified class name both resolve. Only a string reference is a key.\n */\nconst registerDataSourceInjection = (opts: {\n target: Function;\n registry: MetadataRegistry;\n dataSourceRef: TRepositoryMetadata['dataSource'];\n resolvedDataSource: string | Function;\n}): void => {\n const { target, registry, dataSourceRef, resolvedDataSource } = opts;\n\n // Own metadata only: `getInjectMetadata` walks the prototype chain, so a repository extending another @repository class would see the BASE's injection at param[0] and silently resolve the base's dataSource.\n const ownInjects: IInjectMetadata[] | undefined = Reflect.getOwnMetadata(\n MetadataKeys.INJECT,\n target,\n );\n const injectAtIndex0 = ownInjects?.find((entry) => entry?.index === 0);\n\n if (injectAtIndex0) {\n // `@inject({ target })` carries no key; read the one recorded on the class. The function form\n // resolves through the same helper the container uses, so both paths read one class.\n const injectedTarget = injectAtIndex0.target\n ? resolveInjectTarget({ target: injectAtIndex0.target })\n : undefined;\n const injectKey =\n injectAtIndex0.key ??\n (injectedTarget ? registry.getBindingKey({ target: injectedTarget }) : undefined);\n\n // A class is judged by its brand: its key may sit under any namespace a `binding` pinned, and\n // a provisional key may still change at registration. Only a bare key is judged by its prefix.\n const isDataSourceTarget = injectedTarget\n ? isDataSourceClass(injectedTarget)\n : typeof injectKey === 'string' && injectKey.startsWith(`${BindingNamespaces.DATASOURCE}.`);\n\n if (!isDataSourceTarget) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | First parameter must be a DataSource | Found @inject with key: '${String(injectKey)}' | Expected a key starting with '${BindingNamespaces.DATASOURCE}.' or a DataSource class`,\n });\n }\n\n return;\n }\n\n // Checked only when this decorator writes the injection: an explicit @inject decides for itself.\n // An interface emits `Object` and a type-only class import emits `Function` under tsc (`Object`\n // under bun); neither names the class, so neither is judged.\n const firstParamType = Reflect.getMetadata('design:paramtypes', target)?.[0];\n if (firstParamType && firstParamType !== Object && firstParamType !== Function) {\n validateFirstConstructorParameter({ target, firstParamType, resolvedDataSource });\n }\n\n // The inherited list is the base repository's own, and setInjectMetadata may write straight into it.\n if (!ownInjects) {\n Reflect.defineMetadata(\n MetadataKeys.INJECT,\n [...(registry.getInjectMetadata({ target }) ?? [])],\n target,\n );\n }\n\n const derivedKey = BindingKeys.build({\n namespace: BindingNamespaces.DATASOURCE,\n key: typeof resolvedDataSource === 'string' ? resolvedDataSource : resolvedDataSource.name,\n });\n\n // The class first, decided when the repository is resolved: by then any registration - decorated,\n // `bindingList()`, or `dataSource(X, { binding })` - has recorded its key on the class. The derived\n // key is the fallback for a class nothing recorded, bound by hand under exactly that key.\n registry.setInjectMetadata({\n target,\n index: 0,\n metadata:\n typeof dataSourceRef === 'string'\n ? { key: derivedKey, index: 0, isOptional: false }\n : { target: dataSourceRef, key: derivedKey, index: 0, isOptional: false },\n });\n};\n\n/** Resolves repository metadata and registers bindings for schema auto-discovery. */\nconst resolveRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n target: Function;\n registry: MetadataRegistry;\n}): IResolvedRepositoryMetadata<Model, DataSource> => {\n const { metadata, target, registry } = opts;\n\n validateRepositoryMetadata({ metadata, target });\n\n const resolvedDataSource = resolveClass({ ref: metadata.dataSource });\n if (!resolvedDataSource) {\n throw getError({\n message: `[@repository][${target.name}] The dataSource resolver returned nothing at decoration time | An import cycle leaves the datasource class undefined here; import it without the cycle, or name it as a string`,\n });\n }\n\n // No model, so no binding: the datasource owns no schema through this repository.\n if (metadata.type === RepositoryTypes.REMOTE) {\n registerDataSourceInjection({\n target,\n registry,\n dataSourceRef: metadata.dataSource,\n resolvedDataSource,\n });\n return {\n type: RepositoryTypes.REMOTE,\n dataSource: resolvedDataSource,\n operationScope: metadata.operationScope,\n };\n }\n\n const resolvedModel = resolveValue({ value: metadata.model });\n\n registry.registerRepositoryBinding({\n repository: target,\n model: resolvedModel,\n dataSource: resolvedDataSource,\n });\n\n registerDataSourceInjection({\n target,\n registry,\n dataSourceRef: metadata.dataSource,\n resolvedDataSource,\n });\n\n return {\n type: RepositoryTypes.MODEL,\n model: resolvedModel,\n dataSource: resolvedDataSource,\n operationScope: metadata.operationScope,\n };\n};\n\n/** A bare `@repository()` on a subclass reuses the type, model and datasource its nearest decorated parent declared; the registration options (`binding`, `when`, ...) are never inherited, so the subclass registers under its own name. */\nconst inheritRepositoryMetadata = (opts: {\n target: Function;\n registry: MetadataRegistry;\n}): TRepositoryMetadata => {\n // Own metadata does not exist yet at decoration time, so this read walks the prototype chain.\n const inherited = opts.registry.getRepositoryMetadata({ target: opts.target });\n if (!inherited) {\n throw getError({\n message: `[@repository][${opts.target.name}] No metadata given and no decorated repository above it in the prototype chain | pass { model, dataSource } or decorate the parent`,\n });\n }\n\n if (inherited.type === RepositoryTypes.REMOTE) {\n const { type, dataSource, operationScope } = inherited;\n return { type, dataSource, operationScope };\n }\n\n const { type, model: parentModel, dataSource, operationScope } = inherited;\n return { type, model: parentModel, dataSource, operationScope };\n};\n\nconst applyRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n registration: IArtifactRegistrationOptions;\n target: Function;\n registry: MetadataRegistry;\n}): void => {\n const { metadata, registration, target, registry } = opts;\n injectable({\n type: ArtifactTypes.REPOSITORY,\n ...pickRegistrationOptions({ metadata: registration }),\n })(target);\n\n const resolved = resolveRepositoryMetadata({ metadata, target, registry });\n\n registry.setRepositoryMetadata({ target, metadata: { ...metadata, _resolved: resolved } });\n};\n\nexport const repository = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(\n metadata?: TRepositoryMetadata<Model, DataSource>,\n): ClassDecorator => {\n return (target) => {\n const registry = MetadataRegistry.getInstance();\n if (!metadata) {\n applyRepositoryMetadata({\n metadata: inheritRepositoryMetadata({ target, registry }),\n registration: {},\n target,\n registry,\n });\n return;\n }\n\n applyRepositoryMetadata({ metadata, registration: metadata, target, registry });\n };\n};\n"]}
1
+ {"version":3,"file":"persistents.js","sourceRoot":"","sources":["../../../../src/base/metadata/persistents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAStD,OAAO,EACL,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAEhE,oEAAoE;AACpE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAwB,EAAE,EAAkB,EAAE;IAClE,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,GAAG,uBAAuB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CACxF,MAAM,CACP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E,EAAE;QAChB,MAAM,QAAQ,GAAG,gBAAgB,CAAC,WAAW,EAAE,CAAC;QAChD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,uBAAuB,CAAC;gBACtB,QAAQ,EAAE,yBAAyB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;gBACzD,YAAY,EAAE,EAAE;gBAChB,MAAM;gBACN,QAAQ;aACT,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,uBAAuB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClF,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BindingNamespaces } from '@/common/bindings';\nimport type {\n IArtifactRegistrationOptions,\n IDataSourceMetadata,\n IInjectMetadata,\n IModelMetadata,\n IResolvedRepositoryMetadata,\n TRepositoryMetadata,\n} from '@/helpers/inversion';\nimport {\n ArtifactTypes,\n BindingKeys,\n MetadataKeys,\n MetadataRegistry,\n resolveInjectTarget,\n} from '@/helpers/inversion';\nimport { resolveClass, resolveValue } from '@venizia/ignis-helpers/common';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport type { IDataSource } from '../datasources';\nimport { isDataSourceClass } from '../datasources';\nimport type { AbstractEntity } from '../models';\nimport { RepositoryTypes } from '../repositories/common/constants';\nimport { injectable, pickRegistrationOptions } from './injectable';\nimport { normalizeModelMetadata } from './model-metadata';\nimport { assertNoRemovedModelSettings } from './model-settings';\n\n/** Registers a model class with its static schema and relations. */\nexport const model = (input: IModelMetadata = {}): ClassDecorator => {\n return (target) => {\n injectable({ type: ArtifactTypes.MODEL, ...pickRegistrationOptions({ metadata: input }) })(\n target,\n );\n\n const metadata = normalizeModelMetadata({ model: target.name, metadata: input });\n\n assertNoRemovedModelSettings({ model: target.name, settings: metadata.settings });\n const { settings } = metadata;\n\n const defaultLimit = settings?.query?.limit?.default;\n if (defaultLimit !== undefined && (!Number.isInteger(defaultLimit) || defaultLimit <= 0)) {\n throw getError({\n message: `[model][${target.name}] Invalid 'query.limit.default' | Expected a positive integer | Got: ${defaultLimit}`,\n });\n }\n\n // Validated at DECORATION time, like the default limit: a bad ceiling is a wiring mistake, and\n // catching it at boot beats catching it on the one request that happens to reach the limit.\n const maxLimit = settings?.query?.limit?.max;\n if (maxLimit !== undefined && (!Number.isInteger(maxLimit) || maxLimit <= 0)) {\n throw getError({\n message: `[model][${target.name}] Invalid 'query.limit.max' | Expected a positive integer | Got: ${maxLimit}`,\n });\n }\n\n // Auto-populate AUTHORIZATION_SUBJECT from authorize.principal if not already set\n const principal = settings?.authorize?.principal;\n if (principal && !Object.hasOwn(target, 'AUTHORIZATION_SUBJECT')) {\n (target as Record<string, unknown>).AUTHORIZATION_SUBJECT = principal;\n }\n\n MetadataRegistry.getInstance().registerModel({ target, metadata });\n };\n};\n\n/** Registers a datasource with driver and auto-discovery settings. */\nexport const datasource = (metadata?: IDataSourceMetadata): ClassDecorator => {\n return (target) => {\n injectable({\n type: ArtifactTypes.DATASOURCE,\n ...pickRegistrationOptions({ metadata: metadata ?? {} }),\n })(target);\n MetadataRegistry.getInstance().setDataSourceMetadata({ target, metadata });\n };\n};\n\n/** Mirrors the `TRepositoryMetadata` union for JavaScript callers: a known type, a dataSource always, a model exactly when the type is RepositoryTypes.MODEL. */\nconst validateRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n target: Function;\n}): void => {\n const { metadata, target } = opts;\n const type = metadata.type ?? RepositoryTypes.MODEL;\n\n if (!RepositoryTypes.isValid(type)) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Unknown 'type': ${type} | Expected one of: ${[...RepositoryTypes.SCHEME_SET].join(', ')}`,\n });\n }\n\n if (type === RepositoryTypes.MODEL && !metadata.model) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Missing 'model'`,\n });\n }\n\n if (type === RepositoryTypes.REMOTE && metadata.model) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | A '${RepositoryTypes.REMOTE}' repository takes no 'model'`,\n });\n }\n\n if (!metadata.dataSource) {\n throw getError({\n message: `[validateRepositoryMetadata][@repository][${target.name}] Invalid metadata | Missing 'dataSource'`,\n });\n }\n};\n\n/** Asserts the constructor's first parameter is an AbstractDataSource compatible with what @repository declared. */\nconst validateFirstConstructorParameter = (opts: {\n target: Function;\n firstParamType: Function;\n resolvedDataSource: string | Function;\n}): void => {\n const { target, firstParamType, resolvedDataSource } = opts;\n\n // NOT `instanceof`: two copies of this package give two `AbstractDataSource` classes and the\n // check would be false across them, rejecting a perfectly valid repository at import time.\n const isDataSourceType = isDataSourceClass(firstParamType);\n\n if (!isDataSourceType) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | First parameter must extend AbstractDataSource | Received: '${firstParamType.name}'`,\n });\n }\n\n if (typeof resolvedDataSource !== 'function') {\n return;\n }\n\n const isCompatible =\n firstParamType === resolvedDataSource || resolvedDataSource.prototype instanceof firstParamType;\n\n if (!isCompatible) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | Type mismatch | Constructor expects '${firstParamType.name}' but @repository specifies '${resolvedDataSource.name}'`,\n });\n }\n};\n\n/**\n * Auto-injects dataSource at constructor param[0] unless explicit @inject exists. A class is injected\n * by the class itself, so the container reads the key its registration recorded: a pinned\n * `binding` and a minified class name both resolve. Only a string reference is a key.\n */\nconst registerDataSourceInjection = (opts: {\n target: Function;\n registry: MetadataRegistry;\n dataSourceRef: TRepositoryMetadata['dataSource'];\n resolvedDataSource: string | Function;\n}): void => {\n const { target, registry, dataSourceRef, resolvedDataSource } = opts;\n\n // Own metadata only: `getInjectMetadata` walks the prototype chain, so a repository extending another @repository class would see the BASE's injection at param[0] and silently resolve the base's dataSource.\n const ownInjects: IInjectMetadata[] | undefined = Reflect.getOwnMetadata(\n MetadataKeys.INJECT,\n target,\n );\n const injectAtIndex0 = ownInjects?.find((entry) => entry?.index === 0);\n\n if (injectAtIndex0) {\n // `@inject({ target })` carries no key; read the one recorded on the class. The function form\n // resolves through the same helper the container uses, so both paths read one class.\n const injectedTarget = injectAtIndex0.target\n ? resolveInjectTarget({ target: injectAtIndex0.target })\n : undefined;\n const injectKey =\n injectAtIndex0.key ??\n (injectedTarget ? registry.getBindingKey({ target: injectedTarget }) : undefined);\n\n // A class is judged by its brand: its key may sit under any namespace a `binding` pinned, and\n // a provisional key may still change at registration. Only a bare key is judged by its prefix.\n const isDataSourceTarget = injectedTarget\n ? isDataSourceClass(injectedTarget)\n : typeof injectKey === 'string' && injectKey.startsWith(`${BindingNamespaces.DATASOURCE}.`);\n\n if (!isDataSourceTarget) {\n throw getError({\n message: `[@repository][${target.name}] Invalid constructor | First parameter must be a DataSource | Found @inject with key: '${String(injectKey)}' | Expected a key starting with '${BindingNamespaces.DATASOURCE}.' or a DataSource class`,\n });\n }\n\n return;\n }\n\n // Checked only when this decorator writes the injection: an explicit @inject decides for itself.\n // An interface emits `Object` and a type-only class import emits `Function` under tsc (`Object`\n // under bun); neither names the class, so neither is judged.\n const firstParamType = Reflect.getMetadata('design:paramtypes', target)?.[0];\n if (firstParamType && firstParamType !== Object && firstParamType !== Function) {\n validateFirstConstructorParameter({ target, firstParamType, resolvedDataSource });\n }\n\n // The inherited list is the base repository's own, and setInjectMetadata may write straight into it.\n if (!ownInjects) {\n Reflect.defineMetadata(\n MetadataKeys.INJECT,\n [...(registry.getInjectMetadata({ target }) ?? [])],\n target,\n );\n }\n\n const derivedKey = BindingKeys.build({\n namespace: BindingNamespaces.DATASOURCE,\n key: typeof resolvedDataSource === 'string' ? resolvedDataSource : resolvedDataSource.name,\n });\n\n // The class first, decided when the repository is resolved: by then any registration - decorated,\n // `bindingList()`, or `dataSource(X, { binding })` - has recorded its key on the class. The derived\n // key is the fallback for a class nothing recorded, bound by hand under exactly that key.\n registry.setInjectMetadata({\n target,\n index: 0,\n metadata:\n typeof dataSourceRef === 'string'\n ? { key: derivedKey, index: 0, isOptional: false }\n : { target: dataSourceRef, key: derivedKey, index: 0, isOptional: false },\n });\n};\n\n/** Resolves repository metadata and registers bindings for schema auto-discovery. */\nconst resolveRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n target: Function;\n registry: MetadataRegistry;\n}): IResolvedRepositoryMetadata<Model, DataSource> => {\n const { metadata, target, registry } = opts;\n\n validateRepositoryMetadata({ metadata, target });\n\n const resolvedDataSource = resolveClass({ ref: metadata.dataSource });\n if (!resolvedDataSource) {\n throw getError({\n message: `[@repository][${target.name}] The dataSource resolver returned nothing at decoration time | An import cycle leaves the datasource class undefined here; import it without the cycle, or name it as a string`,\n });\n }\n\n // No model, so no binding: the datasource owns no schema through this repository.\n if (metadata.type === RepositoryTypes.REMOTE) {\n registerDataSourceInjection({\n target,\n registry,\n dataSourceRef: metadata.dataSource,\n resolvedDataSource,\n });\n return {\n type: RepositoryTypes.REMOTE,\n dataSource: resolvedDataSource,\n operationScope: metadata.operationScope,\n };\n }\n\n const resolvedModel = resolveValue({ value: metadata.model });\n\n registry.registerRepositoryBinding({\n repository: target,\n model: resolvedModel,\n dataSource: resolvedDataSource,\n });\n\n registerDataSourceInjection({\n target,\n registry,\n dataSourceRef: metadata.dataSource,\n resolvedDataSource,\n });\n\n return {\n type: RepositoryTypes.MODEL,\n model: resolvedModel,\n dataSource: resolvedDataSource,\n operationScope: metadata.operationScope,\n };\n};\n\n/** A bare `@repository()` on a subclass reuses the type, model and datasource its nearest decorated parent declared; the registration options (`binding`, `when`, ...) are never inherited, so the subclass registers under its own name. */\nconst inheritRepositoryMetadata = (opts: {\n target: Function;\n registry: MetadataRegistry;\n}): TRepositoryMetadata => {\n // Own metadata does not exist yet at decoration time, so this read walks the prototype chain.\n const inherited = opts.registry.getRepositoryMetadata({ target: opts.target });\n if (!inherited) {\n throw getError({\n message: `[@repository][${opts.target.name}] No metadata given and no decorated repository above it in the prototype chain | pass { model, dataSource } or decorate the parent`,\n });\n }\n\n if (inherited.type === RepositoryTypes.REMOTE) {\n const { type, dataSource, operationScope } = inherited;\n return { type, dataSource, operationScope };\n }\n\n const { type, model: parentModel, dataSource, operationScope } = inherited;\n return { type, model: parentModel, dataSource, operationScope };\n};\n\nconst applyRepositoryMetadata = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(opts: {\n metadata: TRepositoryMetadata<Model, DataSource>;\n registration: IArtifactRegistrationOptions;\n target: Function;\n registry: MetadataRegistry;\n}): void => {\n const { metadata, registration, target, registry } = opts;\n injectable({\n type: ArtifactTypes.REPOSITORY,\n ...pickRegistrationOptions({ metadata: registration }),\n })(target);\n\n const resolved = resolveRepositoryMetadata({ metadata, target, registry });\n\n registry.setRepositoryMetadata({ target, metadata: { ...metadata, _resolved: resolved } });\n};\n\nexport const repository = <\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n>(\n metadata?: TRepositoryMetadata<Model, DataSource>,\n): ClassDecorator => {\n return (target) => {\n const registry = MetadataRegistry.getInstance();\n if (!metadata) {\n applyRepositoryMetadata({\n metadata: inheritRepositoryMetadata({ target, registry }),\n registration: {},\n target,\n registry,\n });\n return;\n }\n\n applyRepositoryMetadata({ metadata, registration: metadata, target, registry });\n };\n};\n"]}
@@ -8,4 +8,21 @@ export declare class SchemaTypes {
8
8
  static isValid(input: string): input is TSchemaType;
9
9
  }
10
10
  export type TSchemaType = TConstValue<typeof SchemaTypes>;
11
+ /** What `@model` declares. Only ENTITY (a table-backed model) exists; `type` may be left out. */
12
+ export declare class ModelTypes {
13
+ static readonly ENTITY = "entity";
14
+ static readonly SCHEME_SET: Set<string>;
15
+ static isValid(value: string): boolean;
16
+ }
17
+ /** Valid model type values. */
18
+ export type TModelType = TConstValue<typeof ModelTypes>;
19
+ /** The path-param id shape an entity family resolves to (`AbstractEntity.getIdType()`). */
20
+ export declare class IdSchemaTypes {
21
+ static readonly NUMBER = "number";
22
+ static readonly STRING = "string";
23
+ static readonly SCHEME_SET: Set<string>;
24
+ static isValid(value: string): boolean;
25
+ }
26
+ /** Valid id schema type values. */
27
+ export type TIdSchemaType = TConstValue<typeof IdSchemaTypes>;
11
28
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/base/models/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,qBAAa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,OAAO,aAAa;IAEpC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAkE;IAE5F,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW;CAGpD;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/base/models/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,qBAAa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,OAAO,aAAa;IAEpC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAkE;IAE5F,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW;CAGpD;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1D,iGAAiG;AACjG,qBAAa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAA0B;IAEpD,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC;AAED,+BAA+B;AAC/B,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,UAAU,CAAC,CAAC;AAExD,2FAA2F;AAC3F,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAElC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAA+C;IAEzE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC;AAED,mCAAmC;AACnC,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -8,4 +8,21 @@ export class SchemaTypes {
8
8
  return this.SCHEME_SET.has(input);
9
9
  }
10
10
  }
11
+ /** What `@model` declares. Only ENTITY (a table-backed model) exists; `type` may be left out. */
12
+ export class ModelTypes {
13
+ static { this.ENTITY = 'entity'; }
14
+ static { this.SCHEME_SET = new Set([this.ENTITY]); }
15
+ static isValid(value) {
16
+ return this.SCHEME_SET.has(value);
17
+ }
18
+ }
19
+ /** The path-param id shape an entity family resolves to (`AbstractEntity.getIdType()`). */
20
+ export class IdSchemaTypes {
21
+ static { this.NUMBER = 'number'; }
22
+ static { this.STRING = 'string'; }
23
+ static { this.SCHEME_SET = new Set([this.NUMBER, this.STRING]); }
24
+ static isValid(value) {
25
+ return this.SCHEME_SET.has(value);
26
+ }
27
+ }
11
28
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/base/models/common/constants.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,WAAW;aACN,WAAM,GAAG,QAAQ,CAAC;aAClB,WAAM,GAAG,QAAQ,CAAC;aAClB,WAAM,GAAG,QAAQ,CAAC;aAClB,YAAO,GAAG,SAAS,CAAC;aAEpB,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5F,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\nexport class SchemaTypes {\n static readonly SELECT = 'select';\n static readonly UPDATE = 'update';\n static readonly CREATE = 'create';\n static readonly EXECUTE = 'execute';\n\n static readonly SCHEME_SET = new Set([this.SELECT, this.UPDATE, this.CREATE, this.EXECUTE]);\n\n static isValid(input: string): input is TSchemaType {\n return this.SCHEME_SET.has(input);\n }\n}\n\nexport type TSchemaType = TConstValue<typeof SchemaTypes>;\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/base/models/common/constants.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,WAAW;aACN,WAAM,GAAG,QAAQ,CAAC;aAClB,WAAM,GAAG,QAAQ,CAAC;aAClB,WAAM,GAAG,QAAQ,CAAC;aAClB,YAAO,GAAG,SAAS,CAAC;aAEpB,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5F,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAKH,iGAAiG;AACjG,MAAM,OAAO,UAAU;aACL,WAAM,GAAG,QAAQ,CAAC;aAClB,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEpD,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAMH,2FAA2F;AAC3F,MAAM,OAAO,aAAa;aACR,WAAM,GAAG,QAAQ,CAAC;aAClB,WAAM,GAAG,QAAQ,CAAC;aAElB,eAAU,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzE,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\nexport class SchemaTypes {\n static readonly SELECT = 'select';\n static readonly UPDATE = 'update';\n static readonly CREATE = 'create';\n static readonly EXECUTE = 'execute';\n\n static readonly SCHEME_SET = new Set([this.SELECT, this.UPDATE, this.CREATE, this.EXECUTE]);\n\n static isValid(input: string): input is TSchemaType {\n return this.SCHEME_SET.has(input);\n }\n}\n\nexport type TSchemaType = TConstValue<typeof SchemaTypes>;\n\n/** What `@model` declares. Only ENTITY (a table-backed model) exists; `type` may be left out. */\nexport class ModelTypes {\n static readonly ENTITY = 'entity';\n static readonly SCHEME_SET = new Set([this.ENTITY]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid model type values. */\nexport type TModelType = TConstValue<typeof ModelTypes>;\n\n/** The path-param id shape an entity family resolves to (`AbstractEntity.getIdType()`). */\nexport class IdSchemaTypes {\n static readonly NUMBER = 'number';\n static readonly STRING = 'string';\n\n static readonly SCHEME_SET = new Set<string>([this.NUMBER, this.STRING]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid id schema type values. */\nexport type TIdSchemaType = TConstValue<typeof IdSchemaTypes>;\n"]}
@@ -1,5 +1,5 @@
1
1
  import { z } from '@hono/zod-openapi';
2
- import type { TIdSchemaType } from './types/index.js';
2
+ import type { TIdSchemaType } from './constants.js';
3
3
  /**
4
4
  * The error RESPONSE for OpenAPI docs - here, beside the REST layer that already needs `@hono/zod-openapi`.
5
5
  * Named, so every route's `4XX` and `5XX` reference one `ErrorResponse` component.
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../src/base/models/common/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;iBA6BpB,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,GAAI,OAAO;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE;;;;iBAkC9D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,MAAM;IACrD,MAAM,EAAE,CAAC,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;;;;;;;CAMA,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI1B,CAAC;AAEF,mCAAmC;AACnC,KAAK,aAAa,GAAG;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,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MAAM,aAAa,GAAG,WAAW,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IAE1F,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AACxD,CAAC,CAAC;AAkBF,MAAM,CAAC,MAAM,YAAY,GAAG,CAI1B,IAAoD,EACpD,EAAE;IACF,MAAM,YAAY,GAAG,WAAW,CAAC;QAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,kBAAkB;QACnD,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;IAEjG,OAAO;QACL,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,eAAe;QAC3C,GAAG,cAAc,EAAE;KACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { z } from '@hono/zod-openapi';\nimport { HTTP } from '@venizia/ignis-helpers/common';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport type { TIdSchemaType } from './types';\n\n/**\n * The error RESPONSE for OpenAPI docs - here, beside the REST layer that already needs `@hono/zod-openapi`.\n * Named, so every route's `4XX` and `5XX` reference one `ErrorResponse` component.\n */\nexport const ErrorSchema = z\n .object({\n statusCode: z.number().optional(),\n message: z.string(),\n normalized: z\n .object({\n text: z.string(),\n code: z.string(),\n args: z.record(z.string(), z.any()),\n })\n .optional(),\n extra: z.record(z.string(), z.any()).optional(),\n requestId: z.string().optional(),\n details: z.record(z.string(), z.any()).optional(),\n })\n .openapi('ErrorResponse', {\n description: 'Error Schema',\n example: {\n statusCode: HTTP.ResultCodes.RS_4.Conflict,\n message: 'A category named %{name} already exists.',\n normalized: {\n text: 'A category named %{name} already exists.',\n code: 'server.commerce.category.create.duplicate_name',\n args: { name: 'Ticket' },\n },\n extra: { categoryId: 42 },\n requestId: 'abc-123-def',\n details: { url: 'http://localhost:3000/categories', path: '/categories' },\n },\n });\n\nexport type TErrorResponse = z.infer<typeof ErrorSchema>;\n\nexport const idParamsSchema = (opts?: { idType: TIdSchemaType }) => {\n const { idType = 'number' } = opts ?? {};\n\n switch (idType) {\n case 'number': {\n return z.object({\n id: z.number().openapi({\n param: {\n name: 'id',\n in: 'path',\n description: 'The unique id of the resource',\n },\n examples: [1, 2, 3],\n }),\n });\n }\n case 'string': {\n return z.object({\n id: z.string().openapi({\n param: {\n name: 'id',\n in: 'path',\n description: 'The unique id of the resource',\n },\n examples: ['4651e634-a530-4484-9b09-9616a28f35e3', 'some_unique_id'],\n }),\n });\n }\n default: {\n throw getError({\n message: `[idParamsSchema] Invalid input idType | valid: [string | number] | idType: ${idType}`,\n });\n }\n }\n};\n\nexport const jsonContent = <T extends z.ZodType>(opts: {\n schema: T;\n description: string;\n required?: boolean;\n}) => {\n return {\n description: opts.description,\n content: { 'application/json': { schema: opts.schema } },\n required: opts.required,\n };\n};\n\n/** The JSON error body of a route, under `4XX` and `5XX` - the range keys OpenAPI accepts. */\nexport const errorResponses = () => {\n const errorResponse = jsonContent({ description: 'Error Response', schema: ErrorSchema });\n\n return { '4XX': errorResponse, '5XX': errorResponse };\n};\n\n/** OpenAPI Header Object format */\ntype THeaderObject = {\n description?: string;\n schema: { type: string; examples?: Array<string> };\n};\n\n/** Map of header names to Header Objects */\ntype TResponseHeaders = Record<string, THeaderObject>;\n\ntype TJsonResponseOpts<T extends z.ZodType, H extends TResponseHeaders | undefined> = {\n schema: T;\n description?: string;\n required?: boolean;\n headers?: H;\n};\n\nexport const jsonResponse = <\n ContentSchema extends z.ZodType,\n HeaderSchema extends TResponseHeaders | undefined = undefined,\n>(\n opts: TJsonResponseOpts<ContentSchema, HeaderSchema>,\n) => {\n const baseResponse = jsonContent({\n required: opts.required,\n description: opts.description ?? 'Success Response',\n schema: opts.schema,\n });\n\n const successResponse = opts.headers ? { ...baseResponse, headers: opts.headers } : baseResponse;\n\n return {\n [HTTP.ResultCodes.RS_2.Ok]: successResponse,\n ...errorResponses(),\n };\n};\n"]}
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../../src/base/models/common/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC;SACV,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;KACpC,CAAC;SACD,QAAQ,EAAE;IACb,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;CAClD,CAAC;KACD,OAAO,CAAC,eAAe,EAAE;IACxB,WAAW,EAAE,cAAc;IAC3B,O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port { HTTP } from '@venizia/ignis-helpers/common';\nimport { getError } from '@venizia/ignis-helpers/core';\nimport type { TIdSchemaType } from './constants';\n\n/**\n * The error RESPONSE for OpenAPI docs - here, beside the REST layer that already needs `@hono/zod-openapi`.\n * Named, so every route's `4XX` and `5XX` reference one `ErrorResponse` component.\n */\nexport const ErrorSchema = z\n .object({\n statusCode: z.number().optional(),\n message: z.string(),\n normalized: z\n .object({\n text: z.string(),\n code: z.string(),\n args: z.record(z.string(), z.any()),\n })\n .optional(),\n extra: z.record(z.string(), z.any()).optional(),\n requestId: z.string().optional(),\n details: z.record(z.string(), z.any()).optional(),\n })\n .openapi('ErrorResponse', {\n description: 'Error Schema',\n example: {\n statusCode: HTTP.ResultCodes.RS_4.Conflict,\n message: 'A category named %{name} already exists.',\n normalized: {\n text: 'A category named %{name} already exists.',\n code: 'server.commerce.category.create.duplicate_name',\n args: { name: 'Ticket' },\n },\n extra: { categoryId: 42 },\n requestId: 'abc-123-def',\n details: { url: 'http://localhost:3000/categories', path: '/categories' },\n },\n });\n\nexport type TErrorResponse = z.infer<typeof ErrorSchema>;\n\nexport const idParamsSchema = (opts?: { idType: TIdSchemaType }) => {\n const { idType = 'number' } = opts ?? {};\n\n switch (idType) {\n case 'number': {\n return z.object({\n id: z.number().openapi({\n param: {\n name: 'id',\n in: 'path',\n description: 'The unique id of the resource',\n },\n examples: [1, 2, 3],\n }),\n });\n }\n case 'string': {\n return z.object({\n id: z.string().openapi({\n param: {\n name: 'id',\n in: 'path',\n description: 'The unique id of the resource',\n },\n examples: ['4651e634-a530-4484-9b09-9616a28f35e3', 'some_unique_id'],\n }),\n });\n }\n default: {\n throw getError({\n message: `[idParamsSchema] Invalid input idType | valid: [string | number] | idType: ${idType}`,\n });\n }\n }\n};\n\nexport const jsonContent = <T extends z.ZodType>(opts: {\n schema: T;\n description: string;\n required?: boolean;\n}) => {\n return {\n description: opts.description,\n content: { 'application/json': { schema: opts.schema } },\n required: opts.required,\n };\n};\n\n/** The JSON error body of a route, under `4XX` and `5XX` - the range keys OpenAPI accepts. */\nexport const errorResponses = () => {\n const errorResponse = jsonContent({ description: 'Error Response', schema: ErrorSchema });\n\n return { '4XX': errorResponse, '5XX': errorResponse };\n};\n\n/** OpenAPI Header Object format */\ntype THeaderObject = {\n description?: string;\n schema: { type: string; examples?: Array<string> };\n};\n\n/** Map of header names to Header Objects */\ntype TResponseHeaders = Record<string, THeaderObject>;\n\ntype TJsonResponseOpts<T extends z.ZodType, H extends TResponseHeaders | undefined> = {\n schema: T;\n description?: string;\n required?: boolean;\n headers?: H;\n};\n\nexport const jsonResponse = <\n ContentSchema extends z.ZodType,\n HeaderSchema extends TResponseHeaders | undefined = undefined,\n>(\n opts: TJsonResponseOpts<ContentSchema, HeaderSchema>,\n) => {\n const baseResponse = jsonContent({\n required: opts.required,\n description: opts.description ?? 'Success Response',\n schema: opts.schema,\n });\n\n const successResponse = opts.headers ? { ...baseResponse, headers: opts.headers } : baseResponse;\n\n return {\n [HTTP.ResultCodes.RS_2.Ok]: successResponse,\n ...errorResponses(),\n };\n};\n"]}
@@ -18,7 +18,5 @@ declare const entityIdBrand: unique symbol;
18
18
  export type TEntityId = string & {
19
19
  readonly [entityIdBrand]: never;
20
20
  };
21
- /** Path-param id shape every entity family resolves to (`AbstractEntity.getIdType()`). */
22
- export type TIdSchemaType = 'number' | 'string';
23
21
  export {};
24
22
  //# sourceMappingURL=id.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../../../src/base/models/common/types/id.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AAEhE,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAErE,0FAA0F;AAC1F,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../../../src/base/models/common/types/id.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AAEhE,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"id.js","sourceRoot":"","sources":["../../../../../../src/base/models/common/types/id.ts"],"names":[],"mappings":"","sourcesContent":["export type NumberIdType = number;\nexport type StringIdType = string;\nexport type BigIntIdType = bigint;\nexport type IdType = NumberIdType | StringIdType | BigIntIdType;\n\ndeclare const entityIdBrand: unique symbol;\n\n/**\n * A string id a plain `string` cannot be assigned to, so passing a name, code or email where an id\n * belongs is a compile error. Opt a column in with `.$type<TEntityId>()`.\n *\n * IT VALIDATES NOTHING. `toEntityId` is a cast with a non-empty check; the value is making the\n * laundering VISIBLE at each boundary, not proving the string is a real id.\n *\n * The cost is not optional: Drizzle derives `$inferInsert` and `$inferSelect` from the same field,\n * so a branded column rejects every literal - `create({ data: { merchantId: 'M1' } })`, seeds,\n * fixtures, path params - until each converts. A union with `string` would restore those but makes\n * a plain `string` assignable again, which erases the whole guarantee. Measured, not assumed.\n */\nexport type TEntityId = string & { readonly [entityIdBrand]: never };\n\n/** Path-param id shape every entity family resolves to (`AbstractEntity.getIdType()`). */\nexport type TIdSchemaType = 'number' | 'string';\n"]}
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../../../../../src/base/models/common/types/id.ts"],"names":[],"mappings":"","sourcesContent":["export type NumberIdType = number;\nexport type StringIdType = string;\nexport type BigIntIdType = bigint;\nexport type IdType = NumberIdType | StringIdType | BigIntIdType;\n\ndeclare const entityIdBrand: unique symbol;\n\n/**\n * A string id a plain `string` cannot be assigned to, so passing a name, code or email where an id\n * belongs is a compile error. Opt a column in with `.$type<TEntityId>()`.\n *\n * IT VALIDATES NOTHING. `toEntityId` is a cast with a non-empty check; the value is making the\n * laundering VISIBLE at each boundary, not proving the string is a real id.\n *\n * The cost is not optional: Drizzle derives `$inferInsert` and `$inferSelect` from the same field,\n * so a branded column rejects every literal - `create({ data: { merchantId: 'M1' } })`, seeds,\n * fixtures, path params - until each converts. A union with `string` would restore those but makes\n * a plain `string` assignable again, which erases the whole guarantee. Measured, not assumed.\n */\nexport type TEntityId = string & { readonly [entityIdBrand]: never };\n"]}
@@ -32,7 +32,7 @@ export declare class RepositoryTypes {
32
32
  }
33
33
  /** Valid repository type values. */
34
34
  export type TRepositoryType = TConstValue<typeof RepositoryTypes>;
35
- /** What a row-scope filter (`@model` settings.scopeFilter) does when `resolve()` returns null/undefined. */
35
+ /** What a row-scope filter (`@model` settings.access) does when `resolve()` returns null/undefined. */
36
36
  export declare class ScopeFilterMissingBehaviors {
37
37
  /** An unresolved scope matches ZERO rows - the safe reading of "caller's scope is unknown". */
38
38
  static readonly DENY = "deny";
@@ -43,6 +43,21 @@ export declare class ScopeFilterMissingBehaviors {
43
43
  }
44
44
  /** Valid scope-filter missing-behavior values. */
45
45
  export type TScopeFilterMissingBehavior = TConstValue<typeof ScopeFilterMissingBehaviors>;
46
+ /**
47
+ * What a scoped write does with a row whose scope column disagrees with the resolved scope
48
+ * (`@model` settings.access.write.mode). A scope that returns `ScopeFilters.UNRESTRICTED`
49
+ * passes either way.
50
+ */
51
+ export declare class ScopeWriteGuards {
52
+ /** Default. A row whose scope column disagrees, or is absent on create, is refused and nothing is written. */
53
+ static readonly REJECT = "reject";
54
+ /** An ABSENT scope column is filled from an equality scope; a value that disagrees is still refused. */
55
+ static readonly ASSIGN = "assign";
56
+ static readonly SCHEME_SET: Set<string>;
57
+ static isValid(guard: string): boolean;
58
+ }
59
+ /** Valid scope write-guard values. */
60
+ export type TScopeWriteGuard = TConstValue<typeof ScopeWriteGuards>;
46
61
  /**
47
62
  * The third `resolve()` state, beside a `where` and `deny`-by-default null/undefined: unrestricted
48
63
  * for THIS call. `onMissing: 'allow'` cannot express it - `onMissing` lives on the model's static
@@ -62,6 +77,8 @@ export declare class ScopeFilters {
62
77
  export declare class RepositoryErrorCodes {
63
78
  /** A verb the repository's `operationScope` does not permit (e.g. `create()` on a READ_ONLY one). */
64
79
  static readonly OPERATION_NOT_ALLOWED: string;
80
+ /** A write whose scope column disagrees with the resolved scope, or whose scope cannot be verified (`access` write guard). */
81
+ static readonly SCOPE_WRITE_DENIED: string;
65
82
  }
66
83
  /** Valid repository error code values. */
67
84
  export type TRepositoryErrorCode = TConstValue<typeof RepositoryErrorCodes>;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/base/repositories/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE,uDAAuD;AACvD,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC,gGAAgG;AAChG,qBAAa,yBAAyB;IACpC,MAAM,CAAC,QAAQ,CAAC,SAAS,eAAe;IACxC,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC1C,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAgB;IAC1C,MA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QAAQ,CAAC,qBAAqB,SAElC;IAEH,8HAA8H;IAC9H,MAAM,CAAC,QAAQ,CAAC,kBAAkB,SAE/B;CACJ;AAED,0CAA0C;AAC1C,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE5E,mEAAmE;AACnE,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAkC;IAE5D,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;CAGzC;AAED,kCAAkC;AAClC,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC;AAE9D,yEAAyE;AACzE,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,aAAa,mBAAmB;IAChD,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,SAAS,eAAe;IACxC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAKvB;IAEH,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAG1C;AAED,kCAAkC;AAClC,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -32,7 +32,7 @@ export class RepositoryTypes {
32
32
  return this.SCHEME_SET.has(value);
33
33
  }
34
34
  }
35
- /** What a row-scope filter (`@model` settings.scopeFilter) does when `resolve()` returns null/undefined. */
35
+ /** What a row-scope filter (`@model` settings.access) does when `resolve()` returns null/undefined. */
36
36
  export class ScopeFilterMissingBehaviors {
37
37
  /** An unresolved scope matches ZERO rows - the safe reading of "caller's scope is unknown". */
38
38
  static { this.DENY = 'deny'; }
@@ -43,6 +43,21 @@ export class ScopeFilterMissingBehaviors {
43
43
  return this.SCHEME_SET.has(behavior);
44
44
  }
45
45
  }
46
+ /**
47
+ * What a scoped write does with a row whose scope column disagrees with the resolved scope
48
+ * (`@model` settings.access.write.mode). A scope that returns `ScopeFilters.UNRESTRICTED`
49
+ * passes either way.
50
+ */
51
+ export class ScopeWriteGuards {
52
+ /** Default. A row whose scope column disagrees, or is absent on create, is refused and nothing is written. */
53
+ static { this.REJECT = 'reject'; }
54
+ /** An ABSENT scope column is filled from an equality scope; a value that disagrees is still refused. */
55
+ static { this.ASSIGN = 'assign'; }
56
+ static { this.SCHEME_SET = new Set([this.REJECT, this.ASSIGN]); }
57
+ static isValid(guard) {
58
+ return this.SCHEME_SET.has(guard);
59
+ }
60
+ }
46
61
  /**
47
62
  * The third `resolve()` state, beside a `where` and `deny`-by-default null/undefined: unrestricted
48
63
  * for THIS call. `onMissing: 'allow'` cannot express it - `onMissing` lives on the model's static
@@ -64,6 +79,10 @@ export class RepositoryErrorCodes {
64
79
  static { this.OPERATION_NOT_ALLOWED = MessageCode.build({
65
80
  parts: ['core', 'repository', 'operation_not_allowed'],
66
81
  }); }
82
+ /** A write whose scope column disagrees with the resolved scope, or whose scope cannot be verified (`access` write guard). */
83
+ static { this.SCOPE_WRITE_DENIED = MessageCode.build({
84
+ parts: ['core', 'repository', 'scope_write_denied'],
85
+ }); }
67
86
  }
68
87
  /** Entity relation types (one-to-one/many-to-one, one-to-many). */
69
88
  export class RelationTypes {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/base/repositories/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,uDAAuD;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAEhC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC,gGAAgG;AAChG,MAAM,OAAO,yBAAyB;aACpB,cAAS,GAAG,WA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E,CAAC,MAAM,EAAE,YAAY,EAAE,uBAAuB,CAAC;KACvD,CAAC,CAAC;;AAML,mEAAmE;AACnE,MAAM,OAAO,aAAa;aACR,QAAG,GAAG,KAAK,CAAC;aACZ,SAAI,GAAG,MAAM,CAAC;aACd,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE5D,MAAM,CAAC,OAAO,CAAC,OAAe;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;;AAMH,yEAAyE;AACzE,MAAM,OAAO,aAAa;aACR,WAAM,GAAG,QAAQ,CAAC;aAClB,kBAAa,GAAG,eAAe,CAAC;aAChC,UAAK,GAAG,OAAO,CAAC;aAChB,cAAS,GAAG,WAAW,CAAC;aACxB,eAAU,GAAG,IAAI,GAAG,CAAC;QACnC,IAAI,CAAC,MAAM;QACX,IAAI,CAAC,aAAa;QAClB,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,SAAS;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,QAAgB;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC","sourcesContent":["import type { TConstValue } from '@venizia/ignis-helpers/common';\nimport { MessageCode } from '@venizia/ignis-helpers/core';\n\n/** Default pagination limit for repository queries. */\nexport const DEFAULT_LIMIT = 10;\n\n/**\n * Largest `limit` a caller may ask for when a model declares no `maxLimit`.\n *\n * POLICY, not capacity - it sits far below what an engine can physically serve. It exists because\n * removing an accidental guardrail without replacing it would leave the framework less safe than\n * before: a search engine refused a page over 250 hits, so `limit: 5000` failed fast and cheap.\n * Once that page is served, something has to decide when a page is unreasonable.\n *\n * 1000 sits above any list screen and well below the physical ceiling, so reaching it means the\n * caller is doing something unusual - and a model raises it by saying so explicitly.\n */\nexport const DEFAULT_MAX_LIMIT = 1000;\n\n/** Defines the operation scope for repository instances (READ_ONLY, WRITE_ONLY, READ_WRITE). */\nexport class RepositoryOperationScopes {\n static readonly READ_ONLY = 'READ_ONLY';\n static readonly WRITE_ONLY = 'WRITE_ONLY';\n static readonly READ_WRITE = 'READ_WRITE';\n static readonly SCHEME_SET = new Set([this.READ_ONLY, this.WRITE_ONLY, this.READ_WRITE]);\n\n static isValid(orgType: string): boolean {\n return this.SCHEME_SET.has(orgType);\n }\n}\n\n/** Valid repository operation scope values. */\nexport type TRepositoryOperationScope = TConstValue<typeof RepositoryOperationScopes>;\n\n/** What `@repository` binds: MODEL, a model this application declares (the default); REMOTE, data behind another service's API, with no model. */\nexport class RepositoryTypes {\n static readonly MODEL = 'model';\n static readonly REMOTE = 'remote';\n static readonly SCHEME_SET = new Set([this.MODEL, this.REMOTE]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid repository type values. */\nexport type TRepositoryType = TConstValue<typeof RepositoryTypes>;\n\n/** What a row-scope filter (`@model` settings.scopeFilter) does when `resolve()` returns null/undefined. */\nexport class ScopeFilterMissingBehaviors {\n /** An unresolved scope matches ZERO rows - the safe reading of \"caller's scope is unknown\". */\n static readonly DENY = 'deny';\n /** Explicit opt-out: no scope is applied. For migrations and background jobs, never inferred from a request. */\n static readonly ALLOW = 'allow';\n static readonly SCHEME_SET = new Set([this.DENY, this.ALLOW]);\n\n static isValid(behavior: string): boolean {\n return this.SCHEME_SET.has(behavior);\n }\n}\n\n/** Valid scope-filter missing-behavior values. */\nexport type TScopeFilterMissingBehavior = TConstValue<typeof ScopeFilterMissingBehaviors>;\n\n/**\n * The third `resolve()` state, beside a `where` and `deny`-by-default null/undefined: unrestricted\n * for THIS call. `onMissing: 'allow'` cannot express it - `onMissing` lives on the model's static\n * settings, so using it for a per-user bypass (an internal operator) would also unscope every\n * ordinary user whose `resolve()` happens to return nothing.\n */\nexport class ScopeFilters {\n /**\n * Return from `resolve()` to apply NO scope for this request - a caller the application has\n * decided sees everything. Deliberately a symbol: forgetting to return must land in deny, and no\n * JSON body, query string, or header can ever produce this value. `Symbol.for` so two installed\n * copies of this package agree on identity, same as `DATA_SOURCE_BRAND`.\n */\n static readonly UNRESTRICTED = Symbol.for('@venizia/ignis-kernel:scope-filter-unrestricted');\n}\n\n/** Machine-readable codes for repository-level failures, in the dotted namespace core already uses (`core.not_supported`, `core.search_engine.*`) - a client maps the code, never the message. */\nexport class RepositoryErrorCodes {\n /** A verb the repository's `operationScope` does not permit (e.g. `create()` on a READ_ONLY one). */\n static readonly OPERATION_NOT_ALLOWED = MessageCode.build({\n parts: ['core', 'repository', 'operation_not_allowed'],\n });\n}\n\n/** Valid repository error code values. */\nexport type TRepositoryErrorCode = TConstValue<typeof RepositoryErrorCodes>;\n\n/** Entity relation types (one-to-one/many-to-one, one-to-many). */\nexport class RelationTypes {\n static readonly ONE = 'one';\n static readonly MANY = 'many';\n static readonly SCHEME_SET = new Set([this.ONE, this.MANY]);\n\n static isValid(orgType: string): boolean {\n return this.SCHEME_SET.has(orgType);\n }\n}\n\n/** Valid relation type values. */\nexport type TRelationType = TConstValue<typeof RelationTypes>;\n\n/** PostgreSQL row-level lock strengths for SELECT ... FOR <strength>. */\nexport class LockStrengths {\n static readonly UPDATE = 'update';\n static readonly NO_KEY_UPDATE = 'no key update';\n static readonly SHARE = 'share';\n static readonly KEY_SHARE = 'key share';\n static readonly SCHEME_SET = new Set([\n this.UPDATE,\n this.NO_KEY_UPDATE,\n this.SHARE,\n this.KEY_SHARE,\n ]);\n\n static isValid(strength: string): boolean {\n return this.SCHEME_SET.has(strength);\n }\n}\n\n/** Valid lock strength values. */\nexport type TLockStrength = TConstValue<typeof LockStrengths>;\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/base/repositories/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,uDAAuD;AACvD,MAAM,CAAC,M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AAC;QACnC,IAAI,CAAC,MAAM;QACX,IAAI,CAAC,aAAa;QAClB,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,SAAS;KACf,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC,QAAgB;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC","sourcesContent":["import type { TConstValue } from '@venizia/ignis-helpers/common';\nimport { MessageCode } from '@venizia/ignis-helpers/core';\n\n/** Default pagination limit for repository queries. */\nexport const DEFAULT_LIMIT = 10;\n\n/**\n * Largest `limit` a caller may ask for when a model declares no `maxLimit`.\n *\n * POLICY, not capacity - it sits far below what an engine can physically serve. It exists because\n * removing an accidental guardrail without replacing it would leave the framework less safe than\n * before: a search engine refused a page over 250 hits, so `limit: 5000` failed fast and cheap.\n * Once that page is served, something has to decide when a page is unreasonable.\n *\n * 1000 sits above any list screen and well below the physical ceiling, so reaching it means the\n * caller is doing something unusual - and a model raises it by saying so explicitly.\n */\nexport const DEFAULT_MAX_LIMIT = 1000;\n\n/** Defines the operation scope for repository instances (READ_ONLY, WRITE_ONLY, READ_WRITE). */\nexport class RepositoryOperationScopes {\n static readonly READ_ONLY = 'READ_ONLY';\n static readonly WRITE_ONLY = 'WRITE_ONLY';\n static readonly READ_WRITE = 'READ_WRITE';\n static readonly SCHEME_SET = new Set([this.READ_ONLY, this.WRITE_ONLY, this.READ_WRITE]);\n\n static isValid(orgType: string): boolean {\n return this.SCHEME_SET.has(orgType);\n }\n}\n\n/** Valid repository operation scope values. */\nexport type TRepositoryOperationScope = TConstValue<typeof RepositoryOperationScopes>;\n\n/** What `@repository` binds: MODEL, a model this application declares (the default); REMOTE, data behind another service's API, with no model. */\nexport class RepositoryTypes {\n static readonly MODEL = 'model';\n static readonly REMOTE = 'remote';\n static readonly SCHEME_SET = new Set([this.MODEL, this.REMOTE]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid repository type values. */\nexport type TRepositoryType = TConstValue<typeof RepositoryTypes>;\n\n/** What a row-scope filter (`@model` settings.access) does when `resolve()` returns null/undefined. */\nexport class ScopeFilterMissingBehaviors {\n /** An unresolved scope matches ZERO rows - the safe reading of \"caller's scope is unknown\". */\n static readonly DENY = 'deny';\n /** Explicit opt-out: no scope is applied. For migrations and background jobs, never inferred from a request. */\n static readonly ALLOW = 'allow';\n static readonly SCHEME_SET = new Set([this.DENY, this.ALLOW]);\n\n static isValid(behavior: string): boolean {\n return this.SCHEME_SET.has(behavior);\n }\n}\n\n/** Valid scope-filter missing-behavior values. */\nexport type TScopeFilterMissingBehavior = TConstValue<typeof ScopeFilterMissingBehaviors>;\n\n/**\n * What a scoped write does with a row whose scope column disagrees with the resolved scope\n * (`@model` settings.access.write.mode). A scope that returns `ScopeFilters.UNRESTRICTED`\n * passes either way.\n */\nexport class ScopeWriteGuards {\n /** Default. A row whose scope column disagrees, or is absent on create, is refused and nothing is written. */\n static readonly REJECT = 'reject';\n /** An ABSENT scope column is filled from an equality scope; a value that disagrees is still refused. */\n static readonly ASSIGN = 'assign';\n static readonly SCHEME_SET = new Set([this.REJECT, this.ASSIGN]);\n\n static isValid(guard: string): boolean {\n return this.SCHEME_SET.has(guard);\n }\n}\n\n/** Valid scope write-guard values. */\nexport type TScopeWriteGuard = TConstValue<typeof ScopeWriteGuards>;\n\n/**\n * The third `resolve()` state, beside a `where` and `deny`-by-default null/undefined: unrestricted\n * for THIS call. `onMissing: 'allow'` cannot express it - `onMissing` lives on the model's static\n * settings, so using it for a per-user bypass (an internal operator) would also unscope every\n * ordinary user whose `resolve()` happens to return nothing.\n */\nexport class ScopeFilters {\n /**\n * Return from `resolve()` to apply NO scope for this request - a caller the application has\n * decided sees everything. Deliberately a symbol: forgetting to return must land in deny, and no\n * JSON body, query string, or header can ever produce this value. `Symbol.for` so two installed\n * copies of this package agree on identity, same as `DATA_SOURCE_BRAND`.\n */\n static readonly UNRESTRICTED = Symbol.for('@venizia/ignis-kernel:scope-filter-unrestricted');\n}\n\n/** Machine-readable codes for repository-level failures, in the dotted namespace core already uses (`core.not_supported`, `core.search_engine.*`) - a client maps the code, never the message. */\nexport class RepositoryErrorCodes {\n /** A verb the repository's `operationScope` does not permit (e.g. `create()` on a READ_ONLY one). */\n static readonly OPERATION_NOT_ALLOWED = MessageCode.build({\n parts: ['core', 'repository', 'operation_not_allowed'],\n });\n\n /** A write whose scope column disagrees with the resolved scope, or whose scope cannot be verified (`access` write guard). */\n static readonly SCOPE_WRITE_DENIED = MessageCode.build({\n parts: ['core', 'repository', 'scope_write_denied'],\n });\n}\n\n/** Valid repository error code values. */\nexport type TRepositoryErrorCode = TConstValue<typeof RepositoryErrorCodes>;\n\n/** Entity relation types (one-to-one/many-to-one, one-to-many). */\nexport class RelationTypes {\n static readonly ONE = 'one';\n static readonly MANY = 'many';\n static readonly SCHEME_SET = new Set([this.ONE, this.MANY]);\n\n static isValid(orgType: string): boolean {\n return this.SCHEME_SET.has(orgType);\n }\n}\n\n/** Valid relation type values. */\nexport type TRelationType = TConstValue<typeof RelationTypes>;\n\n/** PostgreSQL row-level lock strengths for SELECT ... FOR <strength>. */\nexport class LockStrengths {\n static readonly UPDATE = 'update';\n static readonly NO_KEY_UPDATE = 'no key update';\n static readonly SHARE = 'share';\n static readonly KEY_SHARE = 'key share';\n static readonly SCHEME_SET = new Set([\n this.UPDATE,\n this.NO_KEY_UPDATE,\n this.SHARE,\n this.KEY_SHARE,\n ]);\n\n static isValid(strength: string): boolean {\n return this.SCHEME_SET.has(strength);\n }\n}\n\n/** Valid lock strength values. */\nexport type TLockStrength = TConstValue<typeof LockStrengths>;\n"]}
@@ -42,7 +42,7 @@ export declare abstract class AbstractRepository<TDataObject extends object, TPe
42
42
  */
43
43
  protected get modelSettings(): IModelMetadata['settings'];
44
44
  protected get hiddenFields(): string[];
45
- /** Default where from @model settings.defaultFilter.where, AND-merged into every query unless skipped. */
45
+ /** Default where from @model settings.query.filter.where, AND-merged into every query unless skipped. */
46
46
  protected get defaultWhere(): TWhere | undefined;
47
47
  protected get defaultLimit(): number | undefined;
48
48
  /** Largest `limit` a caller may ask for, when the model declares one; undefined leaves the tier's own default in force. */
@@ -1 +1 @@
1
- {"version":3,"file":"abstract.d.ts","sourceRoot":"","sources":["../../../../../src/base/repositories/core/abstract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAY,MAAM,6BAA6B,CAAC;AAGnE,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,MAAM,EACN,cAAc,EACd,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,OAAO,EAEP,IAAI,EACJ,MAAM,EACP,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,8BAAsB,kBAAkB,CACtC,WAAW,SAAS,MAAM,EAC1B,cAAc,SAAS,MAAM,GAAG,WAAW,EAC3C,QAAQ,SAAS,aAAa,GAAG,aAAa,CAE9C,SAAQ,UACR,YAAW,sBAAsB,CAAC,WAAW,EAAE,cAAc,EAAE,QAAQ,CAAC;IAExE,SAAS,CAAC,eAAe,EAAE,yBAAyB,CAAC;IAErD,oEAAoE;IACpE,SAAS,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAE3C,+DAA+D;IAC/D,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAEnC;;;OAGG;IACH,OAAO,CAAC,cAAc,CAA2C;gBAG/D,UAAU,C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AC,EAAE,OAAO,CAAA;SAAE,CAAC;KAC/D,GAAG,OAAO,CAAC,MAAM,GAAG;QAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;KAAE,CAAC;CAahD"}
@@ -72,16 +72,16 @@ export class AbstractRepository extends BaseHelper {
72
72
  get hiddenFields() {
73
73
  return this.modelSettings?.hiddenProperties ?? [];
74
74
  }
75
- /** Default where from @model settings.defaultFilter.where, AND-merged into every query unless skipped. */
75
+ /** Default where from @model settings.query.filter.where, AND-merged into every query unless skipped. */
76
76
  get defaultWhere() {
77
- return this.modelSettings?.defaultFilter?.where;
77
+ return this.modelSettings?.query?.filter?.where;
78
78
  }
79
79
  get defaultLimit() {
80
- return this.modelSettings?.defaultLimit;
80
+ return this.modelSettings?.query?.limit?.default;
81
81
  }
82
82
  /** Largest `limit` a caller may ask for, when the model declares one; undefined leaves the tier's own default in force. */
83
83
  get maxLimit() {
84
- return this.modelSettings?.maxLimit;
84
+ return this.modelSettings?.query?.limit?.max;
85
85
  }
86
86
  /**
87
87
  * Both bounds, in one place, for every tier.