@wildo-ai/saas-models 1.1.7 → 1.1.9

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 (882) hide show
  1. package/dist/esm/_inspect.d.ts.map +1 -1
  2. package/dist/esm/_inspect.js.map +1 -1
  3. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts.map +1 -1
  4. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.js.map +1 -1
  5. package/dist/esm/applications/application-subject.shared.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/application-subject.shared.schemas.js.map +1 -1
  7. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
  8. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
  9. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  10. package/dist/esm/applications/applications-context.schemas.js.map +1 -1
  11. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  12. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  13. package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
  14. package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
  15. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  16. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  17. package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
  18. package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
  19. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  20. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  21. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  22. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  23. package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
  24. package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
  25. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  26. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
  27. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  28. package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
  29. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
  30. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
  31. package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
  32. package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
  33. package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
  34. package/dist/esm/billing/price.shared.resources-config.schemas.js.map +1 -1
  35. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  36. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  37. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  39. package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
  40. package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
  41. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
  42. package/dist/esm/billing/product.shared.resources-config.schemas.js.map +1 -1
  43. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  44. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  45. package/dist/esm/billing/promotions.shared.resources-config.schemas.d.ts.map +1 -1
  46. package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
  47. package/dist/esm/billing/promotions.shared.schemas.d.ts.map +1 -1
  48. package/dist/esm/billing/promotions.shared.schemas.js.map +1 -1
  49. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -1
  50. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -1
  51. package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -1
  52. package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -1
  53. package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -1
  54. package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -1
  55. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
  56. package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
  57. package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
  58. package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
  59. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  60. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  61. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  62. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  63. package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts.map +1 -1
  64. package/dist/esm/billing/usage-flush-evidence.shared.schemas.js.map +1 -1
  65. package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
  66. package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
  67. package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
  68. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  69. package/dist/esm/charts/aggregation-query.shared.schemas.d.ts.map +1 -1
  70. package/dist/esm/charts/aggregation-query.shared.schemas.js.map +1 -1
  71. package/dist/esm/charts/aggregation.shared.definitions.d.ts.map +1 -1
  72. package/dist/esm/charts/aggregation.shared.definitions.js.map +1 -1
  73. package/dist/esm/charts/chart-definition-builder.shared.d.ts.map +1 -1
  74. package/dist/esm/charts/chart-definition-builder.shared.js.map +1 -1
  75. package/dist/esm/companion/artifact-placement.shared.definitions.d.ts.map +1 -1
  76. package/dist/esm/companion/artifact-placement.shared.definitions.js.map +1 -1
  77. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +13 -0
  78. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  79. package/dist/esm/companion/provider-discovery.shared.schemas.js +13 -0
  80. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  81. package/dist/esm/companion/shared-library-companion.shared.definitions.d.ts.map +1 -1
  82. package/dist/esm/companion/shared-library-companion.shared.definitions.js.map +1 -1
  83. package/dist/esm/companion-exports.d.ts.map +1 -1
  84. package/dist/esm/companion-exports.js.map +1 -1
  85. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  86. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
  87. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts.map +1 -1
  88. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js.map +1 -1
  89. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
  90. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -1
  91. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
  92. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.js.map +1 -1
  93. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  94. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
  95. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  96. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  97. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  98. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  99. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  100. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  101. package/dist/esm/compliance/data-classification/data-classification.shared.schemas.d.ts.map +1 -1
  102. package/dist/esm/compliance/data-classification/data-classification.shared.schemas.js.map +1 -1
  103. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts.map +1 -1
  104. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js.map +1 -1
  105. package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
  106. package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
  107. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts.map +1 -1
  108. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js.map +1 -1
  109. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts.map +1 -1
  110. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js.map +1 -1
  111. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
  112. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
  113. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts.map +1 -1
  114. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js.map +1 -1
  115. package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
  116. package/dist/esm/compliance/privacy/client-storage.shared.schemas.js.map +1 -1
  117. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts.map +1 -1
  118. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js.map +1 -1
  119. package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts.map +1 -1
  120. package/dist/esm/compliance/privacy/consent-purposes.shared.js.map +1 -1
  121. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -1
  122. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
  123. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
  124. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
  125. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  126. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
  127. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -1
  128. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -1
  129. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -1
  130. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -1
  131. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -1
  132. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -1
  133. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
  134. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
  135. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +32 -1
  136. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  137. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +32 -0
  138. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  139. package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.d.ts.map +1 -1
  140. package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.js.map +1 -1
  141. package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.d.ts.map +1 -1
  142. package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.js.map +1 -1
  143. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
  144. package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
  145. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -1
  146. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -1
  147. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -1
  148. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -1
  149. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
  150. package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
  151. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -1
  152. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -1
  153. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -1
  154. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -1
  155. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -1
  156. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -1
  157. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
  158. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js.map +1 -1
  159. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -1
  160. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -1
  161. package/dist/esm/compliance/privacy/sharing.shared.schemas.d.ts.map +1 -1
  162. package/dist/esm/compliance/privacy/sharing.shared.schemas.js.map +1 -1
  163. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -1
  164. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -1
  165. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts.map +1 -1
  166. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js.map +1 -1
  167. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
  168. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
  169. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
  170. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js.map +1 -1
  171. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  172. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  173. package/dist/esm/compliance/review-cadence.shared.schemas.d.ts.map +1 -1
  174. package/dist/esm/compliance/review-cadence.shared.schemas.js.map +1 -1
  175. package/dist/esm/compliance/risk-posture.shared.schemas.d.ts +15 -3
  176. package/dist/esm/compliance/risk-posture.shared.schemas.d.ts.map +1 -1
  177. package/dist/esm/compliance/risk-posture.shared.schemas.js +14 -2
  178. package/dist/esm/compliance/risk-posture.shared.schemas.js.map +1 -1
  179. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
  180. package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
  181. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  182. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  183. package/dist/esm/config/app-frontend-type.shared.schemas.d.ts.map +1 -1
  184. package/dist/esm/config/app-frontend-type.shared.schemas.js.map +1 -1
  185. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
  186. package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
  187. package/dist/esm/config/brand-assets.shared.schemas.d.ts.map +1 -1
  188. package/dist/esm/config/brand-assets.shared.schemas.js.map +1 -1
  189. package/dist/esm/config/configuration-validation.shared.schemas.d.ts.map +1 -1
  190. package/dist/esm/config/configuration-validation.shared.schemas.js.map +1 -1
  191. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  192. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  193. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts.map +1 -1
  194. package/dist/esm/config/frontend/chart-definition.shared.schemas.js.map +1 -1
  195. package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
  196. package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
  197. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  198. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  199. package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
  200. package/dist/esm/config/frontend/onboarding.shared.schemas.js.map +1 -1
  201. package/dist/esm/config/postgresql.shared.schemas.d.ts.map +1 -1
  202. package/dist/esm/config/postgresql.shared.schemas.js.map +1 -1
  203. package/dist/esm/config/registration-acquisition-policy.shared.utils.d.ts.map +1 -1
  204. package/dist/esm/config/registration-acquisition-policy.shared.utils.js.map +1 -1
  205. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  206. package/dist/esm/config-authoring.entry.js.map +1 -1
  207. package/dist/esm/crdt/crdt-merge.shared.utils.d.ts.map +1 -1
  208. package/dist/esm/crdt/crdt-merge.shared.utils.js.map +1 -1
  209. package/dist/esm/data-seeding/data-seeding-config.shared.schemas.d.ts.map +1 -1
  210. package/dist/esm/data-seeding/data-seeding-config.shared.schemas.js.map +1 -1
  211. package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -1
  212. package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -1
  213. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  214. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  215. package/dist/esm/errors/errors.shared.definitions.d.ts.map +1 -1
  216. package/dist/esm/errors/errors.shared.definitions.js.map +1 -1
  217. package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
  218. package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
  219. package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
  220. package/dist/esm/errors/errors.shared.utils.js.map +1 -1
  221. package/dist/esm/errors/resource-access-forbidden.shared.error.d.ts.map +1 -1
  222. package/dist/esm/errors/resource-access-forbidden.shared.error.js.map +1 -1
  223. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
  224. package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
  225. package/dist/esm/errors/zod-issue-formatting.shared.utils.d.ts.map +1 -1
  226. package/dist/esm/errors/zod-issue-formatting.shared.utils.js.map +1 -1
  227. package/dist/esm/exports/tabular-csv.shared.utils.d.ts.map +1 -1
  228. package/dist/esm/exports/tabular-csv.shared.utils.js.map +1 -1
  229. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -1
  230. package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -1
  231. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -1
  232. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -1
  233. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  234. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  235. package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -1
  236. package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -1
  237. package/dist/esm/external-data.exports.d.ts.map +1 -1
  238. package/dist/esm/external-data.exports.js.map +1 -1
  239. package/dist/esm/external-providers/compose-provider-registry.shared.d.ts.map +1 -1
  240. package/dist/esm/external-providers/compose-provider-registry.shared.js.map +1 -1
  241. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  242. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  243. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  244. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  245. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -1
  246. package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
  247. package/dist/esm/external-providers/external-providers.shared.schemas.d.ts.map +1 -1
  248. package/dist/esm/external-providers/external-providers.shared.schemas.js.map +1 -1
  249. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  250. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.js.map +1 -1
  251. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
  252. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
  253. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
  254. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
  255. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  256. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  257. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
  258. package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
  259. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -1
  260. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -1
  261. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -1
  262. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -1
  263. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -1
  264. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -1
  265. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts.map +1 -1
  266. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js.map +1 -1
  267. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -1
  268. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -1
  269. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  270. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  271. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  272. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  273. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
  274. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
  275. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
  276. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
  277. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
  278. package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
  279. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -1
  280. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -1
  281. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  282. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  283. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -1
  284. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -1
  285. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -1
  286. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -1
  287. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -1
  288. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -1
  289. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -1
  290. package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -1
  291. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -1
  292. package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -1
  293. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
  294. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js.map +1 -1
  295. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
  296. package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
  297. package/dist/esm/features/connected-feature.example.d.ts.map +1 -1
  298. package/dist/esm/features/connected-feature.example.js.map +1 -1
  299. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  300. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  301. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  302. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  303. package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
  304. package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
  305. package/dist/esm/features/feature-registry.shared.d.ts.map +1 -1
  306. package/dist/esm/features/feature-registry.shared.js.map +1 -1
  307. package/dist/esm/features/feature-resolution.shared.schemas.d.ts.map +1 -1
  308. package/dist/esm/features/feature-resolution.shared.schemas.js.map +1 -1
  309. package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
  310. package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
  311. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
  312. package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
  313. package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -1
  314. package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -1
  315. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -1
  316. package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -1
  317. package/dist/esm/files/files.shared.resources-config.schemas.d.ts.map +1 -1
  318. package/dist/esm/files/files.shared.resources-config.schemas.js.map +1 -1
  319. package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
  320. package/dist/esm/files/files.shared.schemas.js.map +1 -1
  321. package/dist/esm/files/files.shared.utils.d.ts.map +1 -1
  322. package/dist/esm/files/files.shared.utils.js.map +1 -1
  323. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  324. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
  325. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
  326. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
  327. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
  328. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
  329. package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.d.ts.map +1 -1
  330. package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.js.map +1 -1
  331. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  332. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  333. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
  334. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js.map +1 -1
  335. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -1
  336. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -1
  337. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -1
  338. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -1
  339. package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
  340. package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
  341. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -1
  342. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -1
  343. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
  344. package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
  345. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts.map +1 -1
  346. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js.map +1 -1
  347. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
  348. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
  349. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  350. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  351. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
  352. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
  353. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
  354. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
  355. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  356. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  357. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
  358. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
  359. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
  360. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
  361. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
  362. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  363. package/dist/esm/flows-actors/flows-actors.system.shared.definitions.d.ts.map +1 -1
  364. package/dist/esm/flows-actors/flows-actors.system.shared.definitions.js.map +1 -1
  365. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  366. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
  367. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  368. package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
  369. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
  370. package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
  371. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -1
  372. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -1
  373. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -1
  374. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -1
  375. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -1
  376. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -1
  377. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -1
  378. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -1
  379. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -1
  380. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -1
  381. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -1
  382. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -1
  383. package/dist/esm/flows-actors/prompt-ir.shared.schemas.d.ts.map +1 -1
  384. package/dist/esm/flows-actors/prompt-ir.shared.schemas.js.map +1 -1
  385. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -1
  386. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -1
  387. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -1
  388. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -1
  389. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -1
  390. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -1
  391. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
  392. package/dist/esm/flows-actors/tasks.actors.shared.schemas.js.map +1 -1
  393. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -1
  394. package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -1
  395. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts.map +1 -1
  396. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js.map +1 -1
  397. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
  398. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
  399. package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
  400. package/dist/esm/guidance/guidance-flow.shared.schemas.js.map +1 -1
  401. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
  402. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
  403. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  404. package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
  405. package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
  406. package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
  407. package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts.map +1 -1
  408. package/dist/esm/guidance/lifecycle-config.shared.schemas.js.map +1 -1
  409. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
  410. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
  411. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
  412. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  413. package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
  414. package/dist/esm/guidance/milestone-builders.shared.js.map +1 -1
  415. package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.map +1 -1
  416. package/dist/esm/guidance/milestone-definition.shared.schemas.js.map +1 -1
  417. package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts.map +1 -1
  418. package/dist/esm/guidance/progression-presentation.shared.schemas.js.map +1 -1
  419. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
  420. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
  421. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  422. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  423. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.d.ts.map +1 -1
  424. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
  425. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  426. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  427. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -1
  428. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -1
  429. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -1
  430. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -1
  431. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -1
  432. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
  433. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts.map +1 -1
  434. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js.map +1 -1
  435. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -1
  436. package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -1
  437. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -1
  438. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -1
  439. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -1
  440. package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -1
  441. package/dist/esm/i18n/interpolate-label-params.shared.utils.d.ts.map +1 -1
  442. package/dist/esm/i18n/interpolate-label-params.shared.utils.js.map +1 -1
  443. package/dist/esm/i18n/labelling.dto.shared.schemas.d.ts.map +1 -1
  444. package/dist/esm/i18n/labelling.dto.shared.schemas.js.map +1 -1
  445. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -1
  446. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -1
  447. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -1
  448. package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -1
  449. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -1
  450. package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -1
  451. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -1
  452. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -1
  453. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -1
  454. package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -1
  455. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -1
  456. package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -1
  457. package/dist/esm/index.d.ts.map +1 -1
  458. package/dist/esm/index.js.map +1 -1
  459. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -1
  460. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.js.map +1 -1
  461. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +1 -1
  462. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +1 -1
  463. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts.map +1 -1
  464. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js.map +1 -1
  465. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
  466. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
  467. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -1
  468. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  469. package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.d.ts +128 -0
  470. package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.d.ts.map +1 -0
  471. package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.js +136 -0
  472. package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.js.map +1 -0
  473. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +32 -0
  474. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
  475. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +66 -1
  476. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
  477. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -1
  478. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +1 -1
  479. package/dist/esm/meta-workflows.exports.d.ts +1 -0
  480. package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
  481. package/dist/esm/meta-workflows.exports.js +1 -0
  482. package/dist/esm/meta-workflows.exports.js.map +1 -1
  483. package/dist/esm/monitoring/monitoring.shared.schemas.d.ts.map +1 -1
  484. package/dist/esm/monitoring/monitoring.shared.schemas.js.map +1 -1
  485. package/dist/esm/notifications/email/email-context.shared.schemas.d.ts.map +1 -1
  486. package/dist/esm/notifications/email/email-context.shared.schemas.js.map +1 -1
  487. package/dist/esm/notifications/email/email-submission.shared.enums.d.ts.map +1 -1
  488. package/dist/esm/notifications/email/email-submission.shared.enums.js.map +1 -1
  489. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  490. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  491. package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
  492. package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
  493. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -1
  494. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -1
  495. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -1
  496. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -1
  497. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -1
  498. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -1
  499. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  500. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
  501. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.map +1 -1
  502. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js.map +1 -1
  503. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  504. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  505. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  506. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  507. package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
  508. package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
  509. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  510. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  511. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
  512. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
  513. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  514. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  515. package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts.map +1 -1
  516. package/dist/esm/organizations/application-owner-organization.shared.schemas.js.map +1 -1
  517. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
  518. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
  519. package/dist/esm/organizations/organization-features.shared.schemas.d.ts.map +1 -1
  520. package/dist/esm/organizations/organization-features.shared.schemas.js.map +1 -1
  521. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  522. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  523. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  524. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  525. package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.d.ts.map +1 -1
  526. package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.js.map +1 -1
  527. package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
  528. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  529. package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  530. package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.js.map +1 -1
  531. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
  532. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  533. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
  534. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.js.map +1 -1
  535. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  536. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  537. package/dist/esm/organizations/organization-unit-inheritance.shared.d.ts.map +1 -1
  538. package/dist/esm/organizations/organization-unit-inheritance.shared.js.map +1 -1
  539. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.d.ts.map +1 -1
  540. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map +1 -1
  541. package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
  542. package/dist/esm/organizations/organization-unit-members.shared.schemas.js.map +1 -1
  543. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
  544. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js.map +1 -1
  545. package/dist/esm/organizations/organization-unit-narrowing.example.d.ts.map +1 -1
  546. package/dist/esm/organizations/organization-unit-narrowing.example.js.map +1 -1
  547. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  548. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  549. package/dist/esm/organizations/organization-units.shared.path.d.ts.map +1 -1
  550. package/dist/esm/organizations/organization-units.shared.path.js.map +1 -1
  551. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
  552. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
  553. package/dist/esm/organizations/organization-units.shared.schemas.d.ts.map +1 -1
  554. package/dist/esm/organizations/organization-units.shared.schemas.js.map +1 -1
  555. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  556. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  557. package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
  558. package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
  559. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -1
  560. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -1
  561. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -1
  562. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -1
  563. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -1
  564. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -1
  565. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -1
  566. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -1
  567. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -1
  568. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -1
  569. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -1
  570. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -1
  571. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -1
  572. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -1
  573. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
  574. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
  575. package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
  576. package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
  577. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  578. package/dist/esm/public-runtime/index.js.map +1 -1
  579. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
  580. package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
  581. package/dist/esm/queue/jobs.shared.schemas.d.ts +70 -1
  582. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  583. package/dist/esm/queue/jobs.shared.schemas.js +85 -2
  584. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  585. package/dist/esm/queue/jobs.shared.utils.d.ts.map +1 -1
  586. package/dist/esm/queue/jobs.shared.utils.js.map +1 -1
  587. package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
  588. package/dist/esm/queue/queues.shared.schemas.js.map +1 -1
  589. package/dist/esm/queue/queues.shared.utils.d.ts.map +1 -1
  590. package/dist/esm/queue/queues.shared.utils.js.map +1 -1
  591. package/dist/esm/queue/rabbitmq-queue-args.shared.d.ts.map +1 -1
  592. package/dist/esm/queue/rabbitmq-queue-args.shared.js.map +1 -1
  593. package/dist/esm/rag/rag-retrieval-health.shared.d.ts.map +1 -1
  594. package/dist/esm/rag/rag-retrieval-health.shared.js.map +1 -1
  595. package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
  596. package/dist/esm/requests/header-keys.shared.js.map +1 -1
  597. package/dist/esm/requests/http-requests.shared.d.ts.map +1 -1
  598. package/dist/esm/requests/http-requests.shared.js.map +1 -1
  599. package/dist/esm/requests/idempotency-key.shared.d.ts.map +1 -1
  600. package/dist/esm/requests/idempotency-key.shared.js.map +1 -1
  601. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
  602. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
  603. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  604. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  605. package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
  606. package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
  607. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  608. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  609. package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
  610. package/dist/esm/resources/child-operations.shared.schemas.js.map +1 -1
  611. package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -1
  612. package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -1
  613. package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
  614. package/dist/esm/resources/context-policy.shared.schemas.js.map +1 -1
  615. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -1
  616. package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -1
  617. package/dist/esm/resources/relationship-display.shared.schemas.d.ts.map +1 -1
  618. package/dist/esm/resources/relationship-display.shared.schemas.js.map +1 -1
  619. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  620. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  621. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  622. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  623. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  624. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  625. package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
  626. package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
  627. package/dist/esm/resources/resources-serialization.shared.schemas.d.ts.map +1 -1
  628. package/dist/esm/resources/resources-serialization.shared.schemas.js.map +1 -1
  629. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  630. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  631. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  632. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  633. package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
  634. package/dist/esm/resources/resources.shared.utils.js.map +1 -1
  635. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
  636. package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
  637. package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
  638. package/dist/esm/resources/utils/composition-cascade-deletability.validation.js.map +1 -1
  639. package/dist/esm/resources/utils/composition-seedability.validation.d.ts.map +1 -1
  640. package/dist/esm/resources/utils/composition-seedability.validation.js.map +1 -1
  641. package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.d.ts.map +1 -1
  642. package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.js.map +1 -1
  643. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts.map +1 -1
  644. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js.map +1 -1
  645. package/dist/esm/resources/utils/duplicate-relationship-registration.validation.d.ts.map +1 -1
  646. package/dist/esm/resources/utils/duplicate-relationship-registration.validation.js.map +1 -1
  647. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -1
  648. package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -1
  649. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -1
  650. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -1
  651. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts.map +1 -1
  652. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js.map +1 -1
  653. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -1
  654. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -1
  655. package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.d.ts.map +1 -1
  656. package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.js.map +1 -1
  657. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -1
  658. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
  659. package/dist/esm/resources/utils/repository-dto-builder.utils.d.ts.map +1 -1
  660. package/dist/esm/resources/utils/repository-dto-builder.utils.js.map +1 -1
  661. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -1
  662. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -1
  663. package/dist/esm/resources/utils/required-fk-fillability.validation.d.ts.map +1 -1
  664. package/dist/esm/resources/utils/required-fk-fillability.validation.js.map +1 -1
  665. package/dist/esm/resources/utils/resource-operation-type-guards.utils.d.ts.map +1 -1
  666. package/dist/esm/resources/utils/resource-operation-type-guards.utils.js.map +1 -1
  667. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
  668. package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
  669. package/dist/esm/resources/utils/resource-polymorphism.relationships.d.ts.map +1 -1
  670. package/dist/esm/resources/utils/resource-polymorphism.relationships.js.map +1 -1
  671. package/dist/esm/resources/utils/resource-polymorphism.schemas.d.ts.map +1 -1
  672. package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
  673. package/dist/esm/resources/utils/resource-polymorphism.utils.d.ts.map +1 -1
  674. package/dist/esm/resources/utils/resource-polymorphism.utils.js.map +1 -1
  675. package/dist/esm/resources/utils/resource-subtree.utils.d.ts.map +1 -1
  676. package/dist/esm/resources/utils/resource-subtree.utils.js.map +1 -1
  677. package/dist/esm/resources/utils/resources-config-context-needs.utils.d.ts.map +1 -1
  678. package/dist/esm/resources/utils/resources-config-context-needs.utils.js.map +1 -1
  679. package/dist/esm/resources/utils/resources-config-naming.utils.d.ts.map +1 -1
  680. package/dist/esm/resources/utils/resources-config-naming.utils.js.map +1 -1
  681. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +25 -0
  682. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  683. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +47 -19
  684. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  685. package/dist/esm/resources/utils/resources-config-operations.path.utils.d.ts.map +1 -1
  686. package/dist/esm/resources/utils/resources-config-operations.path.utils.js.map +1 -1
  687. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
  688. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js.map +1 -1
  689. package/dist/esm/resources/utils/resources-config-operations.utils.d.ts.map +1 -1
  690. package/dist/esm/resources/utils/resources-config-operations.utils.js.map +1 -1
  691. package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
  692. package/dist/esm/resources/utils/resources-serialization.utils.js.map +1 -1
  693. package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
  694. package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
  695. package/dist/esm/resources/utils/schema-family-builder.utils.d.ts.map +1 -1
  696. package/dist/esm/resources/utils/schema-family-builder.utils.js.map +1 -1
  697. package/dist/esm/resources/utils/schema-type-inference.utils.d.ts.map +1 -1
  698. package/dist/esm/resources/utils/schema-type-inference.utils.js.map +1 -1
  699. package/dist/esm/resources/utils/schema-type-utils.d.ts.map +1 -1
  700. package/dist/esm/resources/utils/schema-type-utils.js.map +1 -1
  701. package/dist/esm/resources/utils/schema-variant-resolver.utils.d.ts.map +1 -1
  702. package/dist/esm/resources/utils/schema-variant-resolver.utils.js.map +1 -1
  703. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  704. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  705. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.d.ts.map +1 -1
  706. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js.map +1 -1
  707. package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -1
  708. package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -1
  709. package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
  710. package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
  711. package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
  712. package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
  713. package/dist/esm/runtime/runtime.shared.schemas.d.ts.map +1 -1
  714. package/dist/esm/runtime/runtime.shared.schemas.js.map +1 -1
  715. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  716. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  717. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  718. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  719. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
  720. package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
  721. package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.d.ts.map +1 -1
  722. package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.js.map +1 -1
  723. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  724. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  725. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
  726. package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
  727. package/dist/esm/security/authentications/authentication.shared.utils.d.ts.map +1 -1
  728. package/dist/esm/security/authentications/authentication.shared.utils.js.map +1 -1
  729. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
  730. package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
  731. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
  732. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js.map +1 -1
  733. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -1
  734. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -1
  735. package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts.map +1 -1
  736. package/dist/esm/security/authentications/password-blocklist.shared.utils.js.map +1 -1
  737. package/dist/esm/security/authentications/password-reset.shared.dto.schemas.d.ts.map +1 -1
  738. package/dist/esm/security/authentications/password-reset.shared.dto.schemas.js.map +1 -1
  739. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
  740. package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
  741. package/dist/esm/security/authentications/same-origin-redirect-path.shared.d.ts.map +1 -1
  742. package/dist/esm/security/authentications/same-origin-redirect-path.shared.js.map +1 -1
  743. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts.map +1 -1
  744. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
  745. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
  746. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
  747. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
  748. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  749. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
  750. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
  751. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
  752. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js.map +1 -1
  753. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -1
  754. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -1
  755. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
  756. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
  757. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.d.ts.map +1 -1
  758. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.js.map +1 -1
  759. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts.map +1 -1
  760. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js.map +1 -1
  761. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts.map +1 -1
  762. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js.map +1 -1
  763. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -1
  764. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -1
  765. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
  766. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js.map +1 -1
  767. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.map +1 -1
  768. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
  769. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  770. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  771. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  772. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  773. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
  774. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
  775. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  776. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  777. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
  778. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
  779. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  780. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
  781. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -1
  782. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -1
  783. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  784. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  785. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
  786. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
  787. package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
  788. package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
  789. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  790. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  791. package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
  792. package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
  793. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -1
  794. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -1
  795. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
  796. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
  797. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
  798. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
  799. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
  800. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
  801. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -1
  802. package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -1
  803. package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.d.ts.map +1 -1
  804. package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.js.map +1 -1
  805. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  806. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  807. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  808. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  809. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  810. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  811. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
  812. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
  813. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
  814. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
  815. package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.d.ts.map +1 -1
  816. package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.js.map +1 -1
  817. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -1
  818. package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
  819. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -1
  820. package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -1
  821. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -1
  822. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -1
  823. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts.map +1 -1
  824. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js.map +1 -1
  825. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -1
  826. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -1
  827. package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts.map +1 -1
  828. package/dist/esm/systems-of-record/system-of-record-env.shared.js.map +1 -1
  829. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -1
  830. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -1
  831. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -1
  832. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -1
  833. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -1
  834. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
  835. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts.map +1 -1
  836. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js.map +1 -1
  837. package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
  838. package/dist/esm/testing/resource-config-builders.js.map +1 -1
  839. package/dist/esm/testing.d.ts.map +1 -1
  840. package/dist/esm/testing.js.map +1 -1
  841. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
  842. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js.map +1 -1
  843. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
  844. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
  845. package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
  846. package/dist/esm/users/anonymous-users.shared.schema.js.map +1 -1
  847. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  848. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  849. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
  850. package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
  851. package/dist/esm/users/user-consent-decision.shared.utils.d.ts.map +1 -1
  852. package/dist/esm/users/user-consent-decision.shared.utils.js.map +1 -1
  853. package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
  854. package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
  855. package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
  856. package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
  857. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
  858. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
  859. package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
  860. package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
  861. package/dist/esm/users/user-preferences-reset.shared.utils.d.ts.map +1 -1
  862. package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
  863. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  864. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
  865. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  866. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
  867. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  868. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
  869. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  870. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
  871. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
  872. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  873. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  874. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  875. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  876. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  877. package/package.json +4 -4
  878. package/dist/esm/__tests__/setup.d.ts +0 -2
  879. package/dist/esm/__tests__/setup.d.ts.map +0 -1
  880. package/dist/esm/__tests__/setup.js +0 -19
  881. package/dist/esm/__tests__/setup.js.map +0 -1
  882. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"initiator-stamped-field-satisfiability.validation.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/initiator-stamped-field-satisfiability.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,wCAAwC,wEAAyE,CAAC;AAE/H,MAAM,MAAM,mCAAmC,GAAG,OAAO,wCAAwC,CAAC,MAAM,CAAC,CAAC;AAE1G,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,mCAAmC,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,0EAA0E;AAC1E,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAaD;;;;GAIG;AACH,wBAAgB,2CAA2C,CACzD,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC,GACnF,8BAA8B,EAAE,CAoBlC"}
1
+ {"version":3,"file":"initiator-stamped-field-satisfiability.validation.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/initiator-stamped-field-satisfiability.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,wCAAwC,wEAAyE,CAAC;AAE/H,MAAM,MAAM,mCAAmC,GAAG,OAAO,wCAAwC,CAAC,MAAM,CAAC,CAAC;AAE1G,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,mCAAmC,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,0EAA0E;AAC1E,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAaD;;;;GAIG;AACH,wBAAgB,2CAA2C,CACzD,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC,GACnF,8BAA8B,EAAE,CAoBlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"initiator-stamped-field-satisfiability.validation.js","sourceRoot":"","sources":["../../../../src/resources/utils/initiator-stamped-field-satisfiability.validation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,UAAU,EACV,YAAY,GACb,MAAM,0BAA0B,CAAC;AAGlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,CAAU,CAAC;AAiB/H,iGAAiG;AACjG,SAAS,cAAc,CAAC,UAAwB;IAC9C,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,MAAM;QAAE,OAAO,CAAC,MAAsC,CAAC,CAAC;IAC5D,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IACjD,OAAO,CAAC,sBAAsB,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;SACzD,MAAM,CAAC,YAAY,CAAC;SACpB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;SACvC,MAAM,CAAC,CAAC,KAAK,EAAyC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2CAA2C,CACzD,sBAAoF;IAEpF,MAAM,UAAU,GAAqC,EAAE,CAAC;IACxD,KAAK,MAAM,aAAa,IAAI,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAClE,IAAI,CAAC,aAAa,EAAE,UAAU,IAAI,aAAa,CAAC,gBAAgB;YAAE,SAAS;QAC3E,MAAM,MAAM,GAAG,cAAc,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACxD,KAAK,MAAM,KAAK,IAAI,wCAAwC,EAAE,CAAC;YAC7D,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5F,IAAI,CAAC,iBAAiB;gBAAE,SAAS;YACjC,UAAU,CAAC,IAAI,CAAC;gBACd,YAAY,EAAE,aAAa,CAAC,kBAAkB;gBAC9C,KAAK;gBACL,OAAO,EACL,IAAI,MAAM,CAAC,aAAa,CAAC,kBAAkB,CAAC,eAAe,KAAK,mDAAmD;sBACjH,8GAA8G;sBAC9G,2FAA2F;sBAC3F,uFAAuF;aAC5F,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n getObjectShape,\n getZodDefArrayProperty,\n isDiscriminatedUnion,\n isOptional,\n isZodTypeAny,\n} from '@wildo-ai/zod-decorators';\nimport type { ResourceType } from '../resources.shared.core.definitions';\n\n/**\n * Registry-level guard: a field the ENGINE stamps from the initiator's USER must not be REQUIRED.\n *\n * ## The shape (#584)\n *\n * `createdByUserId` is stripped from the CREATE DTO by name — a client may never author it — and is\n * stamped by the repository from `executionContext.initiatorIds.userId`, guarded by `if (userId)` in\n * both adapters (`addUserTracking`, and the PostgreSQL adapter's own copy). `updatedByUserId` /\n * `lastUpdatedByUserId` are stamped the same way on UPDATE.\n *\n * **A machine principal has no `userId`.** An org or application service acting over MCP, A2A,\n * client credentials, a worker or a batch supplies none, so a REQUIRED one of these fields is\n * satisfied by nobody: not the client (stripped), not the repository (the guard skips). Nothing said\n * so at registration or at exposure, and the write failed — or committed and then failed to describe\n * itself — the first time a machine caller reached the resource. That is how `todos` and `todoLists`\n * were found (#577), each only after being exposed.\n *\n * ## A refusal at boot, and why it was a report first\n *\n * The backend refuses to start when this returns anything — the engine's own measurement is that a\n * declaration gets made if and only if the framework refuses to start without it.\n *\n * It shipped as a startup REPORT on the belief that flipping the existing declarations to optional\n * changes PostgreSQL column nullability and so owes a migration in every surface. It does not: the\n * schema planner's contract (version 3) records `sqlType`, `hasIndex`, `isPrimaryKey`, `unique` and\n * `defaultClause` per column and no nullability, so a required-vs-optional change is enforced by the\n * Zod layer alone and leaves every lockfile in sync. Measured on all three PostgreSQL surfaces\n * before the promotion, with the existing declarations flipped in the same change.\n *\n * ## Scope\n *\n * - Only the user-stamped identifiers. The primary-scope foreign keys (`organizationId`, …) are also\n * context-populated, but from the SCOPE, which a machine principal does carry — they are required on\n * purpose.\n * - System resources are skipped: the framework owns their write paths and supplies or refuses the\n * attribution explicitly (the SCIM token mint refuses a principal with no user).\n * - Discriminated-union (polymorphic) schemas are checked on every variant that declares the field.\n */\nexport const INITIATOR_USER_STAMPED_FIELD_IDENTIFIERS = ['createdByUserId', 'updatedByUserId', 'lastUpdatedByUserId'] as const;\n\nexport type InitiatorUserStampedFieldIdentifier = typeof INITIATOR_USER_STAMPED_FIELD_IDENTIFIERS[number];\n\nexport interface InitiatorStampedFieldViolation {\n readonly resourceType: ResourceType;\n readonly field: InitiatorUserStampedFieldIdentifier;\n readonly message: string;\n}\n\n/** Structural subset of a resource configuration this validator needs. */\nexport interface InitiatorStampedFieldResourceInput {\n readonly resourceIdentifier: ResourceType;\n readonly mainSchema: z.ZodTypeAny;\n readonly isSystemResource?: boolean;\n}\n\n/** Every object shape a main schema can present: itself, or each discriminated-union variant. */\nfunction objectShapesOf(mainSchema: z.ZodTypeAny): Record<string, z.ZodTypeAny>[] {\n const direct = getObjectShape(mainSchema);\n if (direct) return [direct as Record<string, z.ZodTypeAny>];\n if (!isDiscriminatedUnion(mainSchema)) return [];\n return (getZodDefArrayProperty(mainSchema, 'options') ?? [])\n .filter(isZodTypeAny)\n .map((option) => getObjectShape(option))\n .filter((shape): shape is Record<string, z.ZodTypeAny> => !!shape);\n}\n\n/**\n * Report every non-system resource that declares an initiator-user-stamped field as REQUIRED.\n * `isOptional` treats `.optional()`, `.default()` and `.nullish()` as optional; a bare `.nullable()`\n * stays required, which is correct — `null` is not what the stamp's absence produces.\n */\nexport function validateInitiatorStampedFieldSatisfiability(\n resourceConfigurations: Readonly<Record<string, InitiatorStampedFieldResourceInput>>,\n): InitiatorStampedFieldViolation[] {\n const violations: InitiatorStampedFieldViolation[] = [];\n for (const configuration of Object.values(resourceConfigurations)) {\n if (!configuration?.mainSchema || configuration.isSystemResource) continue;\n const shapes = objectShapesOf(configuration.mainSchema);\n for (const field of INITIATOR_USER_STAMPED_FIELD_IDENTIFIERS) {\n const requiredSomewhere = shapes.some((shape) => shape[field] && !isOptional(shape[field]));\n if (!requiredSomewhere) continue;\n violations.push({\n resourceType: configuration.resourceIdentifier,\n field,\n message:\n `[${String(configuration.resourceIdentifier)}] declares '${field}' as REQUIRED, but the engine stamps it only when`\n + ' the initiator has a userId. A machine principal (MCP, A2A, client credentials, a worker, a batch) has none,'\n + ' and a client may never send it, so a machine write to this resource cannot be satisfied.'\n + ` Declare it \\`.optional()\\` — and generate the migration its nullability change owes.`,\n });\n }\n }\n return violations;\n}\n"]}
1
+ {"version":3,"file":"initiator-stamped-field-satisfiability.validation.js","sourceRoot":"","sources":["../../../../../src/resources/utils/initiator-stamped-field-satisfiability.validation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,UAAU,EACV,YAAY,GACb,MAAM,0BAA0B,CAAC;AAGlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,CAAU,CAAC;AAiB/H,iGAAiG;AACjG,SAAS,cAAc,CA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G,2FAA2F;sBAC3F,uFAAuF;aAC5F,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n getObjectShape,\n getZodDefArrayProperty,\n isDiscriminatedUnion,\n isOptional,\n isZodTypeAny,\n} from '@wildo-ai/zod-decorators';\nimport type { ResourceType } from '../resources.shared.core.definitions';\n\n/**\n * Registry-level guard: a field the ENGINE stamps from the initiator's USER must not be REQUIRED.\n *\n * ## The shape (#584)\n *\n * `createdByUserId` is stripped from the CREATE DTO by name — a client may never author it — and is\n * stamped by the repository from `executionContext.initiatorIds.userId`, guarded by `if (userId)` in\n * both adapters (`addUserTracking`, and the PostgreSQL adapter's own copy). `updatedByUserId` /\n * `lastUpdatedByUserId` are stamped the same way on UPDATE.\n *\n * **A machine principal has no `userId`.** An org or application service acting over MCP, A2A,\n * client credentials, a worker or a batch supplies none, so a REQUIRED one of these fields is\n * satisfied by nobody: not the client (stripped), not the repository (the guard skips). Nothing said\n * so at registration or at exposure, and the write failed — or committed and then failed to describe\n * itself — the first time a machine caller reached the resource. That is how `todos` and `todoLists`\n * were found (#577), each only after being exposed.\n *\n * ## A refusal at boot, and why it was a report first\n *\n * The backend refuses to start when this returns anything — the engine's own measurement is that a\n * declaration gets made if and only if the framework refuses to start without it.\n *\n * It shipped as a startup REPORT on the belief that flipping the existing declarations to optional\n * changes PostgreSQL column nullability and so owes a migration in every surface. It does not: the\n * schema planner's contract (version 3) records `sqlType`, `hasIndex`, `isPrimaryKey`, `unique` and\n * `defaultClause` per column and no nullability, so a required-vs-optional change is enforced by the\n * Zod layer alone and leaves every lockfile in sync. Measured on all three PostgreSQL surfaces\n * before the promotion, with the existing declarations flipped in the same change.\n *\n * ## Scope\n *\n * - Only the user-stamped identifiers. The primary-scope foreign keys (`organizationId`, …) are also\n * context-populated, but from the SCOPE, which a machine principal does carry — they are required on\n * purpose.\n * - System resources are skipped: the framework owns their write paths and supplies or refuses the\n * attribution explicitly (the SCIM token mint refuses a principal with no user).\n * - Discriminated-union (polymorphic) schemas are checked on every variant that declares the field.\n */\nexport const INITIATOR_USER_STAMPED_FIELD_IDENTIFIERS = ['createdByUserId', 'updatedByUserId', 'lastUpdatedByUserId'] as const;\n\nexport type InitiatorUserStampedFieldIdentifier = typeof INITIATOR_USER_STAMPED_FIELD_IDENTIFIERS[number];\n\nexport interface InitiatorStampedFieldViolation {\n readonly resourceType: ResourceType;\n readonly field: InitiatorUserStampedFieldIdentifier;\n readonly message: string;\n}\n\n/** Structural subset of a resource configuration this validator needs. */\nexport interface InitiatorStampedFieldResourceInput {\n readonly resourceIdentifier: ResourceType;\n readonly mainSchema: z.ZodTypeAny;\n readonly isSystemResource?: boolean;\n}\n\n/** Every object shape a main schema can present: itself, or each discriminated-union variant. */\nfunction objectShapesOf(mainSchema: z.ZodTypeAny): Record<string, z.ZodTypeAny>[] {\n const direct = getObjectShape(mainSchema);\n if (direct) return [direct as Record<string, z.ZodTypeAny>];\n if (!isDiscriminatedUnion(mainSchema)) return [];\n return (getZodDefArrayProperty(mainSchema, 'options') ?? [])\n .filter(isZodTypeAny)\n .map((option) => getObjectShape(option))\n .filter((shape): shape is Record<string, z.ZodTypeAny> => !!shape);\n}\n\n/**\n * Report every non-system resource that declares an initiator-user-stamped field as REQUIRED.\n * `isOptional` treats `.optional()`, `.default()` and `.nullish()` as optional; a bare `.nullable()`\n * stays required, which is correct — `null` is not what the stamp's absence produces.\n */\nexport function validateInitiatorStampedFieldSatisfiability(\n resourceConfigurations: Readonly<Record<string, InitiatorStampedFieldResourceInput>>,\n): InitiatorStampedFieldViolation[] {\n const violations: InitiatorStampedFieldViolation[] = [];\n for (const configuration of Object.values(resourceConfigurations)) {\n if (!configuration?.mainSchema || configuration.isSystemResource) continue;\n const shapes = objectShapesOf(configuration.mainSchema);\n for (const field of INITIATOR_USER_STAMPED_FIELD_IDENTIFIERS) {\n const requiredSomewhere = shapes.some((shape) => shape[field] && !isOptional(shape[field]));\n if (!requiredSomewhere) continue;\n violations.push({\n resourceType: configuration.resourceIdentifier,\n field,\n message:\n `[${String(configuration.resourceIdentifier)}] declares '${field}' as REQUIRED, but the engine stamps it only when`\n + ' the initiator has a userId. A machine principal (MCP, A2A, client credentials, a worker, a batch) has none,'\n + ' and a client may never send it, so a machine write to this resource cannot be satisfied.'\n + ` Declare it \\`.optional()\\` — and generate the migration its nullability change owes.`,\n });\n }\n }\n return violations;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"no-subject-data-stance-coherence.shared.utils.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/no-subject-data-stance-coherence.shared.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAG7F;;;;;;GAMG;AACH,wBAAgB,8CAA8C,CAAC,MAAM,EAAE;IACrE,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C,GAAG,SAAS,MAAM,EAAE,CAOpB;AAED,+FAA+F;AAC/F,wBAAgB,wCAAwC,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAMhJ"}
1
+ {"version":3,"file":"no-subject-data-stance-coherence.shared.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/no-subject-data-stance-coherence.shared.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAG7F;;;;;;GAMG;AACH,wBAAgB,8CAA8C,CAAC,MAAM,EAAE;IACrE,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C,GAAG,SAAS,MAAM,EAAE,CAOpB;AAED,+FAA+F;AAC/F,wBAAgB,wCAAwC,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAMhJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"no-subject-data-stance-coherence.shared.utils.js","sourceRoot":"","sources":["../../../../src/resources/utils/no-subject-data-stance-coherence.shared.utils.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,2DAA2D,CAAC;AAE5G;;;;;;GAMG;AACH,MAAM,UAAU,8CAA8C,CAAC,MAI9D;IACC,IAAI,MAAM,CAAC,MAAM,KAAK,oBAAoB,CAAC,eAAe,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IACzG,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;SACxD,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,+BAA+B,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;SAC1J,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAA2B,CAAC,KAAK,SAAS,CAAC;SACzF,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC;SAC/B,IAAI,EAAE,CAAC;AACZ,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,wCAAwC,CAAC,MAA+E;IACtI,OAAO,eAAe,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,MAAM,0CAA0C;UACzH,0CAA0C,oBAAoB,CAAC,eAAe,mDAAmD;UACjI,iEAAiE;UACjE,IAAI,oBAAoB,CAAC,0BAA0B,SAAS,oBAAoB,CAAC,mCAAmC,KAAK;UACzH,4HAA4H,CAAC;AACnI,CAAC","sourcesContent":["/**\n * `NO_SUBJECT_DATA` against the personal data a resource declares it gets from the system (#2010).\n *\n * `HttpApiErasureStance.NO_SUBJECT_DATA` says the remote rows hold no data about a person, which is why a\n * subject erasure reports `DECLARED_NO_SUBJECT_DATA` for them and reaches nothing. A resource that declares\n * personal-data categories (`.dataCategories()`) on the fields it takes FROM that system says the opposite about\n * the same rows. Both cannot be true, and the stance is the half that erasure acts on, so the contradiction is\n * refused where it is authored, in the resource factory.\n *\n * Which fields come from the system depends on the lane:\n * - a READ-THROUGH binding keeps the rows in the system of record, so every field of the resource is the remote\n * row's, except the tenant anchors the engine stamps (`HTTP_API_ENGINE_INJECTED_FIELDS`). Whether the resource\n * also WRITES does not matter: the rows hold the data either way;\n * - a PIPELINE copies only its mapped fields. A field no mapping writes is the application's own, and a `CONSTANT`\n * entry reads nothing from the source. These are the same fields the privacy notice's source statement counts\n * (`systemOfRecordFlowsOfResource`), so the refusal and the notice cannot disagree about what came from where.\n *\n * Replaces the narrower write-only rule that `assertHttpApiWriteDeclarationCoherence` carried (#1679 rule 5), which\n * asked only whether a binding WRITES personal fields. Reading them is the same contradiction, and a pipeline copy\n * of them was not checked at all. Wonder Todos' `externalCustomers` held both declarations for twelve days.\n *\n * Fixing a refusal is a question of fact, never of preference:\n * - if the fields really are about a person, the rows hold subject data: declare the stance that says so\n * (`EXTERNAL_ERASURE_OPERATION`, or `CONTROLLER_ACKNOWLEDGED_NON_ERASURE`);\n * - if they are not (a company's name and its contact details are data about a legal person, outside personal\n * data), remove the categories.\n *\n * spec-cite: GDPR Recital 14, https://gdpr-info.eu/recitals/no-14/ — \"This Regulation does not cover the processing\n * of personal data which concerns legal persons and in particular undertakings established as legal persons,\n * including the name and the form of the legal person and the contact details of the legal person.\"\n */\nimport type { z } from 'zod';\nimport { getDataCategories, getZodObjectShape, isZodObject } from '@wildo-ai/zod-decorators';\n\nimport { HttpApiErasureStance } from '../../http-api-binding/http-api-erasure-stance.shared';\nimport { HTTP_API_ENGINE_INJECTED_FIELDS } from '../../http-api-binding/read-through-engine-anchors.shared';\n\n/**\n * The fields that declare personal-data categories while the binding they come from declares `NO_SUBJECT_DATA`,\n * sorted. Empty for any other stance, and for a schema that is not an object.\n *\n * `sourcedFields` is the set of fields that come from the system: omit it for a read-through binding (every field\n * but the engine-stamped anchors), pass the pipeline's mapped non-constant local fields for a copy.\n */\nexport function personalFieldsContradictingNoSubjectDataStance(params: {\n readonly stance: HttpApiErasureStance;\n readonly mainSchema: z.ZodTypeAny;\n readonly sourcedFields?: ReadonlySet<string>;\n}): readonly string[] {\n if (params.stance !== HttpApiErasureStance.NO_SUBJECT_DATA || !isZodObject(params.mainSchema)) return [];\n return Object.entries(getZodObjectShape(params.mainSchema))\n .filter(([fieldName]) => (params.sourcedFields === undefined ? !HTTP_API_ENGINE_INJECTED_FIELDS.includes(fieldName) : params.sourcedFields.has(fieldName)))\n .filter(([, fieldSchema]) => getDataCategories(fieldSchema as z.ZodTypeAny) !== undefined)\n .map(([fieldName]) => fieldName)\n .sort();\n}\n\n/** The refusal's text, shared by both lanes so the remedy reads the same wherever it fires. */\nexport function describeNoSubjectDataStanceContradiction(params: { readonly system: string; readonly personalFields: readonly string[] }): string {\n return `the fields [${params.personalFields.join(', ')}] come from '${params.system}' and declare personal-data categories, `\n + `while the binding's erasure stance is '${HttpApiErasureStance.NO_SUBJECT_DATA}' — that those rows hold no data about a person. `\n + 'Both cannot be true. If the fields are about a person, declare '\n + `'${HttpApiErasureStance.EXTERNAL_ERASURE_OPERATION}' or '${HttpApiErasureStance.CONTROLLER_ACKNOWLEDGED_NON_ERASURE}'. `\n + 'If they are not (a company\\'s name and its contact details are data about a legal person), remove their .dataCategories().';\n}\n"]}
1
+ {"version":3,"file":"no-subject-data-stance-coherence.shared.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/no-subject-data-stance-coherence.shared.utils.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,2DAA2D,CAAC;AAE5G;;;;;;GAMG;AACH,MAAM,UAAU,8CAA8C,CAAC,MAI9D;IACC,IAAI,MAAM,CAAC,MAAM,KAAK,oBAAoB,CAAC,eAAe,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IACzG,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;SACxD,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,+BAA+B,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;SAC1J,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAA2B,CAAC,KAAK,SAAS,CAAC;SACzF,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC;SAC/B,IAAI,EAAE,CAAC;AACZ,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,wCAAwC,CAAC,MAA+E;IACtI,OAAO,eAAe,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,MAAM,0CAA0C;UACzH,0CAA0C,oBAAoB,CAAC,eAAe,mDAAmD;UACjI,iEAAiE;UACjE,IAAI,oBAAoB,CAAC,0BAA0B,SAAS,oBAAoB,CAAC,mCAAmC,KAAK;UACzH,4HAA4H,CAAC;AACnI,CAAC","sourcesContent":["/**\n * `NO_SUBJECT_DATA` against the personal data a resource declares it gets from the system (#2010).\n *\n * `HttpApiErasureStance.NO_SUBJECT_DATA` says the remote rows hold no data about a person, which is why a\n * subject erasure reports `DECLARED_NO_SUBJECT_DATA` for them and reaches nothing. A resource that declares\n * personal-data categories (`.dataCategories()`) on the fields it takes FROM that system says the opposite about\n * the same rows. Both cannot be true, and the stance is the half that erasure acts on, so the contradiction is\n * refused where it is authored, in the resource factory.\n *\n * Which fields come from the system depends on the lane:\n * - a READ-THROUGH binding keeps the rows in the system of record, so every field of the resource is the remote\n * row's, except the tenant anchors the engine stamps (`HTTP_API_ENGINE_INJECTED_FIELDS`). Whether the resource\n * also WRITES does not matter: the rows hold the data either way;\n * - a PIPELINE copies only its mapped fields. A field no mapping writes is the application's own, and a `CONSTANT`\n * entry reads nothing from the source. These are the same fields the privacy notice's source statement counts\n * (`systemOfRecordFlowsOfResource`), so the refusal and the notice cannot disagree about what came from where.\n *\n * Replaces the narrower write-only rule that `assertHttpApiWriteDeclarationCoherence` carried (#1679 rule 5), which\n * asked only whether a binding WRITES personal fields. Reading them is the same contradiction, and a pipeline copy\n * of them was not checked at all. Wonder Todos' `externalCustomers` held both declarations for twelve days.\n *\n * Fixing a refusal is a question of fact, never of preference:\n * - if the fields really are about a person, the rows hold subject data: declare the stance that says so\n * (`EXTERNAL_ERASURE_OPERATION`, or `CONTROLLER_ACKNOWLEDGED_NON_ERASURE`);\n * - if they are not (a company's name and its contact details are data about a legal person, outside personal\n * data), remove the categories.\n *\n * spec-cite: GDPR Recital 14, https://gdpr-info.eu/recitals/no-14/ — \"This Regulation does not cover the processing\n * of personal data which concerns legal persons and in particular undertakings established as legal persons,\n * including the name and the form of the legal person and the contact details of the legal person.\"\n */\nimport type { z } from 'zod';\nimport { getDataCategories, getZodObjectShape, isZodObject } from '@wildo-ai/zod-decorators';\n\nimport { HttpApiErasureStance } from '../../http-api-binding/http-api-erasure-stance.shared';\nimport { HTTP_API_ENGINE_INJECTED_FIELDS } from '../../http-api-binding/read-through-engine-anchors.shared';\n\n/**\n * The fields that declare personal-data categories while the binding they come from declares `NO_SUBJECT_DATA`,\n * sorted. Empty for any other stance, and for a schema that is not an object.\n *\n * `sourcedFields` is the set of fields that come from the system: omit it for a read-through binding (every field\n * but the engine-stamped anchors), pass the pipeline's mapped non-constant local fields for a copy.\n */\nexport function personalFieldsContradictingNoSubjectDataStance(params: {\n readonly stance: HttpApiErasureStance;\n readonly mainSchema: z.ZodTypeAny;\n readonly sourcedFields?: ReadonlySet<string>;\n}): readonly string[] {\n if (params.stance !== HttpApiErasureStance.NO_SUBJECT_DATA || !isZodObject(params.mainSchema)) return [];\n return Object.entries(getZodObjectShape(params.mainSchema))\n .filter(([fieldName]) => (params.sourcedFields === undefined ? !HTTP_API_ENGINE_INJECTED_FIELDS.includes(fieldName) : params.sourcedFields.has(fieldName)))\n .filter(([, fieldSchema]) => getDataCategories(fieldSchema as z.ZodTypeAny) !== undefined)\n .map(([fieldName]) => fieldName)\n .sort();\n}\n\n/** The refusal's text, shared by both lanes so the remedy reads the same wherever it fires. */\nexport function describeNoSubjectDataStanceContradiction(params: { readonly system: string; readonly personalFields: readonly string[] }): string {\n return `the fields [${params.personalFields.join(', ')}] come from '${params.system}' and declare personal-data categories, `\n + `while the binding's erasure stance is '${HttpApiErasureStance.NO_SUBJECT_DATA}' — that those rows hold no data about a person. `\n + 'Both cannot be true. If the fields are about a person, declare '\n + `'${HttpApiErasureStance.EXTERNAL_ERASURE_OPERATION}' or '${HttpApiErasureStance.CONTROLLER_ACKNOWLEDGED_NON_ERASURE}'. `\n + 'If they are not (a company\\'s name and its contact details are data about a legal person), remove their .dataCategories().';\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"persistence-adapter-discrimination.shared.utils.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/persistence-adapter-discrimination.shared.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI;IAAE,QAAQ,EAAE,CAAC,IAAI,kBAAkB,GAAG,CAAC;CAAE,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAC1C,OAAO,EAAE,sBAAsB,EAC/B,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAChC,CAAC,CAUH;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAC7B,sBAAsB,CAYxB"}
1
+ {"version":3,"file":"persistence-adapter-discrimination.shared.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/persistence-adapter-discrimination.shared.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI;IAAE,QAAQ,EAAE,CAAC,IAAI,kBAAkB,GAAG,CAAC;CAAE,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAC1C,OAAO,EAAE,sBAAsB,EAC/B,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAChC,CAAC,CAUH;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAC7B,sBAAsB,CAYxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"persistence-adapter-discrimination.shared.utils.js","sourceRoot":"","sources":["../../../../src/resources/utils/persistence-adapter-discrimination.shared.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,oCAAoC,CAAC;AAc5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA+B,EAC/B,KAAiC;IAEjC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CACb,gCAAgC,MAAM,CAAC,OAAO,CAAC,iCAAiC;cAC9E,uBAAuB,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;cACvE,4FAA4F;cAC5F,wHAAwH,CAC3H,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,OAA6B,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,+BAA+B,CAC7C,GAA8B;IAE9B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QACpD,OAAO,2BAA2B,CAAC;IACrC,CAAC;IACD,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,4CAA4C,GAAG,KAAK;cAClD,uBAAuB,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;cACvE,sFAAsF,CACzF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {\n DEFAULT_PERSISTENCE_ADAPTER,\n PersistenceAdapter,\n isPersistenceAdapter,\n type PersistenceAdapterType,\n} from '../resources-config.shared.schemas';\n\n/**\n * One value per {@link PersistenceAdapter} member — the shape every adapter DECISION routes\n * through.\n *\n * Mapped over the enum so that adding a member makes every literal cases object a COMPILE error\n * (missing key) at each decision site, instead of a silent fall-through into whichever arm an\n * `else` happened to mean. Measured 2026-08-25 before this seam existed: 21 of 30 comparisons\n * tested `=== POSTGRESQL` with an `else` arm that silently meant \"MongoDB\" — a third backing kind\n * would have taken the MongoDB lane at all of them with no compile error and no runtime refusal.\n */\nexport type PersistenceAdapterCases<T> = { readonly [K in PersistenceAdapter]: T };\n\n/**\n * Exhaustive discrimination on a persistence adapter.\n *\n * Prefer this over `adapter === PersistenceAdapter.X ? … : …` whenever BOTH arms carry a real\n * answer (dispatching to a database service, choosing a primary-key column, choosing a compiler).\n * A plain binary comparison stays correct only where one side is a genuinely adapter-specific\n * feature gate (\"does this resource need the PostgreSQL migration door?\") — there, the negative\n * arm means \"not that feature\", not \"the other adapter\", and such sites carry a justified comment\n * instead of this helper.\n *\n * Two guarantees, one per failure direction:\n * - **New enum member** → every call site's `cases` object misses a key → compile error\n * (see {@link PersistenceAdapterCases}).\n * - **Unknown string at runtime** (erased config, a serialized value from an older or foreign\n * writer) → throws instead of returning either arm. Thrown as a plain `Error` because this\n * module is shared-tier (no `ErrorBuilder` here — same precedent as the factory's\n * configuration errors); backend callers surface it through their ordinary error projection.\n * It names the value and the supported set so the remedy is legible at the boundary it crossed.\n *\n * Branch values are eagerly evaluated; pass thunks (`() => …`) when construction is expensive or\n * side-effectful and invoke the selected one.\n */\nexport function selectByPersistenceAdapter<T>(\n adapter: PersistenceAdapterType,\n cases: PersistenceAdapterCases<T>,\n): T {\n if (!Object.prototype.hasOwnProperty.call(cases, adapter)) {\n throw new Error(\n `Unknown persistence adapter '${String(adapter)}' reached an adapter decision. `\n + `Supported adapters: ${Object.values(PersistenceAdapter).join(', ')}. `\n + 'This is a framework configuration defect: a backing kind was declared or stored that this '\n + 'deployment does not implement, and refusing here prevents it from being silently treated as one of the known adapters.',\n );\n }\n return cases[adapter as PersistenceAdapter];\n}\n\n/**\n * Parse an adapter declaration arriving as a RAW string (an env var, a stored configuration\n * document, any erased boundary).\n *\n * - absent (`undefined` / `null`) or empty string (the compose-interpolation contract for\n * \"not set\") → {@link DEFAULT_PERSISTENCE_ADAPTER}. An undeclared deployment keeps today's\n * behavior exactly.\n * - a known member's value → that member.\n * - **present but unknown → throws.** This is the provisioning-door contract: a declaration that\n * IS authored but names a backing kind this deployment does not know must refuse loudly, never\n * collapse to MongoDB the way `x === POSTGRESQL ? POSTGRESQL : MONGODB` did — that collapse is\n * how a platform would have provisioned a MongoDB database for a resource that has none.\n */\nexport function parseDeclaredPersistenceAdapter(\n raw: string | undefined | null,\n): PersistenceAdapterType {\n if (raw === undefined || raw === null || raw === '') {\n return DEFAULT_PERSISTENCE_ADAPTER;\n }\n if (!isPersistenceAdapter(raw)) {\n throw new Error(\n `Unknown persistence adapter declaration '${raw}'. `\n + `Supported adapters: ${Object.values(PersistenceAdapter).join(', ')}. `\n + 'Remove the declaration to use the framework default, or declare a supported adapter.',\n );\n }\n return raw;\n}\n"]}
1
+ {"version":3,"file":"persistence-adapter-discrimination.shared.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/persistence-adapter-discrimination.shared.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,oCAAoC,CAAC;AAc5C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA+B,EAC/B,KAAiC;IAEjC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CACb,gCAAgC,MAAM,CAAC,OAAO,CAAC,iCAAiC;cAC9E,uBAAuB,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;cACvE,4FAA4F;cAC5F,wHAAwH,CAC3H,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,OAA6B,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,+BAA+B,CAC7C,GAA8B;IAE9B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QACpD,OAAO,2BAA2B,CAAC;IACrC,CAAC;IACD,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,4CAA4C,GAAG,KAAK;cAClD,uBAAuB,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;cACvE,sFAAsF,CACzF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {\n DEFAULT_PERSISTENCE_ADAPTER,\n PersistenceAdapter,\n isPersistenceAdapter,\n type PersistenceAdapterType,\n} from '../resources-config.shared.schemas';\n\n/**\n * One value per {@link PersistenceAdapter} member — the shape every adapter DECISION routes\n * through.\n *\n * Mapped over the enum so that adding a member makes every literal cases object a COMPILE error\n * (missing key) at each decision site, instead of a silent fall-through into whichever arm an\n * `else` happened to mean. Measured 2026-08-25 before this seam existed: 21 of 30 comparisons\n * tested `=== POSTGRESQL` with an `else` arm that silently meant \"MongoDB\" — a third backing kind\n * would have taken the MongoDB lane at all of them with no compile error and no runtime refusal.\n */\nexport type PersistenceAdapterCases<T> = { readonly [K in PersistenceAdapter]: T };\n\n/**\n * Exhaustive discrimination on a persistence adapter.\n *\n * Prefer this over `adapter === PersistenceAdapter.X ? … : …` whenever BOTH arms carry a real\n * answer (dispatching to a database service, choosing a primary-key column, choosing a compiler).\n * A plain binary comparison stays correct only where one side is a genuinely adapter-specific\n * feature gate (\"does this resource need the PostgreSQL migration door?\") — there, the negative\n * arm means \"not that feature\", not \"the other adapter\", and such sites carry a justified comment\n * instead of this helper.\n *\n * Two guarantees, one per failure direction:\n * - **New enum member** → every call site's `cases` object misses a key → compile error\n * (see {@link PersistenceAdapterCases}).\n * - **Unknown string at runtime** (erased config, a serialized value from an older or foreign\n * writer) → throws instead of returning either arm. Thrown as a plain `Error` because this\n * module is shared-tier (no `ErrorBuilder` here — same precedent as the factory's\n * configuration errors); backend callers surface it through their ordinary error projection.\n * It names the value and the supported set so the remedy is legible at the boundary it crossed.\n *\n * Branch values are eagerly evaluated; pass thunks (`() => …`) when construction is expensive or\n * side-effectful and invoke the selected one.\n */\nexport function selectByPersistenceAdapter<T>(\n adapter: PersistenceAdapterType,\n cases: PersistenceAdapterCases<T>,\n): T {\n if (!Object.prototype.hasOwnProperty.call(cases, adapter)) {\n throw new Error(\n `Unknown persistence adapter '${String(adapter)}' reached an adapter decision. `\n + `Supported adapters: ${Object.values(PersistenceAdapter).join(', ')}. `\n + 'This is a framework configuration defect: a backing kind was declared or stored that this '\n + 'deployment does not implement, and refusing here prevents it from being silently treated as one of the known adapters.',\n );\n }\n return cases[adapter as PersistenceAdapter];\n}\n\n/**\n * Parse an adapter declaration arriving as a RAW string (an env var, a stored configuration\n * document, any erased boundary).\n *\n * - absent (`undefined` / `null`) or empty string (the compose-interpolation contract for\n * \"not set\") → {@link DEFAULT_PERSISTENCE_ADAPTER}. An undeclared deployment keeps today's\n * behavior exactly.\n * - a known member's value → that member.\n * - **present but unknown → throws.** This is the provisioning-door contract: a declaration that\n * IS authored but names a backing kind this deployment does not know must refuse loudly, never\n * collapse to MongoDB the way `x === POSTGRESQL ? POSTGRESQL : MONGODB` did — that collapse is\n * how a platform would have provisioned a MongoDB database for a resource that has none.\n */\nexport function parseDeclaredPersistenceAdapter(\n raw: string | undefined | null,\n): PersistenceAdapterType {\n if (raw === undefined || raw === null || raw === '') {\n return DEFAULT_PERSISTENCE_ADAPTER;\n }\n if (!isPersistenceAdapter(raw)) {\n throw new Error(\n `Unknown persistence adapter declaration '${raw}'. `\n + `Supported adapters: ${Object.values(PersistenceAdapter).join(', ')}. `\n + 'Remove the declaration to use the framework default, or declare a supported adapter.',\n );\n }\n return raw;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"populated-file-fields.shared.utils.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/populated-file-fields.shared.utils.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yFAAyF;AACzF,eAAO,MAAM,yBAAyB,EAAG,MAAe,CAAC;AACzD,iGAAiG;AACjG,eAAO,MAAM,4BAA4B,EAAG,OAAgB,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,UAkB8B,CAAC;AA+B3E;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC;AACtH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AAChH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,GAAG,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"populated-file-fields.shared.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/populated-file-fields.shared.utils.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yFAAyF;AACzF,eAAO,MAAM,yBAAyB,EAAG,MAAe,CAAC;AACzD,iGAAiG;AACjG,eAAO,MAAM,4BAA4B,EAAG,OAAgB,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,UAkB8B,CAAC;AA+B3E;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC;AACtH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AAChH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,GAAG,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"populated-file-fields.shared.utils.js","sourceRoot":"","sources":["../../../../src/resources/utils/populated-file-fields.shared.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW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M,EAAE,cAAc,CAAC,CAAC;QACxF,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;QAExC,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,YAAY,GAAiC,EAAE,CAAC;QACtD,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,KAAK,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7D,MAAM,OAAO,GAAG,gCAAgC,CAAC,WAA2B,EAAE,aAAa,CAAC,CAAC;YAC7F,IAAI,OAAO,KAAK,WAAW;gBAAE,OAAO,GAAG,IAAI,CAAC;YAC5C,YAAY,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,OAAO;YAAE,OAAO,MAAM,CAAC;QAC5B,OAAO,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IAClE,CAAC;YAAS,CAAC;QACT,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC","sourcesContent":["/**\n * The shape a file field takes on a POPULATED read, and the DTO that describes it (issue #1059).\n *\n * A file field is STORED as a reference — `{ fileId, updatedAt }` for one file, `{ fileIds, updatedAt }`\n * for several. A SUMMARY or CONTEXT read runs file population, which used to REPLACE that reference with\n * the file's metadata (`toMetadataResponse`: readiness, filename, size, url, …). The operation's DTO still\n * described the reference, so `transformOutput` refused every context read of a resource whose file\n * existed: `expected date, received Invalid Date` at `<field>.updatedAt`, a 500, and a degraded body\n * instead of the record. Measured 2026-09-14 on Wonder Todos.\n *\n * Population now keeps the reference and adds the metadata BESIDE it — `file` for one, `files` for\n * several — and the SUMMARY / CONTEXT DTOs declare that companion. Three candidates were weighed:\n *\n * - **Declare the replacement.** The frontend reads a file field as its stored reference (`'fileId' in\n * value` / `'fileIds' in value`, then fetches metadata by id itself), so a metadata array in place of\n * `{ fileIds }` fails its multiple-file guard outright. Declaring the replacement would have made the\n * DTO agree with a shape one consumer cannot read.\n * - **Populate after `transformOutput`.** Validation would then never see the populated value, and the\n * response DTO — the OpenAPI contract — would describe less than the wire carries.\n * - **Keep the reference (chosen).** Every reader of the reference keeps working, the companion is\n * OPTIONAL so a read with population disabled or failed (`populateFileFieldsForSingle` keeps the\n * original value on any error) still validates, and a consumer that wants the metadata finds it at a\n * named key.\n *\n * The companion's schema carries the file field's decorator metadata forward, so the widened field is\n * still detected as a FILE field (`isFileSchema`, `getSchemaType`) — the same property\n * `resources-config-operations.dtos-builder.file-metadata-coercion.test.ts` pins for date coercion.\n */\nimport {\n FileDisplayNature,\n FileReadiness,\n FileUploaderEntityType,\n getFileMetadata,\n getZodDef,\n getZodDefArrayProperty,\n getZodDefProperty,\n getZodDefSchemaProperty,\n getZodDefStringProperty,\n getZodObjectShape,\n getZodType,\n isZodArray,\n isZodDefault,\n isZodNullable,\n isZodObject,\n isZodOptional,\n SCHEMA_METADATA,\n withArrayElement,\n} from '@wildo-ai/zod-decorators';\nimport { z } from 'zod';\n\n/** The key a populated single-file field carries its metadata under, beside `fileId`. */\nexport const POPULATED_SINGLE_FILE_KEY = 'file' as const;\n/** The key a populated multiple-file field carries its metadata list under, beside `fileIds`. */\nexport const POPULATED_MULTIPLE_FILES_KEY = 'files' as const;\n\n/**\n * `FileMetadata` (`@wildo-ai/zod-decorators`) as a Zod schema, at the NETWORK boundary: `uploadedAt`\n * coerces an ISO string, and the object is loose so a metadata key added later is carried rather\n * than stripped — this is server-produced data, never a request.\n */\nexport const PopulatedFileMetadataSchema: z.ZodTypeAny = z.looseObject({\n readiness: z.enum(FileReadiness).describe(\"Whether the file may be attached: `ready` may be, `attached` belongs to its current record and is not reused elsewhere, `processing` is still being checked and must be read again, and `unavailable` cannot be newly attached. An upload's success is not this.\"),\n fileId: z.string().min(1).describe(\"The file's identifier.\"),\n filename: z.string().describe(\"The file's original name.\"),\n size: z.number().describe(\"The file's size in bytes.\"),\n mimeType: z.string().describe(\"The file's media type.\"),\n extension: z.string().optional().describe(\"The file's extension, without the dot.\"),\n checksum: z.string().optional().describe(\"A checksum of the file's content.\"),\n url: z.string().optional().describe(\"Where the file can be downloaded.\"),\n thumbnailUrl: z.string().optional().describe(\"Where a thumbnail of an image or video can be fetched.\"),\n nature: z.enum(FileDisplayNature).optional().describe(\"What kind of file it is, for display: image, video, audio, document or generic.\"),\n width: z.number().optional().describe(\"An image's width in pixels.\"),\n height: z.number().optional().describe(\"An image's height in pixels.\"),\n duration: z.number().optional().describe(\"An audio or video file's length in seconds.\"),\n pageCount: z.number().optional().describe(\"A document's number of pages.\"),\n uploadedAt: z.coerce.date().describe(\"When the file was uploaded.\"),\n uploadedBy: z.string().optional().describe(\"The identifier of whoever uploaded the file.\"),\n uploadedByEntityType: z.enum(FileUploaderEntityType).optional().describe(\"What kind of principal uploaded the file: a user, an anonymous user, or an organization's or the application's machine client.\"),\n}).describe(\"The file's details, included when the read populates files.\");\n\nfunction carrySchemaMetadata<TSchema extends z.ZodTypeAny>(source: z.ZodTypeAny, rebuilt: TSchema): TSchema {\n const metadata = (source as any)[SCHEMA_METADATA];\n if (metadata !== undefined) {\n (rebuilt as any)[SCHEMA_METADATA] = metadata;\n }\n // Zod's own registry too (`.describe()` / `.meta()`, #1625): `.extend()` clones without the parent link\n // a clone inherits it through, so a widened file field would otherwise publish undescribed. Not `id`,\n // which names one schema.\n const registered = z.globalRegistry.get(source) as Record<string, unknown> | undefined;\n if (registered !== undefined && !z.globalRegistry.has(rebuilt)) {\n const { id: _id, ...carried } = registered;\n if (Object.keys(carried).length > 0) z.globalRegistry.add(rebuilt, carried as never);\n }\n return rebuilt;\n}\n\n/** A `z_file()` leaf (the reference object, metadata attached) widened with its optional populated companion. */\nfunction widenFileLeaf(leaf: z.ZodTypeAny): z.ZodTypeAny {\n const fileMetadata = getFileMetadata(leaf);\n if (!fileMetadata || !isZodObject(leaf)) return leaf;\n const shape = getZodObjectShape(leaf);\n const companionKey = fileMetadata.multiple ? POPULATED_MULTIPLE_FILES_KEY : POPULATED_SINGLE_FILE_KEY;\n if (companionKey in shape) return leaf; // already widened (a DTO derived from a widened DTO)\n const companion = fileMetadata.multiple\n ? z.array(PopulatedFileMetadataSchema).optional().describe(\"Each file's details, included when the read populates files.\")\n : PopulatedFileMetadataSchema.optional();\n return carrySchemaMetadata(leaf, leaf.extend({ [companionKey]: companion }));\n}\n\n/**\n * Rebuild `schema` so every `z_file()` field accepts its populated companion beside the stored\n * reference. Identity-preserving where nothing beneath changed (a wrapper returns the ORIGINAL\n * instance, so an enclosing object is not rebuilt and keeps its metadata — the #989 lesson recorded\n * on `stripTemplatableFileFieldsRecursively`). Applied to READ-side DTOs only, after date coercion.\n */\nexport function widenFileFieldsForPopulatedReads(schema: z.ZodTypeAny, activeSchemas?: WeakSet<object>): z.ZodTypeAny;\nexport function widenFileFieldsForPopulatedReads(schema: undefined, activeSchemas?: WeakSet<object>): undefined;\nexport function widenFileFieldsForPopulatedReads(schema: z.ZodTypeAny | undefined, activeSchemas?: WeakSet<object>): z.ZodTypeAny | undefined;\nexport function widenFileFieldsForPopulatedReads(schema: z.ZodTypeAny | undefined, activeSchemas: WeakSet<object> = new WeakSet<object>()): z.ZodTypeAny | undefined {\n // An ABSENT schema passes through (#1138). `activeSchemas.add(undefined)` throws\n // `TypeError: Invalid value used in weak set` — a message naming neither a DTO nor an operation,\n // raised while a registry is being initialized, so it reaches a human as a backend that will not\n // boot. `summaryDto` and `contextDto` are declared OPTIONAL on an operation\n // (`resources-config.shared.schemas.ts:2098`), so absent is a state the contract permits.\n //\n // Measured rather than assumed about where it arrives from: `buildAllOperationDtos` DERIVES both\n // (:545, :572), so its own four call sites never pass an absent one. The reported failure was the\n // dev companion's projector rebuilding DTOs against the runtime registry — an EXTERNAL caller of\n // this exported function, which is exactly why the guard belongs here and not at those call\n // sites (`invariant-call-site-enumeration.md`: prefer making the invariant unbypassable).\n //\n // The overloads keep a definite schema in returning a definite schema, so no caller is handed a\n // widened `| undefined` it then has to narrow.\n if (!schema) return schema;\n if (activeSchemas.has(schema)) return schema;\n activeSchemas.add(schema);\n try {\n if (getFileMetadata(schema) && isZodObject(schema)) return widenFileLeaf(schema);\n\n if (isZodOptional(schema) || isZodNullable(schema) || isZodDefault(schema)) {\n const inner = getZodDefSchemaProperty(schema, 'innerType');\n if (!inner) return schema;\n const widenedInner = widenFileFieldsForPopulatedReads(inner, activeSchemas);\n if (widenedInner === inner) return schema;\n const rewrapped = isZodOptional(schema)\n ? widenedInner.optional()\n : isZodNullable(schema)\n ? widenedInner.nullable()\n : widenedInner.default(() => getZodDefProperty(schema, 'defaultValue') as unknown);\n return carrySchemaMetadata(schema, rewrapped);\n }\n\n const schemaType = getZodType(schema);\n if (schemaType === 'lazy') {\n const getter = getZodDef(schema)?.getter;\n return typeof getter === 'function' ? z.lazy(() => widenFileFieldsForPopulatedReads(getter() as z.ZodTypeAny, activeSchemas)) : schema;\n }\n\n if (schemaType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const options = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n if (!options?.length) return schema;\n const widened = options.map((option) => widenFileFieldsForPopulatedReads(option, activeSchemas));\n if (widened.every((option, index) => option === options[index])) return schema;\n const rebuilt: z.ZodTypeAny = discriminator\n ? z.discriminatedUnion(discriminator, widened as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]])\n : z.union(widened as [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]);\n return carrySchemaMetadata(schema, rebuilt);\n }\n\n if (isZodArray(schema)) {\n const element = getZodDefProperty(schema, 'element') as z.ZodTypeAny | undefined;\n if (!element) return schema;\n const widenedElement = widenFileFieldsForPopulatedReads(element, activeSchemas);\n return widenedElement === element ? schema : withArrayElement(schema, widenedElement);\n }\n\n if (!isZodObject(schema)) return schema;\n\n const shape = getZodObjectShape(schema);\n const widenedShape: Record<string, z.ZodTypeAny> = {};\n let changed = false;\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const widened = widenFileFieldsForPopulatedReads(fieldSchema as z.ZodTypeAny, activeSchemas);\n if (widened !== fieldSchema) changed = true;\n widenedShape[fieldName] = widened;\n }\n if (!changed) return schema;\n return carrySchemaMetadata(schema, schema.extend(widenedShape));\n } finally {\n activeSchemas.delete(schema);\n }\n}\n"]}
1
+ {"version":3,"file":"populated-file-fields.shared.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/populated-file-fields.shared.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yFAAyF;AACzF,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAe,CAAC;AACzD,iGAAiG;AACjG,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAgB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAiB,CAAC,CAAC,WAAW,CAAC;IACrE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,kQAAkQ,CAAC;IAC7S,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IAC5D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BA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OAAO,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IAClE,CAAC;YAAS,CAAC;QACT,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC","sourcesContent":["/**\n * The shape a file field takes on a POPULATED read, and the DTO that describes it (issue #1059).\n *\n * A file field is STORED as a reference — `{ fileId, updatedAt }` for one file, `{ fileIds, updatedAt }`\n * for several. A SUMMARY or CONTEXT read runs file population, which used to REPLACE that reference with\n * the file's metadata (`toMetadataResponse`: readiness, filename, size, url, …). The operation's DTO still\n * described the reference, so `transformOutput` refused every context read of a resource whose file\n * existed: `expected date, received Invalid Date` at `<field>.updatedAt`, a 500, and a degraded body\n * instead of the record. Measured 2026-09-14 on Wonder Todos.\n *\n * Population now keeps the reference and adds the metadata BESIDE it — `file` for one, `files` for\n * several — and the SUMMARY / CONTEXT DTOs declare that companion. Three candidates were weighed:\n *\n * - **Declare the replacement.** The frontend reads a file field as its stored reference (`'fileId' in\n * value` / `'fileIds' in value`, then fetches metadata by id itself), so a metadata array in place of\n * `{ fileIds }` fails its multiple-file guard outright. Declaring the replacement would have made the\n * DTO agree with a shape one consumer cannot read.\n * - **Populate after `transformOutput`.** Validation would then never see the populated value, and the\n * response DTO — the OpenAPI contract — would describe less than the wire carries.\n * - **Keep the reference (chosen).** Every reader of the reference keeps working, the companion is\n * OPTIONAL so a read with population disabled or failed (`populateFileFieldsForSingle` keeps the\n * original value on any error) still validates, and a consumer that wants the metadata finds it at a\n * named key.\n *\n * The companion's schema carries the file field's decorator metadata forward, so the widened field is\n * still detected as a FILE field (`isFileSchema`, `getSchemaType`) — the same property\n * `resources-config-operations.dtos-builder.file-metadata-coercion.test.ts` pins for date coercion.\n */\nimport {\n FileDisplayNature,\n FileReadiness,\n FileUploaderEntityType,\n getFileMetadata,\n getZodDef,\n getZodDefArrayProperty,\n getZodDefProperty,\n getZodDefSchemaProperty,\n getZodDefStringProperty,\n getZodObjectShape,\n getZodType,\n isZodArray,\n isZodDefault,\n isZodNullable,\n isZodObject,\n isZodOptional,\n SCHEMA_METADATA,\n withArrayElement,\n} from '@wildo-ai/zod-decorators';\nimport { z } from 'zod';\n\n/** The key a populated single-file field carries its metadata under, beside `fileId`. */\nexport const POPULATED_SINGLE_FILE_KEY = 'file' as const;\n/** The key a populated multiple-file field carries its metadata list under, beside `fileIds`. */\nexport const POPULATED_MULTIPLE_FILES_KEY = 'files' as const;\n\n/**\n * `FileMetadata` (`@wildo-ai/zod-decorators`) as a Zod schema, at the NETWORK boundary: `uploadedAt`\n * coerces an ISO string, and the object is loose so a metadata key added later is carried rather\n * than stripped — this is server-produced data, never a request.\n */\nexport const PopulatedFileMetadataSchema: z.ZodTypeAny = z.looseObject({\n readiness: z.enum(FileReadiness).describe(\"Whether the file may be attached: `ready` may be, `attached` belongs to its current record and is not reused elsewhere, `processing` is still being checked and must be read again, and `unavailable` cannot be newly attached. An upload's success is not this.\"),\n fileId: z.string().min(1).describe(\"The file's identifier.\"),\n filename: z.string().describe(\"The file's original name.\"),\n size: z.number().describe(\"The file's size in bytes.\"),\n mimeType: z.string().describe(\"The file's media type.\"),\n extension: z.string().optional().describe(\"The file's extension, without the dot.\"),\n checksum: z.string().optional().describe(\"A checksum of the file's content.\"),\n url: z.string().optional().describe(\"Where the file can be downloaded.\"),\n thumbnailUrl: z.string().optional().describe(\"Where a thumbnail of an image or video can be fetched.\"),\n nature: z.enum(FileDisplayNature).optional().describe(\"What kind of file it is, for display: image, video, audio, document or generic.\"),\n width: z.number().optional().describe(\"An image's width in pixels.\"),\n height: z.number().optional().describe(\"An image's height in pixels.\"),\n duration: z.number().optional().describe(\"An audio or video file's length in seconds.\"),\n pageCount: z.number().optional().describe(\"A document's number of pages.\"),\n uploadedAt: z.coerce.date().describe(\"When the file was uploaded.\"),\n uploadedBy: z.string().optional().describe(\"The identifier of whoever uploaded the file.\"),\n uploadedByEntityType: z.enum(FileUploaderEntityType).optional().describe(\"What kind of principal uploaded the file: a user, an anonymous user, or an organization's or the application's machine client.\"),\n}).describe(\"The file's details, included when the read populates files.\");\n\nfunction carrySchemaMetadata<TSchema extends z.ZodTypeAny>(source: z.ZodTypeAny, rebuilt: TSchema): TSchema {\n const metadata = (source as any)[SCHEMA_METADATA];\n if (metadata !== undefined) {\n (rebuilt as any)[SCHEMA_METADATA] = metadata;\n }\n // Zod's own registry too (`.describe()` / `.meta()`, #1625): `.extend()` clones without the parent link\n // a clone inherits it through, so a widened file field would otherwise publish undescribed. Not `id`,\n // which names one schema.\n const registered = z.globalRegistry.get(source) as Record<string, unknown> | undefined;\n if (registered !== undefined && !z.globalRegistry.has(rebuilt)) {\n const { id: _id, ...carried } = registered;\n if (Object.keys(carried).length > 0) z.globalRegistry.add(rebuilt, carried as never);\n }\n return rebuilt;\n}\n\n/** A `z_file()` leaf (the reference object, metadata attached) widened with its optional populated companion. */\nfunction widenFileLeaf(leaf: z.ZodTypeAny): z.ZodTypeAny {\n const fileMetadata = getFileMetadata(leaf);\n if (!fileMetadata || !isZodObject(leaf)) return leaf;\n const shape = getZodObjectShape(leaf);\n const companionKey = fileMetadata.multiple ? POPULATED_MULTIPLE_FILES_KEY : POPULATED_SINGLE_FILE_KEY;\n if (companionKey in shape) return leaf; // already widened (a DTO derived from a widened DTO)\n const companion = fileMetadata.multiple\n ? z.array(PopulatedFileMetadataSchema).optional().describe(\"Each file's details, included when the read populates files.\")\n : PopulatedFileMetadataSchema.optional();\n return carrySchemaMetadata(leaf, leaf.extend({ [companionKey]: companion }));\n}\n\n/**\n * Rebuild `schema` so every `z_file()` field accepts its populated companion beside the stored\n * reference. Identity-preserving where nothing beneath changed (a wrapper returns the ORIGINAL\n * instance, so an enclosing object is not rebuilt and keeps its metadata — the #989 lesson recorded\n * on `stripTemplatableFileFieldsRecursively`). Applied to READ-side DTOs only, after date coercion.\n */\nexport function widenFileFieldsForPopulatedReads(schema: z.ZodTypeAny, activeSchemas?: WeakSet<object>): z.ZodTypeAny;\nexport function widenFileFieldsForPopulatedReads(schema: undefined, activeSchemas?: WeakSet<object>): undefined;\nexport function widenFileFieldsForPopulatedReads(schema: z.ZodTypeAny | undefined, activeSchemas?: WeakSet<object>): z.ZodTypeAny | undefined;\nexport function widenFileFieldsForPopulatedReads(schema: z.ZodTypeAny | undefined, activeSchemas: WeakSet<object> = new WeakSet<object>()): z.ZodTypeAny | undefined {\n // An ABSENT schema passes through (#1138). `activeSchemas.add(undefined)` throws\n // `TypeError: Invalid value used in weak set` — a message naming neither a DTO nor an operation,\n // raised while a registry is being initialized, so it reaches a human as a backend that will not\n // boot. `summaryDto` and `contextDto` are declared OPTIONAL on an operation\n // (`resources-config.shared.schemas.ts:2098`), so absent is a state the contract permits.\n //\n // Measured rather than assumed about where it arrives from: `buildAllOperationDtos` DERIVES both\n // (:545, :572), so its own four call sites never pass an absent one. The reported failure was the\n // dev companion's projector rebuilding DTOs against the runtime registry — an EXTERNAL caller of\n // this exported function, which is exactly why the guard belongs here and not at those call\n // sites (`invariant-call-site-enumeration.md`: prefer making the invariant unbypassable).\n //\n // The overloads keep a definite schema in returning a definite schema, so no caller is handed a\n // widened `| undefined` it then has to narrow.\n if (!schema) return schema;\n if (activeSchemas.has(schema)) return schema;\n activeSchemas.add(schema);\n try {\n if (getFileMetadata(schema) && isZodObject(schema)) return widenFileLeaf(schema);\n\n if (isZodOptional(schema) || isZodNullable(schema) || isZodDefault(schema)) {\n const inner = getZodDefSchemaProperty(schema, 'innerType');\n if (!inner) return schema;\n const widenedInner = widenFileFieldsForPopulatedReads(inner, activeSchemas);\n if (widenedInner === inner) return schema;\n const rewrapped = isZodOptional(schema)\n ? widenedInner.optional()\n : isZodNullable(schema)\n ? widenedInner.nullable()\n : widenedInner.default(() => getZodDefProperty(schema, 'defaultValue') as unknown);\n return carrySchemaMetadata(schema, rewrapped);\n }\n\n const schemaType = getZodType(schema);\n if (schemaType === 'lazy') {\n const getter = getZodDef(schema)?.getter;\n return typeof getter === 'function' ? z.lazy(() => widenFileFieldsForPopulatedReads(getter() as z.ZodTypeAny, activeSchemas)) : schema;\n }\n\n if (schemaType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const options = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n if (!options?.length) return schema;\n const widened = options.map((option) => widenFileFieldsForPopulatedReads(option, activeSchemas));\n if (widened.every((option, index) => option === options[index])) return schema;\n const rebuilt: z.ZodTypeAny = discriminator\n ? z.discriminatedUnion(discriminator, widened as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]])\n : z.union(widened as [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]);\n return carrySchemaMetadata(schema, rebuilt);\n }\n\n if (isZodArray(schema)) {\n const element = getZodDefProperty(schema, 'element') as z.ZodTypeAny | undefined;\n if (!element) return schema;\n const widenedElement = widenFileFieldsForPopulatedReads(element, activeSchemas);\n return widenedElement === element ? schema : withArrayElement(schema, widenedElement);\n }\n\n if (!isZodObject(schema)) return schema;\n\n const shape = getZodObjectShape(schema);\n const widenedShape: Record<string, z.ZodTypeAny> = {};\n let changed = false;\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const widened = widenFileFieldsForPopulatedReads(fieldSchema as z.ZodTypeAny, activeSchemas);\n if (widened !== fieldSchema) changed = true;\n widenedShape[fieldName] = widened;\n }\n if (!changed) return schema;\n return carrySchemaMetadata(schema, schema.extend(widenedShape));\n } finally {\n activeSchemas.delete(schema);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"repository-dto-builder.utils.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/repository-dto-builder.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;;;;;;;;;GAUG;AACH,qBAAa,yBAAyB;IAEpC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,mBAAmB,CACxB,YAAY,EAAE,CAAC,CAAC,UAAU,EAC1B,UAAU,EAAE,CAAC,CAAC,UAAU,GACvB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;IAiD7B;;;;;;OAMG;IACH,MAAM,CAAC,0BAA0B,CAC/B,YAAY,EAAE,CAAC,CAAC,UAAU,EAC1B,UAAU,EAAE,CAAC,CAAC,UAAU,GACvB,MAAM,EAAE;IAyBX;;;;;;;OAOG;IACH,MAAM,CAAC,8BAA8B,CACnC,YAAY,EAAE,CAAC,CAAC,UAAU,EAC1B,UAAU,EAAE,CAAC,CAAC,UAAU,GACvB,OAAO;CAuBX"}
1
+ {"version":3,"file":"repository-dto-builder.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/repository-dto-builder.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;;;;;;;;;GAUG;AACH,qBAAa,yBAAyB;IAEpC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,mBAAmB,CACxB,YAAY,EAAE,CAAC,CAAC,UAAU,EAC1B,UAAU,EAAE,CAAC,CAAC,UAAU,GACvB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;IAiD7B;;;;;;OAMG;IACH,MAAM,CAAC,0BAA0B,CAC/B,YAAY,EAAE,CAAC,CAAC,UAAU,EAC1B,UAAU,EAAE,CAAC,CAAC,UAAU,GACvB,MAAM,EAAE;IAyBX;;;;;;;OAOG;IACH,MAAM,CAAC,8BAA8B,CACnC,YAAY,EAAE,CAAC,CAAC,UAAU,EAC1B,UAAU,EAAE,CAAC,CAAC,UAAU,GACvB,OAAO;CAuBX"}
@@ -1 +1 @@
1
- {"version":3,"file":"repository-dto-builder.utils.js","sourceRoot":"","sources":["../../../../src/resources/utils/repository-dto-builder.utils.ts"],"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C,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,8BAA8B,CACnC,YAA0B,EAC1B,UAAwB;QAExB,MAAM,WAAW,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAEhD,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,KAAK,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACpE,IAAI,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;gBAChC,MAAM,IAAI,GAAG,2BAA2B,CAAC,WAAW,CAAC,CAAC;gBACtD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;oBACvB,+DAA+D;oBAC/D,gCAAgC;oBAChC,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;wBACxC,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/**\n * Repository DTO Builder Utilities\n * \n * Utilities for deriving repository-level DTOs from schemas.\n * Repository DTOs exclude virtual fields and populated placeholders,\n * while including fields needed for virtual field computation.\n * \n * Repository DTO Derivation Process:\n * \n * 1. Identify Virtual Fields:\n * - Virtual fields are computed at runtime, not stored in DB\n * - They are excluded from the repository DTO\n * \n * 2. Identify Virtual Dependencies:\n * - Virtual fields may depend on other stored fields for computation\n * - These dependencies must be included in the repository projection\n * - Dependencies are declared via isVirtual({ dependencies: ['field1', 'field2'] })\n * \n * 3. Exclude Populated Placeholders:\n * - Fields that exist only for population (not in mainSchema) are excluded\n * - These are added after repository fetch during population phase\n * \n * 4. Final Repository DTO:\n * - Contains: storable fields + virtual dependencies\n * - Excludes: virtual fields + population placeholders\n * - Used for MongoDB projection to minimize data transfer\n * \n * Example flow:\n * mainSchema: { _id, title, assignedToUserId, displayName (virtual) }\n * summarySchema: { _id, title, displayName, assignedTo (placeholder) }\n * repositoryDto: { _id, title } + dependencies of displayName\n */\n\nimport { z } from 'zod';\nimport { \n getZodObjectShape, \n isVirtualField,\n getVirtualFieldDependencies\n} from '@wildo-ai/zod-decorators';\n\n/**\n * Mutable shape type for building schemas\n */\ntype MutableZodShape = Record<string, z.ZodTypeAny>;\n\n/**\n * Utility class for deriving repository-level DTOs.\n * \n * Repository DTOs are used for MongoDB projections and represent\n * the actual fields to fetch from the database, excluding:\n * - Virtual fields (computed at runtime)\n * - Populated placeholders (fields not in mainSchema, added for population)\n * \n * And including:\n * - Virtual field dependencies (fields needed for virtual computation)\n */\nexport class RepositoryDtoBuilderUtils {\n \n /**\n * Derive repositoryDto from a target schema.\n * \n * @param targetSchema - The schema to derive from (e.g., summary schema)\n * @param mainSchema - The main resource schema (used to identify real vs placeholder fields)\n * @returns A Zod schema containing only storable/fetchable fields\n * \n * @example\n * ```typescript\n * const summarySchema = ResourcesSummaryUtils.deriveSummarySchema(MainSchema);\n * const repoDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(summarySchema, MainSchema);\n * // repoDto excludes virtuals but includes their dependencies\n * ```\n */\n static deriveRepositoryDto(\n targetSchema: z.ZodTypeAny,\n mainSchema: z.ZodTypeAny\n ): z.ZodObject<z.ZodRawShape> {\n const targetShape = getZodObjectShape(targetSchema);\n const mainShape = getZodObjectShape(mainSchema);\n \n if (!targetShape || !mainShape) {\n // Return empty schema if either is not an object\n return z.object({});\n }\n \n const repoShape: MutableZodShape = {};\n const virtualDeps = new Set<string>();\n \n // First pass: identify all virtual field dependencies\n for (const [fieldName, fieldSchema] of Object.entries(targetShape)) {\n if (isVirtualField(fieldSchema)) {\n const deps = getVirtualFieldDependencies(fieldSchema);\n for (const dep of deps) {\n virtualDeps.add(dep);\n }\n }\n }\n \n // Second pass: include non-virtual fields that exist in mainSchema\n for (const [fieldName, fieldSchema] of Object.entries(targetShape)) {\n // Skip virtual fields - they're computed, not stored\n if (isVirtualField(fieldSchema)) {\n continue;\n }\n \n // Skip populated placeholders (fields that don't exist in main schema)\n if (!mainShape[fieldName]) {\n continue;\n }\n \n // Include this field\n repoShape[fieldName] = fieldSchema;\n }\n \n // Third pass: add virtual field dependencies from mainSchema\n // (Only if they're not already included and exist in mainSchema)\n for (const dep of virtualDeps) {\n if (mainShape[dep] && !repoShape[dep]) {\n repoShape[dep] = mainShape[dep];\n }\n }\n \n return z.object(repoShape);\n }\n \n /**\n * Get all fields needed for virtual field computation.\n * \n * @param targetSchema - The schema containing virtual fields\n * @param mainSchema - The main resource schema\n * @returns Array of field names needed for virtual computation\n */\n static getVirtualDependencyFields(\n targetSchema: z.ZodTypeAny,\n mainSchema: z.ZodTypeAny\n ): string[] {\n const targetShape = getZodObjectShape(targetSchema);\n const mainShape = getZodObjectShape(mainSchema);\n \n if (!targetShape || !mainShape) {\n return [];\n }\n \n const deps = new Set<string>();\n \n for (const [_fieldName, fieldSchema] of Object.entries(targetShape)) {\n if (isVirtualField(fieldSchema)) {\n const fieldDeps = getVirtualFieldDependencies(fieldSchema);\n for (const dep of fieldDeps) {\n // Only include if it exists in mainSchema\n if (mainShape[dep]) {\n deps.add(dep);\n }\n }\n }\n }\n \n return Array.from(deps);\n }\n \n /**\n * Check if a target schema has any virtual fields that require\n * fields not already in the target schema.\n * \n * @param targetSchema - The schema to check\n * @param mainSchema - The main resource schema\n * @returns True if additional fields are needed for virtual computation\n */\n static hasExternalVirtualDependencies(\n targetSchema: z.ZodTypeAny,\n mainSchema: z.ZodTypeAny\n ): boolean {\n const targetShape = getZodObjectShape(targetSchema);\n const mainShape = getZodObjectShape(mainSchema);\n \n if (!targetShape || !mainShape) {\n return false;\n }\n \n for (const [_fieldName, fieldSchema] of Object.entries(targetShape)) {\n if (isVirtualField(fieldSchema)) {\n const deps = getVirtualFieldDependencies(fieldSchema);\n for (const dep of deps) {\n // If a dependency exists in mainSchema but not in targetShape,\n // we have external dependencies\n if (mainShape[dep] && !targetShape[dep]) {\n return true;\n }\n }\n }\n }\n \n return false;\n }\n}\n"]}
1
+ {"version":3,"file":"repository-dto-builder.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/repository-dto-builder.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAOlC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,yBAAyB;IAEpC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,mBAAmB,CACxB,YAA0B,EAC1B,UAAwB;QAExB,MAAM,WAAW,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAEhD,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,iDAAiD;YACjD,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACtB,CAAC;QAED,MAAM,SAAS,GAAoB,EAAE,CAAC;QACtC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;QAEtC,sDAAsD;QACtD,KAAK,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACnE,IAAI,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;gBAChC,MAAM,IAAI,GAAG,2BAA2B,CAAC,WAAW,CAAC,CAAC;gBACtD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;oBACvB,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;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AAC,WAAW,CAAC,CAAC;gBAC3D,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;oBAC5B,0CAA0C;oBAC1C,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;wBACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;oBAChB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,8BAA8B,CACnC,YAA0B,EAC1B,UAAwB;QAExB,MAAM,WAAW,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAEhD,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,KAAK,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACpE,IAAI,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;gBAChC,MAAM,IAAI,GAAG,2BAA2B,CAAC,WAAW,CAAC,CAAC;gBACtD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;oBACvB,+DAA+D;oBAC/D,gCAAgC;oBAChC,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;wBACxC,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/**\n * Repository DTO Builder Utilities\n * \n * Utilities for deriving repository-level DTOs from schemas.\n * Repository DTOs exclude virtual fields and populated placeholders,\n * while including fields needed for virtual field computation.\n * \n * Repository DTO Derivation Process:\n * \n * 1. Identify Virtual Fields:\n * - Virtual fields are computed at runtime, not stored in DB\n * - They are excluded from the repository DTO\n * \n * 2. Identify Virtual Dependencies:\n * - Virtual fields may depend on other stored fields for computation\n * - These dependencies must be included in the repository projection\n * - Dependencies are declared via isVirtual({ dependencies: ['field1', 'field2'] })\n * \n * 3. Exclude Populated Placeholders:\n * - Fields that exist only for population (not in mainSchema) are excluded\n * - These are added after repository fetch during population phase\n * \n * 4. Final Repository DTO:\n * - Contains: storable fields + virtual dependencies\n * - Excludes: virtual fields + population placeholders\n * - Used for MongoDB projection to minimize data transfer\n * \n * Example flow:\n * mainSchema: { _id, title, assignedToUserId, displayName (virtual) }\n * summarySchema: { _id, title, displayName, assignedTo (placeholder) }\n * repositoryDto: { _id, title } + dependencies of displayName\n */\n\nimport { z } from 'zod';\nimport { \n getZodObjectShape, \n isVirtualField,\n getVirtualFieldDependencies\n} from '@wildo-ai/zod-decorators';\n\n/**\n * Mutable shape type for building schemas\n */\ntype MutableZodShape = Record<string, z.ZodTypeAny>;\n\n/**\n * Utility class for deriving repository-level DTOs.\n * \n * Repository DTOs are used for MongoDB projections and represent\n * the actual fields to fetch from the database, excluding:\n * - Virtual fields (computed at runtime)\n * - Populated placeholders (fields not in mainSchema, added for population)\n * \n * And including:\n * - Virtual field dependencies (fields needed for virtual computation)\n */\nexport class RepositoryDtoBuilderUtils {\n \n /**\n * Derive repositoryDto from a target schema.\n * \n * @param targetSchema - The schema to derive from (e.g., summary schema)\n * @param mainSchema - The main resource schema (used to identify real vs placeholder fields)\n * @returns A Zod schema containing only storable/fetchable fields\n * \n * @example\n * ```typescript\n * const summarySchema = ResourcesSummaryUtils.deriveSummarySchema(MainSchema);\n * const repoDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(summarySchema, MainSchema);\n * // repoDto excludes virtuals but includes their dependencies\n * ```\n */\n static deriveRepositoryDto(\n targetSchema: z.ZodTypeAny,\n mainSchema: z.ZodTypeAny\n ): z.ZodObject<z.ZodRawShape> {\n const targetShape = getZodObjectShape(targetSchema);\n const mainShape = getZodObjectShape(mainSchema);\n \n if (!targetShape || !mainShape) {\n // Return empty schema if either is not an object\n return z.object({});\n }\n \n const repoShape: MutableZodShape = {};\n const virtualDeps = new Set<string>();\n \n // First pass: identify all virtual field dependencies\n for (const [fieldName, fieldSchema] of Object.entries(targetShape)) {\n if (isVirtualField(fieldSchema)) {\n const deps = getVirtualFieldDependencies(fieldSchema);\n for (const dep of deps) {\n virtualDeps.add(dep);\n }\n }\n }\n \n // Second pass: include non-virtual fields that exist in mainSchema\n for (const [fieldName, fieldSchema] of Object.entries(targetShape)) {\n // Skip virtual fields - they're computed, not stored\n if (isVirtualField(fieldSchema)) {\n continue;\n }\n \n // Skip populated placeholders (fields that don't exist in main schema)\n if (!mainShape[fieldName]) {\n continue;\n }\n \n // Include this field\n repoShape[fieldName] = fieldSchema;\n }\n \n // Third pass: add virtual field dependencies from mainSchema\n // (Only if they're not already included and exist in mainSchema)\n for (const dep of virtualDeps) {\n if (mainShape[dep] && !repoShape[dep]) {\n repoShape[dep] = mainShape[dep];\n }\n }\n \n return z.object(repoShape);\n }\n \n /**\n * Get all fields needed for virtual field computation.\n * \n * @param targetSchema - The schema containing virtual fields\n * @param mainSchema - The main resource schema\n * @returns Array of field names needed for virtual computation\n */\n static getVirtualDependencyFields(\n targetSchema: z.ZodTypeAny,\n mainSchema: z.ZodTypeAny\n ): string[] {\n const targetShape = getZodObjectShape(targetSchema);\n const mainShape = getZodObjectShape(mainSchema);\n \n if (!targetShape || !mainShape) {\n return [];\n }\n \n const deps = new Set<string>();\n \n for (const [_fieldName, fieldSchema] of Object.entries(targetShape)) {\n if (isVirtualField(fieldSchema)) {\n const fieldDeps = getVirtualFieldDependencies(fieldSchema);\n for (const dep of fieldDeps) {\n // Only include if it exists in mainSchema\n if (mainShape[dep]) {\n deps.add(dep);\n }\n }\n }\n }\n \n return Array.from(deps);\n }\n \n /**\n * Check if a target schema has any virtual fields that require\n * fields not already in the target schema.\n * \n * @param targetSchema - The schema to check\n * @param mainSchema - The main resource schema\n * @returns True if additional fields are needed for virtual computation\n */\n static hasExternalVirtualDependencies(\n targetSchema: z.ZodTypeAny,\n mainSchema: z.ZodTypeAny\n ): boolean {\n const targetShape = getZodObjectShape(targetSchema);\n const mainShape = getZodObjectShape(mainSchema);\n \n if (!targetShape || !mainShape) {\n return false;\n }\n \n for (const [_fieldName, fieldSchema] of Object.entries(targetShape)) {\n if (isVirtualField(fieldSchema)) {\n const deps = getVirtualFieldDependencies(fieldSchema);\n for (const dep of deps) {\n // If a dependency exists in mainSchema but not in targetShape,\n // we have external dependencies\n if (mainShape[dep] && !targetShape[dep]) {\n return true;\n }\n }\n }\n }\n \n return false;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"request-schema-field-carriage.shared.utils.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/request-schema-field-carriage.shared.utils.ts"],"names":[],"mappings":"AAQA,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,OAAO,CAehG"}
1
+ {"version":3,"file":"request-schema-field-carriage.shared.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/request-schema-field-carriage.shared.utils.ts"],"names":[],"mappings":"AAQA,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,OAAO,CAehG"}
@@ -1 +1 @@
1
- {"version":3,"file":"request-schema-field-carriage.shared.utils.js","sourceRoot":"","sources":["../../../../src/resources/utils/request-schema-field-carriage.shared.utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,MAAM,UAAU,yBAAyB,CAAC,MAAe,EAAE,SAAiB,EAAE,KAAK,GAAG,CAAC;IACrF,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,K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IAAI,GAAG,CAAC,EAAE;QAAE,OAAO,yBAAyB,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAC3E,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * Whether a request schema can carry `fieldName` as a row field — through wrappers (repeatedly),\n * unions and discriminated unions (any branch), intersections (either side: a bulk DTO over a non-plain\n * row is `selector.and(row)`), and the bulk envelope `{ data: row[] }` of CREATE_MANY. Only the `data`\n * member is followed into an array, so a custom request with an unrelated array of objects is not read as\n * rows. Used by the closure-clock ownership check (#1613), which must see every shape a client route accepts.\n */\nconst BULK_REQUEST_ROWS_KEY = 'data';\nexport function requestSchemaCarriesField(schema: unknown, fieldName: string, depth = 0): boolean {\n if (!schema || typeof schema !== 'object' || depth > 12) return false;\n const def = (schema as any)._zod?.def ?? (schema as any)._def;\n if (!def) return false;\n if (def.shape && typeof def.shape === 'object') {\n if (Object.prototype.hasOwnProperty.call(def.shape, fieldName)) return true;\n const rows = (def.shape as Record<string, unknown>)[BULK_REQUEST_ROWS_KEY];\n return rows !== undefined && requestSchemaCarriesField(rows, fieldName, depth + 1);\n }\n if (Array.isArray(def.options)) return def.options.some((option: unknown) => requestSchemaCarriesField(option, fieldName, depth + 1));\n if (def.left || def.right) return requestSchemaCarriesField(def.left, fieldName, depth + 1) || requestSchemaCarriesField(def.right, fieldName, depth + 1);\n if (def.element) return requestSchemaCarriesField(def.element, fieldName, depth + 1);\n if (def.innerType) return requestSchemaCarriesField(def.innerType, fieldName, depth + 1);\n if (def.in) return requestSchemaCarriesField(def.in, fieldName, depth + 1);\n return false;\n}\n"]}
1
+ {"version":3,"file":"request-schema-field-carriage.shared.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/request-schema-field-carriage.shared.utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,MAAM,UAAU,yBAAyB,CAAC,MAAe,E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IACrF,IAAI,GAAG,CAAC,SAAS;QAAE,OAAO,yBAAyB,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IACzF,IAAI,GAAG,CAAC,EAAE;QAAE,OAAO,yBAAyB,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAC3E,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * Whether a request schema can carry `fieldName` as a row field — through wrappers (repeatedly),\n * unions and discriminated unions (any branch), intersections (either side: a bulk DTO over a non-plain\n * row is `selector.and(row)`), and the bulk envelope `{ data: row[] }` of CREATE_MANY. Only the `data`\n * member is followed into an array, so a custom request with an unrelated array of objects is not read as\n * rows. Used by the closure-clock ownership check (#1613), which must see every shape a client route accepts.\n */\nconst BULK_REQUEST_ROWS_KEY = 'data';\nexport function requestSchemaCarriesField(schema: unknown, fieldName: string, depth = 0): boolean {\n if (!schema || typeof schema !== 'object' || depth > 12) return false;\n const def = (schema as any)._zod?.def ?? (schema as any)._def;\n if (!def) return false;\n if (def.shape && typeof def.shape === 'object') {\n if (Object.prototype.hasOwnProperty.call(def.shape, fieldName)) return true;\n const rows = (def.shape as Record<string, unknown>)[BULK_REQUEST_ROWS_KEY];\n return rows !== undefined && requestSchemaCarriesField(rows, fieldName, depth + 1);\n }\n if (Array.isArray(def.options)) return def.options.some((option: unknown) => requestSchemaCarriesField(option, fieldName, depth + 1));\n if (def.left || def.right) return requestSchemaCarriesField(def.left, fieldName, depth + 1) || requestSchemaCarriesField(def.right, fieldName, depth + 1);\n if (def.element) return requestSchemaCarriesField(def.element, fieldName, depth + 1);\n if (def.innerType) return requestSchemaCarriesField(def.innerType, fieldName, depth + 1);\n if (def.in) return requestSchemaCarriesField(def.in, fieldName, depth + 1);\n return false;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"required-fk-fillability.validation.d.ts","sourceRoot":"","sources":["../../../../src/resources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BAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,kCAAkC,CAAC,GACzE,8BAA8B,EAAE,CAiFlC"}
1
+ {"version":3,"file":"required-fk-fillability.validation.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/required-fk-fillability.validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,EACL,oBAAoB,EAGrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAyB,MAAM,sCAAsC,CAAC;AAE3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,oBAAY,kCAAkC;IAC5C,gHAAgH;IAChH,oBAAoB,iDAAiD;IACrE,2IAA2I;IAC3I,qBAAqB,kDAAkD;CACxE;AAED;;;;;;GAMG;AACH,oBAAY,sCAAsC;IAChD,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAOD,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,kCAAkC,CAAC;IACzC,QAAQ,EAAE,sCAAsC,CAAC;IACjD,wDAAwD;IACxD,YAAY,EAAE,YAAY,CAAC;IAC3B,0DAA0D;IAC1D,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,kBAAkB,EAAE,YAAY,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD,kBAAkB,EAAE,YAAY,CAAC;IACjC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IACzB,qBAAqB,EAAE;QACrB,mBAAmB,EAAE,oBAAoB,EAAE,CAAC;KAC7C,CAAC;IACF,UAAU,EAAE,aAAa,CAAC;QACxB,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;QACrC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACzC,CAAC,CAAC;CACJ;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,CAAC,CAAC,UAAU,EACxB,eAAe,EAAE,MAAM,GACtB,CAAC,CAAC,UAAU,GAAG,SAAS,CAoB1B;AAeD;;;;;;;;GAQG;AACH,wBAAgB,qCAAqC,CACnD,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,kCAAkC,CAAC,GACzE,8BAA8B,EAAE,CAiFlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"required-fk-fillability.validation.js","sourceRoot":"","sources":["../../../../src/resources/utils/required-fk-fillability.validation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,uCAAuC,EACvC,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAgB,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,CAAN,IAAY,kCAKX;AALD,WAAY,kCAAkC;IAC5C,gHAAgH;IAChH,2GAAqE,CAAA;IACrE,2IAA2I;IAC3I,6GAAuE,CAAA;AACzE,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,QAK7C;AAED;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,sCAGX;AAHD,WAAY,sCAAsC;IAChD,uDAAa,CAAA;IACb,uDAAa,CAAA;AACf,CAAC,EAHW,sCAAsC,KAAtC,sCAAsC,QAGjD;AAED,MAAM,kBAAkB,GAAuF;IAC7G,CAAC,kCAAkC,CAAC,oBAAoB,CAAC,EAAE,sCAAsC,CAAC,IAAI;IACtG,CAAC,kCAAkC,CAAC,qBAAqB,CAAC,EAAE,sCAAsC,CAAC,IAAI;CACxG,CAAC;AA+BF;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,UAAwB,EACxB,eAAuB;IAEvB,MAAM,WAAW,GAAG,cAA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BAAwB,kBAAkB,2BAA2B,YAAY,CAAC,mBAAmB,IAAI,OAAO,MAAM;wBACtH,0FAA0F;wBAC1F,uGAAuG;wBACvG,6HAA6H;iBAChI,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;YAED,MAAM,cAAc,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;YAClE,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,0EAA0E;gBAC1E,SAAS;YACX,CAAC;YACD,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,EAAE,CAAC;gBAC/C,UAAU,CAAC,IAAI,CAAC;oBACd,IAAI,EAAE,kCAAkC,CAAC,qBAAqB;oBAC9D,QAAQ,EAAE,kBAAkB,CAAC,kCAAkC,CAAC,qBAAqB,CAAC;oBACtF,YAAY,EAAE,QAAQ,CAAC,kBAAkB;oBACzC,eAAe;oBACf,kBAAkB;oBAClB,OAAO,EACL,aAAa,QAAQ,CAAC,kBAAkB,2BAA2B,eAAe,IAAI;wBACtF,wBAAwB,kBAAkB,2BAA2B,YAAY,CAAC,mBAAmB,IAAI,OAAO,MAAM;wBACtH,gFAAgF,kBAAkB,IAAI;wBACtG,0EAA0E;wBAC1E,mCAAmC,kBAAkB,yCAAyC;iBACjG,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n isOptional,\n isExcludedFromCreate,\n getObjectShape,\n isDiscriminatedUnion,\n getZodDefArrayProperty,\n isZodTypeAny,\n} from '@wildo-ai/zod-decorators';\nimport {\n ResourceRelationship,\n ResourceRelationshipAccessScopeStrategy,\n RelationshipNature,\n} from '../resources.shared.schemas';\nimport { ResourceType, CoreResourceOperation } from '../resources.shared.core.definitions';\n\n/**\n * Registry-level guardrail: a REQUIRED composition-parent foreign key must be\n * **user-fillable on CREATE**.\n *\n * ## Why this exists\n *\n * A resource whose structural (COMPOSITION) parent relationship is\n * `OPTIONAL_CONTEXT` (or `STANDALONE`) can be created WITHOUT that parent in the\n * URL — e.g. a todo created from the org-wide collection rather than from inside\n * a specific list. In that mode the parent FK is NOT seeded from routing context,\n * so the create form must let the user supply it through a resource-reference\n * picker. If the FK is also REQUIRED, the create is impossible unless that picker\n * can actually be rendered and populated. Two ways it silently can't:\n *\n * - the FK field is `excludeFromCreate` → there is no form control at all; or\n * - the FK's target resource exposes no `LIST`/`SEARCH` operation → the picker\n * has no operation to load its options from.\n *\n * Either way the org-wide create form is dead on arrival. This validator surfaces\n * that at registry-assembly time instead of as a confusing client-side validation\n * failure with no visible error (the exact symptom of the 2026-06-27\n * `todoListId`-create bug — see `selectMatchingRoutePath` routing fix and\n * `.claude/plans/todos-required-fk-optional-context-create.md`).\n *\n * ## Why it is restricted to `COMPOSITION` parents\n *\n * `REFERENCE` foreign keys (`assignedToUserId`, `createdByUserId`,\n * `postedByUserId`, …) are NOT user-picked structural parents — they are\n * cross-references that are typically seeded by the backend (author/creator) or\n * are optional. The framework has no schema-level \"user fills this vs the backend\n * sets this\" marker, so including REFERENCE FKs here would false-positive on\n * backend-set required FKs. Limiting to `COMPOSITION` isolates the genuine\n * \"a child belongs to a parent the user must choose\" case.\n *\n * ## Fail-open by construction\n *\n * Every ambiguity skips the relationship rather than flagging it: a missing\n * `foreignKeyField`, an FK column that is not actually present on the resource's\n * own schema (e.g. an inbound FK reference where another resource holds the key),\n * an FK whose requiredness cannot be determined, or an unknown target resource.\n * This keeps the guardrail noise-free and safe to run across every app registry.\n */\nexport enum ForeignKeyFillabilityViolationKind {\n /** The required FK is `excludeFromCreate` yet the parent is not guaranteed in context — no way to supply it. */\n EXCLUDED_FROM_CREATE = 'required-composition-fk-excluded-from-create',\n /** The required FK needs a picker (parent is `OPTIONAL_CONTEXT`/`STANDALONE`) but its target exposes no LIST/SEARCH op to populate one. */\n TARGET_NOT_SEARCHABLE = 'required-composition-fk-target-not-searchable',\n}\n\n/**\n * Severity a consumer should apply to a violation. `EXCLUDED_FROM_CREATE` is a\n * genuinely impossible-to-create config (no context, no control) → `FAIL` so the\n * backend crashes loud at boot rather than shipping a dead create form.\n * `TARGET_NOT_SEARCHABLE` degrades the picker but a custom create surface might\n * still supply the FK → `WARN`.\n */\nexport enum ForeignKeyFillabilityViolationSeverity {\n FAIL = 'fail',\n WARN = 'warn',\n}\n\nconst VIOLATION_SEVERITY: Record<ForeignKeyFillabilityViolationKind, ForeignKeyFillabilityViolationSeverity> = {\n [ForeignKeyFillabilityViolationKind.EXCLUDED_FROM_CREATE]: ForeignKeyFillabilityViolationSeverity.FAIL,\n [ForeignKeyFillabilityViolationKind.TARGET_NOT_SEARCHABLE]: ForeignKeyFillabilityViolationSeverity.WARN,\n};\n\nexport interface ForeignKeyFillabilityViolation {\n kind: ForeignKeyFillabilityViolationKind;\n severity: ForeignKeyFillabilityViolationSeverity;\n /** The child resource that declares the required FK. */\n resourceType: ResourceType;\n /** The FK field on `resourceType` (e.g. `todoListId`). */\n foreignKeyField: string;\n /** The FK target / structural parent (e.g. `todoLists`). */\n parentResourceType: ResourceType;\n message: string;\n}\n\n/**\n * Structural subset of a resource configuration this validator needs. The real\n * `ResourceConfiguration` (and its frontend/backend variants) satisfy this shape,\n * so callers can pass `registry.resourceConfigurations` directly.\n */\nexport interface ForeignKeyFillabilityResourceInput {\n resourceIdentifier: ResourceType;\n mainSchema: z.ZodTypeAny;\n resourceRelationships: {\n parentRelationships: ResourceRelationship[];\n };\n operations: ReadonlyArray<{\n operationIdentifier: string | number;\n resourceOperationLike?: string | number;\n }>;\n}\n\n/**\n * Resolve a field schema by name from a resource's `mainSchema`, transparently\n * handling discriminated-union (polymorphic / schema-family) resources where a\n * plain `getObjectShape` returns `null`. The FK lives in the family's common\n * base, so it is present on every variant — the first variant that carries it\n * wins. Returns `undefined` when the field is genuinely absent (fail-open).\n */\nexport function findForeignKeyFieldSchema(\n mainSchema: z.ZodTypeAny,\n foreignKeyField: string,\n): z.ZodTypeAny | undefined {\n const directShape = getObjectShape(mainSchema);\n if (directShape && directShape[foreignKeyField]) {\n return directShape[foreignKeyField];\n }\n\n if (isDiscriminatedUnion(mainSchema)) {\n const options = getZodDefArrayProperty(mainSchema, 'options') ?? [];\n for (const option of options) {\n if (!isZodTypeAny(option)) {\n continue;\n }\n const optionShape = getObjectShape(option);\n if (optionShape && optionShape[foreignKeyField]) {\n return optionShape[foreignKeyField];\n }\n }\n }\n\n return undefined;\n}\n\n/** True when the resource exposes an operation a reference picker can load options from (LIST or SEARCH, core or `resourceOperationLike`). */\nfunction hasPickerCapableOperation(resource: ForeignKeyFillabilityResourceInput): boolean {\n return resource.operations.some((operation) => {\n const core = operation.resourceOperationLike ?? operation.operationIdentifier;\n return (\n operation.operationIdentifier === CoreResourceOperation.LIST ||\n operation.operationIdentifier === CoreResourceOperation.SEARCH ||\n core === CoreResourceOperation.LIST ||\n core === CoreResourceOperation.SEARCH\n );\n });\n}\n\n/**\n * Validate that every required COMPOSITION-parent foreign key in the registry is\n * user-fillable on CREATE. Returns the list of violations (empty when clean);\n * the caller decides how to surface them (warn vs fail). Pure and side-effect\n * free.\n *\n * @param resourceConfigurations - the registry's `resourceConfigurations` map\n * (`resourceType → configuration`).\n */\nexport function validateRequiredForeignKeyFillability(\n resourceConfigurations: Record<string, ForeignKeyFillabilityResourceInput>,\n): ForeignKeyFillabilityViolation[] {\n const violations: ForeignKeyFillabilityViolation[] = [];\n\n for (const resource of Object.values(resourceConfigurations)) {\n const parentRelationships = resource.resourceRelationships?.parentRelationships ?? [];\n\n for (const relationship of parentRelationships) {\n // Only structural (COMPOSITION) parents are user-picked — REFERENCE FKs are\n // backend-set / optional and would false-positive.\n if (relationship.nature !== RelationshipNature.COMPOSITION) {\n continue;\n }\n // Primary scope and REQUIRES_CONTEXT parents are ALWAYS present in the URL,\n // so the FK is always seeded from context — never needs a picker.\n if (relationship.isPrimaryScope) {\n continue;\n }\n if (relationship.accessScopeStrategy === ResourceRelationshipAccessScopeStrategy.REQUIRES_CONTEXT) {\n continue;\n }\n\n const foreignKeyField = relationship.foreignKeyField;\n if (!foreignKeyField) {\n continue;\n }\n\n // The FK must actually be a column on THIS resource's own schema. If it is\n // not (e.g. an inbound FK reference where another resource holds the key),\n // skip — fail-open.\n const fkFieldSchema = findForeignKeyFieldSchema(resource.mainSchema, foreignKeyField);\n if (!fkFieldSchema) {\n continue;\n }\n // Optional FK → leaving it empty on org-wide create is valid; not a problem.\n if (isOptional(fkFieldSchema)) {\n continue;\n }\n\n const parentResourceType = relationship.resourceType1;\n\n if (isExcludedFromCreate(fkFieldSchema)) {\n violations.push({\n kind: ForeignKeyFillabilityViolationKind.EXCLUDED_FROM_CREATE,\n severity: VIOLATION_SEVERITY[ForeignKeyFillabilityViolationKind.EXCLUDED_FROM_CREATE],\n resourceType: resource.resourceIdentifier,\n foreignKeyField,\n parentResourceType,\n message:\n `Resource '${resource.resourceIdentifier}' requires foreign key '${foreignKeyField}' ` +\n `(composition parent '${parentResourceType}', accessScopeStrategy='${relationship.accessScopeStrategy ?? 'unset'}'), ` +\n `but the field is excludeFromCreate AND the parent is not guaranteed in routing context. ` +\n `The create form can neither seed it from context nor offer a picker → org-wide create is impossible. ` +\n `Make the parent REQUIRES_CONTEXT (create always nested under the parent), or drop excludeFromCreate so a picker can render.`,\n });\n continue;\n }\n\n const parentResource = resourceConfigurations[parentResourceType];\n if (!parentResource) {\n // Unknown target (partial registry / cross-package boundary) → fail-open.\n continue;\n }\n if (!hasPickerCapableOperation(parentResource)) {\n violations.push({\n kind: ForeignKeyFillabilityViolationKind.TARGET_NOT_SEARCHABLE,\n severity: VIOLATION_SEVERITY[ForeignKeyFillabilityViolationKind.TARGET_NOT_SEARCHABLE],\n resourceType: resource.resourceIdentifier,\n foreignKeyField,\n parentResourceType,\n message:\n `Resource '${resource.resourceIdentifier}' requires foreign key '${foreignKeyField}' ` +\n `(composition parent '${parentResourceType}', accessScopeStrategy='${relationship.accessScopeStrategy ?? 'unset'}'), ` +\n `which must be chosen via a reference picker on org-wide create — but target '${parentResourceType}' ` +\n `exposes no LIST or SEARCH operation, so the picker cannot load options. ` +\n `Add a LIST/SEARCH operation to '${parentResourceType}', or make the parent REQUIRES_CONTEXT.`,\n });\n }\n }\n }\n\n return violations;\n}\n"]}
1
+ {"version":3,"file":"required-fk-fillability.validation.js","sourceRoot":"","sources":["../../../../../src/resources/utils/required-fk-fillability.validation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,uCAAuC,EACvC,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAgB,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,CAAN,IAAY,kCAKX;AALD,WAAY,kCAAkC;IAC5C,gHAAgH;IAChH,2GAAqE,CAAA;IACrE,2IAA2I;IAC3I,6GAAuE,CAAA;AACzE,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,QAK7C;AAED;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,sCAGX;AAHD,WAAY,sCAAsC;IAChD,uDAAa,CAAA;IACb,uDAAa,CAAA;AACf,CAAC,EAHW,sCAAsC,KAAtC,sCAAsC,QAGjD;AAED,MAAM,kBAAkB,GAAuF;IAC7G,CAAC,kCAAkC,CAAC,oBAAoB,CAAC,EAAE,sCAAsC,CAAC,IAAI;IACtG,CAAC,kCAAkC,CAAC,qBAAqB,CAAC,EAAE,sCAAsC,CAAC,IAAI;CACxG,CAAC;AA+BF;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,UAAwB,EACxB,eAAuB;IAEvB,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC/C,IAAI,WAAW,IAAI,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC;QACh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uG;wBACvG,6HAA6H;iBAChI,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;YAED,MAAM,cAAc,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;YAClE,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,0EAA0E;gBAC1E,SAAS;YACX,CAAC;YACD,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,EAAE,CAAC;gBAC/C,UAAU,CAAC,IAAI,CAAC;oBACd,IAAI,EAAE,kCAAkC,CAAC,qBAAqB;oBAC9D,QAAQ,EAAE,kBAAkB,CAAC,kCAAkC,CAAC,qBAAqB,CAAC;oBACtF,YAAY,EAAE,QAAQ,CAAC,kBAAkB;oBACzC,eAAe;oBACf,kBAAkB;oBAClB,OAAO,EACL,aAAa,QAAQ,CAAC,kBAAkB,2BAA2B,eAAe,IAAI;wBACtF,wBAAwB,kBAAkB,2BAA2B,YAAY,CAAC,mBAAmB,IAAI,OAAO,MAAM;wBACtH,gFAAgF,kBAAkB,IAAI;wBACtG,0EAA0E;wBAC1E,mCAAmC,kBAAkB,yCAAyC;iBACjG,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n isOptional,\n isExcludedFromCreate,\n getObjectShape,\n isDiscriminatedUnion,\n getZodDefArrayProperty,\n isZodTypeAny,\n} from '@wildo-ai/zod-decorators';\nimport {\n ResourceRelationship,\n ResourceRelationshipAccessScopeStrategy,\n RelationshipNature,\n} from '../resources.shared.schemas';\nimport { ResourceType, CoreResourceOperation } from '../resources.shared.core.definitions';\n\n/**\n * Registry-level guardrail: a REQUIRED composition-parent foreign key must be\n * **user-fillable on CREATE**.\n *\n * ## Why this exists\n *\n * A resource whose structural (COMPOSITION) parent relationship is\n * `OPTIONAL_CONTEXT` (or `STANDALONE`) can be created WITHOUT that parent in the\n * URL — e.g. a todo created from the org-wide collection rather than from inside\n * a specific list. In that mode the parent FK is NOT seeded from routing context,\n * so the create form must let the user supply it through a resource-reference\n * picker. If the FK is also REQUIRED, the create is impossible unless that picker\n * can actually be rendered and populated. Two ways it silently can't:\n *\n * - the FK field is `excludeFromCreate` → there is no form control at all; or\n * - the FK's target resource exposes no `LIST`/`SEARCH` operation → the picker\n * has no operation to load its options from.\n *\n * Either way the org-wide create form is dead on arrival. This validator surfaces\n * that at registry-assembly time instead of as a confusing client-side validation\n * failure with no visible error (the exact symptom of the 2026-06-27\n * `todoListId`-create bug — see `selectMatchingRoutePath` routing fix and\n * `.claude/plans/todos-required-fk-optional-context-create.md`).\n *\n * ## Why it is restricted to `COMPOSITION` parents\n *\n * `REFERENCE` foreign keys (`assignedToUserId`, `createdByUserId`,\n * `postedByUserId`, …) are NOT user-picked structural parents — they are\n * cross-references that are typically seeded by the backend (author/creator) or\n * are optional. The framework has no schema-level \"user fills this vs the backend\n * sets this\" marker, so including REFERENCE FKs here would false-positive on\n * backend-set required FKs. Limiting to `COMPOSITION` isolates the genuine\n * \"a child belongs to a parent the user must choose\" case.\n *\n * ## Fail-open by construction\n *\n * Every ambiguity skips the relationship rather than flagging it: a missing\n * `foreignKeyField`, an FK column that is not actually present on the resource's\n * own schema (e.g. an inbound FK reference where another resource holds the key),\n * an FK whose requiredness cannot be determined, or an unknown target resource.\n * This keeps the guardrail noise-free and safe to run across every app registry.\n */\nexport enum ForeignKeyFillabilityViolationKind {\n /** The required FK is `excludeFromCreate` yet the parent is not guaranteed in context — no way to supply it. */\n EXCLUDED_FROM_CREATE = 'required-composition-fk-excluded-from-create',\n /** The required FK needs a picker (parent is `OPTIONAL_CONTEXT`/`STANDALONE`) but its target exposes no LIST/SEARCH op to populate one. */\n TARGET_NOT_SEARCHABLE = 'required-composition-fk-target-not-searchable',\n}\n\n/**\n * Severity a consumer should apply to a violation. `EXCLUDED_FROM_CREATE` is a\n * genuinely impossible-to-create config (no context, no control) → `FAIL` so the\n * backend crashes loud at boot rather than shipping a dead create form.\n * `TARGET_NOT_SEARCHABLE` degrades the picker but a custom create surface might\n * still supply the FK → `WARN`.\n */\nexport enum ForeignKeyFillabilityViolationSeverity {\n FAIL = 'fail',\n WARN = 'warn',\n}\n\nconst VIOLATION_SEVERITY: Record<ForeignKeyFillabilityViolationKind, ForeignKeyFillabilityViolationSeverity> = {\n [ForeignKeyFillabilityViolationKind.EXCLUDED_FROM_CREATE]: ForeignKeyFillabilityViolationSeverity.FAIL,\n [ForeignKeyFillabilityViolationKind.TARGET_NOT_SEARCHABLE]: ForeignKeyFillabilityViolationSeverity.WARN,\n};\n\nexport interface ForeignKeyFillabilityViolation {\n kind: ForeignKeyFillabilityViolationKind;\n severity: ForeignKeyFillabilityViolationSeverity;\n /** The child resource that declares the required FK. */\n resourceType: ResourceType;\n /** The FK field on `resourceType` (e.g. `todoListId`). */\n foreignKeyField: string;\n /** The FK target / structural parent (e.g. `todoLists`). */\n parentResourceType: ResourceType;\n message: string;\n}\n\n/**\n * Structural subset of a resource configuration this validator needs. The real\n * `ResourceConfiguration` (and its frontend/backend variants) satisfy this shape,\n * so callers can pass `registry.resourceConfigurations` directly.\n */\nexport interface ForeignKeyFillabilityResourceInput {\n resourceIdentifier: ResourceType;\n mainSchema: z.ZodTypeAny;\n resourceRelationships: {\n parentRelationships: ResourceRelationship[];\n };\n operations: ReadonlyArray<{\n operationIdentifier: string | number;\n resourceOperationLike?: string | number;\n }>;\n}\n\n/**\n * Resolve a field schema by name from a resource's `mainSchema`, transparently\n * handling discriminated-union (polymorphic / schema-family) resources where a\n * plain `getObjectShape` returns `null`. The FK lives in the family's common\n * base, so it is present on every variant — the first variant that carries it\n * wins. Returns `undefined` when the field is genuinely absent (fail-open).\n */\nexport function findForeignKeyFieldSchema(\n mainSchema: z.ZodTypeAny,\n foreignKeyField: string,\n): z.ZodTypeAny | undefined {\n const directShape = getObjectShape(mainSchema);\n if (directShape && directShape[foreignKeyField]) {\n return directShape[foreignKeyField];\n }\n\n if (isDiscriminatedUnion(mainSchema)) {\n const options = getZodDefArrayProperty(mainSchema, 'options') ?? [];\n for (const option of options) {\n if (!isZodTypeAny(option)) {\n continue;\n }\n const optionShape = getObjectShape(option);\n if (optionShape && optionShape[foreignKeyField]) {\n return optionShape[foreignKeyField];\n }\n }\n }\n\n return undefined;\n}\n\n/** True when the resource exposes an operation a reference picker can load options from (LIST or SEARCH, core or `resourceOperationLike`). */\nfunction hasPickerCapableOperation(resource: ForeignKeyFillabilityResourceInput): boolean {\n return resource.operations.some((operation) => {\n const core = operation.resourceOperationLike ?? operation.operationIdentifier;\n return (\n operation.operationIdentifier === CoreResourceOperation.LIST ||\n operation.operationIdentifier === CoreResourceOperation.SEARCH ||\n core === CoreResourceOperation.LIST ||\n core === CoreResourceOperation.SEARCH\n );\n });\n}\n\n/**\n * Validate that every required COMPOSITION-parent foreign key in the registry is\n * user-fillable on CREATE. Returns the list of violations (empty when clean);\n * the caller decides how to surface them (warn vs fail). Pure and side-effect\n * free.\n *\n * @param resourceConfigurations - the registry's `resourceConfigurations` map\n * (`resourceType → configuration`).\n */\nexport function validateRequiredForeignKeyFillability(\n resourceConfigurations: Record<string, ForeignKeyFillabilityResourceInput>,\n): ForeignKeyFillabilityViolation[] {\n const violations: ForeignKeyFillabilityViolation[] = [];\n\n for (const resource of Object.values(resourceConfigurations)) {\n const parentRelationships = resource.resourceRelationships?.parentRelationships ?? [];\n\n for (const relationship of parentRelationships) {\n // Only structural (COMPOSITION) parents are user-picked — REFERENCE FKs are\n // backend-set / optional and would false-positive.\n if (relationship.nature !== RelationshipNature.COMPOSITION) {\n continue;\n }\n // Primary scope and REQUIRES_CONTEXT parents are ALWAYS present in the URL,\n // so the FK is always seeded from context — never needs a picker.\n if (relationship.isPrimaryScope) {\n continue;\n }\n if (relationship.accessScopeStrategy === ResourceRelationshipAccessScopeStrategy.REQUIRES_CONTEXT) {\n continue;\n }\n\n const foreignKeyField = relationship.foreignKeyField;\n if (!foreignKeyField) {\n continue;\n }\n\n // The FK must actually be a column on THIS resource's own schema. If it is\n // not (e.g. an inbound FK reference where another resource holds the key),\n // skip — fail-open.\n const fkFieldSchema = findForeignKeyFieldSchema(resource.mainSchema, foreignKeyField);\n if (!fkFieldSchema) {\n continue;\n }\n // Optional FK → leaving it empty on org-wide create is valid; not a problem.\n if (isOptional(fkFieldSchema)) {\n continue;\n }\n\n const parentResourceType = relationship.resourceType1;\n\n if (isExcludedFromCreate(fkFieldSchema)) {\n violations.push({\n kind: ForeignKeyFillabilityViolationKind.EXCLUDED_FROM_CREATE,\n severity: VIOLATION_SEVERITY[ForeignKeyFillabilityViolationKind.EXCLUDED_FROM_CREATE],\n resourceType: resource.resourceIdentifier,\n foreignKeyField,\n parentResourceType,\n message:\n `Resource '${resource.resourceIdentifier}' requires foreign key '${foreignKeyField}' ` +\n `(composition parent '${parentResourceType}', accessScopeStrategy='${relationship.accessScopeStrategy ?? 'unset'}'), ` +\n `but the field is excludeFromCreate AND the parent is not guaranteed in routing context. ` +\n `The create form can neither seed it from context nor offer a picker → org-wide create is impossible. ` +\n `Make the parent REQUIRES_CONTEXT (create always nested under the parent), or drop excludeFromCreate so a picker can render.`,\n });\n continue;\n }\n\n const parentResource = resourceConfigurations[parentResourceType];\n if (!parentResource) {\n // Unknown target (partial registry / cross-package boundary) → fail-open.\n continue;\n }\n if (!hasPickerCapableOperation(parentResource)) {\n violations.push({\n kind: ForeignKeyFillabilityViolationKind.TARGET_NOT_SEARCHABLE,\n severity: VIOLATION_SEVERITY[ForeignKeyFillabilityViolationKind.TARGET_NOT_SEARCHABLE],\n resourceType: resource.resourceIdentifier,\n foreignKeyField,\n parentResourceType,\n message:\n `Resource '${resource.resourceIdentifier}' requires foreign key '${foreignKeyField}' ` +\n `(composition parent '${parentResourceType}', accessScopeStrategy='${relationship.accessScopeStrategy ?? 'unset'}'), ` +\n `which must be chosen via a reference picker on org-wide create — but target '${parentResourceType}' ` +\n `exposes no LIST or SEARCH operation, so the picker cannot load options. ` +\n `Add a LIST/SEARCH operation to '${parentResourceType}', or make the parent REQUIRES_CONTEXT.`,\n });\n }\n }\n }\n\n return violations;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resource-operation-type-guards.utils.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/resource-operation-type-guards.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE3E;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACzF,SAAS,EAAE,CAAC,GACX,SAAS,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,WAAW,EAAE,4BAA4B,CAAC,QAAQ,CAAA;CAAE,CAAC,CAEjF;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACrG,SAAS,EAAE,CAAC,GACX,SAAS,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,WAAW,EAAE,4BAA4B,CAAC,sBAAsB,CAAA;CAAE,CAAC,CAE/F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACzF,SAAS,EAAE,CAAC,GACX,SAAS,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,WAAW,EAAE,4BAA4B,CAAC,QAAQ,CAAA;CAAE,CAAC,CAEjF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC1F,SAAS,EAAE,CAAC,GACX,SAAS,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,WAAW,EAAE,4BAA4B,CAAC,SAAS,CAAA;CAAE,CAAC,CAElF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CAAC,CAKvI"}
1
+ {"version":3,"file":"resource-operation-type-guards.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/resource-operation-type-guards.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE3E;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACzF,SAAS,EAAE,CAAC,GACX,SAAS,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,WAAW,EAAE,4BAA4B,CAAC,QAAQ,CAAA;CAAE,CAAC,CAEjF;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACrG,SAAS,EAAE,CAAC,GACX,SAAS,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,WAAW,EAAE,4BAA4B,CAAC,sBAAsB,CAAA;CAAE,CAAC,CAE/F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACzF,SAAS,EAAE,CAAC,GACX,SAAS,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,WAAW,EAAE,4BAA4B,CAAC,QAAQ,CAAA;CAAE,CAAC,CAEjF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC1F,SAAS,EAAE,CAAC,GACX,SAAS,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,WAAW,EAAE,4BAA4B,CAAC,SAAS,CAAA;CAAE,CAAC,CAElF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,+B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AsC;IACzC,GAAG,mCAAmC;CACvC,CAAC;AAEF;;;;;;;GAOG;AACH,SAAS,sBAAsB,CAA2D,SAAY;IACpG,OAAO,iBAAiB,IAAI,SAAS,IAAI,SAAS,CAAC,eAAe,KAAK,IAAI,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,mCAAmC,CACjD,SAAY,EACZ,mBAA2B;IAE3B,OAAO,SAAS,CAAC,mBAAmB,KAAK,mBAAmB;WACvD,SAAS,CAAC,kBAAkB,KAAK,IAAI;WACrC,CAAC,sBAAsB,CAAC,SAAS,CAAC;WAClC,0CAA0C,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAClF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,4BAA4B,CAC1C,SAAY,EACZ,mBAA2B;IAE3B,OAAO,SAAS,CAAC,mBAAmB,KAAK,mBAAmB;WACvD,SAAS,CAAC,kBAAkB,KAAK,IAAI;WACrC,CAAC,sBAAsB,CAAC,SAAS,CAAC;WAClC,mCAAmC,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["/**\n * Type Guard Utilities for Resource Operations\n * \n * These helpers assist TypeScript in narrowing union types more efficiently,\n * reducing the need to check all operation variants in the union.\n * \n * @see TYPING_OPTIMIZATION_PLAN.md\n */\n\nimport { ResourceConfiguration_Operation } from '../resources-config.shared.schemas';\nimport { ResourceOperationVariantType } from '../resources.shared.schemas';\n\n/**\n * Type guard for API_CALL variant\n */\nexport function isApiCallOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.API_CALL }> {\n return operation.variantType === ResourceOperationVariantType.API_CALL;\n}\n\n/**\n * Type guard for API_CALL_WITH_CALLBACK variant\n */\nexport function isApiCallWithCallbackOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.API_CALL_WITH_CALLBACK }> {\n return operation.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK;\n}\n\n/**\n * Type guard for CRON_JOB variant\n */\nexport function isCronJobOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.CRON_JOB }> {\n return operation.variantType === ResourceOperationVariantType.CRON_JOB;\n}\n\n/**\n * Type guard for BATCH_JOB variant\n */\nexport function isBatchJobOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.BATCH_JOB }> {\n return operation.variantType === ResourceOperationVariantType.BATCH_JOB;\n}\n\n/**\n * Type guard for INTERNAL_CALL variant\n */\nexport function isInternalCallOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.INTERNAL_CALL }> {\n return operation.variantType === ResourceOperationVariantType.INTERNAL_CALL;\n}\n\n/**\n * Type guard for REPOSITORY_ONLY variant\n */\nexport function isRepositoryOnlyOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.REPOSITORY_ONLY }> {\n return operation.variantType === ResourceOperationVariantType.REPOSITORY_ONLY;\n}\n\n/**\n * The variant types that carry an HTTP surface — URL templates, methods,\n * request/response DTOs. THE authority for \"is this variant routable?\".\n *\n * Every site that filters operations by \"reachable over HTTP\" must read this\n * set rather than re-listing its members: the list has drifted before, and each\n * copy is a place a newly-added URL-bearing variant would be silently missed.\n */\nexport const URL_BEARING_OPERATION_VARIANT_TYPES: readonly ResourceOperationVariantType[] = [\n ResourceOperationVariantType.API_CALL,\n ResourceOperationVariantType.API_CALL_WITH_CALLBACK,\n];\n\n/**\n * The service layer's NATIVE transport: variants authors declare for operations\n * that must run through the registry pipeline (ACL, hooks, lifecycle) but are\n * deliberately NOT exposed over HTTP.\n */\nexport const SERVICE_NATIVE_OPERATION_VARIANT_TYPES: readonly ResourceOperationVariantType[] = [\n ResourceOperationVariantType.INTERNAL_CALL,\n];\n\n/**\n * THE authority for \"which variant types can the SERVICE dispatch layer\n * resolve?\" — i.e. exactly the set\n * `ResourcesRegistryBackendService.getServiceOperationPathDefault` matches.\n *\n * **Why this is a named, exported constant rather than three enum members\n * spelled out at each call site.** `REPOSITORY_ONLY` is route-less, just like\n * `INTERNAL_CALL`, and is therefore an extremely natural (wrong) choice for an\n * operation that should exist \"as a capability, without a new HTTP surface\".\n * But it is deliberately EXCLUDED here and served by the separate\n * `getRepositoryOperationPathDefault` transport — so a `REPOSITORY_ONLY`\n * operation satisfies any \"the op exists\" config check and then fails to\n * resolve the moment a service-layer caller actually invokes it. That is a\n * latent RUNTIME failure produced by a config that looked correct at boot; it\n * shipped once already (the `USERS` retention opt-in, caught by a completion\n * review after the config tests were green).\n *\n * Boot-time guards that require an operation to be reachable by a\n * service-layer caller — notably the `retentionPolicy` guard in\n * `resources-config.shared.factory.ts`, whose three primitives\n * (`updateManyAsSystem` / `readRetainedAsSystem` / `listRetainedAsSystem`) all\n * resolve through `getServiceOperationPathDefault` — MUST read this set. Two\n * independently-maintained copies of the list is exactly how that class of bug\n * returns: the guard would accept a variant the resolver rejects.\n *\n * NOT the same question as {@link URL_BEARING_OPERATION_VARIANT_TYPES}: a\n * service-resolvable operation may be route-less (`INTERNAL_CALL`). An\n * operation that must be BOTH route-less and service-resolvable therefore has\n * exactly one legal variant type today — `INTERNAL_CALL` — and that\n * intersection is what a retention capability op needs.\n */\nexport const SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES: readonly ResourceOperationVariantType[] = [\n ...SERVICE_NATIVE_OPERATION_VARIANT_TYPES,\n ...URL_BEARING_OPERATION_VARIANT_TYPES,\n];\n\n/**\n * Is `operation` a BULK variant?\n *\n * `isBulkOperation` exists only on some members of the operation discriminated\n * union (the CronJob variant carries neither the flag nor a bulk notion), so\n * the `in` narrow is required before the read — see\n * `.claude/skills/audit-operation-variants`.\n */\nfunction isBulkOperationVariant<T extends ResourceConfiguration_Operation<any, any, any>>(operation: T): boolean {\n return 'isBulkOperation' in operation && operation.isBulkOperation === true;\n}\n\n/**\n * Composite predicate: is `operation` the DEFAULT, NON-BULK variant for\n * `operationIdentifier` that the SERVICE dispatch layer can resolve?\n *\n * This is the exact admission test applied by\n * `ResourcesRegistryBackendService.getServiceOperationPathDefault` before it\n * chooses between the INTERNAL and URL-bearing candidates. Sharing it makes a\n * boot-time guard and the runtime resolver structurally unable to disagree:\n * a config the guard accepts is a config the resolver can serve, and adding a\n * variant type to {@link SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES} updates\n * both at once.\n *\n * Deliberately NOT a TypeScript type predicate: unlike\n * {@link isDefaultUrlBearingOperation}, callers of this one need a boolean\n * answer about reachability, not a narrowed operation — and narrowing to a\n * three-member union would imply a variant shape the callers do not read.\n *\n * @param operation - a single resource operation variant to classify.\n * @param operationIdentifier - the operation identifier to match (e.g. `CoreResourceOperation.UPDATE_MANY`).\n */\nexport function isServiceResolvableDefaultOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T,\n operationIdentifier: string,\n): boolean {\n return operation.operationIdentifier === operationIdentifier\n && operation.isOperationDefault === true\n && !isBulkOperationVariant(operation)\n && SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES.includes(operation.variantType);\n}\n\n/**\n * Composite type guard: is `operation` the DEFAULT, NON-BULK, URL-bearing\n * variant for `operationIdentifier`?\n *\n * Combines the four conditions that together select THE operation a resource\n * exposes over HTTP for a given identifier:\n * 1. `operationIdentifier` matches,\n * 2. it is the operation default (`isOperationDefault === true`),\n * 3. it is not a bulk operation, and\n * 4. its variant type is in {@link URL_BEARING_OPERATION_VARIANT_TYPES} — the\n * only variants that carry an HTTP surface: URL templates, methods,\n * request/response DTOs.\n *\n * **Why this is single-sourced — a latent HTTP 500 depends on it.** Two\n * independent call sites must apply EXACTLY this filter:\n * - `ResourcesRegistryBackendService.getOperationPathDefault` resolves the\n * URL/DTO routing path and throws `RESOURCES_REGISTRY_OPERATION_PATH_NOT_FOUND`\n * (INTERNAL / 500) when nothing matches.\n * - The validate-field route mount gate (`findDefaultUrlBearingCreateOperation`)\n * decides whether to register a resource's `validate-field` route; that\n * route's request handler later calls `getOperationPathDefault(resourceType,\n * CREATE)`. The handler is safe ONLY because the gate refuses to mount the\n * route for any resource whose CREATE the resolver would reject (e.g. a\n * `REPOSITORY_ONLY`-only CREATE such as `CoreResourceType.FILES`).\n *\n * Keeping both sites on this one predicate makes their agreement structural:\n * adding or removing a URL-bearing variant updates both at once, so the gate can\n * never admit a request the resolver will 500 on. Do NOT inline a copy of this\n * filter at a call site — call this guard.\n *\n * @param operation - a single resource operation variant to classify.\n * @param operationIdentifier - the operation identifier to match (e.g. `CoreResourceOperation.CREATE`).\n */\nexport function isDefaultUrlBearingOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T,\n operationIdentifier: string,\n): operation is Extract<T, { variantType: ResourceOperationVariantType.API_CALL | ResourceOperationVariantType.API_CALL_WITH_CALLBACK }> {\n return operation.operationIdentifier === operationIdentifier\n && operation.isOperationDefault === true\n && !isBulkOperationVariant(operation)\n && URL_BEARING_OPERATION_VARIANT_TYPES.includes(operation.variantType);\n}\n"]}
1
+ {"version":3,"file":"resource-operation-type-guards.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/resource-operation-type-guards.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAE3E;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAY;IAEZ,OAAO,SAAS,CAAC,WAAW,KAAK,4BAA4B,CAAC,QAAQ,CAAC;AACzE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAC5C,SAAY;IAEZ,OAAO,SAAS,CAAC,WAAW,KAAK,4BAA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,CAAC,SAAS,CAAC;WAClC,0CAA0C,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAClF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,4BAA4B,CAC1C,SAAY,EACZ,mBAA2B;IAE3B,OAAO,SAAS,CAAC,mBAAmB,KAAK,mBAAmB;WACvD,SAAS,CAAC,kBAAkB,KAAK,IAAI;WACrC,CAAC,sBAAsB,CAAC,SAAS,CAAC;WAClC,mCAAmC,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["/**\n * Type Guard Utilities for Resource Operations\n * \n * These helpers assist TypeScript in narrowing union types more efficiently,\n * reducing the need to check all operation variants in the union.\n * \n * @see TYPING_OPTIMIZATION_PLAN.md\n */\n\nimport { ResourceConfiguration_Operation } from '../resources-config.shared.schemas';\nimport { ResourceOperationVariantType } from '../resources.shared.schemas';\n\n/**\n * Type guard for API_CALL variant\n */\nexport function isApiCallOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.API_CALL }> {\n return operation.variantType === ResourceOperationVariantType.API_CALL;\n}\n\n/**\n * Type guard for API_CALL_WITH_CALLBACK variant\n */\nexport function isApiCallWithCallbackOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.API_CALL_WITH_CALLBACK }> {\n return operation.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK;\n}\n\n/**\n * Type guard for CRON_JOB variant\n */\nexport function isCronJobOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.CRON_JOB }> {\n return operation.variantType === ResourceOperationVariantType.CRON_JOB;\n}\n\n/**\n * Type guard for BATCH_JOB variant\n */\nexport function isBatchJobOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.BATCH_JOB }> {\n return operation.variantType === ResourceOperationVariantType.BATCH_JOB;\n}\n\n/**\n * Type guard for INTERNAL_CALL variant\n */\nexport function isInternalCallOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.INTERNAL_CALL }> {\n return operation.variantType === ResourceOperationVariantType.INTERNAL_CALL;\n}\n\n/**\n * Type guard for REPOSITORY_ONLY variant\n */\nexport function isRepositoryOnlyOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T\n): operation is Extract<T, { variantType: ResourceOperationVariantType.REPOSITORY_ONLY }> {\n return operation.variantType === ResourceOperationVariantType.REPOSITORY_ONLY;\n}\n\n/**\n * The variant types that carry an HTTP surface — URL templates, methods,\n * request/response DTOs. THE authority for \"is this variant routable?\".\n *\n * Every site that filters operations by \"reachable over HTTP\" must read this\n * set rather than re-listing its members: the list has drifted before, and each\n * copy is a place a newly-added URL-bearing variant would be silently missed.\n */\nexport const URL_BEARING_OPERATION_VARIANT_TYPES: readonly ResourceOperationVariantType[] = [\n ResourceOperationVariantType.API_CALL,\n ResourceOperationVariantType.API_CALL_WITH_CALLBACK,\n];\n\n/**\n * The service layer's NATIVE transport: variants authors declare for operations\n * that must run through the registry pipeline (ACL, hooks, lifecycle) but are\n * deliberately NOT exposed over HTTP.\n */\nexport const SERVICE_NATIVE_OPERATION_VARIANT_TYPES: readonly ResourceOperationVariantType[] = [\n ResourceOperationVariantType.INTERNAL_CALL,\n];\n\n/**\n * THE authority for \"which variant types can the SERVICE dispatch layer\n * resolve?\" — i.e. exactly the set\n * `ResourcesRegistryBackendService.getServiceOperationPathDefault` matches.\n *\n * **Why this is a named, exported constant rather than three enum members\n * spelled out at each call site.** `REPOSITORY_ONLY` is route-less, just like\n * `INTERNAL_CALL`, and is therefore an extremely natural (wrong) choice for an\n * operation that should exist \"as a capability, without a new HTTP surface\".\n * But it is deliberately EXCLUDED here and served by the separate\n * `getRepositoryOperationPathDefault` transport — so a `REPOSITORY_ONLY`\n * operation satisfies any \"the op exists\" config check and then fails to\n * resolve the moment a service-layer caller actually invokes it. That is a\n * latent RUNTIME failure produced by a config that looked correct at boot; it\n * shipped once already (the `USERS` retention opt-in, caught by a completion\n * review after the config tests were green).\n *\n * Boot-time guards that require an operation to be reachable by a\n * service-layer caller — notably the `retentionPolicy` guard in\n * `resources-config.shared.factory.ts`, whose three primitives\n * (`updateManyAsSystem` / `readRetainedAsSystem` / `listRetainedAsSystem`) all\n * resolve through `getServiceOperationPathDefault` — MUST read this set. Two\n * independently-maintained copies of the list is exactly how that class of bug\n * returns: the guard would accept a variant the resolver rejects.\n *\n * NOT the same question as {@link URL_BEARING_OPERATION_VARIANT_TYPES}: a\n * service-resolvable operation may be route-less (`INTERNAL_CALL`). An\n * operation that must be BOTH route-less and service-resolvable therefore has\n * exactly one legal variant type today — `INTERNAL_CALL` — and that\n * intersection is what a retention capability op needs.\n */\nexport const SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES: readonly ResourceOperationVariantType[] = [\n ...SERVICE_NATIVE_OPERATION_VARIANT_TYPES,\n ...URL_BEARING_OPERATION_VARIANT_TYPES,\n];\n\n/**\n * Is `operation` a BULK variant?\n *\n * `isBulkOperation` exists only on some members of the operation discriminated\n * union (the CronJob variant carries neither the flag nor a bulk notion), so\n * the `in` narrow is required before the read — see\n * `.claude/skills/audit-operation-variants`.\n */\nfunction isBulkOperationVariant<T extends ResourceConfiguration_Operation<any, any, any>>(operation: T): boolean {\n return 'isBulkOperation' in operation && operation.isBulkOperation === true;\n}\n\n/**\n * Composite predicate: is `operation` the DEFAULT, NON-BULK variant for\n * `operationIdentifier` that the SERVICE dispatch layer can resolve?\n *\n * This is the exact admission test applied by\n * `ResourcesRegistryBackendService.getServiceOperationPathDefault` before it\n * chooses between the INTERNAL and URL-bearing candidates. Sharing it makes a\n * boot-time guard and the runtime resolver structurally unable to disagree:\n * a config the guard accepts is a config the resolver can serve, and adding a\n * variant type to {@link SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES} updates\n * both at once.\n *\n * Deliberately NOT a TypeScript type predicate: unlike\n * {@link isDefaultUrlBearingOperation}, callers of this one need a boolean\n * answer about reachability, not a narrowed operation — and narrowing to a\n * three-member union would imply a variant shape the callers do not read.\n *\n * @param operation - a single resource operation variant to classify.\n * @param operationIdentifier - the operation identifier to match (e.g. `CoreResourceOperation.UPDATE_MANY`).\n */\nexport function isServiceResolvableDefaultOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T,\n operationIdentifier: string,\n): boolean {\n return operation.operationIdentifier === operationIdentifier\n && operation.isOperationDefault === true\n && !isBulkOperationVariant(operation)\n && SERVICE_RESOLVABLE_OPERATION_VARIANT_TYPES.includes(operation.variantType);\n}\n\n/**\n * Composite type guard: is `operation` the DEFAULT, NON-BULK, URL-bearing\n * variant for `operationIdentifier`?\n *\n * Combines the four conditions that together select THE operation a resource\n * exposes over HTTP for a given identifier:\n * 1. `operationIdentifier` matches,\n * 2. it is the operation default (`isOperationDefault === true`),\n * 3. it is not a bulk operation, and\n * 4. its variant type is in {@link URL_BEARING_OPERATION_VARIANT_TYPES} — the\n * only variants that carry an HTTP surface: URL templates, methods,\n * request/response DTOs.\n *\n * **Why this is single-sourced — a latent HTTP 500 depends on it.** Two\n * independent call sites must apply EXACTLY this filter:\n * - `ResourcesRegistryBackendService.getOperationPathDefault` resolves the\n * URL/DTO routing path and throws `RESOURCES_REGISTRY_OPERATION_PATH_NOT_FOUND`\n * (INTERNAL / 500) when nothing matches.\n * - The validate-field route mount gate (`findDefaultUrlBearingCreateOperation`)\n * decides whether to register a resource's `validate-field` route; that\n * route's request handler later calls `getOperationPathDefault(resourceType,\n * CREATE)`. The handler is safe ONLY because the gate refuses to mount the\n * route for any resource whose CREATE the resolver would reject (e.g. a\n * `REPOSITORY_ONLY`-only CREATE such as `CoreResourceType.FILES`).\n *\n * Keeping both sites on this one predicate makes their agreement structural:\n * adding or removing a URL-bearing variant updates both at once, so the gate can\n * never admit a request the resolver will 500 on. Do NOT inline a copy of this\n * filter at a call site — call this guard.\n *\n * @param operation - a single resource operation variant to classify.\n * @param operationIdentifier - the operation identifier to match (e.g. `CoreResourceOperation.CREATE`).\n */\nexport function isDefaultUrlBearingOperation<T extends ResourceConfiguration_Operation<any, any, any>>(\n operation: T,\n operationIdentifier: string,\n): operation is Extract<T, { variantType: ResourceOperationVariantType.API_CALL | ResourceOperationVariantType.API_CALL_WITH_CALLBACK }> {\n return operation.operationIdentifier === operationIdentifier\n && operation.isOperationDefault === true\n && !isBulkOperationVariant(operation)\n && URL_BEARING_OPERATION_VARIANT_TYPES.includes(operation.variantType);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resource-polymorphism.factory.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/resource-polymorphism.factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EACV,uCAAuC,EACvC,2CAA2C,EAC3C,iDAAiD,EACjD,wDAAwD,EACxD,2BAA2B,EAC5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAgB,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,4BAA4B,EAA8B,MAAM,iCAAiC,CAAC;AAMhH;;;;GAIG;AACH,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,IAAI,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;AAErF;;;;;;;;;;GAUG;AACH;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,CAAC,WAAW,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,IAC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gB,uCAAuC,CACrD,oBAAoB,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,EACjE,kBAAkB,SAAS,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,GAAG,SAAS,EACjF,WAAW,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,MAAM,EAE3C,WAAW,EAAE,4BAA4B,CAAC,WAAW,CAAC,EACtD,YAAY,EAAE,yBAAyB,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,CAAC,GAC7F,MAAM,CAAC,MAAM,EAAE,2CAA2C,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAC,CAwC5G"}
1
+ {"version":3,"file":"resource-polymorphism.factory.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/resource-polymorphism.factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EACV,uCAAuC,EACvC,2CAA2C,EAC3C,iDAAiD,EACjD,wDAAwD,EACxD,2BAA2B,EAC5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAgB,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,4BAA4B,EAA8B,MAAM,iCAAiC,CAAC;AAMhH;;;;GAIG;AACH,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,IAAI,CAAC,SAAS,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;AAErF;;;;;;;;;;GAUG;AACH;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,CAAC,WAAW,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,IACrF,gBAAgB,CAAC,wDAAwD,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,G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ACjE,kBAAkB,SAAS,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,GAAG,SAAS,EACjF,WAAW,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,MAAM,EAE3C,WAAW,EAAE,4BAA4B,CAAC,WAAW,CAAC,EACtD,YAAY,EAAE,yBAAyB,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,CAAC,GAC7F,MAAM,CAAC,MAAM,EAAE,2CAA2C,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAC,CAwC5G"}
@@ -1 +1 @@
1
- {"version":3,"file":"resource-polymorphism.factory.js","sourceRoot":"","sources":["../../../../src/resources/utils/resource-polymorphism.factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,0CAA0C,EAAE,MAAM,oCAAoC,CAAC;AAqIhG,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,UAAU,uCAAuC,CAKrD,WAAsD,EACtD,YAA8F;IAE9F,MAAM,MAAM,GAA+G,EAAE,CAAC;IAE9H,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC/C,MAAM,iBAAiB,GAAG,2BAA2B,CACnD,YAAY,CAAC,uBAAuB,EACpC,OAAO,CACR,CAAC;QAEF,yCAAyC;QACzC,2CAA2C;QAC3C,wDAAwD;QACxD,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;QAEzC,yCAAyC;QACzC,0EAA0E;QAC1E,gDAAgD;QAChD,MAAM,2BAA2B,GAAG,OAAO,CAAC,YAAY;YACtD,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,2BAAkC;YACzD,CAAC,CAAC,YAAY,CAAC,2BAA2B,CAAC;QAE7C,2FAA2F;QAC3F,+FAA+F;QAC/F,iGAAiG;QACjG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,CAAC;gBAC/C,CAAC;qBAAM,IAAI,aAAa,EAAE,CAAC;oBACzB,aAAa,GAAG,aAAa,CAAC;gBAChC,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CACb,mCAAmC,YAAY,6CAA6C;wBAC5F,2BAA2B,UAAU,2BAA2B;wBAChE,eAAe,UAAU,iDAAiD,CAC3E,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,IAAI,aAAa,EAAE,CAAC;gBACzB,aAAa,GAAG,aAAa,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,mCAAmC,YAAY,kDAAkD,CAClG,CAAC;YACJ,CAAC;YAED,gBAAgB,CAAC,IAAI,CAAC;gBACpB,GAAG,IAAI;gBACP,KAAK,EAAE,aAAa;gBACpB,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,4BAA4B,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACpC,CAAC,CAAC;QAC9E,CAAC;QAED,QAAQ,CAAC,YAAY,CAAC,GAAG;YACvB,GAAG,QAAQ;YACX,QAAQ,EAAE,gBAAgB;SAC3B,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/**\n * Resource Polymorphism — Factory Configuration (Phase 3)\n *\n * Provides `createPolymorphicResourceConfigurations()` which takes a polymorphic\n * declaration + shared resource configuration, and produces N factory functions\n * (one per variant) that can be spread into the resource configurations factory map.\n *\n * Key transformation: `polymorphicRole` on operation variants is resolved to\n * standard `roles` for each variant's scope.\n *\n * @see polymorphic-scope-approach-A-expansion.md — Phase 3\n */\n\nimport { z } from 'zod';\nimport { createResourceConfiguration_Initialization } from '../resources-config.shared.factory';\nimport type {\n ResourceConfiguration_BuilderParameters,\n ResourceConfiguration_InitializationFactory,\n ResourceConfiguration_Operation_BuilderParameters,\n ResourceConfiguration_OperationVariant_BuilderParameters,\n CollectionViewFields_Search,\n} from '../resources-config.shared.schemas';\nimport type { ResourceType, CoreResourceOperation } from '../resources.shared.core.definitions';\nimport type { EnumLikeType } from '@wildo-ai/zod-decorators';\nimport type { PolymorphicSchemaDeclaration, PolymorphicResolvedVariant } from './resource-polymorphism.schemas';\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/**\n * Distributive Omit — preserves union members individually.\n * Standard `Omit<A | B, K>` collapses to common keys only, losing per-member properties.\n * This helper distributes the Omit over each union member, preserving all variant-specific fields.\n */\ntype DistributiveOmit<T, K extends PropertyKey> = T extends any ? Omit<T, K> : never;\n\n/**\n * Operation variant with `polymorphicRole` support.\n * Extends the standard variant by adding `polymorphicRole` as an alternative to `roles`.\n *\n * - `polymorphicRole`: `Record<ResourceType, string[]>` — role mapping per parent resource type.\n * The factory resolves this to standard `roles` for each generated variant.\n * - `roles`: standard roles array — used directly (e.g., for admin variants).\n *\n * If both `polymorphicRole` and `roles` are provided, `polymorphicRole` takes precedence\n * for the matching parent resource type. If the parent isn't in `polymorphicRole`, `roles` is used as fallback.\n */\n/**\n * Polymorphic variant type. Intersects with CollectionViewFields_Search so that\n * SEARCH operation variants (including REPOSITORY_ONLY) can specify isSearchable,\n * searchableFields, filterFields, sortFields, etc. All fields are optional.\n */\nexport type PolymorphicOperationVariant<TMainSchema extends z.ZodTypeAny = z.ZodTypeAny> =\n DistributiveOmit<ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema>, 'roles'> &\n CollectionViewFields_Search & {\n /**\n * Role mapping per parent resource type.\n * The factory resolves this into standard `roles` for each generated variant.\n *\n * ⚠️ An EMPTY array is NOT \"skip the role check\" — it is fail-CLOSED. The\n * authorization gate evaluates `operationRoles.some(...)`, and `[].some()`\n * is always `false`, so an empty array denies EVERY caller (403). For the\n * user-self scope, list the baseline authenticated role (`APP_USER`); role\n * membership is the floor, while row ownership is enforced separately by the\n * USER_SELF scope authorizer.\n *\n * @example\n * polymorphicRole: {\n * 'organizations': ['ORG_OWNER', 'ORG_ADMIN'],\n * 'users': ['APP_USER'], // user-self: any authenticated user (ownership checked by scope)\n * }\n */\n polymorphicRole?: Record<string, string[]>;\n /** Standard roles — used directly or as fallback when polymorphicRole doesn't have the parent */\n roles?: string[];\n /**\n * A response DTO built from EACH variant's own main schema, for a response that must carry that variant's\n * fields — above all its scope foreign key (`organizationId` on the organization variant, `applicationId`\n * on the application variant), which only the variant schema has. A static `customResponseDto` built from\n * the shared base schema silently drops it (#1596 review N4).\n *\n * Resolved per variant into `customResponseDto`; declaring both is refused, since only one can win.\n *\n * @example\n * polymorphicCustomResponseDto: (variantSchema) => z.object({\n * data: z.array((variantSchema as z.ZodObject<z.ZodRawShape>).omit({ rawBody: true })),\n * pagination: createPaginationResponseMetadataSchema(DEFAULT_LIST_PAGE_CEILING),\n * }),\n */\n polymorphicCustomResponseDto?: (variantMainSchema: TMainSchema) => z.ZodTypeAny;\n };\n\n/**\n * Operation configuration with polymorphic role support.\n */\nexport type PolymorphicOperationConfig<TMainSchema extends z.ZodTypeAny = z.ZodAny> = Omit<\n ResourceConfiguration_Operation_BuilderParameters<TMainSchema>,\n 'variants'\n> & {\n variants: PolymorphicOperationVariant<TMainSchema>[];\n};\n\n/**\n * Keys the polymorphic factory derives PER VARIANT — the only things a shared config cannot supply.\n * Everything else is shared, and is now inherited structurally (see {@link PolymorphicResourceConfig}).\n */\ntype PolymorphicPerVariantKeys =\n | 'mainSchema' // derived per variant from the declaration\n | 'resourceIdentifier' // derived per variant\n | 'resourceFieldIdentifier' // derived per variant\n | 'resourceRelationships' // provided at factory call time by the registry\n | 'operationsConfiguration';// replaced by the polymorphicRole-aware shape below\n\n/**\n * Shared resource configuration for polymorphic resources — everything common across all variants.\n *\n * ⚠️ DERIVED FROM `ResourceConfiguration_BuilderParameters`, deliberately. This used to be a\n * hand-maintained whitelist of forwarded fields, and it silently DROPPED every resource-level\n * capability axis added after it was written (`isAnonymizable`, `transpositionPolicy`,\n * `retentionPolicy`). The failure mode was invisible: a polymorphic resource could ASK for a\n * capability and simply not get it — no type error, no runtime error, the opt-in just evaporated.\n * Because the type is now an `Omit` of the real parameter surface and the values are spread through,\n * ANY capability added to the builder parameters is automatically available to polymorphic resources\n * and forwarded — there is no list left to forget.\n *\n * Per-variant keys are omitted (see {@link PolymorphicPerVariantKeys}); `operationsConfiguration` is\n * re-declared with the `polymorphicRole`-aware variant shape.\n *\n * NOTE ON SEMANTICS: a capability declared here applies to EVERY generated variant (that is the point\n * — e.g. all billing scopes retain identically). A capability that is invalid for one variant's scope\n * fails loud in that variant's factory call, which is the correct outcome; per-variant capability\n * overrides are intentionally NOT modelled (no consumer needs them, and they would reintroduce the\n * \"which variant actually got it?\" ambiguity this contract removes).\n */\nexport type PolymorphicResourceConfig<\n TCustomOperationEnum extends EnumLikeType | undefined = undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,\n TMainSchema extends z.ZodTypeAny = z.ZodAny,\n> = Omit<\n ResourceConfiguration_BuilderParameters<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n PolymorphicPerVariantKeys\n> & {\n /** Operations configuration — supports `polymorphicRole` on variants. */\n operationsConfiguration: Record<string, PolymorphicOperationConfig<TMainSchema>>;\n};\n\n// =============================================================================\n// MAIN FUNCTION\n// =============================================================================\n\n/**\n * Create N resource configuration factories from a polymorphic declaration.\n *\n * For each variant in the declaration, produces a standard\n * `ResourceConfiguration_InitializationFactory` that can be registered in the factory map.\n *\n * The key transformation: `polymorphicRole` on operation variants is resolved to\n * standard `roles` for each variant's parent resource type.\n *\n * @returns Record mapping variant resource type → factory function\n *\n * @example\n * ```typescript\n * const billingAccountFactories = createPolymorphicResourceConfigurations(\n * billingAccountsPolymorphicDeclaration,\n * {\n * coreOperations: [CoreResourceOperation.READ, CoreResourceOperation.LIST, ...],\n * operationsConfiguration: {\n * [CoreResourceOperation.READ]: {\n * variants: [{\n * variantType: ResourceOperationVariantType.API_CALL,\n * isDefault: true,\n * polymorphicRole: {\n * 'organizations': [CORE_ORG_ROLES.ORG_OWNER],\n * 'users': [CORE_APP_ROLES.APP_USER], // never [] — empty is fail-closed (403)\n * },\n * riskLevel: ResourceOperationRiskLevel.LOW,\n * }],\n * },\n * },\n * },\n * );\n * // → {\n * // 'organizationBillingAccounts': (rels) => ResourceConfiguration,\n * // 'userBillingAccounts': (rels) => ResourceConfiguration,\n * // }\n * ```\n */\nexport function createPolymorphicResourceConfigurations<\n TCustomOperationEnum extends EnumLikeType | undefined = undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,\n TMainSchema extends z.ZodTypeAny = z.ZodAny,\n>(\n declaration: PolymorphicSchemaDeclaration<TMainSchema>,\n sharedConfig: PolymorphicResourceConfig<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n): Record<string, ResourceConfiguration_InitializationFactory<TCustomOperationEnum, TCoreOperationEnum, any>> {\n const result: Record<string, ResourceConfiguration_InitializationFactory<TCustomOperationEnum, TCoreOperationEnum, any>> = {};\n\n for (const [, variant] of declaration.variants) {\n const resolvedOpsConfig = resolveOperationsForVariant(\n sharedConfig.operationsConfiguration,\n variant,\n );\n\n // Determine the schema for this variant:\n // - If SchemaFamily, use the rebuilt union\n // - If plain ZodObject, use the variant schema directly\n const variantMainSchema = variant.schema;\n\n // Determine inheritenceSchemaDefinition:\n // - If SchemaFamily, use the rebuilt family's inheritenceSchemaDefinition\n // - Otherwise, use the shared config's (if any)\n const inheritenceSchemaDefinition = variant.schemaFamily\n ? variant.schemaFamily.inheritenceSchemaDefinition as any\n : sharedConfig.inheritenceSchemaDefinition;\n\n // Lazy factory: relationships are provided at registry call time, not at declaration time.\n // SPREAD the shared config rather than re-listing its fields: that is what makes every current\n // AND FUTURE resource-level capability (retentionPolicy, isAnonymizable, transpositionPolicy, …)\n // reach the generated variants automatically. Re-listing is how those three were silently lost.\n // Only the genuinely per-variant keys are overridden below.\n result[variant.resourceType] = (resourcesRelationships) =>\n createResourceConfiguration_Initialization({\n ...(sharedConfig as any),\n mainSchema: variantMainSchema,\n resourceIdentifier: variant.resourceType as ResourceType,\n resourceFieldIdentifier: variant.fieldIdentifier,\n resourceRelationships: resourcesRelationships,\n // A variant carrying its own SchemaFamily overrides the shared definition.\n inheritenceSchemaDefinition,\n operationsConfiguration: resolvedOpsConfig as any,\n });\n }\n\n return result;\n}\n\n// =============================================================================\n// INTERNALS\n// =============================================================================\n\n/**\n * Resolve `polymorphicRole` → `roles` for each operation variant for a specific scope variant.\n */\nfunction resolveOperationsForVariant<TMainSchema extends z.ZodTypeAny>(\n operationsConfiguration: Record<string, PolymorphicOperationConfig<TMainSchema>>,\n variant: PolymorphicResolvedVariant<TMainSchema>,\n): Record<string, ResourceConfiguration_Operation_BuilderParameters<TMainSchema>> {\n const resolved: Record<string, ResourceConfiguration_Operation_BuilderParameters<TMainSchema>> = {};\n\n for (const [operationKey, opConfig] of Object.entries(operationsConfiguration)) {\n const resolvedVariants: ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema>[] = [];\n\n for (const opVariant of opConfig.variants) {\n const { polymorphicRole, roles: fallbackRoles, polymorphicCustomResponseDto, ...rest } = opVariant;\n if (polymorphicCustomResponseDto && (rest as { customResponseDto?: unknown }).customResponseDto !== undefined) {\n throw new Error(\n `[PolymorphicFactory] Operation \"${operationKey}\" variant declares both customResponseDto and polymorphicCustomResponseDto. ` +\n 'Declare one: the per-variant form when the response must carry the variant schema\\'s own fields.'\n );\n }\n\n let resolvedRoles: string[];\n\n if (polymorphicRole) {\n // Resolve from polymorphicRole map using the parent resource type\n const parentType = variant.parentResourceType as string;\n if (parentType in polymorphicRole) {\n resolvedRoles = polymorphicRole[parentType]!;\n } else if (fallbackRoles) {\n resolvedRoles = fallbackRoles;\n } else {\n throw new Error(\n `[PolymorphicFactory] Operation \"${operationKey}\" variant has polymorphicRole but no entry ` +\n `for parentResourceType=\"${parentType}\" and no fallback roles. ` +\n `Either add \"${parentType}\" to polymorphicRole or provide fallback roles.`\n );\n }\n } else if (fallbackRoles) {\n resolvedRoles = fallbackRoles;\n } else {\n throw new Error(\n `[PolymorphicFactory] Operation \"${operationKey}\" variant has neither polymorphicRole nor roles.`\n );\n }\n\n resolvedVariants.push({\n ...rest,\n roles: resolvedRoles,\n ...(polymorphicCustomResponseDto ? { customResponseDto: polymorphicCustomResponseDto(variant.schema) } : {}),\n } as ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema>);\n }\n\n resolved[operationKey] = {\n ...opConfig,\n variants: resolvedVariants,\n };\n }\n\n return resolved;\n}\n"]}
1
+ {"version":3,"file":"resource-polymorphism.factory.js","sourceRoot":"","sources":["../../../../../src/resources/utils/resource-polymorphism.factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,0CAA0C,EAAE,MAAM,oCAAoC,CAAC;AAqIhG,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,UAAU,uCAAuC,CAKrD,WAAsD,EACtD,YAA8F;IAE9F,MAAM,MAAM,GAA+G,EAAE,CAAC;IAE9H,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC/C,MAAM,iBAAiB,GAAG,2BAA2B,CACnD,YAAY,CAAC,uBAAuB,EACpC,OAAO,CACR,CAAC;QAEF,yCAAyC;QACzC,2CAA2C;QAC3C,wDAAwD;QACxD,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;QAEzC,yCAAyC;QACzC,0EAA0E;QAC1E,gDAAgD;QAChD,MAAM,2BAA2B,GAAG,OAAO,CAAC,YAAY;YACtD,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,2BAAkC;YACzD,CAAC,CAAC,YAAY,CAAC,2BAA2B,CAAC;QAE7C,2FAA2F;QAC3F,+FAA+F;QAC/F,iGAAiG;QACjG,gGAAgG;QAChG,4DAA4D;QAC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,IAAI,aAAa,EAAE,CAAC;oBACzB,aAAa,GAAG,aAAa,CAAC;gBAChC,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CACb,mCAAmC,YAAY,6CAA6C;wBAC5F,2BAA2B,UAAU,2BAA2B;wBAChE,eAAe,UAAU,iDAAiD,CAC3E,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,IAAI,aAAa,EAAE,CAAC;gBACzB,aAAa,GAAG,aAAa,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,mCAAmC,YAAY,kDAAkD,CAClG,CAAC;YACJ,CAAC;YAED,gBAAgB,CAAC,IAAI,CAAC;gBACpB,GAAG,IAAI;gBACP,KAAK,EAAE,aAAa;gBACpB,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,4BAA4B,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACpC,CAAC,CAAC;QAC9E,CAAC;QAED,QAAQ,CAAC,YAAY,CAAC,GAAG;YACvB,GAAG,QAAQ;YACX,QAAQ,EAAE,gBAAgB;SAC3B,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["/**\n * Resource Polymorphism — Factory Configuration (Phase 3)\n *\n * Provides `createPolymorphicResourceConfigurations()` which takes a polymorphic\n * declaration + shared resource configuration, and produces N factory functions\n * (one per variant) that can be spread into the resource configurations factory map.\n *\n * Key transformation: `polymorphicRole` on operation variants is resolved to\n * standard `roles` for each variant's scope.\n *\n * @see polymorphic-scope-approach-A-expansion.md — Phase 3\n */\n\nimport { z } from 'zod';\nimport { createResourceConfiguration_Initialization } from '../resources-config.shared.factory';\nimport type {\n ResourceConfiguration_BuilderParameters,\n ResourceConfiguration_InitializationFactory,\n ResourceConfiguration_Operation_BuilderParameters,\n ResourceConfiguration_OperationVariant_BuilderParameters,\n CollectionViewFields_Search,\n} from '../resources-config.shared.schemas';\nimport type { ResourceType, CoreResourceOperation } from '../resources.shared.core.definitions';\nimport type { EnumLikeType } from '@wildo-ai/zod-decorators';\nimport type { PolymorphicSchemaDeclaration, PolymorphicResolvedVariant } from './resource-polymorphism.schemas';\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/**\n * Distributive Omit — preserves union members individually.\n * Standard `Omit<A | B, K>` collapses to common keys only, losing per-member properties.\n * This helper distributes the Omit over each union member, preserving all variant-specific fields.\n */\ntype DistributiveOmit<T, K extends PropertyKey> = T extends any ? Omit<T, K> : never;\n\n/**\n * Operation variant with `polymorphicRole` support.\n * Extends the standard variant by adding `polymorphicRole` as an alternative to `roles`.\n *\n * - `polymorphicRole`: `Record<ResourceType, string[]>` — role mapping per parent resource type.\n * The factory resolves this to standard `roles` for each generated variant.\n * - `roles`: standard roles array — used directly (e.g., for admin variants).\n *\n * If both `polymorphicRole` and `roles` are provided, `polymorphicRole` takes precedence\n * for the matching parent resource type. If the parent isn't in `polymorphicRole`, `roles` is used as fallback.\n */\n/**\n * Polymorphic variant type. Intersects with CollectionViewFields_Search so that\n * SEARCH operation variants (including REPOSITORY_ONLY) can specify isSearchable,\n * searchableFields, filterFields, sortFields, etc. All fields are optional.\n */\nexport type PolymorphicOperationVariant<TMainSchema extends z.ZodTypeAny = z.ZodTypeAny> =\n DistributiveOmit<ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema>, 'roles'> &\n CollectionViewFields_Search & {\n /**\n * Role mapping per parent resource type.\n * The factory resolves this into standard `roles` for each generated variant.\n *\n * ⚠️ An EMPTY array is NOT \"skip the role check\" — it is fail-CLOSED. The\n * authorization gate evaluates `operationRoles.some(...)`, and `[].some()`\n * is always `false`, so an empty array denies EVERY caller (403). For the\n * user-self scope, list the baseline authenticated role (`APP_USER`); role\n * membership is the floor, while row ownership is enforced separately by the\n * USER_SELF scope authorizer.\n *\n * @example\n * polymorphicRole: {\n * 'organizations': ['ORG_OWNER', 'ORG_ADMIN'],\n * 'users': ['APP_USER'], // user-self: any authenticated user (ownership checked by scope)\n * }\n */\n polymorphicRole?: Record<string, string[]>;\n /** Standard roles — used directly or as fallback when polymorphicRole doesn't have the parent */\n roles?: string[];\n /**\n * A response DTO built from EACH variant's own main schema, for a response that must carry that variant's\n * fields — above all its scope foreign key (`organizationId` on the organization variant, `applicationId`\n * on the application variant), which only the variant schema has. A static `customResponseDto` built from\n * the shared base schema silently drops it (#1596 review N4).\n *\n * Resolved per variant into `customResponseDto`; declaring both is refused, since only one can win.\n *\n * @example\n * polymorphicCustomResponseDto: (variantSchema) => z.object({\n * data: z.array((variantSchema as z.ZodObject<z.ZodRawShape>).omit({ rawBody: true })),\n * pagination: createPaginationResponseMetadataSchema(DEFAULT_LIST_PAGE_CEILING),\n * }),\n */\n polymorphicCustomResponseDto?: (variantMainSchema: TMainSchema) => z.ZodTypeAny;\n };\n\n/**\n * Operation configuration with polymorphic role support.\n */\nexport type PolymorphicOperationConfig<TMainSchema extends z.ZodTypeAny = z.ZodAny> = Omit<\n ResourceConfiguration_Operation_BuilderParameters<TMainSchema>,\n 'variants'\n> & {\n variants: PolymorphicOperationVariant<TMainSchema>[];\n};\n\n/**\n * Keys the polymorphic factory derives PER VARIANT — the only things a shared config cannot supply.\n * Everything else is shared, and is now inherited structurally (see {@link PolymorphicResourceConfig}).\n */\ntype PolymorphicPerVariantKeys =\n | 'mainSchema' // derived per variant from the declaration\n | 'resourceIdentifier' // derived per variant\n | 'resourceFieldIdentifier' // derived per variant\n | 'resourceRelationships' // provided at factory call time by the registry\n | 'operationsConfiguration';// replaced by the polymorphicRole-aware shape below\n\n/**\n * Shared resource configuration for polymorphic resources — everything common across all variants.\n *\n * ⚠️ DERIVED FROM `ResourceConfiguration_BuilderParameters`, deliberately. This used to be a\n * hand-maintained whitelist of forwarded fields, and it silently DROPPED every resource-level\n * capability axis added after it was written (`isAnonymizable`, `transpositionPolicy`,\n * `retentionPolicy`). The failure mode was invisible: a polymorphic resource could ASK for a\n * capability and simply not get it — no type error, no runtime error, the opt-in just evaporated.\n * Because the type is now an `Omit` of the real parameter surface and the values are spread through,\n * ANY capability added to the builder parameters is automatically available to polymorphic resources\n * and forwarded — there is no list left to forget.\n *\n * Per-variant keys are omitted (see {@link PolymorphicPerVariantKeys}); `operationsConfiguration` is\n * re-declared with the `polymorphicRole`-aware variant shape.\n *\n * NOTE ON SEMANTICS: a capability declared here applies to EVERY generated variant (that is the point\n * — e.g. all billing scopes retain identically). A capability that is invalid for one variant's scope\n * fails loud in that variant's factory call, which is the correct outcome; per-variant capability\n * overrides are intentionally NOT modelled (no consumer needs them, and they would reintroduce the\n * \"which variant actually got it?\" ambiguity this contract removes).\n */\nexport type PolymorphicResourceConfig<\n TCustomOperationEnum extends EnumLikeType | undefined = undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,\n TMainSchema extends z.ZodTypeAny = z.ZodAny,\n> = Omit<\n ResourceConfiguration_BuilderParameters<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n PolymorphicPerVariantKeys\n> & {\n /** Operations configuration — supports `polymorphicRole` on variants. */\n operationsConfiguration: Record<string, PolymorphicOperationConfig<TMainSchema>>;\n};\n\n// =============================================================================\n// MAIN FUNCTION\n// =============================================================================\n\n/**\n * Create N resource configuration factories from a polymorphic declaration.\n *\n * For each variant in the declaration, produces a standard\n * `ResourceConfiguration_InitializationFactory` that can be registered in the factory map.\n *\n * The key transformation: `polymorphicRole` on operation variants is resolved to\n * standard `roles` for each variant's parent resource type.\n *\n * @returns Record mapping variant resource type → factory function\n *\n * @example\n * ```typescript\n * const billingAccountFactories = createPolymorphicResourceConfigurations(\n * billingAccountsPolymorphicDeclaration,\n * {\n * coreOperations: [CoreResourceOperation.READ, CoreResourceOperation.LIST, ...],\n * operationsConfiguration: {\n * [CoreResourceOperation.READ]: {\n * variants: [{\n * variantType: ResourceOperationVariantType.API_CALL,\n * isDefault: true,\n * polymorphicRole: {\n * 'organizations': [CORE_ORG_ROLES.ORG_OWNER],\n * 'users': [CORE_APP_ROLES.APP_USER], // never [] — empty is fail-closed (403)\n * },\n * riskLevel: ResourceOperationRiskLevel.LOW,\n * }],\n * },\n * },\n * },\n * );\n * // → {\n * // 'organizationBillingAccounts': (rels) => ResourceConfiguration,\n * // 'userBillingAccounts': (rels) => ResourceConfiguration,\n * // }\n * ```\n */\nexport function createPolymorphicResourceConfigurations<\n TCustomOperationEnum extends EnumLikeType | undefined = undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,\n TMainSchema extends z.ZodTypeAny = z.ZodAny,\n>(\n declaration: PolymorphicSchemaDeclaration<TMainSchema>,\n sharedConfig: PolymorphicResourceConfig<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n): Record<string, ResourceConfiguration_InitializationFactory<TCustomOperationEnum, TCoreOperationEnum, any>> {\n const result: Record<string, ResourceConfiguration_InitializationFactory<TCustomOperationEnum, TCoreOperationEnum, any>> = {};\n\n for (const [, variant] of declaration.variants) {\n const resolvedOpsConfig = resolveOperationsForVariant(\n sharedConfig.operationsConfiguration,\n variant,\n );\n\n // Determine the schema for this variant:\n // - If SchemaFamily, use the rebuilt union\n // - If plain ZodObject, use the variant schema directly\n const variantMainSchema = variant.schema;\n\n // Determine inheritenceSchemaDefinition:\n // - If SchemaFamily, use the rebuilt family's inheritenceSchemaDefinition\n // - Otherwise, use the shared config's (if any)\n const inheritenceSchemaDefinition = variant.schemaFamily\n ? variant.schemaFamily.inheritenceSchemaDefinition as any\n : sharedConfig.inheritenceSchemaDefinition;\n\n // Lazy factory: relationships are provided at registry call time, not at declaration time.\n // SPREAD the shared config rather than re-listing its fields: that is what makes every current\n // AND FUTURE resource-level capability (retentionPolicy, isAnonymizable, transpositionPolicy, …)\n // reach the generated variants automatically. Re-listing is how those three were silently lost.\n // Only the genuinely per-variant keys are overridden below.\n result[variant.resourceType] = (resourcesRelationships) =>\n createResourceConfiguration_Initialization({\n ...(sharedConfig as any),\n mainSchema: variantMainSchema,\n resourceIdentifier: variant.resourceType as ResourceType,\n resourceFieldIdentifier: variant.fieldIdentifier,\n resourceRelationships: resourcesRelationships,\n // A variant carrying its own SchemaFamily overrides the shared definition.\n inheritenceSchemaDefinition,\n operationsConfiguration: resolvedOpsConfig as any,\n });\n }\n\n return result;\n}\n\n// =============================================================================\n// INTERNALS\n// =============================================================================\n\n/**\n * Resolve `polymorphicRole` → `roles` for each operation variant for a specific scope variant.\n */\nfunction resolveOperationsForVariant<TMainSchema extends z.ZodTypeAny>(\n operationsConfiguration: Record<string, PolymorphicOperationConfig<TMainSchema>>,\n variant: PolymorphicResolvedVariant<TMainSchema>,\n): Record<string, ResourceConfiguration_Operation_BuilderParameters<TMainSchema>> {\n const resolved: Record<string, ResourceConfiguration_Operation_BuilderParameters<TMainSchema>> = {};\n\n for (const [operationKey, opConfig] of Object.entries(operationsConfiguration)) {\n const resolvedVariants: ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema>[] = [];\n\n for (const opVariant of opConfig.variants) {\n const { polymorphicRole, roles: fallbackRoles, polymorphicCustomResponseDto, ...rest } = opVariant;\n if (polymorphicCustomResponseDto && (rest as { customResponseDto?: unknown }).customResponseDto !== undefined) {\n throw new Error(\n `[PolymorphicFactory] Operation \"${operationKey}\" variant declares both customResponseDto and polymorphicCustomResponseDto. ` +\n 'Declare one: the per-variant form when the response must carry the variant schema\\'s own fields.'\n );\n }\n\n let resolvedRoles: string[];\n\n if (polymorphicRole) {\n // Resolve from polymorphicRole map using the parent resource type\n const parentType = variant.parentResourceType as string;\n if (parentType in polymorphicRole) {\n resolvedRoles = polymorphicRole[parentType]!;\n } else if (fallbackRoles) {\n resolvedRoles = fallbackRoles;\n } else {\n throw new Error(\n `[PolymorphicFactory] Operation \"${operationKey}\" variant has polymorphicRole but no entry ` +\n `for parentResourceType=\"${parentType}\" and no fallback roles. ` +\n `Either add \"${parentType}\" to polymorphicRole or provide fallback roles.`\n );\n }\n } else if (fallbackRoles) {\n resolvedRoles = fallbackRoles;\n } else {\n throw new Error(\n `[PolymorphicFactory] Operation \"${operationKey}\" variant has neither polymorphicRole nor roles.`\n );\n }\n\n resolvedVariants.push({\n ...rest,\n roles: resolvedRoles,\n ...(polymorphicCustomResponseDto ? { customResponseDto: polymorphicCustomResponseDto(variant.schema) } : {}),\n } as ResourceConfiguration_OperationVariant_BuilderParameters<TMainSchema>);\n }\n\n resolved[operationKey] = {\n ...opConfig,\n variants: resolvedVariants,\n };\n }\n\n return resolved;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resource-polymorphism.relationships.d.ts","sourceRoot":"","sources":["../../../../src/resources/utils/resource-polymorphism.relationships.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,KAAK,+BAA+B,EACrC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACnH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAMpF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,8BAA8B;IAC7C,2CAA2C;IAC3C,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C,kEAAkE;IAClE,MAAM,EAAE,kBAAkB,CAAC;IAC3B,+DAA+D;IAC/D,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,qCAAqC;IACrC,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,qFAAqF;IACrF,aAAa,CAAC,EAAE,iCAAiC,CAAC;IAClD,kFAAkF;IAClF,SAAS,CAAC,EAAE,+BAA+B,CAAC;IAC5C,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,4BAA4B,EACzC,OAAO,EAAE;IACP,yEAAyE;IACzE,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,gDAAgD;IAChD,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C,kEAAkE;IAClE,MAAM,EAAE,kBAAkB,CAAC;IAC3B,gDAAgD;IAChD,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,0FAA0F;IAC1F,gBAAgB,CAAC,EAAE,+BAA+B,CAAC;CACpD,GACA,oBAAoB,EAAE,CAyBxB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,8BAA8B,CAC5C,iBAAiB,EAAE,4BAA4B,EAC/C,sBAAsB,EAAE,4BAA4B,GAAG,YAAY,EACnE,iBAAiB,EAAE,+BAA+B,EAClD,gBAAgB,EAAE,+BAA+B,EACjD,OAAO,EAAE,8BAA8B,GACtC,oBAAoB,EAAE,CA8CxB"}
1
+ {"version":3,"file":"resource-polymorphism.relationships.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/resource-polymorphism.relationships.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,KAAK,+BAA+B,EACrC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACnH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,C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