@wildo-ai/saas-backend-lib 1.1.3 → 1.1.4

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 (1056) hide show
  1. package/dist/esm/__tests__/fixture-deep-partial.d.ts.map +1 -1
  2. package/dist/esm/__tests__/integration/redis-integration-gate.d.ts.map +1 -1
  3. package/dist/esm/__tests__/setup.d.ts.map +1 -1
  4. package/dist/esm/__tests__/test-container.d.ts.map +1 -1
  5. package/dist/esm/applications/models/applications.backend.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/seeds/application-metadata-defaults.seeds.d.ts.map +1 -1
  7. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.d.ts.map +1 -1
  8. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js.map +1 -1
  9. package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
  10. package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
  11. package/dist/esm/base-classes/models/repositories.backend.schemas.d.ts.map +1 -1
  12. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts +1 -1
  13. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts.map +1 -1
  14. package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts.map +1 -1
  15. package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts.map +1 -1
  16. package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts.map +1 -1
  17. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -1
  18. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -1
  19. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -1
  20. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +12 -1
  21. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -1
  22. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts.map +1 -1
  23. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js.map +1 -1
  24. package/dist/esm/base-classes/services/batches/resource-retention-sweep.batch.backend.service.d.ts.map +1 -1
  25. package/dist/esm/base-classes/services/batches/suspension-reactivation-sweep.batch.backend.service.d.ts.map +1 -1
  26. package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts.map +1 -1
  27. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
  28. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
  29. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
  30. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
  31. package/dist/esm/base-classes/services/controllers/utils/audit-access-fields.backend.utils.d.ts.map +1 -1
  32. package/dist/esm/base-classes/services/controllers/utils/operation-response-serializer.backend.utils.d.ts.map +1 -1
  33. package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts.map +1 -1
  34. package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.d.ts.map +1 -1
  35. package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts.map +1 -1
  36. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
  37. package/dist/esm/base-classes/services/repositories/http-api/http-api-filter-translation.backend.d.ts.map +1 -1
  38. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts.map +1 -1
  39. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js +13 -4
  40. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js.map +1 -1
  41. package/dist/esm/base-classes/services/repositories/http-api/http-api-query.backend.d.ts.map +1 -1
  42. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map +1 -1
  43. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js +17 -0
  44. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map +1 -1
  45. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
  46. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
  47. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts.map +1 -1
  48. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -1
  49. package/dist/esm/base-classes/services/repositories/http-api/http-api-row-projection.backend.d.ts.map +1 -1
  50. package/dist/esm/base-classes/services/repositories/http-api/http-api-subject-erasure-effect.backend.d.ts.map +1 -1
  51. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
  52. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
  53. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
  54. package/dist/esm/base-classes/services/repositories/http-api/odoo-jsonrpc-compiler.backend.d.ts.map +1 -1
  55. package/dist/esm/base-classes/services/repositories/http-api/rest-json-query-compiler.backend.d.ts.map +1 -1
  56. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
  57. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
  58. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
  59. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
  60. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +57 -0
  61. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
  62. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +95 -2
  63. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
  64. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
  65. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
  66. package/dist/esm/base-classes/services/repositories/repository-guarded-mutation.backend.types.d.ts.map +1 -1
  67. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +5 -2
  68. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
  69. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +14 -3
  70. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
  71. package/dist/esm/base-classes/services/repositories/repository-version-metadata.backend.utils.d.ts.map +1 -1
  72. package/dist/esm/base-classes/services/repositories/resource-write-integrity.backend.d.ts.map +1 -1
  73. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts +72 -0
  74. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts.map +1 -0
  75. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js +88 -0
  76. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js.map +1 -0
  77. package/dist/esm/base-classes/services/repositories/unique-constraint-conflict-reference.backend.d.ts.map +1 -1
  78. package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts.map +1 -1
  79. package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts.map +1 -1
  80. package/dist/esm/base-classes/services/services/__tests__/mock-system-access.service.d.ts.map +1 -1
  81. package/dist/esm/base-classes/services/services/read-only-field-change.backend.utils.d.ts.map +1 -1
  82. package/dist/esm/base-classes/services/services/resource-operation-audit-emission.backend.utils.d.ts.map +1 -1
  83. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
  84. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
  85. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts.map +1 -1
  86. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts.map +1 -1
  87. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
  88. package/dist/esm/base-classes/services/services/resource-operation-server-injected-fields.backend.utils.d.ts.map +1 -1
  89. package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.d.ts.map +1 -1
  90. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
  91. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
  92. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts.map +1 -1
  93. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js.map +1 -1
  94. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
  95. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +44 -6
  96. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
  97. package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts.map +1 -1
  98. package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
  99. package/dist/esm/base-classes/utils/backend-type-utils.d.ts.map +1 -1
  100. package/dist/esm/base-classes/utils/single-subject-addressing.backend.utils.d.ts.map +1 -1
  101. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -1
  102. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -1
  103. package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -1
  104. package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -1
  105. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -1
  106. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -1
  107. package/dist/esm/billing/services/back-office/abstract-billing.backend.service.d.ts.map +1 -1
  108. package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts.map +1 -1
  109. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +1 -1
  110. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -1
  111. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +5 -4
  112. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -1
  113. package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts.map +1 -1
  114. package/dist/esm/billing/services/back-office/billing-state.backend.service.js +11 -1
  115. package/dist/esm/billing/services/back-office/billing-state.backend.service.js.map +1 -1
  116. package/dist/esm/billing/services/back-office/billing-subject-erasure-effect.backend.d.ts.map +1 -1
  117. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -1
  118. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -1
  119. package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -1
  120. package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -1
  121. package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -1
  122. package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -1
  123. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts.map +1 -1
  124. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js.map +1 -1
  125. package/dist/esm/billing/services/billing.utils.d.ts.map +1 -1
  126. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -1
  127. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
  128. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +32 -0
  129. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -1
  130. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +32 -1
  131. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -1
  132. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -1
  133. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
  134. package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
  135. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
  136. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -1
  137. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -1
  138. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -1
  139. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +9 -6
  140. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts.map +1 -1
  141. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js +9 -6
  142. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js.map +1 -1
  143. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +1 -1
  144. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -1
  145. package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.d.ts.map +1 -1
  146. package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts.map +1 -1
  147. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -1
  148. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +50 -3
  149. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
  150. package/dist/esm/billing/testing/billing-test-fixtures.d.ts.map +1 -1
  151. package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
  152. package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
  153. package/dist/esm/charts/controllers/chart.backend.controller.d.ts.map +1 -1
  154. package/dist/esm/charts/services/chart-registry.backend.service.d.ts +80 -7
  155. package/dist/esm/charts/services/chart-registry.backend.service.d.ts.map +1 -1
  156. package/dist/esm/charts/services/chart-registry.backend.service.js +115 -8
  157. package/dist/esm/charts/services/chart-registry.backend.service.js.map +1 -1
  158. package/dist/esm/companion-exports.d.ts.map +1 -1
  159. package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts.map +1 -1
  160. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.d.ts.map +1 -1
  161. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
  162. package/dist/esm/compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service.d.ts.map +1 -1
  163. package/dist/esm/compliance/audit-trails/batches/siem-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  164. package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts.map +1 -1
  165. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
  166. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
  167. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +107 -4
  168. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
  169. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +176 -5
  170. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
  171. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.d.ts.map +1 -1
  172. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js.map +1 -1
  173. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
  174. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -1
  175. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
  176. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
  177. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -1
  178. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -1
  179. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
  180. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +21 -0
  181. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
  182. package/dist/esm/compliance/audit-trails/services/utils/ocsf-class-mapping.backend.utils.d.ts.map +1 -1
  183. package/dist/esm/compliance/audit-trails/services/utils/siem-dictionary.backend.utils.d.ts.map +1 -1
  184. package/dist/esm/compliance/audit-trails/services/utils/siem-ocsf-projection.backend.utils.d.ts.map +1 -1
  185. package/dist/esm/compliance/audit-trails/services/utils/siem-projection-contract.backend.utils.d.ts.map +1 -1
  186. package/dist/esm/compliance/audit-trails/utils/audit-actor.backend.utils.d.ts.map +1 -1
  187. package/dist/esm/compliance/audit-trails/utils/layer2-audit-provider-boot-diagnostic.backend.utils.d.ts.map +1 -1
  188. package/dist/esm/compliance/index.d.ts.map +1 -1
  189. package/dist/esm/compliance/privacy/retention-hide-predicate.backend.d.ts.map +1 -1
  190. package/dist/esm/compliance/privacy/services/subject-erasure-external-effects.backend.service.d.ts.map +1 -1
  191. package/dist/esm/compliance/privacy/services/subject-session-revocation.backend.service.d.ts.map +1 -1
  192. package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
  193. package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
  194. package/dist/esm/config/bootstrap/minion-initialization-projection.backend.d.ts.map +1 -1
  195. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.d.ts.map +1 -1
  196. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js +3 -0
  197. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js.map +1 -1
  198. package/dist/esm/config/bootstrap/runtime-principal.backend.service.d.ts.map +1 -1
  199. package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
  200. package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts.map +1 -1
  201. package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts.map +1 -1
  202. package/dist/esm/config/models/app-config.backend.schemas.d.ts +4 -4
  203. package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
  204. package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
  205. package/dist/esm/config/models/app-env-config.backend.schemas.d.ts.map +1 -1
  206. package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts +36 -0
  207. package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts.map +1 -0
  208. package/dist/esm/config/models/apps-manager-transport.backend.definitions.js +36 -0
  209. package/dist/esm/config/models/apps-manager-transport.backend.definitions.js.map +1 -0
  210. package/dist/esm/config/models/config-mutation-boundary.utils.d.ts.map +1 -1
  211. package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts.map +1 -1
  212. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts.map +1 -1
  213. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js.map +1 -1
  214. package/dist/esm/config/models/runtime-topology.backend.contracts.d.ts.map +1 -1
  215. package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts.map +1 -1
  216. package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -1
  217. package/dist/esm/config/services/app-configuration-loader.backend.service.js +3 -0
  218. package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -1
  219. package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -1
  220. package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -1
  221. package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
  222. package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
  223. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +12 -0
  224. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -1
  225. package/dist/esm/config/services/application-startup-config-validator.backend.service.js +28 -0
  226. package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
  227. package/dist/esm/data-seeding/batches/data-seeding-run-cleanup.batch.backend.service.d.ts.map +1 -1
  228. package/dist/esm/data-seeding/batches/data-seeding-scheduled-rerun.batch.backend.service.d.ts.map +1 -1
  229. package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.contracts.d.ts.map +1 -1
  230. package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.controller.d.ts.map +1 -1
  231. package/dist/esm/data-seeding/data-seeding-models.d.ts.map +1 -1
  232. package/dist/esm/data-seeding/models/business-key-resolver.shared.utils.d.ts.map +1 -1
  233. package/dist/esm/data-seeding/models/data-seed-execution-context.shared.types.d.ts.map +1 -1
  234. package/dist/esm/data-seeding/models/data-seed-migrator-runner.shared.utils.d.ts.map +1 -1
  235. package/dist/esm/data-seeding/models/data-seed-reconciler.shared.utils.d.ts.map +1 -1
  236. package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.schemas.d.ts.map +1 -1
  237. package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.utils.d.ts.map +1 -1
  238. package/dist/esm/data-seeding/models/data-seed-run.shared.resources-config.schemas.d.ts.map +1 -1
  239. package/dist/esm/data-seeding/models/data-seed-run.shared.schemas.d.ts.map +1 -1
  240. package/dist/esm/data-seeding/models/data-seed-trigger-mode-matrix.shared.utils.d.ts.map +1 -1
  241. package/dist/esm/data-seeding/models/data-seed.shared.schemas.d.ts.map +1 -1
  242. package/dist/esm/data-seeding/services/data-seed-application-bootstrap.backend.d.ts.map +1 -1
  243. package/dist/esm/data-seeding/services/data-seed-dispatcher.backend.service.d.ts.map +1 -1
  244. package/dist/esm/data-seeding/services/data-seed-registry.backend.service.d.ts.map +1 -1
  245. package/dist/esm/data-seeding/services/data-seed-scope-resolver-registry.backend.service.d.ts.map +1 -1
  246. package/dist/esm/data-seeding/services/engines/additive-seed-engine.backend.service.d.ts.map +1 -1
  247. package/dist/esm/data-seeding/services/engines/lazy-seed-engine.backend.service.d.ts.map +1 -1
  248. package/dist/esm/data-seeding/services/engines/manual-seed-engine.backend.service.d.ts.map +1 -1
  249. package/dist/esm/data-seeding/services/engines/sync-seed-engine.backend.service.d.ts.map +1 -1
  250. package/dist/esm/data-seeding/services/engines/upgrade-seed-engine.backend.service.d.ts.map +1 -1
  251. package/dist/esm/data-seeding/services/shared/data-seed-business-key.shared.utils.d.ts.map +1 -1
  252. package/dist/esm/data-seeding/services/shared/data-seed-error.shared.utils.d.ts.map +1 -1
  253. package/dist/esm/data-seeding/services/shared/data-seed-run-counters.shared.types.d.ts.map +1 -1
  254. package/dist/esm/data-seeding/services/shared/data-seed-run-ledger.backend.d.ts.map +1 -1
  255. package/dist/esm/data-seeding/services/shared/data-seed-scope-anchor.shared.types.d.ts.map +1 -1
  256. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts.map +1 -1
  257. package/dist/esm/data-seeding/services/shared/data-seed-scope-resolution.backend.d.ts.map +1 -1
  258. package/dist/esm/databases/models/aggregation.backend.schemas.d.ts.map +1 -1
  259. package/dist/esm/databases/models/databases.backend.schemas.d.ts.map +1 -1
  260. package/dist/esm/databases/models/filter.backend.schemas.d.ts.map +1 -1
  261. package/dist/esm/databases/models/resolve-persistence-adapter.backend.utils.d.ts.map +1 -1
  262. package/dist/esm/databases/models/sql.backend.schemas.d.ts.map +1 -1
  263. package/dist/esm/databases/models/transaction.shared.schemas.d.ts.map +1 -1
  264. package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts.map +1 -1
  265. package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts.map +1 -1
  266. package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts.map +1 -1
  267. package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts.map +1 -1
  268. package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts.map +1 -1
  269. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
  270. package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.d.ts.map +1 -1
  271. package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts.map +1 -1
  272. package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts.map +1 -1
  273. package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts.map +1 -1
  274. package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts.map +1 -1
  275. package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts.map +1 -1
  276. package/dist/esm/databases/services/db-utils.d.ts.map +1 -1
  277. package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts.map +1 -1
  278. package/dist/esm/databases/services/mongodb.service.d.ts.map +1 -1
  279. package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts.map +1 -1
  280. package/dist/esm/databases/services/postgresql-database.backend.service.d.ts.map +1 -1
  281. package/dist/esm/databases/services/postgresql-development-provisioning.backend.d.ts.map +1 -1
  282. package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts.map +1 -1
  283. package/dist/esm/databases/services/postgresql-migration-runner.backend.d.ts.map +1 -1
  284. package/dist/esm/databases/services/postgresql-schema-ddl.backend.d.ts.map +1 -1
  285. package/dist/esm/databases/services/postgresql-schema-migration-sql.backend.d.ts.map +1 -1
  286. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
  287. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
  288. package/dist/esm/databases/services/postgresql-schema-plan-lockfile.backend.d.ts.map +1 -1
  289. package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
  290. package/dist/esm/databases/services/resource-persistence-unit-of-work.backend.service.d.ts.map +1 -1
  291. package/dist/esm/databases/services/schema-planning-standalone.backend.d.ts.map +1 -1
  292. package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts.map +1 -1
  293. package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts.map +1 -1
  294. package/dist/esm/databases/utils/postgresql-identifier.backend.utils.d.ts.map +1 -1
  295. package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts.map +1 -1
  296. package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -1
  297. package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -1
  298. package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
  299. package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
  300. package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
  301. package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -1
  302. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts.map +1 -1
  303. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js.map +1 -1
  304. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts.map +1 -1
  305. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
  306. package/dist/esm/external-data/batches/external-data-pipeline-scheduled-run.batch.backend.service.d.ts.map +1 -1
  307. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -1
  308. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -1
  309. package/dist/esm/external-data/external-data-extraction-source.backend.d.ts.map +1 -1
  310. package/dist/esm/external-data/external-data-models.exports.d.ts.map +1 -1
  311. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
  312. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
  313. package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
  314. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
  315. package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts.map +1 -1
  316. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts.map +1 -1
  317. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.js.map +1 -1
  318. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts +102 -52
  319. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -1
  320. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +117 -71
  321. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -1
  322. package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -1
  323. package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -1
  324. package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -1
  325. package/dist/esm/external-providers/operations/provider-request-signing.backend.js +26 -7
  326. package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -1
  327. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -1
  328. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +1 -1
  329. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -1
  330. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -1
  331. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -1
  332. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -1
  333. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts.map +1 -1
  334. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js.map +1 -1
  335. package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts +81 -34
  336. package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts.map +1 -1
  337. package/dist/esm/external-providers/services/document-extraction.backend.service.js +179 -98
  338. package/dist/esm/external-providers/services/document-extraction.backend.service.js.map +1 -1
  339. package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
  340. package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
  341. package/dist/esm/external-providers/services/external-api-handler.backend.service.d.ts.map +1 -1
  342. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +121 -0
  343. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
  344. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +151 -0
  345. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
  346. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts +15 -1
  347. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts.map +1 -1
  348. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js +60 -4
  349. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
  350. package/dist/esm/features/controllers/features.backend.controller.d.ts.map +1 -1
  351. package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts.map +1 -1
  352. package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts.map +1 -1
  353. package/dist/esm/features/services/application-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
  354. package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts.map +1 -1
  355. package/dist/esm/features/services/feature-gate.backend.service.d.ts.map +1 -1
  356. package/dist/esm/features/services/feature-resolution.backend.service.d.ts.map +1 -1
  357. package/dist/esm/features/services/organization-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
  358. package/dist/esm/features/services/scope-feature-ledger-relationship.backend.utils.d.ts.map +1 -1
  359. package/dist/esm/features/services/scope-features-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
  360. package/dist/esm/features/testing/feature-test-utils.d.ts.map +1 -1
  361. package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts.map +1 -1
  362. package/dist/esm/files/constraints/file-analyzers.types.d.ts.map +1 -1
  363. package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts.map +1 -1
  364. package/dist/esm/files/constraints/file-constraint.types.d.ts.map +1 -1
  365. package/dist/esm/files/constraints/file-validation.backend.service.d.ts.map +1 -1
  366. package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts.map +1 -1
  367. package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
  368. package/dist/esm/files/controllers/file.controller.js.map +1 -1
  369. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -1
  370. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -1
  371. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +37 -0
  372. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
  373. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +221 -21
  374. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
  375. package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts.map +1 -1
  376. package/dist/esm/files/scanning/file-scan.types.d.ts.map +1 -1
  377. package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts.map +1 -1
  378. package/dist/esm/files/scanning/yara-scanner.backend.service.js +20 -2
  379. package/dist/esm/files/scanning/yara-scanner.backend.service.js.map +1 -1
  380. package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts.map +1 -1
  381. package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts.map +1 -1
  382. package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts.map +1 -1
  383. package/dist/esm/files/services/file-field-detection.backend.service.d.ts.map +1 -1
  384. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
  385. package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
  386. package/dist/esm/files/services/file-population.backend.service.d.ts.map +1 -1
  387. package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
  388. package/dist/esm/files/services/file-scanning.backend.service.js +5 -0
  389. package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -1
  390. package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -1
  391. package/dist/esm/files/services/file-text-extraction.backend.service.js +8 -5
  392. package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -1
  393. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -1
  394. package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -1
  395. package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
  396. package/dist/esm/files/services/files.backend.service.js +3 -1
  397. package/dist/esm/files/services/files.backend.service.js.map +1 -1
  398. package/dist/esm/files/services/rag-source-field-detection.backend.service.d.ts.map +1 -1
  399. package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -1
  400. package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -1
  401. package/dist/esm/files/storage/file-storage-path-resolver.backend.service.d.ts.map +1 -1
  402. package/dist/esm/files/storage/file-storage-provider.types.d.ts +36 -1
  403. package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -1
  404. package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -1
  405. package/dist/esm/files/storage/file-storage-router.backend.service.d.ts +21 -3
  406. package/dist/esm/files/storage/file-storage-router.backend.service.d.ts.map +1 -1
  407. package/dist/esm/files/storage/file-storage-router.backend.service.js +38 -5
  408. package/dist/esm/files/storage/file-storage-router.backend.service.js.map +1 -1
  409. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts +87 -0
  410. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts.map +1 -0
  411. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js +340 -0
  412. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js.map +1 -0
  413. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -1
  414. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -1
  415. package/dist/esm/files/storage/storage-credential-provider.backend.utils.d.ts.map +1 -1
  416. package/dist/esm/files/storage/storage-platform-sts-credential-resolver.backend.utils.d.ts.map +1 -1
  417. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.d.ts.map +1 -1
  418. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js +10 -3
  419. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js.map +1 -1
  420. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
  421. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
  422. package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
  423. package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
  424. package/dist/esm/files/utils/file-upload.utils.d.ts.map +1 -1
  425. package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
  426. package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
  427. package/dist/esm/files/utils/file-validation.utils.d.ts.map +1 -1
  428. package/dist/esm/files/utils/image-derivation.backend.utils.d.ts.map +1 -1
  429. package/dist/esm/files/utils/image-thumbnail.backend.utils.d.ts.map +1 -1
  430. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -1
  431. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -1
  432. package/dist/esm/files/utils/rag-source-field-schema-path.backend.utils.d.ts.map +1 -1
  433. package/dist/esm/files/utils/storage-application-identity.backend.utils.d.ts.map +1 -1
  434. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts.map +1 -1
  435. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js.map +1 -1
  436. package/dist/esm/flows-actors/a2a/batches/a2a-push-delivery.batch.backend.service.d.ts.map +1 -1
  437. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.d.ts.map +1 -1
  438. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js.map +1 -1
  439. package/dist/esm/flows-actors/a2a/models/a2a-dialect.backend.schemas.d.ts.map +1 -1
  440. package/dist/esm/flows-actors/a2a/models/a2a-push-notification-delivery.backend.utils.d.ts.map +1 -1
  441. package/dist/esm/flows-actors/a2a/models/a2a-push-notification.backend.schemas.d.ts.map +1 -1
  442. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts.map +1 -1
  443. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js.map +1 -1
  444. package/dist/esm/flows-actors/a2a/services/a2a-push-delivery-log.repository.d.ts.map +1 -1
  445. package/dist/esm/flows-actors/a2a/services/a2a-push-dispatcher.backend.service.d.ts.map +1 -1
  446. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts.map +1 -1
  447. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
  448. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts.map +1 -1
  449. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js.map +1 -1
  450. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts.map +1 -1
  451. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js.map +1 -1
  452. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts.map +1 -1
  453. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.js.map +1 -1
  454. package/dist/esm/flows-actors/controllers/flows-actors.controller.d.ts.map +1 -1
  455. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -1
  456. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -1
  457. package/dist/esm/flows-actors/models/agent-facets.backend.definitions.d.ts.map +1 -1
  458. package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts.map +1 -1
  459. package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -1
  460. package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -1
  461. package/dist/esm/flows-actors/models/flows-actors.backend.definitions.d.ts.map +1 -1
  462. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -1
  463. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -1
  464. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +107 -16
  465. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
  466. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +118 -18
  467. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
  468. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.d.ts.map +1 -1
  469. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js.map +1 -1
  470. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -1
  471. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -1
  472. package/dist/esm/flows-actors/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.d.ts.map +1 -1
  473. package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -1
  474. package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -1
  475. package/dist/esm/flows-actors/services/agent-call-trace-sink.backend.d.ts.map +1 -1
  476. package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts.map +1 -1
  477. package/dist/esm/flows-actors/services/agents.backend.service.d.ts +104 -5
  478. package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
  479. package/dist/esm/flows-actors/services/agents.backend.service.js +263 -31
  480. package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
  481. package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts.map +1 -1
  482. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +46 -1
  483. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
  484. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +193 -6
  485. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
  486. package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
  487. package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
  488. package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -1
  489. package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -1
  490. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.d.ts.map +1 -1
  491. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js.map +1 -1
  492. package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -1
  493. package/dist/esm/flows-actors/services/mcp-client.backend.service.js +3 -0
  494. package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -1
  495. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts +99 -0
  496. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts.map +1 -0
  497. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js +155 -0
  498. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js.map +1 -0
  499. package/dist/esm/flows-actors/services/meta-workflow-evaluation-treatment-compiler.backend.service.d.ts.map +1 -1
  500. package/dist/esm/flows-actors/services/meta-workflow-standard-action-contracts.backend.service.d.ts.map +1 -1
  501. package/dist/esm/flows-actors/services/meta-workflow-standard-evaluation-contracts.backend.service.d.ts.map +1 -1
  502. package/dist/esm/flows-actors/services/meta-workflow-structured-artifact-action-compiler.backend.service.d.ts.map +1 -1
  503. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -1
  504. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -1
  505. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
  506. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +9 -0
  507. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
  508. package/dist/esm/flows-actors/utils/bounded-subprocess.backend.utils.d.ts.map +1 -1
  509. package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts.map +1 -1
  510. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts.map +1 -1
  511. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js.map +1 -1
  512. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.d.ts.map +1 -1
  513. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js.map +1 -1
  514. package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts.map +1 -1
  515. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts +77 -0
  516. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts.map +1 -0
  517. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js +164 -0
  518. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js.map +1 -0
  519. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts +48 -0
  520. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts.map +1 -0
  521. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js +101 -0
  522. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js.map +1 -0
  523. package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts.map +1 -1
  524. package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts.map +1 -1
  525. package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts.map +1 -1
  526. package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts.map +1 -1
  527. package/dist/esm/guidance/services/lifecycle-scope-id.backend.utils.d.ts.map +1 -1
  528. package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts.map +1 -1
  529. package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts.map +1 -1
  530. package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
  531. package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -1
  532. package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts.map +1 -1
  533. package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -1
  534. package/dist/esm/guidance/services/scoped-state-read-custom-implementations.backend.d.ts.map +1 -1
  535. package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
  536. package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
  537. package/dist/esm/i18n/services/i18n.backend.service.d.ts.map +1 -1
  538. package/dist/esm/index.d.ts +0 -1
  539. package/dist/esm/index.d.ts.map +1 -1
  540. package/dist/esm/index.js +0 -1
  541. package/dist/esm/index.js.map +1 -1
  542. package/dist/esm/inject/models/container.d.ts +10 -0
  543. package/dist/esm/inject/models/container.d.ts.map +1 -1
  544. package/dist/esm/inject/models/container.js +49 -1
  545. package/dist/esm/inject/models/container.js.map +1 -1
  546. package/dist/esm/inject/models/service-types.d.ts +3 -0
  547. package/dist/esm/inject/models/service-types.d.ts.map +1 -1
  548. package/dist/esm/inject/models/service-types.js +3 -0
  549. package/dist/esm/inject/models/service-types.js.map +1 -1
  550. package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
  551. package/dist/esm/mcp/controllers/mcp.controller.js +50 -3
  552. package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
  553. package/dist/esm/mcp/models/mcp-protocol.backend.schemas.d.ts.map +1 -1
  554. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
  555. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
  556. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
  557. package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
  558. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
  559. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
  560. package/dist/esm/mcp/services/resource-server-instances-registry.backend.service.d.ts.map +1 -1
  561. package/dist/esm/mcp/utils/zod-to-mcp-json-schema.backend.utils.d.ts.map +1 -1
  562. package/dist/esm/meta-workflow-runtime.exports.d.ts.map +1 -1
  563. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -1
  564. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -1
  565. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -1
  566. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -1
  567. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -1
  568. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -1
  569. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -1
  570. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -1
  571. package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -1
  572. package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
  573. package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts.map +1 -1
  574. package/dist/esm/monitoring/logger/services/logger.service.d.ts +12 -0
  575. package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -1
  576. package/dist/esm/monitoring/logger/services/logger.service.js +3 -3
  577. package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -1
  578. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts.map +1 -1
  579. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -1
  580. package/dist/esm/monitoring/logger/utils/log-value-normalization.backend.utils.d.ts.map +1 -1
  581. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +10 -6
  582. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -1
  583. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +10 -6
  584. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -1
  585. package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
  586. package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
  587. package/dist/esm/monitoring/observability/otel-preload.d.ts.map +1 -1
  588. package/dist/esm/monitoring/observability/otel-sdk-global-handle.d.ts.map +1 -1
  589. package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.d.ts.map +1 -1
  590. package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
  591. package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
  592. package/dist/esm/monitoring/observability/services/observability.backend.service.d.ts.map +1 -1
  593. package/dist/esm/notifications/email/components/email-components.d.ts.map +1 -1
  594. package/dist/esm/notifications/email/models/email-template-definition.d.ts.map +1 -1
  595. package/dist/esm/notifications/email/models/email-transport.backend.definitions.d.ts.map +1 -1
  596. package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts.map +1 -1
  597. package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -1
  598. package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -1
  599. package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -1
  600. package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -1
  601. package/dist/esm/notifications/email/services/email.backend.service.d.ts +47 -6
  602. package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
  603. package/dist/esm/notifications/email/services/email.backend.service.js +86 -36
  604. package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -1
  605. package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -1
  606. package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -1
  607. package/dist/esm/notifications/email/utils/interpolate-email-label.utils.d.ts.map +1 -1
  608. package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts.map +1 -1
  609. package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
  610. package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
  611. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
  612. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
  613. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts +32 -0
  614. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts.map +1 -0
  615. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js +32 -0
  616. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js.map +1 -0
  617. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +64 -10
  618. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
  619. package/dist/esm/notifications/sms/services/sms.backend.service.js +277 -82
  620. package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -1
  621. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
  622. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
  623. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  624. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
  625. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
  626. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
  627. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
  628. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.custom-impl.backend.service.d.ts.map +1 -1
  629. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.repository.d.ts.map +1 -1
  630. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-dispatcher.backend.service.d.ts.map +1 -1
  631. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-public-key.custom-impl.backend.service.d.ts.map +1 -1
  632. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
  633. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
  634. package/dist/esm/notifications/webhooks/outbound/services/webhook-config.backend.service.d.ts.map +1 -1
  635. package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts.map +1 -1
  636. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -1
  637. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -1
  638. package/dist/esm/organizations/batches/organization-member-invitation-sweep.batch.backend.service.d.ts.map +1 -1
  639. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts.map +1 -1
  640. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
  641. package/dist/esm/organizations/services/authority-change-audit.backend.utils.d.ts.map +1 -1
  642. package/dist/esm/organizations/services/invitation-acceptance.backend.utils.d.ts.map +1 -1
  643. package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts.map +1 -1
  644. package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts.map +1 -1
  645. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
  646. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
  647. package/dist/esm/organizations/services/organization-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
  648. package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts.map +1 -1
  649. package/dist/esm/organizations/services/organization-onboarding-operation.backend.utils.d.ts.map +1 -1
  650. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
  651. package/dist/esm/organizations/services/organization-unit-member-custom-implementation.backend.service.d.ts.map +1 -1
  652. package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts.map +1 -1
  653. package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts.map +1 -1
  654. package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts.map +1 -1
  655. package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.d.ts.map +1 -1
  656. package/dist/esm/pdf-templates/models/pdf-template-binding.d.ts.map +1 -1
  657. package/dist/esm/pdf-templates/models/pdf-template-definition.d.ts.map +1 -1
  658. package/dist/esm/pdf-templates/services/pdf-generated-file-writer.backend.service.d.ts.map +1 -1
  659. package/dist/esm/pdf-templates/services/pdf-generation-orchestrator.backend.service.d.ts.map +1 -1
  660. package/dist/esm/pdf-templates/services/pdf-renderer.backend.service.d.ts.map +1 -1
  661. package/dist/esm/pdf-templates/services/pdf-template-binding.backend.service.d.ts.map +1 -1
  662. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -1
  663. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -1
  664. package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -1
  665. package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -1
  666. package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -1
  667. package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -1
  668. package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -1
  669. package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -1
  670. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
  671. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
  672. package/dist/esm/queue/apps-crontabs-manager.backend.service.d.ts.map +1 -1
  673. package/dist/esm/queue/cron-job-sync.backend.service.d.ts.map +1 -1
  674. package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
  675. package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
  676. package/dist/esm/queue/job-completion-registry.backend.service.d.ts.map +1 -1
  677. package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
  678. package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
  679. package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
  680. package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
  681. package/dist/esm/queue/job-payload-storage.backend.service.d.ts.map +1 -1
  682. package/dist/esm/queue/job-status-tracking.backend.service.d.ts.map +1 -1
  683. package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
  684. package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -1
  685. package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -1
  686. package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -1
  687. package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
  688. package/dist/esm/queue/queue.backend.service.js.map +1 -1
  689. package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts.map +1 -1
  690. package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
  691. package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
  692. package/dist/esm/rag/batches/rag-embedding-drain.batch.backend.service.d.ts.map +1 -1
  693. package/dist/esm/rag/batches/rag-reconciliation-sweep.batch.backend.service.d.ts.map +1 -1
  694. package/dist/esm/rag/models/rag-chunk-store.backend.types.d.ts.map +1 -1
  695. package/dist/esm/rag/models/rag-retrieval.backend.types.d.ts.map +1 -1
  696. package/dist/esm/rag/services/mongodb-rag-chunk-store.backend.service.d.ts.map +1 -1
  697. package/dist/esm/rag/services/postgresql-rag-chunk-store.backend.service.d.ts.map +1 -1
  698. package/dist/esm/rag/services/rag-chunk-collection.mongodb-ddl.backend.d.ts.map +1 -1
  699. package/dist/esm/rag/services/rag-chunk-retrieval.mongodb-query.backend.d.ts.map +1 -1
  700. package/dist/esm/rag/services/rag-chunk-retrieval.postgresql-query.backend.d.ts.map +1 -1
  701. package/dist/esm/rag/services/rag-chunk-store.backend.service.d.ts.map +1 -1
  702. package/dist/esm/rag/services/rag-chunk-table.postgresql-ddl.backend.d.ts.map +1 -1
  703. package/dist/esm/rag/services/rag-ingestion.backend.service.d.ts.map +1 -1
  704. package/dist/esm/rag/services/rag-retrieval.backend.service.d.ts.map +1 -1
  705. package/dist/esm/rag/utils/rag-chunk-fusion.backend.utils.d.ts.map +1 -1
  706. package/dist/esm/rag/utils/rag-chunk-removal.backend.utils.d.ts.map +1 -1
  707. package/dist/esm/rag/utils/rag-chunk-row-shaping.backend.utils.d.ts.map +1 -1
  708. package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
  709. package/dist/esm/rag/utils/rag-chunking.backend.utils.js.map +1 -1
  710. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts.map +1 -1
  711. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
  712. package/dist/esm/rag/utils/rag-ingestion-trigger.backend.utils.d.ts.map +1 -1
  713. package/dist/esm/rag/utils/rag-retrieval-scope.backend.utils.d.ts.map +1 -1
  714. package/dist/esm/rag/utils/rag-source-field-value.backend.utils.d.ts.map +1 -1
  715. package/dist/esm/requests/models/api-routes.backend.defintions.d.ts.map +1 -1
  716. package/dist/esm/requests/models/requests.backend.schemas.d.ts.map +1 -1
  717. package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts.map +1 -1
  718. package/dist/esm/requests/service/platform-requests.backend.utils.d.ts.map +1 -1
  719. package/dist/esm/requests/service/remote-client-base.backend.service.d.ts.map +1 -1
  720. package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts.map +1 -1
  721. package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
  722. package/dist/esm/requests/service/websocket.service.js +49 -1
  723. package/dist/esm/requests/service/websocket.service.js.map +1 -1
  724. package/dist/esm/resources/backend-resource-registry.exports.d.ts.map +1 -1
  725. package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
  726. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +2 -0
  727. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
  728. package/dist/esm/resources/models/index.d.ts.map +1 -1
  729. package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -1
  730. package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -1
  731. package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -1
  732. package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -1
  733. package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -1
  734. package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -1
  735. package/dist/esm/resources/models/resources.backend.schemas.d.ts.map +1 -1
  736. package/dist/esm/resources/models/virtual-fields.backend.types.d.ts.map +1 -1
  737. package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts.map +1 -1
  738. package/dist/esm/resources/services/resource-context.backend.service.d.ts.map +1 -1
  739. package/dist/esm/resources/services/resource-id.backend.service.d.ts.map +1 -1
  740. package/dist/esm/resources/services/resource-population.backend.service.d.ts +17 -2
  741. package/dist/esm/resources/services/resource-population.backend.service.d.ts.map +1 -1
  742. package/dist/esm/resources/services/resource-population.backend.service.js +74 -18
  743. package/dist/esm/resources/services/resource-population.backend.service.js.map +1 -1
  744. package/dist/esm/resources/services/resources-registry.backend.service.d.ts +23 -0
  745. package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
  746. package/dist/esm/resources/services/resources-registry.backend.service.js +31 -0
  747. package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
  748. package/dist/esm/resources/services/virtual-fields.backend.service.d.ts.map +1 -1
  749. package/dist/esm/resources/utils/resource-retention.backend.utils.d.ts.map +1 -1
  750. package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
  751. package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
  752. package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
  753. package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
  754. package/dist/esm/runtime/models/execution-context.backend.schemas.d.ts.map +1 -1
  755. package/dist/esm/runtime/models/request-context.als.backend.d.ts.map +1 -1
  756. package/dist/esm/runtime/models/runtime.backend.schemas.d.ts.map +1 -1
  757. package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
  758. package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
  759. package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts.map +1 -1
  760. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -1
  761. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -1
  762. package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
  763. package/dist/esm/runtime/services/http-server.backend.service.js +10 -0
  764. package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
  765. package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
  766. package/dist/esm/runtime/services/start-application.backend.service.js +26 -12
  767. package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
  768. package/dist/esm/runtime/services/utils/oauth-body-cap.backend.utils.d.ts.map +1 -1
  769. package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts.map +1 -1
  770. package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts.map +1 -1
  771. package/dist/esm/runtime/utils/application-startup-config-access.backend.utils.d.ts.map +1 -1
  772. package/dist/esm/runtime/utils/feature-gated-core-resource-exclusions.backend.utils.d.ts.map +1 -1
  773. package/dist/esm/runtime/utils/request-client-ip.utils.d.ts.map +1 -1
  774. package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts.map +1 -1
  775. package/dist/esm/security/api-keys/api-key-generation.backend.utils.d.ts.map +1 -1
  776. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts.map +1 -1
  777. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js.map +1 -1
  778. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -1
  779. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -1
  780. package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.d.ts.map +1 -1
  781. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts +22 -0
  782. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -1
  783. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +84 -0
  784. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -1
  785. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts.map +1 -1
  786. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
  787. package/dist/esm/security/authentications/models/auth-constants.backend.d.ts.map +1 -1
  788. package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts.map +1 -1
  789. package/dist/esm/security/authentications/models/authorization-client.backend.schemas.d.ts.map +1 -1
  790. package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
  791. package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
  792. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts +37 -0
  793. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts.map +1 -0
  794. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js +37 -0
  795. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js.map +1 -0
  796. package/dist/esm/security/authentications/models/identity-persistence-boundaries.backend.d.ts.map +1 -1
  797. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
  798. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +15 -0
  799. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -1
  800. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -1
  801. package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.d.ts.map +1 -1
  802. package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts.map +1 -1
  803. package/dist/esm/security/authentications/models/user-authorization-version.backend.utils.d.ts.map +1 -1
  804. package/dist/esm/security/authentications/seeds/enterprise-config-defaults.seeds.d.ts.map +1 -1
  805. package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts.map +1 -1
  806. package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts.map +1 -1
  807. package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.d.ts.map +1 -1
  808. package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts.map +1 -1
  809. package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts.map +1 -1
  810. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -1
  811. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -1
  812. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -1
  813. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -1
  814. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -1
  815. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -1
  816. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -1
  817. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -1
  818. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.d.ts.map +1 -1
  819. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js +2 -1
  820. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js.map +1 -1
  821. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +9 -2
  822. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -1
  823. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +9 -2
  824. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
  825. package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts.map +1 -1
  826. package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts.map +1 -1
  827. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
  828. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
  829. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
  830. package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts.map +1 -1
  831. package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts.map +1 -1
  832. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -1
  833. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -1
  834. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts +97 -0
  835. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -1
  836. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +218 -26
  837. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -1
  838. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts +14 -0
  839. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -1
  840. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +36 -0
  841. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -1
  842. package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.d.ts.map +1 -1
  843. package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts.map +1 -1
  844. package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts.map +1 -1
  845. package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts.map +1 -1
  846. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -1
  847. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -1
  848. package/dist/esm/security/authentications/services/auth-session-store.backend.service.d.ts.map +1 -1
  849. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
  850. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
  851. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -1
  852. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -1
  853. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts.map +1 -1
  854. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js.map +1 -1
  855. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -1
  856. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -1
  857. package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.d.ts.map +1 -1
  858. package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts.map +1 -1
  859. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -1
  860. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +57 -1
  861. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -1
  862. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -1
  863. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -1
  864. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.d.ts.map +1 -1
  865. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js +11 -1
  866. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js.map +1 -1
  867. package/dist/esm/security/authentications/services/email-verification-initiator.backend.service.d.ts.map +1 -1
  868. package/dist/esm/security/authentications/services/machine-token-issuer.backend.service.d.ts.map +1 -1
  869. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts.map +1 -1
  870. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map +1 -1
  871. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map +1 -1
  872. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js.map +1 -1
  873. package/dist/esm/security/authentications/services/oidc-user-claims.backend.service.d.ts.map +1 -1
  874. package/dist/esm/security/authentications/services/resolve-active-member-orgs.backend.utils.d.ts.map +1 -1
  875. package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts.map +1 -1
  876. package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts.map +1 -1
  877. package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts.map +1 -1
  878. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.d.ts.map +1 -1
  879. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js.map +1 -1
  880. package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.d.ts.map +1 -1
  881. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -1
  882. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -1
  883. package/dist/esm/security/authentications/services/utils/concurrent-session-eviction.backend.utils.d.ts.map +1 -1
  884. package/dist/esm/security/authentications/services/utils/ensure-user-profile.backend.utils.d.ts.map +1 -1
  885. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts.map +1 -1
  886. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js.map +1 -1
  887. package/dist/esm/security/authentications/services/utils/machine-auth-rate-limit.backend.utils.d.ts.map +1 -1
  888. package/dist/esm/security/authentications/services/utils/pkce.backend.utils.d.ts.map +1 -1
  889. package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts.map +1 -1
  890. package/dist/esm/security/authentications/utils/application-auth-policy-audit.backend.utils.d.ts.map +1 -1
  891. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts.map +1 -1
  892. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js.map +1 -1
  893. package/dist/esm/security/authentications/utils/one-off-session-lifetime.backend.utils.d.ts.map +1 -1
  894. package/dist/esm/security/authentications/utils/social-oauth2-purpose.backend.utils.d.ts.map +1 -1
  895. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts +59 -0
  896. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts.map +1 -0
  897. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js +111 -0
  898. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js.map +1 -0
  899. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts +57 -0
  900. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts.map +1 -0
  901. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js +133 -0
  902. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js.map +1 -0
  903. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts +41 -0
  904. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts.map +1 -0
  905. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js +157 -0
  906. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js.map +1 -0
  907. package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts +84 -0
  908. package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts.map +1 -0
  909. package/dist/esm/security/authorizations/application-wide-read-admission.backend.js +99 -0
  910. package/dist/esm/security/authorizations/application-wide-read-admission.backend.js.map +1 -0
  911. package/dist/esm/security/authorizations/authorization-denial-audit.backend.utils.d.ts.map +1 -1
  912. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -1
  913. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -1
  914. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
  915. package/dist/esm/security/authorizations/junction-scope-resolution.backend.d.ts.map +1 -1
  916. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
  917. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
  918. package/dist/esm/security/authorizations/organization-unit-narrowing-enforcement.backend.d.ts.map +1 -1
  919. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.d.ts.map +1 -1
  920. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js +20 -181
  921. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
  922. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -1
  923. package/dist/esm/security/authorizations/relationship-foreign-key-filter.backend.d.ts.map +1 -1
  924. package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
  925. package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
  926. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +40 -0
  927. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -1
  928. package/dist/esm/security/authorizations/role-conferral.backend.utils.js +43 -1
  929. package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -1
  930. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +27 -17
  931. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts.map +1 -1
  932. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js +27 -17
  933. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js.map +1 -1
  934. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +72 -0
  935. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
  936. package/dist/esm/security/authorizations/services/authorizations.backend.service.js +153 -10
  937. package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
  938. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
  939. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
  940. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts.map +1 -1
  941. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -1
  942. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +139 -1
  943. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -1
  944. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +474 -33
  945. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -1
  946. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +40 -0
  947. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -1
  948. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -1
  949. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -1
  950. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -1
  951. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +19 -0
  952. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -1
  953. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +38 -0
  954. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -1
  955. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -1
  956. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -1
  957. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -1
  958. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +17 -1
  959. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -1
  960. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +14 -0
  961. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -1
  962. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +16 -0
  963. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -1
  964. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -1
  965. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +1 -1
  966. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -1
  967. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +19 -0
  968. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -1
  969. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +45 -2
  970. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -1
  971. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -1
  972. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -1
  973. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +37 -1
  974. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -1
  975. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -1
  976. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -1
  977. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -1
  978. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -1
  979. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -1
  980. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts +34 -0
  981. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts.map +1 -0
  982. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js +39 -0
  983. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js.map +1 -0
  984. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
  985. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -1
  986. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
  987. package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.d.ts.map +1 -1
  988. package/dist/esm/security/consumable-tokens/models/index.d.ts.map +1 -1
  989. package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts.map +1 -1
  990. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
  991. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
  992. package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
  993. package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
  994. package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.d.ts.map +1 -1
  995. package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
  996. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts +13 -0
  997. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts.map +1 -1
  998. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js +14 -0
  999. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js.map +1 -1
  1000. package/dist/esm/security/jwt/utils/jwt-verification-error-classification.backend.utils.d.ts.map +1 -1
  1001. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts.map +1 -1
  1002. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js.map +1 -1
  1003. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
  1004. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
  1005. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts +39 -0
  1006. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts.map +1 -0
  1007. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js +60 -0
  1008. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js.map +1 -0
  1009. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts +66 -0
  1010. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts.map +1 -0
  1011. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js +75 -0
  1012. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js.map +1 -0
  1013. package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
  1014. package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -1
  1015. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -1
  1016. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
  1017. package/dist/esm/security/scim/utils/scim-attribute-path-resolver.backend.utils.d.ts.map +1 -1
  1018. package/dist/esm/security/scim/utils/scim-filter-parser.d.ts.map +1 -1
  1019. package/dist/esm/security/scim/utils/scim-response-formatter.d.ts.map +1 -1
  1020. package/dist/esm/security/session-invalidation-fence.backend.utils.d.ts.map +1 -1
  1021. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts.map +1 -1
  1022. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js.map +1 -1
  1023. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -1
  1024. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -1
  1025. package/dist/esm/security/token-invalidation-fence.backend.utils.d.ts.map +1 -1
  1026. package/dist/esm/testing.d.ts.map +1 -1
  1027. package/dist/esm/users/services/inbound-contact-custom-implementation.backend.service.d.ts.map +1 -1
  1028. package/dist/esm/users/services/user-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
  1029. package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.d.ts.map +1 -1
  1030. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -1
  1031. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -1
  1032. package/dist/esm/users/services/user-role-administration.custom-impl.backend.service.d.ts.map +1 -1
  1033. package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts.map +1 -1
  1034. package/dist/esm/users/services/user-super-admin-floor.custom-impl.backend.service.d.ts.map +1 -1
  1035. package/dist/tsconfig.build.tsbuildinfo +1 -1
  1036. package/package.json +9 -9
  1037. package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts +0 -45
  1038. package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts.map +0 -1
  1039. package/dist/esm/external-providers/services/flow-actor-design.backend.service.js +0 -22
  1040. package/dist/esm/external-providers/services/flow-actor-design.backend.service.js.map +0 -1
  1041. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -0
  1042. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -0
  1043. package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -0
  1044. package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -0
  1045. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -0
  1046. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -0
  1047. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -0
  1048. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -0
  1049. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -0
  1050. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -0
  1051. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -0
  1052. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -0
  1053. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -0
  1054. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -0
  1055. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -0
  1056. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"controller-resource.backend.service.js","sourceRoot":"","sources":["../../../../../../src/base-classes/services/controllers/controller-resource.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAmC,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,OAAO,EAAgB,iBAAiB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,qBAAqB,EAAE,yCAAyC,EAAE,uBAAuB,EAAE,yCAAyC,EAAE,qBAAqB,EAAE,2BAA2B,EACrN,cAAc,EAAE,gCAAgC,EAAiC,kBAAkB,GACpG,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,6BAA6B,EAC7B,+BAA+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,CAAC,CAAC,CAAC;QACxF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACvC,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC","sourcesContent":["import 'reflect-metadata';\nimport { injectable, inject } from 'inversify';\nimport { Router, Request, Response, NextFunction } from 'express';\nimport { z } from 'zod';\nimport type {\n CollectionViewFields_Shared,\n ResourceConfiguration,\n ResourceConfiguration_Operation,\n ResourceConfiguration_OperationPath,\n ResourceType,\n ResourceRelationship,\n ResourceConfiguration_Operation_UrlInitiatorInfo,\n ResourceConfiguration_Operation_UrlParameterInfo,\n ResourceConfiguration_Operation_ApiCall,\n ResourceConfiguration_Operation_ApiCallWithCallback,\n VersionConflictDetails,\n} from '@wildo-ai/saas-models';\nimport { EnumLikeType, getZodObjectShape, isExcludedFromUpdate, isZodObject } from '@wildo-ai/zod-decorators';\nimport { HttpMethod, DataMode, OPERATION_VARIANT_KEY, ResourcesConfigOperationsDtosBuilderUtils, ResourceOperationsUtils, ResourcesConfigOperationsUrlsBuilderUtils, extractCrdtFieldNames, COLLECTION_QUERY_PARAMETERS,\n BackendApiType, FileUploadGrantMintRequestSchema, type FileUploadGrantOperation, MAIN_API_BASE_PATH,\n} from '@wildo-ai/saas-models';\n\nimport { ExecutionContext_ExecutionType, ExecutionContext_InitiatorIds, UserStatus, OrganizationMemberStatus, ApiKeyStatus } from '@wildo-ai/saas-models';\nimport { summarizeZodIssues } from '@wildo-ai/saas-models';\nimport {\n buildCollectionExportFilename,\n COLLECTION_EXPORT_CONTENT_TYPES,\n COLLECTION_EXPORT_FORMAT_QUERY_PARAM,\n COLLECTION_EXPORT_ROW_COUNT_HEADER,\n COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM,\n ResourceCollectionExportFormat,\n ResourceCollectionExportRowScope,\n ResourceGeneratedOperationKind,\n resolveCollectionExportCsvColumns,\n resolveRequestedCollectionExportFormat,\n resolveRequestedCollectionExportRowScope,\n toCsvHeaderRow,\n toCsvRow,\n type ResourceConfiguration_GeneratedCollectionExportOperationMetadata,\n} from '@wildo-ai/saas-models';\nimport { CoreResourceOperation, ALL_COLLECTION_OPERATIONS, OPERATIONS_WITHOUT_REQUEST_BODY, ARRAY_RESPONSE_OPERATIONS } from '@wildo-ai/saas-models';\nimport { ResourceOperationVariantType, ResourcesConfig_OperationPathUtils, ErrorType, ErrorCustomMessageReference, WildoHeaderKeys, getContextAddressedCompositionSingletonRelationshipCandidates, isWildoBackendError, RelationshipNature, ResourceRelationshipCardinality } from '@wildo-ai/saas-models';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ServicesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/services/services-registry-handler.backend.service';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ErrorHandlerService } from '~wildo-backend-lib/errors/services/error-handler.backend.service';\nimport { projectWildoBackendErrorLogFields, projectCaughtErrorLogFields, describeCaughtError } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { JwtBackendService } from '~wildo-backend-lib/security/jwt/services/jwt.backend.service';\nimport { AuthorizationsBackendService } from '~wildo-backend-lib/security/authorizations/services/authorizations.backend.service';\nimport { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport { ResourceFileUploadHandlerBackendService } from '~wildo-backend-lib/files/handlers/resource-file-upload-handler.backend.service';\nimport { FileFieldDetectionBackendService } from '~wildo-backend-lib/files/services/file-field-detection.backend.service';\nimport { createMulterUploadConfig } from '~wildo-backend-lib/files/utils/file-upload.utils';\nimport { FileUploadGrantBackendService } from '~wildo-backend-lib/files/services/file-upload-grant.backend.service';\nimport type { FileUploadRouteGrantLocals } from '~wildo-backend-lib/files/handlers/file-upload-route-locals.backend.types';\nimport { getClientIpFromRequest } from '~wildo-backend-lib/runtime/utils/request-client-ip.utils';\nimport { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport { JwtClaim_App_Auth_Schema } from '~wildo-backend-lib/security/authentications/models/authentications.backend.schemas';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { ExecutionContextHandlerBackendService } from '~wildo-backend-lib/runtime/services/execution-context-handler.backend.service';\nimport { ResourceOperationHelperBackendService } from '~wildo-backend-lib/base-classes/services/resource-operations-helper.backend.service';\nimport type { ServiceOptions } from '~wildo-backend-lib/base-classes/models/repositories.backend.schemas';\nimport { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport { AnonymousSessionBackendService } from '~wildo-backend-lib/security/authentications/services/anonymous-session.backend.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { RateLimitBackendService } from '~wildo-backend-lib/errors/services/rate-limit.backend.service';\nimport { resolveConfiguredMaxFileSize } from '~wildo-backend-lib/files/utils/file-validation.utils';\nimport { initializeValidateFieldRoutes } from './validate-field-handler.backend.service';\nimport { serializeOperationResultForResponse } from './utils/operation-response-serializer.backend.utils';\nimport { logAuditAccessForFields } from './utils/audit-access-fields.backend.utils';\n\n/**\n * HTTP Method mapping for operations\n */\nconst HTTP_METHOD_MAP: Record<CoreResourceOperation, HttpMethod> = {\n [CoreResourceOperation.CREATE]: HttpMethod.POST,\n [CoreResourceOperation.READ]: HttpMethod.GET,\n [CoreResourceOperation.UPDATE]: HttpMethod.PUT,\n [CoreResourceOperation.DELETE]: HttpMethod.DELETE,\n [CoreResourceOperation.LIST]: HttpMethod.GET,\n [CoreResourceOperation.SEARCH]: HttpMethod.GET,\n [CoreResourceOperation.COUNT]: HttpMethod.GET,\n [CoreResourceOperation.UPDATE_MANY]: HttpMethod.PUT,\n [CoreResourceOperation.DELETE_MANY]: HttpMethod.DELETE,\n [CoreResourceOperation.CREATE_MANY]: HttpMethod.POST,\n};\n\nexport function shouldSkipImplicitRequestValidation(\n effectiveOperation: string,\n hasExplicitRequestDto: boolean,\n): boolean {\n return !hasExplicitRequestDto && OPERATIONS_WITHOUT_REQUEST_BODY.includes(effectiveOperation as any);\n}\n\nfunction hasMeaningfulExplicitRequestDto(requestDto: z.ZodTypeAny | undefined): boolean {\n if (!requestDto) {\n return false;\n }\n\n if (requestDto instanceof z.ZodObject) {\n return Object.keys(requestDto.shape).length > 0;\n }\n\n return true;\n}\n\ntype CollectionQuerySort = Record<string, 1 | -1>;\n\ntype CollectionQueryRequestData = {\n filter: Record<string, unknown>;\n page?: number;\n limit?: number;\n searchQuery?: string;\n sort?: CollectionQuerySort;\n};\n\n/**\n * Collection-view metadata read off LIST/SEARCH/COUNT operations for\n * request-data normalization.\n *\n * `filterFields` mirrors the canonical authored shape\n * (`CollectionViewFields_Shared['filterFields']`): a record keyed by filter\n * field name whose values are the per-field Zod schemas (or filter-ref\n * transformer functions). The ALLOWED FILTER KEYS are the record's keys —\n * never an array. A previous version of this type declared\n * `readonly string[]`, which made `extractCollectionFilters` spread a Record\n * into a Set and throw `(allowedFilterFields ?? []) is not iterable` on the\n * first real LIST/SEARCH request against a resource with declared filters.\n */\ntype CollectionQueryOperationMetadata = {\n filterFields?: CollectionViewFields_Shared['filterFields'];\n};\n\ntype FileUploadRouteLocals = FileUploadRouteGrantLocals & {\n fileUploadExecutionContext?: ExecutionContext<any>;\n fileUploadResolvedResourceId?: string;\n};\n\nfunction parseOptionalPositiveInt(value: unknown): number | undefined {\n if (typeof value === 'number' && Number.isFinite(value) && value > 0) {\n return Math.trunc(value);\n }\n\n if (typeof value !== 'string' || value.trim() === '') {\n return undefined;\n }\n\n const parsed = Number.parseInt(value, 10);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;\n}\n\nfunction parseCollectionQuerySort(value: unknown): CollectionQuerySort | undefined {\n if (!value || typeof value !== 'string') {\n return undefined;\n }\n\n const sortEntries = value\n .split(',')\n .map((segment) => segment.trim())\n .filter(Boolean)\n .map((segment) => {\n const [field, rawDirection] = segment.split(':');\n if (!field) {\n return null;\n }\n\n const normalizedDirection = rawDirection?.toLowerCase();\n const direction = normalizedDirection === 'desc' ? -1 : 1;\n return [field, direction] as const;\n })\n .filter((entry): entry is readonly [string, 1 | -1] => entry !== null);\n\n return sortEntries.length > 0 ? Object.fromEntries(sortEntries) : undefined;\n}\n\nfunction normalizeCollectionSorting(value: unknown): CollectionQuerySort | undefined {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n return undefined;\n }\n\n const normalizedEntries: Array<[string, 1 | -1]> = [];\n for (const [field, rawValue] of Object.entries(value)) {\n if (rawValue === 1 || rawValue === -1) {\n normalizedEntries.push([field, rawValue]);\n continue;\n }\n\n if (\n rawValue\n && typeof rawValue === 'object'\n && !Array.isArray(rawValue)\n && typeof (rawValue as { field?: unknown }).field === 'string'\n ) {\n const sortField = (rawValue as { field: string }).field;\n const rawOrder = String((rawValue as { order?: unknown }).order ?? 'asc').toLowerCase();\n normalizedEntries.push([sortField, rawOrder === 'desc' ? -1 : 1]);\n }\n }\n\n return normalizedEntries.length > 0 ? Object.fromEntries(normalizedEntries) : undefined;\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction parseIfMatchVersionHeader(rawHeader: string | string[] | undefined): number | undefined {\n const rawValues = Array.isArray(rawHeader) ? rawHeader : [rawHeader];\n\n for (const rawValue of rawValues) {\n if (typeof rawValue !== 'string' || rawValue.trim() === '') {\n continue;\n }\n\n const candidates = rawValue\n .split(',')\n .map((candidate) => candidate.trim())\n .filter((candidate) => candidate !== '');\n\n for (const candidate of candidates) {\n const normalizedCandidate = candidate\n .replace(/^W\\//, '')\n .replace(/^\"|\"$/g, '');\n\n if (!normalizedCandidate) {\n continue;\n }\n\n const parsedVersion = Number(normalizedCandidate);\n if (Number.isInteger(parsedVersion) && parsedVersion >= 0) {\n return parsedVersion;\n }\n }\n }\n\n return undefined;\n}\n\nfunction hasNonEmptyIfMatchHeader(rawHeader: string | string[] | undefined): boolean {\n const rawValues = Array.isArray(rawHeader) ? rawHeader : [rawHeader];\n return rawValues.some((rawValue) => typeof rawValue === 'string' && rawValue.trim() !== '');\n}\n\nfunction supportsIfMatchOptimisticLocking(params: {\n operationIdentifier: unknown;\n resourceOperationLike?: unknown;\n isBulkOperation?: boolean;\n}): boolean {\n // The framework only treats If-Match as authoritative optimistic locking for\n // the single-resource UPDATE-like lane. Broader mutation families may still\n // be update-like semantically, but they do not have the same per-resource\n // compare-and-swap contract and must fail closed when the header is present.\n const effectiveOperation = params.resourceOperationLike || params.operationIdentifier;\n return effectiveOperation === CoreResourceOperation.UPDATE && params.isBulkOperation !== true;\n}\n\nfunction findDefaultUrlBearingOperation<\n TCustomOperationEnum extends EnumLikeType | undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined,\n TMainSchema extends z.ZodTypeAny,\n>(\n operations: Array<ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>>,\n operationIdentifier: CoreResourceOperation,\n params: {\n resourceType: ResourceType;\n errorBuilder: ErrorBuilderBackendService;\n logDebug: (message: string, context?: Record<string, unknown>) => void;\n },\n): ResourceConfiguration_Operation_ApiCall<any, any, any> | ResourceConfiguration_Operation_ApiCallWithCallback<any, any, any> | undefined {\n const candidates = operations.filter((operation) =>\n operation.operationIdentifier === operationIdentifier\n && operation.isOperationDefault === true\n && !('isBulkOperation' in operation && operation.isBulkOperation === true)\n && (\n operation.variantType === ResourceOperationVariantType.API_CALL\n || operation.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n )\n );\n if (candidates.length > 1) {\n const candidateVariants = candidates.map((operation) => ({\n variantType: operation.variantType,\n variantKey: operation.variantKey,\n isOperationDefault: operation.isOperationDefault,\n }));\n params.logDebug('Ambiguous default URL-bearing operation candidates', {\n resourceType: params.resourceType,\n operationIdentifier,\n candidateVariants,\n });\n throw params.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: `Ambiguous default ${operationIdentifier} URL-bearing operation; expected exactly one non-bulk default variant.`,\n resourceType: params.resourceType,\n operationIdentifier,\n candidateVariants,\n },\n },\n );\n }\n return candidates[0] as ResourceConfiguration_Operation_ApiCall<any, any, any> | ResourceConfiguration_Operation_ApiCallWithCallback<any, any, any> | undefined;\n}\n\n/**\n * Compare two Express route paths by matching specificity so that, when\n * registered in the returned order, no parameterized segment can swallow a\n * sibling literal segment.\n *\n * Express matches routes in registration order, and a `:param` segment\n * matches ANY value — including literal operation suffixes. Without ordered\n * registration, `/todos/:todoId` (READ) registered before `/todos/search`\n * (SEARCH) captures `search` as a todoId and fails resource-id validation\n * with a 400 instead of executing the search. The same collision class\n * applies to every literal sibling of an id segment: `/count`, the\n * auto-variant suffixes (`/summary`, `/context` on LIST), and any custom\n * operation whose URL ends in a literal segment.\n *\n * Ordering rule (segment-wise lexicographic):\n * 1. At the first position where one path has a literal and the other a\n * `:param`, the literal sorts first.\n * 2. Two different literals order alphabetically (they cannot both match the\n * same URL, so this is purely for determinism).\n * 3. Two params rank equally — continue to the next segment.\n * 4. All shared segments equal → longer (more specific) path first.\n *\n * The comparator is exported for direct unit testing; the controller applies\n * it once over ALL collected operation routes before registration.\n */\nexport function compareExpressRoutePathSpecificity(a: string, b: string): number {\n const aSegments = a.split('/').filter(Boolean);\n const bSegments = b.split('/').filter(Boolean);\n const sharedLength = Math.min(aSegments.length, bSegments.length);\n\n for (let i = 0; i < sharedLength; i++) {\n const aIsParam = aSegments[i].startsWith(':');\n const bIsParam = bSegments[i].startsWith(':');\n\n if (aIsParam !== bIsParam) {\n return aIsParam ? 1 : -1;\n }\n\n if (!aIsParam && aSegments[i] !== bSegments[i]) {\n return aSegments[i].localeCompare(bSegments[i]);\n }\n }\n\n return bSegments.length - aSegments.length;\n}\n\n/**\n * A fully-resolved operation route awaiting registration. Collected across\n * ALL operations first, then sorted with `compareExpressRoutePathSpecificity`\n * and registered — see `initializeRoutes`.\n */\ninterface OperationRouteDescriptor {\n expressPath: string;\n httpMethod: HttpMethod;\n handler: (req: Request, res: Response, next: NextFunction) => Promise<void>;\n}\n\nfunction collectSubmittedFieldPaths(value: unknown, prefix = ''): string[] {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return prefix ? [prefix] : [];\n }\n\n return value.flatMap((childValue, index) => (\n collectSubmittedFieldPaths(childValue, `${prefix}[${index}]`)\n ));\n }\n\n if (!isPlainRecord(value)) {\n return prefix ? [prefix] : [];\n }\n\n const entries = Object.entries(value).filter(([key]) => !key.startsWith('_'));\n if (entries.length === 0) {\n return prefix ? [prefix] : [];\n }\n\n return entries.flatMap(([key, childValue]) => {\n const nextPath = prefix ? `${prefix}.${key}` : key;\n return collectSubmittedFieldPaths(childValue, nextPath);\n });\n}\n\nfunction getValueAtPath(record: Record<string, unknown>, path: string): unknown {\n const normalizedPath = path.replace(/\\[(\\d+)\\]/g, '.$1');\n return normalizedPath.split('.').filter(Boolean).reduce<unknown>((current, segment) => {\n if (current == null || typeof current !== 'object') {\n return undefined;\n }\n return (current as Record<string, unknown>)[segment];\n }, record);\n}\n\nfunction areConflictValuesEqual(left: unknown, right: unknown): boolean {\n if (left === right) {\n return true;\n }\n\n if (left === null || left === undefined || right === null || right === undefined) {\n return left === right;\n }\n\n if (Array.isArray(left) || Array.isArray(right)) {\n if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) {\n return false;\n }\n\n return left.every((value, index) => areConflictValuesEqual(value, right[index]));\n }\n\n if (isPlainRecord(left) || isPlainRecord(right)) {\n if (!isPlainRecord(left) || !isPlainRecord(right)) {\n return false;\n }\n\n const keys = [...new Set([...Object.keys(left), ...Object.keys(right)])]\n .filter((key) => !key.startsWith('_'));\n return keys.every((key) => areConflictValuesEqual(left[key], right[key]));\n }\n\n return false;\n}\n\nfunction buildSortingSchemaInput(sort: CollectionQuerySort | undefined): Record<string, { field: string; order: 'asc' | 'desc'; priority: number }> | undefined {\n if (!sort) {\n return undefined;\n }\n\n const entries = Object.entries(sort);\n if (entries.length === 0) {\n return undefined;\n }\n\n return Object.fromEntries(\n entries.map(([field, direction], index) => [\n field,\n {\n field,\n order: direction === -1 ? 'desc' : 'asc',\n priority: index,\n },\n ]),\n );\n}\n\n/**\n * Project the declared filter values out of raw collection request data.\n *\n * The allow-list is derived from the KEYS of the operation's authored\n * `filterFields` record (see {@link CollectionQueryOperationMetadata}) plus\n * the universal timestamp filters. Function-valued entries (filter-ref\n * transformers) contribute their key like any other declared filter — the\n * value shape only matters to validation downstream, not to key allowance.\n *\n * Exported for direct unit testing.\n */\nexport function extractCollectionFilters(\n rawData: Record<string, unknown>,\n filterFields: CollectionQueryOperationMetadata['filterFields'],\n): Record<string, unknown> {\n const allowedKeys = new Set<string>([\n ...Object.keys(filterFields ?? {}),\n 'createdAt',\n 'updatedAt',\n ]);\n\n const filters: Record<string, unknown> = {};\n for (const key of allowedKeys) {\n const value = rawData[key];\n if (value !== undefined && isPermittedFilterValue(value)) {\n filters[key] = value;\n }\n }\n\n return filters;\n}\n\n/**\n * Is this filter VALUE one of the shapes a caller is permitted to send?\n *\n * The allow-list above gates filter KEYS. It did not gate VALUES, and that was a real hole: a caller\n * could send `{ status: { $ne: 'completed' } }` on an allow-listed key and have the operator reach\n * the query. Proven live on 2026-08-01 against the MCP surface — `tasks__search` returned exactly the\n * non-matching rows, with a passing control alongside it\n * (`examples/wonder-todos/e2e/mcp-contract.e2e.ts`, probe M-3b).\n *\n * It only surfaced on MCP because the HTTP controller parses the body against the operation's\n * `requestDto` first, and `filterFields` types `status` as an enum, so the object was refused there.\n * MCP normalizes rather than parses, so this allow-list was the only thing between the caller and the\n * query. Gating here rather than at either surface keeps ONE authority: any future surface inherits\n * the guard instead of re-deriving it.\n *\n * ## Why this is an ALLOW-list and not a `$`-prefix blocklist\n *\n * The first version rejected `$`-prefixed keys — the MongoDB operator vocabulary. That is the wrong\n * shape for a framework with more than one persistence adapter: a PostgreSQL-backed resource whose\n * structured filter used any other operator syntax would sail straight through a Mongo-shaped\n * blocklist, and every future operator would have to be enumerated before it could be refused.\n * A blocklist fails OPEN on everything its author did not anticipate.\n *\n * So the question asked here is the positive one — is this a shape a caller may legitimately send —\n * and the answer is closed by construction:\n *\n * - a scalar (`string` / `number` / `boolean` / `null` / `Date`), or\n * - an array of scalars, or\n * - a range object whose keys are exactly {@link RANGE_FILTER_SUBKEYS}, the framework's OWN named\n * date-range vocabulary (`Resources_Filter_DateRangeSchema`), with scalar bounds.\n *\n * Anything else is refused, whatever engine's syntax it happens to be written in. Adding a genuinely\n * new structured filter shape is then a deliberate edit to this predicate and its named vocabulary,\n * which is exactly where that decision belongs.\n *\n * Rejects rather than sanitizes, and rejects the WHOLE value: a partially-stripped operator object is\n * a filter the caller did not ask for, which is its own kind of wrong answer.\n *\n * assurance-control: WILDO.SECURITY.FAIL_CLOSED — untrusted input must not reach a query as an\n * operator; the guard rejects the whole value rather than sanitizing part of it.\n */\nfunction isPermittedFilterScalar(value: unknown): boolean {\n return value === null\n || value instanceof Date\n || typeof value === 'string'\n || typeof value === 'number'\n || typeof value === 'boolean';\n}\n\nfunction isPermittedFilterValue(value: unknown): boolean {\n if (isPermittedFilterScalar(value)) return true;\n if (Array.isArray(value)) return value.every((entry) => isPermittedFilterScalar(entry));\n if (value === null || typeof value !== 'object') return false;\n\n const entries = Object.entries(value as Record<string, unknown>);\n return entries.length > 0\n && entries.every(([key, bound]) => RANGE_FILTER_SUBKEYS.has(key) && isPermittedFilterScalar(bound));\n}\n\n\n/** Date-range filters accepted on every collection op (mirrors `Resources_Filter_BaseSchema`). */\nconst UNIVERSAL_RANGE_FILTER_FIELDS = ['createdAt', 'updatedAt'] as const;\n/** The two sub-keys of a `Resources_Filter_DateRangeSchema` range object. */\nconst RANGE_FILTER_SUBKEYS: ReadonlySet<string> = new Set(['startDate', 'endDate']);\n\n/**\n * Reconstruct date-range filters sent as BRACKETED query keys\n * (`?createdAt[startDate]=<ISO>&createdAt[endDate]=<ISO>`) back into the nested\n * `{ startDate, endDate }` object the SEARCH request DTO expects.\n *\n * WHY THIS EXISTS — a date-range filter is authored as an OBJECT\n * (`Resources_Filter_DateRangeSchema` → `{ startDate?: Date, endDate?: Date }`), and\n * the frontend HTTP client / any generated SDK serialise it with bracket notation\n * (OpenAPI `style: deepObject`). Express 5 defaults its query parser to `simple`\n * (`querystring.parse`), under which `createdAt[startDate]=x` arrives as the LITERAL\n * flat key `req.query['createdAt[startDate]']`. `extractCollectionFilters` reads\n * `rawData.createdAt` and never sees it, so range filtering silently no-ops.\n *\n * We deliberately do NOT switch the global query parser to `extended` (qs): that\n * would change `req.query` shape for EVERY controller and break the pervasive\n * flat-scalar `req.query.X as string` assumption (auth / SCIM / chart consumers) —\n * a parameter-pollution footgun Express 5 avoids by defaulting to `simple`.\n * Instead we reconstruct the nested object HERE, scoped to the collection-query\n * path and DECLARATION-GATED: only the universal `createdAt` / `updatedAt` and any\n * authored `z.date()` `filterField` (the exact set the factory wraps in a range\n * schema) are eligible, so no arbitrary bracketed key can inject a nested object.\n *\n * Values are coerced to `Date` because the range schema is `z.date()` (not\n * `z.coerce.date()`) AND `transformRequestDates` does not descend through the\n * range object's `.optional()` wrapper (a separate, deeper gap — see the\n * date-range coercion note in the plan). An unparseable value becomes an\n * `Invalid Date`, which the DTO parse then rejects with a clean validation error\n * rather than silently dropping the filter.\n *\n * Returns the input by REFERENCE when there is nothing to reconstruct, so the\n * common no-bracket request allocates nothing.\n */\nexport function reconstructBracketedRangeFilters(\n rawData: Record<string, unknown>,\n filterFields: CollectionQueryOperationMetadata['filterFields'],\n): Record<string, unknown> {\n const rangeFields = new Set<string>(UNIVERSAL_RANGE_FILTER_FIELDS);\n for (const [name, schema] of Object.entries(filterFields ?? {})) {\n if (schema instanceof z.ZodDate) {\n rangeFields.add(name);\n }\n }\n\n let reconstructed: Record<string, unknown> | undefined;\n for (const key of Object.keys(rawData)) {\n const match = /^([^[\\]]+)\\[([^[\\]]+)\\]$/u.exec(key);\n if (match === null) continue;\n const base = match[1]!;\n const subKey = match[2]!;\n if (!rangeFields.has(base) || !RANGE_FILTER_SUBKEYS.has(subKey)) continue;\n\n reconstructed ??= { ...rawData };\n const existing = reconstructed[base];\n const range: Record<string, unknown> =\n typeof existing === 'object' && existing !== null && !Array.isArray(existing)\n ? (existing as Record<string, unknown>)\n : {};\n const rawValue = rawData[key];\n range[subKey] = typeof rawValue === 'string' ? new Date(rawValue) : rawValue;\n reconstructed[base] = range;\n // Drop the literal bracketed key so it can't leak downstream as a stray field.\n delete reconstructed[key];\n }\n\n return reconstructed ?? rawData;\n}\n\nexport function shouldAuthorizeCollectionOperation(\n effectiveOperation: string,\n): boolean {\n return ALL_COLLECTION_OPERATIONS.includes(effectiveOperation as any);\n}\n\nexport function isContextAddressedReadOperation(\n effectiveOperation: string,\n resourceFieldIdentifier: string,\n initiatorInfo: Pick<ResourceConfiguration_Operation_UrlInitiatorInfo, 'parameters'>,\n matchedParameterFieldIdentifiers?: string[],\n): boolean {\n if (effectiveOperation !== CoreResourceOperation.READ) {\n return false;\n }\n\n const parameters = initiatorInfo.parameters ?? [];\n\n if ((matchedParameterFieldIdentifiers?.length ?? 0) > 0) {\n const declaredParameterFieldIdentifiers = new Set(\n parameters.map((parameter) => parameter.fieldIdentifier),\n );\n const allMatchedParametersAreDeclared = matchedParameterFieldIdentifiers!.every(\n (fieldIdentifier) => declaredParameterFieldIdentifiers.has(fieldIdentifier),\n );\n\n if (allMatchedParametersAreDeclared) {\n return !matchedParameterFieldIdentifiers?.includes(resourceFieldIdentifier);\n }\n }\n\n if (parameters.length === 0) {\n return false;\n }\n\n return !parameters.some((parameter) => parameter.fieldIdentifier === resourceFieldIdentifier);\n}\n\n/**\n * Page size a full-result-set export iterates at when the source operation declares no ceiling.\n *\n * 100 deliberately — it is the value `maxPaginatedResultPerPageLimit` itself defaults to, and that\n * bound is enforced at eight independent sites. Anything larger here would be an export asking for a\n * page the listing's own request schema refuses.\n */\nconst DEFAULT_COLLECTION_EXPORT_PAGE_LIMIT = 100;\n\nexport class ControllerResourceBackendService<\n TCustomOperationEnum extends EnumLikeType | undefined = undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,\n TMainSchema extends z.ZodTypeAny = z.ZodTypeAny> {\n\n private readonly resourceConfiguration: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>;\n private readonly operationsMap: Map<string, ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>>;\n private readonly router: Router;\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n resourceType: ResourceType,\n private readonly logger: LoggerService,\n private readonly errorBuilder: ErrorBuilderBackendService,\n private readonly errorHandler: ErrorHandlerService,\n private readonly jwtService: JwtBackendService,\n private readonly authorizationsService: AuthorizationsBackendService,\n private readonly resourcesRegistry: ResourcesRegistryBackendService,\n private readonly executionContextCreator: ExecutionContextCreatorBackendService,\n private readonly executionContextHandler: ExecutionContextHandlerBackendService,\n private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n private readonly resourceOperationHelper: ResourceOperationHelperBackendService,\n private readonly servicesRegistry: ServicesRegistryHandlerBackendService,\n private readonly fileFieldDetection: FileFieldDetectionBackendService,\n private readonly fileUploadHandler: ResourceFileUploadHandlerBackendService,\n private readonly auditLogsService: AuditLogsBackendService,\n private readonly anonymousSessionService: AnonymousSessionBackendService,\n private readonly appConfigService: AppConfigurationService,\n private readonly rateLimitService: RateLimitBackendService,\n private readonly fileUploadGrantService: FileUploadGrantBackendService,\n ) {\n\n\n this.resourceConfiguration = this.resourcesRegistry.getResourceConfiguration(resourceType);\n this.router = Router();\n this.operationsMap = new Map();\n\n this.logDebug = this.logger.debugByType(`ControllerResource_${resourceType}`);\n this.logger.setDebugTypeLogging(`ControllerResource_${resourceType}`, false);\n\n this.initializeOperationsMap();\n this.initializeRoutes();\n\n this.logDebug('Controller resource service created', { resourceType: this.resourceConfiguration.resourceIdentifier, operationsCount: this.operationsMap.size\n });\n }\n\n public getRouter(): Router { return this.router }\n\n\n private async resolveContextAddressedSingletonOperationAuthorizationId(\n effectiveOperation: string,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n options?: ServiceOptions,\n ): Promise<string | undefined> {\n const operationEffectiveIdentifier = operation.resourceOperationLike ?? operation.operationIdentifier;\n if (\n operationEffectiveIdentifier !== CoreResourceOperation.READ\n && operationEffectiveIdentifier !== CoreResourceOperation.UPDATE\n && operationEffectiveIdentifier !== CoreResourceOperation.DELETE\n ) {\n return undefined;\n }\n\n if (\n effectiveOperation !== CoreResourceOperation.READ\n && effectiveOperation !== CoreResourceOperation.UPDATE\n && effectiveOperation !== CoreResourceOperation.DELETE\n ) {\n return undefined;\n }\n\n if ('isBulkOperation' in operation && operation.isBulkOperation === true) {\n return undefined;\n }\n\n if (!operation.resourceRelationships) {\n return undefined;\n }\n\n const matchingParents = getContextAddressedCompositionSingletonRelationshipCandidates(operation.resourceRelationships)\n .filter((candidate) => this.hasParentContextForRelationship(\n candidate.parentResourceType,\n candidate.foreignKeyField,\n executionContext,\n ));\n\n if (matchingParents.length === 0) {\n return undefined;\n }\n\n if (matchingParents.length > 1) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Ambiguous context-addressed singleton operation authorization target',\n resourceType: operation.resourceIdentifier,\n parentResourceTypes: matchingParents.map((candidate) => candidate.parentResourceType),\n },\n },\n );\n }\n\n const candidate = matchingParents[0];\n const parentResourceId = this.resolveParentContextResourceId(\n candidate.parentResourceType,\n candidate.foreignKeyField,\n executionContext,\n );\n if (!parentResourceId) {\n return undefined;\n }\n\n const repo = this.repositoriesRegistry.getRepository(operation.resourceIdentifier as ResourceType);\n if (!repo) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Context-addressed singleton operation authorization requires a registered repository to prove uniqueness',\n resourceType: operation.resourceIdentifier,\n },\n },\n );\n }\n\n // Framework-internal uniqueness probe — resolve the singleton's id by\n // its parent FK to authorize a context-addressed READ/UPDATE/DELETE.\n // Use `listForInternalScan` (NOT the public `list`): context-addressed\n // singletons (e.g. `userProgressionState`, `userGuidanceState`) expose\n // only READ to users and declare no user-facing LIST operation. This is\n // framework machinery proving uniqueness, not a user collection read,\n // so it must list regardless of a declared LIST surface.\n const selector = { [candidate.foreignKeyField]: parentResourceId };\n const listResult = // `T` is pinned: the repository handle is schema-less here, so the strengthened\n // contract types rows as `unknown` rather than pretending to know them. This probe\n // only needs the persisted-id shape.\n await repo.listForInternalScan<Record<string, unknown>>(executionContext, selector, {\n ...options,\n paginated: false,\n });\n // The paginated-envelope unwrapping that used to live here is gone, not overlooked:\n // `paginated: false` selects the array overload, so the contract now states the shape\n // that the runtime always returned. The branch was unreachable and only looked\n // defensive because the call was cast to `any`.\n const matches = listResult;\n\n if (matches.length === 0) {\n // No singleton row exists yet for this parent scope.\n // READ: absence is NOT an authorization failure. Return undefined so the caller\n // authorizes the read by parent scope (`isContextAddressedSingletonReadAuthorizedByScope`)\n // and lets the operation layer materialize-or-404 — this is the seam the scoped\n // progression/guidance lazy-materialization POSTFIX hooks rely on. UPDATE/DELETE\n // cannot be addressed to a non-existent singleton, so they still fail closed.\n if (operationEffectiveIdentifier === CoreResourceOperation.READ) {\n return undefined;\n }\n throw this.errorBuilder.buildError(\n ErrorType.NOT_FOUND,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n operation: effectiveOperation,\n selector,\n resourceType: operation.resourceIdentifier,\n },\n },\n );\n }\n\n if (matches.length > 1) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Context-addressed singleton operation authorization matched multiple rows',\n resourceType: operation.resourceIdentifier,\n selector,\n matchCount: matches.length,\n },\n },\n );\n }\n\n const id = matches[0]?._id;\n if (typeof id === 'string') {\n return id;\n }\n if (id && typeof id === 'object' && 'toString' in id && typeof id.toString === 'function') {\n return id.toString();\n }\n\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Context-addressed singleton operation authorization resolved a row without _id',\n resourceType: operation.resourceIdentifier,\n selector,\n },\n },\n );\n }\n\n /**\n * True when `operation` is a context-addressed composition singleton (e.g.\n * `userProgressionState` addressed by `userId`) AND the owning parent scope is\n * present in the execution context — independent of whether the singleton row\n * exists yet.\n *\n * Used to authorize an id-less READ by parent scope when the row is absent: the\n * authorization probe returns undefined (no `_id` to resolve), so this predicate\n * lets the caller treat the read as a legitimate context-only read instead of\n * falling through to the explicit-id validation path. Mirrors the probe's own\n * parent-candidate filter (without the row lookup).\n */\n private hasContextAddressedSingletonParentScope(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n ): boolean {\n if (!operation.resourceRelationships) {\n return false;\n }\n\n return getContextAddressedCompositionSingletonRelationshipCandidates(operation.resourceRelationships)\n .some((candidate) => this.hasParentContextForRelationship(\n candidate.parentResourceType,\n candidate.foreignKeyField,\n executionContext,\n ));\n }\n\n private async resolveContextAddressedAssociationOperationAuthorizationId(\n effectiveOperation: string,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n options?: ServiceOptions,\n ): Promise<string | undefined> {\n const operationEffectiveIdentifier = operation.resourceOperationLike ?? operation.operationIdentifier;\n if (\n operationEffectiveIdentifier !== CoreResourceOperation.READ\n && operationEffectiveIdentifier !== CoreResourceOperation.UPDATE\n && operationEffectiveIdentifier !== CoreResourceOperation.DELETE\n ) {\n return undefined;\n }\n\n if (\n effectiveOperation !== CoreResourceOperation.READ\n && effectiveOperation !== CoreResourceOperation.UPDATE\n && effectiveOperation !== CoreResourceOperation.DELETE\n ) {\n return undefined;\n }\n\n if ('isBulkOperation' in operation && operation.isBulkOperation === true) {\n return undefined;\n }\n\n if (!operation.resourceRelationships) {\n return undefined;\n }\n\n const associationParentRelationships = (operation.resourceRelationships.parentRelationships ?? [])\n .filter((relationship) =>\n relationship.nature === RelationshipNature.ASSOCIATION\n && relationship.jointResourceType === operation.resourceIdentifier\n && relationship.resourceType2 === operation.resourceIdentifier\n && relationship.cardinality1 === ResourceRelationshipCardinality.ONE\n && relationship.cardinality2 === ResourceRelationshipCardinality.MANY\n );\n if (associationParentRelationships.length === 0) {\n return undefined;\n }\n\n if (associationParentRelationships.length !== 2) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization requires exactly two eligible parent relationships',\n resourceType: operation.resourceIdentifier,\n parentResourceTypes: associationParentRelationships.map((relationship) => relationship.resourceType1),\n },\n },\n );\n }\n\n const duplicatedParentResourceTypes = new Set(\n associationParentRelationships\n .map((relationship) => relationship.resourceType1)\n .filter((resourceType, _index, resourceTypes) =>\n resourceTypes.filter((candidate) => candidate === resourceType).length > 1\n )\n );\n const contextParents = associationParentRelationships\n .map((relationship) => {\n const foreignKeyField = this.resourcesRegistry.resolveForeignKeyField({\n resourceType1: relationship.resourceType1,\n foreignKeyField: relationship.foreignKeyField,\n });\n const parentResourceId = this.resolveAssociationParentContextResourceId(\n relationship.resourceType1,\n foreignKeyField,\n executionContext,\n { allowGenericParentContext: !duplicatedParentResourceTypes.has(relationship.resourceType1) },\n );\n return parentResourceId\n ? { relationship, foreignKeyField, parentResourceId }\n : undefined;\n })\n .filter((candidate): candidate is {\n relationship: ResourceRelationship;\n foreignKeyField: string;\n parentResourceId: string;\n } => candidate !== undefined);\n\n if (contextParents.length < 2) {\n return undefined;\n }\n\n const selector = Object.fromEntries(\n contextParents.map((candidate) => [candidate.foreignKeyField, candidate.parentResourceId])\n );\n if (Object.keys(selector).length !== contextParents.length) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization resolved duplicate foreign key fields',\n resourceType: operation.resourceIdentifier,\n foreignKeyFields: contextParents.map((candidate) => candidate.foreignKeyField),\n },\n },\n );\n }\n\n const repo = this.repositoriesRegistry.getRepository(operation.resourceIdentifier as ResourceType);\n // Framework-internal uniqueness probe — resolve the junction row's id by its\n // two parent FKs to authorize a context-addressed READ/UPDATE/DELETE. Use\n // `listForInternalScan` (NOT the public `list`), mirroring the singleton\n // authorization probe above and the service-side association target resolver:\n // an association junction resource may expose READ/UPDATE/DELETE without a\n // user-facing default LIST, so `repo.list()` would throw\n // `repository_resource_operation_failed` (\"no default LIST operation declared\",\n // INTERNAL/critical 500) here — at authorization, before the service resolver is\n // ever reached. `listForInternalScan` synthesizes a REPOSITORY_ONLY scan when no\n // LIST is declared and reuses the declared LIST (with hooks) otherwise. Unlike\n // singletons, an absent junction row stays a genuine NOT_FOUND for every verb\n // (no lazy materialization to defer to), so the 0-rows branch below is unchanged.\n if (!repo) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization requires a registered repository to prove uniqueness',\n resourceType: operation.resourceIdentifier,\n },\n },\n );\n }\n\n const listResult = // `T` is pinned: the repository handle is schema-less here, so the strengthened\n // contract types rows as `unknown` rather than pretending to know them. This probe\n // only needs the persisted-id shape.\n await repo.listForInternalScan<Record<string, unknown>>(executionContext, selector, {\n ...options,\n paginated: false,\n });\n // The paginated-envelope unwrapping that used to live here is gone, not overlooked:\n // `paginated: false` selects the array overload, so the contract now states the shape\n // that the runtime always returned. The branch was unreachable and only looked\n // defensive because the call was cast to `any`.\n const matches = listResult;\n\n if (matches.length === 0) {\n throw this.errorBuilder.buildError(\n ErrorType.NOT_FOUND,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n operation: effectiveOperation,\n selector,\n resourceType: operation.resourceIdentifier,\n },\n },\n );\n }\n\n if (matches.length > 1) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization matched multiple rows',\n resourceType: operation.resourceIdentifier,\n selector,\n matchCount: matches.length,\n },\n },\n );\n }\n\n const id = matches[0]?._id;\n if (typeof id === 'string') {\n return id;\n }\n if (id && typeof id === 'object' && 'toString' in id && typeof id.toString === 'function') {\n return id.toString();\n }\n\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization resolved a row without _id',\n resourceType: operation.resourceIdentifier,\n selector,\n },\n },\n );\n }\n\n private resolveContextAddressedSingletonMutationAuthorizationId(\n effectiveOperation: string,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n options?: ServiceOptions,\n ): Promise<string | undefined> {\n return this.resolveContextAddressedSingletonOperationAuthorizationId(\n effectiveOperation,\n operation,\n executionContext,\n options,\n );\n }\n\n private resolveContextAddressedAssociationMutationAuthorizationId(\n effectiveOperation: string,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n options?: ServiceOptions,\n ): Promise<string | undefined> {\n return this.resolveContextAddressedAssociationOperationAuthorizationId(\n effectiveOperation,\n operation,\n executionContext,\n options,\n );\n }\n\n private hasParentContextForRelationship(\n parentResourceType: ResourceType,\n foreignKeyField: string,\n executionContext: ExecutionContext<any>\n ): boolean {\n if (executionContext.getContextResourceId(foreignKeyField)) {\n return true;\n }\n\n if (\n executionContext.getRelationshipContext(parentResourceType, foreignKeyField)\n ?? executionContext.getRelationshipContext(parentResourceType)\n ) {\n return true;\n }\n\n const parentConfig = this.resourcesRegistry.tryGetResourceConfiguration(parentResourceType);\n return !!parentConfig && !!executionContext.getContextResourceId(parentConfig.resourceFieldIdentifier);\n }\n\n private resolveParentContextResourceId(\n parentResourceType: ResourceType,\n foreignKeyField: string,\n executionContext: ExecutionContext<any>\n ): string | undefined {\n const byForeignKey = executionContext.getContextResourceId(foreignKeyField);\n if (byForeignKey) {\n return byForeignKey;\n }\n\n const relationshipContext = executionContext.getRelationshipContext(parentResourceType, foreignKeyField)\n ?? executionContext.getRelationshipContext(parentResourceType);\n if (relationshipContext?.resourceId) {\n return relationshipContext.resourceId;\n }\n\n const parentConfig = this.resourcesRegistry.tryGetResourceConfiguration(parentResourceType);\n return parentConfig\n ? executionContext.getContextResourceId(parentConfig.resourceFieldIdentifier)\n : undefined;\n }\n\n private resolveAssociationParentContextResourceId(\n parentResourceType: ResourceType,\n foreignKeyField: string,\n executionContext: ExecutionContext<any>,\n options?: { allowGenericParentContext?: boolean },\n ): string | undefined {\n const byForeignKey = executionContext.getContextResourceId(foreignKeyField);\n if (byForeignKey) {\n return byForeignKey;\n }\n\n const relationshipContext = executionContext.getRelationshipContext(parentResourceType, foreignKeyField);\n if (relationshipContext?.resourceId) {\n return relationshipContext.resourceId;\n }\n\n if (options?.allowGenericParentContext !== true) {\n return undefined;\n }\n\n const genericRelationshipContext = executionContext.getRelationshipContext(parentResourceType);\n if (genericRelationshipContext?.resourceId) {\n return genericRelationshipContext.resourceId;\n }\n\n const parentConfig = this.resourcesRegistry.tryGetResourceConfiguration(parentResourceType);\n return parentConfig\n ? executionContext.getContextResourceId(parentConfig.resourceFieldIdentifier)\n : undefined;\n }\n\n private stringifyPersistedValue(value: unknown): string | undefined {\n if (value === undefined || value === null) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n return value;\n }\n\n if (typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n\n if (typeof value === 'object' && 'toString' in value && typeof value.toString === 'function') {\n return value.toString();\n }\n\n return undefined;\n }\n\n private async ensureFileUploadTargetMatchesRouteContext(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n resourceId: string,\n executionContext: ExecutionContext<any>,\n options?: {\n requireRouteContext?: boolean;\n },\n ): Promise<void> {\n if (!operation.resourceRelationships) {\n return;\n }\n\n const repo = this.repositoriesRegistry.getRepository(operation.resourceIdentifier as ResourceType);\n if (!repo) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'File upload route-context verification requires a repository for the target resource',\n resourceType: operation.resourceIdentifier,\n resourceId,\n },\n });\n }\n\n const currentObject = await repo.read<Record<string, unknown>>(\n executionContext,\n resourceId,\n { excludeContextualFilter: true },\n );\n if (!currentObject || typeof currentObject !== 'object') {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n },\n });\n }\n\n const expectedSelectors: Record<string, string> = {};\n const compositionSingletonCandidates = getContextAddressedCompositionSingletonRelationshipCandidates(operation.resourceRelationships);\n for (const candidate of compositionSingletonCandidates) {\n const parentResourceId = this.resolveParentContextResourceId(\n candidate.parentResourceType,\n candidate.foreignKeyField,\n executionContext,\n );\n if (parentResourceId) {\n expectedSelectors[candidate.foreignKeyField] = parentResourceId;\n }\n }\n\n const associationParentRelationships = (operation.resourceRelationships.parentRelationships ?? [])\n .filter((relationship) =>\n relationship.nature === RelationshipNature.ASSOCIATION\n && relationship.jointResourceType === operation.resourceIdentifier\n && relationship.resourceType2 === operation.resourceIdentifier\n && relationship.cardinality1 === ResourceRelationshipCardinality.ONE\n && relationship.cardinality2 === ResourceRelationshipCardinality.MANY\n );\n const duplicatedParentResourceTypes = new Set(\n associationParentRelationships\n .map((relationship) => relationship.resourceType1)\n .filter((resourceType, _index, resourceTypes) =>\n resourceTypes.filter((candidate) => candidate === resourceType).length > 1\n )\n );\n let resolvedAssociationContextCount = 0;\n\n for (const relationship of associationParentRelationships) {\n const foreignKeyField = this.resourcesRegistry.resolveForeignKeyField({\n resourceType1: relationship.resourceType1,\n foreignKeyField: relationship.foreignKeyField,\n });\n const parentResourceId = this.resolveAssociationParentContextResourceId(\n relationship.resourceType1,\n foreignKeyField,\n executionContext,\n { allowGenericParentContext: !duplicatedParentResourceTypes.has(relationship.resourceType1) },\n );\n if (parentResourceId) {\n resolvedAssociationContextCount += 1;\n expectedSelectors[foreignKeyField] = parentResourceId;\n }\n }\n\n if (\n associationParentRelationships.length > 0\n && associationParentRelationships.length !== 2\n && resolvedAssociationContextCount > 0\n ) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n malformedAssociationContext: true,\n parentResourceTypes: associationParentRelationships.map((relationship) => relationship.resourceType1),\n resolvedAssociationContextCount,\n },\n });\n }\n\n if (\n associationParentRelationships.length === 2\n && resolvedAssociationContextCount > 0\n && resolvedAssociationContextCount < 2\n ) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n partialAssociationContext: true,\n resolvedAssociationContextCount,\n },\n });\n }\n\n if (\n Object.keys(expectedSelectors).length === 0\n && (compositionSingletonCandidates.length > 0 || associationParentRelationships.length > 0)\n ) {\n if (!options?.requireRouteContext) {\n return;\n }\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n missingRouteContext: true,\n },\n });\n }\n\n for (const [foreignKeyField, expectedValue] of Object.entries(expectedSelectors)) {\n const actualValue = this.stringifyPersistedValue((currentObject as Record<string, unknown>)[foreignKeyField]);\n if (actualValue !== expectedValue) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n foreignKeyField,\n missingForeignKey: actualValue === undefined,\n },\n });\n }\n }\n }\n\n // ================================\n // Initialization\n // ================================\n\n static createInstance<\n TCustomOperationEnum extends EnumLikeType | undefined = undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,\n TMainSchema extends z.ZodTypeAny = z.ZodTypeAny\n >(\n resourceType: ResourceType,\n logger: LoggerService,\n errorBuilder: ErrorBuilderBackendService,\n errorHandler: ErrorHandlerService,\n jwtService: JwtBackendService,\n authorizationsService: AuthorizationsBackendService,\n resourcesRegistry: ResourcesRegistryBackendService,\n executionContextCreator: ExecutionContextCreatorBackendService,\n executionContextHandler: ExecutionContextHandlerBackendService,\n repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n resourceOperationHelper: ResourceOperationHelperBackendService,\n servicesRegistry: ServicesRegistryHandlerBackendService,\n fileFieldDetection: FileFieldDetectionBackendService,\n fileUploadHandler: ResourceFileUploadHandlerBackendService,\n auditLogsService: AuditLogsBackendService,\n anonymousSessionService: AnonymousSessionBackendService,\n appConfigService: AppConfigurationService,\n rateLimitService: RateLimitBackendService,\n fileUploadGrantService: FileUploadGrantBackendService,\n ): ControllerResourceBackendService<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n return new ControllerResourceBackendService(\n resourceType, logger, errorBuilder, errorHandler,\n jwtService, authorizationsService, resourcesRegistry, executionContextCreator, executionContextHandler,\n repositoriesRegistry, resourceOperationHelper, servicesRegistry,\n fileFieldDetection, fileUploadHandler, auditLogsService, anonymousSessionService, appConfigService,\n rateLimitService, fileUploadGrantService);\n }\n\n\n private initializeOperationsMap(): void {\n if (!this.resourceConfiguration.operations) {\n return;\n }\n\n // Only include URL-bearing operations\n const apiCallOperations = this.resourceConfiguration.operations.filter(\n (op): op is ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> =>\n [ResourceOperationVariantType.API_CALL, ResourceOperationVariantType.API_CALL_WITH_CALLBACK].includes(op.variantType)\n );\n\n apiCallOperations.forEach(operation => {\n const operationKey = ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation);\n this.operationsMap.set(operationKey, operation);\n });\n\n this.logDebug('Operations map initialized', { totalOperations: this.resourceConfiguration.operations.length, apiCallOperations: apiCallOperations.length });\n }\n\n\n private initializeRoutes(): void {\n this.logDebug('Initializing Express routes');\n\n // Collect every operation route first, then register in\n // literal-over-parameter order. Express matches in registration order, so\n // registering as we iterate would let `/:id`-style READ routes swallow\n // literal sibling segments (`/search`, `/count`, variant suffixes) of\n // operations that happen to come later in the operations map. See\n // compareExpressRoutePathSpecificity for the ordering contract.\n const routeDescriptors: OperationRouteDescriptor[] = [];\n this.operationsMap.forEach((operation) => {\n routeDescriptors.push(...this.collectRouteDescriptorsForOperation(operation));\n });\n\n routeDescriptors.sort((a, b) => compareExpressRoutePathSpecificity(a.expressPath, b.expressPath));\n\n for (const descriptor of routeDescriptors) {\n this.registerRouteDescriptor(descriptor);\n }\n\n // Initialize file upload routes for resources with file fields\n this.initializeFileUploadRoutes();\n\n // Initialize file SERVE (GET) routes — inline byte streaming, authz inherited\n // from the parent resource's READ (the read counterpart to upload).\n this.initializeFileServeRoutes();\n\n // Initialize validate-field routes for resources with unique fields\n this.initializeValidateFieldRoutes();\n\n this.router.use(this.errorHandler.expressErrorHandler());\n\n this.logDebug('Express routes initialized with unified error handler', {\n routeCount: this.operationsMap.size\n });\n }\n\n /**\n * Initialize file SERVE (GET) routes for resources with file fields.\n *\n * The read counterpart to `initializeFileUploadRoutes`. For every file field ×\n * every parent URL combination, registers:\n * `GET /api/v1/.../{resourceType}/:resourceId/files/:fieldName/:fileId`\n *\n * ── SECURITY MODEL (defense-in-depth — do NOT weaken any layer) ──────────────\n * A byte-serving route is an IDOR-prone surface; access is restricted by THREE\n * independent checks, so a caller only ever gets a file they may legitimately see:\n *\n * 1. PARENT-RESOURCE READ AUTHORIZATION (access inheritance) — this handler.\n * Builds the READ execution context from the request and calls\n * `authorizeInController(resourceId, …)`: the EXACT gate as reading the record.\n * ⇒ you cannot serve from a resource you're not allowed to READ.\n * 2. LINK-OWNERSHIP BINDING (the IDOR guard) — `handleFileServe`.\n * The path `:fileId` MUST be the file linked to THIS resource + field\n * (`linkedResourceType/Id/FieldName`); mismatch → fail-closed NOT_FOUND (no\n * existence disclosure). ⇒ you cannot swap a victim's fileId into your own\n * record's serve URL.\n * 3. FILE-SCOPE ACCESS CHECK (belt-and-braces) — `getFile → authorizeFileAccess`.\n * Re-verifies the file's own scope (USER_SELF owner / org / app tenant).\n *\n * The bytes are then streamed by `FilesBackendService.streamFileToResponse`, which\n * applies the untrusted-content response hardening (`nosniff` + file-serve CSP +\n * inline→attachment downgrade for script-capable types).\n *\n * Distinct from the global `/files/:fileId` route, which serves direct / consumable-\n * token / public-share access for OTHER purposes and is NOT resource-scoped.\n */\n private initializeFileServeRoutes(): void {\n const resourceType = this.resourceConfiguration.resourceIdentifier;\n\n // EVERY file field, GENERATED ONES INCLUDED — deliberately not `getUploadableFileFields()`.\n //\n // That narrower helper exists so a template-generated field gets no UPLOAD endpoint, which is\n // correct and is why `initializeFileUploadRoutes` still uses it. Serving is the opposite\n // concern: a generated file is precisely a file the caller may READ and never WRITE, it stays\n // in the read DTO by design, and the frontend builds a serve URL for it like any other\n // (`ResourceAutomaticDisplayer` collects file field paths from the DISPLAY schema). Registering\n // serve routes from the upload-shaped set left generated files reachable by NO route at all:\n // proven over HTTP on 2026-08-25, where this path answered Express's own `Route not found`\n // while the identical route on an uploaded field answered a structured error.\n //\n // Every security layer named in this method's docstring applies unchanged — the parent READ\n // authorization, the link-ownership binding in `handleFileServe`, and the file-scope check —\n // and a generated file carries the same `linkedResourceType/Id/FieldName` binding an uploaded\n // one does, so layer 2 is as strong here as there.\n const fileFields = this.fileFieldDetection.detectFileFields(resourceType);\n if (fileFields.length === 0) {\n this.logDebug('No file fields detected, skipping file serve routes', { resourceType });\n return;\n }\n\n const readOperation = findDefaultUrlBearingOperation(\n this.resourceConfiguration.operations,\n CoreResourceOperation.READ,\n {\n resourceType,\n errorBuilder: this.errorBuilder,\n logDebug: this.logDebug,\n },\n );\n\n if (!readOperation) {\n this.logDebug('READ operation not found or not API_CALL, skipping file serve routes', { resourceType });\n return;\n }\n\n const readInitiatorInfos = readOperation.initiatorInfos || [];\n if (readInitiatorInfos.length === 0) {\n this.logDebug('READ operation has no initiatorInfos, skipping file serve routes', { resourceType });\n return;\n }\n\n for (const fileField of fileFields) {\n const { fieldName } = fileField;\n\n // Register more specific routes first (more parent params = more specific).\n const sortedInfos = [...readInitiatorInfos].sort((a, b) => {\n const aParams = a.parameters?.length || 0;\n const bParams = b.parameters?.length || 0;\n return bParams - aParams;\n });\n\n for (const initiatorInfo of sortedInfos) {\n const fileServeInfo = ResourcesConfigOperationsUrlsBuilderUtils.buildFileServeRouteForOperation({\n operationRouteUrl: initiatorInfo.url,\n operationParameters: initiatorInfo.parameters || [],\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier,\n fieldName,\n isFrontend: false,\n });\n const servePath = this.convertUrlPatternToExpressPath(fileServeInfo.url);\n\n this.router.get(\n servePath,\n this.asyncHandler(async (req: Request, res: Response, next: NextFunction) => {\n // Build the READ execution context for the parent resource, then authorize\n // exactly as a READ of that record (access inheritance).\n let executionContext = await this.executionContextCreator.createExecutionContextFromRequest(\n req,\n readOperation,\n {\n url: fileServeInfo.url,\n parameters: fileServeInfo.parameters,\n },\n );\n executionContext = this.resolveExecutionContextForAuthorization(executionContext, req).executionContext;\n\n const resourceId = req.params[this.resourceConfiguration.resourceFieldIdentifier] as string;\n const fileId = req.params.fileId as string;\n\n await this.authorizationsService.authorizeInController(resourceId, executionContext);\n\n await this.fileUploadHandler.handleFileServe(\n req,\n res,\n next,\n resourceType,\n fieldName,\n resourceId,\n fileId,\n executionContext,\n );\n }),\n );\n this.logDebug('Registered file serve route', { resourceType, fieldName, path: servePath });\n }\n }\n }\n\n /**\n * Initialize file upload routes for resources with file fields.\n * Creates routes:\n * - POST /api/v1/.../resourceType/files/:fieldName (CREATE)\n * - POST /api/v1/.../resourceType/:resourceId/files/:fieldName (UPDATE)\n */\n /**\n * L12 Audit (Phase I):\n * - Authorization: registered upload routes now build the execution context and\n * perform `authorizeInController()` before Multer and before the async upload\n * handler runs, so unauthorized requests are rejected before temp-disk writes,\n * storage upload, or DB write.\n * - Parent resource params: `initiatorInfo.parameters` is correctly passed to the execution context\n * creator, ensuring parent resource FK authorization matches non-file routes.\n * - Multer errors: Request-body parsing failures still flow through the unified\n * error handler, and request-size violations are classified as validation\n * errors rather than generic internal failures.\n * - Route order: the controller-specific authorization middleware runs before\n * Multer for registered upload routes, so unauthenticated callers are\n * rejected before temp-disk parsing starts. Multer still runs before the\n * async upload handler itself, which is why file-type/size failures surface\n * as middleware-layer errors rather than handler exceptions.\n */\n private initializeFileUploadRoutes(): void {\n const resourceType = this.resourceConfiguration.resourceIdentifier;\n\n const fileFields = this.fileFieldDetection.getUploadableFileFields(resourceType);\n if (fileFields.length === 0) {\n this.logDebug('No uploadable file fields detected, skipping file upload routes', { resourceType });\n return;\n }\n\n // Use the canonical non-bulk default URL-bearing operations for route wiring.\n // File upload routes are security-sensitive because they authorize before\n // Multer writes temp files; selecting by array order can bind the wrong\n // parent URL/roles when plain API and callback API variants coexist.\n const createOperation = findDefaultUrlBearingOperation(\n this.resourceConfiguration.operations,\n CoreResourceOperation.CREATE,\n {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n errorBuilder: this.errorBuilder,\n logDebug: this.logDebug,\n },\n );\n const updateOperation = findDefaultUrlBearingOperation(\n this.resourceConfiguration.operations,\n CoreResourceOperation.UPDATE,\n {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n errorBuilder: this.errorBuilder,\n logDebug: this.logDebug,\n },\n );\n\n if (!createOperation || !updateOperation) {\n this.logDebug('CREATE or UPDATE operation not found or not API_CALL type, skipping file upload routes', { resourceType });\n return;\n }\n\n // Get initiatorInfos (already populated with all parent combinations)\n // Each initiatorInfo contains:\n // - url: URL pattern with parent paths (e.g., /api/v1/parents/{parentId}/children)\n // - parameters: Parent resource parameters to extract (e.g., [{ fieldIdentifier: 'parentId', resourceType: 'PARENTS' }])\n const createInitiatorInfos = createOperation.initiatorInfos || [];\n const updateInitiatorInfos = updateOperation.initiatorInfos || [];\n\n if (createInitiatorInfos.length === 0 || updateInitiatorInfos.length === 0) {\n this.logDebug('CREATE or UPDATE operation has no initiatorInfos, skipping file upload routes', { resourceType });\n return;\n }\n\n // Configure Multer middleware with disk storage for true streaming (no memory buffering)\n // Files are written to temp directory, then streamed to storage\n // This enables true streaming for large files without OOM risk\n // NOTE: In k8s, ensure pod has volume mount with read-write access to temp directory\n // NOTE: Consider temp file cleanup job for orphaned files (if process crashes)\n const upload = createMulterUploadConfig({\n logger: this.logger,\n maxFileSize: resolveConfiguredMaxFileSize(this.appConfigService.config.storage?.maxFileSize),\n });\n\n // Register routes for each file field and each parent combination\n // CRITICAL SECURITY FIX: Use initiatorInfos to include parent resource context in routes\n // This ensures parent resource authorization is properly validated\n for (const fileField of fileFields) {\n const { fieldName } = fileField;\n\n // CREATE routes (one per parent combination)\n // Register more specific routes first (with parent paths) for correct Express matching\n // Sort by parameter count (more parameters = more specific route)\n const sortedCreateInfos = [...createInitiatorInfos].sort((a, b) => {\n const aParams = a.parameters?.length || 0;\n const bParams = b.parameters?.length || 0;\n return bParams - aParams; // Descending order (more specific first)\n });\n\n for (const initiatorInfo of sortedCreateInfos) {\n const fileUploadInitiatorInfo = ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation({\n operationRouteUrl: initiatorInfo.url,\n operationParameters: initiatorInfo.parameters || [],\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier,\n fieldName,\n requiresTargetResourceId: false,\n isFrontend: false,\n });\n const createPath = this.convertUrlPatternToExpressPath(fileUploadInitiatorInfo.url);\n const authorizeCreateUpload = this.createFileUploadAuthorizationMiddleware(\n createOperation,\n fileUploadInitiatorInfo,\n {\n requiresTargetResourceId: false,\n resourceType,\n fieldName,\n grantOperation: CoreResourceOperation.CREATE,\n },\n );\n\n this.router.post(\n createPath,\n authorizeCreateUpload,\n upload.single('file'), // Multer middleware - expects 'file' field name\n this.asyncHandler(async (req: Request, res: Response, next: NextFunction) => {\n try {\n const executionContext = (res.locals as FileUploadRouteLocals).fileUploadExecutionContext\n ?? await this.executionContextCreator.createExecutionContextFromRequest(\n req,\n FileUploadGrantBackendService.withUploadGrantAcceptance(createOperation),\n {\n url: fileUploadInitiatorInfo.url,\n parameters: fileUploadInitiatorInfo.parameters,\n }\n );\n\n await this.fileUploadHandler.handleFileUpload(\n req,\n res,\n resourceType,\n fieldName,\n undefined, // No resourceId for CREATE\n CoreResourceOperation.CREATE,\n executionContext\n );\n } catch (error) {\n next(error);\n }\n })\n );\n\n this.logDebug('File upload CREATE route registered', {\n resourceType,\n fieldName,\n path: createPath,\n parentParams: fileUploadInitiatorInfo.parameters.map(p => `${p.fieldIdentifier}:${p.resourceType}`).join(', ') || 'none',\n });\n\n // Mint door (issue #312, D3): a SIBLING of the upload route, behind the SAME authorization\n // middleware, so mint-authority ≡ upload-authority by construction.\n this.router.post(\n `${createPath}/grant`,\n authorizeCreateUpload,\n this.asyncHandler(this.buildFileUploadGrantMintHandler({ resourceType, fieldName, operation: CoreResourceOperation.CREATE })),\n );\n }\n\n // UPDATE routes (one per parent combination)\n // Register more specific routes first (with parent paths) for correct Express matching\n const sortedUpdateInfos = [...updateInitiatorInfos].sort((a, b) => {\n const aParams = a.parameters?.length || 0;\n const bParams = b.parameters?.length || 0;\n return bParams - aParams; // Descending order (more specific first)\n });\n\n const registerUpdateUploadRoute = (\n fileUploadInitiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo,\n options: { requiresTargetResourceId: boolean; allowContextAddressedTarget: boolean },\n ): void => {\n const updatePath = this.convertUrlPatternToExpressPath(fileUploadInitiatorInfo.url);\n const authorizeUpdateUpload = this.createFileUploadAuthorizationMiddleware(\n updateOperation,\n fileUploadInitiatorInfo,\n {\n requiresTargetResourceId: options.requiresTargetResourceId,\n allowContextAddressedTarget: options.allowContextAddressedTarget,\n resourceType,\n fieldName,\n grantOperation: CoreResourceOperation.UPDATE,\n },\n );\n\n this.router.post(\n updatePath,\n authorizeUpdateUpload,\n upload.single('file'), // Multer middleware\n this.asyncHandler(async (req: Request, res: Response, next: NextFunction) => {\n try {\n const locals = (res.locals as FileUploadRouteLocals);\n const resourceId = locals.fileUploadResolvedResourceId\n ?? req.params[this.resourceConfiguration.resourceFieldIdentifier] as string | undefined;\n\n if (!resourceId) {\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n {} as ExecutionContext<any>,\n {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n // diagnostic (log-only)\n resourceType,\n fieldName,\n },\n }\n );\n }\n\n const executionContext = locals.fileUploadExecutionContext\n ?? await this.executionContextCreator.createExecutionContextFromRequest(\n req,\n FileUploadGrantBackendService.withUploadGrantAcceptance(updateOperation),\n {\n url: fileUploadInitiatorInfo.url,\n parameters: fileUploadInitiatorInfo.parameters,\n }\n );\n\n await this.fileUploadHandler.handleFileUpload(\n req,\n res,\n resourceType,\n fieldName,\n resourceId,\n CoreResourceOperation.UPDATE,\n executionContext\n );\n } catch (error) {\n next(error);\n }\n })\n );\n\n this.router.post(\n `${updatePath}/grant`,\n authorizeUpdateUpload,\n this.asyncHandler(this.buildFileUploadGrantMintHandler({ resourceType, fieldName, operation: CoreResourceOperation.UPDATE })),\n );\n\n this.logDebug('File upload UPDATE route registered', {\n resourceType,\n fieldName,\n path: updatePath,\n contextAddressedTarget: options.allowContextAddressedTarget,\n parentParams: fileUploadInitiatorInfo.parameters.map(p => `${p.fieldIdentifier}:${p.resourceType}`).join(', ') || 'none',\n });\n };\n\n for (const initiatorInfo of sortedUpdateInfos) {\n const fileUploadInitiatorInfo = ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation({\n operationRouteUrl: initiatorInfo.url,\n operationParameters: initiatorInfo.parameters || [],\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier,\n fieldName,\n requiresTargetResourceId: true,\n isFrontend: false,\n });\n registerUpdateUploadRoute(fileUploadInitiatorInfo, {\n requiresTargetResourceId: true,\n allowContextAddressedTarget: false,\n });\n\n const operationParameters = initiatorInfo.parameters || [];\n const hasTargetResourceIdParameter = operationParameters.some(\n (parameter) => parameter.fieldIdentifier === this.resourceConfiguration.resourceFieldIdentifier,\n );\n if (!hasTargetResourceIdParameter) {\n const contextAddressedFileUploadInitiatorInfo = ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation({\n operationRouteUrl: initiatorInfo.url,\n operationParameters,\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier,\n fieldName,\n requiresTargetResourceId: false,\n isFrontend: false,\n });\n registerUpdateUploadRoute(contextAddressedFileUploadInitiatorInfo, {\n requiresTargetResourceId: false,\n allowContextAddressedTarget: true,\n });\n }\n }\n }\n\n this.logDebug('File upload routes initialized', {\n resourceType,\n fileFieldCount: fileFields.length,\n createRoutes: createInitiatorInfos.length * fileFields.length,\n updateRoutes: updateInitiatorInfos.length * fileFields.length,\n });\n }\n\n /**\n * Authorize file uploads before Multer touches request bodies.\n *\n * Resource upload routes are intentionally protected at the same semantic\n * execution-context layer as the actual upload handler. Running that auth step\n * first avoids unauthenticated callers forcing temp-disk writes through Multer\n * while still reusing the exact same execution context for the later upload.\n */\n /**\n * The handler behind `POST …/files/<field>/grant` (issue #312, D3). Runs AFTER the upload route's\n * own authorization middleware, so by the time it executes the caller has been authorized on the\n * target write exactly as an upload would be. It computes the two absolute URLs the grant needs from\n * the request itself — the upload URL is this request's URL minus `/grant`, so it cannot drift from\n * the route that was just authorized — and delegates the mint to the ONE function the MCP door also\n * calls. Answers 201 with the grant; the token appears in it because it is the credential.\n */\n private buildFileUploadGrantMintHandler(target: { resourceType: ResourceType; fieldName: string; operation: FileUploadGrantOperation }) {\n return async (req: Request, res: Response, next: NextFunction): Promise<void> => {\n try {\n const locals = res.locals as FileUploadRouteLocals;\n const executionContext = locals.fileUploadExecutionContext;\n if (!executionContext) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, {} as ExecutionContext<any>, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: { message: 'Upload grant mint reached without an authorized context' },\n });\n }\n\n const resourceId = target.operation === CoreResourceOperation.UPDATE\n ? (locals.fileUploadResolvedResourceId ?? req.params[this.resourceConfiguration.resourceFieldIdentifier] as string | undefined)\n : undefined;\n\n const parsedBody = FileUploadGrantMintRequestSchema.safeParse(req.body ?? {});\n if (!parsedBody.success) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { errors: parsedBody.error.issues.map((issue) => ({ path: issue.path.join('.'), message: issue.message })) },\n });\n }\n\n // The API's own public origin comes from configuration, never from request headers — a\n // Host header is client-controlled and a grant URL built from it would point wherever the\n // caller said.\n const apiPublicUrl = this.appConfigService.config.runtime?.endPoints?.[BackendApiType.MAIN_BACKEND_API]?.publicUrl;\n if (!apiPublicUrl) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: { message: `runtime.endPoints.${BackendApiType.MAIN_BACKEND_API}.publicUrl is required to mint a file upload grant` },\n });\n }\n const origin = apiPublicUrl.replace(/\\/+$/, '');\n const requestPath = (req.originalUrl.split('?')[0] ?? '').replace(/\\/grant\\/?$/, '');\n const uploadUrl = `${origin}${requestPath}`;\n const apiBaseUrl = `${origin}${req.baseUrl || MAIN_API_BASE_PATH}`;\n\n const grant = await this.fileUploadGrantService.mint({\n executionContext,\n target: { ...target, resourceId },\n expiresInMinutes: parsedBody.data.expiresInMinutes,\n declared: { name: parsedBody.data.name, mimeType: parsedBody.data.mimeType, size: parsedBody.data.size },\n uploadUrl,\n apiBaseUrl,\n requestProvenance: {\n ipAddress: getClientIpFromRequest(req),\n userAgent: typeof req.headers['user-agent'] === 'string' ? req.headers['user-agent'] : undefined,\n },\n });\n res.status(201).json(grant);\n } catch (error) {\n next(error);\n }\n };\n }\n\n private createFileUploadAuthorizationMiddleware(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n fileUploadInitiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo,\n options: {\n requiresTargetResourceId: boolean;\n allowContextAddressedTarget?: boolean;\n resourceType: ResourceType;\n fieldName: string;\n /** Which write the route serves — the operation kind a grant must have been minted for. */\n grantOperation: FileUploadGrantOperation;\n },\n ) {\n // The upload routes — and ONLY the upload routes — accept a file upload GRANT as an ALTERNATIVE\n // credential (issue #312, D4). The authored operation is left untouched, so the JSON CREATE/UPDATE\n // routes refuse the same token (GATE 1, `CONSUMABLE_TOKEN_NOT_ACCEPTED_FOR_OPERATION`).\n const acceptingOperation = FileUploadGrantBackendService.withUploadGrantAcceptance(operation);\n return this.asyncHandler(async (req: Request, res: Response, next: NextFunction) => {\n try {\n let executionContext = await this.executionContextCreator.createExecutionContextFromRequest(\n req,\n acceptingOperation,\n {\n url: fileUploadInitiatorInfo.url,\n parameters: fileUploadInitiatorInfo.parameters,\n }\n );\n executionContext = this.resolveExecutionContextForAuthorization(executionContext, req).executionContext;\n (req as any).executionContext = executionContext;\n const locals = ((res.locals ??= {}) as FileUploadRouteLocals);\n locals.fileUploadExecutionContext = executionContext;\n\n let resourceId = options.requiresTargetResourceId\n ? req.params[this.resourceConfiguration.resourceFieldIdentifier] as string | undefined\n : undefined;\n\n if (!resourceId && options.allowContextAddressedTarget) {\n const resolvedResourceId = await this.resolveContextAddressedSingletonOperationAuthorizationId(\n CoreResourceOperation.UPDATE,\n operation,\n executionContext,\n ) ?? await this.resolveContextAddressedAssociationOperationAuthorizationId(\n CoreResourceOperation.UPDATE,\n operation,\n executionContext,\n );\n if (resolvedResourceId) {\n resourceId = resolvedResourceId;\n locals.fileUploadResolvedResourceId = resolvedResourceId;\n req.params[this.resourceConfiguration.resourceFieldIdentifier] = resolvedResourceId;\n }\n }\n\n if ((options.requiresTargetResourceId || options.allowContextAddressedTarget) && !resourceId) {\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: 'Resource ID is required for UPDATE file upload',\n resourceType: options.resourceType,\n fieldName: options.fieldName,\n },\n }\n );\n }\n\n // A grant is bound to ONE (resource, field, operation kind, row) AND to ONE concrete route.\n // Checked BEFORE the authorizer so a grant minted for another field never even reaches a role\n // check on this one; a non-grant context passes through untouched. Mirrors `validateFileToken`\n // on the download twin.\n //\n // `req.originalUrl` is the raw request target as received — the SAME thing the mint recorded\n // (`origin + req.originalUrl` minus the query and the `/grant` suffix), so the two sides of the\n // comparison are produced by one recipe and cannot drift. It is passed raw, query included:\n // the service owns the normalisation, so there is nowhere else for a caller to get it wrong.\n // This middleware also fronts the `/grant` mint route, whose path carries that extra segment —\n // a grant presented there therefore mismatches, which is the intended answer.\n const grant = await this.fileUploadGrantService.assertGrantMatchesRoute(executionContext, {\n resourceType: options.resourceType,\n fieldName: options.fieldName,\n operation: options.grantOperation,\n resourceId,\n }, req.originalUrl);\n if (grant) {\n locals.fileUploadGrant = grant;\n }\n\n await this.authorizationsService.authorizeInController(resourceId, executionContext);\n if (resourceId) {\n await this.ensureFileUploadTargetMatchesRouteContext(\n operation,\n resourceId,\n executionContext,\n { requireRouteContext: options.allowContextAddressedTarget },\n );\n }\n next();\n } catch (error) {\n next(error);\n }\n });\n }\n\n /**\n * Initialize validate-field routes for resources with unique fields.\n * Delegates to the validate-field handler module.\n *\n * Creates route: POST /api/v1/.../:resourceType/validate-field\n * Authorization uses CREATE operation rights (collection-level).\n */\n private initializeValidateFieldRoutes(): void {\n initializeValidateFieldRoutes(\n this.router,\n this.resourceConfiguration,\n this.logger,\n this.errorBuilder,\n this.authorizationsService,\n this.executionContextCreator,\n this.resourcesRegistry,\n this.repositoriesRegistry,\n this.convertUrlPatternToExpressPath.bind(this),\n this.asyncHandler.bind(this),\n );\n }\n\n /**\n * Async handler wrapper for Express route handlers.\n * Ensures errors are properly passed to Express error handler.\n */\n private asyncHandler(fn: (req: Request, res: Response, next: NextFunction) => Promise<void>) {\n return (req: Request, res: Response, next: NextFunction) => {\n Promise.resolve(fn(req, res, next)).catch(next);\n };\n }\n\n\n /**\n * Build the route descriptors (path + method + handler) for one operation.\n * Registration is deliberately NOT performed here — `initializeRoutes`\n * collects descriptors across all operations and registers them sorted by\n * `compareExpressRoutePathSpecificity`, so literal segments always win over\n * parameterized siblings regardless of operations-map iteration order.\n */\n private collectRouteDescriptorsForOperation(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>\n ): OperationRouteDescriptor[] {\n\n if (![ResourceOperationVariantType.API_CALL, ResourceOperationVariantType.API_CALL_WITH_CALLBACK].includes(operation.variantType)) {\n this.logDebug('Operation is not API_CALL or API_CALL_WITH_CALLBACK type, skipping route creation', { operation: operation.operationIdentifier, variantType: operation.variantType});\n return [];\n }\n\n const apiCallOperation = operation as ResourceConfiguration_Operation_ApiCall<any, any, any> | ResourceConfiguration_Operation_ApiCallWithCallback<any, any, any>;\n const operationInitiatorInfos = apiCallOperation.initiatorInfos;\n\n if (!operationInitiatorInfos || operationInitiatorInfos.length === 0) {\n this.logDebug('No URLs found for operation, skipping route creation', {operation: operation.operationIdentifier });\n return [];\n }\n\n const httpMethod = this.getHttpMethodForOperation(operation);\n\n return operationInitiatorInfos.map((initiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo) => {\n const expressPath = this.convertUrlPatternToExpressPath(initiatorInfo.url);\n\n this.logDebug('Creating route', {\n method: httpMethod,\n path: expressPath,\n operation: operation.operationIdentifier,\n parameters: initiatorInfo.parameters?.map((p: ResourceConfiguration_Operation_UrlParameterInfo) => `${p.fieldIdentifier}:${p.resourceType}`).join(', ') || 'none',\n callbackUrl: (initiatorInfo as any)['urlCallback'] ?? 'none'\n });\n\n const handler = async (req: Request, res: Response, next: NextFunction): Promise<void> => {\n try {\n await this.doOperation(operation, initiatorInfo, httpMethod, req, res, next);\n } catch (error) {\n next(error);\n }\n };\n\n return {\n expressPath,\n httpMethod,\n handler,\n };\n });\n }\n\n private registerRouteDescriptor(descriptor: OperationRouteDescriptor): void {\n const { expressPath, httpMethod, handler } = descriptor;\n\n switch (httpMethod) {\n case HttpMethod.GET:\n this.router.get(expressPath, handler);\n break;\n case HttpMethod.POST:\n this.router.post(expressPath, handler);\n break;\n case HttpMethod.PUT:\n this.router.put(expressPath, handler);\n break;\n case HttpMethod.DELETE:\n this.router.delete(expressPath, handler);\n break;\n case HttpMethod.PATCH:\n this.router.patch(expressPath, handler);\n break;\n default:\n this.logDebug('Unsupported HTTP method', { method: httpMethod });\n return;\n }\n }\n\n private convertUrlPatternToExpressPath(urlPattern: string): string {\n // Remove /api/v1 prefix to avoid double mounting (HTTP server already mounts master router at /api/v1)\n let path = urlPattern.replace(/^\\/api\\/v1/, '');\n\n // Ensure path starts with / if it's not empty\n if (path && !path.startsWith('/')) {\n path = '/' + path;\n }\n\n // Convert {param} to :param for Express\n return path.replace(/\\{([^}]+)\\}/g, ':$1');\n }\n\n // ================================\n // Execution\n // ================================\n\n private async doOperation(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n initiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo,\n httpMethod: HttpMethod,\n req: Request,\n res: Response,\n next: NextFunction\n ): Promise<void> {\n let executionContext: ExecutionContext<any> | undefined;\n let validatedData: unknown;\n let dataMode: DataMode | undefined;\n let optionsWithVersion: ServiceOptions | undefined;\n let contextAddressedOperationAuthorizationId: string | undefined;\n\n try {\n this.logDebug('Executing operation', { operation: operation.operationIdentifier, method: req.method, path: req.path });\n\n // Pre-flight rate-limit check (system 3, K-3 / Step 2 of the\n // rate-limit unification plan). Runs BEFORE execution-context\n // creation, request-data validation, and authorization so a flood\n // never reaches the heavier downstream work. Early-returns with zero\n // Redis traffic when the variant declares no `rateLimit?` policy\n // (the common case until per-endpoint policies are adopted). At this\n // seam the authenticated identity is unknown by construction, so the\n // client identifier is the IP (C-2). The global HTTP limiter\n // (`http-server.backend.service.ts:setupRateLimit`) remains the\n // safety net for endpoints with no per-endpoint policy.\n await this.rateLimitService.checkPolicyForVariant(req, res, operation);\n\n executionContext = await this.executionContextCreator.createExecutionContextFromRequest(req, operation, initiatorInfo);\n const resolvedContext = this.resolveExecutionContextForAuthorization(executionContext, req);\n executionContext = resolvedContext.executionContext;\n dataMode = resolvedContext.dataMode;\n // Attach executionContext to request for error handler access\n (req as any).executionContext = executionContext;\n validatedData = this.validateRequestData(\n req,\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext as ExecutionContext<ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>>,\n );\n\n // Collection operations (LIST, CREATE, SEARCH) don't have a target resource ID\n // They operate on collections and authorization is based on roles + parent scope\n const operationId = executionContext.operation.operationIdentifier;\n const operationLike = executionContext.operation.resourceOperationLike;\n const effectiveOperation = operationLike || operationId;\n const isCollectionOperation = shouldAuthorizeCollectionOperation(\n String(effectiveOperation),\n );\n\n if (isCollectionOperation) {\n // For collection operations: authorize without specific resource ID\n // Authorization relies on roles and parent scope validation (via initiatorIds)\n this.logDebug('Collection operation - authorizing without resource ID', {\n operation: operationId,\n effectiveOperation,\n initiatorIds: executionContext.initiatorIds\n });\n await this.authorizationsService.authorizeInController(undefined, executionContext);\n } else {\n const resourceId = this.resourceOperationHelper.extractIdsFromExecutionContext(\n executionContext,\n executionContext.operation.resourceFieldIdentifier\n );\n\n // F4: stamp the narrowing decision BEFORE the context-addressed probes below.\n //\n // Both probes resolve WHICH row an id-less operation is about by running a real, NARROWED\n // repository read (`listForInternalScan` → `buildContextualFilter`). That read necessarily\n // precedes `authorizeInController` — the id it produces is what gets authorized — so on a\n // narrowed resource it would otherwise run against no stamp, fail closed, resolve nothing, and\n // answer NOT_FOUND before authorization ever ran. Identical in shape to the defect fixed inside\n // `authorizeInRepositoryAndService`, one boundary out.\n //\n // Exempting the probe from narrowing was the alternative and is the fail-OPEN direction: it\n // would resolve a singleton belonging to a unit the caller does not hold and leave the\n // confinement to a later check. Stamped, the probe simply does not find it.\n //\n // Latent until an application declares a resource that is BOTH unit-narrowed and\n // context-addressed — nothing prevents one, and the failure would be a resource that 404s for\n // every caller with no indication why.\n if (resourceId === undefined) {\n await this.authorizationsService.stampOrganizationUnitNarrowingForOperation(\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext,\n );\n }\n\n const contextOnlySingletonOperationAuthorizationId = resourceId === undefined\n ? await this.resolveContextAddressedSingletonOperationAuthorizationId(\n String(effectiveOperation),\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext,\n )\n : undefined;\n const contextOnlyAssociationOperationAuthorizationId = (\n resourceId === undefined\n && contextOnlySingletonOperationAuthorizationId === undefined\n )\n ? await this.resolveContextAddressedAssociationOperationAuthorizationId(\n String(effectiveOperation),\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext,\n )\n : undefined;\n // An id-less READ of a context-addressed singleton whose row does not exist\n // yet: the authorization probe returned undefined (no `_id`), but the parent\n // scope is present, so the read is legitimately context-addressed. Authorize\n // it by scope and let the operation layer materialize-or-404 (the seam scoped\n // progression/guidance lazy-materialization hooks depend on). READ only —\n // mutations against an absent singleton already failed closed in the probe.\n const isContextAddressedSingletonReadAuthorizedByScope = (\n resourceId === undefined\n && effectiveOperation === CoreResourceOperation.READ\n && contextOnlySingletonOperationAuthorizationId === undefined\n && this.hasContextAddressedSingletonParentScope(\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext,\n )\n );\n const allowContextOnlyRead = (\n resourceId === undefined\n && effectiveOperation === CoreResourceOperation.READ\n && (\n contextOnlySingletonOperationAuthorizationId !== undefined\n || contextOnlyAssociationOperationAuthorizationId !== undefined\n || isContextAddressedSingletonReadAuthorizedByScope\n )\n );\n const allowContextOnlySingletonMutation = (\n resourceId === undefined\n && effectiveOperation !== CoreResourceOperation.READ\n && contextOnlySingletonOperationAuthorizationId !== undefined\n );\n const allowContextOnlyAssociationMutation = (\n resourceId === undefined\n && effectiveOperation !== CoreResourceOperation.READ\n && contextOnlyAssociationOperationAuthorizationId !== undefined\n );\n contextAddressedOperationAuthorizationId = contextOnlySingletonOperationAuthorizationId\n ?? contextOnlyAssociationOperationAuthorizationId;\n\n if (allowContextOnlyRead || allowContextOnlySingletonMutation || allowContextOnlyAssociationMutation) {\n this.logDebug('Context-addressed operation - authorizing without explicit resource ID', {\n operation: operationId,\n effectiveOperation,\n contextAddressingMode: allowContextOnlyRead\n ? 'read'\n : allowContextOnlySingletonMutation\n ? 'singleton-mutation'\n : 'association-mutation',\n initiatorParameters: initiatorInfo.parameters?.map((parameter) => parameter.fieldIdentifier) ?? [],\n });\n await this.authorizationsService.authorizeInController(\n contextAddressedOperationAuthorizationId,\n executionContext\n );\n } else {\n /*\n * Validate the addressed resource id, IN THE RESOURCE'S OWN FORMAT.\n *\n * The fourth argument is what makes that possible, and its absence made\n * `validateResourceId`'s format-aware branch unreachable from the only production caller\n * that addresses a row: without a `resourceType` the helper falls through to\n * `isValidResourceId`, which admits ONLY a MongoDB ObjectId or a UUID.\n *\n * That silently defeated both synthesized formats. An `HTTP_API`-backed resource's id\n * encodes a remote entity's key and an `INTROSPECTION`-backed resource's id is whatever\n * its projection calls the row — neither can be an ObjectId or a UUID, and\n * `ResourceIdBackendService.getFormatForResource` exists precisely to say so. Measured on\n * the introspection lane, against the workbench's module projection (a resource since\n * superseded by `workbench-domain-resources`): the LIST answered 200 with 8 rows while the\n * addressed READ of the row keyed `engine` answered 400 `invalid_format`, because the\n * branch that would have admitted `engine` was never entered.\n *\n * Passing the resource type does not loosen anything for platform-backed rows: the helper\n * resolves their format to the application's declared ObjectId or UUID and validates\n * exactly as before.\n */\n this.resourceOperationHelper.validateResourceId(\n resourceId,\n executionContext,\n executionContext.operation.resourceFieldIdentifier,\n executionContext.operation.resourceIdentifier,\n );\n\n // Type assertion is safe here because validateResourceId ensures it's a string\n await this.authorizationsService.authorizeInController(resourceId as string, executionContext);\n }\n }\n\n // ── COLLECTION EXPORT ───────────────────────────────────────────────────────────────────\n // Everything above this line is the ordinary request lifecycle — rate limit, execution\n // context, request validation, authorization — and the export needs all of it unchanged. What\n // differs is only the RESPONSE: bytes rather than JSON. So the branch sits here, after the\n // caller has been authorized exactly as they would be for the listing, and it OWNS the\n // response from this point (it writes headers and streams, then returns).\n //\n // It re-runs the SOURCE operation rather than querying anything itself, which is the whole\n // design: tenant isolation, contextual filters, retention row-hide, backend-only field\n // stripping and population then hold by construction rather than through a second\n // implementation. See `ResourceCollectionExportConfig`.\n if (executionContext.operation.generatedOperation?.kind === ResourceGeneratedOperationKind.GENERATED_COLLECTION_EXPORT) {\n await this.handleCollectionExport(\n executionContext.operation.generatedOperation,\n initiatorInfo,\n req,\n res,\n executionContext,\n dataMode,\n );\n return;\n }\n\n // For API calls, request pagination wrapper for list operations\n // Extract dataMode from query to pass to service layer for variant resolution\n const needsPagination = effectiveOperation === CoreResourceOperation.LIST || effectiveOperation === CoreResourceOperation.SEARCH;\n const options: ServiceOptions | undefined = needsPagination ? { paginated: true, dataMode } : dataMode ? { dataMode } : undefined;\n optionsWithVersion = contextAddressedOperationAuthorizationId\n ? {\n ...options,\n contextAddressedOperationAuthorizationId,\n ...(effectiveOperation === CoreResourceOperation.UPDATE || effectiveOperation === CoreResourceOperation.DELETE\n ? { contextAddressedMutationAuthorizationId: contextAddressedOperationAuthorizationId }\n : {}),\n }\n : options;\n\n // Parse If-Match header for optimistic locking on the supported single-resource\n // update-like lane only. Other mutation families must fail closed instead of\n // silently accepting a header they do not actually enforce downstream.\n const ifMatchRaw = req.headers[WildoHeaderKeys.IF_MATCH] as string | string[] | undefined;\n const hasIfMatchHeader = hasNonEmptyIfMatchHeader(ifMatchRaw);\n const isBulkOperation = 'isBulkOperation' in executionContext.operation\n ? executionContext.operation.isBulkOperation\n : false;\n const supportsIfMatch = supportsIfMatchOptimisticLocking({\n operationIdentifier: operationId,\n resourceOperationLike: operationLike,\n isBulkOperation,\n });\n if (hasIfMatchHeader && !supportsIfMatch) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n // diagnostic (log-only)\n field: WildoHeaderKeys.IF_MATCH,\n operationIdentifier: executionContext.operation.operationIdentifier,\n resourceOperationLike: executionContext.operation.resourceOperationLike,\n isBulkOperation,\n },\n });\n }\n\n const parsedVersion = supportsIfMatch ? parseIfMatchVersionHeader(ifMatchRaw) : undefined;\n if (hasIfMatchHeader && supportsIfMatch && parsedVersion == null) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n // diagnostic (log-only)\n field: WildoHeaderKeys.IF_MATCH,\n operationIdentifier: executionContext.operation.operationIdentifier,\n resourceOperationLike: executionContext.operation.resourceOperationLike,\n isBulkOperation,\n },\n });\n }\n if (parsedVersion != null) {\n optionsWithVersion = { ...optionsWithVersion, ifMatchVersion: parsedVersion };\n }\n\n // CRDT: extract and validate field timestamps from request body (not from validated DTO —\n // _field_timestamps is engine infrastructure, not part of the resource schema).\n // S2: semantic validation — only accept keys that are actually marked isCRDT() on the schema.\n const rawFieldTimestamps = req.body?._field_timestamps;\n if (rawFieldTimestamps && typeof rawFieldTimestamps === 'object' && !Array.isArray(rawFieldTimestamps)) {\n const crdtFields = extractCrdtFieldNames(operation.mainSchema, false);\n const validated: Record<string, number> = {};\n const entries = Object.entries(rawFieldTimestamps as Record<string, unknown>);\n if (entries.length <= 100) {\n for (const [key, value] of entries) {\n if (typeof key === 'string' && key.length <= 200\n && typeof value === 'number' && Number.isFinite(value) && value > 0\n && crdtFields.has(key)) {\n validated[key] = value;\n }\n }\n if (Object.keys(validated).length > 0) {\n optionsWithVersion = { ...optionsWithVersion, fieldTimestamps: validated };\n }\n }\n }\n\n this.logDebug('Calling service with operation', {\n operationIdentifier: executionContext.operation.operationIdentifier,\n variantKey: executionContext.operation.variantKey,\n dataMode,\n hasOptions: !!optionsWithVersion\n });\n\n // W7.3a: Create AnonymousUser BEFORE the main operation to avoid FK orphans.\n // The main operation may create a resource with anonymousUserId FK — the\n // AnonymousUser record must exist first for FK integrity.\n if (executionContext.anonymousUserCreated) {\n await this.anonymousSessionService.createAnonymousUser(executionContext.anonymousUserId!, req, res);\n const token = this.anonymousSessionService.signSessionToken(executionContext.anonymousUserId!);\n executionContext.setAnonymousSessionToken(token);\n }\n\n const result = await this.servicesRegistry.doByExecutionContext(executionContext, validatedData, optionsWithVersion);\n\n if (result == null && effectiveOperation === CoreResourceOperation.READ) {\n const resourceId = this.resourceOperationHelper.extractIdsFromExecutionContext(\n executionContext,\n executionContext.operation.resourceFieldIdentifier,\n );\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n operation: CoreResourceOperation.READ,\n resourceIdentifier: executionContext.operation.resourceIdentifier,\n resourceFieldIdentifier: executionContext.operation.resourceFieldIdentifier,\n resourceId: resourceId ?? null,\n initiatorParameters: initiatorInfo.parameters?.map((parameter) => parameter.fieldIdentifier) ?? [],\n },\n });\n }\n\n // W7.3a: Set the token as response header AFTER the main operation succeeds.\n // The header is read same-origin (the frontend HTTP client that owns the\n // localStorage session); the cookie (below) is the CROSS-origin carrier —\n // it rides the parent domain to the app so a website-captured lead / draft\n // transposes on app signup with no frontend handoff.\n if (executionContext.anonymousSessionToken) {\n res.setHeader(WildoHeaderKeys.ANONYMOUS_SESSION_TOKEN, executionContext.anonymousSessionToken);\n this.anonymousSessionService.setSessionCookie(res, executionContext.anonymousSessionToken);\n }\n\n await this.sendResponse(res, req, executionContext, result);\n } catch (error) {\n if (!executionContext) {\n next(error);\n return;\n }\n const enrichedError = await this.enrichVersionConflictError(error, executionContext, validatedData, optionsWithVersion);\n next(enrichedError);\n }\n }\n\n\n\n /**\n * Render one LIST/SEARCH result set to a downloadable file and stream it.\n *\n * ## The contract, and why each half of it is shaped this way\n *\n * **It re-runs the SOURCE operation.** Everything a listing enforces — role ACL, parent-scope\n * confinement, contextual filters, retention row-hide, backend-only/secret field stripping,\n * relationship population, sort validation — is enforced here by being the same call, not by being\n * re-implemented. `_doList` and `buildContextualFilter` each exist twice (one per persistence\n * adapter) and have diverged before; an export with its own query would be a third place for the\n * tenant boundary to be got right.\n *\n * **The ceiling is checked before a single byte is written.** A whole-result-set export reads page\n * one first, and that page's `pagination.total` is the authoritative match count — so a refusal is\n * a clean error response, never a half-written file. Truncating instead was rejected: a short CSV\n * is indistinguishable from a complete one once it is open in a spreadsheet.\n *\n * **CSV columns come from the declared response shape, never from the rows.** The header record is\n * written before the last page is read, so row-derived columns would silently drop any field that\n * first appears late in the set. If the shape cannot be resolved the export REFUSES rather than\n * guessing — JSON stays available and carries whatever each row carries.\n *\n * **The audit event is emitted after the count is known**, so the count is truthful, and its\n * failure never fails the export.\n */\n private async handleCollectionExport(\n exportMetadata: ResourceConfiguration_GeneratedCollectionExportOperationMetadata,\n initiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo,\n req: Request,\n res: Response,\n exportExecutionContext: ExecutionContext<any>,\n dataMode: DataMode | undefined,\n ): Promise<void> {\n const exportConfig = exportMetadata.export;\n\n // ── The two selectors, resolved against what the operation OFFERS ──\n // A value the author did not publish is refused rather than silently coerced to a default: an\n // export that quietly answers CSV to a caller who asked for JSON has produced the wrong file.\n const format = resolveRequestedCollectionExportFormat(\n req.query[COLLECTION_EXPORT_FORMAT_QUERY_PARAM],\n exportConfig.formats,\n );\n if (!format) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n field: COLLECTION_EXPORT_FORMAT_QUERY_PARAM,\n requested: req.query[COLLECTION_EXPORT_FORMAT_QUERY_PARAM],\n offered: exportConfig.formats,\n },\n });\n }\n const rowScope = resolveRequestedCollectionExportRowScope(\n req.query[COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM],\n exportConfig.rowScopes,\n );\n if (!rowScope) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n field: COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM,\n requested: req.query[COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM],\n offered: exportConfig.rowScopes,\n },\n });\n }\n\n // ── The source operation, and a request that no longer carries the export's own selectors ──\n // `Object.create` rather than a spread: an Express `Request` carries its behaviour on the\n // prototype chain, and a shallow copy would lose it. This shadows `query` alone, so the source\n // operation's request-DTO validation never sees `format`/`rowScope` — keys it has no reason to\n // model and, on a strict DTO, would reject.\n const sourceOperation = this.resourceConfiguration.operations.find(\n (candidate: any) => String(candidate.operationIdentifier) === exportMetadata.sourceOperationIdentifier,\n ) as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> | undefined;\n if (!sourceOperation) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message: 'Collection export references a source operation that is not registered',\n sourceOperationIdentifier: exportMetadata.sourceOperationIdentifier,\n },\n });\n }\n\n const { [COLLECTION_EXPORT_FORMAT_QUERY_PARAM]: _droppedFormat,\n [COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM]: _droppedRowScope,\n ...sourceQuery } = req.query as Record<string, unknown>;\n const sourceRequest = Object.create(req, {\n query: { value: sourceQuery, enumerable: true, configurable: true, writable: true },\n }) as Request;\n\n let sourceExecutionContext = await this.executionContextCreator.createExecutionContextFromRequest(\n sourceRequest,\n sourceOperation,\n initiatorInfo,\n );\n sourceExecutionContext = this.resolveExecutionContextForAuthorization(sourceExecutionContext, sourceRequest).executionContext;\n const sourceRequestData = this.validateRequestData(\n sourceRequest,\n sourceOperation,\n sourceExecutionContext as ExecutionContext<typeof sourceOperation>,\n );\n\n // ── Columns, resolved BEFORE anything is written ──\n const csvColumns = format === ResourceCollectionExportFormat.CSV\n ? resolveCollectionExportCsvColumns((sourceOperation as any).responseDto)\n : undefined;\n if (format === ResourceCollectionExportFormat.CSV && !csvColumns) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message: 'Cannot resolve CSV columns from the source operation response shape; export JSON instead',\n sourceOperationIdentifier: exportMetadata.sourceOperationIdentifier,\n },\n });\n }\n\n const isFullResultSet = rowScope === ResourceCollectionExportRowScope.FULL_RESULT_SET;\n const pageLimit = (sourceOperation as any).maxPaginatedResultPerPageLimit ?? DEFAULT_COLLECTION_EXPORT_PAGE_LIMIT;\n\n const runPage = async (page: number | undefined, limit: number | undefined): Promise<{ rows: Record<string, unknown>[]; total: number }> => {\n const pagedRequestData = page === undefined\n ? sourceRequestData\n : { ...sourceRequestData, pagination: { ...(sourceRequestData?.pagination ?? {}), page, limit } };\n const result = await this.servicesRegistry.doByExecutionContext(\n sourceExecutionContext,\n pagedRequestData,\n ({ paginated: true, ...(dataMode ? { dataMode } : {}) } as ServiceOptions),\n ) as { data?: unknown[]; pagination?: { total?: number } } | undefined;\n const rows = Array.isArray(result?.data) ? (result!.data as Record<string, unknown>[]) : [];\n return { rows, total: typeof result?.pagination?.total === 'number' ? result!.pagination!.total : rows.length };\n };\n\n // Page one is read BEFORE any header is sent — it carries the authoritative match count, which\n // is what makes both the ceiling refusal and an honest row-count header possible.\n const firstPage = await runPage(\n isFullResultSet ? 1 : undefined,\n isFullResultSet ? pageLimit : undefined,\n );\n const declaredRowCount = isFullResultSet ? firstPage.total : firstPage.rows.length;\n\n if (isFullResultSet\n && exportConfig.maximumExportedRows !== undefined\n && declaredRowCount > exportConfig.maximumExportedRows) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n message: 'The export matches more rows than this operation allows; narrow the filters and retry',\n matchedRows: declaredRowCount,\n maximumExportedRows: exportConfig.maximumExportedRows,\n },\n });\n }\n\n const filename = buildCollectionExportFilename(\n String(this.resourceConfiguration.resourceIdentifier),\n format,\n new Date(),\n );\n res.setHeader('Content-Type', COLLECTION_EXPORT_CONTENT_TYPES[format]);\n res.setHeader('Content-Disposition', `attachment; filename=\"${filename}\"`);\n res.setHeader(COLLECTION_EXPORT_ROW_COUNT_HEADER, String(declaredRowCount));\n // The bytes are application data rendered into a downloadable file; the same untrusted-content\n // posture the file-serve route takes applies here.\n res.setHeader('X-Content-Type-Options', 'nosniff');\n\n let writtenRowCount = 0;\n if (format === ResourceCollectionExportFormat.CSV) {\n res.write(toCsvHeaderRow(csvColumns!));\n } else {\n res.write('[');\n }\n\n const writeRows = (rows: Record<string, unknown>[]): void => {\n for (const row of rows) {\n if (format === ResourceCollectionExportFormat.CSV) {\n res.write(toCsvRow(csvColumns!, row));\n } else {\n res.write(`${writtenRowCount === 0 ? '' : ','}\\n${JSON.stringify(row)}`);\n }\n writtenRowCount += 1;\n }\n };\n\n writeRows(firstPage.rows);\n\n if (isFullResultSet) {\n // Iterate at the operation's OWN declared ceiling. Asking for one huge page instead would mean\n // raising a bound that is enforced at eight independent sites, which would move the effective\n // ceiling for every caller of the listing, not just this export.\n let page = 2;\n while (writtenRowCount < declaredRowCount && firstPage.rows.length > 0) {\n const nextPage = await runPage(page, pageLimit);\n if (nextPage.rows.length === 0) break;\n writeRows(nextPage.rows);\n page += 1;\n }\n }\n\n if (format === ResourceCollectionExportFormat.JSON) {\n res.write(writtenRowCount === 0 ? ']\\n' : '\\n]\\n');\n }\n res.end();\n\n // ── The audit record ──\n // AFTER the count is known, so it is truthful. Fire-and-forget and feature-detected: the export\n // has already been delivered, and a trail write must never turn a completed disclosure into an\n // error the caller sees (the response is finished by now in any case).\n void this.emitCollectionExportAuditEvent({\n exportMetadata,\n format,\n rowScope,\n rowCount: writtenRowCount,\n isFullResultSet,\n requestData: sourceRequestData,\n executionContext: sourceExecutionContext,\n });\n }\n\n /**\n * Record the export in the audit trail.\n *\n * Filter FIELD NAMES only — never their values. A filter value is frequently personal data\n * (`?email=…`), so recording it would leave a second copy of the disclosed data in a store that\n * outlives the exported file. Same rule the subject-export event follows.\n */\n private async emitCollectionExportAuditEvent(params: {\n exportMetadata: ResourceConfiguration_GeneratedCollectionExportOperationMetadata;\n format: ResourceCollectionExportFormat;\n rowScope: ResourceCollectionExportRowScope;\n rowCount: number;\n isFullResultSet: boolean;\n requestData: any;\n executionContext: ExecutionContext<any>;\n }): Promise<void> {\n try {\n // The INJECTED service, not a lookup off the services registry. An earlier draft reached for\n // `(this.servicesRegistry as any).auditLogsService`, which does not exist — so the guard below\n // it would have returned early on every export and the trail would have been permanently\n // empty while looking defensively written. A feature-detect on a dependency the constructor\n // already requires is not caution, it is a silent no-op.\n const filters = params.requestData?.filters;\n await this.auditLogsService.logCollectionDataExport({\n resourceType: String(this.resourceConfiguration.resourceIdentifier),\n sourceOperationIdentifier: params.exportMetadata.sourceOperationIdentifier,\n format: params.format,\n rowScope: params.rowScope,\n rowCount: params.rowCount,\n filterFieldNames: filters && typeof filters === 'object' ? Object.keys(filters) : [],\n isFullResultSet: params.isFullResultSet,\n organizationId: params.executionContext.initiatorIds?.organizationId,\n });\n } catch (error) {\n this.logger.warn('Collection export audit event could not be recorded', {\n error: describeCaughtError(error),\n resourceType: String(this.resourceConfiguration.resourceIdentifier),\n });\n }\n }\n\n private async enrichVersionConflictError(\n error: unknown,\n executionContext: ExecutionContext<any>,\n validatedData: unknown,\n options: ServiceOptions | undefined,\n ): Promise<unknown> {\n if (!isWildoBackendError(error)) {\n return error;\n }\n\n if (error.type !== ErrorType.CONFLICT || error.customMessageReference !== ErrorCustomMessageReference.VERSION_CONFLICT) {\n return error;\n }\n\n if (options?.ifMatchVersion == null) {\n return error;\n }\n\n // Only optimistic-lock conflicts carry the richer versionConflict payload.\n // A generic CONFLICT without an If-Match fence does not guarantee that the\n // controller can explain \"expected vs current\" truth field-by-field.\n const versionConflict = await this.buildVersionConflictDetails(\n executionContext,\n validatedData,\n options.ifMatchVersion,\n options.contextAddressedOperationAuthorizationId\n ?? options.contextAddressedMutationAuthorizationId,\n );\n if (!versionConflict) {\n return error;\n }\n\n error.context = {\n ...(error.context ?? {}),\n versionConflict,\n };\n return error;\n }\n\n private async buildVersionConflictDetails(\n executionContext: ExecutionContext<any>,\n validatedData: unknown,\n expectedVersion: number,\n resolvedResourceId?: string,\n ): Promise<VersionConflictDetails | undefined> {\n const resourceId = resolvedResourceId\n ?? this.resourceOperationHelper.extractIdsFromExecutionContext(\n executionContext,\n executionContext.operation.resourceFieldIdentifier,\n );\n if (typeof resourceId !== 'string' || resourceId.length === 0) {\n return undefined;\n }\n\n const submittedValues = isPlainRecord(validatedData) ? { ...validatedData } : {};\n\n try {\n const currentResource = await this.servicesRegistry.read<Record<string, unknown>>(\n executionContext.operation.resourceIdentifier as ResourceType,\n executionContext,\n resourceId,\n );\n if (!isPlainRecord(currentResource)) {\n return undefined;\n }\n\n const currentValues = this.shapeCanonicalConflictCurrentValues(currentResource);\n if (!currentValues) {\n return undefined;\n }\n\n // Compare the client-submitted shape against canonical READ-shaped server\n // truth so conflict consumers see the same surface the frontend normally\n // reads, while still preserving authoritative engine metadata below.\n const conflictingFields = collectSubmittedFieldPaths(submittedValues).filter((fieldPath) => (\n !areConflictValuesEqual(\n getValueAtPath(currentValues, fieldPath),\n getValueAtPath(submittedValues, fieldPath),\n )\n ));\n\n if (typeof currentValues._version !== 'number') {\n this.logger.warn('Skipped version conflict enrichment because canonical current values omitted authoritative version', {\n resourceType: executionContext.operation.resourceIdentifier,\n resourceId,\n expectedVersion,\n });\n return undefined;\n }\n\n return {\n currentVersion: currentValues._version,\n expectedVersion,\n conflictingFields,\n currentValues,\n submittedValues,\n };\n } catch (readError) {\n this.logger.warn('Failed to enrich version conflict with authoritative current values', {\n resourceType: executionContext.operation.resourceIdentifier,\n resourceId,\n ...projectCaughtErrorLogFields(readError),\n });\n return undefined;\n }\n }\n\n private shapeCanonicalConflictCurrentValues(currentResource: Record<string, unknown>): Record<string, unknown> | undefined {\n const readOperation = this.resolveCanonicalConflictReadOperation();\n if (!readOperation) {\n return currentResource;\n }\n\n const selectedDto = this.selectResponseDto(readOperation, undefined);\n if (!selectedDto) {\n return currentResource;\n }\n\n // Best-effort shaping only. A polymorphic (discriminated-union) resource whose stored\n // document does not cleanly re-validate against the addressable READ DTO — or any\n // transform edge — would otherwise throw here, bubble to `buildVersionConflictDetails`'s\n // catch, and yield `undefined` enrichment (a detail-less VERSION_CONFLICT 409 → an\n // optimistic-concurrency client that can never learn the authoritative version and stays\n // stuck retrying with a stale `If-Match`). Fall back to the raw current resource, which\n // still carries the authoritative `_id`/`_version` the client needs to recover.\n // (Consistent with the `!readOperation` / `!selectedDto` fallbacks above.)\n let parsedCurrentResource: unknown;\n try {\n const transformedCurrentResource = ResourcesConfigOperationsDtosBuilderUtils.transformResponseDates(currentResource, selectedDto);\n parsedCurrentResource = selectedDto.parse(transformedCurrentResource);\n } catch (shapingError) {\n this.logger.warn('Conflict current-values DTO shaping failed; falling back to raw current resource', {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n ...projectCaughtErrorLogFields(shapingError),\n });\n return currentResource;\n }\n if (!isPlainRecord(parsedCurrentResource)) {\n return currentResource;\n }\n\n // Preserve engine-owned identity/version metadata even when the canonical\n // READ DTO strips them. Conflict consumers still need the authoritative\n // resource id/version tuple from storage truth, not only the public DTO body.\n if (parsedCurrentResource._id === undefined && currentResource._id !== undefined) {\n parsedCurrentResource._id = currentResource._id;\n }\n if (parsedCurrentResource._version === undefined && currentResource._version !== undefined) {\n parsedCurrentResource._version = currentResource._version;\n }\n if (currentResource._field_meta && typeof currentResource._field_meta === 'object' && !Array.isArray(currentResource._field_meta)) {\n parsedCurrentResource._field_meta = currentResource._field_meta;\n }\n\n return parsedCurrentResource;\n }\n\n private resolveCanonicalConflictReadOperation(): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> | undefined {\n const defaultReadOperations = (this.resourceConfiguration.operations ?? []).filter((operation) => (\n operation.operationIdentifier === CoreResourceOperation.READ\n && operation.isOperationDefault === true\n && !('isBulkOperation' in operation && operation.isBulkOperation === true)\n ));\n if (defaultReadOperations.length <= 1) {\n if (!defaultReadOperations[0]) {\n this.logDebug('No default conflict-read operation configured', {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n });\n }\n return defaultReadOperations[0];\n }\n\n // More than one default READ matched. This is NOT a misconfiguration: `isOperationDefault`\n // is scoped PER TRANSPORT GROUP, so a resource that declares a default READ in more than one\n // transport (e.g. an addressable API_CALL READ alongside an INTERNAL_CALL / REPOSITORY_ONLY\n // default READ) legitimately yields >1 here — the documented \"set-filter that matches >1 and\n // throws\" hazard called out on `determineOperationVariantDefault` in\n // `resources-config.shared.factory`.\n //\n // Conflict shaping must re-read the SAME surface the frontend reads: the addressable\n // (URL-isable) transport. Select it deterministically. Throwing here would abort enrichment\n // (the throw is swallowed by `buildVersionConflictDetails`'s catch), shipping a detail-less\n // VERSION_CONFLICT 409 — which leaves the optimistic-concurrency client unable to learn the\n // authoritative version and permanently stuck retrying with a stale `If-Match`.\n const addressableReadOperation = defaultReadOperations.find((operation) => (\n operation.variantType === ResourceOperationVariantType.API_CALL\n || operation.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n ));\n if (addressableReadOperation) {\n return addressableReadOperation;\n }\n\n // No addressable default READ among the candidates (unusual — a resource whose only default\n // READs are non-addressable). Fall back to the first deterministically so enrichment still\n // proceeds, and warn for configuration visibility.\n this.logger.warn('Multiple non-addressable default READ operations available for conflict shaping; using the first candidate', {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n candidateVariants: defaultReadOperations.map((operation) => ({\n variantType: operation.variantType,\n variantKey: operation.variantKey,\n })),\n });\n return defaultReadOperations[0];\n }\n\n private normalizeCollectionQueryRequestData(\n rawRequestData: Record<string, unknown>,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n effectiveOperation: string,\n ): CollectionQueryRequestData {\n return normalizeCollectionQueryRequestData(\n rawRequestData,\n operation as never,\n effectiveOperation,\n this.resourceConfiguration.operations as never,\n );\n }\n\n\n private buildCollectionQueryRequestDtoInput(\n req: Request,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n effectiveOperation: string,\n ): Record<string, unknown> {\n // ROUTING IS NOT PAYLOAD. `req.params` carries the route's scope ids (`organizationId`,\n // `applicationId`) and the instance id — none of which the caller \"sent\". Merging them into the\n // request-DTO input conflates where a request was ROUTED with what it CONTAINS, and a `.strict()`\n // DTO then rejects every request including `{}` (measured on `auditLogs | exportAuditLogs`, #319).\n //\n // The defect was latent everywhere and surfaced only where an author was rigorous: every\n // non-strict DTO silently accepted the injected keys and ignored them, so being strict was the\n // thing that broke. Nothing is lost by excluding them — the instance id is read separately from\n // `req.params[resourceFieldIdentifier]` at its own call sites, and the scope is authoritative on\n // the execution context (`initiatorIds`), which is where every tenant-isolating consumer already\n // reads it and the only source a request cannot author for itself.\n const requestData = { ...req.query, ...req.body } as Record<string, unknown>;\n const normalizedRequest = this.normalizeCollectionQueryRequestData(requestData, operation, effectiveOperation);\n\n const filters = { ...normalizedRequest.filter };\n if (effectiveOperation === CoreResourceOperation.SEARCH && normalizedRequest.searchQuery) {\n filters.searchRequest = normalizedRequest.searchQuery;\n }\n\n return {\n ...requestData,\n ...(Object.keys(filters).length > 0 ? { filters } : {}),\n ...(normalizedRequest.page !== undefined || normalizedRequest.limit !== undefined\n ? {\n pagination: {\n ...(normalizedRequest.page !== undefined ? { page: normalizedRequest.page } : {}),\n ...(normalizedRequest.limit !== undefined ? { limit: normalizedRequest.limit } : {}),\n },\n }\n : {}),\n ...(normalizedRequest.sort ? { sorting: buildSortingSchemaInput(normalizedRequest.sort) } : {}),\n };\n }\n\n private validateRequestData(\n req: Request,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<typeof operation>\n ): any {\n // Routing is not payload — see `buildCollectionQueryRequestDtoInput` for the full reasoning (#319).\n const _extractedRequestData = (req: Request) => ({ ...req.query, ...req.body });\n\n // Use effectiveOperation to account for resourceOperationLike\n const effectiveOperation = operation.resourceOperationLike || operation.operationIdentifier;\n\n const hasExplicitRequestDto = hasMeaningfulExplicitRequestDto(operation.requestDto);\n\n if (\n effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.COUNT\n || effectiveOperation === CoreResourceOperation.SEARCH\n ) {\n const dtoInput = this.buildCollectionQueryRequestDtoInput(\n req,\n operation,\n String(effectiveOperation),\n );\n\n if (shouldSkipImplicitRequestValidation(String(effectiveOperation), hasExplicitRequestDto)) {\n return this.normalizeCollectionQueryRequestData(\n dtoInput,\n operation,\n String(effectiveOperation),\n );\n }\n\n if (!operation.requestDto) {\n return this.normalizeCollectionQueryRequestData(\n dtoInput,\n operation,\n String(effectiveOperation),\n );\n }\n\n try {\n const transformedRequestData = ResourcesConfigOperationsDtosBuilderUtils.transformRequestDates(\n dtoInput,\n operation.requestDto,\n );\n const parsedRequestData = operation.requestDto.parse(transformedRequestData) as Record<string, unknown>;\n return this.normalizeCollectionQueryRequestData(\n parsedRequestData,\n operation,\n String(effectiveOperation),\n );\n } catch (error) {\n if (error instanceof z.ZodError) {\n throw this.errorBuilder.buildError( ErrorType.VALIDATION, executionContext,\n { customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n stack: error.stack,\n context: { requestData: dtoInput, error: summarizeZodIssues(error.issues), zodIssues: error.issues }\n });\n }\n throw error;\n }\n }\n\n // For pure core READ/LIST/DELETE/COUNT/SEARCH semantics without an explicit\n // request DTO, no request body validation is needed. Custom operations that\n // reuse READ-like semantics may still declare requestDto and must keep it.\n if (shouldSkipImplicitRequestValidation(String(effectiveOperation), hasExplicitRequestDto)) {\n // For other operations (READ, DELETE, COUNT): return empty or minimal data\n // The actual IDs will be extracted from execution context\n return req.body || {};\n }\n\n if (!operation.requestDto) {\n return _extractedRequestData(req);\n }\n\n try {\n const requestData = _extractedRequestData(req);\n\n // Phase 3.8: Transform dates from strings to Date objects before validation\n let transformedRequestData = requestData;\n if (operation.requestDto) {\n transformedRequestData = ResourcesConfigOperationsDtosBuilderUtils.transformRequestDates(requestData, operation.requestDto);\n }\n\n // Phase 3.9: Validate against requestDto (field stripping already applied at factory time)\n const parsed = operation.requestDto.parse(transformedRequestData);\n\n // Carry the schema's OWN read-only (`.excludeFromUpdate()`) fields THROUGH to the service tier on\n // UPDATE and UPDATE_MANY, so the read-only-change guard there can REFUSE a genuine change — instead\n // of the repository silently stripping them and answering a 2xx that changed nothing (the \"answered\n // success, did nothing\" defect). The guard covers BOTH: single UPDATE compares to the stored row\n // (an ECHO of an unchanged value is allowed), bulk UPDATE_MANY refuses on presence (no single row\n // to compare against). Re-attaching for one without guarding the other would leave the sibling path\n // silently broken — see `.claude/rules/invariant-call-site-enumeration.md`. Only the schema's\n // DECLARED read-only fields are re-attached, so the strict mass-assignment boundary is unchanged\n // (arbitrary unknown keys stay stripped).\n if (\n (effectiveOperation === CoreResourceOperation.UPDATE || effectiveOperation === CoreResourceOperation.UPDATE_MANY)\n && parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n && transformedRequestData && typeof transformedRequestData === 'object' && !Array.isArray(transformedRequestData)\n && isZodObject(this.resourceConfiguration.mainSchema)\n ) {\n const shape = getZodObjectShape(this.resourceConfiguration.mainSchema);\n const parsedRecord = parsed as Record<string, unknown>;\n for (const [key, value] of Object.entries(transformedRequestData as Record<string, unknown>)) {\n if (value !== undefined && !(key in parsedRecord) && shape[key] && isExcludedFromUpdate(shape[key])) {\n parsedRecord[key] = value;\n }\n }\n }\n\n return parsed;\n } catch (error) {\n if (error instanceof z.ZodError) {\n throw this.errorBuilder.buildError( ErrorType.VALIDATION, executionContext,\n { customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n stack: error.stack,\n context: { requestData: _extractedRequestData(req), error: summarizeZodIssues(error.issues), zodIssues: error.issues }\n });\n }\n throw this.errorBuilder.buildFromStandardError(error, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: { requestData: _extractedRequestData(req), error: error.message }\n });\n }\n }\n\n\n /**\n * Phase 3.7: Extract DataMode from execution context or query parameters.\n * DataMode determines which DTO variant to use (SUMMARY, CONTEXT, or RAW).\n *\n * Priority:\n * 1. Query parameter `dataMode` (if provided)\n * 2. Operation variantKey (set at factory time)\n * 3. Default to RAW (responseDto)\n */\n private extractDataMode(\n executionContext: ExecutionContext<any>,\n req?: Request\n ): DataMode {\n // Check query parameter first (allows runtime override)\n const queryDataMode = req?.query?.dataMode as string | undefined;\n const extractedFromQuery = ResourceOperationsUtils.normalizeDataModeString(queryDataMode);\n\n // If query param provided a valid value, use it\n if (queryDataMode && extractedFromQuery) {\n return extractedFromQuery;\n }\n\n // Fall back to operation variantKey (set at factory time)\n const operation = executionContext.operation;\n if (operation.variantKey === OPERATION_VARIANT_KEY.SUMMARY) {\n return DataMode.SUMMARY;\n }\n if (operation.variantKey === OPERATION_VARIANT_KEY.CONTEXT) {\n return DataMode.CONTEXT;\n }\n\n // Default to RAW\n return DataMode.RAW;\n }\n\n private resolveExecutionContextForAuthorization(\n executionContext: ExecutionContext<any>,\n req?: Request,\n ): { executionContext: ExecutionContext<any>; dataMode: DataMode } {\n const dataMode = this.extractDataMode(executionContext, req);\n const resolvedOperation = this.resolveOperationForAuthorizationDataMode(\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n dataMode,\n );\n\n if (executionContext.operation === resolvedOperation) {\n return { executionContext, dataMode };\n }\n\n this.logDebug('Resolved controller authorization operation variant before role checks', {\n originalVariantKey: executionContext.operation.variantKey,\n resolvedVariantKey: resolvedOperation.variantKey,\n dataMode,\n operationIdentifier: executionContext.operation.operationIdentifier,\n });\n\n return {\n executionContext: executionContext.withOperation(resolvedOperation),\n dataMode,\n };\n }\n\n private resolveOperationForAuthorizationDataMode(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n dataMode: DataMode | undefined,\n ): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n // RAW (the default) needs no variant resolution — keep the base operation\n // without touching the registry.\n if (!dataMode || dataMode === DataMode.RAW) {\n return operation;\n }\n\n // Delegate SUMMARY/CONTEXT to the registry's shared data-mode resolution so\n // authorization, request validation and dispatch all agree on the resolved\n // operation. For SEARCH-like operations a SUMMARY/CONTEXT request resolves to\n // the base operation (search is summary by construction — see\n // getOperationForDataMode); for READ/LIST it returns the keyed auto-variant,\n // and a genuinely missing variant still fails fast.\n return this.resourcesRegistry.getOperationForDataMode(operation, dataMode) as ResourceConfiguration_Operation<\n TCustomOperationEnum,\n TCoreOperationEnum,\n TMainSchema\n >;\n }\n\n /**\n * Phase 3.7: Select the appropriate response DTO based on DataMode.\n * Uses structure-aware utility method that handles LIST/SEARCH pagination wrappers.\n *\n * - Variant operations: Uses `responseDto` (already variant-specific)\n * - SUMMARY mode: Uses `summaryDto` (wrapped in pagination for LIST/SEARCH)\n * - CONTEXT mode: Uses `contextDto` (wrapped in pagination for LIST/SEARCH)\n * - RAW mode: Uses `responseDto` (default)\n */\n private selectResponseDto(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n dataMode?: DataMode\n ): z.ZodTypeAny | undefined {\n return ResourcesConfigOperationsDtosBuilderUtils.selectResponseDto(operation, dataMode) || undefined;\n }\n\n private async sendResponse(\n res: Response,\n req: Request,\n executionContext: ExecutionContext<any>,\n result: any,\n ): Promise<void | Response> {\n const operation = executionContext.operation as ResourceConfiguration_Operation<\n TCustomOperationEnum,\n TCoreOperationEnum,\n TMainSchema\n >;\n // Resolve the data mode here (HTTP-only — depends on req.query) and\n // delegate the data-shaping pipeline to the shared helper. The\n // helper is also consumed by the outbound webhook dispatcher so\n // both paths emit identical bodies for the same operation result.\n const dataMode = this.extractDataMode(executionContext, req);\n\n const analyzeDtoStructure = (dto: any) => {\n if (!dto || typeof dto !== 'object' || !('shape' in dto)) return 'Not a Zod object';\n try {\n const shape = (dto as any).shape;\n return Object.keys(shape).join(', ');\n } catch {\n return 'Cannot analyze';\n }\n };\n\n let serialized;\n try {\n serialized = await serializeOperationResultForResponse(operation, result, { dataMode });\n } catch (error) {\n const wildoError = error instanceof z.ZodError\n ? this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n stack: error.stack,\n context: { responseData: result, error: summarizeZodIssues(error.issues), zodIssues: error.issues }\n })\n : this.errorBuilder.buildFromStandardError(error as Error, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: { responseData: result, error: describeCaughtError(error) }\n });\n\n // Direct-send boundary (bypasses `expressErrorHandler` — no `next` here),\n // so log once at this boundary. A response-DTO validation failure is a\n // SERVER-side contract violation (our output didn't match our own DTO), so\n // it keeps an explicit `warn` rather than the request-style classification\n // that would treat a VALIDATION type as a client `debug`. The projection\n // restores the full structured detail now that errors no longer self-log\n // at construction.\n this.logger.warn('Response DTO validation failed', {\n operation: operation.operationIdentifier,\n resourceIdentifier: operation.resourceIdentifier,\n dataMode,\n resultKeys: result && typeof result === 'object' ? Object.keys(result) : 'not-object',\n ...projectWildoBackendErrorLogFields(wildoError),\n });\n\n let validationErrors: Record<string, string> | undefined;\n if (error instanceof z.ZodError) {\n validationErrors = {};\n for (const issue of error.issues) {\n const fieldPath = issue.path.join('.');\n if (fieldPath) validationErrors[fieldPath] = issue.message;\n }\n }\n\n return res.status(wildoError.statusCode).json({\n error: {\n type: wildoError.type,\n severity: wildoError.severity,\n message: wildoError.customMessageReference,\n timestamp: wildoError.timestamp?.toISOString() || new Date().toISOString(),\n ...(wildoError.context && { details: wildoError.context }),\n ...(validationErrors && { validationErrors }),\n }\n });\n }\n\n const { body: responseData, statusCode, selectedDto } = serialized;\n\n this.logDebug('Controller - sendResponse DTO selection', {\n operationIdentifier: operation.operationIdentifier,\n variantKey: operation.variantKey,\n dataMode,\n hasSelectedDto: !!selectedDto,\n hasResponseDto: !!operation.responseDto,\n hasSummaryDto: !!operation.summaryDto,\n hasContextDto: !!operation.contextDto,\n hasInternalDto: !!operation.internalDto,\n responseDtoFields: analyzeDtoStructure(operation.responseDto),\n selectedDtoFields: analyzeDtoStructure(selectedDto),\n resultStructure: result && typeof result === 'object' ? Object.keys(result) : typeof result\n });\n\n // Audit logging for first-exposure secret fields (`isReturnedAtCreation`, CREATE only — the\n // sole disclosure trigger the framework has; a generic any-operation `auditAccess` flag was\n // removed on 2026-08-06 as structurally unreachable).\n // Extracted to a pure helper shared with the M2M webhook dispatcher so\n // both paths fire identical audit events for the same operation result.\n // See `.cursor/plans/m2m-webhook-organization-delivery-phase5.md` §Step 16.\n await logAuditAccessForFields(\n { operation, executionContext, responseData, originalResult: result, selectedDto },\n { auditLogsService: this.auditLogsService, logger: this.logger },\n );\n\n if (executionContext.consumableTokenConsumed) {\n res.setHeader(WildoHeaderKeys.CONSUMABLE_TOKEN_CONSUMED, 'true');\n }\n\n res.setHeader(WildoHeaderKeys.X_SERVER_TIME, String(Date.now()));\n\n res.status(statusCode).json(responseData);\n }\n\n private getHttpMethodForOperation(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>\n ): HttpMethod {\n if ('httpVerb' in operation && operation.httpVerb) {\n return operation.httpVerb;\n }\n\n const operationToCheck = ResourceOperationsUtils.getCoreResourceOperationFromOperation(operation);\n\n if(!operationToCheck) {\n this.logDebug('No HTTP method found for operation, defaulting to POST', { operation: operation.operationIdentifier });\n return HttpMethod.POST;\n }\n return HTTP_METHOD_MAP[operationToCheck] || HttpMethod.POST;\n\n }\n\n}\n\n/**\n * Turn a caller-supplied collection query into the shape the SERVICE layer reads\n * (`{ filter, page, limit, sort, searchQuery }` — the keys `executeCorePersistenceOperation`\n * destructures for LIST / SEARCH / COUNT).\n *\n * SURFACE-AGNOSTIC ON PURPOSE. This was a private controller method until 2026-08-01, which\n * meant it ran for HTTP and for nothing else. The MCP surface dispatches straight to\n * `doByOperationPath` with the agent's raw `args`, so it never reached this function — and the\n * two shapes do not match. A collection operation's `requestDto` (what `tools/list` advertises\n * to the agent, via `convertZodSchemaToMcpInputSchema`) is keyed\n * `{ filters, pagination, sorting }`, while the service reads `{ filter, page, limit, sort }`.\n * An agent that followed the advertised schema therefore had its filter silently ignored and\n * received the UNFILTERED collection — the same \"reports success without doing what was asked\"\n * family this codebase has been closing, and worse for an LLM caller, which then reasons over\n * data it believes was filtered.\n *\n * It also carries the filter ALLOW-LIST: `extractCollectionFilters` copies only keys present in\n * the effective `filterFields` (plus the universal `createdAt`/`updatedAt` range fields), so no\n * caller-supplied key — and therefore no Mongo operator object under an unknown key — can reach\n * the repository through it. That matters most for a surface with no strict DTO parse in front\n * of it: `sanitizeRequestFilter` in the repository returns the filter UNCHANGED when an\n * operation declares no `filterFields`, so this allow-list is the layer that holds.\n *\n * Accepts BOTH the flat form (`page`, `sort`, `q`) and the nested DTO form (`pagination.page`,\n * `sorting`, `filters`, `filters.searchRequest`) so either surface's vocabulary works.\n */\nexport function normalizeCollectionQueryRequestData(\n rawRequestData: Record<string, unknown>,\n operation: ResourceConfiguration_Operation<any, any, any>,\n effectiveOperation: string,\n resourceOperations: readonly ResourceConfiguration_Operation<any, any, any>[],\n): CollectionQueryRequestData {\n const { filterFields } = operation as unknown as CollectionQueryOperationMetadata;\n\n // LIST mirrors the frontend collection host's fallback contract: when the\n // LIST operation declares no `filterFields` of its own, filters authored on\n // the sibling default SEARCH variant apply to LIST too. The frontend has\n // always rendered the filter UI from that fallback (\"filterFields from LIST,\n // fallback to SEARCH\" in `ResourceLayout_List`), but the backend extracted\n // ONLY against the LIST op's own (empty) declaration — silently dropping\n // `?field=value` params and making every SEARCH-only-authored filter a\n // UI-only illusion on LIST (same class as the LIST-sort silent no-op,\n // recovered 2026-06-17). Extraction stays declaration-gated either way:\n // only fields present in the effective `filterFields` are read.\n const effectiveFilterFields = (\n effectiveOperation === CoreResourceOperation.LIST\n && (!filterFields || Object.keys(filterFields).length === 0)\n )\n ? (resourceOperations.find(\n (op) => op.operationIdentifier === CoreResourceOperation.SEARCH && op.isOperationDefault === true,\n ) as unknown as CollectionQueryOperationMetadata | undefined)?.filterFields\n : filterFields;\n\n // Reconstruct date-range filters sent as bracketed query keys\n // (`?createdAt[startDate]=…`) that Express 5's `simple` query parser leaves as\n // literal flat keys — declaration-gated to actual range fields. No-op (returns\n // the same reference) when the request carries no such keys.\n const reconstructedRawRequestData = reconstructBracketedRangeFilters(rawRequestData, effectiveFilterFields);\n\n const nestedFilters = reconstructedRawRequestData.filters && typeof reconstructedRawRequestData.filters === 'object' && !Array.isArray(reconstructedRawRequestData.filters)\n ? reconstructedRawRequestData.filters as Record<string, unknown>\n : {};\n const filter = {\n ...extractCollectionFilters(reconstructedRawRequestData, effectiveFilterFields),\n ...extractCollectionFilters(nestedFilters, effectiveFilterFields),\n };\n\n // The flat wire names are the published collection vocabulary\n // (`COLLECTION_QUERY_PARAMETERS`); the nested `pagination` / `sorting` forms\n // are the structured-body aliases the frontend client sends.\n const page = parseOptionalPositiveInt(rawRequestData[COLLECTION_QUERY_PARAMETERS.page])\n ?? parseOptionalPositiveInt((rawRequestData.pagination as { page?: unknown } | undefined)?.page);\n const limit = parseOptionalPositiveInt(rawRequestData[COLLECTION_QUERY_PARAMETERS.limit])\n ?? parseOptionalPositiveInt((rawRequestData.pagination as { limit?: unknown } | undefined)?.limit);\n\n if (effectiveOperation === CoreResourceOperation.SEARCH) {\n const rawSearch = rawRequestData[COLLECTION_QUERY_PARAMETERS.search];\n const rawSearchAlias = rawRequestData[COLLECTION_QUERY_PARAMETERS.searchAlias];\n const searchQuery = (\n typeof rawSearch === 'string' && rawSearch.trim() !== ''\n ? rawSearch\n : typeof rawSearchAlias === 'string' && rawSearchAlias.trim() !== ''\n ? rawSearchAlias\n : typeof nestedFilters.searchRequest === 'string' && nestedFilters.searchRequest.trim() !== ''\n ? nestedFilters.searchRequest\n : undefined\n );\n const sort = parseCollectionQuerySort(rawRequestData[COLLECTION_QUERY_PARAMETERS.sort])\n ?? normalizeCollectionSorting(rawRequestData.sorting);\n\n return { filter, page, limit, searchQuery, sort };\n }\n\n if (effectiveOperation === CoreResourceOperation.LIST) {\n // LIST parses the same `sort=field:dir,field:dir` query param as SEARCH\n // (priority-ordered, comma-separated). This is threaded end-to-end: the\n // service `list()` dispatch forwards it into `listOptions`, and both\n // repository `_doList()` adapters (mongo + postgres) apply it via\n // `constructValidatedSortOptions` (the same validator SEARCH uses). An\n // absent `sort` falls back to the operation's sortFields default, or\n // createdAt-desc when none are configured — i.e. no behaviour change for\n // callers that don't pass `sort`.\n const sort = parseCollectionQuerySort(rawRequestData[COLLECTION_QUERY_PARAMETERS.sort]);\n return { filter, page, limit, sort };\n }\n\n return { filter };\n}\n"]}
1
+ {"version":3,"file":"controller-resource.backend.service.js","sourceRoot":"","sources":["../../../../../src/base-classes/services/controllers/controller-resource.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAmC,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,OAAO,EAAgB,iBAAiB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE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I,EAAE,CAAC;IACpD,CAAC;IAED,IAAI,kBAAkB,KAAK,qBAAqB,CAAC,IAAI,EAAE,CAAC;QACtD,wEAAwE;QACxE,wEAAwE;QACxE,qEAAqE;QACrE,kEAAkE;QAClE,uEAAuE;QACvE,qEAAqE;QACrE,yEAAyE;QACzE,kCAAkC;QAClC,MAAM,IAAI,GAAG,wBAAwB,CAAC,cAAc,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAC;QACxF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACvC,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC","sourcesContent":["import 'reflect-metadata';\nimport { injectable, inject } from 'inversify';\nimport { Router, Request, Response, NextFunction } from 'express';\nimport { z } from 'zod';\nimport type {\n CollectionViewFields_Shared,\n ResourceConfiguration,\n ResourceConfiguration_Operation,\n ResourceConfiguration_OperationPath,\n ResourceType,\n ResourceRelationship,\n ResourceConfiguration_Operation_UrlInitiatorInfo,\n ResourceConfiguration_Operation_UrlParameterInfo,\n ResourceConfiguration_Operation_ApiCall,\n ResourceConfiguration_Operation_ApiCallWithCallback,\n VersionConflictDetails,\n} from '@wildo-ai/saas-models';\nimport { EnumLikeType, getZodObjectShape, isExcludedFromUpdate, isZodObject } from '@wildo-ai/zod-decorators';\nimport { HttpMethod, DataMode, OPERATION_VARIANT_KEY, ResourcesConfigOperationsDtosBuilderUtils, ResourceOperationsUtils, ResourcesConfigOperationsUrlsBuilderUtils, extractCrdtFieldNames, COLLECTION_QUERY_PARAMETERS,\n BackendApiType, FileUploadGrantMintRequestSchema, type FileUploadGrantOperation, MAIN_API_BASE_PATH,\n} from '@wildo-ai/saas-models';\n\nimport { ExecutionContext_ExecutionType, ExecutionContext_InitiatorIds, UserStatus, OrganizationMemberStatus, ApiKeyStatus } from '@wildo-ai/saas-models';\nimport { summarizeZodIssues } from '@wildo-ai/saas-models';\nimport {\n buildCollectionExportFilename,\n COLLECTION_EXPORT_CONTENT_TYPES,\n COLLECTION_EXPORT_FORMAT_QUERY_PARAM,\n COLLECTION_EXPORT_ROW_COUNT_HEADER,\n COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM,\n ResourceCollectionExportFormat,\n ResourceCollectionExportRowScope,\n ResourceGeneratedOperationKind,\n resolveCollectionExportCsvColumns,\n resolveRequestedCollectionExportFormat,\n resolveRequestedCollectionExportRowScope,\n toCsvHeaderRow,\n toCsvRow,\n type ResourceConfiguration_GeneratedCollectionExportOperationMetadata,\n} from '@wildo-ai/saas-models';\nimport { CoreResourceOperation, ALL_COLLECTION_OPERATIONS, OPERATIONS_WITHOUT_REQUEST_BODY, ARRAY_RESPONSE_OPERATIONS } from '@wildo-ai/saas-models';\nimport { ResourceOperationVariantType, ResourcesConfig_OperationPathUtils, ErrorType, ErrorCustomMessageReference, WildoHeaderKeys, getContextAddressedCompositionSingletonRelationshipCandidates, isWildoBackendError, RelationshipNature, ResourceRelationshipCardinality } from '@wildo-ai/saas-models';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ServicesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/services/services-registry-handler.backend.service';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ErrorHandlerService } from '~wildo-backend-lib/errors/services/error-handler.backend.service';\nimport { projectWildoBackendErrorLogFields, projectCaughtErrorLogFields, describeCaughtError } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { JwtBackendService } from '~wildo-backend-lib/security/jwt/services/jwt.backend.service';\nimport { AuthorizationsBackendService } from '~wildo-backend-lib/security/authorizations/services/authorizations.backend.service';\nimport { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport { ResourceFileUploadHandlerBackendService } from '~wildo-backend-lib/files/handlers/resource-file-upload-handler.backend.service';\nimport { FileFieldDetectionBackendService } from '~wildo-backend-lib/files/services/file-field-detection.backend.service';\nimport { createMulterUploadConfig } from '~wildo-backend-lib/files/utils/file-upload.utils';\nimport { FileUploadGrantBackendService } from '~wildo-backend-lib/files/services/file-upload-grant.backend.service';\nimport type { FileUploadRouteGrantLocals } from '~wildo-backend-lib/files/handlers/file-upload-route-locals.backend.types';\nimport { getClientIpFromRequest } from '~wildo-backend-lib/runtime/utils/request-client-ip.utils';\nimport { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport { JwtClaim_App_Auth_Schema } from '~wildo-backend-lib/security/authentications/models/authentications.backend.schemas';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { ExecutionContextHandlerBackendService } from '~wildo-backend-lib/runtime/services/execution-context-handler.backend.service';\nimport { ResourceOperationHelperBackendService } from '~wildo-backend-lib/base-classes/services/resource-operations-helper.backend.service';\nimport type { ServiceOptions } from '~wildo-backend-lib/base-classes/models/repositories.backend.schemas';\nimport { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport { AnonymousSessionBackendService } from '~wildo-backend-lib/security/authentications/services/anonymous-session.backend.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { RateLimitBackendService } from '~wildo-backend-lib/errors/services/rate-limit.backend.service';\nimport { resolveConfiguredMaxFileSize } from '~wildo-backend-lib/files/utils/file-validation.utils';\nimport { initializeValidateFieldRoutes } from './validate-field-handler.backend.service';\nimport { serializeOperationResultForResponse } from './utils/operation-response-serializer.backend.utils';\nimport { logAuditAccessForFields } from './utils/audit-access-fields.backend.utils';\n\n/**\n * HTTP Method mapping for operations\n */\nconst HTTP_METHOD_MAP: Record<CoreResourceOperation, HttpMethod> = {\n [CoreResourceOperation.CREATE]: HttpMethod.POST,\n [CoreResourceOperation.READ]: HttpMethod.GET,\n [CoreResourceOperation.UPDATE]: HttpMethod.PUT,\n [CoreResourceOperation.DELETE]: HttpMethod.DELETE,\n [CoreResourceOperation.LIST]: HttpMethod.GET,\n [CoreResourceOperation.SEARCH]: HttpMethod.GET,\n [CoreResourceOperation.COUNT]: HttpMethod.GET,\n [CoreResourceOperation.UPDATE_MANY]: HttpMethod.PUT,\n [CoreResourceOperation.DELETE_MANY]: HttpMethod.DELETE,\n [CoreResourceOperation.CREATE_MANY]: HttpMethod.POST,\n};\n\nexport function shouldSkipImplicitRequestValidation(\n effectiveOperation: string,\n hasExplicitRequestDto: boolean,\n): boolean {\n return !hasExplicitRequestDto && OPERATIONS_WITHOUT_REQUEST_BODY.includes(effectiveOperation as any);\n}\n\nfunction hasMeaningfulExplicitRequestDto(requestDto: z.ZodTypeAny | undefined): boolean {\n if (!requestDto) {\n return false;\n }\n\n if (requestDto instanceof z.ZodObject) {\n return Object.keys(requestDto.shape).length > 0;\n }\n\n return true;\n}\n\ntype CollectionQuerySort = Record<string, 1 | -1>;\n\ntype CollectionQueryRequestData = {\n filter: Record<string, unknown>;\n page?: number;\n limit?: number;\n searchQuery?: string;\n sort?: CollectionQuerySort;\n};\n\n/**\n * Collection-view metadata read off LIST/SEARCH/COUNT operations for\n * request-data normalization.\n *\n * `filterFields` mirrors the canonical authored shape\n * (`CollectionViewFields_Shared['filterFields']`): a record keyed by filter\n * field name whose values are the per-field Zod schemas (or filter-ref\n * transformer functions). The ALLOWED FILTER KEYS are the record's keys —\n * never an array. A previous version of this type declared\n * `readonly string[]`, which made `extractCollectionFilters` spread a Record\n * into a Set and throw `(allowedFilterFields ?? []) is not iterable` on the\n * first real LIST/SEARCH request against a resource with declared filters.\n */\ntype CollectionQueryOperationMetadata = {\n filterFields?: CollectionViewFields_Shared['filterFields'];\n};\n\ntype FileUploadRouteLocals = FileUploadRouteGrantLocals & {\n fileUploadExecutionContext?: ExecutionContext<any>;\n fileUploadResolvedResourceId?: string;\n};\n\nfunction parseOptionalPositiveInt(value: unknown): number | undefined {\n if (typeof value === 'number' && Number.isFinite(value) && value > 0) {\n return Math.trunc(value);\n }\n\n if (typeof value !== 'string' || value.trim() === '') {\n return undefined;\n }\n\n const parsed = Number.parseInt(value, 10);\n return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;\n}\n\nfunction parseCollectionQuerySort(value: unknown): CollectionQuerySort | undefined {\n if (!value || typeof value !== 'string') {\n return undefined;\n }\n\n const sortEntries = value\n .split(',')\n .map((segment) => segment.trim())\n .filter(Boolean)\n .map((segment) => {\n const [field, rawDirection] = segment.split(':');\n if (!field) {\n return null;\n }\n\n const normalizedDirection = rawDirection?.toLowerCase();\n const direction = normalizedDirection === 'desc' ? -1 : 1;\n return [field, direction] as const;\n })\n .filter((entry): entry is readonly [string, 1 | -1] => entry !== null);\n\n return sortEntries.length > 0 ? Object.fromEntries(sortEntries) : undefined;\n}\n\nfunction normalizeCollectionSorting(value: unknown): CollectionQuerySort | undefined {\n if (!value || typeof value !== 'object' || Array.isArray(value)) {\n return undefined;\n }\n\n const normalizedEntries: Array<[string, 1 | -1]> = [];\n for (const [field, rawValue] of Object.entries(value)) {\n if (rawValue === 1 || rawValue === -1) {\n normalizedEntries.push([field, rawValue]);\n continue;\n }\n\n if (\n rawValue\n && typeof rawValue === 'object'\n && !Array.isArray(rawValue)\n && typeof (rawValue as { field?: unknown }).field === 'string'\n ) {\n const sortField = (rawValue as { field: string }).field;\n const rawOrder = String((rawValue as { order?: unknown }).order ?? 'asc').toLowerCase();\n normalizedEntries.push([sortField, rawOrder === 'desc' ? -1 : 1]);\n }\n }\n\n return normalizedEntries.length > 0 ? Object.fromEntries(normalizedEntries) : undefined;\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction parseIfMatchVersionHeader(rawHeader: string | string[] | undefined): number | undefined {\n const rawValues = Array.isArray(rawHeader) ? rawHeader : [rawHeader];\n\n for (const rawValue of rawValues) {\n if (typeof rawValue !== 'string' || rawValue.trim() === '') {\n continue;\n }\n\n const candidates = rawValue\n .split(',')\n .map((candidate) => candidate.trim())\n .filter((candidate) => candidate !== '');\n\n for (const candidate of candidates) {\n const normalizedCandidate = candidate\n .replace(/^W\\//, '')\n .replace(/^\"|\"$/g, '');\n\n if (!normalizedCandidate) {\n continue;\n }\n\n const parsedVersion = Number(normalizedCandidate);\n if (Number.isInteger(parsedVersion) && parsedVersion >= 0) {\n return parsedVersion;\n }\n }\n }\n\n return undefined;\n}\n\nfunction hasNonEmptyIfMatchHeader(rawHeader: string | string[] | undefined): boolean {\n const rawValues = Array.isArray(rawHeader) ? rawHeader : [rawHeader];\n return rawValues.some((rawValue) => typeof rawValue === 'string' && rawValue.trim() !== '');\n}\n\nfunction supportsIfMatchOptimisticLocking(params: {\n operationIdentifier: unknown;\n resourceOperationLike?: unknown;\n isBulkOperation?: boolean;\n}): boolean {\n // The framework only treats If-Match as authoritative optimistic locking for\n // the single-resource UPDATE-like lane. Broader mutation families may still\n // be update-like semantically, but they do not have the same per-resource\n // compare-and-swap contract and must fail closed when the header is present.\n const effectiveOperation = params.resourceOperationLike || params.operationIdentifier;\n return effectiveOperation === CoreResourceOperation.UPDATE && params.isBulkOperation !== true;\n}\n\nfunction findDefaultUrlBearingOperation<\n TCustomOperationEnum extends EnumLikeType | undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined,\n TMainSchema extends z.ZodTypeAny,\n>(\n operations: Array<ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>>,\n operationIdentifier: CoreResourceOperation,\n params: {\n resourceType: ResourceType;\n errorBuilder: ErrorBuilderBackendService;\n logDebug: (message: string, context?: Record<string, unknown>) => void;\n },\n): ResourceConfiguration_Operation_ApiCall<any, any, any> | ResourceConfiguration_Operation_ApiCallWithCallback<any, any, any> | undefined {\n const candidates = operations.filter((operation) =>\n operation.operationIdentifier === operationIdentifier\n && operation.isOperationDefault === true\n && !('isBulkOperation' in operation && operation.isBulkOperation === true)\n && (\n operation.variantType === ResourceOperationVariantType.API_CALL\n || operation.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n )\n );\n if (candidates.length > 1) {\n const candidateVariants = candidates.map((operation) => ({\n variantType: operation.variantType,\n variantKey: operation.variantKey,\n isOperationDefault: operation.isOperationDefault,\n }));\n params.logDebug('Ambiguous default URL-bearing operation candidates', {\n resourceType: params.resourceType,\n operationIdentifier,\n candidateVariants,\n });\n throw params.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: `Ambiguous default ${operationIdentifier} URL-bearing operation; expected exactly one non-bulk default variant.`,\n resourceType: params.resourceType,\n operationIdentifier,\n candidateVariants,\n },\n },\n );\n }\n return candidates[0] as ResourceConfiguration_Operation_ApiCall<any, any, any> | ResourceConfiguration_Operation_ApiCallWithCallback<any, any, any> | undefined;\n}\n\n/**\n * Compare two Express route paths by matching specificity so that, when\n * registered in the returned order, no parameterized segment can swallow a\n * sibling literal segment.\n *\n * Express matches routes in registration order, and a `:param` segment\n * matches ANY value — including literal operation suffixes. Without ordered\n * registration, `/todos/:todoId` (READ) registered before `/todos/search`\n * (SEARCH) captures `search` as a todoId and fails resource-id validation\n * with a 400 instead of executing the search. The same collision class\n * applies to every literal sibling of an id segment: `/count`, the\n * auto-variant suffixes (`/summary`, `/context` on LIST), and any custom\n * operation whose URL ends in a literal segment.\n *\n * Ordering rule (segment-wise lexicographic):\n * 1. At the first position where one path has a literal and the other a\n * `:param`, the literal sorts first.\n * 2. Two different literals order alphabetically (they cannot both match the\n * same URL, so this is purely for determinism).\n * 3. Two params rank equally — continue to the next segment.\n * 4. All shared segments equal → longer (more specific) path first.\n *\n * The comparator is exported for direct unit testing; the controller applies\n * it once over ALL collected operation routes before registration.\n */\nexport function compareExpressRoutePathSpecificity(a: string, b: string): number {\n const aSegments = a.split('/').filter(Boolean);\n const bSegments = b.split('/').filter(Boolean);\n const sharedLength = Math.min(aSegments.length, bSegments.length);\n\n for (let i = 0; i < sharedLength; i++) {\n const aIsParam = aSegments[i].startsWith(':');\n const bIsParam = bSegments[i].startsWith(':');\n\n if (aIsParam !== bIsParam) {\n return aIsParam ? 1 : -1;\n }\n\n if (!aIsParam && aSegments[i] !== bSegments[i]) {\n return aSegments[i].localeCompare(bSegments[i]);\n }\n }\n\n return bSegments.length - aSegments.length;\n}\n\n/**\n * A fully-resolved operation route awaiting registration. Collected across\n * ALL operations first, then sorted with `compareExpressRoutePathSpecificity`\n * and registered — see `initializeRoutes`.\n */\ninterface OperationRouteDescriptor {\n expressPath: string;\n httpMethod: HttpMethod;\n handler: (req: Request, res: Response, next: NextFunction) => Promise<void>;\n}\n\nfunction collectSubmittedFieldPaths(value: unknown, prefix = ''): string[] {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return prefix ? [prefix] : [];\n }\n\n return value.flatMap((childValue, index) => (\n collectSubmittedFieldPaths(childValue, `${prefix}[${index}]`)\n ));\n }\n\n if (!isPlainRecord(value)) {\n return prefix ? [prefix] : [];\n }\n\n const entries = Object.entries(value).filter(([key]) => !key.startsWith('_'));\n if (entries.length === 0) {\n return prefix ? [prefix] : [];\n }\n\n return entries.flatMap(([key, childValue]) => {\n const nextPath = prefix ? `${prefix}.${key}` : key;\n return collectSubmittedFieldPaths(childValue, nextPath);\n });\n}\n\nfunction getValueAtPath(record: Record<string, unknown>, path: string): unknown {\n const normalizedPath = path.replace(/\\[(\\d+)\\]/g, '.$1');\n return normalizedPath.split('.').filter(Boolean).reduce<unknown>((current, segment) => {\n if (current == null || typeof current !== 'object') {\n return undefined;\n }\n return (current as Record<string, unknown>)[segment];\n }, record);\n}\n\nfunction areConflictValuesEqual(left: unknown, right: unknown): boolean {\n if (left === right) {\n return true;\n }\n\n if (left === null || left === undefined || right === null || right === undefined) {\n return left === right;\n }\n\n if (Array.isArray(left) || Array.isArray(right)) {\n if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) {\n return false;\n }\n\n return left.every((value, index) => areConflictValuesEqual(value, right[index]));\n }\n\n if (isPlainRecord(left) || isPlainRecord(right)) {\n if (!isPlainRecord(left) || !isPlainRecord(right)) {\n return false;\n }\n\n const keys = [...new Set([...Object.keys(left), ...Object.keys(right)])]\n .filter((key) => !key.startsWith('_'));\n return keys.every((key) => areConflictValuesEqual(left[key], right[key]));\n }\n\n return false;\n}\n\nfunction buildSortingSchemaInput(sort: CollectionQuerySort | undefined): Record<string, { field: string; order: 'asc' | 'desc'; priority: number }> | undefined {\n if (!sort) {\n return undefined;\n }\n\n const entries = Object.entries(sort);\n if (entries.length === 0) {\n return undefined;\n }\n\n return Object.fromEntries(\n entries.map(([field, direction], index) => [\n field,\n {\n field,\n order: direction === -1 ? 'desc' : 'asc',\n priority: index,\n },\n ]),\n );\n}\n\n/**\n * Project the declared filter values out of raw collection request data.\n *\n * The allow-list is derived from the KEYS of the operation's authored\n * `filterFields` record (see {@link CollectionQueryOperationMetadata}) plus\n * the universal timestamp filters. Function-valued entries (filter-ref\n * transformers) contribute their key like any other declared filter — the\n * value shape only matters to validation downstream, not to key allowance.\n *\n * Exported for direct unit testing.\n */\nexport function extractCollectionFilters(\n rawData: Record<string, unknown>,\n filterFields: CollectionQueryOperationMetadata['filterFields'],\n): Record<string, unknown> {\n const allowedKeys = new Set<string>([\n ...Object.keys(filterFields ?? {}),\n 'createdAt',\n 'updatedAt',\n ]);\n\n const filters: Record<string, unknown> = {};\n for (const key of allowedKeys) {\n const value = rawData[key];\n if (value !== undefined && isPermittedFilterValue(value)) {\n filters[key] = value;\n }\n }\n\n return filters;\n}\n\n/**\n * Is this filter VALUE one of the shapes a caller is permitted to send?\n *\n * The allow-list above gates filter KEYS. It did not gate VALUES, and that was a real hole: a caller\n * could send `{ status: { $ne: 'completed' } }` on an allow-listed key and have the operator reach\n * the query. Proven live on 2026-08-01 against the MCP surface — `tasks__search` returned exactly the\n * non-matching rows, with a passing control alongside it\n * (`examples/wonder-todos/e2e/mcp-contract.e2e.ts`, probe M-3b).\n *\n * It only surfaced on MCP because the HTTP controller parses the body against the operation's\n * `requestDto` first, and `filterFields` types `status` as an enum, so the object was refused there.\n * MCP normalizes rather than parses, so this allow-list was the only thing between the caller and the\n * query. Gating here rather than at either surface keeps ONE authority: any future surface inherits\n * the guard instead of re-deriving it.\n *\n * ## Why this is an ALLOW-list and not a `$`-prefix blocklist\n *\n * The first version rejected `$`-prefixed keys — the MongoDB operator vocabulary. That is the wrong\n * shape for a framework with more than one persistence adapter: a PostgreSQL-backed resource whose\n * structured filter used any other operator syntax would sail straight through a Mongo-shaped\n * blocklist, and every future operator would have to be enumerated before it could be refused.\n * A blocklist fails OPEN on everything its author did not anticipate.\n *\n * So the question asked here is the positive one — is this a shape a caller may legitimately send —\n * and the answer is closed by construction:\n *\n * - a scalar (`string` / `number` / `boolean` / `null` / `Date`), or\n * - an array of scalars, or\n * - a range object whose keys are exactly {@link RANGE_FILTER_SUBKEYS}, the framework's OWN named\n * date-range vocabulary (`Resources_Filter_DateRangeSchema`), with scalar bounds.\n *\n * Anything else is refused, whatever engine's syntax it happens to be written in. Adding a genuinely\n * new structured filter shape is then a deliberate edit to this predicate and its named vocabulary,\n * which is exactly where that decision belongs.\n *\n * Rejects rather than sanitizes, and rejects the WHOLE value: a partially-stripped operator object is\n * a filter the caller did not ask for, which is its own kind of wrong answer.\n *\n * assurance-control: WILDO.SECURITY.FAIL_CLOSED — untrusted input must not reach a query as an\n * operator; the guard rejects the whole value rather than sanitizing part of it.\n */\nfunction isPermittedFilterScalar(value: unknown): boolean {\n return value === null\n || value instanceof Date\n || typeof value === 'string'\n || typeof value === 'number'\n || typeof value === 'boolean';\n}\n\nfunction isPermittedFilterValue(value: unknown): boolean {\n if (isPermittedFilterScalar(value)) return true;\n if (Array.isArray(value)) return value.every((entry) => isPermittedFilterScalar(entry));\n if (value === null || typeof value !== 'object') return false;\n\n const entries = Object.entries(value as Record<string, unknown>);\n return entries.length > 0\n && entries.every(([key, bound]) => RANGE_FILTER_SUBKEYS.has(key) && isPermittedFilterScalar(bound));\n}\n\n\n/** Date-range filters accepted on every collection op (mirrors `Resources_Filter_BaseSchema`). */\nconst UNIVERSAL_RANGE_FILTER_FIELDS = ['createdAt', 'updatedAt'] as const;\n/** The two sub-keys of a `Resources_Filter_DateRangeSchema` range object. */\nconst RANGE_FILTER_SUBKEYS: ReadonlySet<string> = new Set(['startDate', 'endDate']);\n\n/**\n * Reconstruct date-range filters sent as BRACKETED query keys\n * (`?createdAt[startDate]=<ISO>&createdAt[endDate]=<ISO>`) back into the nested\n * `{ startDate, endDate }` object the SEARCH request DTO expects.\n *\n * WHY THIS EXISTS — a date-range filter is authored as an OBJECT\n * (`Resources_Filter_DateRangeSchema` → `{ startDate?: Date, endDate?: Date }`), and\n * the frontend HTTP client / any generated SDK serialise it with bracket notation\n * (OpenAPI `style: deepObject`). Express 5 defaults its query parser to `simple`\n * (`querystring.parse`), under which `createdAt[startDate]=x` arrives as the LITERAL\n * flat key `req.query['createdAt[startDate]']`. `extractCollectionFilters` reads\n * `rawData.createdAt` and never sees it, so range filtering silently no-ops.\n *\n * We deliberately do NOT switch the global query parser to `extended` (qs): that\n * would change `req.query` shape for EVERY controller and break the pervasive\n * flat-scalar `req.query.X as string` assumption (auth / SCIM / chart consumers) —\n * a parameter-pollution footgun Express 5 avoids by defaulting to `simple`.\n * Instead we reconstruct the nested object HERE, scoped to the collection-query\n * path and DECLARATION-GATED: only the universal `createdAt` / `updatedAt` and any\n * authored `z.date()` `filterField` (the exact set the factory wraps in a range\n * schema) are eligible, so no arbitrary bracketed key can inject a nested object.\n *\n * Values are coerced to `Date` because the range schema is `z.date()` (not\n * `z.coerce.date()`) AND `transformRequestDates` does not descend through the\n * range object's `.optional()` wrapper (a separate, deeper gap — see the\n * date-range coercion note in the plan). An unparseable value becomes an\n * `Invalid Date`, which the DTO parse then rejects with a clean validation error\n * rather than silently dropping the filter.\n *\n * Returns the input by REFERENCE when there is nothing to reconstruct, so the\n * common no-bracket request allocates nothing.\n */\nexport function reconstructBracketedRangeFilters(\n rawData: Record<string, unknown>,\n filterFields: CollectionQueryOperationMetadata['filterFields'],\n): Record<string, unknown> {\n const rangeFields = new Set<string>(UNIVERSAL_RANGE_FILTER_FIELDS);\n for (const [name, schema] of Object.entries(filterFields ?? {})) {\n if (schema instanceof z.ZodDate) {\n rangeFields.add(name);\n }\n }\n\n let reconstructed: Record<string, unknown> | undefined;\n for (const key of Object.keys(rawData)) {\n const match = /^([^[\\]]+)\\[([^[\\]]+)\\]$/u.exec(key);\n if (match === null) continue;\n const base = match[1]!;\n const subKey = match[2]!;\n if (!rangeFields.has(base) || !RANGE_FILTER_SUBKEYS.has(subKey)) continue;\n\n reconstructed ??= { ...rawData };\n const existing = reconstructed[base];\n const range: Record<string, unknown> =\n typeof existing === 'object' && existing !== null && !Array.isArray(existing)\n ? (existing as Record<string, unknown>)\n : {};\n const rawValue = rawData[key];\n range[subKey] = typeof rawValue === 'string' ? new Date(rawValue) : rawValue;\n reconstructed[base] = range;\n // Drop the literal bracketed key so it can't leak downstream as a stray field.\n delete reconstructed[key];\n }\n\n return reconstructed ?? rawData;\n}\n\nexport function shouldAuthorizeCollectionOperation(\n effectiveOperation: string,\n): boolean {\n return ALL_COLLECTION_OPERATIONS.includes(effectiveOperation as any);\n}\n\nexport function isContextAddressedReadOperation(\n effectiveOperation: string,\n resourceFieldIdentifier: string,\n initiatorInfo: Pick<ResourceConfiguration_Operation_UrlInitiatorInfo, 'parameters'>,\n matchedParameterFieldIdentifiers?: string[],\n): boolean {\n if (effectiveOperation !== CoreResourceOperation.READ) {\n return false;\n }\n\n const parameters = initiatorInfo.parameters ?? [];\n\n if ((matchedParameterFieldIdentifiers?.length ?? 0) > 0) {\n const declaredParameterFieldIdentifiers = new Set(\n parameters.map((parameter) => parameter.fieldIdentifier),\n );\n const allMatchedParametersAreDeclared = matchedParameterFieldIdentifiers!.every(\n (fieldIdentifier) => declaredParameterFieldIdentifiers.has(fieldIdentifier),\n );\n\n if (allMatchedParametersAreDeclared) {\n return !matchedParameterFieldIdentifiers?.includes(resourceFieldIdentifier);\n }\n }\n\n if (parameters.length === 0) {\n return false;\n }\n\n return !parameters.some((parameter) => parameter.fieldIdentifier === resourceFieldIdentifier);\n}\n\n/**\n * Page size a full-result-set export iterates at when the source operation declares no ceiling.\n *\n * 100 deliberately — it is the value `maxPaginatedResultPerPageLimit` itself defaults to, and that\n * bound is enforced at eight independent sites. Anything larger here would be an export asking for a\n * page the listing's own request schema refuses.\n */\nconst DEFAULT_COLLECTION_EXPORT_PAGE_LIMIT = 100;\n\nexport class ControllerResourceBackendService<\n TCustomOperationEnum extends EnumLikeType | undefined = undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,\n TMainSchema extends z.ZodTypeAny = z.ZodTypeAny> {\n\n private readonly resourceConfiguration: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>;\n private readonly operationsMap: Map<string, ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>>;\n private readonly router: Router;\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n resourceType: ResourceType,\n private readonly logger: LoggerService,\n private readonly errorBuilder: ErrorBuilderBackendService,\n private readonly errorHandler: ErrorHandlerService,\n private readonly jwtService: JwtBackendService,\n private readonly authorizationsService: AuthorizationsBackendService,\n private readonly resourcesRegistry: ResourcesRegistryBackendService,\n private readonly executionContextCreator: ExecutionContextCreatorBackendService,\n private readonly executionContextHandler: ExecutionContextHandlerBackendService,\n private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n private readonly resourceOperationHelper: ResourceOperationHelperBackendService,\n private readonly servicesRegistry: ServicesRegistryHandlerBackendService,\n private readonly fileFieldDetection: FileFieldDetectionBackendService,\n private readonly fileUploadHandler: ResourceFileUploadHandlerBackendService,\n private readonly auditLogsService: AuditLogsBackendService,\n private readonly anonymousSessionService: AnonymousSessionBackendService,\n private readonly appConfigService: AppConfigurationService,\n private readonly rateLimitService: RateLimitBackendService,\n private readonly fileUploadGrantService: FileUploadGrantBackendService,\n ) {\n\n\n this.resourceConfiguration = this.resourcesRegistry.getResourceConfiguration(resourceType);\n this.router = Router();\n this.operationsMap = new Map();\n\n this.logDebug = this.logger.debugByType(`ControllerResource_${resourceType}`);\n this.logger.setDebugTypeLogging(`ControllerResource_${resourceType}`, false);\n\n this.initializeOperationsMap();\n this.initializeRoutes();\n\n this.logDebug('Controller resource service created', { resourceType: this.resourceConfiguration.resourceIdentifier, operationsCount: this.operationsMap.size\n });\n }\n\n public getRouter(): Router { return this.router }\n\n\n private async resolveContextAddressedSingletonOperationAuthorizationId(\n effectiveOperation: string,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n options?: ServiceOptions,\n ): Promise<string | undefined> {\n const operationEffectiveIdentifier = operation.resourceOperationLike ?? operation.operationIdentifier;\n if (\n operationEffectiveIdentifier !== CoreResourceOperation.READ\n && operationEffectiveIdentifier !== CoreResourceOperation.UPDATE\n && operationEffectiveIdentifier !== CoreResourceOperation.DELETE\n ) {\n return undefined;\n }\n\n if (\n effectiveOperation !== CoreResourceOperation.READ\n && effectiveOperation !== CoreResourceOperation.UPDATE\n && effectiveOperation !== CoreResourceOperation.DELETE\n ) {\n return undefined;\n }\n\n if ('isBulkOperation' in operation && operation.isBulkOperation === true) {\n return undefined;\n }\n\n if (!operation.resourceRelationships) {\n return undefined;\n }\n\n const matchingParents = getContextAddressedCompositionSingletonRelationshipCandidates(operation.resourceRelationships)\n .filter((candidate) => this.hasParentContextForRelationship(\n candidate.parentResourceType,\n candidate.foreignKeyField,\n executionContext,\n ));\n\n if (matchingParents.length === 0) {\n return undefined;\n }\n\n if (matchingParents.length > 1) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Ambiguous context-addressed singleton operation authorization target',\n resourceType: operation.resourceIdentifier,\n parentResourceTypes: matchingParents.map((candidate) => candidate.parentResourceType),\n },\n },\n );\n }\n\n const candidate = matchingParents[0];\n const parentResourceId = this.resolveParentContextResourceId(\n candidate.parentResourceType,\n candidate.foreignKeyField,\n executionContext,\n );\n if (!parentResourceId) {\n return undefined;\n }\n\n const repo = this.repositoriesRegistry.getRepository(operation.resourceIdentifier as ResourceType);\n if (!repo) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Context-addressed singleton operation authorization requires a registered repository to prove uniqueness',\n resourceType: operation.resourceIdentifier,\n },\n },\n );\n }\n\n // Framework-internal uniqueness probe — resolve the singleton's id by\n // its parent FK to authorize a context-addressed READ/UPDATE/DELETE.\n // Use `listForInternalScan` (NOT the public `list`): context-addressed\n // singletons (e.g. `userProgressionState`, `userGuidanceState`) expose\n // only READ to users and declare no user-facing LIST operation. This is\n // framework machinery proving uniqueness, not a user collection read,\n // so it must list regardless of a declared LIST surface.\n const selector = { [candidate.foreignKeyField]: parentResourceId };\n const listResult = // `T` is pinned: the repository handle is schema-less here, so the strengthened\n // contract types rows as `unknown` rather than pretending to know them. This probe\n // only needs the persisted-id shape.\n await repo.listForInternalScan<Record<string, unknown>>(executionContext, selector, {\n ...options,\n paginated: false,\n });\n // The paginated-envelope unwrapping that used to live here is gone, not overlooked:\n // `paginated: false` selects the array overload, so the contract now states the shape\n // that the runtime always returned. The branch was unreachable and only looked\n // defensive because the call was cast to `any`.\n const matches = listResult;\n\n if (matches.length === 0) {\n // No singleton row exists yet for this parent scope.\n // READ: absence is NOT an authorization failure. Return undefined so the caller\n // authorizes the read by parent scope (`isContextAddressedSingletonReadAuthorizedByScope`)\n // and lets the operation layer materialize-or-404 — this is the seam the scoped\n // progression/guidance lazy-materialization POSTFIX hooks rely on. UPDATE/DELETE\n // cannot be addressed to a non-existent singleton, so they still fail closed.\n if (operationEffectiveIdentifier === CoreResourceOperation.READ) {\n return undefined;\n }\n throw this.errorBuilder.buildError(\n ErrorType.NOT_FOUND,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n operation: effectiveOperation,\n selector,\n resourceType: operation.resourceIdentifier,\n },\n },\n );\n }\n\n if (matches.length > 1) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Context-addressed singleton operation authorization matched multiple rows',\n resourceType: operation.resourceIdentifier,\n selector,\n matchCount: matches.length,\n },\n },\n );\n }\n\n const id = matches[0]?._id;\n if (typeof id === 'string') {\n return id;\n }\n if (id && typeof id === 'object' && 'toString' in id && typeof id.toString === 'function') {\n return id.toString();\n }\n\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Context-addressed singleton operation authorization resolved a row without _id',\n resourceType: operation.resourceIdentifier,\n selector,\n },\n },\n );\n }\n\n /**\n * True when `operation` is a context-addressed composition singleton (e.g.\n * `userProgressionState` addressed by `userId`) AND the owning parent scope is\n * present in the execution context — independent of whether the singleton row\n * exists yet.\n *\n * Used to authorize an id-less READ by parent scope when the row is absent: the\n * authorization probe returns undefined (no `_id` to resolve), so this predicate\n * lets the caller treat the read as a legitimate context-only read instead of\n * falling through to the explicit-id validation path. Mirrors the probe's own\n * parent-candidate filter (without the row lookup).\n */\n private hasContextAddressedSingletonParentScope(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n ): boolean {\n if (!operation.resourceRelationships) {\n return false;\n }\n\n return getContextAddressedCompositionSingletonRelationshipCandidates(operation.resourceRelationships)\n .some((candidate) => this.hasParentContextForRelationship(\n candidate.parentResourceType,\n candidate.foreignKeyField,\n executionContext,\n ));\n }\n\n private async resolveContextAddressedAssociationOperationAuthorizationId(\n effectiveOperation: string,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n options?: ServiceOptions,\n ): Promise<string | undefined> {\n const operationEffectiveIdentifier = operation.resourceOperationLike ?? operation.operationIdentifier;\n if (\n operationEffectiveIdentifier !== CoreResourceOperation.READ\n && operationEffectiveIdentifier !== CoreResourceOperation.UPDATE\n && operationEffectiveIdentifier !== CoreResourceOperation.DELETE\n ) {\n return undefined;\n }\n\n if (\n effectiveOperation !== CoreResourceOperation.READ\n && effectiveOperation !== CoreResourceOperation.UPDATE\n && effectiveOperation !== CoreResourceOperation.DELETE\n ) {\n return undefined;\n }\n\n if ('isBulkOperation' in operation && operation.isBulkOperation === true) {\n return undefined;\n }\n\n if (!operation.resourceRelationships) {\n return undefined;\n }\n\n const associationParentRelationships = (operation.resourceRelationships.parentRelationships ?? [])\n .filter((relationship) =>\n relationship.nature === RelationshipNature.ASSOCIATION\n && relationship.jointResourceType === operation.resourceIdentifier\n && relationship.resourceType2 === operation.resourceIdentifier\n && relationship.cardinality1 === ResourceRelationshipCardinality.ONE\n && relationship.cardinality2 === ResourceRelationshipCardinality.MANY\n );\n if (associationParentRelationships.length === 0) {\n return undefined;\n }\n\n if (associationParentRelationships.length !== 2) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization requires exactly two eligible parent relationships',\n resourceType: operation.resourceIdentifier,\n parentResourceTypes: associationParentRelationships.map((relationship) => relationship.resourceType1),\n },\n },\n );\n }\n\n const duplicatedParentResourceTypes = new Set(\n associationParentRelationships\n .map((relationship) => relationship.resourceType1)\n .filter((resourceType, _index, resourceTypes) =>\n resourceTypes.filter((candidate) => candidate === resourceType).length > 1\n )\n );\n const contextParents = associationParentRelationships\n .map((relationship) => {\n const foreignKeyField = this.resourcesRegistry.resolveForeignKeyField({\n resourceType1: relationship.resourceType1,\n foreignKeyField: relationship.foreignKeyField,\n });\n const parentResourceId = this.resolveAssociationParentContextResourceId(\n relationship.resourceType1,\n foreignKeyField,\n executionContext,\n { allowGenericParentContext: !duplicatedParentResourceTypes.has(relationship.resourceType1) },\n );\n return parentResourceId\n ? { relationship, foreignKeyField, parentResourceId }\n : undefined;\n })\n .filter((candidate): candidate is {\n relationship: ResourceRelationship;\n foreignKeyField: string;\n parentResourceId: string;\n } => candidate !== undefined);\n\n if (contextParents.length < 2) {\n return undefined;\n }\n\n const selector = Object.fromEntries(\n contextParents.map((candidate) => [candidate.foreignKeyField, candidate.parentResourceId])\n );\n if (Object.keys(selector).length !== contextParents.length) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization resolved duplicate foreign key fields',\n resourceType: operation.resourceIdentifier,\n foreignKeyFields: contextParents.map((candidate) => candidate.foreignKeyField),\n },\n },\n );\n }\n\n const repo = this.repositoriesRegistry.getRepository(operation.resourceIdentifier as ResourceType);\n // Framework-internal uniqueness probe — resolve the junction row's id by its\n // two parent FKs to authorize a context-addressed READ/UPDATE/DELETE. Use\n // `listForInternalScan` (NOT the public `list`), mirroring the singleton\n // authorization probe above and the service-side association target resolver:\n // an association junction resource may expose READ/UPDATE/DELETE without a\n // user-facing default LIST, so `repo.list()` would throw\n // `repository_resource_operation_failed` (\"no default LIST operation declared\",\n // INTERNAL/critical 500) here — at authorization, before the service resolver is\n // ever reached. `listForInternalScan` synthesizes a REPOSITORY_ONLY scan when no\n // LIST is declared and reuses the declared LIST (with hooks) otherwise. Unlike\n // singletons, an absent junction row stays a genuine NOT_FOUND for every verb\n // (no lazy materialization to defer to), so the 0-rows branch below is unchanged.\n if (!repo) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization requires a registered repository to prove uniqueness',\n resourceType: operation.resourceIdentifier,\n },\n },\n );\n }\n\n const listResult = // `T` is pinned: the repository handle is schema-less here, so the strengthened\n // contract types rows as `unknown` rather than pretending to know them. This probe\n // only needs the persisted-id shape.\n await repo.listForInternalScan<Record<string, unknown>>(executionContext, selector, {\n ...options,\n paginated: false,\n });\n // The paginated-envelope unwrapping that used to live here is gone, not overlooked:\n // `paginated: false` selects the array overload, so the contract now states the shape\n // that the runtime always returned. The branch was unreachable and only looked\n // defensive because the call was cast to `any`.\n const matches = listResult;\n\n if (matches.length === 0) {\n throw this.errorBuilder.buildError(\n ErrorType.NOT_FOUND,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n operation: effectiveOperation,\n selector,\n resourceType: operation.resourceIdentifier,\n },\n },\n );\n }\n\n if (matches.length > 1) {\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization matched multiple rows',\n resourceType: operation.resourceIdentifier,\n selector,\n matchCount: matches.length,\n },\n },\n );\n }\n\n const id = matches[0]?._id;\n if (typeof id === 'string') {\n return id;\n }\n if (id && typeof id === 'object' && 'toString' in id && typeof id.toString === 'function') {\n return id.toString();\n }\n\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Complete association-context operation authorization resolved a row without _id',\n resourceType: operation.resourceIdentifier,\n selector,\n },\n },\n );\n }\n\n private resolveContextAddressedSingletonMutationAuthorizationId(\n effectiveOperation: string,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n options?: ServiceOptions,\n ): Promise<string | undefined> {\n return this.resolveContextAddressedSingletonOperationAuthorizationId(\n effectiveOperation,\n operation,\n executionContext,\n options,\n );\n }\n\n private resolveContextAddressedAssociationMutationAuthorizationId(\n effectiveOperation: string,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<any>,\n options?: ServiceOptions,\n ): Promise<string | undefined> {\n return this.resolveContextAddressedAssociationOperationAuthorizationId(\n effectiveOperation,\n operation,\n executionContext,\n options,\n );\n }\n\n private hasParentContextForRelationship(\n parentResourceType: ResourceType,\n foreignKeyField: string,\n executionContext: ExecutionContext<any>\n ): boolean {\n if (executionContext.getContextResourceId(foreignKeyField)) {\n return true;\n }\n\n if (\n executionContext.getRelationshipContext(parentResourceType, foreignKeyField)\n ?? executionContext.getRelationshipContext(parentResourceType)\n ) {\n return true;\n }\n\n const parentConfig = this.resourcesRegistry.tryGetResourceConfiguration(parentResourceType);\n return !!parentConfig && !!executionContext.getContextResourceId(parentConfig.resourceFieldIdentifier);\n }\n\n private resolveParentContextResourceId(\n parentResourceType: ResourceType,\n foreignKeyField: string,\n executionContext: ExecutionContext<any>\n ): string | undefined {\n const byForeignKey = executionContext.getContextResourceId(foreignKeyField);\n if (byForeignKey) {\n return byForeignKey;\n }\n\n const relationshipContext = executionContext.getRelationshipContext(parentResourceType, foreignKeyField)\n ?? executionContext.getRelationshipContext(parentResourceType);\n if (relationshipContext?.resourceId) {\n return relationshipContext.resourceId;\n }\n\n const parentConfig = this.resourcesRegistry.tryGetResourceConfiguration(parentResourceType);\n return parentConfig\n ? executionContext.getContextResourceId(parentConfig.resourceFieldIdentifier)\n : undefined;\n }\n\n private resolveAssociationParentContextResourceId(\n parentResourceType: ResourceType,\n foreignKeyField: string,\n executionContext: ExecutionContext<any>,\n options?: { allowGenericParentContext?: boolean },\n ): string | undefined {\n const byForeignKey = executionContext.getContextResourceId(foreignKeyField);\n if (byForeignKey) {\n return byForeignKey;\n }\n\n const relationshipContext = executionContext.getRelationshipContext(parentResourceType, foreignKeyField);\n if (relationshipContext?.resourceId) {\n return relationshipContext.resourceId;\n }\n\n if (options?.allowGenericParentContext !== true) {\n return undefined;\n }\n\n const genericRelationshipContext = executionContext.getRelationshipContext(parentResourceType);\n if (genericRelationshipContext?.resourceId) {\n return genericRelationshipContext.resourceId;\n }\n\n const parentConfig = this.resourcesRegistry.tryGetResourceConfiguration(parentResourceType);\n return parentConfig\n ? executionContext.getContextResourceId(parentConfig.resourceFieldIdentifier)\n : undefined;\n }\n\n private stringifyPersistedValue(value: unknown): string | undefined {\n if (value === undefined || value === null) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n return value;\n }\n\n if (typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n\n if (typeof value === 'object' && 'toString' in value && typeof value.toString === 'function') {\n return value.toString();\n }\n\n return undefined;\n }\n\n private async ensureFileUploadTargetMatchesRouteContext(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n resourceId: string,\n executionContext: ExecutionContext<any>,\n options?: {\n requireRouteContext?: boolean;\n },\n ): Promise<void> {\n if (!operation.resourceRelationships) {\n return;\n }\n\n const repo = this.repositoriesRegistry.getRepository(operation.resourceIdentifier as ResourceType);\n if (!repo) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'File upload route-context verification requires a repository for the target resource',\n resourceType: operation.resourceIdentifier,\n resourceId,\n },\n });\n }\n\n const currentObject = await repo.read<Record<string, unknown>>(\n executionContext,\n resourceId,\n { excludeContextualFilter: true },\n );\n if (!currentObject || typeof currentObject !== 'object') {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n },\n });\n }\n\n const expectedSelectors: Record<string, string> = {};\n const compositionSingletonCandidates = getContextAddressedCompositionSingletonRelationshipCandidates(operation.resourceRelationships);\n for (const candidate of compositionSingletonCandidates) {\n const parentResourceId = this.resolveParentContextResourceId(\n candidate.parentResourceType,\n candidate.foreignKeyField,\n executionContext,\n );\n if (parentResourceId) {\n expectedSelectors[candidate.foreignKeyField] = parentResourceId;\n }\n }\n\n const associationParentRelationships = (operation.resourceRelationships.parentRelationships ?? [])\n .filter((relationship) =>\n relationship.nature === RelationshipNature.ASSOCIATION\n && relationship.jointResourceType === operation.resourceIdentifier\n && relationship.resourceType2 === operation.resourceIdentifier\n && relationship.cardinality1 === ResourceRelationshipCardinality.ONE\n && relationship.cardinality2 === ResourceRelationshipCardinality.MANY\n );\n const duplicatedParentResourceTypes = new Set(\n associationParentRelationships\n .map((relationship) => relationship.resourceType1)\n .filter((resourceType, _index, resourceTypes) =>\n resourceTypes.filter((candidate) => candidate === resourceType).length > 1\n )\n );\n let resolvedAssociationContextCount = 0;\n\n for (const relationship of associationParentRelationships) {\n const foreignKeyField = this.resourcesRegistry.resolveForeignKeyField({\n resourceType1: relationship.resourceType1,\n foreignKeyField: relationship.foreignKeyField,\n });\n const parentResourceId = this.resolveAssociationParentContextResourceId(\n relationship.resourceType1,\n foreignKeyField,\n executionContext,\n { allowGenericParentContext: !duplicatedParentResourceTypes.has(relationship.resourceType1) },\n );\n if (parentResourceId) {\n resolvedAssociationContextCount += 1;\n expectedSelectors[foreignKeyField] = parentResourceId;\n }\n }\n\n if (\n associationParentRelationships.length > 0\n && associationParentRelationships.length !== 2\n && resolvedAssociationContextCount > 0\n ) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n malformedAssociationContext: true,\n parentResourceTypes: associationParentRelationships.map((relationship) => relationship.resourceType1),\n resolvedAssociationContextCount,\n },\n });\n }\n\n if (\n associationParentRelationships.length === 2\n && resolvedAssociationContextCount > 0\n && resolvedAssociationContextCount < 2\n ) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n partialAssociationContext: true,\n resolvedAssociationContextCount,\n },\n });\n }\n\n if (\n Object.keys(expectedSelectors).length === 0\n && (compositionSingletonCandidates.length > 0 || associationParentRelationships.length > 0)\n ) {\n if (!options?.requireRouteContext) {\n return;\n }\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n missingRouteContext: true,\n },\n });\n }\n\n for (const [foreignKeyField, expectedValue] of Object.entries(expectedSelectors)) {\n const actualValue = this.stringifyPersistedValue((currentObject as Record<string, unknown>)[foreignKeyField]);\n if (actualValue !== expectedValue) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n resourceType: operation.resourceIdentifier,\n resourceId,\n foreignKeyField,\n missingForeignKey: actualValue === undefined,\n },\n });\n }\n }\n }\n\n // ================================\n // Initialization\n // ================================\n\n static createInstance<\n TCustomOperationEnum extends EnumLikeType | undefined = undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,\n TMainSchema extends z.ZodTypeAny = z.ZodTypeAny\n >(\n resourceType: ResourceType,\n logger: LoggerService,\n errorBuilder: ErrorBuilderBackendService,\n errorHandler: ErrorHandlerService,\n jwtService: JwtBackendService,\n authorizationsService: AuthorizationsBackendService,\n resourcesRegistry: ResourcesRegistryBackendService,\n executionContextCreator: ExecutionContextCreatorBackendService,\n executionContextHandler: ExecutionContextHandlerBackendService,\n repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n resourceOperationHelper: ResourceOperationHelperBackendService,\n servicesRegistry: ServicesRegistryHandlerBackendService,\n fileFieldDetection: FileFieldDetectionBackendService,\n fileUploadHandler: ResourceFileUploadHandlerBackendService,\n auditLogsService: AuditLogsBackendService,\n anonymousSessionService: AnonymousSessionBackendService,\n appConfigService: AppConfigurationService,\n rateLimitService: RateLimitBackendService,\n fileUploadGrantService: FileUploadGrantBackendService,\n ): ControllerResourceBackendService<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n return new ControllerResourceBackendService(\n resourceType, logger, errorBuilder, errorHandler,\n jwtService, authorizationsService, resourcesRegistry, executionContextCreator, executionContextHandler,\n repositoriesRegistry, resourceOperationHelper, servicesRegistry,\n fileFieldDetection, fileUploadHandler, auditLogsService, anonymousSessionService, appConfigService,\n rateLimitService, fileUploadGrantService);\n }\n\n\n private initializeOperationsMap(): void {\n if (!this.resourceConfiguration.operations) {\n return;\n }\n\n // Only include URL-bearing operations\n const apiCallOperations = this.resourceConfiguration.operations.filter(\n (op): op is ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> =>\n [ResourceOperationVariantType.API_CALL, ResourceOperationVariantType.API_CALL_WITH_CALLBACK].includes(op.variantType)\n );\n\n apiCallOperations.forEach(operation => {\n const operationKey = ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation);\n this.operationsMap.set(operationKey, operation);\n });\n\n this.logDebug('Operations map initialized', { totalOperations: this.resourceConfiguration.operations.length, apiCallOperations: apiCallOperations.length });\n }\n\n\n private initializeRoutes(): void {\n this.logDebug('Initializing Express routes');\n\n // Collect every operation route first, then register in\n // literal-over-parameter order. Express matches in registration order, so\n // registering as we iterate would let `/:id`-style READ routes swallow\n // literal sibling segments (`/search`, `/count`, variant suffixes) of\n // operations that happen to come later in the operations map. See\n // compareExpressRoutePathSpecificity for the ordering contract.\n const routeDescriptors: OperationRouteDescriptor[] = [];\n this.operationsMap.forEach((operation) => {\n routeDescriptors.push(...this.collectRouteDescriptorsForOperation(operation));\n });\n\n routeDescriptors.sort((a, b) => compareExpressRoutePathSpecificity(a.expressPath, b.expressPath));\n\n for (const descriptor of routeDescriptors) {\n this.registerRouteDescriptor(descriptor);\n }\n\n // Initialize file upload routes for resources with file fields\n this.initializeFileUploadRoutes();\n\n // Initialize file SERVE (GET) routes — inline byte streaming, authz inherited\n // from the parent resource's READ (the read counterpart to upload).\n this.initializeFileServeRoutes();\n\n // Initialize validate-field routes for resources with unique fields\n this.initializeValidateFieldRoutes();\n\n this.router.use(this.errorHandler.expressErrorHandler());\n\n this.logDebug('Express routes initialized with unified error handler', {\n routeCount: this.operationsMap.size\n });\n }\n\n /**\n * Initialize file SERVE (GET) routes for resources with file fields.\n *\n * The read counterpart to `initializeFileUploadRoutes`. For every file field ×\n * every parent URL combination, registers:\n * `GET /api/v1/.../{resourceType}/:resourceId/files/:fieldName/:fileId`\n *\n * ── SECURITY MODEL (defense-in-depth — do NOT weaken any layer) ──────────────\n * A byte-serving route is an IDOR-prone surface; access is restricted by THREE\n * independent checks, so a caller only ever gets a file they may legitimately see:\n *\n * 1. PARENT-RESOURCE READ AUTHORIZATION (access inheritance) — this handler.\n * Builds the READ execution context from the request and calls\n * `authorizeInController(resourceId, …)`: the EXACT gate as reading the record.\n * ⇒ you cannot serve from a resource you're not allowed to READ.\n * 2. LINK-OWNERSHIP BINDING (the IDOR guard) — `handleFileServe`.\n * The path `:fileId` MUST be the file linked to THIS resource + field\n * (`linkedResourceType/Id/FieldName`); mismatch → fail-closed NOT_FOUND (no\n * existence disclosure). ⇒ you cannot swap a victim's fileId into your own\n * record's serve URL.\n * 3. FILE-SCOPE ACCESS CHECK (belt-and-braces) — `getFile → authorizeFileAccess`.\n * Re-verifies the file's own scope (USER_SELF owner / org / app tenant).\n *\n * The bytes are then streamed by `FilesBackendService.streamFileToResponse`, which\n * applies the untrusted-content response hardening (`nosniff` + file-serve CSP +\n * inline→attachment downgrade for script-capable types).\n *\n * Distinct from the global `/files/:fileId` route, which serves direct / consumable-\n * token / public-share access for OTHER purposes and is NOT resource-scoped.\n */\n private initializeFileServeRoutes(): void {\n const resourceType = this.resourceConfiguration.resourceIdentifier;\n\n // EVERY file field, GENERATED ONES INCLUDED — deliberately not `getUploadableFileFields()`.\n //\n // That narrower helper exists so a template-generated field gets no UPLOAD endpoint, which is\n // correct and is why `initializeFileUploadRoutes` still uses it. Serving is the opposite\n // concern: a generated file is precisely a file the caller may READ and never WRITE, it stays\n // in the read DTO by design, and the frontend builds a serve URL for it like any other\n // (`ResourceAutomaticDisplayer` collects file field paths from the DISPLAY schema). Registering\n // serve routes from the upload-shaped set left generated files reachable by NO route at all:\n // proven over HTTP on 2026-08-25, where this path answered Express's own `Route not found`\n // while the identical route on an uploaded field answered a structured error.\n //\n // Every security layer named in this method's docstring applies unchanged — the parent READ\n // authorization, the link-ownership binding in `handleFileServe`, and the file-scope check —\n // and a generated file carries the same `linkedResourceType/Id/FieldName` binding an uploaded\n // one does, so layer 2 is as strong here as there.\n const fileFields = this.fileFieldDetection.detectFileFields(resourceType);\n if (fileFields.length === 0) {\n this.logDebug('No file fields detected, skipping file serve routes', { resourceType });\n return;\n }\n\n const readOperation = findDefaultUrlBearingOperation(\n this.resourceConfiguration.operations,\n CoreResourceOperation.READ,\n {\n resourceType,\n errorBuilder: this.errorBuilder,\n logDebug: this.logDebug,\n },\n );\n\n if (!readOperation) {\n this.logDebug('READ operation not found or not API_CALL, skipping file serve routes', { resourceType });\n return;\n }\n\n const readInitiatorInfos = readOperation.initiatorInfos || [];\n if (readInitiatorInfos.length === 0) {\n this.logDebug('READ operation has no initiatorInfos, skipping file serve routes', { resourceType });\n return;\n }\n\n for (const fileField of fileFields) {\n const { fieldName } = fileField;\n\n // Register more specific routes first (more parent params = more specific).\n const sortedInfos = [...readInitiatorInfos].sort((a, b) => {\n const aParams = a.parameters?.length || 0;\n const bParams = b.parameters?.length || 0;\n return bParams - aParams;\n });\n\n for (const initiatorInfo of sortedInfos) {\n const fileServeInfo = ResourcesConfigOperationsUrlsBuilderUtils.buildFileServeRouteForOperation({\n operationRouteUrl: initiatorInfo.url,\n operationParameters: initiatorInfo.parameters || [],\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier,\n fieldName,\n isFrontend: false,\n });\n const servePath = this.convertUrlPatternToExpressPath(fileServeInfo.url);\n\n this.router.get(\n servePath,\n this.asyncHandler(async (req: Request, res: Response, next: NextFunction) => {\n // Build the READ execution context for the parent resource, then authorize\n // exactly as a READ of that record (access inheritance).\n let executionContext = await this.executionContextCreator.createExecutionContextFromRequest(\n req,\n readOperation,\n {\n url: fileServeInfo.url,\n parameters: fileServeInfo.parameters,\n },\n );\n executionContext = this.resolveExecutionContextForAuthorization(executionContext, req).executionContext;\n\n const resourceId = req.params[this.resourceConfiguration.resourceFieldIdentifier] as string;\n const fileId = req.params.fileId as string;\n\n await this.authorizationsService.authorizeInController(resourceId, executionContext);\n\n await this.fileUploadHandler.handleFileServe(\n req,\n res,\n next,\n resourceType,\n fieldName,\n resourceId,\n fileId,\n executionContext,\n );\n }),\n );\n this.logDebug('Registered file serve route', { resourceType, fieldName, path: servePath });\n }\n }\n }\n\n /**\n * Initialize file upload routes for resources with file fields.\n * Creates routes:\n * - POST /api/v1/.../resourceType/files/:fieldName (CREATE)\n * - POST /api/v1/.../resourceType/:resourceId/files/:fieldName (UPDATE)\n */\n /**\n * L12 Audit (Phase I):\n * - Authorization: registered upload routes now build the execution context and\n * perform `authorizeInController()` before Multer and before the async upload\n * handler runs, so unauthorized requests are rejected before temp-disk writes,\n * storage upload, or DB write.\n * - Parent resource params: `initiatorInfo.parameters` is correctly passed to the execution context\n * creator, ensuring parent resource FK authorization matches non-file routes.\n * - Multer errors: Request-body parsing failures still flow through the unified\n * error handler, and request-size violations are classified as validation\n * errors rather than generic internal failures.\n * - Route order: the controller-specific authorization middleware runs before\n * Multer for registered upload routes, so unauthenticated callers are\n * rejected before temp-disk parsing starts. Multer still runs before the\n * async upload handler itself, which is why file-type/size failures surface\n * as middleware-layer errors rather than handler exceptions.\n */\n private initializeFileUploadRoutes(): void {\n const resourceType = this.resourceConfiguration.resourceIdentifier;\n\n const fileFields = this.fileFieldDetection.getUploadableFileFields(resourceType);\n if (fileFields.length === 0) {\n this.logDebug('No uploadable file fields detected, skipping file upload routes', { resourceType });\n return;\n }\n\n // Use the canonical non-bulk default URL-bearing operations for route wiring.\n // File upload routes are security-sensitive because they authorize before\n // Multer writes temp files; selecting by array order can bind the wrong\n // parent URL/roles when plain API and callback API variants coexist.\n const createOperation = findDefaultUrlBearingOperation(\n this.resourceConfiguration.operations,\n CoreResourceOperation.CREATE,\n {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n errorBuilder: this.errorBuilder,\n logDebug: this.logDebug,\n },\n );\n const updateOperation = findDefaultUrlBearingOperation(\n this.resourceConfiguration.operations,\n CoreResourceOperation.UPDATE,\n {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n errorBuilder: this.errorBuilder,\n logDebug: this.logDebug,\n },\n );\n\n if (!createOperation || !updateOperation) {\n this.logDebug('CREATE or UPDATE operation not found or not API_CALL type, skipping file upload routes', { resourceType });\n return;\n }\n\n // Get initiatorInfos (already populated with all parent combinations)\n // Each initiatorInfo contains:\n // - url: URL pattern with parent paths (e.g., /api/v1/parents/{parentId}/children)\n // - parameters: Parent resource parameters to extract (e.g., [{ fieldIdentifier: 'parentId', resourceType: 'PARENTS' }])\n const createInitiatorInfos = createOperation.initiatorInfos || [];\n const updateInitiatorInfos = updateOperation.initiatorInfos || [];\n\n if (createInitiatorInfos.length === 0 || updateInitiatorInfos.length === 0) {\n this.logDebug('CREATE or UPDATE operation has no initiatorInfos, skipping file upload routes', { resourceType });\n return;\n }\n\n // Configure Multer middleware with disk storage for true streaming (no memory buffering)\n // Files are written to temp directory, then streamed to storage\n // This enables true streaming for large files without OOM risk\n // NOTE: In k8s, ensure pod has volume mount with read-write access to temp directory\n // NOTE: Consider temp file cleanup job for orphaned files (if process crashes)\n const upload = createMulterUploadConfig({\n logger: this.logger,\n maxFileSize: resolveConfiguredMaxFileSize(this.appConfigService.config.storage?.maxFileSize),\n });\n\n // Register routes for each file field and each parent combination\n // CRITICAL SECURITY FIX: Use initiatorInfos to include parent resource context in routes\n // This ensures parent resource authorization is properly validated\n for (const fileField of fileFields) {\n const { fieldName } = fileField;\n\n // CREATE routes (one per parent combination)\n // Register more specific routes first (with parent paths) for correct Express matching\n // Sort by parameter count (more parameters = more specific route)\n const sortedCreateInfos = [...createInitiatorInfos].sort((a, b) => {\n const aParams = a.parameters?.length || 0;\n const bParams = b.parameters?.length || 0;\n return bParams - aParams; // Descending order (more specific first)\n });\n\n for (const initiatorInfo of sortedCreateInfos) {\n const fileUploadInitiatorInfo = ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation({\n operationRouteUrl: initiatorInfo.url,\n operationParameters: initiatorInfo.parameters || [],\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier,\n fieldName,\n requiresTargetResourceId: false,\n isFrontend: false,\n });\n const createPath = this.convertUrlPatternToExpressPath(fileUploadInitiatorInfo.url);\n const authorizeCreateUpload = this.createFileUploadAuthorizationMiddleware(\n createOperation,\n fileUploadInitiatorInfo,\n {\n requiresTargetResourceId: false,\n resourceType,\n fieldName,\n grantOperation: CoreResourceOperation.CREATE,\n },\n );\n\n this.router.post(\n createPath,\n authorizeCreateUpload,\n upload.single('file'), // Multer middleware - expects 'file' field name\n this.asyncHandler(async (req: Request, res: Response, next: NextFunction) => {\n try {\n const executionContext = (res.locals as FileUploadRouteLocals).fileUploadExecutionContext\n ?? await this.executionContextCreator.createExecutionContextFromRequest(\n req,\n FileUploadGrantBackendService.withUploadGrantAcceptance(createOperation),\n {\n url: fileUploadInitiatorInfo.url,\n parameters: fileUploadInitiatorInfo.parameters,\n }\n );\n\n await this.fileUploadHandler.handleFileUpload(\n req,\n res,\n resourceType,\n fieldName,\n undefined, // No resourceId for CREATE\n CoreResourceOperation.CREATE,\n executionContext\n );\n } catch (error) {\n next(error);\n }\n })\n );\n\n this.logDebug('File upload CREATE route registered', {\n resourceType,\n fieldName,\n path: createPath,\n parentParams: fileUploadInitiatorInfo.parameters.map(p => `${p.fieldIdentifier}:${p.resourceType}`).join(', ') || 'none',\n });\n\n // Mint door (issue #312, D3): a SIBLING of the upload route, behind the SAME authorization\n // middleware, so mint-authority ≡ upload-authority by construction.\n this.router.post(\n `${createPath}/grant`,\n authorizeCreateUpload,\n this.asyncHandler(this.buildFileUploadGrantMintHandler({ resourceType, fieldName, operation: CoreResourceOperation.CREATE })),\n );\n }\n\n // UPDATE routes (one per parent combination)\n // Register more specific routes first (with parent paths) for correct Express matching\n const sortedUpdateInfos = [...updateInitiatorInfos].sort((a, b) => {\n const aParams = a.parameters?.length || 0;\n const bParams = b.parameters?.length || 0;\n return bParams - aParams; // Descending order (more specific first)\n });\n\n const registerUpdateUploadRoute = (\n fileUploadInitiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo,\n options: { requiresTargetResourceId: boolean; allowContextAddressedTarget: boolean },\n ): void => {\n const updatePath = this.convertUrlPatternToExpressPath(fileUploadInitiatorInfo.url);\n const authorizeUpdateUpload = this.createFileUploadAuthorizationMiddleware(\n updateOperation,\n fileUploadInitiatorInfo,\n {\n requiresTargetResourceId: options.requiresTargetResourceId,\n allowContextAddressedTarget: options.allowContextAddressedTarget,\n resourceType,\n fieldName,\n grantOperation: CoreResourceOperation.UPDATE,\n },\n );\n\n this.router.post(\n updatePath,\n authorizeUpdateUpload,\n upload.single('file'), // Multer middleware\n this.asyncHandler(async (req: Request, res: Response, next: NextFunction) => {\n try {\n const locals = (res.locals as FileUploadRouteLocals);\n const resourceId = locals.fileUploadResolvedResourceId\n ?? req.params[this.resourceConfiguration.resourceFieldIdentifier] as string | undefined;\n\n if (!resourceId) {\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n {} as ExecutionContext<any>,\n {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n // diagnostic (log-only)\n resourceType,\n fieldName,\n },\n }\n );\n }\n\n const executionContext = locals.fileUploadExecutionContext\n ?? await this.executionContextCreator.createExecutionContextFromRequest(\n req,\n FileUploadGrantBackendService.withUploadGrantAcceptance(updateOperation),\n {\n url: fileUploadInitiatorInfo.url,\n parameters: fileUploadInitiatorInfo.parameters,\n }\n );\n\n await this.fileUploadHandler.handleFileUpload(\n req,\n res,\n resourceType,\n fieldName,\n resourceId,\n CoreResourceOperation.UPDATE,\n executionContext\n );\n } catch (error) {\n next(error);\n }\n })\n );\n\n this.router.post(\n `${updatePath}/grant`,\n authorizeUpdateUpload,\n this.asyncHandler(this.buildFileUploadGrantMintHandler({ resourceType, fieldName, operation: CoreResourceOperation.UPDATE })),\n );\n\n this.logDebug('File upload UPDATE route registered', {\n resourceType,\n fieldName,\n path: updatePath,\n contextAddressedTarget: options.allowContextAddressedTarget,\n parentParams: fileUploadInitiatorInfo.parameters.map(p => `${p.fieldIdentifier}:${p.resourceType}`).join(', ') || 'none',\n });\n };\n\n for (const initiatorInfo of sortedUpdateInfos) {\n const fileUploadInitiatorInfo = ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation({\n operationRouteUrl: initiatorInfo.url,\n operationParameters: initiatorInfo.parameters || [],\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier,\n fieldName,\n requiresTargetResourceId: true,\n isFrontend: false,\n });\n registerUpdateUploadRoute(fileUploadInitiatorInfo, {\n requiresTargetResourceId: true,\n allowContextAddressedTarget: false,\n });\n\n const operationParameters = initiatorInfo.parameters || [];\n const hasTargetResourceIdParameter = operationParameters.some(\n (parameter) => parameter.fieldIdentifier === this.resourceConfiguration.resourceFieldIdentifier,\n );\n if (!hasTargetResourceIdParameter) {\n const contextAddressedFileUploadInitiatorInfo = ResourcesConfigOperationsUrlsBuilderUtils.buildFileUploadRouteForOperation({\n operationRouteUrl: initiatorInfo.url,\n operationParameters,\n targetResourceType: resourceType,\n targetResourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier,\n fieldName,\n requiresTargetResourceId: false,\n isFrontend: false,\n });\n registerUpdateUploadRoute(contextAddressedFileUploadInitiatorInfo, {\n requiresTargetResourceId: false,\n allowContextAddressedTarget: true,\n });\n }\n }\n }\n\n this.logDebug('File upload routes initialized', {\n resourceType,\n fileFieldCount: fileFields.length,\n createRoutes: createInitiatorInfos.length * fileFields.length,\n updateRoutes: updateInitiatorInfos.length * fileFields.length,\n });\n }\n\n /**\n * Authorize file uploads before Multer touches request bodies.\n *\n * Resource upload routes are intentionally protected at the same semantic\n * execution-context layer as the actual upload handler. Running that auth step\n * first avoids unauthenticated callers forcing temp-disk writes through Multer\n * while still reusing the exact same execution context for the later upload.\n */\n /**\n * The handler behind `POST …/files/<field>/grant` (issue #312, D3). Runs AFTER the upload route's\n * own authorization middleware, so by the time it executes the caller has been authorized on the\n * target write exactly as an upload would be. It computes the two absolute URLs the grant needs from\n * the request itself — the upload URL is this request's URL minus `/grant`, so it cannot drift from\n * the route that was just authorized — and delegates the mint to the ONE function the MCP door also\n * calls. Answers 201 with the grant; the token appears in it because it is the credential.\n */\n private buildFileUploadGrantMintHandler(target: { resourceType: ResourceType; fieldName: string; operation: FileUploadGrantOperation }) {\n return async (req: Request, res: Response, next: NextFunction): Promise<void> => {\n try {\n const locals = res.locals as FileUploadRouteLocals;\n const executionContext = locals.fileUploadExecutionContext;\n if (!executionContext) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, {} as ExecutionContext<any>, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: { message: 'Upload grant mint reached without an authorized context' },\n });\n }\n\n const resourceId = target.operation === CoreResourceOperation.UPDATE\n ? (locals.fileUploadResolvedResourceId ?? req.params[this.resourceConfiguration.resourceFieldIdentifier] as string | undefined)\n : undefined;\n\n const parsedBody = FileUploadGrantMintRequestSchema.safeParse(req.body ?? {});\n if (!parsedBody.success) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { errors: parsedBody.error.issues.map((issue) => ({ path: issue.path.join('.'), message: issue.message })) },\n });\n }\n\n // The API's own public origin comes from configuration, never from request headers — a\n // Host header is client-controlled and a grant URL built from it would point wherever the\n // caller said.\n const apiPublicUrl = this.appConfigService.config.runtime?.endPoints?.[BackendApiType.MAIN_BACKEND_API]?.publicUrl;\n if (!apiPublicUrl) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: { message: `runtime.endPoints.${BackendApiType.MAIN_BACKEND_API}.publicUrl is required to mint a file upload grant` },\n });\n }\n const origin = apiPublicUrl.replace(/\\/+$/, '');\n const requestPath = (req.originalUrl.split('?')[0] ?? '').replace(/\\/grant\\/?$/, '');\n const uploadUrl = `${origin}${requestPath}`;\n const apiBaseUrl = `${origin}${req.baseUrl || MAIN_API_BASE_PATH}`;\n\n const grant = await this.fileUploadGrantService.mint({\n executionContext,\n target: { ...target, resourceId },\n expiresInMinutes: parsedBody.data.expiresInMinutes,\n declared: { name: parsedBody.data.name, mimeType: parsedBody.data.mimeType, size: parsedBody.data.size },\n uploadUrl,\n apiBaseUrl,\n requestProvenance: {\n ipAddress: getClientIpFromRequest(req),\n userAgent: typeof req.headers['user-agent'] === 'string' ? req.headers['user-agent'] : undefined,\n },\n });\n res.status(201).json(grant);\n } catch (error) {\n next(error);\n }\n };\n }\n\n private createFileUploadAuthorizationMiddleware(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n fileUploadInitiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo,\n options: {\n requiresTargetResourceId: boolean;\n allowContextAddressedTarget?: boolean;\n resourceType: ResourceType;\n fieldName: string;\n /** Which write the route serves — the operation kind a grant must have been minted for. */\n grantOperation: FileUploadGrantOperation;\n },\n ) {\n // The upload routes — and ONLY the upload routes — accept a file upload GRANT as an ALTERNATIVE\n // credential (issue #312, D4). The authored operation is left untouched, so the JSON CREATE/UPDATE\n // routes refuse the same token (GATE 1, `CONSUMABLE_TOKEN_NOT_ACCEPTED_FOR_OPERATION`).\n const acceptingOperation = FileUploadGrantBackendService.withUploadGrantAcceptance(operation);\n return this.asyncHandler(async (req: Request, res: Response, next: NextFunction) => {\n try {\n let executionContext = await this.executionContextCreator.createExecutionContextFromRequest(\n req,\n acceptingOperation,\n {\n url: fileUploadInitiatorInfo.url,\n parameters: fileUploadInitiatorInfo.parameters,\n }\n );\n executionContext = this.resolveExecutionContextForAuthorization(executionContext, req).executionContext;\n (req as any).executionContext = executionContext;\n const locals = ((res.locals ??= {}) as FileUploadRouteLocals);\n locals.fileUploadExecutionContext = executionContext;\n\n let resourceId = options.requiresTargetResourceId\n ? req.params[this.resourceConfiguration.resourceFieldIdentifier] as string | undefined\n : undefined;\n\n if (!resourceId && options.allowContextAddressedTarget) {\n const resolvedResourceId = await this.resolveContextAddressedSingletonOperationAuthorizationId(\n CoreResourceOperation.UPDATE,\n operation,\n executionContext,\n ) ?? await this.resolveContextAddressedAssociationOperationAuthorizationId(\n CoreResourceOperation.UPDATE,\n operation,\n executionContext,\n );\n if (resolvedResourceId) {\n resourceId = resolvedResourceId;\n locals.fileUploadResolvedResourceId = resolvedResourceId;\n req.params[this.resourceConfiguration.resourceFieldIdentifier] = resolvedResourceId;\n }\n }\n\n if ((options.requiresTargetResourceId || options.allowContextAddressedTarget) && !resourceId) {\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n executionContext,\n {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n message: 'Resource ID is required for UPDATE file upload',\n resourceType: options.resourceType,\n fieldName: options.fieldName,\n },\n }\n );\n }\n\n // A grant is bound to ONE (resource, field, operation kind, row) AND to ONE concrete route.\n // Checked BEFORE the authorizer so a grant minted for another field never even reaches a role\n // check on this one; a non-grant context passes through untouched. Mirrors `validateFileToken`\n // on the download twin.\n //\n // `req.originalUrl` is the raw request target as received — the SAME thing the mint recorded\n // (`origin + req.originalUrl` minus the query and the `/grant` suffix), so the two sides of the\n // comparison are produced by one recipe and cannot drift. It is passed raw, query included:\n // the service owns the normalisation, so there is nowhere else for a caller to get it wrong.\n // This middleware also fronts the `/grant` mint route, whose path carries that extra segment —\n // a grant presented there therefore mismatches, which is the intended answer.\n const grant = await this.fileUploadGrantService.assertGrantMatchesRoute(executionContext, {\n resourceType: options.resourceType,\n fieldName: options.fieldName,\n operation: options.grantOperation,\n resourceId,\n }, req.originalUrl);\n if (grant) {\n locals.fileUploadGrant = grant;\n }\n\n await this.authorizationsService.authorizeInController(resourceId, executionContext);\n if (resourceId) {\n await this.ensureFileUploadTargetMatchesRouteContext(\n operation,\n resourceId,\n executionContext,\n { requireRouteContext: options.allowContextAddressedTarget },\n );\n }\n next();\n } catch (error) {\n next(error);\n }\n });\n }\n\n /**\n * Initialize validate-field routes for resources with unique fields.\n * Delegates to the validate-field handler module.\n *\n * Creates route: POST /api/v1/.../:resourceType/validate-field\n * Authorization uses CREATE operation rights (collection-level).\n */\n private initializeValidateFieldRoutes(): void {\n initializeValidateFieldRoutes(\n this.router,\n this.resourceConfiguration,\n this.logger,\n this.errorBuilder,\n this.authorizationsService,\n this.executionContextCreator,\n this.resourcesRegistry,\n this.repositoriesRegistry,\n this.convertUrlPatternToExpressPath.bind(this),\n this.asyncHandler.bind(this),\n );\n }\n\n /**\n * Async handler wrapper for Express route handlers.\n * Ensures errors are properly passed to Express error handler.\n */\n private asyncHandler(fn: (req: Request, res: Response, next: NextFunction) => Promise<void>) {\n return (req: Request, res: Response, next: NextFunction) => {\n Promise.resolve(fn(req, res, next)).catch(next);\n };\n }\n\n\n /**\n * Build the route descriptors (path + method + handler) for one operation.\n * Registration is deliberately NOT performed here — `initializeRoutes`\n * collects descriptors across all operations and registers them sorted by\n * `compareExpressRoutePathSpecificity`, so literal segments always win over\n * parameterized siblings regardless of operations-map iteration order.\n */\n private collectRouteDescriptorsForOperation(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>\n ): OperationRouteDescriptor[] {\n\n if (![ResourceOperationVariantType.API_CALL, ResourceOperationVariantType.API_CALL_WITH_CALLBACK].includes(operation.variantType)) {\n this.logDebug('Operation is not API_CALL or API_CALL_WITH_CALLBACK type, skipping route creation', { operation: operation.operationIdentifier, variantType: operation.variantType});\n return [];\n }\n\n const apiCallOperation = operation as ResourceConfiguration_Operation_ApiCall<any, any, any> | ResourceConfiguration_Operation_ApiCallWithCallback<any, any, any>;\n const operationInitiatorInfos = apiCallOperation.initiatorInfos;\n\n if (!operationInitiatorInfos || operationInitiatorInfos.length === 0) {\n this.logDebug('No URLs found for operation, skipping route creation', {operation: operation.operationIdentifier });\n return [];\n }\n\n const httpMethod = this.getHttpMethodForOperation(operation);\n\n return operationInitiatorInfos.map((initiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo) => {\n const expressPath = this.convertUrlPatternToExpressPath(initiatorInfo.url);\n\n this.logDebug('Creating route', {\n method: httpMethod,\n path: expressPath,\n operation: operation.operationIdentifier,\n parameters: initiatorInfo.parameters?.map((p: ResourceConfiguration_Operation_UrlParameterInfo) => `${p.fieldIdentifier}:${p.resourceType}`).join(', ') || 'none',\n callbackUrl: (initiatorInfo as any)['urlCallback'] ?? 'none'\n });\n\n const handler = async (req: Request, res: Response, next: NextFunction): Promise<void> => {\n try {\n await this.doOperation(operation, initiatorInfo, httpMethod, req, res, next);\n } catch (error) {\n next(error);\n }\n };\n\n return {\n expressPath,\n httpMethod,\n handler,\n };\n });\n }\n\n private registerRouteDescriptor(descriptor: OperationRouteDescriptor): void {\n const { expressPath, httpMethod, handler } = descriptor;\n\n switch (httpMethod) {\n case HttpMethod.GET:\n this.router.get(expressPath, handler);\n break;\n case HttpMethod.POST:\n this.router.post(expressPath, handler);\n break;\n case HttpMethod.PUT:\n this.router.put(expressPath, handler);\n break;\n case HttpMethod.DELETE:\n this.router.delete(expressPath, handler);\n break;\n case HttpMethod.PATCH:\n this.router.patch(expressPath, handler);\n break;\n default:\n this.logDebug('Unsupported HTTP method', { method: httpMethod });\n return;\n }\n }\n\n private convertUrlPatternToExpressPath(urlPattern: string): string {\n // Remove /api/v1 prefix to avoid double mounting (HTTP server already mounts master router at /api/v1)\n let path = urlPattern.replace(/^\\/api\\/v1/, '');\n\n // Ensure path starts with / if it's not empty\n if (path && !path.startsWith('/')) {\n path = '/' + path;\n }\n\n // Convert {param} to :param for Express\n return path.replace(/\\{([^}]+)\\}/g, ':$1');\n }\n\n // ================================\n // Execution\n // ================================\n\n private async doOperation(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n initiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo,\n httpMethod: HttpMethod,\n req: Request,\n res: Response,\n next: NextFunction\n ): Promise<void> {\n let executionContext: ExecutionContext<any> | undefined;\n let validatedData: unknown;\n let dataMode: DataMode | undefined;\n let optionsWithVersion: ServiceOptions | undefined;\n let contextAddressedOperationAuthorizationId: string | undefined;\n\n try {\n this.logDebug('Executing operation', { operation: operation.operationIdentifier, method: req.method, path: req.path });\n\n // Pre-flight rate-limit check (system 3, K-3 / Step 2 of the\n // rate-limit unification plan). Runs BEFORE execution-context\n // creation, request-data validation, and authorization so a flood\n // never reaches the heavier downstream work. Early-returns with zero\n // Redis traffic when the variant declares no `rateLimit?` policy\n // (the common case until per-endpoint policies are adopted). At this\n // seam the authenticated identity is unknown by construction, so the\n // client identifier is the IP (C-2). The global HTTP limiter\n // (`http-server.backend.service.ts:setupRateLimit`) remains the\n // safety net for endpoints with no per-endpoint policy.\n await this.rateLimitService.checkPolicyForVariant(req, res, operation);\n\n executionContext = await this.executionContextCreator.createExecutionContextFromRequest(req, operation, initiatorInfo);\n const resolvedContext = this.resolveExecutionContextForAuthorization(executionContext, req);\n executionContext = resolvedContext.executionContext;\n dataMode = resolvedContext.dataMode;\n // Attach executionContext to request for error handler access\n (req as any).executionContext = executionContext;\n validatedData = this.validateRequestData(\n req,\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext as ExecutionContext<ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>>,\n );\n\n // Collection operations (LIST, CREATE, SEARCH) don't have a target resource ID\n // They operate on collections and authorization is based on roles + parent scope\n const operationId = executionContext.operation.operationIdentifier;\n const operationLike = executionContext.operation.resourceOperationLike;\n const effectiveOperation = operationLike || operationId;\n const isCollectionOperation = shouldAuthorizeCollectionOperation(\n String(effectiveOperation),\n );\n\n if (isCollectionOperation) {\n // For collection operations: authorize without specific resource ID\n // Authorization relies on roles and parent scope validation (via initiatorIds)\n this.logDebug('Collection operation - authorizing without resource ID', {\n operation: operationId,\n effectiveOperation,\n initiatorIds: executionContext.initiatorIds\n });\n await this.authorizationsService.authorizeInController(undefined, executionContext);\n } else {\n const resourceId = this.resourceOperationHelper.extractIdsFromExecutionContext(\n executionContext,\n executionContext.operation.resourceFieldIdentifier\n );\n\n // F4: stamp the narrowing decision BEFORE the context-addressed probes below.\n //\n // Both probes resolve WHICH row an id-less operation is about by running a real, NARROWED\n // repository read (`listForInternalScan` → `buildContextualFilter`). That read necessarily\n // precedes `authorizeInController` — the id it produces is what gets authorized — so on a\n // narrowed resource it would otherwise run against no stamp, fail closed, resolve nothing, and\n // answer NOT_FOUND before authorization ever ran. Identical in shape to the defect fixed inside\n // `authorizeInRepositoryAndService`, one boundary out.\n //\n // Exempting the probe from narrowing was the alternative and is the fail-OPEN direction: it\n // would resolve a singleton belonging to a unit the caller does not hold and leave the\n // confinement to a later check. Stamped, the probe simply does not find it.\n //\n // Latent until an application declares a resource that is BOTH unit-narrowed and\n // context-addressed — nothing prevents one, and the failure would be a resource that 404s for\n // every caller with no indication why.\n if (resourceId === undefined) {\n await this.authorizationsService.stampOrganizationUnitNarrowingForOperation(\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext,\n );\n }\n\n const contextOnlySingletonOperationAuthorizationId = resourceId === undefined\n ? await this.resolveContextAddressedSingletonOperationAuthorizationId(\n String(effectiveOperation),\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext,\n )\n : undefined;\n const contextOnlyAssociationOperationAuthorizationId = (\n resourceId === undefined\n && contextOnlySingletonOperationAuthorizationId === undefined\n )\n ? await this.resolveContextAddressedAssociationOperationAuthorizationId(\n String(effectiveOperation),\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext,\n )\n : undefined;\n // An id-less READ of a context-addressed singleton whose row does not exist\n // yet: the authorization probe returned undefined (no `_id`), but the parent\n // scope is present, so the read is legitimately context-addressed. Authorize\n // it by scope and let the operation layer materialize-or-404 (the seam scoped\n // progression/guidance lazy-materialization hooks depend on). READ only —\n // mutations against an absent singleton already failed closed in the probe.\n const isContextAddressedSingletonReadAuthorizedByScope = (\n resourceId === undefined\n && effectiveOperation === CoreResourceOperation.READ\n && contextOnlySingletonOperationAuthorizationId === undefined\n && this.hasContextAddressedSingletonParentScope(\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext,\n )\n );\n const allowContextOnlyRead = (\n resourceId === undefined\n && effectiveOperation === CoreResourceOperation.READ\n && (\n contextOnlySingletonOperationAuthorizationId !== undefined\n || contextOnlyAssociationOperationAuthorizationId !== undefined\n || isContextAddressedSingletonReadAuthorizedByScope\n )\n );\n const allowContextOnlySingletonMutation = (\n resourceId === undefined\n && effectiveOperation !== CoreResourceOperation.READ\n && contextOnlySingletonOperationAuthorizationId !== undefined\n );\n const allowContextOnlyAssociationMutation = (\n resourceId === undefined\n && effectiveOperation !== CoreResourceOperation.READ\n && contextOnlyAssociationOperationAuthorizationId !== undefined\n );\n contextAddressedOperationAuthorizationId = contextOnlySingletonOperationAuthorizationId\n ?? contextOnlyAssociationOperationAuthorizationId;\n\n if (allowContextOnlyRead || allowContextOnlySingletonMutation || allowContextOnlyAssociationMutation) {\n this.logDebug('Context-addressed operation - authorizing without explicit resource ID', {\n operation: operationId,\n effectiveOperation,\n contextAddressingMode: allowContextOnlyRead\n ? 'read'\n : allowContextOnlySingletonMutation\n ? 'singleton-mutation'\n : 'association-mutation',\n initiatorParameters: initiatorInfo.parameters?.map((parameter) => parameter.fieldIdentifier) ?? [],\n });\n await this.authorizationsService.authorizeInController(\n contextAddressedOperationAuthorizationId,\n executionContext\n );\n } else {\n /*\n * Validate the addressed resource id, IN THE RESOURCE'S OWN FORMAT.\n *\n * The fourth argument is what makes that possible, and its absence made\n * `validateResourceId`'s format-aware branch unreachable from the only production caller\n * that addresses a row: without a `resourceType` the helper falls through to\n * `isValidResourceId`, which admits ONLY a MongoDB ObjectId or a UUID.\n *\n * That silently defeated both synthesized formats. An `HTTP_API`-backed resource's id\n * encodes a remote entity's key and an `INTROSPECTION`-backed resource's id is whatever\n * its projection calls the row — neither can be an ObjectId or a UUID, and\n * `ResourceIdBackendService.getFormatForResource` exists precisely to say so. Measured on\n * the introspection lane, against the workbench's module projection (a resource since\n * superseded by `workbench-domain-resources`): the LIST answered 200 with 8 rows while the\n * addressed READ of the row keyed `engine` answered 400 `invalid_format`, because the\n * branch that would have admitted `engine` was never entered.\n *\n * Passing the resource type does not loosen anything for platform-backed rows: the helper\n * resolves their format to the application's declared ObjectId or UUID and validates\n * exactly as before.\n */\n this.resourceOperationHelper.validateResourceId(\n resourceId,\n executionContext,\n executionContext.operation.resourceFieldIdentifier,\n executionContext.operation.resourceIdentifier,\n );\n\n // Type assertion is safe here because validateResourceId ensures it's a string\n await this.authorizationsService.authorizeInController(resourceId as string, executionContext);\n }\n }\n\n // ── COLLECTION EXPORT ───────────────────────────────────────────────────────────────────\n // Everything above this line is the ordinary request lifecycle — rate limit, execution\n // context, request validation, authorization — and the export needs all of it unchanged. What\n // differs is only the RESPONSE: bytes rather than JSON. So the branch sits here, after the\n // caller has been authorized exactly as they would be for the listing, and it OWNS the\n // response from this point (it writes headers and streams, then returns).\n //\n // It re-runs the SOURCE operation rather than querying anything itself, which is the whole\n // design: tenant isolation, contextual filters, retention row-hide, backend-only field\n // stripping and population then hold by construction rather than through a second\n // implementation. See `ResourceCollectionExportConfig`.\n if (executionContext.operation.generatedOperation?.kind === ResourceGeneratedOperationKind.GENERATED_COLLECTION_EXPORT) {\n await this.handleCollectionExport(\n executionContext.operation.generatedOperation,\n initiatorInfo,\n req,\n res,\n executionContext,\n dataMode,\n );\n return;\n }\n\n // For API calls, request pagination wrapper for list operations\n // Extract dataMode from query to pass to service layer for variant resolution\n const needsPagination = effectiveOperation === CoreResourceOperation.LIST || effectiveOperation === CoreResourceOperation.SEARCH;\n const options: ServiceOptions | undefined = needsPagination ? { paginated: true, dataMode } : dataMode ? { dataMode } : undefined;\n optionsWithVersion = contextAddressedOperationAuthorizationId\n ? {\n ...options,\n contextAddressedOperationAuthorizationId,\n ...(effectiveOperation === CoreResourceOperation.UPDATE || effectiveOperation === CoreResourceOperation.DELETE\n ? { contextAddressedMutationAuthorizationId: contextAddressedOperationAuthorizationId }\n : {}),\n }\n : options;\n\n // Parse If-Match header for optimistic locking on the supported single-resource\n // update-like lane only. Other mutation families must fail closed instead of\n // silently accepting a header they do not actually enforce downstream.\n const ifMatchRaw = req.headers[WildoHeaderKeys.IF_MATCH] as string | string[] | undefined;\n const hasIfMatchHeader = hasNonEmptyIfMatchHeader(ifMatchRaw);\n const isBulkOperation = 'isBulkOperation' in executionContext.operation\n ? executionContext.operation.isBulkOperation\n : false;\n const supportsIfMatch = supportsIfMatchOptimisticLocking({\n operationIdentifier: operationId,\n resourceOperationLike: operationLike,\n isBulkOperation,\n });\n if (hasIfMatchHeader && !supportsIfMatch) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n // diagnostic (log-only)\n field: WildoHeaderKeys.IF_MATCH,\n operationIdentifier: executionContext.operation.operationIdentifier,\n resourceOperationLike: executionContext.operation.resourceOperationLike,\n isBulkOperation,\n },\n });\n }\n\n const parsedVersion = supportsIfMatch ? parseIfMatchVersionHeader(ifMatchRaw) : undefined;\n if (hasIfMatchHeader && supportsIfMatch && parsedVersion == null) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n // diagnostic (log-only)\n field: WildoHeaderKeys.IF_MATCH,\n operationIdentifier: executionContext.operation.operationIdentifier,\n resourceOperationLike: executionContext.operation.resourceOperationLike,\n isBulkOperation,\n },\n });\n }\n if (parsedVersion != null) {\n optionsWithVersion = { ...optionsWithVersion, ifMatchVersion: parsedVersion };\n }\n\n // CRDT: extract and validate field timestamps from request body (not from validated DTO —\n // _field_timestamps is engine infrastructure, not part of the resource schema).\n // S2: semantic validation — only accept keys that are actually marked isCRDT() on the schema.\n const rawFieldTimestamps = req.body?._field_timestamps;\n if (rawFieldTimestamps && typeof rawFieldTimestamps === 'object' && !Array.isArray(rawFieldTimestamps)) {\n const crdtFields = extractCrdtFieldNames(operation.mainSchema, false);\n const validated: Record<string, number> = {};\n const entries = Object.entries(rawFieldTimestamps as Record<string, unknown>);\n if (entries.length <= 100) {\n for (const [key, value] of entries) {\n if (typeof key === 'string' && key.length <= 200\n && typeof value === 'number' && Number.isFinite(value) && value > 0\n && crdtFields.has(key)) {\n validated[key] = value;\n }\n }\n if (Object.keys(validated).length > 0) {\n optionsWithVersion = { ...optionsWithVersion, fieldTimestamps: validated };\n }\n }\n }\n\n this.logDebug('Calling service with operation', {\n operationIdentifier: executionContext.operation.operationIdentifier,\n variantKey: executionContext.operation.variantKey,\n dataMode,\n hasOptions: !!optionsWithVersion\n });\n\n // W7.3a: Create AnonymousUser BEFORE the main operation to avoid FK orphans.\n // The main operation may create a resource with anonymousUserId FK — the\n // AnonymousUser record must exist first for FK integrity.\n if (executionContext.anonymousUserCreated) {\n await this.anonymousSessionService.createAnonymousUser(executionContext.anonymousUserId!, req, res);\n const token = this.anonymousSessionService.signSessionToken(executionContext.anonymousUserId!);\n executionContext.setAnonymousSessionToken(token);\n }\n\n const result = await this.servicesRegistry.doByExecutionContext(executionContext, validatedData, optionsWithVersion);\n\n if (result == null && effectiveOperation === CoreResourceOperation.READ) {\n const resourceId = this.resourceOperationHelper.extractIdsFromExecutionContext(\n executionContext,\n executionContext.operation.resourceFieldIdentifier,\n );\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_NOT_FOUND,\n context: {\n operation: CoreResourceOperation.READ,\n resourceIdentifier: executionContext.operation.resourceIdentifier,\n resourceFieldIdentifier: executionContext.operation.resourceFieldIdentifier,\n resourceId: resourceId ?? null,\n initiatorParameters: initiatorInfo.parameters?.map((parameter) => parameter.fieldIdentifier) ?? [],\n },\n });\n }\n\n // W7.3a: Set the token as response header AFTER the main operation succeeds.\n // The header is read same-origin (the frontend HTTP client that owns the\n // localStorage session); the cookie (below) is the CROSS-origin carrier —\n // it rides the parent domain to the app so a website-captured lead / draft\n // transposes on app signup with no frontend handoff.\n if (executionContext.anonymousSessionToken) {\n res.setHeader(WildoHeaderKeys.ANONYMOUS_SESSION_TOKEN, executionContext.anonymousSessionToken);\n this.anonymousSessionService.setSessionCookie(res, executionContext.anonymousSessionToken);\n }\n\n await this.sendResponse(res, req, executionContext, result);\n } catch (error) {\n if (!executionContext) {\n next(error);\n return;\n }\n const enrichedError = await this.enrichVersionConflictError(error, executionContext, validatedData, optionsWithVersion);\n next(enrichedError);\n }\n }\n\n\n\n /**\n * Render one LIST/SEARCH result set to a downloadable file and stream it.\n *\n * ## The contract, and why each half of it is shaped this way\n *\n * **It re-runs the SOURCE operation.** Everything a listing enforces — role ACL, parent-scope\n * confinement, contextual filters, retention row-hide, backend-only/secret field stripping,\n * relationship population, sort validation — is enforced here by being the same call, not by being\n * re-implemented. `_doList` and `buildContextualFilter` each exist twice (one per persistence\n * adapter) and have diverged before; an export with its own query would be a third place for the\n * tenant boundary to be got right.\n *\n * **The ceiling is checked before a single byte is written.** A whole-result-set export reads page\n * one first, and that page's `pagination.total` is the authoritative match count — so a refusal is\n * a clean error response, never a half-written file. Truncating instead was rejected: a short CSV\n * is indistinguishable from a complete one once it is open in a spreadsheet.\n *\n * **CSV columns come from the declared response shape, never from the rows.** The header record is\n * written before the last page is read, so row-derived columns would silently drop any field that\n * first appears late in the set. If the shape cannot be resolved the export REFUSES rather than\n * guessing — JSON stays available and carries whatever each row carries.\n *\n * **The audit event is emitted after the count is known**, so the count is truthful, and its\n * failure never fails the export.\n */\n private async handleCollectionExport(\n exportMetadata: ResourceConfiguration_GeneratedCollectionExportOperationMetadata,\n initiatorInfo: ResourceConfiguration_Operation_UrlInitiatorInfo,\n req: Request,\n res: Response,\n exportExecutionContext: ExecutionContext<any>,\n dataMode: DataMode | undefined,\n ): Promise<void> {\n const exportConfig = exportMetadata.export;\n\n // ── The two selectors, resolved against what the operation OFFERS ──\n // A value the author did not publish is refused rather than silently coerced to a default: an\n // export that quietly answers CSV to a caller who asked for JSON has produced the wrong file.\n const format = resolveRequestedCollectionExportFormat(\n req.query[COLLECTION_EXPORT_FORMAT_QUERY_PARAM],\n exportConfig.formats,\n );\n if (!format) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n field: COLLECTION_EXPORT_FORMAT_QUERY_PARAM,\n requested: req.query[COLLECTION_EXPORT_FORMAT_QUERY_PARAM],\n offered: exportConfig.formats,\n },\n });\n }\n const rowScope = resolveRequestedCollectionExportRowScope(\n req.query[COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM],\n exportConfig.rowScopes,\n );\n if (!rowScope) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n field: COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM,\n requested: req.query[COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM],\n offered: exportConfig.rowScopes,\n },\n });\n }\n\n // ── The source operation, and a request that no longer carries the export's own selectors ──\n // `Object.create` rather than a spread: an Express `Request` carries its behaviour on the\n // prototype chain, and a shallow copy would lose it. This shadows `query` alone, so the source\n // operation's request-DTO validation never sees `format`/`rowScope` — keys it has no reason to\n // model and, on a strict DTO, would reject.\n const sourceOperation = this.resourceConfiguration.operations.find(\n (candidate: any) => String(candidate.operationIdentifier) === exportMetadata.sourceOperationIdentifier,\n ) as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> | undefined;\n if (!sourceOperation) {\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message: 'Collection export references a source operation that is not registered',\n sourceOperationIdentifier: exportMetadata.sourceOperationIdentifier,\n },\n });\n }\n\n const { [COLLECTION_EXPORT_FORMAT_QUERY_PARAM]: _droppedFormat,\n [COLLECTION_EXPORT_ROW_SCOPE_QUERY_PARAM]: _droppedRowScope,\n ...sourceQuery } = req.query as Record<string, unknown>;\n const sourceRequest = Object.create(req, {\n query: { value: sourceQuery, enumerable: true, configurable: true, writable: true },\n }) as Request;\n\n let sourceExecutionContext = await this.executionContextCreator.createExecutionContextFromRequest(\n sourceRequest,\n sourceOperation,\n initiatorInfo,\n );\n sourceExecutionContext = this.resolveExecutionContextForAuthorization(sourceExecutionContext, sourceRequest).executionContext;\n const sourceRequestData = this.validateRequestData(\n sourceRequest,\n sourceOperation,\n sourceExecutionContext as ExecutionContext<typeof sourceOperation>,\n );\n\n // ── Columns, resolved BEFORE anything is written ──\n const csvColumns = format === ResourceCollectionExportFormat.CSV\n ? resolveCollectionExportCsvColumns((sourceOperation as any).responseDto)\n : undefined;\n if (format === ResourceCollectionExportFormat.CSV && !csvColumns) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n message: 'Cannot resolve CSV columns from the source operation response shape; export JSON instead',\n sourceOperationIdentifier: exportMetadata.sourceOperationIdentifier,\n },\n });\n }\n\n const isFullResultSet = rowScope === ResourceCollectionExportRowScope.FULL_RESULT_SET;\n const pageLimit = (sourceOperation as any).maxPaginatedResultPerPageLimit ?? DEFAULT_COLLECTION_EXPORT_PAGE_LIMIT;\n\n const runPage = async (page: number | undefined, limit: number | undefined): Promise<{ rows: Record<string, unknown>[]; total: number }> => {\n const pagedRequestData = page === undefined\n ? sourceRequestData\n : { ...sourceRequestData, pagination: { ...(sourceRequestData?.pagination ?? {}), page, limit } };\n const result = await this.servicesRegistry.doByExecutionContext(\n sourceExecutionContext,\n pagedRequestData,\n ({ paginated: true, ...(dataMode ? { dataMode } : {}) } as ServiceOptions),\n ) as { data?: unknown[]; pagination?: { total?: number } } | undefined;\n const rows = Array.isArray(result?.data) ? (result!.data as Record<string, unknown>[]) : [];\n return { rows, total: typeof result?.pagination?.total === 'number' ? result!.pagination!.total : rows.length };\n };\n\n // Page one is read BEFORE any header is sent — it carries the authoritative match count, which\n // is what makes both the ceiling refusal and an honest row-count header possible.\n const firstPage = await runPage(\n isFullResultSet ? 1 : undefined,\n isFullResultSet ? pageLimit : undefined,\n );\n const declaredRowCount = isFullResultSet ? firstPage.total : firstPage.rows.length;\n\n if (isFullResultSet\n && exportConfig.maximumExportedRows !== undefined\n && declaredRowCount > exportConfig.maximumExportedRows) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, exportExecutionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: {\n message: 'The export matches more rows than this operation allows; narrow the filters and retry',\n matchedRows: declaredRowCount,\n maximumExportedRows: exportConfig.maximumExportedRows,\n },\n });\n }\n\n const filename = buildCollectionExportFilename(\n String(this.resourceConfiguration.resourceIdentifier),\n format,\n new Date(),\n );\n res.setHeader('Content-Type', COLLECTION_EXPORT_CONTENT_TYPES[format]);\n res.setHeader('Content-Disposition', `attachment; filename=\"${filename}\"`);\n res.setHeader(COLLECTION_EXPORT_ROW_COUNT_HEADER, String(declaredRowCount));\n // The bytes are application data rendered into a downloadable file; the same untrusted-content\n // posture the file-serve route takes applies here.\n res.setHeader('X-Content-Type-Options', 'nosniff');\n\n let writtenRowCount = 0;\n if (format === ResourceCollectionExportFormat.CSV) {\n res.write(toCsvHeaderRow(csvColumns!));\n } else {\n res.write('[');\n }\n\n const writeRows = (rows: Record<string, unknown>[]): void => {\n for (const row of rows) {\n if (format === ResourceCollectionExportFormat.CSV) {\n res.write(toCsvRow(csvColumns!, row));\n } else {\n res.write(`${writtenRowCount === 0 ? '' : ','}\\n${JSON.stringify(row)}`);\n }\n writtenRowCount += 1;\n }\n };\n\n writeRows(firstPage.rows);\n\n if (isFullResultSet) {\n // Iterate at the operation's OWN declared ceiling. Asking for one huge page instead would mean\n // raising a bound that is enforced at eight independent sites, which would move the effective\n // ceiling for every caller of the listing, not just this export.\n let page = 2;\n while (writtenRowCount < declaredRowCount && firstPage.rows.length > 0) {\n const nextPage = await runPage(page, pageLimit);\n if (nextPage.rows.length === 0) break;\n writeRows(nextPage.rows);\n page += 1;\n }\n }\n\n if (format === ResourceCollectionExportFormat.JSON) {\n res.write(writtenRowCount === 0 ? ']\\n' : '\\n]\\n');\n }\n res.end();\n\n // ── The audit record ──\n // AFTER the count is known, so it is truthful. Fire-and-forget and feature-detected: the export\n // has already been delivered, and a trail write must never turn a completed disclosure into an\n // error the caller sees (the response is finished by now in any case).\n void this.emitCollectionExportAuditEvent({\n exportMetadata,\n format,\n rowScope,\n rowCount: writtenRowCount,\n isFullResultSet,\n requestData: sourceRequestData,\n executionContext: sourceExecutionContext,\n });\n }\n\n /**\n * Record the export in the audit trail.\n *\n * Filter FIELD NAMES only — never their values. A filter value is frequently personal data\n * (`?email=…`), so recording it would leave a second copy of the disclosed data in a store that\n * outlives the exported file. Same rule the subject-export event follows.\n */\n private async emitCollectionExportAuditEvent(params: {\n exportMetadata: ResourceConfiguration_GeneratedCollectionExportOperationMetadata;\n format: ResourceCollectionExportFormat;\n rowScope: ResourceCollectionExportRowScope;\n rowCount: number;\n isFullResultSet: boolean;\n requestData: any;\n executionContext: ExecutionContext<any>;\n }): Promise<void> {\n try {\n // The INJECTED service, not a lookup off the services registry. An earlier draft reached for\n // `(this.servicesRegistry as any).auditLogsService`, which does not exist — so the guard below\n // it would have returned early on every export and the trail would have been permanently\n // empty while looking defensively written. A feature-detect on a dependency the constructor\n // already requires is not caution, it is a silent no-op.\n const filters = params.requestData?.filters;\n await this.auditLogsService.logCollectionDataExport({\n resourceType: String(this.resourceConfiguration.resourceIdentifier),\n sourceOperationIdentifier: params.exportMetadata.sourceOperationIdentifier,\n format: params.format,\n rowScope: params.rowScope,\n rowCount: params.rowCount,\n filterFieldNames: filters && typeof filters === 'object' ? Object.keys(filters) : [],\n isFullResultSet: params.isFullResultSet,\n organizationId: params.executionContext.initiatorIds?.organizationId,\n });\n } catch (error) {\n this.logger.warn('Collection export audit event could not be recorded', {\n error: describeCaughtError(error),\n resourceType: String(this.resourceConfiguration.resourceIdentifier),\n });\n }\n }\n\n private async enrichVersionConflictError(\n error: unknown,\n executionContext: ExecutionContext<any>,\n validatedData: unknown,\n options: ServiceOptions | undefined,\n ): Promise<unknown> {\n if (!isWildoBackendError(error)) {\n return error;\n }\n\n if (error.type !== ErrorType.CONFLICT || error.customMessageReference !== ErrorCustomMessageReference.VERSION_CONFLICT) {\n return error;\n }\n\n if (options?.ifMatchVersion == null) {\n return error;\n }\n\n // Only optimistic-lock conflicts carry the richer versionConflict payload.\n // A generic CONFLICT without an If-Match fence does not guarantee that the\n // controller can explain \"expected vs current\" truth field-by-field.\n const versionConflict = await this.buildVersionConflictDetails(\n executionContext,\n validatedData,\n options.ifMatchVersion,\n options.contextAddressedOperationAuthorizationId\n ?? options.contextAddressedMutationAuthorizationId,\n );\n if (!versionConflict) {\n return error;\n }\n\n error.context = {\n ...(error.context ?? {}),\n versionConflict,\n };\n return error;\n }\n\n private async buildVersionConflictDetails(\n executionContext: ExecutionContext<any>,\n validatedData: unknown,\n expectedVersion: number,\n resolvedResourceId?: string,\n ): Promise<VersionConflictDetails | undefined> {\n const resourceId = resolvedResourceId\n ?? this.resourceOperationHelper.extractIdsFromExecutionContext(\n executionContext,\n executionContext.operation.resourceFieldIdentifier,\n );\n if (typeof resourceId !== 'string' || resourceId.length === 0) {\n return undefined;\n }\n\n const submittedValues = isPlainRecord(validatedData) ? { ...validatedData } : {};\n\n try {\n const currentResource = await this.servicesRegistry.read<Record<string, unknown>>(\n executionContext.operation.resourceIdentifier as ResourceType,\n executionContext,\n resourceId,\n );\n if (!isPlainRecord(currentResource)) {\n return undefined;\n }\n\n const currentValues = this.shapeCanonicalConflictCurrentValues(currentResource);\n if (!currentValues) {\n return undefined;\n }\n\n // Compare the client-submitted shape against canonical READ-shaped server\n // truth so conflict consumers see the same surface the frontend normally\n // reads, while still preserving authoritative engine metadata below.\n const conflictingFields = collectSubmittedFieldPaths(submittedValues).filter((fieldPath) => (\n !areConflictValuesEqual(\n getValueAtPath(currentValues, fieldPath),\n getValueAtPath(submittedValues, fieldPath),\n )\n ));\n\n if (typeof currentValues._version !== 'number') {\n this.logger.warn('Skipped version conflict enrichment because canonical current values omitted authoritative version', {\n resourceType: executionContext.operation.resourceIdentifier,\n resourceId,\n expectedVersion,\n });\n return undefined;\n }\n\n return {\n currentVersion: currentValues._version,\n expectedVersion,\n conflictingFields,\n currentValues,\n submittedValues,\n };\n } catch (readError) {\n this.logger.warn('Failed to enrich version conflict with authoritative current values', {\n resourceType: executionContext.operation.resourceIdentifier,\n resourceId,\n ...projectCaughtErrorLogFields(readError),\n });\n return undefined;\n }\n }\n\n private shapeCanonicalConflictCurrentValues(currentResource: Record<string, unknown>): Record<string, unknown> | undefined {\n const readOperation = this.resolveCanonicalConflictReadOperation();\n if (!readOperation) {\n return currentResource;\n }\n\n const selectedDto = this.selectResponseDto(readOperation, undefined);\n if (!selectedDto) {\n return currentResource;\n }\n\n // Best-effort shaping only. A polymorphic (discriminated-union) resource whose stored\n // document does not cleanly re-validate against the addressable READ DTO — or any\n // transform edge — would otherwise throw here, bubble to `buildVersionConflictDetails`'s\n // catch, and yield `undefined` enrichment (a detail-less VERSION_CONFLICT 409 → an\n // optimistic-concurrency client that can never learn the authoritative version and stays\n // stuck retrying with a stale `If-Match`). Fall back to the raw current resource, which\n // still carries the authoritative `_id`/`_version` the client needs to recover.\n // (Consistent with the `!readOperation` / `!selectedDto` fallbacks above.)\n let parsedCurrentResource: unknown;\n try {\n const transformedCurrentResource = ResourcesConfigOperationsDtosBuilderUtils.transformResponseDates(currentResource, selectedDto);\n parsedCurrentResource = selectedDto.parse(transformedCurrentResource);\n } catch (shapingError) {\n this.logger.warn('Conflict current-values DTO shaping failed; falling back to raw current resource', {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n ...projectCaughtErrorLogFields(shapingError),\n });\n return currentResource;\n }\n if (!isPlainRecord(parsedCurrentResource)) {\n return currentResource;\n }\n\n // Preserve engine-owned identity/version metadata even when the canonical\n // READ DTO strips them. Conflict consumers still need the authoritative\n // resource id/version tuple from storage truth, not only the public DTO body.\n if (parsedCurrentResource._id === undefined && currentResource._id !== undefined) {\n parsedCurrentResource._id = currentResource._id;\n }\n if (parsedCurrentResource._version === undefined && currentResource._version !== undefined) {\n parsedCurrentResource._version = currentResource._version;\n }\n if (currentResource._field_meta && typeof currentResource._field_meta === 'object' && !Array.isArray(currentResource._field_meta)) {\n parsedCurrentResource._field_meta = currentResource._field_meta;\n }\n\n return parsedCurrentResource;\n }\n\n private resolveCanonicalConflictReadOperation(): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> | undefined {\n const defaultReadOperations = (this.resourceConfiguration.operations ?? []).filter((operation) => (\n operation.operationIdentifier === CoreResourceOperation.READ\n && operation.isOperationDefault === true\n && !('isBulkOperation' in operation && operation.isBulkOperation === true)\n ));\n if (defaultReadOperations.length <= 1) {\n if (!defaultReadOperations[0]) {\n this.logDebug('No default conflict-read operation configured', {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n });\n }\n return defaultReadOperations[0];\n }\n\n // More than one default READ matched. This is NOT a misconfiguration: `isOperationDefault`\n // is scoped PER TRANSPORT GROUP, so a resource that declares a default READ in more than one\n // transport (e.g. an addressable API_CALL READ alongside an INTERNAL_CALL / REPOSITORY_ONLY\n // default READ) legitimately yields >1 here — the documented \"set-filter that matches >1 and\n // throws\" hazard called out on `determineOperationVariantDefault` in\n // `resources-config.shared.factory`.\n //\n // Conflict shaping must re-read the SAME surface the frontend reads: the addressable\n // (URL-isable) transport. Select it deterministically. Throwing here would abort enrichment\n // (the throw is swallowed by `buildVersionConflictDetails`'s catch), shipping a detail-less\n // VERSION_CONFLICT 409 — which leaves the optimistic-concurrency client unable to learn the\n // authoritative version and permanently stuck retrying with a stale `If-Match`.\n const addressableReadOperation = defaultReadOperations.find((operation) => (\n operation.variantType === ResourceOperationVariantType.API_CALL\n || operation.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n ));\n if (addressableReadOperation) {\n return addressableReadOperation;\n }\n\n // No addressable default READ among the candidates (unusual — a resource whose only default\n // READs are non-addressable). Fall back to the first deterministically so enrichment still\n // proceeds, and warn for configuration visibility.\n this.logger.warn('Multiple non-addressable default READ operations available for conflict shaping; using the first candidate', {\n resourceType: this.resourceConfiguration.resourceIdentifier,\n candidateVariants: defaultReadOperations.map((operation) => ({\n variantType: operation.variantType,\n variantKey: operation.variantKey,\n })),\n });\n return defaultReadOperations[0];\n }\n\n private normalizeCollectionQueryRequestData(\n rawRequestData: Record<string, unknown>,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n effectiveOperation: string,\n ): CollectionQueryRequestData {\n return normalizeCollectionQueryRequestData(\n rawRequestData,\n operation as never,\n effectiveOperation,\n this.resourceConfiguration.operations as never,\n );\n }\n\n\n private buildCollectionQueryRequestDtoInput(\n req: Request,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n effectiveOperation: string,\n ): Record<string, unknown> {\n // ROUTING IS NOT PAYLOAD. `req.params` carries the route's scope ids (`organizationId`,\n // `applicationId`) and the instance id — none of which the caller \"sent\". Merging them into the\n // request-DTO input conflates where a request was ROUTED with what it CONTAINS, and a `.strict()`\n // DTO then rejects every request including `{}` (measured on `auditLogs | exportAuditLogs`, #319).\n //\n // The defect was latent everywhere and surfaced only where an author was rigorous: every\n // non-strict DTO silently accepted the injected keys and ignored them, so being strict was the\n // thing that broke. Nothing is lost by excluding them — the instance id is read separately from\n // `req.params[resourceFieldIdentifier]` at its own call sites, and the scope is authoritative on\n // the execution context (`initiatorIds`), which is where every tenant-isolating consumer already\n // reads it and the only source a request cannot author for itself.\n const requestData = { ...req.query, ...req.body } as Record<string, unknown>;\n const normalizedRequest = this.normalizeCollectionQueryRequestData(requestData, operation, effectiveOperation);\n\n const filters = { ...normalizedRequest.filter };\n if (effectiveOperation === CoreResourceOperation.SEARCH && normalizedRequest.searchQuery) {\n filters.searchRequest = normalizedRequest.searchQuery;\n }\n\n return {\n ...requestData,\n ...(Object.keys(filters).length > 0 ? { filters } : {}),\n ...(normalizedRequest.page !== undefined || normalizedRequest.limit !== undefined\n ? {\n pagination: {\n ...(normalizedRequest.page !== undefined ? { page: normalizedRequest.page } : {}),\n ...(normalizedRequest.limit !== undefined ? { limit: normalizedRequest.limit } : {}),\n },\n }\n : {}),\n ...(normalizedRequest.sort ? { sorting: buildSortingSchemaInput(normalizedRequest.sort) } : {}),\n };\n }\n\n private validateRequestData(\n req: Request,\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n executionContext: ExecutionContext<typeof operation>\n ): any {\n // Routing is not payload — see `buildCollectionQueryRequestDtoInput` for the full reasoning (#319).\n const _extractedRequestData = (req: Request) => ({ ...req.query, ...req.body });\n\n // Use effectiveOperation to account for resourceOperationLike\n const effectiveOperation = operation.resourceOperationLike || operation.operationIdentifier;\n\n const hasExplicitRequestDto = hasMeaningfulExplicitRequestDto(operation.requestDto);\n\n if (\n effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.COUNT\n || effectiveOperation === CoreResourceOperation.SEARCH\n ) {\n const dtoInput = this.buildCollectionQueryRequestDtoInput(\n req,\n operation,\n String(effectiveOperation),\n );\n\n if (shouldSkipImplicitRequestValidation(String(effectiveOperation), hasExplicitRequestDto)) {\n return this.normalizeCollectionQueryRequestData(\n dtoInput,\n operation,\n String(effectiveOperation),\n );\n }\n\n if (!operation.requestDto) {\n return this.normalizeCollectionQueryRequestData(\n dtoInput,\n operation,\n String(effectiveOperation),\n );\n }\n\n try {\n const transformedRequestData = ResourcesConfigOperationsDtosBuilderUtils.transformRequestDates(\n dtoInput,\n operation.requestDto,\n );\n const parsedRequestData = operation.requestDto.parse(transformedRequestData) as Record<string, unknown>;\n return this.normalizeCollectionQueryRequestData(\n parsedRequestData,\n operation,\n String(effectiveOperation),\n );\n } catch (error) {\n if (error instanceof z.ZodError) {\n throw this.errorBuilder.buildError( ErrorType.VALIDATION, executionContext,\n { customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n stack: error.stack,\n context: { requestData: dtoInput, error: summarizeZodIssues(error.issues), zodIssues: error.issues }\n });\n }\n throw error;\n }\n }\n\n // For pure core READ/LIST/DELETE/COUNT/SEARCH semantics without an explicit\n // request DTO, no request body validation is needed. Custom operations that\n // reuse READ-like semantics may still declare requestDto and must keep it.\n if (shouldSkipImplicitRequestValidation(String(effectiveOperation), hasExplicitRequestDto)) {\n // For other operations (READ, DELETE, COUNT): return empty or minimal data\n // The actual IDs will be extracted from execution context\n return req.body || {};\n }\n\n if (!operation.requestDto) {\n return _extractedRequestData(req);\n }\n\n try {\n const requestData = _extractedRequestData(req);\n\n // Phase 3.8: Transform dates from strings to Date objects before validation\n let transformedRequestData = requestData;\n if (operation.requestDto) {\n transformedRequestData = ResourcesConfigOperationsDtosBuilderUtils.transformRequestDates(requestData, operation.requestDto);\n }\n\n // Phase 3.9: Validate against requestDto (field stripping already applied at factory time)\n const parsed = operation.requestDto.parse(transformedRequestData);\n\n // Carry the schema's OWN read-only (`.excludeFromUpdate()`) fields THROUGH to the service tier on\n // UPDATE and UPDATE_MANY, so the read-only-change guard there can REFUSE a genuine change — instead\n // of the repository silently stripping them and answering a 2xx that changed nothing (the \"answered\n // success, did nothing\" defect). The guard covers BOTH: single UPDATE compares to the stored row\n // (an ECHO of an unchanged value is allowed), bulk UPDATE_MANY refuses on presence (no single row\n // to compare against). Re-attaching for one without guarding the other would leave the sibling path\n // silently broken — see `.claude/rules/invariant-call-site-enumeration.md`. Only the schema's\n // DECLARED read-only fields are re-attached, so the strict mass-assignment boundary is unchanged\n // (arbitrary unknown keys stay stripped).\n if (\n (effectiveOperation === CoreResourceOperation.UPDATE || effectiveOperation === CoreResourceOperation.UPDATE_MANY)\n && parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n && transformedRequestData && typeof transformedRequestData === 'object' && !Array.isArray(transformedRequestData)\n && isZodObject(this.resourceConfiguration.mainSchema)\n ) {\n const shape = getZodObjectShape(this.resourceConfiguration.mainSchema);\n const parsedRecord = parsed as Record<string, unknown>;\n for (const [key, value] of Object.entries(transformedRequestData as Record<string, unknown>)) {\n if (value !== undefined && !(key in parsedRecord) && shape[key] && isExcludedFromUpdate(shape[key])) {\n parsedRecord[key] = value;\n }\n }\n }\n\n return parsed;\n } catch (error) {\n if (error instanceof z.ZodError) {\n throw this.errorBuilder.buildError( ErrorType.VALIDATION, executionContext,\n { customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n stack: error.stack,\n context: { requestData: _extractedRequestData(req), error: summarizeZodIssues(error.issues), zodIssues: error.issues }\n });\n }\n throw this.errorBuilder.buildFromStandardError(error, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: { requestData: _extractedRequestData(req), error: error.message }\n });\n }\n }\n\n\n /**\n * Phase 3.7: Extract DataMode from execution context or query parameters.\n * DataMode determines which DTO variant to use (SUMMARY, CONTEXT, or RAW).\n *\n * Priority:\n * 1. Query parameter `dataMode` (if provided)\n * 2. Operation variantKey (set at factory time)\n * 3. Default to RAW (responseDto)\n */\n private extractDataMode(\n executionContext: ExecutionContext<any>,\n req?: Request\n ): DataMode {\n // Check query parameter first (allows runtime override)\n const queryDataMode = req?.query?.dataMode as string | undefined;\n const extractedFromQuery = ResourceOperationsUtils.normalizeDataModeString(queryDataMode);\n\n // If query param provided a valid value, use it\n if (queryDataMode && extractedFromQuery) {\n return extractedFromQuery;\n }\n\n // Fall back to operation variantKey (set at factory time)\n const operation = executionContext.operation;\n if (operation.variantKey === OPERATION_VARIANT_KEY.SUMMARY) {\n return DataMode.SUMMARY;\n }\n if (operation.variantKey === OPERATION_VARIANT_KEY.CONTEXT) {\n return DataMode.CONTEXT;\n }\n\n // Default to RAW\n return DataMode.RAW;\n }\n\n private resolveExecutionContextForAuthorization(\n executionContext: ExecutionContext<any>,\n req?: Request,\n ): { executionContext: ExecutionContext<any>; dataMode: DataMode } {\n const dataMode = this.extractDataMode(executionContext, req);\n const resolvedOperation = this.resolveOperationForAuthorizationDataMode(\n executionContext.operation as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n dataMode,\n );\n\n if (executionContext.operation === resolvedOperation) {\n return { executionContext, dataMode };\n }\n\n this.logDebug('Resolved controller authorization operation variant before role checks', {\n originalVariantKey: executionContext.operation.variantKey,\n resolvedVariantKey: resolvedOperation.variantKey,\n dataMode,\n operationIdentifier: executionContext.operation.operationIdentifier,\n });\n\n return {\n executionContext: executionContext.withOperation(resolvedOperation),\n dataMode,\n };\n }\n\n private resolveOperationForAuthorizationDataMode(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n dataMode: DataMode | undefined,\n ): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n // RAW (the default) needs no variant resolution — keep the base operation\n // without touching the registry.\n if (!dataMode || dataMode === DataMode.RAW) {\n return operation;\n }\n\n // Delegate SUMMARY/CONTEXT to the registry's shared data-mode resolution so\n // authorization, request validation and dispatch all agree on the resolved\n // operation. For SEARCH-like operations a SUMMARY/CONTEXT request resolves to\n // the base operation (search is summary by construction — see\n // getOperationForDataMode); for READ/LIST it returns the keyed auto-variant,\n // and a genuinely missing variant still fails fast.\n return this.resourcesRegistry.getOperationForDataMode(operation, dataMode) as ResourceConfiguration_Operation<\n TCustomOperationEnum,\n TCoreOperationEnum,\n TMainSchema\n >;\n }\n\n /**\n * Phase 3.7: Select the appropriate response DTO based on DataMode.\n * Uses structure-aware utility method that handles LIST/SEARCH pagination wrappers.\n *\n * - Variant operations: Uses `responseDto` (already variant-specific)\n * - SUMMARY mode: Uses `summaryDto` (wrapped in pagination for LIST/SEARCH)\n * - CONTEXT mode: Uses `contextDto` (wrapped in pagination for LIST/SEARCH)\n * - RAW mode: Uses `responseDto` (default)\n */\n private selectResponseDto(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n dataMode?: DataMode\n ): z.ZodTypeAny | undefined {\n return ResourcesConfigOperationsDtosBuilderUtils.selectResponseDto(operation, dataMode) || undefined;\n }\n\n private async sendResponse(\n res: Response,\n req: Request,\n executionContext: ExecutionContext<any>,\n result: any,\n ): Promise<void | Response> {\n const operation = executionContext.operation as ResourceConfiguration_Operation<\n TCustomOperationEnum,\n TCoreOperationEnum,\n TMainSchema\n >;\n // Resolve the data mode here (HTTP-only — depends on req.query) and\n // delegate the data-shaping pipeline to the shared helper. The\n // helper is also consumed by the outbound webhook dispatcher so\n // both paths emit identical bodies for the same operation result.\n const dataMode = this.extractDataMode(executionContext, req);\n\n const analyzeDtoStructure = (dto: any) => {\n if (!dto || typeof dto !== 'object' || !('shape' in dto)) return 'Not a Zod object';\n try {\n const shape = (dto as any).shape;\n return Object.keys(shape).join(', ');\n } catch {\n return 'Cannot analyze';\n }\n };\n\n let serialized;\n try {\n serialized = await serializeOperationResultForResponse(operation, result, { dataMode });\n } catch (error) {\n const wildoError = error instanceof z.ZodError\n ? this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n stack: error.stack,\n context: { responseData: result, error: summarizeZodIssues(error.issues), zodIssues: error.issues }\n })\n : this.errorBuilder.buildFromStandardError(error as Error, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONTROLLER_RESOURCE_VALIDATION_FAILED,\n context: { responseData: result, error: describeCaughtError(error) }\n });\n\n // Direct-send boundary (bypasses `expressErrorHandler` — no `next` here),\n // so log once at this boundary. A response-DTO validation failure is a\n // SERVER-side contract violation (our output didn't match our own DTO), so\n // it keeps an explicit `warn` rather than the request-style classification\n // that would treat a VALIDATION type as a client `debug`. The projection\n // restores the full structured detail now that errors no longer self-log\n // at construction.\n this.logger.warn('Response DTO validation failed', {\n operation: operation.operationIdentifier,\n resourceIdentifier: operation.resourceIdentifier,\n dataMode,\n resultKeys: result && typeof result === 'object' ? Object.keys(result) : 'not-object',\n ...projectWildoBackendErrorLogFields(wildoError),\n });\n\n let validationErrors: Record<string, string> | undefined;\n if (error instanceof z.ZodError) {\n validationErrors = {};\n for (const issue of error.issues) {\n const fieldPath = issue.path.join('.');\n if (fieldPath) validationErrors[fieldPath] = issue.message;\n }\n }\n\n return res.status(wildoError.statusCode).json({\n error: {\n type: wildoError.type,\n severity: wildoError.severity,\n message: wildoError.customMessageReference,\n timestamp: wildoError.timestamp?.toISOString() || new Date().toISOString(),\n ...(wildoError.context && { details: wildoError.context }),\n ...(validationErrors && { validationErrors }),\n }\n });\n }\n\n const { body: responseData, statusCode, selectedDto } = serialized;\n\n this.logDebug('Controller - sendResponse DTO selection', {\n operationIdentifier: operation.operationIdentifier,\n variantKey: operation.variantKey,\n dataMode,\n hasSelectedDto: !!selectedDto,\n hasResponseDto: !!operation.responseDto,\n hasSummaryDto: !!operation.summaryDto,\n hasContextDto: !!operation.contextDto,\n hasInternalDto: !!operation.internalDto,\n responseDtoFields: analyzeDtoStructure(operation.responseDto),\n selectedDtoFields: analyzeDtoStructure(selectedDto),\n resultStructure: result && typeof result === 'object' ? Object.keys(result) : typeof result\n });\n\n // Audit logging for first-exposure secret fields (`isReturnedAtCreation`, CREATE only — the\n // sole disclosure trigger the framework has; a generic any-operation `auditAccess` flag was\n // removed on 2026-08-06 as structurally unreachable).\n // Extracted to a pure helper shared with the M2M webhook dispatcher so\n // both paths fire identical audit events for the same operation result.\n // See `.cursor/plans/m2m-webhook-organization-delivery-phase5.md` §Step 16.\n await logAuditAccessForFields(\n { operation, executionContext, responseData, originalResult: result, selectedDto },\n { auditLogsService: this.auditLogsService, logger: this.logger },\n );\n\n if (executionContext.consumableTokenConsumed) {\n res.setHeader(WildoHeaderKeys.CONSUMABLE_TOKEN_CONSUMED, 'true');\n }\n\n res.setHeader(WildoHeaderKeys.X_SERVER_TIME, String(Date.now()));\n\n res.status(statusCode).json(responseData);\n }\n\n private getHttpMethodForOperation(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>\n ): HttpMethod {\n if ('httpVerb' in operation && operation.httpVerb) {\n return operation.httpVerb;\n }\n\n const operationToCheck = ResourceOperationsUtils.getCoreResourceOperationFromOperation(operation);\n\n if(!operationToCheck) {\n this.logDebug('No HTTP method found for operation, defaulting to POST', { operation: operation.operationIdentifier });\n return HttpMethod.POST;\n }\n return HTTP_METHOD_MAP[operationToCheck] || HttpMethod.POST;\n\n }\n\n}\n\n/**\n * Turn a caller-supplied collection query into the shape the SERVICE layer reads\n * (`{ filter, page, limit, sort, searchQuery }` — the keys `executeCorePersistenceOperation`\n * destructures for LIST / SEARCH / COUNT).\n *\n * SURFACE-AGNOSTIC ON PURPOSE. This was a private controller method until 2026-08-01, which\n * meant it ran for HTTP and for nothing else. The MCP surface dispatches straight to\n * `doByOperationPath` with the agent's raw `args`, so it never reached this function — and the\n * two shapes do not match. A collection operation's `requestDto` (what `tools/list` advertises\n * to the agent, via `convertZodSchemaToMcpInputSchema`) is keyed\n * `{ filters, pagination, sorting }`, while the service reads `{ filter, page, limit, sort }`.\n * An agent that followed the advertised schema therefore had its filter silently ignored and\n * received the UNFILTERED collection — the same \"reports success without doing what was asked\"\n * family this codebase has been closing, and worse for an LLM caller, which then reasons over\n * data it believes was filtered.\n *\n * It also carries the filter ALLOW-LIST: `extractCollectionFilters` copies only keys present in\n * the effective `filterFields` (plus the universal `createdAt`/`updatedAt` range fields), so no\n * caller-supplied key — and therefore no Mongo operator object under an unknown key — can reach\n * the repository through it. That matters most for a surface with no strict DTO parse in front\n * of it: `sanitizeRequestFilter` in the repository returns the filter UNCHANGED when an\n * operation declares no `filterFields`, so this allow-list is the layer that holds.\n *\n * Accepts BOTH the flat form (`page`, `sort`, `q`) and the nested DTO form (`pagination.page`,\n * `sorting`, `filters`, `filters.searchRequest`) so either surface's vocabulary works.\n */\nexport function normalizeCollectionQueryRequestData(\n rawRequestData: Record<string, unknown>,\n operation: ResourceConfiguration_Operation<any, any, any>,\n effectiveOperation: string,\n resourceOperations: readonly ResourceConfiguration_Operation<any, any, any>[],\n): CollectionQueryRequestData {\n const { filterFields } = operation as unknown as CollectionQueryOperationMetadata;\n\n // LIST mirrors the frontend collection host's fallback contract: when the\n // LIST operation declares no `filterFields` of its own, filters authored on\n // the sibling default SEARCH variant apply to LIST too. The frontend has\n // always rendered the filter UI from that fallback (\"filterFields from LIST,\n // fallback to SEARCH\" in `ResourceLayout_List`), but the backend extracted\n // ONLY against the LIST op's own (empty) declaration — silently dropping\n // `?field=value` params and making every SEARCH-only-authored filter a\n // UI-only illusion on LIST (same class as the LIST-sort silent no-op,\n // recovered 2026-06-17). Extraction stays declaration-gated either way:\n // only fields present in the effective `filterFields` are read.\n const effectiveFilterFields = (\n effectiveOperation === CoreResourceOperation.LIST\n && (!filterFields || Object.keys(filterFields).length === 0)\n )\n ? (resourceOperations.find(\n (op) => op.operationIdentifier === CoreResourceOperation.SEARCH && op.isOperationDefault === true,\n ) as unknown as CollectionQueryOperationMetadata | undefined)?.filterFields\n : filterFields;\n\n // Reconstruct date-range filters sent as bracketed query keys\n // (`?createdAt[startDate]=…`) that Express 5's `simple` query parser leaves as\n // literal flat keys — declaration-gated to actual range fields. No-op (returns\n // the same reference) when the request carries no such keys.\n const reconstructedRawRequestData = reconstructBracketedRangeFilters(rawRequestData, effectiveFilterFields);\n\n const nestedFilters = reconstructedRawRequestData.filters && typeof reconstructedRawRequestData.filters === 'object' && !Array.isArray(reconstructedRawRequestData.filters)\n ? reconstructedRawRequestData.filters as Record<string, unknown>\n : {};\n const filter = {\n ...extractCollectionFilters(reconstructedRawRequestData, effectiveFilterFields),\n ...extractCollectionFilters(nestedFilters, effectiveFilterFields),\n };\n\n // The flat wire names are the published collection vocabulary\n // (`COLLECTION_QUERY_PARAMETERS`); the nested `pagination` / `sorting` forms\n // are the structured-body aliases the frontend client sends.\n const page = parseOptionalPositiveInt(rawRequestData[COLLECTION_QUERY_PARAMETERS.page])\n ?? parseOptionalPositiveInt((rawRequestData.pagination as { page?: unknown } | undefined)?.page);\n const limit = parseOptionalPositiveInt(rawRequestData[COLLECTION_QUERY_PARAMETERS.limit])\n ?? parseOptionalPositiveInt((rawRequestData.pagination as { limit?: unknown } | undefined)?.limit);\n\n if (effectiveOperation === CoreResourceOperation.SEARCH) {\n const rawSearch = rawRequestData[COLLECTION_QUERY_PARAMETERS.search];\n const rawSearchAlias = rawRequestData[COLLECTION_QUERY_PARAMETERS.searchAlias];\n const searchQuery = (\n typeof rawSearch === 'string' && rawSearch.trim() !== ''\n ? rawSearch\n : typeof rawSearchAlias === 'string' && rawSearchAlias.trim() !== ''\n ? rawSearchAlias\n : typeof nestedFilters.searchRequest === 'string' && nestedFilters.searchRequest.trim() !== ''\n ? nestedFilters.searchRequest\n : undefined\n );\n const sort = parseCollectionQuerySort(rawRequestData[COLLECTION_QUERY_PARAMETERS.sort])\n ?? normalizeCollectionSorting(rawRequestData.sorting);\n\n return { filter, page, limit, searchQuery, sort };\n }\n\n if (effectiveOperation === CoreResourceOperation.LIST) {\n // LIST parses the same `sort=field:dir,field:dir` query param as SEARCH\n // (priority-ordered, comma-separated). This is threaded end-to-end: the\n // service `list()` dispatch forwards it into `listOptions`, and both\n // repository `_doList()` adapters (mongo + postgres) apply it via\n // `constructValidatedSortOptions` (the same validator SEARCH uses). An\n // absent `sort` falls back to the operation's sortFields default, or\n // createdAt-desc when none are configured — i.e. no behaviour change for\n // callers that don't pass `sort`.\n const sort = parseCollectionQuerySort(rawRequestData[COLLECTION_QUERY_PARAMETERS.sort]);\n return { filter, page, limit, sort };\n }\n\n return { filter };\n}\n"]}