@wildo-ai/saas-backend-lib 1.1.0 → 1.1.2

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 (265) hide show
  1. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts +14 -3
  2. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
  3. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +115 -22
  4. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
  5. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +3 -1
  6. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
  7. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +8 -3
  8. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
  9. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts +11 -0
  10. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
  11. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js +11 -2
  12. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js.map +1 -1
  13. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +1 -0
  14. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
  15. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js +6 -1
  16. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
  17. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
  18. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js +16 -0
  19. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js.map +1 -1
  20. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts +20 -6
  21. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
  22. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +88 -32
  23. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
  24. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts +3 -1
  25. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
  26. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js +32 -7
  27. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js.map +1 -1
  28. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts +8 -5
  29. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
  30. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.js.map +1 -1
  31. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +31 -0
  32. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
  33. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +127 -5
  34. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
  35. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +71 -1
  36. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
  37. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +62 -2
  38. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
  39. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +21 -0
  40. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
  41. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +126 -4
  42. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
  43. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts +3 -26
  44. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
  45. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js +3 -68
  46. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js.map +1 -1
  47. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
  48. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +4 -2
  49. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
  50. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +6 -6
  51. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
  52. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +38 -0
  53. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
  54. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +40 -0
  55. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
  56. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +20 -0
  57. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
  58. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +28 -0
  59. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
  60. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +12 -0
  61. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -0
  62. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +118 -0
  63. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -0
  64. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
  65. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +8 -5
  66. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
  67. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
  68. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +14 -0
  69. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
  70. package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
  71. package/dist/esm/config/custom/application-config-controller.backend.service.js +7 -1
  72. package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -1
  73. package/dist/esm/config/models/app-config.backend.schemas.d.ts +4 -0
  74. package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
  75. package/dist/esm/config/services/app-configuration.backend.utils.d.ts +10 -1
  76. package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
  77. package/dist/esm/config/services/app-configuration.backend.utils.js +13 -2
  78. package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
  79. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts +2 -2
  80. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js +2 -2
  81. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js.map +1 -1
  82. package/dist/esm/databases/models/filter.backend.schemas.js +2 -2
  83. package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -1
  84. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
  85. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +20 -1
  86. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -1
  87. package/dist/esm/databases/services/redis.service.d.ts +27 -0
  88. package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
  89. package/dist/esm/databases/services/redis.service.js +29 -0
  90. package/dist/esm/databases/services/redis.service.js.map +1 -1
  91. package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
  92. package/dist/esm/errors/services/error-handler.backend.service.js +5 -0
  93. package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
  94. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts +41 -0
  95. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -0
  96. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js +40 -0
  97. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js.map +1 -0
  98. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts +64 -0
  99. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -0
  100. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js +193 -0
  101. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js.map +1 -0
  102. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +13 -2
  103. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
  104. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js +8 -2
  105. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
  106. package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
  107. package/dist/esm/external-data/external-data-transform.backend.js +7 -1
  108. package/dist/esm/external-data/external-data-transform.backend.js.map +1 -1
  109. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts +2 -0
  110. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
  111. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js +13 -0
  112. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js.map +1 -1
  113. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +14 -0
  114. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
  115. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +6 -0
  116. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
  117. package/dist/esm/files/controllers/file.controller.d.ts +24 -1
  118. package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
  119. package/dist/esm/files/controllers/file.controller.js +66 -2
  120. package/dist/esm/files/controllers/file.controller.js.map +1 -1
  121. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts +17 -0
  122. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -0
  123. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js +1 -0
  124. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -0
  125. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +5 -1
  126. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
  127. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +42 -3
  128. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
  129. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +18 -0
  130. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
  131. package/dist/esm/files/services/file-operation-handler.backend.service.js +36 -28
  132. package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
  133. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +163 -0
  134. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -0
  135. package/dist/esm/files/services/file-upload-grant.backend.service.js +442 -0
  136. package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -0
  137. package/dist/esm/files/services/files.backend.service.d.ts +19 -0
  138. package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
  139. package/dist/esm/files/services/files.backend.service.js +78 -15
  140. package/dist/esm/files/services/files.backend.service.js.map +1 -1
  141. package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
  142. package/dist/esm/files/utils/file-uploader.utils.js +12 -0
  143. package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
  144. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +5 -5
  145. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
  146. package/dist/esm/flows-actors/services/agents.backend.service.d.ts +79 -0
  147. package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
  148. package/dist/esm/flows-actors/services/agents.backend.service.js +319 -42
  149. package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
  150. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +151 -41
  151. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
  152. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +300 -139
  153. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
  154. package/dist/esm/index.d.ts +4 -1
  155. package/dist/esm/index.d.ts.map +1 -1
  156. package/dist/esm/index.js +14 -1
  157. package/dist/esm/index.js.map +1 -1
  158. package/dist/esm/inject/models/container.d.ts.map +1 -1
  159. package/dist/esm/inject/models/container.js +4 -0
  160. package/dist/esm/inject/models/container.js.map +1 -1
  161. package/dist/esm/inject/models/service-types.d.ts +3 -0
  162. package/dist/esm/inject/models/service-types.d.ts.map +1 -1
  163. package/dist/esm/inject/models/service-types.js +2 -0
  164. package/dist/esm/inject/models/service-types.js.map +1 -1
  165. package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
  166. package/dist/esm/mcp/controllers/mcp.controller.js +12 -4
  167. package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
  168. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts +34 -0
  169. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
  170. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js +42 -0
  171. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
  172. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +29 -1
  173. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
  174. package/dist/esm/mcp/services/mcp-server.backend.service.js +131 -3
  175. package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
  176. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts +64 -2
  177. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
  178. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +130 -6
  179. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
  180. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +9 -0
  181. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
  182. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +11 -36
  183. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
  184. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  185. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js +9 -7
  186. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
  187. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts +5 -5
  188. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
  189. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js +14 -13
  190. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js.map +1 -1
  191. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts +2 -1
  192. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
  193. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +2 -2
  194. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
  195. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
  196. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +9 -7
  197. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
  198. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
  199. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js +4 -1
  200. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js.map +1 -1
  201. package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
  202. package/dist/esm/requests/service/websocket.service.js +56 -7
  203. package/dist/esm/requests/service/websocket.service.js.map +1 -1
  204. package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
  205. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +2 -0
  206. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
  207. package/dist/esm/resources/services/resource-id.backend.service.js +3 -3
  208. package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -1
  209. package/dist/esm/resources/services/resources-registry.backend.service.js +1 -1
  210. package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
  211. package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
  212. package/dist/esm/runtime/services/execution-context-creator.backend.service.js +13 -7
  213. package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
  214. package/dist/esm/runtime/services/start-application.backend.service.d.ts +28 -0
  215. package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
  216. package/dist/esm/runtime/services/start-application.backend.service.js +82 -0
  217. package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
  218. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +3 -23
  219. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
  220. package/dist/esm/security/authentications/models/jwt.backend.schemas.js +20 -45
  221. package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -1
  222. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +9 -1
  223. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
  224. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +9 -1
  225. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
  226. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
  227. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js +5 -3
  228. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -1
  229. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +25 -1
  230. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
  231. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +55 -4
  232. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
  233. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
  234. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js +24 -1
  235. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js.map +1 -1
  236. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts +117 -0
  237. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -0
  238. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js +104 -0
  239. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js.map +1 -0
  240. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +101 -6
  241. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
  242. package/dist/esm/security/authorizations/services/authorizations.backend.service.js +210 -30
  243. package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
  244. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +18 -1
  245. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
  246. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +110 -74
  247. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -1
  248. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts +22 -0
  249. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -0
  250. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js +22 -0
  251. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js.map +1 -0
  252. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +17 -3
  253. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
  254. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +12 -0
  255. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -1
  256. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +20 -0
  257. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
  258. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +58 -5
  259. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
  260. package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
  261. package/dist/esm/security/jwt/services/jwt.backend.service.js +1 -18
  262. package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -1
  263. package/dist/tsconfig.build.tsbuildinfo +1 -1
  264. package/package.json +15 -9
  265. package/dist/esm/.builder.pid +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"introspection-resource-repository.backend.service.js","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,EACT,uBAAuB,GAGxB,MAAM,uBAAuB,CAAC;AAQ/B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,6CAA6C;IAErC;IACA;IACA;IACA;IAJnB,YACmB,YAAoB,EACpB,MAAqB,EACrB,YAAwC,EACxC,aAAuE;QAHvE,iBAAY,GAAZ,YAAY,CAAQ;QACpB,WAAM,GAAN,MAAM,CAAe;QACrB,iBAAY,GAAZ,YAAY,CAA4B;QACxC,kBAAa,GAAb,aAAa,CAA0D;IACvF,CAAC;IAEJ,iGAAiG;IAEjG;;;;;;;;;OASG;IACI,KAAK,CAAC,QAAQ,CACnB,uBAAkH,EAClH,gBAAuC,EACvC,mBAAyB,EACzB,IAAQ,EACR,OAAiB;QAEjB,OAAO,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,IAAI,CAAe,CAAC;IACjH,CAAC;IAEM,KAAK,CAAC,OAAO,CAClB,2BAAmC,EACnC,gBAAuC,EACvC,mBAAyB,EACzB,IAAQ,EACR,OAAiB;QAEjB,OAAO,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,IAAI,CAAe,CAAC;IACjH,CAAC;IAEM,KAAK,CAAC,oBAAoB,CAC/B,gBAAuC,EACvC,IAAU;QAEV,OAAO,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,CAAe,CAAC;IACvG,CAAC;IAEO,KAAK,CAAC,WAAW,CACvB,SAAkB,EAClB,gBAAuC,EACvC,mBAAyB,EACz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sBAC/G,oHAAoH;aACzH;SACF,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import {\n CoreResourceOperation,\n ErrorCustomMessageReference,\n ErrorType,\n ResourceOperationsUtils,\n ResourcesConfig_OperationPathUtils,\n type Resources_PaginatedResult,\n} from '@wildo-ai/saas-models';\n\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\n\nimport type { IntrospectionResourceSourceBackendPort } from './introspection-resource-source.backend.port';\n\n/**\n * Repository for `PersistenceAdapter.INTROSPECTION` — rows DERIVED per read, never stored.\n *\n * Modelled on `HttpApiResourceRepositoryBackendService`: a read surface, and every write member an\n * explicit refusal rather than an omission. The difference from that sibling is the reason for the\n * refusals. HTTP_API refuses writes because slice 1 chose read-only against a store that could in\n * principle accept them. Here there is NO STORE: a row is a projection of the application's own\n * source, so a write has nowhere to land and never will.\n *\n * ## The source is resolved LAZILY and its absence is not an error\n *\n * The port is bound by the dev companion; an application running without one has no binding at all.\n * That must stay a clean per-call refusal, never a boot failure — a companion is the only thing that\n * can serve these rows, so refusing at BOOT would need a running companion to fix the companion\n * (`continuity-drift-and-cas-basis.md` Rule 3). Same lazy `isBound` shape the HTTP_API arm uses for\n * its audit sink.\n *\n * ## Degradation is honest, never an empty result\n *\n * A behavior can fail for an ordinary reason — the target application's `dist` is not built, so the\n * subprocess cannot import its modules. That surfaces as a refusal naming the cause. It must NOT\n * become an empty row set: \"no rows\" and \"could not look\" are different answers, and an author\n * reading the first when the second is true will conclude their application declares nothing.\n */\nexport class IntrospectionResourceRepositoryBackendService {\n constructor(\n private readonly resourceType: string,\n private readonly logger: LoggerService,\n private readonly errorBuilder: ErrorBuilderBackendService,\n private readonly resolveSource: () => IntrospectionResourceSourceBackendPort | undefined,\n ) {}\n\n // ───────────────── dispatch: how the SERVICE tier actually calls a repository ─────────────────\n\n /*\n * The service tier does not call `read`/`list` directly — it dispatches through `doByPath`, and a\n * repository without it fails at REQUEST time with `TypeError: repository.doByPath is not a\n * function`, long after registration reported success. That is how this surface was discovered:\n * the route mounted, authenticated, resolved its operation, and then died inside the service.\n *\n * Mirrors the HTTP_API sibling's shape, including the refusal for anything outside the read\n * family — the adapter's writes are refused in `doOperation` as well as on their named members,\n * because the service dispatches by operation and never touches those members.\n */\n public async doByPath<T = any, U = any>(\n operationRepositoryPath: Parameters<typeof ResourcesConfig_OperationPathUtils.createOperationRepositoryPathKey>[0],\n executionContext: ExecutionContext<any>,\n id_or_ids_or_filter?: any,\n data?: U,\n options?: unknown,\n ): Promise<T> {\n return this.doOperation(executionContext.operation, executionContext, id_or_ids_or_filter, data) as Promise<T>;\n }\n\n public async doByKey<T = any, U = any>(\n _operationRepositoryPathKey: string,\n executionContext: ExecutionContext<any>,\n id_or_ids_or_filter?: any,\n data?: U,\n options?: unknown,\n ): Promise<T> {\n return this.doOperation(executionContext.operation, executionContext, id_or_ids_or_filter, data) as Promise<T>;\n }\n\n public async doByExecutionContext<T = any>(\n executionContext: ExecutionContext<any>,\n data?: any,\n ): Promise<T> {\n return this.doOperation(executionContext.operation, executionContext, undefined, data) as Promise<T>;\n }\n\n private async doOperation(\n operation: unknown,\n executionContext: ExecutionContext<any>,\n id_or_ids_or_filter?: any,\n data?: any,\n ): Promise<unknown> {\n const operationIdentifier = ResourceOperationsUtils.getCoreResourceOperationFromOperation(operation as never);\n\n switch (operationIdentifier) {\n case CoreResourceOperation.READ:\n return this.read(executionContext, id_or_ids_or_filter);\n case CoreResourceOperation.LIST:\n return this.list(executionContext, id_or_ids_or_filter);\n case CoreResourceOperation.COUNT:\n return this.count(executionContext, data?.filter);\n case CoreResourceOperation.SEARCH:\n return this.search(executionContext, data?.query ?? '', data?.filter);\n default:\n throw this.readOnlyRefusal(String(operationIdentifier ?? 'unknown operation'));\n }\n }\n\n // ───────────────────────────── reads ─────────────────────────────\n\n public async read<T = undefined>(executionContext: ExecutionContext<any>, id_or_filter: any): Promise<any> {\n const rows = await this.derive(executionContext, { filter: id_or_filter });\n return rows[0] ?? null;\n }\n\n public async readForInternalScan<T = undefined>(executionContext: ExecutionContext<any>, id_or_filter: any): Promise<any> {\n return this.read(executionContext, id_or_filter);\n }\n\n /**\n * LIST answers the PAGINATED envelope the controller validates against — `{ data, pagination }` —\n * not a bare array.\n *\n * Learned from a live 400: the rows were derived correctly and the response DTO refused them with\n * \"data: expected array, received undefined\". A repository that returns the right rows in the\n * wrong shape fails at the very last hop, and the error names the DTO rather than the repository.\n *\n * Pagination is reported over the DERIVED set rather than pushed into the source. An introspection\n * behavior computes its whole answer in one subprocess run — there is no cursor to seek and no\n * cheaper partial read — so slicing before returning would add an interface without saving any of\n * the work, and reporting a total the caller cannot page past would be a lie.\n */\n public async list<T = undefined>(executionContext: ExecutionContext<any>, ids_or_filter: any): Promise<any> {\n const rows = await this.derive(executionContext, { filter: ids_or_filter });\n return {\n data: rows,\n pagination: { page: 1, limit: rows.length, total: rows.length, totalPages: 1 },\n };\n }\n\n /**\n * The internal-scan variant returns the BARE rows, matching its sibling: internal scans consume a\n * collection, not a page, and handing them an envelope would make every caller unwrap one.\n */\n public async listForInternalScan<T = undefined>(executionContext: ExecutionContext<any>, ids_or_filter: any): Promise<any> {\n return this.derive(executionContext, { filter: ids_or_filter });\n }\n\n public async search<T = any>(\n executionContext: ExecutionContext<any>,\n searchQuery: string,\n filter?: any,\n ): Promise<Resources_PaginatedResult<T>> {\n const rows = await this.derive(executionContext, { filter, searchQuery });\n return { data: rows as T[], total: rows.length, page: 1, limit: rows.length } as unknown as Resources_PaginatedResult<T>;\n }\n\n public async count(executionContext: ExecutionContext<any>, filter?: any): Promise<{ count: number }> {\n const rows = await this.derive(executionContext, { filter });\n return { count: rows.length };\n }\n\n private async derive(\n executionContext: ExecutionContext<any>,\n query: { filter?: unknown; searchQuery?: string },\n ): Promise<readonly Record<string, unknown>[]> {\n const source = this.sourceOrRefuse(executionContext);\n try {\n const result = await source.deriveRows({\n resourceType: this.resourceType,\n executionContext,\n ...query,\n });\n return result.rows;\n } catch (error) {\n /*\n * Deliberately NOT swallowed into an empty result. The most common cause is the target\n * application's `dist` being absent, which is a fixable condition an author must see — an\n * empty list would read as \"this application declares nothing\".\n */\n this.logger.error('Introspection row derivation failed', { resourceType: this.resourceType, error });\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n reason: 'introspection_derivation_failed',\n resourceType: this.resourceType,\n message:\n 'Deriving introspected rows failed. The most common cause is that the target application has not been built, '\n + 'so its modules cannot be imported. This is reported rather than returned as an empty result, because \"no rows\" '\n + 'and \"could not look\" are different answers.',\n },\n });\n }\n }\n\n private sourceOrRefuse(executionContext: ExecutionContext<any>): IntrospectionResourceSourceBackendPort {\n const source = this.resolveSource();\n if (!source) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n reason: 'introspection_source_unbound',\n resourceType: this.resourceType,\n message:\n 'No introspection source is bound. Rows for an INTROSPECTION-backed resource are derived by the dev companion; '\n + 'an application running without one cannot serve them. Refused per call rather than at boot, because a companion '\n + 'is the only thing that could repair this.',\n },\n });\n }\n return source;\n }\n\n // ───────────────────────────── writes: all refused ─────────────────────────────\n\n public async create(): Promise<never> { throw this.readOnlyRefusal('create'); }\n public async createMany(): Promise<never> { throw this.readOnlyRefusal('createMany'); }\n public async update(): Promise<never> { throw this.readOnlyRefusal('update'); }\n public async updateMany(): Promise<never> { throw this.readOnlyRefusal('updateMany'); }\n public async delete(): Promise<never> { throw this.readOnlyRefusal('delete'); }\n public async deleteMany(): Promise<never> { throw this.readOnlyRefusal('deleteMany'); }\n public async atomicIncrementField(): Promise<never> { throw this.readOnlyRefusal('atomicIncrementField'); }\n public async atomicConditionalSet(): Promise<never> { throw this.readOnlyRefusal('atomicConditionalSet'); }\n public async atomicGuardedMutation(): Promise<never> { throw this.readOnlyRefusal('atomicGuardedMutation'); }\n public async updateManyByRawFilter(): Promise<never> { throw this.readOnlyRefusal('updateManyByRawFilter'); }\n public async insertRawDocument(): Promise<never> { throw this.readOnlyRefusal('insertRawDocument'); }\n public async findManyByRawFilter(): Promise<never> { throw this.readOnlyRefusal('findManyByRawFilter'); }\n\n private readOnlyRefusal(member: string): ReturnType<ErrorBuilderBackendService['buildError']> {\n return this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n reason: 'introspection_repository_member_unsupported',\n member,\n resourceType: this.resourceType,\n message: `'${member}' has no meaning on an INTROSPECTION-backed resource: rows are derived from the application's `\n + 'own source per read and no store exists to write to. Reads: read/list/count/search and the internal-scan variants.',\n },\n });\n }\n}\n"]}
1
+ {"version":3,"file":"introspection-resource-repository.backend.service.js","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,EACT,uBAAuB,EACvB,kCAAkC,GAEnC,MAAM,uBAAuB,CAAC;AAQ/B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,6CAA6C;IAErC;IACA;IACA;IACA;IAJnB,YACmB,YAAoB,EACpB,MAAqB,EACrB,YAAwC,EACxC,aAAuE;QAHvE,iBAAY,GAAZ,YAAY,CAAQ;QACpB,WAAM,GAAN,MAAM,CAAe;QACrB,iBAAY,GAAZ,YAAY,CAA4B;QACxC,kBAAa,GAAb,aAAa,CAA0D;IACvF,CAAC;IAEJ,iGAAiG;IAEjG;;;;;;;;;OASG;IACH;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,QAAQ,CACnB,uBAAkH,EAClH,gBAAuC,EACvC,mBAAyB,EACzB,IAAQ,EACR,OAAiB;QA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perationsUtils,\n ResourcesConfig_OperationPathUtils,\n type Resources_PaginatedResult,\n} from '@wildo-ai/saas-models';\n\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\n\nimport type { IntrospectionResourceSourceBackendPort } from './introspection-resource-source.backend.port';\n\n/**\n * Repository for `PersistenceAdapter.INTROSPECTION` — rows DERIVED per read, never stored.\n *\n * Modelled on `HttpApiResourceRepositoryBackendService`: a read surface, and every write member an\n * explicit refusal rather than an omission. The difference from that sibling is the reason for the\n * refusals. HTTP_API refuses writes because slice 1 chose read-only against a store that could in\n * principle accept them. Here there is NO STORE: a row is a projection of the application's own\n * source, so a write has nowhere to land and never will.\n *\n * ## The source is resolved LAZILY and its absence is not an error\n *\n * The port is bound by the dev companion; an application running without one has no binding at all.\n * That must stay a clean per-call refusal, never a boot failure — a companion is the only thing that\n * can serve these rows, so refusing at BOOT would need a running companion to fix the companion\n * (`continuity-drift-and-cas-basis.md` Rule 3). Same lazy `isBound` shape the HTTP_API arm uses for\n * its audit sink.\n *\n * ## Degradation is honest, never an empty result\n *\n * A behavior can fail for an ordinary reason — the target application's `dist` is not built, so the\n * subprocess cannot import its modules. That surfaces as a refusal naming the cause. It must NOT\n * become an empty row set: \"no rows\" and \"could not look\" are different answers, and an author\n * reading the first when the second is true will conclude their application declares nothing.\n */\nexport class IntrospectionResourceRepositoryBackendService {\n constructor(\n private readonly resourceType: string,\n private readonly logger: LoggerService,\n private readonly errorBuilder: ErrorBuilderBackendService,\n private readonly resolveSource: () => IntrospectionResourceSourceBackendPort | undefined,\n ) {}\n\n // ───────────────── dispatch: how the SERVICE tier actually calls a repository ─────────────────\n\n /*\n * The service tier does not call `read`/`list` directly — it dispatches through `doByPath`, and a\n * repository without it fails at REQUEST time with `TypeError: repository.doByPath is not a\n * function`, long after registration reported success. That is how this surface was discovered:\n * the route mounted, authenticated, resolved its operation, and then died inside the service.\n *\n * Mirrors the HTTP_API sibling's shape, including the refusal for anything outside the read\n * family — the adapter's writes are refused in `doOperation` as well as on their named members,\n * because the service dispatches by operation and never touches those members.\n */\n /*\n * The SUPPLIED path is the dispatch authority, never `executionContext.operation` — corrected\n * 2026-09-01, and the distinction only becomes visible on the adapter's first non-read\n * operation. The authorizer's pre-fetch reads the target of a WRITE-SHAPED operation by calling\n * `doByPath({resourceIdentifier, operationIdentifier: READ}, …)` while the execution context\n * still carries the operation being authorized; the Mongo and PostgreSQL repositories dispatch\n * on the supplied key, so their pre-fetch reads. This repository dispatched on the CONTEXT's\n * operation, so the same pre-fetch fell into the read-only refusal and every custom dispatch\n * operation on an introspected resource died as 404 `authorizations_validation_failed` before\n * its OVERRIDE_ALL implementation could run. Same rule as the twins: the caller names the\n * repository intent; the context names what is being authorized.\n */\n public async doByPath<T = any, U = any>(\n operationRepositoryPath: Parameters<typeof ResourcesConfig_OperationPathUtils.createOperationRepositoryPathKey>[0],\n executionContext: ExecutionContext<any>,\n id_or_ids_or_filter?: any,\n data?: U,\n options?: unknown,\n ): Promise<T> {\n return this.doOperationByIdentifier(\n String(operationRepositoryPath.operationIdentifier),\n executionContext,\n id_or_ids_or_filter,\n data,\n ) as Promise<T>;\n }\n\n public async doByKey<T = any, U = any>(\n operationRepositoryPathKey: string,\n executionContext: ExecutionContext<any>,\n id_or_ids_or_filter?: any,\n data?: U,\n options?: unknown,\n ): Promise<T> {\n const parsed = ResourcesConfig_OperationPathUtils.parseOperationRepositoryPathKey(operationRepositoryPathKey);\n return this.doOperationByIdentifier(\n String(parsed.operationIdentifier),\n executionContext,\n id_or_ids_or_filter,\n data,\n ) as Promise<T>;\n }\n\n public async doByExecutionContext<T = any>(\n executionContext: ExecutionContext<any>,\n data?: any,\n ): Promise<T> {\n return this.doOperation(executionContext.operation, executionContext, undefined, data) as Promise<T>;\n }\n\n private async doOperation(\n operation: unknown,\n executionContext: ExecutionContext<any>,\n id_or_ids_or_filter?: any,\n data?: any,\n ): Promise<unknown> {\n const operationIdentifier = ResourceOperationsUtils.getCoreResourceOperationFromOperation(operation as never);\n return this.doOperationByIdentifier(String(operationIdentifier ?? ''), executionContext, id_or_ids_or_filter, data);\n }\n\n private async doOperationByIdentifier(\n operationIdentifier: string,\n executionContext: ExecutionContext<any>,\n id_or_ids_or_filter?: any,\n data?: any,\n ): Promise<unknown> {\n switch (operationIdentifier) {\n case CoreResourceOperation.READ:\n return this.read(executionContext, id_or_ids_or_filter);\n case CoreResourceOperation.LIST:\n return this.list(executionContext, id_or_ids_or_filter);\n case CoreResourceOperation.COUNT:\n return this.count(executionContext, data?.filter);\n case CoreResourceOperation.SEARCH:\n return this.search(executionContext, data?.query ?? '', data?.filter);\n default:\n throw this.readOnlyRefusal(operationIdentifier || 'unknown operation');\n }\n }\n\n // ───────────────────────────── reads ─────────────────────────────\n\n public async read<T = undefined>(executionContext: ExecutionContext<any>, id_or_filter: any): Promise<any> {\n const rows = await this.derive(executionContext, { filter: id_or_filter });\n return rows[0] ?? null;\n }\n\n public async readForInternalScan<T = undefined>(executionContext: ExecutionContext<any>, id_or_filter: any): Promise<any> {\n return this.read(executionContext, id_or_filter);\n }\n\n /**\n * LIST answers the PAGINATED envelope the controller validates against — `{ data, pagination }` —\n * not a bare array.\n *\n * Learned from a live 400: the rows were derived correctly and the response DTO refused them with\n * \"data: expected array, received undefined\". A repository that returns the right rows in the\n * wrong shape fails at the very last hop, and the error names the DTO rather than the repository.\n *\n * Pagination is reported over the DERIVED set rather than pushed into the source. An introspection\n * behavior computes its whole answer in one subprocess run — there is no cursor to seek and no\n * cheaper partial read — so slicing before returning would add an interface without saving any of\n * the work, and reporting a total the caller cannot page past would be a lie.\n */\n public async list<T = undefined>(executionContext: ExecutionContext<any>, ids_or_filter: any): Promise<any> {\n const rows = await this.derive(executionContext, { filter: ids_or_filter });\n return {\n data: rows,\n /*\n * `limit` is the page SIZE the answer was computed with, and the envelope schema holds it to\n * >= 1 — `rows.length` alone turned every EMPTY derivation into a 500 at transformOutput\n * (\"pagination.limit: too_small\"), measured 2026-09-01 the first time an introspection\n * resource could legitimately be empty (a family-aspect collection of a not-landed family).\n * An empty page of size 1 is honest; a page of size 0 is not a page.\n */\n pagination: { page: 1, limit: Math.max(rows.length, 1), total: rows.length, totalPages: 1 },\n };\n }\n\n /**\n * The internal-scan variant returns the BARE rows, matching its sibling: internal scans consume a\n * collection, not a page, and handing them an envelope would make every caller unwrap one.\n */\n public async listForInternalScan<T = undefined>(executionContext: ExecutionContext<any>, ids_or_filter: any): Promise<any> {\n return this.derive(executionContext, { filter: ids_or_filter });\n }\n\n public async search<T = any>(\n executionContext: ExecutionContext<any>,\n searchQuery: string,\n filter?: any,\n ): Promise<Resources_PaginatedResult<T>> {\n const rows = await this.derive(executionContext, { filter, searchQuery });\n // Same >=1 floor as list() above — an empty search result is a page of size 1 with no rows.\n return { data: rows as T[], total: rows.length, page: 1, limit: Math.max(rows.length, 1) } as unknown as Resources_PaginatedResult<T>;\n }\n\n public async count(executionContext: ExecutionContext<any>, filter?: any): Promise<{ count: number }> {\n const rows = await this.derive(executionContext, { filter });\n return { count: rows.length };\n }\n\n private async derive(\n executionContext: ExecutionContext<any>,\n query: { filter?: unknown; searchQuery?: string },\n ): Promise<readonly Record<string, unknown>[]> {\n const source = this.sourceOrRefuse(executionContext);\n try {\n const result = await source.deriveRows({\n resourceType: this.resourceType,\n executionContext,\n ...query,\n });\n return result.rows;\n } catch (error) {\n /*\n * Deliberately NOT swallowed into an empty result. The most common cause is the target\n * application's `dist` being absent, which is a fixable condition an author must see — an\n * empty list would read as \"this application declares nothing\".\n */\n this.logger.error('Introspection row derivation failed', { resourceType: this.resourceType, error });\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n reason: 'introspection_derivation_failed',\n resourceType: this.resourceType,\n message:\n 'Deriving introspected rows failed. The most common cause is that the target application has not been built, '\n + 'so its modules cannot be imported. This is reported rather than returned as an empty result, because \"no rows\" '\n + 'and \"could not look\" are different answers.',\n },\n });\n }\n }\n\n private sourceOrRefuse(executionContext: ExecutionContext<any>): IntrospectionResourceSourceBackendPort {\n const source = this.resolveSource();\n if (!source) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n reason: 'introspection_source_unbound',\n resourceType: this.resourceType,\n message:\n 'No introspection source is bound. Rows for an INTROSPECTION-backed resource are derived by the dev companion; '\n + 'an application running without one cannot serve them. Refused per call rather than at boot, because a companion '\n + 'is the only thing that could repair this.',\n },\n });\n }\n return source;\n }\n\n // ───────────────────────────── writes: all refused ─────────────────────────────\n\n public async create(): Promise<never> { throw this.readOnlyRefusal('create'); }\n public async createMany(): Promise<never> { throw this.readOnlyRefusal('createMany'); }\n public async update(): Promise<never> { throw this.readOnlyRefusal('update'); }\n public async updateMany(): Promise<never> { throw this.readOnlyRefusal('updateMany'); }\n public async delete(): Promise<never> { throw this.readOnlyRefusal('delete'); }\n public async deleteMany(): Promise<never> { throw this.readOnlyRefusal('deleteMany'); }\n public async atomicIncrementField(): Promise<never> { throw this.readOnlyRefusal('atomicIncrementField'); }\n public async atomicConditionalSet(): Promise<never> { throw this.readOnlyRefusal('atomicConditionalSet'); }\n public async atomicGuardedMutation(): Promise<never> { throw this.readOnlyRefusal('atomicGuardedMutation'); }\n public async updateManyByRawFilter(): Promise<never> { throw this.readOnlyRefusal('updateManyByRawFilter'); }\n public async deleteManyByRawFilter(): Promise<never> { throw this.readOnlyRefusal('deleteManyByRawFilter'); }\n public async insertRawDocument(): Promise<never> { throw this.readOnlyRefusal('insertRawDocument'); }\n public async findManyByRawFilter(): Promise<never> { throw this.readOnlyRefusal('findManyByRawFilter'); }\n\n private readOnlyRefusal(member: string): ReturnType<ErrorBuilderBackendService['buildError']> {\n return this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n reason: 'introspection_repository_member_unsupported',\n member,\n resourceType: this.resourceType,\n message: `'${member}' has no meaning on an INTROSPECTION-backed resource: rows are derived from the application's `\n + 'own source per read and no store exists to write to. Reads: read/list/count/search and the internal-scan variants.',\n },\n });\n }\n}\n"]}
@@ -4,10 +4,13 @@ import type { ExecutionContext } from '../../../../runtime/models/execution-cont
4
4
  *
5
5
  * ## Why the engine declares this but never implements it
6
6
  *
7
- * Producing an introspected row means spawning a subprocess that imports the TARGET application's
8
- * built modules and running a named behavior against them. Only the dev companion can do that: it
9
- * knows where the application lives, which behaviors exist, and how to run one. The engine must not
10
- * learn any of it.
7
+ * Producing an introspected row means running a named companion behavior — for the app-import
8
+ * behaviors a subprocess importing the TARGET application's built modules, for the creation-plane
9
+ * behaviors an in-process projection of the companion's own runtime services (amended 2026-09-01).
10
+ * Only the dev companion can do either: it knows where the application lives, which behaviors
11
+ * exist, and how each one materializes. The engine must not learn any of it — the materialization
12
+ * mechanism, like the behavior catalog itself, is the SOURCE's per-behavior decision, and cost and
13
+ * failure characteristics are per-behavior rather than per-adapter.
11
14
  *
12
15
  * So the engine owns the CONTRACT — the read surface, refusing every write, erasure posture — and
13
16
  * the companion owns the SOURCE, bound into the container under
@@ -47,7 +50,7 @@ export interface IntrospectionResourceRows {
47
50
  export interface IntrospectionResourceSourceBackendPort {
48
51
  /** Whether this source can serve the named resource at all. Cheap; no subprocess. */
49
52
  supports(resourceType: string): boolean;
50
- /** Derive the matching rows. May be expensive (subprocess + module import). */
53
+ /** Derive the matching rows. Cost is per-behavior: from an in-process projection to a subprocess module import. */
51
54
  deriveRows(query: IntrospectionResourceQuery): Promise<IntrospectionResourceRows>;
52
55
  }
53
56
  //# sourceMappingURL=introspection-resource-source.backend.port.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"introspection-resource-source.backend.port.d.ts","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAE5G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,0BAA0B;IACzC,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD,qFAAqF;IACrF,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAExC,+EAA+E;IAC/E,UAAU,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACnF"}
1
+ {"version":3,"file":"introspection-resource-source.backend.port.d.ts","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAE5G;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,0BAA0B;IACzC,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD,qFAAqF;IACrF,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAExC,mHAAmH;IACnH,UAAU,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"introspection-resource-source.backend.port.js","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\n\n/**\n * The port behind `PersistenceAdapter.INTROSPECTION`.\n *\n * ## Why the engine declares this but never implements it\n *\n * Producing an introspected row means spawning a subprocess that imports the TARGET application's\n * built modules and running a named behavior against them. Only the dev companion can do that: it\n * knows where the application lives, which behaviors exist, and how to run one. The engine must not\n * learn any of it.\n *\n * So the engine owns the CONTRACT — the read surface, refusing every write, erasure posture — and\n * the companion owns the SOURCE, bound into the container under\n * `SAAS_SERVICE_TYPES.IntrospectionResourceSource`. This is the shape `HTTP_API` already uses for\n * provider credentials, and the precedent for a non-engine package supplying an engine port is\n * `platform-apps-manager` binding `SAAS_SERVICE_TYPES.StorageCredentialResolver`.\n *\n * ## Absence is normal, not an error\n *\n * Every application that is not running a companion has NO binding for this port, and that must\n * stay a clean refusal rather than a boot failure — see the repository's `sourceOrRefuse`.\n */\nexport interface IntrospectionResourceQuery {\n /** The resource whose rows are being derived. */\n readonly resourceType: string;\n /** Filter as the engine passes it; the source decides what it can honor. */\n readonly filter?: unknown;\n /** Free-text query, for SEARCH only. */\n readonly searchQuery?: string;\n readonly executionContext: ExecutionContext<any>;\n}\n\nexport interface IntrospectionResourceRows {\n readonly rows: readonly Record<string, unknown>[];\n /**\n * Total matching rows when the source can state one.\n *\n * `undefined` means UNKNOWN, never zero. A source that cannot count must say so rather than\n * report 0 — an aggregate a caller would read as \"nothing there\" is the failure mode that makes a\n * degraded read indistinguishable from an empty one.\n */\n readonly total?: number;\n}\n\n/**\n * Implemented by the dev companion. Every method DERIVES; nothing is stored, so two consecutive\n * calls may legitimately differ if the application changed in between.\n */\nexport interface IntrospectionResourceSourceBackendPort {\n /** Whether this source can serve the named resource at all. Cheap; no subprocess. */\n supports(resourceType: string): boolean;\n\n /** Derive the matching rows. May be expensive (subprocess + module import). */\n deriveRows(query: IntrospectionResourceQuery): Promise<IntrospectionResourceRows>;\n}\n"]}
1
+ {"version":3,"file":"introspection-resource-source.backend.port.js","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\n\n/**\n * The port behind `PersistenceAdapter.INTROSPECTION`.\n *\n * ## Why the engine declares this but never implements it\n *\n * Producing an introspected row means running a named companion behavior — for the app-import\n * behaviors a subprocess importing the TARGET application's built modules, for the creation-plane\n * behaviors an in-process projection of the companion's own runtime services (amended 2026-09-01).\n * Only the dev companion can do either: it knows where the application lives, which behaviors\n * exist, and how each one materializes. The engine must not learn any of it — the materialization\n * mechanism, like the behavior catalog itself, is the SOURCE's per-behavior decision, and cost and\n * failure characteristics are per-behavior rather than per-adapter.\n *\n * So the engine owns the CONTRACT — the read surface, refusing every write, erasure posture — and\n * the companion owns the SOURCE, bound into the container under\n * `SAAS_SERVICE_TYPES.IntrospectionResourceSource`. This is the shape `HTTP_API` already uses for\n * provider credentials, and the precedent for a non-engine package supplying an engine port is\n * `platform-apps-manager` binding `SAAS_SERVICE_TYPES.StorageCredentialResolver`.\n *\n * ## Absence is normal, not an error\n *\n * Every application that is not running a companion has NO binding for this port, and that must\n * stay a clean refusal rather than a boot failure — see the repository's `sourceOrRefuse`.\n */\nexport interface IntrospectionResourceQuery {\n /** The resource whose rows are being derived. */\n readonly resourceType: string;\n /** Filter as the engine passes it; the source decides what it can honor. */\n readonly filter?: unknown;\n /** Free-text query, for SEARCH only. */\n readonly searchQuery?: string;\n readonly executionContext: ExecutionContext<any>;\n}\n\nexport interface IntrospectionResourceRows {\n readonly rows: readonly Record<string, unknown>[];\n /**\n * Total matching rows when the source can state one.\n *\n * `undefined` means UNKNOWN, never zero. A source that cannot count must say so rather than\n * report 0 — an aggregate a caller would read as \"nothing there\" is the failure mode that makes a\n * degraded read indistinguishable from an empty one.\n */\n readonly total?: number;\n}\n\n/**\n * Implemented by the dev companion. Every method DERIVES; nothing is stored, so two consecutive\n * calls may legitimately differ if the application changed in between.\n */\nexport interface IntrospectionResourceSourceBackendPort {\n /** Whether this source can serve the named resource at all. Cheap; no subprocess. */\n supports(resourceType: string): boolean;\n\n /** Derive the matching rows. Cost is per-behavior: from an in-process projection to a subprocess module import. */\n deriveRows(query: IntrospectionResourceQuery): Promise<IntrospectionResourceRows>;\n}\n"]}
@@ -28,6 +28,19 @@ type RepositoriesRegistryHandlerBackendService = any;
28
28
  import type { BackendResourceRepository } from './repositories-registry-handler.backend.service';
29
29
  import type { ConditionalArrayReturnType, ConditionalNullableReturnType, ConditionalReturnType, MainSchemaArrayType, MainSchemaType, PartialMainSchemaType } from '../../../base-classes/utils/backend-type-utils';
30
30
  import { type RepositoryGuardedMutation } from './repository-guarded-mutation.backend.types';
31
+ /**
32
+ * The id of a deleted row, from whatever `_doDelete` answered.
33
+ *
34
+ * ONE function because there are TWO doors into the same delete — the typed `delete()` wrapper and
35
+ * the `doOperation` dispatch — and for as long as only one of them unwrapped, the shape a caller got
36
+ * depended on which door it came through. That is the adapter/door-conditional guarantee this file
37
+ * has now been bitten by twice; keeping the unwrap in a single place is what stops a third.
38
+ *
39
+ * `_id` first, `id` second: PostgreSQL tables carry the framework's `_id`, and the `id` fallback is
40
+ * kept for a row shape that predates it. `''` for "nothing matched" is the contract both adapters
41
+ * already answer, and it is what lets the service distinguish a no-op delete from a successful one.
42
+ */
43
+ export declare function extractDeletedRowId(deletedRow: unknown): string;
31
44
  export declare class PostgreSQLResourceRepositoryBackendService<TCustomOperationEnum extends EnumLikeType | undefined = undefined, TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined, TMainSchema extends z.ZodTypeAny = z.ZodTypeAny> implements BackendResourceRepository<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {
32
45
  private readonly dbService;
33
46
  private readonly logger;
@@ -465,6 +478,24 @@ export declare class PostgreSQLResourceRepositoryBackendService<TCustomOperation
465
478
  * detectable.
466
479
  */
467
480
  updateManyByRawFilter(filter: Record<string, unknown>, mutation: RepositoryGuardedMutation, options?: RepositoryOptions): Promise<number>;
481
+ /**
482
+ * The MULTI-row DELETE below the operation tier: destroy every row matching an already-built
483
+ * filter, returning how many went.
484
+ *
485
+ * retention-gate: N/A — the hide is applied ONCE by the caller
486
+ * (`deleteManyForInfrastructure`), matching every sibling on this tier.
487
+ *
488
+ * rag-removal-gate: N/A — a raw repository door, bounded by the hourly RAG reconciliation sweep's
489
+ * orphan reconciliation, exactly as `_doDelete` / `_doDeleteMany` are.
490
+ *
491
+ * **The empty-filter refusal is contract, not local defensiveness** — see the same guard in
492
+ * `prepareGuardedUpdate`, and the reason it is stricter here than in `countByRawFilter` /
493
+ * `findManyByRawFilter`: `applyWhere` returns the builder UNCHANGED for a null where-expression
494
+ * and `buildWhere` yields null for an empty or unusable filter, so without this a caller whose
495
+ * predicate came out empty would emit `DELETE FROM <table>` and get a cheerful count back. A read
496
+ * can legitimately ask a whole-table question; a delete cannot.
497
+ */
498
+ deleteManyByRawFilter(filter: Record<string, unknown>, options?: RepositoryOptions): Promise<number>;
468
499
  /**
469
500
  * The expression a column currently carries in this statement, or its base value when nothing has
470
501
  * touched it yet.
@@ -1 +1 @@
1
- {"version":3,"file":"postgresql-resource-repository.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/base-classes/services/repositories/postgresql-resource-repository.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,+BAA+B,EAC/B,6CAA6C,EAC7C,YAAY,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qBAAqB,EAUrB,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAuB/B,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,8EAA8E,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAC;AAEjG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AACzG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AACnH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAChI,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,qFAAqF,CAAC;AACjJ,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EAClB,MAAM,qEAAqE,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,2EAA2E,CAAC;AAElI,OAAO,EAAE,yCAAyC,EAAE,MAAM,wEAAwE,CAAC;AACnI,OAAO,KAAK,EAAE,wBAAwB,EAAE,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6BAA6B;IA4CrC,OAAO,CAAC,qBAAqB;IAsL7B;;;;;OAKG;IACH;;;;;;;;;;;;OAYG;YACW,2CAA2C;IAkEzD;;;;;;OAMG;IACH,OAAO,KAAK,kBAAkB,GAO7B;YAEa,sCAAsC;IA8BpD,OAAO,CAAC,0BAA0B;IAelC;;;;;;;;;;OAUG;YACW,eAAe;IA0B7B,OAAO,CAAC,gCAAgC;IAsBxC,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,qBAAqB;IAmC7B,OAAO,CAAC,6BAA6B;IAwDrC,OAAO,CAAC,4BAA4B;CAuBrC"}
1
+ {"version":3,"file":"postgresql-resource-repository.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/base-classes/services/repositories/postgresql-resource-repository.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,+BAA+B,EAC/B,6CAA6C,EAC7C,YAAY,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,qBAAqB,EAUrB,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAuB/B,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,8EAA8E,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAC;AAEjG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AACzG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AACnH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAChI,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,qFAAqF,CAAC;AACjJ,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,E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CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IAkB5E;;;;;;;;;;;;;;;;OAgBG;IACU,yBAAyB,CACpC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC;IA+CpB;;;;;;;;;;;;OAYG;IACU,cAAc,CACzB,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACvC,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC;IA6ClB,sFAAsF;YACxE,wBAAwB;YAcxB,UAAU;IAYxB,OAAO,CAAC,oBAAoB;IAY5B;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,6BAA6B;IA4CrC,OAAO,CAAC,qBAAqB;IAsN7B;;;;;OAKG;IACH;;;;;;;;;;;;OAYG;YACW,2CAA2C;IAkEzD;;;;;;OAMG;IACH,OAAO,KAAK,kBAAkB,GAO7B;YAEa,sCAAsC;IA8BpD,OAAO,CAAC,0BAA0B;IAelC;;;;;;;;;;OAUG;YACW,eAAe;IA0B7B,OAAO,CAAC,gCAAgC;IAsBxC,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,qBAAqB;IAmC7B,OAAO,CAAC,6BAA6B;IAwDrC,OAAO,CAAC,4BAA4B;CAuBrC"}
@@ -16,6 +16,7 @@ import { getZodObjectShape } from '@wildo-ai/zod-decorators';
16
16
  import { PostgreSQLFilterBackendService } from '../../../databases/services/postgresql-filter.backend.service.js';
17
17
  import { sql } from 'kysely';
18
18
  import { normalizeRepositoryVersionMetadata } from '../../../base-classes/services/repositories/repository-version-metadata.backend.utils.js';
19
+ import { isEngineReservedFieldName } from './field-clearing-partition.backend.js';
19
20
  import { buildRetentionVisibleRowsSqlPredicate, isRetentionGovernedResource, withRetentionHideApplied, } from '../../../compliance/privacy/retention-hide-predicate.backend.js';
20
21
  import { quotePostgresColumnOf, quotePostgresIdentifier, } from '../../../databases/utils/postgresql-identifier.backend.utils.js';
21
22
  import { guardedMutationHasWork, RepositoryArrayAdditionPlacement, } from './repository-guarded-mutation.backend.types.js';
@@ -43,6 +44,25 @@ const ARRAY_JSONB_LITERAL = sql `'[]'::jsonb`;
43
44
  function uniqueColumnSetKey(columns) {
44
45
  return JSON.stringify([...columns].sort());
45
46
  }
47
+ /**
48
+ * The id of a deleted row, from whatever `_doDelete` answered.
49
+ *
50
+ * ONE function because there are TWO doors into the same delete — the typed `delete()` wrapper and
51
+ * the `doOperation` dispatch — and for as long as only one of them unwrapped, the shape a caller got
52
+ * depended on which door it came through. That is the adapter/door-conditional guarantee this file
53
+ * has now been bitten by twice; keeping the unwrap in a single place is what stops a third.
54
+ *
55
+ * `_id` first, `id` second: PostgreSQL tables carry the framework's `_id`, and the `id` fallback is
56
+ * kept for a row shape that predates it. `''` for "nothing matched" is the contract both adapters
57
+ * already answer, and it is what lets the service distinguish a no-op delete from a successful one.
58
+ */
59
+ export function extractDeletedRowId(deletedRow) {
60
+ if (!deletedRow || typeof deletedRow !== 'object')
61
+ return '';
62
+ const row = deletedRow;
63
+ const identity = row._id ?? row.id;
64
+ return typeof identity === 'string' && identity.length > 0 ? identity : '';
65
+ }
46
66
  export class PostgreSQLResourceRepositoryBackendService {
47
67
  dbService;
48
68
  logger;
@@ -412,7 +432,11 @@ export class PostgreSQLResourceRepositoryBackendService {
412
432
  ResourcesConfig_OperationPathUtils.validateOperationRepositoryPathKey(operationRepositoryPathKey);
413
433
  const operation = this.operationsMap.get(operationRepositoryPathKey);
414
434
  if (!operation) {
415
- throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {
435
+ // CONFIGURATION, not NOT_FOUND — the same structural fault as the Mongo arm, fixed with it
436
+ // rather than after it. Both persistence adapters carry this lookup, which is the shape
437
+ // `invariant-call-site-enumeration.md` records for a port: a fix applied to one side leaves
438
+ // the other answering the old way.
439
+ throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {
416
440
  customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED,
417
441
  context: { operationRepositoryPathKey },
418
442
  });
@@ -469,7 +493,21 @@ export class PostgreSQLResourceRepositoryBackendService {
469
493
  context: { operationRepositoryPathKey, id_or_ids_or_filter },
470
494
  });
471
495
  }
472
- return this._doDelete(operation, executionContext, id_or_ids_or_filter, options);
496
+ /*
497
+ * UNWRAPPED, exactly as the `delete()` wrapper does.
498
+ *
499
+ * `_doDelete` uses `.returningAll()` and answers the whole deleted ROW, while the DELETE
500
+ * contract — `Promise<string>` on both adapters — is the id. `delete()` unwrapped it and this
501
+ * dispatch did not, so which shape a caller got depended on WHICH DOOR it came through. The
502
+ * service layer comes through here, so every single DELETE on a PostgreSQL-backed resource
503
+ * returned a row; `composeDefaultOperationResponse` then built `{ id: <row> }`, the DELETE DTO
504
+ * refused it, and the request answered 500 AFTER the row was already gone.
505
+ *
506
+ * MongoDB's `_doDelete` returns the id directly, so its dispatch was correct and this was
507
+ * adapter-conditional — the failure shape this file's own `_doDelete` comment calls "worse than
508
+ * no guarantee". Both doors now go through one function so they cannot drift apart again.
509
+ */
510
+ return extractDeletedRowId(await this._doDelete(operation, executionContext, id_or_ids_or_filter, options));
473
511
  case CoreResourceOperation.DELETE_MANY:
474
512
  return this._doDeleteMany(operation, executionContext, id_or_ids_or_filter, options);
475
513
  case CoreResourceOperation.LIST:
@@ -600,7 +638,7 @@ export class PostgreSQLResourceRepositoryBackendService {
600
638
  });
601
639
  }
602
640
  const deleted = await this._doDelete(operation, executionContext, id_or_ids_or_filter, options);
603
- return deleted?._id ?? deleted?.id ?? '';
641
+ return extractDeletedRowId(deleted);
604
642
  }
605
643
  async deleteMany(executionContext, ids_or_filter, options) {
606
644
  const operation = this.resourceConfiguration.operations.find((op) => op.operationIdentifier === CoreResourceOperation.DELETE_MANY && op.isOperationDefault === true);
@@ -1029,6 +1067,41 @@ export class PostgreSQLResourceRepositoryBackendService {
1029
1067
  // Kysely reports affected rows as a bigint; coerce so callers compare a number, not a string.
1030
1068
  return Number(result?.numUpdatedRows ?? 0);
1031
1069
  }
1070
+ /**
1071
+ * The MULTI-row DELETE below the operation tier: destroy every row matching an already-built
1072
+ * filter, returning how many went.
1073
+ *
1074
+ * retention-gate: N/A — the hide is applied ONCE by the caller
1075
+ * (`deleteManyForInfrastructure`), matching every sibling on this tier.
1076
+ *
1077
+ * rag-removal-gate: N/A — a raw repository door, bounded by the hourly RAG reconciliation sweep's
1078
+ * orphan reconciliation, exactly as `_doDelete` / `_doDeleteMany` are.
1079
+ *
1080
+ * **The empty-filter refusal is contract, not local defensiveness** — see the same guard in
1081
+ * `prepareGuardedUpdate`, and the reason it is stricter here than in `countByRawFilter` /
1082
+ * `findManyByRawFilter`: `applyWhere` returns the builder UNCHANGED for a null where-expression
1083
+ * and `buildWhere` yields null for an empty or unusable filter, so without this a caller whose
1084
+ * predicate came out empty would emit `DELETE FROM <table>` and get a cheerful count back. A read
1085
+ * can legitimately ask a whole-table question; a delete cannot.
1086
+ */
1087
+ async deleteManyByRawFilter(filter, options) {
1088
+ const where = this.buildWhere(filter);
1089
+ if (!where) {
1090
+ throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
1091
+ customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,
1092
+ context: {
1093
+ resourceType: this.tableName,
1094
+ reason: 'deleteManyByRawFilter requires a non-empty filter — refusing an unfiltered DELETE',
1095
+ },
1096
+ });
1097
+ }
1098
+ const db = await this.getDbOrTrx(options);
1099
+ const result = await this.filterService
1100
+ .applyWhere(db.deleteFrom(this.tableName), where)
1101
+ .executeTakeFirst();
1102
+ // Kysely reports affected rows as a bigint; coerce so callers compare a number, not a string.
1103
+ return Number(result?.numDeletedRows ?? 0);
1104
+ }
1032
1105
  /**
1033
1106
  * The expression a column currently carries in this statement, or its base value when nothing has
1034
1107
  * touched it yet.
@@ -1196,8 +1269,25 @@ export class PostgreSQLResourceRepositoryBackendService {
1196
1269
  // coverage of the write surface is a PROPERTY of the chokepoint set rather than a consequence of
1197
1270
  // who happens to call it today.
1198
1271
  await this.assertOrganizationUnitWriteWithinGrant(payload, CoreResourceOperation.CREATE, executionContext);
1272
+ // Engine-reserved metadata is stripped from the CALLER's payload before anything else — the
1273
+ // 7th site of an invariant the six sibling write paths already apply by hand (`_doCreate`,
1274
+ // `_doCreateMany`, `_doUpdate`, `_doUpdateMany`, and both `upsertByFilter` branches each
1275
+ // `delete ..._version`). This one was missed, and it is the ONLY write path data-seeding uses.
1276
+ //
1277
+ // It matters because a seed UPGRADE's payload is a READ PROJECTION: the managed-field overlay
1278
+ // is the persisted row with managed paths replaced, and `transformPersistenceRow` publishes
1279
+ // `_version_db_doc` as the public read-only `_version`. Writing that back names a column this
1280
+ // table does not have — `column "_version" of relation "..." does not exist` — so every
1281
+ // PostgreSQL seed upgrade failed. Applied via the named rule rather than a seventh hand-list so
1282
+ // a future engine-owned key is covered without another enumeration.
1283
+ const callerAuthoredPayload = {};
1284
+ for (const key of Object.keys(payload)) {
1285
+ if (isEngineReservedFieldName(key))
1286
+ continue;
1287
+ callerAuthoredPayload[key] = payload[key];
1288
+ }
1199
1289
  const writePayload = {
1200
- ...payload,
1290
+ ...callerAuthoredPayload,
1201
1291
  [DATA_SEED_ROW_METADATA_FIELD_KEY]: seedMetadata,
1202
1292
  };
1203
1293
  const trackedPayload = this.addUserTrackingAndTimestamps(writePayload, executionContext, existing ? CoreResourceOperation.UPDATE : CoreResourceOperation.CREATE);
@@ -2354,11 +2444,43 @@ export class PostgreSQLResourceRepositoryBackendService {
2354
2444
  this.resourceOperationHelper.applyAuthoritativeContextFilterValue(contextualFilter, fieldIdentifier, resourceId, { fieldIdentifier, resourceIdentifier: String(this.resourceConfiguration.resourceIdentifier) });
2355
2445
  return;
2356
2446
  }
2357
- const matchingPaths = this.resourceOperationHelper.findRequiredNestedFieldPathsFromZodSchema(this.resourceConfiguration.mainSchema, fieldIdentifier, executionContext, {
2447
+ const allMatchingPaths = this.resourceOperationHelper.findRequiredNestedFieldPathsFromZodSchema(this.resourceConfiguration.mainSchema, fieldIdentifier, executionContext, {
2358
2448
  reason: 'context_filter',
2359
2449
  resourceIdentifier: this.resourceConfiguration.resourceIdentifier,
2360
2450
  message: `Execution context field '${fieldIdentifier}' is missing from schema for resource '${this.resourceConfiguration.resourceIdentifier}' during contextual filtering`,
2361
2451
  });
2452
+ /*
2453
+ * THE SCOPE FIELD FILTERS AT THE TOP LEVEL ONLY — the third site of the same invariant fixed
2454
+ * on 2026-09-01 (the initiator-organization confinement, the Mongo context block, and this
2455
+ * twin), and the one that was actually RUNNING when the defect was measured: this adapter
2456
+ * served `wildoApplicationActorTasks`, whose schema nests
2457
+ * `errorStates.errorItems.initiatorIds.organizationId` (a recorded error's initiator — data,
2458
+ * not tenancy), and the unrestricted sweep put that dotted path into the filter, which this
2459
+ * adapter's compiler refused as an invalid column reference — a 400 on every LIST. Read the
2460
+ * Mongo sibling's block comment for the full account, including why Mongo's failure mode for
2461
+ * the same sweep is WORSE (silent row-hiding rather than a crash). The write path had already
2462
+ * learned this lesson (`enrichDataWithContextFields`: "Deep matches inside embedded payloads
2463
+ * are never the scope column").
2464
+ */
2465
+ const isScopeField = fieldIdentifier === primaryScopeFieldIdentifier;
2466
+ const matchingPaths = isScopeField
2467
+ ? allMatchingPaths.filter((fullPath) => fullPath === fieldIdentifier)
2468
+ : allMatchingPaths;
2469
+ if (isScopeField && matchingPaths.length === 0 && allMatchingPaths.length > 0) {
2470
+ throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {
2471
+ customMessageReference: ErrorCustomMessageReference.CONFIGURATION,
2472
+ context: {
2473
+ reason: 'scope_field_modeled_only_nested',
2474
+ resourceIdentifier: this.resourceConfiguration.resourceIdentifier,
2475
+ fieldIdentifier,
2476
+ nestedPaths: allMatchingPaths,
2477
+ message: `Scope field '${fieldIdentifier}' appears only NESTED in the schema for resource `
2478
+ + `'${this.resourceConfiguration.resourceIdentifier}'. A scoped resource carries its scope FK as a `
2479
+ + 'top-level column (the write path injects it there); a nested occurrence of the name is data. '
2480
+ + 'Refusing rather than widening the query beyond its tenant.',
2481
+ },
2482
+ });
2483
+ }
2362
2484
  matchingPaths.forEach((fullPath) => {
2363
2485
  /**
2364
2486
  * D2 — resolve a SURROGATE primary key to the queryable column.