@wildo-ai/saas-models 1.1.5 → 1.1.6

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 (888) hide show
  1. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
  2. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js +2 -1
  3. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
  4. package/dist/esm/applications/applications-context.schemas.d.ts +176 -2
  5. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  7. package/dist/esm/applications/applications.shared.resources-config.schemas.js +3 -2
  8. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  9. package/dist/esm/applications/applications.shared.schemas.d.ts +7 -5
  10. package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
  11. package/dist/esm/applications/applications.shared.schemas.js +6 -4
  12. package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
  13. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +10 -1
  14. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  15. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +49 -15
  16. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  17. package/dist/esm/billing/billing-account.shared.schemas.js +2 -2
  18. package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
  19. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts +25 -0
  20. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  21. package/dist/esm/billing/billing-configuration.shared.schemas.js +19 -0
  22. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  23. package/dist/esm/billing/billing-enums.shared.schemas.d.ts +27 -5
  24. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  25. package/dist/esm/billing/billing-enums.shared.schemas.js +30 -4
  26. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  27. package/dist/esm/billing/billing-types.shared.schemas.d.ts +37 -11
  28. package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
  29. package/dist/esm/billing/billing-types.shared.schemas.js +31 -19
  30. package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
  31. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +2 -0
  32. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  33. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js +18 -7
  34. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
  35. package/dist/esm/billing/credit-pool.shared.schemas.d.ts +2 -0
  36. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  37. package/dist/esm/billing/credit-pool.shared.schemas.js +7 -1
  38. package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
  39. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js +6 -6
  40. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
  41. package/dist/esm/billing/invoice-ref.shared.schemas.js +1 -1
  42. package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
  43. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  44. package/dist/esm/billing/price.shared.schemas.js +5 -3
  45. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  46. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts +11 -1
  47. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  48. package/dist/esm/billing/product-behavior-policy.shared.schemas.js +39 -23
  49. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  50. package/dist/esm/billing/product-definition.shared.schemas.d.ts +30 -2
  51. package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
  52. package/dist/esm/billing/product-definition.shared.schemas.js +35 -0
  53. package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
  54. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +6 -3
  55. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
  56. package/dist/esm/billing/product.shared.schemas.d.ts +7 -3
  57. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  58. package/dist/esm/billing/product.shared.schemas.js +22 -7
  59. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  60. package/dist/esm/billing/promotions.shared.resources-config.schemas.js +8 -8
  61. package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
  62. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts +135 -0
  63. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -0
  64. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js +112 -0
  65. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -0
  66. package/dist/esm/billing/public-pricing-catalog.shared.d.ts +30 -0
  67. package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -0
  68. package/dist/esm/billing/public-pricing-catalog.shared.js +53 -0
  69. package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -0
  70. package/dist/esm/billing/referral-reward.shared.schemas.d.ts +51 -0
  71. package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -0
  72. package/dist/esm/billing/referral-reward.shared.schemas.js +92 -0
  73. package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -0
  74. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts +54 -33
  75. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
  76. package/dist/esm/billing/referral.shared.resources-config.schemas.js +56 -2
  77. package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
  78. package/dist/esm/billing/referral.shared.schemas.d.ts +22 -37
  79. package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
  80. package/dist/esm/billing/referral.shared.schemas.js +24 -44
  81. package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
  82. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +9 -1
  83. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  84. package/dist/esm/billing/subscription.shared.resources-config.schemas.js +55 -22
  85. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  86. package/dist/esm/billing/subscription.shared.schemas.d.ts +80 -5
  87. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  88. package/dist/esm/billing/subscription.shared.schemas.js +85 -25
  89. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  90. package/dist/esm/billing/usage-record.shared.schemas.js +5 -5
  91. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  92. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +143 -2
  93. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  94. package/dist/esm/companion/provider-discovery.shared.schemas.js +84 -1
  95. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  96. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +14 -1
  97. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  98. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +4 -0
  99. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
  100. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts +70 -0
  101. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts.map +1 -1
  102. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js +87 -0
  103. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js.map +1 -1
  104. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts +34 -0
  105. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
  106. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js +137 -3
  107. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -1
  108. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts +7 -0
  109. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
  110. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.js.map +1 -1
  111. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts +28 -2
  112. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  113. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +29 -8
  114. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
  115. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +29 -6
  116. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  117. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +38 -9
  118. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  119. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +1822 -146
  120. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  121. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +1777 -87
  122. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  123. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts +10 -0
  124. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  125. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +148 -7
  126. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  127. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts +2 -0
  128. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
  129. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js +2 -0
  130. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
  131. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts +0 -8
  132. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts.map +0 -1
  133. package/dist/esm/compliance/privacy/data-retention.shared.schemas.js.map +0 -1
  134. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts +17 -8
  135. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -1
  136. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js +43 -20
  137. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
  138. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +38 -0
  139. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  140. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +39 -0
  141. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
  142. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts +35 -0
  143. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -0
  144. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js +82 -0
  145. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -0
  146. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts +37 -0
  147. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -0
  148. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js +223 -0
  149. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -0
  150. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts +222 -0
  151. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -0
  152. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js +331 -0
  153. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -0
  154. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +37 -3
  155. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  156. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +33 -4
  157. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  158. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts +52 -0
  159. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -0
  160. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js +116 -0
  161. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -0
  162. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts +11 -0
  163. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -0
  164. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js +11 -0
  165. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -0
  166. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts +93 -0
  167. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -0
  168. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js +149 -0
  169. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -0
  170. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts +43 -0
  171. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -0
  172. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js +106 -0
  173. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -0
  174. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts +209 -0
  175. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -0
  176. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js +226 -0
  177. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -0
  178. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts +129 -5
  179. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
  180. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js +128 -4
  181. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js.map +1 -1
  182. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts +53 -0
  183. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -0
  184. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js +74 -0
  185. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -0
  186. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts +311 -0
  187. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -0
  188. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js +355 -0
  189. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -0
  190. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts +178 -39
  191. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
  192. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js +145 -35
  193. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
  194. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
  195. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js +26 -0
  196. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js.map +1 -1
  197. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts +9 -0
  198. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  199. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  200. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +109 -1
  201. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  202. package/dist/esm/config/app-configuration-shared.shared.schemas.js +57 -0
  203. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  204. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +69 -0
  205. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  206. package/dist/esm/config/entity-identity-config.shared.schemas.js +93 -0
  207. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  208. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +16 -16
  209. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +160 -61
  210. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  211. package/dist/esm/config/frontend/navigation.shared.schemas.js +297 -65
  212. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  213. package/dist/esm/errors/caught-error-description.shared.utils.d.ts +69 -0
  214. package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -0
  215. package/dist/esm/errors/caught-error-description.shared.utils.js +77 -0
  216. package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -0
  217. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +76 -3
  218. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  219. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +76 -2
  220. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  221. package/dist/esm/errors/errors.shared.schemas.d.ts +20 -1
  222. package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
  223. package/dist/esm/errors/errors.shared.schemas.js +16 -9
  224. package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
  225. package/dist/esm/errors/errors.shared.utils.d.ts +0 -24
  226. package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
  227. package/dist/esm/errors/errors.shared.utils.js +0 -39
  228. package/dist/esm/errors/errors.shared.utils.js.map +1 -1
  229. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts +6 -7
  230. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
  231. package/dist/esm/errors/thrown-value-description.shared.utils.js +6 -7
  232. package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
  233. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts +70 -0
  234. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -0
  235. package/dist/esm/external-data/external-data-pipeline-description.shared.js +92 -0
  236. package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -0
  237. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts +154 -0
  238. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -0
  239. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js +161 -0
  240. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -0
  241. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +1071 -23
  242. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  243. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js +1065 -17
  244. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  245. package/dist/esm/external-data/external-data-provenance.shared.d.ts +71 -0
  246. package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -0
  247. package/dist/esm/external-data/external-data-provenance.shared.js +88 -0
  248. package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -0
  249. package/dist/esm/external-data.exports.d.ts +5 -0
  250. package/dist/esm/external-data.exports.d.ts.map +1 -1
  251. package/dist/esm/external-data.exports.js +11 -0
  252. package/dist/esm/external-data.exports.js.map +1 -1
  253. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +17 -2
  254. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  255. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +22 -4
  256. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  257. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  258. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +3 -0
  259. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  260. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -1
  261. package/dist/esm/external-providers/engine-capability-surface.shared.js +2 -0
  262. package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
  263. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +152 -1
  264. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  265. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +4 -3
  266. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
  267. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +4 -3
  268. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
  269. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts +45 -0
  270. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
  271. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js +14 -0
  272. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
  273. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +188 -4
  274. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  275. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js +76 -9
  276. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  277. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts +175 -33
  278. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
  279. package/dist/esm/external-providers/frontend-provider-public-config.shared.js +247 -42
  280. package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
  281. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts +53 -0
  282. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -0
  283. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js +41 -0
  284. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -0
  285. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts +150 -0
  286. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -0
  287. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js +22 -0
  288. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -0
  289. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts +42 -0
  290. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -0
  291. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js +49 -0
  292. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -0
  293. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts +53 -0
  294. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -1
  295. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js +56 -0
  296. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -1
  297. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +34 -0
  298. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  299. package/dist/esm/external-providers/provider-capability.shared.schemas.js +34 -0
  300. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  301. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts +341 -4
  302. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  303. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js +270 -20
  304. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  305. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts +6 -2
  306. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
  307. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js +6 -2
  308. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
  309. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +174 -1
  310. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
  311. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +125 -0
  312. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
  313. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +3 -3
  314. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts +42 -0
  315. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -0
  316. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js +57 -0
  317. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -0
  318. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts +6 -0
  319. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  320. package/dist/esm/external-providers/provider-protocol.shared.schemas.js +6 -0
  321. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  322. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts +58 -0
  323. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -0
  324. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js +35 -0
  325. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -0
  326. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts +115 -0
  327. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -0
  328. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js +137 -0
  329. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -0
  330. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts +73 -0
  331. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -0
  332. package/dist/esm/external-providers/provider-usage-cost.shared.js +171 -0
  333. package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -0
  334. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts +12 -0
  335. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -0
  336. package/dist/esm/external-providers/provider-usage-pricing.example.js +40 -0
  337. package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -0
  338. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts +68 -32
  339. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
  340. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js +63 -52
  341. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js.map +1 -1
  342. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts +5 -5
  343. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
  344. package/dist/esm/features/application-features.shared.resources-config.schemas.js +13 -5
  345. package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
  346. package/dist/esm/features/connected-feature.example.d.ts.map +1 -1
  347. package/dist/esm/features/connected-feature.example.js +2 -1
  348. package/dist/esm/features/connected-feature.example.js.map +1 -1
  349. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  350. package/dist/esm/features/core-feature-definitions.shared.js +2 -1
  351. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  352. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  353. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  354. package/dist/esm/features/feature-definition.shared.schemas.d.ts +2 -11
  355. package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
  356. package/dist/esm/features/feature-definition.shared.schemas.js +0 -12
  357. package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
  358. package/dist/esm/features/scope-features.shared.schemas.d.ts +31 -17
  359. package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
  360. package/dist/esm/features/scope-features.shared.schemas.js +27 -5
  361. package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
  362. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +5 -5
  363. package/dist/esm/flows-actors/actors.shared.schemas.d.ts +127 -11
  364. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  365. package/dist/esm/flows-actors/actors.shared.schemas.js +32 -1
  366. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  367. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts +16 -0
  368. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
  369. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js +7 -0
  370. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js.map +1 -1
  371. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts +68 -0
  372. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -0
  373. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js +276 -0
  374. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -0
  375. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts +468 -0
  376. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -0
  377. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js +472 -0
  378. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -0
  379. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts +118 -0
  380. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -0
  381. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js +144 -0
  382. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -0
  383. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +142 -8
  384. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  385. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +209 -11
  386. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  387. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +37 -2
  388. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  389. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js +30 -2
  390. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  391. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts +0 -11
  392. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
  393. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js +12 -5
  394. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
  395. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts +45 -6
  396. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
  397. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js +31 -5
  398. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
  399. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js +30 -30
  400. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  401. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts +15 -7
  402. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  403. package/dist/esm/flows-actors/flows.shared.schemas.d.ts +15 -0
  404. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  405. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts +506 -0
  406. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
  407. package/dist/esm/flows-actors/human-decision.shared.schemas.js +502 -0
  408. package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
  409. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts +46 -0
  410. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -0
  411. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js +65 -0
  412. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -0
  413. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts +120 -0
  414. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -0
  415. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js +165 -0
  416. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -0
  417. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts +45 -0
  418. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -0
  419. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js +127 -0
  420. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -0
  421. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts +83 -0
  422. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -0
  423. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js +97 -0
  424. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -0
  425. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts +136 -0
  426. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -0
  427. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js +90 -0
  428. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -0
  429. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts +5 -1
  430. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -1
  431. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js +19 -4
  432. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -1
  433. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts +13 -15
  434. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -1
  435. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js +30 -17
  436. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -1
  437. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts +268 -0
  438. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -0
  439. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js +576 -0
  440. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -0
  441. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts +30 -0
  442. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
  443. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts +129 -0
  444. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -0
  445. package/dist/esm/flows-actors/work-attribution.shared.schemas.js +141 -0
  446. package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -0
  447. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts +22 -1
  448. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts.map +1 -1
  449. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js +23 -0
  450. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js.map +1 -1
  451. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts +61 -0
  452. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
  453. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js +61 -0
  454. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
  455. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  456. package/dist/esm/guidance/guidance-state.shared.schemas.js +11 -10
  457. package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
  458. package/dist/esm/guidance/lifecycle-state.shared.schemas.js +6 -6
  459. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  460. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  461. package/dist/esm/guidance/progression-state.shared.schemas.js +8 -7
  462. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  463. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js +1 -1
  464. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
  465. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +550 -30
  466. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  467. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +498 -34
  468. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  469. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts +62 -0
  470. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -0
  471. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js +66 -0
  472. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -0
  473. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts +133 -0
  474. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -0
  475. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js +191 -0
  476. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -0
  477. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts +37 -6
  478. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -1
  479. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js +37 -6
  480. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
  481. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts +36 -0
  482. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -0
  483. package/dist/esm/i18n/application-config-vocabulary.shared.js +39 -0
  484. package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -0
  485. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts +11 -0
  486. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -0
  487. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js +14 -0
  488. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -0
  489. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts +20 -0
  490. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -0
  491. package/dist/esm/i18n/engine-open-vocabulary.shared.js +21 -0
  492. package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -0
  493. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts +94 -0
  494. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -0
  495. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js +206 -0
  496. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -0
  497. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts +169 -0
  498. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -0
  499. package/dist/esm/inbound/conversation-threads.shared.schemas.js +231 -0
  500. package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -0
  501. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts +195 -0
  502. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -0
  503. package/dist/esm/inbound/inbound-channels.shared.schemas.js +244 -0
  504. package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -0
  505. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts +36 -0
  506. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -0
  507. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js +169 -0
  508. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -0
  509. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts +404 -0
  510. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -0
  511. package/dist/esm/inbound/inbound-delivery.shared.schemas.js +449 -0
  512. package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -0
  513. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts +46 -0
  514. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -0
  515. package/dist/esm/inbound/inbound-endpoint-env.shared.js +57 -0
  516. package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -0
  517. package/dist/esm/index.d.ts +58 -1
  518. package/dist/esm/index.d.ts.map +1 -1
  519. package/dist/esm/index.js +67 -1
  520. package/dist/esm/index.js.map +1 -1
  521. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts +28 -0
  522. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -1
  523. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js +29 -0
  524. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  525. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +95 -1
  526. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
  527. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +121 -0
  528. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
  529. package/dist/esm/meta-workflows.exports.d.ts +0 -1
  530. package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
  531. package/dist/esm/meta-workflows.exports.js +0 -1
  532. package/dist/esm/meta-workflows.exports.js.map +1 -1
  533. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +7 -1
  534. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  535. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js +35 -0
  536. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  537. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts +131 -0
  538. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -0
  539. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js +258 -0
  540. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -0
  541. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts +448 -0
  542. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -0
  543. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js +530 -0
  544. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -0
  545. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  546. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js +4 -3
  547. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
  548. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts +16 -1
  549. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  550. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +46 -16
  551. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  552. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts +19 -12
  553. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  554. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js +77 -12
  555. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  556. package/dist/esm/notifications/notification-badges.schemas.d.ts +35 -3
  557. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  558. package/dist/esm/notifications/notification-badges.schemas.js +43 -3
  559. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  560. package/dist/esm/notifications/notifications.shared.schemas.d.ts +66 -399
  561. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  562. package/dist/esm/notifications/notifications.shared.schemas.js +111 -58
  563. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  564. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts +5 -5
  565. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js +6 -6
  566. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
  567. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +3 -0
  568. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  569. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +60 -14
  570. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  571. package/dist/esm/organizations/organization-members.shared.schemas.d.ts +3 -0
  572. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  573. package/dist/esm/organizations/organization-members.shared.schemas.js +30 -0
  574. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  575. package/dist/esm/organizations/organization-notifications.shared.schemas.js +9 -9
  576. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  577. package/dist/esm/organizations/organization-preferences.shared.schemas.js +4 -4
  578. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  579. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts +0 -1
  580. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
  581. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +5 -5
  582. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  583. package/dist/esm/organizations/organization-profile.shared.schemas.js +15 -10
  584. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  585. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js +1 -1
  586. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map +1 -1
  587. package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
  588. package/dist/esm/organizations/organization-unit-members.shared.schemas.js +2 -1
  589. package/dist/esm/organizations/organization-unit-members.shared.schemas.js.map +1 -1
  590. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts +63 -1
  591. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
  592. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js +106 -5
  593. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js.map +1 -1
  594. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  595. package/dist/esm/organizations/organization-unit-narrowing.shared.js +9 -0
  596. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  597. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
  598. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js +7 -2
  599. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
  600. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts +3 -1
  601. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  602. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +12 -8
  603. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  604. package/dist/esm/organizations/organizations.shared.schemas.d.ts +7 -2
  605. package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
  606. package/dist/esm/organizations/organizations.shared.schemas.js +51 -1
  607. package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
  608. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts +58 -0
  609. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -0
  610. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js +188 -0
  611. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -0
  612. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts +122 -0
  613. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -0
  614. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js +136 -0
  615. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -0
  616. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts +36 -0
  617. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -0
  618. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js +155 -0
  619. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -0
  620. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts +229 -0
  621. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -0
  622. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js +290 -0
  623. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -0
  624. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts +48 -0
  625. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -0
  626. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js +50 -0
  627. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -0
  628. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts +97 -0
  629. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -0
  630. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js +572 -0
  631. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -0
  632. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts +590 -0
  633. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -0
  634. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js +869 -0
  635. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -0
  636. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts +36 -6
  637. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
  638. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js +57 -16
  639. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
  640. package/dist/esm/provider-registration-runtime.exports.d.ts +0 -1
  641. package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
  642. package/dist/esm/provider-registration-runtime.exports.js +0 -1
  643. package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
  644. package/dist/esm/public-runtime/index.d.ts +30 -11
  645. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  646. package/dist/esm/public-runtime/index.js +30 -11
  647. package/dist/esm/public-runtime/index.js.map +1 -1
  648. package/dist/esm/queue/jobs.shared.schemas.d.ts +36 -8
  649. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  650. package/dist/esm/queue/jobs.shared.schemas.js +12 -0
  651. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  652. package/dist/esm/requests/header-keys.shared.d.ts +6 -0
  653. package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
  654. package/dist/esm/requests/header-keys.shared.js +7 -0
  655. package/dist/esm/requests/header-keys.shared.js.map +1 -1
  656. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
  657. package/dist/esm/requests/manual-controllers-routes-documentation.js +147 -8
  658. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
  659. package/dist/esm/requests/manual-controllers-routes-urls.d.ts +51 -23
  660. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  661. package/dist/esm/requests/manual-controllers-routes-urls.js +64 -0
  662. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  663. package/dist/esm/requests/websocket.shared.schemas.d.ts +78 -13
  664. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  665. package/dist/esm/requests/websocket.shared.schemas.js +91 -18
  666. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  667. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts +21 -0
  668. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -0
  669. package/dist/esm/resources/embedded-resource-mark.shared.utils.js +22 -0
  670. package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -0
  671. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  672. package/dist/esm/resources/resources-config.shared.factory.js +812 -32
  673. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  674. package/dist/esm/resources/resources-config.shared.schemas.d.ts +244 -48
  675. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  676. package/dist/esm/resources/resources-config.shared.schemas.js +151 -17
  677. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  678. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  679. package/dist/esm/resources/resources-registry.shared.core.definitions.js +353 -12
  680. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  681. package/dist/esm/resources/resources.shared.core.definitions.d.ts +45 -0
  682. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  683. package/dist/esm/resources/resources.shared.core.definitions.js +92 -0
  684. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  685. package/dist/esm/resources/resources.shared.schemas.d.ts +2 -17
  686. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  687. package/dist/esm/resources/resources.shared.schemas.js +24 -20
  688. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  689. package/dist/esm/resources/resources.shared.utils.d.ts +16 -8
  690. package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
  691. package/dist/esm/resources/resources.shared.utils.js +16 -8
  692. package/dist/esm/resources/resources.shared.utils.js.map +1 -1
  693. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts +2 -2
  694. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
  695. package/dist/esm/resources/utils/collection-export.shared.utils.js +4 -2
  696. package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
  697. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts +103 -0
  698. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -0
  699. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js +275 -0
  700. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -0
  701. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts +51 -0
  702. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -0
  703. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js +28 -0
  704. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -0
  705. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -1
  706. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js +30 -19
  707. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
  708. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts +2 -0
  709. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -0
  710. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js +33 -0
  711. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -0
  712. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts +15 -0
  713. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
  714. package/dist/esm/resources/utils/resource-polymorphism.factory.js +6 -1
  715. package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
  716. package/dist/esm/resources/utils/resource-polymorphism.schemas.js +30 -4
  717. package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
  718. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +46 -0
  719. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  720. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +205 -22
  721. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  722. package/dist/esm/resources/utils/resources-serialization.utils.d.ts +19 -2
  723. package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
  724. package/dist/esm/resources/utils/resources-serialization.utils.js +4 -0
  725. package/dist/esm/resources/utils/resources-serialization.utils.js.map +1 -1
  726. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  727. package/dist/esm/resources/utils/shared-persistence-collection.utils.js +15 -9
  728. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  729. package/dist/esm/resources/work-unit.shared.schemas.d.ts +20 -0
  730. package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -0
  731. package/dist/esm/resources/work-unit.shared.schemas.js +19 -0
  732. package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -0
  733. package/dist/esm/runtime/execution-context.shared.schemas.d.ts +48 -1
  734. package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
  735. package/dist/esm/runtime/execution-context.shared.schemas.js +101 -9
  736. package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
  737. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts +1 -0
  738. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  739. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +37 -20
  740. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  741. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts +1 -0
  742. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  743. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +61 -48
  744. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  745. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts +26 -0
  746. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
  747. package/dist/esm/security/api-keys/api-keys.shared.schemas.js +39 -5
  748. package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
  749. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +5 -3
  750. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  751. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +6 -0
  752. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  753. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js +2 -2
  754. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
  755. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts +11 -0
  756. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
  757. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js +19 -8
  758. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
  759. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +1 -1
  760. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +5 -5
  761. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  762. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js +11 -11
  763. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
  764. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts +2 -0
  765. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
  766. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js +9 -0
  767. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js.map +1 -1
  768. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts +169 -0
  769. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -0
  770. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js +162 -0
  771. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -0
  772. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
  773. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js +10 -8
  774. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
  775. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js +8 -8
  776. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
  777. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  778. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js +17 -16
  779. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  780. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  781. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js +28 -25
  782. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  783. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts +17 -6
  784. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
  785. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js +90 -38
  786. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
  787. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +0 -24
  788. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  789. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js +79 -68
  790. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  791. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts +8 -1
  792. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
  793. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js +7 -0
  794. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
  795. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js +1 -1
  796. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
  797. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +7 -7
  798. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  799. package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
  800. package/dist/esm/security/authorizations/roles.shared.defaults.js +56 -0
  801. package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
  802. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +77 -1
  803. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  804. package/dist/esm/security/authorizations/roles.shared.schemas.js +90 -0
  805. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  806. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts +86 -0
  807. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -0
  808. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js +40 -0
  809. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -0
  810. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +2 -1
  811. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
  812. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js +2 -1
  813. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
  814. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +2 -1
  815. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
  816. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +2 -1
  817. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
  818. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +46 -14
  819. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
  820. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +81 -21
  821. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
  822. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts +69 -0
  823. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -0
  824. package/dist/esm/security/credential-rotation-grace.shared.utils.js +77 -0
  825. package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -0
  826. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  827. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js +28 -8
  828. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  829. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts +3 -1
  830. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  831. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js +89 -14
  832. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  833. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts +1 -0
  834. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  835. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +25 -4
  836. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  837. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts +7 -1
  838. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -1
  839. package/dist/esm/security/outbound-target-control.shared.schemas.js +6 -0
  840. package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
  841. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts +143 -0
  842. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -0
  843. package/dist/esm/security/submission-challenge/submission-challenge.shared.js +123 -0
  844. package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -0
  845. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts +384 -0
  846. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -0
  847. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js +327 -0
  848. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -0
  849. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts +121 -8
  850. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -1
  851. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js +83 -4
  852. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -1
  853. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts +266 -8
  854. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -1
  855. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js +291 -7
  856. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -1
  857. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts +313 -3
  858. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -1
  859. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js +369 -3
  860. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -1
  861. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -1
  862. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js +2 -1
  863. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
  864. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts +5 -3
  865. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
  866. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js +19 -10
  867. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
  868. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  869. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +6 -0
  870. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  871. package/dist/esm/users/user-preferences-reset.shared.utils.js +2 -2
  872. package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
  873. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +0 -3
  874. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  875. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +0 -3
  876. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  877. package/dist/esm/users/user-self.shared.resources-config.schemas.js +1 -1
  878. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  879. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  880. package/dist/esm/users/users.shared.resources-config.schemas.js +82 -20
  881. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  882. package/dist/esm/users/users.shared.schemas.d.ts +12 -9
  883. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  884. package/dist/esm/users/users.shared.schemas.js +49 -18
  885. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  886. package/package.json +4 -4
  887. package/dist/esm/compliance/privacy/data-retention.shared.schemas.js +0 -7
  888. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -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,UAkB1C,CAAC;AAqBH;;;;;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"}
@@ -38,29 +38,38 @@ export const POPULATED_MULTIPLE_FILES_KEY = 'files';
38
38
  * than stripped — this is server-produced data, never a request.
39
39
  */
40
40
  export const PopulatedFileMetadataSchema = z.looseObject({
41
- readiness: z.enum(FileReadiness),
42
- fileId: z.string().min(1),
43
- filename: z.string(),
44
- size: z.number(),
45
- mimeType: z.string(),
46
- extension: z.string().optional(),
47
- checksum: z.string().optional(),
48
- url: z.string().optional(),
49
- thumbnailUrl: z.string().optional(),
50
- nature: z.enum(FileDisplayNature).optional(),
51
- width: z.number().optional(),
52
- height: z.number().optional(),
53
- duration: z.number().optional(),
54
- pageCount: z.number().optional(),
55
- uploadedAt: z.coerce.date(),
56
- uploadedBy: z.string().optional(),
57
- uploadedByEntityType: z.enum(FileUploaderEntityType).optional(),
58
- });
41
+ 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."),
42
+ fileId: z.string().min(1).describe("The file's identifier."),
43
+ filename: z.string().describe("The file's original name."),
44
+ size: z.number().describe("The file's size in bytes."),
45
+ mimeType: z.string().describe("The file's media type."),
46
+ extension: z.string().optional().describe("The file's extension, without the dot."),
47
+ checksum: z.string().optional().describe("A checksum of the file's content."),
48
+ url: z.string().optional().describe("Where the file can be downloaded."),
49
+ thumbnailUrl: z.string().optional().describe("Where a thumbnail of an image or video can be fetched."),
50
+ nature: z.enum(FileDisplayNature).optional().describe("What kind of file it is, for display: image, video, audio, document or generic."),
51
+ width: z.number().optional().describe("An image's width in pixels."),
52
+ height: z.number().optional().describe("An image's height in pixels."),
53
+ duration: z.number().optional().describe("An audio or video file's length in seconds."),
54
+ pageCount: z.number().optional().describe("A document's number of pages."),
55
+ uploadedAt: z.coerce.date().describe("When the file was uploaded."),
56
+ uploadedBy: z.string().optional().describe("The identifier of whoever uploaded the file."),
57
+ 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."),
58
+ }).describe("The file's details, included when the read populates files.");
59
59
  function carrySchemaMetadata(source, rebuilt) {
60
60
  const metadata = source[SCHEMA_METADATA];
61
61
  if (metadata !== undefined) {
62
62
  rebuilt[SCHEMA_METADATA] = metadata;
63
63
  }
64
+ // Zod's own registry too (`.describe()` / `.meta()`, #1625): `.extend()` clones without the parent link
65
+ // a clone inherits it through, so a widened file field would otherwise publish undescribed. Not `id`,
66
+ // which names one schema.
67
+ const registered = z.globalRegistry.get(source);
68
+ if (registered !== undefined && !z.globalRegistry.has(rebuilt)) {
69
+ const { id: _id, ...carried } = registered;
70
+ if (Object.keys(carried).length > 0)
71
+ z.globalRegistry.add(rebuilt, carried);
72
+ }
64
73
  return rebuilt;
65
74
  }
66
75
  /** A `z_file()` leaf (the reference object, metadata attached) widened with its optional populated companion. */
@@ -72,7 +81,9 @@ function widenFileLeaf(leaf) {
72
81
  const companionKey = fileMetadata.multiple ? POPULATED_MULTIPLE_FILES_KEY : POPULATED_SINGLE_FILE_KEY;
73
82
  if (companionKey in shape)
74
83
  return leaf; // already widened (a DTO derived from a widened DTO)
75
- const companion = fileMetadata.multiple ? z.array(PopulatedFileMetadataSchema).optional() : PopulatedFileMetadataSchema.optional();
84
+ const companion = fileMetadata.multiple
85
+ ? z.array(PopulatedFileMetadataSchema).optional().describe("Each file's details, included when the read populates files.")
86
+ : PopulatedFileMetadataSchema.optional();
76
87
  return carrySchemaMetadata(leaf, leaf.extend({ [companionKey]: companion }));
77
88
  }
78
89
  export function widenFileFieldsForPopulatedReads(schema, activeSchemas = new WeakSet()) {
@@ -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,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,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AAC;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),\n fileId: z.string().min(1),\n filename: z.string(),\n size: z.number(),\n mimeType: z.string(),\n extension: z.string().optional(),\n checksum: z.string().optional(),\n url: z.string().optional(),\n thumbnailUrl: z.string().optional(),\n nature: z.enum(FileDisplayNature).optional(),\n width: z.number().optional(),\n height: z.number().optional(),\n duration: z.number().optional(),\n pageCount: z.number().optional(),\n uploadedAt: z.coerce.date(),\n uploadedBy: z.string().optional(),\n uploadedByEntityType: z.enum(FileUploaderEntityType).optional(),\n});\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 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 ? z.array(PopulatedFileMetadataSchema).optional() : 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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AM,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"]}
@@ -0,0 +1,2 @@
1
+ export declare function requestSchemaCarriesField(schema: unknown, fieldName: string, depth?: number): boolean;
2
+ //# sourceMappingURL=request-schema-field-carriage.shared.utils.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Whether a request schema can carry `fieldName` as a row field — through wrappers (repeatedly),
3
+ * unions and discriminated unions (any branch), intersections (either side: a bulk DTO over a non-plain
4
+ * row is `selector.and(row)`), and the bulk envelope `{ data: row[] }` of CREATE_MANY. Only the `data`
5
+ * member is followed into an array, so a custom request with an unrelated array of objects is not read as
6
+ * rows. Used by the closure-clock ownership check (#1613), which must see every shape a client route accepts.
7
+ */
8
+ const BULK_REQUEST_ROWS_KEY = 'data';
9
+ export function requestSchemaCarriesField(schema, fieldName, depth = 0) {
10
+ if (!schema || typeof schema !== 'object' || depth > 12)
11
+ return false;
12
+ const def = schema._zod?.def ?? schema._def;
13
+ if (!def)
14
+ return false;
15
+ if (def.shape && typeof def.shape === 'object') {
16
+ if (Object.prototype.hasOwnProperty.call(def.shape, fieldName))
17
+ return true;
18
+ const rows = def.shape[BULK_REQUEST_ROWS_KEY];
19
+ return rows !== undefined && requestSchemaCarriesField(rows, fieldName, depth + 1);
20
+ }
21
+ if (Array.isArray(def.options))
22
+ return def.options.some((option) => requestSchemaCarriesField(option, fieldName, depth + 1));
23
+ if (def.left || def.right)
24
+ return requestSchemaCarriesField(def.left, fieldName, depth + 1) || requestSchemaCarriesField(def.right, fieldName, depth + 1);
25
+ if (def.element)
26
+ return requestSchemaCarriesField(def.element, fieldName, depth + 1);
27
+ if (def.innerType)
28
+ return requestSchemaCarriesField(def.innerType, fieldName, depth + 1);
29
+ if (def.in)
30
+ return requestSchemaCarriesField(def.in, fieldName, depth + 1);
31
+ return false;
32
+ }
33
+ //# sourceMappingURL=request-schema-field-carriage.shared.utils.js.map
@@ -0,0 +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,KAAK,CAAC;IACtE,MAAM,GAAG,GAAI,MAAc,CAAC,IAAI,EAAE,GAAG,IAAK,MAAc,CAAC,IAAI,CAAC;IAC9D,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,GAAG,CAAC,KAAK,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/C,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5E,MAAM,IAAI,GAAI,GAAG,CAAC,KAAiC,CAAC,qBAAqB,CAAC,CAAC;QAC3E,OAAO,IAAI,KAAK,SAAS,IAAI,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IACrF,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAe,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IACtI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK;QAAE,OAAO,yBAAyB,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,CAAC,IAAI,yBAAyB,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAC1J,IAAI,GAAG,CAAC,OAAO;QAAE,OAAO,yBAAyB,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;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"]}
@@ -58,6 +58,21 @@ export type PolymorphicOperationVariant<TMainSchema extends z.ZodTypeAny = z.Zod
58
58
  polymorphicRole?: Record<string, string[]>;
59
59
  /** Standard roles — used directly or as fallback when polymorphicRole doesn't have the parent */
60
60
  roles?: string[];
61
+ /**
62
+ * A response DTO built from EACH variant's own main schema, for a response that must carry that variant's
63
+ * fields — above all its scope foreign key (`organizationId` on the organization variant, `applicationId`
64
+ * on the application variant), which only the variant schema has. A static `customResponseDto` built from
65
+ * the shared base schema silently drops it (#1596 review N4).
66
+ *
67
+ * Resolved per variant into `customResponseDto`; declaring both is refused, since only one can win.
68
+ *
69
+ * @example
70
+ * polymorphicCustomResponseDto: (variantSchema) => z.object({
71
+ * data: z.array((variantSchema as z.ZodObject<z.ZodRawShape>).omit({ rawBody: true })),
72
+ * pagination: createPaginationResponseMetadataSchema(DEFAULT_LIST_PAGE_CEILING),
73
+ * }),
74
+ */
75
+ polymorphicCustomResponseDto?: (variantMainSchema: TMainSchema) => z.ZodTypeAny;
61
76
  };
62
77
  /**
63
78
  * Operation configuration with polymorphic role support.
@@ -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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AY,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,IACzC,IAAI,CACN,uCAAuC,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAC9F,yBAAyB,CAC1B,GAAG;IACF,yEAAyE;IACzE,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC,CAAC;CAClF,CAAC;AAMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,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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AqB,CAAC,GAAG,SAAS,GAAG,SAAS,EACjF,WAAW,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,MAAM,IACzC,IAAI,CACN,uCAAuC,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAC9F,yBAAyB,CAC1B,GAAG;IACF,yEAAyE;IACzE,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC,CAAC;CAClF,CAAC;AAMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,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"}
@@ -95,7 +95,11 @@ function resolveOperationsForVariant(operationsConfiguration, variant) {
95
95
  for (const [operationKey, opConfig] of Object.entries(operationsConfiguration)) {
96
96
  const resolvedVariants = [];
97
97
  for (const opVariant of opConfig.variants) {
98
- const { polymorphicRole, roles: fallbackRoles, ...rest } = opVariant;
98
+ const { polymorphicRole, roles: fallbackRoles, polymorphicCustomResponseDto, ...rest } = opVariant;
99
+ if (polymorphicCustomResponseDto && rest.customResponseDto !== undefined) {
100
+ throw new Error(`[PolymorphicFactory] Operation "${operationKey}" variant declares both customResponseDto and polymorphicCustomResponseDto. ` +
101
+ 'Declare one: the per-variant form when the response must carry the variant schema\'s own fields.');
102
+ }
99
103
  let resolvedRoles;
100
104
  if (polymorphicRole) {
101
105
  // Resolve from polymorphicRole map using the parent resource type
@@ -121,6 +125,7 @@ function resolveOperationsForVariant(operationsConfiguration, variant) {
121
125
  resolvedVariants.push({
122
126
  ...rest,
123
127
  roles: resolvedRoles,
128
+ ...(polymorphicCustomResponseDto ? { customResponseDto: polymorphicCustomResponseDto(variant.schema) } : {}),
124
129
  });
125
130
  }
126
131
  resolved[operationKey] = {
@@ -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;AAsHhG,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;QAC5D,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,sBAAsB,EAAE,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Aa,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;aACoD,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\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, ...rest } = opVariant;\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 } 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,YAA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,OAAO,CAAC,kBAA4B,CAAC;gBACxD,IAAI,UAAU,IAAI,eAAe,EAAE,CAAC;oBAClC,aAAa,GAAG,eAAe,CAAC,UAAU,CAAE,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"]}
@@ -495,6 +495,19 @@ function cloneFieldForBusinessKeyDecoration(value) {
495
495
  * forcing the change to either (a) propagate the outer metadata explicitly
496
496
  * or (b) document why it's safe to drop.
497
497
  *
498
+ * **The one outer decorator that IS propagated: `.businessKeySet([...])`**
499
+ * (#1596). A many-rows-per-scope polymorphic resource whose identity is a
500
+ * COMPOSITE of base fields — the inbound-delivery ledger's
501
+ * `(sourceKey, dedupKey)` — declares it on the base object, and each variant
502
+ * is its own table, so each variant must carry the compound unique index.
503
+ * Dropping it would leave the dedup ledger with no index at all, which is the
504
+ * exact silent loss this guard exists to stop; refusing it would leave a
505
+ * polymorphic resource no way to declare a composite identity. So the set is
506
+ * re-applied to the fresh wrapper, after checking every named field still
507
+ * exists on the post-injection, post-rename shape (a renamed field would
508
+ * otherwise produce an index over a column that does not exist). Every OTHER
509
+ * outer key still fails loud, for the reason above.
510
+ *
498
511
  * @param schema The post-injection, post-rename variant ZodObject.
499
512
  * @param fieldNames Field names (post-rename) to mark with `.isBusinessKey()`.
500
513
  * @param baseResourceType For error context (the polymorphic base name).
@@ -509,18 +522,31 @@ function applyBusinessKeyMarkers(schema, fieldNames, baseResourceType, parentRes
509
522
  // because no current call site needs it; instead we fail loud so the next
510
523
  // caller that DOES need it has to make a deliberate design decision.
511
524
  const outerMetadata = getFieldMetadata(schema);
512
- if (outerMetadata && Object.keys(outerMetadata).length > 0) {
525
+ const propagatedBusinessKeySet = outerMetadata?.[ZodDecorator.OBJECT_BUSINESS_KEY_SET];
526
+ const unpropagatedOuterKeys = Object.keys(outerMetadata ?? {}).filter((key) => key !== ZodDecorator.OBJECT_BUSINESS_KEY_SET);
527
+ if (unpropagatedOuterKeys.length > 0) {
513
528
  throw new Error(`[PolymorphicSchemas] baseResourceType="${baseResourceType}" parentResourceType="${parentResourceType}": ` +
514
529
  `applyBusinessKeyMarkers received a ZodObject with outer-level metadata ` +
515
- `(keys: [${Object.keys(outerMetadata).join(', ')}]). The function rebuilds ` +
530
+ `(keys: [${unpropagatedOuterKeys.join(', ')}]). The function rebuilds ` +
516
531
  `the wrapper via z.object(...), which would silently drop those entries. ` +
517
532
  `Either remove the outer metadata before calling, or extend this helper ` +
518
533
  `to propagate it (and add a regression test). See JSDoc "Outer-level ` +
519
534
  `metadata contract" for the full rationale.`);
520
535
  }
521
536
  const shape = getZodObjectShape(schema);
537
+ if (propagatedBusinessKeySet) {
538
+ const missingKeyFields = propagatedBusinessKeySet.fields.filter((field) => !Object.prototype.hasOwnProperty.call(shape, field));
539
+ if (missingKeyFields.length > 0) {
540
+ throw new Error(`[PolymorphicSchemas] baseResourceType="${baseResourceType}" parentResourceType="${parentResourceType}": ` +
541
+ `the base object's businessKeySet names field(s) absent from the post-injection variant shape: ` +
542
+ `[${missingKeyFields.join(', ')}]. A renamed field cannot carry a compound unique index under its old name.`);
543
+ }
544
+ }
545
+ const withPropagatedBusinessKeySet = (rebuilt) => propagatedBusinessKeySet
546
+ ? addDecorators(rebuilt, [{ ref: ZodDecorator.OBJECT_BUSINESS_KEY_SET, params: { ...propagatedBusinessKeySet } }])
547
+ : rebuilt;
522
548
  if (fieldNames.length === 0) {
523
- return z.object({ ...shape });
549
+ return withPropagatedBusinessKeySet(z.object({ ...shape }));
524
550
  }
525
551
  for (const fieldName of fieldNames) {
526
552
  if (!Object.prototype.hasOwnProperty.call(shape, fieldName)) {
@@ -560,6 +586,6 @@ function applyBusinessKeyMarkers(schema, fieldNames, baseResourceType, parentRes
560
586
  ? addDecorators(cloneFieldForBusinessKeyDecoration(value), businessKeyDecorators)
561
587
  : value;
562
588
  }
563
- return z.object(newShape);
589
+ return withPropagatedBusinessKeySet(z.object(newShape));
564
590
  }
565
591
  //# sourceMappingURL=resource-polymorphism.schemas.js.map