@wildo-ai/saas-models 1.1.6 → 1.1.7

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 (869) hide show
  1. package/dist/esm/__tests__/setup.d.ts.map +1 -1
  2. package/dist/esm/__tests__/setup.js.map +1 -1
  3. package/dist/esm/_inspect.d.ts.map +1 -1
  4. package/dist/esm/_inspect.js.map +1 -1
  5. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.js.map +1 -1
  7. package/dist/esm/applications/application-subject.shared.schemas.d.ts.map +1 -1
  8. package/dist/esm/applications/application-subject.shared.schemas.js.map +1 -1
  9. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
  10. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
  11. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  12. package/dist/esm/applications/applications-context.schemas.js.map +1 -1
  13. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  14. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  15. package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
  16. package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
  17. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  18. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  19. package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
  20. package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
  21. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  22. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  23. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  24. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  25. package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
  26. package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
  27. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  28. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
  29. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  30. package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
  31. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
  32. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
  33. package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
  34. package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
  35. package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
  36. package/dist/esm/billing/price.shared.resources-config.schemas.js.map +1 -1
  37. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  39. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  40. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  41. package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
  42. package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
  43. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
  44. package/dist/esm/billing/product.shared.resources-config.schemas.js.map +1 -1
  45. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  46. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  47. package/dist/esm/billing/promotions.shared.resources-config.schemas.d.ts.map +1 -1
  48. package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
  49. package/dist/esm/billing/promotions.shared.schemas.d.ts.map +1 -1
  50. package/dist/esm/billing/promotions.shared.schemas.js.map +1 -1
  51. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -1
  52. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -1
  53. package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -1
  54. package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -1
  55. package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -1
  56. package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -1
  57. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
  58. package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
  59. package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
  60. package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
  61. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  62. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  63. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  64. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  65. package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts.map +1 -1
  66. package/dist/esm/billing/usage-flush-evidence.shared.schemas.js.map +1 -1
  67. package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
  68. package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
  69. package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
  70. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  71. package/dist/esm/charts/aggregation-query.shared.schemas.d.ts.map +1 -1
  72. package/dist/esm/charts/aggregation-query.shared.schemas.js.map +1 -1
  73. package/dist/esm/charts/aggregation.shared.definitions.d.ts.map +1 -1
  74. package/dist/esm/charts/aggregation.shared.definitions.js.map +1 -1
  75. package/dist/esm/charts/chart-definition-builder.shared.d.ts.map +1 -1
  76. package/dist/esm/charts/chart-definition-builder.shared.js.map +1 -1
  77. package/dist/esm/companion/artifact-placement.shared.definitions.d.ts.map +1 -1
  78. package/dist/esm/companion/artifact-placement.shared.definitions.js.map +1 -1
  79. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  80. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  81. package/dist/esm/companion/shared-library-companion.shared.definitions.d.ts.map +1 -1
  82. package/dist/esm/companion/shared-library-companion.shared.definitions.js.map +1 -1
  83. package/dist/esm/companion-exports.d.ts.map +1 -1
  84. package/dist/esm/companion-exports.js.map +1 -1
  85. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  86. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
  87. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts.map +1 -1
  88. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js.map +1 -1
  89. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
  90. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -1
  91. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
  92. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.js.map +1 -1
  93. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  94. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
  95. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  96. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  97. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  98. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  99. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  100. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  101. package/dist/esm/compliance/data-classification/data-classification.shared.schemas.d.ts.map +1 -1
  102. package/dist/esm/compliance/data-classification/data-classification.shared.schemas.js.map +1 -1
  103. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts.map +1 -1
  104. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js.map +1 -1
  105. package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
  106. package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
  107. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts.map +1 -1
  108. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js.map +1 -1
  109. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts.map +1 -1
  110. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js.map +1 -1
  111. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
  112. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
  113. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts.map +1 -1
  114. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js.map +1 -1
  115. package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
  116. package/dist/esm/compliance/privacy/client-storage.shared.schemas.js.map +1 -1
  117. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts.map +1 -1
  118. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js.map +1 -1
  119. package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts.map +1 -1
  120. package/dist/esm/compliance/privacy/consent-purposes.shared.js.map +1 -1
  121. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -1
  122. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
  123. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
  124. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
  125. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  126. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
  127. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -1
  128. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -1
  129. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -1
  130. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -1
  131. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -1
  132. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -1
  133. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
  134. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
  135. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  136. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  137. package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.d.ts.map +1 -1
  138. package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.js.map +1 -1
  139. package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.d.ts.map +1 -1
  140. package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.js.map +1 -1
  141. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
  142. package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
  143. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -1
  144. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -1
  145. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -1
  146. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -1
  147. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
  148. package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
  149. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -1
  150. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -1
  151. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -1
  152. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -1
  153. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -1
  154. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -1
  155. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
  156. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js.map +1 -1
  157. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -1
  158. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -1
  159. package/dist/esm/compliance/privacy/sharing.shared.schemas.d.ts.map +1 -1
  160. package/dist/esm/compliance/privacy/sharing.shared.schemas.js.map +1 -1
  161. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -1
  162. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -1
  163. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts.map +1 -1
  164. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js.map +1 -1
  165. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
  166. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
  167. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
  168. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js.map +1 -1
  169. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  170. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  171. package/dist/esm/compliance/review-cadence.shared.schemas.d.ts.map +1 -1
  172. package/dist/esm/compliance/review-cadence.shared.schemas.js.map +1 -1
  173. package/dist/esm/compliance/risk-posture.shared.schemas.d.ts.map +1 -1
  174. package/dist/esm/compliance/risk-posture.shared.schemas.js.map +1 -1
  175. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
  176. package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
  177. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  178. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  179. package/dist/esm/config/app-frontend-type.shared.schemas.d.ts.map +1 -1
  180. package/dist/esm/config/app-frontend-type.shared.schemas.js.map +1 -1
  181. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
  182. package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
  183. package/dist/esm/config/brand-assets.shared.schemas.d.ts.map +1 -1
  184. package/dist/esm/config/brand-assets.shared.schemas.js.map +1 -1
  185. package/dist/esm/config/configuration-validation.shared.schemas.d.ts.map +1 -1
  186. package/dist/esm/config/configuration-validation.shared.schemas.js.map +1 -1
  187. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  188. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  189. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +22 -22
  190. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts.map +1 -1
  191. package/dist/esm/config/frontend/chart-definition.shared.schemas.js.map +1 -1
  192. package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
  193. package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
  194. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  195. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  196. package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
  197. package/dist/esm/config/frontend/onboarding.shared.schemas.js.map +1 -1
  198. package/dist/esm/config/postgresql.shared.schemas.d.ts.map +1 -1
  199. package/dist/esm/config/postgresql.shared.schemas.js.map +1 -1
  200. package/dist/esm/config/registration-acquisition-policy.shared.utils.d.ts.map +1 -1
  201. package/dist/esm/config/registration-acquisition-policy.shared.utils.js.map +1 -1
  202. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  203. package/dist/esm/config-authoring.entry.js.map +1 -1
  204. package/dist/esm/crdt/crdt-merge.shared.utils.d.ts.map +1 -1
  205. package/dist/esm/crdt/crdt-merge.shared.utils.js.map +1 -1
  206. package/dist/esm/data-seeding/data-seeding-config.shared.schemas.d.ts.map +1 -1
  207. package/dist/esm/data-seeding/data-seeding-config.shared.schemas.js.map +1 -1
  208. package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -1
  209. package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -1
  210. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  211. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  212. package/dist/esm/errors/errors.shared.definitions.d.ts.map +1 -1
  213. package/dist/esm/errors/errors.shared.definitions.js.map +1 -1
  214. package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
  215. package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
  216. package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
  217. package/dist/esm/errors/errors.shared.utils.js.map +1 -1
  218. package/dist/esm/errors/resource-access-forbidden.shared.error.d.ts.map +1 -1
  219. package/dist/esm/errors/resource-access-forbidden.shared.error.js.map +1 -1
  220. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
  221. package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
  222. package/dist/esm/errors/zod-issue-formatting.shared.utils.d.ts.map +1 -1
  223. package/dist/esm/errors/zod-issue-formatting.shared.utils.js.map +1 -1
  224. package/dist/esm/exports/tabular-csv.shared.utils.d.ts.map +1 -1
  225. package/dist/esm/exports/tabular-csv.shared.utils.js.map +1 -1
  226. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -1
  227. package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -1
  228. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -1
  229. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -1
  230. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  231. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  232. package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -1
  233. package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -1
  234. package/dist/esm/external-data.exports.d.ts.map +1 -1
  235. package/dist/esm/external-data.exports.js.map +1 -1
  236. package/dist/esm/external-providers/compose-provider-registry.shared.d.ts.map +1 -1
  237. package/dist/esm/external-providers/compose-provider-registry.shared.js.map +1 -1
  238. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  239. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  240. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  241. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  242. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -1
  243. package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
  244. package/dist/esm/external-providers/external-providers.shared.schemas.d.ts.map +1 -1
  245. package/dist/esm/external-providers/external-providers.shared.schemas.js.map +1 -1
  246. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  247. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.js.map +1 -1
  248. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
  249. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
  250. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
  251. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
  252. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  253. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  254. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
  255. package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
  256. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -1
  257. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -1
  258. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -1
  259. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -1
  260. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -1
  261. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -1
  262. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts.map +1 -1
  263. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js.map +1 -1
  264. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -1
  265. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -1
  266. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  267. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  268. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  269. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  270. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
  271. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
  272. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
  273. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
  274. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
  275. package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
  276. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -1
  277. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -1
  278. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  279. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  280. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -1
  281. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -1
  282. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -1
  283. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -1
  284. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -1
  285. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -1
  286. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -1
  287. package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -1
  288. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -1
  289. package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -1
  290. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
  291. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js.map +1 -1
  292. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
  293. package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
  294. package/dist/esm/features/connected-feature.example.d.ts.map +1 -1
  295. package/dist/esm/features/connected-feature.example.js.map +1 -1
  296. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  297. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  298. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  299. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  300. package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
  301. package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
  302. package/dist/esm/features/feature-registry.shared.d.ts.map +1 -1
  303. package/dist/esm/features/feature-registry.shared.js.map +1 -1
  304. package/dist/esm/features/feature-resolution.shared.schemas.d.ts.map +1 -1
  305. package/dist/esm/features/feature-resolution.shared.schemas.js.map +1 -1
  306. package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
  307. package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
  308. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
  309. package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
  310. package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -1
  311. package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -1
  312. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -1
  313. package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -1
  314. package/dist/esm/files/files.shared.resources-config.schemas.d.ts.map +1 -1
  315. package/dist/esm/files/files.shared.resources-config.schemas.js.map +1 -1
  316. package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
  317. package/dist/esm/files/files.shared.schemas.js.map +1 -1
  318. package/dist/esm/files/files.shared.utils.d.ts.map +1 -1
  319. package/dist/esm/files/files.shared.utils.js.map +1 -1
  320. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  321. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
  322. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
  323. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
  324. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
  325. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
  326. package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.d.ts.map +1 -1
  327. package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.js.map +1 -1
  328. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  329. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  330. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
  331. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js.map +1 -1
  332. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -1
  333. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -1
  334. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -1
  335. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -1
  336. package/dist/esm/flows-actors/agents.shared.schemas.d.ts +2 -2
  337. package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
  338. package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
  339. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -1
  340. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -1
  341. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
  342. package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
  343. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts.map +1 -1
  344. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js.map +1 -1
  345. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
  346. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
  347. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  348. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  349. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
  350. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
  351. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
  352. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
  353. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  354. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  355. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
  356. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
  357. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
  358. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
  359. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
  360. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  361. package/dist/esm/flows-actors/flows-actors.system.shared.definitions.d.ts.map +1 -1
  362. package/dist/esm/flows-actors/flows-actors.system.shared.definitions.js.map +1 -1
  363. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  364. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
  365. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  366. package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
  367. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
  368. package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
  369. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -1
  370. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -1
  371. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -1
  372. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -1
  373. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -1
  374. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -1
  375. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -1
  376. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -1
  377. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -1
  378. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -1
  379. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -1
  380. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -1
  381. package/dist/esm/flows-actors/prompt-ir.shared.schemas.d.ts.map +1 -1
  382. package/dist/esm/flows-actors/prompt-ir.shared.schemas.js.map +1 -1
  383. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -1
  384. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -1
  385. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -1
  386. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -1
  387. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -1
  388. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -1
  389. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
  390. package/dist/esm/flows-actors/tasks.actors.shared.schemas.js.map +1 -1
  391. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -1
  392. package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -1
  393. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts.map +1 -1
  394. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js.map +1 -1
  395. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
  396. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
  397. package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
  398. package/dist/esm/guidance/guidance-flow.shared.schemas.js.map +1 -1
  399. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
  400. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
  401. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  402. package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
  403. package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
  404. package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
  405. package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts.map +1 -1
  406. package/dist/esm/guidance/lifecycle-config.shared.schemas.js.map +1 -1
  407. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
  408. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
  409. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
  410. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  411. package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
  412. package/dist/esm/guidance/milestone-builders.shared.js.map +1 -1
  413. package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.map +1 -1
  414. package/dist/esm/guidance/milestone-definition.shared.schemas.js.map +1 -1
  415. package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts.map +1 -1
  416. package/dist/esm/guidance/progression-presentation.shared.schemas.js.map +1 -1
  417. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
  418. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
  419. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  420. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  421. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.d.ts.map +1 -1
  422. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
  423. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  424. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  425. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -1
  426. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -1
  427. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -1
  428. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -1
  429. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -1
  430. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
  431. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts.map +1 -1
  432. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js.map +1 -1
  433. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -1
  434. package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -1
  435. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -1
  436. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -1
  437. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -1
  438. package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -1
  439. package/dist/esm/i18n/interpolate-label-params.shared.utils.d.ts.map +1 -1
  440. package/dist/esm/i18n/interpolate-label-params.shared.utils.js.map +1 -1
  441. package/dist/esm/i18n/labelling.dto.shared.schemas.d.ts.map +1 -1
  442. package/dist/esm/i18n/labelling.dto.shared.schemas.js.map +1 -1
  443. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -1
  444. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -1
  445. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -1
  446. package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -1
  447. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -1
  448. package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -1
  449. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -1
  450. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -1
  451. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -1
  452. package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -1
  453. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -1
  454. package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -1
  455. package/dist/esm/index.d.ts.map +1 -1
  456. package/dist/esm/index.js.map +1 -1
  457. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -1
  458. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.js.map +1 -1
  459. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +1 -1
  460. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +1 -1
  461. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts.map +1 -1
  462. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js.map +1 -1
  463. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
  464. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
  465. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -1
  466. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  467. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
  468. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
  469. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -1
  470. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +1 -1
  471. package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
  472. package/dist/esm/meta-workflows.exports.js.map +1 -1
  473. package/dist/esm/monitoring/monitoring.shared.schemas.d.ts.map +1 -1
  474. package/dist/esm/monitoring/monitoring.shared.schemas.js.map +1 -1
  475. package/dist/esm/notifications/email/email-context.shared.schemas.d.ts.map +1 -1
  476. package/dist/esm/notifications/email/email-context.shared.schemas.js.map +1 -1
  477. package/dist/esm/notifications/email/email-submission.shared.enums.d.ts.map +1 -1
  478. package/dist/esm/notifications/email/email-submission.shared.enums.js.map +1 -1
  479. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  480. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  481. package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
  482. package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
  483. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -1
  484. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -1
  485. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -1
  486. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -1
  487. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -1
  488. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -1
  489. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  490. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
  491. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.map +1 -1
  492. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js.map +1 -1
  493. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  494. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  495. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  496. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  497. package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
  498. package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
  499. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  500. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  501. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
  502. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
  503. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  504. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  505. package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts.map +1 -1
  506. package/dist/esm/organizations/application-owner-organization.shared.schemas.js.map +1 -1
  507. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
  508. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
  509. package/dist/esm/organizations/organization-features.shared.schemas.d.ts.map +1 -1
  510. package/dist/esm/organizations/organization-features.shared.schemas.js.map +1 -1
  511. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  512. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  513. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  514. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  515. package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.d.ts.map +1 -1
  516. package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.js.map +1 -1
  517. package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
  518. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  519. package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  520. package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.js.map +1 -1
  521. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
  522. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  523. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
  524. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.js.map +1 -1
  525. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  526. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  527. package/dist/esm/organizations/organization-unit-inheritance.shared.d.ts.map +1 -1
  528. package/dist/esm/organizations/organization-unit-inheritance.shared.js.map +1 -1
  529. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.d.ts.map +1 -1
  530. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map +1 -1
  531. package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
  532. package/dist/esm/organizations/organization-unit-members.shared.schemas.js.map +1 -1
  533. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
  534. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js.map +1 -1
  535. package/dist/esm/organizations/organization-unit-narrowing.example.d.ts.map +1 -1
  536. package/dist/esm/organizations/organization-unit-narrowing.example.js.map +1 -1
  537. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  538. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  539. package/dist/esm/organizations/organization-units.shared.path.d.ts.map +1 -1
  540. package/dist/esm/organizations/organization-units.shared.path.js.map +1 -1
  541. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
  542. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
  543. package/dist/esm/organizations/organization-units.shared.schemas.d.ts.map +1 -1
  544. package/dist/esm/organizations/organization-units.shared.schemas.js.map +1 -1
  545. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  546. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  547. package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
  548. package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
  549. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -1
  550. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -1
  551. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -1
  552. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -1
  553. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -1
  554. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -1
  555. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -1
  556. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -1
  557. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -1
  558. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -1
  559. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -1
  560. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -1
  561. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -1
  562. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -1
  563. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
  564. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
  565. package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
  566. package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
  567. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  568. package/dist/esm/public-runtime/index.js.map +1 -1
  569. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
  570. package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
  571. package/dist/esm/queue/jobs.shared.schemas.d.ts +8 -8
  572. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  573. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  574. package/dist/esm/queue/jobs.shared.utils.d.ts.map +1 -1
  575. package/dist/esm/queue/jobs.shared.utils.js.map +1 -1
  576. package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
  577. package/dist/esm/queue/queues.shared.schemas.js.map +1 -1
  578. package/dist/esm/queue/queues.shared.utils.d.ts.map +1 -1
  579. package/dist/esm/queue/queues.shared.utils.js.map +1 -1
  580. package/dist/esm/queue/rabbitmq-queue-args.shared.d.ts.map +1 -1
  581. package/dist/esm/queue/rabbitmq-queue-args.shared.js.map +1 -1
  582. package/dist/esm/rag/rag-retrieval-health.shared.d.ts.map +1 -1
  583. package/dist/esm/rag/rag-retrieval-health.shared.js.map +1 -1
  584. package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
  585. package/dist/esm/requests/header-keys.shared.js.map +1 -1
  586. package/dist/esm/requests/http-requests.shared.d.ts.map +1 -1
  587. package/dist/esm/requests/http-requests.shared.js.map +1 -1
  588. package/dist/esm/requests/idempotency-key.shared.d.ts.map +1 -1
  589. package/dist/esm/requests/idempotency-key.shared.js.map +1 -1
  590. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
  591. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
  592. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  593. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  594. package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
  595. package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
  596. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  597. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  598. package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
  599. package/dist/esm/resources/child-operations.shared.schemas.js.map +1 -1
  600. package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -1
  601. package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -1
  602. package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
  603. package/dist/esm/resources/context-policy.shared.schemas.js.map +1 -1
  604. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -1
  605. package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -1
  606. package/dist/esm/resources/relationship-display.shared.schemas.d.ts.map +1 -1
  607. package/dist/esm/resources/relationship-display.shared.schemas.js.map +1 -1
  608. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  609. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  610. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  611. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  612. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  613. package/dist/esm/resources/resources-registry.shared.core.definitions.js +18 -2
  614. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  615. package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
  616. package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
  617. package/dist/esm/resources/resources-serialization.shared.schemas.d.ts.map +1 -1
  618. package/dist/esm/resources/resources-serialization.shared.schemas.js.map +1 -1
  619. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  620. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  621. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  622. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  623. package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
  624. package/dist/esm/resources/resources.shared.utils.js.map +1 -1
  625. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
  626. package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
  627. package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
  628. package/dist/esm/resources/utils/composition-cascade-deletability.validation.js.map +1 -1
  629. package/dist/esm/resources/utils/composition-seedability.validation.d.ts.map +1 -1
  630. package/dist/esm/resources/utils/composition-seedability.validation.js.map +1 -1
  631. package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.d.ts.map +1 -1
  632. package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.js.map +1 -1
  633. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts.map +1 -1
  634. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js.map +1 -1
  635. package/dist/esm/resources/utils/duplicate-relationship-registration.validation.d.ts.map +1 -1
  636. package/dist/esm/resources/utils/duplicate-relationship-registration.validation.js.map +1 -1
  637. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -1
  638. package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -1
  639. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -1
  640. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -1
  641. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts.map +1 -1
  642. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js.map +1 -1
  643. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -1
  644. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -1
  645. package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.d.ts.map +1 -1
  646. package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.js.map +1 -1
  647. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -1
  648. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
  649. package/dist/esm/resources/utils/repository-dto-builder.utils.d.ts.map +1 -1
  650. package/dist/esm/resources/utils/repository-dto-builder.utils.js.map +1 -1
  651. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -1
  652. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -1
  653. package/dist/esm/resources/utils/required-fk-fillability.validation.d.ts.map +1 -1
  654. package/dist/esm/resources/utils/required-fk-fillability.validation.js.map +1 -1
  655. package/dist/esm/resources/utils/resource-operation-type-guards.utils.d.ts.map +1 -1
  656. package/dist/esm/resources/utils/resource-operation-type-guards.utils.js.map +1 -1
  657. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
  658. package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
  659. package/dist/esm/resources/utils/resource-polymorphism.relationships.d.ts.map +1 -1
  660. package/dist/esm/resources/utils/resource-polymorphism.relationships.js.map +1 -1
  661. package/dist/esm/resources/utils/resource-polymorphism.schemas.d.ts.map +1 -1
  662. package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
  663. package/dist/esm/resources/utils/resource-polymorphism.utils.d.ts.map +1 -1
  664. package/dist/esm/resources/utils/resource-polymorphism.utils.js.map +1 -1
  665. package/dist/esm/resources/utils/resource-subtree.utils.d.ts.map +1 -1
  666. package/dist/esm/resources/utils/resource-subtree.utils.js.map +1 -1
  667. package/dist/esm/resources/utils/resources-config-context-needs.utils.d.ts.map +1 -1
  668. package/dist/esm/resources/utils/resources-config-context-needs.utils.js.map +1 -1
  669. package/dist/esm/resources/utils/resources-config-naming.utils.d.ts.map +1 -1
  670. package/dist/esm/resources/utils/resources-config-naming.utils.js.map +1 -1
  671. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  672. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  673. package/dist/esm/resources/utils/resources-config-operations.path.utils.d.ts.map +1 -1
  674. package/dist/esm/resources/utils/resources-config-operations.path.utils.js.map +1 -1
  675. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
  676. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js.map +1 -1
  677. package/dist/esm/resources/utils/resources-config-operations.utils.d.ts.map +1 -1
  678. package/dist/esm/resources/utils/resources-config-operations.utils.js.map +1 -1
  679. package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
  680. package/dist/esm/resources/utils/resources-serialization.utils.js.map +1 -1
  681. package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
  682. package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
  683. package/dist/esm/resources/utils/schema-family-builder.utils.d.ts.map +1 -1
  684. package/dist/esm/resources/utils/schema-family-builder.utils.js.map +1 -1
  685. package/dist/esm/resources/utils/schema-type-inference.utils.d.ts.map +1 -1
  686. package/dist/esm/resources/utils/schema-type-inference.utils.js.map +1 -1
  687. package/dist/esm/resources/utils/schema-type-utils.d.ts.map +1 -1
  688. package/dist/esm/resources/utils/schema-type-utils.js.map +1 -1
  689. package/dist/esm/resources/utils/schema-variant-resolver.utils.d.ts.map +1 -1
  690. package/dist/esm/resources/utils/schema-variant-resolver.utils.js.map +1 -1
  691. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  692. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  693. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.d.ts.map +1 -1
  694. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js.map +1 -1
  695. package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -1
  696. package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -1
  697. package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
  698. package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
  699. package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
  700. package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
  701. package/dist/esm/runtime/runtime.shared.schemas.d.ts.map +1 -1
  702. package/dist/esm/runtime/runtime.shared.schemas.js.map +1 -1
  703. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  704. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  705. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  706. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  707. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
  708. package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
  709. package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.d.ts.map +1 -1
  710. package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.js.map +1 -1
  711. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  712. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  713. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
  714. package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
  715. package/dist/esm/security/authentications/authentication.shared.utils.d.ts.map +1 -1
  716. package/dist/esm/security/authentications/authentication.shared.utils.js.map +1 -1
  717. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
  718. package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
  719. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
  720. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js.map +1 -1
  721. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -1
  722. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -1
  723. package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts.map +1 -1
  724. package/dist/esm/security/authentications/password-blocklist.shared.utils.js.map +1 -1
  725. package/dist/esm/security/authentications/password-reset.shared.dto.schemas.d.ts.map +1 -1
  726. package/dist/esm/security/authentications/password-reset.shared.dto.schemas.js.map +1 -1
  727. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
  728. package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
  729. package/dist/esm/security/authentications/same-origin-redirect-path.shared.d.ts.map +1 -1
  730. package/dist/esm/security/authentications/same-origin-redirect-path.shared.js.map +1 -1
  731. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts.map +1 -1
  732. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
  733. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
  734. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
  735. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
  736. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  737. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
  738. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
  739. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
  740. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js.map +1 -1
  741. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -1
  742. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -1
  743. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
  744. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
  745. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.d.ts.map +1 -1
  746. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.js.map +1 -1
  747. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts.map +1 -1
  748. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js.map +1 -1
  749. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts.map +1 -1
  750. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js.map +1 -1
  751. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -1
  752. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -1
  753. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
  754. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js.map +1 -1
  755. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.map +1 -1
  756. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
  757. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  758. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  759. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  760. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  761. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
  762. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
  763. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  764. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  765. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
  766. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
  767. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  768. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
  769. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -1
  770. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -1
  771. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  772. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  773. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
  774. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
  775. package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
  776. package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
  777. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  778. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  779. package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
  780. package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
  781. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -1
  782. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -1
  783. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
  784. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
  785. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
  786. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
  787. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
  788. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
  789. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -1
  790. package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -1
  791. package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.d.ts.map +1 -1
  792. package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.js.map +1 -1
  793. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  794. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  795. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  796. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  797. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  798. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  799. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
  800. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
  801. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
  802. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
  803. package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.d.ts.map +1 -1
  804. package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.js.map +1 -1
  805. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -1
  806. package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
  807. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -1
  808. package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -1
  809. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -1
  810. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -1
  811. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts.map +1 -1
  812. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js.map +1 -1
  813. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -1
  814. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -1
  815. package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts.map +1 -1
  816. package/dist/esm/systems-of-record/system-of-record-env.shared.js.map +1 -1
  817. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -1
  818. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -1
  819. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -1
  820. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -1
  821. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -1
  822. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
  823. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts.map +1 -1
  824. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js.map +1 -1
  825. package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
  826. package/dist/esm/testing/resource-config-builders.js.map +1 -1
  827. package/dist/esm/testing.d.ts.map +1 -1
  828. package/dist/esm/testing.js.map +1 -1
  829. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
  830. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js.map +1 -1
  831. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
  832. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
  833. package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
  834. package/dist/esm/users/anonymous-users.shared.schema.js.map +1 -1
  835. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  836. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  837. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
  838. package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
  839. package/dist/esm/users/user-consent-decision.shared.utils.d.ts.map +1 -1
  840. package/dist/esm/users/user-consent-decision.shared.utils.js.map +1 -1
  841. package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
  842. package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
  843. package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
  844. package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
  845. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
  846. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
  847. package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
  848. package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
  849. package/dist/esm/users/user-preferences-reset.shared.utils.d.ts.map +1 -1
  850. package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
  851. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  852. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
  853. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  854. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
  855. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  856. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
  857. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  858. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
  859. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
  860. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  861. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  862. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  863. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  864. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  865. package/dist/tsconfig.build.tsbuildinfo +1 -0
  866. package/package.json +4 -4
  867. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts +0 -0
  868. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts.map +0 -0
  869. package/dist/esm/compliance/privacy/data-retention.shared.schemas.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"price.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/price.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAE7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AASrD,MAAM,CAAC,MAAM,iDAAiD,GAAG,CAC/D,sBAA8C,EAC9C,EAAE,CAAC,0CAA0C,CAI7C;IACA,UAAU,EAAE,WAAW;IACvB,kBAAkB,EAAE,gBAAgB,CAAC,MAAM;IAC3C,uBAAuB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,MAAM,CAAC;IACpF,qBAAqB,EAAE,sBAAsB;IAC7C,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE;QACd,qBAAqB,CAAC,IAAI;QAC1B,qBAAqB,CAAC,IAAI;QAC1B,qBAAqB,CAAC,MAAM;QAC5B,qBAAqB,CAAC,MAAM;QAC5B,oEAAoE;QACpE,yEAAyE;QACzE,2DAA2D;QAC3D,oEAAoE;QACpE,qBAAqB,CAAC,MAAM;KAC7B;IACD,uBAAuB,EAAE;QACvB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE;YAC5B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBAC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EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C,CAAC;SACH;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Price Resource Configuration\n *\n * Admin-managed: APPLICATION-scoped, linked to products.\n */\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n} from '../resources/resources.shared.schemas';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { PriceSchema } from './price.shared.schemas';\n\ntype PricesCoreOps =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\nexport const pricesResourceConfiguration_InitializationFactory = (\n resourcesRelationships: ResourceRelationship[]\n) => createResourceConfiguration_Initialization<\n undefined,\n PricesCoreOps,\n typeof PriceSchema\n>({\n mainSchema: PriceSchema,\n resourceIdentifier: CoreResourceType.PRICES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.PRICES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition\n // onParentDelete cascade so price rows are physically removed when their\n // owning product is deleted. Without it the cascade throws\n // ErrorType.CONFIGURATION on any product that still has price rows.\n CoreResourceOperation.DELETE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n /*\n * The OPERATOR's door onto the catalogue — added 2026-09-18 for issue #1295.\n *\n * The `INTERNAL_CALL` variant above is route-less by design: the billing back-office drives\n * this resource through the service pipeline, and states that these catalog reads have \"NO\n * HTTP surface\". That stays true and stays the DEFAULT, so `createForInternalServiceOperation`\n * keeps resolving it and no internal seam moves.\n *\n * What was missing is the surface an application ADMINISTRATOR needs. The `billing-catalog`\n * settings destination targets `prices.list` and could never load — the rail entry, the tab and the\n * heading all rendered, and every request 404'd at the ROUTER, because no route was ever\n * mounted. An operator cannot price what they cannot see.\n *\n * Gated on `APP_ADMIN_SUPER_ADMIN`, exactly what that destination already requires. Not a\n * widening: the aggregated billing state already ships products, prices and active promotions\n * to EVERY authenticated client, so an admin-only list is strictly narrower than what the\n * application discloses today.\n *\n * Two `isDefault: true` variants is the shape `organizations.CREATE` already uses — default is\n * per variant TYPE, so the internal door and the HTTP door each stay the default of their own\n * transport and the HTTP one needs no `variantKey` in its URL.\n */\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n\n // Internal-only (REPOSITORY_ONLY, no HTTP route): powers the composition\n // onParentDelete cascade so price rows are physically removed when their owning\n // product is deleted. Without a DELETE op the cascade (deleteChildrenImmediate)\n // throws ErrorType.CONFIGURATION on any product that still has price rows.\n // ORG_OWNER/HIGH: mirrors the price write tier (billing catalog is org-owned).\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n },\n});\n"]}
1
+ {"version":3,"file":"price.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../src/billing/price.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAE7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AASrD,MAAM,CAAC,MAAM,iDAAiD,GAAG,CAC/D,sBAA8C,EAC9C,EAAE,CAAC,0CAA0C,CAI7C;IACA,UAAU,EAAE,WAAW;IACvB,kBAAkB,EAAE,gBAAgB,CAAC,MAAM;IAC3C,uBAAuB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,MAAM,CAAC;IACpF,qBAAqB,EAAE,sBAAsB;IAC7C,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE;QACd,qBAAqB,CAAC,IAAI;QAC1B,qBAAqB,CAAC,IAAI;QAC1B,qBAAqB,CAAC,MAAM;QAC5B,qBAAqB,CAAC,MAAM;QAC5B,oEAAoE;QACpE,yEAAyE;QACzE,2DAA2D;QAC3D,oEAA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AED,yEAAyE;QACzE,gFAAgF;QAChF,gFAAgF;QAChF,2EAA2E;QAC3E,+EAA+E;QAC/E,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,eAAe;oBACzD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C,CAAC;SACH;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Price Resource Configuration\n *\n * Admin-managed: APPLICATION-scoped, linked to products.\n */\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n} from '../resources/resources.shared.schemas';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { PriceSchema } from './price.shared.schemas';\n\ntype PricesCoreOps =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\nexport const pricesResourceConfiguration_InitializationFactory = (\n resourcesRelationships: ResourceRelationship[]\n) => createResourceConfiguration_Initialization<\n undefined,\n PricesCoreOps,\n typeof PriceSchema\n>({\n mainSchema: PriceSchema,\n resourceIdentifier: CoreResourceType.PRICES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.PRICES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition\n // onParentDelete cascade so price rows are physically removed when their\n // owning product is deleted. Without it the cascade throws\n // ErrorType.CONFIGURATION on any product that still has price rows.\n CoreResourceOperation.DELETE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n /*\n * The OPERATOR's door onto the catalogue — added 2026-09-18 for issue #1295.\n *\n * The `INTERNAL_CALL` variant above is route-less by design: the billing back-office drives\n * this resource through the service pipeline, and states that these catalog reads have \"NO\n * HTTP surface\". That stays true and stays the DEFAULT, so `createForInternalServiceOperation`\n * keeps resolving it and no internal seam moves.\n *\n * What was missing is the surface an application ADMINISTRATOR needs. The `billing-catalog`\n * settings destination targets `prices.list` and could never load — the rail entry, the tab and the\n * heading all rendered, and every request 404'd at the ROUTER, because no route was ever\n * mounted. An operator cannot price what they cannot see.\n *\n * Gated on `APP_ADMIN_SUPER_ADMIN`, exactly what that destination already requires. Not a\n * widening: the aggregated billing state already ships products, prices and active promotions\n * to EVERY authenticated client, so an admin-only list is strictly narrower than what the\n * application discloses today.\n *\n * Two `isDefault: true` variants is the shape `organizations.CREATE` already uses — default is\n * per variant TYPE, so the internal door and the HTTP door each stay the default of their own\n * transport and the HTTP one needs no `variantKey` in its URL.\n */\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n\n // Internal-only (REPOSITORY_ONLY, no HTTP route): powers the composition\n // onParentDelete cascade so price rows are physically removed when their owning\n // product is deleted. Without a DELETE op the cascade (deleteChildrenImmediate)\n // throws ErrorType.CONFIGURATION on any product that still has price rows.\n // ORG_OWNER/HIGH: mirrors the price write tier (billing catalog is org-owned).\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"price.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/price.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,cAAc,EACf,MAAM,gCAAgC,CAAC;AAIxC;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;;;iBAS1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;iBAkDtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"price.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/price.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK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,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE;IACtD,4EAA4E;IAC5E,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACpC,mDAAmD;IACnD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE;IAEjD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC","sourcesContent":["/**\n * Price & Price Tier Schemas (Shared)\n *\n * Prices define how much a product costs. A product can have multiple prices\n * (e.g., monthly vs. yearly, different currencies).\n *\n * Prices are APPLICATION-scoped, linked to a Product via productId.\n * Like products, they are populated lazily from the code-defined catalog.\n *\n * @see billing-and-features-system.md §6.2 (Product & Price Catalog)\n */\n\nimport { z } from 'zod';\nimport { z_money, CurrencyAllowed } from '@wildo-ai/zod-decorators';\nimport {\n PricingModel,\n BillingInterval,\n UsageAggregationType,\n TaxDisplayMode,\n} from './billing-enums.shared.schemas';\n\n// ── Price Tier ─────────────────────────────────────────────────────\n\n/**\n * A single tier in a tiered/graduated pricing model.\n * `upTo: null` means \"infinity\" (the final open-ended tier).\n *\n * Tier amounts carry their own currency via z_money for:\n * - Self-describing data (no implicit dependency on parent Price's currency)\n * - Proper money input rendering in forms\n * - Bigint precision for all monetary values\n */\nexport const PriceTierSchema = z.object({\n /** Upper bound for this tier (null = infinity, i.e. the last tier) */\n upTo: z.number().nullable().describe(\"The highest quantity this tier covers, inclusive. `null` for the last tier, which has no upper bound.\"),\n /** Per-unit price for this tier */\n unitPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n })\n .describe('The price of each unit this tier covers.'),\n /** Flat price added to this tier (on top of unit pricing) */\n flatPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n })\n .describe('A fixed amount charged once when the quantity reaches this tier, added to its unit prices. Zero when the tier has no fixed charge.'),\n});\nexport type PriceTier = z.infer<typeof PriceTierSchema>;\n\n// ── Price ──────────────────────────────────────────────────────────\n\nexport const PriceSchema = z.object({\n\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n /** Reference to the parent product */\n productId: z.string().min(1).isForeignKey().isDBIndexed(),\n\n /** Pricing model (flat, per_unit, tiered, graduated, package) */\n model: z.enum(PricingModel).isSummaryField().systemEnum('PricingModel'),\n /**\n * Unit price for FLAT/PER_UNIT models.\n * Uses z_money for bigint precision, self-contained currency, and proper form rendering.\n * Undefined for TIERED/GRADUATED models (use `tiers` instead).\n */\n unitPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n }).isSummaryField(),\n\n /** Billing interval (undefined for one-time prices) */\n interval: z.enum(BillingInterval).optional().isSummaryField(),\n /** Interval count (e.g., 3 for quarterly = interval:'month', intervalCount:3) */\n intervalCount: z.number().min(1).default(1),\n\n /** Tiers for TIERED/GRADUATED pricing models */\n tiers: z.array(PriceTierSchema).optional(),\n /** Package size for PACKAGE pricing model (price per N units) */\n packageSize: z.number().min(1).optional(),\n /** Usage aggregation type for metered prices */\n usageAggregation: z.enum(UsageAggregationType).optional(),\n\n /**\n * Tax behavior for this price (maps to Stripe's price.tax_behavior).\n *\n * There is NO resolution chain: this value alone reaches the provider. The catalog sync passes\n * `taxBehavior` straight through on both the price upsert and the provider price creation, so\n * leaving it unset does not fall back to `product.taxDisplayMode` or to\n * `BillingConfiguration.tax.defaultDisplayMode`. The provider call simply omits `tax_behavior`\n * and the billing account's own default decides. Declare it here on every price whose tax\n * presentation matters.\n * - 'exclusive': amount is HT, tax added on top\n * - 'inclusive': amount is TTC, tax embedded\n * When absent: inherits from product, then from global config.\n */\n taxBehavior: z.enum(TaxDisplayMode).optional(),\n\n /** Provider sync (lazy: populated on first use, not at startup) */\n providerPriceId: z.string().optional().isBackendOnly(),\n /** Whether this is the default price for the product (shown first in UI) */\n isDefault: z.boolean().default(true),\n /** Whether this price is available for purchase */\n isActive: z.boolean().default(true).isDBIndexed(),\n\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type Price = z.infer<typeof PriceSchema>;\n"]}
1
+ {"version":3,"file":"price.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/price.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,gCAAgC,CAAC;AAExC,sEAAsE;AAEtE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,sEAAsE;IACtE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uGAAuG,CAAC;IAC7I,mCAAmC;IACnC,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;SAC7E,QAAQ,CAAC,0CAA0C,CAAC;IACvD,6DAA6D;IAC7D,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;SAC7E,QAAQ,CAAC,oIAAoI,CAAC;CAClJ,CAAC,CAAC;AAGH,sEAAsE;AAEtE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAElC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC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AAmD;IACnD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE;IAEjD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC","sourcesContent":["/**\n * Price & Price Tier Schemas (Shared)\n *\n * Prices define how much a product costs. A product can have multiple prices\n * (e.g., monthly vs. yearly, different currencies).\n *\n * Prices are APPLICATION-scoped, linked to a Product via productId.\n * Like products, they are populated lazily from the code-defined catalog.\n *\n * @see billing-and-features-system.md §6.2 (Product & Price Catalog)\n */\n\nimport { z } from 'zod';\nimport { z_money, CurrencyAllowed } from '@wildo-ai/zod-decorators';\nimport {\n PricingModel,\n BillingInterval,\n UsageAggregationType,\n TaxDisplayMode,\n} from './billing-enums.shared.schemas';\n\n// ── Price Tier ─────────────────────────────────────────────────────\n\n/**\n * A single tier in a tiered/graduated pricing model.\n * `upTo: null` means \"infinity\" (the final open-ended tier).\n *\n * Tier amounts carry their own currency via z_money for:\n * - Self-describing data (no implicit dependency on parent Price's currency)\n * - Proper money input rendering in forms\n * - Bigint precision for all monetary values\n */\nexport const PriceTierSchema = z.object({\n /** Upper bound for this tier (null = infinity, i.e. the last tier) */\n upTo: z.number().nullable().describe(\"The highest quantity this tier covers, inclusive. `null` for the last tier, which has no upper bound.\"),\n /** Per-unit price for this tier */\n unitPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n })\n .describe('The price of each unit this tier covers.'),\n /** Flat price added to this tier (on top of unit pricing) */\n flatPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n })\n .describe('A fixed amount charged once when the quantity reaches this tier, added to its unit prices. Zero when the tier has no fixed charge.'),\n});\nexport type PriceTier = z.infer<typeof PriceTierSchema>;\n\n// ── Price ──────────────────────────────────────────────────────────\n\nexport const PriceSchema = z.object({\n\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n /** Reference to the parent product */\n productId: z.string().min(1).isForeignKey().isDBIndexed(),\n\n /** Pricing model (flat, per_unit, tiered, graduated, package) */\n model: z.enum(PricingModel).isSummaryField().systemEnum('PricingModel'),\n /**\n * Unit price for FLAT/PER_UNIT models.\n * Uses z_money for bigint precision, self-contained currency, and proper form rendering.\n * Undefined for TIERED/GRADUATED models (use `tiers` instead).\n */\n unitPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n }).isSummaryField(),\n\n /** Billing interval (undefined for one-time prices) */\n interval: z.enum(BillingInterval).optional().isSummaryField(),\n /** Interval count (e.g., 3 for quarterly = interval:'month', intervalCount:3) */\n intervalCount: z.number().min(1).default(1),\n\n /** Tiers for TIERED/GRADUATED pricing models */\n tiers: z.array(PriceTierSchema).optional(),\n /** Package size for PACKAGE pricing model (price per N units) */\n packageSize: z.number().min(1).optional(),\n /** Usage aggregation type for metered prices */\n usageAggregation: z.enum(UsageAggregationType).optional(),\n\n /**\n * Tax behavior for this price (maps to Stripe's price.tax_behavior).\n *\n * There is NO resolution chain: this value alone reaches the provider. The catalog sync passes\n * `taxBehavior` straight through on both the price upsert and the provider price creation, so\n * leaving it unset does not fall back to `product.taxDisplayMode` or to\n * `BillingConfiguration.tax.defaultDisplayMode`. The provider call simply omits `tax_behavior`\n * and the billing account's own default decides. Declare it here on every price whose tax\n * presentation matters.\n * - 'exclusive': amount is HT, tax added on top\n * - 'inclusive': amount is TTC, tax embedded\n * When absent: inherits from product, then from global config.\n */\n taxBehavior: z.enum(TaxDisplayMode).optional(),\n\n /** Provider sync (lazy: populated on first use, not at startup) */\n providerPriceId: z.string().optional().isBackendOnly(),\n /** Whether this is the default price for the product (shown first in UI) */\n isDefault: z.boolean().default(true),\n /** Whether this price is available for purchase */\n isActive: z.boolean().default(true).isDBIndexed(),\n\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type Price = z.infer<typeof PriceSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"product-behavior-policy.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/product-behavior-policy.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,0BAA0B,CAAC;AAElC,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AAIxC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB;;;iBAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+GtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF;;;;;;;GAOG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
1
+ {"version":3,"file":"product-behavior-policy.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/product-behavior-policy.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,0BAA0B,CAAC;AAElC,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AAIxC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB;;;iBAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+GtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF;;;;;;;GAOG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"product-behavior-policy.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/product-behavior-policy.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AAExC,sEAAsE;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,2DAA2D;IAC3D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;IACpH,0CAA0C;IAC1C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,iRAAiR,CAAC;CACrV,CAAC,CAAC;AAGH,sEAAsE;AAEtE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,mFAAmF;IACnF,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,0CAA0C;QAC1C,IAAI,EAAE,CAAC,CAA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AC,CAAC,QAAQ,CAAC,+DAA+D,CAAC;SACnH,CAAC,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,+DAA+D,CAAC;KAC9H,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wEAAwE,CAAC;CACjG,CAAC,CAAC","sourcesContent":["/**\n * Product Behavior Policy & Limit Grant Schemas (Shared)\n *\n * Declarative configuration for how the billing provider and the engine\n * should handle product lifecycle (trial, proration, cancellation, metering).\n *\n * Also defines the LimitGrant schema that controls how product limits compose.\n *\n * @see billing-and-features-system.md §6.1 (LimitGrant), §6.1 (ProductBehaviorPolicy)\n */\n\nimport { z } from 'zod';\nimport '@wildo-ai/zod-decorators';\nimport { FEATURES_UNLIMITED } from '../features/scope-features.shared.schemas';\nimport {\n LimitGrantMode,\n ProrationBehavior,\n BillingTiming,\n MeteringAggregationWindow,\n} from './billing-enums.shared.schemas';\n\n// ── Limit Grant ────────────────────────────────────────────────────\n\n/**\n * A limit grant from a product.\n *\n * - SET mode: absolute value (replaces, used for PLAN base limits).\n * Example: \"Professional plan gives you 50 projects.\"\n * - ADD mode: additive (stacks on top, used for ADDON bonus limits).\n * Example: \"+10 extra projects.\"\n *\n * Aggregation algorithm in BillingFeatureSyncBackendService:\n * 1. Start with active PLAN's SET limits (only one active plan per billing account)\n * 2. For each active ADDON with ADD mode: sum onto current limit\n * 3. For each active ADDON with SET mode: take max(current, addon value)\n * 4. FEATURES_UNLIMITED always wins in any comparison\n */\nexport const LimitGrantSchema = z.object({\n /** The limit value (count or -1 for FEATURES_UNLIMITED) */\n value: z.number().numberUI({ unlimitedAt: FEATURES_UNLIMITED }).describe(\"The limit granted. `-1` means unlimited.\"),\n /** How this grant composes with others */\n mode: z.enum(LimitGrantMode).default(LimitGrantMode.SET).describe(\"How the grant of a product other than the plan combines with the limit already granted: `add` adds its value, `set` keeps whichever value is more generous (or, for a limit that caps usage, more restrictive). A plan's grant is always the starting value. Defaults to `set`.\"),\n});\nexport type LimitGrant = z.infer<typeof LimitGrantSchema>;\n\n// ── Product Behavior Policy ────────────────────────────────────────\n\n/**\n * Declarative configuration for how the billing provider and the engine\n * should handle this product's lifecycle.\n *\n * This is the \"billing policy\" layer — NOT reimplementing provider logic,\n * but CONFIGURING the parameters that get passed to the provider's API.\n */\nexport const ProductBehaviorPolicySchema = z.object({\n /** Trial configuration (overrides global BillingConfiguration.defaultTrialDays) */\n trial: z.object({\n /** Number of trial days (0 = no trial) */\n days: z.number().min(0).default(0).describe(\"Length of the free trial in days. `0` means no trial.\"),\n /**\n * Require a payment method before the trial starts. READ since 2026-09-08 (#408).\n *\n * It reached no provider call before that, so a trial declared as requiring a card behaved\n * identically to one that did not — Wonder Todos' enterprise plan (`true`) and professional\n * plan (`false`) were indistinguishable at the provider.\n *\n * Only meaningful WITH a trial: a product declaring it alongside `days: 0` demands nothing,\n * because asking for a card up front on a purchase with no trial is a different decision and\n * nobody authored it.\n */\n requirePaymentMethod: z.boolean().default(false).describe(\"Whether checkout collects a payment method before the trial starts. Applies only when checkout starts a trial.\"),\n }).optional().describe(\"The free trial a subscription checkout for this product starts. When absent, the application's default trial length applies.\"),\n\n /** Upgrade behavior (when switching TO this plan from a lower tier) */\n upgrade: z.object({\n /** Proration passed to provider: create_prorations, none, always_invoice */\n proration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS).describe(\"How the billing provider charges for the unused part of the current period when the plan changes. Defaults to `create_prorations`.\"),\n /**\n * When the change takes effect (#1868). `immediate` applies it on confirmation and settles the unused part of the\n * period by `proration`; `at_period_end` leaves the subscription unchanged until renewal, carries the change as the\n * subscription's `pendingPlanChange`, and applies it then through a provider subscription schedule.\n *\n * History: `timing` was declared once before, never enforced, and removed by #1798 so the catalogue stopped promising\n * it. It returned with the mechanism behind it.\n */\n timing: z.enum(BillingTiming).default(BillingTiming.IMMEDIATE).describe(\"When a plan change onto this plan takes effect: `immediate` (on confirmation, prorated by `proration`) or `at_period_end` (at renewal; the subscription carries the change as pending until then). Defaults to `immediate`.\"),\n }).optional().describe(\"How a plan change onto this plan from a lower tier, or from no plan, is billed. When absent, the application's default proration applies and the change takes effect immediately.\"),\n\n /**\n * Downgrade behavior (when switching TO this plan from a higher or equal tier). The plan change reads\n * the NEW plan's policy for both directions, so this block governs moves onto this product, not away from it.\n */\n downgrade: z.object({\n proration: z.enum(ProrationBehavior).default(ProrationBehavior.NONE).describe(\"How the billing provider charges for the unused part of the current period when the change applies immediately. Defaults to `none`, which gives no credit for the unused part of the higher plan.\"),\n /**\n * When the change takes effect (#1868). Defaults to `at_period_end`: the customer keeps the plan they paid for until\n * renewal, which is how an immediate downgrade under `proration: none` stops forfeiting the unused part of the period.\n */\n timing: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END).describe(\"When a plan change onto this plan takes effect: `at_period_end` (the default: the subscription keeps its current plan until renewal and carries the change as pending until then) or `immediate` (on confirmation, prorated by `proration`).\"),\n }).optional().describe(\"How a plan change onto this plan from a higher or equal tier is billed. When absent, it takes effect at the end of the current period.\"),\n\n /** Cancellation behavior for subscriptions on this product */\n cancellation: z.object({\n /** Allow immediate cancellation (vs only at period end) */\n allowImmediate: z.boolean().default(false).describe(\"Whether a subscription on this plan may be cancelled immediately. When `false`, an immediate cancellation is refused and only cancellation at period end is accepted.\"),\n /** Default cancellation timing when user cancels */\n defaultBehavior: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END).describe(\"When a cancellation takes effect if the request does not say: `immediate` or `at_period_end`. Defaults to `at_period_end`, and cannot be `immediate` when `allowImmediate` is `false`.\"),\n }).refine(\n (policy) => policy.allowImmediate || policy.defaultBehavior !== BillingTiming.IMMEDIATE,\n { message: 'Immediate cancellation cannot be the default when immediate cancellation is forbidden.', path: ['defaultBehavior'] },\n ).optional().describe(\"How subscriptions whose plan is this product may be cancelled.\"),\n\n /**\n * Authored metering policy (for METERED products only), READ by\n * `UsageMeteringBackendService` since 2026-09-08 (#415).\n *\n * Every field here was declared, defaulted, documented and read by NOTHING until then: the flush\n * merged every pending row by billing account and product whatever the product said, so\n * `preFlushAggregation: false` was unrepresentable and `aggregationWindow`'s two members selected\n * between behaviours that were the same behaviour. The note that stood here said exactly that and\n * asked that the gap stay visible rather than become \"a false runtime guarantee\"; this replaces it\n * because the guarantee is now real, and says which reader makes each field true.\n */\n metering: z.object({\n /**\n * How often to flush aggregated usage to the billing provider (minutes).\n *\n * Read by the engine's usage-flush batch, which picks the SHORTEST interval any metered product\n * authors — a schedule is one thing and the products sharing it are many, so the fastest promise\n * is the one that has to be kept. A product asking for less frequent reporting than its neighbour\n * still gets reported at the neighbour's cadence, which costs nothing: reporting sooner than\n * authored is never wrong, reporting later than authored is.\n */\n flushIntervalMinutes: z.number().min(1).default(60).describe(\"How long, in minutes, recorded usage may wait before it is reported to the billing provider. Defaults to 60.\"),\n /**\n * Whether one meter event may span a billing-period boundary.\n *\n * This is not a preference, it is a correctness choice about MONEY. A merged group carries ONE\n * timestamp and the provider assigns the event to the period that timestamp falls in, so\n * `PER_FLUSH` merging across a boundary bills the earlier period's usage into the later one.\n * `PER_BILLING_PERIOD` splits at the boundary, derived from the subscription's own\n * `currentPeriodStart` / `currentPeriodEnd`. Leave it `PER_FLUSH` when the product's periods do\n * not change what it costs.\n */\n aggregationWindow: z.enum(MeteringAggregationWindow).default(MeteringAggregationWindow.PER_FLUSH).describe(\"How far merged usage may reach: `per_flush` merges everything waiting to be reported, `per_billing_period` never merges usage across a billing-period boundary, so each period is billed for its own usage. Defaults to `per_flush`.\"),\n /**\n * Aggregate locally before sending (sum same-key records into one meter event).\n *\n * `false` sends one event per recorded row, each with its own instant. Choose it when the provider\n * must see every event — because its aggregation is not a sum, or because the individual instants\n * matter. Local merging destroys both irreversibly, before the provider ever sees them.\n */\n preFlushAggregation: z.boolean().default(true).describe(\"Whether usage records are summed into one event before being reported. `false` reports each record on its own, with its own time. Defaults to `true`.\"),\n /**\n * Retry policy when a provider report fails.\n *\n * Safe only because every meter event carries a derived idempotency identifier: a retry after a\n * response lost in transit re-sends the same identifier and the provider discards it. Retrying\n * without that is how a timeout becomes a double charge, which is why the two shipped together.\n */\n retryPolicy: z.object({\n maxRetries: z.number().default(3).describe(\"How many times a failed usage report is retried before it is left for the next run. Defaults to 3.\"),\n backoffMultiplier: z.number().default(2).describe(\"The factor each wait between retries grows by. Defaults to 2.\"),\n }).default({ maxRetries: 3, backoffMultiplier: 2 }).describe(\"How a failed usage report to the billing provider is retried.\"),\n }).optional().describe(\"How usage of this metered product is reported to the billing provider.\"),\n});\nexport type ProductBehaviorPolicy = z.infer<typeof ProductBehaviorPolicySchema>;\n/**\n * The policy as an application AUTHORS it in a `ProductDefinition`: every field that carries a default may be omitted.\n *\n * A `ProductDefinition` is hand-written and never parsed (see the note on `ProductDefinitionSchema.isPublic`), so typing\n * its policy by the schema's OUTPUT would require an author to restate every default — `upgrade.timing` included — and\n * make each \"Defaults to …\" above untrue for the one surface authors write. The defaults materialize when the catalog\n * sync parses the policy onto the persisted `Product`, which is typed `ProductBehaviorPolicy`.\n */\nexport type ProductBehaviorPolicyInput = z.input<typeof ProductBehaviorPolicySchema>;\n"]}
1
+ {"version":3,"file":"product-behavior-policy.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/product-behavior-policy.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AAExC,sEAAsE;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,2DAA2D;IAC3D,KAAK,EAAE,CAA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,IAAI,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,sOAAsO,CAAC;QAClV;;;;;;WAMG;QACH,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,uJAAuJ,CAAC;QAChN;;;;;;WAMG;QACH,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oGAAoG,CAAC;YAChJ,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,+DAA+D,CAAC;SACnH,CAAC,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,+DAA+D,CAAC;KAC9H,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wEAAwE,CAAC;CACjG,CAAC,CAAC","sourcesContent":["/**\n * Product Behavior Policy & Limit Grant Schemas (Shared)\n *\n * Declarative configuration for how the billing provider and the engine\n * should handle product lifecycle (trial, proration, cancellation, metering).\n *\n * Also defines the LimitGrant schema that controls how product limits compose.\n *\n * @see billing-and-features-system.md §6.1 (LimitGrant), §6.1 (ProductBehaviorPolicy)\n */\n\nimport { z } from 'zod';\nimport '@wildo-ai/zod-decorators';\nimport { FEATURES_UNLIMITED } from '../features/scope-features.shared.schemas';\nimport {\n LimitGrantMode,\n ProrationBehavior,\n BillingTiming,\n MeteringAggregationWindow,\n} from './billing-enums.shared.schemas';\n\n// ── Limit Grant ────────────────────────────────────────────────────\n\n/**\n * A limit grant from a product.\n *\n * - SET mode: absolute value (replaces, used for PLAN base limits).\n * Example: \"Professional plan gives you 50 projects.\"\n * - ADD mode: additive (stacks on top, used for ADDON bonus limits).\n * Example: \"+10 extra projects.\"\n *\n * Aggregation algorithm in BillingFeatureSyncBackendService:\n * 1. Start with active PLAN's SET limits (only one active plan per billing account)\n * 2. For each active ADDON with ADD mode: sum onto current limit\n * 3. For each active ADDON with SET mode: take max(current, addon value)\n * 4. FEATURES_UNLIMITED always wins in any comparison\n */\nexport const LimitGrantSchema = z.object({\n /** The limit value (count or -1 for FEATURES_UNLIMITED) */\n value: z.number().numberUI({ unlimitedAt: FEATURES_UNLIMITED }).describe(\"The limit granted. `-1` means unlimited.\"),\n /** How this grant composes with others */\n mode: z.enum(LimitGrantMode).default(LimitGrantMode.SET).describe(\"How the grant of a product other than the plan combines with the limit already granted: `add` adds its value, `set` keeps whichever value is more generous (or, for a limit that caps usage, more restrictive). A plan's grant is always the starting value. Defaults to `set`.\"),\n});\nexport type LimitGrant = z.infer<typeof LimitGrantSchema>;\n\n// ── Product Behavior Policy ────────────────────────────────────────\n\n/**\n * Declarative configuration for how the billing provider and the engine\n * should handle this product's lifecycle.\n *\n * This is the \"billing policy\" layer — NOT reimplementing provider logic,\n * but CONFIGURING the parameters that get passed to the provider's API.\n */\nexport const ProductBehaviorPolicySchema = z.object({\n /** Trial configuration (overrides global BillingConfiguration.defaultTrialDays) */\n trial: z.object({\n /** Number of trial days (0 = no trial) */\n days: z.number().min(0).default(0).describe(\"Length of the free trial in days. `0` means no trial.\"),\n /**\n * Require a payment method before the trial starts. READ since 2026-09-08 (#408).\n *\n * It reached no provider call before that, so a trial declared as requiring a card behaved\n * identically to one that did not — Wonder Todos' enterprise plan (`true`) and professional\n * plan (`false`) were indistinguishable at the provider.\n *\n * Only meaningful WITH a trial: a product declaring it alongside `days: 0` demands nothing,\n * because asking for a card up front on a purchase with no trial is a different decision and\n * nobody authored it.\n */\n requirePaymentMethod: z.boolean().default(false).describe(\"Whether checkout collects a payment method before the trial starts. Applies only when checkout starts a trial.\"),\n }).optional().describe(\"The free trial a subscription checkout for this product starts. When absent, the application's default trial length applies.\"),\n\n /** Upgrade behavior (when switching TO this plan from a lower tier) */\n upgrade: z.object({\n /** Proration passed to provider: create_prorations, none, always_invoice */\n proration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS).describe(\"How the billing provider charges for the unused part of the current period when the plan changes. Defaults to `create_prorations`.\"),\n /**\n * When the change takes effect (#1868). `immediate` applies it on confirmation and settles the unused part of the\n * period by `proration`; `at_period_end` leaves the subscription unchanged until renewal, carries the change as the\n * subscription's `pendingPlanChange`, and applies it then through a provider subscription schedule.\n *\n * History: `timing` was declared once before, never enforced, and removed by #1798 so the catalogue stopped promising\n * it. It returned with the mechanism behind it.\n */\n timing: z.enum(BillingTiming).default(BillingTiming.IMMEDIATE).describe(\"When a plan change onto this plan takes effect: `immediate` (on confirmation, prorated by `proration`) or `at_period_end` (at renewal; the subscription carries the change as pending until then). Defaults to `immediate`.\"),\n }).optional().describe(\"How a plan change onto this plan from a lower tier, or from no plan, is billed. When absent, the application's default proration applies and the change takes effect immediately.\"),\n\n /**\n * Downgrade behavior (when switching TO this plan from a higher or equal tier). The plan change reads\n * the NEW plan's policy for both directions, so this block governs moves onto this product, not away from it.\n */\n downgrade: z.object({\n proration: z.enum(ProrationBehavior).default(ProrationBehavior.NONE).describe(\"How the billing provider charges for the unused part of the current period when the change applies immediately. Defaults to `none`, which gives no credit for the unused part of the higher plan.\"),\n /**\n * When the change takes effect (#1868). Defaults to `at_period_end`: the customer keeps the plan they paid for until\n * renewal, which is how an immediate downgrade under `proration: none` stops forfeiting the unused part of the period.\n */\n timing: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END).describe(\"When a plan change onto this plan takes effect: `at_period_end` (the default: the subscription keeps its current plan until renewal and carries the change as pending until then) or `immediate` (on confirmation, prorated by `proration`).\"),\n }).optional().describe(\"How a plan change onto this plan from a higher or equal tier is billed. When absent, it takes effect at the end of the current period.\"),\n\n /** Cancellation behavior for subscriptions on this product */\n cancellation: z.object({\n /** Allow immediate cancellation (vs only at period end) */\n allowImmediate: z.boolean().default(false).describe(\"Whether a subscription on this plan may be cancelled immediately. When `false`, an immediate cancellation is refused and only cancellation at period end is accepted.\"),\n /** Default cancellation timing when user cancels */\n defaultBehavior: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END).describe(\"When a cancellation takes effect if the request does not say: `immediate` or `at_period_end`. Defaults to `at_period_end`, and cannot be `immediate` when `allowImmediate` is `false`.\"),\n }).refine(\n (policy) => policy.allowImmediate || policy.defaultBehavior !== BillingTiming.IMMEDIATE,\n { message: 'Immediate cancellation cannot be the default when immediate cancellation is forbidden.', path: ['defaultBehavior'] },\n ).optional().describe(\"How subscriptions whose plan is this product may be cancelled.\"),\n\n /**\n * Authored metering policy (for METERED products only), READ by\n * `UsageMeteringBackendService` since 2026-09-08 (#415).\n *\n * Every field here was declared, defaulted, documented and read by NOTHING until then: the flush\n * merged every pending row by billing account and product whatever the product said, so\n * `preFlushAggregation: false` was unrepresentable and `aggregationWindow`'s two members selected\n * between behaviours that were the same behaviour. The note that stood here said exactly that and\n * asked that the gap stay visible rather than become \"a false runtime guarantee\"; this replaces it\n * because the guarantee is now real, and says which reader makes each field true.\n */\n metering: z.object({\n /**\n * How often to flush aggregated usage to the billing provider (minutes).\n *\n * Read by the engine's usage-flush batch, which picks the SHORTEST interval any metered product\n * authors — a schedule is one thing and the products sharing it are many, so the fastest promise\n * is the one that has to be kept. A product asking for less frequent reporting than its neighbour\n * still gets reported at the neighbour's cadence, which costs nothing: reporting sooner than\n * authored is never wrong, reporting later than authored is.\n */\n flushIntervalMinutes: z.number().min(1).default(60).describe(\"How long, in minutes, recorded usage may wait before it is reported to the billing provider. Defaults to 60.\"),\n /**\n * Whether one meter event may span a billing-period boundary.\n *\n * This is not a preference, it is a correctness choice about MONEY. A merged group carries ONE\n * timestamp and the provider assigns the event to the period that timestamp falls in, so\n * `PER_FLUSH` merging across a boundary bills the earlier period's usage into the later one.\n * `PER_BILLING_PERIOD` splits at the boundary, derived from the subscription's own\n * `currentPeriodStart` / `currentPeriodEnd`. Leave it `PER_FLUSH` when the product's periods do\n * not change what it costs.\n */\n aggregationWindow: z.enum(MeteringAggregationWindow).default(MeteringAggregationWindow.PER_FLUSH).describe(\"How far merged usage may reach: `per_flush` merges everything waiting to be reported, `per_billing_period` never merges usage across a billing-period boundary, so each period is billed for its own usage. Defaults to `per_flush`.\"),\n /**\n * Aggregate locally before sending (sum same-key records into one meter event).\n *\n * `false` sends one event per recorded row, each with its own instant. Choose it when the provider\n * must see every event — because its aggregation is not a sum, or because the individual instants\n * matter. Local merging destroys both irreversibly, before the provider ever sees them.\n */\n preFlushAggregation: z.boolean().default(true).describe(\"Whether usage records are summed into one event before being reported. `false` reports each record on its own, with its own time. Defaults to `true`.\"),\n /**\n * Retry policy when a provider report fails.\n *\n * Safe only because every meter event carries a derived idempotency identifier: a retry after a\n * response lost in transit re-sends the same identifier and the provider discards it. Retrying\n * without that is how a timeout becomes a double charge, which is why the two shipped together.\n */\n retryPolicy: z.object({\n maxRetries: z.number().default(3).describe(\"How many times a failed usage report is retried before it is left for the next run. Defaults to 3.\"),\n backoffMultiplier: z.number().default(2).describe(\"The factor each wait between retries grows by. Defaults to 2.\"),\n }).default({ maxRetries: 3, backoffMultiplier: 2 }).describe(\"How a failed usage report to the billing provider is retried.\"),\n }).optional().describe(\"How usage of this metered product is reported to the billing provider.\"),\n});\nexport type ProductBehaviorPolicy = z.infer<typeof ProductBehaviorPolicySchema>;\n/**\n * The policy as an application AUTHORS it in a `ProductDefinition`: every field that carries a default may be omitted.\n *\n * A `ProductDefinition` is hand-written and never parsed (see the note on `ProductDefinitionSchema.isPublic`), so typing\n * its policy by the schema's OUTPUT would require an author to restate every default — `upgrade.timing` included — and\n * make each \"Defaults to …\" above untrue for the one surface authors write. The defaults materialize when the catalog\n * sync parses the policy onto the persisted `Product`, which is typed `ProductBehaviorPolicy`.\n */\nexport type ProductBehaviorPolicyInput = z.input<typeof ProductBehaviorPolicySchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"product-definition.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/product-definition.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACpG,OAAO,EAAiD,KAAK,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAK1I;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;iBAuBhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAIpE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+FlC,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,EAAE,gBAAgB,CAAC;IACxG,cAAc,CAAC,EAAE,0BAA0B,CAAC;CAC7C;AAED,kFAAkF;AAClF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,sBAAsB,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;CAC5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,iBAAiB,GAAG,cAAc,CAAC,GAAG,0BAA0B,CAMvK"}
1
+ {"version":3,"file":"product-definition.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/product-definition.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACpG,OAAO,EAAiD,KAAK,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAK1I;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;iBAuBhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAIpE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+FlC,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,EAAE,gBAAgB,CAAC;IACxG,cAAc,CAAC,EAAE,0BAA0B,CAAC;CAC7C;AAED,kFAAkF;AAClF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,sBAAsB,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;CAC5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,iBAAiB,GAAG,cAAc,CAAC,GAAG,0BAA0B,CAMvK"}
@@ -1 +1 @@
1
- {"version":3,"file":"product-definition.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/product-definition.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAmC,MAAM,0CAA0C,CAAC;AAC1I,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,sEAAsE;AAEtE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,iEAAiE;IACjE,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;IAC3B;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAChF,8CAA8C;IAC9C,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAC5C,iFAAiF;IACjF,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,gDAAgD;IAChD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAC1C,6CAA6C;IAC7C,WAAW,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,UAAyF;IACzI,OAAO;QACL,aAAa,EAAE,UAAU,CAAC,aAAa,IAAI,KAAK;QAChD,eAAe,EAAE,UAAU,CAAC,eAAe,IAAI,sBAAsB,CAAC,MAAM;QAC5E,YAAY,EAAE,UAAU,CAAC,YAAY,IAAI,mBAAmB,CAAC,SAAS;KACvE,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Product Definition Schema (Shared)\n *\n * The bridge between what developers write in the product catalog config\n * and the DB-level Product + Price schemas.\n *\n * Unlike ProductSchema (the DB record), ProductDefinition:\n * - Has prices INLINE (not separate records)\n * - Has no _id, providerProductId, or DB timestamps\n * - Uses `key` as the unique identifier (maps to Product.key in DB)\n *\n * ProductCatalogSyncBackendService.ensureProductSynced(key):\n * 1. Look up ProductDefinition from catalog config by key\n * 2. Upsert Product DB record (key → _id mapping)\n * 3. Upsert Price DB records for each inline price\n * 4. On first provider use: sync to billing provider (fill providerProductId/providerPriceId)\n *\n * @see billing-and-features-system.md §6.2b (Product Definition)\n */\n\nimport { z } from 'zod';\nimport { z_money, CurrencyAllowed } from '@wildo-ai/zod-decorators';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n ProductType,\n PricingModel,\n BillingInterval,\n UsageAggregationType,\n TaxDisplayMode,\n} from './billing-enums.shared.schemas';\nimport { ProductPriceDisclosure, ProductAvailability } from './public-pricing-catalog.shared.atoms';\nimport { LimitGrantSchema, ProductBehaviorPolicySchema, type ProductBehaviorPolicyInput } from './product-behavior-policy.shared.schemas';\nimport { PriceTierSchema } from './price.shared.schemas';\n\n// ── Price Definition (inline in product config) ────────────────────\n\n/**\n * Inline price definition for product catalog configuration.\n * Maps to a separate Price DB record when synced.\n */\nexport const PriceDefinitionSchema = z.object({\n /** Pricing model (flat, per_unit, tiered, graduated, package) */\n model: z.enum(PricingModel),\n /**\n * Unit price for FLAT/PER_UNIT models.\n * Uses z_money for consistent monetary representation across the billing system.\n * Undefined for TIERED/GRADUATED models (use `tiers` instead).\n */\n unitPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n }),\n /** Billing interval (undefined = one-time) */\n interval: z.enum(BillingInterval).optional(),\n /** Interval count (e.g., 3 for quarterly = interval:'month', intervalCount:3) */\n intervalCount: z.number().min(1).default(1),\n /** Tiers for TIERED/GRADUATED pricing models */\n tiers: z.array(PriceTierSchema).optional(),\n /** Package size for PACKAGE pricing model */\n packageSize: z.number().min(1).optional(),\n /** Usage aggregation for metered prices */\n usageAggregation: z.enum(UsageAggregationType).optional(),\n /** Per-price tax behavior override */\n taxBehavior: z.enum(TaxDisplayMode).optional(),\n /** Whether this is the default price */\n isDefault: z.boolean().default(true),\n});\n\nexport type PriceDefinition = z.infer<typeof PriceDefinitionSchema>;\n\n// ── Product Definition (what developers write) ─────────────────────\n\n/**\n * ProductDefinition: what custom app developers write in their product catalog config.\n * This is the declarative product definition that lives in shared-lib code.\n */\nexport const ProductDefinitionSchema = z.object({\n /** Unique product key (matches Product.key in DB) */\n key: z.string().min(1),\n type: z.enum(ProductType),\n\n /** Which scopes can subscribe/purchase this product */\n targetScopes: z.array(z.enum(ResourcePrimaryScope)).min(1),\n\n /**\n * Features this product grants (boolean features: present = enabled).\n * Optional — omit to grant none. See the defaults note on `isPublic`.\n */\n grantedFeatures: z.array(z.string()).optional(),\n /**\n * Limits this product grants, with mode (SET for plans, ADD for addons).\n * Optional — omit to grant none. See the defaults note on `isPublic`.\n */\n grantedLimits: z.record(z.string(), LimitGrantSchema).optional(),\n\n /** Inline price definitions (transformed into separate Price records on sync) */\n prices: z.array(PriceDefinitionSchema).min(1),\n\n /** Behavior policy (trial, proration, cancellation, metering) */\n behaviorPolicy: ProductBehaviorPolicySchema.optional(),\n\n // ── PLAN-specific ──\n /** Tier identifier for mutual exclusion (e.g., 'free', 'professional', 'enterprise') */\n planTier: z.string().optional(),\n /** Tier sort order (higher = higher tier, for upgrade/downgrade direction) */\n planTierOrder: z.number().optional(),\n\n // ── ADDON-specific ──\n /** Required plan tiers to subscribe (empty/undefined = no restriction) */\n requiredPlanTiers: z.array(z.string()).optional(),\n\n // ── Tax ──\n /** Per-product tax display override */\n taxDisplayMode: z.enum(TaxDisplayMode).optional(),\n\n // ── Non-subscription specific ──\n /** Purchase config for ONE_TIME/CREDIT_PACK/ITEM products */\n purchaseConfig: z.object({\n maxQuantityPerPurchase: z.number().min(1).optional(),\n creditsPerUnit: z.number().min(1).optional(),\n creditPoolKey: z.string().optional(),\n }).optional(),\n\n /**\n * Sort order in pricing tables. Optional — see the defaults note on `isPublic`.\n */\n sortOrder: z.number().optional(),\n /**\n * Show in public pricing pages. Optional — omitting it yields a PUBLIC product,\n * because the persisted resource defaults it to `true`.\n *\n * WHY `.optional()` AND NOT `.default(...)`\n * This schema is a declarative authoring surface: an application hand-writes\n * `const PLAN: ProductDefinition = { ... }` and nothing ever calls\n * `ProductDefinitionSchema.parse()` on it. A `.default(...)` here would be dead\n * code that never runs, while `z.infer` would still type the field as REQUIRED —\n * so every app author was forced to hand-write `isPublic: true`, `grantedLimits: {}`\n * and friends purely to satisfy the compiler.\n *\n * The real defaults live one layer down, on the PERSISTED `Product` resource\n * (`product.shared.schemas.ts`), which mirrors all four of these fields with\n * identical default values and IS parsed on write. `ProductCatalogSyncBackendService`\n * maps this definition into a `Partial<Product>`, so an omitted field arrives as\n * `undefined` and the resource default materializes it — `grantedFeatures: []`,\n * `grantedLimits: {}`, `sortOrder: 0`, `isPublic: true`.\n *\n * Do NOT \"restore\" `.default(...)` here to make the type look tidier: that would\n * re-assert a guarantee nothing enforces at this layer. Any consumer reading these\n * straight off a `ProductDefinition` must apply the same fallback the resource does.\n */\n isPublic: z.boolean().optional(),\n\n // ── Pricing-surface facts ──\n //\n // What a pricing page needs beyond the price itself, stated here so every surface that lists the\n // catalogue — the application's own pricing table and its public website — reads one answer\n // instead of keeping its own list (#1835). All three are optional for the reason `isPublic`\n // gives: the persisted `Product` resource carries the defaults.\n\n /**\n * The plan this application recommends to the audience it is designed for, emphasised on a\n * pricing surface. Omitted = not recommended.\n *\n * A RECOMMENDATION, not a popularity claim: nothing here measures what customers chose, so no\n * surface may word it as \"most popular\". Recommend at most one plan per scope a surface lists.\n */\n isRecommended: z.boolean().optional(),\n /** How much of this product's price a pricing surface may state. Omitted = `LISTED`. */\n priceDisclosure: z.enum(ProductPriceDisclosure).optional(),\n /** Whether this product can be bought today. Omitted = `AVAILABLE`. */\n availability: z.enum(ProductAvailability).optional(),\n});\n\n/**\n * A product as an application authors it. Its `behaviorPolicy` is the policy's INPUT type, so a field the policy\n * defaults may be omitted; the catalog sync parses it onto the persisted `Product`, where the defaults materialize.\n * An interface rather than an intersection alias, so declaration emit keeps the name.\n */\nexport interface ProductDefinition extends Omit<z.infer<typeof ProductDefinitionSchema>, 'behaviorPolicy'> {\n behaviorPolicy?: ProductBehaviorPolicyInput;\n}\n\n/** The three pricing-surface facts of a product, with every omission resolved. */\nexport interface ProductPricingSurfaceFacts {\n readonly isRecommended: boolean;\n readonly priceDisclosure: ProductPriceDisclosure;\n readonly availability: ProductAvailability;\n}\n\n/**\n * Resolve a definition's pricing-surface facts, applying the defaults the persisted `Product`\n * resource declares.\n *\n * ONE place for the fallbacks, because two readers need them and must agree: the catalogue sync,\n * which must WRITE the default rather than leave a field out (an update ignores an absent field, so\n * a definition that stops recommending a plan would otherwise leave it recommended forever), and a\n * website build, which reads the definitions directly and never sees a persisted row.\n */\nexport function resolveProductPricingSurfaceFacts(definition: Pick<ProductDefinition, 'isRecommended' | 'priceDisclosure' | 'availability'>): ProductPricingSurfaceFacts {\n return {\n isRecommended: definition.isRecommended ?? false,\n priceDisclosure: definition.priceDisclosure ?? ProductPriceDisclosure.LISTED,\n availability: definition.availability ?? ProductAvailability.AVAILABLE,\n };\n}\n"]}
1
+ {"version":3,"file":"product-definition.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/product-definition.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,CAA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AC,SAAS;KACvE,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Product Definition Schema (Shared)\n *\n * The bridge between what developers write in the product catalog config\n * and the DB-level Product + Price schemas.\n *\n * Unlike ProductSchema (the DB record), ProductDefinition:\n * - Has prices INLINE (not separate records)\n * - Has no _id, providerProductId, or DB timestamps\n * - Uses `key` as the unique identifier (maps to Product.key in DB)\n *\n * ProductCatalogSyncBackendService.ensureProductSynced(key):\n * 1. Look up ProductDefinition from catalog config by key\n * 2. Upsert Product DB record (key → _id mapping)\n * 3. Upsert Price DB records for each inline price\n * 4. On first provider use: sync to billing provider (fill providerProductId/providerPriceId)\n *\n * @see billing-and-features-system.md §6.2b (Product Definition)\n */\n\nimport { z } from 'zod';\nimport { z_money, CurrencyAllowed } from '@wildo-ai/zod-decorators';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n ProductType,\n PricingModel,\n BillingInterval,\n UsageAggregationType,\n TaxDisplayMode,\n} from './billing-enums.shared.schemas';\nimport { ProductPriceDisclosure, ProductAvailability } from './public-pricing-catalog.shared.atoms';\nimport { LimitGrantSchema, ProductBehaviorPolicySchema, type ProductBehaviorPolicyInput } from './product-behavior-policy.shared.schemas';\nimport { PriceTierSchema } from './price.shared.schemas';\n\n// ── Price Definition (inline in product config) ────────────────────\n\n/**\n * Inline price definition for product catalog configuration.\n * Maps to a separate Price DB record when synced.\n */\nexport const PriceDefinitionSchema = z.object({\n /** Pricing model (flat, per_unit, tiered, graduated, package) */\n model: z.enum(PricingModel),\n /**\n * Unit price for FLAT/PER_UNIT models.\n * Uses z_money for consistent monetary representation across the billing system.\n * Undefined for TIERED/GRADUATED models (use `tiers` instead).\n */\n unitPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n }),\n /** Billing interval (undefined = one-time) */\n interval: z.enum(BillingInterval).optional(),\n /** Interval count (e.g., 3 for quarterly = interval:'month', intervalCount:3) */\n intervalCount: z.number().min(1).default(1),\n /** Tiers for TIERED/GRADUATED pricing models */\n tiers: z.array(PriceTierSchema).optional(),\n /** Package size for PACKAGE pricing model */\n packageSize: z.number().min(1).optional(),\n /** Usage aggregation for metered prices */\n usageAggregation: z.enum(UsageAggregationType).optional(),\n /** Per-price tax behavior override */\n taxBehavior: z.enum(TaxDisplayMode).optional(),\n /** Whether this is the default price */\n isDefault: z.boolean().default(true),\n});\n\nexport type PriceDefinition = z.infer<typeof PriceDefinitionSchema>;\n\n// ── Product Definition (what developers write) ─────────────────────\n\n/**\n * ProductDefinition: what custom app developers write in their product catalog config.\n * This is the declarative product definition that lives in shared-lib code.\n */\nexport const ProductDefinitionSchema = z.object({\n /** Unique product key (matches Product.key in DB) */\n key: z.string().min(1),\n type: z.enum(ProductType),\n\n /** Which scopes can subscribe/purchase this product */\n targetScopes: z.array(z.enum(ResourcePrimaryScope)).min(1),\n\n /**\n * Features this product grants (boolean features: present = enabled).\n * Optional — omit to grant none. See the defaults note on `isPublic`.\n */\n grantedFeatures: z.array(z.string()).optional(),\n /**\n * Limits this product grants, with mode (SET for plans, ADD for addons).\n * Optional — omit to grant none. See the defaults note on `isPublic`.\n */\n grantedLimits: z.record(z.string(), LimitGrantSchema).optional(),\n\n /** Inline price definitions (transformed into separate Price records on sync) */\n prices: z.array(PriceDefinitionSchema).min(1),\n\n /** Behavior policy (trial, proration, cancellation, metering) */\n behaviorPolicy: ProductBehaviorPolicySchema.optional(),\n\n // ── PLAN-specific ──\n /** Tier identifier for mutual exclusion (e.g., 'free', 'professional', 'enterprise') */\n planTier: z.string().optional(),\n /** Tier sort order (higher = higher tier, for upgrade/downgrade direction) */\n planTierOrder: z.number().optional(),\n\n // ── ADDON-specific ──\n /** Required plan tiers to subscribe (empty/undefined = no restriction) */\n requiredPlanTiers: z.array(z.string()).optional(),\n\n // ── Tax ──\n /** Per-product tax display override */\n taxDisplayMode: z.enum(TaxDisplayMode).optional(),\n\n // ── Non-subscription specific ──\n /** Purchase config for ONE_TIME/CREDIT_PACK/ITEM products */\n purchaseConfig: z.object({\n maxQuantityPerPurchase: z.number().min(1).optional(),\n creditsPerUnit: z.number().min(1).optional(),\n creditPoolKey: z.string().optional(),\n }).optional(),\n\n /**\n * Sort order in pricing tables. Optional — see the defaults note on `isPublic`.\n */\n sortOrder: z.number().optional(),\n /**\n * Show in public pricing pages. Optional — omitting it yields a PUBLIC product,\n * because the persisted resource defaults it to `true`.\n *\n * WHY `.optional()` AND NOT `.default(...)`\n * This schema is a declarative authoring surface: an application hand-writes\n * `const PLAN: ProductDefinition = { ... }` and nothing ever calls\n * `ProductDefinitionSchema.parse()` on it. A `.default(...)` here would be dead\n * code that never runs, while `z.infer` would still type the field as REQUIRED —\n * so every app author was forced to hand-write `isPublic: true`, `grantedLimits: {}`\n * and friends purely to satisfy the compiler.\n *\n * The real defaults live one layer down, on the PERSISTED `Product` resource\n * (`product.shared.schemas.ts`), which mirrors all four of these fields with\n * identical default values and IS parsed on write. `ProductCatalogSyncBackendService`\n * maps this definition into a `Partial<Product>`, so an omitted field arrives as\n * `undefined` and the resource default materializes it — `grantedFeatures: []`,\n * `grantedLimits: {}`, `sortOrder: 0`, `isPublic: true`.\n *\n * Do NOT \"restore\" `.default(...)` here to make the type look tidier: that would\n * re-assert a guarantee nothing enforces at this layer. Any consumer reading these\n * straight off a `ProductDefinition` must apply the same fallback the resource does.\n */\n isPublic: z.boolean().optional(),\n\n // ── Pricing-surface facts ──\n //\n // What a pricing page needs beyond the price itself, stated here so every surface that lists the\n // catalogue — the application's own pricing table and its public website — reads one answer\n // instead of keeping its own list (#1835). All three are optional for the reason `isPublic`\n // gives: the persisted `Product` resource carries the defaults.\n\n /**\n * The plan this application recommends to the audience it is designed for, emphasised on a\n * pricing surface. Omitted = not recommended.\n *\n * A RECOMMENDATION, not a popularity claim: nothing here measures what customers chose, so no\n * surface may word it as \"most popular\". Recommend at most one plan per scope a surface lists.\n */\n isRecommended: z.boolean().optional(),\n /** How much of this product's price a pricing surface may state. Omitted = `LISTED`. */\n priceDisclosure: z.enum(ProductPriceDisclosure).optional(),\n /** Whether this product can be bought today. Omitted = `AVAILABLE`. */\n availability: z.enum(ProductAvailability).optional(),\n});\n\n/**\n * A product as an application authors it. Its `behaviorPolicy` is the policy's INPUT type, so a field the policy\n * defaults may be omitted; the catalog sync parses it onto the persisted `Product`, where the defaults materialize.\n * An interface rather than an intersection alias, so declaration emit keeps the name.\n */\nexport interface ProductDefinition extends Omit<z.infer<typeof ProductDefinitionSchema>, 'behaviorPolicy'> {\n behaviorPolicy?: ProductBehaviorPolicyInput;\n}\n\n/** The three pricing-surface facts of a product, with every omission resolved. */\nexport interface ProductPricingSurfaceFacts {\n readonly isRecommended: boolean;\n readonly priceDisclosure: ProductPriceDisclosure;\n readonly availability: ProductAvailability;\n}\n\n/**\n * Resolve a definition's pricing-surface facts, applying the defaults the persisted `Product`\n * resource declares.\n *\n * ONE place for the fallbacks, because two readers need them and must agree: the catalogue sync,\n * which must WRITE the default rather than leave a field out (an update ignores an absent field, so\n * a definition that stops recommending a plan would otherwise leave it recommended forever), and a\n * website build, which reads the definitions directly and never sees a persisted row.\n */\nexport function resolveProductPricingSurfaceFacts(definition: Pick<ProductDefinition, 'isRecommended' | 'priceDisclosure' | 'availability'>): ProductPricingSurfaceFacts {\n return {\n isRecommended: definition.isRecommended ?? false,\n priceDisclosure: definition.priceDisclosure ?? ProductPriceDisclosure.LISTED,\n availability: definition.availability ?? ProductAvailability.AVAILABLE,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"product.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/product.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAwD,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAI/C,KAAK,eAAe,GAChB,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,mDAAmD,GAC9D,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgG9C,CAAC"}
1
+ {"version":3,"file":"product.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/product.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAwD,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAI/C,KAAK,eAAe,GAChB,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,mDAAmD,GAC9D,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgG9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"product.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/product.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAE7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AASzD,MAAM,CAAC,MAAM,mDAAmD,GAAG,CACjE,s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I;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;oBAChC,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,YAAY,EAAE,IAAI;oBAClB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;oBACjC,iBAAiB,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;oBACjE,YAAY,EAAE,EAAE;oBAChB,UAAU,EAAE,EAAE;oBACd,8BAA8B,EAAE,EAAE;iBACnC,CAAC;SACH;QACD,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;iBAC7C,CAAC;SACH;QACD,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;iBAC7C,CAAC;SACH;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Product Resource Configuration\n *\n * Admin-managed: APPLICATION-scoped catalog (read-only in UI, code-driven).\n */\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n} from '../resources/resources.shared.schemas';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ProductSchema } from './product.shared.schemas';\n\ntype ProductsCoreOps =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE;\n\nexport const productsResourceConfiguration_InitializationFactory = (\n resourcesRelationships: ResourceRelationship[]\n) => createResourceConfiguration_Initialization<\n undefined,\n ProductsCoreOps,\n typeof ProductSchema\n>({\n mainSchema: ProductSchema,\n resourceIdentifier: CoreResourceType.PRODUCTS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.PRODUCTS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n /*\n * The OPERATOR's door onto the catalogue — added 2026-09-18 for issue #1295.\n *\n * The `INTERNAL_CALL` variant above is route-less by design: the billing back-office drives\n * this resource through the service pipeline, and states that these catalog reads have \"NO\n * HTTP surface\". That stays true and stays the DEFAULT, so `createForInternalServiceOperation`\n * keeps resolving it and no internal seam moves.\n *\n * What was missing is the surface an application ADMINISTRATOR needs. The `billing-catalog`\n * settings destination targets `products.list` and could never load — the rail entry, the tab and the\n * heading all rendered, and every request 404'd at the ROUTER, because no route was ever\n * mounted. An operator cannot price what they cannot see.\n *\n * Gated on `APP_ADMIN_SUPER_ADMIN`, exactly what that destination already requires. Not a\n * widening: the aggregated billing state already ships products, prices and active promotions\n * to EVERY authenticated client, so an admin-only list is strictly narrower than what the\n * application discloses today.\n *\n * Two `isDefault: true` variants is the shape `organizations.CREATE` already uses — default is\n * per variant TYPE, so the internal door and the HTTP door each stay the default of their own\n * transport and the HTTP one needs no `variantKey` in its URL.\n */\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n searchableFields: ['key', 'type'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: {},\n sortFields: [],\n maxPaginatedResultPerPageLimit: 50,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n },\n});\n"]}
1
+ {"version":3,"file":"product.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../src/billing/product.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAE7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAi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AAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;oBAChC,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,YAAY,EAAE,IAAI;oBAClB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;oBACjC,iBAAiB,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;oBACjE,YAAY,EAAE,EAAE;oBAChB,UAAU,EAAE,EAAE;oBACd,8BAA8B,EAAE,EAAE;iBACnC,CAAC;SACH;QACD,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;iBAC7C,CAAC;SACH;QACD,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;iBAC7C,CAAC;SACH;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Product Resource Configuration\n *\n * Admin-managed: APPLICATION-scoped catalog (read-only in UI, code-driven).\n */\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n} from '../resources/resources.shared.schemas';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ProductSchema } from './product.shared.schemas';\n\ntype ProductsCoreOps =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE;\n\nexport const productsResourceConfiguration_InitializationFactory = (\n resourcesRelationships: ResourceRelationship[]\n) => createResourceConfiguration_Initialization<\n undefined,\n ProductsCoreOps,\n typeof ProductSchema\n>({\n mainSchema: ProductSchema,\n resourceIdentifier: CoreResourceType.PRODUCTS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.PRODUCTS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n /*\n * The OPERATOR's door onto the catalogue — added 2026-09-18 for issue #1295.\n *\n * The `INTERNAL_CALL` variant above is route-less by design: the billing back-office drives\n * this resource through the service pipeline, and states that these catalog reads have \"NO\n * HTTP surface\". That stays true and stays the DEFAULT, so `createForInternalServiceOperation`\n * keeps resolving it and no internal seam moves.\n *\n * What was missing is the surface an application ADMINISTRATOR needs. The `billing-catalog`\n * settings destination targets `products.list` and could never load — the rail entry, the tab and the\n * heading all rendered, and every request 404'd at the ROUTER, because no route was ever\n * mounted. An operator cannot price what they cannot see.\n *\n * Gated on `APP_ADMIN_SUPER_ADMIN`, exactly what that destination already requires. Not a\n * widening: the aggregated billing state already ships products, prices and active promotions\n * to EVERY authenticated client, so an admin-only list is strictly narrower than what the\n * application discloses today.\n *\n * Two `isDefault: true` variants is the shape `organizations.CREATE` already uses — default is\n * per variant TYPE, so the internal door and the HTTP door each stay the default of their own\n * transport and the HTTP one needs no `variantKey` in its URL.\n */\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n searchableFields: ['key', 'type'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: {},\n sortFields: [],\n maxPaginatedResultPerPageLimit: 50,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"product.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/product.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAIpG,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4FxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"product.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/product.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,cAAc,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAIpG,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4FxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"product.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/product.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,6GAA6G;AAC7G,+GAA+G;AAC/G,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAC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G;IACH,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IAElE,6GAA6G;IAC7G,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC,cAAc,EAAE;IAC1E,4GAA4G;IAC5G,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC,wBAAwB,CAAC;IAC3I,4GAA4G;IAC5G,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC,cAAc,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC;IACnJ,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAErD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IACrF,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC","sourcesContent":["/**\n * Product Schema (Shared)\n *\n * Products define what you sell. They live in the DB as APPLICATION-scoped records,\n * populated lazily from the code-defined ProductDefinition catalog.\n *\n * Config-driven, lazy-populated:\n * 1. Config is the source of truth: Product definitions live in code (shared lib)\n * 2. Populate on demand: DB records created on first checkout/admin view\n * 3. Provider sync on demand: providerProductId filled when first used in provider ops\n * 4. Bulk sync available: Admin action to pre-populate all products\n * 5. Startup is lightweight: No blocking provider calls at boot\n *\n * The admin UI shows products as read-only resources (view + \"Sync to Provider\" action),\n * NOT as CRUD-editable. Changes require code deployment.\n *\n * @see billing-and-features-system.md §6.2 (Product & Price Catalog)\n */\n\nimport { z } from 'zod';\n// Side-effect import: this module calls `.systemEnum()` at load, so the decorators must be installed first —\n// never by the importer's luck (#966). A named import used only as a type would be elided and install nothing.\nimport '@wildo-ai/zod-decorators';\nimport { SectionedVocabulary } from '@wildo-ai/presets-components-models';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n ProductType,\n TaxDisplayMode,\n} from './billing-enums.shared.schemas';\nimport { ProductPriceDisclosure, ProductAvailability } from './public-pricing-catalog.shared.atoms';\nimport { LimitGrantSchema } from './product-behavior-policy.shared.schemas';\nimport { ProductBehaviorPolicySchema } from './product-behavior-policy.shared.schemas';\n\nexport const ProductSchema = z.object({\n\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n type: z.enum(ProductType).isDBIndexed().isSummaryField().isNotEditable().systemEnum('ProductType'),\n /** Unique product key (maps to ProductDefinition.key in code catalog) */\n key: z.string().min(1).isUnique({ scope: 'global' }).isSummaryField().isNotEditable(),\n\n /** Which scopes can subscribe to this product (code-driven, not user-editable) */\n targetScopes: z.array(z.enum(ResourcePrimaryScope)).min(1),\n\n /** Features this product grants (boolean: present = enabled) */\n grantedFeatures: z.array(z.string().systemEnum(SectionedVocabulary.FEATURE)).default([]).isNotEditable(),\n\n /**\n * Limits this product grants, with aggregation mode.\n * - SET: absolute value (for PLAN products: \"Professional gives you 50 projects\")\n * - ADD: additive to current limits (for ADDON products: \"+10 extra projects\")\n *\n * Aggregation algorithm in BillingFeatureSyncBackendService:\n * 1. Start with active PLAN's SET limits (only one active plan per billing account)\n * 2. For each active ADDON with ADD mode: sum onto current limit\n * 3. For each active ADDON with SET mode: take max(current, addon value)\n * 4. FEATURES_UNLIMITED always wins in any comparison\n */\n grantedLimits: z.record(z.string().systemEnum(SectionedVocabulary.LIMIT), LimitGrantSchema).default({}).isNotEditable(),\n\n /** For PLAN type: mutually exclusive tier ordering (higher number = higher tier) */\n planTier: z.string().optional().isSummaryField(),\n /** For PLAN type: tier sort order (used for upgrade/downgrade direction detection) */\n planTierOrder: z.number().optional(),\n\n /** For ADDON type: required plan tiers to subscribe to this addon (empty = no restriction) */\n requiredPlanTiers: z.array(z.string()).optional(),\n\n /**\n * Tax display intent for this product, recorded on the product row.\n * - 'exclusive': price amounts are HT (tax added at checkout)\n * - 'inclusive': price amounts are TTC (tax embedded)\n *\n * It is DECLARATIVE ONLY and does not reach the billing provider. The catalog sync stores it on\n * the product and then sends each price's own `taxBehavior` unchanged, so a price that declares\n * none is created without `tax_behavior` regardless of what this field says. To make the\n * intention effective, set `taxBehavior` on the prices as well.\n *\n * Common pattern: org products exclusive, user products inclusive.\n */\n taxDisplayMode: z.enum(TaxDisplayMode).optional(),\n\n /**\n * Purchase configuration for non-subscription products (ONE_TIME, CREDIT_PACK, ITEM).\n * Ignored for subscription products (PLAN, ADDON, METERED).\n */\n purchaseConfig: z.object({\n /**\n * The most units one purchase may carry (for ONE_TIME/CREDIT_PACK/ITEM). Absent means no cap beyond the\n * checkout's own bound. ENFORCED since #1798: opening a checkout for more is refused with\n * `BILLING_PURCHASE_QUANTITY_EXCEEDS_LIMIT` (422). Nothing read it before.\n */\n maxQuantityPerPurchase: z.number().int().min(1).optional().describe(\"The most units one purchase of this product may carry. Opening a checkout for more is refused. Absent means no cap beyond the checkout's own bound. Ignored for subscription products.\"),\n /** For CREDIT_PACK: how many credits per pack unit */\n creditsPerUnit: z.number().min(1).optional().describe(\"For a credit pack, how many credits each unit bought adds to the credit pool. Defaults to 1.\"),\n /** For CREDIT_PACK: which \"credit pool\" this feeds (e.g., 'ai_tokens', 'sms_credits') */\n creditPoolKey: z.string().optional().describe(\"For a credit pack, the key of the credit pool a completed purchase adds credits to. A credit pack without one grants no credits.\"),\n }).optional(),\n\n /** Behavior policy: trial, proration, cancellation, metering */\n behaviorPolicy: ProductBehaviorPolicySchema.optional(),\n\n /** Provider sync (lazy: populated on first checkout or sync action, NOT at startup) */\n providerProductId: z.string().optional().isBackendOnly(),\n\n /** Display sort order in pricing tables */\n sortOrder: z.number().default(0),\n /** Whether this product is visible to end users */\n isPublic: z.boolean().default(true).isSummaryField(),\n /**\n * Whether this product is RETIRED (`false`): withdrawn from the code catalogue, no longer sold or\n * offered. Not the same question as `availability`, which announces a product not yet on sale.\n */\n isActive: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n /** The plan this application recommends on pricing surfaces — a recommendation, never a popularity claim. */\n isRecommended: z.boolean().default(false).isNotEditable().isSummaryField(),\n /** How much of this product's price a pricing surface may state (display only; not an acquisition gate). */\n priceDisclosure: z.enum(ProductPriceDisclosure).default(ProductPriceDisclosure.LISTED).isNotEditable().systemEnum('ProductPriceDisclosure'),\n /** Whether this product can be bought today; `UPCOMING` is listed and refused at every acquisition door. */\n availability: z.enum(ProductAvailability).default(ProductAvailability.AVAILABLE).isNotEditable().isSummaryField().systemEnum('ProductAvailability'),\n metadata: z.record(z.string(), z.string()).optional(),\n\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type Product = z.infer<typeof ProductSchema>;\n"]}
1
+ {"version":3,"file":"product.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/product.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,6GAA6G;AAC7G,+GAA+G;AAC/G,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,WAA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,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IAElE,6GAA6G;IAC7G,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC,cAAc,EAAE;IAC1E,4GAA4G;IAC5G,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC,wBAAwB,CAAC;IAC3I,4GAA4G;IAC5G,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,CAAC,cAAc,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC;IACnJ,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAErD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IACrF,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC","sourcesContent":["/**\n * Product Schema (Shared)\n *\n * Products define what you sell. They live in the DB as APPLICATION-scoped records,\n * populated lazily from the code-defined ProductDefinition catalog.\n *\n * Config-driven, lazy-populated:\n * 1. Config is the source of truth: Product definitions live in code (shared lib)\n * 2. Populate on demand: DB records created on first checkout/admin view\n * 3. Provider sync on demand: providerProductId filled when first used in provider ops\n * 4. Bulk sync available: Admin action to pre-populate all products\n * 5. Startup is lightweight: No blocking provider calls at boot\n *\n * The admin UI shows products as read-only resources (view + \"Sync to Provider\" action),\n * NOT as CRUD-editable. Changes require code deployment.\n *\n * @see billing-and-features-system.md §6.2 (Product & Price Catalog)\n */\n\nimport { z } from 'zod';\n// Side-effect import: this module calls `.systemEnum()` at load, so the decorators must be installed first —\n// never by the importer's luck (#966). A named import used only as a type would be elided and install nothing.\nimport '@wildo-ai/zod-decorators';\nimport { SectionedVocabulary } from '@wildo-ai/presets-components-models';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n ProductType,\n TaxDisplayMode,\n} from './billing-enums.shared.schemas';\nimport { ProductPriceDisclosure, ProductAvailability } from './public-pricing-catalog.shared.atoms';\nimport { LimitGrantSchema } from './product-behavior-policy.shared.schemas';\nimport { ProductBehaviorPolicySchema } from './product-behavior-policy.shared.schemas';\n\nexport const ProductSchema = z.object({\n\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n type: z.enum(ProductType).isDBIndexed().isSummaryField().isNotEditable().systemEnum('ProductType'),\n /** Unique product key (maps to ProductDefinition.key in code catalog) */\n key: z.string().min(1).isUnique({ scope: 'global' }).isSummaryField().isNotEditable(),\n\n /** Which scopes can subscribe to this product (code-driven, not user-editable) */\n targetScopes: z.array(z.enum(ResourcePrimaryScope)).min(1),\n\n /** Features this product grants (boolean: present = enabled) */\n grantedFeatures: z.array(z.string().systemEnum(SectionedVocabulary.FEATURE)).default([]).isNotEditable(),\n\n /**\n * Limits this product grants, with aggregation mode.\n * - SET: absolute value (for PLAN products: \"Professional gives you 50 projects\")\n * - ADD: additive to current limits (for ADDON products: \"+10 extra projects\")\n *\n * Aggregation algorithm in BillingFeatureSyncBackendService:\n * 1. Start with active PLAN's SET limits (only one active plan per billing account)\n * 2. For each active ADDON with ADD mode: sum onto current limit\n * 3. For each active ADDON with SET mode: take max(current, addon value)\n * 4. FEATURES_UNLIMITED always wins in any comparison\n */\n grantedLimits: z.record(z.string().systemEnum(SectionedVocabulary.LIMIT), LimitGrantSchema).default({}).isNotEditable(),\n\n /** For PLAN type: mutually exclusive tier ordering (higher number = higher tier) */\n planTier: z.string().optional().isSummaryField(),\n /** For PLAN type: tier sort order (used for upgrade/downgrade direction detection) */\n planTierOrder: z.number().optional(),\n\n /** For ADDON type: required plan tiers to subscribe to this addon (empty = no restriction) */\n requiredPlanTiers: z.array(z.string()).optional(),\n\n /**\n * Tax display intent for this product, recorded on the product row.\n * - 'exclusive': price amounts are HT (tax added at checkout)\n * - 'inclusive': price amounts are TTC (tax embedded)\n *\n * It is DECLARATIVE ONLY and does not reach the billing provider. The catalog sync stores it on\n * the product and then sends each price's own `taxBehavior` unchanged, so a price that declares\n * none is created without `tax_behavior` regardless of what this field says. To make the\n * intention effective, set `taxBehavior` on the prices as well.\n *\n * Common pattern: org products exclusive, user products inclusive.\n */\n taxDisplayMode: z.enum(TaxDisplayMode).optional(),\n\n /**\n * Purchase configuration for non-subscription products (ONE_TIME, CREDIT_PACK, ITEM).\n * Ignored for subscription products (PLAN, ADDON, METERED).\n */\n purchaseConfig: z.object({\n /**\n * The most units one purchase may carry (for ONE_TIME/CREDIT_PACK/ITEM). Absent means no cap beyond the\n * checkout's own bound. ENFORCED since #1798: opening a checkout for more is refused with\n * `BILLING_PURCHASE_QUANTITY_EXCEEDS_LIMIT` (422). Nothing read it before.\n */\n maxQuantityPerPurchase: z.number().int().min(1).optional().describe(\"The most units one purchase of this product may carry. Opening a checkout for more is refused. Absent means no cap beyond the checkout's own bound. Ignored for subscription products.\"),\n /** For CREDIT_PACK: how many credits per pack unit */\n creditsPerUnit: z.number().min(1).optional().describe(\"For a credit pack, how many credits each unit bought adds to the credit pool. Defaults to 1.\"),\n /** For CREDIT_PACK: which \"credit pool\" this feeds (e.g., 'ai_tokens', 'sms_credits') */\n creditPoolKey: z.string().optional().describe(\"For a credit pack, the key of the credit pool a completed purchase adds credits to. A credit pack without one grants no credits.\"),\n }).optional(),\n\n /** Behavior policy: trial, proration, cancellation, metering */\n behaviorPolicy: ProductBehaviorPolicySchema.optional(),\n\n /** Provider sync (lazy: populated on first checkout or sync action, NOT at startup) */\n providerProductId: z.string().optional().isBackendOnly(),\n\n /** Display sort order in pricing tables */\n sortOrder: z.number().default(0),\n /** Whether this product is visible to end users */\n isPublic: z.boolean().default(true).isSummaryField(),\n /**\n * Whether this product is RETIRED (`false`): withdrawn from the code catalogue, no longer sold or\n * offered. Not the same question as `availability`, which announces a product not yet on sale.\n */\n isActive: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n /** The plan this application recommends on pricing surfaces — a recommendation, never a popularity claim. */\n isRecommended: z.boolean().default(false).isNotEditable().isSummaryField(),\n /** How much of this product's price a pricing surface may state (display only; not an acquisition gate). */\n priceDisclosure: z.enum(ProductPriceDisclosure).default(ProductPriceDisclosure.LISTED).isNotEditable().systemEnum('ProductPriceDisclosure'),\n /** Whether this product can be bought today; `UPCOMING` is listed and refused at every acquisition door. */\n availability: z.enum(ProductAvailability).default(ProductAvailability.AVAILABLE).isNotEditable().isSummaryField().systemEnum('ProductAvailability'),\n metadata: z.record(z.string(), z.string()).optional(),\n\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type Product = z.infer<typeof ProductSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"promotions.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/promotions.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAwD,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAM/C,oBAAY,oBAAoB;IAC9B,2DAA2D;IAC3D,KAAK,UAAU;IACf,sDAAsD;IACtD,UAAU,eAAe;CAC1B;AAED,KAAK,iBAAiB,GAClB,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,qDAAqD,GAChE,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;kBAmJ9C,CAAC"}
1
+ {"version":3,"file":"promotions.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/promotions.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAwD,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAM/C,oBAAY,oBAAoB;IAC9B,2DAA2D;IAC3D,KAAK,UAAU;IACf,sDAAsD;IACtD,UAAU,eAAe;CAC1B;AAED,KAAK,iBAAiB,GAClB,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,qDAAqD,GAChE,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;kBAmJ9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"promotions.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/promotions.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,g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,iHAAiH,CAAC;yBAC3J,CAAC,CAAC,QAAQ,CAAC,yIAAyI,CAAC;qBACvJ,CAAC;iBACH,CAAC;SACH;QACD,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE;YACjC,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;oBAC5C,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,iBAAiB,EAAE,IAAI;oBACvB,kFAAkF;oBAClF,sFAAsF;oBACtF,kFAAkF;oBAClF,oFAAoF;oBACpF,8EAA8E;oBAC9E,wBAAwB;oBACxB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;oBACxB,2EAA2E;oBAC3E,kCAAkC;oBAClC,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC;wBAC1B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;qBACtB,CAAC;iBACH,CAAC;SACH;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Promotions Resource Configuration\n *\n * Admin-managed: discount mechanisms synced to provider.\n */\n\nimport { z } from 'zod';\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n} from '../resources/resources.shared.schemas';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { PromotionSchema } from './promotions.shared.schemas';\n\n// ── Custom Operations ────────────────────────────────────────────────\n\nexport enum Promotion_Operations {\n /** Apply a promotion code (validates and records usage) */\n APPLY = 'apply',\n /** Deactivate a promotion (sets isActive to false) */\n DEACTIVATE = 'deactivate',\n}\n\ntype PromotionsCoreOps =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE;\n\nexport const promotionsResourceConfiguration_InitializationFactory = (\n resourcesRelationships: ResourceRelationship[]\n) => createResourceConfiguration_Initialization<\n typeof Promotion_Operations,\n PromotionsCoreOps,\n typeof PromotionSchema\n>({\n mainSchema: PromotionSchema,\n resourceIdentifier: CoreResourceType.PROMOTIONS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.PROMOTIONS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n customOperation: Promotion_Operations,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n /*\n * The OPERATOR's door onto the catalogue — added 2026-09-18 for issue #1295.\n *\n * The `INTERNAL_CALL` variant above is route-less by design: the billing back-office drives\n * this resource through the service pipeline, and states that these catalog reads have \"NO\n * HTTP surface\". That stays true and stays the DEFAULT, so `createForInternalServiceOperation`\n * keeps resolving it and no internal seam moves.\n *\n * What was missing is the surface an application ADMINISTRATOR needs. The `billing-catalog`\n * settings destination targets `promotions.list` and could never load — the rail entry, the tab and the\n * heading all rendered, and every request 404'd at the ROUTER, because no route was ever\n * mounted. An operator cannot price what they cannot see.\n *\n * Gated on `APP_ADMIN_SUPER_ADMIN`, exactly what that destination already requires. Not a\n * widening: the aggregated billing state already ships products, prices and active promotions\n * to EVERY authenticated client, so an admin-only list is strictly narrower than what the\n * application discloses today.\n *\n * Two `isDefault: true` variants is the shape `organizations.CREATE` already uses — default is\n * per variant TYPE, so the internal door and the HTTP door each stay the default of their own\n * transport and the HTTP one needs no `variantKey` in its URL.\n */\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n searchableFields: ['name', 'code'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: {},\n sortFields: [],\n maxPaginatedResultPerPageLimit: 50,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [Promotion_Operations.APPLY]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n code: z.string().min(1),\n }),\n // Borrows UPDATE for its route/verb but returns discount info for the caller,\n // NOT the Promotion resource row. Without this the service output fails\n // `transformOutput`'s `internalDto.parse` against the resource schema → 500.\n customResponseDto: z.object({\n valid: z.boolean().describe(\"Always `true`. A promotion that cannot be used is refused with an error instead.\"),\n promotionId: z.string().describe(\"The id of the promotion that was checked.\"),\n providerCouponId: z.string().nullish().describe(\"The billing provider's id for the coupon behind the promotion. Absent when the promotion is not set up with the provider, in which case checkout refuses its code.\"),\n providerPromotionId: z.string().nullish().describe(\"The billing provider's id for the promotion code. Present only for a promotion with a code that is set up with the provider.\"),\n discount: z.object({\n type: z.string().describe(\"The kind of discount: `percentage` or `fixed_amount`.\"),\n percentage: z.number().optional().describe(\"For a `percentage` discount, the percentage taken off, from 0 to 100.\"),\n // `amount` is a MoneyValue (z_money) — modelled permissively to avoid\n // pulling the money factory into this response contract.\n amount: z.unknown().optional().describe(\"For a `fixed_amount` discount, the amount taken off, as a money value with `amount`, `currency` and `decimals`.\"),\n }).describe(\"The discount the promotion gives. Checking a code does not redeem it: a redemption is counted when a checkout using the code completes.\"),\n }),\n }],\n },\n [Promotion_Operations.DEACTIVATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n haveBulkOperation: true,\n // DEACTIVATE forces `isActive: false` from its prefix implementation and takes no\n // caller input. Omitting `requestDto` would auto-derive the FULL promotion update DTO\n // — including `isActive` itself (so \"deactivate\" could re-activate), plus `code`,\n // `discountPercentage` and `maxRedemptions`. The prefix's return is MERGED onto the\n // caller payload rather than replacing it, so narrowing here is what actually\n // constrains the write.\n requestDto: z.object({}),\n // Borrows UPDATE for its route/verb but returns a bare `{ isActive }` ack,\n // NOT the Promotion resource row.\n customResponseDto: z.object({\n isActive: z.boolean(),\n }),\n }],\n },\n },\n});\n"]}
1
+ {"version":3,"file":"promotions.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../src/billing/promotions.shared.resources-config.schemas.ts"],"names":[],"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AE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uEAAuE,CAAC;4BACnH,sEAAsE;4BACtE,yDAAyD;4BACzD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iHAAiH,CAAC;yBAC3J,CAAC,CAAC,QAAQ,CAAC,yIAAyI,CAAC;qBACvJ,CAAC;iBACH,CAAC;SACH;QACD,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE;YACjC,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;oBAC5C,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,iBAAiB,EAAE,IAAI;oBACvB,kFAAkF;oBAClF,sFAAsF;oBACtF,kFAAkF;oBAClF,oFAAoF;oBACpF,8EAA8E;oBAC9E,wBAAwB;oBACxB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;oBACxB,2EAA2E;oBAC3E,kCAAkC;oBAClC,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC;wBAC1B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;qBACtB,CAAC;iBACH,CAAC;SACH;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Promotions Resource Configuration\n *\n * Admin-managed: discount mechanisms synced to provider.\n */\n\nimport { z } from 'zod';\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n} from '../resources/resources.shared.schemas';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { PromotionSchema } from './promotions.shared.schemas';\n\n// ── Custom Operations ────────────────────────────────────────────────\n\nexport enum Promotion_Operations {\n /** Apply a promotion code (validates and records usage) */\n APPLY = 'apply',\n /** Deactivate a promotion (sets isActive to false) */\n DEACTIVATE = 'deactivate',\n}\n\ntype PromotionsCoreOps =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE;\n\nexport const promotionsResourceConfiguration_InitializationFactory = (\n resourcesRelationships: ResourceRelationship[]\n) => createResourceConfiguration_Initialization<\n typeof Promotion_Operations,\n PromotionsCoreOps,\n typeof PromotionSchema\n>({\n mainSchema: PromotionSchema,\n resourceIdentifier: CoreResourceType.PROMOTIONS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.PROMOTIONS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n customOperation: Promotion_Operations,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n /*\n * The OPERATOR's door onto the catalogue — added 2026-09-18 for issue #1295.\n *\n * The `INTERNAL_CALL` variant above is route-less by design: the billing back-office drives\n * this resource through the service pipeline, and states that these catalog reads have \"NO\n * HTTP surface\". That stays true and stays the DEFAULT, so `createForInternalServiceOperation`\n * keeps resolving it and no internal seam moves.\n *\n * What was missing is the surface an application ADMINISTRATOR needs. The `billing-catalog`\n * settings destination targets `promotions.list` and could never load — the rail entry, the tab and the\n * heading all rendered, and every request 404'd at the ROUTER, because no route was ever\n * mounted. An operator cannot price what they cannot see.\n *\n * Gated on `APP_ADMIN_SUPER_ADMIN`, exactly what that destination already requires. Not a\n * widening: the aggregated billing state already ships products, prices and active promotions\n * to EVERY authenticated client, so an admin-only list is strictly narrower than what the\n * application discloses today.\n *\n * Two `isDefault: true` variants is the shape `organizations.CREATE` already uses — default is\n * per variant TYPE, so the internal door and the HTTP door each stay the default of their own\n * transport and the HTTP one needs no `variantKey` in its URL.\n */\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n searchableFields: ['name', 'code'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: {},\n sortFields: [],\n maxPaginatedResultPerPageLimit: 50,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [Promotion_Operations.APPLY]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n code: z.string().min(1),\n }),\n // Borrows UPDATE for its route/verb but returns discount info for the caller,\n // NOT the Promotion resource row. Without this the service output fails\n // `transformOutput`'s `internalDto.parse` against the resource schema → 500.\n customResponseDto: z.object({\n valid: z.boolean().describe(\"Always `true`. A promotion that cannot be used is refused with an error instead.\"),\n promotionId: z.string().describe(\"The id of the promotion that was checked.\"),\n providerCouponId: z.string().nullish().describe(\"The billing provider's id for the coupon behind the promotion. Absent when the promotion is not set up with the provider, in which case checkout refuses its code.\"),\n providerPromotionId: z.string().nullish().describe(\"The billing provider's id for the promotion code. Present only for a promotion with a code that is set up with the provider.\"),\n discount: z.object({\n type: z.string().describe(\"The kind of discount: `percentage` or `fixed_amount`.\"),\n percentage: z.number().optional().describe(\"For a `percentage` discount, the percentage taken off, from 0 to 100.\"),\n // `amount` is a MoneyValue (z_money) — modelled permissively to avoid\n // pulling the money factory into this response contract.\n amount: z.unknown().optional().describe(\"For a `fixed_amount` discount, the amount taken off, as a money value with `amount`, `currency` and `decimals`.\"),\n }).describe(\"The discount the promotion gives. Checking a code does not redeem it: a redemption is counted when a checkout using the code completes.\"),\n }),\n }],\n },\n [Promotion_Operations.DEACTIVATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n haveBulkOperation: true,\n // DEACTIVATE forces `isActive: false` from its prefix implementation and takes no\n // caller input. Omitting `requestDto` would auto-derive the FULL promotion update DTO\n // — including `isActive` itself (so \"deactivate\" could re-activate), plus `code`,\n // `discountPercentage` and `maxRedemptions`. The prefix's return is MERGED onto the\n // caller payload rather than replacing it, so narrowing here is what actually\n // constrains the write.\n requestDto: z.object({}),\n // Borrows UPDATE for its route/verb but returns a bare `{ isActive }` ack,\n // NOT the Promotion resource row.\n customResponseDto: z.object({\n isActive: z.boolean(),\n }),\n }],\n },\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"promotions.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/promotions.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EAClB,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;iBAkE1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"promotions.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/promotions.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,EAClB,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;iBAkE1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"promotions.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/promotions.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AAExC,MAAM,CAAC,MAAM,eAAe,GA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CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IACrF,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC","sourcesContent":["/**\n * Promotion Schema (Shared)\n *\n * Promotions are APPLICATION-scoped, admin-managed discount mechanisms\n * synced to the billing provider (as coupons + promotion codes).\n *\n * Types:\n * - COUPON: Auto-applied or admin-applied discount\n * - PROMOTION_CODE: User-entered code at checkout\n * - REFERRAL: Generated by referral program (links to ReferralSchema)\n * - DEAL: Custom negotiated deal (enterprise/sales-driven)\n *\n * @see billing-and-features-system.md §10 (Promotions)\n */\n\nimport { z } from 'zod';\nimport { z_money, CurrencyAllowed } from '@wildo-ai/zod-decorators';\nimport {\n PromotionType,\n DiscountType,\n PromotionDuration,\n} from './billing-enums.shared.schemas';\n\nexport const PromotionSchema = z.object({\n\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /** Promotion type */\n type: z.enum(PromotionType).isDBIndexed().isSummaryField().systemEnum('PromotionType'),\n\n /** Human-readable name (admin display) */\n name: z.string().min(1).max(200).isSummaryField(),\n /** Optional description */\n description: z.string().max(500).optional(),\n\n /** The user-facing promotion code (for PROMOTION_CODE type) */\n code: z.string().min(1).max(50).optional().isDBIndexed(),\n\n // ── Discount ──\n\n /** Discount type (percentage or fixed amount) */\n discountType: z.enum(DiscountType).isSummaryField().systemEnum('DiscountType'),\n /**\n * Discount percentage (0-100), for PERCENTAGE discount type.\n * Mutually exclusive with discountFixedAmount.\n */\n discountPercentage: z.number().min(0).max(100).optional(),\n /**\n * Fixed discount amount, for FIXED_AMOUNT discount type.\n * Uses z_money for proper monetary representation with bigint precision.\n * Mutually exclusive with discountPercentage.\n */\n discountFixedAmount: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n }).optional(),\n\n // ── Duration ──\n\n /** How long the discount applies */\n duration: z.enum(PromotionDuration).default(PromotionDuration.ONCE),\n /** For REPEATING duration: number of months */\n durationInMonths: z.number().min(1).optional(),\n\n // ── Applicability ──\n\n /** Product keys this promotion applies to (empty = all products) */\n applicableProducts: z.array(z.string()).default([]),\n /** Maximum number of redemptions (null = unlimited) */\n maxRedemptions: z.number().min(1).nullable().default(null),\n /** Current redemption count */\n timesRedeemed: z.number().min(0).default(0).isNotEditable(),\n\n // ── Validity ──\n\n /** Start date (promotion is not active before this) */\n validFrom: z.date().optional(),\n /** End date (promotion expires after this) */\n validUntil: z.date().optional(),\n /** Whether this promotion is currently active */\n isActive: z.boolean().default(true).isDBIndexed(),\n\n // ── Provider sync ──\n\n /** Provider coupon ID (synced on creation) */\n providerCouponId: z.string().optional().isBackendOnly(),\n /** Provider promotion code ID (for PROMOTION_CODE type) */\n providerPromotionId: z.string().optional().isBackendOnly(),\n\n metadata: z.record(z.string(), z.string()).optional(),\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type Promotion = z.infer<typeof PromotionSchema>;\n"]}
1
+ {"version":3,"file":"promotions.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/promotions.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AAExC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAEtC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE;IAEtD,qBAAqB;IACrB,IAAI,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AAC,iBAAiB,EAAE;CACtF,CAAC,CAAC","sourcesContent":["/**\n * Promotion Schema (Shared)\n *\n * Promotions are APPLICATION-scoped, admin-managed discount mechanisms\n * synced to the billing provider (as coupons + promotion codes).\n *\n * Types:\n * - COUPON: Auto-applied or admin-applied discount\n * - PROMOTION_CODE: User-entered code at checkout\n * - REFERRAL: Generated by referral program (links to ReferralSchema)\n * - DEAL: Custom negotiated deal (enterprise/sales-driven)\n *\n * @see billing-and-features-system.md §10 (Promotions)\n */\n\nimport { z } from 'zod';\nimport { z_money, CurrencyAllowed } from '@wildo-ai/zod-decorators';\nimport {\n PromotionType,\n DiscountType,\n PromotionDuration,\n} from './billing-enums.shared.schemas';\n\nexport const PromotionSchema = z.object({\n\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /** Promotion type */\n type: z.enum(PromotionType).isDBIndexed().isSummaryField().systemEnum('PromotionType'),\n\n /** Human-readable name (admin display) */\n name: z.string().min(1).max(200).isSummaryField(),\n /** Optional description */\n description: z.string().max(500).optional(),\n\n /** The user-facing promotion code (for PROMOTION_CODE type) */\n code: z.string().min(1).max(50).optional().isDBIndexed(),\n\n // ── Discount ──\n\n /** Discount type (percentage or fixed amount) */\n discountType: z.enum(DiscountType).isSummaryField().systemEnum('DiscountType'),\n /**\n * Discount percentage (0-100), for PERCENTAGE discount type.\n * Mutually exclusive with discountFixedAmount.\n */\n discountPercentage: z.number().min(0).max(100).optional(),\n /**\n * Fixed discount amount, for FIXED_AMOUNT discount type.\n * Uses z_money for proper monetary representation with bigint precision.\n * Mutually exclusive with discountPercentage.\n */\n discountFixedAmount: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT], minAmount: 0n }).optional(),\n\n // ── Duration ──\n\n /** How long the discount applies */\n duration: z.enum(PromotionDuration).default(PromotionDuration.ONCE),\n /** For REPEATING duration: number of months */\n durationInMonths: z.number().min(1).optional(),\n\n // ── Applicability ──\n\n /** Product keys this promotion applies to (empty = all products) */\n applicableProducts: z.array(z.string()).default([]),\n /** Maximum number of redemptions (null = unlimited) */\n maxRedemptions: z.number().min(1).nullable().default(null),\n /** Current redemption count */\n timesRedeemed: z.number().min(0).default(0).isNotEditable(),\n\n // ── Validity ──\n\n /** Start date (promotion is not active before this) */\n validFrom: z.date().optional(),\n /** End date (promotion expires after this) */\n validUntil: z.date().optional(),\n /** Whether this promotion is currently active */\n isActive: z.boolean().default(true).isDBIndexed(),\n\n // ── Provider sync ──\n\n /** Provider coupon ID (synced on creation) */\n providerCouponId: z.string().optional().isBackendOnly(),\n /** Provider promotion code ID (for PROMOTION_CODE type) */\n providerPromotionId: z.string().optional().isBackendOnly(),\n\n metadata: z.record(z.string(), z.string()).optional(),\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type Promotion = z.infer<typeof PromotionSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"public-pricing-catalog.shared.atoms.d.ts","sourceRoot":"","sources":["../../../../src/billing/public-pricing-catalog.shared.atoms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wHAAwH;AACxH;;;;;;;;;;;;;;GAcG;AACH,oBAAY,sBAAsB;IAChC,yGAAyG;IACzG,MAAM,WAAW;IACjB;;;;OAIG;IACH,WAAW,gBAAgB;IAC3B,mFAAmF;IACnF,UAAU,eAAe;CAC1B;AAED;;;;;;;GAOG;AACH,oBAAY,mBAAmB;IAC7B,wEAAwE;IACxE,SAAS,cAAc;IACvB,iGAAiG;IACjG,QAAQ,aAAa;CACtB;AACD,sEAAsE;AAEtE;;;;;;;GAOG;AACH,oBAAY,2BAA2B;IACrC,iCAAiC;IACjC,QAAQ,aAAa;IACrB,mCAAmC;IACnC,KAAK,UAAU;IACf,kCAAkC;IAClC,IAAI,SAAS;CACd;AAED;;;;;;GAMG;AACH,oBAAY,wBAAwB;IAClC,oDAAoD;IACpD,IAAI,SAAS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KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,UAAU,CAAC,GAAG,MAAM,CAQ9G"}
1
+ {"version":3,"file":"public-pricing-catalog.shared.atoms.d.ts","sourceRoot":"","sources":["../../../src/billing/public-pricing-catalog.shared.atoms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wHAAwH;AACxH;;;;;;;;;;;;;;GAcG;AACH,oBAAY,sBAAsB;IAChC,yGAAyG;IACzG,MAAM,WAAW;IACjB;;;;OAIG;IACH,WAAW,gBAAgB;IAC3B,mFAAmF;IACnF,UAAU,eAAe;CAC1B;AAED;;;;;;;GAOG;AACH,oBAAY,mBAAmB;IAC7B,wEAAwE;IACxE,SAAS,cAAc;IACvB,iGAAiG;IACjG,QAAQ,aAAa;CACtB;AACD,sEAAsE;AAEtE;;;;;;;GAOG;AACH,oBAAY,2BAA2B;IACrC,iCAAiC;IACjC,QAAQ,aAAa;IACrB,mCAAmC;IACnC,KAAK,UAAU;IACf,kCAAkC;IAClC,IAAI,SAAS;CACd;AAED;;;;;;GAMG;AACH,oBAAY,wBAAwB;IAClC,oDAAoD;IACpD,IAAI,SAAS;IACb,gEAAgE;IAChE,QAAQ,aAAa;IACrB,iGAAiG;IACjG,QAAQ,aAAa;CACtB;AAED,kCAAkC;AAClC,MAAM,WAAW,kBAAkB;IACjC,+FAA+F;IAC/F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,kGAAkG;IAClG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8BAA8B;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5F,QAAQ,CAAC,WAAW,EAAE,wBAAwB,CAAC;IAC/C,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,wGAAwG;AACxG,MAAM,WAAW,iBAAiB;IAChC,gFAAgF;IAChF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,sBAAsB,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C,kDAAkD;IAClD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAChD;AAED,kFAAkF;AAClF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,UAAU,CAAC,GAAG,MAAM,CAQ9G"}
@@ -1 +1 @@
1
- {"version":3,"file":"public-pricing-catalog.shared.atoms.js","sourceRoot":"","sources":["../../../../src/billing/public-pricing-catalog.shared.atoms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wHAAwH;AACxH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,sBAWX;AAXD,WAAY,sBAAsB;IAChC,yGAAyG;IACzG,2CAAiB,CAAA;IACjB;;;;OAIG;IACH,qDAA2B,CAAA;IAC3B,mFAAmF;IACnF,mDAAyB,CAAA;AAC3B,CAAC,EAXW,sBAAsB,KAAtB,sBAAsB,QAWjC;AAED;;;;;;;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AC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjF,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACtF,CAAC","sourcesContent":["/**\n * The PUBLIC pricing catalogue: what a pricing surface outside the application (the public website)\n * may know about the application's billing catalogue, as plain JSON-safe data (#1835).\n *\n * ## Why this file imports nothing\n *\n * It is an ATOM on the `@wildo-ai/saas-models/public-runtime` seam. The website's pricing section is a\n * browser island, and the billing vocabulary it would otherwise need (`ProductType`, `BillingInterval`,\n * `PricingModel`) lives behind the decorator-framework root barrel and the provider models, neither of\n * which may reach a browser bundle. So the catalogue is DERIVED on the build side, where those\n * vocabularies are available (`derivePublicPricingCatalog` in `./public-pricing-catalog.shared`), and\n * crosses into the browser as the plain shape declared here.\n *\n * ## Why a price carries `amountMinor` as a STRING\n *\n * A `z_money` amount is a `bigint` in minor units. A bigint does not survive `JSON.stringify` (it\n * throws), and the catalogue crosses Astro's island serialization boundary, so it travels as the\n * decimal digits of that integer — lossless, where a `number` would not be for large amounts.\n */\n\n/** @wildo_source:part:start saas.models.billing.catalog-vocabularies facet:layer:shared facet:audience:app-developer */\n/**\n * How much of a product's price a pricing surface may state.\n *\n * The catalogue always carries typed prices — a product cannot sync to the billing provider\n * without one — but a commercial offer is not always fully decided by them. A plan sold as \"per\n * member, plus a platform fee we quote\" has a real unit price and an unsettled total; an\n * enterprise plan sold by a sales conversation may carry a placeholder price nobody should read.\n * Before this vocabulary existed, every pricing surface either printed that price as if it were\n * the whole offer, or kept its own hand-written list of exceptions (#1835).\n *\n * This is a DISPLAY fact and deliberately NOT an acquisition gate: a customer handed a checkout\n * link for an on-request plan by a salesperson must still be able to pay it, for the same reason a\n * private-but-active plan stays purchasable. Whether the product can\n * be bought today is {@link ProductAvailability}'s question.\n */\nexport enum ProductPriceDisclosure {\n /** The listed prices ARE the offer: a pricing page states them, and structured data may publish them. */\n LISTED = 'listed',\n /**\n * The listed price is a FLOOR: part of the total is not settled (a quoted fee, a volume term).\n * A pricing page states it as a starting price, and structured data must not publish it as the\n * price, because a search engine would show it as the whole offer.\n */\n STARTING_AT = 'starting_at',\n /** No price is stated: the offer is quoted on request (a \"contact sales\" plan). */\n ON_REQUEST = 'on_request',\n}\n\n/**\n * Whether a product can be bought today.\n *\n * Distinct from `Product.isActive`, which is RETIREMENT — a product the catalogue withdrew, no\n * longer sold and no longer offered. An UPCOMING product is the opposite end of the same life: it is\n * announced on pricing surfaces so a visitor can see where the product is going, and it cannot be\n * bought yet. Folding it into `isActive: false` would hide it from the very pages that announce it.\n */\nexport enum ProductAvailability {\n /** On sale: the acquisition doors accept it (subject to retirement). */\n AVAILABLE = 'available',\n /** Announced, not yet on sale: listed on pricing surfaces, refused at every acquisition door. */\n UPCOMING = 'upcoming',\n}\n/** @wildo_source:part:end saas.models.billing.catalog-vocabularies */\n\n/**\n * How a public price RECURS, as a pricing page states it.\n *\n * Not a copy of the provider's `BillingInterval`: that vocabulary has no member for a one-time price\n * (an absent interval means one-time), and this one must name it, because \"once\" and \"per month\" are\n * different sentences on a pricing page. Every `BillingInterval` member maps onto one of these in\n * `derivePublicPricingCatalog`, through a table that is total over it.\n */\nexport enum PublicPricingRecurrenceUnit {\n /** Paid once — no recurrence. */\n ONE_TIME = 'one_time',\n /** Recurs every `count` months. */\n MONTH = 'month',\n /** Recurs every `count` years. */\n YEAR = 'year',\n}\n\n/**\n * What one public price amount MEANS.\n *\n * A single amount can state a flat price or a per-unit price. It cannot state a tiered, graduated or\n * package price, whose total depends on quantity; for those the amount is indicative only, so no\n * surface may present it — or publish it in structured data — as the price.\n */\nexport enum PublicPricingAmountBasis {\n /** The amount is the whole price for the period. */\n FLAT = 'flat',\n /** The amount is per unit (a seat, a member) for the period. */\n PER_UNIT = 'per_unit',\n /** The total depends on quantity (tiered, graduated, package): the amount is indicative only. */\n VARIABLE = 'variable',\n}\n\n/** One public price of a plan. */\nexport interface PublicPricingPrice {\n /** The price amount in the currency's MINOR units, as decimal digits (see the file header). */\n readonly amountMinor: string;\n /** How many decimal places `amountMinor` carries: the value is `amountMinor / 10 ** decimals`. */\n readonly decimals: number;\n /** ISO 4217 currency code. */\n readonly currency: string;\n readonly recurrence: { readonly unit: PublicPricingRecurrenceUnit; readonly count: number };\n readonly amountBasis: PublicPricingAmountBasis;\n /** The price the catalogue marks as the plan's default. */\n readonly isDefault: boolean;\n}\n\n/** One public plan: a product the catalogue lists publicly, with its pricing-surface facts resolved. */\nexport interface PublicPricingPlan {\n /** The catalogue key — also the label namespace a surface names the plan by. */\n readonly key: string;\n readonly planTier?: string;\n /** Ascending order on a pricing surface. */\n readonly sortOrder: number;\n /** The scopes that may subscribe (wire values of `ResourcePrimaryScope`). */\n readonly targetScopes: readonly string[];\n readonly isRecommended: boolean;\n readonly priceDisclosure: ProductPriceDisclosure;\n readonly availability: ProductAvailability;\n /** Free-trial length when the plan offers one. */\n readonly trialDays?: number;\n readonly prices: readonly PublicPricingPrice[];\n}\n\n/** The public pricing catalogue: every publicly listed plan, in display order. */\nexport interface PublicPricingCatalog {\n readonly plans: readonly PublicPricingPlan[];\n}\n\n/**\n * The amount of a public price as a plain decimal string (`\"4\"`, `\"29.9\"`, `\"0.0001\"`), exact — no\n * floating point. What structured data publishes as `price`, and what a surface formats for display.\n */\nexport function publicPricingAmountDecimal(price: Pick<PublicPricingPrice, 'amountMinor' | 'decimals'>): string {\n const negative = price.amountMinor.startsWith('-');\n const digits = (negative ? price.amountMinor.slice(1) : price.amountMinor).replace(/^0+(?=\\d)/, '');\n if (price.decimals <= 0) return `${negative ? '-' : ''}${digits}`;\n const padded = digits.padStart(price.decimals + 1, '0');\n const whole = padded.slice(0, padded.length - price.decimals);\n const fraction = padded.slice(padded.length - price.decimals).replace(/0+$/, '');\n return `${negative ? '-' : ''}${whole}${fraction.length > 0 ? `.${fraction}` : ''}`;\n}\n"]}
1
+ {"version":3,"file":"public-pricing-catalog.shared.atoms.js","sourceRoot":"","sources":["../../../src/billing/public-pricing-catalog.shared.atoms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wHAAwH;AACxH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,sBAWX;AAXD,WAAY,sBAAsB;IAChC,yGAAyG;IACzG,2CAAiB,CAAA;IACjB;;;;OAIG;IACH,qDAA2B,CAAA;IAC3B,mFAAmF;IACnF,mDAAyB,CAAA;AAC3B,CAAC,EAXW,sBAAsB,KAAtB,sBAAsB,QAWjC;AAED;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,wEAAwE;IACxE,8CAAuB,CAAA;IACvB,iGAAiG;IACjG,4CAAqB,CAAA;AACvB,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AACD,sEAAsE;AAEtE;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,2BAOX;AAPD,WAAY,2BAA2B;IACrC,iCAAiC;IACjC,oDAAqB,CAAA;IACrB,mCAAmC;IACnC,8CAAe,CAAA;IACf,kCAAkC;IAClC,4CAAa,CAAA;AACf,CAAC,EAPW,2BAA2B,KAA3B,2BAA2B,QAOtC;AAED;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,wBAOX;AAPD,WAAY,wBAAwB;IAClC,oDAAoD;IACpD,yCAAa,CAAA;IACb,gEAAgE;IAChE,iDAAqB,CAAA;IACrB,iGAAiG;IACjG,iDAAqB,CAAA;AACvB,CAAC,EAPW,wBAAwB,KAAxB,wBAAwB,QAOnC;AAsCD;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAA2D;IACpG,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACpG,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC;QAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjF,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACtF,CAAC","sourcesContent":["/**\n * The PUBLIC pricing catalogue: what a pricing surface outside the application (the public website)\n * may know about the application's billing catalogue, as plain JSON-safe data (#1835).\n *\n * ## Why this file imports nothing\n *\n * It is an ATOM on the `@wildo-ai/saas-models/public-runtime` seam. The website's pricing section is a\n * browser island, and the billing vocabulary it would otherwise need (`ProductType`, `BillingInterval`,\n * `PricingModel`) lives behind the decorator-framework root barrel and the provider models, neither of\n * which may reach a browser bundle. So the catalogue is DERIVED on the build side, where those\n * vocabularies are available (`derivePublicPricingCatalog` in `./public-pricing-catalog.shared`), and\n * crosses into the browser as the plain shape declared here.\n *\n * ## Why a price carries `amountMinor` as a STRING\n *\n * A `z_money` amount is a `bigint` in minor units. A bigint does not survive `JSON.stringify` (it\n * throws), and the catalogue crosses Astro's island serialization boundary, so it travels as the\n * decimal digits of that integer — lossless, where a `number` would not be for large amounts.\n */\n\n/** @wildo_source:part:start saas.models.billing.catalog-vocabularies facet:layer:shared facet:audience:app-developer */\n/**\n * How much of a product's price a pricing surface may state.\n *\n * The catalogue always carries typed prices — a product cannot sync to the billing provider\n * without one — but a commercial offer is not always fully decided by them. A plan sold as \"per\n * member, plus a platform fee we quote\" has a real unit price and an unsettled total; an\n * enterprise plan sold by a sales conversation may carry a placeholder price nobody should read.\n * Before this vocabulary existed, every pricing surface either printed that price as if it were\n * the whole offer, or kept its own hand-written list of exceptions (#1835).\n *\n * This is a DISPLAY fact and deliberately NOT an acquisition gate: a customer handed a checkout\n * link for an on-request plan by a salesperson must still be able to pay it, for the same reason a\n * private-but-active plan stays purchasable. Whether the product can\n * be bought today is {@link ProductAvailability}'s question.\n */\nexport enum ProductPriceDisclosure {\n /** The listed prices ARE the offer: a pricing page states them, and structured data may publish them. */\n LISTED = 'listed',\n /**\n * The listed price is a FLOOR: part of the total is not settled (a quoted fee, a volume term).\n * A pricing page states it as a starting price, and structured data must not publish it as the\n * price, because a search engine would show it as the whole offer.\n */\n STARTING_AT = 'starting_at',\n /** No price is stated: the offer is quoted on request (a \"contact sales\" plan). */\n ON_REQUEST = 'on_request',\n}\n\n/**\n * Whether a product can be bought today.\n *\n * Distinct from `Product.isActive`, which is RETIREMENT — a product the catalogue withdrew, no\n * longer sold and no longer offered. An UPCOMING product is the opposite end of the same life: it is\n * announced on pricing surfaces so a visitor can see where the product is going, and it cannot be\n * bought yet. Folding it into `isActive: false` would hide it from the very pages that announce it.\n */\nexport enum ProductAvailability {\n /** On sale: the acquisition doors accept it (subject to retirement). */\n AVAILABLE = 'available',\n /** Announced, not yet on sale: listed on pricing surfaces, refused at every acquisition door. */\n UPCOMING = 'upcoming',\n}\n/** @wildo_source:part:end saas.models.billing.catalog-vocabularies */\n\n/**\n * How a public price RECURS, as a pricing page states it.\n *\n * Not a copy of the provider's `BillingInterval`: that vocabulary has no member for a one-time price\n * (an absent interval means one-time), and this one must name it, because \"once\" and \"per month\" are\n * different sentences on a pricing page. Every `BillingInterval` member maps onto one of these in\n * `derivePublicPricingCatalog`, through a table that is total over it.\n */\nexport enum PublicPricingRecurrenceUnit {\n /** Paid once — no recurrence. */\n ONE_TIME = 'one_time',\n /** Recurs every `count` months. */\n MONTH = 'month',\n /** Recurs every `count` years. */\n YEAR = 'year',\n}\n\n/**\n * What one public price amount MEANS.\n *\n * A single amount can state a flat price or a per-unit price. It cannot state a tiered, graduated or\n * package price, whose total depends on quantity; for those the amount is indicative only, so no\n * surface may present it — or publish it in structured data — as the price.\n */\nexport enum PublicPricingAmountBasis {\n /** The amount is the whole price for the period. */\n FLAT = 'flat',\n /** The amount is per unit (a seat, a member) for the period. */\n PER_UNIT = 'per_unit',\n /** The total depends on quantity (tiered, graduated, package): the amount is indicative only. */\n VARIABLE = 'variable',\n}\n\n/** One public price of a plan. */\nexport interface PublicPricingPrice {\n /** The price amount in the currency's MINOR units, as decimal digits (see the file header). */\n readonly amountMinor: string;\n /** How many decimal places `amountMinor` carries: the value is `amountMinor / 10 ** decimals`. */\n readonly decimals: number;\n /** ISO 4217 currency code. */\n readonly currency: string;\n readonly recurrence: { readonly unit: PublicPricingRecurrenceUnit; readonly count: number };\n readonly amountBasis: PublicPricingAmountBasis;\n /** The price the catalogue marks as the plan's default. */\n readonly isDefault: boolean;\n}\n\n/** One public plan: a product the catalogue lists publicly, with its pricing-surface facts resolved. */\nexport interface PublicPricingPlan {\n /** The catalogue key — also the label namespace a surface names the plan by. */\n readonly key: string;\n readonly planTier?: string;\n /** Ascending order on a pricing surface. */\n readonly sortOrder: number;\n /** The scopes that may subscribe (wire values of `ResourcePrimaryScope`). */\n readonly targetScopes: readonly string[];\n readonly isRecommended: boolean;\n readonly priceDisclosure: ProductPriceDisclosure;\n readonly availability: ProductAvailability;\n /** Free-trial length when the plan offers one. */\n readonly trialDays?: number;\n readonly prices: readonly PublicPricingPrice[];\n}\n\n/** The public pricing catalogue: every publicly listed plan, in display order. */\nexport interface PublicPricingCatalog {\n readonly plans: readonly PublicPricingPlan[];\n}\n\n/**\n * The amount of a public price as a plain decimal string (`\"4\"`, `\"29.9\"`, `\"0.0001\"`), exact — no\n * floating point. What structured data publishes as `price`, and what a surface formats for display.\n */\nexport function publicPricingAmountDecimal(price: Pick<PublicPricingPrice, 'amountMinor' | 'decimals'>): string {\n const negative = price.amountMinor.startsWith('-');\n const digits = (negative ? price.amountMinor.slice(1) : price.amountMinor).replace(/^0+(?=\\d)/, '');\n if (price.decimals <= 0) return `${negative ? '-' : ''}${digits}`;\n const padded = digits.padStart(price.decimals + 1, '0');\n const whole = padded.slice(0, padded.length - price.decimals);\n const fraction = padded.slice(padded.length - price.decimals).replace(/0+$/, '');\n return `${negative ? '-' : ''}${whole}${fraction.length > 0 ? `.${fraction}` : ''}`;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"public-pricing-catalog.shared.d.ts","sourceRoot":"","sources":["../../../../src/billing/public-pricing-catalog.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAG9F,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,uCAAuC,CAAC;AAiB/C,MAAM,WAAW,iCAAiC;IAChD;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,SAAS,iBAAiB,EAAE,EACzC,OAAO,GAAE,iCAAsC,GAC9C,oBAAoB,CAsBtB"}
1
+ {"version":3,"file":"public-pricing-catalog.shared.d.ts","sourceRoot":"","sources":["../../../src/billing/public-pricing-catalog.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAG9F,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,uCAAuC,CAAC;AAiB/C,MAAM,WAAW,iCAAiC;IAChD;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,SAAS,iBAAiB,EAAE,EACzC,OAAO,GAAE,iCAAsC,GAC9C,oBAAoB,CAsBtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"public-pricing-catalog.shared.js","sourceRoot":"","sources":["../../../../src/billing/public-pricing-catalog.shared.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EACL,wBAAwB,EACxB,2BAA2B,GAI5B,MAAM,uCAAuC,CAAC;AAE/C,qGAAqG;AACrG,MAAM,8BAA8B,GAAyD;IAC3F,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,KAAK;IAC1D,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,2BAA2B,CAAC,IAAI;CACzD,CAAC;AAEF,0GAA0G;AAC1G,MAAM,6BAA6B,GAAmD;IACpF,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,wBAAwB,CAAC,IAAI;IAClD,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,wBAAw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ChC,GAAG,CAAC,SAAS,KAAK,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;YACnE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;SACpD,CAAC;IACJ,CAAC,CAAC,CAAC;IACL,sGAAsG;IACtG,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;AACvF,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAsB;IAClD,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE;QAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ;QAClC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC1C,UAAU,EAAE,KAAK,CAAC,QAAQ,KAAK,SAAS;YACtC,CAAC,CAAC,EAAE,IAAI,EAAE,2BAA2B,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1D,CAAC,CAAC,EAAE,IAAI,EAAE,8BAA8B,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,IAAI,CAAC,EAAE;QAC7F,WAAW,EAAE,6BAA6B,CAAC,KAAK,CAAC,KAAK,CAAC;QACvD,iHAAiH;QACjH,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI;KACnC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * `derivePublicPricingCatalog` — the billing catalogue as a public pricing surface may state it (#1835).\n *\n * The public website must not keep its own copy of the prices it advertises: before this, every\n * application's pricing section re-typed its prices by hand, and Wonder Todos' site published a $12\n * tier its own catalogue does not sell. So the website reads THIS, derived from the same\n * `ProductDefinition[]` the backend syncs to the billing provider — one catalogue, two surfaces.\n *\n * It lives on the root barrel, not beside the plain types in `./public-pricing-catalog.shared.atoms`,\n * because it needs the billing vocabularies (`ProductType`, `BillingInterval`, `PricingModel`) that\n * may not reach a browser bundle. It runs on the build side and hands the browser plain data.\n *\n * ## What is public\n *\n * PLAN products the catalogue lists publicly (`isPublic` not `false`) — the same visibility rule the\n * application's own pricing table applies. Add-ons, metered products and one-off purchases are not\n * plans a visitor chooses between. RETIRED products never reach this function: it reads the code\n * catalogue, and a product retired from the catalogue is by definition no longer in it.\n */\nimport type { PriceDefinition, ProductDefinition } from './product-definition.shared.schemas';\nimport { resolveProductPricingSurfaceFacts } from './product-definition.shared.schemas';\nimport { ProductType, PricingModel, BillingInterval } from './billing-enums.shared.schemas';\nimport {\n PublicPricingAmountBasis,\n PublicPricingRecurrenceUnit,\n type PublicPricingCatalog,\n type PublicPricingPlan,\n type PublicPricingPrice,\n} from './public-pricing-catalog.shared.atoms';\n\n/** Total over `BillingInterval`: a member added there is a compile error here until it is mapped. */\nconst RECURRENCE_BY_BILLING_INTERVAL: Record<BillingInterval, PublicPricingRecurrenceUnit> = {\n [BillingInterval.MONTH]: PublicPricingRecurrenceUnit.MONTH,\n [BillingInterval.YEAR]: PublicPricingRecurrenceUnit.YEAR,\n};\n\n/** Total over `PricingModel`: which models a single amount can state (see `PublicPricingAmountBasis`). */\nconst AMOUNT_BASIS_BY_PRICING_MODEL: Record<PricingModel, PublicPricingAmountBasis> = {\n [PricingModel.FLAT]: PublicPricingAmountBasis.FLAT,\n [PricingModel.PER_UNIT]: PublicPricingAmountBasis.PER_UNIT,\n [PricingModel.TIERED]: PublicPricingAmountBasis.VARIABLE,\n [PricingModel.GRADUATED]: PublicPricingAmountBasis.VARIABLE,\n [PricingModel.PACKAGE]: PublicPricingAmountBasis.VARIABLE,\n};\n\nexport interface DerivePublicPricingCatalogOptions {\n /**\n * Keep only plans this scope may subscribe to (a `ResourcePrimaryScope` wire value). Omit to keep\n * every public plan — the right answer for a site whose catalogue sells to one audience.\n */\n readonly targetScope?: string;\n}\n\nexport function derivePublicPricingCatalog(\n definitions: readonly ProductDefinition[],\n options: DerivePublicPricingCatalogOptions = {},\n): PublicPricingCatalog {\n const plans = definitions\n .filter((definition) => definition.type === ProductType.PLAN && definition.isPublic !== false)\n .filter((definition) => options.targetScope === undefined || definition.targetScopes.some((scope) => scope === options.targetScope))\n .map((definition): PublicPricingPlan => {\n const facts = resolveProductPricingSurfaceFacts(definition);\n const trialDays = definition.behaviorPolicy?.trial?.days;\n return {\n key: definition.key,\n ...(definition.planTier === undefined ? {} : { planTier: definition.planTier }),\n // The persisted `Product` resource defaults `sortOrder` to 0; apply the same fallback.\n sortOrder: definition.sortOrder ?? 0,\n targetScopes: [...definition.targetScopes],\n isRecommended: facts.isRecommended,\n priceDisclosure: facts.priceDisclosure,\n availability: facts.availability,\n ...(trialDays === undefined || trialDays <= 0 ? {} : { trialDays }),\n prices: definition.prices.map(toPublicPricingPrice),\n };\n });\n // Stable: equal `sortOrder`s keep catalogue order, so the page does not reorder on an unrelated edit.\n return { plans: [...plans].sort((left, right) => left.sortOrder - right.sortOrder) };\n}\n\nfunction toPublicPricingPrice(price: PriceDefinition): PublicPricingPrice {\n return {\n amountMinor: price.unitPrice.amount.toString(),\n decimals: price.unitPrice.decimals,\n currency: String(price.unitPrice.currency),\n recurrence: price.interval === undefined\n ? { unit: PublicPricingRecurrenceUnit.ONE_TIME, count: 1 }\n : { unit: RECURRENCE_BY_BILLING_INTERVAL[price.interval], count: price.intervalCount ?? 1 },\n amountBasis: AMOUNT_BASIS_BY_PRICING_MODEL[price.model],\n // `PriceDefinitionSchema` defaults `isDefault` to true; a hand-authored definition that omits it means the same.\n isDefault: price.isDefault ?? true,\n };\n}\n"]}
1
+ {"version":3,"file":"public-pricing-catalog.shared.js","sourceRoot":"","sources":["../../../src/billing/public-pricing-catalog.shared.ts"],"names":[],"mappings":"AAoBA,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SAAS;YACtC,CAAC,CAAC,EAAE,IAAI,EAAE,2BAA2B,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1D,CAAC,CAAC,EAAE,IAAI,EAAE,8BAA8B,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,IAAI,CAAC,EAAE;QAC7F,WAAW,EAAE,6BAA6B,CAAC,KAAK,CAAC,KAAK,CAAC;QACvD,iHAAiH;QACjH,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI;KACnC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * `derivePublicPricingCatalog` — the billing catalogue as a public pricing surface may state it (#1835).\n *\n * The public website must not keep its own copy of the prices it advertises: before this, every\n * application's pricing section re-typed its prices by hand, and Wonder Todos' site published a $12\n * tier its own catalogue does not sell. So the website reads THIS, derived from the same\n * `ProductDefinition[]` the backend syncs to the billing provider — one catalogue, two surfaces.\n *\n * It lives on the root barrel, not beside the plain types in `./public-pricing-catalog.shared.atoms`,\n * because it needs the billing vocabularies (`ProductType`, `BillingInterval`, `PricingModel`) that\n * may not reach a browser bundle. It runs on the build side and hands the browser plain data.\n *\n * ## What is public\n *\n * PLAN products the catalogue lists publicly (`isPublic` not `false`) — the same visibility rule the\n * application's own pricing table applies. Add-ons, metered products and one-off purchases are not\n * plans a visitor chooses between. RETIRED products never reach this function: it reads the code\n * catalogue, and a product retired from the catalogue is by definition no longer in it.\n */\nimport type { PriceDefinition, ProductDefinition } from './product-definition.shared.schemas';\nimport { resolveProductPricingSurfaceFacts } from './product-definition.shared.schemas';\nimport { ProductType, PricingModel, BillingInterval } from './billing-enums.shared.schemas';\nimport {\n PublicPricingAmountBasis,\n PublicPricingRecurrenceUnit,\n type PublicPricingCatalog,\n type PublicPricingPlan,\n type PublicPricingPrice,\n} from './public-pricing-catalog.shared.atoms';\n\n/** Total over `BillingInterval`: a member added there is a compile error here until it is mapped. */\nconst RECURRENCE_BY_BILLING_INTERVAL: Record<BillingInterval, PublicPricingRecurrenceUnit> = {\n [BillingInterval.MONTH]: PublicPricingRecurrenceUnit.MONTH,\n [BillingInterval.YEAR]: PublicPricingRecurrenceUnit.YEAR,\n};\n\n/** Total over `PricingModel`: which models a single amount can state (see `PublicPricingAmountBasis`). */\nconst AMOUNT_BASIS_BY_PRICING_MODEL: Record<PricingModel, PublicPricingAmountBasis> = {\n [PricingModel.FLAT]: PublicPricingAmountBasis.FLAT,\n [PricingModel.PER_UNIT]: PublicPricingAmountBasis.PER_UNIT,\n [PricingModel.TIERED]: PublicPricingAmountBasis.VARIABLE,\n [PricingModel.GRADUATED]: PublicPricingAmountBasis.VARIABLE,\n [PricingModel.PACKAGE]: PublicPricingAmountBasis.VARIABLE,\n};\n\nexport interface DerivePublicPricingCatalogOptions {\n /**\n * Keep only plans this scope may subscribe to (a `ResourcePrimaryScope` wire value). Omit to keep\n * every public plan — the right answer for a site whose catalogue sells to one audience.\n */\n readonly targetScope?: string;\n}\n\nexport function derivePublicPricingCatalog(\n definitions: readonly ProductDefinition[],\n options: DerivePublicPricingCatalogOptions = {},\n): PublicPricingCatalog {\n const plans = definitions\n .filter((definition) => definition.type === ProductType.PLAN && definition.isPublic !== false)\n .filter((definition) => options.targetScope === undefined || definition.targetScopes.some((scope) => scope === options.targetScope))\n .map((definition): PublicPricingPlan => {\n const facts = resolveProductPricingSurfaceFacts(definition);\n const trialDays = definition.behaviorPolicy?.trial?.days;\n return {\n key: definition.key,\n ...(definition.planTier === undefined ? {} : { planTier: definition.planTier }),\n // The persisted `Product` resource defaults `sortOrder` to 0; apply the same fallback.\n sortOrder: definition.sortOrder ?? 0,\n targetScopes: [...definition.targetScopes],\n isRecommended: facts.isRecommended,\n priceDisclosure: facts.priceDisclosure,\n availability: facts.availability,\n ...(trialDays === undefined || trialDays <= 0 ? {} : { trialDays }),\n prices: definition.prices.map(toPublicPricingPrice),\n };\n });\n // Stable: equal `sortOrder`s keep catalogue order, so the page does not reorder on an unrelated edit.\n return { plans: [...plans].sort((left, right) => left.sortOrder - right.sortOrder) };\n}\n\nfunction toPublicPricingPrice(price: PriceDefinition): PublicPricingPrice {\n return {\n amountMinor: price.unitPrice.amount.toString(),\n decimals: price.unitPrice.decimals,\n currency: String(price.unitPrice.currency),\n recurrence: price.interval === undefined\n ? { unit: PublicPricingRecurrenceUnit.ONE_TIME, count: 1 }\n : { unit: RECURRENCE_BY_BILLING_INTERVAL[price.interval], count: price.intervalCount ?? 1 },\n amountBasis: AMOUNT_BASIS_BY_PRICING_MODEL[price.model],\n // `PriceDefinitionSchema` defaults `isDefault` to true; a hand-authored definition that omits it means the same.\n isDefault: price.isDefault ?? true,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"referral-reward.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/referral-reward.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAE3G;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAIjG,CAAC;AAkBF,sDAAsD;AACtD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,kBAAkB,CAI5G;AAoCD,oHAAoH;AACpH,6DAA6D;AAC7D,eAAO,MAAM,oBAAoB;;;;;;;;;iBAGA,CAAC;AAClC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,0CAA0C;AAC1C,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAIA,CAAC;AAClC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,kEAAkE"}
1
+ {"version":3,"file":"referral-reward.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/referral-reward.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAE3G;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAIjG,CAAC;AAkBF,sDAAsD;AACtD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,kBAAkB,CAI5G;AAoCD,oHAAoH;AACpH,6DAA6D;AAC7D,eAAO,MAAM,oBAAoB;;;;;;;;;iBAGA,CAAC;AAClC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,0CAA0C;AAC1C,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAIA,CAAC;AAClC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,kEAAkE"}