@wildo-ai/saas-specifications 1.1.1 → 1.1.3

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 (633) hide show
  1. package/dist/esm/_core/brand/brand-asset.schemas.d.ts +4 -6
  2. package/dist/esm/_core/brand/brand-asset.schemas.d.ts.map +1 -1
  3. package/dist/esm/_core/brand/brand-asset.schemas.js +4 -12
  4. package/dist/esm/_core/brand/brand-asset.schemas.js.map +1 -1
  5. package/dist/esm/_core/brand/brand-generation.schemas.d.ts +5 -3
  6. package/dist/esm/_core/brand/brand-generation.schemas.d.ts.map +1 -1
  7. package/dist/esm/_core/brand/brand-generation.schemas.js +5 -2
  8. package/dist/esm/_core/brand/brand-generation.schemas.js.map +1 -1
  9. package/dist/esm/_core/brand/brand-snapshot.schemas.d.ts +10 -3
  10. package/dist/esm/_core/brand/brand-snapshot.schemas.d.ts.map +1 -1
  11. package/dist/esm/_core/brand/brand-snapshot.schemas.js +10 -2
  12. package/dist/esm/_core/brand/brand-snapshot.schemas.js.map +1 -1
  13. package/dist/esm/_core/brand/brand.family-aspects.d.ts +3 -0
  14. package/dist/esm/_core/brand/brand.family-aspects.d.ts.map +1 -0
  15. package/dist/esm/_core/brand/brand.family-aspects.js +51 -0
  16. package/dist/esm/_core/brand/brand.family-aspects.js.map +1 -0
  17. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
  18. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.js +15 -5
  19. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.js.map +1 -1
  20. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +40 -3
  21. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
  22. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +85 -6
  23. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
  24. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts +3 -0
  25. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -0
  26. package/dist/esm/_core/build-plan/build-plan.family-aspects.js +28 -0
  27. package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -0
  28. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.d.ts.map +1 -1
  29. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js +10 -4
  30. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js.map +1 -1
  31. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts +15 -0
  32. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts.map +1 -1
  33. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.js.map +1 -1
  34. package/dist/esm/_core/business-model-lite/business-model.family-aspects.d.ts +3 -0
  35. package/dist/esm/_core/business-model-lite/business-model.family-aspects.d.ts.map +1 -0
  36. package/dist/esm/_core/business-model-lite/business-model.family-aspects.js +21 -0
  37. package/dist/esm/_core/business-model-lite/business-model.family-aspects.js.map +1 -0
  38. package/dist/esm/_core/chart-view-specification.schemas.d.ts +11 -0
  39. package/dist/esm/_core/chart-view-specification.schemas.d.ts.map +1 -1
  40. package/dist/esm/_core/chart-view-specification.schemas.js.map +1 -1
  41. package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.d.ts +85 -0
  42. package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.d.ts.map +1 -1
  43. package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.js +41 -0
  44. package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.js.map +1 -1
  45. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +178 -2
  46. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
  47. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +115 -9
  48. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
  49. package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.d.ts +12 -0
  50. package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.d.ts.map +1 -0
  51. package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.js +47 -0
  52. package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.js.map +1 -0
  53. package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.d.ts.map +1 -1
  54. package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.js +8 -3
  55. package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.js.map +1 -1
  56. package/dist/esm/_core/compliance-documents/processor-register.family-aspects.d.ts +21 -0
  57. package/dist/esm/_core/compliance-documents/processor-register.family-aspects.d.ts.map +1 -0
  58. package/dist/esm/_core/compliance-documents/processor-register.family-aspects.js +40 -0
  59. package/dist/esm/_core/compliance-documents/processor-register.family-aspects.js.map +1 -0
  60. package/dist/esm/_core/composite-view-specification.schemas.d.ts +11 -0
  61. package/dist/esm/_core/composite-view-specification.schemas.d.ts.map +1 -1
  62. package/dist/esm/_core/composite-view-specification.schemas.js.map +1 -1
  63. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +3 -0
  64. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -0
  65. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +32 -0
  66. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -0
  67. package/dist/esm/_core/execution-view-specification.schemas.d.ts +11 -0
  68. package/dist/esm/_core/execution-view-specification.schemas.d.ts.map +1 -1
  69. package/dist/esm/_core/execution-view-specification.schemas.js.map +1 -1
  70. package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.d.ts +6 -7
  71. package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.d.ts.map +1 -1
  72. package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.js +6 -13
  73. package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.js.map +1 -1
  74. package/dist/esm/_core/expert-personas/expert-persona-validation.d.ts +0 -11
  75. package/dist/esm/_core/expert-personas/expert-persona-validation.d.ts.map +1 -1
  76. package/dist/esm/_core/expert-personas/expert-persona-validation.js +0 -19
  77. package/dist/esm/_core/expert-personas/expert-persona-validation.js.map +1 -1
  78. package/dist/esm/_core/expert-personas/expert-role-template.schemas.d.ts +1 -2
  79. package/dist/esm/_core/expert-personas/expert-role-template.schemas.d.ts.map +1 -1
  80. package/dist/esm/_core/expert-personas/expert-role-template.schemas.js +1 -2
  81. package/dist/esm/_core/expert-personas/expert-role-template.schemas.js.map +1 -1
  82. package/dist/esm/_core/family-aspects.registry.d.ts +18 -0
  83. package/dist/esm/_core/family-aspects.registry.d.ts.map +1 -0
  84. package/dist/esm/_core/family-aspects.registry.js +60 -0
  85. package/dist/esm/_core/family-aspects.registry.js.map +1 -0
  86. package/dist/esm/_core/family-aspects.schemas.d.ts +122 -0
  87. package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -0
  88. package/dist/esm/_core/family-aspects.schemas.js +15 -0
  89. package/dist/esm/_core/family-aspects.schemas.js.map +1 -0
  90. package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +11 -11
  91. package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.d.ts +3 -0
  92. package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.d.ts.map +1 -0
  93. package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.js +25 -0
  94. package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.js.map +1 -0
  95. package/dist/esm/_core/feature-drafts/feature-specification-drafts-generation.schemas.d.ts.map +1 -1
  96. package/dist/esm/_core/feature-drafts/feature-specification-drafts-generation.schemas.js +17 -4
  97. package/dist/esm/_core/feature-drafts/feature-specification-drafts-generation.schemas.js.map +1 -1
  98. package/dist/esm/_core/flows-actors-view-specification.schemas.d.ts +11 -0
  99. package/dist/esm/_core/flows-actors-view-specification.schemas.d.ts.map +1 -1
  100. package/dist/esm/_core/flows-actors-view-specification.schemas.js.map +1 -1
  101. package/dist/esm/_core/frontend-component-specification.schemas.d.ts.map +1 -1
  102. package/dist/esm/_core/frontend-component-specification.schemas.js +19 -1
  103. package/dist/esm/_core/frontend-component-specification.schemas.js.map +1 -1
  104. package/dist/esm/_core/full-custom-view-specification.schemas.d.ts +11 -0
  105. package/dist/esm/_core/full-custom-view-specification.schemas.d.ts.map +1 -1
  106. package/dist/esm/_core/full-custom-view-specification.schemas.js.map +1 -1
  107. package/dist/esm/_core/guidance-flow-specification.schemas.d.ts +11 -0
  108. package/dist/esm/_core/guidance-flow-specification.schemas.d.ts.map +1 -1
  109. package/dist/esm/_core/guidance-flow-specification.schemas.js +14 -0
  110. package/dist/esm/_core/guidance-flow-specification.schemas.js.map +1 -1
  111. package/dist/esm/_core/index.d.ts +3 -0
  112. package/dist/esm/_core/index.d.ts.map +1 -1
  113. package/dist/esm/_core/index.js +3 -0
  114. package/dist/esm/_core/index.js.map +1 -1
  115. package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +22 -22
  116. package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts.map +1 -1
  117. package/dist/esm/_core/market/market-snapshot-generation.schemas.js +5 -40
  118. package/dist/esm/_core/market/market-snapshot-generation.schemas.js.map +1 -1
  119. package/dist/esm/_core/market/market-snapshot-validation.d.ts +15 -0
  120. package/dist/esm/_core/market/market-snapshot-validation.d.ts.map +1 -1
  121. package/dist/esm/_core/market/market-snapshot-validation.js.map +1 -1
  122. package/dist/esm/_core/market/market.family-aspects.d.ts +9 -0
  123. package/dist/esm/_core/market/market.family-aspects.d.ts.map +1 -0
  124. package/dist/esm/_core/market/market.family-aspects.js +227 -0
  125. package/dist/esm/_core/market/market.family-aspects.js.map +1 -0
  126. package/dist/esm/_core/onboarding-view-specification.schemas.d.ts +11 -0
  127. package/dist/esm/_core/onboarding-view-specification.schemas.d.ts.map +1 -1
  128. package/dist/esm/_core/onboarding-view-specification.schemas.js +14 -0
  129. package/dist/esm/_core/onboarding-view-specification.schemas.js.map +1 -1
  130. package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.d.ts.map +1 -1
  131. package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.js +11 -5
  132. package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.js.map +1 -1
  133. package/dist/esm/_core/placement-plan/placement-plan-validation.d.ts +66 -9
  134. package/dist/esm/_core/placement-plan/placement-plan-validation.d.ts.map +1 -1
  135. package/dist/esm/_core/placement-plan/placement-plan-validation.js +62 -20
  136. package/dist/esm/_core/placement-plan/placement-plan-validation.js.map +1 -1
  137. package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts +3 -0
  138. package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts.map +1 -0
  139. package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js +31 -0
  140. package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js.map +1 -0
  141. package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts +4 -1
  142. package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts.map +1 -1
  143. package/dist/esm/_core/placement-plan/placement-plan.schemas.js +4 -1
  144. package/dist/esm/_core/placement-plan/placement-plan.schemas.js.map +1 -1
  145. package/dist/esm/_core/provider-specification.schemas.d.ts +82 -0
  146. package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -0
  147. package/dist/esm/_core/provider-specification.schemas.js +144 -0
  148. package/dist/esm/_core/provider-specification.schemas.js.map +1 -0
  149. package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.d.ts.map +1 -1
  150. package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.js +13 -8
  151. package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.js.map +1 -1
  152. package/dist/esm/_core/requirements/requirements-snapshot-validation.d.ts +15 -0
  153. package/dist/esm/_core/requirements/requirements-snapshot-validation.d.ts.map +1 -1
  154. package/dist/esm/_core/requirements/requirements-snapshot-validation.js.map +1 -1
  155. package/dist/esm/_core/requirements/requirements.family-aspects.d.ts +9 -0
  156. package/dist/esm/_core/requirements/requirements.family-aspects.d.ts.map +1 -0
  157. package/dist/esm/_core/requirements/requirements.family-aspects.js +40 -0
  158. package/dist/esm/_core/requirements/requirements.family-aspects.js.map +1 -0
  159. package/dist/esm/_core/resource-specification.schemas.d.ts +22 -0
  160. package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
  161. package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
  162. package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.d.ts.map +1 -1
  163. package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.js +7 -2
  164. package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.js.map +1 -1
  165. package/dist/esm/_core/roadmap/roadmap-snapshot-validation.d.ts +15 -0
  166. package/dist/esm/_core/roadmap/roadmap-snapshot-validation.d.ts.map +1 -1
  167. package/dist/esm/_core/roadmap/roadmap-snapshot-validation.js.map +1 -1
  168. package/dist/esm/_core/roadmap/roadmap.family-aspects.d.ts +3 -0
  169. package/dist/esm/_core/roadmap/roadmap.family-aspects.d.ts.map +1 -0
  170. package/dist/esm/_core/roadmap/roadmap.family-aspects.js +26 -0
  171. package/dist/esm/_core/roadmap/roadmap.family-aspects.js.map +1 -0
  172. package/dist/esm/_core/utils/family-ref-stamping.d.ts +64 -0
  173. package/dist/esm/_core/utils/family-ref-stamping.d.ts.map +1 -0
  174. package/dist/esm/_core/utils/family-ref-stamping.js +73 -0
  175. package/dist/esm/_core/utils/family-ref-stamping.js.map +1 -0
  176. package/dist/esm/_core/vision/vision-snapshot-generation.schemas.d.ts.map +1 -1
  177. package/dist/esm/_core/vision/vision-snapshot-generation.schemas.js +23 -9
  178. package/dist/esm/_core/vision/vision-snapshot-generation.schemas.js.map +1 -1
  179. package/dist/esm/_core/vision/vision.family-aspects.d.ts +11 -0
  180. package/dist/esm/_core/vision/vision.family-aspects.d.ts.map +1 -0
  181. package/dist/esm/_core/vision/vision.family-aspects.js +63 -0
  182. package/dist/esm/_core/vision/vision.family-aspects.js.map +1 -0
  183. package/dist/esm/application-creation/application-coding-tasks.application-creation.schemas.d.ts +0 -4
  184. package/dist/esm/application-creation/application-coding-tasks.application-creation.schemas.d.ts.map +1 -1
  185. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +193 -38
  186. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
  187. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +157 -57
  188. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
  189. package/dist/esm/application-creation/application-document-release-policy-specification.application-creation.schemas.d.ts +3 -3
  190. package/dist/esm/application-creation/application-document-release-policy-specification.application-creation.schemas.js +3 -3
  191. package/dist/esm/application-creation/application-document-release-policy-specification.application-creation.schemas.js.map +1 -1
  192. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts +38 -4
  193. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts.map +1 -1
  194. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js +37 -3
  195. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js.map +1 -1
  196. package/dist/esm/application-creation/document-facts.family-aspects.d.ts +12 -0
  197. package/dist/esm/application-creation/document-facts.family-aspects.d.ts.map +1 -0
  198. package/dist/esm/application-creation/document-facts.family-aspects.js +37 -0
  199. package/dist/esm/application-creation/document-facts.family-aspects.js.map +1 -0
  200. package/dist/esm/application-creation/document-release-policy.family-aspects.d.ts +3 -0
  201. package/dist/esm/application-creation/document-release-policy.family-aspects.d.ts.map +1 -0
  202. package/dist/esm/application-creation/document-release-policy.family-aspects.js +23 -0
  203. package/dist/esm/application-creation/document-release-policy.family-aspects.js.map +1 -0
  204. package/dist/esm/application-creation/journey.application-creation.schemas.d.ts +18 -6
  205. package/dist/esm/application-creation/journey.application-creation.schemas.d.ts.map +1 -1
  206. package/dist/esm/application-creation/journey.application-creation.schemas.js +18 -6
  207. package/dist/esm/application-creation/journey.application-creation.schemas.js.map +1 -1
  208. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +101 -85
  209. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
  210. package/dist/esm/application-creation/playbooks.application-creation.schemas.js +171 -86
  211. package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
  212. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts +2 -0
  213. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts.map +1 -1
  214. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js +2 -0
  215. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js.map +1 -1
  216. package/dist/esm/application-creation.exports.d.ts +11 -0
  217. package/dist/esm/application-creation.exports.d.ts.map +1 -1
  218. package/dist/esm/application-creation.exports.js +11 -0
  219. package/dist/esm/application-creation.exports.js.map +1 -1
  220. package/dist/esm/assurance/application-document-publication.schemas.d.ts +20 -6
  221. package/dist/esm/assurance/application-document-publication.schemas.d.ts.map +1 -1
  222. package/dist/esm/assurance/application-document-publication.schemas.js +26 -10
  223. package/dist/esm/assurance/application-document-publication.schemas.js.map +1 -1
  224. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +999 -2
  225. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
  226. package/dist/esm/assurance/assurance-authority-basis.definitions.js +2127 -61
  227. package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
  228. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +26 -0
  229. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
  230. package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
  231. package/dist/esm/assurance/assurance-document-system.definitions.js +18 -3
  232. package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
  233. package/dist/esm/assurance/assurance-document-system.schemas.d.ts +32 -2
  234. package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
  235. package/dist/esm/assurance/assurance-document-system.schemas.js +32 -2
  236. package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
  237. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts +36 -0
  238. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -0
  239. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +859 -0
  240. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -0
  241. package/dist/esm/assurance/assurance-external-framework-mapping.d.ts +90 -0
  242. package/dist/esm/assurance/assurance-external-framework-mapping.d.ts.map +1 -0
  243. package/dist/esm/assurance/assurance-external-framework-mapping.js +134 -0
  244. package/dist/esm/assurance/assurance-external-framework-mapping.js.map +1 -0
  245. package/dist/esm/assurance/assurance-foundation.schemas.d.ts +43 -0
  246. package/dist/esm/assurance/assurance-foundation.schemas.d.ts.map +1 -1
  247. package/dist/esm/assurance/assurance-foundation.schemas.js +56 -0
  248. package/dist/esm/assurance/assurance-foundation.schemas.js.map +1 -1
  249. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts +78 -1
  250. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
  251. package/dist/esm/assurance/assurance-objective-catalog.definitions.js +562 -5
  252. package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
  253. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +148 -0
  254. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -0
  255. package/dist/esm/assurance/assurance-program-generation.schemas.js +385 -0
  256. package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -0
  257. package/dist/esm/assurance/assurance-program.family-aspects.d.ts +13 -0
  258. package/dist/esm/assurance/assurance-program.family-aspects.d.ts.map +1 -0
  259. package/dist/esm/assurance/assurance-program.family-aspects.js +16 -0
  260. package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -0
  261. package/dist/esm/assurance/assurance-program.schemas.d.ts +474 -14
  262. package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
  263. package/dist/esm/assurance/assurance-program.schemas.js +319 -8
  264. package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
  265. package/dist/esm/assurance/assurance-source-registry.definitions.d.ts +1 -0
  266. package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
  267. package/dist/esm/assurance/assurance-source-registry.definitions.js +12 -0
  268. package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
  269. package/dist/esm/assurance/assurance-sources.schemas.d.ts +76 -0
  270. package/dist/esm/assurance/assurance-sources.schemas.d.ts.map +1 -1
  271. package/dist/esm/assurance/assurance-sources.schemas.js +59 -0
  272. package/dist/esm/assurance/assurance-sources.schemas.js.map +1 -1
  273. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts +35 -0
  274. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -0
  275. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +999 -0
  276. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -0
  277. package/dist/esm/assurance/document-publication.family-aspects.d.ts +29 -0
  278. package/dist/esm/assurance/document-publication.family-aspects.d.ts.map +1 -0
  279. package/dist/esm/assurance/document-publication.family-aspects.js +48 -0
  280. package/dist/esm/assurance/document-publication.family-aspects.js.map +1 -0
  281. package/dist/esm/assurance.exports.d.ts +2 -0
  282. package/dist/esm/assurance.exports.d.ts.map +1 -1
  283. package/dist/esm/assurance.exports.js +2 -0
  284. package/dist/esm/assurance.exports.js.map +1 -1
  285. package/dist/esm/companion-exports.d.ts +26 -8
  286. package/dist/esm/companion-exports.d.ts.map +1 -1
  287. package/dist/esm/companion-exports.js.map +1 -1
  288. package/dist/esm/engine/_bootstrap.js +3 -1
  289. package/dist/esm/engine/_bootstrap.js.map +1 -1
  290. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
  291. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +15 -1
  292. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
  293. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.d.ts.map +1 -1
  294. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +4 -2
  295. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
  296. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts +2 -0
  297. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
  298. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +17 -3
  299. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
  300. package/dist/esm/engine/applications/resources/application-versions.resource.specification.d.ts.map +1 -1
  301. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +12 -10
  302. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
  303. package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts.map +1 -1
  304. package/dist/esm/engine/applications/resources/applications.resource.specification.js +4 -2
  305. package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
  306. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.d.ts +36 -0
  307. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.d.ts.map +1 -0
  308. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js +193 -0
  309. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js.map +1 -0
  310. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts +1 -1
  311. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts.map +1 -1
  312. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +3 -1
  313. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
  314. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
  315. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +15 -1
  316. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
  317. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts +2 -0
  318. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
  319. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +17 -3
  320. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
  321. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts +32 -0
  322. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts.map +1 -0
  323. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js +308 -0
  324. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js.map +1 -0
  325. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts +1 -1
  326. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts.map +1 -1
  327. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +6 -4
  328. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
  329. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts.map +1 -1
  330. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +4 -2
  331. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
  332. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts.map +1 -1
  333. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +8 -6
  334. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
  335. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
  336. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +11 -9
  337. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
  338. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.d.ts.map +1 -1
  339. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +8 -6
  340. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js.map +1 -1
  341. package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts +9 -25
  342. package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
  343. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +106 -10
  344. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
  345. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts +0 -6
  346. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
  347. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js +2 -0
  348. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
  349. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts +32 -0
  350. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts.map +1 -0
  351. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js +297 -0
  352. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js.map +1 -0
  353. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts +2 -2
  354. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
  355. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +6 -3
  356. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
  357. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +8 -8
  358. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts.map +1 -1
  359. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +4 -2
  360. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
  361. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts +2 -2
  362. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts.map +1 -1
  363. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +5 -3
  364. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
  365. package/dist/esm/engine/billing/resources/prices.resource.specification.d.ts.map +1 -1
  366. package/dist/esm/engine/billing/resources/prices.resource.specification.js +10 -8
  367. package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
  368. package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
  369. package/dist/esm/engine/billing/resources/products.resource.specification.js +10 -8
  370. package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
  371. package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
  372. package/dist/esm/engine/billing/resources/promotions.resource.specification.js +16 -12
  373. package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
  374. package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
  375. package/dist/esm/engine/billing/resources/referrals.resource.specification.js +10 -8
  376. package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
  377. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +6 -6
  378. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
  379. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +8 -3
  380. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
  381. package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts +13 -9
  382. package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts.map +1 -1
  383. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +30 -11
  384. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
  385. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts.map +1 -1
  386. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +10 -8
  387. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
  388. package/dist/esm/engine/engine-resource-specifications.registry.d.ts +2 -2
  389. package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
  390. package/dist/esm/engine/engine-resource-specifications.registry.js +11 -2
  391. package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
  392. package/dist/esm/engine/engine-resource-sub-domain.d.ts +83 -0
  393. package/dist/esm/engine/engine-resource-sub-domain.d.ts.map +1 -0
  394. package/dist/esm/engine/engine-resource-sub-domain.js +153 -0
  395. package/dist/esm/engine/engine-resource-sub-domain.js.map +1 -0
  396. package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
  397. package/dist/esm/engine/errors/error-messages.specification.js +44 -1
  398. package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
  399. package/dist/esm/engine/features/audit-logs.feature.specification.js +4 -4
  400. package/dist/esm/engine/features/audit-logs.feature.specification.js.map +1 -1
  401. package/dist/esm/engine/features/core-limits.feature.specifications.js +7 -7
  402. package/dist/esm/engine/features/core-limits.feature.specifications.js.map +1 -1
  403. package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts.map +1 -1
  404. package/dist/esm/engine/features/resources/application-features.resource.specification.js +5 -3
  405. package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
  406. package/dist/esm/engine/features/resources/organization-features.resource.specification.d.ts.map +1 -1
  407. package/dist/esm/engine/features/resources/organization-features.resource.specification.js +5 -3
  408. package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
  409. package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts +1 -1
  410. package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts.map +1 -1
  411. package/dist/esm/engine/features/resources/user-features.resource.specification.js +5 -3
  412. package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -1
  413. package/dist/esm/engine/files/resources/files.resource.specification.d.ts.map +1 -1
  414. package/dist/esm/engine/files/resources/files.resource.specification.js +12 -10
  415. package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
  416. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts +3 -3
  417. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts.map +1 -1
  418. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +22 -10
  419. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
  420. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.d.ts +3 -3
  421. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.d.ts.map +1 -1
  422. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +6 -4
  423. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
  424. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +3 -3
  425. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts.map +1 -1
  426. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +4 -2
  427. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
  428. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts +3 -3
  429. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts.map +1 -1
  430. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -1
  431. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
  432. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts +5 -0
  433. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts.map +1 -0
  434. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js +81 -0
  435. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js.map +1 -0
  436. package/dist/esm/engine/frontend-components/app/public-layout-file-upload-grant.frontend-component.specification.d.ts +4 -0
  437. package/dist/esm/engine/frontend-components/app/public-layout-file-upload-grant.frontend-component.specification.d.ts.map +1 -0
  438. package/dist/esm/engine/frontend-components/app/public-layout-file-upload-grant.frontend-component.specification.js +22 -0
  439. package/dist/esm/engine/frontend-components/app/public-layout-file-upload-grant.frontend-component.specification.js.map +1 -0
  440. package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.d.ts.map +1 -1
  441. package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js +8 -3
  442. package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js.map +1 -1
  443. package/dist/esm/engine/frontend-components/billing/billing-plan-change-preview.frontend-component.specification.d.ts +0 -4
  444. package/dist/esm/engine/frontend-components/billing/billing-plan-change-preview.frontend-component.specification.d.ts.map +0 -1
  445. package/dist/esm/engine/frontend-components/billing/billing-plan-change-preview.frontend-component.specification.js +0 -21
  446. package/dist/esm/engine/frontend-components/billing/billing-plan-change-preview.frontend-component.specification.js.map +0 -1
  447. package/dist/esm/engine/frontend-components/billing/billing-promotion-code-input.frontend-component.specification.d.ts +0 -4
  448. package/dist/esm/engine/frontend-components/billing/billing-promotion-code-input.frontend-component.specification.d.ts.map +0 -1
  449. package/dist/esm/engine/frontend-components/billing/billing-promotion-code-input.frontend-component.specification.js +0 -21
  450. package/dist/esm/engine/frontend-components/billing/billing-promotion-code-input.frontend-component.specification.js.map +0 -1
  451. package/dist/esm/engine/frontend-components/index.d.ts +0 -2
  452. package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
  453. package/dist/esm/engine/frontend-components/index.js +4 -6
  454. package/dist/esm/engine/frontend-components/index.js.map +1 -1
  455. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.d.ts +1 -1
  456. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.d.ts.map +1 -1
  457. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +15 -12
  458. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
  459. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts +1 -1
  460. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts.map +1 -1
  461. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +12 -9
  462. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
  463. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts +9 -1
  464. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
  465. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +9 -6
  466. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
  467. package/dist/esm/engine/index.d.ts +2 -0
  468. package/dist/esm/engine/index.d.ts.map +1 -1
  469. package/dist/esm/engine/index.js +2 -0
  470. package/dist/esm/engine/index.js.map +1 -1
  471. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.d.ts.map +1 -1
  472. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +19 -17
  473. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
  474. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.d.ts.map +1 -1
  475. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +9 -7
  476. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
  477. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
  478. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +10 -8
  479. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
  480. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts +7 -2
  481. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts.map +1 -1
  482. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +12 -5
  483. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
  484. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
  485. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +22 -15
  486. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
  487. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts +1 -1
  488. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map +1 -1
  489. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +14 -10
  490. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
  491. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
  492. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +31 -6
  493. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
  494. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +1 -1
  495. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
  496. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +11 -9
  497. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
  498. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.d.ts.map +1 -1
  499. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +5 -3
  500. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
  501. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.d.ts.map +1 -1
  502. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +6 -4
  503. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
  504. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts.map +1 -1
  505. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +4 -2
  506. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
  507. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts.map +1 -1
  508. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +3 -1
  509. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
  510. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.d.ts.map +1 -1
  511. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +2 -0
  512. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
  513. package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
  514. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +9 -7
  515. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
  516. package/dist/esm/engine/providers/_engine-provider-shared.d.ts +9 -0
  517. package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -0
  518. package/dist/esm/engine/providers/_engine-provider-shared.js +19 -0
  519. package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -0
  520. package/dist/esm/engine/providers/anthropic.provider.specification.d.ts +7 -0
  521. package/dist/esm/engine/providers/anthropic.provider.specification.d.ts.map +1 -0
  522. package/dist/esm/engine/providers/anthropic.provider.specification.js +33 -0
  523. package/dist/esm/engine/providers/anthropic.provider.specification.js.map +1 -0
  524. package/dist/esm/engine/providers/apple.provider.specification.d.ts +7 -0
  525. package/dist/esm/engine/providers/apple.provider.specification.d.ts.map +1 -0
  526. package/dist/esm/engine/providers/apple.provider.specification.js +35 -0
  527. package/dist/esm/engine/providers/apple.provider.specification.js.map +1 -0
  528. package/dist/esm/engine/providers/email-preview.provider.specification.d.ts +7 -0
  529. package/dist/esm/engine/providers/email-preview.provider.specification.d.ts.map +1 -0
  530. package/dist/esm/engine/providers/email-preview.provider.specification.js +31 -0
  531. package/dist/esm/engine/providers/email-preview.provider.specification.js.map +1 -0
  532. package/dist/esm/engine/providers/github.provider.specification.d.ts +7 -0
  533. package/dist/esm/engine/providers/github.provider.specification.d.ts.map +1 -0
  534. package/dist/esm/engine/providers/github.provider.specification.js +30 -0
  535. package/dist/esm/engine/providers/github.provider.specification.js.map +1 -0
  536. package/dist/esm/engine/providers/google.provider.specification.d.ts +7 -0
  537. package/dist/esm/engine/providers/google.provider.specification.d.ts.map +1 -0
  538. package/dist/esm/engine/providers/google.provider.specification.js +34 -0
  539. package/dist/esm/engine/providers/google.provider.specification.js.map +1 -0
  540. package/dist/esm/engine/providers/grok.provider.specification.d.ts +7 -0
  541. package/dist/esm/engine/providers/grok.provider.specification.d.ts.map +1 -0
  542. package/dist/esm/engine/providers/grok.provider.specification.js +30 -0
  543. package/dist/esm/engine/providers/grok.provider.specification.js.map +1 -0
  544. package/dist/esm/engine/providers/index.d.ts +23 -0
  545. package/dist/esm/engine/providers/index.d.ts.map +1 -0
  546. package/dist/esm/engine/providers/index.js +37 -0
  547. package/dist/esm/engine/providers/index.js.map +1 -0
  548. package/dist/esm/engine/providers/microsoft.provider.specification.d.ts +7 -0
  549. package/dist/esm/engine/providers/microsoft.provider.specification.d.ts.map +1 -0
  550. package/dist/esm/engine/providers/microsoft.provider.specification.js +30 -0
  551. package/dist/esm/engine/providers/microsoft.provider.specification.js.map +1 -0
  552. package/dist/esm/engine/providers/mistral.provider.specification.d.ts +7 -0
  553. package/dist/esm/engine/providers/mistral.provider.specification.d.ts.map +1 -0
  554. package/dist/esm/engine/providers/mistral.provider.specification.js +33 -0
  555. package/dist/esm/engine/providers/mistral.provider.specification.js.map +1 -0
  556. package/dist/esm/engine/providers/openai.provider.specification.d.ts +7 -0
  557. package/dist/esm/engine/providers/openai.provider.specification.d.ts.map +1 -0
  558. package/dist/esm/engine/providers/openai.provider.specification.js +43 -0
  559. package/dist/esm/engine/providers/openai.provider.specification.js.map +1 -0
  560. package/dist/esm/engine/providers/opencode.provider.specification.d.ts +7 -0
  561. package/dist/esm/engine/providers/opencode.provider.specification.d.ts.map +1 -0
  562. package/dist/esm/engine/providers/opencode.provider.specification.js +50 -0
  563. package/dist/esm/engine/providers/opencode.provider.specification.js.map +1 -0
  564. package/dist/esm/engine/providers/perplexity.provider.specification.d.ts +7 -0
  565. package/dist/esm/engine/providers/perplexity.provider.specification.d.ts.map +1 -0
  566. package/dist/esm/engine/providers/perplexity.provider.specification.js +30 -0
  567. package/dist/esm/engine/providers/perplexity.provider.specification.js.map +1 -0
  568. package/dist/esm/engine/providers/resend.provider.specification.d.ts +7 -0
  569. package/dist/esm/engine/providers/resend.provider.specification.d.ts.map +1 -0
  570. package/dist/esm/engine/providers/resend.provider.specification.js +33 -0
  571. package/dist/esm/engine/providers/resend.provider.specification.js.map +1 -0
  572. package/dist/esm/engine/providers/stripe.provider.specification.d.ts +7 -0
  573. package/dist/esm/engine/providers/stripe.provider.specification.d.ts.map +1 -0
  574. package/dist/esm/engine/providers/stripe.provider.specification.js +35 -0
  575. package/dist/esm/engine/providers/stripe.provider.specification.js.map +1 -0
  576. package/dist/esm/engine/providers/twilio.provider.specification.d.ts +7 -0
  577. package/dist/esm/engine/providers/twilio.provider.specification.d.ts.map +1 -0
  578. package/dist/esm/engine/providers/twilio.provider.specification.js +33 -0
  579. package/dist/esm/engine/providers/twilio.provider.specification.js.map +1 -0
  580. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.d.ts.map +1 -1
  581. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +9 -7
  582. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
  583. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts +1 -1
  584. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts.map +1 -1
  585. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +11 -9
  586. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
  587. package/dist/esm/engine/users/resources/user-credentials.resource.specification.d.ts +1 -1
  588. package/dist/esm/engine/users/resources/user-credentials.resource.specification.d.ts.map +1 -1
  589. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +4 -2
  590. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js.map +1 -1
  591. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts +1 -1
  592. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts.map +1 -1
  593. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js +10 -8
  594. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
  595. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +5 -5
  596. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
  597. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +6 -4
  598. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
  599. package/dist/esm/engine/users/resources/user-profiles.resource.specification.d.ts +1 -1
  600. package/dist/esm/engine/users/resources/user-profiles.resource.specification.d.ts.map +1 -1
  601. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +4 -2
  602. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
  603. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +5 -5
  604. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
  605. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +15 -11
  606. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
  607. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.d.ts +1 -1
  608. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.d.ts.map +1 -1
  609. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +3 -1
  610. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
  611. package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts.map +1 -1
  612. package/dist/esm/engine/users/resources/user-self.resource.specification.js +11 -9
  613. package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
  614. package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
  615. package/dist/esm/engine/users/resources/users.resource.specification.js +95 -0
  616. package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
  617. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts +5 -0
  618. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
  619. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +451 -25
  620. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
  621. package/dist/esm/technical-documentation/technical-documentation-units.schemas.d.ts +37 -1
  622. package/dist/esm/technical-documentation/technical-documentation-units.schemas.d.ts.map +1 -1
  623. package/dist/esm/technical-documentation/technical-documentation-units.schemas.js +37 -1
  624. package/dist/esm/technical-documentation/technical-documentation-units.schemas.js.map +1 -1
  625. package/dist/tsconfig.build.tsbuildinfo +1 -0
  626. package/package.json +8 -8
  627. package/dist/esm/.builder.pid +0 -9
  628. package/dist/esm/_core/business-coverage/coverage-findings-validation.d.ts +0 -0
  629. package/dist/esm/_core/business-coverage/coverage-findings-validation.d.ts.map +0 -0
  630. package/dist/esm/_core/business-coverage/coverage-findings-validation.js.map +0 -0
  631. package/dist/esm/_core/business-coverage/coverage-findings.schemas.d.ts +0 -0
  632. package/dist/esm/_core/business-coverage/coverage-findings.schemas.d.ts.map +0 -0
  633. package/dist/esm/_core/business-coverage/coverage-findings.schemas.js.map +0 -0
@@ -3,13 +3,15 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
3
3
  import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
4
4
  import { CoreResourceOperation as Op, BillingInterval, PriceSchema, PricingModel, ResourcePrimaryScope, TaxDisplayMode, UsageAggregationType, pricesResourceConfiguration_InitializationFactory as pricesFactory, } from '@wildo-ai/saas-models';
5
5
  import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
6
+ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
6
7
  const pricesMainUI = pricesMainSource;
7
8
  const pricesAdminUI = pricesAdminSource;
8
9
  const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaShape }) => ({
9
- purpose: 'One concrete price for a product (model, money, interval, tiers) — the row checkout and subscriptions reference through `priceId`.',
10
+ purpose: 'One way to pay for a product: its pricing model, amount, currency, billing interval and tiers. Checkout and subscriptions refer to a price by its identifier.',
10
11
  businessRole: 'Binds a catalog product to a billable money shape (flat, per-unit, tiered, …) the provider can invoice.',
11
12
  lifecycleRole: 'Admin-managed: created with products; activation toggles hide from new purchases without mutating old subscriptions in typical flows.',
12
13
  audience: LabelAudience.ADMIN,
14
+ subDomain: EngineResourceSubDomain.BILLING,
13
15
  codeHandling: {
14
16
  mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PriceSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },
15
17
  resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'pricesResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },
@@ -21,7 +23,7 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
21
23
  ],
22
24
  },
23
25
  fields: {
24
- _id: schemaShape._id.stringSpec({ meaning: 'Price row id; referenced as `priceId` on subscription items.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),
26
+ _id: schemaShape._id.stringSpec({ meaning: 'Price record id; referenced as `priceId` on subscription items.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),
25
27
  productId: schemaShape.productId.stringSpec({ meaning: 'FK to the owning `PRODUCTS` document.', importance: FieldSemanticImportance.PRIMARY }),
26
28
  model: schemaShape.model.enumSpec({
27
29
  meaning: 'Stripe-style pricing model for how quantity maps to line items.',
@@ -34,7 +36,7 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
34
36
  [PricingModel.PACKAGE]: { meaning: 'Blocks of units sold as packages.' },
35
37
  },
36
38
  }),
37
- unitPrice: schemaShape.unitPrice.objectSpec({ meaning: 'Money object (amount + currency) for FLAT/PER_UNIT models; not used for pure tiered/graduated rows that rely on `tiers` instead.' }),
39
+ unitPrice: schemaShape.unitPrice.objectSpec({ meaning: 'Money object (amount + currency) for FLAT/PER_UNIT models; not used for pure tiered/graduated records that rely on `tiers` instead.' }),
38
40
  interval: schemaShape.interval.enumSpec({
39
41
  meaning: 'Billing period anchor when recurring.',
40
42
  enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingInterval', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },
@@ -47,7 +49,7 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
47
49
  tiers: schemaShape.tiers.arraySpec({ meaning: 'Tier ladder for TIERED/GRADUATED models with per-tier money blocks.', elementMeaning: 'One `PriceTierSchema` row with `upTo`, `unitPrice`, and `flatPrice` money objects.' }),
48
50
  packageSize: schemaShape.packageSize.numberSpec({ meaning: 'Units per price package for PACKAGE model pricing.' }),
49
51
  usageAggregation: schemaShape.usageAggregation.enumSpec({
50
- meaning: 'Authored intent for how a provider meter should roll up usage. The current application metering flush always groups pending local rows by account and product and sums their quantities; it does not consume this field, so the provider meter configuration and observed invoice remain the effective billing proof.',
52
+ meaning: 'Authored intent for how a provider meter should roll up usage. The current application metering flush always groups pending local records by account and product and sums their quantities; it does not consume this field, so the provider meter configuration and observed invoice remain the effective billing proof.',
51
53
  enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'UsageAggregationType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },
52
54
  values: {
53
55
  [UsageAggregationType.SUM]: { meaning: 'Sum raw quantities in the period.' },
@@ -66,14 +68,14 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
66
68
  providerPriceId: schemaShape.providerPriceId.stringSpec({ meaning: 'Provider price id for sync; backend-only in many responses.' }),
67
69
  isDefault: schemaShape.isDefault.booleanSpec({ meaning: 'Preferred default price for UIs that pick one price per product if multiple exist.' }),
68
70
  isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether new checkouts can select this price when multiple exist.' }),
69
- createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Row creation time.', temporalRole: 'creation' }),
71
+ createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),
70
72
  },
71
73
  operations: {
72
74
  [Op.READ]: {
73
75
  purpose: 'Read price details for plan pickers, invoice lines, and admin audit.',
74
76
  outcome: 'Money + interval + tier blocks per schema.',
75
77
  responseStatuses: [
76
- { code: HttpResponseStatusCode.OK_200, meaning: 'The price row was found and its money / interval / tier blocks are returned.' },
78
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was found and its money / interval / tier blocks are returned.' },
77
79
  ],
78
80
  errorScenarios: [
79
81
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },
@@ -131,7 +133,7 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
131
133
  purpose: 'Change activation, default flag, or money fields in controlled admin flows.',
132
134
  outcome: 'Patched row — verify provider sync rules before claiming invoices update retroactively.',
133
135
  responseStatuses: [
134
- { code: HttpResponseStatusCode.OK_200, meaning: 'The price row was patched (activation / default flag / money fields) and the updated DTO is returned.' },
136
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was patched (activation / default flag / money fields) and the updated DTO is returned.' },
135
137
  ],
136
138
  errorScenarios: [
137
139
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },
@@ -145,7 +147,7 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
145
147
  purpose: 'Repository-only teardown of the price row when its owning product is deleted (composition `onParentDelete` cascade).',
146
148
  outcome: 'Every price under the product is removed together with the product — the composition parts do not outlive their whole.',
147
149
  responseStatuses: [
148
- { code: HttpResponseStatusCode.OK_200, meaning: 'The price row was deleted as part of the owning product’s deletion cascade.' },
150
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was deleted as part of the owning product’s deletion cascade.' },
149
151
  ],
150
152
  // REPOSITORY_ONLY variant (ORG_OWNER) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.
151
153
  idempotent: true,
@@ -1 +1 @@
1
- {"version":3,"file":"prices.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/prices.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,IAAI,iBAAiB,EAClD,4BAA4B,IAAI,gBAAgB,GACjD,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,eAAe,EACf,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,iDAAiD,IAAI,aAAa,GACnE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AAKrC,MAAM,YAAY,GAAG,gBAAmE,CAAC;AACzF,MAAM,aAAa,GAAG,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QAC5H,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,OAAO,EAAE,qEAAqE,EAAE,SAAS,EAAE,uDAAuD,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,2FAA2F,EAAE,EAAE,EAAE;YAC3U,KAAK,EAAE,EAAE,OAAO,EAAE,wEAAwE,EAAE,SAAS,EAAE,+BAA+B,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,EAAE,EAAE;YAClS,GAAG,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE,SAAS,EAAE,oCAAoC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,mEAAmE,EAAE,EAAE,EAAE;YACrQ,YAAY,EAAE,EAAE,OAAO,EAAE,sEAAsE,EAAE,SAAS,EAAE,kFAAkF,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,yGAAyG,EAAE,EAAE,EAAE;SAChY;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,2BAA2B,EAAE;QAC3I,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,mCAAmC,EAAE;KACpJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n pricesAdminResourceUIBehavior as pricesAdminSource,\n pricesMainResourceUIBehavior as pricesMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n BillingInterval,\n PriceSchema,\n PricingModel,\n ResourcePrimaryScope,\n TaxDisplayMode,\n UsageAggregationType,\n pricesResourceConfiguration_InitializationFactory as pricesFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\n\ntype Cfg = ReturnType<typeof pricesFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst pricesMainUI = pricesMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst pricesAdminUI = pricesAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst pricesBase = resourceSpecification<undefined, Core, Main>(\n pricesFactory,\n PriceSchema,\n ({ schemaShape }) => ({\n purpose: 'One concrete price for a product (model, money, interval, tiers) — the row checkout and subscriptions reference through `priceId`.',\n businessRole: 'Binds a catalog product to a billable money shape (flat, per-unit, tiered, …) the provider can invoice.',\n lifecycleRole: 'Admin-managed: created with products; activation toggles hide from new purchases without mutating old subscriptions in typical flows.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PriceSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'pricesResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PRICES' },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'pricesMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'pricesAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Price row id; referenced as `priceId` on subscription items.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n productId: schemaShape.productId.stringSpec({ meaning: 'FK to the owning `PRODUCTS` document.', importance: FieldSemanticImportance.PRIMARY }),\n model: schemaShape.model.enumSpec({\n meaning: 'Stripe-style pricing model for how quantity maps to line items.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PricingModel', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PricingModel.FLAT]: { meaning: 'One fixed price without per-seat scaling.' },\n [PricingModel.PER_UNIT]: { meaning: 'Linear in quantity (seats, tokens bucket).' },\n [PricingModel.TIERED]: { meaning: 'Volume pricing: the reached tier supplies the unit rate for the whole quantity.' },\n [PricingModel.GRADUATED]: { meaning: 'Graduated pricing: each quantity bracket is priced independently and the bracket amounts are added.' },\n [PricingModel.PACKAGE]: { meaning: 'Blocks of units sold as packages.' },\n },\n }),\n unitPrice: schemaShape.unitPrice.objectSpec({ meaning: 'Money object (amount + currency) for FLAT/PER_UNIT models; not used for pure tiered/graduated rows that rely on `tiers` instead.' }),\n interval: schemaShape.interval.enumSpec({\n meaning: 'Billing period anchor when recurring.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingInterval', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [BillingInterval.MONTH]: { meaning: 'Monthly cadence at provider.' },\n [BillingInterval.YEAR]: { meaning: 'Annual cadence at provider.' },\n },\n }),\n intervalCount: schemaShape.intervalCount.numberSpec({ meaning: 'Multiplier on interval (e.g. every 3 months).' }),\n tiers: schemaShape.tiers.arraySpec({ meaning: 'Tier ladder for TIERED/GRADUATED models with per-tier money blocks.', elementMeaning: 'One `PriceTierSchema` row with `upTo`, `unitPrice`, and `flatPrice` money objects.' }),\n packageSize: schemaShape.packageSize.numberSpec({ meaning: 'Units per price package for PACKAGE model pricing.' }),\n usageAggregation: schemaShape.usageAggregation.enumSpec({\n meaning:\n 'Authored intent for how a provider meter should roll up usage. The current application metering flush always groups pending local rows by account and product and sums their quantities; it does not consume this field, so the provider meter configuration and observed invoice remain the effective billing proof.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'UsageAggregationType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [UsageAggregationType.SUM]: { meaning: 'Sum raw quantities in the period.' },\n [UsageAggregationType.MAX]: { meaning: 'Use peak usage in the period when the price model calls for it.' },\n [UsageAggregationType.LAST]: { meaning: 'Use the last reported sample in the window for certain meter designs.' },\n },\n }),\n taxBehavior: schemaShape.taxBehavior.enumSpec({\n meaning: 'Per-price tax display — overrides product-level `taxDisplayMode` when set.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'TaxDisplayMode', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [TaxDisplayMode.EXCLUSIVE]: { meaning: 'HT list amounts before tax in invoices using this price.' },\n [TaxDisplayMode.INCLUSIVE]: { meaning: 'TTC amounts embedded in the published price point.' },\n },\n }),\n providerPriceId: schemaShape.providerPriceId.stringSpec({ meaning: 'Provider price id for sync; backend-only in many responses.' }),\n isDefault: schemaShape.isDefault.booleanSpec({ meaning: 'Preferred default price for UIs that pick one price per product if multiple exist.' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether new checkouts can select this price when multiple exist.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Row creation time.', temporalRole: 'creation' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read price details for plan pickers, invoice lines, and admin audit.',\n outcome: 'Money + interval + tier blocks per schema.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price row was found and its money / interval / tier blocks are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'List prices; often filter by `productId` in application code.',\n outcome: 'All offers for a product in admin.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of price offers, optionally narrowed by `productId`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to browse the full price catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Add a new offer row under a product when catalog expands.',\n outcome: 'New price id in catalog.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The price offer was created under its product and is returned with its server-assigned `priceId`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The price payload fails schema validation (e.g. a TIERED model with no `tiers`, or a missing `unitPrice` for FLAT/PER_UNIT).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to extend the price catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `productId` does not exist in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A price already maps to the same provider price id (duplicate provider sync target).', errorCode: 'PROVIDER_PRICE_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Add a recurring per-seat monthly price to a product',\n request: {\n productId: 'prod_01HX2…',\n model: PricingModel.PER_UNIT,\n unitPrice: { amount: 1200, currency: 'usd' },\n interval: BillingInterval.MONTH,\n intervalCount: 1,\n isDefault: true,\n isActive: true,\n },\n response: {\n _id: 'price_01HX2…',\n productId: 'prod_01HX2…',\n model: PricingModel.PER_UNIT,\n interval: BillingInterval.MONTH,\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Change activation, default flag, or money fields in controlled admin flows.',\n outcome: 'Patched row — verify provider sync rules before claiming invoices update retroactively.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price row was patched (activation / default flag / money fields) and the updated DTO is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the price catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The price is already synced/locked at the provider in a way that forbids mutating immutable money fields (provider prices are immutable after creation).' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the price row when its owning product is deleted (composition `onParentDelete` cascade).',\n outcome: 'Every price under the product is removed together with the product — the composition parts do not outlive their whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price row was deleted as part of the owning product’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (ORG_OWNER) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Tax behavior and tier arrays can be large — UI should paginate or collapse in admin when many tiers exist.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const pricesResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(pricesMainUI), resourceFrontendConfiguration(pricesAdminUI)),\n pricesBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses `model — interval` (or one-time) for a compact sublabel under the product context.' },\n layout: {\n purpose: 'Section refs `pricing`, `tiers`, `tax`, `availability` in billing presets: money + cadence, tier ladders, tax behavior, default/active flags.',\n displayPurpose: 'Merged admin adds LIST+READ `views` (non-addressable) on top of main empty-views for catalog admin browse.',\n sections: {\n pricing: { purpose: 'Model, `unitPrice`, and interval for the headline commercial terms.', whenToUse: 'Checkout price selection and subscription diff tools.', textSlots: { title: { purpose: 'Pricing block.' }, description: { purpose: 'Provider ids may exist as backend-only fields in implementation — not in this spec layer.' } } },\n tiers: { purpose: 'Volume tiers, package size, and usage aggregation for advanced models.', whenToUse: 'Metered and tiered SKUs only.', textSlots: { title: { purpose: 'Tiers block.' }, description: { purpose: 'Empty in flat pricing — UI should not imply misconfiguration when absent.' } } },\n tax: { purpose: 'Tax display behavior on invoices for this price.', whenToUse: 'Jurisdictional checkout messaging.', textSlots: { title: { purpose: 'Tax block.' }, description: { purpose: 'Not a legal tax engine in Wildo — provider calculates actual tax.' } } },\n availability: { purpose: '`isDefault` and `isActive` to steer which price auto-selects in UIs.', whenToUse: 'When multiple active prices per product are normal (regional, promo base, etc.).', textSlots: { title: { purpose: 'Availability block.' }, description: { purpose: 'Deactivating a price does not by itself change existing subscription items until change-plan flows run.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin LIST view entry (non-addressable in billing `views` wiring).', whenToUse: 'Catalog admin for prices.' },\n [Op.READ]: { purpose: 'Merged admin READ view entry (non-addressable in billing `views` wiring).', whenToUse: 'Admin drill-down on one price id.' },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"prices.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/prices.resource.specification.ts"],"names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EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,mEAAmE,EAAE,EAAE,EAAE;YACrQ,YAAY,EAAE,EAAE,OAAO,EAAE,sEAAsE,EAAE,SAAS,EAAE,kFAAkF,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,yGAAyG,EAAE,EAAE,EAAE;SAChY;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,2BAA2B,EAAE;QAC3I,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,mCAAmC,EAAE;KACpJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n pricesAdminResourceUIBehavior as pricesAdminSource,\n pricesMainResourceUIBehavior as pricesMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n BillingInterval,\n PriceSchema,\n PricingModel,\n ResourcePrimaryScope,\n TaxDisplayMode,\n UsageAggregationType,\n pricesResourceConfiguration_InitializationFactory as pricesFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof pricesFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst pricesMainUI = pricesMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst pricesAdminUI = pricesAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst pricesBase = resourceSpecification<undefined, Core, Main>(\n pricesFactory,\n PriceSchema,\n ({ schemaShape }) => ({\n purpose: 'One way to pay for a product: its pricing model, amount, currency, billing interval and tiers. Checkout and subscriptions refer to a price by its identifier.',\n businessRole: 'Binds a catalog product to a billable money shape (flat, per-unit, tiered, …) the provider can invoice.',\n lifecycleRole: 'Admin-managed: created with products; activation toggles hide from new purchases without mutating old subscriptions in typical flows.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PriceSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'pricesResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PRICES' },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'pricesMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'pricesAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Price record id; referenced as `priceId` on subscription items.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n productId: schemaShape.productId.stringSpec({ meaning: 'FK to the owning `PRODUCTS` document.', importance: FieldSemanticImportance.PRIMARY }),\n model: schemaShape.model.enumSpec({\n meaning: 'Stripe-style pricing model for how quantity maps to line items.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PricingModel', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PricingModel.FLAT]: { meaning: 'One fixed price without per-seat scaling.' },\n [PricingModel.PER_UNIT]: { meaning: 'Linear in quantity (seats, tokens bucket).' },\n [PricingModel.TIERED]: { meaning: 'Volume pricing: the reached tier supplies the unit rate for the whole quantity.' },\n [PricingModel.GRADUATED]: { meaning: 'Graduated pricing: each quantity bracket is priced independently and the bracket amounts are added.' },\n [PricingModel.PACKAGE]: { meaning: 'Blocks of units sold as packages.' },\n },\n }),\n unitPrice: schemaShape.unitPrice.objectSpec({ meaning: 'Money object (amount + currency) for FLAT/PER_UNIT models; not used for pure tiered/graduated records that rely on `tiers` instead.' }),\n interval: schemaShape.interval.enumSpec({\n meaning: 'Billing period anchor when recurring.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingInterval', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [BillingInterval.MONTH]: { meaning: 'Monthly cadence at provider.' },\n [BillingInterval.YEAR]: { meaning: 'Annual cadence at provider.' },\n },\n }),\n intervalCount: schemaShape.intervalCount.numberSpec({ meaning: 'Multiplier on interval (e.g. every 3 months).' }),\n tiers: schemaShape.tiers.arraySpec({ meaning: 'Tier ladder for TIERED/GRADUATED models with per-tier money blocks.', elementMeaning: 'One `PriceTierSchema` row with `upTo`, `unitPrice`, and `flatPrice` money objects.' }),\n packageSize: schemaShape.packageSize.numberSpec({ meaning: 'Units per price package for PACKAGE model pricing.' }),\n usageAggregation: schemaShape.usageAggregation.enumSpec({\n meaning:\n 'Authored intent for how a provider meter should roll up usage. The current application metering flush always groups pending local records by account and product and sums their quantities; it does not consume this field, so the provider meter configuration and observed invoice remain the effective billing proof.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'UsageAggregationType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [UsageAggregationType.SUM]: { meaning: 'Sum raw quantities in the period.' },\n [UsageAggregationType.MAX]: { meaning: 'Use peak usage in the period when the price model calls for it.' },\n [UsageAggregationType.LAST]: { meaning: 'Use the last reported sample in the window for certain meter designs.' },\n },\n }),\n taxBehavior: schemaShape.taxBehavior.enumSpec({\n meaning: 'Per-price tax display — overrides product-level `taxDisplayMode` when set.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'TaxDisplayMode', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [TaxDisplayMode.EXCLUSIVE]: { meaning: 'HT list amounts before tax in invoices using this price.' },\n [TaxDisplayMode.INCLUSIVE]: { meaning: 'TTC amounts embedded in the published price point.' },\n },\n }),\n providerPriceId: schemaShape.providerPriceId.stringSpec({ meaning: 'Provider price id for sync; backend-only in many responses.' }),\n isDefault: schemaShape.isDefault.booleanSpec({ meaning: 'Preferred default price for UIs that pick one price per product if multiple exist.' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether new checkouts can select this price when multiple exist.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read price details for plan pickers, invoice lines, and admin audit.',\n outcome: 'Money + interval + tier blocks per schema.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was found and its money / interval / tier blocks are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'List prices; often filter by `productId` in application code.',\n outcome: 'All offers for a product in admin.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of price offers, optionally narrowed by `productId`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to browse the full price catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Add a new offer row under a product when catalog expands.',\n outcome: 'New price id in catalog.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The price offer was created under its product and is returned with its server-assigned `priceId`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The price payload fails schema validation (e.g. a TIERED model with no `tiers`, or a missing `unitPrice` for FLAT/PER_UNIT).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to extend the price catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `productId` does not exist in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A price already maps to the same provider price id (duplicate provider sync target).', errorCode: 'PROVIDER_PRICE_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Add a recurring per-seat monthly price to a product',\n request: {\n productId: 'prod_01HX2…',\n model: PricingModel.PER_UNIT,\n unitPrice: { amount: 1200, currency: 'usd' },\n interval: BillingInterval.MONTH,\n intervalCount: 1,\n isDefault: true,\n isActive: true,\n },\n response: {\n _id: 'price_01HX2…',\n productId: 'prod_01HX2…',\n model: PricingModel.PER_UNIT,\n interval: BillingInterval.MONTH,\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Change activation, default flag, or money fields in controlled admin flows.',\n outcome: 'Patched row — verify provider sync rules before claiming invoices update retroactively.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was patched (activation / default flag / money fields) and the updated DTO is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the price catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The price is already synced/locked at the provider in a way that forbids mutating immutable money fields (provider prices are immutable after creation).' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the price row when its owning product is deleted (composition `onParentDelete` cascade).',\n outcome: 'Every price under the product is removed together with the product — the composition parts do not outlive their whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was deleted as part of the owning product’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (ORG_OWNER) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Tax behavior and tier arrays can be large — UI should paginate or collapse in admin when many tiers exist.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const pricesResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(pricesMainUI), resourceFrontendConfiguration(pricesAdminUI)),\n pricesBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses `model — interval` (or one-time) for a compact sublabel under the product context.' },\n layout: {\n purpose: 'Section refs `pricing`, `tiers`, `tax`, `availability` in billing presets: money + cadence, tier ladders, tax behavior, default/active flags.',\n displayPurpose: 'Merged admin adds LIST+READ `views` (non-addressable) on top of main empty-views for catalog admin browse.',\n sections: {\n pricing: { purpose: 'Model, `unitPrice`, and interval for the headline commercial terms.', whenToUse: 'Checkout price selection and subscription diff tools.', textSlots: { title: { purpose: 'Pricing block.' }, description: { purpose: 'Provider ids may exist as backend-only fields in implementation — not in this spec layer.' } } },\n tiers: { purpose: 'Volume tiers, package size, and usage aggregation for advanced models.', whenToUse: 'Metered and tiered SKUs only.', textSlots: { title: { purpose: 'Tiers block.' }, description: { purpose: 'Empty in flat pricing — UI should not imply misconfiguration when absent.' } } },\n tax: { purpose: 'Tax display behavior on invoices for this price.', whenToUse: 'Jurisdictional checkout messaging.', textSlots: { title: { purpose: 'Tax block.' }, description: { purpose: 'Not a legal tax engine in Wildo — provider calculates actual tax.' } } },\n availability: { purpose: '`isDefault` and `isActive` to steer which price auto-selects in UIs.', whenToUse: 'When multiple active prices per product are normal (regional, promo base, etc.).', textSlots: { title: { purpose: 'Availability block.' }, description: { purpose: 'Deactivating a price does not by itself change existing subscription items until change-plan flows run.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin LIST view entry (non-addressable in billing `views` wiring).', whenToUse: 'Catalog admin for prices.' },\n [Op.READ]: { purpose: 'Merged admin READ view entry (non-addressable in billing `views` wiring).', whenToUse: 'Admin drill-down on one price id.' },\n },\n }),\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"products.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/products.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,WAAW,EAEX,oBAAoB,EACpB,cAAc,EAEf,MAAM,uBAAuB,CAAC;AA4K/B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAqBzC,CAAC"}
1
+ {"version":3,"file":"products.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/products.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,WAAW,EAEX,oBAAoB,EACpB,cAAc,EAEf,MAAM,uBAAuB,CAAC;AA8K/B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAqBzC,CAAC"}
@@ -3,13 +3,15 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
3
3
  import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
4
4
  import { CoreResourceOperation as Op, ProductType, ProductSchema, ResourcePrimaryScope, TaxDisplayMode, productsResourceConfiguration_InitializationFactory as productsFactory, } from '@wildo-ai/saas-models';
5
5
  import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
6
+ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
6
7
  const productsMainUI = productsMainSource;
7
8
  const productsAdminUI = productsAdminSource;
8
9
  const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ schemaShape }) => ({
9
- purpose: 'Application-scoped product catalog row: mirrors code `ProductDefinition` into Mongo for provider sync, entitlement evaluation, and admin browse — not arbitrary tenant merchandising in typical flows.',
10
+ purpose: 'One product in the application\'s catalog: the plan, add-on or credit pack an organization can subscribe to, with the features and limits it grants. The catalog is defined by the application, not edited per organization.',
10
11
  businessRole: 'Anchor for prices, promotions, and subscription line items; drives plan tiers, add-ons, and feature/limit grants.',
11
12
  lifecycleRole: 'Lazy DB row created from definitions; provider ids filled on first use; bulk sync in admin; edits are deployment-driven, not ad-hoc CRUD in end-user UI.',
12
13
  audience: LabelAudience.ADMIN,
14
+ subDomain: EngineResourceSubDomain.BILLING,
13
15
  codeHandling: {
14
16
  mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ProductSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },
15
17
  resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'productsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },
@@ -29,7 +31,7 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
29
31
  values: {
30
32
  [ProductType.PLAN]: { meaning: 'Primary subscription entitlements and tiering.' },
31
33
  [ProductType.ADDON]: { meaning: 'Optional capacity or feature on top of a plan.' },
32
- [ProductType.METERED]: { meaning: 'Usage-billed add-on; ties to `UsageRecord` rows.' },
34
+ [ProductType.METERED]: { meaning: 'Usage-billed add-on; ties to `UsageRecord` records.' },
33
35
  [ProductType.ONE_TIME]: { meaning: 'One-shot purchase, not a recurring subscription state machine.' },
34
36
  [ProductType.CREDIT_PACK]: { meaning: 'Prepaid credits to a `CreditPool` balance.' },
35
37
  [ProductType.ITEM]: { meaning: 'Generic one-off line item in catalog semantics.' },
@@ -62,18 +64,18 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
62
64
  behaviorPolicy: schemaShape.behaviorPolicy.objectSpec({ meaning: 'Nested policy for trial, proration, cancellation windows, and metering hooks — the authoritative behavior engine for this SKU in services.' }),
63
65
  providerProductId: schemaShape.providerProductId.stringSpec({ meaning: 'Provider-side id after first sync — backend-only in many API shapes.' }),
64
66
  isPublic: schemaShape.isPublic.booleanSpec({ meaning: 'Visibility for self-serve catalog vs org-admin-only offer matrix.' }),
65
- isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether the product is offered to new checkouts; historical subs may still reference inactive rows.' }),
67
+ isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether the product is offered to new checkouts; historical subs may still reference inactive records.' }),
66
68
  sortOrder: schemaShape.sortOrder.numberSpec({ meaning: 'Display ordering in pickers and marketing surfaces.' }),
67
69
  metadata: schemaShape.metadata.objectSpec({ meaning: 'Opaque key/value for provider sync or A/B test tags — not PII by contract.' }),
68
- createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Row creation time.', temporalRole: 'creation' }),
69
- updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Row update time for syncs.', temporalRole: 'modified' }),
70
+ createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),
71
+ updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Record update time for syncs.', temporalRole: 'modified' }),
70
72
  },
71
73
  operations: {
72
74
  [Op.READ]: {
73
75
  purpose: 'Read one catalog row (features, keys, and limits) for admin and in-app gating code.',
74
76
  outcome: 'Full product + behavior policy in implementation.',
75
77
  responseStatuses: [
76
- { code: HttpResponseStatusCode.OK_200, meaning: 'The product catalog row was found and its full DTO (features, limits, behavior policy) is returned.' },
78
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The product catalog record was found and its full DTO (features, limits, behavior policy) is returned.' },
77
79
  ],
78
80
  errorScenarios: [
79
81
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },
@@ -106,7 +108,7 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
106
108
  purpose: 'Internal service-pipeline lazy insert (not HTTP-exposed) of the first DB row for a `ProductDefinition` on demand.',
107
109
  outcome: 'Seeded `key` and immutable bits from the definition in services.',
108
110
  responseStatuses: [
109
- { code: HttpResponseStatusCode.CREATED_201, meaning: 'The product row was materialized from its `ProductDefinition` and is returned with its server-assigned id.' },
111
+ { code: HttpResponseStatusCode.CREATED_201, meaning: 'The product record was materialized from its `ProductDefinition` and is returned with its server-assigned id.' },
110
112
  ],
111
113
  errorScenarios: [
112
114
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The product payload fails schema validation (e.g. missing `key` or unknown `type`).', errorCode: 'VALIDATION_FAILED' },
@@ -142,7 +144,7 @@ const productsBase = resourceSpecification(productsFactory, ProductSchema, ({ sc
142
144
  purpose: 'Sync metadata, activation flags, or provider ids; not end-user ad-hoc edits in production discipline.',
143
145
  outcome: 'Patched product row per admin workflow.',
144
146
  responseStatuses: [
145
- { code: HttpResponseStatusCode.OK_200, meaning: 'The product row was patched and the updated catalog DTO is returned.' },
147
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The product record was patched and the updated catalog DTO is returned.' },
146
148
  ],
147
149
  errorScenarios: [
148
150
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },
@@ -1 +1 @@
1
- {"version":3,"file":"products.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/products.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,IAAI,mBAAmB,EACtD,8BAA8B,IAAI,kBAAkB,GACrD,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,mDAAmD,IAAI,eAAe,GACvE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AAKrC,MAAM,cAAc,GAAG,kBAAqE,CAAC;AAC7F,MAAM,eAAe,GAAG,mBAAsE,CAAC;AAE/F,MAAM,YAAY,GAAG,qBAAqB,CACxC,eAAe,EACf,aAAa,EACb,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,wMAAwM;IACjN,YAAY,EAAE,mHAAmH;IACjI,aAAa,EAAE,0JAA0J;IACzK,QAAQ,EAAE,aAAa,CAAC,KAAK;IAC7B,YAAY,EAAE;QACZ,UAAU,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE,mBAAmB,CAAC,UAAU,EAAE;QACrK,eAAe,EAAE,EAAE,WAAW,EAAE,uBAA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AAS,EAAE,iCAAiC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,6EAA6E,EAAE,EAAE,EAAE;YACrT,QAAQ,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,+CAA+C,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,wFAAwF,EAAE,EAAE,EAAE;YACvT,UAAU,EAAE,EAAE,OAAO,EAAE,4DAA4D,EAAE,SAAS,EAAE,8CAA8C,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,6FAA6F,EAAE,EAAE,EAAE;SAClU;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,6FAA6F,EAAE,SAAS,EAAE,0CAA0C,EAAE;QAC5K,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,iDAAiD,EAAE;KACjJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n productsAdminResourceUIBehavior as productsAdminSource,\n productsMainResourceUIBehavior as productsMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ProductType,\n ProductSchema,\n ResourcePrimaryScope,\n TaxDisplayMode,\n productsResourceConfiguration_InitializationFactory as productsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\n\ntype Cfg = ReturnType<typeof productsFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst productsMainUI = productsMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst productsAdminUI = productsAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst productsBase = resourceSpecification<undefined, Core, Main>(\n productsFactory,\n ProductSchema,\n ({ schemaShape }) => ({\n purpose: 'Application-scoped product catalog row: mirrors code `ProductDefinition` into Mongo for provider sync, entitlement evaluation, and admin browse — not arbitrary tenant merchandising in typical flows.',\n businessRole: 'Anchor for prices, promotions, and subscription line items; drives plan tiers, add-ons, and feature/limit grants.',\n lifecycleRole: 'Lazy DB row created from definitions; provider ids filled on first use; bulk sync in admin; edits are deployment-driven, not ad-hoc CRUD in end-user UI.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ProductSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'productsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PRODUCTS' },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'productsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'productsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Product document id in the app catalog collection.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n key: schemaShape.key.stringSpec({ meaning: 'Stable key that maps 1:1 to `ProductDefinition.key` in the code catalog — unique globally per app database.', importance: FieldSemanticImportance.PRIMARY }),\n type: schemaShape.type.enumSpec({\n meaning: 'Commercial shape of the product (PLAN, ADDON, METERED, etc.).',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ProductType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [ProductType.PLAN]: { meaning: 'Primary subscription entitlements and tiering.' },\n [ProductType.ADDON]: { meaning: 'Optional capacity or feature on top of a plan.' },\n [ProductType.METERED]: { meaning: 'Usage-billed add-on; ties to `UsageRecord` rows.' },\n [ProductType.ONE_TIME]: { meaning: 'One-shot purchase, not a recurring subscription state machine.' },\n [ProductType.CREDIT_PACK]: { meaning: 'Prepaid credits to a `CreditPool` balance.' },\n [ProductType.ITEM]: { meaning: 'Generic one-off line item in catalog semantics.' },\n },\n }),\n targetScopes: schemaShape.targetScopes.arraySpec({\n meaning: 'Which `ResourcePrimaryScope` values may attach subscriptions to this product (org vs user vs app).',\n elementMeaning: 'One primary scope discriminator the product is sold into.',\n elementType: {\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ResourcePrimaryScope', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n }),\n grantedFeatures: schemaShape.grantedFeatures.arraySpec({\n meaning: 'Feature keys this product enables when the subscription line is active — merged by billing feature sync with ADDON rules.',\n elementMeaning: 'One string feature id from the app feature catalog.',\n }),\n grantedLimits: schemaShape.grantedLimits.objectSpec({ meaning: 'Named limit grants (`LimitGrantSchema`) and aggregation mode for entitlements in runtime checks.' }),\n planTier: schemaShape.planTier.stringSpec({ meaning: 'For PLAN: human tier label; used with `planTierOrder` for upgrade/downgrade heuristics.' }),\n planTierOrder: schemaShape.planTierOrder.numberSpec({ meaning: 'Numeric order for plan comparisons within the app.' }),\n requiredPlanTiers: schemaShape.requiredPlanTiers.arraySpec({ meaning: 'For ADDON: plan tier keys that must be active before this add-on is purchasable.', elementMeaning: 'One `planTier` string id.' }),\n taxDisplayMode: schemaShape.taxDisplayMode.enumSpec({\n meaning: 'Whether displayed prices for this product are tax-exclusive or tax-inclusive, overriding the global default when set.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'TaxDisplayMode', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [TaxDisplayMode.EXCLUSIVE]: { meaning: 'Amounts shown before tax; tax added at checkout.' },\n [TaxDisplayMode.INCLUSIVE]: { meaning: 'Amounts include tax in displayed totals.' },\n },\n }),\n purchaseConfig: schemaShape.purchaseConfig.objectSpec({ meaning: 'Per-purchase options for one-time and credit products (max quantity, credits per unit, target credit pool key).' }),\n behaviorPolicy: schemaShape.behaviorPolicy.objectSpec({ meaning: 'Nested policy for trial, proration, cancellation windows, and metering hooks — the authoritative behavior engine for this SKU in services.' }),\n providerProductId: schemaShape.providerProductId.stringSpec({ meaning: 'Provider-side id after first sync — backend-only in many API shapes.' }),\n isPublic: schemaShape.isPublic.booleanSpec({ meaning: 'Visibility for self-serve catalog vs org-admin-only offer matrix.' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether the product is offered to new checkouts; historical subs may still reference inactive rows.' }),\n sortOrder: schemaShape.sortOrder.numberSpec({ meaning: 'Display ordering in pickers and marketing surfaces.' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Opaque key/value for provider sync or A/B test tags — not PII by contract.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Row creation time.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Row update time for syncs.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read one catalog row (features, keys, and limits) for admin and in-app gating code.',\n outcome: 'Full product + behavior policy in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The product catalog row was found and its full DTO (features, limits, behavior policy) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Browse the catalog in admin and tooling.',\n outcome: 'Paginated products for the application scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of catalog products for the application scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to browse the product catalog.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Search by `key` / `type` per factory searchable fields in repository variant.',\n outcome: 'Filtered list for typeahead in admin UIs.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of products matching the `key` / `type` search query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to search the product catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Internal service-pipeline lazy insert (not HTTP-exposed) of the first DB row for a `ProductDefinition` on demand.',\n outcome: 'Seeded `key` and immutable bits from the definition in services.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The product row was materialized from its `ProductDefinition` and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The product payload fails schema validation (e.g. missing `key` or unknown `type`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not the platform/admin/repository path permitted to seed catalog rows.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A product with the same globally-unique `key` already exists in this application database.', errorCode: 'PRODUCT_KEY_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Materialize a plan product from its definition',\n request: {\n key: 'plan_pro',\n type: ProductType.PLAN,\n targetScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n grantedFeatures: ['advanced_reporting'],\n planTier: 'pro',\n planTierOrder: 20,\n isPublic: true,\n isActive: true,\n },\n response: {\n _id: 'prod_01HX2…',\n key: 'plan_pro',\n type: ProductType.PLAN,\n planTier: 'pro',\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Sync metadata, activation flags, or provider ids; not end-user ad-hoc edits in production discipline.',\n outcome: 'Patched product row per admin workflow.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The product row was patched and the updated catalog DTO is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the product catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Code definitions remain the conceptual source of truth — treat DB as materialized state for the billing engine, not a CMS.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const productsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(productsMainUI), resourceFrontendConfiguration(productsAdminUI)),\n productsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses `key` for short catalog rows.' },\n layout: {\n purpose: 'Five section refs: `overview` (key, type, plan tier, feature grants), `tax` (tax display mode), `purchase` (credit pack config), `behavior` (policy), `visibility` (public/active/metadata).',\n displayPurpose: 'Main preset has no addressable `views` — merged admin adds LIST+READ for catalog browse (all non-addressable in billing presets).',\n sections: {\n overview: { purpose: 'Identity and tier information for a product in one card.', whenToUse: 'Admin or pricing tables.', textSlots: { title: { purpose: 'Product header.' }, description: { purpose: 'Feature/limit details follow `grantedFeatures` and `grantedLimits` in schema — not repeated field-by-field here.' } } },\n tax: { purpose: 'How tax is displayed on invoices for this product line.', whenToUse: 'When jurisdiction matters for checkout copy.', textSlots: { title: { purpose: 'Tax block.' }, description: { purpose: 'Does not set legal tax rates — that is the provider in production.' } } },\n purchase: { purpose: 'Per-unit, credit, and max-quantity options for one-time and credit products.', whenToUse: 'CREDIT_PACK and one-time flows.', textSlots: { title: { purpose: 'Purchase settings.' }, description: { purpose: 'Align with `ProductBehaviorPolicy` in implementation for when fields apply.' } } },\n behavior: { purpose: 'Policies for metering, trials, and add-on compatibility.', whenToUse: 'When tuning product-behavior for engineering.', textSlots: { title: { purpose: 'Behavior block.' }, description: { purpose: 'Backend enforcement lives in services — UI is a structured editor over the zod object.' } } },\n visibility: { purpose: 'Public, active, and free-form `metadata` for integrations.', whenToUse: 'Gating a product in marketing vs admin-only.', textSlots: { title: { purpose: 'Visibility block.' }, description: { purpose: 'Turning `isActive` off does not cancel existing subscriptions in typical billing semantics.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin exposes LIST in `views` as non-addressable; included for overlay truthfulness.', whenToUse: 'App operator catalog screens when wired.' },\n [Op.READ]: { purpose: 'Merged admin exposes READ in `views` as non-addressable.', whenToUse: 'Drill into one product in admin UIs when wired.' },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"products.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/products.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,IAAI,mBAAmB,EACtD,8BAA8B,IAAI,kBAAkB,GACrD,MAAM,8BAA8B,CAAC;AACtC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AAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,wFAAwF,EAAE,EAAE,EAAE;YACvT,UAAU,EAAE,EAAE,OAAO,EAAE,4DAA4D,EAAE,SAAS,EAAE,8CAA8C,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,6FAA6F,EAAE,EAAE,EAAE;SAClU;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,6FAA6F,EAAE,SAAS,EAAE,0CAA0C,EAAE;QAC5K,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,iDAAiD,EAAE;KACjJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n productsAdminResourceUIBehavior as productsAdminSource,\n productsMainResourceUIBehavior as productsMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ProductType,\n ProductSchema,\n ResourcePrimaryScope,\n TaxDisplayMode,\n productsResourceConfiguration_InitializationFactory as productsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof productsFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst productsMainUI = productsMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst productsAdminUI = productsAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst productsBase = resourceSpecification<undefined, Core, Main>(\n productsFactory,\n ProductSchema,\n ({ schemaShape }) => ({\n purpose: 'One product in the application\\'s catalog: the plan, add-on or credit pack an organization can subscribe to, with the features and limits it grants. The catalog is defined by the application, not edited per organization.',\n businessRole: 'Anchor for prices, promotions, and subscription line items; drives plan tiers, add-ons, and feature/limit grants.',\n lifecycleRole: 'Lazy DB row created from definitions; provider ids filled on first use; bulk sync in admin; edits are deployment-driven, not ad-hoc CRUD in end-user UI.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ProductSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'productsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PRODUCTS' },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'productsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'productsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Product document id in the app catalog collection.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n key: schemaShape.key.stringSpec({ meaning: 'Stable key that maps 1:1 to `ProductDefinition.key` in the code catalog — unique globally per app database.', importance: FieldSemanticImportance.PRIMARY }),\n type: schemaShape.type.enumSpec({\n meaning: 'Commercial shape of the product (PLAN, ADDON, METERED, etc.).',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ProductType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [ProductType.PLAN]: { meaning: 'Primary subscription entitlements and tiering.' },\n [ProductType.ADDON]: { meaning: 'Optional capacity or feature on top of a plan.' },\n [ProductType.METERED]: { meaning: 'Usage-billed add-on; ties to `UsageRecord` records.' },\n [ProductType.ONE_TIME]: { meaning: 'One-shot purchase, not a recurring subscription state machine.' },\n [ProductType.CREDIT_PACK]: { meaning: 'Prepaid credits to a `CreditPool` balance.' },\n [ProductType.ITEM]: { meaning: 'Generic one-off line item in catalog semantics.' },\n },\n }),\n targetScopes: schemaShape.targetScopes.arraySpec({\n meaning: 'Which `ResourcePrimaryScope` values may attach subscriptions to this product (org vs user vs app).',\n elementMeaning: 'One primary scope discriminator the product is sold into.',\n elementType: {\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ResourcePrimaryScope', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n }),\n grantedFeatures: schemaShape.grantedFeatures.arraySpec({\n meaning: 'Feature keys this product enables when the subscription line is active — merged by billing feature sync with ADDON rules.',\n elementMeaning: 'One string feature id from the app feature catalog.',\n }),\n grantedLimits: schemaShape.grantedLimits.objectSpec({ meaning: 'Named limit grants (`LimitGrantSchema`) and aggregation mode for entitlements in runtime checks.' }),\n planTier: schemaShape.planTier.stringSpec({ meaning: 'For PLAN: human tier label; used with `planTierOrder` for upgrade/downgrade heuristics.' }),\n planTierOrder: schemaShape.planTierOrder.numberSpec({ meaning: 'Numeric order for plan comparisons within the app.' }),\n requiredPlanTiers: schemaShape.requiredPlanTiers.arraySpec({ meaning: 'For ADDON: plan tier keys that must be active before this add-on is purchasable.', elementMeaning: 'One `planTier` string id.' }),\n taxDisplayMode: schemaShape.taxDisplayMode.enumSpec({\n meaning: 'Whether displayed prices for this product are tax-exclusive or tax-inclusive, overriding the global default when set.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'TaxDisplayMode', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [TaxDisplayMode.EXCLUSIVE]: { meaning: 'Amounts shown before tax; tax added at checkout.' },\n [TaxDisplayMode.INCLUSIVE]: { meaning: 'Amounts include tax in displayed totals.' },\n },\n }),\n purchaseConfig: schemaShape.purchaseConfig.objectSpec({ meaning: 'Per-purchase options for one-time and credit products (max quantity, credits per unit, target credit pool key).' }),\n behaviorPolicy: schemaShape.behaviorPolicy.objectSpec({ meaning: 'Nested policy for trial, proration, cancellation windows, and metering hooks — the authoritative behavior engine for this SKU in services.' }),\n providerProductId: schemaShape.providerProductId.stringSpec({ meaning: 'Provider-side id after first sync — backend-only in many API shapes.' }),\n isPublic: schemaShape.isPublic.booleanSpec({ meaning: 'Visibility for self-serve catalog vs org-admin-only offer matrix.' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether the product is offered to new checkouts; historical subs may still reference inactive records.' }),\n sortOrder: schemaShape.sortOrder.numberSpec({ meaning: 'Display ordering in pickers and marketing surfaces.' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Opaque key/value for provider sync or A/B test tags — not PII by contract.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Record update time for syncs.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read one catalog row (features, keys, and limits) for admin and in-app gating code.',\n outcome: 'Full product + behavior policy in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The product catalog record was found and its full DTO (features, limits, behavior policy) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Browse the catalog in admin and tooling.',\n outcome: 'Paginated products for the application scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of catalog products for the application scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to browse the product catalog.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Search by `key` / `type` per factory searchable fields in repository variant.',\n outcome: 'Filtered list for typeahead in admin UIs.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of products matching the `key` / `type` search query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to search the product catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Internal service-pipeline lazy insert (not HTTP-exposed) of the first DB row for a `ProductDefinition` on demand.',\n outcome: 'Seeded `key` and immutable bits from the definition in services.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The product record was materialized from its `ProductDefinition` and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The product payload fails schema validation (e.g. missing `key` or unknown `type`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not the platform/admin/repository path permitted to seed catalog rows.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A product with the same globally-unique `key` already exists in this application database.', errorCode: 'PRODUCT_KEY_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Materialize a plan product from its definition',\n request: {\n key: 'plan_pro',\n type: ProductType.PLAN,\n targetScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n grantedFeatures: ['advanced_reporting'],\n planTier: 'pro',\n planTierOrder: 20,\n isPublic: true,\n isActive: true,\n },\n response: {\n _id: 'prod_01HX2…',\n key: 'plan_pro',\n type: ProductType.PLAN,\n planTier: 'pro',\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Sync metadata, activation flags, or provider ids; not end-user ad-hoc edits in production discipline.',\n outcome: 'Patched product row per admin workflow.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The product record was patched and the updated catalog DTO is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the product catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No product exists for the supplied id in this application catalog.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Code definitions remain the conceptual source of truth — treat DB as materialized state for the billing engine, not a CMS.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const productsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(productsMainUI), resourceFrontendConfiguration(productsAdminUI)),\n productsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses `key` for short catalog rows.' },\n layout: {\n purpose: 'Five section refs: `overview` (key, type, plan tier, feature grants), `tax` (tax display mode), `purchase` (credit pack config), `behavior` (policy), `visibility` (public/active/metadata).',\n displayPurpose: 'Main preset has no addressable `views` — merged admin adds LIST+READ for catalog browse (all non-addressable in billing presets).',\n sections: {\n overview: { purpose: 'Identity and tier information for a product in one card.', whenToUse: 'Admin or pricing tables.', textSlots: { title: { purpose: 'Product header.' }, description: { purpose: 'Feature/limit details follow `grantedFeatures` and `grantedLimits` in schema — not repeated field-by-field here.' } } },\n tax: { purpose: 'How tax is displayed on invoices for this product line.', whenToUse: 'When jurisdiction matters for checkout copy.', textSlots: { title: { purpose: 'Tax block.' }, description: { purpose: 'Does not set legal tax rates — that is the provider in production.' } } },\n purchase: { purpose: 'Per-unit, credit, and max-quantity options for one-time and credit products.', whenToUse: 'CREDIT_PACK and one-time flows.', textSlots: { title: { purpose: 'Purchase settings.' }, description: { purpose: 'Align with `ProductBehaviorPolicy` in implementation for when fields apply.' } } },\n behavior: { purpose: 'Policies for metering, trials, and add-on compatibility.', whenToUse: 'When tuning product-behavior for engineering.', textSlots: { title: { purpose: 'Behavior block.' }, description: { purpose: 'Backend enforcement lives in services — UI is a structured editor over the zod object.' } } },\n visibility: { purpose: 'Public, active, and free-form `metadata` for integrations.', whenToUse: 'Gating a product in marketing vs admin-only.', textSlots: { title: { purpose: 'Visibility block.' }, description: { purpose: 'Turning `isActive` off does not cancel existing subscriptions in typical billing semantics.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin exposes LIST in `views` as non-addressable; included for overlay truthfulness.', whenToUse: 'App operator catalog screens when wired.' },\n [Op.READ]: { purpose: 'Merged admin exposes READ in `views` as non-addressable.', whenToUse: 'Drill into one product in admin UIs when wired.' },\n },\n }),\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"promotions.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/promotions.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,YAAY,EACZ,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EAGrB,MAAM,uBAAuB,CAAC;AAgN/B,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;iCAuB3C,CAAC"}
1
+ {"version":3,"file":"promotions.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/promotions.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,YAAY,EACZ,aAAa,EACb,iBAAiB,EAEjB,oBAAoB,EAGrB,MAAM,uBAAuB,CAAC;AAoN/B,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;iCAuB3C,CAAC"}
@@ -3,6 +3,7 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
3
3
  import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
4
4
  import { CoreResourceOperation as Op, DiscountType, PromotionType, PromotionDuration, PromotionSchema, Promotion_Operations, ResourcePrimaryScope, promotionsResourceConfiguration_InitializationFactory as promotionsFactory, } from '@wildo-ai/saas-models';
5
5
  import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
6
+ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
6
7
  const promotionsMainUI = promotionsMainSource;
7
8
  const promotionsAdminUI = promotionsAdminSource;
8
9
  const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema, ({ schemaShape }) => ({
@@ -10,6 +11,7 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
10
11
  businessRole: 'Feeds checkout `promotionCode` validation and subscription discount objects; distinct from `REFERRALS` relationship rows.',
11
12
  lifecycleRole: 'Authored by operators; `APPLY` validates at purchase; `DEACTIVATE` ends new redemptions while historical subs may retain benefits per policy.',
12
13
  audience: LabelAudience.ADMIN,
14
+ subDomain: EngineResourceSubDomain.BILLING,
13
15
  codeHandling: {
14
16
  mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },
15
17
  resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'promotionsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },
@@ -63,7 +65,7 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
63
65
  timesRedeemed: schemaShape.timesRedeemed.numberSpec({ meaning: 'Counter mirrored for admin read of campaign health.' }),
64
66
  validFrom: schemaShape.validFrom.dateSpec({ meaning: 'Earliest datetime the code is valid.', temporalRole: 'scheduled' }),
65
67
  validUntil: schemaShape.validUntil.dateSpec({ meaning: 'Hard stop for new redemptions.', temporalRole: 'deadline' }),
66
- isActive: schemaShape.isActive.booleanSpec({ meaning: 'Soft switch to stop new uses without deleting the row.' }),
68
+ isActive: schemaShape.isActive.booleanSpec({ meaning: 'Soft switch to stop new uses without deleting the record.' }),
67
69
  metadata: schemaShape.metadata.objectSpec({ meaning: 'Extra campaign tags for analytics — not user PII.' }),
68
70
  },
69
71
  operations: {
@@ -83,7 +85,7 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
83
85
  purpose: 'Browse campaigns in admin (merged admin adds non-addressable LIST view).',
84
86
  outcome: 'Paginated promotions in application scope.',
85
87
  responseStatuses: [
86
- { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotion rows in the application scope.' },
88
+ { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotion records in the application scope.' },
87
89
  ],
88
90
  errorScenarios: [
89
91
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to browse the promotion catalog.' },
@@ -105,7 +107,7 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
105
107
  purpose: 'Author a new promotion row for an upcoming campaign.',
106
108
  outcome: 'New id and code when unique constraints pass.',
107
109
  responseStatuses: [
108
- { code: HttpResponseStatusCode.CREATED_201, meaning: 'A promotion row was created and is returned with its server-assigned id.' },
110
+ { code: HttpResponseStatusCode.CREATED_201, meaning: 'A promotion record was created and is returned with its server-assigned id.' },
109
111
  ],
110
112
  errorScenarios: [
111
113
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The discount mechanics are inconsistent (e.g. percentage value with `discountType` fixed, or `REPEATING` duration without `durationInMonths`) or the payload otherwise fails schema validation.', errorCode: 'VALIDATION_FAILED' },
@@ -142,7 +144,7 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
142
144
  purpose: 'Adjust limits, validity, or active bit before or during a campaign.',
143
145
  outcome: 'Patched row with provider sync where required.',
144
146
  responseStatuses: [
145
- { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s limits / validity window / active bit were patched and the updated row is returned.' },
147
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s limits / validity window / active bit were patched and the updated record is returned.' },
146
148
  ],
147
149
  errorScenarios: [
148
150
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited discount or duration fields are inconsistent, or the patch otherwise fails schema validation.', errorCode: 'VALIDATION_FAILED' },
@@ -154,10 +156,10 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
154
156
  },
155
157
  [Promotion_Operations.APPLY]: {
156
158
  operationId: Promotion_Operations.APPLY,
157
- purpose: 'Validate and apply a promotion at checkout or plan change when a user supplies a code.',
158
- outcome: 'Discount object or error for the checkout session — main preset surfaces this in `views` as non-addressable.',
159
+ purpose: 'Validate a promotion code a user supplied, and return the discount it resolves to. Records no redemption.',
160
+ outcome: 'Discount object or error for the checkout session.',
159
161
  responseStatuses: [
160
- { code: HttpResponseStatusCode.OK_200, meaning: 'The supplied `code` was valid and applicable; the resolved discount object is returned and the redemption counter is advanced.' },
162
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The supplied `code` was valid and applicable; the resolved discount object is returned. `timesRedeemed` is NOT advanced — a redemption is counted when the purchase completes.' },
161
163
  ],
162
164
  errorScenarios: [
163
165
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `code` is missing/empty or fails request-DTO validation.', errorCode: 'VALIDATION_FAILED' },
@@ -165,10 +167,12 @@ const promotionsBase = resourceSpecification(promotionsFactory, PromotionSchema,
165
167
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion matches the supplied `code`.' },
166
168
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'The matched promotion is inactive, outside its `validFrom`/`validUntil` window, exhausted (`maxRedemptions` reached), or not applicable to the targeted products.' },
167
169
  ],
168
- // Each successful APPLY records a redemption and advances `timesRedeemed`, so
169
- // re-issuing the same request is NOT side-effect-free — it consumes another
170
- // redemption (and may then trip the exhaustion 409 above).
171
- idempotent: false,
170
+ // Side-effect-free: this verb validates and reports, and advances no counter. It used to
171
+ // increment `timesRedeemed`, which counted a redemption when a customer TYPED a code —
172
+ // so a limited campaign was exhausted by window-shoppers, and a customer who then bought
173
+ // was counted twice once completion started counting. The redemption is now counted only
174
+ // by `checkout.session.completed`.
175
+ idempotent: true,
172
176
  rateLimitNote: 'Code-application is abuse-sensitive (coupon brute-forcing) — the platform may throttle repeated APPLY attempts per caller/account.',
173
177
  },
174
178
  [Promotion_Operations.DEACTIVATE]: {
@@ -207,7 +211,7 @@ export const promotionsResourceSpecification = resourceSpecificationFromFrontend
207
211
  views: {
208
212
  [Op.LIST]: { purpose: 'Merged admin LIST (non-addressable) for operator catalog alignment.', whenToUse: 'Super-admin promotion management when routes exist.' },
209
213
  [Op.READ]: { purpose: 'Merged admin READ (non-addressable) for drill-down alignment.', whenToUse: 'Inspect one campaign when wired.' },
210
- [Promotion_Operations.APPLY]: { purpose: 'Apply path for checkout integration; non-addressable in merged `views` array but op is present for action buttons.', whenToUse: 'User enters code in purchase flow.' },
214
+ [Promotion_Operations.APPLY]: { purpose: 'Code-validation path for checkout integration; non-addressable in merged `views` array but op is present for action buttons. Reports the discount; the redemption is counted at purchase completion.', whenToUse: 'User enters code in purchase flow.' },
211
215
  [Promotion_Operations.DEACTIVATE]: { purpose: 'Deactivate path for admin shutoff; present in both main and merged `views` maps as non-addressable.', whenToUse: 'End a campaign early without deleting history.' },
212
216
  },
213
217
  }));