@wildo-ai/saas-specifications 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (677) hide show
  1. package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts +10 -8
  2. package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts.map +1 -1
  3. package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js +14 -13
  4. package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js.map +1 -1
  5. package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts +3 -2
  6. package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts.map +1 -1
  7. package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js +4 -3
  8. package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js.map +1 -1
  9. package/dist/esm/_catalogs/schema-org/index.d.ts +31 -15
  10. package/dist/esm/_catalogs/schema-org/index.d.ts.map +1 -1
  11. package/dist/esm/_catalogs/schema-org/index.js +34 -13
  12. package/dist/esm/_catalogs/schema-org/index.js.map +1 -1
  13. package/dist/esm/_catalogs/schema-org/product.catalog-spec.d.ts +2 -2
  14. package/dist/esm/_catalogs/schema-org/product.catalog-spec.js +4 -4
  15. package/dist/esm/_catalogs/schema-org/product.catalog-spec.js.map +1 -1
  16. package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts +45 -0
  17. package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts.map +1 -0
  18. package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js +58 -0
  19. package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js.map +1 -0
  20. package/dist/esm/_core/application-specification-family-identity.schemas.d.ts +3 -2
  21. package/dist/esm/_core/application-specification-family-identity.schemas.d.ts.map +1 -1
  22. package/dist/esm/_core/application-specification-family-identity.schemas.js +3 -2
  23. package/dist/esm/_core/application-specification-family-identity.schemas.js.map +1 -1
  24. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts +18 -0
  25. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
  26. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +39 -13
  27. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
  28. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +43 -13
  29. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
  30. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +90 -2
  31. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
  32. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +70 -6
  33. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
  34. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
  35. package/dist/esm/_core/build-plan/build-plan.family-aspects.js +26 -4
  36. package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
  37. package/dist/esm/_core/business-semantics.specifications.schemas.d.ts +14 -0
  38. package/dist/esm/_core/business-semantics.specifications.schemas.d.ts.map +1 -1
  39. package/dist/esm/_core/business-semantics.specifications.schemas.js.map +1 -1
  40. package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts.map +1 -1
  41. package/dist/esm/_core/capability-composition/capability-composition-validation.js +1 -0
  42. package/dist/esm/_core/capability-composition/capability-composition-validation.js.map +1 -1
  43. package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts +21 -2
  44. package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts.map +1 -1
  45. package/dist/esm/_core/capability-composition/capability-composition.schemas.js +20 -1
  46. package/dist/esm/_core/capability-composition/capability-composition.schemas.js.map +1 -1
  47. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +11 -32
  48. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
  49. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +70 -3
  50. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
  51. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts +142 -17
  52. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
  53. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +285 -30
  54. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
  55. package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +183 -18
  56. package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
  57. package/dist/esm/_core/compliance-documents/processor-register.schemas.js +165 -18
  58. package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
  59. package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts +139 -0
  60. package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts.map +1 -0
  61. package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js +172 -0
  62. package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js.map +1 -0
  63. package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts +306 -0
  64. package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts.map +1 -0
  65. package/dist/esm/_core/compliance-documents/recipient-population.schemas.js +502 -0
  66. package/dist/esm/_core/compliance-documents/recipient-population.schemas.js.map +1 -0
  67. package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts +107 -0
  68. package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts.map +1 -0
  69. package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js +118 -0
  70. package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js.map +1 -0
  71. package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts +56 -0
  72. package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts.map +1 -0
  73. package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js +100 -0
  74. package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js.map +1 -0
  75. package/dist/esm/_core/composite-view-specification.schemas.js +8 -1
  76. package/dist/esm/_core/composite-view-specification.schemas.js.map +1 -1
  77. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +3 -2
  78. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -1
  79. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +3 -2
  80. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -1
  81. package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts +16 -3
  82. package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts.map +1 -1
  83. package/dist/esm/_core/experience-plan/experience-plan.schemas.js +70 -5
  84. package/dist/esm/_core/experience-plan/experience-plan.schemas.js.map +1 -1
  85. package/dist/esm/_core/family-aspects.schemas.d.ts +10 -0
  86. package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -1
  87. package/dist/esm/_core/family-aspects.schemas.js.map +1 -1
  88. package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +2 -2
  89. package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts +1 -0
  90. package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts.map +1 -1
  91. package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts +16 -0
  92. package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts.map +1 -1
  93. package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js +8 -0
  94. package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js.map +1 -1
  95. package/dist/esm/_core/index.d.ts +3 -0
  96. package/dist/esm/_core/index.d.ts.map +1 -1
  97. package/dist/esm/_core/index.js +3 -0
  98. package/dist/esm/_core/index.js.map +1 -1
  99. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +5 -0
  100. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
  101. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +3 -1
  102. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
  103. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
  104. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +12 -2
  105. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
  106. package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +30 -2
  107. package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
  108. package/dist/esm/_core/integration-plan/integration-plan.schemas.js +32 -2
  109. package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
  110. package/dist/esm/_core/market/feature-benefit.schemas.js +2 -2
  111. package/dist/esm/_core/market/feature-benefit.schemas.js.map +1 -1
  112. package/dist/esm/_core/market/market-alternative.schemas.js +2 -2
  113. package/dist/esm/_core/market/market-alternative.schemas.js.map +1 -1
  114. package/dist/esm/_core/market/market-buying-journey.schemas.js +2 -2
  115. package/dist/esm/_core/market/market-buying-journey.schemas.js.map +1 -1
  116. package/dist/esm/_core/market/market-category.schemas.js +2 -2
  117. package/dist/esm/_core/market/market-category.schemas.js.map +1 -1
  118. package/dist/esm/_core/market/market-channel.schemas.js +2 -2
  119. package/dist/esm/_core/market/market-channel.schemas.js.map +1 -1
  120. package/dist/esm/_core/market/market-gain.schemas.js +2 -2
  121. package/dist/esm/_core/market/market-gain.schemas.js.map +1 -1
  122. package/dist/esm/_core/market/market-icp.schemas.d.ts.map +1 -1
  123. package/dist/esm/_core/market/market-icp.schemas.js +2 -2
  124. package/dist/esm/_core/market/market-icp.schemas.js.map +1 -1
  125. package/dist/esm/_core/market/market-job.schemas.js +2 -2
  126. package/dist/esm/_core/market/market-job.schemas.js.map +1 -1
  127. package/dist/esm/_core/market/market-message-template.schemas.js +2 -2
  128. package/dist/esm/_core/market/market-message-template.schemas.js.map +1 -1
  129. package/dist/esm/_core/market/market-objection.schemas.js +2 -2
  130. package/dist/esm/_core/market/market-objection.schemas.js.map +1 -1
  131. package/dist/esm/_core/market/market-pain.schemas.js +2 -2
  132. package/dist/esm/_core/market/market-pain.schemas.js.map +1 -1
  133. package/dist/esm/_core/market/market-persona.schemas.d.ts.map +1 -1
  134. package/dist/esm/_core/market/market-persona.schemas.js +2 -2
  135. package/dist/esm/_core/market/market-persona.schemas.js.map +1 -1
  136. package/dist/esm/_core/market/market-positioning.schemas.js +2 -2
  137. package/dist/esm/_core/market/market-positioning.schemas.js.map +1 -1
  138. package/dist/esm/_core/market/market-proof.schemas.js +2 -2
  139. package/dist/esm/_core/market/market-proof.schemas.js.map +1 -1
  140. package/dist/esm/_core/market/market-references.schemas.d.ts +6 -0
  141. package/dist/esm/_core/market/market-references.schemas.d.ts.map +1 -1
  142. package/dist/esm/_core/market/market-references.schemas.js +6 -0
  143. package/dist/esm/_core/market/market-references.schemas.js.map +1 -1
  144. package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +4 -4
  145. package/dist/esm/_core/market/market-tone-of-voice.schemas.js +2 -2
  146. package/dist/esm/_core/market/market-tone-of-voice.schemas.js.map +1 -1
  147. package/dist/esm/_core/market/market-trigger.schemas.js +2 -2
  148. package/dist/esm/_core/market/market-trigger.schemas.js.map +1 -1
  149. package/dist/esm/_core/market/market.family-aspects.js +1 -1
  150. package/dist/esm/_core/market/market.family-aspects.js.map +1 -1
  151. package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts.map +1 -1
  152. package/dist/esm/_core/placement-plan/placement-plan.schemas.js +6 -1
  153. package/dist/esm/_core/placement-plan/placement-plan.schemas.js.map +1 -1
  154. package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts +1 -0
  155. package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts.map +1 -1
  156. package/dist/esm/_core/requirements/functional-requirement.schemas.js +8 -0
  157. package/dist/esm/_core/requirements/functional-requirement.schemas.js.map +1 -1
  158. package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts +1 -0
  159. package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts.map +1 -1
  160. package/dist/esm/_core/resource-specification.schemas.d.ts +86 -28
  161. package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
  162. package/dist/esm/_core/resource-specification.schemas.js +110 -24
  163. package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
  164. package/dist/esm/_core/utils/retention-clock-field-specs.d.ts +13 -0
  165. package/dist/esm/_core/utils/retention-clock-field-specs.d.ts.map +1 -0
  166. package/dist/esm/_core/utils/retention-clock-field-specs.js +26 -0
  167. package/dist/esm/_core/utils/retention-clock-field-specs.js.map +1 -0
  168. package/dist/esm/_core/website-plan/website-plan.schemas.d.ts +31 -6
  169. package/dist/esm/_core/website-plan/website-plan.schemas.d.ts.map +1 -1
  170. package/dist/esm/_core/website-plan/website-plan.schemas.js +35 -6
  171. package/dist/esm/_core/website-plan/website-plan.schemas.js.map +1 -1
  172. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts +142 -3
  173. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts.map +1 -1
  174. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js +148 -14
  175. package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js.map +1 -1
  176. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +70 -10
  177. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
  178. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +98 -11
  179. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
  180. package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts +215 -0
  181. package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts.map +1 -0
  182. package/dist/esm/application-creation/application-line.application-creation.schemas.js +253 -0
  183. package/dist/esm/application-creation/application-line.application-creation.schemas.js.map +1 -0
  184. package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts +39 -0
  185. package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts.map +1 -0
  186. package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js +37 -0
  187. package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js.map +1 -0
  188. package/dist/esm/application-creation/journey.application-creation.schemas.d.ts +5 -49
  189. package/dist/esm/application-creation/journey.application-creation.schemas.d.ts.map +1 -1
  190. package/dist/esm/application-creation/journey.application-creation.schemas.js +25 -60
  191. package/dist/esm/application-creation/journey.application-creation.schemas.js.map +1 -1
  192. package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts +28 -0
  193. package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts.map +1 -0
  194. package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js +32 -0
  195. package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js.map +1 -0
  196. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +26 -6
  197. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
  198. package/dist/esm/application-creation/playbooks.application-creation.schemas.js +28 -1
  199. package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
  200. package/dist/esm/application-creation.exports.d.ts +7 -0
  201. package/dist/esm/application-creation.exports.d.ts.map +1 -1
  202. package/dist/esm/application-creation.exports.js +7 -0
  203. package/dist/esm/application-creation.exports.js.map +1 -1
  204. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.d.ts +1 -1
  205. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js +1 -1
  206. package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js.map +1 -1
  207. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +24 -1
  208. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
  209. package/dist/esm/assurance/assurance-authority-basis.definitions.js +75 -5
  210. package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
  211. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +6 -0
  212. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
  213. package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts +11 -0
  214. package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts.map +1 -1
  215. package/dist/esm/assurance/assurance-document-blueprint-selection.js +22 -3
  216. package/dist/esm/assurance/assurance-document-blueprint-selection.js.map +1 -1
  217. package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
  218. package/dist/esm/assurance/assurance-document-system.definitions.js +39 -6
  219. package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
  220. package/dist/esm/assurance/assurance-document-system.schemas.d.ts +11 -0
  221. package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
  222. package/dist/esm/assurance/assurance-document-system.schemas.js +19 -0
  223. package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
  224. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
  225. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +295 -31
  226. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
  227. package/dist/esm/assurance/assurance-foundation.schemas.d.ts +7 -0
  228. package/dist/esm/assurance/assurance-foundation.schemas.d.ts.map +1 -1
  229. package/dist/esm/assurance/assurance-foundation.schemas.js +7 -0
  230. package/dist/esm/assurance/assurance-foundation.schemas.js.map +1 -1
  231. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
  232. package/dist/esm/assurance/assurance-objective-catalog.definitions.js +17 -0
  233. package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
  234. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +5 -1
  235. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -1
  236. package/dist/esm/assurance/assurance-program-generation.schemas.js +6 -3
  237. package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -1
  238. package/dist/esm/assurance/assurance-program.family-aspects.js +1 -1
  239. package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -1
  240. package/dist/esm/assurance/assurance-program.schemas.d.ts +232 -3
  241. package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
  242. package/dist/esm/assurance/assurance-program.schemas.js +107 -14
  243. package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
  244. package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
  245. package/dist/esm/assurance/assurance-source-registry.definitions.js +77 -1
  246. package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
  247. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
  248. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +23 -1
  249. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
  250. package/dist/esm/assurance/governed-document-release.d.ts +7 -0
  251. package/dist/esm/assurance/governed-document-release.d.ts.map +1 -1
  252. package/dist/esm/assurance/governed-document-release.js +11 -2
  253. package/dist/esm/assurance/governed-document-release.js.map +1 -1
  254. package/dist/esm/companion-exports.d.ts +6 -5
  255. package/dist/esm/companion-exports.d.ts.map +1 -1
  256. package/dist/esm/companion-exports.js.map +1 -1
  257. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts +1 -0
  258. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
  259. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +35 -33
  260. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
  261. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.d.ts.map +1 -1
  262. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +6 -2
  263. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
  264. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
  265. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +13 -12
  266. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
  267. package/dist/esm/engine/applications/resources/application-versions.resource.specification.d.ts.map +1 -1
  268. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +26 -2
  269. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
  270. package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts.map +1 -1
  271. package/dist/esm/engine/applications/resources/applications.resource.specification.js +4 -4
  272. package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
  273. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map +1 -1
  274. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +11 -9
  275. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map +1 -1
  276. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +2 -2
  277. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
  278. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts +1 -0
  279. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
  280. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +45 -32
  281. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
  282. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts +1 -23
  283. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
  284. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +185 -31
  285. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
  286. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts +2 -1
  287. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts.map +1 -1
  288. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js +29 -7
  289. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js.map +1 -1
  290. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts.map +1 -1
  291. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +7 -1
  292. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
  293. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts.map +1 -1
  294. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +9 -6
  295. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
  296. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts +1 -0
  297. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts.map +1 -1
  298. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +11 -7
  299. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
  300. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
  301. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +18 -16
  302. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
  303. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.d.ts.map +1 -1
  304. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +9 -11
  305. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js.map +1 -1
  306. package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
  307. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +238 -219
  308. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
  309. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts +0 -24
  310. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
  311. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js +76 -16
  312. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
  313. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts +2 -1
  314. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts.map +1 -1
  315. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js +28 -6
  316. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js.map +1 -1
  317. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
  318. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +29 -11
  319. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
  320. package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js +1 -1
  321. package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js.map +1 -1
  322. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +2 -0
  323. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts.map +1 -1
  324. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +13 -12
  325. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
  326. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +5 -5
  327. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
  328. package/dist/esm/engine/billing/resources/prices.resource.specification.d.ts.map +1 -1
  329. package/dist/esm/engine/billing/resources/prices.resource.specification.js +12 -9
  330. package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
  331. package/dist/esm/engine/billing/resources/products.resource.specification.d.ts +7 -4
  332. package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
  333. package/dist/esm/engine/billing/resources/products.resource.specification.js +36 -16
  334. package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
  335. package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
  336. package/dist/esm/engine/billing/resources/promotions.resource.specification.js +13 -10
  337. package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
  338. package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts +13 -8
  339. package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
  340. package/dist/esm/engine/billing/resources/referrals.resource.specification.js +54 -20
  341. package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
  342. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +30 -4
  343. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
  344. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +85 -25
  345. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
  346. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +2 -2
  347. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
  348. package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts +15 -2
  349. package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts.map +1 -1
  350. package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js +45 -10
  351. package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js.map +1 -1
  352. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts +15 -2
  353. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts.map +1 -1
  354. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +52 -12
  355. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
  356. package/dist/esm/engine/compliance/resources/index.d.ts +1 -0
  357. package/dist/esm/engine/compliance/resources/index.d.ts.map +1 -1
  358. package/dist/esm/engine/compliance/resources/index.js +1 -0
  359. package/dist/esm/engine/compliance/resources/index.js.map +1 -1
  360. package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts +39 -0
  361. package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts.map +1 -0
  362. package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js +325 -0
  363. package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js.map +1 -0
  364. package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts +23 -0
  365. package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts.map +1 -0
  366. package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js +197 -0
  367. package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js.map +1 -0
  368. package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
  369. package/dist/esm/engine/engine-resource-specifications.registry.js +59 -0
  370. package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
  371. package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
  372. package/dist/esm/engine/errors/error-messages.specification.js +69 -0
  373. package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
  374. package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts +5 -5
  375. package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts.map +1 -1
  376. package/dist/esm/engine/features/resources/application-features.resource.specification.js +9 -10
  377. package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
  378. package/dist/esm/engine/features/resources/organization-features.resource.specification.d.ts +5 -5
  379. package/dist/esm/engine/features/resources/organization-features.resource.specification.js +11 -11
  380. package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
  381. package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts +5 -5
  382. package/dist/esm/engine/features/resources/user-features.resource.specification.js +3 -3
  383. package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -1
  384. package/dist/esm/engine/files/resources/files.resource.specification.d.ts.map +1 -1
  385. package/dist/esm/engine/files/resources/files.resource.specification.js +7 -8
  386. package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
  387. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts.map +1 -1
  388. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +16 -4
  389. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
  390. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +1 -1
  391. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
  392. package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts +11 -0
  393. package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts.map +1 -0
  394. package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js +382 -0
  395. package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js.map +1 -0
  396. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +139 -1
  397. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts.map +1 -1
  398. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +150 -4
  399. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
  400. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts.map +1 -1
  401. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +9 -1
  402. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
  403. package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts +3 -0
  404. package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts.map +1 -0
  405. package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js +162 -0
  406. package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js.map +1 -0
  407. package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts +3 -0
  408. package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts.map +1 -0
  409. package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js +158 -0
  410. package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js.map +1 -0
  411. package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts +2 -1
  412. package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts.map +1 -1
  413. package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js +16 -9
  414. package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js.map +1 -1
  415. package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js +1 -1
  416. package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js.map +1 -1
  417. package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js +1 -1
  418. package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js.map +1 -1
  419. package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts +5 -0
  420. package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts.map +1 -0
  421. package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js +79 -0
  422. package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js.map +1 -0
  423. package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js +1 -1
  424. package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js.map +1 -1
  425. package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.d.ts.map +1 -1
  426. package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js +3 -1
  427. package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js.map +1 -1
  428. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts.map +1 -1
  429. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js +5 -4
  430. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js.map +1 -1
  431. package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js +1 -1
  432. package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js.map +1 -1
  433. package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js +1 -1
  434. package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js.map +1 -1
  435. package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js +2 -2
  436. package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js.map +1 -1
  437. package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js +1 -1
  438. package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js.map +1 -1
  439. package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js +2 -2
  440. package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js.map +1 -1
  441. package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js +1 -1
  442. package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js.map +1 -1
  443. package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js +1 -1
  444. package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js.map +1 -1
  445. package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.d.ts.map +1 -1
  446. package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js +1 -1
  447. package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js.map +1 -1
  448. package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js +2 -2
  449. package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js.map +1 -1
  450. package/dist/esm/engine/frontend-components/index.d.ts +1 -0
  451. package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
  452. package/dist/esm/engine/frontend-components/index.js +3 -0
  453. package/dist/esm/engine/frontend-components/index.js.map +1 -1
  454. package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js +1 -1
  455. package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js.map +1 -1
  456. package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js +1 -1
  457. package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js.map +1 -1
  458. package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js +1 -1
  459. package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js.map +1 -1
  460. package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.d.ts.map +1 -1
  461. package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js +9 -4
  462. package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js.map +1 -1
  463. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +4 -4
  464. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
  465. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts.map +1 -1
  466. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +34 -0
  467. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
  468. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
  469. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +26 -0
  470. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
  471. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +2 -2
  472. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
  473. package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts +9 -0
  474. package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts.map +1 -0
  475. package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js +122 -0
  476. package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js.map +1 -0
  477. package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts +9 -0
  478. package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts.map +1 -0
  479. package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js +152 -0
  480. package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js.map +1 -0
  481. package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts +10 -0
  482. package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts.map +1 -0
  483. package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js +94 -0
  484. package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js.map +1 -0
  485. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts +10 -0
  486. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts.map +1 -0
  487. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js +64 -0
  488. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js.map +1 -0
  489. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts +4 -1
  490. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts.map +1 -1
  491. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js +20 -16
  492. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js.map +1 -1
  493. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts +9 -0
  494. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts.map +1 -0
  495. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js +200 -0
  496. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js.map +1 -0
  497. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.d.ts.map +1 -1
  498. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +19 -6
  499. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
  500. package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts +9 -0
  501. package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts.map +1 -0
  502. package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js +97 -0
  503. package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js.map +1 -0
  504. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts +8 -0
  505. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
  506. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +2 -2
  507. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
  508. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts +8 -8
  509. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +1 -1
  510. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
  511. package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js +4 -4
  512. package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js.map +1 -1
  513. package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts +9 -0
  514. package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts.map +1 -0
  515. package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js +153 -0
  516. package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js.map +1 -0
  517. package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts +81 -0
  518. package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts.map +1 -0
  519. package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js +437 -0
  520. package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js.map +1 -0
  521. package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts +112 -0
  522. package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts.map +1 -0
  523. package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js +287 -0
  524. package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js.map +1 -0
  525. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts +131 -0
  526. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -0
  527. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +594 -0
  528. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -0
  529. package/dist/esm/engine/notifications/resources/index.d.ts +1 -0
  530. package/dist/esm/engine/notifications/resources/index.d.ts.map +1 -1
  531. package/dist/esm/engine/notifications/resources/index.js +1 -0
  532. package/dist/esm/engine/notifications/resources/index.js.map +1 -1
  533. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts +6 -3
  534. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
  535. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +20 -5
  536. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
  537. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map +1 -1
  538. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +12 -2
  539. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
  540. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts +6 -6
  541. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
  542. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +8 -11
  543. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
  544. package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts +4 -0
  545. package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts.map +1 -0
  546. package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js +62 -0
  547. package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js.map +1 -0
  548. package/dist/esm/engine/notifications/system-emails/index.d.ts +2 -1
  549. package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
  550. package/dist/esm/engine/notifications/system-emails/index.js +4 -2
  551. package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
  552. package/dist/esm/engine/organizations/resources/index.d.ts +2 -0
  553. package/dist/esm/engine/organizations/resources/index.d.ts.map +1 -1
  554. package/dist/esm/engine/organizations/resources/index.js +2 -0
  555. package/dist/esm/engine/organizations/resources/index.js.map +1 -1
  556. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +3 -0
  557. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
  558. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +40 -12
  559. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
  560. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +2 -2
  561. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
  562. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +2 -2
  563. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
  564. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts +0 -1
  565. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts.map +1 -1
  566. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +4 -6
  567. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
  568. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts.map +1 -1
  569. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +7 -3
  570. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
  571. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.d.ts.map +1 -1
  572. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +15 -8
  573. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
  574. package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts +3 -1
  575. package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
  576. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +36 -21
  577. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
  578. package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts +38 -0
  579. package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts.map +1 -0
  580. package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js +152 -0
  581. package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js.map +1 -0
  582. package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts +106 -0
  583. package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts.map +1 -0
  584. package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js +417 -0
  585. package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js.map +1 -0
  586. package/dist/esm/engine/providers/apple.provider.specification.js +1 -1
  587. package/dist/esm/engine/providers/apple.provider.specification.js.map +1 -1
  588. package/dist/esm/engine/providers/github.provider.specification.js +1 -1
  589. package/dist/esm/engine/providers/github.provider.specification.js.map +1 -1
  590. package/dist/esm/engine/providers/google-places.provider.specification.d.ts +6 -0
  591. package/dist/esm/engine/providers/google-places.provider.specification.d.ts.map +1 -0
  592. package/dist/esm/engine/providers/google-places.provider.specification.js +44 -0
  593. package/dist/esm/engine/providers/google-places.provider.specification.js.map +1 -0
  594. package/dist/esm/engine/providers/google.provider.specification.js +1 -1
  595. package/dist/esm/engine/providers/google.provider.specification.js.map +1 -1
  596. package/dist/esm/engine/providers/index.d.ts +2 -0
  597. package/dist/esm/engine/providers/index.d.ts.map +1 -1
  598. package/dist/esm/engine/providers/index.js +5 -1
  599. package/dist/esm/engine/providers/index.js.map +1 -1
  600. package/dist/esm/engine/providers/microsoft.provider.specification.d.ts.map +1 -1
  601. package/dist/esm/engine/providers/microsoft.provider.specification.js +10 -6
  602. package/dist/esm/engine/providers/microsoft.provider.specification.js.map +1 -1
  603. package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts +6 -0
  604. package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts.map +1 -0
  605. package/dist/esm/engine/providers/recaptcha.provider.specification.js +38 -0
  606. package/dist/esm/engine/providers/recaptcha.provider.specification.js.map +1 -0
  607. package/dist/esm/engine/providers/resend.provider.specification.d.ts.map +1 -1
  608. package/dist/esm/engine/providers/resend.provider.specification.js +3 -1
  609. package/dist/esm/engine/providers/resend.provider.specification.js.map +1 -1
  610. package/dist/esm/engine/providers/stripe.provider.specification.d.ts.map +1 -1
  611. package/dist/esm/engine/providers/stripe.provider.specification.js +3 -2
  612. package/dist/esm/engine/providers/stripe.provider.specification.js.map +1 -1
  613. package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts +2 -0
  614. package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts.map +1 -0
  615. package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js +21 -0
  616. package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js.map +1 -0
  617. package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts +2 -0
  618. package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts.map +1 -0
  619. package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js +21 -0
  620. package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js.map +1 -0
  621. package/dist/esm/engine/roles/index.d.ts +13 -5
  622. package/dist/esm/engine/roles/index.d.ts.map +1 -1
  623. package/dist/esm/engine/roles/index.js +19 -6
  624. package/dist/esm/engine/roles/index.js.map +1 -1
  625. package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts +2 -0
  626. package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts.map +1 -0
  627. package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js +21 -0
  628. package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js.map +1 -0
  629. package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts +7 -0
  630. package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts.map +1 -0
  631. package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js +72 -0
  632. package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js.map +1 -0
  633. package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts +2 -0
  634. package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts.map +1 -0
  635. package/dist/esm/engine/roles/org-service-provider.role.specification.js +22 -0
  636. package/dist/esm/engine/roles/org-service-provider.role.specification.js.map +1 -0
  637. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +2 -2
  638. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
  639. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +3 -3
  640. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
  641. package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts +1 -1
  642. package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts.map +1 -1
  643. package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js +3 -6
  644. package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js.map +1 -1
  645. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -2
  646. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js.map +1 -1
  647. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js +2 -2
  648. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
  649. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +0 -4
  650. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
  651. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +0 -3
  652. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
  653. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +0 -3
  654. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
  655. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +7 -7
  656. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
  657. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +5 -5
  658. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
  659. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +0 -3
  660. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
  661. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +11 -18
  662. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
  663. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +6 -6
  664. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
  665. package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts.map +1 -1
  666. package/dist/esm/engine/users/resources/user-self.resource.specification.js +5 -1
  667. package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
  668. package/dist/esm/engine/users/resources/users.resource.specification.d.ts +8 -5
  669. package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
  670. package/dist/esm/engine/users/resources/users.resource.specification.js +49 -16
  671. package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
  672. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
  673. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +29 -10
  674. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
  675. package/dist/tsconfig.build.tsbuildinfo +1 -1
  676. package/package.json +8 -8
  677. package/dist/assurance/external-framework-mapping.json +0 -1228
@@ -1,7 +1,7 @@
1
1
  import { referralsAdminResourceUIBehavior as referralsAdminSource, referralsMainResourceUIBehavior as referralsMainSource, } from '@wildo-ai/presets-components';
2
2
  import { LabelAudience } from '@wildo-ai/presets-components-models';
3
3
  import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
4
- import { BillingScopeType, CoreResourceOperation as Op, ReferralSchema, ReferralStatus, ResourcePrimaryScope, referralsResourceConfiguration_InitializationFactory as referralsFactory, } from '@wildo-ai/saas-models';
4
+ import { BillingScopeType, CoreResourceOperation as Op, ErrorCustomMessageReference, ReferralSchema, ReferralStatus, Referral_Operations, ResourcePrimaryScope, referralsResourceConfiguration_InitializationFactory as referralsFactory, } from '@wildo-ai/saas-models';
5
5
  import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
6
6
  import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
7
7
  const referralsMainUI = referralsMainSource;
@@ -9,7 +9,7 @@ const referralsAdminUI = referralsAdminSource;
9
9
  const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({ schemaShape }) => ({
10
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.',
11
11
  businessRole: 'Tracks who referred whom across org vs user billing scopes and whether rewards were applied once the referred party converts.',
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
+ lifecycleRole: 'Issued PENDING by an organization billing account (`ISSUE`), with the rewards copied from the application\'s `billing.referrals` policy. Redeemed by another, new billing account (`REDEEM_REFERRAL`) → ACCEPTED. The referred account\'s first paid invoice → CONVERTED, and each side\'s reward is granted once under a durable settlement claim. A code redeemed after `expiresAt` is refused and marked EXPIRED; the referrer can CANCEL a PENDING or ACCEPTED referral.',
13
13
  audience: LabelAudience.ADMIN,
14
14
  subDomain: EngineResourceSubDomain.BILLING,
15
15
  codeHandling: {
@@ -47,20 +47,20 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
47
47
  meaning: 'Lifecycle of the referral record for reward eligibility.',
48
48
  enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'ReferralStatus', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },
49
49
  values: {
50
- [ReferralStatus.PENDING]: { meaning: 'Code issued; no conversion yet.' },
51
- [ReferralStatus.ACCEPTED]: { meaning: 'Referee signed up; not yet monetized.' },
52
- [ReferralStatus.CONVERTED]: { meaning: 'First qualifying subscription completed — reward hooks run here.' },
53
- [ReferralStatus.EXPIRED]: { meaning: 'Past `expiresAt` without conversion.' },
54
- [ReferralStatus.CANCELLED]: { meaning: 'Programmatically voided referral.' },
50
+ [ReferralStatus.PENDING]: { meaning: 'The code is issued and has not been redeemed.' },
51
+ [ReferralStatus.ACCEPTED]: { meaning: 'A new billing account redeemed the code and has not yet paid an invoice.' },
52
+ [ReferralStatus.CONVERTED]: { meaning: 'The referred account paid its first invoice; both sides\' rewards are granted.' },
53
+ [ReferralStatus.EXPIRED]: { meaning: 'Someone tried to redeem the code after `expiresAt`; it can no longer be redeemed.' },
54
+ [ReferralStatus.CANCELLED]: { meaning: 'The referrer withdrew the referral before it converted.' },
55
55
  },
56
56
  }),
57
- referrerReward: schemaShape.referrerReward.objectSpec({ meaning: 'Serialized reward terms for the referrer when status hits CONVERTED.' }),
58
- referredReward: schemaShape.referredReward.objectSpec({ meaning: 'Serialized reward terms for the referred account on conversion.' }),
59
- referrerRewardApplied: schemaShape.referrerRewardApplied.booleanSpec({ meaning: 'Idempotency bit so payout jobs do not double-apply benefits.' }),
60
- referredRewardApplied: schemaShape.referredRewardApplied.booleanSpec({ meaning: 'Idempotency for the referred-side credit/discount application.' }),
61
- acceptedAt: schemaShape.acceptedAt.dateSpec({ meaning: 'When the referred party accepted/registered using the code.', temporalRole: 'occurred' }),
62
- convertedAt: schemaShape.convertedAt.dateSpec({ meaning: 'When the business defines “conversion” (often first paid subscription).', temporalRole: 'occurred' }),
63
- expiresAt: schemaShape.expiresAt.dateSpec({ meaning: 'When the offer window closes for this code if limited.', temporalRole: 'deadline' }),
57
+ referrerReward: schemaShape.referrerReward.objectSpec({ meaning: 'What the referrer receives on conversion: a `credit` top-up of a credit pool, a `discount` coupon on its active subscription, or a `feature` for `durationDays`. Copied from the application policy when the code was issued, so a later policy change never re-prices it.' }),
58
+ referredReward: schemaShape.referredReward.objectSpec({ meaning: 'What the referred account receives: the same three kinds, delivered on conversion, or a `trial_extension` that lengthens the trial of checkouts it opens while the referral is ACCEPTED.' }),
59
+ referrerRewardApplied: schemaShape.referrerRewardApplied.booleanSpec({ meaning: 'Whether the referrer\'s reward was delivered. A discount for an account with no active subscription stays undelivered until the account pays an invoice on one.' }),
60
+ referredRewardApplied: schemaShape.referredRewardApplied.booleanSpec({ meaning: 'Whether the referred account\'s reward was delivered.' }),
61
+ acceptedAt: schemaShape.acceptedAt.dateSpec({ meaning: 'When the referred account redeemed the code.', temporalRole: 'occurred' }),
62
+ convertedAt: schemaShape.convertedAt.dateSpec({ meaning: 'When the referred account paid its first invoice. A feature reward\'s `durationDays` counts from here.', temporalRole: 'occurred' }),
63
+ expiresAt: schemaShape.expiresAt.dateSpec({ meaning: 'The last moment the code can be redeemed: issue time plus the policy\'s `codeValidityDays`.', temporalRole: 'deadline' }),
64
64
  metadata: schemaShape.metadata.objectSpec({ meaning: 'Campaign ids or UTM echo for marketing analytics.' }),
65
65
  createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),
66
66
  updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last reward or status change.', temporalRole: 'modified' }),
@@ -96,7 +96,7 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
96
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.' },
97
97
  ],
98
98
  errorScenarios: [
99
- { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The referral payload (referrer account / scope) fails schema validation.', errorCode: 'VALIDATION_FAILED' },
99
+ { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The referral payload (referrer account / scope) fails schema validation.' },
100
100
  { 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).' },
101
101
  { 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.' },
102
102
  ],
@@ -126,27 +126,61 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
126
126
  { code: HttpResponseStatusCode.OK_200, meaning: 'The referral record advanced (status / referred ids / reward-applied flags / timestamps) and the updated record is returned.' },
127
127
  ],
128
128
  errorScenarios: [
129
- { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields (status transition, referred account, applied flags) fail schema validation.', errorCode: 'VALIDATION_FAILED' },
129
+ { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields (status transition, referred account, applied flags) fail schema validation.' },
130
130
  { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner role required to mutate referral program rows.' },
131
131
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No referral exists for the supplied id in the caller’s billing scope.' },
132
132
  { 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.' },
133
133
  ],
134
134
  idempotent: true,
135
135
  },
136
+ [Referral_Operations.ISSUE]: {
137
+ operationId: Referral_Operations.ISSUE,
138
+ purpose: 'Issue a single-use referral code for the organization\'s billing account, to share with one prospective customer.',
139
+ outcome: 'A PENDING referral with a new `referralCode`, the rewards the application\'s referral policy promises today, and an `expiresAt` from its `codeValidityDays`. The request carries nothing: the referrer is the routed organization and the rewards are server policy.',
140
+ responseStatuses: [
141
+ { code: HttpResponseStatusCode.CREATED_201, meaning: 'The referral was issued; share its `referralCode`.' },
142
+ ],
143
+ errorScenarios: [
144
+ { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an owner of the organization.' },
145
+ { code: HttpResponseStatusCode.CONFLICT_409, when: 'The application has not turned its referral program on (`billing.referrals.enabled`).', customMessageReference: ErrorCustomMessageReference.BILLING_REFERRAL_PROGRAM_DISABLED },
146
+ { code: HttpResponseStatusCode.CONFLICT_409, when: 'The organization has no billing account yet, so there is nothing to credit its referrals to.', customMessageReference: ErrorCustomMessageReference.BILLING_ACCOUNT_NOT_FOUND },
147
+ ],
148
+ idempotent: false,
149
+ },
150
+ [Referral_Operations.CANCEL]: {
151
+ operationId: Referral_Operations.CANCEL,
152
+ purpose: 'Withdraw a referral that has not converted, so its code can no longer be redeemed or rewarded.',
153
+ outcome: 'The referral is CANCELLED. A converted referral stays as it is: its rewards may already be delivered.',
154
+ responseStatuses: [
155
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The referral was withdrawn.' },
156
+ ],
157
+ errorScenarios: [
158
+ { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an owner of the organization that issued the referral.' },
159
+ { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No referral with that id belongs to the organization.' },
160
+ { code: HttpResponseStatusCode.CONFLICT_409, when: 'The referral has converted, expired or been cancelled already.', customMessageReference: ErrorCustomMessageReference.BILLING_REFERRAL_NOT_CANCELLABLE },
161
+ ],
162
+ idempotent: false,
163
+ },
136
164
  },
137
165
  businessConstraints: [
138
- 'Referral program definitions may live in separate config; this row is the per-relationship state machine, not the global program editor.',
166
+ 'The program — whether codes can be issued, and what each side receives — is the application\'s `billing.referrals` configuration. This row is one code\'s state and the rewards it promised, never the program editor.',
167
+ 'A code is single-use: one referral row links one referrer to one referred account.',
168
+ 'Rewards are server policy. No request can set or change them.',
139
169
  ],
140
170
  }), { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS });
141
171
  export const referralsResourceSpecification = resourceSpecificationFromFrontendConfiguration(mergeResourceFrontendConfigurations(resourceFrontendConfiguration(referralsMainUI), resourceFrontendConfiguration(referralsAdminUI)), referralsBase, () => ({
142
- label: { purpose: 'Preset `getFrontendResourceLabel` shows `referralCode` in lists for share/audit.' },
172
+ label: { purpose: 'Preset `getFrontendResourceLabel` uses `referralCode` as the page title and card title.' },
143
173
  layout: {
144
- purpose: 'Inline summary in billing presets (no `refs.sections`) shows `referralCode`, status, scope badges, key dates, and referrer id.',
145
- 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.',
174
+ purpose: 'No sections: a referral is one code, its status, the two sides and what each earned. It is an immutable ledger row, so there is no edit form.',
175
+ headerPurpose: 'The READ identity line: the `referralCode` as the title and the `status` badge beside it. Neither repeats in the body.',
176
+ displayPurpose: 'Settings rows: the two sides\' scope types, the expiry / acceptance / conversion dates and each side\'s reward and whether it was applied. Every optional row hides when empty. Main bundle has no addressable `views`; merged admin adds LIST+READ (non-addressable).',
177
+ summaryPurpose: 'A card: the code and the status badge, then the two scope types and the two dates — those four keep their labels, because a bare "Organization" beside a bare "User" does not say which side referred and a bare date does not say what happened on it.',
146
178
  },
147
179
  views: {
148
180
  [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.' },
149
181
  [Op.READ]: { purpose: 'Merged admin includes READ in `views` as non-addressable.', whenToUse: 'Detail drawer on one referral when wired.' },
182
+ [Referral_Operations.ISSUE]: { purpose: 'The list\'s action for issuing a new code, in both bundles, non-addressable.', whenToUse: 'An organization owner wants a code to share with one prospective customer.' },
183
+ [Referral_Operations.CANCEL]: { purpose: 'A row action that withdraws a referral which has not converted, in both bundles, non-addressable.', whenToUse: 'A code was shared by mistake, or should no longer be honoured.' },
150
184
  },
151
185
  }));
152
186
  //# sourceMappingURL=referrals.resource.specification.js.map
@@ -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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E,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
+ {"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,2BAA2B,EAC3B,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,oDAAoD,IAAI,gBAAgB,G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AS,EAAE,qEAAqE,EAAE;QAC/M,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2DAA2D,EAAE,SAAS,EAAE,2CAA2C,EAAE;QAC3I,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,8EAA8E,EAAE,SAAS,EAAE,4EAA4E,EAAE;QACjN,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,mGAAmG,EAAE,SAAS,EAAE,gEAAgE,EAAE;KAC5N;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 ErrorCustomMessageReference,\n ReferralSchema,\n ReferralStatus,\n Referral_Operations,\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 Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst referralsMainUI = referralsMainSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\nconst referralsAdminUI = referralsAdminSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst referralsBase = resourceSpecification<Custom, 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: 'Issued PENDING by an organization billing account (`ISSUE`), with the rewards copied from the application\\'s `billing.referrals` policy. Redeemed by another, new billing account (`REDEEM_REFERRAL`) → ACCEPTED. The referred account\\'s first paid invoice → CONVERTED, and each side\\'s reward is granted once under a durable settlement claim. A code redeemed after `expiresAt` is refused and marked EXPIRED; the referrer can CANCEL a PENDING or ACCEPTED referral.',\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: 'The code is issued and has not been redeemed.' },\n [ReferralStatus.ACCEPTED]: { meaning: 'A new billing account redeemed the code and has not yet paid an invoice.' },\n [ReferralStatus.CONVERTED]: { meaning: 'The referred account paid its first invoice; both sides\\' rewards are granted.' },\n [ReferralStatus.EXPIRED]: { meaning: 'Someone tried to redeem the code after `expiresAt`; it can no longer be redeemed.' },\n [ReferralStatus.CANCELLED]: { meaning: 'The referrer withdrew the referral before it converted.' },\n },\n }),\n referrerReward: schemaShape.referrerReward.objectSpec({ meaning: 'What the referrer receives on conversion: a `credit` top-up of a credit pool, a `discount` coupon on its active subscription, or a `feature` for `durationDays`. Copied from the application policy when the code was issued, so a later policy change never re-prices it.' }),\n referredReward: schemaShape.referredReward.objectSpec({ meaning: 'What the referred account receives: the same three kinds, delivered on conversion, or a `trial_extension` that lengthens the trial of checkouts it opens while the referral is ACCEPTED.' }),\n referrerRewardApplied: schemaShape.referrerRewardApplied.booleanSpec({ meaning: 'Whether the referrer\\'s reward was delivered. A discount for an account with no active subscription stays undelivered until the account pays an invoice on one.' }),\n referredRewardApplied: schemaShape.referredRewardApplied.booleanSpec({ meaning: 'Whether the referred account\\'s reward was delivered.' }),\n acceptedAt: schemaShape.acceptedAt.dateSpec({ meaning: 'When the referred account redeemed the code.', temporalRole: 'occurred' }),\n convertedAt: schemaShape.convertedAt.dateSpec({ meaning: 'When the referred account paid its first invoice. A feature reward\\'s `durationDays` counts from here.', temporalRole: 'occurred' }),\n expiresAt: schemaShape.expiresAt.dateSpec({ meaning: 'The last moment the code can be redeemed: issue time plus the policy\\'s `codeValidityDays`.', 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.' },\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.' },\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 [Referral_Operations.ISSUE]: {\n operationId: Referral_Operations.ISSUE,\n purpose: 'Issue a single-use referral code for the organization\\'s billing account, to share with one prospective customer.',\n outcome: 'A PENDING referral with a new `referralCode`, the rewards the application\\'s referral policy promises today, and an `expiresAt` from its `codeValidityDays`. The request carries nothing: the referrer is the routed organization and the rewards are server policy.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The referral was issued; share its `referralCode`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an owner of the organization.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The application has not turned its referral program on (`billing.referrals.enabled`).', customMessageReference: ErrorCustomMessageReference.BILLING_REFERRAL_PROGRAM_DISABLED },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The organization has no billing account yet, so there is nothing to credit its referrals to.', customMessageReference: ErrorCustomMessageReference.BILLING_ACCOUNT_NOT_FOUND },\n ],\n idempotent: false,\n },\n [Referral_Operations.CANCEL]: {\n operationId: Referral_Operations.CANCEL,\n purpose: 'Withdraw a referral that has not converted, so its code can no longer be redeemed or rewarded.',\n outcome: 'The referral is CANCELLED. A converted referral stays as it is: its rewards may already be delivered.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The referral was withdrawn.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an owner of the organization that issued the referral.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No referral with that id belongs to the organization.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The referral has converted, expired or been cancelled already.', customMessageReference: ErrorCustomMessageReference.BILLING_REFERRAL_NOT_CANCELLABLE },\n ],\n idempotent: false,\n },\n },\n businessConstraints: [\n 'The program — whether codes can be issued, and what each side receives — is the application\\'s `billing.referrals` configuration. This row is one code\\'s state and the rewards it promised, never the program editor.',\n 'A code is single-use: one referral row links one referrer to one referred account.',\n 'Rewards are server policy. No request can set or change them.',\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` uses `referralCode` as the page title and card title.' },\n layout: {\n purpose: 'No sections: a referral is one code, its status, the two sides and what each earned. It is an immutable ledger row, so there is no edit form.',\n headerPurpose: 'The READ identity line: the `referralCode` as the title and the `status` badge beside it. Neither repeats in the body.',\n displayPurpose: 'Settings rows: the two sides\\' scope types, the expiry / acceptance / conversion dates and each side\\'s reward and whether it was applied. Every optional row hides when empty. Main bundle has no addressable `views`; merged admin adds LIST+READ (non-addressable).',\n summaryPurpose: 'A card: the code and the status badge, then the two scope types and the two dates — those four keep their labels, because a bare \"Organization\" beside a bare \"User\" does not say which side referred and a bare date does not say what happened on it.',\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 [Referral_Operations.ISSUE]: { purpose: 'The list\\'s action for issuing a new code, in both bundles, non-addressable.', whenToUse: 'An organization owner wants a code to share with one prospective customer.' },\n [Referral_Operations.CANCEL]: { purpose: 'A row action that withdraws a referral which has not converted, in both bundles, non-addressable.', whenToUse: 'A code was shared by mistake, or should no longer be honoured.' },\n },\n }),\n);\n"]}
@@ -17,14 +17,27 @@ export declare const organizationSubscriptionsResourceSpecification: import("../
17
17
  cancelAtPeriodEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>;
18
18
  cancelledAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodDate>>;
19
19
  cancellationReason: import("zod").ZodOptional<import("zod").ZodString>;
20
- discount: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodObject<{
20
+ discounts: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
21
21
  providerCouponId: import("zod").ZodOptional<import("zod").ZodString>;
22
22
  percentOff: import("zod").ZodOptional<import("zod").ZodNumber>;
23
23
  amountOff: import("zod").ZodOptional<import("zod").ZodNumber>;
24
24
  currency: import("zod").ZodOptional<import("zod").ZodString>;
25
- duration: import("zod").ZodOptional<import("zod").ZodString>;
25
+ duration: import("zod").ZodOptional<import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").PromotionDuration>>;
26
26
  durationInMonths: import("zod").ZodOptional<import("zod").ZodNumber>;
27
27
  end: import("zod").ZodOptional<import("zod").ZodDate>;
28
+ }, import("zod/v4/core").$strip>>>>;
29
+ pendingPlanChange: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodObject<{
30
+ productId: import("zod").ZodString;
31
+ priceId: import("zod").ZodString;
32
+ effectiveAt: import("zod").ZodDate;
33
+ items: import("zod").ZodArray<import("zod").ZodObject<{
34
+ _id: import("zod").ZodString;
35
+ productId: import("zod").ZodString;
36
+ priceId: import("zod").ZodString;
37
+ quantity: import("zod").ZodNumber;
38
+ providerPriceId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
39
+ }, import("zod/v4/core").$strip>>;
40
+ providerScheduleId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
28
41
  }, import("zod/v4/core").$strip>>>;
29
42
  providerSubscriptionId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
30
43
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
@@ -49,14 +62,27 @@ export declare const userSubscriptionsResourceSpecification: import("../../../_c
49
62
  cancelAtPeriodEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>;
50
63
  cancelledAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodDate>>;
51
64
  cancellationReason: import("zod").ZodOptional<import("zod").ZodString>;
52
- discount: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodObject<{
65
+ discounts: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
53
66
  providerCouponId: import("zod").ZodOptional<import("zod").ZodString>;
54
67
  percentOff: import("zod").ZodOptional<import("zod").ZodNumber>;
55
68
  amountOff: import("zod").ZodOptional<import("zod").ZodNumber>;
56
69
  currency: import("zod").ZodOptional<import("zod").ZodString>;
57
- duration: import("zod").ZodOptional<import("zod").ZodString>;
70
+ duration: import("zod").ZodOptional<import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").PromotionDuration>>;
58
71
  durationInMonths: import("zod").ZodOptional<import("zod").ZodNumber>;
59
72
  end: import("zod").ZodOptional<import("zod").ZodDate>;
73
+ }, import("zod/v4/core").$strip>>>>;
74
+ pendingPlanChange: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodObject<{
75
+ productId: import("zod").ZodString;
76
+ priceId: import("zod").ZodString;
77
+ effectiveAt: import("zod").ZodDate;
78
+ items: import("zod").ZodArray<import("zod").ZodObject<{
79
+ _id: import("zod").ZodString;
80
+ productId: import("zod").ZodString;
81
+ priceId: import("zod").ZodString;
82
+ quantity: import("zod").ZodNumber;
83
+ providerPriceId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
84
+ }, import("zod/v4/core").$strip>>;
85
+ providerScheduleId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
60
86
  }, import("zod/v4/core").$strip>>>;
61
87
  providerSubscriptionId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
62
88
  metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
@@ -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;AA+c/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,EAGnB,MAAM,uBAAuB,CAAC;AA2gB/B,eAAO,MAAM,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAG1D,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAmF,CAAC"}