@venizia/ignis-kernel 0.4.7-0 → 0.4.7-1

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 (161) hide show
  1. package/LICENSE.md +1 -4
  2. package/dist/esm/base/applications/cors.d.ts +12 -10
  3. package/dist/esm/base/applications/cors.d.ts.map +1 -1
  4. package/dist/esm/base/applications/cors.js +37 -35
  5. package/dist/esm/base/applications/cors.js.map +1 -1
  6. package/dist/esm/base/applications/rest.js +11 -11
  7. package/dist/esm/base/applications/rest.js.map +1 -1
  8. package/dist/esm/base/auth/authenticate/common/codecs.js +2 -2
  9. package/dist/esm/base/auth/authenticate/common/codecs.js.map +1 -1
  10. package/dist/esm/base/auth/authenticate/strategies/strategy-registry.d.ts +1 -1
  11. package/dist/esm/base/auth/authenticate/strategies/strategy-registry.js +1 -1
  12. package/dist/esm/base/auth/authenticate/strategies/strategy-registry.js.map +1 -1
  13. package/dist/esm/base/auth/authorize/providers/authorization.provider.js +7 -7
  14. package/dist/esm/base/auth/authorize/providers/authorization.provider.js.map +1 -1
  15. package/dist/esm/base/auth/authorize/providers/request-domain.d.ts +14 -11
  16. package/dist/esm/base/auth/authorize/providers/request-domain.d.ts.map +1 -1
  17. package/dist/esm/base/auth/authorize/providers/request-domain.js +42 -39
  18. package/dist/esm/base/auth/authorize/providers/request-domain.js.map +1 -1
  19. package/dist/esm/base/auth/base/abstract-auth-registry.js +2 -2
  20. package/dist/esm/base/auth/base/abstract-auth-registry.js.map +1 -1
  21. package/dist/esm/base/auth/models/requests/change-password.schema.js +3 -3
  22. package/dist/esm/base/auth/models/requests/change-password.schema.js.map +1 -1
  23. package/dist/esm/base/auth/models/requests/sign-in.schema.js +5 -5
  24. package/dist/esm/base/auth/models/requests/sign-in.schema.js.map +1 -1
  25. package/dist/esm/base/components/controller/rest/rest.component.js +2 -2
  26. package/dist/esm/base/components/controller/rest/rest.component.js.map +1 -1
  27. package/dist/esm/base/controllers/common/index.d.ts +0 -1
  28. package/dist/esm/base/controllers/common/index.d.ts.map +1 -1
  29. package/dist/esm/base/controllers/common/index.js +0 -1
  30. package/dist/esm/base/controllers/common/index.js.map +1 -1
  31. package/dist/esm/base/controllers/common/schema-builders.d.ts +0 -5
  32. package/dist/esm/base/controllers/common/schema-builders.d.ts.map +1 -1
  33. package/dist/esm/base/controllers/common/schema-builders.js +0 -14
  34. package/dist/esm/base/controllers/common/schema-builders.js.map +1 -1
  35. package/dist/esm/base/controllers/context.d.ts +7 -2
  36. package/dist/esm/base/controllers/context.d.ts.map +1 -1
  37. package/dist/esm/base/controllers/context.js +7 -4
  38. package/dist/esm/base/controllers/context.js.map +1 -1
  39. package/dist/esm/base/controllers/factory/controller.d.ts +33 -1
  40. package/dist/esm/base/controllers/factory/controller.d.ts.map +1 -1
  41. package/dist/esm/base/controllers/factory/controller.js +90 -6
  42. package/dist/esm/base/controllers/factory/controller.js.map +1 -1
  43. package/dist/esm/base/controllers/factory/definition.d.ts +1 -8
  44. package/dist/esm/base/controllers/factory/definition.d.ts.map +1 -1
  45. package/dist/esm/base/controllers/factory/definition.js +17 -24
  46. package/dist/esm/base/controllers/factory/definition.js.map +1 -1
  47. package/dist/esm/base/controllers/factory/index.d.ts +0 -1
  48. package/dist/esm/base/controllers/factory/index.d.ts.map +1 -1
  49. package/dist/esm/base/controllers/factory/index.js +0 -1
  50. package/dist/esm/base/controllers/factory/index.js.map +1 -1
  51. package/dist/esm/base/controllers/rest/abstract.d.ts.map +1 -1
  52. package/dist/esm/base/controllers/rest/abstract.js +6 -6
  53. package/dist/esm/base/controllers/rest/abstract.js.map +1 -1
  54. package/dist/esm/base/controllers/rest/base.d.ts +0 -5
  55. package/dist/esm/base/controllers/rest/base.d.ts.map +1 -1
  56. package/dist/esm/base/controllers/rest/base.js +14 -14
  57. package/dist/esm/base/controllers/rest/base.js.map +1 -1
  58. package/dist/esm/base/datasources/abstract.js +2 -2
  59. package/dist/esm/base/datasources/abstract.js.map +1 -1
  60. package/dist/esm/base/events/event-bus.js +4 -4
  61. package/dist/esm/base/events/event-bus.js.map +1 -1
  62. package/dist/esm/base/metadata/injectable.d.ts +7 -4
  63. package/dist/esm/base/metadata/injectable.d.ts.map +1 -1
  64. package/dist/esm/base/metadata/injectable.js +26 -23
  65. package/dist/esm/base/metadata/injectable.js.map +1 -1
  66. package/dist/esm/base/metadata/model-metadata.d.ts +27 -13
  67. package/dist/esm/base/metadata/model-metadata.d.ts.map +1 -1
  68. package/dist/esm/base/metadata/model-metadata.js +56 -26
  69. package/dist/esm/base/metadata/model-metadata.js.map +1 -1
  70. package/dist/esm/base/metadata/persistents.d.ts.map +1 -1
  71. package/dist/esm/base/metadata/persistents.js +21 -13
  72. package/dist/esm/base/metadata/persistents.js.map +1 -1
  73. package/dist/esm/base/metadata/routes/controller.d.ts.map +1 -1
  74. package/dist/esm/base/metadata/routes/controller.js +5 -2
  75. package/dist/esm/base/metadata/routes/controller.js.map +1 -1
  76. package/dist/esm/base/middlewares/app-error/app-error.middleware.js +7 -7
  77. package/dist/esm/base/middlewares/app-error/app-error.middleware.js.map +1 -1
  78. package/dist/esm/base/middlewares/app-error/database.handler.d.ts +14 -12
  79. package/dist/esm/base/middlewares/app-error/database.handler.d.ts.map +1 -1
  80. package/dist/esm/base/middlewares/app-error/database.handler.js +37 -35
  81. package/dist/esm/base/middlewares/app-error/database.handler.js.map +1 -1
  82. package/dist/esm/base/middlewares/app-error/zod.handler.d.ts +28 -23
  83. package/dist/esm/base/middlewares/app-error/zod.handler.d.ts.map +1 -1
  84. package/dist/esm/base/middlewares/app-error/zod.handler.js +56 -53
  85. package/dist/esm/base/middlewares/app-error/zod.handler.js.map +1 -1
  86. package/dist/esm/base/middlewares/emoji-favicon/emoji-favicon.middleware.d.ts +6 -4
  87. package/dist/esm/base/middlewares/emoji-favicon/emoji-favicon.middleware.d.ts.map +1 -1
  88. package/dist/esm/base/middlewares/emoji-favicon/emoji-favicon.middleware.js +14 -12
  89. package/dist/esm/base/middlewares/emoji-favicon/emoji-favicon.middleware.js.map +1 -1
  90. package/dist/esm/base/middlewares/form-body/form-body.middleware.d.ts +15 -11
  91. package/dist/esm/base/middlewares/form-body/form-body.middleware.d.ts.map +1 -1
  92. package/dist/esm/base/middlewares/form-body/form-body.middleware.js +25 -21
  93. package/dist/esm/base/middlewares/form-body/form-body.middleware.js.map +1 -1
  94. package/dist/esm/base/models/common/schemas.d.ts +184 -105
  95. package/dist/esm/base/models/common/schemas.d.ts.map +1 -1
  96. package/dist/esm/base/models/common/schemas.js +105 -54
  97. package/dist/esm/base/models/common/schemas.js.map +1 -1
  98. package/dist/esm/base/models/common/utilities.d.ts +10 -5
  99. package/dist/esm/base/models/common/utilities.d.ts.map +1 -1
  100. package/dist/esm/base/models/common/utilities.js +22 -16
  101. package/dist/esm/base/models/common/utilities.js.map +1 -1
  102. package/dist/esm/base/repositories/common/types/results.d.ts +15 -7
  103. package/dist/esm/base/repositories/common/types/results.d.ts.map +1 -1
  104. package/dist/esm/base/repositories/common/types/results.js +16 -7
  105. package/dist/esm/base/repositories/common/types/results.js.map +1 -1
  106. package/dist/esm/base/repositories/core/abstract.d.ts.map +1 -1
  107. package/dist/esm/base/repositories/core/abstract.js +5 -3
  108. package/dist/esm/base/repositories/core/abstract.js.map +1 -1
  109. package/dist/esm/base/repositories/query-schemas/index.d.ts +1 -1
  110. package/dist/esm/base/repositories/query-schemas/index.d.ts.map +1 -1
  111. package/dist/esm/base/repositories/query-schemas/index.js +3 -3
  112. package/dist/esm/base/repositories/query-schemas/index.js.map +1 -1
  113. package/dist/esm/helpers/inversion/common/relation-builder.js.map +1 -1
  114. package/dist/esm/helpers/inversion/index.d.ts +1 -1
  115. package/dist/esm/helpers/inversion/index.d.ts.map +1 -1
  116. package/dist/esm/helpers/inversion/index.js +1 -1
  117. package/dist/esm/helpers/inversion/index.js.map +1 -1
  118. package/dist/esm/helpers/inversion/mixins/repository.mixin.d.ts.map +1 -1
  119. package/dist/esm/helpers/inversion/mixins/repository.mixin.js +5 -5
  120. package/dist/esm/helpers/inversion/mixins/repository.mixin.js.map +1 -1
  121. package/dist/esm/metadata.d.ts +1 -1
  122. package/dist/esm/metadata.d.ts.map +1 -1
  123. package/dist/esm/metadata.js +1 -1
  124. package/dist/esm/metadata.js.map +1 -1
  125. package/dist/esm/repository.d.ts +2 -2
  126. package/dist/esm/repository.d.ts.map +1 -1
  127. package/dist/esm/repository.js +2 -2
  128. package/dist/esm/repository.js.map +1 -1
  129. package/dist/esm/utilities/index.d.ts +1 -1
  130. package/dist/esm/utilities/index.d.ts.map +1 -1
  131. package/dist/esm/utilities/index.js +1 -1
  132. package/dist/esm/utilities/index.js.map +1 -1
  133. package/dist/esm/utilities/not-supported.utility.d.ts +11 -0
  134. package/dist/esm/utilities/not-supported.utility.d.ts.map +1 -0
  135. package/dist/esm/utilities/not-supported.utility.js +19 -0
  136. package/dist/esm/utilities/not-supported.utility.js.map +1 -0
  137. package/package.json +6 -7
  138. package/dist/esm/base/controllers/common/html-response.d.ts +0 -70
  139. package/dist/esm/base/controllers/common/html-response.d.ts.map +0 -1
  140. package/dist/esm/base/controllers/common/html-response.js +0 -30
  141. package/dist/esm/base/controllers/common/html-response.js.map +0 -1
  142. package/dist/esm/base/controllers/factory/authorize-guard.d.ts +0 -19
  143. package/dist/esm/base/controllers/factory/authorize-guard.d.ts.map +0 -1
  144. package/dist/esm/base/controllers/factory/authorize-guard.js +0 -56
  145. package/dist/esm/base/controllers/factory/authorize-guard.js.map +0 -1
  146. package/dist/esm/base/controllers/factory/helper.d.ts +0 -2
  147. package/dist/esm/base/controllers/factory/helper.d.ts.map +0 -1
  148. package/dist/esm/base/controllers/factory/helper.js +0 -2
  149. package/dist/esm/base/controllers/factory/helper.js.map +0 -1
  150. package/dist/esm/base/controllers/factory/repository-injection.d.ts +0 -14
  151. package/dist/esm/base/controllers/factory/repository-injection.d.ts.map +0 -1
  152. package/dist/esm/base/controllers/factory/repository-injection.js +0 -27
  153. package/dist/esm/base/controllers/factory/repository-injection.js.map +0 -1
  154. package/dist/esm/base/metadata/model-settings.d.ts +0 -11
  155. package/dist/esm/base/metadata/model-settings.d.ts.map +0 -1
  156. package/dist/esm/base/metadata/model-settings.js +0 -30
  157. package/dist/esm/base/metadata/model-settings.js.map +0 -1
  158. package/dist/esm/utilities/error.utility.d.ts +0 -8
  159. package/dist/esm/utilities/error.utility.d.ts.map +0 -1
  160. package/dist/esm/utilities/error.utility.js +0 -14
  161. package/dist/esm/utilities/error.utility.js.map +0 -1
@@ -1,4 +1,4 @@
1
- /** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `buildQuerySchemas` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */
1
+ /** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `QuerySchemaFactory.build` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */
2
2
  import { z } from '@hono/zod-openapi';
3
3
  export declare const FieldsSchema: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodBoolean>, z.ZodArray<z.ZodString>]>>, FilterSchema: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
4
4
  where: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>, z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>]>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAEA,yaAAya;AACza,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAOtC,eAAO,MACL,YAAY,gGACZ,YAAY;;;;;;;;;;;;;;;;;;;;;;uBACZ,eAAe;;;qBACf,WAAW,8BACX,YAAY,8BACZ,aAAa,0CACb,UAAU,8BACV,WAAW,yNACwC,CAAC;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;iBAE5B,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;iBAE3B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAEA,gbAAgb;AAChb,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAOtC,eAAO,MACL,YAAY,gGACZ,YAAY;;;;;;;;;;;;;;;;;;;;;;uBACZ,eAAe;;;qBACf,WAAW,8BACX,YAAY,8BACZ,aAAa,0CACb,UAAU,8BACV,WAAW,yNAC+C,CAAC;AAE7D;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;iBAE5B,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;iBAE3B,CAAC"}
@@ -1,11 +1,11 @@
1
- import { buildQuerySchemas } from '@venizia/ignis-filter/schemas';
2
- /** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `buildQuerySchemas` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */
1
+ import { QuerySchemaFactory } from '@venizia/ignis-filter/schemas';
2
+ /** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `QuerySchemaFactory.build` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */
3
3
  import { z } from '@hono/zod-openapi';
4
4
  /** The schemas themselves live in `@venizia/ignis-filter`, built with plain `zod` so a browser can use them. Documentation metadata is injected here because it is a server concern - `.openapi()` returns a new schema rather than mutating, and three of the decorations sit on inner nodes, so they cannot be applied after the tree is composed. */
5
5
  const openApiDecorator = (schema, metadata) => {
6
6
  return schema.openapi(metadata);
7
7
  };
8
- export const { FieldsSchema, FilterSchema, InclusionSchema, LimitSchema, OffsetSchema, OrderBySchema, SkipSchema, WhereSchema, } = buildQuerySchemas({ decorate: openApiDecorator });
8
+ export const { FieldsSchema, FilterSchema, InclusionSchema, LimitSchema, OffsetSchema, OrderBySchema, SkipSchema, WhereSchema, } = QuerySchemaFactory.build({ decorate: openApiDecorator });
9
9
  /**
10
10
  * The query shape of a route that accepts a `filter`. The framework's own `find`, `findById` and
11
11
  * `findOne` use it, and a hand-written route gets the same contract by naming it.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,+BAA+B,CAAC;AAEzF,yaAAya;AACza,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,wVAAwV;AACxV,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;IAC9D,OAAQ,MAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,GACZ,GAAG,iBAAiB,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC;IAC1E,WAAW,EAAE,wDAAwD;CACtE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC;IAClF,WAAW,EAAE,mBAAmB;CACjC,CAAC,CAAC","sourcesContent":["import { buildQuerySchemas, type TSchemaDecorator } from '@venizia/ignis-filter/schemas';\n\n/** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `buildQuerySchemas` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */\nimport { z } from '@hono/zod-openapi';\n\n/** The schemas themselves live in `@venizia/ignis-filter`, built with plain `zod` so a browser can use them. Documentation metadata is injected here because it is a server concern - `.openapi()` returns a new schema rather than mutating, and three of the decorations sit on inner nodes, so they cannot be applied after the tree is composed. */\nconst openApiDecorator: TSchemaDecorator = (schema, metadata) => {\n return (schema as any).openapi(metadata);\n};\n\nexport const {\n FieldsSchema,\n FilterSchema,\n InclusionSchema,\n LimitSchema,\n OffsetSchema,\n OrderBySchema,\n SkipSchema,\n WhereSchema,\n} = buildQuerySchemas({ decorate: openApiDecorator });\n\n/**\n * The query shape of a route that accepts a `filter`. The framework's own `find`, `findById` and\n * `findOne` use it, and a hand-written route gets the same contract by naming it.\n *\n * `filter` needs no `.optional()` at the call site - {@link FilterSchema} already carries one, so a\n * second is a no-op and so is a trailing `.partial()`.\n *\n * Extend it rather than rebuilding it when a route takes more than `filter`:\n * `FilterQuerySchema.extend({ q: z.string().optional() })`.\n */\nexport const FilterQuerySchema = z.object({ filter: FilterSchema }).openapi({\n description: 'Filter with where, fields, limit, skip, order, include',\n});\n\n/**\n * The query shape of a route that accepts conditions and nothing else - `count` and anything shaped\n * like it. `where` is OPTIONAL here.\n *\n * `updateBy` and `deleteBy` deliberately do not use this. Their `where` is optional in the query\n * because it may ride in the body instead; the handler refuses a request that carries it in neither\n * place - a missing one there rewrites or deletes every row in the table.\n */\nexport const WhereQuerySchema = z.object({ where: WhereSchema.optional() }).openapi({\n description: 'Filter conditions',\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAyB,MAAM,+BAA+B,CAAC;AAE1F,gbAAgb;AAChb,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,wVAAwV;AACxV,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;IAC9D,OAAQ,MAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,GACZ,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAE7D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC;IAC1E,WAAW,EAAE,wDAAwD;CACtE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC;IAClF,WAAW,EAAE,mBAAmB;CACjC,CAAC,CAAC","sourcesContent":["import { QuerySchemaFactory, type TSchemaDecorator } from '@venizia/ignis-filter/schemas';\n\n/** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `QuerySchemaFactory.build` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */\nimport { z } from '@hono/zod-openapi';\n\n/** The schemas themselves live in `@venizia/ignis-filter`, built with plain `zod` so a browser can use them. Documentation metadata is injected here because it is a server concern - `.openapi()` returns a new schema rather than mutating, and three of the decorations sit on inner nodes, so they cannot be applied after the tree is composed. */\nconst openApiDecorator: TSchemaDecorator = (schema, metadata) => {\n return (schema as any).openapi(metadata);\n};\n\nexport const {\n FieldsSchema,\n FilterSchema,\n InclusionSchema,\n LimitSchema,\n OffsetSchema,\n OrderBySchema,\n SkipSchema,\n WhereSchema,\n} = QuerySchemaFactory.build({ decorate: openApiDecorator });\n\n/**\n * The query shape of a route that accepts a `filter`. The framework's own `find`, `findById` and\n * `findOne` use it, and a hand-written route gets the same contract by naming it.\n *\n * `filter` needs no `.optional()` at the call site - {@link FilterSchema} already carries one, so a\n * second is a no-op and so is a trailing `.partial()`.\n *\n * Extend it rather than rebuilding it when a route takes more than `filter`:\n * `FilterQuerySchema.extend({ q: z.string().optional() })`.\n */\nexport const FilterQuerySchema = z.object({ filter: FilterSchema }).openapi({\n description: 'Filter with where, fields, limit, skip, order, include',\n});\n\n/**\n * The query shape of a route that accepts conditions and nothing else - `count` and anything shaped\n * like it. `where` is OPTIONAL here.\n *\n * `updateBy` and `deleteBy` deliberately do not use this. Their `where` is optional in the query\n * because it may ride in the body instead; the handler refuses a request that carries it in neither\n * place - a missing one there rewrites or deletes every row in the table.\n */\nexport const WhereQuerySchema = z.object({ where: WhereSchema.optional() }).openapi({\n description: 'Filter conditions',\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"relation-builder.js","sourceRoot":"","sources":["../../../../../src/helpers/inversion/common/relation-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAiBvD,MAAM,OAAO,uBAAuB;aAClB,uBAAkB,GAAG,kBAAkB,CAAC;IAExD,uNAAuN;IAC/M,MAAM,CAAC,IAAI;QACjB,OAAO,cAAc,CAAC,OAAO,CAAC;YAC5B,GAAG,EAAE,uBAAuB,CAAC,kBAAkB;YAC/C,MAAM,EAAE,GAAiB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;SACrD,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,IAAmC;QAC5C,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC;IAC7B,CAAC","sourcesContent":["import { SingletonRealm } from '../../singleton-realm';\n\n/** Engine-neutral: the registry is shared across connectors, so each connector narrows at its own call site. */\nexport type TRelationBuilder = (opts: {\n source: unknown;\n relations: unknown;\n}) => { relations?: unknown } | undefined;\n\n/**\n * The relational connector installs itself here from its own module body. The mixin must not import\n * the connector: one value import of `createRelations` drags `drizzle-orm` into every graph that\n * uses `@repository`.\n */\ninterface IBuilderSlot {\n builder: TRelationBuilder | undefined;\n}\n\nexport class RelationBuilderRegistry {\n static readonly SINGLETON_REAL_KEY = 'relation-builder';\n\n /** Realm-anchored like the other cross-package registries: connectors installs into one copy of this package and the `@repository` mixin resolves from the other, which throws \"no relation builder is registered\". */\n private static slot(): IBuilderSlot {\n return SingletonRealm.resolve({\n key: RelationBuilderRegistry.SINGLETON_REAL_KEY,\n create: (): IBuilderSlot => ({ builder: undefined }),\n });\n }\n\n static set(opts: { builder: TRelationBuilder }): void {\n this.slot().builder = opts.builder;\n }\n\n static resolve(): TRelationBuilder | undefined {\n return this.slot().builder;\n }\n}\n"]}
1
+ {"version":3,"file":"relation-builder.js","sourceRoot":"","sources":["../../../../../src/helpers/inversion/common/relation-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAiBvD,MAAM,OAAO,uBAAuB;aAClB,uBAAkB,GAAG,kBAAkB,CAAC;IAExD,uNAAuN;IAC/M,MAAM,CAAC,IAAI;QACjB,OAAO,cAAc,CAAC,OAAO,CAAC;YAC5B,GAAG,EAAE,uBAAuB,CAAC,kBAAkB;YAC/C,MAAM,EAAE,GAAiB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;SACrD,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,IAAmC;QAC5C,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC;IAC7B,CAAC","sourcesContent":["import { SingletonRealm } from '../../singleton-realm';\n\n/** Engine-neutral: the registry is shared across connectors, so each connector narrows at its own call site. */\nexport type TRelationBuilder = (opts: {\n source: unknown;\n relations: unknown;\n}) => { relations?: unknown } | undefined;\n\n/**\n * The relational connector installs itself here from its own module body. The mixin must not import\n * the connector: one value import of `RelationsFactory.create` drags `drizzle-orm` into every graph that\n * uses `@repository`.\n */\ninterface IBuilderSlot {\n builder: TRelationBuilder | undefined;\n}\n\nexport class RelationBuilderRegistry {\n static readonly SINGLETON_REAL_KEY = 'relation-builder';\n\n /** Realm-anchored like the other cross-package registries: connectors installs into one copy of this package and the `@repository` mixin resolves from the other, which throws \"no relation builder is registered\". */\n private static slot(): IBuilderSlot {\n return SingletonRealm.resolve({\n key: RelationBuilderRegistry.SINGLETON_REAL_KEY,\n create: (): IBuilderSlot => ({ builder: undefined }),\n });\n }\n\n static set(opts: { builder: TRelationBuilder }): void {\n this.slot().builder = opts.builder;\n }\n\n static resolve(): TRelationBuilder | undefined {\n return this.slot().builder;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- export { Binding, BindingKeys, BindingScopes, BindingValueTypes, isClass, isClassProvider, resolveInjectTarget, type IProvider, type TBindingKey, type TBindingScope, type TBindingValueType, type IBindingTag, type TInjectTarget, } from '@venizia/ignis-inversion';
1
+ export { Binding, BindingKeys, BindingScopes, BindingValueTypes, isClass, isClassProvider, ResolverUtility, type IProvider, type TBindingKey, type TBindingScope, type TBindingValueType, type IBindingTag, type TInjectTarget, } from '@venizia/ignis-inversion';
2
2
  export * from './common/index.js';
3
3
  export * from './container.js';
4
4
  export * from './registry.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/helpers/inversion/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,0BAA0B,CAAC;AAElC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/helpers/inversion/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,eAAe,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,0BAA0B,CAAC;AAElC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // DI-specific symbols only available in inversion (not in helpers)
2
- export { Binding, BindingKeys, BindingScopes, BindingValueTypes, isClass, isClassProvider, resolveInjectTarget, } from '@venizia/ignis-inversion';
2
+ export { Binding, BindingKeys, BindingScopes, BindingValueTypes, isClass, isClassProvider, ResolverUtility, } from '@venizia/ignis-inversion';
3
3
  export * from './common/index.js';
4
4
  export * from './container.js';
5
5
  export * from './registry.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/helpers/inversion/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,mBAAmB,GAOpB,MAAM,0BAA0B,CAAC;AAElC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC","sourcesContent":["// DI-specific symbols only available in inversion (not in helpers)\nexport {\n Binding,\n BindingKeys,\n BindingScopes,\n BindingValueTypes,\n isClass,\n isClassProvider,\n resolveInjectTarget,\n type IProvider,\n type TBindingKey,\n type TBindingScope,\n type TBindingValueType,\n type IBindingTag,\n type TInjectTarget,\n} from '@venizia/ignis-inversion';\n\nexport * from './common';\nexport * from './container';\nexport * from './registry';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/helpers/inversion/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,eAAe,GAOhB,MAAM,0BAA0B,CAAC;AAElC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC","sourcesContent":["// DI-specific symbols only available in inversion (not in helpers)\nexport {\n Binding,\n BindingKeys,\n BindingScopes,\n BindingValueTypes,\n isClass,\n isClassProvider,\n ResolverUtility,\n type IProvider,\n type TBindingKey,\n type TBindingScope,\n type TBindingValueType,\n type IBindingTag,\n type TInjectTarget,\n} from '@venizia/ignis-inversion';\n\nexport * from './common';\nexport * from './container';\nexport * from './registry';\n"]}
@@ -1 +1 @@
1
- {"version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AAM,CAAC,OAAO,CAAC,CAAC;QAM3F,wGAAwG;8BAClF;YAAE,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;SAAE,GAAG,MAAM;QAU9D,gFAAgF;0BAC9D;YAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;SAAE,GAAG;YAC/D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SACpC;wBAsBe;YAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;SAAE,GAAG,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApMhD,CAAC;;;;;;;uBA/BN,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC;iCACxB;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,KAAG,cAAc,GAAG,SAAS;;aAsO3E,CAAC"}
@@ -1,4 +1,4 @@
1
- import { resolveValue } from '@venizia/ignis-helpers/common';
1
+ import { ResolverUtility } from '@venizia/ignis-helpers/common';
2
2
  import { getError } from '@venizia/ignis-helpers/core';
3
3
  import { MetadataKeys } from '../common/keys.js';
4
4
  import { RelationBuilderRegistry } from '../common/relation-builder.js';
@@ -17,11 +17,11 @@ export const RepositoryMetadataMixin = (baseClass) => {
17
17
  // Every member of the binding may be a resolver, the escape hatch for circular imports.
18
18
  // Reading `.name` off the resolver keys the registry by the arrow's inferred name, and the
19
19
  // datasource then silently discovers no schema.
20
- const repositoryClass = resolveValue({ value: opts.repository });
20
+ const repositoryClass = ResolverUtility.resolveValue({ value: opts.repository });
21
21
  this.repositoryBindings.set(repositoryClass.name, opts);
22
22
  this.repositoryBindingsByClass.set(repositoryClass, opts);
23
- const dataSourceRef = resolveValue({ value: opts.dataSource });
24
- const modelClass = resolveValue({ value: opts.model });
23
+ const dataSourceRef = ResolverUtility.resolveValue({ value: opts.dataSource });
24
+ const modelClass = ResolverUtility.resolveValue({ value: opts.model });
25
25
  if (!this.datasourceModels.has(dataSourceRef)) {
26
26
  this.datasourceModels.set(dataSourceRef, new Set());
27
27
  }
@@ -63,7 +63,7 @@ export const RepositoryMetadataMixin = (baseClass) => {
63
63
  if (!modelMeta.relationsResolver) {
64
64
  return undefined;
65
65
  }
66
- const relations = resolveValue({ value: modelMeta.relationsResolver });
66
+ const relations = ResolverUtility.resolveValue({ value: modelMeta.relationsResolver });
67
67
  if (!relations || !modelMeta.schema) {
68
68
  return undefined;
69
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"repository.mixin.js","sourceRoot":"","sources":["../../../../../src/helpers/inversion/mixins/repository.mixin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AASrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAQrC,SAAoB,EACpB,EAAE;IACF,OAAO,KAAM,SAAQ,SAAS;QAc5B,qBAAqB,CAInB,IAKD;YACC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;YAClC,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpE,CAAC;QAED,qBAAqB,CAAiC,IAErD;YACC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;YACxB,OAAO,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC9D,CAAC;QAED,6GAA6G;QAC7G,yBAAyB,CAGvB,IAA2C;YAC3C,wFAAwF;YACxF,2FAA2F;YAC3F,gDAAgD;YAChD,MA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QAClF,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { IDataSource } from '@/base/datasources';\nimport type { AbstractEntity } from '@/base/models';\nimport type { AnyType, TClass, TMixinTarget } from '@venizia/ignis-helpers/common';\nimport { resolveValue } 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 { RelationBuilderRegistry } from '../common/relation-builder';\nimport type {\n IModelMetadata,\n IModelRegistryEntry,\n IRepositoryBinding,\n IResolvedRepositoryMetadata,\n TRepositoryMetadata,\n} from '../common/types';\n\nexport const RepositoryMetadataMixin = <\n BaseClass extends TMixinTarget<\n _MetadataRegistry & {\n modelRegistry: Map<string, IModelRegistryEntry>;\n getModelMetadata(opts: { target: object }): IModelMetadata | undefined;\n }\n >,\n>(\n baseClass: BaseClass,\n) => {\n return class extends baseClass {\n /** By repository class name, for the by-name API. Two classes may share a name; `repositoryBindingsByClass` cannot confuse them. */\n repositoryBindings: Map<string, IRepositoryBinding<AbstractEntity>>;\n\n /** By repository class: a minified build renames classes, and two chunks may give two of them one name. */\n repositoryBindingsByClass: Map<Function, IRepositoryBinding<AbstractEntity>>;\n\n /**\n * The model classes each datasource owns, keyed by the datasource class - or by the string a\n * repository named it with (`dataSource: 'PgDataSource'`), which only a class of that name\n * can match. Never by class name alone: a minified build gives two datasources one name.\n */\n datasourceModels: Map<string | Function, Set<TClass<AnyType>>>;\n\n setRepositoryMetadata<\n Target extends object = object,\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n >(opts: {\n target: Target;\n metadata: TRepositoryMetadata<Model, DataSource> & {\n _resolved?: IResolvedRepositoryMetadata<Model, DataSource>;\n };\n }): void {\n const { target, metadata } = opts;\n Reflect.defineMetadata(MetadataKeys.REPOSITORY, metadata, target);\n }\n\n getRepositoryMetadata<Target extends object = object>(opts: {\n target: Target;\n }): (TRepositoryMetadata & { _resolved?: IResolvedRepositoryMetadata }) | undefined {\n const { target } = opts;\n return Reflect.getMetadata(MetadataKeys.REPOSITORY, target);\n }\n\n /** Registers a repository binding (called by @repository) linking a repository to its model + datasource. */\n registerRepositoryBinding<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n >(opts: IRepositoryBinding<Model, DataSource>) {\n // Every member of the binding may be a resolver, the escape hatch for circular imports.\n // Reading `.name` off the resolver keys the registry by the arrow's inferred name, and the\n // datasource then silently discovers no schema.\n const repositoryClass = resolveValue({ value: opts.repository });\n this.repositoryBindings.set(repositoryClass.name, opts);\n this.repositoryBindingsByClass.set(repositoryClass, opts);\n\n const dataSourceRef = resolveValue({ value: opts.dataSource });\n const modelClass = resolveValue({ value: opts.model });\n\n if (!this.datasourceModels.has(dataSourceRef)) {\n this.datasourceModels.set(dataSourceRef, new Set());\n }\n\n this.datasourceModels.get(dataSourceRef)!.add(modelClass);\n }\n\n /** By class, walking up to the nearest decorated parent; by name only for callers holding a name. */\n getRepositoryBinding(\n opts: { target: Function } | { name: string },\n ): IRepositoryBinding<AbstractEntity> | undefined {\n if ('name' in opts) {\n return this.repositoryBindings.get(opts.name);\n }\n\n for (\n let current: Function | null = opts.target;\n current && current !== Function.prototype;\n current = Object.getPrototypeOf(current)\n ) {\n const binding = this.repositoryBindingsByClass.get(current);\n if (binding) {\n return binding;\n }\n }\n\n return undefined;\n }\n\n /** A class finds what was registered under it, and under a string equal to its name. */\n getDataSourceModelClasses(opts: {\n dataSource: string | TClass<IDataSource>;\n }): Set<TClass<AnyType>> {\n const { dataSource } = opts;\n\n if (typeof dataSource === 'string') {\n return this.datasourceModels.get(dataSource) ?? new Set();\n }\n\n return new Set([\n ...(this.datasourceModels.get(dataSource) ?? []),\n ...(this.datasourceModels.get(dataSource.name) ?? []),\n ]);\n }\n\n /**\n * Resolves and caches relations for a model entry - called lazily from buildSchema() so that\n * every `@model` class is registered first, which avoids circular-dependency ordering issues.\n * @internal\n */\n resolveModelRelations(modelMeta: IModelRegistryEntry): unknown {\n if (modelMeta._builtRelations !== undefined) {\n return modelMeta._builtRelations;\n }\n\n if (!modelMeta.relationsResolver) {\n return undefined;\n }\n\n const relations = resolveValue({ value: modelMeta.relationsResolver });\n\n if (!relations || !modelMeta.schema) {\n return undefined;\n }\n\n const builder = RelationBuilderRegistry.resolve();\n\n // Relations were declared but no connector installed a builder - silently dropping them\n // would surface much later as an empty `with` clause.\n if (!builder) {\n throw getError({\n message: `[RepositoryMetadataMixin][resolveModelRelations] Model declares relations but no relation builder is registered | Import the relational connector so it installs one`,\n });\n }\n\n const builtRelations = builder({ source: modelMeta.schema, relations });\n\n modelMeta._builtRelations = builtRelations?.relations;\n return modelMeta._builtRelations;\n }\n\n /**\n * Models registered for a datasource, relations resolved lazily. `schema`/`relations` stay\n * `unknown` - the registry is shared across connectors, so each connector narrows at its call\n * site.\n */\n getModels(opts: { dataSource: string | TClass<IDataSource> }): Array<{\n tableName: string;\n schema: unknown;\n relations?: unknown;\n }> {\n const modelClasses = this.getDataSourceModelClasses({ dataSource: opts.dataSource });\n\n const rs = Array.from(modelClasses)\n .map((modelClass) => {\n // Read straight off the class: a class -> name -> modelRegistry round-trip collapses two\n // same-named models onto one entry, silently swapping schemas. `modelRegistry` stays\n // name-keyed for the by-name APIs that need it.\n const entry: IModelRegistryEntry = {\n target: modelClass as AnyType,\n metadata:\n this.getModelMetadata({ target: modelClass }) ?? ({ settings: {} } as AnyType),\n schema: (modelClass as AnyType).schema,\n relationsResolver: (modelClass as AnyType).relations,\n };\n\n if (entry.schema === undefined) {\n return null;\n }\n\n return {\n tableName: this.resolveModelKey({ modelClass }),\n schema: entry.schema,\n relations: this.resolveModelRelations(entry),\n };\n })\n .filter((item): item is NonNullable<typeof item> => {\n return item !== undefined && item !== null;\n });\n\n return rs;\n }\n\n /**\n * Like getModels but returns only resolved model classes - used by BaseSearchDataSource, which\n * has no pgTable to resolve.\n */\n getModelClasses(opts: { dataSource: string | TClass<IDataSource> }): Array<TClass<unknown>> {\n // Straight from the stored class refs: a name round-trip through the shared modelRegistry\n // would hand back whichever same-named class registered last.\n return Array.from(this.getDataSourceModelClasses({ dataSource: opts.dataSource }));\n }\n\n /** The key a model occupies in `modelRegistry` - its table name, or its class name when it has none. */\n resolveModelKey(opts: { modelClass: TClass<AnyType> }): string {\n const { modelClass } = opts;\n const modelMetadata = this.getModelMetadata({ target: modelClass });\n\n return (\n [modelMetadata?.tableName, (modelClass as AnyType).TABLE_NAME].find(Boolean) ??\n modelClass.name\n );\n }\n\n /** Assembles table schemas + relations for a datasource's registered models. */\n buildSchema(opts: { dataSource: string | TClass<IDataSource> }): {\n schema: Record<string, unknown>;\n relations: Record<string, unknown>;\n } {\n const { dataSource } = opts;\n const models = this.getModels({ dataSource });\n\n const rs: {\n schema: Record<string, unknown>;\n relations: Record<string, unknown>;\n } = { schema: {}, relations: {} };\n\n for (const model of models) {\n if (model.schema) {\n rs.schema[model.tableName] = model.schema;\n }\n\n if (model.relations) {\n rs.relations[`${model.tableName}Relations`] = model.relations;\n }\n }\n\n return rs;\n }\n\n hasModels(opts: { dataSource: string | TClass<IDataSource> }): boolean {\n return this.getDataSourceModelClasses({ dataSource: opts.dataSource }).size > 0;\n }\n };\n};\n"]}
1
+ {"version":3,"file":"repository.mixin.js","sourceRoot":"","sources":["../../../../../src/helpers/inversion/mixins/repository.mixin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AASrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAQrC,SAAoB,EACpB,EAAE;IACF,OAAO,KAAM,SAAQ,SAAS;QAc5B,qBAAqB,CAInB,IAKD;YACC,MAAM,EA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M,EAAE,CAAC;oBACjB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC5C,CAAC;gBAED,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;oBACpB,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,WAAW,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;gBAChE,CAAC;YACH,CAAC;YAED,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,SAAS,CAAC,IAAkD;YAC1D,OAAO,IAAI,CAAC,yBAAyB,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;QAClF,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { IDataSource } from '@/base/datasources';\nimport type { AbstractEntity } from '@/base/models';\nimport type { AnyType, TClass, TMixinTarget } from '@venizia/ignis-helpers/common';\nimport { ResolverUtility } 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 { RelationBuilderRegistry } from '../common/relation-builder';\nimport type {\n IModelMetadata,\n IModelRegistryEntry,\n IRepositoryBinding,\n IResolvedRepositoryMetadata,\n TRepositoryMetadata,\n} from '../common/types';\n\nexport const RepositoryMetadataMixin = <\n BaseClass extends TMixinTarget<\n _MetadataRegistry & {\n modelRegistry: Map<string, IModelRegistryEntry>;\n getModelMetadata(opts: { target: object }): IModelMetadata | undefined;\n }\n >,\n>(\n baseClass: BaseClass,\n) => {\n return class extends baseClass {\n /** By repository class name, for the by-name API. Two classes may share a name; `repositoryBindingsByClass` cannot confuse them. */\n repositoryBindings: Map<string, IRepositoryBinding<AbstractEntity>>;\n\n /** By repository class: a minified build renames classes, and two chunks may give two of them one name. */\n repositoryBindingsByClass: Map<Function, IRepositoryBinding<AbstractEntity>>;\n\n /**\n * The model classes each datasource owns, keyed by the datasource class - or by the string a\n * repository named it with (`dataSource: 'PgDataSource'`), which only a class of that name\n * can match. Never by class name alone: a minified build gives two datasources one name.\n */\n datasourceModels: Map<string | Function, Set<TClass<AnyType>>>;\n\n setRepositoryMetadata<\n Target extends object = object,\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n >(opts: {\n target: Target;\n metadata: TRepositoryMetadata<Model, DataSource> & {\n _resolved?: IResolvedRepositoryMetadata<Model, DataSource>;\n };\n }): void {\n const { target, metadata } = opts;\n Reflect.defineMetadata(MetadataKeys.REPOSITORY, metadata, target);\n }\n\n getRepositoryMetadata<Target extends object = object>(opts: {\n target: Target;\n }): (TRepositoryMetadata & { _resolved?: IResolvedRepositoryMetadata }) | undefined {\n const { target } = opts;\n return Reflect.getMetadata(MetadataKeys.REPOSITORY, target);\n }\n\n /** Registers a repository binding (called by @repository) linking a repository to its model + datasource. */\n registerRepositoryBinding<\n Model extends AbstractEntity = AbstractEntity,\n DataSource extends IDataSource = IDataSource,\n >(opts: IRepositoryBinding<Model, DataSource>) {\n // Every member of the binding may be a resolver, the escape hatch for circular imports.\n // Reading `.name` off the resolver keys the registry by the arrow's inferred name, and the\n // datasource then silently discovers no schema.\n const repositoryClass = ResolverUtility.resolveValue({ value: opts.repository });\n this.repositoryBindings.set(repositoryClass.name, opts);\n this.repositoryBindingsByClass.set(repositoryClass, opts);\n\n const dataSourceRef = ResolverUtility.resolveValue({ value: opts.dataSource });\n const modelClass = ResolverUtility.resolveValue({ value: opts.model });\n\n if (!this.datasourceModels.has(dataSourceRef)) {\n this.datasourceModels.set(dataSourceRef, new Set());\n }\n\n this.datasourceModels.get(dataSourceRef)!.add(modelClass);\n }\n\n /** By class, walking up to the nearest decorated parent; by name only for callers holding a name. */\n getRepositoryBinding(\n opts: { target: Function } | { name: string },\n ): IRepositoryBinding<AbstractEntity> | undefined {\n if ('name' in opts) {\n return this.repositoryBindings.get(opts.name);\n }\n\n for (\n let current: Function | null = opts.target;\n current && current !== Function.prototype;\n current = Object.getPrototypeOf(current)\n ) {\n const binding = this.repositoryBindingsByClass.get(current);\n if (binding) {\n return binding;\n }\n }\n\n return undefined;\n }\n\n /** A class finds what was registered under it, and under a string equal to its name. */\n getDataSourceModelClasses(opts: {\n dataSource: string | TClass<IDataSource>;\n }): Set<TClass<AnyType>> {\n const { dataSource } = opts;\n\n if (typeof dataSource === 'string') {\n return this.datasourceModels.get(dataSource) ?? new Set();\n }\n\n return new Set([\n ...(this.datasourceModels.get(dataSource) ?? []),\n ...(this.datasourceModels.get(dataSource.name) ?? []),\n ]);\n }\n\n /**\n * Resolves and caches relations for a model entry - called lazily from buildSchema() so that\n * every `@model` class is registered first, which avoids circular-dependency ordering issues.\n * @internal\n */\n resolveModelRelations(modelMeta: IModelRegistryEntry): unknown {\n if (modelMeta._builtRelations !== undefined) {\n return modelMeta._builtRelations;\n }\n\n if (!modelMeta.relationsResolver) {\n return undefined;\n }\n\n const relations = ResolverUtility.resolveValue({ value: modelMeta.relationsResolver });\n\n if (!relations || !modelMeta.schema) {\n return undefined;\n }\n\n const builder = RelationBuilderRegistry.resolve();\n\n // Relations were declared but no connector installed a builder - silently dropping them\n // would surface much later as an empty `with` clause.\n if (!builder) {\n throw getError({\n message: `[RepositoryMetadataMixin][resolveModelRelations] Model declares relations but no relation builder is registered | Import the relational connector so it installs one`,\n });\n }\n\n const builtRelations = builder({ source: modelMeta.schema, relations });\n\n modelMeta._builtRelations = builtRelations?.relations;\n return modelMeta._builtRelations;\n }\n\n /**\n * Models registered for a datasource, relations resolved lazily. `schema`/`relations` stay\n * `unknown` - the registry is shared across connectors, so each connector narrows at its call\n * site.\n */\n getModels(opts: { dataSource: string | TClass<IDataSource> }): Array<{\n tableName: string;\n schema: unknown;\n relations?: unknown;\n }> {\n const modelClasses = this.getDataSourceModelClasses({ dataSource: opts.dataSource });\n\n const rs = Array.from(modelClasses)\n .map((modelClass) => {\n // Read straight off the class: a class -> name -> modelRegistry round-trip collapses two\n // same-named models onto one entry, silently swapping schemas. `modelRegistry` stays\n // name-keyed for the by-name APIs that need it.\n const entry: IModelRegistryEntry = {\n target: modelClass as AnyType,\n metadata:\n this.getModelMetadata({ target: modelClass }) ?? ({ settings: {} } as AnyType),\n schema: (modelClass as AnyType).schema,\n relationsResolver: (modelClass as AnyType).relations,\n };\n\n if (entry.schema === undefined) {\n return null;\n }\n\n return {\n tableName: this.resolveModelKey({ modelClass }),\n schema: entry.schema,\n relations: this.resolveModelRelations(entry),\n };\n })\n .filter((item): item is NonNullable<typeof item> => {\n return item !== undefined && item !== null;\n });\n\n return rs;\n }\n\n /**\n * Like getModels but returns only resolved model classes - used by BaseSearchDataSource, which\n * has no pgTable to resolve.\n */\n getModelClasses(opts: { dataSource: string | TClass<IDataSource> }): Array<TClass<unknown>> {\n // Straight from the stored class refs: a name round-trip through the shared modelRegistry\n // would hand back whichever same-named class registered last.\n return Array.from(this.getDataSourceModelClasses({ dataSource: opts.dataSource }));\n }\n\n /** The key a model occupies in `modelRegistry` - its table name, or its class name when it has none. */\n resolveModelKey(opts: { modelClass: TClass<AnyType> }): string {\n const { modelClass } = opts;\n const modelMetadata = this.getModelMetadata({ target: modelClass });\n\n return (\n [modelMetadata?.tableName, (modelClass as AnyType).TABLE_NAME].find(Boolean) ??\n modelClass.name\n );\n }\n\n /** Assembles table schemas + relations for a datasource's registered models. */\n buildSchema(opts: { dataSource: string | TClass<IDataSource> }): {\n schema: Record<string, unknown>;\n relations: Record<string, unknown>;\n } {\n const { dataSource } = opts;\n const models = this.getModels({ dataSource });\n\n const rs: {\n schema: Record<string, unknown>;\n relations: Record<string, unknown>;\n } = { schema: {}, relations: {} };\n\n for (const model of models) {\n if (model.schema) {\n rs.schema[model.tableName] = model.schema;\n }\n\n if (model.relations) {\n rs.relations[`${model.tableName}Relations`] = model.relations;\n }\n }\n\n return rs;\n }\n\n hasModels(opts: { dataSource: string | TClass<IDataSource> }): boolean {\n return this.getDataSourceModelClasses({ dataSource: opts.dataSource }).size > 0;\n }\n };\n};\n"]}
@@ -6,7 +6,7 @@
6
6
  * decided on, not whatever a directory grows into. Weight is a contract, checked by
7
7
  * `src/__tests__/bundle/browser-weight.test.ts`.
8
8
  */
9
- export { component, configuration, injectable, pickRegistrationOptions, provide, service, } from './base/metadata/injectable.js';
9
+ export { component, configuration, injectable, InjectableUtility, provide, service, } from './base/metadata/injectable.js';
10
10
  export { datasource, model, repository } from './base/metadata/persistents.js';
11
11
  export { inject } from './base/metadata/injectors.js';
12
12
  export { ArtifactBindingKeys } from './base/metadata/artifact-keys.js';
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,uBAAuB,EACvB,OAAO,EACP,OAAO,GACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGpE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjF,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACnF,YAAY,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,aAAa,GACd,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,OAAO,GACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGpE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjF,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACnF,YAAY,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,aAAa,GACd,MAAM,qBAAqB,CAAC"}
@@ -6,7 +6,7 @@
6
6
  * decided on, not whatever a directory grows into. Weight is a contract, checked by
7
7
  * `src/__tests__/bundle/browser-weight.test.ts`.
8
8
  */
9
- export { component, configuration, injectable, pickRegistrationOptions, provide, service, } from './base/metadata/injectable.js';
9
+ export { component, configuration, injectable, InjectableUtility, provide, service, } from './base/metadata/injectable.js';
10
10
  export { datasource, model, repository } from './base/metadata/persistents.js';
11
11
  export { inject } from './base/metadata/injectors.js';
12
12
  export { ArtifactBindingKeys } from './base/metadata/artifact-keys.js';
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,uBAAuB,EACvB,OAAO,EACP,OAAO,GACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,qIAAqI;AACrI,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG1E;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["/**\n * How a class is MARKED as an artifact, and nothing about how one is served. 23 KB gzipped against\n * the root barrel's 161 KB, which carries the REST surface and is right to.\n *\n * Listed export by export rather than re-exporting `base/metadata`: a sub-path is a surface someone\n * decided on, not whatever a directory grows into. Weight is a contract, checked by\n * `src/__tests__/bundle/browser-weight.test.ts`.\n */\n\nexport {\n component,\n configuration,\n injectable,\n pickRegistrationOptions,\n provide,\n service,\n} from '@/base/metadata/injectable';\nexport { datasource, model, repository } from '@/base/metadata/persistents';\nexport { inject } from '@/base/metadata/injectors';\nexport { ArtifactBindingKeys } from '@/base/metadata/artifact-keys';\n\n// A group of a package's classes, borrowed by an application - a browser kit defines its groups from here, not from the root barrel.\nexport { ArtifactGroup } from '@/base/applications/artifact-group';\nexport type { IArtifactGroup, IArtifactIndex } from '@/base/applications/common';\n\nexport { ArtifactNamespaces, BindingNamespaces } from '@/common/bindings';\nexport type { TBindingNamespace } from '@/common/bindings';\n\n/**\n * `CoreBindings` is deliberately NOT here. The namespaces above are the GRAMMAR of a binding key;\n * `CoreBindings` is one application's DICTIONARY (`APPLICATION_SERVER`, `APPLICATION_ROOT_ROUTER`).\n * A sibling framework ships a class of the same name whose `APPLICATION_INSTANCE` is a different\n * string, so shipping ours beside the stereotypes means binding under one key and resolving under\n * another, with nothing failing until run time. It stays on the root barrel.\n */\n\nexport { ArtifactTypes, BindingKeys, MetadataRegistry } from '@/helpers/inversion';\nexport type {\n IArtifactMetadata,\n IArtifactRegistrationOptions,\n TBindingScope,\n} from '@/helpers/inversion';\n"]}
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,OAAO,GACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,qIAAqI;AACrI,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG1E;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["/**\n * How a class is MARKED as an artifact, and nothing about how one is served. 23 KB gzipped against\n * the root barrel's 161 KB, which carries the REST surface and is right to.\n *\n * Listed export by export rather than re-exporting `base/metadata`: a sub-path is a surface someone\n * decided on, not whatever a directory grows into. Weight is a contract, checked by\n * `src/__tests__/bundle/browser-weight.test.ts`.\n */\n\nexport {\n component,\n configuration,\n injectable,\n InjectableUtility,\n provide,\n service,\n} from '@/base/metadata/injectable';\nexport { datasource, model, repository } from '@/base/metadata/persistents';\nexport { inject } from '@/base/metadata/injectors';\nexport { ArtifactBindingKeys } from '@/base/metadata/artifact-keys';\n\n// A group of a package's classes, borrowed by an application - a browser kit defines its groups from here, not from the root barrel.\nexport { ArtifactGroup } from '@/base/applications/artifact-group';\nexport type { IArtifactGroup, IArtifactIndex } from '@/base/applications/common';\n\nexport { ArtifactNamespaces, BindingNamespaces } from '@/common/bindings';\nexport type { TBindingNamespace } from '@/common/bindings';\n\n/**\n * `CoreBindings` is deliberately NOT here. The namespaces above are the GRAMMAR of a binding key;\n * `CoreBindings` is one application's DICTIONARY (`APPLICATION_SERVER`, `APPLICATION_ROOT_ROUTER`).\n * A sibling framework ships a class of the same name whose `APPLICATION_INSTANCE` is a different\n * string, so shipping ours beside the stereotypes means binding under one key and resolving under\n * another, with nothing failing until run time. It stays on the root barrel.\n */\n\nexport { ArtifactTypes, BindingKeys, MetadataRegistry } from '@/helpers/inversion';\nexport type {\n IArtifactMetadata,\n IArtifactRegistrationOptions,\n TBindingScope,\n} from '@/helpers/inversion';\n"]}
@@ -15,14 +15,14 @@
15
15
  export { AbstractRepository } from './base/repositories/core/abstract.js';
16
16
  export { AbstractDataSource } from './base/datasources/abstract.js';
17
17
  export type { ICreatableRepository, ICrudRepository, IDeletableRepository, IPersistableRepository, IReadableRepository, IRepository, IUpdatableRepository, } from './base/repositories/common/types/contracts.js';
18
- export { buildDataRange } from './base/repositories/common/types/results.js';
18
+ export { DataRangeUtility } from './base/repositories/common/types/results.js';
19
19
  export { HttpResponseReader } from './base/repositories/common/response-reader.js';
20
20
  export { HttpExtraRequest } from './base/repositories/common/extra-request.js';
21
21
  export type { TExtraRequest, TExtraResult } from './base/repositories/common/extra-request.js';
22
22
  export { DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, RepositoryOperationScopes, RepositoryTypes, } from './base/repositories/common/constants.js';
23
23
  export type { TRepositoryType } from './base/repositories/common/constants.js';
24
24
  export { CoreErrorCodes, SearchErrorCodes } from './common/error-codes.js';
25
- export { throwNotSupported } from './utilities/error.utility.js';
25
+ export { NotSupportedUtility } from './utilities/not-supported.utility.js';
26
26
  export type { TCount, TDataRange, TDataWithRange } from './base/repositories/common/types/results.js';
27
27
  export type { IDataSource } from './base/datasources/common/types.js';
28
28
  export { AbstractEntity } from './base/models/base.js';
@@ -1 +1 @@
1
- {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/repository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,WAAW,EACX,oBAAoB,GACrB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAI1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAI5F,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAEnG,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAInE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGvE,YAAY,EACV,WAAW,EACX,OAAO,EACP,OAAO,EACP,UAAU,EACV,IA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,EACJ,YAAY,EACZ,MAAM,GACP,MAAM,uBAAuB,CAAC"}
@@ -14,7 +14,7 @@
14
14
  */
15
15
  export { AbstractRepository } from './base/repositories/core/abstract.js';
16
16
  export { AbstractDataSource } from './base/datasources/abstract.js';
17
- export { buildDataRange } from './base/repositories/common/types/results.js';
17
+ export { DataRangeUtility } from './base/repositories/common/types/results.js';
18
18
  // How a client reads what an IGNIS server answers - shared by the http connector and any client
19
19
  // that reads the same server without it.
20
20
  export { HttpResponseReader } from './base/repositories/common/response-reader.js';
@@ -23,7 +23,7 @@ export { HttpExtraRequest } from './base/repositories/common/extra-request.js';
23
23
  // and the helper an engine that lacks an operation throws through.
24
24
  export { DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, RepositoryOperationScopes, RepositoryTypes, } from './base/repositories/common/constants.js';
25
25
  export { CoreErrorCodes, SearchErrorCodes } from './common/error-codes.js';
26
- export { throwNotSupported } from './utilities/error.utility.js';
26
+ export { NotSupportedUtility } from './utilities/not-supported.utility.js';
27
27
  // `IRepository` names an entity, so a consumer implementing the contract needs the base to extend.
28
28
  // Engine-neutral like the datasource: a name, `getSchema({ type })`, and an id type.
29
29
  export { AbstractEntity } from './base/models/base.js';
@@ -1 +1 @@
1
- {"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/repository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAYjE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,gGAAgG;AAChG,yCAAyC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,mGAAmG;AACnG,mEAAmE;AACnE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAK9D,mGAAmG;AACnG,qFAAqF;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["/**\n * The persistence contract, and nothing about how a row is served or validated.\n *\n * A repository talks to a datasource. `AbstractDataSource` is engine-neutral - its only required\n * member is `configure()` - so \"an HTTP request to another server\" is a datasource in the same sense\n * Drizzle-over-Postgres is one: same role, different transport. This entry exists so a consumer can\n * implement that without taking the OpenAPI layer, which `base/repositories` reaches through\n * `query-schemas` and `result-schemas`.\n *\n * Both halves already speak `@venizia/ignis-filter`, so a consumer on another transport shares the\n * query vocabulary rather than translating into one.\n *\n * Weight is a contract, checked by `src/__tests__/bundle/browser-weight.test.ts`.\n */\n\nexport { AbstractRepository } from '@/base/repositories/core/abstract';\nexport { AbstractDataSource } from '@/base/datasources/abstract';\n\nexport type {\n ICreatableRepository,\n ICrudRepository,\n IDeletableRepository,\n IPersistableRepository,\n IReadableRepository,\n IRepository,\n IUpdatableRepository,\n} from '@/base/repositories/common/types/contracts';\n\nexport { buildDataRange } from '@/base/repositories/common/types/results';\n\n// How a client reads what an IGNIS server answers - shared by the http connector and any client\n// that reads the same server without it.\nexport { HttpResponseReader } from '@/base/repositories/common/response-reader';\nexport { HttpExtraRequest } from '@/base/repositories/common/extra-request';\nexport type { TExtraRequest, TExtraResult } from '@/base/repositories/common/extra-request';\n\n// What a repository on any transport raises and bounds itself by - the constants, the error codes,\n// and the helper an engine that lacks an operation throws through.\nexport {\n DEFAULT_LIMIT,\n DEFAULT_MAX_LIMIT,\n RepositoryOperationScopes,\n RepositoryTypes,\n} from '@/base/repositories/common/constants';\nexport type { TRepositoryType } from '@/base/repositories/common/constants';\nexport { CoreErrorCodes, SearchErrorCodes } from '@/common/error-codes';\nexport { throwNotSupported } from '@/utilities/error.utility';\nexport type { TCount, TDataRange, TDataWithRange } from '@/base/repositories/common/types/results';\n\nexport type { IDataSource } from '@/base/datasources/common/types';\n\n// `IRepository` names an entity, so a consumer implementing the contract needs the base to extend.\n// Engine-neutral like the datasource: a name, `getSchema({ type })`, and an id type.\nexport { AbstractEntity } from '@/base/models/base';\nexport { SchemaTypes } from '@/base/models/common/constants';\nexport type { TIdSchemaType, TSchemaType } from '@/base/models/common';\n\n// The query vocabulary both transports share.\nexport type {\n TByIdFilter,\n TFields,\n TFilter,\n TInclusion,\n TRow,\n TSelectedRow,\n TWhere,\n} from '@venizia/ignis-filter';\n"]}
1
+ {"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/repository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAYjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,gGAAgG;AAChG,yCAAyC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,mGAAmG;AACnG,mEAAmE;AACnE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAKxE,mGAAmG;AACnG,qFAAqF;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["/**\n * The persistence contract, and nothing about how a row is served or validated.\n *\n * A repository talks to a datasource. `AbstractDataSource` is engine-neutral - its only required\n * member is `configure()` - so \"an HTTP request to another server\" is a datasource in the same sense\n * Drizzle-over-Postgres is one: same role, different transport. This entry exists so a consumer can\n * implement that without taking the OpenAPI layer, which `base/repositories` reaches through\n * `query-schemas` and `result-schemas`.\n *\n * Both halves already speak `@venizia/ignis-filter`, so a consumer on another transport shares the\n * query vocabulary rather than translating into one.\n *\n * Weight is a contract, checked by `src/__tests__/bundle/browser-weight.test.ts`.\n */\n\nexport { AbstractRepository } from '@/base/repositories/core/abstract';\nexport { AbstractDataSource } from '@/base/datasources/abstract';\n\nexport type {\n ICreatableRepository,\n ICrudRepository,\n IDeletableRepository,\n IPersistableRepository,\n IReadableRepository,\n IRepository,\n IUpdatableRepository,\n} from '@/base/repositories/common/types/contracts';\n\nexport { DataRangeUtility } from '@/base/repositories/common/types/results';\n\n// How a client reads what an IGNIS server answers - shared by the http connector and any client\n// that reads the same server without it.\nexport { HttpResponseReader } from '@/base/repositories/common/response-reader';\nexport { HttpExtraRequest } from '@/base/repositories/common/extra-request';\nexport type { TExtraRequest, TExtraResult } from '@/base/repositories/common/extra-request';\n\n// What a repository on any transport raises and bounds itself by - the constants, the error codes,\n// and the helper an engine that lacks an operation throws through.\nexport {\n DEFAULT_LIMIT,\n DEFAULT_MAX_LIMIT,\n RepositoryOperationScopes,\n RepositoryTypes,\n} from '@/base/repositories/common/constants';\nexport type { TRepositoryType } from '@/base/repositories/common/constants';\nexport { CoreErrorCodes, SearchErrorCodes } from '@/common/error-codes';\nexport { NotSupportedUtility } from '@/utilities/not-supported.utility';\nexport type { TCount, TDataRange, TDataWithRange } from '@/base/repositories/common/types/results';\n\nexport type { IDataSource } from '@/base/datasources/common/types';\n\n// `IRepository` names an entity, so a consumer implementing the contract needs the base to extend.\n// Engine-neutral like the datasource: a name, `getSchema({ type })`, and an id type.\nexport { AbstractEntity } from '@/base/models/base';\nexport { SchemaTypes } from '@/base/models/common/constants';\nexport type { TIdSchemaType, TSchemaType } from '@/base/models/common';\n\n// The query vocabulary both transports share.\nexport type {\n TByIdFilter,\n TFields,\n TFilter,\n TInclusion,\n TRow,\n TSelectedRow,\n TWhere,\n} from '@venizia/ignis-filter';\n"]}
@@ -1,2 +1,2 @@
1
- export * from './error.utility.js';
1
+ export * from './not-supported.utility.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAEA,cAAc,yBAAyB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  // Zod-free by design: this barrel must stay reachable from a browser bundle. The OpenAPI schema
2
2
  // builders that used to live here are under `base/controllers/common/`, with the REST surface.
3
- export * from './error.utility.js';
3
+ export * from './not-supported.utility.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,+FAA+F;AAC/F,cAAc,iBAAiB,CAAC","sourcesContent":["// Zod-free by design: this barrel must stay reachable from a browser bundle. The OpenAPI schema\n// builders that used to live here are under `base/controllers/common/`, with the REST surface.\nexport * from './error.utility';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,+FAA+F;AAC/F,cAAc,yBAAyB,CAAC","sourcesContent":["// Zod-free by design: this barrel must stay reachable from a browser bundle. The OpenAPI schema\n// builders that used to live here are under `base/controllers/common/`, with the REST surface.\nexport * from './not-supported.utility';\n"]}
@@ -0,0 +1,11 @@
1
+ import type { ILogger } from '@venizia/ignis-helpers/core';
2
+ /** Errors an implementation raises on purpose. */
3
+ export declare class NotSupportedUtility {
4
+ /** Standardized NotSupported error (HTTP 501) for a capability an implementation deliberately does not provide - logs a warning before throwing so the gap shows in operational logs, not just to the caller. */
5
+ static throwNotSupported(opts: {
6
+ scope: string;
7
+ feature: string;
8
+ logger: ILogger;
9
+ }): never;
10
+ }
11
+ //# sourceMappingURL=not-supported.utility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-supported.utility.d.ts","sourceRoot":"","sources":["../../../src/utilities/not-supported.utility.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG3D,kDAAkD;AAClD,qBAAa,mBAAmB;IAC9B,iNAAiN;IACjN,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,KAAK;CAa3F"}
@@ -0,0 +1,19 @@
1
+ import { CoreErrorCodes } from '../common/error-codes.js';
2
+ import { HTTP } from '@venizia/ignis-helpers/common';
3
+ import { getError } from '@venizia/ignis-helpers/core';
4
+ /** Errors an implementation raises on purpose. */
5
+ export class NotSupportedUtility {
6
+ /** Standardized NotSupported error (HTTP 501) for a capability an implementation deliberately does not provide - logs a warning before throwing so the gap shows in operational logs, not just to the caller. */
7
+ static throwNotSupported(opts) {
8
+ const { scope, feature, logger } = opts;
9
+ logger
10
+ .for(NotSupportedUtility.throwNotSupported.name)
11
+ .warn('%s is not supported | Scope: %s', feature, scope);
12
+ throw getError({
13
+ statusCode: HTTP.ResultCodes.RS_5.NotImplemented,
14
+ messageCode: CoreErrorCodes.NOT_SUPPORTED,
15
+ message: `[${scope}] ${feature} is not supported.`,
16
+ });
17
+ }
18
+ }
19
+ //# sourceMappingURL=not-supported.utility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not-supported.utility.js","sourceRoot":"","sources":["../../../src/utilities/not-supported.utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,kDAAkD;AAClD,MAAM,OAAO,mBAAmB;IAC9B,iNAAiN;IACjN,MAAM,CAAC,iBAAiB,CAAC,IAAyD;QAChF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAExC,MAAM;aACH,GAAG,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,IAAI,CAAC;aAC/C,IAAI,CAAC,iCAAiC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAE3D,MAAM,QAAQ,CAAC;YACb,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc;YAChD,WAAW,EAAE,cAAc,CAAC,aAAa;YACzC,OAAO,EAAE,IAAI,KAAK,KAAK,OAAO,oBAAoB;SACnD,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { CoreErrorCodes } from '@/common/error-codes';\nimport { HTTP } from '@venizia/ignis-helpers/common';\nimport type { ILogger } from '@venizia/ignis-helpers/core';\nimport { getError } from '@venizia/ignis-helpers/core';\n\n/** Errors an implementation raises on purpose. */\nexport class NotSupportedUtility {\n /** Standardized NotSupported error (HTTP 501) for a capability an implementation deliberately does not provide - logs a warning before throwing so the gap shows in operational logs, not just to the caller. */\n static throwNotSupported(opts: { scope: string; feature: string; logger: ILogger }): never {\n const { scope, feature, logger } = opts;\n\n logger\n .for(NotSupportedUtility.throwNotSupported.name)\n .warn('%s is not supported | Scope: %s', feature, scope);\n\n throw getError({\n statusCode: HTTP.ResultCodes.RS_5.NotImplemented,\n messageCode: CoreErrorCodes.NOT_SUPPORTED,\n message: `[${scope}] ${feature} is not supported.`,\n });\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-kernel",
3
- "version": "0.4.7-0",
3
+ "version": "0.4.7-1",
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",
@@ -65,18 +65,17 @@
65
65
  "access": "public"
66
66
  },
67
67
  "scripts": {
68
- "force-update": "sh ../../scripts/build/force-update.sh",
69
- "prepublishOnly": "make rebuild"
68
+ "force-update": "sh ../../scripts/build/force-update.sh"
70
69
  },
71
70
  "dependencies": {
72
- "@venizia/ignis-filter": "0.4.6-0",
73
- "@venizia/ignis-helpers": "0.4.7-0",
74
- "@venizia/ignis-inversion": "0.4.6-0",
71
+ "@venizia/ignis-filter": "0.4.6-1",
72
+ "@venizia/ignis-helpers": "0.4.7-1",
73
+ "@venizia/ignis-inversion": "0.4.6-1",
75
74
  "reflect-metadata": "^0.2.2"
76
75
  },
77
76
  "devDependencies": {
78
77
  "@types/bun": "^1.4.3",
79
- "@venizia/dev-configs": "0.4.7-0",
78
+ "@venizia/dev-configs": "0.4.7-1",
80
79
  "casbin": "^5.51.1",
81
80
  "eslint": "^10.13.0",
82
81
  "oxlint": "1.89.0",
@@ -1,70 +0,0 @@
1
- import { z } from '@hono/zod-openapi';
2
- /** Creates HTML content configuration for OpenAPI documentation. */
3
- export declare const htmlContent: (opts: {
4
- description: string;
5
- required?: boolean;
6
- }) => {
7
- description: string;
8
- content: {
9
- 'text/html': {
10
- schema: z.ZodString;
11
- };
12
- };
13
- required: boolean;
14
- };
15
- /** Creates HTML response configuration for OpenAPI documentation. */
16
- export declare const htmlResponse: (opts: {
17
- description: string;
18
- required?: boolean;
19
- }) => {
20
- '4XX': {
21
- description: string;
22
- content: {
23
- 'application/json': {
24
- schema: z.ZodObject<{
25
- statusCode: z.ZodOptional<z.ZodNumber>;
26
- message: z.ZodString;
27
- normalized: z.ZodOptional<z.ZodObject<{
28
- text: z.ZodString;
29
- code: z.ZodString;
30
- args: z.ZodRecord<z.ZodString, z.ZodAny>;
31
- }, z.core.$strip>>;
32
- extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
33
- requestId: z.ZodOptional<z.ZodString>;
34
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
35
- }, z.core.$strip>;
36
- };
37
- };
38
- required: boolean | undefined;
39
- };
40
- '5XX': {
41
- description: string;
42
- content: {
43
- 'application/json': {
44
- schema: z.ZodObject<{
45
- statusCode: z.ZodOptional<z.ZodNumber>;
46
- message: z.ZodString;
47
- normalized: z.ZodOptional<z.ZodObject<{
48
- text: z.ZodString;
49
- code: z.ZodString;
50
- args: z.ZodRecord<z.ZodString, z.ZodAny>;
51
- }, z.core.$strip>>;
52
- extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
53
- requestId: z.ZodOptional<z.ZodString>;
54
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
55
- }, z.core.$strip>;
56
- };
57
- };
58
- required: boolean | undefined;
59
- };
60
- 200: {
61
- description: string;
62
- content: {
63
- 'text/html': {
64
- schema: z.ZodString;
65
- };
66
- };
67
- required: boolean;
68
- };
69
- };
70
- //# sourceMappingURL=html-response.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"html-response.d.ts","sourceRoot":"","sources":["../../../../../src/base/controllers/common/html-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAGtC,oEAAoE;AACpE,eAAO,MAAM,WAAW,GAAI,MAAM;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;;;;CAe5E,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,YAAY,GAAI,MAAM;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ7E,CAAC"}
@@ -1,30 +0,0 @@
1
- import { errorResponses } from '../../models/common/index.js';
2
- import { z } from '@hono/zod-openapi';
3
- import { HTTP } from '@venizia/ignis-helpers/common';
4
- /** Creates HTML content configuration for OpenAPI documentation. */
5
- export const htmlContent = (opts) => {
6
- const { description } = opts;
7
- return {
8
- description,
9
- content: {
10
- 'text/html': {
11
- schema: z.string().openapi({
12
- description: 'HTML content',
13
- example: '<!DOCTYPE html><html><head><title>Page</title></head><body>...</body></html>',
14
- }),
15
- },
16
- },
17
- required: opts?.required ?? false,
18
- };
19
- };
20
- /** Creates HTML response configuration for OpenAPI documentation. */
21
- export const htmlResponse = (opts) => {
22
- return {
23
- [HTTP.ResultCodes.RS_2.Ok]: htmlContent({
24
- description: opts.description,
25
- required: opts.required,
26
- }),
27
- ...errorResponses(),
28
- };
29
- };
30
- //# sourceMappingURL=html-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"html-response.js","sourceRoot":"","sources":["../../../../../src/base/controllers/common/html-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,oEAAoE;AACpE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAiD,EAAE,EAAE;IAC/E,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE7B,OAAO;QACL,WAAW;QACX,OAAO,EAAE;YACP,WAAW,EAAE;gBACX,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;oBACzB,WAAW,EAAE,cAAc;oBAC3B,OAAO,EAAE,8EAA8E;iBACxF,CAAC;aACH;SACF;QACD,QAAQ,EAAE,IAAI,EAAE,QAAQ,IAAI,KAAK;KAClC,CAAC;AACJ,CAAC,CAAC;AAEF,qEAAqE;AACrE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAiD,EAAE,EAAE;IAChF,OAAO;QACL,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC;YACtC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;QACF,GAAG,cAAc,EAAE;KACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { errorResponses } from '@/base/models/common';\nimport { z } from '@hono/zod-openapi';\nimport { HTTP } from '@venizia/ignis-helpers/common';\n\n/** Creates HTML content configuration for OpenAPI documentation. */\nexport const htmlContent = (opts: { description: string; required?: boolean }) => {\n const { description } = opts;\n\n return {\n description,\n content: {\n 'text/html': {\n schema: z.string().openapi({\n description: 'HTML content',\n example: '<!DOCTYPE html><html><head><title>Page</title></head><body>...</body></html>',\n }),\n },\n },\n required: opts?.required ?? false,\n };\n};\n\n/** Creates HTML response configuration for OpenAPI documentation. */\nexport const htmlResponse = (opts: { description: string; required?: boolean }) => {\n return {\n [HTTP.ResultCodes.RS_2.Ok]: htmlContent({\n description: opts.description,\n required: opts.required,\n }),\n ...errorResponses(),\n };\n};\n"]}
@@ -1,19 +0,0 @@
1
- import type { IAuthorizationSpec } from '../../auth/authorize/common/types/index.js';
2
- import type { ICustomizableRoutes } from '../common/index.js';
3
- /**
4
- * Refuses a CRUD controller whose enabled write verb would inherit a controller-level `authorize`
5
- * that is only a `read` permission: the verb would then answer to anyone who may read.
6
- *
7
- * A write verb is fine when it declares its own `authorize` (a spec, an array, or `{ skip: true }`),
8
- * skips authentication, is not enabled, or the controller is `readonly`. Only the literal action
9
- * `read` is detected; a custom action name is the application's own vocabulary. An array counts when
10
- * every spec in it is `read`, since the specs of one route must all pass.
11
- */
12
- export declare const assertWriteVerbsDeclareAuthorize: (opts: {
13
- controllerName: string;
14
- authorize: IAuthorizationSpec | IAuthorizationSpec[] | undefined;
15
- routes: ICustomizableRoutes | undefined;
16
- readonly: boolean | undefined;
17
- enabledRoutes: Array<keyof ICustomizableRoutes> | undefined;
18
- }) => void;
19
- //# sourceMappingURL=authorize-guard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authorize-guard.d.ts","sourceRoot":"","sources":["../../../../../src/base/controllers/factory/authorize-guard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AASrD;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,GAAI,MAAM;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,GAAG,SAAS,CAAC;IACjE,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACxC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,aAAa,EAAE,KAAK,CAAC,MAAM,mBAAmB,CAAC,GAAG,SAAS,CAAC;CAC7D,KAAG,IA+CH,CAAC"}