@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
@@ -1 +1 @@
1
- {"version":3,"file":"promotions.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/promotions.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,IAAI,qBAAqB,EAC1D,gCAAgC,IAAI,o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AAE,EAAE;YACzS,aAAa,EAAE,EAAE,OAAO,EAAE,2DAA2D,EAAE,SAAS,EAAE,qCAAqC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,6EAA6E,EAAE,EAAE,EAAE;YAC7S,QAAQ,EAAE,EAAE,OAAO,EAAE,8EAA8E,EAAE,SAAS,EAAE,kCAAkC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,iGAAiG,EAAE,EAAE,EAAE;SACxU;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,qEAAqE,EAAE,SAAS,EAAE,qDAAqD,EAAE;QAC/J,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,+DAA+D,EAAE,SAAS,EAAE,kCAAkC,EAAE;QACtI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,oHAAoH,EAAE,SAAS,EAAE,oCAAoC,EAAE;QAChN,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,qGAAqG,EAAE,SAAS,EAAE,gDAAgD,EAAE;KACnN;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n promotionsAdminResourceUIBehavior as promotionsAdminSource,\n promotionsMainResourceUIBehavior as promotionsMainSource,\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 DiscountType,\n PromotionType,\n PromotionDuration,\n PromotionSchema,\n Promotion_Operations,\n ResourcePrimaryScope,\n promotionsResourceConfiguration_InitializationFactory as promotionsFactory,\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 promotionsFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst promotionsMainUI = promotionsMainSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\nconst promotionsAdminUI = promotionsAdminSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst promotionsBase = resourceSpecification<Custom, Core, Main>(\n promotionsFactory,\n PromotionSchema,\n ({ schemaShape }) => ({\n purpose: 'Promotional instrument (coupon, promotion code, referral program, deal) with discount mechanics, validity window, and redemption counters — synced to the provider where applicable.',\n businessRole: 'Feeds checkout `promotionCode` validation and subscription discount objects; distinct from `REFERRALS` relationship rows.',\n lifecycleRole: 'Authored by operators; `APPLY` validates at purchase; `DEACTIVATE` ends new redemptions while historical subs may retain benefits per policy.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'promotionsResourceConfiguration_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: 'PROMOTIONS' },\n operationVocabulary: {\n coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n customEnum: { packageName: '@wildo-ai/saas-models', exportName: 'Promotion_Operations', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'promotionsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'promotionsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Promotion document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n name: schemaShape.name.stringSpec({ meaning: 'Human label in admin and support tools.', importance: FieldSemanticImportance.PRIMARY }),\n description: schemaShape.description.stringSpec({ meaning: 'Longer explanation of the offer and legal/restriction copy when needed.' }),\n type: schemaShape.type.enumSpec({\n meaning: 'Kind of promotion surface in catalog and checkout.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PromotionType.COUPON]: { meaning: 'Checkout coupon code style.' },\n [PromotionType.PROMOTION_CODE]: { meaning: 'Provider-style promotion code.' },\n [PromotionType.REFERRAL]: { meaning: 'Referral-driven automatic benefit (cross-link to referral program when present).' },\n [PromotionType.DEAL]: { meaning: 'Negotiated or campaign deal object with custom rules.' },\n },\n }),\n code: schemaShape.code.stringSpec({ meaning: 'The string customers or APIs pass at checkout when applicable.' }),\n discountType: schemaShape.discountType.enumSpec({\n meaning: 'Whether the benefit is percentage, fixed money, or free trial extension per schema rules.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'DiscountType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [DiscountType.PERCENTAGE]: { meaning: 'Percent off list or subtotal.' },\n [DiscountType.FIXED_AMOUNT]: { meaning: 'Flat money off (currency in provider sync).' },\n },\n }),\n discountPercentage: schemaShape.discountPercentage.numberSpec({ meaning: 'Percent off when `discountType` is percentage.' }),\n discountFixedAmount: schemaShape.discountFixedAmount.numberSpec({ meaning: 'Money off when `discountType` is fixed amount in provider currency.' }),\n duration: schemaShape.duration.enumSpec({\n meaning: 'How long the discount applies to a subscription once redeemed.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionDuration', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PromotionDuration.ONCE]: { meaning: 'First invoice only.' },\n [PromotionDuration.REPEATING]: { meaning: 'Repeats for N months when `durationInMonths` is set.' },\n [PromotionDuration.FOREVER]: { meaning: 'Applies for the life of the subscription while active.' },\n },\n }),\n durationInMonths: schemaShape.durationInMonths.numberSpec({ meaning: 'Repeat window for `REPEATING` duration mode.' }),\n applicableProducts: schemaShape.applicableProducts.arraySpec({ meaning: 'Product keys this promo can apply to — empty may mean all catalog per policy.', elementMeaning: 'One product `key` string.' }),\n maxRedemptions: schemaShape.maxRedemptions.numberSpec({ meaning: 'Cap on redemptions across all customers; null may mean unlimited per implementation.' }),\n timesRedeemed: schemaShape.timesRedeemed.numberSpec({ meaning: 'Counter mirrored for admin read of campaign health.' }),\n validFrom: schemaShape.validFrom.dateSpec({ meaning: 'Earliest datetime the code is valid.', temporalRole: 'scheduled' }),\n validUntil: schemaShape.validUntil.dateSpec({ meaning: 'Hard stop for new redemptions.', temporalRole: 'deadline' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Soft switch to stop new uses without deleting the row.' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Extra campaign tags for analytics — not user PII.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect one promotion’s terms and counters in admin.',\n outcome: 'Full discount and validity block for editing support.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion was found and its full discount mechanics + validity block + redemption counters are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to read the admin-managed promotion catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Browse campaigns in admin (merged admin adds non-addressable LIST view).',\n outcome: 'Paginated promotions in application scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotion rows in the application scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to browse the promotion catalog.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Search by `name` / `code` per factory search config.',\n outcome: 'Filtered list for operators.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotions matching the `name` / `code` query (case-insensitive, max 50 per page).' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to search the promotion catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Author a new promotion row for an upcoming campaign.',\n outcome: 'New id and code when unique constraints pass.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A promotion row was created and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { 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' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to author promotions.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A promotion with the same `code` already exists (codes are the customer-facing checkout key and must be unique).' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Create a percentage coupon',\n request: {\n name: 'Summer launch 20%',\n type: PromotionType.COUPON,\n code: 'SUMMER20',\n discountType: DiscountType.PERCENTAGE,\n discountPercentage: 20,\n duration: PromotionDuration.ONCE,\n maxRedemptions: 500,\n },\n response: {\n _id: 'promo_01HX2…',\n name: 'Summer launch 20%',\n code: 'SUMMER20',\n discountType: DiscountType.PERCENTAGE,\n discountPercentage: 20,\n isActive: true,\n timesRedeemed: 0,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Adjust limits, validity, or active bit before or during a campaign.',\n outcome: 'Patched row with provider sync where required.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s limits / validity window / active bit were patched and the updated row is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited discount or duration fields are inconsistent, or the patch otherwise fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to edit promotions.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A `code` change collides with another promotion’s existing code.' },\n ],\n idempotent: true,\n },\n [Promotion_Operations.APPLY]: {\n operationId: Promotion_Operations.APPLY,\n purpose: 'Validate and apply a promotion at checkout or plan change when a user supplies a code.',\n outcome: 'Discount object or error for the checkout session — main preset surfaces this in `views` as non-addressable.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The supplied `code` was valid and applicable; the resolved discount object is returned and the redemption counter is advanced.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `code` is missing/empty or fails request-DTO validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an org owner nor an org member, so cannot apply promotions in this scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion matches the supplied `code`.' },\n { 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.' },\n ],\n // Each successful APPLY records a redemption and advances `timesRedeemed`, so\n // re-issuing the same request is NOT side-effect-free — it consumes another\n // redemption (and may then trip the exhaustion 409 above).\n idempotent: false,\n rateLimitNote: 'Code-application is abuse-sensitive (coupon brute-forcing) — the platform may throttle repeated APPLY attempts per caller/account.',\n },\n [Promotion_Operations.DEACTIVATE]: {\n operationId: Promotion_Operations.DEACTIVATE,\n purpose: 'Disable new redemptions while preserving history for audits.',\n outcome: 'Sets `isActive` false in implementation; still listed in merged `views` for action wiring.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s `isActive` flag is now false; the campaign accepts no new redemptions while history is preserved.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to deactivate a promotion.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n ],\n // Convergent state-set: deactivating drives `isActive` to a fixed value, so\n // repeating the request lands the campaign in the same disabled state.\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Provider is the settlement system of record — Wildo rows follow provider capabilities for multi-currency and duration semantics.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const promotionsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(promotionsMainUI), resourceFrontendConfiguration(promotionsAdminUI)),\n promotionsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses the promotion `name` for list rows.' },\n layout: {\n purpose: 'Section refs `overview`, `discount`, `duration`, `applicability`, `validity` in billing presets — form and display walk the same order.',\n displayPurpose: 'Main bundle exposes `APPLY` and `DEACTIVATE` custom views; merged admin adds LIST+READ for catalog browse (non-addressable).',\n sections: {\n overview: { purpose: 'Name, description, type, and public `code`.', whenToUse: 'Campaign identification in admin.', textSlots: { title: { purpose: 'Promotion title block.' }, description: { purpose: 'Type drives which provider API is used when syncing.' } } },\n discount: { purpose: 'Percent vs fixed amount semantics with the two discount fields.', whenToUse: 'Setting the commercial terms of the deal.', textSlots: { title: { purpose: 'Discount block.' }, description: { purpose: 'Only one of percentage/fixed is meaningful per `discountType` — UI enforces in product.' } } },\n duration: { purpose: '`duration` + `durationInMonths` for repeating windows.', whenToUse: 'When promos apply across multiple renewal cycles.', textSlots: { title: { purpose: 'Duration block.' }, description: { purpose: '“Forever” maps to provider “forever coupon” semantics where available.' } } },\n applicability: { purpose: 'Which products can consume the promo and redemption caps.', whenToUse: 'Limiting an offer to specific SKUs.', textSlots: { title: { purpose: 'Applicability block.' }, description: { purpose: '`maxRedemptions` is global — not per-user unless extended in policy layers.' } } },\n validity: { purpose: '`validFrom`, `validUntil`, `isActive`, and `metadata` for ops and analytics.', whenToUse: 'Sunsetting and seasonal windows.', textSlots: { title: { purpose: 'Validity block.' }, description: { purpose: 'Past `validUntil` should reject `APPLY` at API even if `isActive` is true until a job flips it.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin LIST (non-addressable) for operator catalog alignment.', whenToUse: 'Super-admin promotion management when routes exist.' },\n [Op.READ]: { purpose: 'Merged admin READ (non-addressable) for drill-down alignment.', whenToUse: 'Inspect one campaign when wired.' },\n [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.' },\n [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.' },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"promotions.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/promotions.resource.specification.ts"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AE;YAC3T,QAAQ,EAAE,EAAE,OAAO,EAAE,wDAAwD,EAAE,SAAS,EAAE,mDAAmD,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,wEAAwE,EAAE,EAAE,EAAE;YACzS,aAAa,EAAE,EAAE,OAAO,EAAE,2DAA2D,EAAE,SAAS,EAAE,qCAAqC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,6EAA6E,EAAE,EAAE,EAAE;YAC7S,QAAQ,EAAE,EAAE,OAAO,EAAE,8EAA8E,EAAE,SAAS,EAAE,kCAAkC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,iGAAiG,EAAE,EAAE,EAAE;SACxU;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,qEAAqE,EAAE,SAAS,EAAE,qDAAqD,EAAE;QAC/J,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,+DAA+D,EAAE,SAAS,EAAE,kCAAkC,EAAE;QACtI,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,sMAAsM,EAAE,SAAS,EAAE,oCAAoC,EAAE;QAClS,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,qGAAqG,EAAE,SAAS,EAAE,gDAAgD,EAAE;KACnN;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n promotionsAdminResourceUIBehavior as promotionsAdminSource,\n promotionsMainResourceUIBehavior as promotionsMainSource,\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 DiscountType,\n PromotionType,\n PromotionDuration,\n PromotionSchema,\n Promotion_Operations,\n ResourcePrimaryScope,\n promotionsResourceConfiguration_InitializationFactory as promotionsFactory,\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 promotionsFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst promotionsMainUI = promotionsMainSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\nconst promotionsAdminUI = promotionsAdminSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst promotionsBase = resourceSpecification<Custom, Core, Main>(\n promotionsFactory,\n PromotionSchema,\n ({ schemaShape }) => ({\n purpose: 'Promotional instrument (coupon, promotion code, referral program, deal) with discount mechanics, validity window, and redemption counters — synced to the provider where applicable.',\n businessRole: 'Feeds checkout `promotionCode` validation and subscription discount objects; distinct from `REFERRALS` relationship rows.',\n lifecycleRole: 'Authored by operators; `APPLY` validates at purchase; `DEACTIVATE` ends new redemptions while historical subs may retain benefits per policy.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'promotionsResourceConfiguration_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: 'PROMOTIONS' },\n operationVocabulary: {\n coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n customEnum: { packageName: '@wildo-ai/saas-models', exportName: 'Promotion_Operations', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'promotionsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'promotionsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Promotion document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n name: schemaShape.name.stringSpec({ meaning: 'Human label in admin and support tools.', importance: FieldSemanticImportance.PRIMARY }),\n description: schemaShape.description.stringSpec({ meaning: 'Longer explanation of the offer and legal/restriction copy when needed.' }),\n type: schemaShape.type.enumSpec({\n meaning: 'Kind of promotion surface in catalog and checkout.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PromotionType.COUPON]: { meaning: 'Checkout coupon code style.' },\n [PromotionType.PROMOTION_CODE]: { meaning: 'Provider-style promotion code.' },\n [PromotionType.REFERRAL]: { meaning: 'Referral-driven automatic benefit (cross-link to referral program when present).' },\n [PromotionType.DEAL]: { meaning: 'Negotiated or campaign deal object with custom rules.' },\n },\n }),\n code: schemaShape.code.stringSpec({ meaning: 'The string customers or APIs pass at checkout when applicable.' }),\n discountType: schemaShape.discountType.enumSpec({\n meaning: 'Whether the benefit is percentage, fixed money, or free trial extension per schema rules.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'DiscountType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [DiscountType.PERCENTAGE]: { meaning: 'Percent off list or subtotal.' },\n [DiscountType.FIXED_AMOUNT]: { meaning: 'Flat money off (currency in provider sync).' },\n },\n }),\n discountPercentage: schemaShape.discountPercentage.numberSpec({ meaning: 'Percent off when `discountType` is percentage.' }),\n discountFixedAmount: schemaShape.discountFixedAmount.numberSpec({ meaning: 'Money off when `discountType` is fixed amount in provider currency.' }),\n duration: schemaShape.duration.enumSpec({\n meaning: 'How long the discount applies to a subscription once redeemed.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PromotionDuration', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PromotionDuration.ONCE]: { meaning: 'First invoice only.' },\n [PromotionDuration.REPEATING]: { meaning: 'Repeats for N months when `durationInMonths` is set.' },\n [PromotionDuration.FOREVER]: { meaning: 'Applies for the life of the subscription while active.' },\n },\n }),\n durationInMonths: schemaShape.durationInMonths.numberSpec({ meaning: 'Repeat window for `REPEATING` duration mode.' }),\n applicableProducts: schemaShape.applicableProducts.arraySpec({ meaning: 'Product keys this promo can apply to — empty may mean all catalog per policy.', elementMeaning: 'One product `key` string.' }),\n maxRedemptions: schemaShape.maxRedemptions.numberSpec({ meaning: 'Cap on redemptions across all customers; null may mean unlimited per implementation.' }),\n timesRedeemed: schemaShape.timesRedeemed.numberSpec({ meaning: 'Counter mirrored for admin read of campaign health.' }),\n validFrom: schemaShape.validFrom.dateSpec({ meaning: 'Earliest datetime the code is valid.', temporalRole: 'scheduled' }),\n validUntil: schemaShape.validUntil.dateSpec({ meaning: 'Hard stop for new redemptions.', temporalRole: 'deadline' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Soft switch to stop new uses without deleting the record.' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Extra campaign tags for analytics — not user PII.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect one promotion’s terms and counters in admin.',\n outcome: 'Full discount and validity block for editing support.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion was found and its full discount mechanics + validity block + redemption counters are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to read the admin-managed promotion catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Browse campaigns in admin (merged admin adds non-addressable LIST view).',\n outcome: 'Paginated promotions in application scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotion records in the application scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to browse the promotion catalog.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Search by `name` / `code` per factory search config.',\n outcome: 'Filtered list for operators.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of promotions matching the `name` / `code` query (case-insensitive, max 50 per page).' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to search the promotion catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Author a new promotion row for an upcoming campaign.',\n outcome: 'New id and code when unique constraints pass.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A promotion record was created and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { 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' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to author promotions.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A promotion with the same `code` already exists (codes are the customer-facing checkout key and must be unique).' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Create a percentage coupon',\n request: {\n name: 'Summer launch 20%',\n type: PromotionType.COUPON,\n code: 'SUMMER20',\n discountType: DiscountType.PERCENTAGE,\n discountPercentage: 20,\n duration: PromotionDuration.ONCE,\n maxRedemptions: 500,\n },\n response: {\n _id: 'promo_01HX2…',\n name: 'Summer launch 20%',\n code: 'SUMMER20',\n discountType: DiscountType.PERCENTAGE,\n discountPercentage: 20,\n isActive: true,\n timesRedeemed: 0,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Adjust limits, validity, or active bit before or during a campaign.',\n outcome: 'Patched row with provider sync where required.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s limits / validity window / active bit were patched and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited discount or duration fields are inconsistent, or the patch otherwise fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to edit promotions.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A `code` change collides with another promotion’s existing code.' },\n ],\n idempotent: true,\n },\n [Promotion_Operations.APPLY]: {\n operationId: Promotion_Operations.APPLY,\n purpose: 'Validate a promotion code a user supplied, and return the discount it resolves to. Records no redemption.',\n outcome: 'Discount object or error for the checkout session.',\n responseStatuses: [\n { 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.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `code` is missing/empty or fails request-DTO validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an org owner nor an org member, so cannot apply promotions in this scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion matches the supplied `code`.' },\n { 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.' },\n ],\n // Side-effect-free: this verb validates and reports, and advances no counter. It used to\n // increment `timesRedeemed`, which counted a redemption when a customer TYPED a code —\n // so a limited campaign was exhausted by window-shoppers, and a customer who then bought\n // was counted twice once completion started counting. The redemption is now counted only\n // by `checkout.session.completed`.\n idempotent: true,\n rateLimitNote: 'Code-application is abuse-sensitive (coupon brute-forcing) — the platform may throttle repeated APPLY attempts per caller/account.',\n },\n [Promotion_Operations.DEACTIVATE]: {\n operationId: Promotion_Operations.DEACTIVATE,\n purpose: 'Disable new redemptions while preserving history for audits.',\n outcome: 'Sets `isActive` false in implementation; still listed in merged `views` for action wiring.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The promotion’s `isActive` flag is now false; the campaign accepts no new redemptions while history is preserved.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to deactivate a promotion.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No promotion exists for the supplied id in the application scope.' },\n ],\n // Convergent state-set: deactivating drives `isActive` to a fixed value, so\n // repeating the request lands the campaign in the same disabled state.\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Provider is the settlement system of record — Wildo rows follow provider capabilities for multi-currency and duration semantics.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const promotionsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(promotionsMainUI), resourceFrontendConfiguration(promotionsAdminUI)),\n promotionsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses the promotion `name` for list rows.' },\n layout: {\n purpose: 'Section refs `overview`, `discount`, `duration`, `applicability`, `validity` in billing presets — form and display walk the same order.',\n displayPurpose: 'Main bundle exposes `APPLY` and `DEACTIVATE` custom views; merged admin adds LIST+READ for catalog browse (non-addressable).',\n sections: {\n overview: { purpose: 'Name, description, type, and public `code`.', whenToUse: 'Campaign identification in admin.', textSlots: { title: { purpose: 'Promotion title block.' }, description: { purpose: 'Type drives which provider API is used when syncing.' } } },\n discount: { purpose: 'Percent vs fixed amount semantics with the two discount fields.', whenToUse: 'Setting the commercial terms of the deal.', textSlots: { title: { purpose: 'Discount block.' }, description: { purpose: 'Only one of percentage/fixed is meaningful per `discountType` — UI enforces in product.' } } },\n duration: { purpose: '`duration` + `durationInMonths` for repeating windows.', whenToUse: 'When promos apply across multiple renewal cycles.', textSlots: { title: { purpose: 'Duration block.' }, description: { purpose: '“Forever” maps to provider “forever coupon” semantics where available.' } } },\n applicability: { purpose: 'Which products can consume the promo and redemption caps.', whenToUse: 'Limiting an offer to specific SKUs.', textSlots: { title: { purpose: 'Applicability block.' }, description: { purpose: '`maxRedemptions` is global — not per-user unless extended in policy layers.' } } },\n validity: { purpose: '`validFrom`, `validUntil`, `isActive`, and `metadata` for ops and analytics.', whenToUse: 'Sunsetting and seasonal windows.', textSlots: { title: { purpose: 'Validity block.' }, description: { purpose: 'Past `validUntil` should reject `APPLY` at API even if `isActive` is true until a job flips it.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin LIST (non-addressable) for operator catalog alignment.', whenToUse: 'Super-admin promotion management when routes exist.' },\n [Op.READ]: { purpose: 'Merged admin READ (non-addressable) for drill-down alignment.', whenToUse: 'Inspect one campaign when wired.' },\n [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.' },\n [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.' },\n },\n }),\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"referrals.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/referrals.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,IAAI,EAAE,EAE3B,cAAc,EAGf,MAAM,uBAAuB,CAAC;AAwJ/B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAc1C,CAAC"}
1
+ {"version":3,"file":"referrals.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/referrals.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,IAAI,EAAE,EAE3B,cAAc,EAGf,MAAM,uBAAuB,CAAC;AA0J/B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAc1C,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 { BillingScopeType, CoreResourceOperation as Op, ReferralSchema, ReferralStatus, ResourcePrimaryScope, referralsResourceConfiguration_InitializationFactory as referralsFactory, } 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 referralsMainUI = referralsMainSource;
7
8
  const referralsAdminUI = referralsAdminSource;
8
9
  const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({ schemaShape }) => ({
9
- purpose: 'Referral relationship between two billing accounts: code, status, reward blocks, and conversion timestamps — the program’s state row, not the marketing `PROMOTIONS` definition.',
10
+ purpose: 'A referral between two billing accounts: the code that was shared, whether it converted, and the rewards each side earned. Promotions define the offer; a referral records one use of it.',
10
11
  businessRole: 'Tracks who referred whom across org vs user billing scopes and whether rewards were applied once the referred party converts.',
11
12
  lifecycleRole: 'Created when a code is issued; `referredBillingAccountId` fills in on signup; status moves to CONVERTED on first subscription per product rules; rewards are idempotent via `*RewardApplied` flags.',
12
13
  audience: LabelAudience.ADMIN,
14
+ subDomain: EngineResourceSubDomain.BILLING,
13
15
  codeHandling: {
14
16
  mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ReferralSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },
15
17
  resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'referralsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },
@@ -23,7 +25,7 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
23
25
  fields: {
24
26
  _id: schemaShape._id.stringSpec({ meaning: 'Referral document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),
25
27
  referralCode: schemaShape.referralCode.stringSpec({ meaning: 'Globally unique shareable code embedded in invite links.', importance: FieldSemanticImportance.PRIMARY }),
26
- referrerBillingAccountId: schemaShape.referrerBillingAccountId.foreignKeySpec({ meaning: 'Billing account of the party that ISSUED the referral (the referrer) and is entitled to referrer-side rewards on conversion. Per-record DISCRIMINATED polymorphic FK: resolves to a `userBillingAccounts` OR `organizationBillingAccounts` record, selected per row by `referrerScopeType`.', importance: FieldSemanticImportance.PRIMARY }),
28
+ referrerBillingAccountId: schemaShape.referrerBillingAccountId.foreignKeySpec({ meaning: 'Billing account of the party that ISSUED the referral (the referrer) and is entitled to referrer-side rewards on conversion. Per-record DISCRIMINATED polymorphic FK: resolves to a `userBillingAccounts` OR `organizationBillingAccounts` record, selected per record by `referrerScopeType`.', importance: FieldSemanticImportance.PRIMARY }),
27
29
  referrerScopeType: schemaShape.referrerScopeType.enumSpec({
28
30
  meaning: 'Discriminator that selects which billing-account branch `referrerBillingAccountId` points at (org- vs user-scoped); matched against the branch’s primary scope.',
29
31
  enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingScopeType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },
@@ -42,7 +44,7 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
42
44
  },
43
45
  }),
44
46
  status: schemaShape.status.enumSpec({
45
- meaning: 'Lifecycle of the referral row for reward eligibility.',
47
+ meaning: 'Lifecycle of the referral record for reward eligibility.',
46
48
  enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ReferralStatus', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },
47
49
  values: {
48
50
  [ReferralStatus.PENDING]: { meaning: 'Code issued; no conversion yet.' },
@@ -60,7 +62,7 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
60
62
  convertedAt: schemaShape.convertedAt.dateSpec({ meaning: 'When the business defines “conversion” (often first paid subscription).', temporalRole: 'occurred' }),
61
63
  expiresAt: schemaShape.expiresAt.dateSpec({ meaning: 'When the offer window closes for this code if limited.', temporalRole: 'deadline' }),
62
64
  metadata: schemaShape.metadata.objectSpec({ meaning: 'Campaign ids or UTM echo for marketing analytics.' }),
63
- createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Row creation time.', temporalRole: 'creation' }),
65
+ createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),
64
66
  updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last reward or status change.', temporalRole: 'modified' }),
65
67
  },
66
68
  operations: {
@@ -68,7 +70,7 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
68
70
  purpose: 'Inspect a referral in partner or CSM UIs and support tools.',
69
71
  outcome: 'Full state + reward config snapshot.',
70
72
  responseStatuses: [
71
- { code: HttpResponseStatusCode.OK_200, meaning: 'The referral row was found and its full state + reward-config snapshot is returned.' },
73
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The referral record was found and its full state + reward-config snapshot is returned.' },
72
74
  ],
73
75
  errorScenarios: [
74
76
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to read referral program rows (the operation is an internal service-pipeline op, back-office scoped, not HTTP-exposed).' },
@@ -80,7 +82,7 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
80
82
  purpose: 'Program dashboards over referrals for an org or app (merged admin adds LIST in `views` as non-addressable).',
81
83
  outcome: 'Paginated rows filtered by app policies.',
82
84
  responseStatuses: [
83
- { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of referral rows scoped to the caller’s billing account and filtered by app policy.' },
85
+ { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of referral records scoped to the caller’s billing account and filtered by app policy.' },
84
86
  ],
85
87
  errorScenarios: [
86
88
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to enumerate referral program rows.' },
@@ -91,7 +93,7 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
91
93
  purpose: 'Issue a new referral when a user/org starts a share from billing settings.',
92
94
  outcome: 'New `referralCode` and reward templates from the active program config.',
93
95
  responseStatuses: [
94
- { code: HttpResponseStatusCode.CREATED_201, meaning: 'A referral row was created with a freshly minted `referralCode` and reward templates copied from the active program config.' },
96
+ { code: HttpResponseStatusCode.CREATED_201, meaning: 'A referral record was created with a freshly minted `referralCode` and reward templates copied from the active program config.' },
95
97
  ],
96
98
  errorScenarios: [
97
99
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The referral payload (referrer account / scope) fails schema validation.', errorCode: 'VALIDATION_FAILED' },
@@ -121,7 +123,7 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
121
123
  purpose: 'Patch status, referred ids, applied flags, and timestamps as the funnel progresses.',
122
124
  outcome: 'Updated row; reward application should be transactional in the service layer.',
123
125
  responseStatuses: [
124
- { code: HttpResponseStatusCode.OK_200, meaning: 'The referral row advanced (status / referred ids / reward-applied flags / timestamps) and the updated row is returned.' },
126
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The referral record advanced (status / referred ids / reward-applied flags / timestamps) and the updated record is returned.' },
125
127
  ],
126
128
  errorScenarios: [
127
129
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields (status transition, referred account, applied flags) fail schema validation.', errorCode: 'VALIDATION_FAILED' },
@@ -1 +1 @@
1
- {"version":3,"file":"referrals.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/referrals.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,IAAI,oBAAoB,EACxD,+BAA+B,IAAI,mBAAmB,GACvD,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,gBAAgB,EAChB,qBAAqB,IAAI,EAAE,EAC3B,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,oDAAoD,IAAI,gBAAgB,GACzE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AAKrC,MAAM,eAAe,GAAG,mBAAsE,CA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AI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,wHAAwH,EAAE;aAC3K;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,iGAAiG,EAAE,SAAS,EAAE,mBAAmB,EAAE;gBACzL,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+EAA+E,EAAE;gBACrI,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uEAAuE,EAAE;gBAC7H,EAAE,IAAI,EAAE,sBAAsB,CAAC,YAAY,EAAE,IAAI,EAAE,0IAA0I,EAAE;aAChM;YACD,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,0IAA0I;KAC3I;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,8CAA8C,CAC1F,mCAAmC,CAAC,6BAA6B,CAAC,eAAe,CAAC,EAAE,6BAA6B,CAAC,gBAAgB,CAAC,CAAC,EACpI,aAAa,EACb,GAAG,EAAE,CAAC,CAAC;IACL,KAAK,EAAE,EAAE,OAAO,EAAE,kFAAkF,EAAE;IACpG,MAAM,EAAE;QACN,OAAO,EAAE,gIAAgI;QACzI,cAAc,EAAE,mJAAmJ;KACpK;IACH,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,qGAAqG,EAAE,SAAS,EAAE,qEAAqE,EAAE;QAC/M,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2DAA2D,EAAE,SAAS,EAAE,2CAA2C,EAAE;KAC5I;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n referralsAdminResourceUIBehavior as referralsAdminSource,\n referralsMainResourceUIBehavior as referralsMainSource,\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 BillingScopeType,\n CoreResourceOperation as Op,\n ReferralSchema,\n ReferralStatus,\n ResourcePrimaryScope,\n referralsResourceConfiguration_InitializationFactory as referralsFactory,\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 referralsFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst referralsMainUI = referralsMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst referralsAdminUI = referralsAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst referralsBase = resourceSpecification<undefined, Core, Main>(\n referralsFactory,\n ReferralSchema,\n ({ schemaShape }) => ({\n purpose: 'Referral relationship between two billing accounts: code, status, reward blocks, and conversion timestamps — the program’s state row, not the marketing `PROMOTIONS` definition.',\n businessRole: 'Tracks who referred whom across org vs user billing scopes and whether rewards were applied once the referred party converts.',\n lifecycleRole: 'Created when a code is issued; `referredBillingAccountId` fills in on signup; status moves to CONVERTED on first subscription per product rules; rewards are idempotent via `*RewardApplied` flags.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ReferralSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'referralsResourceConfiguration_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: 'REFERRALS' },\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: 'referralsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'referralsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Referral document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n referralCode: schemaShape.referralCode.stringSpec({ meaning: 'Globally unique shareable code embedded in invite links.', importance: FieldSemanticImportance.PRIMARY }),\n referrerBillingAccountId: schemaShape.referrerBillingAccountId.foreignKeySpec({ meaning: 'Billing account of the party that ISSUED the referral (the referrer) and is entitled to referrer-side rewards on conversion. Per-record DISCRIMINATED polymorphic FK: resolves to a `userBillingAccounts` OR `organizationBillingAccounts` record, selected per row by `referrerScopeType`.', importance: FieldSemanticImportance.PRIMARY }),\n referrerScopeType: schemaShape.referrerScopeType.enumSpec({\n meaning: 'Discriminator that selects which billing-account branch `referrerBillingAccountId` points at (org- vs user-scoped); matched against the branch’s primary scope.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingScopeType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [BillingScopeType.ORGANIZATIONS]: { meaning: 'Referrer account lives under an organization billing account resource.' },\n [BillingScopeType.USER_SELF]: { meaning: 'Referrer account is a user billing account resource.' },\n },\n }),\n referredBillingAccountId: schemaShape.referredBillingAccountId.foreignKeySpec({ meaning: 'Billing account of the party that WAS REFERRED (the referee), populated once they create a billing account through the program and entitled to referred-side credit. Per-record DISCRIMINATED polymorphic FK like `referrerBillingAccountId`, with the branch selected by `referredScopeType`.', importance: FieldSemanticImportance.PRIMARY }),\n referredScopeType: schemaShape.referredScopeType.enumSpec({\n meaning: 'Discriminator that selects which billing-account branch `referredBillingAccountId` points at, once the referred account is known.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingScopeType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [BillingScopeType.ORGANIZATIONS]: { meaning: 'Referred tenant org billing account.' },\n [BillingScopeType.USER_SELF]: { meaning: 'Referred individual billing account.' },\n },\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Lifecycle of the referral row for reward eligibility.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ReferralStatus', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [ReferralStatus.PENDING]: { meaning: 'Code issued; no conversion yet.' },\n [ReferralStatus.ACCEPTED]: { meaning: 'Referee signed up; not yet monetized.' },\n [ReferralStatus.CONVERTED]: { meaning: 'First qualifying subscription completed — reward hooks run here.' },\n [ReferralStatus.EXPIRED]: { meaning: 'Past `expiresAt` without conversion.' },\n [ReferralStatus.CANCELLED]: { meaning: 'Programmatically voided referral.' },\n },\n }),\n referrerReward: schemaShape.referrerReward.objectSpec({ meaning: 'Serialized reward terms for the referrer when status hits CONVERTED.' }),\n referredReward: schemaShape.referredReward.objectSpec({ meaning: 'Serialized reward terms for the referred account on conversion.' }),\n referrerRewardApplied: schemaShape.referrerRewardApplied.booleanSpec({ meaning: 'Idempotency bit so payout jobs do not double-apply benefits.' }),\n referredRewardApplied: schemaShape.referredRewardApplied.booleanSpec({ meaning: 'Idempotency for the referred-side credit/discount application.' }),\n acceptedAt: schemaShape.acceptedAt.dateSpec({ meaning: 'When the referred party accepted/registered using the code.', temporalRole: 'occurred' }),\n convertedAt: schemaShape.convertedAt.dateSpec({ meaning: 'When the business defines “conversion” (often first paid subscription).', temporalRole: 'occurred' }),\n expiresAt: schemaShape.expiresAt.dateSpec({ meaning: 'When the offer window closes for this code if limited.', temporalRole: 'deadline' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Campaign ids or UTM echo for marketing analytics.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Row creation time.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last reward or status change.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect a referral in partner or CSM UIs and support tools.',\n outcome: 'Full state + reward config snapshot.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The referral row was found and its full state + reward-config snapshot is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to read referral program rows (the operation is an internal service-pipeline op, back-office scoped, not HTTP-exposed).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No referral exists for the supplied id in the caller’s billing scope.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Program dashboards over referrals for an org or app (merged admin adds LIST in `views` as non-addressable).',\n outcome: 'Paginated rows filtered by app policies.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of referral rows scoped to the caller’s billing account and filtered by app policy.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to enumerate referral program rows.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Issue a new referral when a user/org starts a share from billing settings.',\n outcome: 'New `referralCode` and reward templates from the active program config.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A referral row was created with a freshly minted `referralCode` and reward templates copied from the active program config.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The referral payload (referrer account / scope) fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to issue referral rows (this is an internal service-pipeline, back-office-issued resource, not HTTP-exposed).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The generated `referralCode` collides with an existing code, or the referrer is attempting a self-referral that program rules forbid.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Issue a referral for an organization referrer',\n request: {\n referrerBillingAccountId: 'billacct_org_01HX2…',\n referrerScopeType: BillingScopeType.ORGANIZATIONS,\n },\n response: {\n _id: 'referral_01HX2…',\n referralCode: 'WILDO-7Q2K9X',\n referrerBillingAccountId: 'billacct_org_01HX2…',\n referrerScopeType: BillingScopeType.ORGANIZATIONS,\n status: ReferralStatus.PENDING,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Patch status, referred ids, applied flags, and timestamps as the funnel progresses.',\n outcome: 'Updated row; reward application should be transactional in the service layer.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The referral row advanced (status / referred ids / reward-applied flags / timestamps) and the updated row is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields (status transition, referred account, applied flags) fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to mutate referral program rows.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No referral exists for the supplied id in the caller’s billing scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The referee is already claimed/converted on this referral, or a `*RewardApplied` idempotency bit conflicts with a concurrent payout job.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Referral program definitions may live in separate config; this row is the per-relationship state machine, not the global program editor.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n\nexport const referralsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(referralsMainUI), resourceFrontendConfiguration(referralsAdminUI)),\n referralsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` shows `referralCode` in lists for share/audit.' },\n layout: {\n purpose: 'Inline summary in billing presets (no `refs.sections`) shows `referralCode`, status, scope badges, key dates, and referrer id.',\n displayPurpose: 'Main bundle has no addressable `views`; merged admin adds LIST+READ (non-addressable) for back-office triage with org owner roles in the factory.',\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin includes LIST in `views` as non-addressable — document for spec/preset overlay parity.', whenToUse: 'Org referral tables when super-admin or org-admin routes are wired.' },\n [Op.READ]: { purpose: 'Merged admin includes READ in `views` as non-addressable.', whenToUse: 'Detail drawer on one referral when wired.' },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"referrals.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/referrals.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,IAAI,oBAAoB,EACxD,+BAA+B,IAAI,mBAAmB,GACvD,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,gBAAgB,EAChB,qBAAqB,IAAI,EAAE,EAC3B,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,oDAAoD,IAAI,gBAAgB,GACzE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,MAAM,eAAe,GAAG,mBAAsE,CAAC;AAC/F,MAAM,gB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AAE;gBAChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,8HAA8H,EAAE;aACjL;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,iGAAiG,EAAE,SAAS,EAAE,mBAAmB,EAAE;gBACzL,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+EAA+E,EAAE;gBACrI,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uEAAuE,EAAE;gBAC7H,EAAE,IAAI,EAAE,sBAAsB,CAAC,YAAY,EAAE,IAAI,EAAE,0IAA0I,EAAE;aAChM;YACD,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,0IAA0I;KAC3I;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,8CAA8C,CAC1F,mCAAmC,CAAC,6BAA6B,CAAC,eAAe,CAAC,EAAE,6BAA6B,CAAC,gBAAgB,CAAC,CAAC,EACpI,aAAa,EACb,GAAG,EAAE,CAAC,CAAC;IACL,KAAK,EAAE,EAAE,OAAO,EAAE,kFAAkF,EAAE;IACpG,MAAM,EAAE;QACN,OAAO,EAAE,gIAAgI;QACzI,cAAc,EAAE,mJAAmJ;KACpK;IACH,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,qGAAqG,EAAE,SAAS,EAAE,qEAAqE,EAAE;QAC/M,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2DAA2D,EAAE,SAAS,EAAE,2CAA2C,EAAE;KAC5I;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n referralsAdminResourceUIBehavior as referralsAdminSource,\n referralsMainResourceUIBehavior as referralsMainSource,\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 BillingScopeType,\n CoreResourceOperation as Op,\n ReferralSchema,\n ReferralStatus,\n ResourcePrimaryScope,\n referralsResourceConfiguration_InitializationFactory as referralsFactory,\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 referralsFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst referralsMainUI = referralsMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst referralsAdminUI = referralsAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst referralsBase = resourceSpecification<undefined, Core, Main>(\n referralsFactory,\n ReferralSchema,\n ({ schemaShape }) => ({\n purpose: 'A referral between two billing accounts: the code that was shared, whether it converted, and the rewards each side earned. Promotions define the offer; a referral records one use of it.',\n businessRole: 'Tracks who referred whom across org vs user billing scopes and whether rewards were applied once the referred party converts.',\n lifecycleRole: 'Created when a code is issued; `referredBillingAccountId` fills in on signup; status moves to CONVERTED on first subscription per product rules; rewards are idempotent via `*RewardApplied` flags.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ReferralSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'referralsResourceConfiguration_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: 'REFERRALS' },\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: 'referralsMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'referralsAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Referral document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n referralCode: schemaShape.referralCode.stringSpec({ meaning: 'Globally unique shareable code embedded in invite links.', importance: FieldSemanticImportance.PRIMARY }),\n referrerBillingAccountId: schemaShape.referrerBillingAccountId.foreignKeySpec({ meaning: 'Billing account of the party that ISSUED the referral (the referrer) and is entitled to referrer-side rewards on conversion. Per-record DISCRIMINATED polymorphic FK: resolves to a `userBillingAccounts` OR `organizationBillingAccounts` record, selected per record by `referrerScopeType`.', importance: FieldSemanticImportance.PRIMARY }),\n referrerScopeType: schemaShape.referrerScopeType.enumSpec({\n meaning: 'Discriminator that selects which billing-account branch `referrerBillingAccountId` points at (org- vs user-scoped); matched against the branch’s primary scope.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingScopeType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [BillingScopeType.ORGANIZATIONS]: { meaning: 'Referrer account lives under an organization billing account resource.' },\n [BillingScopeType.USER_SELF]: { meaning: 'Referrer account is a user billing account resource.' },\n },\n }),\n referredBillingAccountId: schemaShape.referredBillingAccountId.foreignKeySpec({ meaning: 'Billing account of the party that WAS REFERRED (the referee), populated once they create a billing account through the program and entitled to referred-side credit. Per-record DISCRIMINATED polymorphic FK like `referrerBillingAccountId`, with the branch selected by `referredScopeType`.', importance: FieldSemanticImportance.PRIMARY }),\n referredScopeType: schemaShape.referredScopeType.enumSpec({\n meaning: 'Discriminator that selects which billing-account branch `referredBillingAccountId` points at, once the referred account is known.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingScopeType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [BillingScopeType.ORGANIZATIONS]: { meaning: 'Referred tenant org billing account.' },\n [BillingScopeType.USER_SELF]: { meaning: 'Referred individual billing account.' },\n },\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Lifecycle of the referral record for reward eligibility.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ReferralStatus', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [ReferralStatus.PENDING]: { meaning: 'Code issued; no conversion yet.' },\n [ReferralStatus.ACCEPTED]: { meaning: 'Referee signed up; not yet monetized.' },\n [ReferralStatus.CONVERTED]: { meaning: 'First qualifying subscription completed — reward hooks run here.' },\n [ReferralStatus.EXPIRED]: { meaning: 'Past `expiresAt` without conversion.' },\n [ReferralStatus.CANCELLED]: { meaning: 'Programmatically voided referral.' },\n },\n }),\n referrerReward: schemaShape.referrerReward.objectSpec({ meaning: 'Serialized reward terms for the referrer when status hits CONVERTED.' }),\n referredReward: schemaShape.referredReward.objectSpec({ meaning: 'Serialized reward terms for the referred account on conversion.' }),\n referrerRewardApplied: schemaShape.referrerRewardApplied.booleanSpec({ meaning: 'Idempotency bit so payout jobs do not double-apply benefits.' }),\n referredRewardApplied: schemaShape.referredRewardApplied.booleanSpec({ meaning: 'Idempotency for the referred-side credit/discount application.' }),\n acceptedAt: schemaShape.acceptedAt.dateSpec({ meaning: 'When the referred party accepted/registered using the code.', temporalRole: 'occurred' }),\n convertedAt: schemaShape.convertedAt.dateSpec({ meaning: 'When the business defines “conversion” (often first paid subscription).', temporalRole: 'occurred' }),\n expiresAt: schemaShape.expiresAt.dateSpec({ meaning: 'When the offer window closes for this code if limited.', temporalRole: 'deadline' }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Campaign ids or UTM echo for marketing analytics.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last reward or status change.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect a referral in partner or CSM UIs and support tools.',\n outcome: 'Full state + reward config snapshot.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The referral record was found and its full state + reward-config snapshot is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to read referral program rows (the operation is an internal service-pipeline op, back-office scoped, not HTTP-exposed).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No referral exists for the supplied id in the caller’s billing scope.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Program dashboards over referrals for an org or app (merged admin adds LIST in `views` as non-addressable).',\n outcome: 'Paginated rows filtered by app policies.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of referral records scoped to the caller’s billing account and filtered by app policy.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to enumerate referral program rows.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Issue a new referral when a user/org starts a share from billing settings.',\n outcome: 'New `referralCode` and reward templates from the active program config.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A referral record was created with a freshly minted `referralCode` and reward templates copied from the active program config.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The referral payload (referrer account / scope) fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to issue referral rows (this is an internal service-pipeline, back-office-issued resource, not HTTP-exposed).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The generated `referralCode` collides with an existing code, or the referrer is attempting a self-referral that program rules forbid.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Issue a referral for an organization referrer',\n request: {\n referrerBillingAccountId: 'billacct_org_01HX2…',\n referrerScopeType: BillingScopeType.ORGANIZATIONS,\n },\n response: {\n _id: 'referral_01HX2…',\n referralCode: 'WILDO-7Q2K9X',\n referrerBillingAccountId: 'billacct_org_01HX2…',\n referrerScopeType: BillingScopeType.ORGANIZATIONS,\n status: ReferralStatus.PENDING,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Patch status, referred ids, applied flags, and timestamps as the funnel progresses.',\n outcome: 'Updated row; reward application should be transactional in the service layer.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The referral record advanced (status / referred ids / reward-applied flags / timestamps) and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields (status transition, referred account, applied flags) fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to mutate referral program rows.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No referral exists for the supplied id in the caller’s billing scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The referee is already claimed/converted on this referral, or a `*RewardApplied` idempotency bit conflicts with a concurrent payout job.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Referral program definitions may live in separate config; this row is the per-relationship state machine, not the global program editor.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n\nexport const referralsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(referralsMainUI), resourceFrontendConfiguration(referralsAdminUI)),\n referralsBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` shows `referralCode` in lists for share/audit.' },\n layout: {\n purpose: 'Inline summary in billing presets (no `refs.sections`) shows `referralCode`, status, scope badges, key dates, and referrer id.',\n displayPurpose: 'Main bundle has no addressable `views`; merged admin adds LIST+READ (non-addressable) for back-office triage with org owner roles in the factory.',\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin includes LIST in `views` as non-addressable — document for spec/preset overlay parity.', whenToUse: 'Org referral tables when super-admin or org-admin routes are wired.' },\n [Op.READ]: { purpose: 'Merged admin includes READ in `views` as non-addressable.', whenToUse: 'Detail drawer on one referral when wired.' },\n },\n }),\n);\n"]}
@@ -1,15 +1,15 @@
1
1
  import { BillingSubscription_Operations, CoreResourceOperation as Op, SubscriptionStatus } from '@wildo-ai/saas-models';
2
- export declare const organizationSubscriptionsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<typeof BillingSubscription_Operations, Op.READ | Op.UPDATE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
2
+ export declare const organizationSubscriptionsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<typeof BillingSubscription_Operations, Op.READ | Op.UPDATE | Op.UPDATE_MANY | Op.CREATE | Op.LIST, import("zod").ZodObject<{
3
3
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
4
4
  billingAccountId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>;
5
5
  status: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodEnum<typeof SubscriptionStatus>>>>>;
6
- items: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodArray<import("zod").ZodObject<{
6
+ items: import("zod").ZodArray<import("zod").ZodObject<{
7
7
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
8
8
  productId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
9
9
  priceId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
10
10
  quantity: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>;
11
11
  providerSubscriptionItemId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
12
- }, import("zod/v4/core").$strip>>>;
12
+ }, import("zod/v4/core").$strip>>;
13
13
  currentPeriodStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate>>;
14
14
  currentPeriodEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate>>>;
15
15
  trialStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodDate>>;
@@ -31,17 +31,17 @@ export declare const organizationSubscriptionsResourceSpecification: import("../
31
31
  createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
32
32
  updatedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
33
33
  }, import("zod/v4/core").$strip>>;
34
- export declare const userSubscriptionsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<typeof BillingSubscription_Operations, Op.READ | Op.UPDATE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
34
+ export declare const userSubscriptionsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<typeof BillingSubscription_Operations, Op.READ | Op.UPDATE | Op.UPDATE_MANY | Op.CREATE | Op.LIST, import("zod").ZodObject<{
35
35
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
36
36
  billingAccountId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>;
37
37
  status: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodEnum<typeof SubscriptionStatus>>>>>;
38
- items: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodArray<import("zod").ZodObject<{
38
+ items: import("zod").ZodArray<import("zod").ZodObject<{
39
39
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
40
40
  productId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
41
41
  priceId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
42
42
  quantity: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>;
43
43
  providerSubscriptionItemId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
44
- }, import("zod/v4/core").$strip>>>;
44
+ }, import("zod/v4/core").$strip>>;
45
45
  currentPeriodStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate>>;
46
46
  currentPeriodEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate>>>;
47
47
  trialStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodDate>>;
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/subscriptions.resource.specification.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,8BAA8B,EAC9B,qBAAqB,IAAI,EAAE,EAG3B,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAkZ/B,eAAO,MAAM,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAG1D,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAmF,CAAC"}
1
+ {"version":3,"file":"subscriptions.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/subscriptions.resource.specification.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,8BAA8B,EAC9B,qBAAqB,IAAI,EAAE,EAG3B,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAuZ/B,eAAO,MAAM,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAG1D,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAmF,CAAC"}
@@ -4,6 +4,7 @@ import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@w
4
4
  import { BillingSubscriptionBaseSchema, BillingSubscription_Operations, CoreResourceOperation as Op, CoreResourceType, ResourcePrimaryScope, SubscriptionStatus, billingSubscriptionsPolymorphicFactories, } from '@wildo-ai/saas-models';
5
5
  import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
6
6
  import { BILLING_API_REFERENCE_PAGE_REQUEST, billingApiReferencePage, createBillingApiReferenceScopeExample, } from './billing-api-reference-examples.js';
7
+ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
7
8
  const subResourcePrimaryScopeByResourceType = {
8
9
  [CoreResourceType.ORGANIZATION_SUBSCRIPTIONS]: ResourcePrimaryScope.ORGANIZATIONS,
9
10
  [CoreResourceType.USER_SUBSCRIPTIONS]: ResourcePrimaryScope.USER_SELF,
@@ -48,6 +49,7 @@ function buildSubscriptionBase(resourceType, memberName) {
48
49
  businessRole: 'Entitlement driver for seats and renewals — the object billing emails and plan changes refer to.',
49
50
  lifecycleRole: 'Created after a successful checkout and updated after subscription changes or billing-provider events. A cancelled subscription is retained as billing history rather than cascade-deleted with its account, and subject erasure terminates active billing.',
50
51
  audience: LabelAudience.ADMIN,
52
+ subDomain: EngineResourceSubDomain.BILLING,
51
53
  codeHandling: {
52
54
  mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'BillingSubscriptionBaseSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },
53
55
  resourceFactoryCollectionEntry: {
@@ -179,7 +181,7 @@ function buildSubscriptionBase(resourceType, memberName) {
179
181
  purpose: 'Internal updates from webhooks or migration; user-facing changes often use custom ops.',
180
182
  outcome: 'Patched fields per DTO rules in factory.',
181
183
  responseStatuses: [
182
- { code: HttpResponseStatusCode.OK_200, meaning: 'The subscription fields were patched (typically reconciling provider webhook state) and the updated row is returned.' },
184
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The subscription fields were patched (typically reconciling provider webhook state) and the updated record is returned.' },
183
185
  ],
184
186
  errorScenarios: [
185
187
  { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },
@@ -190,8 +192,8 @@ function buildSubscriptionBase(resourceType, memberName) {
190
192
  },
191
193
  [BillingSubscription_Operations.CANCEL]: {
192
194
  operationId: BillingSubscription_Operations.CANCEL,
193
- purpose: 'Cancel at period end or immediately per request DTO.',
194
- outcome: 'Provider and row updated; emails may fire per runtime config.',
195
+ purpose: 'Cancel at the end of the current period or immediately, within what the plan permits.',
196
+ outcome: 'Provider and row updated; emails may fire per runtime config. Timing is decided in this order: the request’s `cancelImmediately` when it names one, then the plan product’s authored default, then the end of the current period. A plan may FORBID immediate cancellation, in which case a request for one is refused rather than quietly downgraded — a caller told their subscription ended when it has not is worse served than one told no.',
195
197
  responseStatuses: [
196
198
  { code: HttpResponseStatusCode.OK_200, meaning: 'The cancellation was accepted at the provider and mirrored locally — either `cancelAtPeriodEnd` is set or the subscription is now `CANCELLED` per the `cancelImmediately` flag.' },
197
199
  ],
@@ -199,6 +201,7 @@ function buildSubscriptionBase(resourceType, memberName) {
199
201
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to cancel the subscription (a CRITICAL-risk lifecycle action).' },
200
202
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },
201
203
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription is in a state the provider will not cancel (e.g. already terminated, or `INCOMPLETE_EXPIRED`).' },
204
+ { code: HttpResponseStatusCode.CONFLICT_409, when: 'Immediate cancellation was requested for a plan whose product forbids it. The subscription can still be cancelled at the end of the current period.' },
202
205
  ],
203
206
  // Convergent lifecycle set: cancelling drives the subscription toward a fixed
204
207
  // cancelled / cancel-at-period-end state, so a repeat request lands the same
@@ -255,6 +258,7 @@ function buildSubscriptionBase(resourceType, memberName) {
255
258
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to change the plan (a HIGH-risk commercial action).' },
256
259
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id, or the target product/price is not in the catalog.' },
257
260
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'The requested price is incompatible with the current subscription, or the provider rejects the proration in the subscription’s current state.' },
261
+ { code: HttpResponseStatusCode.CONFLICT_409, when: '`newProductKey` (or the price named by `newPriceId`) has been RETIRED from the code catalogue. A subscription may not be MOVED ONTO a retired product; a subscription already on one keeps running, and REMOVE_ADDON deliberately still works so a customer is never trapped on a withdrawn add-on.', errorCode: 'BILLING_PRODUCT_RETIRED' },
258
262
  ],
259
263
  // Non-convergent: each plan swap is a distinct commercial change with its own
260
264
  // proration at the provider, so repeating the request is not side-effect-free.
@@ -288,6 +292,7 @@ function buildSubscriptionBase(resourceType, memberName) {
288
292
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to add an add-on (a HIGH-risk commercial action).' },
289
293
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id, or the add-on product is not in the catalog.' },
290
294
  { code: HttpResponseStatusCode.CONFLICT_409, when: 'The add-on is already attached, or is incompatible with the current plan per provider rules.' },
295
+ { code: HttpResponseStatusCode.CONFLICT_409, when: '`addonProductKey` (or the price named by `priceId`) has been RETIRED from the code catalogue and may no longer be bought.', errorCode: 'BILLING_PRODUCT_RETIRED' },
291
296
  ],
292
297
  // Non-convergent: adding an add-on is an incremental commercial change; a repeat
293
298
  // call would attempt to attach the same add-on again (and trips the 409 above).