@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":"scim-protocol.backend.schemas.js","sourceRoot":"","sources":["../../../../../../src/security/scim/models/scim-protocol.backend.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,kEAAkE;AAClE,8BAA8B;AAC9B,kEAAkE;AAElE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU,EAAS,OAAO;IAC1B,gBAAgB,EAAG,WAAW;IAC9B,iBAAiB,EAAE,UAAU;IAC7B,aAAa,EAAM,aAAa;IAChC,QAAQ,EAAW,SAAS,EAAS,kDAAkD;IACvF,YAAY,EAAO,gBAAgB;CAC3B,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAA2B,MAAM,CAAC,WAAW,CACrF,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAA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,EAAE,6BAA6B;SACxC;KACF,CAAU,CAAC","sourcesContent":["/**\n * SCIM Protocol Schemas — Step 20\n * \n * SCIM 2.0 types, attribute mapping, and protocol constants for directory provisioning.\n * \n * Decision 13: Lean SCIM — Users only in v1, no Groups, no generic adapter.\n * SCIM_USER_ATTRIBUTE_MAP maps SCIM attributes → NormalizedUserProfile fields\n * (the same type used by SSO JIT provisioning in Step 4/15).\n *\n * Token schema has moved to @wildo-ai/saas-models (scimTokensPolymorphicDeclaration).\n */\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM User Attribute Mapping\n// ═══════════════════════════════════════════════════════════════\n\n/**\n * Maps SCIM User resource attribute paths to NormalizedUserProfile fields.\n * Hardcoded for v1 — only the SCIM User resource is supported.\n * \n * FUTURE: If SCIM Groups or custom resources are needed, extract this into a\n * generic SCIMResourceMappingRegistry. See Decision 13 for the architecture.\n */\nexport const SCIM_USER_ATTRIBUTE_MAP = {\n 'userName': 'email',\n 'name.givenName': 'firstName',\n 'name.familyName': 'lastName',\n 'displayName': 'displayName',\n 'active': '_active', // computed: maps to user status (active/inactive)\n 'externalId': 'providerUserId',\n} as const;\n\n/**\n * Reverse map: NormalizedUserProfile field → SCIM attribute path.\n * Used by the response formatter to build SCIM User resources from internal data.\n */\nexport const PROFILE_TO_SCIM_ATTRIBUTE_MAP: Record<string, string> = Object.fromEntries(\n Object.entries(SCIM_USER_ATTRIBUTE_MAP).map(([scim, profile]) => [profile, scim])\n);\n\n/**\n * FUTURE: SCIM Groups → Organization Roles\n * SCIM Groups map to role assignments, not departments.\n * Example: Okta group \"Wildo Admins\" → ADMIN role.\n * Implementation: add /scim/v2/Groups endpoints with:\n * - POST/PUT/PATCH /Groups → create/update org roles\n * - Group membership changes → OrganizationMember role updates\n * - Group displayName → role identifier mapping (configurable per org)\n *\n * SCIM User department → OrganizationUnit: IMPLEMENTED (2026-08-01, WS-C). `department` from the\n * Enterprise User extension is bound to an organization unit through the EXPLICIT per-organization\n * `organizationUnitMapping` on the SCIM provisioning config — see\n * {@link extractScimDirectoryUnitValue} and `scim-organization-unit-mapping.shared.ts`. `division`\n * and `manager` remain unmapped: `division` would only be needed to disambiguate a search-based\n * match, and the declared mapping is unambiguous by construction, while `manager` is a reporting\n * relationship rather than a unit membership.\n */\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM Protocol Constants\n// ═══════════════════════════════════════════════════════════════\n\nexport const SCIM_SCHEMAS = {\n USER: 'urn:ietf:params:scim:schemas:core:2.0:User',\n ENTERPRISE_USER: 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User',\n LIST_RESPONSE: 'urn:ietf:params:scim:api:messages:2.0:ListResponse',\n ERROR: 'urn:ietf:params:scim:api:messages:2.0:Error',\n PATCH_OP: 'urn:ietf:params:scim:api:messages:2.0:PatchOp',\n BULK_REQUEST: 'urn:ietf:params:scim:api:messages:2.0:BulkRequest',\n BULK_RESPONSE: 'urn:ietf:params:scim:api:messages:2.0:BulkResponse',\n SERVICE_PROVIDER_CONFIG: 'urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig',\n RESOURCE_TYPE: 'urn:ietf:params:scim:schemas:core:2.0:ResourceType',\n SCHEMA: 'urn:ietf:params:scim:schemas:core:2.0:Schema',\n} as const;\n\nexport const SCIM_CONTENT_TYPE = 'application/scim+json';\n\n/**\n * Read the directory's `department` from an inbound SCIM User body.\n *\n * ## Why this is NOT an entry in `attributeMapping`\n *\n * Two independent reasons, and both matter:\n *\n * 1. **The path grammar cannot express it.** `resolveScimAttributePath` splits on `.`, and the\n * extension key is literally `urn:ietf:params:scim:schemas:extension:enterprise:2.0:User` — the\n * `2.0` contains a dot, so any dotted path would traverse into a key that does not exist.\n * 2. **There is nothing tenant-specific to configure.** `attributeMapping` exists because directories\n * disagree about where a value lives (`emails[0].value` vs `emails[type eq \"work\"].value`). The\n * enterprise extension URN is fixed BY THE SCIM SPEC, so a configurable path here would offer a\n * choice that has exactly one correct answer.\n *\n * The tenant-specific part — what a department VALUE means — is configured, in\n * `organizationUnitMapping`. This function only finds the value.\n *\n * Falls back to a top-level `department` because directories in the wild place it there when they do\n * not send the extension envelope. Returns `undefined` for anything non-string or blank, so an absent\n * department is unambiguous to the caller.\n */\nexport function extractScimDirectoryUnitValue(body: unknown): string | undefined {\n if (body === null || typeof body !== 'object') return undefined;\n\n const scimBody = body as Record<string, unknown>;\n const enterpriseExtension = scimBody[SCIM_SCHEMAS.ENTERPRISE_USER];\n const enterpriseDepartment =\n enterpriseExtension !== null && typeof enterpriseExtension === 'object'\n ? (enterpriseExtension as Record<string, unknown>)['department']\n : undefined;\n\n const rawDepartment = enterpriseDepartment ?? scimBody['department'];\n if (typeof rawDepartment !== 'string') return undefined;\n\n const department = rawDepartment.trim();\n return department.length > 0 ? department : undefined;\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM Error Types (RFC 7644 §3.12)\n// ═══════════════════════════════════════════════════════════════\n\nexport type SCIMErrorType =\n | 'invalidFilter'\n | 'tooMany'\n | 'uniqueness'\n | 'mutability'\n | 'invalidSyntax'\n | 'invalidPath'\n | 'noTarget'\n | 'invalidValue'\n | 'invalidVers'\n | 'sensitive';\n\nexport interface SCIMErrorResponse {\n schemas: [typeof SCIM_SCHEMAS.ERROR];\n status: string;\n detail: string;\n scimType?: SCIMErrorType;\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM PATCH Operation Types (RFC 7644 §3.5.2)\n// ═══════════════════════════════════════════════════════════════\n\nexport interface SCIMPatchOperation {\n op: 'add' | 'remove' | 'replace';\n path?: string;\n value?: unknown;\n}\n\nexport interface SCIMPatchRequest {\n schemas: string[];\n Operations: SCIMPatchOperation[];\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM Bulk Operation Types (RFC 7644 §3.7)\n// ═══════════════════════════════════════════════════════════════\n\nexport interface SCIMBulkOperation {\n method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n path: string;\n bulkId?: string;\n data?: Record<string, unknown>;\n}\n\nexport interface SCIMBulkRequest {\n schemas: [typeof SCIM_SCHEMAS.BULK_REQUEST];\n Operations: SCIMBulkOperation[];\n failOnErrors?: number;\n}\n\nexport interface SCIMBulkOperationResponse {\n method: string;\n bulkId?: string;\n location?: string;\n status: string;\n response?: SCIMErrorResponse;\n}\n\nexport interface SCIMBulkResponse {\n schemas: [typeof SCIM_SCHEMAS.BULK_RESPONSE];\n Operations: SCIMBulkOperationResponse[];\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM User Resource Type (RFC 7643 §4.1)\n// ═══════════════════════════════════════════════════════════════\n\nexport interface SCIMUserResource {\n schemas: string[];\n id: string;\n externalId?: string;\n userName: string;\n name?: {\n formatted?: string;\n familyName?: string;\n givenName?: string;\n };\n displayName?: string;\n active: boolean;\n emails?: Array<{\n value: string;\n type?: string;\n primary?: boolean;\n }>;\n meta: {\n resourceType: 'User';\n created: string;\n lastModified: string;\n location: string;\n };\n}\n\nexport interface SCIMListResponse<T = SCIMUserResource> {\n schemas: [typeof SCIM_SCHEMAS.LIST_RESPONSE];\n totalResults: number;\n startIndex: number;\n itemsPerPage: number;\n Resources: T[];\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM ServiceProviderConfig (RFC 7643 §5)\n// ═══════════════════════════════════════════════════════════════\n\n/**\n * Where an application's SCIM discovery document sends a directory administrator for\n * documentation. Authored per application (`auth.scimDocumentation`), because the RFC defines\n * `documentationUri` as the SERVICE PROVIDER's documentation — and the service provider is the\n * application, not the framework it was built with.\n *\n * spec-cite: RFC 7643 §5 — \"An HTTP-addressable URL pointing to the service provider's\n * human-consumable help documentation. OPTIONAL.\"\n */\nexport interface ScimDocumentationUris {\n /** RFC 7643 §5 `documentationUri` on the ServiceProviderConfig itself. */\n readonly serviceProviderUri?: string;\n /** RFC 7643 §5 `documentationUri` on the OAuth bearer-token authentication scheme. */\n readonly authenticationSchemeUri?: string;\n}\n\n/**\n * Build the SCIM ServiceProviderConfig this application serves at\n * `GET /scim/v2/ServiceProviderConfig` (RFC 7643 §5).\n *\n * Everything except the two documentation URLs is a statement about THIS implementation and is\n * therefore fixed: patch and bulk are supported, filtering is capped, `changePassword`, `sort` and\n * `etag` are not. Those are facts about the code, not choices an application makes.\n *\n * ## Why the two URLs are parameters, and why absence OMITS rather than empties\n *\n * They were frozen here, pointing at `docs.wildo.ai/scim` and `/scim/auth` — a host with no DNS\n * record, so every application built on Wildo told its enterprise customers to go somewhere that\n * does not resolve. Both are OPTIONAL in the RFC, so a discovery document without them is\n * conformant; one carrying a URL that answers nothing is a false advertisement served to the exact\n * reader who is trying to integrate.\n *\n * spec-cite: RFC 7643 §5 — both the top-level `documentationUri` and the `authenticationSchemes`\n * sub-attribute of the same name are marked \"OPTIONAL.\" \n *\n * An absent value therefore removes the KEY. Emitting `documentationUri: ''` or `null` would\n * replace an unanswerable URL with a malformed one, and a directory-service client that reads the\n * field before checking it would be worse off than if the framework had said nothing.\n */\nexport function buildScimServiceProviderConfig(documentation?: ScimDocumentationUris) {\n return {\n schemas: [SCIM_SCHEMAS.SERVICE_PROVIDER_CONFIG],\n ...(documentation?.serviceProviderUri ? { documentationUri: documentation.serviceProviderUri } : {}),\n patch: { supported: true },\n bulk: { supported: true, maxOperations: 100, maxPayloadSize: 1048576 },\n filter: { supported: true, maxResults: 200 },\n changePassword: { supported: false },\n sort: { supported: false },\n etag: { supported: false },\n authenticationSchemes: [{\n type: 'oauthbearertoken',\n name: 'OAuth Bearer Token',\n description: 'Authentication scheme using the OAuth Bearer Token Standard',\n specUri: 'https://www.rfc-editor.org/info/rfc6750',\n ...(documentation?.authenticationSchemeUri ? { documentationUri: documentation.authenticationSchemeUri } : {}),\n primary: true,\n }],\n meta: {\n resourceType: 'ServiceProviderConfig',\n location: '/scim/v2/ServiceProviderConfig',\n },\n };\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM User Schema Definition (RFC 7643 §7)\n// ═══════════════════════════════════════════════════════════════\n\nexport const SCIM_USER_SCHEMA_DEFINITION = {\n schemas: [SCIM_SCHEMAS.SCHEMA],\n id: SCIM_SCHEMAS.USER,\n name: 'User',\n description: 'User Account',\n attributes: [\n { name: 'userName', type: 'string', multiValued: false, required: true, caseExact: false, mutability: 'readWrite', returned: 'default', uniqueness: 'server' },\n { name: 'name', type: 'complex', multiValued: false, required: false, mutability: 'readWrite', returned: 'default', subAttributes: [\n { name: 'givenName', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n { name: 'familyName', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n { name: 'formatted', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n ]},\n { name: 'displayName', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n { name: 'active', type: 'boolean', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n { name: 'emails', type: 'complex', multiValued: true, required: false, mutability: 'readWrite', returned: 'default', subAttributes: [\n { name: 'value', type: 'string', multiValued: false, required: true },\n { name: 'type', type: 'string', multiValued: false, required: false },\n { name: 'primary', type: 'boolean', multiValued: false, required: false },\n ]},\n { name: 'externalId', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n ],\n meta: {\n resourceType: 'Schema',\n location: `/scim/v2/Schemas/${SCIM_SCHEMAS.USER}`,\n },\n} as const;\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM Resource Types Definition (RFC 7644 §4)\n// ═══════════════════════════════════════════════════════════════\n\nexport const SCIM_RESOURCE_TYPES = [{\n schemas: [SCIM_SCHEMAS.RESOURCE_TYPE],\n id: 'User',\n name: 'User',\n endpoint: '/Users',\n description: 'User Account',\n schema: SCIM_SCHEMAS.USER,\n schemaExtensions: [{\n schema: SCIM_SCHEMAS.ENTERPRISE_USER,\n required: false,\n }],\n meta: {\n resourceType: 'ResourceType',\n location: '/scim/v2/ResourceTypes/User',\n },\n}] as const;\n"]}
1
+ {"version":3,"file":"scim-protocol.backend.schemas.js","sourceRoot":"","sources":["../../../../../src/security/scim/models/scim-prot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QACJ,YAAY,EAAE,QAAQ;QACtB,QAAQ,EAAE,oBAAoB,YAAY,CAAC,IAAI,EAAE;KAClD;CACO,CAAC;AAEX,kEAAkE;AAClE,+CAA+C;AAC/C,kEAAkE;AAElE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;QAClC,OAAO,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC;QACrC,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,cAAc;QAC3B,MAAM,EAAE,YAAY,CAAC,IAAI;QACzB,gBAAgB,EAAE,CAAC;gBACjB,MAAM,EAAE,YAAY,CAAC,eAAe;gBACpC,QAAQ,EAAE,KAAK;aAChB,CAAC;QACF,IAAI,EAAE;YACJ,YAAY,EAAE,cAAc;YAC5B,QAAQ,EAAE,6BAA6B;SACxC;KACF,CAAU,CAAC","sourcesContent":["/**\n * SCIM Protocol Schemas — Step 20\n * \n * SCIM 2.0 types, attribute mapping, and protocol constants for directory provisioning.\n * \n * Decision 13: Lean SCIM — Users only in v1, no Groups, no generic adapter.\n * SCIM_USER_ATTRIBUTE_MAP maps SCIM attributes → NormalizedUserProfile fields\n * (the same type used by SSO JIT provisioning in Step 4/15).\n *\n * Token schema has moved to @wildo-ai/saas-models (scimTokensPolymorphicDeclaration).\n */\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM User Attribute Mapping\n// ═══════════════════════════════════════════════════════════════\n\n/**\n * Maps SCIM User resource attribute paths to NormalizedUserProfile fields.\n * Hardcoded for v1 — only the SCIM User resource is supported.\n * \n * FUTURE: If SCIM Groups or custom resources are needed, extract this into a\n * generic SCIMResourceMappingRegistry. See Decision 13 for the architecture.\n */\nexport const SCIM_USER_ATTRIBUTE_MAP = {\n 'userName': 'email',\n 'name.givenName': 'firstName',\n 'name.familyName': 'lastName',\n 'displayName': 'displayName',\n 'active': '_active', // computed: maps to user status (active/inactive)\n 'externalId': 'providerUserId',\n} as const;\n\n/**\n * Reverse map: NormalizedUserProfile field → SCIM attribute path.\n * Used by the response formatter to build SCIM User resources from internal data.\n */\nexport const PROFILE_TO_SCIM_ATTRIBUTE_MAP: Record<string, string> = Object.fromEntries(\n Object.entries(SCIM_USER_ATTRIBUTE_MAP).map(([scim, profile]) => [profile, scim])\n);\n\n/**\n * FUTURE: SCIM Groups → Organization Roles\n * SCIM Groups map to role assignments, not departments.\n * Example: Okta group \"Wildo Admins\" → ADMIN role.\n * Implementation: add /scim/v2/Groups endpoints with:\n * - POST/PUT/PATCH /Groups → create/update org roles\n * - Group membership changes → OrganizationMember role updates\n * - Group displayName → role identifier mapping (configurable per org)\n *\n * SCIM User department → OrganizationUnit: IMPLEMENTED (2026-08-01, WS-C). `department` from the\n * Enterprise User extension is bound to an organization unit through the EXPLICIT per-organization\n * `organizationUnitMapping` on the SCIM provisioning config — see\n * {@link extractScimDirectoryUnitValue} and `scim-organization-unit-mapping.shared.ts`. `division`\n * and `manager` remain unmapped: `division` would only be needed to disambiguate a search-based\n * match, and the declared mapping is unambiguous by construction, while `manager` is a reporting\n * relationship rather than a unit membership.\n */\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM Protocol Constants\n// ═══════════════════════════════════════════════════════════════\n\nexport const SCIM_SCHEMAS = {\n USER: 'urn:ietf:params:scim:schemas:core:2.0:User',\n ENTERPRISE_USER: 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User',\n LIST_RESPONSE: 'urn:ietf:params:scim:api:messages:2.0:ListResponse',\n ERROR: 'urn:ietf:params:scim:api:messages:2.0:Error',\n PATCH_OP: 'urn:ietf:params:scim:api:messages:2.0:PatchOp',\n BULK_REQUEST: 'urn:ietf:params:scim:api:messages:2.0:BulkRequest',\n BULK_RESPONSE: 'urn:ietf:params:scim:api:messages:2.0:BulkResponse',\n SERVICE_PROVIDER_CONFIG: 'urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig',\n RESOURCE_TYPE: 'urn:ietf:params:scim:schemas:core:2.0:ResourceType',\n SCHEMA: 'urn:ietf:params:scim:schemas:core:2.0:Schema',\n} as const;\n\nexport const SCIM_CONTENT_TYPE = 'application/scim+json';\n\n/**\n * Read the directory's `department` from an inbound SCIM User body.\n *\n * ## Why this is NOT an entry in `attributeMapping`\n *\n * Two independent reasons, and both matter:\n *\n * 1. **The path grammar cannot express it.** `resolveScimAttributePath` splits on `.`, and the\n * extension key is literally `urn:ietf:params:scim:schemas:extension:enterprise:2.0:User` — the\n * `2.0` contains a dot, so any dotted path would traverse into a key that does not exist.\n * 2. **There is nothing tenant-specific to configure.** `attributeMapping` exists because directories\n * disagree about where a value lives (`emails[0].value` vs `emails[type eq \"work\"].value`). The\n * enterprise extension URN is fixed BY THE SCIM SPEC, so a configurable path here would offer a\n * choice that has exactly one correct answer.\n *\n * The tenant-specific part — what a department VALUE means — is configured, in\n * `organizationUnitMapping`. This function only finds the value.\n *\n * Falls back to a top-level `department` because directories in the wild place it there when they do\n * not send the extension envelope. Returns `undefined` for anything non-string or blank, so an absent\n * department is unambiguous to the caller.\n */\nexport function extractScimDirectoryUnitValue(body: unknown): string | undefined {\n if (body === null || typeof body !== 'object') return undefined;\n\n const scimBody = body as Record<string, unknown>;\n const enterpriseExtension = scimBody[SCIM_SCHEMAS.ENTERPRISE_USER];\n const enterpriseDepartment =\n enterpriseExtension !== null && typeof enterpriseExtension === 'object'\n ? (enterpriseExtension as Record<string, unknown>)['department']\n : undefined;\n\n const rawDepartment = enterpriseDepartment ?? scimBody['department'];\n if (typeof rawDepartment !== 'string') return undefined;\n\n const department = rawDepartment.trim();\n return department.length > 0 ? department : undefined;\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM Error Types (RFC 7644 §3.12)\n// ═══════════════════════════════════════════════════════════════\n\nexport type SCIMErrorType =\n | 'invalidFilter'\n | 'tooMany'\n | 'uniqueness'\n | 'mutability'\n | 'invalidSyntax'\n | 'invalidPath'\n | 'noTarget'\n | 'invalidValue'\n | 'invalidVers'\n | 'sensitive';\n\nexport interface SCIMErrorResponse {\n schemas: [typeof SCIM_SCHEMAS.ERROR];\n status: string;\n detail: string;\n scimType?: SCIMErrorType;\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM PATCH Operation Types (RFC 7644 §3.5.2)\n// ═══════════════════════════════════════════════════════════════\n\nexport interface SCIMPatchOperation {\n op: 'add' | 'remove' | 'replace';\n path?: string;\n value?: unknown;\n}\n\nexport interface SCIMPatchRequest {\n schemas: string[];\n Operations: SCIMPatchOperation[];\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM Bulk Operation Types (RFC 7644 §3.7)\n// ═══════════════════════════════════════════════════════════════\n\nexport interface SCIMBulkOperation {\n method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n path: string;\n bulkId?: string;\n data?: Record<string, unknown>;\n}\n\nexport interface SCIMBulkRequest {\n schemas: [typeof SCIM_SCHEMAS.BULK_REQUEST];\n Operations: SCIMBulkOperation[];\n failOnErrors?: number;\n}\n\nexport interface SCIMBulkOperationResponse {\n method: string;\n bulkId?: string;\n location?: string;\n status: string;\n response?: SCIMErrorResponse;\n}\n\nexport interface SCIMBulkResponse {\n schemas: [typeof SCIM_SCHEMAS.BULK_RESPONSE];\n Operations: SCIMBulkOperationResponse[];\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM User Resource Type (RFC 7643 §4.1)\n// ═══════════════════════════════════════════════════════════════\n\nexport interface SCIMUserResource {\n schemas: string[];\n id: string;\n externalId?: string;\n userName: string;\n name?: {\n formatted?: string;\n familyName?: string;\n givenName?: string;\n };\n displayName?: string;\n active: boolean;\n emails?: Array<{\n value: string;\n type?: string;\n primary?: boolean;\n }>;\n meta: {\n resourceType: 'User';\n created: string;\n lastModified: string;\n location: string;\n };\n}\n\nexport interface SCIMListResponse<T = SCIMUserResource> {\n schemas: [typeof SCIM_SCHEMAS.LIST_RESPONSE];\n totalResults: number;\n startIndex: number;\n itemsPerPage: number;\n Resources: T[];\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM ServiceProviderConfig (RFC 7643 §5)\n// ═══════════════════════════════════════════════════════════════\n\n/**\n * Where an application's SCIM discovery document sends a directory administrator for\n * documentation. Authored per application (`auth.scimDocumentation`), because the RFC defines\n * `documentationUri` as the SERVICE PROVIDER's documentation — and the service provider is the\n * application, not the framework it was built with.\n *\n * spec-cite: RFC 7643 §5 — \"An HTTP-addressable URL pointing to the service provider's\n * human-consumable help documentation. OPTIONAL.\"\n */\nexport interface ScimDocumentationUris {\n /** RFC 7643 §5 `documentationUri` on the ServiceProviderConfig itself. */\n readonly serviceProviderUri?: string;\n /** RFC 7643 §5 `documentationUri` on the OAuth bearer-token authentication scheme. */\n readonly authenticationSchemeUri?: string;\n}\n\n/**\n * Build the SCIM ServiceProviderConfig this application serves at\n * `GET /scim/v2/ServiceProviderConfig` (RFC 7643 §5).\n *\n * Everything except the two documentation URLs is a statement about THIS implementation and is\n * therefore fixed: patch and bulk are supported, filtering is capped, `changePassword`, `sort` and\n * `etag` are not. Those are facts about the code, not choices an application makes.\n *\n * ## Why the two URLs are parameters, and why absence OMITS rather than empties\n *\n * They were frozen here, pointing at `docs.wildo.ai/scim` and `/scim/auth` — a host with no DNS\n * record, so every application built on Wildo told its enterprise customers to go somewhere that\n * does not resolve. Both are OPTIONAL in the RFC, so a discovery document without them is\n * conformant; one carrying a URL that answers nothing is a false advertisement served to the exact\n * reader who is trying to integrate.\n *\n * spec-cite: RFC 7643 §5 — both the top-level `documentationUri` and the `authenticationSchemes`\n * sub-attribute of the same name are marked \"OPTIONAL.\" \n *\n * An absent value therefore removes the KEY. Emitting `documentationUri: ''` or `null` would\n * replace an unanswerable URL with a malformed one, and a directory-service client that reads the\n * field before checking it would be worse off than if the framework had said nothing.\n */\nexport function buildScimServiceProviderConfig(documentation?: ScimDocumentationUris) {\n return {\n schemas: [SCIM_SCHEMAS.SERVICE_PROVIDER_CONFIG],\n ...(documentation?.serviceProviderUri ? { documentationUri: documentation.serviceProviderUri } : {}),\n patch: { supported: true },\n bulk: { supported: true, maxOperations: 100, maxPayloadSize: 1048576 },\n filter: { supported: true, maxResults: 200 },\n changePassword: { supported: false },\n sort: { supported: false },\n etag: { supported: false },\n authenticationSchemes: [{\n type: 'oauthbearertoken',\n name: 'OAuth Bearer Token',\n description: 'Authentication scheme using the OAuth Bearer Token Standard',\n specUri: 'https://www.rfc-editor.org/info/rfc6750',\n ...(documentation?.authenticationSchemeUri ? { documentationUri: documentation.authenticationSchemeUri } : {}),\n primary: true,\n }],\n meta: {\n resourceType: 'ServiceProviderConfig',\n location: '/scim/v2/ServiceProviderConfig',\n },\n };\n}\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM User Schema Definition (RFC 7643 §7)\n// ═══════════════════════════════════════════════════════════════\n\nexport const SCIM_USER_SCHEMA_DEFINITION = {\n schemas: [SCIM_SCHEMAS.SCHEMA],\n id: SCIM_SCHEMAS.USER,\n name: 'User',\n description: 'User Account',\n attributes: [\n { name: 'userName', type: 'string', multiValued: false, required: true, caseExact: false, mutability: 'readWrite', returned: 'default', uniqueness: 'server' },\n { name: 'name', type: 'complex', multiValued: false, required: false, mutability: 'readWrite', returned: 'default', subAttributes: [\n { name: 'givenName', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n { name: 'familyName', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n { name: 'formatted', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n ]},\n { name: 'displayName', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n { name: 'active', type: 'boolean', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n { name: 'emails', type: 'complex', multiValued: true, required: false, mutability: 'readWrite', returned: 'default', subAttributes: [\n { name: 'value', type: 'string', multiValued: false, required: true },\n { name: 'type', type: 'string', multiValued: false, required: false },\n { name: 'primary', type: 'boolean', multiValued: false, required: false },\n ]},\n { name: 'externalId', type: 'string', multiValued: false, required: false, mutability: 'readWrite', returned: 'default' },\n ],\n meta: {\n resourceType: 'Schema',\n location: `/scim/v2/Schemas/${SCIM_SCHEMAS.USER}`,\n },\n} as const;\n\n// ═══════════════════════════════════════════════════════════════\n// SCIM Resource Types Definition (RFC 7644 §4)\n// ═══════════════════════════════════════════════════════════════\n\nexport const SCIM_RESOURCE_TYPES = [{\n schemas: [SCIM_SCHEMAS.RESOURCE_TYPE],\n id: 'User',\n name: 'User',\n endpoint: '/Users',\n description: 'User Account',\n schema: SCIM_SCHEMAS.USER,\n schemaExtensions: [{\n schema: SCIM_SCHEMAS.ENTERPRISE_USER,\n required: false,\n }],\n meta: {\n resourceType: 'ResourceType',\n location: '/scim/v2/ResourceTypes/User',\n },\n}] as const;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"scim-attribute-path-resolver.backend.utils.d.ts","sourceRoot":"","sources":["../../../../../../src/security/scim/utils/scim-attribute-path-resolver.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAuDH;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAc5F"}
1
+ {"version":3,"file":"scim-attribute-path-resolver.backend.utils.d.ts","sourceRoot":"","sources":["../../../../../src/security/scim/utils/scim-attribute-path-resolver.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAuDH;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAc5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"scim-filter-parser.d.ts","sourceRoot":"","sources":["../../../../../../src/security/scim/utils/scim-filter-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;IACjC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAgE,GAClG,gBAAgB,CAQlB"}
1
+ {"version":3,"file":"scim-filter-parser.d.ts","sourceRoot":"","sources":["../../../../../src/security/scim/utils/scim-filter-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;IACjC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAgE,GAClG,gBAAgB,CAQlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"scim-response-formatter.d.ts","sourceRoot":"","sources":["../../../../../../src/security/scim/utils/scim-response-formatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,uEAAuE,CAAC;AAE/E,UAAU,WAAW;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CA6BlB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAC9E,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,gBAAgB,CAUlB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,aAAa,GACvB,iBAAiB,CAOnB"}
1
+ {"version":3,"file":"scim-response-formatter.d.ts","sourceRoot":"","sources":["../../../../../src/security/scim/utils/scim-response-formatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,uEAAuE,CAAC;AAE/E,UAAU,WAAW;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CA6BlB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAC9E,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,gBAAgB,CAUlB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,aAAa,GACvB,iBAAiB,CAOnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"session-invalidation-fence.backend.utils.d.ts","sourceRoot":"","sources":["../../../../src/security/session-invalidation-fence.backend.utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAExF;;;;GAIG;AACH,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAEvE,2DAA2D;AAC3D,MAAM,WAAW,+BAA+B;IAC9C,yFAAyF;IACzF,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,8BAA8B,EAC5C,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAAC,+BAA+B,CAAC,CAY1C"}
1
+ {"version":3,"file":"session-invalidation-fence.backend.utils.d.ts","sourceRoot":"","sources":["../../../src/security/session-invalidation-fence.backend.utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAExF;;;;GAIG;AACH,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAEvE,2DAA2D;AAC3D,MAAM,WAAW,+BAA+B;IAC9C,yFAAyF;IACzF,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,8BAA8B,EAC5C,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAAC,+BAA+B,CAAC,CAY1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"outbound-target-guard.backend.utils.d.ts","sourceRoot":"","sources":["../../../../../src/security/ssrf/outbound-target-guard.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAIH,8FAA8F;AAC9F,oBAAY,uBAAuB;IACjC,8EAA8E;IAC9E,4BAA4B,iCAAiC;IAC7D,gGAAgG;IAChG,kBAAkB,uBAAuB;IACzC,kGAAkG;IAClG,2BAA2B,gCAAgC;IAC3D,mGAAmG;IACnG,6BAA6B,kCAAkC;CAChE;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGlE;AAsCD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAsB,GAAG,OAAO,CA6BxG;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,gGAAgG;AAChG,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,uBAAuB,GAAG,SAAS,CAsB3H;AAED,uGAAuG;AACvG,oBAAY,wBAAwB;IAClC,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,GACpD,OAAO,CAAC,wBAAwB,CAAC,CAoBnC"}
1
+ {"version":3,"file":"outbound-target-guard.backend.utils.d.ts","sourceRoot":"","sources":["../../../../src/security/ssrf/outbound-target-guard.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAIH,8FAA8F;AAC9F,oBAAY,uBAAuB;IACjC,8EAA8E;IAC9E,4BAA4B,iCAAiC;IAC7D,gGAAgG;IAChG,kBAAkB,uBAAuB;IACzC,kGAAkG;IAClG,2BAA2B,gCAAgC;IAC3D,mGAAmG;IACnG,6BAA6B,kCAAkC;CAChE;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGlE;AAsCD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAsB,GAAG,OAAO,CA6BxG;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,gGAAgG;AAChG,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,uBAAuB,GAAG,SAAS,CAsB3H;AAED,uGAAuG;AACvG,oBAAY,wBAAwB;IAClC,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,GACpD,OAAO,CAAC,wBAAwB,CAAC,CAoBnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"outbound-target-guard.backend.utils.js","sourceRoot":"","sources":["../../../../../src/security/ssrf/outbound-target-guard.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,8FAA8F;AAC9F,MAAM,CAAN,IAAY,uBASX;AATD,WAAY,uBAAuB;IACjC,8EAA8E;IAC9E,wFAA6D,CAAA;IAC7D,gGAAgG;IAChG,oEAAyC,CAAA;IACzC,kGAAkG;IAClG,sFAA2D,CAAA;IAC3D,mGAAmG;IACnG,0FAA+D,CAAA;AACjE,CAAC,EATW,uBAAuB,KAAvB,uBAAuB,QASlC;AAED;;;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AAC,MAAM,CAAC;AACtC,CAAC","sourcesContent":["/**\n * The ONE classification of \"is this address one the public internet cannot reach?\".\n *\n * ## Why this module exists\n *\n * Wildo makes server-side HTTP requests to destinations that come from application- or\n * tenant-authored configuration: M2M webhook endpoints, A2A push-notification targets, SIEM\n * collectors, SSO metadata documents, OAuth client-metadata documents. Every one of those is a\n * server-side request forgery primitive by construction, and the classic targets are the same in all\n * of them — `169.254.169.254` (cloud instance metadata), loopback admin ports, RFC 1918 space.\n *\n * Before this module the answer was written TWICE, privately, and the two copies disagreed:\n *\n * | Copy | Missing from it |\n * |---|---|\n * | `a2a-push-notification.backend.schemas.ts` (`isPrivateOrReservedAddress`) | IPv6 multicast `ff00::/8` |\n * | `cimd-client-metadata.backend.service.ts` (`isInternalAddress`) | `192.0.0.0/24` (IETF protocol assignments), `198.18.0.0/15` (benchmarking), the IPv4-mapped IPv6 HEX notation (`::ffff:a9fe:a9fe`), and the full `fe80::/10` link-local block (it matched only the literal `fe80:` prefix) |\n *\n * Both were written carefully, by authors who had read OWASP, eight months apart. Neither could see\n * the other because each was a module-private function — the exact shape\n * `.claude/rules/invariant-call-site-enumeration.md` #13 records, where the enumeration returns 1/1\n * and is *correct*, because the other site does not mention the symbol you searched for. The set\n * below is the UNION, so both call sites strictly improve.\n *\n * ## Block-list, not allow-list — and OWASP says why\n *\n * spec-cite: OWASP Server Side Request Forgery Prevention Cheat Sheet — *\"Case 2: application can\n * send request to ANY external IP address or domain name\"*, whose remedy is block-listing the\n * non-public ranges. An allow-list is unavailable here by construction: a tenant's webhook receiver,\n * an unknown OAuth client's metadata host and a customer's SIEM collector are all strangers.\n *\n * The ranges are an ALLOW-NOTHING list rather than a deny-list of known-bad addresses. A new reserved\n * block is far rarer than a new interesting internal service, so an unrecognised shape must not be\n * admitted merely because nobody enumerated it.\n *\n * ## What this CANNOT do, stated rather than hidden\n *\n * {@link isPrivateOrReservedIpAddress} classifies an ADDRESS. {@link classifyOutboundTargetUrl}\n * classifies a URL's SHAPE and, for a literal-IP host, its address. Neither resolves DNS, so\n * `evil.test` with an A record of `10.0.0.5` passes both. Resolving at validation time would not\n * close it either — DNS can answer differently at connect time (rebinding) — so the complete defence\n * is enforcement in the egress path. Callers that want the intermediate strength\n * ({@link resolvesOnlyToPublicAddresses}) get an explicit check-then-connect with that residual named.\n *\n * **That egress-path enforcement now EXISTS**, in the sibling module\n * `pinned-outbound-fetch.backend.utils.ts`: it classifies inside the connection's `lookup` hook, so\n * the address validated and the address connected to are one value in one event. Every function here\n * remains a pure classifier and keeps its stated residual — what changed is that a caller no longer\n * has to live with it. A caller that makes the request itself, with its own `fetch`, still does.\n */\n\nimport { isIP } from 'node:net';\n\n/** Why an outbound target was refused. A closed vocabulary so caller messages stay stable. */\nexport enum OutboundTargetRejection {\n /** Not parseable as an absolute URL, or not on a scheme the caller admits. */\n NOT_ABSOLUTE_ADMITTED_SCHEME = 'not_absolute_admitted_scheme',\n /** `https://user:pass@host` — the credentials would be replayed on every request and logged. */\n CREDENTIALS_IN_URL = 'credentials_in_url',\n /** A literal IP inside a private, loopback, link-local, multicast or otherwise reserved range. */\n PRIVATE_OR_RESERVED_ADDRESS = 'private_or_reserved_address',\n /** A hostname that resolves into the deployment's own network by DEFINITION rather than by DNS. */\n RESERVED_SPECIAL_USE_HOSTNAME = 'reserved_special_use_hostname',\n}\n\n/**\n * Hostnames that reach the local machine by DEFINITION rather than by DNS answer.\n *\n * Deliberately grounded in special-use name registries instead of a list of cloud metadata\n * hostnames: a vendor list needs maintaining, names vendors in engine code, and is always one\n * provider behind.\n *\n * spec-cite: RFC 6761 §6.3 (`localhost` and any name ending in `.localhost` are special-use and\n * resolve to a loopback address) · RFC 6762 §3 (`.local` is reserved for link-local multicast DNS).\n */\nexport function isReservedSpecialUseHostname(host: string): boolean {\n const name = host.toLowerCase().replace(/\\.$/, ''); // a trailing dot is a fully-qualified form of the same name\n return name === 'localhost' || name.endsWith('.localhost') || name === 'local' || name.endsWith('.local');\n}\n\n/**\n * Is this literal IPv4 address one no externally-reachable service can live at?\n *\n * A MALFORMED address returns `true` — fail closed. A caller that cannot even parse the host it is\n * about to connect to has no basis for admitting it, and the alternative (admit what we could not\n * classify) is how notation tricks get through.\n */\nfunction isPrivateOrReservedIpv4(address: string): boolean {\n const parts = address.split('.').map((part) => Number(part));\n if (parts.length !== 4 || parts.some((part) => !Number.isInteger(part) || part < 0 || part > 255)) {\n return true;\n }\n const [a, b, c] = parts;\n return (\n a === 0 // \"this network\" — RFC 1122\n || a === 10 // RFC 1918\n || a === 127 // loopback\n || (a === 100 && b >= 64 && b <= 127) // RFC 6598 carrier-grade NAT\n || (a === 169 && b === 254) // link-local — INCLUDES 169.254.169.254, cloud metadata\n || (a === 172 && b >= 16 && b <= 31) // RFC 1918\n /**\n * RFC 6890 IETF protocol assignments — `192.0.0.0/**24**`, not `/16`.\n *\n * The A2A copy this list was merged from tested `a === 192 && b === 0`, which is a /16 and\n * therefore over-blocked ~65,000 ORDINARY PUBLIC addresses (`192.0.1.x`, `192.0.3.x`, …) that are\n * regular allocated space. Narrowed here to what the registry actually reserves, because an\n * over-wide range is not \"extra safe\" — it silently refuses legitimate customer endpoints, and it\n * is exactly the failure the adjacent-public controls in the test suite exist to catch.\n */\n || (a === 192 && b === 0 && c === 0)\n || (a === 192 && b === 168) // RFC 1918\n || (a === 198 && (b === 18 || b === 19)) // RFC 2544 benchmarking\n || a >= 224 // multicast 224/4, reserved 240/4, broadcast\n );\n}\n\n/**\n * Is this literal IP address (v4 or v6) one no externally-reachable service can live at?\n *\n * `ipVersion` may be supplied when the caller already computed it; otherwise it is derived. A value\n * that is not an IP at all returns `false` — this function answers a question about ADDRESSES, and a\n * hostname is the caller's job (see {@link isReservedSpecialUseHostname} and\n * {@link resolvesOnlyToPublicAddresses}).\n */\nexport function isPrivateOrReservedIpAddress(address: string, ipVersion: number = isIP(address)): boolean {\n if (ipVersion === 4) return isPrivateOrReservedIpv4(address);\n if (ipVersion !== 6) return false;\n\n const v6 = address.toLowerCase();\n if (v6 === '::' || v6 === '::1') return true; // unspecified, loopback\n if (/^f[cd]/.test(v6)) return true; // unique-local fc00::/7\n if (/^fe[89ab]/.test(v6)) return true; // link-local fe80::/10 — the WHOLE block\n if (/^ff/.test(v6)) return true; // multicast ff00::/8\n\n /**\n * IPv4-mapped — the same address wearing a different notation, and the notation that got past the\n * first version of the A2A guard. `new URL()` NORMALISES `::ffff:169.254.169.254` to\n * `::ffff:a9fe:a9fe`, so matching only the dotted form let the cloud metadata address through while\n * every dotted-form pin stayed green. Both spellings are handled: the hex form is what arrives from\n * a parsed URL, the dotted form is what arrives from a config read back out of storage or from a\n * DNS answer.\n */\n const mappedDotted = v6.match(/^::ffff:(\\d+\\.\\d+\\.\\d+\\.\\d+)$/);\n if (mappedDotted) return isPrivateOrReservedIpv4(mappedDotted[1]);\n\n const mappedHex = v6.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/);\n if (mappedHex) {\n const high = parseInt(mappedHex[1], 16);\n const low = parseInt(mappedHex[2], 16);\n return isPrivateOrReservedIpv4(`${(high >> 8) & 0xff}.${high & 0xff}.${(low >> 8) & 0xff}.${low & 0xff}`);\n }\n\n return false;\n}\n\n/** Strip the brackets a parsed URL puts around an IPv6 literal, so `isIP` can read it. */\nexport function unwrapUrlHost(hostname: string): string {\n return hostname.replace(/^\\[|\\]$/g, '');\n}\n\n/** What a caller admits, so one classifier can serve callers with different scheme policies. */\nexport interface OutboundTargetPolicy {\n /**\n * Schemes the caller will issue a request on. Pass `['https:']` where the value in transit is a\n * credential; pass `['https:', 'http:']` where refusing plaintext would break existing authored\n * configuration and that decision has not been taken.\n */\n admittedProtocols: readonly string[];\n}\n\n/**\n * Classify a target URL a caller is about to request, refusing the shapes that turn this server into\n * a request-forgery tool.\n *\n * Returns `undefined` for an admitted target. An ordinary hostname is admitted — see the module\n * header for why that is a stated residual rather than an oversight.\n */\nexport function classifyOutboundTargetUrl(rawUrl: string, policy: OutboundTargetPolicy): OutboundTargetRejection | undefined {\n let url: URL;\n try {\n url = new URL(rawUrl);\n } catch {\n return OutboundTargetRejection.NOT_ABSOLUTE_ADMITTED_SCHEME;\n }\n\n if (!policy.admittedProtocols.includes(url.protocol)) {\n return OutboundTargetRejection.NOT_ABSOLUTE_ADMITTED_SCHEME;\n }\n if (url.username || url.password) {\n return OutboundTargetRejection.CREDENTIALS_IN_URL;\n }\n\n const host = unwrapUrlHost(url.hostname);\n const ipVersion = isIP(host);\n if (ipVersion === 0) {\n return isReservedSpecialUseHostname(host) ? OutboundTargetRejection.RESERVED_SPECIAL_USE_HOSTNAME : undefined;\n }\n\n return isPrivateOrReservedIpAddress(host, ipVersion) ? OutboundTargetRejection.PRIVATE_OR_RESERVED_ADDRESS : undefined;\n}\n\n/** Outcome of the DNS-resolving half, kept separate because \"did not resolve\" is not \"is internal\". */\nexport enum OutboundTargetResolution {\n PUBLIC = 'public',\n INTERNAL = 'internal',\n UNRESOLVABLE = 'unresolvable',\n}\n\n/**\n * Resolve a hostname and check EVERY answer, not just the first.\n *\n * DNS is resolved rather than the hostname trusted, because `internal.example.com` may be a public\n * name with a private A record — the attack a shape check cannot see. Every resolved address is\n * checked because a hostile resolver can return one public and one private address and rely on the\n * client picking the other.\n *\n * ⚠️ Residual, stated rather than hidden: this is a check-then-connect, so a DNS entry that changes\n * between the two (rebinding) is not covered by THIS function. Closing it needs the request pinned to\n * the validated address — which Node's `fetch` does not expose, but `node:https`'s `lookup` hook\n * does. `pinnedOutboundFetch` is built on that hook; a caller that issues its request through it has\n * the residual closed, and a caller that does not, does not.\n *\n * `resolve` is injectable so callers can test the internal/public branches without a resolver.\n */\nexport async function resolvesOnlyToPublicAddresses(\n hostname: string,\n resolve: (host: string) => Promise<readonly string[]>,\n): Promise<OutboundTargetResolution> {\n const literal = unwrapUrlHost(hostname);\n if (isIP(literal) !== 0) {\n return isPrivateOrReservedIpAddress(literal) ? OutboundTargetResolution.INTERNAL : OutboundTargetResolution.PUBLIC;\n }\n\n let addresses: readonly string[];\n try {\n addresses = await resolve(hostname);\n } catch {\n return OutboundTargetResolution.UNRESOLVABLE;\n }\n\n // An empty answer is treated as INTERNAL rather than UNRESOLVABLE: the resolver succeeded and told\n // us nothing usable, which is not evidence the name is safe.\n if (addresses.length === 0) return OutboundTargetResolution.INTERNAL;\n\n return addresses.some((address) => isPrivateOrReservedIpAddress(address))\n ? OutboundTargetResolution.INTERNAL\n : OutboundTargetResolution.PUBLIC;\n}\n"]}
1
+ {"version":3,"file":"outbound-target-guard.backend.utils.js","sourceRoot":"","sources":["../../../../src/security/ssrf/outbound-target-guard.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,8FAA8F;AAC9F,MAAM,CAAN,IAAY,uBASX;AATD,WAAY,uBAAuB;IACjC,8EAA8E;IAC9E,wFAA6D,CAAA;IAC7D,gGAAgG;IAChG,oEAAyC,CAAA;IACzC,kGAAkG;IAClG,sFAA2D,CAAA;IAC3D,mGAAmG;IACnG,0FAA+D,CAAA;AACjE,CAAC,EATW,uBAAuB,KAAvB,uBAAuB,QASlC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAAY;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,4DAA4D;IAChH,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC5G,CAAC;AAED;;;;;;GAMG;AACH,SAAS,uBAAuB,CAAC,OAAe;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAA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GAeG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,QAAgB,EAChB,OAAqD;IAErD,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,4BAA4B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,wBAAwB,CAAC,MAAM,CAAC;IACrH,CAAC;IAED,IAAI,SAA4B,CAAC;IACjC,IAAI,CAAC;QACH,SAAS,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,wBAAwB,CAAC,YAAY,CAAC;IAC/C,CAAC;IAED,mGAAmG;IACnG,6DAA6D;IAC7D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,wBAAwB,CAAC,QAAQ,CAAC;IAErE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;QACvE,CAAC,CAAC,wBAAwB,CAAC,QAAQ;QACnC,CAAC,CAAC,wBAAwB,CAAC,MAAM,CAAC;AACtC,CAAC","sourcesContent":["/**\n * The ONE classification of \"is this address one the public internet cannot reach?\".\n *\n * ## Why this module exists\n *\n * Wildo makes server-side HTTP requests to destinations that come from application- or\n * tenant-authored configuration: M2M webhook endpoints, A2A push-notification targets, SIEM\n * collectors, SSO metadata documents, OAuth client-metadata documents. Every one of those is a\n * server-side request forgery primitive by construction, and the classic targets are the same in all\n * of them — `169.254.169.254` (cloud instance metadata), loopback admin ports, RFC 1918 space.\n *\n * Before this module the answer was written TWICE, privately, and the two copies disagreed:\n *\n * | Copy | Missing from it |\n * |---|---|\n * | `a2a-push-notification.backend.schemas.ts` (`isPrivateOrReservedAddress`) | IPv6 multicast `ff00::/8` |\n * | `cimd-client-metadata.backend.service.ts` (`isInternalAddress`) | `192.0.0.0/24` (IETF protocol assignments), `198.18.0.0/15` (benchmarking), the IPv4-mapped IPv6 HEX notation (`::ffff:a9fe:a9fe`), and the full `fe80::/10` link-local block (it matched only the literal `fe80:` prefix) |\n *\n * Both were written carefully, by authors who had read OWASP, eight months apart. Neither could see\n * the other because each was a module-private function — the exact shape\n * `.claude/rules/invariant-call-site-enumeration.md` #13 records, where the enumeration returns 1/1\n * and is *correct*, because the other site does not mention the symbol you searched for. The set\n * below is the UNION, so both call sites strictly improve.\n *\n * ## Block-list, not allow-list — and OWASP says why\n *\n * spec-cite: OWASP Server Side Request Forgery Prevention Cheat Sheet — *\"Case 2: application can\n * send request to ANY external IP address or domain name\"*, whose remedy is block-listing the\n * non-public ranges. An allow-list is unavailable here by construction: a tenant's webhook receiver,\n * an unknown OAuth client's metadata host and a customer's SIEM collector are all strangers.\n *\n * The ranges are an ALLOW-NOTHING list rather than a deny-list of known-bad addresses. A new reserved\n * block is far rarer than a new interesting internal service, so an unrecognised shape must not be\n * admitted merely because nobody enumerated it.\n *\n * ## What this CANNOT do, stated rather than hidden\n *\n * {@link isPrivateOrReservedIpAddress} classifies an ADDRESS. {@link classifyOutboundTargetUrl}\n * classifies a URL's SHAPE and, for a literal-IP host, its address. Neither resolves DNS, so\n * `evil.test` with an A record of `10.0.0.5` passes both. Resolving at validation time would not\n * close it either — DNS can answer differently at connect time (rebinding) — so the complete defence\n * is enforcement in the egress path. Callers that want the intermediate strength\n * ({@link resolvesOnlyToPublicAddresses}) get an explicit check-then-connect with that residual named.\n *\n * **That egress-path enforcement now EXISTS**, in the sibling module\n * `pinned-outbound-fetch.backend.utils.ts`: it classifies inside the connection's `lookup` hook, so\n * the address validated and the address connected to are one value in one event. Every function here\n * remains a pure classifier and keeps its stated residual — what changed is that a caller no longer\n * has to live with it. A caller that makes the request itself, with its own `fetch`, still does.\n */\n\nimport { isIP } from 'node:net';\n\n/** Why an outbound target was refused. A closed vocabulary so caller messages stay stable. */\nexport enum OutboundTargetRejection {\n /** Not parseable as an absolute URL, or not on a scheme the caller admits. */\n NOT_ABSOLUTE_ADMITTED_SCHEME = 'not_absolute_admitted_scheme',\n /** `https://user:pass@host` — the credentials would be replayed on every request and logged. */\n CREDENTIALS_IN_URL = 'credentials_in_url',\n /** A literal IP inside a private, loopback, link-local, multicast or otherwise reserved range. */\n PRIVATE_OR_RESERVED_ADDRESS = 'private_or_reserved_address',\n /** A hostname that resolves into the deployment's own network by DEFINITION rather than by DNS. */\n RESERVED_SPECIAL_USE_HOSTNAME = 'reserved_special_use_hostname',\n}\n\n/**\n * Hostnames that reach the local machine by DEFINITION rather than by DNS answer.\n *\n * Deliberately grounded in special-use name registries instead of a list of cloud metadata\n * hostnames: a vendor list needs maintaining, names vendors in engine code, and is always one\n * provider behind.\n *\n * spec-cite: RFC 6761 §6.3 (`localhost` and any name ending in `.localhost` are special-use and\n * resolve to a loopback address) · RFC 6762 §3 (`.local` is reserved for link-local multicast DNS).\n */\nexport function isReservedSpecialUseHostname(host: string): boolean {\n const name = host.toLowerCase().replace(/\\.$/, ''); // a trailing dot is a fully-qualified form of the same name\n return name === 'localhost' || name.endsWith('.localhost') || name === 'local' || name.endsWith('.local');\n}\n\n/**\n * Is this literal IPv4 address one no externally-reachable service can live at?\n *\n * A MALFORMED address returns `true` — fail closed. A caller that cannot even parse the host it is\n * about to connect to has no basis for admitting it, and the alternative (admit what we could not\n * classify) is how notation tricks get through.\n */\nfunction isPrivateOrReservedIpv4(address: string): boolean {\n const parts = address.split('.').map((part) => Number(part));\n if (parts.length !== 4 || parts.some((part) => !Number.isInteger(part) || part < 0 || part > 255)) {\n return true;\n }\n const [a, b, c] = parts;\n return (\n a === 0 // \"this network\" — RFC 1122\n || a === 10 // RFC 1918\n || a === 127 // loopback\n || (a === 100 && b >= 64 && b <= 127) // RFC 6598 carrier-grade NAT\n || (a === 169 && b === 254) // link-local — INCLUDES 169.254.169.254, cloud metadata\n || (a === 172 && b >= 16 && b <= 31) // RFC 1918\n /**\n * RFC 6890 IETF protocol assignments — `192.0.0.0/**24**`, not `/16`.\n *\n * The A2A copy this list was merged from tested `a === 192 && b === 0`, which is a /16 and\n * therefore over-blocked ~65,000 ORDINARY PUBLIC addresses (`192.0.1.x`, `192.0.3.x`, …) that are\n * regular allocated space. Narrowed here to what the registry actually reserves, because an\n * over-wide range is not \"extra safe\" — it silently refuses legitimate customer endpoints, and it\n * is exactly the failure the adjacent-public controls in the test suite exist to catch.\n */\n || (a === 192 && b === 0 && c === 0)\n || (a === 192 && b === 168) // RFC 1918\n || (a === 198 && (b === 18 || b === 19)) // RFC 2544 benchmarking\n || a >= 224 // multicast 224/4, reserved 240/4, broadcast\n );\n}\n\n/**\n * Is this literal IP address (v4 or v6) one no externally-reachable service can live at?\n *\n * `ipVersion` may be supplied when the caller already computed it; otherwise it is derived. A value\n * that is not an IP at all returns `false` — this function answers a question about ADDRESSES, and a\n * hostname is the caller's job (see {@link isReservedSpecialUseHostname} and\n * {@link resolvesOnlyToPublicAddresses}).\n */\nexport function isPrivateOrReservedIpAddress(address: string, ipVersion: number = isIP(address)): boolean {\n if (ipVersion === 4) return isPrivateOrReservedIpv4(address);\n if (ipVersion !== 6) return false;\n\n const v6 = address.toLowerCase();\n if (v6 === '::' || v6 === '::1') return true; // unspecified, loopback\n if (/^f[cd]/.test(v6)) return true; // unique-local fc00::/7\n if (/^fe[89ab]/.test(v6)) return true; // link-local fe80::/10 — the WHOLE block\n if (/^ff/.test(v6)) return true; // multicast ff00::/8\n\n /**\n * IPv4-mapped — the same address wearing a different notation, and the notation that got past the\n * first version of the A2A guard. `new URL()` NORMALISES `::ffff:169.254.169.254` to\n * `::ffff:a9fe:a9fe`, so matching only the dotted form let the cloud metadata address through while\n * every dotted-form pin stayed green. Both spellings are handled: the hex form is what arrives from\n * a parsed URL, the dotted form is what arrives from a config read back out of storage or from a\n * DNS answer.\n */\n const mappedDotted = v6.match(/^::ffff:(\\d+\\.\\d+\\.\\d+\\.\\d+)$/);\n if (mappedDotted) return isPrivateOrReservedIpv4(mappedDotted[1]);\n\n const mappedHex = v6.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/);\n if (mappedHex) {\n const high = parseInt(mappedHex[1], 16);\n const low = parseInt(mappedHex[2], 16);\n return isPrivateOrReservedIpv4(`${(high >> 8) & 0xff}.${high & 0xff}.${(low >> 8) & 0xff}.${low & 0xff}`);\n }\n\n return false;\n}\n\n/** Strip the brackets a parsed URL puts around an IPv6 literal, so `isIP` can read it. */\nexport function unwrapUrlHost(hostname: string): string {\n return hostname.replace(/^\\[|\\]$/g, '');\n}\n\n/** What a caller admits, so one classifier can serve callers with different scheme policies. */\nexport interface OutboundTargetPolicy {\n /**\n * Schemes the caller will issue a request on. Pass `['https:']` where the value in transit is a\n * credential; pass `['https:', 'http:']` where refusing plaintext would break existing authored\n * configuration and that decision has not been taken.\n */\n admittedProtocols: readonly string[];\n}\n\n/**\n * Classify a target URL a caller is about to request, refusing the shapes that turn this server into\n * a request-forgery tool.\n *\n * Returns `undefined` for an admitted target. An ordinary hostname is admitted — see the module\n * header for why that is a stated residual rather than an oversight.\n */\nexport function classifyOutboundTargetUrl(rawUrl: string, policy: OutboundTargetPolicy): OutboundTargetRejection | undefined {\n let url: URL;\n try {\n url = new URL(rawUrl);\n } catch {\n return OutboundTargetRejection.NOT_ABSOLUTE_ADMITTED_SCHEME;\n }\n\n if (!policy.admittedProtocols.includes(url.protocol)) {\n return OutboundTargetRejection.NOT_ABSOLUTE_ADMITTED_SCHEME;\n }\n if (url.username || url.password) {\n return OutboundTargetRejection.CREDENTIALS_IN_URL;\n }\n\n const host = unwrapUrlHost(url.hostname);\n const ipVersion = isIP(host);\n if (ipVersion === 0) {\n return isReservedSpecialUseHostname(host) ? OutboundTargetRejection.RESERVED_SPECIAL_USE_HOSTNAME : undefined;\n }\n\n return isPrivateOrReservedIpAddress(host, ipVersion) ? OutboundTargetRejection.PRIVATE_OR_RESERVED_ADDRESS : undefined;\n}\n\n/** Outcome of the DNS-resolving half, kept separate because \"did not resolve\" is not \"is internal\". */\nexport enum OutboundTargetResolution {\n PUBLIC = 'public',\n INTERNAL = 'internal',\n UNRESOLVABLE = 'unresolvable',\n}\n\n/**\n * Resolve a hostname and check EVERY answer, not just the first.\n *\n * DNS is resolved rather than the hostname trusted, because `internal.example.com` may be a public\n * name with a private A record — the attack a shape check cannot see. Every resolved address is\n * checked because a hostile resolver can return one public and one private address and rely on the\n * client picking the other.\n *\n * ⚠️ Residual, stated rather than hidden: this is a check-then-connect, so a DNS entry that changes\n * between the two (rebinding) is not covered by THIS function. Closing it needs the request pinned to\n * the validated address — which Node's `fetch` does not expose, but `node:https`'s `lookup` hook\n * does. `pinnedOutboundFetch` is built on that hook; a caller that issues its request through it has\n * the residual closed, and a caller that does not, does not.\n *\n * `resolve` is injectable so callers can test the internal/public branches without a resolver.\n */\nexport async function resolvesOnlyToPublicAddresses(\n hostname: string,\n resolve: (host: string) => Promise<readonly string[]>,\n): Promise<OutboundTargetResolution> {\n const literal = unwrapUrlHost(hostname);\n if (isIP(literal) !== 0) {\n return isPrivateOrReservedIpAddress(literal) ? OutboundTargetResolution.INTERNAL : OutboundTargetResolution.PUBLIC;\n }\n\n let addresses: readonly string[];\n try {\n addresses = await resolve(hostname);\n } catch {\n return OutboundTargetResolution.UNRESOLVABLE;\n }\n\n // An empty answer is treated as INTERNAL rather than UNRESOLVABLE: the resolver succeeded and told\n // us nothing usable, which is not evidence the name is safe.\n if (addresses.length === 0) return OutboundTargetResolution.INTERNAL;\n\n return addresses.some((address) => isPrivateOrReservedIpAddress(address))\n ? OutboundTargetResolution.INTERNAL\n : OutboundTargetResolution.PUBLIC;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pinned-outbound-fetch.backend.utils.d.ts","sourceRoot":"","sources":["../../../../../src/security/ssrf/pinned-outbound-fetch.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAMnE,OAAO,EACL,uBAAuB,EAGvB,KAAK,oBAAoB,EAC1B,MAAM,sEAAsE,CAAC;AAE9E;;;;;;;GAOG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;aASjC,SAAS,EAAE,uBAAuB;aAClC,cAAc,CAAC,EAAE,MAAM;IATzC;;;;OAIG;IACH,SAAgB,IAAI,mCAAmC;gBAGrC,SAAS,EAAE,uBAAuB,EAClC,cAAc,CAAC,EAAE,MAAM;CAK1C;AAED,sGAAsG;AACtG,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;AAE5F,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AA8CD;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAoH5G"}
1
+ {"version":3,"file":"pinned-outbound-fetch.backend.utils.d.ts","sourceRoot":"","sources":["../../../../src/security/ssrf/pinned-outbound-fetch.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAMnE,OAAO,EACL,uBAAuB,EAGvB,KAAK,oBAAoB,EAC1B,MAAM,sEAAsE,CAAC;AAE9E;;;;;;;GAOG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;aASjC,SAAS,EAAE,uBAAuB;aAClC,cAAc,CAAC,EAAE,MAAM;IATzC;;;;OAIG;IACH,SAAgB,IAAI,mCAAmC;gBAGrC,SAAS,EAAE,uBAAuB,EAClC,cAAc,CAAC,EAAE,MAAM;CAK1C;AAED,sGAAsG;AACtG,MAAM,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;AAE5F,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CAC1C;AA8CD;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAoH5G"}
@@ -1 +1 @@
1
- {"version":3,"file":"pinned-outbound-fetch.backend.utils.js","sourceRoot":"","sources":["../../../../../src/security/ssrf/pinned-outbound-fetch.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,KAAK,CAAC,CAAC;yBAC3D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;wBAAE,KAAK,MAAM,GAAG,IAAI,KAAK;4BAAE,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC5F,CAAC;gBACD,eAAe,CACb,IAAI,QAAQ;gBACV,iFAAiF;gBACjF,kDAAkD;gBAClD,QAAQ,CAAC,UAAU,KAAK,GAAG,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG;oBACxD,CAAC,CAAC,IAAI;oBACN,CAAC,CAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAgC,EAC5D;oBACE,MAAM,EAAE,QAAQ,CAAC,UAAU,IAAI,GAAG;oBAClC,UAAU,EAAE,QAAQ,CAAC,aAAa,IAAI,EAAE;oBACxC,OAAO,EAAE,eAAe;iBACzB,CACF,CACF,CAAC;YACJ,CAAC,CACF,CAAC;YAEF,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YACpC,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5C,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,+FAA+F;QAC/F,wFAAwF;QACxF,IAAI,cAAc;YAAE,MAAM,cAAc,CAAC;QACzC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["/**\n * An outbound HTTP request that CONNECTS to the address it VALIDATED — the half\n * {@link classifyOutboundTargetUrl} and {@link resolvesOnlyToPublicAddresses} structurally cannot do.\n *\n * ## The hole this closes, and why the classifier alone could never close it\n *\n * Every guard in the sibling module answers a question and then hands the answer to somebody else,\n * who makes a SEPARATE connection. That is a check-then-connect, and the guard's own header says so:\n *\n * \"⚠️ Residual, stated rather than hidden: this is a check-then-connect, so a DNS entry that\n * changes between the two (rebinding) is not covered. Closing it needs the request pinned to the\n * validated address, which Node's `fetch` does not expose.\"\n *\n * So a name whose A record answers `93.184.216.34` to the validating resolver and `169.254.169.254`\n * to the connecting one passes every check in this directory and still reaches cloud instance\n * metadata. The window is small and entirely attacker-controlled: the attacker owns the zone, so the\n * attacker chooses the TTL and therefore the width of the window.\n *\n * The classifier cannot fix this at any level of effort, because the defect is not in the answer —\n * the answer was correct when it was given. The defect is that the answer is thrown away before the\n * socket is opened.\n *\n * ## The mechanism, chosen after measuring the alternatives\n *\n * `net.Socket.connect` accepts a **`lookup` hook**, and `http.request` / `https.request` pass it\n * straight through. Node calls it at CONNECT time, and the address it returns is the address the\n * socket is opened to — there is no second resolution and therefore no window. Classifying inside\n * the hook makes validation and connection the SAME event rather than two events with a gap.\n *\n * Measured on this Node (2026-09-08) rather than assumed, because each of these decided the design:\n *\n * | probe | result |\n * |---|---|\n * | is `lookup` called for a hostname? | yes, as `lookup(host, { hints, all: true }, cb)` — note `all` |\n * | is `lookup` called for an IP LITERAL? | **no** — `net` short-circuits, so literals need the shape check |\n * | does an error raised inside the hook reach the caller? | yes, same error object, `message` and `code` intact |\n * | does TLS still verify against the NAME while connected to the pinned IP? | **yes** — a cert for `pinned.test` validated over a socket to `127.0.0.1` |\n *\n * That last row is what makes the whole approach viable. Pinning by rewriting the URL's host to the\n * validated IP — the obvious alternative — breaks SNI and certificate verification, i.e. it trades an\n * SSRF hole for a transport-security hole. Pinning through `lookup` keeps the hostname everywhere it\n * is a security input (SNI, certificate subject, the `Host` header) and replaces it only where it is\n * a routing input.\n *\n * ## Why this is not `fetch` with a dispatcher\n *\n * Node's `fetch` exposes no `lookup` hook. The undici route (`new Agent({ connect: { lookup } })`)\n * would work, but undici is not a declared dependency of this package — it is present in the store\n * only transitively — so taking it would add a second HTTP stack beside the one Node already embeds,\n * for a hook `node:https` exposes natively. Rejected on that basis, not on preference.\n *\n * `node:https` also gives one property for free that `fetch` needs an option for: **it does not\n * follow redirects at all.** A 302 arrives as a 302 the caller can see. `redirect: 'error'` is\n * therefore not something this module has to remember to pass — following a redirect to a target the\n * guard never saw is unrepresentable here.\n *\n * ## What this still does NOT do\n *\n * It does not defend a target that is public at connect time and hostile at the application layer,\n * and it does not stop a public host from being an open proxy into somebody else's private network.\n * Those are different problems with different answers. What it removes is the specific gap between\n * \"we checked this name\" and \"we opened this socket\".\n *\n * assurance-control: WILDO.NETWORK.OUTBOUND_TARGET_CONTROL — a server-side request initiated from\n * application- or tenant-authored configuration reaches only an address the deployment admits\n */\n\nimport { lookup as dnsLookup, type LookupAddress } from 'node:dns';\nimport { request as httpRequest, Agent as HttpAgent, type ClientRequest, type IncomingMessage } from 'node:http';\nimport type { LookupFunction } from 'node:net';\nimport { request as httpsRequest, Agent as HttpsAgent } from 'node:https';\nimport { Readable } from 'node:stream';\n\nimport {\n OutboundTargetRejection,\n classifyOutboundTargetUrl,\n isPrivateOrReservedIpAddress,\n type OutboundTargetPolicy,\n} from '~wildo-backend-lib/security/ssrf/outbound-target-guard.backend.utils';\n\n/**\n * Raised when the target was refused. Carries the closed-vocabulary reason so a caller can map it\n * onto its OWN rejection vocabulary rather than pattern-matching a message.\n *\n * `refusedAddress` is present only for a connect-time refusal — it is the address the resolver\n * returned at the moment of connection, which is the evidence that a rebinding attempt happened\n * rather than a merely mis-authored URL.\n */\nexport class OutboundTargetRefusedError extends Error {\n /**\n * A stable `code` alongside the class, because the error crosses `net`'s internals on its way out\n * of the `lookup` hook. The class identity survives on this Node (measured), but a `code` is what\n * every other error in that path carries and it costs nothing to be robust to a future wrap.\n */\n public readonly code = 'WILDO_OUTBOUND_TARGET_REFUSED';\n\n constructor(\n public readonly rejection: OutboundTargetRejection,\n public readonly refusedAddress?: string,\n ) {\n super(`Outbound target refused: ${rejection}${refusedAddress ? ` (${refusedAddress})` : ''}`);\n this.name = 'OutboundTargetRefusedError';\n }\n}\n\n/** The `dns.lookup` shape the connection hook needs, injectable so a test can drive both branches. */\nexport type PinnedAddressResolver = (hostname: string) => Promise<readonly LookupAddress[]>;\n\nexport interface PinnedOutboundRequestInit extends OutboundTargetPolicy {\n method?: string;\n headers?: Readonly<Record<string, string>>;\n /** Already-serialized request body. `content-length` is computed here; do not pass one. */\n body?: string;\n signal?: AbortSignal;\n\n /**\n * OPERATOR-authored escape: admit an address the public internet cannot reach.\n *\n * It exists because one legitimate outbound target class genuinely lives on a private network — a\n * self-hosted SIEM collector on the same VPC as the application. Refusing that unconditionally\n * would not be \"safe\", it would break a supported deployment shape.\n *\n * Three properties keep it from being an SSRF bypass with a checkbox, and all three are the\n * caller's obligation rather than this module's:\n *\n * 1. **It is never the default.** Absent means refuse.\n * 2. **It must be authored by the DEPLOYMENT OPERATOR, never by the tenant whose row supplies the\n * URL.** A tenant-settable \"allow private addresses\" flag hands the attacker the switch that\n * disarms the guard aimed at them. This is why the SIEM escape lives on the application\n * configuration and not on `siemExportConfig`, which an organization administrator authors.\n * 3. **It must never reach a target class whose URL comes from an UNAUTHENTICATED stranger.** CIMD\n * resolves a `client_id` supplied by anyone who can reach the authorization endpoint; there is\n * no operator on earth who means \"let strangers address my metadata service\".\n *\n * Note what it does NOT relax: the scheme policy and the credentials-in-URL refusal still apply,\n * and the connection is still pinned. It widens WHICH addresses are admitted, never whether the\n * address that was admitted is the one connected to.\n */\n admitPrivateAddresses?: boolean;\n\n /**\n * Resolver used by the connection hook. Defaults to the system resolver.\n *\n * Injectable for the same reason `resolvesOnlyToPublicAddresses` takes one: the two branches that\n * matter (a name that answers public, a name that answers private) cannot be exercised against a\n * real resolver without owning a zone, and a rebinding pin needs a resolver that answers\n * DIFFERENTLY on its second call — which is exactly what no real resolver will do on demand.\n */\n resolveAddresses?: PinnedAddressResolver;\n}\n\n/**\n * Connections are NOT pooled, deliberately.\n *\n * Two reasons, in order of weight. First, a pooled socket skips the `lookup` hook on reuse, so the\n * connect-time classification would run on the first request to a host and not on later ones — the\n * guard would hold or not hold depending on pool state, which is the least auditable property a\n * security control can have. (Reuse would in fact be SAFE, because a pooled socket is already\n * connected to an address this module validated — but \"safe because of a subtlety in another\n * module's cache\" is not a property to rest a control on.) Second, these targets are strangers:\n * pooling keeps an idle socket open per tenant-authored host, which is an unbounded resource keyed\n * on attacker-supplied strings.\n *\n * The cost is one TCP+TLS handshake per request, on a path that runs at webhook cadence rather than\n * per user request.\n */\nconst PINNED_HTTP_AGENT = new HttpAgent({ keepAlive: false });\nconst PINNED_HTTPS_AGENT = new HttpsAgent({ keepAlive: false });\n\n/**\n * Classify the URL's SHAPE before anything leaves the process.\n *\n * This is not redundant with the connection hook, and the reason is measured: `net` short-circuits\n * DNS for an IP LITERAL, so `https://169.254.169.254/latest/meta-data` never calls `lookup` and the\n * hook would never see it. The shape check is the ONLY thing standing in front of a literal target.\n */\nfunction classifyShape(rawUrl: string, init: PinnedOutboundRequestInit): OutboundTargetRejection | undefined {\n const rejection = classifyOutboundTargetUrl(rawUrl, { admittedProtocols: init.admittedProtocols });\n if (rejection === undefined) return undefined;\n\n if (init.admitPrivateAddresses\n && (rejection === OutboundTargetRejection.PRIVATE_OR_RESERVED_ADDRESS\n || rejection === OutboundTargetRejection.RESERVED_SPECIAL_USE_HOSTNAME)) {\n // The operator declared this deployment reaches internal collectors. The scheme and\n // credentials-in-URL refusals are NOT part of that declaration and fall through unchanged.\n return undefined;\n }\n return rejection;\n}\n\nconst defaultResolver: PinnedAddressResolver = (hostname) =>\n new Promise((resolve, reject) => {\n dnsLookup(hostname, { all: true }, (error, addresses) => (error ? reject(error) : resolve(addresses)));\n });\n\n/**\n * Make the request, connecting only to an address classified at the moment of connection.\n *\n * Returns a real {@link Response} built over the incoming message, so callers keep `ok`, `status`,\n * `headers.get()`, `body.getReader()` and `text()` — every surface the `fetch` this replaces gave\n * them. It is a genuine `Response`, not a look-alike: streaming size enforcement (CIMD reads the body\n * with a running byte counter and cancels the reader) works unchanged.\n *\n * Throws {@link OutboundTargetRefusedError} for a refusal, and whatever `node:http` throws for a\n * transport failure — callers already distinguish those, and conflating them would turn \"your\n * collector is down\" into \"your collector is an SSRF attempt\".\n */\nexport async function pinnedOutboundFetch(rawUrl: string, init: PinnedOutboundRequestInit): Promise<Response> {\n const shapeRejection = classifyShape(rawUrl, init);\n if (shapeRejection !== undefined) throw new OutboundTargetRefusedError(shapeRejection);\n\n const url = new URL(rawUrl);\n const resolve = init.resolveAddresses ?? defaultResolver;\n\n /**\n * The refusal is recorded here as well as thrown, because the throw happens INSIDE a `net`\n * callback. The error object does survive that path on this Node — measured — but a caught error\n * on the outside is only usefully classified if we can answer \"was it ours?\" without depending on\n * that. The box answers it from our own frame.\n */\n let connectRefusal: OutboundTargetRefusedError | undefined;\n\n const requestFn = url.protocol === 'https:' ? httpsRequest : httpRequest;\n const agent = url.protocol === 'https:' ? PINNED_HTTPS_AGENT : PINNED_HTTP_AGENT;\n\n const body = init.body;\n const headers: Record<string, string> = { ...init.headers };\n if (body !== undefined) headers['content-length'] = String(Buffer.byteLength(body, 'utf8'));\n\n try {\n const response = await new Promise<Response>((resolveResponse, rejectResponse) => {\n const request: ClientRequest = requestFn(\n {\n protocol: url.protocol,\n hostname: url.hostname.replace(/^\\[|\\]$/g, ''), // an IPv6 literal arrives bracketed from `URL`\n port: url.port || undefined,\n path: `${url.pathname}${url.search}`,\n method: init.method ?? 'GET',\n headers,\n agent,\n signal: init.signal,\n\n /**\n * THE PIN. Every address the resolver returns is classified here, and the connection is\n * made to one of the addresses that passed — the same values, in the same event.\n *\n * ALL answers are checked rather than the one we hand back, because a hostile resolver can\n * return one public and one private address and rely on the client picking the other. That\n * is the same reasoning `resolvesOnlyToPublicAddresses` states; keeping it here means the\n * property does not depend on which resolver the caller pre-checked with.\n *\n * An empty answer is a refusal rather than a fall-through: the resolver succeeded and told\n * us nothing usable, which is not evidence the name is safe.\n */\n lookup: ((hostname, options, callback) => {\n /**\n * `callback` is typed as requiring an address even on the error path, so every refusal\n * hands back an empty list beside the error. Node's `lookupAndConnect` tests the error\n * FIRST and destroys the socket, so the list is never read — this is a type obligation,\n * not a fallback the connection could take.\n */\n const refuse = (refusal: OutboundTargetRefusedError): void => {\n connectRefusal = refusal;\n callback(refusal as NodeJS.ErrnoException, []);\n };\n resolve(hostname).then(\n (resolved) => {\n const addresses: LookupAddress[] = resolved.map((entry) => ({ address: entry.address, family: entry.family }));\n if (addresses.length === 0) {\n refuse(new OutboundTargetRefusedError(OutboundTargetRejection.PRIVATE_OR_RESERVED_ADDRESS));\n return;\n }\n if (!init.admitPrivateAddresses) {\n const refused = addresses.find((entry) => isPrivateOrReservedIpAddress(entry.address));\n if (refused) {\n refuse(new OutboundTargetRefusedError(OutboundTargetRejection.PRIVATE_OR_RESERVED_ADDRESS, refused.address));\n return;\n }\n }\n // `all` is what Node passes today; the single-address form is honoured so a future\n // Node calling the hook the other way does not silently reach the `Invalid IP\n // address: undefined` failure that the first draft of this hook produced.\n if ((options as { all?: boolean }).all) callback(null, addresses);\n else callback(null, addresses[0].address, addresses[0].family);\n },\n (error: NodeJS.ErrnoException) => callback(error, []),\n );\n }) satisfies LookupFunction,\n },\n (incoming: IncomingMessage) => {\n const responseHeaders = new Headers();\n for (const [name, value] of Object.entries(incoming.headers)) {\n if (typeof value === 'string') responseHeaders.set(name, value);\n else if (Array.isArray(value)) for (const one of value) responseHeaders.append(name, one);\n }\n resolveResponse(\n new Response(\n // A 204/304 carries no body; `Response` refuses a body on those statuses, so the\n // stream is only attached where one is permitted.\n incoming.statusCode === 204 || incoming.statusCode === 304\n ? null\n : (Readable.toWeb(incoming) as ReadableStream<Uint8Array>),\n {\n status: incoming.statusCode ?? 502,\n statusText: incoming.statusMessage ?? '',\n headers: responseHeaders,\n },\n ),\n );\n },\n );\n\n request.on('error', rejectResponse);\n if (body !== undefined) request.write(body);\n request.end();\n });\n return response;\n } catch (error) {\n // A refusal raised inside the hook surfaces here wrapped in whatever `net` did with it. Prefer\n // our own record of it, so the caller's classification never depends on error identity.\n if (connectRefusal) throw connectRefusal;\n throw error;\n }\n}\n"]}
1
+ {"version":3,"file":"pinned-outbound-fetch.backend.utils.js","sourceRoot":"","sources":["../../../../src/security/ssrf/pinned-outbound-fetch.backend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,OAAO,EAAE,MAAM,IAAI,SAAS,EAAsB,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,KAAK,IAAI,SAAS,EAA4C,MAAM,WAAW,CAAC;AAEjH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,GAE7B,MAAM,sEAAsE,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IASjC;IACA;IATlB;;;;OAIG;IACa,IAAI,GAAG,+BAA+B,CAAC;IAEvD,YACkB,SAAkC,EAClC,cAAuB;QAEvC,KAAK,CAAC,4BAA4B,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,KAAK,cAAc,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAH9E,cAAS,GAAT,SAAS,CAAyB;QAClC,mBAAc,GAAd,cAAc,CAAS;QAGvC,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF;AAgDD;;;;;;;;;;;;;;GAcG;AACH,MAAM,iBAAiB,GAAG,IAAI,SAAS,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AAC9D,MAAM,kBAAkB,GAAG,IAAI,UAAU,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,SAAS,aAAa,CAAC,MAAc,EAAE,IAA+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K,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ;wBAAE,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;yBAC3D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;wBAAE,KAAK,MAAM,GAAG,IAAI,KAAK;4BAAE,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC5F,CAAC;gBACD,eAAe,CACb,IAAI,QAAQ;gBACV,iFAAiF;gBACjF,kDAAkD;gBAClD,QAAQ,CAAC,UAAU,KAAK,GAAG,IAAI,QAAQ,CAAC,UAAU,KAAK,GAAG;oBACxD,CAAC,CAAC,IAAI;oBACN,CAAC,CAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAgC,EAC5D;oBACE,MAAM,EAAE,QAAQ,CAAC,UAAU,IAAI,GAAG;oBAClC,UAAU,EAAE,QAAQ,CAAC,aAAa,IAAI,EAAE;oBACxC,OAAO,EAAE,eAAe;iBACzB,CACF,CACF,CAAC;YACJ,CAAC,CACF,CAAC;YAEF,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;YACpC,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5C,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,+FAA+F;QAC/F,wFAAwF;QACxF,IAAI,cAAc;YAAE,MAAM,cAAc,CAAC;QACzC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["/**\n * An outbound HTTP request that CONNECTS to the address it VALIDATED — the half\n * {@link classifyOutboundTargetUrl} and {@link resolvesOnlyToPublicAddresses} structurally cannot do.\n *\n * ## The hole this closes, and why the classifier alone could never close it\n *\n * Every guard in the sibling module answers a question and then hands the answer to somebody else,\n * who makes a SEPARATE connection. That is a check-then-connect, and the guard's own header says so:\n *\n * \"⚠️ Residual, stated rather than hidden: this is a check-then-connect, so a DNS entry that\n * changes between the two (rebinding) is not covered. Closing it needs the request pinned to the\n * validated address, which Node's `fetch` does not expose.\"\n *\n * So a name whose A record answers `93.184.216.34` to the validating resolver and `169.254.169.254`\n * to the connecting one passes every check in this directory and still reaches cloud instance\n * metadata. The window is small and entirely attacker-controlled: the attacker owns the zone, so the\n * attacker chooses the TTL and therefore the width of the window.\n *\n * The classifier cannot fix this at any level of effort, because the defect is not in the answer —\n * the answer was correct when it was given. The defect is that the answer is thrown away before the\n * socket is opened.\n *\n * ## The mechanism, chosen after measuring the alternatives\n *\n * `net.Socket.connect` accepts a **`lookup` hook**, and `http.request` / `https.request` pass it\n * straight through. Node calls it at CONNECT time, and the address it returns is the address the\n * socket is opened to — there is no second resolution and therefore no window. Classifying inside\n * the hook makes validation and connection the SAME event rather than two events with a gap.\n *\n * Measured on this Node (2026-09-08) rather than assumed, because each of these decided the design:\n *\n * | probe | result |\n * |---|---|\n * | is `lookup` called for a hostname? | yes, as `lookup(host, { hints, all: true }, cb)` — note `all` |\n * | is `lookup` called for an IP LITERAL? | **no** — `net` short-circuits, so literals need the shape check |\n * | does an error raised inside the hook reach the caller? | yes, same error object, `message` and `code` intact |\n * | does TLS still verify against the NAME while connected to the pinned IP? | **yes** — a cert for `pinned.test` validated over a socket to `127.0.0.1` |\n *\n * That last row is what makes the whole approach viable. Pinning by rewriting the URL's host to the\n * validated IP — the obvious alternative — breaks SNI and certificate verification, i.e. it trades an\n * SSRF hole for a transport-security hole. Pinning through `lookup` keeps the hostname everywhere it\n * is a security input (SNI, certificate subject, the `Host` header) and replaces it only where it is\n * a routing input.\n *\n * ## Why this is not `fetch` with a dispatcher\n *\n * Node's `fetch` exposes no `lookup` hook. The undici route (`new Agent({ connect: { lookup } })`)\n * would work, but undici is not a declared dependency of this package — it is present in the store\n * only transitively — so taking it would add a second HTTP stack beside the one Node already embeds,\n * for a hook `node:https` exposes natively. Rejected on that basis, not on preference.\n *\n * `node:https` also gives one property for free that `fetch` needs an option for: **it does not\n * follow redirects at all.** A 302 arrives as a 302 the caller can see. `redirect: 'error'` is\n * therefore not something this module has to remember to pass — following a redirect to a target the\n * guard never saw is unrepresentable here.\n *\n * ## What this still does NOT do\n *\n * It does not defend a target that is public at connect time and hostile at the application layer,\n * and it does not stop a public host from being an open proxy into somebody else's private network.\n * Those are different problems with different answers. What it removes is the specific gap between\n * \"we checked this name\" and \"we opened this socket\".\n *\n * assurance-control: WILDO.NETWORK.OUTBOUND_TARGET_CONTROL — a server-side request initiated from\n * application- or tenant-authored configuration reaches only an address the deployment admits\n */\n\nimport { lookup as dnsLookup, type LookupAddress } from 'node:dns';\nimport { request as httpRequest, Agent as HttpAgent, type ClientRequest, type IncomingMessage } from 'node:http';\nimport type { LookupFunction } from 'node:net';\nimport { request as httpsRequest, Agent as HttpsAgent } from 'node:https';\nimport { Readable } from 'node:stream';\n\nimport {\n OutboundTargetRejection,\n classifyOutboundTargetUrl,\n isPrivateOrReservedIpAddress,\n type OutboundTargetPolicy,\n} from '~wildo-backend-lib/security/ssrf/outbound-target-guard.backend.utils';\n\n/**\n * Raised when the target was refused. Carries the closed-vocabulary reason so a caller can map it\n * onto its OWN rejection vocabulary rather than pattern-matching a message.\n *\n * `refusedAddress` is present only for a connect-time refusal — it is the address the resolver\n * returned at the moment of connection, which is the evidence that a rebinding attempt happened\n * rather than a merely mis-authored URL.\n */\nexport class OutboundTargetRefusedError extends Error {\n /**\n * A stable `code` alongside the class, because the error crosses `net`'s internals on its way out\n * of the `lookup` hook. The class identity survives on this Node (measured), but a `code` is what\n * every other error in that path carries and it costs nothing to be robust to a future wrap.\n */\n public readonly code = 'WILDO_OUTBOUND_TARGET_REFUSED';\n\n constructor(\n public readonly rejection: OutboundTargetRejection,\n public readonly refusedAddress?: string,\n ) {\n super(`Outbound target refused: ${rejection}${refusedAddress ? ` (${refusedAddress})` : ''}`);\n this.name = 'OutboundTargetRefusedError';\n }\n}\n\n/** The `dns.lookup` shape the connection hook needs, injectable so a test can drive both branches. */\nexport type PinnedAddressResolver = (hostname: string) => Promise<readonly LookupAddress[]>;\n\nexport interface PinnedOutboundRequestInit extends OutboundTargetPolicy {\n method?: string;\n headers?: Readonly<Record<string, string>>;\n /** Already-serialized request body. `content-length` is computed here; do not pass one. */\n body?: string;\n signal?: AbortSignal;\n\n /**\n * OPERATOR-authored escape: admit an address the public internet cannot reach.\n *\n * It exists because one legitimate outbound target class genuinely lives on a private network — a\n * self-hosted SIEM collector on the same VPC as the application. Refusing that unconditionally\n * would not be \"safe\", it would break a supported deployment shape.\n *\n * Three properties keep it from being an SSRF bypass with a checkbox, and all three are the\n * caller's obligation rather than this module's:\n *\n * 1. **It is never the default.** Absent means refuse.\n * 2. **It must be authored by the DEPLOYMENT OPERATOR, never by the tenant whose row supplies the\n * URL.** A tenant-settable \"allow private addresses\" flag hands the attacker the switch that\n * disarms the guard aimed at them. This is why the SIEM escape lives on the application\n * configuration and not on `siemExportConfig`, which an organization administrator authors.\n * 3. **It must never reach a target class whose URL comes from an UNAUTHENTICATED stranger.** CIMD\n * resolves a `client_id` supplied by anyone who can reach the authorization endpoint; there is\n * no operator on earth who means \"let strangers address my metadata service\".\n *\n * Note what it does NOT relax: the scheme policy and the credentials-in-URL refusal still apply,\n * and the connection is still pinned. It widens WHICH addresses are admitted, never whether the\n * address that was admitted is the one connected to.\n */\n admitPrivateAddresses?: boolean;\n\n /**\n * Resolver used by the connection hook. Defaults to the system resolver.\n *\n * Injectable for the same reason `resolvesOnlyToPublicAddresses` takes one: the two branches that\n * matter (a name that answers public, a name that answers private) cannot be exercised against a\n * real resolver without owning a zone, and a rebinding pin needs a resolver that answers\n * DIFFERENTLY on its second call — which is exactly what no real resolver will do on demand.\n */\n resolveAddresses?: PinnedAddressResolver;\n}\n\n/**\n * Connections are NOT pooled, deliberately.\n *\n * Two reasons, in order of weight. First, a pooled socket skips the `lookup` hook on reuse, so the\n * connect-time classification would run on the first request to a host and not on later ones — the\n * guard would hold or not hold depending on pool state, which is the least auditable property a\n * security control can have. (Reuse would in fact be SAFE, because a pooled socket is already\n * connected to an address this module validated — but \"safe because of a subtlety in another\n * module's cache\" is not a property to rest a control on.) Second, these targets are strangers:\n * pooling keeps an idle socket open per tenant-authored host, which is an unbounded resource keyed\n * on attacker-supplied strings.\n *\n * The cost is one TCP+TLS handshake per request, on a path that runs at webhook cadence rather than\n * per user request.\n */\nconst PINNED_HTTP_AGENT = new HttpAgent({ keepAlive: false });\nconst PINNED_HTTPS_AGENT = new HttpsAgent({ keepAlive: false });\n\n/**\n * Classify the URL's SHAPE before anything leaves the process.\n *\n * This is not redundant with the connection hook, and the reason is measured: `net` short-circuits\n * DNS for an IP LITERAL, so `https://169.254.169.254/latest/meta-data` never calls `lookup` and the\n * hook would never see it. The shape check is the ONLY thing standing in front of a literal target.\n */\nfunction classifyShape(rawUrl: string, init: PinnedOutboundRequestInit): OutboundTargetRejection | undefined {\n const rejection = classifyOutboundTargetUrl(rawUrl, { admittedProtocols: init.admittedProtocols });\n if (rejection === undefined) return undefined;\n\n if (init.admitPrivateAddresses\n && (rejection === OutboundTargetRejection.PRIVATE_OR_RESERVED_ADDRESS\n || rejection === OutboundTargetRejection.RESERVED_SPECIAL_USE_HOSTNAME)) {\n // The operator declared this deployment reaches internal collectors. The scheme and\n // credentials-in-URL refusals are NOT part of that declaration and fall through unchanged.\n return undefined;\n }\n return rejection;\n}\n\nconst defaultResolver: PinnedAddressResolver = (hostname) =>\n new Promise((resolve, reject) => {\n dnsLookup(hostname, { all: true }, (error, addresses) => (error ? reject(error) : resolve(addresses)));\n });\n\n/**\n * Make the request, connecting only to an address classified at the moment of connection.\n *\n * Returns a real {@link Response} built over the incoming message, so callers keep `ok`, `status`,\n * `headers.get()`, `body.getReader()` and `text()` — every surface the `fetch` this replaces gave\n * them. It is a genuine `Response`, not a look-alike: streaming size enforcement (CIMD reads the body\n * with a running byte counter and cancels the reader) works unchanged.\n *\n * Throws {@link OutboundTargetRefusedError} for a refusal, and whatever `node:http` throws for a\n * transport failure — callers already distinguish those, and conflating them would turn \"your\n * collector is down\" into \"your collector is an SSRF attempt\".\n */\nexport async function pinnedOutboundFetch(rawUrl: string, init: PinnedOutboundRequestInit): Promise<Response> {\n const shapeRejection = classifyShape(rawUrl, init);\n if (shapeRejection !== undefined) throw new OutboundTargetRefusedError(shapeRejection);\n\n const url = new URL(rawUrl);\n const resolve = init.resolveAddresses ?? defaultResolver;\n\n /**\n * The refusal is recorded here as well as thrown, because the throw happens INSIDE a `net`\n * callback. The error object does survive that path on this Node — measured — but a caught error\n * on the outside is only usefully classified if we can answer \"was it ours?\" without depending on\n * that. The box answers it from our own frame.\n */\n let connectRefusal: OutboundTargetRefusedError | undefined;\n\n const requestFn = url.protocol === 'https:' ? httpsRequest : httpRequest;\n const agent = url.protocol === 'https:' ? PINNED_HTTPS_AGENT : PINNED_HTTP_AGENT;\n\n const body = init.body;\n const headers: Record<string, string> = { ...init.headers };\n if (body !== undefined) headers['content-length'] = String(Buffer.byteLength(body, 'utf8'));\n\n try {\n const response = await new Promise<Response>((resolveResponse, rejectResponse) => {\n const request: ClientRequest = requestFn(\n {\n protocol: url.protocol,\n hostname: url.hostname.replace(/^\\[|\\]$/g, ''), // an IPv6 literal arrives bracketed from `URL`\n port: url.port || undefined,\n path: `${url.pathname}${url.search}`,\n method: init.method ?? 'GET',\n headers,\n agent,\n signal: init.signal,\n\n /**\n * THE PIN. Every address the resolver returns is classified here, and the connection is\n * made to one of the addresses that passed — the same values, in the same event.\n *\n * ALL answers are checked rather than the one we hand back, because a hostile resolver can\n * return one public and one private address and rely on the client picking the other. That\n * is the same reasoning `resolvesOnlyToPublicAddresses` states; keeping it here means the\n * property does not depend on which resolver the caller pre-checked with.\n *\n * An empty answer is a refusal rather than a fall-through: the resolver succeeded and told\n * us nothing usable, which is not evidence the name is safe.\n */\n lookup: ((hostname, options, callback) => {\n /**\n * `callback` is typed as requiring an address even on the error path, so every refusal\n * hands back an empty list beside the error. Node's `lookupAndConnect` tests the error\n * FIRST and destroys the socket, so the list is never read — this is a type obligation,\n * not a fallback the connection could take.\n */\n const refuse = (refusal: OutboundTargetRefusedError): void => {\n connectRefusal = refusal;\n callback(refusal as NodeJS.ErrnoException, []);\n };\n resolve(hostname).then(\n (resolved) => {\n const addresses: LookupAddress[] = resolved.map((entry) => ({ address: entry.address, family: entry.family }));\n if (addresses.length === 0) {\n refuse(new OutboundTargetRefusedError(OutboundTargetRejection.PRIVATE_OR_RESERVED_ADDRESS));\n return;\n }\n if (!init.admitPrivateAddresses) {\n const refused = addresses.find((entry) => isPrivateOrReservedIpAddress(entry.address));\n if (refused) {\n refuse(new OutboundTargetRefusedError(OutboundTargetRejection.PRIVATE_OR_RESERVED_ADDRESS, refused.address));\n return;\n }\n }\n // `all` is what Node passes today; the single-address form is honoured so a future\n // Node calling the hook the other way does not silently reach the `Invalid IP\n // address: undefined` failure that the first draft of this hook produced.\n if ((options as { all?: boolean }).all) callback(null, addresses);\n else callback(null, addresses[0].address, addresses[0].family);\n },\n (error: NodeJS.ErrnoException) => callback(error, []),\n );\n }) satisfies LookupFunction,\n },\n (incoming: IncomingMessage) => {\n const responseHeaders = new Headers();\n for (const [name, value] of Object.entries(incoming.headers)) {\n if (typeof value === 'string') responseHeaders.set(name, value);\n else if (Array.isArray(value)) for (const one of value) responseHeaders.append(name, one);\n }\n resolveResponse(\n new Response(\n // A 204/304 carries no body; `Response` refuses a body on those statuses, so the\n // stream is only attached where one is permitted.\n incoming.statusCode === 204 || incoming.statusCode === 304\n ? null\n : (Readable.toWeb(incoming) as ReadableStream<Uint8Array>),\n {\n status: incoming.statusCode ?? 502,\n statusText: incoming.statusMessage ?? '',\n headers: responseHeaders,\n },\n ),\n );\n },\n );\n\n request.on('error', rejectResponse);\n if (body !== undefined) request.write(body);\n request.end();\n });\n return response;\n } catch (error) {\n // A refusal raised inside the hook surfaces here wrapped in whatever `net` did with it. Prefer\n // our own record of it, so the caller's classification never depends on error identity.\n if (connectRefusal) throw connectRefusal;\n throw error;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"token-invalidation-fence.backend.utils.d.ts","sourceRoot":"","sources":["../../../../src/security/token-invalidation-fence.backend.utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAExF;;;;GAIG;AACH,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAEzE,6DAA6D;AAC7D,MAAM,WAAW,iCAAiC;IAChD,iGAAiG;IACjG,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8FG;AACH,wBAAsB,kCAAkC,CACtD,YAAY,EAAE,gCAAgC,EAC9C,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAAC,iCAAiC,CAAC,CAY5C"}
1
+ {"version":3,"file":"token-invalidation-fence.backend.utils.d.ts","sourceRoot":"","sources":["../../../src/security/token-invalidation-fence.backend.utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAExF;;;;GAIG;AACH,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAEzE,6DAA6D;AAC7D,MAAM,WAAW,iCAAiC;IAChD,iGAAiG;IACjG,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8FG;AACH,wBAAsB,kCAAkC,CACtD,YAAY,EAAE,gCAAgC,EAC9C,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAAC,iCAAiC,CAAC,CAY5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sEAAsE,CAAC;AACrF,cAAc,2FAA2F,CAAC;AAC1G,cAAc,mFAAmF,CAAC;AAClG,cAAc,uEAAuE,CAAC;AACtF,cAAc,qDAAqD,CAAC;AACpE,cAAc,mDAAmD,CAAC;AAClE,cAAc,wDAAwD,CAAC;AACvE,cAAc,kFAAkF,CAAC;AACjG,cAAc,wEAAwE,CAAC;AACvF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,uCAAuC,CAAC;AACtD,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,yDAAyD,CAAC;AACxE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,2FAA2F,CAAC;AAC1G,cAAc,8EAA8E,CAAC;AAC7F,cAAc,8FAA8F,CAAC;AAC7G,cAAc,sGAAsG,CAAC;AACrH,cAAc,mFAAmF,CAAC;AAClG,cAAc,+EAA+E,CAAC"}
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/testing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,sEAAsE,CAAC;AACrF,cAAc,2FAA2F,CAAC;AAC1G,cAAc,mFAAmF,CAAC;AAClG,cAAc,uEAAuE,CAAC;AACtF,cAAc,qDAAqD,CAAC;AACpE,cAAc,mDAAmD,CAAC;AAClE,cAAc,wDAAwD,CAAC;AACvE,cAAc,kFAAkF,CAAC;AACjG,cAAc,wEAAwE,CAAC;AACvF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,uCAAuC,CAAC;AACtD,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,yDAAyD,CAAC;AACxE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,2FAA2F,CAAC;AAC1G,cAAc,8EAA8E,CAAC;AAC7F,cAAc,8FAA8F,CAAC;AAC7G,cAAc,sGAAsG,CAAC;AACrH,cAAc,mFAAmF,CAAC;AAClG,cAAc,+EAA+E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"inbound-contact-custom-implementation.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/users/services/inbound-contact-custom-implementation.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAGL,4BAA4B,EAG7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AACpH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iFAAiF,CAAC;AAGlI;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,IAAI,GAAG,4BAA4B,CAKjG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,qBAAqB,CACzC,mBAAmB,EAAE,0BAA0B,EAC/C,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,4BAA4B,CAAC,CAcvC;AAED,wBAAgB,mCAAmC,IAAI,0CAA0C,EAAE,CAuDlG"}
1
+ {"version":3,"file":"inbound-contact-custom-implementation.backend.service.d.ts","sourceRoot":"","sources":["../../../../src/users/services/inbound-contact-custom-implementation.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAGL,4BAA4B,EAG7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AACpH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iFAAiF,CAAC;AAGlI;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,IAAI,GAAG,4BAA4B,CAKjG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,qBAAqB,CACzC,mBAAmB,EAAE,0BAA0B,EAC/C,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,4BAA4B,CAAC,CAcvC;AAED,wBAAgB,mCAAmC,IAAI,0CAA0C,EAAE,CAuDlG"}
@@ -1 +1 @@
1
- {"version":3,"file":"user-deletion-audit.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/users/services/user-deletion-audit.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAUH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AAsEpH;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,IAAI,0CAA0C,EAAE,CAmB/F"}
1
+ {"version":3,"file":"user-deletion-audit.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../src/users/services/user-deletion-audit.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAUH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AAsEpH;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,IAAI,0CAA0C,EAAE,CAmB/F"}
@@ -1 +1 @@
1
- {"version":3,"file":"user-force-password-reset.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/users/services/user-force-password-reset.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAUH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AA2GpH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,qCAAqC,IAAI,0CAA0C,EAAE,CAwDpG"}
1
+ {"version":3,"file":"user-force-password-reset.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../src/users/services/user-force-password-reset.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAUH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AA2GpH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,qCAAqC,IAAI,0CAA0C,EAAE,CAwDpG"}
@@ -1 +1 @@
1
- {"version":3,"file":"user-read-retained.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/users/services/user-read-retained.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAWH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AA0GpH,wBAAgB,+BAA+B,IAAI,0CAA0C,EAAE,CA4D9F"}
1
+ {"version":3,"file":"user-read-retained.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../src/users/services/user-read-retained.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAWH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AA0GpH,wBAAgB,+BAA+B,IAAI,0CAA0C,EAAE,CA4D9F"}
@@ -1 +1 @@
1
- {"version":3,"file":"user-read-retained.custom-impl.backend.service.js","sourceRoot":"","sources":["../../../../../src/users/services/user-read-retained.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,SAAS,EACT,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,yCAAyC,GAE1C,MAAM,4GAA4G,CAAC;AACpH,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,+EAA+E,CAAC;AAEvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAsBpF;;;;;;GAMG;AACH,SAAS,mCAAmC,CAC1C,EAAW,EACX,KAAc,EACd,gBAAuC,EACvC,KAAyB;IAEzB,kGAAkG;IAClG,4FAA4F;IAC5F,qCAAqC;IACrC,MAAM,aAAa,GAAG,sBAAsB,CAAC,EAAW,CAAC,CAAC;IAC1D,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,gBAAgB,EAAE;YAC1E,sBAAsB,EAAE,2BAA2B,CAAC,kCAAkC;YACtF,OAAO,EAAE;gBACP,MAAM,EAAE,mDAAmD;gBAC3D,kBAAkB,EAAE,0BAA0B,CAAC,EAAW,CAAC;aAC5D;SACF,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,eAAe,GAAG,gBAAg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B,CAAC,aAAa;YACnD,WAAW,EAAE,4BAA4B,CAAC,QAAQ;YAClD,kBAAkB,EAAE,IAAI;SACzB;QACD,UAAU,EAAE,wCAAwC;QACpD,QAAQ,EAAE;YACR,uFAAuF;YACvF,6EAA6E;YAC7E,oBAAoB,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE;gBACjF,mCAAmC,CAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;gBACxE,OAAO,KAAK,CAAC;YACf,CAAC;YACD;;;;;;;;;eASG;YACH,qBAAqB,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE;gBAClF,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAClE,mCAAmC,CAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;gBAE1E,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAA6B,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;gBAEvG;;;;;;;;mBAQG;gBACH,OAAO,MAAM,YAAY,CAAC,oBAAoB,CAC5C,gBAAgB,CAAC,KAAK,EACtB,aAAa,EACb,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAC/C;oBACE,uFAAuF;oBACvF,oFAAoF;oBACpF,iEAAiE;oBACjE,YAAY,EAAE,gBAAgB,CAAC,YAAY,EAAE,cAAc;wBACzD,CAAC,CAAC,EAAE,cAAc,EAAE,gBAAgB,CAAC,YAAY,CAAC,cAAc,EAAE;wBAClE,CAAC,CAAC,SAAS;iBACd,CACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC,CAAC;IAEL,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC","sourcesContent":["/**\n * `users | read_retained` — the operator surface for the audited see-through read (#490).\n *\n * # What this replaced: a capability nothing could reach\n *\n * `SystemAccessBackendService.readRetainedAsSystem` is the sanctioned way to reveal a RETAINED\n * (erased-and-impersonalized) user row. It has been complete and correct since retention landed —\n * it asserts the `seeRetained` policy verb, demands a privileged role, refuses a blank attribution,\n * sets the see-through flag for that read only, and emits a human-attributed `RETAINED_DATA_ACCESS`\n * audit row.\n *\n * And it had **no caller**. Measured: the only references were the factory that derives its grant\n * and the schema prose describing it as LIVE. So the capability existed, was audited by\n * construction, and the only route an operator actually had to a retained record was a database\n * console — which is precisely the unaudited path the primitive was built to replace.\n *\n * # Why an authenticated resource operation, and not an admin controller\n *\n * The engine already has an operator-facing admin controller pattern (`data-seeding-admin`), and it\n * is the wrong shape here: it authenticates with a shared `X-Admin-Secret`, which yields no user id\n * and no roles. The primitive requires BOTH — it fail-closes on a blank `accessingUserId`, and the\n * audit row's entire purpose is to say WHO looked. A shared secret answers \"someone who holds the\n * secret\", which is the question the record exists to improve on.\n *\n * A resource operation runs inside the application's own authentication and authorization, so the\n * caller's identity and roles arrive already established and cannot be self-asserted.\n *\n * # Application tier, deliberately — not platform tier\n *\n * A retention policy is an application's decision about its own data, the role gate the primitive\n * enforces (`APP_ADMIN_SUPER_ADMIN`) is an application role, and the system context the primitive\n * builds is APPLICATION-scoped. A platform-tier version would cross tenants, and would therefore\n * come under the declared cross-tenant admission rules and the `PLATFORM_ACCESS_GRANTS` requirement\n * rather than an ordinary role check. That is a bigger, different door; it is not this one, and it\n * should not be added by widening this one.\n */\n\nimport {\n CoreResourceType,\n ErrorCustomMessageReference,\n ErrorType,\n ResourceOperationVariantType,\n Users_Operations,\n} from '@wildo-ai/saas-models';\nimport type { Container } from 'inversify';\n\nimport {\n createResourceCustomServiceImplementation,\n type ResourceCustomServiceImplementationFactory,\n} from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation.factory.backend';\nimport {\n describeUnaddressableShape,\n resolveSingleSubjectId,\n} from '~wildo-backend-lib/base-classes/utils/single-subject-addressing.backend.utils';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\n\ninterface ErrorBuildingUtils {\n errorBuilder: {\n buildError: (\n type: ErrorType,\n executionContext?: unknown,\n options?: { customMessageReference?: ErrorCustomMessageReference; context?: Record<string, unknown> },\n ) => unknown;\n };\n}\n\n/** Everything the reveal needs, resolved from the request and the established session. */\ninterface ValidatedRetainedReadRequest {\n subjectUserId: string;\n accessingUserId: string;\n accessingUserRoles: string[];\n reason: string;\n}\n\n/**\n * Resolve and validate the whole request, or throw.\n *\n * PURE and idempotent, so the PREFIX phase can run it to refuse before anything happens and the\n * REPLACE phase can re-derive the same values without state threaded between them — the shape the\n * sibling `force_password_reset` implementation records.\n */\nfunction resolveValidatedRetainedReadRequest(\n id: unknown,\n input: unknown,\n executionContext: ExecutionContext<any>,\n utils: ErrorBuildingUtils,\n): ValidatedRetainedReadRequest {\n // Exactly one subject. A population-addressed reveal would disclose every retained row matching a\n // filter on one operator's single stated reason, and the audit row would record that reason\n // against a disclosure nobody sized.\n const subjectUserId = resolveSingleSubjectId(id as never);\n if (subjectUserId === undefined) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: {\n reason: 'read_retained requires a single addressed user id',\n receivedAddressing: describeUnaddressableShape(id as never),\n },\n });\n }\n\n /*\n * A HUMAN, and only a human.\n *\n * The sibling `force_password_reset` accepts a machine credential as attribution, and that is\n * right there: a forced reset is an administrative ACT whose provenance is the strongest\n * attribution available for a machine caller. This is different. The record being written says a\n * named person chose to look at data an erasure removed, for a reason they wrote down — and an\n * API key can supply neither half. `machineCredential` would answer \"which credential\", never\n * \"who\", and the audit row is the whole reason this read is permitted at all.\n */\n const accessingUserId = executionContext.initiatorIds?.userId;\n if (!accessingUserId) {\n throw utils.errorBuilder.buildError(ErrorType.AUTHORIZATION, executionContext, {\n context: {\n reason: 'read_retained_requires_human_principal',\n message:\n 'Revealing a retained (erased) record requires an authenticated human principal. A machine '\n + 'credential cannot supply the attribution this reveal is audited on.',\n },\n });\n }\n\n /*\n * Roles from the ESTABLISHED session, never from the request body.\n *\n * The primitive re-asserts the privileged role itself, and it can only assert what it is handed —\n * so handing it a request-supplied list would let a caller name their own authorization. The\n * execution context's roles were established by authentication and cannot be written by the\n * caller. Flattened across scopes because the primitive tests for one member, not for a scope.\n */\n const accessingUserRoles = (executionContext.initiatorRoles ?? []).flatMap((roleInfo) => [...roleInfo.roles]);\n\n const reason = typeof (input as { reason?: unknown })?.reason === 'string'\n ? ((input as { reason: string }).reason).trim()\n : '';\n if (!reason) {\n // Also enforced by the request DTO and again inside the primitive. Three sites, because the\n // audit store persists `eventData` unparsed: a blank reason that reached the row would produce a\n // reveal recorded with no justification, which is indistinguishable from an unaudited one.\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: {\n reason: 'read_retained requires a non-empty justification',\n message: 'Provide `reason`: why this retained record is being revealed (legal hold, dispute, investigation).',\n },\n });\n }\n\n return { subjectUserId, accessingUserId, accessingUserRoles, reason };\n}\n\nexport function createUserReadRetainedFactories(): ResourceCustomServiceImplementationFactory[] {\n const factory = (_resourcesRegistryService: ResourcesRegistryBackendService, container: Container) =>\n createResourceCustomServiceImplementation({\n operationPath: {\n resourceIdentifier: CoreResourceType.USERS,\n operationIdentifier: Users_Operations.READ_RETAINED,\n variantType: ResourceOperationVariantType.API_CALL,\n isOperationDefault: true,\n },\n debugLabel: 'users.read_retained.see-through-reveal',\n handlers: {\n // Every refusal lives in PREFIX, the only phase that runs before the core write — so a\n // rejected request cannot have touched the row on its way to being rejected.\n prefixCoreOperations: async (id, input, executionContext, _operationPath, utils) => {\n resolveValidatedRetainedReadRequest(id, input, executionContext, utils);\n return input;\n },\n /*\n * REPLACE, because the operation is UPDATE-like and must WRITE NOTHING.\n *\n * `resourceOperationLike: UPDATE` is how the operation gets a PUT with a body — the request\n * carries a free-text justification, and a GET would put it in the URL and therefore in\n * every access log between the operator and the server. Left to the generic core path, that\n * declaration would make this a real update: a retained row is frozen, so it would fail, and\n * on a resource that did not freeze it, it would silently write. Replacing the core\n * operation is what makes an UPDATE-shaped route a read.\n */\n replaceCoreOperations: async (id, input, executionContext, _operationPath, utils) => {\n const { subjectUserId, accessingUserId, accessingUserRoles, reason } =\n resolveValidatedRetainedReadRequest(id, input, executionContext, utils);\n\n const systemAccess = container.get<SystemAccessBackendService>(SAAS_SERVICE_TYPES.SystemAccessService);\n\n /*\n * Through the PRIMITIVE, never through the repository.\n *\n * This is the line the whole issue turns on. The same row is reachable by building a\n * super-admin context and reading it directly — and that path asserts no `seeRetained`\n * grant, sets no see-through flag, and writes no audit row. Reaching the repository here\n * would reveal exactly the same personal data with no record of it, which is the outcome\n * the audited pair exists to prevent.\n */\n return await systemAccess.readRetainedAsSystem(\n CoreResourceType.USERS,\n subjectUserId,\n { accessingUserId, accessingUserRoles, reason },\n {\n // Scoped to the organization the caller is acting in, when there is one. The primitive\n // suppresses the RETENTION predicate only — never the scope filter — so this cannot\n // widen the read beyond what the caller could otherwise address.\n scopeContext: executionContext.initiatorIds?.organizationId\n ? { organizationId: executionContext.initiatorIds.organizationId }\n : undefined,\n },\n );\n },\n },\n });\n\n return [factory];\n}\n"]}
1
+ {"version":3,"file":"user-read-retained.custom-impl.backend.service.js","sourceRoot":"","sources":["../../../../src/users/services/user-read-retained.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EA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AE,gBAAgB,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE;gBAClF,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAClE,mCAAmC,CAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;gBAE1E,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAA6B,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;gBAEvG;;;;;;;;mBAQG;gBACH,OAAO,MAAM,YAAY,CAAC,oBAAoB,CAC5C,gBAAgB,CAAC,KAAK,EACtB,aAAa,EACb,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAC/C;oBACE,uFAAuF;oBACvF,oFAAoF;oBACpF,iEAAiE;oBACjE,YAAY,EAAE,gBAAgB,CAAC,YAAY,EAAE,cAAc;wBACzD,CAAC,CAAC,EAAE,cAAc,EAAE,gBAAgB,CAAC,YAAY,CAAC,cAAc,EAAE;wBAClE,CAAC,CAAC,SAAS;iBACd,CACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC,CAAC;IAEL,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC","sourcesContent":["/**\n * `users | read_retained` — the operator surface for the audited see-through read (#490).\n *\n * # What this replaced: a capability nothing could reach\n *\n * `SystemAccessBackendService.readRetainedAsSystem` is the sanctioned way to reveal a RETAINED\n * (erased-and-impersonalized) user row. It has been complete and correct since retention landed —\n * it asserts the `seeRetained` policy verb, demands a privileged role, refuses a blank attribution,\n * sets the see-through flag for that read only, and emits a human-attributed `RETAINED_DATA_ACCESS`\n * audit row.\n *\n * And it had **no caller**. Measured: the only references were the factory that derives its grant\n * and the schema prose describing it as LIVE. So the capability existed, was audited by\n * construction, and the only route an operator actually had to a retained record was a database\n * console — which is precisely the unaudited path the primitive was built to replace.\n *\n * # Why an authenticated resource operation, and not an admin controller\n *\n * The engine already has an operator-facing admin controller pattern (`data-seeding-admin`), and it\n * is the wrong shape here: it authenticates with a shared `X-Admin-Secret`, which yields no user id\n * and no roles. The primitive requires BOTH — it fail-closes on a blank `accessingUserId`, and the\n * audit row's entire purpose is to say WHO looked. A shared secret answers \"someone who holds the\n * secret\", which is the question the record exists to improve on.\n *\n * A resource operation runs inside the application's own authentication and authorization, so the\n * caller's identity and roles arrive already established and cannot be self-asserted.\n *\n * # Application tier, deliberately — not platform tier\n *\n * A retention policy is an application's decision about its own data, the role gate the primitive\n * enforces (`APP_ADMIN_SUPER_ADMIN`) is an application role, and the system context the primitive\n * builds is APPLICATION-scoped. A platform-tier version would cross tenants, and would therefore\n * come under the declared cross-tenant admission rules and the `PLATFORM_ACCESS_GRANTS` requirement\n * rather than an ordinary role check. That is a bigger, different door; it is not this one, and it\n * should not be added by widening this one.\n */\n\nimport {\n CoreResourceType,\n ErrorCustomMessageReference,\n ErrorType,\n ResourceOperationVariantType,\n Users_Operations,\n} from '@wildo-ai/saas-models';\nimport type { Container } from 'inversify';\n\nimport {\n createResourceCustomServiceImplementation,\n type ResourceCustomServiceImplementationFactory,\n} from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation.factory.backend';\nimport {\n describeUnaddressableShape,\n resolveSingleSubjectId,\n} from '~wildo-backend-lib/base-classes/utils/single-subject-addressing.backend.utils';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\n\ninterface ErrorBuildingUtils {\n errorBuilder: {\n buildError: (\n type: ErrorType,\n executionContext?: unknown,\n options?: { customMessageReference?: ErrorCustomMessageReference; context?: Record<string, unknown> },\n ) => unknown;\n };\n}\n\n/** Everything the reveal needs, resolved from the request and the established session. */\ninterface ValidatedRetainedReadRequest {\n subjectUserId: string;\n accessingUserId: string;\n accessingUserRoles: string[];\n reason: string;\n}\n\n/**\n * Resolve and validate the whole request, or throw.\n *\n * PURE and idempotent, so the PREFIX phase can run it to refuse before anything happens and the\n * REPLACE phase can re-derive the same values without state threaded between them — the shape the\n * sibling `force_password_reset` implementation records.\n */\nfunction resolveValidatedRetainedReadRequest(\n id: unknown,\n input: unknown,\n executionContext: ExecutionContext<any>,\n utils: ErrorBuildingUtils,\n): ValidatedRetainedReadRequest {\n // Exactly one subject. A population-addressed reveal would disclose every retained row matching a\n // filter on one operator's single stated reason, and the audit row would record that reason\n // against a disclosure nobody sized.\n const subjectUserId = resolveSingleSubjectId(id as never);\n if (subjectUserId === undefined) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: {\n reason: 'read_retained requires a single addressed user id',\n receivedAddressing: describeUnaddressableShape(id as never),\n },\n });\n }\n\n /*\n * A HUMAN, and only a human.\n *\n * The sibling `force_password_reset` accepts a machine credential as attribution, and that is\n * right there: a forced reset is an administrative ACT whose provenance is the strongest\n * attribution available for a machine caller. This is different. The record being written says a\n * named person chose to look at data an erasure removed, for a reason they wrote down — and an\n * API key can supply neither half. `machineCredential` would answer \"which credential\", never\n * \"who\", and the audit row is the whole reason this read is permitted at all.\n */\n const accessingUserId = executionContext.initiatorIds?.userId;\n if (!accessingUserId) {\n throw utils.errorBuilder.buildError(ErrorType.AUTHORIZATION, executionContext, {\n context: {\n reason: 'read_retained_requires_human_principal',\n message:\n 'Revealing a retained (erased) record requires an authenticated human principal. A machine '\n + 'credential cannot supply the attribution this reveal is audited on.',\n },\n });\n }\n\n /*\n * Roles from the ESTABLISHED session, never from the request body.\n *\n * The primitive re-asserts the privileged role itself, and it can only assert what it is handed —\n * so handing it a request-supplied list would let a caller name their own authorization. The\n * execution context's roles were established by authentication and cannot be written by the\n * caller. Flattened across scopes because the primitive tests for one member, not for a scope.\n */\n const accessingUserRoles = (executionContext.initiatorRoles ?? []).flatMap((roleInfo) => [...roleInfo.roles]);\n\n const reason = typeof (input as { reason?: unknown })?.reason === 'string'\n ? ((input as { reason: string }).reason).trim()\n : '';\n if (!reason) {\n // Also enforced by the request DTO and again inside the primitive. Three sites, because the\n // audit store persists `eventData` unparsed: a blank reason that reached the row would produce a\n // reveal recorded with no justification, which is indistinguishable from an unaudited one.\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n context: {\n reason: 'read_retained requires a non-empty justification',\n message: 'Provide `reason`: why this retained record is being revealed (legal hold, dispute, investigation).',\n },\n });\n }\n\n return { subjectUserId, accessingUserId, accessingUserRoles, reason };\n}\n\nexport function createUserReadRetainedFactories(): ResourceCustomServiceImplementationFactory[] {\n const factory = (_resourcesRegistryService: ResourcesRegistryBackendService, container: Container) =>\n createResourceCustomServiceImplementation({\n operationPath: {\n resourceIdentifier: CoreResourceType.USERS,\n operationIdentifier: Users_Operations.READ_RETAINED,\n variantType: ResourceOperationVariantType.API_CALL,\n isOperationDefault: true,\n },\n debugLabel: 'users.read_retained.see-through-reveal',\n handlers: {\n // Every refusal lives in PREFIX, the only phase that runs before the core write — so a\n // rejected request cannot have touched the row on its way to being rejected.\n prefixCoreOperations: async (id, input, executionContext, _operationPath, utils) => {\n resolveValidatedRetainedReadRequest(id, input, executionContext, utils);\n return input;\n },\n /*\n * REPLACE, because the operation is UPDATE-like and must WRITE NOTHING.\n *\n * `resourceOperationLike: UPDATE` is how the operation gets a PUT with a body — the request\n * carries a free-text justification, and a GET would put it in the URL and therefore in\n * every access log between the operator and the server. Left to the generic core path, that\n * declaration would make this a real update: a retained row is frozen, so it would fail, and\n * on a resource that did not freeze it, it would silently write. Replacing the core\n * operation is what makes an UPDATE-shaped route a read.\n */\n replaceCoreOperations: async (id, input, executionContext, _operationPath, utils) => {\n const { subjectUserId, accessingUserId, accessingUserRoles, reason } =\n resolveValidatedRetainedReadRequest(id, input, executionContext, utils);\n\n const systemAccess = container.get<SystemAccessBackendService>(SAAS_SERVICE_TYPES.SystemAccessService);\n\n /*\n * Through the PRIMITIVE, never through the repository.\n *\n * This is the line the whole issue turns on. The same row is reachable by building a\n * super-admin context and reading it directly — and that path asserts no `seeRetained`\n * grant, sets no see-through flag, and writes no audit row. Reaching the repository here\n * would reveal exactly the same personal data with no record of it, which is the outcome\n * the audited pair exists to prevent.\n */\n return await systemAccess.readRetainedAsSystem(\n CoreResourceType.USERS,\n subjectUserId,\n { accessingUserId, accessingUserRoles, reason },\n {\n // Scoped to the organization the caller is acting in, when there is one. The primitive\n // suppresses the RETENTION predicate only — never the scope filter — so this cannot\n // widen the read beyond what the caller could otherwise address.\n scopeContext: executionContext.initiatorIds?.organizationId\n ? { organizationId: executionContext.initiatorIds.organizationId }\n : undefined,\n },\n );\n },\n },\n });\n\n return [factory];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"user-role-administration.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/users/services/user-role-administration.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAaH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AAsYpH,uCAAuC;AACvC,wBAAgB,mCAAmC,IAAI,0CAA0C,EAAE,CAKlG;AAiJD,mDAAmD;AACnD,wBAAgB,kCAAkC,IAAI,0CAA0C,EAAE,CAKjG"}
1
+ {"version":3,"file":"user-role-administration.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../src/users/services/user-role-administration.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAaH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AAsYpH,uCAAuC;AACvC,wBAAgB,mCAAmC,IAAI,0CAA0C,EAAE,CAKlG;AAiJD,mDAAmD;AACnD,wBAAgB,kCAAkC,IAAI,0CAA0C,EAAE,CAKjG"}
@@ -1 +1 @@
1
- {"version":3,"file":"user-self-custom-implementations.backend.d.ts","sourceRoot":"","sources":["../../../../../src/users/services/user-self-custom-implementations.backend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AA0IpH,eAAO,MAAM,6BAA6B,EAAE,0CAA0C,EAGrF,CAAC"}
1
+ {"version":3,"file":"user-self-custom-implementations.backend.d.ts","sourceRoot":"","sources":["../../../../src/users/services/user-self-custom-implementations.backend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AA0IpH,eAAO,MAAM,6BAA6B,EAAE,0CAA0C,EAGrF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"user-super-admin-floor.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/users/services/user-super-admin-floor.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAUH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AA8CpH;;GAEG;AACH,wBAAgB,sCAAsC,IAAI,0CAA0C,CAiEnG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,sCAAsC,IAAI,0CAA0C,CA+DnG;AAED,yDAAyD;AACzD,wBAAgB,kCAAkC,IAAI,0CAA0C,EAAE,CAEjG"}
1
+ {"version":3,"file":"user-super-admin-floor.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../src/users/services/user-super-admin-floor.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAUH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AA8CpH;;GAEG;AACH,wBAAgB,sCAAsC,IAAI,0CAA0C,CAiEnG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,sCAAsC,IAAI,0CAA0C,CA+DnG;AAED,yDAAyD;AACzD,wBAAgB,kCAAkC,IAAI,0CAA0C,EAAE,CAEjG"}