@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":"resources-config-operations.dtos-builder.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/resources-config-operations.dtos-builder.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAgB,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,EAA0J,oBAAoB,EAAE,gCAAgC,EAAE,QAAQ,EAAE,qBAAqB,EAA8C,sCAAsC,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,+BAA+B,EAA4B,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAC5iB,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,oCAAoC,EACpC,yBAAyB,EACzB,6BAA6B,EAC7B,+BAA+B,EAE/B,wCAAwC,EACxC,oCAAoC,EACrC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAOlE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EAEZ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AC","sourcesContent":["import { z } from 'zod';\nimport { ResourceType, CoreResourceOperation } from '../resources.shared.core.definitions';\nimport { ResourceConfiguration_ResourceRelationships, ResourceConfiguration_InheritanceSchemaDefinition, ResourceConfiguration_Operation, ResourceConfiguration, wrapRequestDtoAsBulk, resolveBulkOperationMaxSelection, DataMode, OPERATION_VARIANT_KEY, Resources_PaginationResponseMetadataSchema, createPaginationResponseMetadataSchema, DEFAULT_LIST_PAGE_CEILING, DEFAULT_SEARCH_PAGE_CEILING, getChildDirectionRelationships, getParentDirectionRelationships, AnyResourceConfiguration, ResourceGeneratedOperationKind } from '../resources-config.shared.schemas';\nimport {\n ResourceRelationshipCardinality,\n isOneToOneCardinality,\n isArrayCardinality,\n getDefaultResponseSchemaForOperation,\n isOutputEnvelopeOperation,\n operationShouldHaveRequestDto,\n DefaultBulkDeleteResponseSchema,\n ResourceRelationship,\n CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS,\n createOrUpdateMandatoryDiscardFields\n} from '../resources.shared.schemas';\nimport { Resources_SharedUtils } from '../resources.shared.utils';\nimport {\n ChildNestedReadConfig_Parsed,\n ChildNestedMutationConfig_Parsed,\n ChildNestedReadConfig,\n ChildNestedMutationConfig\n} from '../child-operations.shared.schemas';\nimport {\n addDiscriminator,\n getCustomFieldMetadata,\n ZodDecorator,\n EnumLikeType,\n getZodType,\n hasZodType,\n isZodObject,\n isZodArray,\n isZodOptional,\n isZodNullable,\n isZodDefault,\n toPatchOptionalField,\n getZodObjectShape,\n getZodDefSchemaProperty,\n getZodDefArrayProperty,\n getZodDefStringProperty,\n getZodDefProperty,\n isZodTypeAny,\n getEnumValues,\n isExcludedFromCreate,\n isExcludedFromUpdate,\n isVirtualField,\n isTemplatableFileField,\n isPrimaryKey,\n isBackendOnlyField,\n getBackendOnlyParams,\n isWriteOnlySecretField,\n isDiscriminatorField,\n unwrapSchema,\n getMergedObjectOrUnionShape,\n withArrayElement,\n markPatchRequestDtoObject,\n SCHEMA_METADATA\n} from '@wildo-ai/zod-decorators';\nimport {\n ContextPolicy_ObjectMode,\n DEFAULT_RELATIONSHIP_CONTEXT_POLICY,\n type RelationshipContextPolicy,\n} from '../context-policy.shared.schemas';\nimport { ResourcesConfigNamingUtils } from './resources-config-naming.utils';\nimport { ResourcesSummaryUtils } from './resources-summary.utils';\nimport { RepositoryDtoBuilderUtils } from './repository-dto-builder.utils';\nimport {\n stripTemplatableFileFieldsRecursively as stripTemplatableFileFieldsSchema,\n} from './templatable-file-fields.shared.utils';\nimport { widenFileFieldsForPopulatedReads } from './populated-file-fields.shared.utils';\n\nimport { describeCaughtError } from '../../errors/errors.shared.utils';\n/**\n * Canonical placeholder shown to clients in place of a `.isWriteOnlySecret()`\n * field's real value. It doubles as the write-back sentinel: when a client\n * echoes this exact string back on CREATE/UPDATE, the framework interprets it as\n * \"keep the existing stored secret\" and strips the field from the write payload\n * (UPDATE is a partial `$set`, so the stored value is preserved). Kept as a\n * single constant so the output mask and the input sentinel never drift.\n */\nexport const WRITE_ONLY_SECRET_MASK = '••••••••';\n\n/**\n * Type guard to check if schema is a ZodAny\n * In Zod v4, any schemas have type: \"any\"\n */\nfunction isZodAny(schema: z.ZodTypeAny): boolean {\n return hasZodType(schema, 'any');\n}\n\nexport class ResourcesConfigOperationsDtosBuilderUtils {\n /**\n * Carry field/schema decorators across a wrapper or leaf rebuild.\n *\n * Network-boundary coercion necessarily replaces Zod instances (`date` becomes\n * `coerce.date`, optional/nullable/default wrappers are rebuilt around transformed\n * children). Decorators such as `isBackendOnly` live on those instances. Losing\n * the metadata before the response-stripping pass turns a backend-only field into\n * an ordinary public field, which is a confidentiality failure rather than a\n * presentation defect.\n */\n private static preserveSchemaMetadata<TSchema extends z.ZodTypeAny>(\n source: z.ZodTypeAny,\n rebuilt: TSchema,\n ): TSchema {\n const sourceMetadata = (source as any)[SCHEMA_METADATA];\n if (sourceMetadata !== undefined) {\n (rebuilt as any)[SCHEMA_METADATA] = sourceMetadata;\n }\n return rebuilt;\n }\n\n static buildSchemaWithInheritance<TMainSchema extends z.ZodTypeAny>(\n mainSchema: TMainSchema,\n inheritanceDefinition: any,\n ): TMainSchema {\n return this.applyInheritanceToSchema(\n mainSchema,\n inheritanceDefinition,\n new Map(),\n );\n }\n\n /**\n * Rebuild an object schema, optionally preserving schema-level checks.\n *\n * DTO derivation frequently needs to rebuild object shapes for omission,\n * backend-only stripping, and date coercion. In Zod 4 those rebuilds would\n * otherwise discard `.refine()` / `.superRefine()` checks. Preserve them when\n * the field set stays semantically equivalent; skip them when fields were\n * omitted because the original cross-field logic may no longer be valid.\n */\n private static rebuildObjectSchema(\n schema: z.ZodObject<any>,\n rebuiltShape: Record<string, z.ZodTypeAny>,\n options?: {\n preserveChecks?: boolean;\n },\n ): z.ZodTypeAny {\n /*\n * Preserve the source object's CATCHALL (fixed 2026-09-01). `z.looseObject` is\n * `catchall(z.unknown())` and `z.strictObject` is `catchall(z.never())`; a bare\n * `z.object(rebuiltShape)` silently rebuilds BOTH as the default strip-unknown object. For a\n * loose schema that strip is a data-loss bug with no error anywhere: every DTO parse quietly\n * deletes the undeclared keys the schema's author explicitly declared passthrough for.\n * Measured live on the creation board's `customResponseDto` (a deliberately loose dispatch\n * outcome): a completed playbook run answered HTTP 200 with a literal `{}` — every field of a\n * rich result stripped, because the outcome's named fields were optional and everything else\n * was passthrough. Applied on the omit path too: removing declared fields does not change what\n * the author said about UNDECLARED ones.\n */\n const sourceCatchall = (schema as unknown as { def?: { catchall?: z.ZodTypeAny } }).def?.catchall;\n let rebuiltSchema: z.ZodTypeAny = sourceCatchall !== undefined\n ? z.object(rebuiltShape).catchall(sourceCatchall)\n : z.object(rebuiltShape);\n if (options?.preserveChecks === false) {\n return rebuiltSchema;\n }\n\n const checks = getZodDefArrayProperty(schema, 'checks') as unknown[] | undefined;\n for (const check of checks ?? []) {\n rebuiltSchema = rebuiltSchema.check(check as never);\n }\n\n // Preserve decorator metadata (`SCHEMA_METADATA`) across shape-equivalent rebuilds.\n //\n // Factory helpers like `z_file()`, `z_money()`, `z_bigdecimal()` and `z_range()`\n // stamp their identity as a symbol-keyed metadata object on the *ZodObject\n // instance* (not on any inner field). A fresh `z.object(rebuiltShape)` is a new\n // instance, so that symbol is lost. When the field SET is unchanged — i.e. the\n // check-preserving path (date coercion, nested inner rebuilds) — the metadata\n // still describes the schema faithfully, so it MUST be carried over.\n //\n // Concretely: `z_file()`'s value is `z.object({ fileId, updatedAt: z.date() })`.\n // DTO date-coercion rewrites the inner `updatedAt` to `z.coerce.date()`, which\n // rebuilds the object here. Without re-attaching `fileConfig`, `getSchemaType()`\n // resolves the field to a plain OBJECT and the automated form renders it as a raw\n // `{ fileId, updatedAt }` composite instead of the file uploader — and\n // `collectUploadableFileFieldPaths()` finds nothing, so no upload endpoints are\n // derived. This was the root cause of avatar/file fields never rendering an\n // uploader (the \"first real file implementation\" gap).\n //\n // The omit path (`preserveChecks: false`, above) intentionally skips this: there\n // the field set changed, so the original field-type identity may no longer hold.\n const sourceMetadata = (schema as any)[SCHEMA_METADATA];\n if (sourceMetadata !== undefined) {\n (rebuiltSchema as any)[SCHEMA_METADATA] = sourceMetadata;\n }\n\n return rebuiltSchema;\n }\n\n /**\n * Omit fields from an object schema while staying compatible with Zod 4\n * refined objects.\n *\n * Zod 4 throws when `.omit()` is used on object schemas that already carry\n * schema-level checks (`.refine()` / `.superRefine()`). DTO derivation must\n * still be able to remove transport-managed fields from those schemas, so we\n * fall back to rebuilding the object shape and reapplying the existing checks.\n */\n private static omitObjectFields(\n schema: z.ZodObject<any>,\n omitObj: Record<string, true>,\n ): z.ZodTypeAny {\n if (Object.keys(omitObj).length === 0) {\n return schema;\n }\n\n try {\n return schema.omit(omitObj);\n } catch (error) {\n if (!(error instanceof Error) || !error.message.includes('containing refinements')) {\n throw error;\n }\n\n const originalShape = getZodObjectShape(schema);\n const rebuiltShape: Record<string, z.ZodTypeAny> = {};\n\n for (const [fieldName, fieldSchema] of Object.entries(originalShape)) {\n if (!omitObj[fieldName]) {\n rebuiltShape[fieldName] = fieldSchema as z.ZodTypeAny;\n }\n }\n\n return this.rebuildObjectSchema(schema, rebuiltShape, {\n preserveChecks: false,\n });\n }\n }\n\n private static stripTemplatableFileFieldsRecursively(schema: z.ZodTypeAny): z.ZodTypeAny {\n return stripTemplatableFileFieldsSchema(schema, {\n rebuildObjectSchema: (objectSchema, strippedShape) => {\n // Checks and decorator metadata survive when the FIELD SET is unchanged — only a nested field\n // was replaced, so the object is still what they describe. This passed `preserveChecks: false`\n // unconditionally, which dropped both on every object above a rewritten field (#989).\n const fieldSetUnchanged = Object.keys(getZodObjectShape(objectSchema)).every((fieldName) => fieldName in strippedShape);\n return this.rebuildObjectSchema(objectSchema, strippedShape, { preserveChecks: fieldSetUnchanged });\n },\n });\n }\n\n /**\n * Run a resource `mainSchema`'s TOP-LEVEL object checks (`.refine()` / `.superRefine()`) against a\n * fully-materialised row (post-enrichment) and return the ZodError, or null when the schema declares\n * no top-level check or all pass.\n *\n * This is the correct enforcement point for a cross-field invariant declared on a resource\n * `mainSchema`. A CREATE REQUEST cannot carry it: the request DTO omits every backend-injected field\n * (`primaryScope`, `organizationId`, `createdAt`, …), so a check referencing one — e.g. a file-scope\n * check keyed on `primaryScope` — would fire against an ABSENT value and reject a valid create. The\n * ENRICHED row (after context injection + literal / user-tracking population) carries every field, so\n * the check validates truthfully: a file-scope check passes on a consistent row, while a check on\n * create-supplied fields (a junction's `source ≠ target`) still rejects a bad row.\n *\n * The checks run in ISOLATION via a passthrough object, so no unrelated shape/coercion validation is\n * re-applied to the already-built row (its dates are `Date`s, its ids may be driver objects — none of\n * which a fresh full-schema parse should re-police here). Works whether `mainSchema` is a plain object\n * or a discriminated-union family — a schema with no top-level check simply returns null.\n */\n static validateTopLevelObjectChecks(mainSchema: z.ZodTypeAny, value: unknown): z.ZodError | null {\n const checks = getZodDefArrayProperty(mainSchema, 'checks') as unknown[] | undefined;\n if (!checks || checks.length === 0) {\n return null;\n }\n let checker: z.ZodTypeAny = z.looseObject({});\n for (const check of checks) {\n checker = (checker as z.ZodObject<any>).check(check as never);\n }\n const result = checker.safeParse(value);\n return result.success ? null : result.error;\n }\n\n /**\n * Rebuild all operation DTOs once the full registry is available.\n *\n * Resource factories only know about their own config at declaration time, so\n * nested child DTOs cannot be fully derived there. Registry startup is the\n * authoritative compilation boundary for operation DTOs.\n */\n static rebuildResourceConfigurationsOperationDtos(\n resourceConfigurations: Record<string, AnyResourceConfiguration>\n ): void {\n const resourceRegistry = new Map<ResourceType, AnyResourceConfiguration>(\n Object.entries(resourceConfigurations) as [ResourceType, AnyResourceConfiguration][]\n );\n\n for (const config of Object.values(resourceConfigurations)) {\n config.operations = config.operations.map((operation) =>\n this.buildAllOperationDtos(operation, config as AnyResourceConfiguration, resourceRegistry)\n );\n }\n }\n\n /**\n * Build all DTO variants for an operation.\n * This is the main entry point called by the factory.\n *\n * @param operation - Operation configuration\n * @param resourceConfig - Full resource configuration (for inheritance reference)\n * @param registry - Resource registry\n * @returns Operation with all DTOs pre-computed and stored\n */\n static buildAllOperationDtos<\n TCustomOperationEnum extends EnumLikeType | undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined,\n TMainSchema extends z.ZodTypeAny\n >(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n resourceConfig: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n registry: Map<ResourceType, any>\n ): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n\n // 1. Apply inheritance to mainSchema (from resourceConfig.inheritenceSchemaDefinition)\n const inheritenceSchemaDefinition = resourceConfig.inheritenceSchemaDefinition;\n const enhancedMainSchema = (inheritenceSchemaDefinition\n ? this.applyInheritanceToSchema(operation.mainSchema, inheritenceSchemaDefinition, new Map())\n : operation.mainSchema) as TMainSchema;\n\n // Determine the effective operation identifier for DTO building\n const effectiveOperation = operation.resourceOperationLike || operation.operationIdentifier;\n\n // IMPORTANT: Temporary DTOs from factory are built from mainSchema WITHOUT inheritance.\n // buildEnhancedRequestDto/buildEnhancedResponseDto check for existing DTOs first and\n // return them if meaningful (line 330, 388), which would skip inheritance application.\n //\n // Strategy: Store original DTOs to detect custom ones, then clear temporary DTOs to force\n // rebuild from enhancedMainSchema (with inheritance). Custom DTOs will be preserved and\n // only have transformations applied (date coercion), while auto-derived DTOs will be\n // rebuilt with inheritance and transformations.\n //\n // Custom DTOs are detected by comparing the rebuilt DTO structure to the original.\n // If they're significantly different, we preserve the original (it's custom).\n // Otherwise, we use the rebuilt one (with inheritance).\n const originalRequestDto = operation.requestDto;\n const originalResponseDto = operation.responseDto;\n\n const operationWithEnhancedSchema = {\n ...operation,\n mainSchema: enhancedMainSchema,\n requestDto: undefined, // Clear to force rebuild with inheritance\n responseDto: undefined // Clear to force rebuild with inheritance\n };\n\n // 2. Build requestDto:\n // - Rebuild from enhancedMainSchema (with inheritance applied)\n // - If original was explicitly provided (custom), preserve it but apply transformations\n // - Otherwise use rebuilt DTO (with inheritance)\n // - Apply network-boundary coercion (dates + money bigints)\n // - Backend-only fields already excluded in buildEnhancedRequestDto\n let requestDto = this.buildEnhancedRequestDto(\n operationWithEnhancedSchema,\n effectiveOperation as string\n );\n\n // Check if original DTO was explicitly provided (custom DTO from variantParams.requestDto).\n const rebuiltRequestInfo = this.analyzeDtoSchema(requestDto);\n const originalRequestInfo = originalRequestDto ? this.analyzeDtoSchema(originalRequestDto) : null;\n\n // Custom-DTO classification is driven by the explicit `hasCustomRequestDto`\n // flag that the resource factory stamps on EVERY operation it builds:\n // • `true` → the variant supplied an explicit `requestDto`; preserve it\n // verbatim (it is a complete, author-owned contract — e.g. a narrow\n // `{ status }` for a CHANGE_STATUS custom operation).\n // • `false` → the requestDto is the factory's auto-derived *temporary*\n // placeholder, built from the base object via `deriveRequestDto` BEFORE\n // inheritance is known. So we MUST use the inheritance-rebuilt DTO —\n // which, for an inheritance resource (discriminated-union mainSchema via\n // `createSchemaFamily`), is the per-variant union. Preserving the bare\n // temporary here is what silently dropped variant-only fields\n // (e.g. todos `recurrence`/`startDate`/`endsDate`) from CREATE/UPDATE\n // request validation: `z.object` strips unknown keys, so a RECURRING\n // payload parsed but lost its extension fields — the request-side twin\n // of the RAW-mode LIST responseDto bug fixed just below.\n // Only when the flag is ABSENT (legacy / hand-authored operations that\n // predate the flag) do we fall back to the structural `analyzeDtoSchema`\n // heuristic — a base object always differs structurally from the rebuilt\n // union, so the heuristic alone cannot tell \"custom\" from \"auto-derived\n // inheritance DTO\".\n const hasExplicitCustomRequestDto = operation.hasCustomRequestDto === true;\n const isExplicitlyAutoDerivedRequestDto = operation.hasCustomRequestDto === false;\n const isCustomRequestDto = hasExplicitCustomRequestDto\n ? (originalRequestDto && !isZodAny(originalRequestDto))\n : isExplicitlyAutoDerivedRequestDto\n ? false\n : (originalRequestDto && originalRequestInfo &&\n originalRequestInfo !== rebuiltRequestInfo &&\n originalRequestInfo !== '📄 {} (empty object)' &&\n !isZodAny(originalRequestDto));\n\n if (isCustomRequestDto && originalRequestDto) {\n // Custom DTO: preserve structure but apply network-boundary coercion (dates + money bigints)\n requestDto = this.applyNetworkBoundaryCoercion(\n this.stripTemplatableFileFieldsRecursively(originalRequestDto)\n );\n } else if (operation.generatedOperation && originalRequestDto && !isZodAny(originalRequestDto)) {\n // Framework-generated operations own their DTO contract. In particular,\n // generated file regeneration is UPDATE-like for authorization and\n // persistence but intentionally accepts an empty request body.\n requestDto = this.applyNetworkBoundaryCoercion(\n this.stripTemplatableFileFieldsRecursively(originalRequestDto)\n );\n } else {\n // Auto-derived DTO: use rebuilt (with inheritance) and apply transformations\n requestDto = this.applyNetworkBoundaryCoercion(requestDto);\n }\n requestDto = this.stripTemplatableFileFieldsRecursively(requestDto);\n\n // 3. Build responseDto first (repositoryDto depends on it)\n // - Rebuild from enhancedMainSchema (with inheritance applied)\n // - If original was custom (significantly different), preserve it but apply transformations\n // - Otherwise use rebuilt DTO (with inheritance)\n // - Strip backend-only fields (except isReturnedAtCreation for CREATE)\n // - Apply network-boundary coercion (dates + money bigints)\n // - Exclude virtual fields (they're computed, not stored)\n let responseDtoInternal = this.buildEnhancedResponseDto(\n operationWithEnhancedSchema,\n effectiveOperation as string\n );\n let responseDto = responseDtoInternal;\n\n // Check if original DTO was explicitly provided (custom DTO from customResponseDto)\n // Custom DTOs are complete schemas that should be preserved as-is, but still need\n // transformations (backend-only stripping, date + money-bigint coercion).\n const hasExplicitCustomResponseDto = operation.hasCustomResponseDto === true;\n const rebuiltResponseInfo = this.analyzeDtoSchema(responseDtoInternal);\n const originalResponseInfo = originalResponseDto ? this.analyzeDtoSchema(originalResponseDto) : null;\n\n // Custom-DTO classification is driven by the explicit `hasCustomResponseDto`\n // flag that the resource factory stamps on EVERY operation it builds:\n // • `true` → the app supplied a `customResponseDto`; preserve it verbatim.\n // • `false` → the DTO is framework auto-derived. The factory only sets a\n // *temporary*, item-level placeholder (documented as \"will be replaced by\n // buildAllOperationDtos\"), so we MUST use the inheritance-rebuilt DTO —\n // which, for LIST/SEARCH, is the `{ data, pagination }` pagination wrapper.\n // Preserving the bare temporary schema here is what broke RAW-mode list\n // responses: `selectResponseDto(op, RAW)` returned the item schema and the\n // controller parsed the `{ data, pagination }` envelope against it (Zod\n // \"No matching discriminator\" for inheritance resources such as todos,\n // missing-field errors for plain ones).\n // Only when the flag is ABSENT (legacy / hand-authored operations that predate\n // the flag) do we fall back to the structural `analyzeDtoSchema` heuristic — an\n // item schema always differs structurally from the rebuilt wrapper, so the\n // heuristic alone cannot tell \"custom\" from \"auto-derived collection DTO\".\n const isExplicitlyAutoDerivedResponseDto = operation.hasCustomResponseDto === false;\n const isCustomResponseDto = hasExplicitCustomResponseDto\n ? (originalResponseDto && !isZodAny(originalResponseDto))\n : isExplicitlyAutoDerivedResponseDto\n ? false\n : (originalResponseDto && originalResponseInfo &&\n originalResponseInfo !== rebuiltResponseInfo &&\n originalResponseInfo !== '📄 {} (empty object)' &&\n !isZodAny(originalResponseDto));\n\n if (isCustomResponseDto && originalResponseDto) {\n // Strip while decorator metadata is still on the source nodes, then apply\n // network coercion to each trust-boundary shape independently. Reversing\n // this order allowed wrapper rebuilds to erase `isBackendOnly` before the\n // confidentiality pass inspected it.\n const isCreateOperation = effectiveOperation === CoreResourceOperation.CREATE ||\n effectiveOperation === CoreResourceOperation.CREATE_MANY;\n responseDtoInternal = this.applyNetworkBoundaryCoercion(originalResponseDto);\n responseDto = this.applyNetworkBoundaryCoercion(this.stripBackendOnlyFields(originalResponseDto, {\n respectIsReturnedAtCreation: isCreateOperation,\n operationType: isCreateOperation ? CoreResourceOperation.CREATE : undefined\n }));\n } else {\n // Auto-derived DTO: use rebuilt (with inheritance) and apply transformations\n // Strip backend-only fields before coercion rebuilds wrappers/leaves.\n const isCreateOperation = effectiveOperation === CoreResourceOperation.CREATE ||\n effectiveOperation === CoreResourceOperation.CREATE_MANY;\n const clientResponseDto = this.stripBackendOnlyFields(responseDtoInternal, {\n respectIsReturnedAtCreation: isCreateOperation,\n operationType: isCreateOperation ? CoreResourceOperation.CREATE : undefined\n });\n responseDtoInternal = this.applyNetworkBoundaryCoercion(responseDtoInternal);\n responseDto = this.applyNetworkBoundaryCoercion(clientResponseDto);\n }\n\n // Note: Virtual fields are already excluded in buildEnhancedResponseDto\n\n // 4. Add nested operations DTOs if configured (child + self relationships)\n const resourceRelationships = operation.resourceRelationships;\n const childDirRels = resourceRelationships ? getChildDirectionRelationships(resourceRelationships) : [];\n if (childDirRels.length > 0) {\n // Build request DTO with nested children for create/update operations,\n // including bulk variants. Runtime bulk orchestration is handled in the\n // services layer by applying the same nested-processing principles per\n // parent result.\n if (effectiveOperation === CoreResourceOperation.CREATE || effectiveOperation === CoreResourceOperation.CREATE_MANY ||\n effectiveOperation === CoreResourceOperation.UPDATE || effectiveOperation === CoreResourceOperation.UPDATE_MANY) {\n requestDto = this.buildRequestDtoWithNested(\n effectiveOperation as CoreResourceOperation,\n requestDto,\n childDirRels,\n registry\n );\n }\n\n // Build response DTO with nested children (for READ)\n if (effectiveOperation === CoreResourceOperation.READ) {\n responseDtoInternal = this.buildResponseDtoWithNested(\n responseDtoInternal,\n childDirRels,\n registry\n );\n responseDto = this.buildResponseDtoWithNested(\n responseDto,\n childDirRels,\n registry\n );\n }\n }\n\n // 5. Build summaryDto (WITH backend-only fields for internal processing):\n // - Extract summary fields (isSummaryField)\n // - If no summary fields defined, fall back to mainSchema (same as RAW)\n // - DO NOT strip backend-only fields yet (needed for repositoryDto)\n // - Handle discriminated unions\n // - Network-boundary coercion (dates + money bigints) is applied ONCE below,\n // after the no-summary-fields fallback resolves, so EVERY summary shape\n // (plain object, discriminated union, AND the full-schema fallback) accepts\n // ISO-string dates AND bigint-as-string money amounts — the same uniform\n // transposition point used for requestDto/responseDto/internalDto.\n let summaryDtoInternal: z.ZodTypeAny = this.extractSummaryFields(enhancedMainSchema);\n\n // If no summary fields are defined, use full schema (same as RAW mode)\n // Check if summaryDtoInternal is empty (z.object({}))\n if (isZodObject(summaryDtoInternal)) {\n const summaryShape = getZodObjectShape(summaryDtoInternal);\n if (Object.keys(summaryShape).length === 0) {\n // No summary fields defined - use full mainSchema as fallback\n // This ensures SUMMARY mode works even without explicit isSummaryField decorators\n summaryDtoInternal = this.excludeVirtualFieldsFromSchema(enhancedMainSchema);\n }\n }\n\n // Apply network-boundary coercion (z.date() → z.coerce.date() AND string-accepting\n // z.bigint() for z_money amounts) over the fully-resolved summary schema — the\n // single, uniform transposition point for the summary DTO, covering the\n // extracted-summary path, the discriminated-union path, and the full-schema\n // fallback alike. Without this, summary responses (which carry ISO-string\n // createdAt/updatedAt and bigint-as-string money totals over JSON) fail frontend\n // response validation with \"expected date, received string\" / \"expected bigint,\n // received string\" (e.g. invoiceRefs.total.amount is an isSummaryField z_money).\n const summaryDto = this.applyNetworkBoundaryCoercion(\n this.stripBackendOnlyFields(summaryDtoInternal),\n );\n summaryDtoInternal = this.applyNetworkBoundaryCoercion(summaryDtoInternal);\n\n // The COLLECTION EXPORT companion is deliberately excluded. It carries\n // `resourceOperationLike: LIST/SEARCH` so that routing, collection-level authorization and URL\n // building all treat it as a listing — which is exactly right — but its response is a FILE, not\n // a pagination envelope, so every list-shaped DTO derivation below (context item extraction,\n // SUMMARY/CONTEXT envelope rebuilding) would be operating on the wrong shape. Without this\n // exclusion the derivation throws `pagination response must contain a data array` at resource\n // configuration time and the whole application fails to start.\n const isCollectionExportCompanion =\n operation.generatedOperation?.kind === ResourceGeneratedOperationKind.GENERATED_COLLECTION_EXPORT;\n const isListOrSearch = !isCollectionExportCompanion\n && (effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.SEARCH);\n\n // 6. Build contextDto:\n // - Start with the response item DTO. LIST/SEARCH responseDto is already\n // a pagination envelope, so projecting relationships on that envelope\n // would later wrap a page inside another page for the CONTEXT variant.\n // - Add relationship placeholders\n // - Date coercion already applied to responseDto\n const contextBaseDto = isListOrSearch\n ? this.extractPaginatedCollectionItemDto(responseDto, effectiveOperation)\n : responseDto;\n const contextDto = this.addRelationshipPlaceholders(\n contextBaseDto,\n operation.resourceRelationships,\n effectiveOperation,\n registry\n );\n\n // 7. Build internalDto base (before variant overrides):\n // - Start with mainSchema (with inheritance)\n // - Include backend-only fields (DO NOT strip)\n // - Exclude virtual fields (they're computed)\n //\n // A non-READ op that declares a `customResponseDto` (e.g. a CREATE that\n // returns an ephemeral `plainKey`) legitimately carries the extra fields\n // the custom schema adds in its service output. `transformOutput`\n // validates that output against `internalDto`, so for these ops internalDto\n // must be the custom schema (`responseDtoInternal`), not the bare main\n // schema — otherwise the enriched fields are stripped before the controller\n // serializes against the custom `responseDto` (the api-key CREATE's\n // `plainKey` failed exactly this way). This mirrors the custom-VARIANT\n // branch below (lines ~516), which only runs for `variantKey`'d ops and so\n // left the DEFAULT custom-DTO op falling through to `enhancedMainSchema`.\n // LIST/SEARCH keep the main-schema base (their pagination wrapper is\n // applied below and the collection item DTO is handled separately).\n const internalDtoUsesCustomResponse =\n effectiveOperation !== CoreResourceOperation.READ\n && Boolean(isCustomResponseDto)\n && Boolean(originalResponseDto)\n && effectiveOperation !== CoreResourceOperation.LIST\n && effectiveOperation !== CoreResourceOperation.SEARCH;\n // `internalDto` is what the service layer validates its OUTPUT against\n // (`ServiceResourceBackendService.transformOutput`). It must mirror the shape the operation\n // actually returns. For most mutations that is the resource object (`enhancedMainSchema`), but:\n // • READ → the resource itself (custom read DTOs handled via the flag below)\n // • OUTPUT_ENVELOPE_OPERATIONS (DELETE, DELETE_MANY, COUNT) → a framework RESPONSE ENVELOPE\n // (`DefaultDeleteResponseSchema` / `DefaultBulkDeleteResponseSchema` / `DefaultCountResponseSchema`)\n // For all of these the correct `internalDto` is the very schema already exposed via\n // `responseDto`: `responseDtoInternal` is that schema with backend-only fields retained (a\n // no-op for these envelopes, which carry none) and is already bulk-vs-single aware because\n // `buildEnhancedResponseDto` resolved it from `getDefaultResponseSchemaForOperation` (and the\n // bulk-operation branch). Leaving an envelope operation on `enhancedMainSchema` is what made\n // `transformOutput` validate the envelope value against the resource object schema and throw\n // `service_resource_transformation_failed` → HTTP 500 (the delete bug; COUNT was a latent\n // sibling). Bulk mutations (CREATE_MANY/UPDATE_MANY) are intentionally NOT in the set — they\n // return per-item resource objects validated item-by-item, so they keep `enhancedMainSchema`.\n //\n // ⚠️ Keyed on the operation's OWN `operationIdentifier`, NOT `effectiveOperation`\n // (`resourceOperationLike || operationIdentifier`). A CUSTOM op that borrows DELETE/COUNT\n // semantics for its route/verb but returns its own shape (via `REPLACE_CORE_OPERATIONS` or a\n // `customResponseDto`) must NOT be forced onto the core envelope — its custom response is\n // already handled by `internalDtoUsesCustomResponse`, or it keeps `enhancedMainSchema`. Only the\n // genuine core operation carries `operationIdentifier === CoreResourceOperation.DELETE` etc.\n // For the deletes, the runtime composition of the envelope from the repository's bare id(s)\n // happens at the transform boundary via `composeDefaultOperationResponse` (same keying).\n let internalDtoProcessed: z.ZodTypeAny =\n effectiveOperation === CoreResourceOperation.READ\n || isOutputEnvelopeOperation(operation.operationIdentifier as string)\n || internalDtoUsesCustomResponse\n ? responseDtoInternal\n : enhancedMainSchema;\n\n // Exclude virtual fields from internalDto\n if (isZodObject(internalDtoProcessed)) {\n const shape = getZodObjectShape(internalDtoProcessed);\n const omitObj: Record<string, true> = {};\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isVirtualField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n }\n if (Object.keys(omitObj).length > 0) {\n internalDtoProcessed = this.omitObjectFields(internalDtoProcessed, omitObj);\n }\n }\n\n // 8. Build repositoryDto first (before variant overrides):\n // - For default operations, derive from responseDto\n // - Include backend-only fields (for internal processing)\n // - Exclude virtual fields but include their dependencies\n let repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(responseDto, enhancedMainSchema);\n\n // 9. For default operations (no variantKey), wrap internalDto in pagination for LIST/SEARCH:\n if (!operation.variantKey && isListOrSearch) {\n // Default LIST/SEARCH operations: wrap internalDto in pagination\n internalDtoProcessed = z.object({\n data: z.array(internalDtoProcessed),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n }\n\n // 10. Override responseDto, repositoryDto, and internalDto for variant operations:\n // - For SUMMARY variants: use summaryDto (wrapped in pagination for LIST/SEARCH)\n // - For CONTEXT variants: use contextDto (wrapped in pagination for LIST/SEARCH)\n // - For custom variants with customResponseDto: use the custom schema for internalDto too\n // - Build repositoryDto from INTERNAL versions (with backend-only fields)\n // - Build internalDto for service-layer validation (pagination wrapper with backend-only items)\n if (operation.variantKey) {\n if (operation.variantKey === OPERATION_VARIANT_KEY.SUMMARY) {\n // For SUMMARY variants, build repositoryDto from INTERNAL version (has backend-only fields)\n repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(summaryDtoInternal, enhancedMainSchema);\n\n if (isListOrSearch) {\n // Build internalDto for service-layer validation (pagination wrapper with backend-only items)\n internalDtoProcessed = z.object({\n data: z.array(summaryDtoInternal),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n // Wrap summaryDto (frontend version, backend-only stripped) in pagination for responseDto\n responseDto = z.object({\n data: z.array(summaryDto),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n } else {\n // For READ operations, use summaryDto versions\n internalDtoProcessed = summaryDtoInternal;\n responseDto = summaryDto;\n }\n } else if (operation.variantKey === OPERATION_VARIANT_KEY.CONTEXT) {\n // For CONTEXT variants, build from contextDto versions\n // contextDto is built from responseDto which already has backend-only stripped, so we need internal version\n const contextDtoInternal = this.addRelationshipPlaceholders(\n this.excludeVirtualFieldsFromSchema(enhancedMainSchema),\n operation.resourceRelationships,\n effectiveOperation,\n registry\n );\n repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(contextDtoInternal, enhancedMainSchema);\n\n if (isListOrSearch) {\n // Build internalDto for service-layer validation (pagination wrapper with backend-only items)\n internalDtoProcessed = z.object({\n data: z.array(contextDtoInternal),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n // Wrap contextDto (frontend version, backend-only stripped) in pagination for responseDto\n responseDto = z.object({\n data: z.array(contextDto),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n } else {\n // For READ operations, use contextDto versions\n internalDtoProcessed = contextDtoInternal;\n responseDto = contextDto;\n }\n } else if (originalResponseDto && !isZodAny(originalResponseDto)) {\n // For custom variants with customResponseDto (e.g., 'context_old'):\n // The internalDto should also use the custom schema to preserve enriched fields.\n // This ensures that custom implementations can return additional fields that won't be stripped.\n // Apply network-boundary coercion (dates + money bigints) to the custom schema for internal processing.\n internalDtoProcessed = this.applyNetworkBoundaryCoercion(originalResponseDto);\n repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(originalResponseDto, enhancedMainSchema);\n }\n }\n\n if (operation.generatedOperation && originalResponseDto && !isZodAny(originalResponseDto)) {\n // Generated operations may be UPDATE-like for routing/authorization while\n // returning a framework-owned envelope that is not the resource schema.\n // Keep service-layer output validation aligned with that envelope.\n internalDtoProcessed = this.applyNetworkBoundaryCoercion(originalResponseDto);\n repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(enhancedMainSchema, enhancedMainSchema);\n }\n\n requestDto = this.stripTemplatableFileFieldsRecursively(requestDto);\n\n // 11. Finalize internalDto with network-boundary coercion (dates + money bigints):\n let internalDtoFinal: z.ZodTypeAny = this.applyNetworkBoundaryCoercion(internalDtoProcessed);\n\n // 11b. A SUMMARY or CONTEXT read runs file population, which lays each file's metadata BESIDE the\n // stored reference (`file` / `files`, issue #1059). The DTOs that describe those reads — what\n // `transformOutput` validates and what the wire carries — declare that optional companion;\n // RAW reads never populate and keep the bare reference. Applied AFTER coercion, so the\n // companion's own dates are coerced by its own schema rather than by a walker that leaves a\n // plain union untouched. The widened field keeps its file metadata, so it is still a FILE field.\n const isPopulatedReadVariant = operation.variantKey === OPERATION_VARIANT_KEY.SUMMARY\n || operation.variantKey === OPERATION_VARIANT_KEY.CONTEXT;\n if (isPopulatedReadVariant) {\n internalDtoFinal = widenFileFieldsForPopulatedReads(internalDtoFinal);\n responseDto = widenFileFieldsForPopulatedReads(responseDto);\n }\n\n // 12. Return operation with all DTOs stored\n return {\n ...operation,\n requestDto,\n responseDto,\n summaryDto: widenFileFieldsForPopulatedReads(summaryDto),\n contextDto: widenFileFieldsForPopulatedReads(contextDto),\n internalDto: internalDtoFinal,\n repositoryDto\n } as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>;\n }\n\n /**\n * Build enhanced request DTO based on operation type and existing DTOs.\n *\n * Decorator-aware DTO building:\n * - For CREATE operations: excludes fields with `excludeFromCreate` decorator\n * - For UPDATE operations: excludes fields with `excludeFromUpdate` decorator\n * - For ALL operations: excludes fields with `isVirtual` decorator (computed fields)\n */\n private static buildEnhancedRequestDto(\n operation: ResourceConfiguration_Operation<any, any, any>,\n effectiveOperation: string\n ): z.ZodTypeAny {\n\n // Check if operation already has a meaningful requestDto (not z.any() and not empty)\n const isZAny = operation.requestDto && isZodAny(operation.requestDto);\n const currentRequestInfo = this.analyzeDtoSchema(operation.requestDto);\n\n if (operation.requestDto && !isZAny && currentRequestInfo !== '📄 {} (empty object)') {\n return this.stripTemplatableFileFieldsRecursively(operation.requestDto);\n }\n\n const searchQueryRequestSchema = (operation as {\n searchQueryRequestSchema?: z.ZodTypeAny;\n }).searchQueryRequestSchema;\n if (\n effectiveOperation === CoreResourceOperation.SEARCH\n && searchQueryRequestSchema\n && !isZodAny(searchQueryRequestSchema)\n ) {\n return searchQueryRequestSchema;\n }\n\n // For operations that shouldn't have request DTOs, return empty object\n const shouldHaveRequestDto = operationShouldHaveRequestDto(effectiveOperation);\n if (!shouldHaveRequestDto) {\n return z.object({});\n }\n\n // Apply bulk operation decorator for URL-bearing bulk companion operations.\n // For bulk operations, we need to wrap the underlying operation's requestDto\n // with Resources_BulkOperationBaseSchema\n if ('isBulkOperation' in operation && operation.isBulkOperation) {\n // Rebuild the underlying (non-bulk) requestDto by temporarily treating as non-bulk\n const underlyingOperation = {\n ...operation,\n isBulkOperation: false,\n requestDto: undefined // Clear to force rebuild\n };\n // The ROW of a batch create is a CREATE row. Rebuilding it as CREATE_MANY would return the\n // `{ data: row[] }` envelope (see the CREATE_MANY branch below) and this wrap would nest it twice.\n const underlyingRequestDto = this.buildEnhancedRequestDto(\n underlyingOperation,\n effectiveOperation === CoreResourceOperation.CREATE_MANY ? CoreResourceOperation.CREATE : effectiveOperation,\n );\n\n // Wrap as the bulk request, WITH this operation's batch limit (`wrapRequestDtoAsBulk`).\n const hasRowInput = !!underlyingRequestDto\n && !isZodAny(underlyingRequestDto)\n && this.analyzeDtoSchema(underlyingRequestDto) !== '📄 {} (empty object)';\n return wrapRequestDtoAsBulk({\n rowRequestDto: hasRowInput ? underlyingRequestDto : undefined,\n maxSelection: resolveBulkOperationMaxSelection(operation as { bulkOperationMaxSelection?: number }),\n isCreate: effectiveOperation === CoreResourceOperation.CREATE_MANY,\n });\n }\n\n /*\n * CREATE_MANY takes a BATCH: `{ data: row[] }`, at most the batch limit (#1551).\n *\n * It shared the single-row branch below, so its request was ONE row while `createMany` validates\n * the whole `{ data: [...] }` payload against this DTO (`validateAndTransformInput`, loose parse)\n * and then reads `.data` as the rows (`normalizeCreateManyInput`). A resource with any required\n * field could therefore not be batch-created at all. The envelope is built by the same\n * `wrapRequestDtoAsBulk` every other batch request uses, so the row shape and the limit have one\n * construction.\n */\n if (effectiveOperation === CoreResourceOperation.CREATE_MANY) {\n return wrapRequestDtoAsBulk({\n rowRequestDto: this.createRequestDtoForCreate(operation.mainSchema),\n maxSelection: resolveBulkOperationMaxSelection(operation as { bulkOperationMaxSelection?: number }),\n isCreate: true,\n });\n }\n\n // For create operations, use decorator-aware DTO building\n if (effectiveOperation === CoreResourceOperation.CREATE) {\n return this.createRequestDtoForCreate(operation.mainSchema);\n }\n\n // For update operations, use decorator-aware DTO building\n if (effectiveOperation === CoreResourceOperation.UPDATE || effectiveOperation === CoreResourceOperation.UPDATE_MANY) {\n return this.createRequestDtoForUpdate(operation.mainSchema);\n }\n\n // Default: use mainSchema as-is (but still exclude virtual fields)\n return this.excludeVirtualFieldsFromSchema(operation.mainSchema);\n }\n\n /**\n * Build enhanced response DTO based on operation type and mainSchema\n */\n private static buildEnhancedResponseDto(\n operation: ResourceConfiguration_Operation<any, any, any>,\n effectiveOperation: string\n ): z.ZodTypeAny {\n\n // Check if operation already has a meaningful responseDto (not z.any() and not empty)\n const isZAny = operation.responseDto && isZodAny(operation.responseDto);\n const currentResponseInfo = this.analyzeDtoSchema(operation.responseDto);\n\n if (operation.responseDto && !isZAny && currentResponseInfo !== '📄 {} (empty object)') {\n return operation.responseDto;\n }\n\n // Apply bulk operation decorator for URL-bearing bulk companion operations.\n if ('isBulkOperation' in operation && operation.isBulkOperation) {\n switch (effectiveOperation) {\n case CoreResourceOperation.DELETE:\n case CoreResourceOperation.DELETE_MANY:\n return DefaultBulkDeleteResponseSchema;\n case CoreResourceOperation.UPDATE:\n case CoreResourceOperation.UPDATE_MANY:\n case CoreResourceOperation.CREATE:\n case CoreResourceOperation.CREATE_MANY:\n // Bulk create/update responses are arrays of resource items at runtime.\n // The controller validates array responses item-by-item against responseDto,\n // so bulk mutations must expose the per-item schema here, not a count wrapper.\n return operation.mainSchema;\n default:\n return z.array(operation.mainSchema);\n }\n }\n\n // Apply pagination decorator for list/search operations.\n //\n // The ceiling comes from the OPERATION, not from a constant. It used to be a hard-coded `50`,\n // which made `maxPaginatedResultPerPageLimit` inert on the response side: an operation could\n // declare 100 or 200, the repository would honour it, and the response DTO would then reject the\n // very page the repository had just built — a 500 (`service_resource_transformation_failed`,\n // `too_big: expected array to have <=50 items`) rather than a page. Live example found\n // 2026-08-12 on `users | list | admin`; latent on every operation declaring a larger ceiling\n // (`users SEARCH` 200, `organizations SEARCH` 100, `user-profiles` 200).\n //\n // The default is 100 — the ceiling the Mongo `_doList` hard-coded before it was taught to read\n // the declared value, and therefore the largest page this DTO could ever have been handed. It is\n // NOT 50: a 50 default would reject the very pages the repository is still allowed to build for\n // an operation that declares nothing, which is the 500 this whole change exists to remove, in a\n // new place. SEARCH's repository default stays 50, so its pages sit comfortably inside this.\n if (effectiveOperation === CoreResourceOperation.LIST || effectiveOperation === CoreResourceOperation.SEARCH) {\n return this.createPaginatedResponseSchema(\n operation.mainSchema,\n (operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit\n ?? (effectiveOperation === CoreResourceOperation.SEARCH ? DEFAULT_SEARCH_PAGE_CEILING : DEFAULT_LIST_PAGE_CEILING),\n );\n }\n\n // Apply operation-specific default patterns\n const defaultResponse = getDefaultResponseSchemaForOperation(effectiveOperation, operation.mainSchema);\n return defaultResponse;\n }\n\n /**\n * Return the row schema owned by a standard paginated collection response.\n *\n * LIST and SEARCH first derive a client response shaped as\n * `{ data: Row[]; pagination: ... }`. Context projection enriches `Row`, not\n * the envelope. Keeping this extraction at the shared DTO boundary makes the\n * invariant unbypassable for every generated CONTEXT collection operation:\n * its response is exactly one page of context-enriched rows.\n *\n * A malformed/custom collection response fails closed here. Silently falling\n * back to the envelope recreates the former `Page<Page<Row>>` contract and\n * lets runtime, OpenAPI, examples and client validation disagree.\n */\n private static extractPaginatedCollectionItemDto(\n responseDto: z.ZodTypeAny,\n effectiveOperation: string\n ): z.ZodTypeAny {\n if (!isZodObject(responseDto)) {\n throw new Error(\n `Cannot build ${effectiveOperation} context DTO: collection response must be a pagination object`\n );\n }\n\n const responseShape = getZodObjectShape(responseDto);\n const dataSchema = responseShape.data;\n if (!dataSchema || !isZodArray(dataSchema)) {\n throw new Error(\n `Cannot build ${effectiveOperation} context DTO: pagination response must contain a data array`\n );\n }\n\n const itemSchema = getZodDefSchemaProperty(dataSchema, 'element');\n if (!itemSchema) {\n throw new Error(\n `Cannot build ${effectiveOperation} context DTO: pagination data array has no item schema`\n );\n }\n\n return itemSchema;\n }\n\n /**\n * Create request DTO for CREATE operations.\n *\n * Excludes:\n * - Standard auto-populated fields (_id, createdAt, etc.)\n * - Fields with `excludeFromCreate` decorator\n * - Fields with `isVirtual` decorator (computed fields)\n *\n * Handles discriminated unions by applying omissions to each variant.\n */\n private static createRequestDtoForCreate(mainSchema: z.ZodTypeAny): z.ZodTypeAny {\n // Check if it's a discriminated union - need to handle each variant\n const zodType = getZodType(mainSchema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(mainSchema, 'discriminator');\n const options = getZodDefArrayProperty(mainSchema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && options && options.length > 0) {\n // Apply omissions to each variant in the union\n const modifiedOptions = options.map(option =>\n this.applyCreateOmissionsToSchema(option)\n );\n\n // Recreate discriminated union with modified variants\n if (modifiedOptions.length >= 2) {\n return z.discriminatedUnion(\n discriminator,\n modifiedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n );\n } else if (modifiedOptions.length === 1) {\n return modifiedOptions[0];\n }\n }\n }\n\n // Regular object schema - apply omissions directly\n return this.applyCreateOmissionsToSchema(mainSchema);\n }\n\n /**\n * Check if a field is a non-discriminator literal.\n * Non-discriminator literals are fixed values that should be auto-populated by the backend.\n * Discriminator literals are used for variant selection and should be shown in CREATE forms.\n *\n * Handles wrapped types (optional, default, etc.) by unwrapping before type check.\n */\n private static isNonDiscriminatorLiteral(fieldSchema: z.ZodTypeAny): boolean {\n // Unwrap to handle z.literal(\"value\").optional() etc.\n const unwrapped = unwrapSchema(fieldSchema);\n const zodType = getZodType(unwrapped);\n // Check if it's a literal type and NOT marked as discriminator\n // isDiscriminatorField already handles unwrapping via getMetadataRecursive\n return zodType === 'literal' && !isDiscriminatorField(fieldSchema);\n }\n\n /**\n * Apply CREATE operation omissions to a single schema (object or other).\n */\n private static applyCreateOmissionsToSchema(schema: z.ZodTypeAny): z.ZodTypeAny {\n if (!isZodObject(schema)) {\n return schema;\n }\n\n // Standard auto-generated fields to omit from create request DTOs.\n // Note: _id is handled via isPrimaryKey decorator which implies excludeFromCreate.\n // The context-auto-populated FKs (createdByUserId, organizationId, userId,\n // applicationId, anonymousUserId — all backend-injected from the EC, never\n // client-supplied) come from the shared CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS\n // single source of truth so this omit list and the trusted-system-write\n // re-attach allowlist (deriveTrustedSystemWritePreservedFields) never drift.\n const fieldsToOmit = ['id', 'createdAt', 'updatedAt', ...CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS];\n\n try {\n const omitObj: Record<string, true> = {};\n const shape = getZodObjectShape(schema);\n\n // Add standard fields to omit\n fieldsToOmit.forEach(field => {\n if (shape[field]) {\n omitObj[field] = true;\n }\n });\n\n // Add fields with excludeFromCreate decorator (includes isPrimaryKey which implies excludeFromCreate)\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isExcludedFromCreate(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude virtual fields - they are computed, not submitted\n if (isVirtualField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude backend-only fields - they are managed internally\n if (isBackendOnlyField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude generated file fields - they are materialized by operations,\n // not uploaded or supplied in client write payloads.\n if (isTemplatableFileField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude non-discriminator literals - they are auto-populated by backend\n // Discriminator literals are KEPT for variant selection in CREATE forms\n if (this.isNonDiscriminatorLiteral(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n }\n\n // If we have fields to omit, create omitted schema\n if (Object.keys(omitObj).length > 0) {\n const omittedSchema = this.omitObjectFields(schema, omitObj);\n return this.stripTemplatableFileFieldsRecursively(omittedSchema);\n }\n } catch (error) {\n throw new Error(`Failed to create request DTO for CREATE: ${describeCaughtError(error)}`);\n }\n\n return this.stripTemplatableFileFieldsRecursively(schema);\n }\n\n /**\n * Create request DTO for UPDATE operations.\n *\n * Excludes:\n * - Standard auto-populated fields (_id, createdAt, etc.)\n * - Fields with `excludeFromUpdate` decorator\n * - Fields with `isVirtual` decorator (computed fields)\n *\n * Handles discriminated unions by applying omissions to each variant.\n */\n private static createRequestDtoForUpdate(mainSchema: z.ZodTypeAny): z.ZodTypeAny {\n // Check if it's a discriminated union - need to handle each variant\n const zodType = getZodType(mainSchema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(mainSchema, 'discriminator');\n const options = getZodDefArrayProperty(mainSchema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && options && options.length > 0) {\n // PATCH semantics for an inheritance resource. Two hard constraints\n // collide here and only a MERGED SUPERSET OBJECT satisfies both:\n //\n // 1. The persisted variant is IMMUTABLE and the repository applies a\n // partial `$set` (see `RepositoryResourceBackendService.update` →\n // `findOneAndUpdate({ $set })`). A caller therefore legitimately\n // sends only the fields it changes — e.g. an inline status\n // autosave submits `{ status }` with NO `recurringType`. A\n // discriminated union CANNOT express \"discriminator optional\":\n // Zod needs the key present to pick a branch, and a discriminator\n // `.default()` does NOT fire inside `z.discriminatedUnion`, so the\n // missing key fails with \"No matching discriminator\" (the exact\n // wonder-todos `todos` CHANGE_STATUS / inline-edit crash).\n // 2. Variant-only fields (`recurrence` / `startDate` / `endsDate`)\n // must stay IN the contract — a bare base object would `z.object`-\n // strip them, silently dropping a partial update that touches a\n // variant field. Keeping every variant field is the whole reason\n // this DTO became a union in the first place.\n //\n // Collapsing the per-variant options into one object whose fields are\n // all optional (the discriminator included) keeps every variant field\n // reachable AND lets any partial subset validate without echoing the\n // immutable discriminator. Variant/field coherence is enforced\n // server-side against the merged persisted+patch object (the `$set`\n // target already carries the true variant), NOT by the static request\n // contract. CREATE keeps the discriminated union (see\n // `createRequestDtoForCreate`) because on CREATE the client MUST choose\n // a variant and variant-field validation applies.\n return this.mergeUnionOptionsIntoOptionalUpdateObject(options, discriminator);\n }\n }\n\n // Regular object schema - apply omissions directly\n return this.applyUpdateOmissionsToSchema(mainSchema);\n }\n\n /**\n * Collapse the per-variant options of an inheritance UPDATE discriminated\n * union into a single object with PATCH semantics: every base + variant-only\n * field present and optional, and the discriminator itself optional.\n *\n * Each option is first run through {@link applyUpdateOmissionsToSchema}\n * (which drops `excludeFromUpdate` / PK / virtual / backend-only / templatable\n * file fields and optionalises every non-discriminator field), then the\n * resulting shapes are merged. The discriminator — which\n * `applyUpdateOmissionsToSchema` keeps required per-variant so the omission\n * pass does not mistake it for an auto-populated literal — is replaced by a\n * single OPTIONAL enum spanning every variant value, so a partial update may\n * omit it entirely (the persisted variant is immutable) yet a full-object\n * update that re-sends the current discriminator still validates.\n *\n * Nested inheritance (an option that is itself a union) is flattened\n * recursively so deeply-nested variant fields are preserved too.\n */\n private static mergeUnionOptionsIntoOptionalUpdateObject(\n options: z.ZodTypeAny[],\n discriminatorField: string\n ): z.ZodTypeAny {\n const mergedShape: Record<string, z.ZodTypeAny> = {};\n const discriminatorValues = new Set<string>();\n\n const collectFromOption = (option: z.ZodTypeAny): void => {\n // Flatten nested discriminated unions (multi-level inheritance).\n if (getZodType(option) === 'union') {\n const nestedOptions = getZodDefArrayProperty(option, 'options') as z.ZodTypeAny[] | undefined;\n if (nestedOptions && nestedOptions.length > 0) {\n nestedOptions.forEach(collectFromOption);\n return;\n }\n }\n\n const omitted = this.applyUpdateOmissionsToSchema(option);\n if (!isZodObject(omitted)) {\n return;\n }\n\n const shape = getZodObjectShape(omitted);\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (fieldName === discriminatorField) {\n // Gather every variant value the discriminator can carry; the field\n // is rebuilt as one optional enum below.\n for (const value of this.extractDiscriminatorValues(fieldSchema as z.ZodTypeAny)) {\n discriminatorValues.add(value);\n }\n continue;\n }\n // First writer wins: base fields are identical across variants and\n // variant-only fields appear in exactly one option, so there is no\n // meaningful collision to resolve. `applyUpdateOmissionsToSchema`\n // already made every non-discriminator field optional.\n if (!mergedShape[fieldName]) {\n mergedShape[fieldName] = fieldSchema as z.ZodTypeAny;\n }\n }\n };\n\n options.forEach(collectFromOption);\n\n if (discriminatorValues.size > 0) {\n // Optional so a partial update may omit the immutable discriminator; the\n // enum still accepts a re-sent current value from a full-object update.\n mergedShape[discriminatorField] = z\n .enum(Array.from(discriminatorValues) as [string, ...string[]])\n .optional();\n }\n\n // The merged inheritance UPDATE root is written PATCH style like any other UPDATE root (#989).\n return markPatchRequestDtoObject(z.object(mergedShape));\n }\n\n /**\n * Extract the concrete discriminator value(s) a union-option's discriminator\n * field can hold. Variant options carry a `z.literal(value)`; the base option\n * carries a `z.enum([...baseValues])`. Both may be wrapped by the\n * `isDiscriminator` decorator / `.default()` / `.optional()`, so unwrap first.\n */\n private static extractDiscriminatorValues(fieldSchema: z.ZodTypeAny): string[] {\n const unwrapped = unwrapSchema(fieldSchema);\n const unwrappedType = getZodType(unwrapped);\n\n if (unwrappedType === 'enum') {\n return getEnumValues(unwrapped).map(String);\n }\n\n // Literal — Zod 4 stores value(s) in `def.values` (array); fall back to the\n // legacy scalar `def.value`. Mirrors the literal read at `analyzeDtoSchema`.\n const literalValues = (getZodDefArrayProperty(unwrapped, 'values')\n ?? [getZodDefProperty(unwrapped, 'value')]) as unknown[];\n return literalValues\n .filter((value): value is string | number => value !== undefined && value !== null)\n .map(String);\n }\n\n /**\n * Apply UPDATE operation omissions to a single schema (object or other).\n */\n private static applyUpdateOmissionsToSchema(schema: z.ZodTypeAny): z.ZodTypeAny {\n if (!isZodObject(schema)) {\n return schema;\n }\n\n // Standard auto-generated fields to omit from update request DTOs.\n // Note: Primary keys are passed as route params, not in request body.\n // The context-auto-populated FKs (immutable after creation; anonymousUserId\n // is managed by transposition, never client-updatable) come from the shared\n // CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS single source of truth so this omit\n // list and the trusted-system-write re-attach allowlist stay in lockstep.\n const fieldsToOmit = ['id', 'createdAt', 'updatedAt', ...CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS];\n\n try {\n const omitObj: Record<string, true> = {};\n const shape = getZodObjectShape(schema);\n\n // Add standard fields to omit\n fieldsToOmit.forEach(field => {\n if (shape[field]) {\n omitObj[field] = true;\n }\n });\n\n // Add fields with excludeFromUpdate decorator or isPrimaryKey (passed as route param)\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isExcludedFromUpdate(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Primary keys are passed as route params, not in request body\n if (isPrimaryKey(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude virtual fields - they are computed, not submitted\n if (isVirtualField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude backend-only fields - they are managed internally\n if (isBackendOnlyField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude generated file fields - explicit regenerate operations own\n // refreshing them, so generic UPDATE payloads must not accept them.\n if (isTemplatableFileField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude NON-discriminator literals only — they are fixed values\n // auto-populated by the backend and immutable after creation.\n //\n // Discriminator literals are KEPT: for an inheritance resource the\n // UPDATE DTO is a discriminated union, and the discriminator must be\n // present (and required) so Zod can select the variant and validate\n // its variant-specific fields. Stripping it produced a structurally\n // invalid discriminated union (\"Invalid discriminated union option\").\n // The discriminator's immutability is enforced at the service layer\n // (the update is rejected if it changes the variant), not by removing\n // it from the request contract — which would silently drop every\n // variant-only field from the payload.\n if (this.isNonDiscriminatorLiteral(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n }\n\n // Rebuild the shape with PATCH semantics: drop the omitted fields, then\n // make every remaining field optional EXCEPT the discriminator. This\n // mirrors the factory's `buildUpdateRequestDto` (partial update). The\n // discriminator is left REQUIRED here only so this per-variant omission\n // pass does not mistake it for an auto-populated literal and strip it —\n // for an inheritance UPDATE the per-variant objects are then merged by\n // `mergeUnionOptionsIntoOptionalUpdateObject`, which replaces the\n // discriminator with a single OPTIONAL enum so partial updates may omit\n // the immutable discriminator. (Without optionalizing the other fields\n // every field would become mandatory, breaking partial updates for every\n // resource.)\n const updateShape: Record<string, z.ZodTypeAny> = {};\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (omitObj[fieldName]) {\n continue;\n }\n const strippedField = this.stripTemplatableFileFieldsRecursively(fieldSchema as z.ZodTypeAny);\n // Non-discriminator fields are optionalised for PATCH; `toPatchOptionalField`\n // also peels any `.default()` so an omitted field is never re-materialized to\n // its default and `$set` back over the stored value (the `attemptCount`-reset\n // class of bug). The discriminator is kept as-is (required, default intact) so\n // the union stays selectable — the merge pass replaces it with an optional enum.\n updateShape[fieldName] = isDiscriminatorField(fieldSchema as z.ZodTypeAny)\n ? strippedField\n : toPatchOptionalField(strippedField);\n }\n // PATCH write rule: the form clears this object's direct fields with an explicit null (#989).\n return markPatchRequestDtoObject(z.object(updateShape));\n } catch (error) {\n throw new Error(`Failed to create request DTO for UPDATE: ${describeCaughtError(error)}`);\n }\n\n return this.stripTemplatableFileFieldsRecursively(schema);\n }\n\n /**\n * Exclude virtual fields from a schema.\n * Virtual fields are computed at runtime and should not appear in request DTOs.\n *\n * Handles discriminated unions by applying omissions to each variant.\n */\n private static excludeVirtualFieldsFromSchema(mainSchema: z.ZodTypeAny): z.ZodTypeAny {\n // Check if it's a discriminated union - need to handle each variant\n const zodType = getZodType(mainSchema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(mainSchema, 'discriminator');\n const options = getZodDefArrayProperty(mainSchema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && options && options.length > 0) {\n // Apply virtual field exclusion to each variant\n const modifiedOptions = options.map(option =>\n this.applyVirtualFieldExclusionToSchema(option)\n );\n\n // Recreate discriminated union with modified variants\n if (modifiedOptions.length >= 2) {\n return z.discriminatedUnion(\n discriminator,\n modifiedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n );\n } else if (modifiedOptions.length === 1) {\n return modifiedOptions[0];\n }\n }\n }\n\n // Regular object schema - apply exclusion directly\n return this.applyVirtualFieldExclusionToSchema(mainSchema);\n }\n\n /**\n * Apply virtual field exclusion to a single schema (object or other).\n */\n private static applyVirtualFieldExclusionToSchema(schema: z.ZodTypeAny): z.ZodTypeAny {\n if (!isZodObject(schema)) {\n return schema;\n }\n\n try {\n const omitObj: Record<string, true> = {};\n const shape = getZodObjectShape(schema);\n\n // Find and exclude virtual fields\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isVirtualField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n }\n\n // If we have fields to omit, create omitted schema\n if (Object.keys(omitObj).length > 0) {\n const omittedSchema = this.omitObjectFields(schema, omitObj);\n return omittedSchema;\n }\n } catch (error) {\n throw new Error(`Failed to exclude virtual fields from schema: ${describeCaughtError(error)}`);\n }\n\n return schema;\n }\n\n // TODO: Implement cascading relationships logic in future iteration\n\n\n\n /**\n * Create paginated response schema using shared pagination metadata schema\n */\n private static createPaginatedResponseSchema(\n dataSchema: z.ZodTypeAny,\n maxResultsPerPageLimit: number = 100\n ): z.ZodTypeAny {\n return z.object({\n data: z.array(dataSchema).max(maxResultsPerPageLimit),\n // Bounded by the SAME ceiling as the data array beside it. Leaving this on the default-bounded\n // constant is how a legitimately-served 120-row page still answered 500 after the array bound,\n // the request bound and both repository maxima had been unified: `limit` echoes the page size\n // actually served, so a stricter bound here rejects what the line above just permitted.\n pagination: createPaginationResponseMetadataSchema(maxResultsPerPageLimit)\n });\n }\n\n /**\n * Analyze a DTO schema with full recursive object display\n * Public method to get detailed recursive schema analysis\n */\n static analyzeSchemaRecursive(\n schema: any,\n maxDepth: number = 5\n ): string {\n return this.analyzeDtoSchemaRecursive(schema, '', maxDepth);\n }\n\n /**\n * Debug helper to display a single schema with full recursive analysis\n * Useful for detailed inspection of specific DTOs\n */\n static debugDisplaySingleSchema(\n schemaName: string,\n schema: any,\n maxDepth: number = 5\n ): void {\n console.log(`\\n🔍 === SCHEMA DEBUG: ${schemaName} ===`);\n const analysis = this.analyzeDtoSchemaRecursive(schema, '', maxDepth);\n console.log(analysis);\n console.log(`=== END SCHEMA DEBUG ===\\n`);\n }\n\n /**\n * Convenience method to display DTOs with full recursive object details\n * Shows complete nested structures for better understanding\n */\n static debugDisplayGeneratedDtosWithFullDetails(\n resourceConfigurations: { [key: string]: any },\n resourceFilter: ResourceType[] = [],\n maxDepth: number = 4\n ): void {\n console.log(`\\n🔍 === FULL RECURSIVE DTO ANALYSIS (depth: ${maxDepth}) ===\\n`);\n this.debugDisplayGeneratedDtos(\n resourceConfigurations,\n resourceFilter,\n true, // Always use recursive analysis\n maxDepth\n );\n }\n\n /**\n * Debug function to display DTOs for specific resources\n * @param resourceConfigurations - All resource configurations\n * @param resourceFilter - Array of resource types to filter (empty = show all)\n * @param useRecursiveAnalysis - Whether to show full recursive object structures (default: true now)\n * @param maxRecursionDepth - Maximum depth for recursive object analysis (default: 3)\n */\n static debugDisplayGeneratedDtos(\n resourceConfigurations: { [key: string]: any },\n resourceFilter: ResourceType[] = [],\n useRecursiveAnalysis: boolean = true,\n maxRecursionDepth: number = 3\n ): void {\n console.log('\\n=== 📋 GENERATED DTOS DEBUG DISPLAY ===\\n');\n\n const resourceTypes = Object.keys(resourceConfigurations).sort();\n let totalOperations = 0;\n let totalDtosProcessed = 0;\n let filteredResourceTypes = resourceFilter.length > 0\n ? resourceTypes.filter(type => resourceFilter.includes(type as ResourceType))\n : resourceTypes;\n\n if (resourceFilter.length > 0) {\n console.log(`🔍 Filtering for resources: ${resourceFilter.join(', ')}\\n`);\n }\n\n if (useRecursiveAnalysis) {\n console.log(`🔄 Using recursive object analysis (full nested structures, max depth: ${maxRecursionDepth})\\n`);\n }\n\n for (const resourceType of filteredResourceTypes) {\n const resourceConfig = resourceConfigurations[resourceType];\n\n if (!resourceConfig || !resourceConfig.operations) {\n console.log(`⚠️ Resource ${resourceType}: No operations found`);\n continue;\n }\n\n const operations = resourceConfig.operations;\n console.log(`\\n📦 Resource: ${resourceType}`);\n console.log(` Operations: ${operations.length}`);\n\n // Group operations by operation identifier for cleaner display\n const operationGroups = new Map<string, any[]>();\n operations.forEach((op: any) => {\n const key = op.operationIdentifier;\n if (!operationGroups.has(key)) {\n operationGroups.set(key, []);\n }\n operationGroups.get(key)!.push(op);\n });\n\n for (const [operationIdentifier, ops] of operationGroups.entries()) {\n console.log(`\\n 🔧 Operation: ${operationIdentifier} (${ops.length} variants)`);\n\n ops.forEach((operation: any, index: number) => {\n totalOperations++;\n const variantInfo = operation.variantType +\n ('isBulkOperation' in operation && operation.isBulkOperation ? ' [BULK]' : '') +\n (operation.isOperationDefault ? ' [DEFAULT]' : '') +\n (operation.variantKey ? ` [${operation.variantKey}]` : '');\n\n console.log(` └─ Variant ${index + 1}: ${variantInfo}`);\n\n // Display Request DTO\n const requestDtoInfo = useRecursiveAnalysis\n ? this.analyzeDtoSchemaRecursive(operation.requestDto, '', maxRecursionDepth)\n : this.analyzeDtoSchema(operation.requestDto);\n console.log(` 📤 Request: ${requestDtoInfo}`);\n totalDtosProcessed++;\n\n // Display Response DTO\n const responseDtoInfo = useRecursiveAnalysis\n ? this.analyzeDtoSchemaRecursive(operation.responseDto, '', maxRecursionDepth)\n : this.analyzeDtoSchema(operation.responseDto);\n console.log(` 📥 Response: ${responseDtoInfo}`);\n totalDtosProcessed++;\n\n // NOTE: Cascade mode logging removed - lifecycle operations are now on relationships\n // See childOperations.lifecycle.onParentDelete on ResourceRelationship\n\n // NOTE: inheritenceSchemaConfiguration removed - conditional relationships now use\n // discriminator field on ResourceRelationship instead\n });\n }\n }\n\n console.log(`\\n=== 📊 DTO DEBUG SUMMARY ===`);\n console.log(`Resources processed: ${filteredResourceTypes.length}/${resourceTypes.length}`);\n console.log(`Total operations: ${totalOperations}`);\n console.log(`Total DTOs processed: ${totalDtosProcessed}`);\n if (resourceFilter.length > 0) {\n console.log(`Filter applied: [${resourceFilter.join(', ')}]`);\n }\n if (useRecursiveAnalysis) {\n console.log(`Analysis mode: Recursive (full nested structures, depth: ${maxRecursionDepth})`);\n }\n console.log(`=================================\\n`);\n }\n\n /**\n * Get field count and names from a Zod object schema (Zod-compliant)\n */\n private static getZodObjectFields(schema: any): { fieldCount: number; fieldNames: string[] } {\n if (!isZodObject(schema)) {\n return { fieldCount: 0, fieldNames: [] };\n }\n\n try {\n // Use public .shape property (Zod v4 API)\n const shape = getZodObjectShape(schema);\n const fieldNames = Object.keys(shape);\n return { fieldCount: fieldNames.length, fieldNames };\n } catch (error) {\n return { fieldCount: 0, fieldNames: [] };\n }\n }\n\n /**\n * Analyze a DTO schema and return a detailed human-readable summary (Zod-compliant)\n */\n private static analyzeDtoSchema(schema: any, indent: string = ''): string {\n if (!schema) {\n return '❌ null/undefined';\n }\n\n // Check if it's a z.any()\n if (isZodAny(schema)) {\n return '⚪ z.any() [NEEDS ENHANCEMENT]';\n }\n\n // Check if it's a ZodObject - use proper field detection\n if (isZodObject(schema)) {\n const { fieldCount, fieldNames } = this.getZodObjectFields(schema);\n\n if (fieldCount === 0) {\n return '📄 {} (empty object)';\n }\n\n // Check if this is a decorated schema\n let decorationInfo = '';\n // Use the new Symbol-based metadata approach (preserves description for API docs)\n const metadata = getCustomFieldMetadata(schema);\n const decorations: string[] = [];\n if (metadata[ZodDecorator.IS_DB_INDEXED]) decorations.push('indexed');\n if (metadata[ZodDecorator.IS_FOREIGN_KEY]) decorations.push('reference');\n if (decorations.length > 0) {\n decorationInfo = ` [${decorations.join(', ')}]`;\n }\n\n // Return with detailed field information inline\n let result = `📋 Object (${fieldCount} fields)${decorationInfo}`;\n\n // Always show ALL field details without truncation\n if (fieldCount > 0) {\n try {\n const shape = getZodObjectShape(schema);\n\n result += ':\\n';\n fieldNames.forEach((fieldName, index) => {\n const fieldSchema = shape[fieldName];\n const fieldType = this.getFieldTypeRecursive(\n fieldSchema,\n indent + ' │ ',\n 3, // Max depth for nested objects\n 0,\n new Set()\n );\n const isOptional = this.isFieldOptional(fieldSchema);\n const optionalMark = isOptional ? '?' : '';\n result += `${indent} │ ${fieldName}${optionalMark}: ${fieldType}`;\n if (index < fieldNames.length - 1) result += '\\n';\n });\n } catch (error) {\n result += ` (field details unavailable: ${error})`;\n }\n }\n\n return result;\n }\n\n\n\n // Check if it's an array\n if (isZodArray(schema)) {\n const element = getZodDefSchemaProperty(schema, 'element');\n if (!element) return '📚 Array[unknown]';\n const elementType = this.getFieldTypeRecursive(\n element,\n indent,\n 3, // Max depth for array elements\n 0,\n new Set()\n );\n return `📚 Array[${elementType}]`;\n }\n\n // Check if it's a union (regular or discriminated)\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const options = getZodDefArrayProperty(schema, 'options');\n const optionCount = options?.length || 0;\n // In Zod v4, discriminated unions extend union and have a discriminator property\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n if (discriminator) {\n return `🔀 DiscriminatedUnion (${optionCount} options, discriminator: \"${discriminator}\")`;\n }\n return `🔀 Union (${optionCount} options)`;\n }\n\n // Check if it's a merge/intersection\n if (zodType === 'intersection') {\n return '🔗 Merged schema';\n }\n\n // Check if it's an optional wrapper\n if (isZodOptional(schema)) {\n const innerType = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerType) return 'unknown (optional)';\n return this.analyzeDtoSchema(innerType, indent) + ' (optional)';\n }\n\n // Check if it's a pipe (from .transform(), .pipe(), etc.)\n // In Zod v4, transforms create pipe types with 'in' and 'out' schemas\n if (zodType === 'pipe') {\n const inSchema = getZodDefSchemaProperty(schema, 'in');\n if (!inSchema) return '🔧 Pipe[unknown]';\n return `🔧 Pipe[${this.analyzeDtoSchema(inSchema, indent)}]`;\n }\n\n // Check if it's a transform (standalone transform, no underlying schema)\n if (zodType === 'transform') {\n return '🔧 Transform';\n }\n\n // Check if it's a custom (from .refine(), .superRefine(), etc.)\n // Custom types don't wrap schemas - refinements are stored as checks on the schema\n if (zodType === 'custom') {\n return '🔧 Custom';\n }\n\n // Check if it's a ZodDefault (has default value)\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerSchema) return 'unknown (with default)';\n return this.analyzeDtoSchema(innerSchema, indent) + ' (with default)';\n }\n\n // Default case\n return `🔍 ${zodType || 'Unknown'}`;\n }\n\n /**\n * Analyze a DTO schema with full recursive object display\n * This method shows complete nested object structures instead of just summaries\n */\n private static analyzeDtoSchemaRecursive(\n schema: any,\n indent: string = '',\n maxDepth: number = 5,\n currentDepth: number = 0,\n visitedSchemas: Set<any> = new Set()\n ): string {\n if (!schema) {\n return '❌ null/undefined';\n }\n\n // Prevent infinite recursion\n if (currentDepth >= maxDepth) {\n return `🔄 [Max depth ${maxDepth} reached]`;\n }\n\n // Prevent circular references\n if (visitedSchemas.has(schema)) {\n return '🔄 [Circular reference]';\n }\n visitedSchemas.add(schema);\n\n // Check if it's a z.any()\n if (isZodAny(schema)) {\n visitedSchemas.delete(schema);\n return '⚪ z.any() [NEEDS ENHANCEMENT]';\n }\n\n // Check if it's a ZodObject - use proper field detection with full recursion\n if (isZodObject(schema)) {\n const { fieldCount, fieldNames } = this.getZodObjectFields(schema);\n\n if (fieldCount === 0) {\n visitedSchemas.delete(schema);\n return '📄 {} (empty object)';\n }\n\n // Check if this is a decorated schema\n let decorationInfo = '';\n // Use the new Symbol-based metadata approach (preserves description for API docs)\n const metadata = getCustomFieldMetadata(schema);\n const decorations: string[] = [];\n if (metadata[ZodDecorator.IS_DB_INDEXED]) decorations.push('indexed');\n if (metadata[ZodDecorator.IS_FOREIGN_KEY]) decorations.push('reference');\n if (decorations.length > 0) {\n decorationInfo = ` [${decorations.join(', ')}]`;\n }\n\n // Return with detailed field information inline with full recursion\n let result = `📋 Object (${fieldCount} fields)${decorationInfo}`;\n\n // Always show ALL field details with recursion\n if (fieldCount > 0) {\n try {\n const shape = getZodObjectShape(schema);\n\n result += ':\\n';\n fieldNames.forEach((fieldName, index) => {\n const fieldSchema = shape[fieldName];\n const fieldType = this.getFieldTypeRecursive(\n fieldSchema,\n indent + ' │ ',\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n const isOptional = this.isFieldOptional(fieldSchema);\n const optionalMark = isOptional ? '?' : '';\n result += `${indent} │ ${fieldName}${optionalMark}: ${fieldType}`;\n if (index < fieldNames.length - 1) result += '\\n';\n });\n } catch (error) {\n result += ` (field details unavailable: ${error})`;\n }\n }\n\n visitedSchemas.delete(schema);\n return result;\n }\n\n // Check if it's an array with recursive element analysis\n if (isZodArray(schema)) {\n const element = getZodDefSchemaProperty(schema, 'element');\n if (!element) {\n visitedSchemas.delete(schema);\n return '📚 Array[unknown]';\n }\n const elementType = this.getFieldTypeRecursive(\n element,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n visitedSchemas.delete(schema);\n return `📚 Array[${elementType}]`;\n }\n\n // Check if it's a union (regular or discriminated)\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const options = getZodDefArrayProperty(schema, 'options');\n const optionCount = options?.length || 0;\n // In Zod v4, discriminated unions extend union and have a discriminator property\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n visitedSchemas.delete(schema);\n if (discriminator) {\n return `🔀 DiscriminatedUnion (${optionCount} options, discriminator: \"${discriminator}\")`;\n }\n return `🔀 Union (${optionCount} options)`;\n }\n\n // Check if it's a merge/intersection\n if (zodType === 'intersection') {\n visitedSchemas.delete(schema);\n return '🔗 Merged schema';\n }\n\n // Check if it's an optional wrapper\n if (isZodOptional(schema)) {\n const innerType = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerType) {\n visitedSchemas.delete(schema);\n return 'unknown (optional)';\n }\n const result = this.analyzeDtoSchemaRecursive(\n innerType,\n indent,\n maxDepth,\n currentDepth,\n new Set(visitedSchemas)\n ) + ' (optional)';\n visitedSchemas.delete(schema);\n return result;\n }\n\n // Check if it's a pipe (from .transform(), .pipe(), etc.)\n // In Zod v4, transforms create pipe types with 'in' and 'out' schemas\n if (zodType === 'pipe') {\n const inSchema = getZodDefSchemaProperty(schema, 'in');\n if (!inSchema) {\n visitedSchemas.delete(schema);\n return '🔧 Pipe[unknown]';\n }\n const result = `🔧 Pipe[${this.analyzeDtoSchemaRecursive(\n inSchema,\n indent,\n maxDepth,\n currentDepth,\n new Set(visitedSchemas)\n )}]`;\n visitedSchemas.delete(schema);\n return result;\n }\n\n // Check if it's a transform (standalone transform, no underlying schema)\n if (zodType === 'transform') {\n visitedSchemas.delete(schema);\n return '🔧 Transform';\n }\n\n // Check if it's a custom (from .refine(), .superRefine(), etc.)\n // Custom types don't wrap schemas - refinements are stored as checks on the schema\n if (zodType === 'custom') {\n visitedSchemas.delete(schema);\n return '🔧 Custom';\n }\n\n // Check if it's a ZodDefault (has default value)\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerSchema) {\n visitedSchemas.delete(schema);\n return 'unknown (with default)';\n }\n const result = this.analyzeDtoSchemaRecursive(\n innerSchema,\n indent,\n maxDepth,\n currentDepth,\n new Set(visitedSchemas)\n ) + ' (with default)';\n visitedSchemas.delete(schema);\n return result;\n }\n\n // Default case\n visitedSchemas.delete(schema);\n return `🔍 ${zodType || 'Unknown'}`;\n }\n\n /**\n * Get detailed field type description with full recursive sub-object support\n */\n private static getFieldTypeRecursive(\n fieldSchema: any,\n indent: string = '',\n maxDepth: number = 5,\n currentDepth: number = 0,\n visitedSchemas: Set<any> = new Set()\n ): string {\n const zodType = getZodType(fieldSchema);\n if (!zodType) return 'unknown';\n\n // Prevent infinite recursion\n if (currentDepth >= maxDepth) {\n return `[Max depth ${maxDepth} reached]`;\n }\n\n // Prevent circular references\n if (visitedSchemas.has(fieldSchema)) {\n return '[Circular reference]';\n }\n\n switch (zodType) {\n case 'string':\n // Check for decorations\n if (fieldSchema.description) {\n try {\n const metadata = JSON.parse(fieldSchema.description);\n const decorations: string[] = [];\n if (metadata.isDBIndexed) decorations.push('indexed');\n if (metadata.isForeignKey) decorations.push('ref');\n if (decorations.length > 0) {\n return `string [${decorations.join(', ')}]`;\n }\n } catch {}\n }\n return 'string';\n case 'number':\n case 'int': return 'number';\n case 'bigint': return 'bigint';\n case 'boolean': return 'boolean';\n case 'date': return 'Date';\n case 'array':\n visitedSchemas.add(fieldSchema);\n const element = getZodDefSchemaProperty(fieldSchema, 'element');\n if (!element) {\n visitedSchemas.delete(fieldSchema);\n return 'unknown[]';\n }\n const elementType = this.getFieldTypeRecursive(\n element,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n visitedSchemas.delete(fieldSchema);\n return `${elementType}[]`;\n case 'enum':\n // Use centralized getEnumValues function\n const enumValues = getEnumValues(fieldSchema);\n if (enumValues.length === 0) return 'enum()';\n return `enum(${enumValues.slice(0, 3).join('|')}${enumValues.length > 3 ? '...' : ''})`;\n case 'object':\n // Full recursive object analysis\n visitedSchemas.add(fieldSchema);\n const { fieldCount, fieldNames } = this.getZodObjectFields(fieldSchema);\n\n if (fieldCount === 0) {\n visitedSchemas.delete(fieldSchema);\n return '{}';\n }\n\n let result = `{\\n`;\n try {\n const shape = getZodObjectShape(fieldSchema);\n\n fieldNames.forEach((fieldName, index) => {\n const nestedFieldSchema = shape[fieldName];\n const nestedFieldType = this.getFieldTypeRecursive(\n nestedFieldSchema,\n indent + ' ',\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n const isOptional = this.isFieldOptional(nestedFieldSchema);\n const optionalMark = isOptional ? '?' : '';\n result += `${indent} ${fieldName}${optionalMark}: ${nestedFieldType}`;\n if (index < fieldNames.length - 1) result += ',\\n';\n });\n result += `\\n${indent}}`;\n } catch (error) {\n result = `object(${fieldCount} fields) [error: ${error}]`;\n }\n\n visitedSchemas.delete(fieldSchema);\n return result;\n case 'optional':\n const optionalInnerType = getZodDefSchemaProperty(fieldSchema, 'innerType');\n if (!optionalInnerType) return 'unknown?';\n return this.getFieldTypeRecursive(\n optionalInnerType,\n indent,\n maxDepth,\n currentDepth,\n visitedSchemas\n ) + '?';\n case 'nullable':\n const nullableInnerType = getZodDefSchemaProperty(fieldSchema, 'innerType');\n if (!nullableInnerType) return 'unknown | null';\n return this.getFieldTypeRecursive(\n nullableInnerType,\n indent,\n maxDepth,\n currentDepth,\n visitedSchemas\n ) + ' | null';\n case 'default':\n const defaultValue = getZodDefProperty(fieldSchema, 'defaultValue');\n const defaultInnerType = getZodDefSchemaProperty(fieldSchema, 'innerType');\n if (!defaultInnerType) return 'unknown (with default)';\n const defaultValueStr = typeof defaultValue === 'function'\n ? 'fn()'\n : String(defaultValue ?? 'undefined');\n return this.getFieldTypeRecursive(\n defaultInnerType,\n indent,\n maxDepth,\n currentDepth,\n visitedSchemas\n ) + ` (default: ${defaultValueStr})`;\n case 'union':\n const unionOptions = getZodDefArrayProperty(fieldSchema, 'options');\n const optionCount = unionOptions?.length || 0;\n // Check if it's a discriminated union\n const unionDiscriminator = getZodDefStringProperty(fieldSchema, 'discriminator');\n if (unionDiscriminator) {\n return `discriminatedUnion(${optionCount} options, discriminator: \"${unionDiscriminator}\")`;\n }\n return `union(${optionCount} options)`;\n case 'literal':\n // Zod 4 stores literal value(s) in def.values (an array); the legacy Zod-3\n // def.value is always undefined in v4, so reading it alone always rendered\n // literal(\"unknown\"). Read def.values first, fall back to def.value.\n const literalValues = (getZodDefArrayProperty(fieldSchema, 'values') ?? [getZodDefProperty(fieldSchema, 'value')])\n .filter((entry) => entry !== undefined && entry !== null);\n return `literal(\"${String(literalValues[0] ?? 'unknown')}\")`;\n case 'any':\n return 'any';\n case 'unknown':\n return 'unknown';\n case 'set':\n visitedSchemas.add(fieldSchema);\n const setElement = getZodDefSchemaProperty(fieldSchema, 'valueType');\n if (!setElement) {\n visitedSchemas.delete(fieldSchema);\n return 'Set<unknown>';\n }\n const setElementType = this.getFieldTypeRecursive(\n setElement,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n visitedSchemas.delete(fieldSchema);\n return `Set<${setElementType}>`;\n case 'tuple':\n visitedSchemas.add(fieldSchema);\n const tupleItems = getZodDefArrayProperty(fieldSchema, 'items') ?? [];\n const tupleTypes = tupleItems\n .filter((item): item is z.ZodTypeAny => isZodTypeAny(item))\n .map(item => this.getFieldTypeRecursive(\n item,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n ));\n visitedSchemas.delete(fieldSchema);\n return `[${tupleTypes.join(', ')}]`;\n case 'record':\n visitedSchemas.add(fieldSchema);\n const recordValue = getZodDefSchemaProperty(fieldSchema, 'valueType');\n if (!recordValue) {\n visitedSchemas.delete(fieldSchema);\n return 'Record<string, unknown>';\n }\n const recordValueType = this.getFieldTypeRecursive(\n recordValue,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n visitedSchemas.delete(fieldSchema);\n return `Record<string, ${recordValueType}>`;\n case 'map':\n visitedSchemas.add(fieldSchema);\n const mapKey = getZodDefSchemaProperty(fieldSchema, 'keyType');\n const mapValue = getZodDefSchemaProperty(fieldSchema, 'valueType');\n const mapKeyType = mapKey ? this.getFieldTypeRecursive(\n mapKey,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n ) : 'unknown';\n const mapValueType = mapValue ? this.getFieldTypeRecursive(\n mapValue,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n ) : 'unknown';\n visitedSchemas.delete(fieldSchema);\n return `Map<${mapKeyType}, ${mapValueType}>`;\n case 'intersection':\n const leftSchema = getZodDefSchemaProperty(fieldSchema, 'left');\n const rightSchema = getZodDefSchemaProperty(fieldSchema, 'right');\n const leftType = leftSchema ? this.getFieldTypeRecursive(\n leftSchema,\n indent,\n maxDepth,\n currentDepth + 1,\n visitedSchemas\n ) : 'unknown';\n const rightType = rightSchema ? this.getFieldTypeRecursive(\n rightSchema,\n indent,\n maxDepth,\n currentDepth + 1,\n visitedSchemas\n ) : 'unknown';\n return `${leftType} & ${rightType}`;\n case 'lazy':\n return 'lazy<...>';\n case 'void':\n case 'undefined':\n case 'never':\n return zodType;\n case 'pipe':\n const pipeInSchema = getZodDefSchemaProperty(fieldSchema, 'in');\n if (!pipeInSchema) return 'pipe[unknown]';\n const pipeInnerType = this.getFieldTypeRecursive(\n pipeInSchema,\n indent,\n maxDepth,\n currentDepth,\n visitedSchemas\n );\n return `pipe[${pipeInnerType}]`;\n case 'transform':\n return 'transform';\n case 'custom':\n return 'custom';\n default:\n return zodType || 'unknown';\n }\n }\n\n\n /**\n * Check if a field is optional\n */\n private static isFieldOptional(fieldSchema: any): boolean {\n // Check if it's wrapped in ZodOptional\n if (isZodOptional(fieldSchema)) return true;\n\n // Check if it's a ZodDefault (has default value)\n if (isZodDefault(fieldSchema)) return true;\n\n return false;\n }\n\n /**\n * Apply inheritance to mainSchema based on inheritance definition\n * Creates discriminated union schemas when inheritance is defined\n *\n * NOTE: This transfers inheritance logic from relationship cascading mechanism\n * to schema-level processing, ensuring inheritance affects DTOs properly.\n *\n * NOTE: TDatabaseSchema has been removed. Backend-only fields are now marked with\n * the `isBackendOnly` decorator and stripped at the service layer.\n */\n private static applyInheritanceToSchema<\n TMainSchema extends z.ZodTypeAny\n >(\n mainSchema: TMainSchema,\n inheritanceDefinition: any,\n processedInheritanceSchemas: Map<string, z.ZodTypeAny>\n ): TMainSchema {\n\n // If no inheritance definition, return original schema\n if (!inheritanceDefinition || !inheritanceDefinition.inheritedSchemas ||\n inheritanceDefinition.inheritedSchemas.length === 0) {\n return mainSchema;\n }\n\n const cacheKey = `${JSON.stringify(inheritanceDefinition)}_main`;\n\n // Check cache first\n if (processedInheritanceSchemas.has(cacheKey)) {\n return processedInheritanceSchemas.get(cacheKey)! as TMainSchema;\n }\n\n const { discriminatorField, inheritedSchemas, withoutInheritanceDiscriminatorFieldValues } = inheritanceDefinition;\n\n // Build discriminated union options for mainSchema\n const mainSchemaOptions: z.ZodTypeAny[] = [];\n\n // Add base schema for non-inherited values if specified\n if (withoutInheritanceDiscriminatorFieldValues && withoutInheritanceDiscriminatorFieldValues.length > 0) {\n // Create enum for base discriminator values.\n // Mark it with the isDiscriminator decorator so EVERY union option's\n // discriminator field is uniformly recognized as a discriminator (and not\n // mistaken for an auto-populated literal by the request-DTO omission logic).\n const baseDiscriminatorEnum = addDiscriminator(\n z.enum(withoutInheritanceDiscriminatorFieldValues as [string, ...string[]]),\n { baseValues: withoutInheritanceDiscriminatorFieldValues as string[] }\n );\n\n // Extend mainSchema with discriminator field\n const baseMainSchema = this.extendSchemaWithDiscriminator(mainSchema, discriminatorField, baseDiscriminatorEnum);\n\n mainSchemaOptions.push(baseMainSchema);\n }\n\n // Process each inherited schema\n inheritedSchemas.forEach((inheritedItem: any) => {\n const { discriminatorFieldValue, schema: inheritedSchema } = inheritedItem;\n\n // Create literal discriminator for this variant.\n // It MUST carry the isDiscriminator decorator: `mergeInheritedSchema`\n // overwrites the variant's discriminator field with this value, dropping\n // the decorator `createSchemaFamily` originally applied. Without it, the\n // request-DTO builder's `isNonDiscriminatorLiteral` check would strip the\n // discriminator from CREATE/UPDATE DTOs, producing a structurally-invalid\n // discriminated union (Zod: \"Invalid discriminated union option\").\n const discriminatorLiteral = addDiscriminator(\n z.literal(discriminatorFieldValue),\n { baseValues: withoutInheritanceDiscriminatorFieldValues as string[] | undefined }\n );\n\n // Merge inherited schema with base schema and add discriminator\n const mergedMainSchema = this.mergeInheritedSchema(mainSchema, inheritedSchema, discriminatorField, discriminatorLiteral);\n\n mainSchemaOptions.push(mergedMainSchema);\n\n // Handle nested inheritance recursively\n if (inheritedItem.inheritenceSchemaDefinition) {\n const nestedMain = this.applyInheritanceToSchema(\n mergedMainSchema,\n inheritedItem.inheritenceSchemaDefinition,\n processedInheritanceSchemas\n );\n\n // Replace the simple merged schema with the nested enhanced one\n mainSchemaOptions[mainSchemaOptions.length - 1] = nestedMain;\n }\n });\n\n // Create discriminated union if we have multiple options\n let enhancedMainSchema: z.ZodTypeAny;\n\n if (mainSchemaOptions.length > 1) {\n // Check if all schemas are ZodObject types to use discriminated union\n const allMainAreObjects = mainSchemaOptions.every(schema =>\n isZodObject(schema)\n );\n\n if (allMainAreObjects) {\n // Use discriminated union for object schemas\n enhancedMainSchema = z.discriminatedUnion(\n discriminatorField,\n mainSchemaOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n );\n } else {\n // Fallback to regular union for mixed types\n enhancedMainSchema = z.union(mainSchemaOptions as [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]);\n }\n } else if (mainSchemaOptions.length === 1) {\n enhancedMainSchema = mainSchemaOptions[0];\n } else {\n // Fallback to original schema\n enhancedMainSchema = mainSchema;\n }\n\n // Cache the result\n processedInheritanceSchemas.set(cacheKey, enhancedMainSchema);\n\n return enhancedMainSchema as TMainSchema;\n }\n\n /**\n * Extend a schema with a discriminator field\n */\n private static extendSchemaWithDiscriminator(\n baseSchema: z.ZodTypeAny,\n discriminatorField: string,\n discriminatorSchema: z.ZodTypeAny\n ): z.ZodTypeAny {\n\n // If base schema is not an object, wrap it in an object with the discriminator\n if (!isZodObject(baseSchema)) {\n return z.object({\n [discriminatorField]: discriminatorSchema,\n value: baseSchema\n });\n }\n\n // Extend existing object schema with discriminator field\n // Type guard already ensures it's a ZodObject\n return baseSchema.extend({\n [discriminatorField]: discriminatorSchema\n });\n }\n\n /**\n * Merge inherited schema with base schema and add discriminator\n */\n private static mergeInheritedSchema(\n baseSchema: z.ZodTypeAny,\n inheritedSchema: z.ZodTypeAny,\n discriminatorField: string,\n discriminatorValue: z.ZodTypeAny\n ): z.ZodTypeAny {\n\n // If both are object schemas, merge them\n if (isZodObject(baseSchema) && isZodObject(inheritedSchema)) {\n\n // Merge the two object schemas and add discriminator (using extend instead of merge in Zod v4)\n const mergedSchema = baseSchema.extend(inheritedSchema.shape);\n return mergedSchema.extend({\n [discriminatorField]: discriminatorValue\n });\n }\n\n // If only inherited schema is an object, extend it with discriminator\n if (isZodObject(inheritedSchema)) {\n // Type guard already ensures it's a ZodObject\n return inheritedSchema.extend({\n [discriminatorField]: discriminatorValue\n });\n }\n\n // Fallback: create object with discriminator and value\n return z.object({\n [discriminatorField]: discriminatorValue,\n value: inheritedSchema\n });\n }\n\n // =============================================================================\n // NESTED OPERATIONS DTO BUILDING\n // =============================================================================\n\n private static getAllResourceFieldIdentifiers(\n resourceRegistry: Map<ResourceType, any>\n ): Partial<Record<ResourceType, string>> {\n const allResourceFieldIdentifiers: Partial<Record<ResourceType, string>> = {};\n\n for (const [resourceType, resourceConfig] of resourceRegistry.entries()) {\n if (typeof resourceConfig?.resourceFieldIdentifier === 'string' && resourceConfig.resourceFieldIdentifier.length > 0) {\n allResourceFieldIdentifiers[resourceType] = resourceConfig.resourceFieldIdentifier;\n }\n }\n\n return allResourceFieldIdentifiers;\n }\n\n /**\n * Derive nested field name from the relationship identifier.\n */\n private static getNestedFieldName(\n rel: ResourceRelationship,\n resourceRegistry: Map<ResourceType, any>\n ): string {\n return Resources_SharedUtils.resolveRelationshipObjectIdentity(\n rel,\n rel.resourceType2,\n rel.cardinality2,\n this.getAllResourceFieldIdentifiers(resourceRegistry)\n ).objectFieldName;\n }\n\n private static getRelationshipObjectFieldName(\n rel: Pick<ResourceRelationship, 'foreignKeyField' | 'resourceType1' | 'resourceType2'>,\n relatedResourceType: ResourceType,\n cardinality: ResourceRelationshipCardinality,\n resourceRegistry: Map<ResourceType, any>\n ): string {\n return Resources_SharedUtils.resolveRelationshipObjectIdentity(\n rel,\n relatedResourceType,\n cardinality,\n this.getAllResourceFieldIdentifiers(resourceRegistry)\n ).objectFieldName;\n }\n\n /**\n * Get delete field name: _{nestedField}ToDelete\n */\n private static getDeleteFieldName(nestedFieldName: string): string {\n return `_${nestedFieldName}ToDelete`;\n }\n\n /**\n * Build child schema for nested operations based on operation type and config.\n * For CREATE: uses child's CREATE request DTO\n * For UPDATE: uses union of CREATE (no _id) and UPDATE (with _id) DTOs\n */\n private static buildNestedChildSchema(\n rel: ResourceRelationship,\n nestedConfig: ChildNestedMutationConfig | ChildNestedMutationConfig_Parsed,\n operation: CoreResourceOperation,\n childMainSchema: z.ZodTypeAny,\n resourceRegistry: Map<ResourceType, any>\n ): z.ZodTypeAny {\n const childResourceType = rel.resourceType2;\n\n // Get child's operation config to find request DTOs\n const childConfig = resourceRegistry.get(childResourceType);\n if (!childConfig || !childConfig.operations) {\n // Fallback: use child's main schema with appropriate omissions\n if (operation === CoreResourceOperation.CREATE || operation === CoreResourceOperation.CREATE_MANY) {\n return this.createRequestDtoForCreate(childMainSchema);\n } else {\n return this.createRequestDtoForUpdate(childMainSchema);\n }\n }\n\n // Find child's CREATE operation for request DTO\n const childCreateOp = childConfig.operations.find(\n (op: any) => op.operationIdentifier === CoreResourceOperation.CREATE ||\n op.resourceOperationLike === CoreResourceOperation.CREATE\n );\n const childCreateDto = childCreateOp?.requestDto || this.createRequestDtoForCreate(childMainSchema);\n\n if (operation === CoreResourceOperation.CREATE || operation === CoreResourceOperation.CREATE_MANY) {\n // For CREATE: use child's CREATE DTO\n return childCreateDto;\n }\n\n // For UPDATE: use union of CREATE (no _id) and UPDATE (with _id) DTOs\n const childUpdateOp = childConfig.operations.find(\n (op: any) => op.operationIdentifier === CoreResourceOperation.UPDATE ||\n op.resourceOperationLike === CoreResourceOperation.UPDATE\n );\n const childUpdateDto = childUpdateOp?.requestDto || this.createRequestDtoForUpdate(childMainSchema);\n\n // Create union: items without _id are creates, items with _id are updates\n // In Zod 4, we use z.union for discriminated unions or z.union for simple unions\n if (isZodObject(childCreateDto) && isZodObject(childUpdateDto)) {\n // Explicitly forbid _id on the create branch so _id-bearing payloads are\n // routed through the update branch instead of being accepted as creates and\n // only failing later in downstream child UPDATE validation.\n const createWithoutId = childCreateDto.extend({\n _id: z.never().optional()\n });\n\n // UPDATE DTO should have _id as required\n // `.extend()` returns a fresh object without the child UPDATE DTO's metadata; its PATCH write\n // rule has to survive, or a form reads the update branch as written whole (#989).\n const updateWithRequiredId = this.preserveSchemaMetadata(childUpdateDto, childUpdateDto.extend({\n _id: z.string()\n }));\n\n return z.union([updateWithRequiredId, createWithoutId]);\n }\n\n // Fallback: use UPDATE DTO\n return childUpdateDto;\n }\n\n /**\n * Get child schema for a specific DataMode (for nested READ responses).\n * - RAW: All stored fields, no population\n * - SUMMARY: Summary fields only (fields with isSummaryField decorator)\n * - CONTEXT: Full context (all fields with contextPolicy applied)\n *\n * Note: CONTEXT mode requires service-layer processing (contextPolicy application),\n * so we return the full schema here. The service layer will apply contextPolicy.\n */\n private static getChildSchemaForDataMode(\n childMainSchema: z.ZodTypeAny,\n dataMode: DataMode\n ): z.ZodTypeAny {\n switch (dataMode) {\n case DataMode.SUMMARY:\n // Use ResourcesSummaryUtils to derive summary schema (only fields with isSummaryField decorator)\n if (isZodObject(childMainSchema)) {\n return ResourcesSummaryUtils.deriveSummarySchema(childMainSchema, {\n includeId: true, // Always include _id in summaries\n includeForeignKeys: false, // Only include FKs if they have isSummaryField decorator\n });\n }\n // Fallback for non-object schemas\n return childMainSchema;\n\n case DataMode.CONTEXT:\n // CONTEXT mode requires service-layer processing (contextPolicy, population, etc.)\n // Return full schema - service layer will apply contextPolicy\n return childMainSchema;\n\n case DataMode.RAW:\n default:\n // RAW mode: return full schema (all stored fields)\n return childMainSchema;\n }\n }\n\n /**\n * Extend a DTO root that may be either a plain object or a discriminated\n * union of objects.\n *\n * Relationship-driven nested fields must exist on every variant of a\n * polymorphic DTO root; otherwise the shared contract silently diverges from\n * the live frontend form/runtime path.\n */\n private static extendObjectLikeDto(\n baseDto: z.ZodTypeAny,\n extensionShape: Record<string, z.ZodTypeAny>,\n ): z.ZodTypeAny {\n if (Object.keys(extensionShape).length === 0) {\n return baseDto;\n }\n\n if (isZodObject(baseDto)) {\n // Carry the base DTO's metadata (its PATCH write rule among it) across the extension (#989).\n return this.preserveSchemaMetadata(baseDto, baseDto.extend(extensionShape));\n }\n\n const zodType = getZodType(baseDto);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(baseDto, 'discriminator');\n const unionOptions = getZodDefArrayProperty(baseDto, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && unionOptions && unionOptions.length > 0) {\n const extendedOptions = unionOptions.map((option) =>\n isZodObject(option)\n ? this.preserveSchemaMetadata(option, option.extend(extensionShape))\n : option,\n );\n\n if (extendedOptions.every((option) => isZodObject(option))) {\n if (extendedOptions.length >= 2) {\n return z.discriminatedUnion(\n discriminator,\n extendedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]],\n );\n }\n\n if (extendedOptions.length === 1) {\n return extendedOptions[0];\n }\n }\n }\n }\n\n return baseDto;\n }\n \n\n /**\n * Build request DTO with nested children based on config.\n * Extends the base request DTO with nested child fields for CREATE/UPDATE operations.\n *\n * ## Deliberate Condition-Agnosticism\n *\n * This method iterates ALL child relationships whose compiled runtime\n * semantics expose a current effective nested projection,\n * regardless of whether they carry a `discriminator` or `condition`.\n * It generates DTO fields for every such relationship unconditionally.\n *\n * This is intentional: DTO generation is a STARTUP concern — it defines the shape\n * of all possible request/response schemas. Conditional filtering is a RUNTIME\n * concern handled by:\n * - `ServicesRegistryHandler.filterRelationshipsByParent()` — which filters\n * active relationships before processing nested data in CREATE/UPDATE\n * - `ResourceContextBackendService.fetchChildResourcesWithPolicy()` — which\n * filters active relationships before fetching children in context\n *\n * If the DTO builder filtered by discriminator at startup, the nested fields\n * would be missing from the schema entirely, and runtime data for those fields\n * would be silently dropped during Zod validation.\n */\n static buildRequestDtoWithNested(\n operation: CoreResourceOperation,\n baseDto: z.ZodTypeAny,\n childRelationships: ResourceRelationship[],\n resourceRegistry: Map<ResourceType, any>\n ): z.ZodTypeAny {\n if (operation === CoreResourceOperation.CREATE_MANY) {\n const baseShape = isZodObject(baseDto) ? getZodObjectShape(baseDto) : undefined;\n const dataSchema = baseShape?.data;\n\n if (dataSchema instanceof z.ZodArray) {\n const nestedItemDto = this.buildRequestDtoWithNested(\n CoreResourceOperation.CREATE,\n dataSchema.element as z.ZodTypeAny,\n childRelationships,\n resourceRegistry\n );\n\n return this.extendObjectLikeDto(baseDto, {\n data: z.array(nestedItemDto),\n });\n }\n }\n\n const nestedFields: Record<string, z.ZodTypeAny> = {};\n const allResourceFieldIdentifiers = this.getAllResourceFieldIdentifiers(resourceRegistry);\n\n for (const rel of childRelationships) {\n const compiledRel = Resources_SharedUtils.ensureCompiledRelationship(\n rel,\n allResourceFieldIdentifiers\n );\n const nestedConfig = Resources_SharedUtils.resolveRelationshipNestedMutationConfig(\n compiledRel,\n operation\n );\n\n if (!nestedConfig) continue;\n\n const fieldName = this.getNestedFieldName(compiledRel, resourceRegistry);\n const childConfig = resourceRegistry.get(compiledRel.resourceType2);\n if (!childConfig) continue;\n\n const childSchema = this.buildNestedChildSchema(\n compiledRel,\n nestedConfig as ChildNestedMutationConfig_Parsed,\n operation,\n childConfig.mainSchema,\n resourceRegistry\n );\n\n // Add nested field (array for 1:N/N:N, object for 1:1)\n nestedFields[fieldName] = isArrayCardinality(compiledRel.cardinality2)\n ? z.array(childSchema).optional()\n : childSchema.optional();\n\n // Add delete field if allowDelete (for UPDATE only)\n if (nestedConfig.allowDelete &&\n (operation === CoreResourceOperation.UPDATE || operation === CoreResourceOperation.UPDATE_MANY)) {\n nestedFields[this.getDeleteFieldName(fieldName)] = z.array(z.string()).optional();\n }\n }\n\n return this.extendObjectLikeDto(baseDto, nestedFields);\n }\n\n /**\n * Build response DTO with nested children based on onRead config.\n * Extends the base response DTO with nested child fields for READ operations.\n *\n * Like `buildRequestDtoWithNested`, this is deliberately condition-agnostic —\n * it generates response DTO fields for ALL relationships whose compiled\n * runtime semantics expose an effective nested-read projection, regardless of\n * discriminator/condition. The fields are optional (`z.optional()`), so when\n * the runtime skips a conditional relationship, the field is simply absent\n * from the response rather than causing a schema validation error.\n */\n static buildResponseDtoWithNested(\n baseDto: z.ZodTypeAny,\n childRelationships: ResourceRelationship[],\n resourceRegistry: Map<ResourceType, any>\n ): z.ZodTypeAny {\n const nestedFields: Record<string, z.ZodTypeAny> = {};\n const allResourceFieldIdentifiers = this.getAllResourceFieldIdentifiers(resourceRegistry);\n\n for (const rel of childRelationships) {\n const compiledRel = Resources_SharedUtils.ensureCompiledRelationship(\n rel,\n allResourceFieldIdentifiers\n );\n const readConfig = Resources_SharedUtils.resolveRelationshipNestedReadConfig(compiledRel);\n if (!readConfig) continue;\n\n const fieldName = this.getNestedFieldName(compiledRel, resourceRegistry);\n const childConfig = resourceRegistry.get(compiledRel.resourceType2);\n if (!childConfig) continue;\n\n const childSchema = this.getChildSchemaForDataMode(\n childConfig.mainSchema,\n readConfig.dataMode\n );\n\n // Add nested field (array for 1:N/N:N, object for 1:1)\n nestedFields[fieldName] = isArrayCardinality(compiledRel.cardinality2)\n ? z.array(childSchema).optional()\n : childSchema.optional();\n }\n\n return this.extendObjectLikeDto(baseDto, nestedFields);\n }\n\n /**\n * Schema-guided value walk that locates every `.isWriteOnlySecret()` field in\n * a runtime object and hands the holding object + field name to `visitSecret`.\n *\n * Mirrors the unwrap/recursion structure of {@link stripBackendOnlyFields} but\n * operates on VALUES, not schemas. It mutates in place (callers pass a freshly\n * `.parse()`'d body or a to-be-validated input, both safe to mutate). For\n * discriminated unions it recurses EVERY variant against the single value —\n * safe because both leaf actions (mask/strip) are guarded (mask only a present\n * value; strip only the exact sentinel), so fields belonging to a non-matching\n * variant are simply absent and no-op.\n */\n private static walkWriteOnlySecretValues(\n schema: z.ZodTypeAny,\n value: unknown,\n visitSecret: (holder: Record<string, unknown>, fieldName: string) => void,\n ): void {\n if (value === null || value === undefined) {\n return;\n }\n\n // Unwrap optional / nullable / default wrappers — same value, inner schema.\n if (isZodOptional(schema) || hasZodType(schema, 'nullable') || isZodDefault(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny | undefined;\n if (innerSchema) {\n this.walkWriteOnlySecretValues(innerSchema, value, visitSecret);\n }\n return;\n }\n\n // Unions (incl. discriminated) — recurse every object variant.\n if (getZodType(schema) === 'union') {\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n if (unionOptions) {\n for (const option of unionOptions) {\n this.walkWriteOnlySecretValues(option, value, visitSecret);\n }\n }\n return;\n }\n\n // Arrays — recurse each element against the element schema.\n if (isZodArray(schema) && Array.isArray(value)) {\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny | undefined;\n if (elementSchema) {\n for (const item of value) {\n this.walkWriteOnlySecretValues(elementSchema, item, visitSecret);\n }\n }\n return;\n }\n\n // Objects — visit write-only-secret fields, recurse the rest.\n if (isZodObject(schema) && typeof value === 'object' && !Array.isArray(value)) {\n const shape = getZodObjectShape(schema);\n const holder = value as Record<string, unknown>;\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isWriteOnlySecretField(fieldSchema as z.ZodTypeAny)) {\n visitSecret(holder, fieldName);\n } else {\n this.walkWriteOnlySecretValues(fieldSchema as z.ZodTypeAny, holder[fieldName], visitSecret);\n }\n }\n }\n }\n\n /**\n * Redact every `.isWriteOnlySecret()` field in a client-facing response body to\n * {@link WRITE_ONLY_SECRET_MASK}. Applied at the client-serialization boundary\n * ONLY (`serializeOperationResultForResponse`), never at the service dispatch /\n * `transformOutput` tier — internal reads (`readAsSystem`, repository\n * `read<T>()`) must keep the real value so backend consumers (e.g. a webhook\n * signer) can use it. Returns the same (mutated) value for call-site ergonomics.\n */\n static maskWriteOnlySecretFields<T>(schema: z.ZodTypeAny, value: T): T {\n this.walkWriteOnlySecretValues(schema, value, (holder, fieldName) => {\n const current = holder[fieldName];\n if (current !== null && current !== undefined && current !== '') {\n holder[fieldName] = WRITE_ONLY_SECRET_MASK;\n }\n });\n return value;\n }\n\n /**\n * Strip any `.isWriteOnlySecret()` field whose incoming value equals the\n * {@link WRITE_ONLY_SECRET_MASK} sentinel from a CREATE/UPDATE input payload.\n * A client that renders the masked read value and submits it unchanged sends\n * the sentinel back; removing the field means the stored secret is preserved\n * (UPDATE is a partial `$set`). A genuinely new secret value is left intact.\n * Returns the same (mutated) value.\n */\n static stripWriteOnlySecretSentinel<T>(schema: z.ZodTypeAny, value: T): T {\n this.walkWriteOnlySecretValues(schema, value, (holder, fieldName) => {\n if (holder[fieldName] === WRITE_ONLY_SECRET_MASK) {\n delete holder[fieldName];\n }\n });\n return value;\n }\n\n /**\n * Strip fields marked with isBackendOnly decorator from schema.\n *\n * @param schema - Schema to strip from\n * @param options - Options for stripping behavior\n * @returns New schema without backend-only fields\n */\n private static stripBackendOnlyFields(\n schema: z.ZodTypeAny,\n options?: {\n respectIsReturnedAtCreation?: boolean; // Include fields with isReturnedAtCreation in CREATE responses\n operationType?: CoreResourceOperation; // Operation type for isReturnedAtCreation logic\n }\n ): z.ZodTypeAny {\n // Handle discriminated unions - strip from all variants\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && unionOptions && unionOptions.length > 0) {\n const strippedOptions = unionOptions.map((option: z.ZodTypeAny) =>\n this.stripBackendOnlyFields(option, options)\n );\n\n // Recreate discriminated union with modified variants\n if (strippedOptions.length >= 2) {\n return z.discriminatedUnion(\n discriminator,\n strippedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n );\n } else if (strippedOptions.length === 1) {\n return strippedOptions[0];\n }\n }\n\n return schema;\n }\n\n // Handle arrays - strip from array element schema.\n // `withArrayElement` rather than `z.array(...)`: a fresh array carries none of the original's\n // own `.min()` / `.max()` / `.length()` checks, which would silently drop an authored\n // collection-size constraint from the response contract.\n if (isZodArray(schema)) {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny;\n return withArrayElement(schema, this.stripBackendOnlyFields(elementSchema, options));\n }\n\n // Handle optional/nullable/default wrappers - unwrap, strip, rewrap\n if (isZodOptional(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.preserveSchemaMetadata(\n schema,\n this.stripBackendOnlyFields(innerSchema, options).optional(),\n );\n }\n\n if (hasZodType(schema, 'nullable')) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.preserveSchemaMetadata(\n schema,\n this.stripBackendOnlyFields(innerSchema, options).nullable(),\n );\n }\n\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n // ⚠️ Re-READ the default per parse, never carry a value across.\n //\n // In Zod 4 `def.defaultValue` is a GETTER: reading it EVALUATES the default\n // (`z.date().default(() => new Date())` yields a fresh Date on every read).\n // A DTO is rebuilt ONCE, when the resource configuration is built at process\n // start — so `.default(<value read here>)` freezes that instant into every\n // parse the process ever performs. Recovered 2026-08-11: lifecycle rows were\n // persisting `stageEnteredAt` / `lastActiveAt` stamped at backend boot,\n // identical to the millisecond across rows created a minute apart.\n //\n // Passing a FUNCTION makes Zod evaluate per parse. A literal default is\n // unaffected — the getter simply returns the same value each time.\n return this.preserveSchemaMetadata(\n schema,\n this.stripBackendOnlyFields(innerSchema, options).default(() => getZodDefProperty(schema, 'defaultValue')),\n );\n }\n\n // Handle objects - strip backend-only fields from shape\n if (isZodObject(schema)) {\n const shape = getZodObjectShape(schema);\n const omitObj: Record<string, true> = {};\n const rebuiltShape: Record<string, z.ZodTypeAny> = {};\n let didRebuildNestedField = false;\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isBackendOnlyField(fieldSchema as z.ZodTypeAny)) {\n const backendOnlyParams = getBackendOnlyParams(fieldSchema as z.ZodTypeAny);\n\n // Respect isReturnedAtCreation for CREATE operations\n if (options?.respectIsReturnedAtCreation &&\n options?.operationType === CoreResourceOperation.CREATE &&\n backendOnlyParams?.isReturnedAtCreation) {\n // Keep this field - it's returned at creation\n rebuiltShape[fieldName] = fieldSchema as z.ZodTypeAny;\n continue;\n }\n\n // Strip this backend-only field\n omitObj[fieldName] = true;\n } else {\n // Recursively strip from nested objects/arrays\n const strippedFieldSchema = this.stripBackendOnlyFields(fieldSchema as z.ZodTypeAny, options);\n rebuiltShape[fieldName] = strippedFieldSchema;\n didRebuildNestedField = didRebuildNestedField || strippedFieldSchema !== fieldSchema;\n }\n }\n\n if (Object.keys(omitObj).length > 0 || didRebuildNestedField) {\n return this.rebuildObjectSchema(schema, rebuiltShape, {\n preserveChecks: Object.keys(omitObj).length === 0,\n });\n }\n\n return schema;\n }\n\n // For other schema types (primitives, etc.), return as-is\n return schema;\n }\n\n /**\n * Transform network-boundary leaves recursively for API/WebSocket/Queue DTOs:\n * `z.date()` → string-accepting `z.coerce.date()`, and `z.bigint()` (notably\n * `z_money`'s `amount`) → a string-accepting bigint (see\n * {@link applyNetworkBoundaryCoercion} for why money bigints arrive as strings).\n *\n * This utility is used to create schemas suitable for parsing API responses/requests\n * where dates come as ISO strings and money amounts come as numeric strings, both of\n * which need to be coerced back to their runtime types (Date / bigint).\n *\n * Use this when parsing data from:\n * - HTTP API responses (JSON with date strings and bigint-as-string money amounts)\n * - WebSocket messages\n * - Queue messages\n * - Any external data source where dates/bigints are serialized as strings\n *\n * @param schema - Schema to transform (typically a database/internal schema with z.date()/z.bigint())\n * @returns New schema with coerced dates + bigints suitable for API parsing\n *\n * @example\n * ```typescript\n * // Database schema uses z.date()\n * const dbSchema = z.object({ createdAt: z.date() });\n *\n * // Create API parsing schema\n * const apiSchema = ResourcesConfigOperationsDtosBuilderUtils.createApiParsingSchema(dbSchema);\n *\n * // Now can parse API response with date strings\n * const data = apiSchema.parse({ createdAt: \"2024-01-01T00:00:00Z\" }); // Works!\n * ```\n */\n static createApiParsingSchema<T extends z.ZodTypeAny>(schema: T): T {\n return this.applyNetworkBoundaryCoercion(schema) as T;\n }\n\n /**\n * Recursively transpose the two network-boundary leaf types that do NOT survive\n * a JSON round-trip as their runtime type — `z.date()` and `z.bigint()` — into\n * string-accepting forms, walking union / array / optional / nullable / default /\n * object wrappers so nested and optional leaves are covered identically.\n *\n * This is the INBOUND (coerce, string → runtime type) half of the network-boundary\n * contract. Its OUTBOUND (serialize, runtime type → wire string) counterpart is\n * `Date.prototype.toJSON` (built-in) for dates and `BigInt.prototype.toJSON`\n * (installed by `installBigIntJsonEncoding` in `@wildo-ai/zod-decorators`) for\n * money bigints. Because the SAME coerced `responseDto`/`requestDto` this produces\n * is parsed on BOTH sides, the backend serialize-parse, the frontend\n * receive-parse, and worker queue re-hydration all coerce identically. See the\n * full mechanism map in `install-bigint-json-encoding.ts`.\n *\n * **Why `z.bigint()` needs this (the `z_money` case).** `z_money().amount` is a\n * `z.bigint()`. The Zod→Mongoose convertor persists bigint as a Mongoose **String**\n * column (with a `v → BigInt(v)` getter), but reads go through `.lean()` /\n * `toObject` WITHOUT `{ getters: true }`, so the value that reaches the DTO layer\n * is the raw **string** (e.g. `\"1999\"`), and over the JSON wire a bigint is always\n * serialized as a string too. A strict `z.bigint().parse(\"1999\")` then throws\n * `expected bigint, received string` in the service-layer `transformOutput`. This\n * pass rewrites every `z.bigint()` leaf to first coerce a string to `BigInt`, so\n * the same strict schema now accepts the on-wire/from-DB string form. It mirrors\n * the `z.date()` → `z.coerce.date()` transposition exactly — both are \"the runtime\n * type does not round-trip through JSON, accept its string form on read\" fixes.\n *\n * The bigint leaf is wrapped with `z.preprocess` over the ORIGINAL schema (rather\n * than a fresh `z.coerce.bigint()`) specifically to **preserve any `.min()`/`.max()`\n * checks** — e.g. `z_money({ minAmount: 0n })` compiles to `z.bigint().min(0n)`,\n * whose non-negativity check must survive the coercion. `z.coerce.bigint()` would\n * silently drop those checks; preprocessing the untouched schema keeps them intact.\n *\n * z_money field coverage this pass restores (each parses after coercion):\n * `prices.unitPrice`, `prices.tiers[].unitPrice`, `prices.tiers[].flatPrice`\n * (array-nested), `invoiceRefs.total`, `promotions.discountFixedAmount` (optional),\n * `productDefinitions.unitPrice`.\n *\n * @param schema - Schema to transform (typically a database/internal schema with z.date()/z.bigint())\n * @returns New schema with coerced dates + string-accepting bigints\n */\n private static applyNetworkBoundaryCoercion(schema: z.ZodTypeAny): z.ZodTypeAny {\n // Handle discriminated unions - transform dates in all variants\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && unionOptions && unionOptions.length > 0) {\n const transformedOptions = unionOptions.map((option: z.ZodTypeAny) =>\n this.applyNetworkBoundaryCoercion(option)\n );\n\n if (transformedOptions.length >= 2) {\n return z.discriminatedUnion(\n discriminator,\n transformedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n );\n } else if (transformedOptions.length === 1) {\n return transformedOptions[0];\n }\n }\n\n return schema;\n }\n\n // Handle arrays - transform dates in array element schema.\n // `withArrayElement` rather than `z.array(...)`: this walk runs over EVERY operation DTO,\n // including an author-supplied `requestDto`, so rebuilding bare here is what stripped\n // authored `.min()` / `.max()` constraints out of request validation.\n if (isZodArray(schema)) {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny;\n return withArrayElement(schema, this.applyNetworkBoundaryCoercion(elementSchema));\n }\n\n // Handle optional/nullable/default wrappers - unwrap, transform, rewrap\n if (isZodOptional(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.preserveSchemaMetadata(\n schema,\n this.applyNetworkBoundaryCoercion(innerSchema).optional(),\n );\n }\n\n if (hasZodType(schema, 'nullable')) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.preserveSchemaMetadata(\n schema,\n this.applyNetworkBoundaryCoercion(innerSchema).nullable(),\n );\n }\n\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n // Per-parse re-read — see the note on the `stripBackendOnlyFields` default\n // branch: a materialized default freezes at DTO-build time (process start).\n return this.preserveSchemaMetadata(\n schema,\n this.applyNetworkBoundaryCoercion(innerSchema).default(() => getZodDefProperty(schema, 'defaultValue')),\n );\n }\n\n // Handle pipe/refine chains (`.transform()` / `.refine()` — e.g. `z_phone()`,\n // which is `z.string().transform(...).refine(...).transform(...)`, or a bare\n // `z.coerce.date()`). Return the schema UNCHANGED.\n //\n // Rationale: a pipe/refine chain is an opaque validation+normalization pipeline\n // over a primitive. Framework `z.date()` leaves NEVER live inside such a chain —\n // dates are only ever wrapped in optional/nullable/default/array/object/union —\n // so there is nothing for date-coercion to rewrite here.\n //\n // Rejected alternative (the prior implementation): unwrap the inner schema,\n // coerce it, and return that inner. This is doubly wrong — (1) in Zod 4 the pipe\n // input lives at `def.in`, not the Zod-3-era `def.schema`, so the unwrap read\n // `undefined` and any surrounding `.optional()/.nullable()/.default()` then\n // crashed with \"Cannot read properties of undefined (reading 'optional')\" the\n // moment a pipe field (e.g. `z_phone().optional()`) reached this branch; and\n // (2) even reading `def.in` correctly, returning the bare inner would silently\n // DROP the pipe's transform/refine steps (e.g. `z_phone`'s E.164 normalization\n // and validation) from every request/response/summary DTO. Preserving the whole\n // pipe atomically is the only semantically-faithful behavior.\n if (hasZodType(schema, 'pipe') || hasZodType(schema, 'refine')) {\n return schema;\n }\n\n // Handle date - transform to coerce.date\n if (hasZodType(schema, 'date')) {\n // Always transform to coerce.date for DTOs (API/WebSocket/Queue communication)\n // This allows string dates from JSON to be coerced to Date objects\n return this.preserveSchemaMetadata(schema, z.coerce.date());\n }\n\n // Handle bigint - accept the on-wire/from-DB string form and coerce to bigint.\n //\n // z_money's `amount` is a z.bigint(); bigint never round-trips through JSON as a\n // bigint (it serializes as a string) and the Mongoose String-backed storage + a\n // getterless .lean()/toObject read also yield the raw string. Wrapping the\n // ORIGINAL schema in z.preprocess (instead of z.coerce.bigint()) preserves any\n // .min()/.max() checks compiled from z_money({ minAmount/maxAmount }). Non-string\n // inputs pass through untouched so an in-process bigint stays a bigint and any\n // genuinely-wrong type is still reported by the underlying strict bigint schema.\n if (hasZodType(schema, 'bigint')) {\n return this.preserveSchemaMetadata(schema, z.preprocess(\n (value) => (typeof value === 'string' ? BigInt(value) : value),\n schema\n ));\n }\n\n // Handle objects - transform dates in shape\n if (isZodObject(schema)) {\n const shape = getZodObjectShape(schema);\n const transformedShape: Record<string, z.ZodTypeAny> = {};\n let didTransformAnyField = false;\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const transformedFieldSchema = this.applyNetworkBoundaryCoercion(fieldSchema as z.ZodTypeAny);\n transformedShape[fieldName] = transformedFieldSchema;\n didTransformAnyField = didTransformAnyField || transformedFieldSchema !== fieldSchema;\n }\n\n if (!didTransformAnyField) {\n return schema;\n }\n\n return this.rebuildObjectSchema(schema, transformedShape);\n }\n\n // For other schema types (primitives, etc.), return as-is\n return schema;\n }\n\n /**\n * Extract summary fields (isSummaryField decorator) from schema.\n * Handles discriminated unions by extracting from each variant.\n *\n * @param schema - Schema to extract from\n * @returns New schema with only summary fields\n */\n private static extractSummaryFields(schema: z.ZodTypeAny): z.ZodTypeAny {\n // Handle discriminated unions - extract summary from each variant\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && unionOptions && unionOptions.length > 0) {\n // Use ResourcesSummaryUtils.deriveSummarySchemaForDiscriminatedUnion if all options are objects\n const allAreObjects = unionOptions.every(opt => isZodObject(opt));\n if (allAreObjects) {\n try {\n return ResourcesSummaryUtils.deriveSummarySchemaForDiscriminatedUnion(\n schema as unknown as z.ZodObject<z.ZodRawShape>,\n {\n discriminatorField: discriminator,\n withoutInheritanceDiscriminatorFieldValues: []\n } as any\n );\n } catch {\n // Fallback: extract from each variant individually (see lines below)\n }\n }\n\n // Extract summary from each variant and rebuild union\n const summaryOptions = unionOptions.map((option: z.ZodTypeAny) =>\n this.extractSummaryFields(option)\n ).filter(opt => opt !== null && opt !== undefined);\n\n if (summaryOptions.length >= 2) {\n return z.discriminatedUnion(\n discriminator,\n summaryOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n );\n } else if (summaryOptions.length === 1) {\n return summaryOptions[0];\n }\n }\n\n return schema;\n }\n\n // Handle arrays - extract summary from array element schema.\n // `withArrayElement` rather than `z.array(...)`, for the same reason as the two walkers above:\n // a fresh array carries none of the original's own `.min()` / `.max()` / `.length()` checks.\n if (isZodArray(schema)) {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny;\n return withArrayElement(schema, this.extractSummaryFields(elementSchema));\n }\n\n // Handle optional/nullable/default wrappers - unwrap, extract, rewrap\n if (isZodOptional(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.extractSummaryFields(innerSchema).optional();\n }\n\n if (hasZodType(schema, 'nullable')) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.extractSummaryFields(innerSchema).nullable();\n }\n\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n // Per-parse re-read — see the note on the `stripBackendOnlyFields` default\n // branch: a materialized default freezes at DTO-build time (process start).\n return this.extractSummaryFields(innerSchema).default(() => getZodDefProperty(schema, 'defaultValue'));\n }\n\n // Handle objects - use ResourcesSummaryUtils.deriveSummarySchema\n if (isZodObject(schema)) {\n try {\n // Pure summary-field extraction — NO network-boundary coercion here.\n // Network-boundary transposition (z.date() → z.coerce.date() AND\n // string-accepting z.bigint() for z_money amounts) is applied UNIFORMLY by\n // the caller (`buildAllOperationDtos`) over the fully-resolved summary\n // schema, mirroring how requestDto/responseDto/internalDto are coerced.\n // Coercing per-branch here is what let the discriminated-union branch (and\n // the no-summary-fields fallback) silently ship strict z.date()/z.bigint()\n // summary DTOs that reject ISO-string dates / bigint-as-string amounts.\n return ResourcesSummaryUtils.deriveSummarySchema(schema, {\n includeId: true,\n includeForeignKeys: false\n });\n } catch (error) {\n throw new Error(`Failed to derive summary schema for object: ${describeCaughtError(error)}`);\n }\n }\n\n // For other schema types (primitives, etc.), return as-is\n return schema;\n }\n\n /**\n * The schema ONE populated context relative (a parent, or a child row) is described by.\n *\n * ## Why a typed schema, and why this shape (#1189)\n *\n * A populated relative used to be `z.record(z.string(), z.any())`, which types every embedded\n * value as `any`. `applyNetworkBoundaryCoercion` has nothing to walk inside that, so every\n * `z.date()` and `z.bigint()` leaf INSIDE an embed stayed in its wire form — an ISO string, or a\n * decimal string for a money amount — while the value's declared type said `Date` / `bigint`.\n *\n * Measured 2026-09-15: on sign-in, `privacy.consentDecidedAt` reached the frontend as a string\n * inside `userSelfPreferences` (a 1:1 child of the USER_SELF context read). The preferences event\n * validated it against the in-memory `z.date()` and the whole event was dropped, so language,\n * regional, theme and consent preferences all failed to reach their providers.\n *\n * ## The schema can only ADD coercion — never a refusal, never a strip\n *\n * Three properties, each load-bearing:\n *\n * - **Every field is OPTIONAL** (`.partial()`). What an embed actually carries depends on the\n * producer's projection and on `objectMode`, so a REQUIRED field would turn a response that\n * parses today into a hard validation failure — strictly worse than an uncoerced string.\n * - **Unknown keys PASS THROUGH** (`.loose()`). Declaring a shape must not strip what the shape\n * does not mention. `z.object({ _id })` was tried for parents and dropped every SUMMARY/FULL\n * field they carried (#579); this keeps that class unrepresentable.\n * - **The shape follows the relationship's resolved `objectMode`**, so a SUMMARY embed is typed by\n * the related resource's summary fields and a FULL embed by its whole schema. The\n * per-operation override is honoured, because these DTOs are built per operation.\n *\n * Falls back to the untyped record — i.e. exactly the previous behaviour — whenever the related\n * schema cannot be read: an ID_ONLY relative (a bare reference has no leaf to coerce), a registry\n * that does not hold the related resource, or a related schema that is not a plain object. The\n * factory pass builds DTOs against an EMPTY registry, so it takes that fallback for everything and\n * the typed form appears at `rebuildResourceConfigurationsOperationDtos`, which every serving and\n * documenting consumer runs.\n *\n * A POLYMORPHIC relative is typed by its base object, so the variants' own fields pass through\n * loose and uncoerced. That is a partial improvement rather than a regression, and it is the same\n * fallback reasoning: a discriminated union has no `.partial()`.\n *\n * @param relatedResourceType - The resource on the other side of the relationship\n * @param contextPolicy - That relationship's context policy (its `objectMode` decides the shape)\n * @param effectiveOperation - The operation these DTOs are being built for, for `operationOverrides`\n * @param registry - Resource registry; empty during the factory pass\n * @returns A single-object schema for one relative (callers wrap it in `.optional()` / `z.array`)\n */\n private static buildContextRelativeObjectSchema(\n relatedResourceType: ResourceType,\n contextPolicy: RelationshipContextPolicy | undefined,\n effectiveOperation: CoreResourceOperation | EnumLikeType,\n registry: Map<ResourceType, any>\n ): z.ZodTypeAny {\n // Zod 4 requires key and value schemas for z.record\n const untypedRelative = z.record(z.string(), z.any());\n\n const objectMode = contextPolicy?.operationOverrides?.[effectiveOperation as CoreResourceOperation]?.objectMode\n ?? contextPolicy?.objectMode\n ?? DEFAULT_RELATIONSHIP_CONTEXT_POLICY.objectMode;\n\n // ID_ONLY carries a bare reference: no fetch, so no leaf to coerce.\n if (objectMode === ContextPolicy_ObjectMode.ID_ONLY) {\n return untypedRelative;\n }\n\n const relatedMainSchema = registry.get(relatedResourceType)?.mainSchema as z.ZodTypeAny | undefined;\n if (!relatedMainSchema || !isZodObject(relatedMainSchema)) {\n return untypedRelative;\n }\n\n let relativeSchema: z.ZodTypeAny = relatedMainSchema;\n if (objectMode === ContextPolicy_ObjectMode.SUMMARY) {\n // Mirrors the summary DTO's own derivation, including its fallback: a resource that marks NO\n // summary field is served its whole object, so the embed must be typed by the whole schema\n // too. The emptiness test deliberately runs on a derivation WITHOUT `_id` — `includeId` adds\n // it unconditionally, so asking the id-bearing shape whether it is empty always answers no,\n // and every such resource would be typed `{ _id }` with its every other leaf left uncoerced.\n const summaryFieldsOnly = ResourcesSummaryUtils.deriveSummarySchema(relatedMainSchema, {\n includeId: false,\n includeForeignKeys: false,\n });\n if (Object.keys(getZodObjectShape(summaryFieldsOnly)).length > 0) {\n relativeSchema = ResourcesSummaryUtils.deriveSummarySchema(relatedMainSchema, {\n includeId: true,\n includeForeignKeys: false,\n });\n }\n }\n\n // Coerced HERE rather than left to a later pass: the CONTEXT variant's `responseDto` IS this\n // `contextDto`, and nothing re-coerces it after the variant override (step 10).\n const coercedRelativeSchema = this.applyNetworkBoundaryCoercion(relativeSchema);\n if (!isZodObject(coercedRelativeSchema)) {\n return untypedRelative;\n }\n\n // Backend-only fields are deliberately NOT stripped. They never reach the wire, and the same\n // placeholder types the service-layer `internalDto`, where they legitimately appear — `.loose()`\n // would pass them through either way, and declaring them means their dates are coerced too.\n const typedRelative = (coercedRelativeSchema as z.ZodObject<z.ZodRawShape>).partial().loose();\n\n // The union is what makes \"can only ADD coercion\" true rather than nearly true.\n //\n // `.partial()` reaches the TOP level only, so a nested object inside the related schema keeps\n // its required leaves. An embed that omits one — a projection this builder cannot see, an\n // application's own resource shaped differently from its schema — would then turn a response\n // that parses today into a hard validation failure, and a whole context read would be refused\n // over a field nobody reads. Trying the typed schema FIRST and falling back to the untyped\n // record bounds the worst case at exactly the previous behaviour: uncoerced, never rejected.\n return z.union([typedRelative, untypedRelative]);\n }\n\n /**\n * Add relationship placeholders to schema for context DTO.\n * Placeholders are optional and named by `Resources_SharedUtils.resolveRelationshipObjectIdentity`\n * — the same authority `ResourcePopulationBackendService.populateForContext` names them with.\n * Each one's SHAPE comes from {@link buildContextRelativeObjectSchema}.\n *\n * @param schema - Base schema\n * @param relationships - Resource relationships configuration\n * @param effectiveOperation - Operation these DTOs are for, for per-operation context overrides\n * @param registry - Resource registry for type resolution\n * @returns Schema with relationship placeholders added\n */\n private static addRelationshipPlaceholders(\n schema: z.ZodTypeAny,\n relationships: ResourceConfiguration_ResourceRelationships,\n effectiveOperation: CoreResourceOperation | EnumLikeType,\n registry: Map<ResourceType, any>\n ): z.ZodTypeAny {\n // A POLYMORPHIC resource's response is a discriminated union: every variant carries the same\n // relationships, so every variant gets the same placeholders, and the union is rebuilt with the\n // discriminator it had — the pattern `excludeVirtualFieldsFromSchema` already uses. Returning a\n // union unchanged (the previous behaviour) left its context DTO with NO placeholder at all, so\n // `internalDto.parse` and the response serializer stripped every populated child and parent of,\n // e.g., Wonder Todos' `todos` — and the generated API reference documented its context as the\n // plain read response. A union WITHOUT a discriminator has no rebuild this builder can promise,\n // so it stays as-is.\n if (getZodType(schema) === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const options = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n if (discriminator && options && options.length > 0) {\n const withPlaceholders = options.map((option) => this.addRelationshipPlaceholders(option, relationships, effectiveOperation, registry));\n return withPlaceholders.length >= 2\n ? z.discriminatedUnion(discriminator, withPlaceholders as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]])\n : withPlaceholders[0];\n }\n return schema;\n }\n\n // Otherwise only object schemas carry placeholders\n if (!isZodObject(schema)) {\n return schema;\n }\n\n const shape = getZodObjectShape(schema);\n const placeholderFields: Record<string, z.ZodTypeAny> = {};\n\n // Add parent relationship placeholders (includes self-refs acting as parents)\n const parentDirRels = getParentDirectionRelationships(relationships);\n for (const relationship of parentDirRels) {\n if (relationship.contextPolicy?.enabled === false) {\n continue;\n }\n\n const fieldName = this.getRelationshipObjectFieldName(\n relationship,\n relationship.resourceType1,\n ResourceRelationshipCardinality.ONE,\n registry\n );\n\n // Only add if field doesn't already exist (avoid conflicts)\n if (!shape[fieldName]) {\n // A parent carries what its contextPolicy's `objectMode` fetched — a bare reference for\n // ID_ONLY, the parent's summary fields for SUMMARY (the default), its whole object for FULL\n // — and the placeholder is typed from that same mode, optional-everywhere and loose (#1189).\n // It was once `z.object({ _id })`, which stripped every SUMMARY/FULL field even under the\n // right name: no parent object had ever reached a client, on any resource (#579). That is\n // why the typed form below can only ever ADD coercion.\n placeholderFields[fieldName] = this.buildContextRelativeObjectSchema(\n relationship.resourceType1,\n relationship.contextPolicy,\n effectiveOperation,\n registry\n ).optional();\n }\n }\n\n // Add child relationship placeholders (includes self-refs acting as children)\n // Children with contextPolicy enabled are populated in CONTEXT mode\n const childDirRels = getChildDirectionRelationships(relationships);\n for (const relationship of childDirRels) {\n // Skip relationships without contextPolicy or with disabled contextPolicy\n if (!relationship.contextPolicy) {\n continue;\n }\n\n // Skip if contextPolicy is explicitly disabled\n if (relationship.contextPolicy.enabled === false) {\n continue;\n }\n\n const fieldName = this.getRelationshipObjectFieldName(\n relationship,\n relationship.resourceType2,\n relationship.cardinality2,\n registry\n );\n // DTO context placeholders are projection conveniences, not transport\n // addressability proof. Keep this broader than context-addressed mutation\n // eligibility: URL/backend/frontend runtime predicates separately require\n // composition nature, explicit FK metadata, and routing scope.\n const isOneToOne = isOneToOneCardinality(relationship.cardinality2);\n\n // Only add if field doesn't already exist (avoid conflicts)\n if (!shape[fieldName]) {\n // Typed from the child's own schema by the relationship's resolved `objectMode`, with every\n // field optional and unknown keys passed through, so the declaration coerces the child's\n // date and money leaves without being able to strip or refuse anything (#1189).\n const childPlaceholder = this.buildContextRelativeObjectSchema(\n relationship.resourceType2,\n relationship.contextPolicy,\n effectiveOperation,\n registry\n );\n\n if (isOneToOne) {\n // 1:1: single object (optional)\n placeholderFields[fieldName] = childPlaceholder.optional();\n } else {\n // 1:many: array of objects (optional)\n placeholderFields[fieldName] = z.array(childPlaceholder).optional();\n }\n }\n }\n\n // Merge placeholders with existing schema\n if (Object.keys(placeholderFields).length > 0) {\n return schema.extend(placeholderFields);\n }\n\n return schema;\n }\n\n /**\n * Transform object dates from strings to Date objects (for incoming requests).\n * Uses DTO schema to identify which fields are dates.\n *\n * @param data - Object to transform\n * @param dtoSchema - DTO schema (with z.coerce.date() fields)\n * @returns Transformed object with Date objects\n */\n /**\n * Unwrap the pure field-MODIFIER wrappers (`optional` / `nullable` / `default`) to\n * reach the underlying schema, so a wrapped date field is still detected as a date\n * and a wrapped nested object/array is still recursed into.\n *\n * WHY: without this, `z.date().optional()` reports type `'optional'` (not `'date'`),\n * so its string value was never coerced to a `Date`, and an `.optional()`-wrapped\n * object was treated as a leaf. Nested/optional date fields — notably the collection\n * filter date ranges `{ startDate, endDate }` built on `z.date()` (NOT\n * `z.coerce.date()`) — therefore reached the DTO parse as strings and threw\n * `z.date()` validation. Stackable modifiers (`z.date().nullable().default()`) are\n * peeled in a bounded loop.\n *\n * DELIBERATELY does NOT unwrap `pipe` / `transform` / `readonly` / `catch`: those can\n * change the value's meaning (input vs output side), so treating their output schema\n * as their input would mis-coerce. They stay leaves exactly as before. (`z.coerce.date()`\n * reports type `'date'` directly, so it needs no unwrapping and keeps working.)\n */\n private static unwrapDateModifierWrappers(schema: z.ZodTypeAny): z.ZodTypeAny {\n let current = schema;\n while (isZodOptional(current) || isZodNullable(current) || isZodDefault(current)) {\n const inner = getZodDefSchemaProperty(current, 'innerType');\n if (!inner) break;\n current = inner;\n }\n return current;\n }\n\n static transformRequestDates<T = any>(data: T, dtoSchema: z.ZodTypeAny): T {\n if (!data || typeof data !== 'object') {\n return data;\n }\n\n // See through modifier wrappers so a wrapped array/object schema is still handled\n // (e.g. `z.array(...).optional()`, an `.optional()` nested object).\n const schema = this.unwrapDateModifierWrappers(dtoSchema);\n\n // Handle arrays\n if (Array.isArray(data)) {\n const zodType = getZodType(schema);\n if (zodType === 'array') {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny;\n if (elementSchema) {\n return data.map(item => this.transformRequestDates(item, elementSchema)) as T;\n }\n }\n return data;\n }\n\n // Handle objects\n if (isZodObject(schema)) {\n const shape = getZodObjectShape(schema);\n const transformed: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(data as Record<string, any>)) {\n const fieldSchema = shape[key];\n if (fieldSchema) {\n // Unwrap modifier wrappers, then check if the underlying field is a date\n // (`z.date()` / `z.coerce.date()`, incl. `.optional()` / `.nullable()` /\n // `.default()` around them).\n const unwrappedField = this.unwrapDateModifierWrappers(fieldSchema);\n if (getZodType(unwrappedField) === 'date') {\n // Transform string to Date; leave existing Dates (and non-strings) alone.\n transformed[key] = typeof value === 'string' ? new Date(value) : value;\n } else {\n // Recursively transform nested objects/arrays (through their wrappers).\n transformed[key] = this.transformRequestDates(value, unwrappedField);\n }\n } else {\n transformed[key] = value;\n }\n }\n\n return transformed as T;\n }\n\n return data;\n }\n\n /**\n * Transform object dates from Date objects to ISO strings (for outgoing responses).\n * Uses DTO schema to identify which fields are dates.\n *\n * NO `transformResponseBigints` twin exists, BY DESIGN. This is date-specific\n * in-body normalization; the money-`bigint` leaf (the other network-boundary type)\n * is NOT normalized in the body — it stays a `bigint` in the serialized body and is\n * encoded to a decimal string at the JSON boundary by `BigInt.prototype.toJSON`\n * (`installBigIntJsonEncoding`, `@wildo-ai/zod-decorators`). A parallel body-walk for\n * bigint would be redundant with that `toJSON`. (Indeed, since `Date.prototype.toJSON`\n * also exists, this date walk is itself now largely belt-and-suspenders — kept as-is,\n * not extended.) Full mechanism map: `install-bigint-json-encoding.ts`.\n *\n * @param data - Object to transform\n * @param dtoSchema - DTO schema (with z.coerce.date() fields)\n * @returns Transformed object with ISO string dates\n */\n static transformResponseDates<T = any>(data: T, dtoSchema: z.ZodTypeAny): T {\n if (!data || typeof data !== 'object') {\n return data;\n }\n\n // Handle arrays\n if (Array.isArray(data)) {\n const zodType = getZodType(dtoSchema);\n if (zodType === 'array') {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(dtoSchema, 'element') as z.ZodTypeAny;\n if (elementSchema) {\n return data.map(item => this.transformResponseDates(item, elementSchema)) as T;\n }\n }\n return data;\n }\n\n // Handle objects\n if (isZodObject(dtoSchema)) {\n const shape = getZodObjectShape(dtoSchema);\n const transformed: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(data as Record<string, any>)) {\n const fieldSchema = shape[key];\n if (fieldSchema) {\n // Check if field is a date (coerced or regular)\n const zodType = getZodType(fieldSchema);\n if (zodType === 'date' || hasZodType(fieldSchema, 'date')) {\n // Transform Date to ISO string\n if (value instanceof Date) {\n transformed[key] = value.toISOString();\n } else {\n transformed[key] = value;\n }\n } else {\n // Recursively transform nested objects/arrays\n transformed[key] = this.transformResponseDates(value, fieldSchema);\n }\n } else {\n transformed[key] = value;\n }\n }\n\n return transformed as T;\n }\n\n return data;\n }\n\n /**\n * Select the appropriate response DTO based on DataMode.\n * Used by both backend and frontend services to ensure consistent DTO selection.\n *\n * IMPORTANT: Handles structure differences between single-item and collection operations:\n * - Single item (READ, CREATE, etc.): Returns item schema\n * - Collection (LIST, SEARCH): Returns pagination wrapper schema\n *\n * Priority:\n * 1. If operation has variantKey → return operation.responseDto (already variant-specific)\n * 2. If DataMode is SUMMARY and summaryDto exists → return summaryDto (wrapped for LIST/SEARCH)\n * 3. If DataMode is CONTEXT and contextDto exists → return contextDto (wrapped for LIST/SEARCH)\n * 4. Otherwise → return responseDto (default for RAW mode)\n *\n * @param operation - The resource operation configuration\n * @param dataMode - The data mode (defaults to RAW if not specified)\n * @returns The selected DTO schema, or null/undefined if not available\n */\n static selectResponseDto(\n operation: ResourceConfiguration_Operation<any, any, any>,\n dataMode?: DataMode\n ): z.ZodTypeAny | null | undefined {\n if (!operation) {\n return null;\n }\n\n // For variant operations (with variantKey), responseDto is already correct\n // (built in buildAllOperationDtos with correct structure for LIST/SEARCH)\n if (operation.variantKey) {\n return operation.responseDto || null;\n }\n\n const effectiveDataMode = dataMode || DataMode.RAW;\n const effectiveOperation = operation.resourceOperationLike || operation.operationIdentifier;\n const isListOrSearch = effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.SEARCH;\n\n // For default operations with dataMode specified, select and wrap appropriately\n if (effectiveDataMode === DataMode.SUMMARY && operation.summaryDto) {\n return isListOrSearch\n ? this.wrapInPaginationStructure(operation.summaryDto, (operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n : operation.summaryDto;\n }\n\n if (effectiveDataMode === DataMode.CONTEXT && operation.contextDto) {\n return isListOrSearch\n ? this.wrapInPaginationStructure(operation.contextDto, (operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n : operation.contextDto;\n }\n\n // Default to responseDto for RAW mode or when specific DTOs are not available\n return operation.responseDto || null;\n }\n\n /**\n * Wrap item schema in pagination structure for LIST/SEARCH operations\n * @param itemSchema - Schema for individual items\n * @returns Pagination wrapper schema\n */\n private static wrapInPaginationStructure(itemSchema: z.ZodTypeAny, maxResultsPerPageLimit?: number): z.ZodTypeAny {\n return z.object({\n data: z.array(itemSchema),\n // The operation's ceiling, like every other pagination bound in the framework. `limit` echoes\n // the page size that was SERVED, so a bound stricter than the repository's turns a valid page\n // into a 500 — which is exactly what a hard-coded 100 here did to an operation declaring 200.\n pagination: createPaginationResponseMetadataSchema(maxResultsPerPageLimit)\n });\n }\n}\n\n/**\n * Derive the re-attach allowlist for a TRUSTED, in-process system write.\n *\n * The repository strict-parses every create/update against a client-shaped\n * request DTO that DROPS three classes of field: `.isBackendOnly()` fields, the\n * context-auto-populated FKs (`CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS`, stripped\n * by name), and the verb-excluded fields (`.excludeFromCreate()` on CREATE /\n * `.excludeFromUpdate()` on UPDATE). On the HTTP path those are re-supplied AFTER\n * the strip — backend-only material never comes from the client, the context FKs\n * are injected from the URL-derived context / initiator identity by\n * `enrichDataWithContext`, and a client is simply not allowed to author the\n * verb-excluded fields (the server owns them).\n *\n * An in-process caller writing to a system resource has NEITHER context: the\n * payload IS the source of truth. Registration creating `USER_CREDENTIALS` with\n * `{ userId, passwordHash }` needs the FK + backend-only field to survive; an\n * OIDC re-login bumping an identity link's `.excludeFromUpdate()` `lastUsedAt`\n * needs the verb-excluded field to survive. Without help, the strip silently\n * drops them → a required-path Mongoose crash or silent data loss.\n *\n * This function returns exactly the subset of `payloadKeys` the strip would drop\n * for one of those legitimate reasons, so the trusted-write primitives\n * (`SystemAccessBackendService.createAsSystem` / `updateAsSystem` /\n * `updateManyAsSystem`) can forward it as `options.preserveServerInjectedFields`\n * and have the repository re-attach the values after the strip. Ordinary fields\n * are deliberately excluded — they parse normally, so re-attaching them would\n * bypass their own validation.\n *\n * PER-VERB EXCLUDE SEMANTICS (the `verb` argument):\n * - UPDATE / UPDATE_MANY: re-attach every `.excludeFromUpdate()` key the caller\n * authored. UPDATE is a partial `$set` (no default application), so an\n * explicitly-authored value is authoritative — this is the path that lets a\n * server-managed timestamp like `lastUsedAt` actually advance.\n * - CREATE: re-attach an `.excludeFromCreate()` key the caller authored ONLY\n * when the field has NO `.default()`. A defaulted excludeFromCreate field\n * (`createdAt`, `linkedAt`, …) is server-owned at creation and the\n * strip-then-default path is the intended source of truth; re-attaching a\n * caller value would let stale input clobber the fresh default. A caller with\n * a genuine need to override a defaulted field can still pass an explicit\n * `preserveServerInjectedFields`.\n *\n * The mandatory-discard fields (`_id` / `createdAt` / `updatedAt` / `deletedAt` /\n * `_version_db_doc`) are NEVER re-attached — they are force-removed before\n * validation and are unconditionally server-owned. This guard is what keeps the\n * UPDATE branch (which would otherwise match `.excludeFromUpdate()` `createdAt` /\n * `updatedAt`) honest.\n *\n * ANTI-SMUGGLING: this is safe ONLY because the primitives are reachable exclusively\n * from trusted engine code behind a fail-closed `systemAccessPolicy` opt-in — never\n * from an HTTP payload. Do NOT call this to re-attach fields from an untrusted\n * request; that would re-open the exact hole the strict parse closes.\n *\n * Polymorphic-safe: `getMergedObjectOrUnionShape` merges discriminated-union\n * variants and returns `{}` for a non-object schema (in which case only the\n * name-based context-FK detection applies — still correct for scope/audit FKs).\n *\n * @param mainSchema The resource's main Zod schema.\n * @param payloadKeys The keys actually present on the trusted write payload.\n * @param verb The write verb — selects `.excludeFromCreate()` vs\n * `.excludeFromUpdate()` detection (UPDATE_MANY ≡ UPDATE). The\n * write is always one of these, so the caller always knows it.\n * @returns The subset of `payloadKeys` that are backend-only, context-auto-populated,\n * or a legitimately-authored verb-excluded field.\n */\nexport function deriveTrustedSystemWritePreservedFields(\n mainSchema: z.ZodTypeAny,\n payloadKeys: readonly string[],\n verb: CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.UPDATE_MANY,\n): string[] {\n const backendOnlyFieldNames = new Set<string>();\n // Verb-excluded fields the client-shaped DTO strips but a TRUSTED caller may\n // legitimately author (see PER-VERB EXCLUDE SEMANTICS above).\n const verbExcludedFieldNames = new Set<string>();\n\n const shape = getMergedObjectOrUnionShape(mainSchema);\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isBackendOnlyField(fieldSchema)) {\n backendOnlyFieldNames.add(fieldName);\n }\n if (verb === CoreResourceOperation.CREATE) {\n // Defaulted excludeFromCreate fields are server-materialised at creation —\n // withhold them so the schema default wins over any (potentially stale) input.\n if (isExcludedFromCreate(fieldSchema) && !isZodDefault(fieldSchema)) {\n verbExcludedFieldNames.add(fieldName);\n }\n } else if (verb === CoreResourceOperation.UPDATE || verb === CoreResourceOperation.UPDATE_MANY) {\n if (isExcludedFromUpdate(fieldSchema)) {\n verbExcludedFieldNames.add(fieldName);\n }\n }\n }\n\n return payloadKeys.filter((key) =>\n // Never resurrect a mandatory-discard field (force-removed pre-validation).\n !createOrUpdateMandatoryDiscardFields.includes(key)\n && (\n backendOnlyFieldNames.has(key)\n || verbExcludedFieldNames.has(key)\n || CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS.includes(key)\n ),\n );\n}\n"]}
1
+ {"version":3,"file":"resources-config-operations.dtos-builder.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/resources-config-operations.dtos-builder.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAgB,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,EAA0J,oBAAoB,EAAE,gCAAgC,EAAE,QAAQ,EAAE,qBAAqB,EAA8C,sCAAsC,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,+BAA+B,EAA4B,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAC5iB,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,oCAAoC,EACpC,yBAAyB,EACzB,6BAA6B,EAC7B,+BAA+B,EAE/B,wCAAwC,EACxC,oCAAoC,EACrC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAOlE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EAEZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,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IACtD,KAAK,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7D,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,qBAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,IAAI,KAAK,qBAAqB,CAAC,MAAM,EAAE,CAAC;YAC1C,2EAA2E;YAC3E,+EAA+E;YAC/E,IAAI,oBAAoB,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;gBACpE,sBAAsB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;aAAM,IAAI,IAAI,KAAK,qBAAqB,CAAC,MAAM,IAAI,IAAI,KAAK,qBAAqB,CAAC,WAAW,EAAE,CAAC;YAC/F,IAAI,oBAAoB,CAAC,WAAW,CAAC,EAAE,CAAC;gBACtC,sBAAsB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;IAChC,4EAA4E;IAC5E,CAAC,oCAAoC,CAAC,QAAQ,CAAC,GAAG,CAAC;WAChD,CACD,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC;eAC3B,sBAAsB,CAAC,GAAG,CAAC,GAAG,CAAC;eAC/B,wCAAwC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAC1D,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { z } from 'zod';\nimport { markEmbeddedResourceSchema } from '../embedded-resource-mark.shared.utils';\nimport { ResourceType, CoreResourceOperation } from '../resources.shared.core.definitions';\nimport { ResourceConfiguration_ResourceRelationships, ResourceConfiguration_InheritanceSchemaDefinition, ResourceConfiguration_Operation, ResourceConfiguration, wrapRequestDtoAsBulk, resolveBulkOperationMaxSelection, DataMode, OPERATION_VARIANT_KEY, Resources_PaginationResponseMetadataSchema, createPaginationResponseMetadataSchema, DEFAULT_LIST_PAGE_CEILING, DEFAULT_SEARCH_PAGE_CEILING, getChildDirectionRelationships, getParentDirectionRelationships, AnyResourceConfiguration, ResourceGeneratedOperationKind } from '../resources-config.shared.schemas';\nimport {\n ResourceRelationshipCardinality,\n isOneToOneCardinality,\n isArrayCardinality,\n getDefaultResponseSchemaForOperation,\n isOutputEnvelopeOperation,\n operationShouldHaveRequestDto,\n DefaultBulkDeleteResponseSchema,\n ResourceRelationship,\n CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS,\n createOrUpdateMandatoryDiscardFields\n} from '../resources.shared.schemas';\nimport { Resources_SharedUtils } from '../resources.shared.utils';\nimport {\n ChildNestedReadConfig_Parsed,\n ChildNestedMutationConfig_Parsed,\n ChildNestedReadConfig,\n ChildNestedMutationConfig\n} from '../child-operations.shared.schemas';\nimport {\n addDiscriminator,\n getCustomFieldMetadata,\n ZodDecorator,\n EnumLikeType,\n getZodType,\n hasZodType,\n isZodObject,\n isZodArray,\n isZodOptional,\n isZodNullable,\n isZodDefault,\n toPatchOptionalField,\n getZodObjectShape,\n getZodDefSchemaProperty,\n getZodDefArrayProperty,\n getZodDefStringProperty,\n getZodDefProperty,\n isZodTypeAny,\n getEnumValues,\n isExcludedFromCreate,\n isExcludedFromUpdate,\n isVirtualField,\n isTemplatableFileField,\n isPrimaryKey,\n isBackendOnlyField,\n getBackendOnlyParams,\n isWriteOnlySecretField,\n isDiscriminatorField,\n unwrapSchema,\n getMergedObjectOrUnionShape,\n withArrayElement,\n markPatchRequestDtoObject,\n SCHEMA_METADATA\n} from '@wildo-ai/zod-decorators';\nimport {\n ContextPolicy_ObjectMode,\n DEFAULT_RELATIONSHIP_CONTEXT_POLICY,\n type RelationshipContextPolicy,\n} from '../context-policy.shared.schemas';\nimport { ResourcesConfigNamingUtils } from './resources-config-naming.utils';\nimport { ResourcesSummaryUtils } from './resources-summary.utils';\nimport { RepositoryDtoBuilderUtils } from './repository-dto-builder.utils';\nimport {\n stripTemplatableFileFieldsRecursively as stripTemplatableFileFieldsSchema,\n} from './templatable-file-fields.shared.utils';\nimport { widenFileFieldsForPopulatedReads } from './populated-file-fields.shared.utils';\n\nimport { describeCaughtError } from '../../errors/caught-error-description.shared.utils';\n/**\n * Canonical placeholder shown to clients in place of a `.isWriteOnlySecret()`\n * field's real value. It doubles as the write-back sentinel: when a client\n * echoes this exact string back on CREATE/UPDATE, the framework interprets it as\n * \"keep the existing stored secret\" and strips the field from the write payload\n * (UPDATE is a partial `$set`, so the stored value is preserved). Kept as a\n * single constant so the output mask and the input sentinel never drift.\n */\nexport const WRITE_ONLY_SECRET_MASK = '••••••••';\n\n/**\n * The memos that let one RESOURCE's operation DTOs share their derived schemas (#1587).\n *\n * ## Why they exist\n *\n * Every derivation below is a pure function of the schema instance it is given, and the builder\n * applied them to the same sub-schemas once per operation and variant. One registry build made\n * 263,963 network-boundary coercion calls over 69,771 distinct inputs, re-coerced schemas it had\n * itself just produced, and rebuilt every nested object of every DTO. Zod 4 classic installs ~40\n * closures on every instance, so one resource registry retained ~735 MB, and a platform process\n * holding two of them died of heap exhaustion in INIT, as exit 139.\n *\n * ## Why they are PER RESOURCE, never global\n *\n * Sharing a derived instance is only safe while nothing writes to it, and one consumer does: the\n * frontend's `overlayUiBehaviorFieldDecorators` writes a resource's UI-behavior metadata IN PLACE\n * onto its DTO fields, on the stated premise that a DTO field is \"shared within the single owning\n * resource\". A process-wide memo broke that premise. Measured on the core registry, it raised the\n * number of DTO field instances serving more than one resource from 142 to 728, including coerced\n * dates such as `deletedAt` shared by 71 resources, so one resource's overlay would have rewritten\n * the display metadata of seventy others. Scoped to the resource, the sharing stays inside the\n * owner, which is the case that overlay was written for, and it is where almost all the duplication\n * was: dozens of operations and variants per resource.\n *\n * Outside a resource build no scope is active and every derivation runs uncached, exactly as it\n * did before the memo existed. WeakMaps, so a discarded registry releases what it derived.\n *\n * ## Two consequences to know before relying on these\n *\n * - **A scope lives as long as its resource configuration OBJECT, not one build.** The memos are\n * correct only while no decorator metadata changes between two builds of the same object:\n * decorating a field mutates its metadata bag in place, and a later build would still return the\n * strip computed before it. No path does this today — the factory pass builds on a temporary\n * configuration object, the backend builds fresh configurations per registry, and the frontend\n * spreads new ones — so a caller that re-decorates and rebuilds the same object must build on a\n * new object instead.\n * - **An author-owned DTO built from the main schema shares coerced leaves with the resource's\n * derived DTOs.** A custom `responseDto` written as `mainSchema.extend(...)` reuses the main\n * schema's field instances, which are coerced in this same scope, so the frontend overlay applied\n * to a derived operation also writes the resource's UI metadata onto those shared leaves. The\n * metadata is the same resource's and the parse contract is untouched, but \"a custom DTO is never\n * overlaid\" no longer holds at instance level.\n */\ninterface DtoDerivationMemoScope {\n /** Input schema → its network-boundary-coerced form; a coerced schema maps to itself. */\n readonly networkBoundaryCoercion: WeakMap<z.ZodTypeAny, z.ZodTypeAny>;\n /** Input schema → that schema with its backend-only fields removed. */\n readonly backendOnlyStrip: WeakMap<z.ZodTypeAny, z.ZodTypeAny>;\n /** The same, for a CREATE response, which keeps fields marked `isReturnedAtCreation`. */\n readonly backendOnlyStripKeepingReturnedAtCreation: WeakMap<z.ZodTypeAny, z.ZodTypeAny>;\n /** Related main schema → resolved `objectMode` → the SERVICE-layer context-relative placeholder shape. */\n readonly contextRelative: WeakMap<z.ZodTypeAny, Map<ContextPolicy_ObjectMode, z.ZodTypeAny>>;\n /**\n * The same, for the CLIENT placeholder, whose backend-only fields are stripped (#1625). Kept apart\n * like the two strip memos above: one map for both would hand whichever placeholder was built first\n * to the other, publishing backend-only fields to clients or hiding them from the internal DTO.\n */\n readonly clientContextRelative: WeakMap<z.ZodTypeAny, Map<ContextPolicy_ObjectMode, z.ZodTypeAny>>;\n}\n\nfunction createDtoDerivationMemoScope(): DtoDerivationMemoScope {\n return {\n networkBoundaryCoercion: new WeakMap(),\n backendOnlyStrip: new WeakMap(),\n backendOnlyStripKeepingReturnedAtCreation: new WeakMap(),\n contextRelative: new WeakMap(),\n clientContextRelative: new WeakMap(),\n };\n}\n\n/** One memo scope per resource configuration object; see {@link DtoDerivationMemoScope}. */\nconst DTO_DERIVATION_MEMO_SCOPE_BY_RESOURCE = new WeakMap<object, DtoDerivationMemoScope>();\n\n/**\n * The scope `createApiParsingSchema` runs in. Its callers parse configuration and wire payloads with\n * the result; none of them is an operation DTO, so no per-resource overlay can reach it.\n */\nconst API_PARSING_MEMO_SCOPE = createDtoDerivationMemoScope();\n\n/**\n * Type guard to check if schema is a ZodAny\n * In Zod v4, any schemas have type: \"any\"\n */\nfunction isZodAny(schema: z.ZodTypeAny): boolean {\n return hasZodType(schema, 'any');\n}\n\n\n\nexport class ResourcesConfigOperationsDtosBuilderUtils {\n /**\n * The memo scope of the resource whose DTOs are being built, or `null` outside a resource build.\n * The builder is synchronous, so a scope set on entry and restored on exit cannot leak into\n * another resource's build. See {@link DtoDerivationMemoScope}.\n */\n private static activeMemoScope: DtoDerivationMemoScope | null = null;\n\n /** Run `derive` with `scope` active, restoring whatever was active before. */\n private static withMemoScope<T>(scope: DtoDerivationMemoScope, derive: () => T): T {\n const previousScope = this.activeMemoScope;\n this.activeMemoScope = scope;\n try {\n return derive();\n } finally {\n this.activeMemoScope = previousScope;\n }\n }\n\n /**\n * Carry field/schema decorators across a wrapper or leaf rebuild.\n *\n * Network-boundary coercion necessarily replaces Zod instances (`date` becomes\n * `coerce.date`, optional/nullable/default wrappers are rebuilt around transformed\n * children). Decorators such as `isBackendOnly` live on those instances. Losing\n * the metadata before the response-stripping pass turns a backend-only field into\n * an ordinary public field, which is a confidentiality failure rather than a\n * presentation defect.\n */\n private static preserveSchemaMetadata<TSchema extends z.ZodTypeAny>(\n source: z.ZodTypeAny,\n rebuilt: TSchema,\n ): TSchema {\n const sourceMetadata = (source as any)[SCHEMA_METADATA];\n if (sourceMetadata !== undefined) {\n (rebuilt as any)[SCHEMA_METADATA] = sourceMetadata;\n }\n this.preserveRegistryMetadata(source, rebuilt);\n return rebuilt;\n }\n\n /**\n * Carry Zod's own `z.globalRegistry` metadata across a rebuild (#1625).\n *\n * That registry is where `.describe()` and `.meta()` live: the description the API reference\n * publishes, and the mark naming the resource an embedded record belongs to\n * (`EMBEDDED_RESOURCE_SCHEMA_KEY`). A clone keeps it through Zod's parent link; a fresh\n * `z.object(...)` does not. So every rebuild here (backend-only stripping, date coercion, omission)\n * used to publish the rebuilt object undescribed, and a response whose records the DTO builder\n * rebuilt lost its embedded-record mark. Measured on the generated file-regenerate response: its\n * `file` and `resource` descriptions and the mark all disappeared before the DTO was used.\n *\n * Carried even when fields were omitted: an object's description and the resource its record\n * belongs to do not depend on which of its fields a DTO exposes. `id` is NOT carried: it names ONE\n * schema, and Zod refuses to register the same id twice. Nothing is overwritten on a rebuilt schema\n * that already has its own registration.\n */\n private static preserveRegistryMetadata<TSchema extends z.ZodTypeAny>(source: z.ZodTypeAny, rebuilt: TSchema): TSchema {\n if (source === rebuilt || z.globalRegistry.has(rebuilt)) return rebuilt;\n const registered = z.globalRegistry.get(source) as Record<string, unknown> | undefined;\n if (registered === undefined) return rebuilt;\n const { id: _id, ...carried } = registered;\n if (Object.keys(carried).length > 0) z.globalRegistry.add(rebuilt, carried as never);\n return rebuilt;\n }\n\n static buildSchemaWithInheritance<TMainSchema extends z.ZodTypeAny>(\n mainSchema: TMainSchema,\n inheritanceDefinition: any,\n ): TMainSchema {\n return this.applyInheritanceToSchema(\n mainSchema,\n inheritanceDefinition,\n new Map(),\n );\n }\n\n /**\n * Rebuild an object schema, optionally preserving schema-level checks.\n *\n * DTO derivation frequently needs to rebuild object shapes for omission,\n * backend-only stripping, and date coercion. In Zod 4 those rebuilds would\n * otherwise discard `.refine()` / `.superRefine()` checks. Preserve them when\n * the field set stays semantically equivalent; skip them when fields were\n * omitted because the original cross-field logic may no longer be valid.\n */\n private static rebuildObjectSchema(\n schema: z.ZodObject<any>,\n rebuiltShape: Record<string, z.ZodTypeAny>,\n options?: {\n preserveChecks?: boolean;\n },\n ): z.ZodTypeAny {\n /*\n * Preserve the source object's CATCHALL (fixed 2026-09-01). `z.looseObject` is\n * `catchall(z.unknown())` and `z.strictObject` is `catchall(z.never())`; a bare\n * `z.object(rebuiltShape)` silently rebuilds BOTH as the default strip-unknown object. For a\n * loose schema that strip is a data-loss bug with no error anywhere: every DTO parse quietly\n * deletes the undeclared keys the schema's author explicitly declared passthrough for.\n * Measured live on the creation board's `customResponseDto` (a deliberately loose dispatch\n * outcome): a completed playbook run answered HTTP 200 with a literal `{}` — every field of a\n * rich result stripped, because the outcome's named fields were optional and everything else\n * was passthrough. Applied on the omit path too: removing declared fields does not change what\n * the author said about UNDECLARED ones.\n */\n const sourceCatchall = (schema as unknown as { def?: { catchall?: z.ZodTypeAny } }).def?.catchall;\n let rebuiltSchema: z.ZodTypeAny = sourceCatchall !== undefined\n ? z.object(rebuiltShape).catchall(sourceCatchall)\n : z.object(rebuiltShape);\n if (options?.preserveChecks === false) {\n this.preserveRegistryMetadata(schema, rebuiltSchema);\n return rebuiltSchema;\n }\n\n const checks = getZodDefArrayProperty(schema, 'checks') as unknown[] | undefined;\n for (const check of checks ?? []) {\n rebuiltSchema = rebuiltSchema.check(check as never);\n }\n\n // Preserve decorator metadata (`SCHEMA_METADATA`) across shape-equivalent rebuilds.\n //\n // Factory helpers like `z_file()`, `z_money()`, `z_bigdecimal()` and `z_range()`\n // stamp their identity as a symbol-keyed metadata object on the *ZodObject\n // instance* (not on any inner field). A fresh `z.object(rebuiltShape)` is a new\n // instance, so that symbol is lost. When the field SET is unchanged — i.e. the\n // check-preserving path (date coercion, nested inner rebuilds) — the metadata\n // still describes the schema faithfully, so it MUST be carried over.\n //\n // Concretely: `z_file()`'s value is `z.object({ fileId, updatedAt: z.date() })`.\n // DTO date-coercion rewrites the inner `updatedAt` to `z.coerce.date()`, which\n // rebuilds the object here. Without re-attaching `fileConfig`, `getSchemaType()`\n // resolves the field to a plain OBJECT and the automated form renders it as a raw\n // `{ fileId, updatedAt }` composite instead of the file uploader — and\n // `collectUploadableFileFieldPaths()` finds nothing, so no upload endpoints are\n // derived. This was the root cause of avatar/file fields never rendering an\n // uploader (the \"first real file implementation\" gap).\n //\n // The omit path (`preserveChecks: false`, above) intentionally skips this: there\n // the field set changed, so the original field-type identity may no longer hold.\n const sourceMetadata = (schema as any)[SCHEMA_METADATA];\n if (sourceMetadata !== undefined) {\n (rebuiltSchema as any)[SCHEMA_METADATA] = sourceMetadata;\n }\n this.preserveRegistryMetadata(schema, rebuiltSchema);\n\n return rebuiltSchema;\n }\n\n /**\n * Omit fields from an object schema while staying compatible with Zod 4\n * refined objects.\n *\n * Zod 4 throws when `.omit()` is used on object schemas that already carry\n * schema-level checks (`.refine()` / `.superRefine()`). DTO derivation must\n * still be able to remove transport-managed fields from those schemas, so we\n * fall back to rebuilding the object shape and reapplying the existing checks.\n */\n private static omitObjectFields(\n schema: z.ZodObject<any>,\n omitObj: Record<string, true>,\n ): z.ZodTypeAny {\n if (Object.keys(omitObj).length === 0) {\n return schema;\n }\n\n try {\n return schema.omit(omitObj);\n } catch (error) {\n if (!(error instanceof Error) || !error.message.includes('containing refinements')) {\n throw error;\n }\n\n const originalShape = getZodObjectShape(schema);\n const rebuiltShape: Record<string, z.ZodTypeAny> = {};\n\n for (const [fieldName, fieldSchema] of Object.entries(originalShape)) {\n if (!omitObj[fieldName]) {\n rebuiltShape[fieldName] = fieldSchema as z.ZodTypeAny;\n }\n }\n\n return this.rebuildObjectSchema(schema, rebuiltShape, {\n preserveChecks: false,\n });\n }\n }\n\n private static stripTemplatableFileFieldsRecursively(schema: z.ZodTypeAny): z.ZodTypeAny {\n return stripTemplatableFileFieldsSchema(schema, {\n rebuildObjectSchema: (objectSchema, strippedShape) => {\n // Checks and decorator metadata survive when the FIELD SET is unchanged — only a nested field\n // was replaced, so the object is still what they describe. This passed `preserveChecks: false`\n // unconditionally, which dropped both on every object above a rewritten field (#989).\n const fieldSetUnchanged = Object.keys(getZodObjectShape(objectSchema)).every((fieldName) => fieldName in strippedShape);\n return this.rebuildObjectSchema(objectSchema, strippedShape, { preserveChecks: fieldSetUnchanged });\n },\n });\n }\n\n /**\n * Run a resource `mainSchema`'s TOP-LEVEL object checks (`.refine()` / `.superRefine()`) against a\n * fully-materialised row (post-enrichment) and return the ZodError, or null when the schema declares\n * no top-level check or all pass.\n *\n * This is the correct enforcement point for a cross-field invariant declared on a resource\n * `mainSchema`. A CREATE REQUEST cannot carry it: the request DTO omits every backend-injected field\n * (`primaryScope`, `organizationId`, `createdAt`, …), so a check referencing one — e.g. a file-scope\n * check keyed on `primaryScope` — would fire against an ABSENT value and reject a valid create. The\n * ENRICHED row (after context injection + literal / user-tracking population) carries every field, so\n * the check validates truthfully: a file-scope check passes on a consistent row, while a check on\n * create-supplied fields (a junction's `source ≠ target`) still rejects a bad row.\n *\n * The checks run in ISOLATION via a passthrough object, so no unrelated shape/coercion validation is\n * re-applied to the already-built row (its dates are `Date`s, its ids may be driver objects — none of\n * which a fresh full-schema parse should re-police here). Works whether `mainSchema` is a plain object\n * or a discriminated-union family — a schema with no top-level check simply returns null.\n */\n static validateTopLevelObjectChecks(mainSchema: z.ZodTypeAny, value: unknown): z.ZodError | null {\n const checks = getZodDefArrayProperty(mainSchema, 'checks') as unknown[] | undefined;\n if (!checks || checks.length === 0) {\n return null;\n }\n let checker: z.ZodTypeAny = z.looseObject({});\n for (const check of checks) {\n checker = (checker as z.ZodObject<any>).check(check as never);\n }\n const result = checker.safeParse(value);\n return result.success ? null : result.error;\n }\n\n /**\n * Rebuild all operation DTOs once the full registry is available.\n *\n * Resource factories only know about their own config at declaration time, so\n * nested child DTOs cannot be fully derived there. Registry startup is the\n * authoritative compilation boundary for operation DTOs.\n */\n static rebuildResourceConfigurationsOperationDtos(\n resourceConfigurations: Record<string, AnyResourceConfiguration>\n ): void {\n const resourceRegistry = new Map<ResourceType, AnyResourceConfiguration>(\n Object.entries(resourceConfigurations) as [ResourceType, AnyResourceConfiguration][]\n );\n\n for (const config of Object.values(resourceConfigurations)) {\n config.operations = config.operations.map((operation) =>\n this.buildAllOperationDtos(operation, config as AnyResourceConfiguration, resourceRegistry)\n );\n }\n }\n\n /**\n * Build all DTO variants for an operation.\n * This is the main entry point called by the factory.\n *\n * @param operation - Operation configuration\n * @param resourceConfig - Full resource configuration (for inheritance reference)\n * @param registry - Resource registry\n * @returns Operation with all DTOs pre-computed and stored\n */\n static buildAllOperationDtos<\n TCustomOperationEnum extends EnumLikeType | undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined,\n TMainSchema extends z.ZodTypeAny\n >(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n resourceConfig: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n registry: Map<ResourceType, any>\n ): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n // Every operation of one resource shares the resource's derivation memos, and no other\n // resource can see them — see `DtoDerivationMemoScope` for why the boundary is the resource.\n let scope = DTO_DERIVATION_MEMO_SCOPE_BY_RESOURCE.get(resourceConfig);\n if (scope === undefined) {\n scope = createDtoDerivationMemoScope();\n DTO_DERIVATION_MEMO_SCOPE_BY_RESOURCE.set(resourceConfig, scope);\n }\n return this.withMemoScope(scope, () => this.buildAllOperationDtosInResourceScope(operation, resourceConfig, registry));\n }\n\n /** {@link buildAllOperationDtos}, run inside its resource's memo scope. */\n private static buildAllOperationDtosInResourceScope<\n TCustomOperationEnum extends EnumLikeType | undefined,\n TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined,\n TMainSchema extends z.ZodTypeAny\n >(\n operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n resourceConfig: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,\n registry: Map<ResourceType, any>\n ): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {\n\n // 1. Apply inheritance to mainSchema (from resourceConfig.inheritenceSchemaDefinition)\n const inheritenceSchemaDefinition = resourceConfig.inheritenceSchemaDefinition;\n const enhancedMainSchema = (inheritenceSchemaDefinition\n ? this.applyInheritanceToSchema(operation.mainSchema, inheritenceSchemaDefinition, new Map())\n : operation.mainSchema) as TMainSchema;\n\n // Determine the effective operation identifier for DTO building\n const effectiveOperation = operation.resourceOperationLike || operation.operationIdentifier;\n\n // IMPORTANT: Temporary DTOs from factory are built from mainSchema WITHOUT inheritance.\n // buildEnhancedRequestDto/buildEnhancedResponseDto check for existing DTOs first and\n // return them if meaningful (line 330, 388), which would skip inheritance application.\n //\n // Strategy: Store original DTOs to detect custom ones, then clear temporary DTOs to force\n // rebuild from enhancedMainSchema (with inheritance). Custom DTOs will be preserved and\n // only have transformations applied (date coercion), while auto-derived DTOs will be\n // rebuilt with inheritance and transformations.\n //\n // Custom DTOs are detected by comparing the rebuilt DTO structure to the original.\n // If they're significantly different, we preserve the original (it's custom).\n // Otherwise, we use the rebuilt one (with inheritance).\n const originalRequestDto = operation.requestDto;\n const originalResponseDto = operation.responseDto;\n\n const operationWithEnhancedSchema = {\n ...operation,\n mainSchema: enhancedMainSchema,\n requestDto: undefined, // Clear to force rebuild with inheritance\n responseDto: undefined // Clear to force rebuild with inheritance\n };\n\n // 2. Build requestDto:\n // - Rebuild from enhancedMainSchema (with inheritance applied)\n // - If original was explicitly provided (custom), preserve it but apply transformations\n // - Otherwise use rebuilt DTO (with inheritance)\n // - Apply network-boundary coercion (dates + money bigints)\n // - Backend-only fields already excluded in buildEnhancedRequestDto\n let requestDto = this.buildEnhancedRequestDto(\n operationWithEnhancedSchema,\n effectiveOperation as string\n );\n\n // Check if original DTO was explicitly provided (custom DTO from variantParams.requestDto).\n const rebuiltRequestInfo = this.analyzeDtoSchema(requestDto);\n const originalRequestInfo = originalRequestDto ? this.analyzeDtoSchema(originalRequestDto) : null;\n\n // Custom-DTO classification is driven by the explicit `hasCustomRequestDto`\n // flag that the resource factory stamps on EVERY operation it builds:\n // • `true` → the variant supplied an explicit `requestDto`; preserve it\n // verbatim (it is a complete, author-owned contract — e.g. a narrow\n // `{ status }` for a CHANGE_STATUS custom operation).\n // • `false` → the requestDto is the factory's auto-derived *temporary*\n // placeholder, built from the base object via `deriveRequestDto` BEFORE\n // inheritance is known. So we MUST use the inheritance-rebuilt DTO —\n // which, for an inheritance resource (discriminated-union mainSchema via\n // `createSchemaFamily`), is the per-variant union. Preserving the bare\n // temporary here is what silently dropped variant-only fields\n // (e.g. todos `recurrence`/`startDate`/`endsDate`) from CREATE/UPDATE\n // request validation: `z.object` strips unknown keys, so a RECURRING\n // payload parsed but lost its extension fields — the request-side twin\n // of the RAW-mode LIST responseDto bug fixed just below.\n // Only when the flag is ABSENT (legacy / hand-authored operations that\n // predate the flag) do we fall back to the structural `analyzeDtoSchema`\n // heuristic — a base object always differs structurally from the rebuilt\n // union, so the heuristic alone cannot tell \"custom\" from \"auto-derived\n // inheritance DTO\".\n const hasExplicitCustomRequestDto = operation.hasCustomRequestDto === true;\n const isExplicitlyAutoDerivedRequestDto = operation.hasCustomRequestDto === false;\n const isCustomRequestDto = hasExplicitCustomRequestDto\n ? (originalRequestDto && !isZodAny(originalRequestDto))\n : isExplicitlyAutoDerivedRequestDto\n ? false\n : (originalRequestDto && originalRequestInfo &&\n originalRequestInfo !== rebuiltRequestInfo &&\n originalRequestInfo !== '📄 {} (empty object)' &&\n !isZodAny(originalRequestDto));\n\n if (isCustomRequestDto && originalRequestDto) {\n // Custom DTO: preserve structure but apply network-boundary coercion (dates + money bigints)\n requestDto = this.applyNetworkBoundaryCoercion(\n this.stripTemplatableFileFieldsRecursively(originalRequestDto)\n );\n } else if (operation.generatedOperation && originalRequestDto && !isZodAny(originalRequestDto)) {\n // Framework-generated operations own their DTO contract. In particular,\n // generated file regeneration is UPDATE-like for authorization and\n // persistence but intentionally accepts an empty request body.\n requestDto = this.applyNetworkBoundaryCoercion(\n this.stripTemplatableFileFieldsRecursively(originalRequestDto)\n );\n } else {\n // Auto-derived DTO: use rebuilt (with inheritance) and apply transformations\n requestDto = this.applyNetworkBoundaryCoercion(requestDto);\n }\n requestDto = this.stripTemplatableFileFieldsRecursively(requestDto);\n\n // 3. Build responseDto first (repositoryDto depends on it)\n // - Rebuild from enhancedMainSchema (with inheritance applied)\n // - If original was custom (significantly different), preserve it but apply transformations\n // - Otherwise use rebuilt DTO (with inheritance)\n // - Strip backend-only fields (except isReturnedAtCreation for CREATE)\n // - Apply network-boundary coercion (dates + money bigints)\n // - Exclude virtual fields (they're computed, not stored)\n let responseDtoInternal = this.buildEnhancedResponseDto(\n operationWithEnhancedSchema,\n effectiveOperation as string\n );\n let responseDto = responseDtoInternal;\n\n // Check if original DTO was explicitly provided (custom DTO from customResponseDto)\n // Custom DTOs are complete schemas that should be preserved as-is, but still need\n // transformations (backend-only stripping, date + money-bigint coercion).\n const hasExplicitCustomResponseDto = operation.hasCustomResponseDto === true;\n const rebuiltResponseInfo = this.analyzeDtoSchema(responseDtoInternal);\n const originalResponseInfo = originalResponseDto ? this.analyzeDtoSchema(originalResponseDto) : null;\n\n // Custom-DTO classification is driven by the explicit `hasCustomResponseDto`\n // flag that the resource factory stamps on EVERY operation it builds:\n // • `true` → the app supplied a `customResponseDto`; preserve it verbatim.\n // • `false` → the DTO is framework auto-derived. The factory only sets a\n // *temporary*, item-level placeholder (documented as \"will be replaced by\n // buildAllOperationDtos\"), so we MUST use the inheritance-rebuilt DTO —\n // which, for LIST/SEARCH, is the `{ data, pagination }` pagination wrapper.\n // Preserving the bare temporary schema here is what broke RAW-mode list\n // responses: `selectResponseDto(op, RAW)` returned the item schema and the\n // controller parsed the `{ data, pagination }` envelope against it (Zod\n // \"No matching discriminator\" for inheritance resources such as todos,\n // missing-field errors for plain ones).\n // Only when the flag is ABSENT (legacy / hand-authored operations that predate\n // the flag) do we fall back to the structural `analyzeDtoSchema` heuristic — an\n // item schema always differs structurally from the rebuilt wrapper, so the\n // heuristic alone cannot tell \"custom\" from \"auto-derived collection DTO\".\n const isExplicitlyAutoDerivedResponseDto = operation.hasCustomResponseDto === false;\n const isCustomResponseDto = hasExplicitCustomResponseDto\n ? (originalResponseDto && !isZodAny(originalResponseDto))\n : isExplicitlyAutoDerivedResponseDto\n ? false\n : (originalResponseDto && originalResponseInfo &&\n originalResponseInfo !== rebuiltResponseInfo &&\n originalResponseInfo !== '📄 {} (empty object)' &&\n !isZodAny(originalResponseDto));\n\n if (isCustomResponseDto && originalResponseDto) {\n // Strip while decorator metadata is still on the source nodes, then apply\n // network coercion to each trust-boundary shape independently. Reversing\n // this order allowed wrapper rebuilds to erase `isBackendOnly` before the\n // confidentiality pass inspected it.\n const isCreateOperation = effectiveOperation === CoreResourceOperation.CREATE ||\n effectiveOperation === CoreResourceOperation.CREATE_MANY;\n responseDtoInternal = this.applyNetworkBoundaryCoercion(originalResponseDto);\n responseDto = this.applyNetworkBoundaryCoercion(this.stripBackendOnlyFields(originalResponseDto, {\n respectIsReturnedAtCreation: isCreateOperation,\n operationType: isCreateOperation ? CoreResourceOperation.CREATE : undefined\n }));\n } else {\n // Auto-derived DTO: use rebuilt (with inheritance) and apply transformations\n // Strip backend-only fields before coercion rebuilds wrappers/leaves.\n const isCreateOperation = effectiveOperation === CoreResourceOperation.CREATE ||\n effectiveOperation === CoreResourceOperation.CREATE_MANY;\n const clientResponseDto = this.stripBackendOnlyFields(responseDtoInternal, {\n respectIsReturnedAtCreation: isCreateOperation,\n operationType: isCreateOperation ? CoreResourceOperation.CREATE : undefined\n });\n responseDtoInternal = this.applyNetworkBoundaryCoercion(responseDtoInternal);\n responseDto = this.applyNetworkBoundaryCoercion(clientResponseDto);\n }\n\n // Note: Virtual fields are already excluded in buildEnhancedResponseDto\n\n // 4. Add nested operations DTOs if configured (child + self relationships)\n const resourceRelationships = operation.resourceRelationships;\n const childDirRels = resourceRelationships ? getChildDirectionRelationships(resourceRelationships) : [];\n if (childDirRels.length > 0) {\n // Build request DTO with nested children for create/update operations,\n // including bulk variants. Runtime bulk orchestration is handled in the\n // services layer by applying the same nested-processing principles per\n // parent result.\n if (effectiveOperation === CoreResourceOperation.CREATE || effectiveOperation === CoreResourceOperation.CREATE_MANY ||\n effectiveOperation === CoreResourceOperation.UPDATE || effectiveOperation === CoreResourceOperation.UPDATE_MANY) {\n requestDto = this.buildRequestDtoWithNested(\n effectiveOperation as CoreResourceOperation,\n requestDto,\n childDirRels,\n registry\n );\n }\n\n // Build response DTO with nested children (for READ)\n if (effectiveOperation === CoreResourceOperation.READ) {\n responseDtoInternal = this.buildResponseDtoWithNested(\n responseDtoInternal,\n childDirRels,\n registry\n );\n responseDto = this.buildResponseDtoWithNested(\n responseDto,\n childDirRels,\n registry\n );\n }\n }\n\n // 5. Build summaryDto (WITH backend-only fields for internal processing):\n // - Extract summary fields (isSummaryField)\n // - If no summary fields defined, fall back to mainSchema (same as RAW)\n // - DO NOT strip backend-only fields yet (needed for repositoryDto)\n // - Handle discriminated unions\n // - Network-boundary coercion (dates + money bigints) is applied ONCE below,\n // after the no-summary-fields fallback resolves, so EVERY summary shape\n // (plain object, discriminated union, AND the full-schema fallback) accepts\n // ISO-string dates AND bigint-as-string money amounts — the same uniform\n // transposition point used for requestDto/responseDto/internalDto.\n let summaryDtoInternal: z.ZodTypeAny = this.extractSummaryFields(enhancedMainSchema);\n\n // If no summary fields are defined, use full schema (same as RAW mode)\n // Check if summaryDtoInternal is empty (z.object({}))\n if (isZodObject(summaryDtoInternal)) {\n const summaryShape = getZodObjectShape(summaryDtoInternal);\n if (Object.keys(summaryShape).length === 0) {\n // No summary fields defined - use full mainSchema as fallback\n // This ensures SUMMARY mode works even without explicit isSummaryField decorators\n summaryDtoInternal = this.excludeVirtualFieldsFromSchema(enhancedMainSchema);\n }\n }\n\n // Apply network-boundary coercion (z.date() → z.coerce.date() AND string-accepting\n // z.bigint() for z_money amounts) over the fully-resolved summary schema — the\n // single, uniform transposition point for the summary DTO, covering the\n // extracted-summary path, the discriminated-union path, and the full-schema\n // fallback alike. Without this, summary responses (which carry ISO-string\n // createdAt/updatedAt and bigint-as-string money totals over JSON) fail frontend\n // response validation with \"expected date, received string\" / \"expected bigint,\n // received string\" (e.g. invoiceRefs.total.amount is an isSummaryField z_money).\n const summaryDto = this.applyNetworkBoundaryCoercion(\n this.stripBackendOnlyFields(summaryDtoInternal),\n );\n summaryDtoInternal = this.applyNetworkBoundaryCoercion(summaryDtoInternal);\n\n // The COLLECTION EXPORT companion is deliberately excluded. It carries\n // `resourceOperationLike: LIST/SEARCH` so that routing, collection-level authorization and URL\n // building all treat it as a listing — which is exactly right — but its response is a FILE, not\n // a pagination envelope, so every list-shaped DTO derivation below (context item extraction,\n // SUMMARY/CONTEXT envelope rebuilding) would be operating on the wrong shape. Without this\n // exclusion the derivation throws `pagination response must contain a data array` at resource\n // configuration time and the whole application fails to start.\n const isCollectionExportCompanion =\n operation.generatedOperation?.kind === ResourceGeneratedOperationKind.GENERATED_COLLECTION_EXPORT;\n const isListOrSearch = !isCollectionExportCompanion\n && (effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.SEARCH);\n\n // 6. Build contextDto:\n // - Start with the response item DTO. LIST/SEARCH responseDto is already\n // a pagination envelope, so projecting relationships on that envelope\n // would later wrap a page inside another page for the CONTEXT variant.\n // - Add relationship placeholders\n // - Date coercion already applied to responseDto\n const contextBaseDto = isListOrSearch\n ? this.extractPaginatedCollectionItemDto(responseDto, effectiveOperation)\n : responseDto;\n const contextDto = this.addRelationshipPlaceholders(\n contextBaseDto,\n operation.resourceRelationships,\n effectiveOperation,\n registry,\n true, // the CLIENT context DTO: related records lose their backend-only fields\n );\n\n // 7. Build internalDto base (before variant overrides):\n // - Start with mainSchema (with inheritance)\n // - Include backend-only fields (DO NOT strip)\n // - Exclude virtual fields (they're computed)\n //\n // A non-READ op that declares a `customResponseDto` (e.g. a CREATE that\n // returns an ephemeral `plainKey`) legitimately carries the extra fields\n // the custom schema adds in its service output. `transformOutput`\n // validates that output against `internalDto`, so for these ops internalDto\n // must be the custom schema (`responseDtoInternal`), not the bare main\n // schema — otherwise the enriched fields are stripped before the controller\n // serializes against the custom `responseDto` (the api-key CREATE's\n // `plainKey` failed exactly this way). This mirrors the custom-VARIANT\n // branch below (lines ~516), which only runs for `variantKey`'d ops and so\n // left the DEFAULT custom-DTO op falling through to `enhancedMainSchema`.\n // LIST/SEARCH keep the main-schema base (their pagination wrapper is\n // applied below and the collection item DTO is handled separately).\n const internalDtoUsesCustomResponse =\n effectiveOperation !== CoreResourceOperation.READ\n && Boolean(isCustomResponseDto)\n && Boolean(originalResponseDto)\n && effectiveOperation !== CoreResourceOperation.LIST\n && effectiveOperation !== CoreResourceOperation.SEARCH;\n // `internalDto` is what the service layer validates its OUTPUT against\n // (`ServiceResourceBackendService.transformOutput`). It must mirror the shape the operation\n // actually returns. For most mutations that is the resource object (`enhancedMainSchema`), but:\n // • READ → the resource itself (custom read DTOs handled via the flag below)\n // • OUTPUT_ENVELOPE_OPERATIONS (DELETE, DELETE_MANY, COUNT) → a framework RESPONSE ENVELOPE\n // (`DefaultDeleteResponseSchema` / `DefaultBulkDeleteResponseSchema` / `DefaultCountResponseSchema`)\n // For all of these the correct `internalDto` is the very schema already exposed via\n // `responseDto`: `responseDtoInternal` is that schema with backend-only fields retained (a\n // no-op for these envelopes, which carry none) and is already bulk-vs-single aware because\n // `buildEnhancedResponseDto` resolved it from `getDefaultResponseSchemaForOperation` (and the\n // bulk-operation branch). Leaving an envelope operation on `enhancedMainSchema` is what made\n // `transformOutput` validate the envelope value against the resource object schema and throw\n // `service_resource_transformation_failed` → HTTP 500 (the delete bug; COUNT was a latent\n // sibling). Bulk mutations (CREATE_MANY/UPDATE_MANY) are intentionally NOT in the set — they\n // return per-item resource objects validated item-by-item, so they keep `enhancedMainSchema`.\n //\n // ⚠️ Keyed on the operation's OWN `operationIdentifier`, NOT `effectiveOperation`\n // (`resourceOperationLike || operationIdentifier`). A CUSTOM op that borrows DELETE/COUNT\n // semantics for its route/verb but returns its own shape (via `REPLACE_CORE_OPERATIONS` or a\n // `customResponseDto`) must NOT be forced onto the core envelope — its custom response is\n // already handled by `internalDtoUsesCustomResponse`, or it keeps `enhancedMainSchema`. Only the\n // genuine core operation carries `operationIdentifier === CoreResourceOperation.DELETE` etc.\n // For the deletes, the runtime composition of the envelope from the repository's bare id(s)\n // happens at the transform boundary via `composeDefaultOperationResponse` (same keying).\n let internalDtoProcessed: z.ZodTypeAny =\n effectiveOperation === CoreResourceOperation.READ\n || isOutputEnvelopeOperation(operation.operationIdentifier as string)\n || internalDtoUsesCustomResponse\n ? responseDtoInternal\n : enhancedMainSchema;\n\n // Exclude virtual fields from internalDto\n if (isZodObject(internalDtoProcessed)) {\n const shape = getZodObjectShape(internalDtoProcessed);\n const omitObj: Record<string, true> = {};\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isVirtualField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n }\n if (Object.keys(omitObj).length > 0) {\n internalDtoProcessed = this.omitObjectFields(internalDtoProcessed, omitObj);\n }\n }\n\n // 8. Build repositoryDto first (before variant overrides):\n // - For default operations, derive from responseDto\n // - Include backend-only fields (for internal processing)\n // - Exclude virtual fields but include their dependencies\n let repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(responseDto, enhancedMainSchema);\n\n // 9. For default operations (no variantKey), wrap internalDto in pagination for LIST/SEARCH:\n if (!operation.variantKey && isListOrSearch) {\n // Default LIST/SEARCH operations: wrap internalDto in pagination\n internalDtoProcessed = z.object({\n data: z.array(internalDtoProcessed),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n }\n\n // 10. Override responseDto, repositoryDto, and internalDto for variant operations:\n // - For SUMMARY variants: use summaryDto (wrapped in pagination for LIST/SEARCH)\n // - For CONTEXT variants: use contextDto (wrapped in pagination for LIST/SEARCH)\n // - For custom variants with customResponseDto: use the custom schema for internalDto too\n // - Build repositoryDto from INTERNAL versions (with backend-only fields)\n // - Build internalDto for service-layer validation (pagination wrapper with backend-only items)\n if (operation.variantKey) {\n if (operation.variantKey === OPERATION_VARIANT_KEY.SUMMARY) {\n // For SUMMARY variants, build repositoryDto from INTERNAL version (has backend-only fields)\n repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(summaryDtoInternal, enhancedMainSchema);\n\n if (isListOrSearch) {\n // Build internalDto for service-layer validation (pagination wrapper with backend-only items)\n internalDtoProcessed = z.object({\n data: z.array(summaryDtoInternal),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n // Wrap summaryDto (frontend version, backend-only stripped) in pagination for responseDto\n responseDto = z.object({\n data: z.array(summaryDto),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n } else {\n // For READ operations, use summaryDto versions\n internalDtoProcessed = summaryDtoInternal;\n responseDto = summaryDto;\n }\n } else if (operation.variantKey === OPERATION_VARIANT_KEY.CONTEXT) {\n // For CONTEXT variants, build from contextDto versions\n // contextDto is built from responseDto which already has backend-only stripped, so we need internal version\n const contextDtoInternal = this.addRelationshipPlaceholders(\n this.excludeVirtualFieldsFromSchema(enhancedMainSchema),\n operation.resourceRelationships,\n effectiveOperation,\n registry\n );\n repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(contextDtoInternal, enhancedMainSchema);\n\n if (isListOrSearch) {\n // Build internalDto for service-layer validation (pagination wrapper with backend-only items)\n internalDtoProcessed = z.object({\n data: z.array(contextDtoInternal),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n // Wrap contextDto (frontend version, backend-only stripped) in pagination for responseDto\n responseDto = z.object({\n data: z.array(contextDto),\n pagination: createPaginationResponseMetadataSchema((operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n });\n } else {\n // For READ operations, use contextDto versions\n internalDtoProcessed = contextDtoInternal;\n responseDto = contextDto;\n }\n } else if (originalResponseDto && !isZodAny(originalResponseDto)) {\n // For custom variants with customResponseDto (e.g., 'context_old'):\n // The internalDto should also use the custom schema to preserve enriched fields.\n // This ensures that custom implementations can return additional fields that won't be stripped.\n // Apply network-boundary coercion (dates + money bigints) to the custom schema for internal processing.\n internalDtoProcessed = this.applyNetworkBoundaryCoercion(originalResponseDto);\n repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(originalResponseDto, enhancedMainSchema);\n }\n }\n\n if (operation.generatedOperation && originalResponseDto && !isZodAny(originalResponseDto)) {\n // Generated operations may be UPDATE-like for routing/authorization while\n // returning a framework-owned envelope that is not the resource schema.\n // Keep service-layer output validation aligned with that envelope.\n internalDtoProcessed = this.applyNetworkBoundaryCoercion(originalResponseDto);\n repositoryDto = RepositoryDtoBuilderUtils.deriveRepositoryDto(enhancedMainSchema, enhancedMainSchema);\n }\n\n requestDto = this.stripTemplatableFileFieldsRecursively(requestDto);\n\n // 11. Finalize internalDto with network-boundary coercion (dates + money bigints):\n let internalDtoFinal: z.ZodTypeAny = this.applyNetworkBoundaryCoercion(internalDtoProcessed);\n\n // 11b. A SUMMARY or CONTEXT read runs file population, which lays each file's metadata BESIDE the\n // stored reference (`file` / `files`, issue #1059). The DTOs that describe those reads — what\n // `transformOutput` validates and what the wire carries — declare that optional companion;\n // RAW reads never populate and keep the bare reference. Applied AFTER coercion, so the\n // companion's own dates are coerced by its own schema rather than by a walker that leaves a\n // plain union untouched. The widened field keeps its file metadata, so it is still a FILE field.\n const isPopulatedReadVariant = operation.variantKey === OPERATION_VARIANT_KEY.SUMMARY\n || operation.variantKey === OPERATION_VARIANT_KEY.CONTEXT;\n if (isPopulatedReadVariant) {\n internalDtoFinal = widenFileFieldsForPopulatedReads(internalDtoFinal);\n responseDto = widenFileFieldsForPopulatedReads(responseDto);\n }\n\n // 12. Return operation with all DTOs stored\n return {\n ...operation,\n requestDto,\n responseDto,\n summaryDto: widenFileFieldsForPopulatedReads(summaryDto),\n contextDto: widenFileFieldsForPopulatedReads(contextDto),\n internalDto: internalDtoFinal,\n repositoryDto\n } as ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>;\n }\n\n /**\n * Build enhanced request DTO based on operation type and existing DTOs.\n *\n * Decorator-aware DTO building:\n * - For CREATE operations: excludes fields with `excludeFromCreate` decorator\n * - For UPDATE operations: excludes fields with `excludeFromUpdate` decorator\n * - For ALL operations: excludes fields with `isVirtual` decorator (computed fields)\n */\n private static buildEnhancedRequestDto(\n operation: ResourceConfiguration_Operation<any, any, any>,\n effectiveOperation: string\n ): z.ZodTypeAny {\n\n // Check if operation already has a meaningful requestDto (not z.any() and not empty)\n const isZAny = operation.requestDto && isZodAny(operation.requestDto);\n const currentRequestInfo = this.analyzeDtoSchema(operation.requestDto);\n\n if (operation.requestDto && !isZAny && currentRequestInfo !== '📄 {} (empty object)') {\n return this.stripTemplatableFileFieldsRecursively(operation.requestDto);\n }\n\n const searchQueryRequestSchema = (operation as {\n searchQueryRequestSchema?: z.ZodTypeAny;\n }).searchQueryRequestSchema;\n if (\n effectiveOperation === CoreResourceOperation.SEARCH\n && searchQueryRequestSchema\n && !isZodAny(searchQueryRequestSchema)\n ) {\n return searchQueryRequestSchema;\n }\n\n // For operations that shouldn't have request DTOs, return empty object\n const shouldHaveRequestDto = operationShouldHaveRequestDto(effectiveOperation);\n if (!shouldHaveRequestDto) {\n return z.object({});\n }\n\n // Apply bulk operation decorator for URL-bearing bulk companion operations.\n // For bulk operations, we need to wrap the underlying operation's requestDto\n // with Resources_BulkOperationBaseSchema\n if ('isBulkOperation' in operation && operation.isBulkOperation) {\n // Rebuild the underlying (non-bulk) requestDto by temporarily treating as non-bulk\n const underlyingOperation = {\n ...operation,\n isBulkOperation: false,\n requestDto: undefined // Clear to force rebuild\n };\n // The ROW of a batch create is a CREATE row. Rebuilding it as CREATE_MANY would return the\n // `{ data: row[] }` envelope (see the CREATE_MANY branch below) and this wrap would nest it twice.\n const underlyingRequestDto = this.buildEnhancedRequestDto(\n underlyingOperation,\n effectiveOperation === CoreResourceOperation.CREATE_MANY ? CoreResourceOperation.CREATE : effectiveOperation,\n );\n\n // Wrap as the bulk request, WITH this operation's batch limit (`wrapRequestDtoAsBulk`).\n const hasRowInput = !!underlyingRequestDto\n && !isZodAny(underlyingRequestDto)\n && this.analyzeDtoSchema(underlyingRequestDto) !== '📄 {} (empty object)';\n return wrapRequestDtoAsBulk({\n rowRequestDto: hasRowInput ? underlyingRequestDto : undefined,\n maxSelection: resolveBulkOperationMaxSelection(operation as { bulkOperationMaxSelection?: number }),\n isCreate: effectiveOperation === CoreResourceOperation.CREATE_MANY,\n });\n }\n\n /*\n * CREATE_MANY takes a BATCH: `{ data: row[] }`, at most the batch limit (#1551).\n *\n * It shared the single-row branch below, so its request was ONE row while `createMany` validates\n * the whole `{ data: [...] }` payload against this DTO (`validateAndTransformInput`, loose parse)\n * and then reads `.data` as the rows (`normalizeCreateManyInput`). A resource with any required\n * field could therefore not be batch-created at all. The envelope is built by the same\n * `wrapRequestDtoAsBulk` every other batch request uses, so the row shape and the limit have one\n * construction.\n */\n if (effectiveOperation === CoreResourceOperation.CREATE_MANY) {\n return wrapRequestDtoAsBulk({\n rowRequestDto: this.createRequestDtoForCreate(operation.mainSchema),\n maxSelection: resolveBulkOperationMaxSelection(operation as { bulkOperationMaxSelection?: number }),\n isCreate: true,\n });\n }\n\n // For create operations, use decorator-aware DTO building\n if (effectiveOperation === CoreResourceOperation.CREATE) {\n return this.createRequestDtoForCreate(operation.mainSchema);\n }\n\n // For update operations, use decorator-aware DTO building\n if (effectiveOperation === CoreResourceOperation.UPDATE || effectiveOperation === CoreResourceOperation.UPDATE_MANY) {\n return this.createRequestDtoForUpdate(operation.mainSchema);\n }\n\n // Default: use mainSchema as-is (but still exclude virtual fields)\n return this.excludeVirtualFieldsFromSchema(operation.mainSchema);\n }\n\n /**\n * Build enhanced response DTO based on operation type and mainSchema\n */\n private static buildEnhancedResponseDto(\n operation: ResourceConfiguration_Operation<any, any, any>,\n effectiveOperation: string\n ): z.ZodTypeAny {\n\n // Check if operation already has a meaningful responseDto (not z.any() and not empty)\n const isZAny = operation.responseDto && isZodAny(operation.responseDto);\n const currentResponseInfo = this.analyzeDtoSchema(operation.responseDto);\n\n if (operation.responseDto && !isZAny && currentResponseInfo !== '📄 {} (empty object)') {\n return operation.responseDto;\n }\n\n // Apply bulk operation decorator for URL-bearing bulk companion operations.\n if ('isBulkOperation' in operation && operation.isBulkOperation) {\n switch (effectiveOperation) {\n case CoreResourceOperation.DELETE:\n case CoreResourceOperation.DELETE_MANY:\n return DefaultBulkDeleteResponseSchema;\n case CoreResourceOperation.UPDATE:\n case CoreResourceOperation.UPDATE_MANY:\n case CoreResourceOperation.CREATE:\n case CoreResourceOperation.CREATE_MANY:\n // Bulk create/update responses are arrays of resource items at runtime.\n // The controller validates array responses item-by-item against responseDto,\n // so bulk mutations must expose the per-item schema here, not a count wrapper.\n return operation.mainSchema;\n default:\n return z.array(operation.mainSchema);\n }\n }\n\n // Apply pagination decorator for list/search operations.\n //\n // The ceiling comes from the OPERATION, not from a constant. It used to be a hard-coded `50`,\n // which made `maxPaginatedResultPerPageLimit` inert on the response side: an operation could\n // declare 100 or 200, the repository would honour it, and the response DTO would then reject the\n // very page the repository had just built — a 500 (`service_resource_transformation_failed`,\n // `too_big: expected array to have <=50 items`) rather than a page. Live example found\n // 2026-08-12 on `users | list | admin`; latent on every operation declaring a larger ceiling\n // (`users SEARCH` 200, `organizations SEARCH` 100, `user-profiles` 200).\n //\n // The default is 100 — the ceiling the Mongo `_doList` hard-coded before it was taught to read\n // the declared value, and therefore the largest page this DTO could ever have been handed. It is\n // NOT 50: a 50 default would reject the very pages the repository is still allowed to build for\n // an operation that declares nothing, which is the 500 this whole change exists to remove, in a\n // new place. SEARCH's repository default stays 50, so its pages sit comfortably inside this.\n if (effectiveOperation === CoreResourceOperation.LIST || effectiveOperation === CoreResourceOperation.SEARCH) {\n return this.createPaginatedResponseSchema(\n operation.mainSchema,\n (operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit\n ?? (effectiveOperation === CoreResourceOperation.SEARCH ? DEFAULT_SEARCH_PAGE_CEILING : DEFAULT_LIST_PAGE_CEILING),\n );\n }\n\n // Apply operation-specific default patterns\n const defaultResponse = getDefaultResponseSchemaForOperation(effectiveOperation, operation.mainSchema);\n return defaultResponse;\n }\n\n /**\n * Return the row schema owned by a standard paginated collection response.\n *\n * LIST and SEARCH first derive a client response shaped as\n * `{ data: Row[]; pagination: ... }`. Context projection enriches `Row`, not\n * the envelope. Keeping this extraction at the shared DTO boundary makes the\n * invariant unbypassable for every generated CONTEXT collection operation:\n * its response is exactly one page of context-enriched rows.\n *\n * A malformed/custom collection response fails closed here. Silently falling\n * back to the envelope recreates the former `Page<Page<Row>>` contract and\n * lets runtime, OpenAPI, examples and client validation disagree.\n */\n private static extractPaginatedCollectionItemDto(\n responseDto: z.ZodTypeAny,\n effectiveOperation: string\n ): z.ZodTypeAny {\n if (!isZodObject(responseDto)) {\n throw new Error(\n `Cannot build ${effectiveOperation} context DTO: collection response must be a pagination object`\n );\n }\n\n const responseShape = getZodObjectShape(responseDto);\n const dataSchema = responseShape.data;\n if (!dataSchema || !isZodArray(dataSchema)) {\n throw new Error(\n `Cannot build ${effectiveOperation} context DTO: pagination response must contain a data array`\n );\n }\n\n const itemSchema = getZodDefSchemaProperty(dataSchema, 'element');\n if (!itemSchema) {\n throw new Error(\n `Cannot build ${effectiveOperation} context DTO: pagination data array has no item schema`\n );\n }\n\n return itemSchema;\n }\n\n /**\n * Create request DTO for CREATE operations.\n *\n * Excludes:\n * - Standard auto-populated fields (_id, createdAt, etc.)\n * - Fields with `excludeFromCreate` decorator\n * - Fields with `isVirtual` decorator (computed fields)\n *\n * Handles discriminated unions by applying omissions to each variant.\n */\n private static createRequestDtoForCreate(mainSchema: z.ZodTypeAny): z.ZodTypeAny {\n // Check if it's a discriminated union - need to handle each variant\n const zodType = getZodType(mainSchema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(mainSchema, 'discriminator');\n const options = getZodDefArrayProperty(mainSchema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && options && options.length > 0) {\n // Apply omissions to each variant in the union\n const modifiedOptions = options.map(option =>\n this.applyCreateOmissionsToSchema(option)\n );\n\n // Recreate discriminated union with modified variants\n if (modifiedOptions.length >= 2) {\n return this.preserveRegistryMetadata(\n mainSchema,\n z.discriminatedUnion(\n discriminator,\n modifiedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n ),\n );\n } else if (modifiedOptions.length === 1) {\n return modifiedOptions[0];\n }\n }\n }\n\n // Regular object schema - apply omissions directly\n return this.applyCreateOmissionsToSchema(mainSchema);\n }\n\n /**\n * Check if a field is a non-discriminator literal.\n * Non-discriminator literals are fixed values that should be auto-populated by the backend.\n * Discriminator literals are used for variant selection and should be shown in CREATE forms.\n *\n * Handles wrapped types (optional, default, etc.) by unwrapping before type check.\n */\n private static isNonDiscriminatorLiteral(fieldSchema: z.ZodTypeAny): boolean {\n // Unwrap to handle z.literal(\"value\").optional() etc.\n const unwrapped = unwrapSchema(fieldSchema);\n const zodType = getZodType(unwrapped);\n // Check if it's a literal type and NOT marked as discriminator\n // isDiscriminatorField already handles unwrapping via getMetadataRecursive\n return zodType === 'literal' && !isDiscriminatorField(fieldSchema);\n }\n\n /**\n * Apply CREATE operation omissions to a single schema (object or other).\n */\n private static applyCreateOmissionsToSchema(schema: z.ZodTypeAny): z.ZodTypeAny {\n if (!isZodObject(schema)) {\n return schema;\n }\n\n // Standard auto-generated fields to omit from create request DTOs.\n // Note: _id is handled via isPrimaryKey decorator which implies excludeFromCreate.\n // The context-auto-populated FKs (createdByUserId, organizationId, userId,\n // applicationId, anonymousUserId — all backend-injected from the EC, never\n // client-supplied) come from the shared CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS\n // single source of truth so this omit list and the trusted-system-write\n // re-attach allowlist (deriveTrustedSystemWritePreservedFields) never drift.\n const fieldsToOmit = ['id', 'createdAt', 'updatedAt', ...CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS];\n\n try {\n const omitObj: Record<string, true> = {};\n const shape = getZodObjectShape(schema);\n\n // Add standard fields to omit\n fieldsToOmit.forEach(field => {\n if (shape[field]) {\n omitObj[field] = true;\n }\n });\n\n // Add fields with excludeFromCreate decorator (includes isPrimaryKey which implies excludeFromCreate)\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isExcludedFromCreate(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude virtual fields - they are computed, not submitted\n if (isVirtualField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude backend-only fields - they are managed internally\n if (isBackendOnlyField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude generated file fields - they are materialized by operations,\n // not uploaded or supplied in client write payloads.\n if (isTemplatableFileField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude non-discriminator literals - they are auto-populated by backend\n // Discriminator literals are KEPT for variant selection in CREATE forms\n if (this.isNonDiscriminatorLiteral(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n }\n\n // If we have fields to omit, create omitted schema\n if (Object.keys(omitObj).length > 0) {\n const omittedSchema = this.omitObjectFields(schema, omitObj);\n return this.stripTemplatableFileFieldsRecursively(omittedSchema);\n }\n } catch (error) {\n throw new Error(`Failed to create request DTO for CREATE: ${describeCaughtError(error)}`);\n }\n\n return this.stripTemplatableFileFieldsRecursively(schema);\n }\n\n /**\n * Create request DTO for UPDATE operations.\n *\n * Excludes:\n * - Standard auto-populated fields (_id, createdAt, etc.)\n * - Fields with `excludeFromUpdate` decorator\n * - Fields with `isVirtual` decorator (computed fields)\n *\n * Handles discriminated unions by applying omissions to each variant.\n */\n private static createRequestDtoForUpdate(mainSchema: z.ZodTypeAny): z.ZodTypeAny {\n // Check if it's a discriminated union - need to handle each variant\n const zodType = getZodType(mainSchema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(mainSchema, 'discriminator');\n const options = getZodDefArrayProperty(mainSchema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && options && options.length > 0) {\n // PATCH semantics for an inheritance resource. Two hard constraints\n // collide here and only a MERGED SUPERSET OBJECT satisfies both:\n //\n // 1. The persisted variant is IMMUTABLE and the repository applies a\n // partial `$set` (see `RepositoryResourceBackendService.update` →\n // `findOneAndUpdate({ $set })`). A caller therefore legitimately\n // sends only the fields it changes — e.g. an inline status\n // autosave submits `{ status }` with NO `recurringType`. A\n // discriminated union CANNOT express \"discriminator optional\":\n // Zod needs the key present to pick a branch, and a discriminator\n // `.default()` does NOT fire inside `z.discriminatedUnion`, so the\n // missing key fails with \"No matching discriminator\" (the exact\n // wonder-todos `todos` CHANGE_STATUS / inline-edit crash).\n // 2. Variant-only fields (`recurrence` / `startDate` / `endsDate`)\n // must stay IN the contract — a bare base object would `z.object`-\n // strip them, silently dropping a partial update that touches a\n // variant field. Keeping every variant field is the whole reason\n // this DTO became a union in the first place.\n //\n // Collapsing the per-variant options into one object whose fields are\n // all optional (the discriminator included) keeps every variant field\n // reachable AND lets any partial subset validate without echoing the\n // immutable discriminator. Variant/field coherence is enforced\n // server-side against the merged persisted+patch object (the `$set`\n // target already carries the true variant), NOT by the static request\n // contract. CREATE keeps the discriminated union (see\n // `createRequestDtoForCreate`) because on CREATE the client MUST choose\n // a variant and variant-field validation applies.\n return this.mergeUnionOptionsIntoOptionalUpdateObject(options, discriminator);\n }\n }\n\n // Regular object schema - apply omissions directly\n return this.applyUpdateOmissionsToSchema(mainSchema);\n }\n\n /**\n * Collapse the per-variant options of an inheritance UPDATE discriminated\n * union into a single object with PATCH semantics: every base + variant-only\n * field present and optional, and the discriminator itself optional.\n *\n * Each option is first run through {@link applyUpdateOmissionsToSchema}\n * (which drops `excludeFromUpdate` / PK / virtual / backend-only / templatable\n * file fields and optionalises every non-discriminator field), then the\n * resulting shapes are merged. The discriminator — which\n * `applyUpdateOmissionsToSchema` keeps required per-variant so the omission\n * pass does not mistake it for an auto-populated literal — is replaced by a\n * single OPTIONAL enum spanning every variant value, so a partial update may\n * omit it entirely (the persisted variant is immutable) yet a full-object\n * update that re-sends the current discriminator still validates.\n *\n * Nested inheritance (an option that is itself a union) is flattened\n * recursively so deeply-nested variant fields are preserved too.\n */\n private static mergeUnionOptionsIntoOptionalUpdateObject(\n options: z.ZodTypeAny[],\n discriminatorField: string\n ): z.ZodTypeAny {\n const mergedShape: Record<string, z.ZodTypeAny> = {};\n const discriminatorValues = new Set<string>();\n\n const collectFromOption = (option: z.ZodTypeAny): void => {\n // Flatten nested discriminated unions (multi-level inheritance).\n if (getZodType(option) === 'union') {\n const nestedOptions = getZodDefArrayProperty(option, 'options') as z.ZodTypeAny[] | undefined;\n if (nestedOptions && nestedOptions.length > 0) {\n nestedOptions.forEach(collectFromOption);\n return;\n }\n }\n\n const omitted = this.applyUpdateOmissionsToSchema(option);\n if (!isZodObject(omitted)) {\n return;\n }\n\n const shape = getZodObjectShape(omitted);\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (fieldName === discriminatorField) {\n // Gather every variant value the discriminator can carry; the field\n // is rebuilt as one optional enum below.\n for (const value of this.extractDiscriminatorValues(fieldSchema as z.ZodTypeAny)) {\n discriminatorValues.add(value);\n }\n continue;\n }\n // First writer wins: base fields are identical across variants and\n // variant-only fields appear in exactly one option, so there is no\n // meaningful collision to resolve. `applyUpdateOmissionsToSchema`\n // already made every non-discriminator field optional.\n if (!mergedShape[fieldName]) {\n mergedShape[fieldName] = fieldSchema as z.ZodTypeAny;\n }\n }\n };\n\n options.forEach(collectFromOption);\n\n if (discriminatorValues.size > 0) {\n // Optional so a partial update may omit the immutable discriminator; the\n // enum still accepts a re-sent current value from a full-object update.\n mergedShape[discriminatorField] = z\n .enum(Array.from(discriminatorValues) as [string, ...string[]])\n .optional();\n }\n\n // The merged inheritance UPDATE root is written PATCH style like any other UPDATE root (#989).\n return markPatchRequestDtoObject(z.object(mergedShape));\n }\n\n /**\n * Extract the concrete discriminator value(s) a union-option's discriminator\n * field can hold. Variant options carry a `z.literal(value)`; the base option\n * carries a `z.enum([...baseValues])`. Both may be wrapped by the\n * `isDiscriminator` decorator / `.default()` / `.optional()`, so unwrap first.\n */\n private static extractDiscriminatorValues(fieldSchema: z.ZodTypeAny): string[] {\n const unwrapped = unwrapSchema(fieldSchema);\n const unwrappedType = getZodType(unwrapped);\n\n if (unwrappedType === 'enum') {\n return getEnumValues(unwrapped).map(String);\n }\n\n // Literal — Zod 4 stores value(s) in `def.values` (array); fall back to the\n // legacy scalar `def.value`. Mirrors the literal read at `analyzeDtoSchema`.\n const literalValues = (getZodDefArrayProperty(unwrapped, 'values')\n ?? [getZodDefProperty(unwrapped, 'value')]) as unknown[];\n return literalValues\n .filter((value): value is string | number => value !== undefined && value !== null)\n .map(String);\n }\n\n /**\n * Apply UPDATE operation omissions to a single schema (object or other).\n */\n private static applyUpdateOmissionsToSchema(schema: z.ZodTypeAny): z.ZodTypeAny {\n if (!isZodObject(schema)) {\n return schema;\n }\n\n // Standard auto-generated fields to omit from update request DTOs.\n // Note: Primary keys are passed as route params, not in request body.\n // The context-auto-populated FKs (immutable after creation; anonymousUserId\n // is managed by transposition, never client-updatable) come from the shared\n // CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS single source of truth so this omit\n // list and the trusted-system-write re-attach allowlist stay in lockstep.\n const fieldsToOmit = ['id', 'createdAt', 'updatedAt', ...CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS];\n\n try {\n const omitObj: Record<string, true> = {};\n const shape = getZodObjectShape(schema);\n\n // Add standard fields to omit\n fieldsToOmit.forEach(field => {\n if (shape[field]) {\n omitObj[field] = true;\n }\n });\n\n // Add fields with excludeFromUpdate decorator or isPrimaryKey (passed as route param)\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isExcludedFromUpdate(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Primary keys are passed as route params, not in request body\n if (isPrimaryKey(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude virtual fields - they are computed, not submitted\n if (isVirtualField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude backend-only fields - they are managed internally\n if (isBackendOnlyField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude generated file fields - explicit regenerate operations own\n // refreshing them, so generic UPDATE payloads must not accept them.\n if (isTemplatableFileField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n // Exclude NON-discriminator literals only — they are fixed values\n // auto-populated by the backend and immutable after creation.\n //\n // Discriminator literals are KEPT: for an inheritance resource the\n // UPDATE DTO is a discriminated union, and the discriminator must be\n // present (and required) so Zod can select the variant and validate\n // its variant-specific fields. Stripping it produced a structurally\n // invalid discriminated union (\"Invalid discriminated union option\").\n // The discriminator's immutability is enforced at the service layer\n // (the update is rejected if it changes the variant), not by removing\n // it from the request contract — which would silently drop every\n // variant-only field from the payload.\n if (this.isNonDiscriminatorLiteral(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n }\n\n // Rebuild the shape with PATCH semantics: drop the omitted fields, then\n // make every remaining field optional EXCEPT the discriminator. This\n // mirrors the factory's `buildUpdateRequestDto` (partial update). The\n // discriminator is left REQUIRED here only so this per-variant omission\n // pass does not mistake it for an auto-populated literal and strip it —\n // for an inheritance UPDATE the per-variant objects are then merged by\n // `mergeUnionOptionsIntoOptionalUpdateObject`, which replaces the\n // discriminator with a single OPTIONAL enum so partial updates may omit\n // the immutable discriminator. (Without optionalizing the other fields\n // every field would become mandatory, breaking partial updates for every\n // resource.)\n const updateShape: Record<string, z.ZodTypeAny> = {};\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (omitObj[fieldName]) {\n continue;\n }\n const strippedField = this.stripTemplatableFileFieldsRecursively(fieldSchema as z.ZodTypeAny);\n // Non-discriminator fields are optionalised for PATCH; `toPatchOptionalField`\n // also peels any `.default()` so an omitted field is never re-materialized to\n // its default and `$set` back over the stored value (the `attemptCount`-reset\n // class of bug). The discriminator is kept as-is (required, default intact) so\n // the union stays selectable — the merge pass replaces it with an optional enum.\n updateShape[fieldName] = isDiscriminatorField(fieldSchema as z.ZodTypeAny)\n ? strippedField\n : toPatchOptionalField(strippedField);\n }\n // PATCH write rule: the form clears this object's direct fields with an explicit null (#989).\n return markPatchRequestDtoObject(z.object(updateShape));\n } catch (error) {\n throw new Error(`Failed to create request DTO for UPDATE: ${describeCaughtError(error)}`);\n }\n\n return this.stripTemplatableFileFieldsRecursively(schema);\n }\n\n /**\n * Exclude virtual fields from a schema.\n * Virtual fields are computed at runtime and should not appear in request DTOs.\n *\n * Handles discriminated unions by applying omissions to each variant.\n */\n private static excludeVirtualFieldsFromSchema(mainSchema: z.ZodTypeAny): z.ZodTypeAny {\n // Check if it's a discriminated union - need to handle each variant\n const zodType = getZodType(mainSchema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(mainSchema, 'discriminator');\n const options = getZodDefArrayProperty(mainSchema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && options && options.length > 0) {\n // Apply virtual field exclusion to each variant\n const modifiedOptions = options.map(option =>\n this.applyVirtualFieldExclusionToSchema(option)\n );\n\n // Recreate discriminated union with modified variants\n if (modifiedOptions.length >= 2) {\n return this.preserveRegistryMetadata(\n mainSchema,\n z.discriminatedUnion(\n discriminator,\n modifiedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n ),\n );\n } else if (modifiedOptions.length === 1) {\n return modifiedOptions[0];\n }\n }\n }\n\n // Regular object schema - apply exclusion directly\n return this.applyVirtualFieldExclusionToSchema(mainSchema);\n }\n\n /**\n * Apply virtual field exclusion to a single schema (object or other).\n */\n private static applyVirtualFieldExclusionToSchema(schema: z.ZodTypeAny): z.ZodTypeAny {\n if (!isZodObject(schema)) {\n return schema;\n }\n\n try {\n const omitObj: Record<string, true> = {};\n const shape = getZodObjectShape(schema);\n\n // Find and exclude virtual fields\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isVirtualField(fieldSchema as z.ZodTypeAny)) {\n omitObj[fieldName] = true;\n }\n }\n\n // If we have fields to omit, create omitted schema\n if (Object.keys(omitObj).length > 0) {\n const omittedSchema = this.omitObjectFields(schema, omitObj);\n return omittedSchema;\n }\n } catch (error) {\n throw new Error(`Failed to exclude virtual fields from schema: ${describeCaughtError(error)}`);\n }\n\n return schema;\n }\n\n // TODO: Implement cascading relationships logic in future iteration\n\n\n\n /**\n * Create paginated response schema using shared pagination metadata schema\n */\n private static createPaginatedResponseSchema(\n dataSchema: z.ZodTypeAny,\n maxResultsPerPageLimit: number = 100\n ): z.ZodTypeAny {\n return z.object({\n data: z.array(dataSchema).max(maxResultsPerPageLimit),\n // Bounded by the SAME ceiling as the data array beside it. Leaving this on the default-bounded\n // constant is how a legitimately-served 120-row page still answered 500 after the array bound,\n // the request bound and both repository maxima had been unified: `limit` echoes the page size\n // actually served, so a stricter bound here rejects what the line above just permitted.\n pagination: createPaginationResponseMetadataSchema(maxResultsPerPageLimit)\n });\n }\n\n /**\n * Analyze a DTO schema with full recursive object display\n * Public method to get detailed recursive schema analysis\n */\n static analyzeSchemaRecursive(\n schema: any,\n maxDepth: number = 5\n ): string {\n return this.analyzeDtoSchemaRecursive(schema, '', maxDepth);\n }\n\n /**\n * Debug helper to display a single schema with full recursive analysis\n * Useful for detailed inspection of specific DTOs\n */\n static debugDisplaySingleSchema(\n schemaName: string,\n schema: any,\n maxDepth: number = 5\n ): void {\n console.log(`\\n🔍 === SCHEMA DEBUG: ${schemaName} ===`);\n const analysis = this.analyzeDtoSchemaRecursive(schema, '', maxDepth);\n console.log(analysis);\n console.log(`=== END SCHEMA DEBUG ===\\n`);\n }\n\n /**\n * Convenience method to display DTOs with full recursive object details\n * Shows complete nested structures for better understanding\n */\n static debugDisplayGeneratedDtosWithFullDetails(\n resourceConfigurations: { [key: string]: any },\n resourceFilter: ResourceType[] = [],\n maxDepth: number = 4\n ): void {\n console.log(`\\n🔍 === FULL RECURSIVE DTO ANALYSIS (depth: ${maxDepth}) ===\\n`);\n this.debugDisplayGeneratedDtos(\n resourceConfigurations,\n resourceFilter,\n true, // Always use recursive analysis\n maxDepth\n );\n }\n\n /**\n * Debug function to display DTOs for specific resources\n * @param resourceConfigurations - All resource configurations\n * @param resourceFilter - Array of resource types to filter (empty = show all)\n * @param useRecursiveAnalysis - Whether to show full recursive object structures (default: true now)\n * @param maxRecursionDepth - Maximum depth for recursive object analysis (default: 3)\n */\n static debugDisplayGeneratedDtos(\n resourceConfigurations: { [key: string]: any },\n resourceFilter: ResourceType[] = [],\n useRecursiveAnalysis: boolean = true,\n maxRecursionDepth: number = 3\n ): void {\n console.log('\\n=== 📋 GENERATED DTOS DEBUG DISPLAY ===\\n');\n\n const resourceTypes = Object.keys(resourceConfigurations).sort();\n let totalOperations = 0;\n let totalDtosProcessed = 0;\n let filteredResourceTypes = resourceFilter.length > 0\n ? resourceTypes.filter(type => resourceFilter.includes(type as ResourceType))\n : resourceTypes;\n\n if (resourceFilter.length > 0) {\n console.log(`🔍 Filtering for resources: ${resourceFilter.join(', ')}\\n`);\n }\n\n if (useRecursiveAnalysis) {\n console.log(`🔄 Using recursive object analysis (full nested structures, max depth: ${maxRecursionDepth})\\n`);\n }\n\n for (const resourceType of filteredResourceTypes) {\n const resourceConfig = resourceConfigurations[resourceType];\n\n if (!resourceConfig || !resourceConfig.operations) {\n console.log(`⚠️ Resource ${resourceType}: No operations found`);\n continue;\n }\n\n const operations = resourceConfig.operations;\n console.log(`\\n📦 Resource: ${resourceType}`);\n console.log(` Operations: ${operations.length}`);\n\n // Group operations by operation identifier for cleaner display\n const operationGroups = new Map<string, any[]>();\n operations.forEach((op: any) => {\n const key = op.operationIdentifier;\n if (!operationGroups.has(key)) {\n operationGroups.set(key, []);\n }\n operationGroups.get(key)!.push(op);\n });\n\n for (const [operationIdentifier, ops] of operationGroups.entries()) {\n console.log(`\\n 🔧 Operation: ${operationIdentifier} (${ops.length} variants)`);\n\n ops.forEach((operation: any, index: number) => {\n totalOperations++;\n const variantInfo = operation.variantType +\n ('isBulkOperation' in operation && operation.isBulkOperation ? ' [BULK]' : '') +\n (operation.isOperationDefault ? ' [DEFAULT]' : '') +\n (operation.variantKey ? ` [${operation.variantKey}]` : '');\n\n console.log(` └─ Variant ${index + 1}: ${variantInfo}`);\n\n // Display Request DTO\n const requestDtoInfo = useRecursiveAnalysis\n ? this.analyzeDtoSchemaRecursive(operation.requestDto, '', maxRecursionDepth)\n : this.analyzeDtoSchema(operation.requestDto);\n console.log(` 📤 Request: ${requestDtoInfo}`);\n totalDtosProcessed++;\n\n // Display Response DTO\n const responseDtoInfo = useRecursiveAnalysis\n ? this.analyzeDtoSchemaRecursive(operation.responseDto, '', maxRecursionDepth)\n : this.analyzeDtoSchema(operation.responseDto);\n console.log(` 📥 Response: ${responseDtoInfo}`);\n totalDtosProcessed++;\n\n // NOTE: Cascade mode logging removed - lifecycle operations are now on relationships\n // See childOperations.lifecycle.onParentDelete on ResourceRelationship\n\n // NOTE: inheritenceSchemaConfiguration removed - conditional relationships now use\n // discriminator field on ResourceRelationship instead\n });\n }\n }\n\n console.log(`\\n=== 📊 DTO DEBUG SUMMARY ===`);\n console.log(`Resources processed: ${filteredResourceTypes.length}/${resourceTypes.length}`);\n console.log(`Total operations: ${totalOperations}`);\n console.log(`Total DTOs processed: ${totalDtosProcessed}`);\n if (resourceFilter.length > 0) {\n console.log(`Filter applied: [${resourceFilter.join(', ')}]`);\n }\n if (useRecursiveAnalysis) {\n console.log(`Analysis mode: Recursive (full nested structures, depth: ${maxRecursionDepth})`);\n }\n console.log(`=================================\\n`);\n }\n\n /**\n * Get field count and names from a Zod object schema (Zod-compliant)\n */\n private static getZodObjectFields(schema: any): { fieldCount: number; fieldNames: string[] } {\n if (!isZodObject(schema)) {\n return { fieldCount: 0, fieldNames: [] };\n }\n\n try {\n // Use public .shape property (Zod v4 API)\n const shape = getZodObjectShape(schema);\n const fieldNames = Object.keys(shape);\n return { fieldCount: fieldNames.length, fieldNames };\n } catch (error) {\n return { fieldCount: 0, fieldNames: [] };\n }\n }\n\n /**\n * Analyze a DTO schema and return a detailed human-readable summary (Zod-compliant)\n */\n private static analyzeDtoSchema(schema: any, indent: string = ''): string {\n if (!schema) {\n return '❌ null/undefined';\n }\n\n // Check if it's a z.any()\n if (isZodAny(schema)) {\n return '⚪ z.any() [NEEDS ENHANCEMENT]';\n }\n\n // Check if it's a ZodObject - use proper field detection\n if (isZodObject(schema)) {\n const { fieldCount, fieldNames } = this.getZodObjectFields(schema);\n\n if (fieldCount === 0) {\n return '📄 {} (empty object)';\n }\n\n // Check if this is a decorated schema\n let decorationInfo = '';\n // Use the new Symbol-based metadata approach (preserves description for API docs)\n const metadata = getCustomFieldMetadata(schema);\n const decorations: string[] = [];\n if (metadata[ZodDecorator.IS_DB_INDEXED]) decorations.push('indexed');\n if (metadata[ZodDecorator.IS_FOREIGN_KEY]) decorations.push('reference');\n if (decorations.length > 0) {\n decorationInfo = ` [${decorations.join(', ')}]`;\n }\n\n // Return with detailed field information inline\n let result = `📋 Object (${fieldCount} fields)${decorationInfo}`;\n\n // Always show ALL field details without truncation\n if (fieldCount > 0) {\n try {\n const shape = getZodObjectShape(schema);\n\n result += ':\\n';\n fieldNames.forEach((fieldName, index) => {\n const fieldSchema = shape[fieldName];\n const fieldType = this.getFieldTypeRecursive(\n fieldSchema,\n indent + ' │ ',\n 3, // Max depth for nested objects\n 0,\n new Set()\n );\n const isOptional = this.isFieldOptional(fieldSchema);\n const optionalMark = isOptional ? '?' : '';\n result += `${indent} │ ${fieldName}${optionalMark}: ${fieldType}`;\n if (index < fieldNames.length - 1) result += '\\n';\n });\n } catch (error) {\n result += ` (field details unavailable: ${error})`;\n }\n }\n\n return result;\n }\n\n\n\n // Check if it's an array\n if (isZodArray(schema)) {\n const element = getZodDefSchemaProperty(schema, 'element');\n if (!element) return '📚 Array[unknown]';\n const elementType = this.getFieldTypeRecursive(\n element,\n indent,\n 3, // Max depth for array elements\n 0,\n new Set()\n );\n return `📚 Array[${elementType}]`;\n }\n\n // Check if it's a union (regular or discriminated)\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const options = getZodDefArrayProperty(schema, 'options');\n const optionCount = options?.length || 0;\n // In Zod v4, discriminated unions extend union and have a discriminator property\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n if (discriminator) {\n return `🔀 DiscriminatedUnion (${optionCount} options, discriminator: \"${discriminator}\")`;\n }\n return `🔀 Union (${optionCount} options)`;\n }\n\n // Check if it's a merge/intersection\n if (zodType === 'intersection') {\n return '🔗 Merged schema';\n }\n\n // Check if it's an optional wrapper\n if (isZodOptional(schema)) {\n const innerType = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerType) return 'unknown (optional)';\n return this.analyzeDtoSchema(innerType, indent) + ' (optional)';\n }\n\n // Check if it's a pipe (from .transform(), .pipe(), etc.)\n // In Zod v4, transforms create pipe types with 'in' and 'out' schemas\n if (zodType === 'pipe') {\n const inSchema = getZodDefSchemaProperty(schema, 'in');\n if (!inSchema) return '🔧 Pipe[unknown]';\n return `🔧 Pipe[${this.analyzeDtoSchema(inSchema, indent)}]`;\n }\n\n // Check if it's a transform (standalone transform, no underlying schema)\n if (zodType === 'transform') {\n return '🔧 Transform';\n }\n\n // Check if it's a custom (from .refine(), .superRefine(), etc.)\n // Custom types don't wrap schemas - refinements are stored as checks on the schema\n if (zodType === 'custom') {\n return '🔧 Custom';\n }\n\n // Check if it's a ZodDefault (has default value)\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerSchema) return 'unknown (with default)';\n return this.analyzeDtoSchema(innerSchema, indent) + ' (with default)';\n }\n\n // Default case\n return `🔍 ${zodType || 'Unknown'}`;\n }\n\n /**\n * Analyze a DTO schema with full recursive object display\n * This method shows complete nested object structures instead of just summaries\n */\n private static analyzeDtoSchemaRecursive(\n schema: any,\n indent: string = '',\n maxDepth: number = 5,\n currentDepth: number = 0,\n visitedSchemas: Set<any> = new Set()\n ): string {\n if (!schema) {\n return '❌ null/undefined';\n }\n\n // Prevent infinite recursion\n if (currentDepth >= maxDepth) {\n return `🔄 [Max depth ${maxDepth} reached]`;\n }\n\n // Prevent circular references\n if (visitedSchemas.has(schema)) {\n return '🔄 [Circular reference]';\n }\n visitedSchemas.add(schema);\n\n // Check if it's a z.any()\n if (isZodAny(schema)) {\n visitedSchemas.delete(schema);\n return '⚪ z.any() [NEEDS ENHANCEMENT]';\n }\n\n // Check if it's a ZodObject - use proper field detection with full recursion\n if (isZodObject(schema)) {\n const { fieldCount, fieldNames } = this.getZodObjectFields(schema);\n\n if (fieldCount === 0) {\n visitedSchemas.delete(schema);\n return '📄 {} (empty object)';\n }\n\n // Check if this is a decorated schema\n let decorationInfo = '';\n // Use the new Symbol-based metadata approach (preserves description for API docs)\n const metadata = getCustomFieldMetadata(schema);\n const decorations: string[] = [];\n if (metadata[ZodDecorator.IS_DB_INDEXED]) decorations.push('indexed');\n if (metadata[ZodDecorator.IS_FOREIGN_KEY]) decorations.push('reference');\n if (decorations.length > 0) {\n decorationInfo = ` [${decorations.join(', ')}]`;\n }\n\n // Return with detailed field information inline with full recursion\n let result = `📋 Object (${fieldCount} fields)${decorationInfo}`;\n\n // Always show ALL field details with recursion\n if (fieldCount > 0) {\n try {\n const shape = getZodObjectShape(schema);\n\n result += ':\\n';\n fieldNames.forEach((fieldName, index) => {\n const fieldSchema = shape[fieldName];\n const fieldType = this.getFieldTypeRecursive(\n fieldSchema,\n indent + ' │ ',\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n const isOptional = this.isFieldOptional(fieldSchema);\n const optionalMark = isOptional ? '?' : '';\n result += `${indent} │ ${fieldName}${optionalMark}: ${fieldType}`;\n if (index < fieldNames.length - 1) result += '\\n';\n });\n } catch (error) {\n result += ` (field details unavailable: ${error})`;\n }\n }\n\n visitedSchemas.delete(schema);\n return result;\n }\n\n // Check if it's an array with recursive element analysis\n if (isZodArray(schema)) {\n const element = getZodDefSchemaProperty(schema, 'element');\n if (!element) {\n visitedSchemas.delete(schema);\n return '📚 Array[unknown]';\n }\n const elementType = this.getFieldTypeRecursive(\n element,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n visitedSchemas.delete(schema);\n return `📚 Array[${elementType}]`;\n }\n\n // Check if it's a union (regular or discriminated)\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const options = getZodDefArrayProperty(schema, 'options');\n const optionCount = options?.length || 0;\n // In Zod v4, discriminated unions extend union and have a discriminator property\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n visitedSchemas.delete(schema);\n if (discriminator) {\n return `🔀 DiscriminatedUnion (${optionCount} options, discriminator: \"${discriminator}\")`;\n }\n return `🔀 Union (${optionCount} options)`;\n }\n\n // Check if it's a merge/intersection\n if (zodType === 'intersection') {\n visitedSchemas.delete(schema);\n return '🔗 Merged schema';\n }\n\n // Check if it's an optional wrapper\n if (isZodOptional(schema)) {\n const innerType = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerType) {\n visitedSchemas.delete(schema);\n return 'unknown (optional)';\n }\n const result = this.analyzeDtoSchemaRecursive(\n innerType,\n indent,\n maxDepth,\n currentDepth,\n new Set(visitedSchemas)\n ) + ' (optional)';\n visitedSchemas.delete(schema);\n return result;\n }\n\n // Check if it's a pipe (from .transform(), .pipe(), etc.)\n // In Zod v4, transforms create pipe types with 'in' and 'out' schemas\n if (zodType === 'pipe') {\n const inSchema = getZodDefSchemaProperty(schema, 'in');\n if (!inSchema) {\n visitedSchemas.delete(schema);\n return '🔧 Pipe[unknown]';\n }\n const result = `🔧 Pipe[${this.analyzeDtoSchemaRecursive(\n inSchema,\n indent,\n maxDepth,\n currentDepth,\n new Set(visitedSchemas)\n )}]`;\n visitedSchemas.delete(schema);\n return result;\n }\n\n // Check if it's a transform (standalone transform, no underlying schema)\n if (zodType === 'transform') {\n visitedSchemas.delete(schema);\n return '🔧 Transform';\n }\n\n // Check if it's a custom (from .refine(), .superRefine(), etc.)\n // Custom types don't wrap schemas - refinements are stored as checks on the schema\n if (zodType === 'custom') {\n visitedSchemas.delete(schema);\n return '🔧 Custom';\n }\n\n // Check if it's a ZodDefault (has default value)\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerSchema) {\n visitedSchemas.delete(schema);\n return 'unknown (with default)';\n }\n const result = this.analyzeDtoSchemaRecursive(\n innerSchema,\n indent,\n maxDepth,\n currentDepth,\n new Set(visitedSchemas)\n ) + ' (with default)';\n visitedSchemas.delete(schema);\n return result;\n }\n\n // Default case\n visitedSchemas.delete(schema);\n return `🔍 ${zodType || 'Unknown'}`;\n }\n\n /**\n * Get detailed field type description with full recursive sub-object support\n */\n private static getFieldTypeRecursive(\n fieldSchema: any,\n indent: string = '',\n maxDepth: number = 5,\n currentDepth: number = 0,\n visitedSchemas: Set<any> = new Set()\n ): string {\n const zodType = getZodType(fieldSchema);\n if (!zodType) return 'unknown';\n\n // Prevent infinite recursion\n if (currentDepth >= maxDepth) {\n return `[Max depth ${maxDepth} reached]`;\n }\n\n // Prevent circular references\n if (visitedSchemas.has(fieldSchema)) {\n return '[Circular reference]';\n }\n\n switch (zodType) {\n case 'string':\n // Check for decorations\n if (fieldSchema.description) {\n try {\n const metadata = JSON.parse(fieldSchema.description);\n const decorations: string[] = [];\n if (metadata.isDBIndexed) decorations.push('indexed');\n if (metadata.isForeignKey) decorations.push('ref');\n if (decorations.length > 0) {\n return `string [${decorations.join(', ')}]`;\n }\n } catch {}\n }\n return 'string';\n case 'number':\n case 'int': return 'number';\n case 'bigint': return 'bigint';\n case 'boolean': return 'boolean';\n case 'date': return 'Date';\n case 'array':\n visitedSchemas.add(fieldSchema);\n const element = getZodDefSchemaProperty(fieldSchema, 'element');\n if (!element) {\n visitedSchemas.delete(fieldSchema);\n return 'unknown[]';\n }\n const elementType = this.getFieldTypeRecursive(\n element,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n visitedSchemas.delete(fieldSchema);\n return `${elementType}[]`;\n case 'enum':\n // Use centralized getEnumValues function\n const enumValues = getEnumValues(fieldSchema);\n if (enumValues.length === 0) return 'enum()';\n return `enum(${enumValues.slice(0, 3).join('|')}${enumValues.length > 3 ? '...' : ''})`;\n case 'object':\n // Full recursive object analysis\n visitedSchemas.add(fieldSchema);\n const { fieldCount, fieldNames } = this.getZodObjectFields(fieldSchema);\n\n if (fieldCount === 0) {\n visitedSchemas.delete(fieldSchema);\n return '{}';\n }\n\n let result = `{\\n`;\n try {\n const shape = getZodObjectShape(fieldSchema);\n\n fieldNames.forEach((fieldName, index) => {\n const nestedFieldSchema = shape[fieldName];\n const nestedFieldType = this.getFieldTypeRecursive(\n nestedFieldSchema,\n indent + ' ',\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n const isOptional = this.isFieldOptional(nestedFieldSchema);\n const optionalMark = isOptional ? '?' : '';\n result += `${indent} ${fieldName}${optionalMark}: ${nestedFieldType}`;\n if (index < fieldNames.length - 1) result += ',\\n';\n });\n result += `\\n${indent}}`;\n } catch (error) {\n result = `object(${fieldCount} fields) [error: ${error}]`;\n }\n\n visitedSchemas.delete(fieldSchema);\n return result;\n case 'optional':\n const optionalInnerType = getZodDefSchemaProperty(fieldSchema, 'innerType');\n if (!optionalInnerType) return 'unknown?';\n return this.getFieldTypeRecursive(\n optionalInnerType,\n indent,\n maxDepth,\n currentDepth,\n visitedSchemas\n ) + '?';\n case 'nullable':\n const nullableInnerType = getZodDefSchemaProperty(fieldSchema, 'innerType');\n if (!nullableInnerType) return 'unknown | null';\n return this.getFieldTypeRecursive(\n nullableInnerType,\n indent,\n maxDepth,\n currentDepth,\n visitedSchemas\n ) + ' | null';\n case 'default':\n const defaultValue = getZodDefProperty(fieldSchema, 'defaultValue');\n const defaultInnerType = getZodDefSchemaProperty(fieldSchema, 'innerType');\n if (!defaultInnerType) return 'unknown (with default)';\n const defaultValueStr = typeof defaultValue === 'function'\n ? 'fn()'\n : String(defaultValue ?? 'undefined');\n return this.getFieldTypeRecursive(\n defaultInnerType,\n indent,\n maxDepth,\n currentDepth,\n visitedSchemas\n ) + ` (default: ${defaultValueStr})`;\n case 'union':\n const unionOptions = getZodDefArrayProperty(fieldSchema, 'options');\n const optionCount = unionOptions?.length || 0;\n // Check if it's a discriminated union\n const unionDiscriminator = getZodDefStringProperty(fieldSchema, 'discriminator');\n if (unionDiscriminator) {\n return `discriminatedUnion(${optionCount} options, discriminator: \"${unionDiscriminator}\")`;\n }\n return `union(${optionCount} options)`;\n case 'literal':\n // Zod 4 stores literal value(s) in def.values (an array); the legacy Zod-3\n // def.value is always undefined in v4, so reading it alone always rendered\n // literal(\"unknown\"). Read def.values first, fall back to def.value.\n const literalValues = (getZodDefArrayProperty(fieldSchema, 'values') ?? [getZodDefProperty(fieldSchema, 'value')])\n .filter((entry) => entry !== undefined && entry !== null);\n return `literal(\"${String(literalValues[0] ?? 'unknown')}\")`;\n case 'any':\n return 'any';\n case 'unknown':\n return 'unknown';\n case 'set':\n visitedSchemas.add(fieldSchema);\n const setElement = getZodDefSchemaProperty(fieldSchema, 'valueType');\n if (!setElement) {\n visitedSchemas.delete(fieldSchema);\n return 'Set<unknown>';\n }\n const setElementType = this.getFieldTypeRecursive(\n setElement,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n visitedSchemas.delete(fieldSchema);\n return `Set<${setElementType}>`;\n case 'tuple':\n visitedSchemas.add(fieldSchema);\n const tupleItems = getZodDefArrayProperty(fieldSchema, 'items') ?? [];\n const tupleTypes = tupleItems\n .filter((item): item is z.ZodTypeAny => isZodTypeAny(item))\n .map(item => this.getFieldTypeRecursive(\n item,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n ));\n visitedSchemas.delete(fieldSchema);\n return `[${tupleTypes.join(', ')}]`;\n case 'record':\n visitedSchemas.add(fieldSchema);\n const recordValue = getZodDefSchemaProperty(fieldSchema, 'valueType');\n if (!recordValue) {\n visitedSchemas.delete(fieldSchema);\n return 'Record<string, unknown>';\n }\n const recordValueType = this.getFieldTypeRecursive(\n recordValue,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n );\n visitedSchemas.delete(fieldSchema);\n return `Record<string, ${recordValueType}>`;\n case 'map':\n visitedSchemas.add(fieldSchema);\n const mapKey = getZodDefSchemaProperty(fieldSchema, 'keyType');\n const mapValue = getZodDefSchemaProperty(fieldSchema, 'valueType');\n const mapKeyType = mapKey ? this.getFieldTypeRecursive(\n mapKey,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n ) : 'unknown';\n const mapValueType = mapValue ? this.getFieldTypeRecursive(\n mapValue,\n indent,\n maxDepth,\n currentDepth + 1,\n new Set(visitedSchemas)\n ) : 'unknown';\n visitedSchemas.delete(fieldSchema);\n return `Map<${mapKeyType}, ${mapValueType}>`;\n case 'intersection':\n const leftSchema = getZodDefSchemaProperty(fieldSchema, 'left');\n const rightSchema = getZodDefSchemaProperty(fieldSchema, 'right');\n const leftType = leftSchema ? this.getFieldTypeRecursive(\n leftSchema,\n indent,\n maxDepth,\n currentDepth + 1,\n visitedSchemas\n ) : 'unknown';\n const rightType = rightSchema ? this.getFieldTypeRecursive(\n rightSchema,\n indent,\n maxDepth,\n currentDepth + 1,\n visitedSchemas\n ) : 'unknown';\n return `${leftType} & ${rightType}`;\n case 'lazy':\n return 'lazy<...>';\n case 'void':\n case 'undefined':\n case 'never':\n return zodType;\n case 'pipe':\n const pipeInSchema = getZodDefSchemaProperty(fieldSchema, 'in');\n if (!pipeInSchema) return 'pipe[unknown]';\n const pipeInnerType = this.getFieldTypeRecursive(\n pipeInSchema,\n indent,\n maxDepth,\n currentDepth,\n visitedSchemas\n );\n return `pipe[${pipeInnerType}]`;\n case 'transform':\n return 'transform';\n case 'custom':\n return 'custom';\n default:\n return zodType || 'unknown';\n }\n }\n\n\n /**\n * Check if a field is optional\n */\n private static isFieldOptional(fieldSchema: any): boolean {\n // Check if it's wrapped in ZodOptional\n if (isZodOptional(fieldSchema)) return true;\n\n // Check if it's a ZodDefault (has default value)\n if (isZodDefault(fieldSchema)) return true;\n\n return false;\n }\n\n /**\n * Apply inheritance to mainSchema based on inheritance definition\n * Creates discriminated union schemas when inheritance is defined\n *\n * NOTE: This transfers inheritance logic from relationship cascading mechanism\n * to schema-level processing, ensuring inheritance affects DTOs properly.\n *\n * NOTE: TDatabaseSchema has been removed. Backend-only fields are now marked with\n * the `isBackendOnly` decorator and stripped at the service layer.\n */\n private static applyInheritanceToSchema<\n TMainSchema extends z.ZodTypeAny\n >(\n mainSchema: TMainSchema,\n inheritanceDefinition: any,\n processedInheritanceSchemas: Map<string, z.ZodTypeAny>\n ): TMainSchema {\n\n // If no inheritance definition, return original schema\n if (!inheritanceDefinition || !inheritanceDefinition.inheritedSchemas ||\n inheritanceDefinition.inheritedSchemas.length === 0) {\n return mainSchema;\n }\n\n const cacheKey = `${JSON.stringify(inheritanceDefinition)}_main`;\n\n // Check cache first\n if (processedInheritanceSchemas.has(cacheKey)) {\n return processedInheritanceSchemas.get(cacheKey)! as TMainSchema;\n }\n\n const { discriminatorField, inheritedSchemas, withoutInheritanceDiscriminatorFieldValues } = inheritanceDefinition;\n\n // Build discriminated union options for mainSchema\n const mainSchemaOptions: z.ZodTypeAny[] = [];\n\n // Add base schema for non-inherited values if specified\n if (withoutInheritanceDiscriminatorFieldValues && withoutInheritanceDiscriminatorFieldValues.length > 0) {\n // Create enum for base discriminator values.\n // Mark it with the isDiscriminator decorator so EVERY union option's\n // discriminator field is uniformly recognized as a discriminator (and not\n // mistaken for an auto-populated literal by the request-DTO omission logic).\n const baseDiscriminatorEnum = addDiscriminator(\n z.enum(withoutInheritanceDiscriminatorFieldValues as [string, ...string[]]),\n { baseValues: withoutInheritanceDiscriminatorFieldValues as string[] }\n );\n\n // Extend mainSchema with discriminator field\n const baseMainSchema = this.extendSchemaWithDiscriminator(mainSchema, discriminatorField, baseDiscriminatorEnum);\n\n mainSchemaOptions.push(baseMainSchema);\n }\n\n // Process each inherited schema\n inheritedSchemas.forEach((inheritedItem: any) => {\n const { discriminatorFieldValue, schema: inheritedSchema } = inheritedItem;\n\n // Create literal discriminator for this variant.\n // It MUST carry the isDiscriminator decorator: `mergeInheritedSchema`\n // overwrites the variant's discriminator field with this value, dropping\n // the decorator `createSchemaFamily` originally applied. Without it, the\n // request-DTO builder's `isNonDiscriminatorLiteral` check would strip the\n // discriminator from CREATE/UPDATE DTOs, producing a structurally-invalid\n // discriminated union (Zod: \"Invalid discriminated union option\").\n const discriminatorLiteral = addDiscriminator(\n z.literal(discriminatorFieldValue),\n { baseValues: withoutInheritanceDiscriminatorFieldValues as string[] | undefined }\n );\n\n // Merge inherited schema with base schema and add discriminator\n const mergedMainSchema = this.mergeInheritedSchema(mainSchema, inheritedSchema, discriminatorField, discriminatorLiteral);\n\n mainSchemaOptions.push(mergedMainSchema);\n\n // Handle nested inheritance recursively\n if (inheritedItem.inheritenceSchemaDefinition) {\n const nestedMain = this.applyInheritanceToSchema(\n mergedMainSchema,\n inheritedItem.inheritenceSchemaDefinition,\n processedInheritanceSchemas\n );\n\n // Replace the simple merged schema with the nested enhanced one\n mainSchemaOptions[mainSchemaOptions.length - 1] = nestedMain;\n }\n });\n\n // Create discriminated union if we have multiple options\n let enhancedMainSchema: z.ZodTypeAny;\n\n if (mainSchemaOptions.length > 1) {\n // Check if all schemas are ZodObject types to use discriminated union\n const allMainAreObjects = mainSchemaOptions.every(schema =>\n isZodObject(schema)\n );\n\n if (allMainAreObjects) {\n // Use discriminated union for object schemas\n enhancedMainSchema = z.discriminatedUnion(\n discriminatorField,\n mainSchemaOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n );\n } else {\n // Fallback to regular union for mixed types\n enhancedMainSchema = z.union(mainSchemaOptions as [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]);\n }\n } else if (mainSchemaOptions.length === 1) {\n enhancedMainSchema = mainSchemaOptions[0];\n } else {\n // Fallback to original schema\n enhancedMainSchema = mainSchema;\n }\n\n // Cache the result\n processedInheritanceSchemas.set(cacheKey, enhancedMainSchema);\n\n return enhancedMainSchema as TMainSchema;\n }\n\n /**\n * Extend a schema with a discriminator field\n */\n private static extendSchemaWithDiscriminator(\n baseSchema: z.ZodTypeAny,\n discriminatorField: string,\n discriminatorSchema: z.ZodTypeAny\n ): z.ZodTypeAny {\n\n // If base schema is not an object, wrap it in an object with the discriminator\n if (!isZodObject(baseSchema)) {\n return z.object({\n [discriminatorField]: discriminatorSchema,\n value: baseSchema\n });\n }\n\n // Extend existing object schema with discriminator field\n // Type guard already ensures it's a ZodObject\n return baseSchema.extend({\n [discriminatorField]: discriminatorSchema\n });\n }\n\n /**\n * Merge inherited schema with base schema and add discriminator\n */\n private static mergeInheritedSchema(\n baseSchema: z.ZodTypeAny,\n inheritedSchema: z.ZodTypeAny,\n discriminatorField: string,\n discriminatorValue: z.ZodTypeAny\n ): z.ZodTypeAny {\n\n // If both are object schemas, merge them\n if (isZodObject(baseSchema) && isZodObject(inheritedSchema)) {\n\n // Merge the two object schemas and add discriminator (using extend instead of merge in Zod v4)\n const mergedSchema = baseSchema.extend(inheritedSchema.shape);\n return mergedSchema.extend({\n [discriminatorField]: discriminatorValue\n });\n }\n\n // If only inherited schema is an object, extend it with discriminator\n if (isZodObject(inheritedSchema)) {\n // Type guard already ensures it's a ZodObject\n return inheritedSchema.extend({\n [discriminatorField]: discriminatorValue\n });\n }\n\n // Fallback: create object with discriminator and value\n return z.object({\n [discriminatorField]: discriminatorValue,\n value: inheritedSchema\n });\n }\n\n // =============================================================================\n // NESTED OPERATIONS DTO BUILDING\n // =============================================================================\n\n private static getAllResourceFieldIdentifiers(\n resourceRegistry: Map<ResourceType, any>\n ): Partial<Record<ResourceType, string>> {\n const allResourceFieldIdentifiers: Partial<Record<ResourceType, string>> = {};\n\n for (const [resourceType, resourceConfig] of resourceRegistry.entries()) {\n if (typeof resourceConfig?.resourceFieldIdentifier === 'string' && resourceConfig.resourceFieldIdentifier.length > 0) {\n allResourceFieldIdentifiers[resourceType] = resourceConfig.resourceFieldIdentifier;\n }\n }\n\n return allResourceFieldIdentifiers;\n }\n\n /**\n * Derive nested field name from the relationship identifier.\n */\n private static getNestedFieldName(\n rel: ResourceRelationship,\n resourceRegistry: Map<ResourceType, any>\n ): string {\n return Resources_SharedUtils.resolveRelationshipObjectIdentity(\n rel,\n rel.resourceType2,\n rel.cardinality2,\n this.getAllResourceFieldIdentifiers(resourceRegistry)\n ).objectFieldName;\n }\n\n private static getRelationshipObjectFieldName(\n rel: Pick<ResourceRelationship, 'foreignKeyField' | 'resourceType1' | 'resourceType2'>,\n relatedResourceType: ResourceType,\n cardinality: ResourceRelationshipCardinality,\n resourceRegistry: Map<ResourceType, any>\n ): string {\n return Resources_SharedUtils.resolveRelationshipObjectIdentity(\n rel,\n relatedResourceType,\n cardinality,\n this.getAllResourceFieldIdentifiers(resourceRegistry)\n ).objectFieldName;\n }\n\n /**\n * Get delete field name: _{nestedField}ToDelete\n */\n private static getDeleteFieldName(nestedFieldName: string): string {\n return `_${nestedFieldName}ToDelete`;\n }\n\n /**\n * Build child schema for nested operations based on operation type and config.\n * For CREATE: uses child's CREATE request DTO\n * For UPDATE: uses union of CREATE (no _id) and UPDATE (with _id) DTOs\n */\n private static buildNestedChildSchema(\n rel: ResourceRelationship,\n nestedConfig: ChildNestedMutationConfig | ChildNestedMutationConfig_Parsed,\n operation: CoreResourceOperation,\n childMainSchema: z.ZodTypeAny,\n resourceRegistry: Map<ResourceType, any>\n ): z.ZodTypeAny {\n const childResourceType = rel.resourceType2;\n\n // Get child's operation config to find request DTOs\n const childConfig = resourceRegistry.get(childResourceType);\n if (!childConfig || !childConfig.operations) {\n // Fallback: use child's main schema with appropriate omissions\n if (operation === CoreResourceOperation.CREATE || operation === CoreResourceOperation.CREATE_MANY) {\n return this.createRequestDtoForCreate(childMainSchema);\n } else {\n return this.createRequestDtoForUpdate(childMainSchema);\n }\n }\n\n // Find child's CREATE operation for request DTO\n const childCreateOp = childConfig.operations.find(\n (op: any) => op.operationIdentifier === CoreResourceOperation.CREATE ||\n op.resourceOperationLike === CoreResourceOperation.CREATE\n );\n const childCreateDto = childCreateOp?.requestDto || this.createRequestDtoForCreate(childMainSchema);\n\n if (operation === CoreResourceOperation.CREATE || operation === CoreResourceOperation.CREATE_MANY) {\n // For CREATE: use child's CREATE DTO\n return childCreateDto;\n }\n\n // For UPDATE: use union of CREATE (no _id) and UPDATE (with _id) DTOs\n const childUpdateOp = childConfig.operations.find(\n (op: any) => op.operationIdentifier === CoreResourceOperation.UPDATE ||\n op.resourceOperationLike === CoreResourceOperation.UPDATE\n );\n const childUpdateDto = childUpdateOp?.requestDto || this.createRequestDtoForUpdate(childMainSchema);\n\n // Create union: items without _id are creates, items with _id are updates\n // In Zod 4, we use z.union for discriminated unions or z.union for simple unions\n if (isZodObject(childCreateDto) && isZodObject(childUpdateDto)) {\n // Explicitly forbid _id on the create branch so _id-bearing payloads are\n // routed through the update branch instead of being accepted as creates and\n // only failing later in downstream child UPDATE validation.\n const createWithoutId = childCreateDto.extend({\n _id: z.never().optional()\n });\n\n // UPDATE DTO should have _id as required\n // `.extend()` returns a fresh object without the child UPDATE DTO's metadata; its PATCH write\n // rule has to survive, or a form reads the update branch as written whole (#989).\n const updateWithRequiredId = this.preserveSchemaMetadata(childUpdateDto, childUpdateDto.extend({\n _id: z.string()\n }));\n\n return z.union([updateWithRequiredId, createWithoutId]);\n }\n\n // Fallback: use UPDATE DTO\n return childUpdateDto;\n }\n\n /**\n * Get child schema for a specific DataMode (for nested READ responses).\n * - RAW: All stored fields, no population\n * - SUMMARY: Summary fields only (fields with isSummaryField decorator)\n * - CONTEXT: Full context (all fields with contextPolicy applied)\n *\n * Note: CONTEXT mode requires service-layer processing (contextPolicy application),\n * so we return the full schema here. The service layer will apply contextPolicy.\n */\n private static getChildSchemaForDataMode(\n childMainSchema: z.ZodTypeAny,\n dataMode: DataMode\n ): z.ZodTypeAny {\n switch (dataMode) {\n case DataMode.SUMMARY:\n // Use ResourcesSummaryUtils to derive summary schema (only fields with isSummaryField decorator)\n if (isZodObject(childMainSchema)) {\n return ResourcesSummaryUtils.deriveSummarySchema(childMainSchema, {\n includeId: true, // Always include _id in summaries\n includeForeignKeys: false, // Only include FKs if they have isSummaryField decorator\n });\n }\n // Fallback for non-object schemas\n return childMainSchema;\n\n case DataMode.CONTEXT:\n // CONTEXT mode requires service-layer processing (contextPolicy, population, etc.)\n // Return full schema - service layer will apply contextPolicy\n return childMainSchema;\n\n case DataMode.RAW:\n default:\n // RAW mode: return full schema (all stored fields)\n return childMainSchema;\n }\n }\n\n /**\n * Extend a DTO root that may be either a plain object or a discriminated\n * union of objects.\n *\n * Relationship-driven nested fields must exist on every variant of a\n * polymorphic DTO root; otherwise the shared contract silently diverges from\n * the live frontend form/runtime path.\n */\n private static extendObjectLikeDto(\n baseDto: z.ZodTypeAny,\n extensionShape: Record<string, z.ZodTypeAny>,\n ): z.ZodTypeAny {\n if (Object.keys(extensionShape).length === 0) {\n return baseDto;\n }\n\n if (isZodObject(baseDto)) {\n // Carry the base DTO's metadata (its PATCH write rule among it) across the extension (#989).\n return this.preserveSchemaMetadata(baseDto, baseDto.extend(extensionShape));\n }\n\n const zodType = getZodType(baseDto);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(baseDto, 'discriminator');\n const unionOptions = getZodDefArrayProperty(baseDto, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && unionOptions && unionOptions.length > 0) {\n const extendedOptions = unionOptions.map((option) =>\n isZodObject(option)\n ? this.preserveSchemaMetadata(option, option.extend(extensionShape))\n : option,\n );\n\n if (extendedOptions.every((option) => isZodObject(option))) {\n if (extendedOptions.length >= 2) {\n return this.preserveRegistryMetadata(\n baseDto,\n z.discriminatedUnion(\n discriminator,\n extendedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]],\n ),\n );\n }\n\n if (extendedOptions.length === 1) {\n return extendedOptions[0];\n }\n }\n }\n }\n\n return baseDto;\n }\n \n\n /**\n * Build request DTO with nested children based on config.\n * Extends the base request DTO with nested child fields for CREATE/UPDATE operations.\n *\n * ## Deliberate Condition-Agnosticism\n *\n * This method iterates ALL child relationships whose compiled runtime\n * semantics expose a current effective nested projection,\n * regardless of whether they carry a `discriminator` or `condition`.\n * It generates DTO fields for every such relationship unconditionally.\n *\n * This is intentional: DTO generation is a STARTUP concern — it defines the shape\n * of all possible request/response schemas. Conditional filtering is a RUNTIME\n * concern handled by:\n * - `ServicesRegistryHandler.filterRelationshipsByParent()` — which filters\n * active relationships before processing nested data in CREATE/UPDATE\n * - `ResourceContextBackendService.fetchChildResourcesWithPolicy()` — which\n * filters active relationships before fetching children in context\n *\n * If the DTO builder filtered by discriminator at startup, the nested fields\n * would be missing from the schema entirely, and runtime data for those fields\n * would be silently dropped during Zod validation.\n */\n static buildRequestDtoWithNested(\n operation: CoreResourceOperation,\n baseDto: z.ZodTypeAny,\n childRelationships: ResourceRelationship[],\n resourceRegistry: Map<ResourceType, any>\n ): z.ZodTypeAny {\n if (operation === CoreResourceOperation.CREATE_MANY) {\n const baseShape = isZodObject(baseDto) ? getZodObjectShape(baseDto) : undefined;\n const dataSchema = baseShape?.data;\n\n if (dataSchema instanceof z.ZodArray) {\n const nestedItemDto = this.buildRequestDtoWithNested(\n CoreResourceOperation.CREATE,\n dataSchema.element as z.ZodTypeAny,\n childRelationships,\n resourceRegistry\n );\n\n return this.extendObjectLikeDto(baseDto, {\n data: z.array(nestedItemDto),\n });\n }\n }\n\n const nestedFields: Record<string, z.ZodTypeAny> = {};\n const allResourceFieldIdentifiers = this.getAllResourceFieldIdentifiers(resourceRegistry);\n\n for (const rel of childRelationships) {\n const compiledRel = Resources_SharedUtils.ensureCompiledRelationship(\n rel,\n allResourceFieldIdentifiers\n );\n const nestedConfig = Resources_SharedUtils.resolveRelationshipNestedMutationConfig(\n compiledRel,\n operation\n );\n\n if (!nestedConfig) continue;\n\n const fieldName = this.getNestedFieldName(compiledRel, resourceRegistry);\n const childConfig = resourceRegistry.get(compiledRel.resourceType2);\n if (!childConfig) continue;\n\n // A nested write carries records of the CHILD resource, so it is described by the child (#1625).\n const childSchema = markEmbeddedResourceSchema(this.buildNestedChildSchema(\n compiledRel,\n nestedConfig as ChildNestedMutationConfig_Parsed,\n operation,\n childConfig.mainSchema,\n resourceRegistry\n ), String(compiledRel.resourceType2));\n\n // Add nested field (array for 1:N/N:N, object for 1:1)\n nestedFields[fieldName] = isArrayCardinality(compiledRel.cardinality2)\n ? z.array(childSchema).optional()\n : childSchema.optional();\n\n // Add delete field if allowDelete (for UPDATE only)\n if (nestedConfig.allowDelete &&\n (operation === CoreResourceOperation.UPDATE || operation === CoreResourceOperation.UPDATE_MANY)) {\n nestedFields[this.getDeleteFieldName(fieldName)] = z.array(z.string()).optional();\n }\n }\n\n return this.extendObjectLikeDto(baseDto, nestedFields);\n }\n\n /**\n * Build response DTO with nested children based on onRead config.\n * Extends the base response DTO with nested child fields for READ operations.\n *\n * Like `buildRequestDtoWithNested`, this is deliberately condition-agnostic —\n * it generates response DTO fields for ALL relationships whose compiled\n * runtime semantics expose an effective nested-read projection, regardless of\n * discriminator/condition. The fields are optional (`z.optional()`), so when\n * the runtime skips a conditional relationship, the field is simply absent\n * from the response rather than causing a schema validation error.\n */\n static buildResponseDtoWithNested(\n baseDto: z.ZodTypeAny,\n childRelationships: ResourceRelationship[],\n resourceRegistry: Map<ResourceType, any>\n ): z.ZodTypeAny {\n const nestedFields: Record<string, z.ZodTypeAny> = {};\n const allResourceFieldIdentifiers = this.getAllResourceFieldIdentifiers(resourceRegistry);\n\n for (const rel of childRelationships) {\n const compiledRel = Resources_SharedUtils.ensureCompiledRelationship(\n rel,\n allResourceFieldIdentifiers\n );\n const readConfig = Resources_SharedUtils.resolveRelationshipNestedReadConfig(compiledRel);\n if (!readConfig) continue;\n\n const fieldName = this.getNestedFieldName(compiledRel, resourceRegistry);\n const childConfig = resourceRegistry.get(compiledRel.resourceType2);\n if (!childConfig) continue;\n\n const childSchema = markEmbeddedResourceSchema(this.getChildSchemaForDataMode(\n childConfig.mainSchema,\n readConfig.dataMode\n ), String(compiledRel.resourceType2));\n\n // Add nested field (array for 1:N/N:N, object for 1:1)\n nestedFields[fieldName] = isArrayCardinality(compiledRel.cardinality2)\n ? z.array(childSchema).optional()\n : childSchema.optional();\n }\n\n return this.extendObjectLikeDto(baseDto, nestedFields);\n }\n\n /**\n * Schema-guided value walk that locates every `.isWriteOnlySecret()` field in\n * a runtime object and hands the holding object + field name to `visitSecret`.\n *\n * Mirrors the unwrap/recursion structure of {@link stripBackendOnlyFields} but\n * operates on VALUES, not schemas. It mutates in place (callers pass a freshly\n * `.parse()`'d body or a to-be-validated input, both safe to mutate). For\n * discriminated unions it recurses EVERY variant against the single value —\n * safe because both leaf actions (mask/strip) are guarded (mask only a present\n * value; strip only the exact sentinel), so fields belonging to a non-matching\n * variant are simply absent and no-op.\n */\n private static walkWriteOnlySecretValues(\n schema: z.ZodTypeAny,\n value: unknown,\n visitSecret: (holder: Record<string, unknown>, fieldName: string) => void,\n ): void {\n if (value === null || value === undefined) {\n return;\n }\n\n // Unwrap optional / nullable / default wrappers — same value, inner schema.\n if (isZodOptional(schema) || hasZodType(schema, 'nullable') || isZodDefault(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny | undefined;\n if (innerSchema) {\n this.walkWriteOnlySecretValues(innerSchema, value, visitSecret);\n }\n return;\n }\n\n // Unions (incl. discriminated) — recurse every object variant.\n if (getZodType(schema) === 'union') {\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n if (unionOptions) {\n for (const option of unionOptions) {\n this.walkWriteOnlySecretValues(option, value, visitSecret);\n }\n }\n return;\n }\n\n // Arrays — recurse each element against the element schema.\n if (isZodArray(schema) && Array.isArray(value)) {\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny | undefined;\n if (elementSchema) {\n for (const item of value) {\n this.walkWriteOnlySecretValues(elementSchema, item, visitSecret);\n }\n }\n return;\n }\n\n // Objects — visit write-only-secret fields, recurse the rest.\n if (isZodObject(schema) && typeof value === 'object' && !Array.isArray(value)) {\n const shape = getZodObjectShape(schema);\n const holder = value as Record<string, unknown>;\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isWriteOnlySecretField(fieldSchema as z.ZodTypeAny)) {\n visitSecret(holder, fieldName);\n } else {\n this.walkWriteOnlySecretValues(fieldSchema as z.ZodTypeAny, holder[fieldName], visitSecret);\n }\n }\n }\n }\n\n /**\n * Redact every `.isWriteOnlySecret()` field in a client-facing response body to\n * {@link WRITE_ONLY_SECRET_MASK}. Applied at the client-serialization boundary\n * ONLY (`serializeOperationResultForResponse`), never at the service dispatch /\n * `transformOutput` tier — internal reads (`readAsSystem`, repository\n * `read<T>()`) must keep the real value so backend consumers (e.g. a webhook\n * signer) can use it. Returns the same (mutated) value for call-site ergonomics.\n */\n static maskWriteOnlySecretFields<T>(schema: z.ZodTypeAny, value: T): T {\n this.walkWriteOnlySecretValues(schema, value, (holder, fieldName) => {\n const current = holder[fieldName];\n if (current !== null && current !== undefined && current !== '') {\n holder[fieldName] = WRITE_ONLY_SECRET_MASK;\n }\n });\n return value;\n }\n\n /**\n * Strip any `.isWriteOnlySecret()` field whose incoming value equals the\n * {@link WRITE_ONLY_SECRET_MASK} sentinel from a CREATE/UPDATE input payload.\n * A client that renders the masked read value and submits it unchanged sends\n * the sentinel back; removing the field means the stored secret is preserved\n * (UPDATE is a partial `$set`). A genuinely new secret value is left intact.\n * Returns the same (mutated) value.\n */\n static stripWriteOnlySecretSentinel<T>(schema: z.ZodTypeAny, value: T): T {\n this.walkWriteOnlySecretValues(schema, value, (holder, fieldName) => {\n if (holder[fieldName] === WRITE_ONLY_SECRET_MASK) {\n delete holder[fieldName];\n }\n });\n return value;\n }\n\n /**\n * Strip fields marked with isBackendOnly decorator from schema.\n *\n * @param schema - Schema to strip from\n * @param options - Options for stripping behavior\n * @returns New schema without backend-only fields\n */\n private static stripBackendOnlyFields(\n schema: z.ZodTypeAny,\n options?: {\n respectIsReturnedAtCreation?: boolean; // Include fields with isReturnedAtCreation in CREATE responses\n operationType?: CoreResourceOperation; // Operation type for isReturnedAtCreation logic\n }\n ): z.ZodTypeAny {\n /*\n * Memoized by input identity within the active resource scope, per effective mode (#1587;\n * see {@link DtoDerivationMemoScope}). The two options only ever act\n * TOGETHER — a field is kept for `isReturnedAtCreation` exactly when both are set for CREATE —\n * so they collapse to one boolean, and the walk is otherwise a pure function of the schema.\n * Without the memo every operation rebuilt its nested objects afresh, which also defeated the\n * network-boundary coercion memo downstream: that one is keyed by identity too, and a fresh\n * nested object is never a hit.\n */\n const keepsReturnedAtCreation = options?.respectIsReturnedAtCreation === true\n && options.operationType === CoreResourceOperation.CREATE;\n const scope = this.activeMemoScope;\n if (scope === null) return this.stripBackendOnlyFieldsUncached(schema, options);\n const memo = keepsReturnedAtCreation\n ? scope.backendOnlyStripKeepingReturnedAtCreation\n : scope.backendOnlyStrip;\n const cached = memo.get(schema);\n if (cached !== undefined) return cached;\n const stripped = this.stripBackendOnlyFieldsUncached(schema, options);\n memo.set(schema, stripped);\n return stripped;\n }\n\n /** The uncached walk behind {@link stripBackendOnlyFields}; recursion goes through the memo. */\n private static stripBackendOnlyFieldsUncached(\n schema: z.ZodTypeAny,\n options?: {\n respectIsReturnedAtCreation?: boolean;\n operationType?: CoreResourceOperation;\n }\n ): z.ZodTypeAny {\n // Handle discriminated unions - strip from all variants\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && unionOptions && unionOptions.length > 0) {\n const strippedOptions = unionOptions.map((option: z.ZodTypeAny) =>\n this.stripBackendOnlyFields(option, options)\n );\n\n // Recreate discriminated union with modified variants\n if (strippedOptions.length >= 2) {\n return this.preserveRegistryMetadata(\n schema,\n z.discriminatedUnion(\n discriminator,\n strippedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n ),\n );\n } else if (strippedOptions.length === 1) {\n return strippedOptions[0];\n }\n }\n\n // A PLAIN union is stripped option by option too. The context placeholder for a related\n // record is exactly this shape — `z.union([typedRelative, untypedRelative])`, with the typed\n // branch built from the related resource's full schema so the service-layer DTO can carry its\n // backend-only fields. Returning it unchanged left those fields in the CLIENT response DTO, so\n // the API reference published e.g. `application.ownerOrganizationSerializationToken` on every\n // context read that embeds the application (#1625).\n if (!discriminator && unionOptions && unionOptions.length >= 2) {\n const strippedOptions = unionOptions.map((option: z.ZodTypeAny) => this.stripBackendOnlyFields(option, options));\n if (strippedOptions.every((option, index) => option === unionOptions[index])) {\n return schema;\n }\n return this.preserveRegistryMetadata(schema, z.union(strippedOptions as [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]));\n }\n\n return schema;\n }\n\n // Handle arrays - strip from array element schema.\n // `withArrayElement` rather than `z.array(...)`: a fresh array carries none of the original's\n // own `.min()` / `.max()` / `.length()` checks, which would silently drop an authored\n // collection-size constraint from the response contract.\n if (isZodArray(schema)) {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny;\n return withArrayElement(schema, this.stripBackendOnlyFields(elementSchema, options));\n }\n\n // Handle optional/nullable/default wrappers - unwrap, strip, rewrap\n if (isZodOptional(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.preserveSchemaMetadata(\n schema,\n this.stripBackendOnlyFields(innerSchema, options).optional(),\n );\n }\n\n if (hasZodType(schema, 'nullable')) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.preserveSchemaMetadata(\n schema,\n this.stripBackendOnlyFields(innerSchema, options).nullable(),\n );\n }\n\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n // ⚠️ Re-READ the default per parse, never carry a value across.\n //\n // In Zod 4 `def.defaultValue` is a GETTER: reading it EVALUATES the default\n // (`z.date().default(() => new Date())` yields a fresh Date on every read).\n // A DTO is rebuilt ONCE, when the resource configuration is built at process\n // start — so `.default(<value read here>)` freezes that instant into every\n // parse the process ever performs. Recovered 2026-08-11: lifecycle rows were\n // persisting `stageEnteredAt` / `lastActiveAt` stamped at backend boot,\n // identical to the millisecond across rows created a minute apart.\n //\n // Passing a FUNCTION makes Zod evaluate per parse. A literal default is\n // unaffected — the getter simply returns the same value each time.\n return this.preserveSchemaMetadata(\n schema,\n this.stripBackendOnlyFields(innerSchema, options).default(() => getZodDefProperty(schema, 'defaultValue')),\n );\n }\n\n // Handle objects - strip backend-only fields from shape\n if (isZodObject(schema)) {\n const shape = getZodObjectShape(schema);\n const omitObj: Record<string, true> = {};\n const rebuiltShape: Record<string, z.ZodTypeAny> = {};\n let didRebuildNestedField = false;\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isBackendOnlyField(fieldSchema as z.ZodTypeAny)) {\n const backendOnlyParams = getBackendOnlyParams(fieldSchema as z.ZodTypeAny);\n\n // Respect isReturnedAtCreation for CREATE operations\n if (options?.respectIsReturnedAtCreation &&\n options?.operationType === CoreResourceOperation.CREATE &&\n backendOnlyParams?.isReturnedAtCreation) {\n // Keep this field - it's returned at creation\n rebuiltShape[fieldName] = fieldSchema as z.ZodTypeAny;\n continue;\n }\n\n // Strip this backend-only field\n omitObj[fieldName] = true;\n } else {\n // Recursively strip from nested objects/arrays\n const strippedFieldSchema = this.stripBackendOnlyFields(fieldSchema as z.ZodTypeAny, options);\n rebuiltShape[fieldName] = strippedFieldSchema;\n didRebuildNestedField = didRebuildNestedField || strippedFieldSchema !== fieldSchema;\n }\n }\n\n if (Object.keys(omitObj).length > 0 || didRebuildNestedField) {\n return this.rebuildObjectSchema(schema, rebuiltShape, {\n preserveChecks: Object.keys(omitObj).length === 0,\n });\n }\n\n return schema;\n }\n\n // For other schema types (primitives, etc.), return as-is\n return schema;\n }\n\n /**\n * Transform network-boundary leaves recursively for API/WebSocket/Queue DTOs:\n * `z.date()` → string-accepting `z.coerce.date()`, and `z.bigint()` (notably\n * `z_money`'s `amount`) → a string-accepting bigint (see\n * {@link applyNetworkBoundaryCoercion} for why money bigints arrive as strings).\n *\n * This utility is used to create schemas suitable for parsing API responses/requests\n * where dates come as ISO strings and money amounts come as numeric strings, both of\n * which need to be coerced back to their runtime types (Date / bigint).\n *\n * Use this when parsing data from:\n * - HTTP API responses (JSON with date strings and bigint-as-string money amounts)\n * - WebSocket messages\n * - Queue messages\n * - Any external data source where dates/bigints are serialized as strings\n *\n * @param schema - Schema to transform (typically a database/internal schema with z.date()/z.bigint())\n * @returns New schema with coerced dates + bigints suitable for API parsing\n *\n * @example\n * ```typescript\n * // Database schema uses z.date()\n * const dbSchema = z.object({ createdAt: z.date() });\n *\n * // Create API parsing schema\n * const apiSchema = ResourcesConfigOperationsDtosBuilderUtils.createApiParsingSchema(dbSchema);\n *\n * // Now can parse API response with date strings\n * const data = apiSchema.parse({ createdAt: \"2024-01-01T00:00:00Z\" }); // Works!\n * ```\n */\n static createApiParsingSchema<T extends z.ZodTypeAny>(schema: T): T {\n return this.withMemoScope(API_PARSING_MEMO_SCOPE, () => this.applyNetworkBoundaryCoercion(schema)) as T;\n }\n\n /**\n * Recursively transpose the two network-boundary leaf types that do NOT survive\n * a JSON round-trip as their runtime type — `z.date()` and `z.bigint()` — into\n * string-accepting forms, walking union / array / optional / nullable / default /\n * object wrappers so nested and optional leaves are covered identically.\n *\n * This is the INBOUND (coerce, string → runtime type) half of the network-boundary\n * contract. Its OUTBOUND (serialize, runtime type → wire string) counterpart is\n * `Date.prototype.toJSON` (built-in) for dates and `BigInt.prototype.toJSON`\n * (installed by `installBigIntJsonEncoding` in `@wildo-ai/zod-decorators`) for\n * money bigints. Because the SAME coerced `responseDto`/`requestDto` this produces\n * is parsed on BOTH sides, the backend serialize-parse, the frontend\n * receive-parse, and worker queue re-hydration all coerce identically. See the\n * full mechanism map in `install-bigint-json-encoding.ts`.\n *\n * **Why `z.bigint()` needs this (the `z_money` case).** `z_money().amount` is a\n * `z.bigint()`. The Zod→Mongoose convertor persists bigint as a Mongoose **String**\n * column (with a `v → BigInt(v)` getter), but reads go through `.lean()` /\n * `toObject` WITHOUT `{ getters: true }`, so the value that reaches the DTO layer\n * is the raw **string** (e.g. `\"1999\"`), and over the JSON wire a bigint is always\n * serialized as a string too. A strict `z.bigint().parse(\"1999\")` then throws\n * `expected bigint, received string` in the service-layer `transformOutput`. This\n * pass rewrites every `z.bigint()` leaf to first coerce a string to `BigInt`, so\n * the same strict schema now accepts the on-wire/from-DB string form. It mirrors\n * the `z.date()` → `z.coerce.date()` transposition exactly — both are \"the runtime\n * type does not round-trip through JSON, accept its string form on read\" fixes.\n *\n * The bigint leaf is wrapped with `z.preprocess` over the ORIGINAL schema (rather\n * than a fresh `z.coerce.bigint()`) specifically to **preserve any `.min()`/`.max()`\n * checks** — e.g. `z_money({ minAmount: 0n })` compiles to `z.bigint().min(0n)`,\n * whose non-negativity check must survive the coercion. `z.coerce.bigint()` would\n * silently drop those checks; preprocessing the untouched schema keeps them intact.\n *\n * z_money field coverage this pass restores (each parses after coercion):\n * `prices.unitPrice`, `prices.tiers[].unitPrice`, `prices.tiers[].flatPrice`\n * (array-nested), `invoiceRefs.total`, `promotions.discountFixedAmount` (optional),\n * `productDefinitions.unitPrice`.\n *\n * @param schema - Schema to transform (typically a database/internal schema with z.date()/z.bigint())\n * @returns New schema with coerced dates + string-accepting bigints\n *\n * **Memoized by input identity, and idempotent (#1587).** The walk is a pure function of the\n * schema instance it is given, and the registry calls it on the SAME sub-schemas over and over:\n * one registry build made 263,963 calls over 69,771 distinct inputs, 14,627 of them on a schema\n * this function had itself just produced (`responseDtoInternal` coerced, then coerced again).\n * Every call that reached an object containing a date rebuilt that object, so 146,352 calls\n * returned a NEW tree. Zod 4 classic installs ~40 closures on every instance, which is why one\n * resource registry retained ~735 MB, and why a platform process holding two of them outgrew a\n * 2 GB heap and died in INIT.\n *\n * Every metadata write in this builder targets a freshly created instance, so sharing a coerced\n * output among one resource's DTOs is safe. The memo is scoped to that resource, and why it must\n * not be wider is on {@link DtoDerivationMemoScope}.\n */\n private static applyNetworkBoundaryCoercion(schema: z.ZodTypeAny): z.ZodTypeAny {\n const memo = this.activeMemoScope?.networkBoundaryCoercion;\n if (memo === undefined) return this.coerceNetworkBoundaryLeaves(schema);\n const cached = memo.get(schema);\n if (cached !== undefined) return cached;\n const coerced = this.coerceNetworkBoundaryLeaves(schema);\n memo.set(schema, coerced);\n // A coerced schema is a fixed point: its dates are already `z.coerce.date()` (whose type still\n // reads `date`, which is what made re-coercion rebuild everything) and its bigints are pipes.\n memo.set(coerced, coerced);\n return coerced;\n }\n\n /** The uncached walk behind {@link applyNetworkBoundaryCoercion}; recursion goes through the memo. */\n private static coerceNetworkBoundaryLeaves(schema: z.ZodTypeAny): z.ZodTypeAny {\n // Handle discriminated unions - transform dates in all variants\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && unionOptions && unionOptions.length > 0) {\n const transformedOptions = unionOptions.map((option: z.ZodTypeAny) =>\n this.applyNetworkBoundaryCoercion(option)\n );\n\n if (transformedOptions.length >= 2) {\n return this.preserveRegistryMetadata(\n schema,\n z.discriminatedUnion(\n discriminator,\n transformedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n ),\n );\n } else if (transformedOptions.length === 1) {\n return transformedOptions[0];\n }\n }\n\n return schema;\n }\n\n // Handle arrays - transform dates in array element schema.\n // `withArrayElement` rather than `z.array(...)`: this walk runs over EVERY operation DTO,\n // including an author-supplied `requestDto`, so rebuilding bare here is what stripped\n // authored `.min()` / `.max()` constraints out of request validation.\n if (isZodArray(schema)) {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny;\n return withArrayElement(schema, this.applyNetworkBoundaryCoercion(elementSchema));\n }\n\n // Handle optional/nullable/default wrappers - unwrap, transform, rewrap\n if (isZodOptional(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.preserveSchemaMetadata(\n schema,\n this.applyNetworkBoundaryCoercion(innerSchema).optional(),\n );\n }\n\n if (hasZodType(schema, 'nullable')) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.preserveSchemaMetadata(\n schema,\n this.applyNetworkBoundaryCoercion(innerSchema).nullable(),\n );\n }\n\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n // Per-parse re-read — see the note on the `stripBackendOnlyFields` default\n // branch: a materialized default freezes at DTO-build time (process start).\n return this.preserveSchemaMetadata(\n schema,\n this.applyNetworkBoundaryCoercion(innerSchema).default(() => getZodDefProperty(schema, 'defaultValue')),\n );\n }\n\n // Handle pipe/refine chains (`.transform()` / `.refine()` — e.g. `z_phone()`,\n // which is `z.string().transform(...).refine(...).transform(...)`, or a bare\n // `z.coerce.date()`). Return the schema UNCHANGED.\n //\n // Rationale: a pipe/refine chain is an opaque validation+normalization pipeline\n // over a primitive. Framework `z.date()` leaves NEVER live inside such a chain —\n // dates are only ever wrapped in optional/nullable/default/array/object/union —\n // so there is nothing for date-coercion to rewrite here.\n //\n // Rejected alternative (the prior implementation): unwrap the inner schema,\n // coerce it, and return that inner. This is doubly wrong — (1) in Zod 4 the pipe\n // input lives at `def.in`, not the Zod-3-era `def.schema`, so the unwrap read\n // `undefined` and any surrounding `.optional()/.nullable()/.default()` then\n // crashed with \"Cannot read properties of undefined (reading 'optional')\" the\n // moment a pipe field (e.g. `z_phone().optional()`) reached this branch; and\n // (2) even reading `def.in` correctly, returning the bare inner would silently\n // DROP the pipe's transform/refine steps (e.g. `z_phone`'s E.164 normalization\n // and validation) from every request/response/summary DTO. Preserving the whole\n // pipe atomically is the only semantically-faithful behavior.\n if (hasZodType(schema, 'pipe') || hasZodType(schema, 'refine')) {\n return schema;\n }\n\n // Handle date - transform to coerce.date\n if (hasZodType(schema, 'date')) {\n // Always transform to coerce.date for DTOs (API/WebSocket/Queue communication)\n // This allows string dates from JSON to be coerced to Date objects\n return this.preserveSchemaMetadata(schema, z.coerce.date());\n }\n\n // Handle bigint - accept the on-wire/from-DB string form and coerce to bigint.\n //\n // z_money's `amount` is a z.bigint(); bigint never round-trips through JSON as a\n // bigint (it serializes as a string) and the Mongoose String-backed storage + a\n // getterless .lean()/toObject read also yield the raw string. Wrapping the\n // ORIGINAL schema in z.preprocess (instead of z.coerce.bigint()) preserves any\n // .min()/.max() checks compiled from z_money({ minAmount/maxAmount }). Non-string\n // inputs pass through untouched so an in-process bigint stays a bigint and any\n // genuinely-wrong type is still reported by the underlying strict bigint schema.\n if (hasZodType(schema, 'bigint')) {\n return this.preserveSchemaMetadata(schema, z.preprocess(\n (value) => (typeof value === 'string' ? BigInt(value) : value),\n schema\n ));\n }\n\n // Handle objects - transform dates in shape\n if (isZodObject(schema)) {\n const shape = getZodObjectShape(schema);\n const transformedShape: Record<string, z.ZodTypeAny> = {};\n let didTransformAnyField = false;\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const transformedFieldSchema = this.applyNetworkBoundaryCoercion(fieldSchema as z.ZodTypeAny);\n transformedShape[fieldName] = transformedFieldSchema;\n didTransformAnyField = didTransformAnyField || transformedFieldSchema !== fieldSchema;\n }\n\n if (!didTransformAnyField) {\n return schema;\n }\n\n return this.rebuildObjectSchema(schema, transformedShape);\n }\n\n // For other schema types (primitives, etc.), return as-is\n return schema;\n }\n\n /**\n * Extract summary fields (isSummaryField decorator) from schema.\n * Handles discriminated unions by extracting from each variant.\n *\n * @param schema - Schema to extract from\n * @returns New schema with only summary fields\n */\n private static extractSummaryFields(schema: z.ZodTypeAny): z.ZodTypeAny {\n // Handle discriminated unions - extract summary from each variant\n const zodType = getZodType(schema);\n if (zodType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n\n if (discriminator && unionOptions && unionOptions.length > 0) {\n // Use ResourcesSummaryUtils.deriveSummarySchemaForDiscriminatedUnion if all options are objects\n const allAreObjects = unionOptions.every(opt => isZodObject(opt));\n if (allAreObjects) {\n try {\n return ResourcesSummaryUtils.deriveSummarySchemaForDiscriminatedUnion(\n schema as unknown as z.ZodObject<z.ZodRawShape>,\n {\n discriminatorField: discriminator,\n withoutInheritanceDiscriminatorFieldValues: []\n } as any\n );\n } catch {\n // Fallback: extract from each variant individually (see lines below)\n }\n }\n\n // Extract summary from each variant and rebuild union\n const summaryOptions = unionOptions.map((option: z.ZodTypeAny) =>\n this.extractSummaryFields(option)\n ).filter(opt => opt !== null && opt !== undefined);\n\n if (summaryOptions.length >= 2) {\n return this.preserveRegistryMetadata(\n schema,\n z.discriminatedUnion(\n discriminator,\n summaryOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]\n ),\n );\n } else if (summaryOptions.length === 1) {\n return summaryOptions[0];\n }\n }\n\n return schema;\n }\n\n // Handle arrays - extract summary from array element schema.\n // `withArrayElement` rather than `z.array(...)`, for the same reason as the two walkers above:\n // a fresh array carries none of the original's own `.min()` / `.max()` / `.length()` checks.\n if (isZodArray(schema)) {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny;\n return withArrayElement(schema, this.extractSummaryFields(elementSchema));\n }\n\n // Handle optional/nullable/default wrappers - unwrap, extract, rewrap\n if (isZodOptional(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.extractSummaryFields(innerSchema).optional();\n }\n\n if (hasZodType(schema, 'nullable')) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n return this.extractSummaryFields(innerSchema).nullable();\n }\n\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefProperty(schema, 'innerType') as z.ZodTypeAny;\n // Per-parse re-read — see the note on the `stripBackendOnlyFields` default\n // branch: a materialized default freezes at DTO-build time (process start).\n return this.extractSummaryFields(innerSchema).default(() => getZodDefProperty(schema, 'defaultValue'));\n }\n\n // Handle objects - use ResourcesSummaryUtils.deriveSummarySchema\n if (isZodObject(schema)) {\n try {\n // Pure summary-field extraction — NO network-boundary coercion here.\n // Network-boundary transposition (z.date() → z.coerce.date() AND\n // string-accepting z.bigint() for z_money amounts) is applied UNIFORMLY by\n // the caller (`buildAllOperationDtos`) over the fully-resolved summary\n // schema, mirroring how requestDto/responseDto/internalDto are coerced.\n // Coercing per-branch here is what let the discriminated-union branch (and\n // the no-summary-fields fallback) silently ship strict z.date()/z.bigint()\n // summary DTOs that reject ISO-string dates / bigint-as-string amounts.\n return ResourcesSummaryUtils.deriveSummarySchema(schema, {\n includeId: true,\n includeForeignKeys: false\n });\n } catch (error) {\n throw new Error(`Failed to derive summary schema for object: ${describeCaughtError(error)}`);\n }\n }\n\n // For other schema types (primitives, etc.), return as-is\n return schema;\n }\n\n /**\n * The schema ONE populated context relative (a parent, or a child row) is described by.\n *\n * ## Why a typed schema, and why this shape (#1189)\n *\n * A populated relative used to be `z.record(z.string(), z.any())`, which types every embedded\n * value as `any`. `applyNetworkBoundaryCoercion` has nothing to walk inside that, so every\n * `z.date()` and `z.bigint()` leaf INSIDE an embed stayed in its wire form — an ISO string, or a\n * decimal string for a money amount — while the value's declared type said `Date` / `bigint`.\n *\n * Measured 2026-09-15: on sign-in, `privacy.consentDecidedAt` reached the frontend as a string\n * inside `userSelfPreferences` (a 1:1 child of the USER_SELF context read). The preferences event\n * validated it against the in-memory `z.date()` and the whole event was dropped, so language,\n * regional, theme and consent preferences all failed to reach their providers.\n *\n * ## The schema can only ADD coercion — never a refusal, never a strip\n *\n * Three properties, each load-bearing:\n *\n * - **Every field is OPTIONAL** (`.partial()`). What an embed actually carries depends on the\n * producer's projection and on `objectMode`, so a REQUIRED field would turn a response that\n * parses today into a hard validation failure — strictly worse than an uncoerced string.\n * - **Unknown keys PASS THROUGH** (`.loose()`). Declaring a shape must not strip what the shape\n * does not mention. `z.object({ _id })` was tried for parents and dropped every SUMMARY/FULL\n * field they carried (#579); this keeps that class unrepresentable.\n * - **The shape follows the relationship's resolved `objectMode`**, so a SUMMARY embed is typed by\n * the related resource's summary fields and a FULL embed by its whole schema. The\n * per-operation override is honoured, because these DTOs are built per operation.\n *\n * Falls back to the untyped record — i.e. exactly the previous behaviour — whenever the related\n * schema cannot be read: an ID_ONLY relative (a bare reference has no leaf to coerce), a registry\n * that does not hold the related resource, or a related schema that is not a plain object. The\n * factory pass builds DTOs against an EMPTY registry, so it takes that fallback for everything and\n * the typed form appears at `rebuildResourceConfigurationsOperationDtos`, which every serving and\n * documenting consumer runs.\n *\n * A POLYMORPHIC relative is typed by its base object, so the variants' own fields pass through\n * loose and uncoerced. That is a partial improvement rather than a regression, and it is the same\n * fallback reasoning: a discriminated union has no `.partial()`.\n *\n * @param relatedResourceType - The resource on the other side of the relationship\n * @param contextPolicy - That relationship's context policy (its `objectMode` decides the shape)\n * @param effectiveOperation - The operation these DTOs are being built for, for `operationOverrides`\n * @param registry - Resource registry; empty during the factory pass\n * @returns A single-object schema for one relative (callers wrap it in `.optional()` / `z.array`)\n */\n private static buildContextRelativeObjectSchema(\n relatedResourceType: ResourceType,\n contextPolicy: RelationshipContextPolicy | undefined,\n effectiveOperation: CoreResourceOperation | EnumLikeType,\n registry: Map<ResourceType, any>,\n stripBackendOnly: boolean = false,\n ): z.ZodTypeAny {\n // Zod 4 requires key and value schemas for z.record\n const untypedRelative = z.record(z.string(), z.any());\n // Every placeholder is marked as an embedded `relatedResourceType` record (#1625). Marked HERE,\n // inside the memo, because `.meta()` clones: marked at the call site, each context DTO received\n // its own outer instance and the sharing the memo exists for (#1587) never reached the DTO. The\n // mark reads only `relatedResourceType`, which the memo key (its main schema) already fixes.\n const mark = (relative: z.ZodTypeAny): z.ZodTypeAny => markEmbeddedResourceSchema(relative, String(relatedResourceType));\n\n const objectMode = contextPolicy?.operationOverrides?.[effectiveOperation as CoreResourceOperation]?.objectMode\n ?? contextPolicy?.objectMode\n ?? DEFAULT_RELATIONSHIP_CONTEXT_POLICY.objectMode;\n\n // ID_ONLY carries a bare reference: no fetch, so no leaf to coerce.\n if (objectMode === ContextPolicy_ObjectMode.ID_ONLY) {\n return mark(untypedRelative);\n }\n\n const relatedMainSchema = registry.get(relatedResourceType)?.mainSchema as z.ZodTypeAny | undefined;\n if (!relatedMainSchema || !isZodObject(relatedMainSchema)) {\n return mark(untypedRelative);\n }\n\n /*\n * Memoized by (related main schema, resolved objectMode, stripBackendOnly) — the only three inputs\n * the shape below reads (#1587, #1625); the flag selects the memo map rather than keying it. It is built per operation × relationship, so the same summary derivation,\n * coercion and union were rebuilt for every operation of every resource that embeds a relative:\n * 107 MB of one resource registry's heap. Callers only ever WRAP the result (`.optional()`,\n * `z.array`), never write to it, so within the active resource scope one instance serves every\n * placeholder that asks for it.\n */\n const memoScope = this.activeMemoScope;\n const memo = stripBackendOnly ? memoScope?.clientContextRelative : memoScope?.contextRelative;\n if (memo === undefined) return mark(this.composeContextRelativeObjectSchema(relatedMainSchema, objectMode, untypedRelative, stripBackendOnly));\n let byObjectMode = memo.get(relatedMainSchema);\n const cachedRelative = byObjectMode?.get(objectMode);\n if (cachedRelative !== undefined) return cachedRelative;\n if (byObjectMode === undefined) {\n byObjectMode = new Map();\n memo.set(relatedMainSchema, byObjectMode);\n }\n const composedRelative = mark(this.composeContextRelativeObjectSchema(relatedMainSchema, objectMode, untypedRelative, stripBackendOnly));\n byObjectMode.set(objectMode, composedRelative);\n return composedRelative;\n }\n\n /** The uncached shape behind {@link buildContextRelativeObjectSchema}. */\n private static composeContextRelativeObjectSchema(\n relatedMainSchema: z.ZodTypeAny,\n objectMode: ContextPolicy_ObjectMode,\n untypedRelative: z.ZodTypeAny,\n stripBackendOnly: boolean,\n ): z.ZodTypeAny {\n let relativeSchema: z.ZodTypeAny = relatedMainSchema;\n if (objectMode === ContextPolicy_ObjectMode.SUMMARY) {\n // Mirrors the summary DTO's own derivation, including its fallback: a resource that marks NO\n // summary field is served its whole object, so the embed must be typed by the whole schema\n // too. The emptiness test deliberately runs on a derivation WITHOUT `_id` — `includeId` adds\n // it unconditionally, so asking the id-bearing shape whether it is empty always answers no,\n // and every such resource would be typed `{ _id }` with its every other leaf left uncoerced.\n const summaryFieldsOnly = ResourcesSummaryUtils.deriveSummarySchema(relatedMainSchema, {\n includeId: false,\n includeForeignKeys: false,\n });\n if (Object.keys(getZodObjectShape(summaryFieldsOnly)).length > 0) {\n relativeSchema = ResourcesSummaryUtils.deriveSummarySchema(relatedMainSchema, {\n includeId: true,\n includeForeignKeys: false,\n });\n }\n }\n\n // The CLIENT placeholder drops the related resource's backend-only fields, stripped here BEFORE\n // coercion because coercion rebuilds wrappers and can erase the `isBackendOnly` mark the strip\n // reads. The client context DTO is assembled AFTER the response DTO's own strip pass, so nothing\n // later would remove them, and the API reference published them (#1625). The service-layer\n // placeholder keeps them. Runtime parsing is unchanged either way: the typed branch is `.loose()`\n // and the union falls back to any record, so this changes what the contract DECLARES.\n if (stripBackendOnly) {\n relativeSchema = this.stripBackendOnlyFields(relativeSchema);\n }\n\n // Coerced HERE rather than left to a later pass: the CONTEXT variant's `responseDto` IS this\n // `contextDto`, and nothing re-coerces it after the variant override (step 10).\n const coercedRelativeSchema = this.applyNetworkBoundaryCoercion(relativeSchema);\n if (!isZodObject(coercedRelativeSchema)) {\n return untypedRelative;\n }\n\n // Backend-only fields are kept on the SERVICE-layer placeholder (`stripBackendOnly: false`): it\n // types the `internalDto`, where they legitimately appear, and declaring them means their dates\n // are coerced too. The client placeholder was stripped above.\n const typedRelative = (coercedRelativeSchema as z.ZodObject<z.ZodRawShape>).partial().loose();\n\n // The union is what makes \"can only ADD coercion\" true rather than nearly true.\n //\n // `.partial()` reaches the TOP level only, so a nested object inside the related schema keeps\n // its required leaves. An embed that omits one — a projection this builder cannot see, an\n // application's own resource shaped differently from its schema — would then turn a response\n // that parses today into a hard validation failure, and a whole context read would be refused\n // over a field nobody reads. Trying the typed schema FIRST and falling back to the untyped\n // record bounds the worst case at exactly the previous behaviour: uncoerced, never rejected.\n return z.union([typedRelative, untypedRelative]);\n }\n\n /**\n * Add relationship placeholders to schema for context DTO.\n * Placeholders are optional and named by `Resources_SharedUtils.resolveRelationshipObjectIdentity`\n * — the same authority `ResourcePopulationBackendService.populateForContext` names them with.\n * Each one's SHAPE comes from {@link buildContextRelativeObjectSchema}.\n *\n * @param schema - Base schema\n * @param relationships - Resource relationships configuration\n * @param effectiveOperation - Operation these DTOs are for, for per-operation context overrides\n * @param registry - Resource registry for type resolution\n * @returns Schema with relationship placeholders added\n */\n private static addRelationshipPlaceholders(\n schema: z.ZodTypeAny,\n relationships: ResourceConfiguration_ResourceRelationships,\n effectiveOperation: CoreResourceOperation | EnumLikeType,\n registry: Map<ResourceType, any>,\n stripBackendOnly: boolean = false,\n ): z.ZodTypeAny {\n // A POLYMORPHIC resource's response is a discriminated union: every variant carries the same\n // relationships, so every variant gets the same placeholders, and the union is rebuilt with the\n // discriminator it had — the pattern `excludeVirtualFieldsFromSchema` already uses. Returning a\n // union unchanged (the previous behaviour) left its context DTO with NO placeholder at all, so\n // `internalDto.parse` and the response serializer stripped every populated child and parent of,\n // e.g., Wonder Todos' `todos` — and the generated API reference documented its context as the\n // plain read response. A union WITHOUT a discriminator has no rebuild this builder can promise,\n // so it stays as-is.\n if (getZodType(schema) === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const options = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n if (discriminator && options && options.length > 0) {\n const withPlaceholders = options.map((option) => this.addRelationshipPlaceholders(option, relationships, effectiveOperation, registry, stripBackendOnly));\n return withPlaceholders.length >= 2\n ? this.preserveRegistryMetadata(schema, z.discriminatedUnion(discriminator, withPlaceholders as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]]))\n : withPlaceholders[0];\n }\n return schema;\n }\n\n // Otherwise only object schemas carry placeholders\n if (!isZodObject(schema)) {\n return schema;\n }\n\n const shape = getZodObjectShape(schema);\n const placeholderFields: Record<string, z.ZodTypeAny> = {};\n\n // Add parent relationship placeholders (includes self-refs acting as parents)\n const parentDirRels = getParentDirectionRelationships(relationships);\n for (const relationship of parentDirRels) {\n if (relationship.contextPolicy?.enabled === false) {\n continue;\n }\n\n const fieldName = this.getRelationshipObjectFieldName(\n relationship,\n relationship.resourceType1,\n ResourceRelationshipCardinality.ONE,\n registry\n );\n\n // Only add if field doesn't already exist (avoid conflicts)\n if (!shape[fieldName]) {\n // A parent carries what its contextPolicy's `objectMode` fetched — a bare reference for\n // ID_ONLY, the parent's summary fields for SUMMARY (the default), its whole object for FULL\n // — and the placeholder is typed from that same mode, optional-everywhere and loose (#1189).\n // It was once `z.object({ _id })`, which stripped every SUMMARY/FULL field even under the\n // right name: no parent object had ever reached a client, on any resource (#579). That is\n // why the typed form below can only ever ADD coercion.\n placeholderFields[fieldName] = this.buildContextRelativeObjectSchema(\n relationship.resourceType1,\n relationship.contextPolicy,\n effectiveOperation,\n registry,\n stripBackendOnly,\n ).optional();\n }\n }\n\n // Add child relationship placeholders (includes self-refs acting as children)\n // Children with contextPolicy enabled are populated in CONTEXT mode\n const childDirRels = getChildDirectionRelationships(relationships);\n for (const relationship of childDirRels) {\n // Skip relationships without contextPolicy or with disabled contextPolicy\n if (!relationship.contextPolicy) {\n continue;\n }\n\n // Skip if contextPolicy is explicitly disabled\n if (relationship.contextPolicy.enabled === false) {\n continue;\n }\n\n const fieldName = this.getRelationshipObjectFieldName(\n relationship,\n relationship.resourceType2,\n relationship.cardinality2,\n registry\n );\n // DTO context placeholders are projection conveniences, not transport\n // addressability proof. Keep this broader than context-addressed mutation\n // eligibility: URL/backend/frontend runtime predicates separately require\n // composition nature, explicit FK metadata, and routing scope.\n const isOneToOne = isOneToOneCardinality(relationship.cardinality2);\n\n // Only add if field doesn't already exist (avoid conflicts)\n if (!shape[fieldName]) {\n // Typed from the child's own schema by the relationship's resolved `objectMode`, with every\n // field optional and unknown keys passed through, so the declaration coerces the child's\n // date and money leaves without being able to strip or refuse anything (#1189).\n const childPlaceholder = this.buildContextRelativeObjectSchema(\n relationship.resourceType2,\n relationship.contextPolicy,\n effectiveOperation,\n registry,\n stripBackendOnly,\n );\n\n if (isOneToOne) {\n // 1:1: single object (optional)\n placeholderFields[fieldName] = childPlaceholder.optional();\n } else {\n // 1:many: array of objects (optional)\n placeholderFields[fieldName] = z.array(childPlaceholder).optional();\n }\n }\n }\n\n // Merge placeholders with existing schema\n if (Object.keys(placeholderFields).length > 0) {\n return schema.extend(placeholderFields);\n }\n\n return schema;\n }\n\n /**\n * Transform object dates from strings to Date objects (for incoming requests).\n * Uses DTO schema to identify which fields are dates.\n *\n * @param data - Object to transform\n * @param dtoSchema - DTO schema (with z.coerce.date() fields)\n * @returns Transformed object with Date objects\n */\n /**\n * Unwrap the pure field-MODIFIER wrappers (`optional` / `nullable` / `default`) to\n * reach the underlying schema, so a wrapped date field is still detected as a date\n * and a wrapped nested object/array is still recursed into.\n *\n * WHY: without this, `z.date().optional()` reports type `'optional'` (not `'date'`),\n * so its string value was never coerced to a `Date`, and an `.optional()`-wrapped\n * object was treated as a leaf. Nested/optional date fields — notably the collection\n * filter date ranges `{ startDate, endDate }` built on `z.date()` (NOT\n * `z.coerce.date()`) — therefore reached the DTO parse as strings and threw\n * `z.date()` validation. Stackable modifiers (`z.date().nullable().default()`) are\n * peeled in a bounded loop.\n *\n * DELIBERATELY does NOT unwrap `pipe` / `transform` / `readonly` / `catch`: those can\n * change the value's meaning (input vs output side), so treating their output schema\n * as their input would mis-coerce. They stay leaves exactly as before. (`z.coerce.date()`\n * reports type `'date'` directly, so it needs no unwrapping and keeps working.)\n */\n private static unwrapDateModifierWrappers(schema: z.ZodTypeAny): z.ZodTypeAny {\n let current = schema;\n while (isZodOptional(current) || isZodNullable(current) || isZodDefault(current)) {\n const inner = getZodDefSchemaProperty(current, 'innerType');\n if (!inner) break;\n current = inner;\n }\n return current;\n }\n\n static transformRequestDates<T = any>(data: T, dtoSchema: z.ZodTypeAny): T {\n if (!data || typeof data !== 'object') {\n return data;\n }\n\n // See through modifier wrappers so a wrapped array/object schema is still handled\n // (e.g. `z.array(...).optional()`, an `.optional()` nested object).\n const schema = this.unwrapDateModifierWrappers(dtoSchema);\n\n // Handle arrays\n if (Array.isArray(data)) {\n const zodType = getZodType(schema);\n if (zodType === 'array') {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny;\n if (elementSchema) {\n return data.map(item => this.transformRequestDates(item, elementSchema)) as T;\n }\n }\n return data;\n }\n\n // Handle objects\n if (isZodObject(schema)) {\n const shape = getZodObjectShape(schema);\n const transformed: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(data as Record<string, any>)) {\n const fieldSchema = shape[key];\n if (fieldSchema) {\n // Unwrap modifier wrappers, then check if the underlying field is a date\n // (`z.date()` / `z.coerce.date()`, incl. `.optional()` / `.nullable()` /\n // `.default()` around them).\n const unwrappedField = this.unwrapDateModifierWrappers(fieldSchema);\n if (getZodType(unwrappedField) === 'date') {\n // Transform string to Date; leave existing Dates (and non-strings) alone.\n transformed[key] = typeof value === 'string' ? new Date(value) : value;\n } else {\n // Recursively transform nested objects/arrays (through their wrappers).\n transformed[key] = this.transformRequestDates(value, unwrappedField);\n }\n } else {\n transformed[key] = value;\n }\n }\n\n return transformed as T;\n }\n\n return data;\n }\n\n /**\n * Transform object dates from Date objects to ISO strings (for outgoing responses).\n * Uses DTO schema to identify which fields are dates.\n *\n * NO `transformResponseBigints` twin exists, BY DESIGN. This is date-specific\n * in-body normalization; the money-`bigint` leaf (the other network-boundary type)\n * is NOT normalized in the body — it stays a `bigint` in the serialized body and is\n * encoded to a decimal string at the JSON boundary by `BigInt.prototype.toJSON`\n * (`installBigIntJsonEncoding`, `@wildo-ai/zod-decorators`). A parallel body-walk for\n * bigint would be redundant with that `toJSON`. (Indeed, since `Date.prototype.toJSON`\n * also exists, this date walk is itself now largely belt-and-suspenders — kept as-is,\n * not extended.) Full mechanism map: `install-bigint-json-encoding.ts`.\n *\n * @param data - Object to transform\n * @param dtoSchema - DTO schema (with z.coerce.date() fields)\n * @returns Transformed object with ISO string dates\n */\n static transformResponseDates<T = any>(data: T, dtoSchema: z.ZodTypeAny): T {\n if (!data || typeof data !== 'object') {\n return data;\n }\n\n // Handle arrays\n if (Array.isArray(data)) {\n const zodType = getZodType(dtoSchema);\n if (zodType === 'array') {\n // ZodArray stores element schema in _def.element (not _def.type)\n const elementSchema = getZodDefProperty(dtoSchema, 'element') as z.ZodTypeAny;\n if (elementSchema) {\n return data.map(item => this.transformResponseDates(item, elementSchema)) as T;\n }\n }\n return data;\n }\n\n // Handle objects\n if (isZodObject(dtoSchema)) {\n const shape = getZodObjectShape(dtoSchema);\n const transformed: Record<string, any> = {};\n\n for (const [key, value] of Object.entries(data as Record<string, any>)) {\n const fieldSchema = shape[key];\n if (fieldSchema) {\n // Check if field is a date (coerced or regular)\n const zodType = getZodType(fieldSchema);\n if (zodType === 'date' || hasZodType(fieldSchema, 'date')) {\n // Transform Date to ISO string\n if (value instanceof Date) {\n transformed[key] = value.toISOString();\n } else {\n transformed[key] = value;\n }\n } else {\n // Recursively transform nested objects/arrays\n transformed[key] = this.transformResponseDates(value, fieldSchema);\n }\n } else {\n transformed[key] = value;\n }\n }\n\n return transformed as T;\n }\n\n return data;\n }\n\n /**\n * Select the appropriate response DTO based on DataMode.\n * Used by both backend and frontend services to ensure consistent DTO selection.\n *\n * IMPORTANT: Handles structure differences between single-item and collection operations:\n * - Single item (READ, CREATE, etc.): Returns item schema\n * - Collection (LIST, SEARCH): Returns pagination wrapper schema\n *\n * Priority:\n * 1. If operation has variantKey → return operation.responseDto (already variant-specific)\n * 2. If DataMode is SUMMARY and summaryDto exists → return summaryDto (wrapped for LIST/SEARCH)\n * 3. If DataMode is CONTEXT and contextDto exists → return contextDto (wrapped for LIST/SEARCH)\n * 4. Otherwise → return responseDto (default for RAW mode)\n *\n * @param operation - The resource operation configuration\n * @param dataMode - The data mode (defaults to RAW if not specified)\n * @returns The selected DTO schema, or null/undefined if not available\n */\n static selectResponseDto(\n operation: ResourceConfiguration_Operation<any, any, any>,\n dataMode?: DataMode\n ): z.ZodTypeAny | null | undefined {\n if (!operation) {\n return null;\n }\n\n // For variant operations (with variantKey), responseDto is already correct\n // (built in buildAllOperationDtos with correct structure for LIST/SEARCH)\n if (operation.variantKey) {\n return operation.responseDto || null;\n }\n\n const effectiveDataMode = dataMode || DataMode.RAW;\n const effectiveOperation = operation.resourceOperationLike || operation.operationIdentifier;\n const isListOrSearch = effectiveOperation === CoreResourceOperation.LIST\n || effectiveOperation === CoreResourceOperation.SEARCH;\n\n // For default operations with dataMode specified, select and wrap appropriately\n if (effectiveDataMode === DataMode.SUMMARY && operation.summaryDto) {\n return isListOrSearch\n ? this.wrapInPaginationStructure(operation.summaryDto, (operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n : operation.summaryDto;\n }\n\n if (effectiveDataMode === DataMode.CONTEXT && operation.contextDto) {\n return isListOrSearch\n ? this.wrapInPaginationStructure(operation.contextDto, (operation as { maxPaginatedResultPerPageLimit?: number }).maxPaginatedResultPerPageLimit)\n : operation.contextDto;\n }\n\n // Default to responseDto for RAW mode or when specific DTOs are not available\n return operation.responseDto || null;\n }\n\n /**\n * Wrap item schema in pagination structure for LIST/SEARCH operations\n * @param itemSchema - Schema for individual items\n * @returns Pagination wrapper schema\n */\n private static wrapInPaginationStructure(itemSchema: z.ZodTypeAny, maxResultsPerPageLimit?: number): z.ZodTypeAny {\n return z.object({\n data: z.array(itemSchema),\n // The operation's ceiling, like every other pagination bound in the framework. `limit` echoes\n // the page size that was SERVED, so a bound stricter than the repository's turns a valid page\n // into a 500 — which is exactly what a hard-coded 100 here did to an operation declaring 200.\n pagination: createPaginationResponseMetadataSchema(maxResultsPerPageLimit)\n });\n }\n}\n\n/**\n * Derive the re-attach allowlist for a TRUSTED, in-process system write.\n *\n * The repository strict-parses every create/update against a client-shaped\n * request DTO that DROPS three classes of field: `.isBackendOnly()` fields, the\n * context-auto-populated FKs (`CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS`, stripped\n * by name), and the verb-excluded fields (`.excludeFromCreate()` on CREATE /\n * `.excludeFromUpdate()` on UPDATE). On the HTTP path those are re-supplied AFTER\n * the strip — backend-only material never comes from the client, the context FKs\n * are injected from the URL-derived context / initiator identity by\n * `enrichDataWithContext`, and a client is simply not allowed to author the\n * verb-excluded fields (the server owns them).\n *\n * An in-process caller writing to a system resource has NEITHER context: the\n * payload IS the source of truth. Registration creating `USER_CREDENTIALS` with\n * `{ userId, passwordHash }` needs the FK + backend-only field to survive; an\n * OIDC re-login bumping an identity link's `.excludeFromUpdate()` `lastUsedAt`\n * needs the verb-excluded field to survive. Without help, the strip silently\n * drops them → a required-path Mongoose crash or silent data loss.\n *\n * This function returns exactly the subset of `payloadKeys` the strip would drop\n * for one of those legitimate reasons, so the trusted-write primitives\n * (`SystemAccessBackendService.createAsSystem` / `updateAsSystem` /\n * `updateManyAsSystem`) can forward it as `options.preserveServerInjectedFields`\n * and have the repository re-attach the values after the strip. Ordinary fields\n * are deliberately excluded — they parse normally, so re-attaching them would\n * bypass their own validation.\n *\n * PER-VERB EXCLUDE SEMANTICS (the `verb` argument):\n * - UPDATE / UPDATE_MANY: re-attach every `.excludeFromUpdate()` key the caller\n * authored. UPDATE is a partial `$set` (no default application), so an\n * explicitly-authored value is authoritative — this is the path that lets a\n * server-managed timestamp like `lastUsedAt` actually advance.\n * - CREATE: re-attach an `.excludeFromCreate()` key the caller authored ONLY\n * when the field has NO `.default()`. A defaulted excludeFromCreate field\n * (`createdAt`, `linkedAt`, …) is server-owned at creation and the\n * strip-then-default path is the intended source of truth; re-attaching a\n * caller value would let stale input clobber the fresh default. A caller with\n * a genuine need to override a defaulted field can still pass an explicit\n * `preserveServerInjectedFields`.\n *\n * The mandatory-discard fields (`_id` / `createdAt` / `updatedAt` / `deletedAt` /\n * `_version_db_doc`) are NEVER re-attached — they are force-removed before\n * validation and are unconditionally server-owned. This guard is what keeps the\n * UPDATE branch (which would otherwise match `.excludeFromUpdate()` `createdAt` /\n * `updatedAt`) honest.\n *\n * ANTI-SMUGGLING: this is safe ONLY because the primitives are reachable exclusively\n * from trusted engine code behind a fail-closed `systemAccessPolicy` opt-in — never\n * from an HTTP payload. Do NOT call this to re-attach fields from an untrusted\n * request; that would re-open the exact hole the strict parse closes.\n *\n * Polymorphic-safe: `getMergedObjectOrUnionShape` merges discriminated-union\n * variants and returns `{}` for a non-object schema (in which case only the\n * name-based context-FK detection applies — still correct for scope/audit FKs).\n *\n * @param mainSchema The resource's main Zod schema.\n * @param payloadKeys The keys actually present on the trusted write payload.\n * @param verb The write verb — selects `.excludeFromCreate()` vs\n * `.excludeFromUpdate()` detection (UPDATE_MANY ≡ UPDATE). The\n * write is always one of these, so the caller always knows it.\n * @returns The subset of `payloadKeys` that are backend-only, context-auto-populated,\n * or a legitimately-authored verb-excluded field.\n */\nexport function deriveTrustedSystemWritePreservedFields(\n mainSchema: z.ZodTypeAny,\n payloadKeys: readonly string[],\n verb: CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.UPDATE_MANY,\n): string[] {\n const backendOnlyFieldNames = new Set<string>();\n // Verb-excluded fields the client-shaped DTO strips but a TRUSTED caller may\n // legitimately author (see PER-VERB EXCLUDE SEMANTICS above).\n const verbExcludedFieldNames = new Set<string>();\n\n const shape = getMergedObjectOrUnionShape(mainSchema);\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (isBackendOnlyField(fieldSchema)) {\n backendOnlyFieldNames.add(fieldName);\n }\n if (verb === CoreResourceOperation.CREATE) {\n // Defaulted excludeFromCreate fields are server-materialised at creation —\n // withhold them so the schema default wins over any (potentially stale) input.\n if (isExcludedFromCreate(fieldSchema) && !isZodDefault(fieldSchema)) {\n verbExcludedFieldNames.add(fieldName);\n }\n } else if (verb === CoreResourceOperation.UPDATE || verb === CoreResourceOperation.UPDATE_MANY) {\n if (isExcludedFromUpdate(fieldSchema)) {\n verbExcludedFieldNames.add(fieldName);\n }\n }\n }\n\n return payloadKeys.filter((key) =>\n // Never resurrect a mandatory-discard field (force-removed pre-validation).\n !createOrUpdateMandatoryDiscardFields.includes(key)\n && (\n backendOnlyFieldNames.has(key)\n || verbExcludedFieldNames.has(key)\n || CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS.includes(key)\n ),\n );\n}\n"]}