@wildo-ai/saas-specifications 1.1.9 → 1.1.11
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.
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts +5 -4
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js +5 -4
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/index.js +1 -1
- package/dist/esm/_core/application-maturity/application-maturity.schemas.js +1 -1
- package/dist/esm/_core/application-maturity/application-maturity.schemas.js.map +1 -1
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts +11 -0
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts.map +1 -1
- package/dist/esm/_core/application-specification-family-identity.schemas.js +11 -0
- package/dist/esm/_core/application-specification-family-identity.schemas.js.map +1 -1
- package/dist/esm/_core/brand/brand-name-choice.d.ts +72 -10
- package/dist/esm/_core/brand/brand-name-choice.d.ts.map +1 -1
- package/dist/esm/_core/brand/brand-name-choice.js +144 -24
- package/dist/esm/_core/brand/brand-name-choice.js.map +1 -1
- package/dist/esm/_core/brand/brand-name-screening-generation.schemas.d.ts +41 -1
- package/dist/esm/_core/brand/brand-name-screening-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/brand/brand-name-screening-generation.schemas.js +19 -3
- package/dist/esm/_core/brand/brand-name-screening-generation.schemas.js.map +1 -1
- package/dist/esm/_core/brand/brand-name-screening-validation.d.ts +7 -1
- package/dist/esm/_core/brand/brand-name-screening-validation.d.ts.map +1 -1
- package/dist/esm/_core/brand/brand-name-screening-validation.js +24 -3
- package/dist/esm/_core/brand/brand-name-screening-validation.js.map +1 -1
- package/dist/esm/_core/brand/brand-name-screening-view.d.ts +61 -9
- package/dist/esm/_core/brand/brand-name-screening-view.d.ts.map +1 -1
- package/dist/esm/_core/brand/brand-name-screening-view.js +42 -1
- package/dist/esm/_core/brand/brand-name-screening-view.js.map +1 -1
- package/dist/esm/_core/brand/brand-name-screening.schemas.d.ts +130 -2
- package/dist/esm/_core/brand/brand-name-screening.schemas.d.ts.map +1 -1
- package/dist/esm/_core/brand/brand-name-screening.schemas.js +165 -3
- package/dist/esm/_core/brand/brand-name-screening.schemas.js.map +1 -1
- package/dist/esm/_core/brand/brand-visual-tone.schemas.d.ts +25 -7
- package/dist/esm/_core/brand/brand-visual-tone.schemas.d.ts.map +1 -1
- package/dist/esm/_core/brand/brand-visual-tone.schemas.js +26 -8
- package/dist/esm/_core/brand/brand-visual-tone.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts +76 -0
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +7 -2
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +21 -3
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +411 -13
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +281 -8
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.d.ts +4 -0
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js +3 -0
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts +6 -0
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.js +20 -0
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.js.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.d.ts +1 -0
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-model-lite/pricing-plan.schemas.d.ts +1 -0
- package/dist/esm/_core/business-model-lite/pricing-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-model-lite/pricing-plan.schemas.js +7 -0
- package/dist/esm/_core/business-model-lite/pricing-plan.schemas.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts +4 -3
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js +4 -3
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/ai-document-facts.schemas.d.ts +265 -0
- package/dist/esm/_core/compliance-documents/ai-document-facts.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/ai-document-facts.schemas.js +371 -0
- package/dist/esm/_core/compliance-documents/ai-document-facts.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts +55 -5
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +66 -2
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.d.ts +42 -2
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js +174 -1
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +4 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js +10 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts +102 -10
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js +128 -25
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts +28 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.js +36 -1
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/required-document-set.schemas.d.ts +15 -0
- package/dist/esm/_core/compliance-documents/required-document-set.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/required-document-set.schemas.js +15 -0
- package/dist/esm/_core/compliance-documents/required-document-set.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts +21 -10
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js +130 -14
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js.map +1 -1
- package/dist/esm/_core/data-seed-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/data-seed-specification.schemas.js +5 -1
- package/dist/esm/_core/data-seed-specification.schemas.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-generation.schemas.d.ts +32 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-generation.schemas.js +41 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-generation.schemas.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.d.ts +33 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.d.ts.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.js +134 -9
- package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.d.ts +117 -0
- package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.d.ts.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.js +118 -0
- package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +1 -0
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +22 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan-generation.schemas.d.ts +17 -1
- package/dist/esm/_core/experience-plan/experience-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan-generation.schemas.js +21 -5
- package/dist/esm/_core/experience-plan/experience-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan-validation.d.ts +7 -1
- package/dist/esm/_core/experience-plan/experience-plan-validation.d.ts.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan-validation.js +39 -1
- package/dist/esm/_core/experience-plan/experience-plan-validation.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.family-aspects.js +31 -5
- package/dist/esm/_core/experience-plan/experience-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts +81 -9
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js +88 -7
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js.map +1 -1
- package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.d.ts +13 -6
- package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.d.ts.map +1 -1
- package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.js +13 -6
- package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.js.map +1 -1
- package/dist/esm/_core/family-aspects.registry.d.ts.map +1 -1
- package/dist/esm/_core/family-aspects.registry.js +2 -0
- package/dist/esm/_core/family-aspects.registry.js.map +1 -1
- package/dist/esm/_core/family-aspects.schemas.d.ts +24 -0
- package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -1
- package/dist/esm/_core/family-aspects.schemas.js +20 -0
- package/dist/esm/_core/family-aspects.schemas.js.map +1 -1
- package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +6 -6
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js +2 -2
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js.map +1 -1
- package/dist/esm/_core/index.d.ts +6 -0
- package/dist/esm/_core/index.d.ts.map +1 -1
- package/dist/esm/_core/index.js +6 -0
- package/dist/esm/_core/index.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +1 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +2 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +26 -2
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js +21 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-references.schemas.d.ts +7 -0
- package/dist/esm/_core/market/market-references.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-references.schemas.js +13 -1
- package/dist/esm/_core/market/market-references.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +18 -12
- package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-snapshot-generation.schemas.js +46 -17
- package/dist/esm/_core/market/market-snapshot-generation.schemas.js.map +1 -1
- package/dist/esm/_core/market/market.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/market/market.family-aspects.js +4 -1
- package/dist/esm/_core/market/market.family-aspects.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.d.ts +15 -3
- package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.js +6 -3
- package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan-validation.d.ts +12 -1
- package/dist/esm/_core/placement-plan/placement-plan-validation.d.ts.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan-validation.js +56 -3
- package/dist/esm/_core/placement-plan/placement-plan-validation.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js +9 -0
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts +83 -0
- package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.js +102 -2
- package/dist/esm/_core/placement-plan/placement-plan.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts +3 -2
- package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts.map +1 -1
- package/dist/esm/_core/requirements/functional-requirement.schemas.js +8 -2
- package/dist/esm/_core/requirements/functional-requirement.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/non-functional-requirement.schemas.d.ts +1 -0
- package/dist/esm/_core/requirements/non-functional-requirement.schemas.d.ts.map +1 -1
- package/dist/esm/_core/requirements/non-functional-requirement.schemas.js +2 -0
- package/dist/esm/_core/requirements/non-functional-requirement.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/requirements-pain-coverage.d.ts +41 -0
- package/dist/esm/_core/requirements/requirements-pain-coverage.d.ts.map +1 -0
- package/dist/esm/_core/requirements/requirements-pain-coverage.js +63 -0
- package/dist/esm/_core/requirements/requirements-pain-coverage.js.map +1 -0
- package/dist/esm/_core/requirements/requirements-references.schemas.d.ts +1 -1
- package/dist/esm/_core/requirements/requirements-references.schemas.js +1 -1
- package/dist/esm/_core/requirements/requirements-references.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.d.ts +16 -0
- package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.js +12 -1
- package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot-validation.d.ts +13 -2
- package/dist/esm/_core/requirements/requirements-snapshot-validation.d.ts.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot-validation.js +32 -1
- package/dist/esm/_core/requirements/requirements-snapshot-validation.js.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts +65 -1
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.js +53 -1
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/requirements.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/requirements/requirements.family-aspects.js +2 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.js.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.d.ts +56 -15
- package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.js +73 -13
- package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
- package/dist/esm/_core/roadmap/roadmap-phase.schemas.d.ts +1 -16
- package/dist/esm/_core/roadmap/roadmap-phase.schemas.d.ts.map +1 -1
- package/dist/esm/_core/roadmap/roadmap-phase.schemas.js +3 -17
- package/dist/esm/_core/roadmap/roadmap-phase.schemas.js.map +1 -1
- package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.d.ts +2 -1
- package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.js +2 -1
- package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.js.map +1 -1
- package/dist/esm/_core/roadmap/roadmap-snapshot.schemas.d.ts +1 -1
- package/dist/esm/_core/service-method/service-method-derivation.d.ts +155 -0
- package/dist/esm/_core/service-method/service-method-derivation.d.ts.map +1 -0
- package/dist/esm/_core/service-method/service-method-derivation.js +410 -0
- package/dist/esm/_core/service-method/service-method-derivation.js.map +1 -0
- package/dist/esm/_core/service-method/service-method-generation.schemas.d.ts +86 -0
- package/dist/esm/_core/service-method/service-method-generation.schemas.d.ts.map +1 -0
- package/dist/esm/_core/service-method/service-method-generation.schemas.js +28 -0
- package/dist/esm/_core/service-method/service-method-generation.schemas.js.map +1 -0
- package/dist/esm/_core/service-method/service-method-validation.d.ts +35 -0
- package/dist/esm/_core/service-method/service-method-validation.d.ts.map +1 -0
- package/dist/esm/_core/service-method/service-method-validation.js +75 -0
- package/dist/esm/_core/service-method/service-method-validation.js.map +1 -0
- package/dist/esm/_core/service-method/service-method.family-aspects.d.ts +3 -0
- package/dist/esm/_core/service-method/service-method.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/service-method/service-method.family-aspects.js +59 -0
- package/dist/esm/_core/service-method/service-method.family-aspects.js.map +1 -0
- package/dist/esm/_core/service-method/service-method.schemas.d.ts +385 -0
- package/dist/esm/_core/service-method/service-method.schemas.d.ts.map +1 -0
- package/dist/esm/_core/service-method/service-method.schemas.js +372 -0
- package/dist/esm/_core/service-method/service-method.schemas.js.map +1 -0
- package/dist/esm/_core/website-plan/website-plan-generation.schemas.d.ts +37 -5
- package/dist/esm/_core/website-plan/website-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/website-plan/website-plan-generation.schemas.js +34 -6
- package/dist/esm/_core/website-plan/website-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/website-plan/website-plan-validation.d.ts +29 -3
- package/dist/esm/_core/website-plan/website-plan-validation.d.ts.map +1 -1
- package/dist/esm/_core/website-plan/website-plan-validation.js +97 -5
- package/dist/esm/_core/website-plan/website-plan-validation.js.map +1 -1
- package/dist/esm/_core/website-plan/website-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/website-plan/website-plan.family-aspects.js +6 -1
- package/dist/esm/_core/website-plan/website-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/website-plan/website-plan.schemas.d.ts +521 -15
- package/dist/esm/_core/website-plan/website-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/website-plan/website-plan.schemas.js +703 -23
- package/dist/esm/_core/website-plan/website-plan.schemas.js.map +1 -1
- package/dist/esm/application-creation/accepted-change-attribution.application-creation.schemas.d.ts +78 -0
- package/dist/esm/application-creation/accepted-change-attribution.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/accepted-change-attribution.application-creation.schemas.js +92 -0
- package/dist/esm/application-creation/accepted-change-attribution.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts +26 -0
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js +14 -0
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +21 -5
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +22 -4
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts +119 -10
- package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-line.application-creation.schemas.js +140 -7
- package/dist/esm/application-creation/application-line.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/domain-plan-evaluation-identities.application-creation.definitions.d.ts +7 -1
- package/dist/esm/application-creation/domain-plan-evaluation-identities.application-creation.definitions.d.ts.map +1 -1
- package/dist/esm/application-creation/domain-plan-evaluation-identities.application-creation.definitions.js +7 -1
- package/dist/esm/application-creation/domain-plan-evaluation-identities.application-creation.definitions.js.map +1 -1
- package/dist/esm/application-creation/journey.application-creation.schemas.d.ts +4 -2
- package/dist/esm/application-creation/journey.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/journey.application-creation.schemas.js +4 -2
- package/dist/esm/application-creation/journey.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +103 -15
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +151 -21
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts +1 -0
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js +1 -0
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +7 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +7 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/application-risk-signals.derivations.d.ts +36 -2
- package/dist/esm/assurance/application-risk-signals.derivations.d.ts.map +1 -1
- package/dist/esm/assurance/application-risk-signals.derivations.js +52 -4
- package/dist/esm/assurance/application-risk-signals.derivations.js.map +1 -1
- package/dist/esm/assurance/assurance-assessment-twins.d.ts +38 -0
- package/dist/esm/assurance/assurance-assessment-twins.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-assessment-twins.js +36 -0
- package/dist/esm/assurance/assurance-assessment-twins.js.map +1 -0
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +608 -9
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +2962 -1078
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +15 -0
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.schemas.js +1 -0
- package/dist/esm/assurance/assurance-authority-basis.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.d.ts +2 -0
- package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.js +138 -19
- package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts +65 -0
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.js +13 -0
- package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-judgement.schemas.d.ts +81 -6
- package/dist/esm/assurance/assurance-evidence-judgement.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-judgement.schemas.js +68 -7
- package/dist/esm/assurance/assurance-evidence-judgement.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +1631 -70
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-host-implementation-artifacts.d.ts +77 -0
- package/dist/esm/assurance/assurance-host-implementation-artifacts.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-host-implementation-artifacts.js +51 -0
- package/dist/esm/assurance/assurance-host-implementation-artifacts.js.map +1 -0
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts +3 -2
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +327 -3
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-open-compliance-answer-cell.d.ts +12 -0
- package/dist/esm/assurance/assurance-open-compliance-answer-cell.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-open-compliance-answer-cell.js +19 -0
- package/dist/esm/assurance/assurance-open-compliance-answer-cell.js.map +1 -0
- package/dist/esm/assurance/assurance-open-compliance-coverage-pack.d.ts +403 -0
- package/dist/esm/assurance/assurance-open-compliance-coverage-pack.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-open-compliance-coverage-pack.js +825 -0
- package/dist/esm/assurance/assurance-open-compliance-coverage-pack.js.map +1 -0
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +83 -8
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.js +167 -20
- package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.d.ts +234 -35
- package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.js +255 -14
- package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts +2 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.js +259 -18
- package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-source-requirement-inventory.definitions.d.ts +17 -0
- package/dist/esm/assurance/assurance-source-requirement-inventory.definitions.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-source-requirement-inventory.definitions.js +216 -0
- package/dist/esm/assurance/assurance-source-requirement-inventory.definitions.js.map +1 -0
- package/dist/esm/assurance/assurance-sources.schemas.d.ts +110 -0
- package/dist/esm/assurance/assurance-sources.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-sources.schemas.js +111 -1
- package/dist/esm/assurance/assurance-sources.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +356 -5
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/governed-document-audience.derivations.d.ts +83 -0
- package/dist/esm/assurance/governed-document-audience.derivations.d.ts.map +1 -0
- package/dist/esm/assurance/governed-document-audience.derivations.js +97 -0
- package/dist/esm/assurance/governed-document-audience.derivations.js.map +1 -0
- package/dist/esm/assurance/governed-document-release.d.ts +15 -1
- package/dist/esm/assurance/governed-document-release.d.ts.map +1 -1
- package/dist/esm/assurance/governed-document-release.js +3 -1
- package/dist/esm/assurance/governed-document-release.js.map +1 -1
- package/dist/esm/assurance.exports.d.ts +4 -0
- package/dist/esm/assurance.exports.d.ts.map +1 -1
- package/dist/esm/assurance.exports.js +4 -0
- package/dist/esm/assurance.exports.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +9 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +33 -5
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +9 -12
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +60 -6
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +4 -4
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts +1 -0
- package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.js +2 -2
- package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts +12 -4
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +46 -10
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts +3 -2
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +15 -4
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +40 -11
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +44 -3
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts +7 -3
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js +40 -8
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts +14 -8
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +72 -19
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts +2 -2
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +6 -6
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts +1 -0
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +14 -13
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +2 -2
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-outbox.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-outbox.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +68 -12
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js +75 -19
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts +3 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js +11 -7
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts +2 -0
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +2 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts +4 -2
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +8 -7
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.js +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js +6 -6
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +2 -2
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts +4 -0
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +4 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts +9 -5
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js +16 -8
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/approval-seals.resource.specification.d.ts +73 -0
- package/dist/esm/engine/compliance/resources/approval-seals.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/compliance/resources/approval-seals.resource.specification.js +192 -0
- package/dist/esm/engine/compliance/resources/approval-seals.resource.specification.js.map +1 -0
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts +5 -3
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +19 -13
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts +11 -6
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js +14 -3
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/published-verification-keys.resource.specification.d.ts +37 -0
- package/dist/esm/engine/compliance/resources/published-verification-keys.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/compliance/resources/published-verification-keys.resource.specification.js +161 -0
- package/dist/esm/engine/compliance/resources/published-verification-keys.resource.specification.js.map +1 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js +1 -1
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +55 -11
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
- package/dist/esm/engine/errors/error-messages.specification.js +300 -5
- package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
- package/dist/esm/engine/features/core-limits.feature.specifications.d.ts +10 -4
- package/dist/esm/engine/features/core-limits.feature.specifications.d.ts.map +1 -1
- package/dist/esm/engine/features/core-limits.feature.specifications.js +100 -5
- package/dist/esm/engine/features/core-limits.feature.specifications.js.map +1 -1
- package/dist/esm/engine/features/custom-branding.feature.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/custom-branding.feature.specification.js +7 -3
- package/dist/esm/engine/features/custom-branding.feature.specification.js.map +1 -1
- package/dist/esm/engine/features/index.d.ts +4 -2
- package/dist/esm/engine/features/index.d.ts.map +1 -1
- package/dist/esm/engine/features/index.js +6 -4
- package/dist/esm/engine/features/index.js.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.js +2 -2
- package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/organization-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js +34 -15
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/files/resources/files.resource.specification.d.ts +4 -1
- package/dist/esm/engine/files/resources/files.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/files/resources/files.resource.specification.js +24 -3
- package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +31 -3
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +6 -6
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.d.ts +30 -0
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js +181 -0
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js +110 -0
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/agent-behavior-reports.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/agent-behavior-reports.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/agent-behavior-reports.resource.specification.js +286 -0
- package/dist/esm/engine/flows-actors/resources/agent-behavior-reports.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/agent-operation-records.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/agent-operation-records.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/agent-operation-records.resource.specification.js +147 -0
- package/dist/esm/engine/flows-actors/resources/agent-operation-records.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js +71 -26
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/application-agent-policies.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/application-agent-policies.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/application-agent-policies.resource.specification.js +92 -0
- package/dist/esm/engine/flows-actors/resources/application-agent-policies.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/chat-conversations.resource.specification.d.ts +46 -0
- package/dist/esm/engine/flows-actors/resources/chat-conversations.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/chat-conversations.resource.specification.js +196 -0
- package/dist/esm/engine/flows-actors/resources/chat-conversations.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +73 -31
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +118 -18
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +9 -4
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/human-decision-notice-stays.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/human-decision-notice-stays.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/human-decision-notice-stays.resource.specification.js +184 -0
- package/dist/esm/engine/flows-actors/resources/human-decision-notice-stays.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js +17 -5
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js +47 -7
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/model-usage-ceiling-state.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/model-usage-ceiling-state.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-usage-ceiling-state.resource.specification.js +118 -0
- package/dist/esm/engine/flows-actors/resources/model-usage-ceiling-state.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/operation-approval-requests.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/operation-approval-requests.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/operation-approval-requests.resource.specification.js +230 -0
- package/dist/esm/engine/flows-actors/resources/operation-approval-requests.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/organization-agent-policies.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/organization-agent-policies.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/organization-agent-policies.resource.specification.js +151 -0
- package/dist/esm/engine/flows-actors/resources/organization-agent-policies.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.d.ts +23 -0
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js +124 -0
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/person-token-ceiling-state.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/person-token-ceiling-state.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/person-token-ceiling-state.resource.specification.js +114 -0
- package/dist/esm/engine/flows-actors/resources/person-token-ceiling-state.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js +45 -3
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/actions/action-bar.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/actions/action-bar.frontend-component.specification.js +6 -0
- package/dist/esm/engine/frontend-components/actions/action-bar.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/chat/ai-conversation-thread.frontend-component.specification.d.ts +4 -0
- package/dist/esm/engine/frontend-components/ai-elements/chat/ai-conversation-thread.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/ai-elements/chat/ai-conversation-thread.frontend-component.specification.js +78 -0
- package/dist/esm/engine/frontend-components/ai-elements/chat/ai-conversation-thread.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/ai-elements/chat/ai-prompt-input.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/chat/ai-prompt-input.frontend-component.specification.js +4 -4
- package/dist/esm/engine/frontend-components/ai-elements/chat/ai-prompt-input.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js +3 -3
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/graph/ai-canvas.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/graph/ai-canvas.frontend-component.specification.js +4 -4
- package/dist/esm/engine/frontend-components/ai-elements/graph/ai-canvas.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/graph/ai-node.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/graph/ai-node.frontend-component.specification.js +3 -3
- package/dist/esm/engine/frontend-components/ai-elements/graph/ai-node.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-evaluation-export-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-evaluation-export-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-evaluation-export-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-evaluation-export-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-autonomous-agents-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-autonomous-agents-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-autonomous-agents-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-autonomous-agents-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js +3 -2
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js +3 -3
- package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-model-cost-breakdown-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-model-cost-breakdown-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-model-cost-breakdown-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-model-cost-breakdown-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-representative-activity-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-representative-activity-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-representative-activity-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-representative-activity-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-settings-hub.frontend-component.specification.js +3 -3
- package/dist/esm/engine/frontend-components/app/app-layout-settings-hub.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/public-layout-legal-notice.frontend-component.specification.d.ts +4 -0
- package/dist/esm/engine/frontend-components/app/public-layout-legal-notice.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/public-layout-legal-notice.frontend-component.specification.js +22 -0
- package/dist/esm/engine/frontend-components/app/public-layout-legal-notice.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js +2 -1
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js +3 -2
- package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/auth/public-layout-chat-identity-link.frontend-component.specification.d.ts +4 -0
- package/dist/esm/engine/frontend-components/auth/public-layout-chat-identity-link.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/auth/public-layout-chat-identity-link.frontend-component.specification.js +22 -0
- package/dist/esm/engine/frontend-components/auth/public-layout-chat-identity-link.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/auth/public-layout-user-auth.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/auth/public-layout-user-auth.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/auth/public-layout-user-invitation.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/auth/public-layout-user-invitation.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/data-display/badge.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/data-display/badge.frontend-component.specification.js +7 -0
- package/dist/esm/engine/frontend-components/data-display/badge.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/feedback/features/feature-limit-indicator.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/feedback/features/feature-limit-indicator.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js +6 -6
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-execution-usage.frontend-component.specification.d.ts +4 -0
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-execution-usage.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-execution-usage.frontend-component.specification.js +24 -0
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-execution-usage.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-flow-node.frontend-component.specification.js +6 -6
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-flow-node.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-graph-viewer.frontend-component.specification.d.ts +4 -0
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-graph-viewer.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-graph-viewer.frontend-component.specification.js +128 -0
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-graph-viewer.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-system-catalog.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-system-catalog.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/controls/boolean/toggle.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/controls/boolean/toggle.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/date-range-picker.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/date-range-picker.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/datepicker.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/datepicker.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/datetime-picker.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/datetime-picker.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/datetime-range-picker.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/datetime-range-picker.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/time-range-picker.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/controls/date-time/time-range-picker.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/controls/enum/toggle-group.frontend-component.specification.js +4 -4
- package/dist/esm/engine/frontend-components/form/controls/enum/toggle-group.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/controls/string/chips-input.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/form/controls/string/chips-input.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/form/controls/string/chips-input.frontend-component.specification.js +139 -0
- package/dist/esm/engine/frontend-components/form/controls/string/chips-input.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/high-level-views/high-level-views-flows-actors.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/high-level-views/high-level-views-flows-actors.frontend-component.specification.js +5 -1
- package/dist/esm/engine/frontend-components/high-level-views/high-level-views-flows-actors.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/index.d.ts +7 -0
- package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/index.js +29 -0
- package/dist/esm/engine/frontend-components/index.js.map +1 -1
- package/dist/esm/engine/frontend-components/navigation/app-level/sidebar.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/navigation/app-level/sidebar.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/navigation/app-level/user-dropdown.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/navigation/app-level/user-dropdown.frontend-component.specification.js +3 -1
- package/dist/esm/engine/frontend-components/navigation/app-level/user-dropdown.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/navigation/app-level/utility-panel.frontend-component.specification.js +4 -4
- package/dist/esm/engine/frontend-components/navigation/app-level/utility-panel.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-header.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/resources/resource-layout-header.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-list.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/resources/resource-layout-list.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-record-sharing.frontend-component.specification.d.ts +4 -0
- package/dist/esm/engine/frontend-components/resources/resource-layout-record-sharing.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/resources/resource-layout-record-sharing.frontend-component.specification.js +27 -0
- package/dist/esm/engine/frontend-components/resources/resource-layout-record-sharing.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/typography/text.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/typography/text.frontend-component.specification.js +3 -1
- package/dist/esm/engine/frontend-components/typography/text.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/application-data-keys.resource.specification.d.ts +24 -0
- package/dist/esm/engine/infrastructure/resources/application-data-keys.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/application-data-keys.resource.specification.js +136 -0
- package/dist/esm/engine/infrastructure/resources/application-data-keys.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +6 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/document-sequence-counters.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/document-sequence-counters.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/document-sequence-counters.resource.specification.js +110 -0
- package/dist/esm/engine/infrastructure/resources/document-sequence-counters.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js +10 -4
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js +20 -2
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js +6 -6
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js +5 -5
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-requested-keys.resource.specification.d.ts +10 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-requested-keys.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-requested-keys.resource.specification.js +118 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-requested-keys.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js +54 -8
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js +33 -5
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts +21 -4
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts +3 -3
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/post-commit-effect-outbox.resource.specification.d.ts +10 -0
- package/dist/esm/engine/infrastructure/resources/post-commit-effect-outbox.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/post-commit-effect-outbox.resource.specification.js +159 -0
- package/dist/esm/engine/infrastructure/resources/post-commit-effect-outbox.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.d.ts +5 -5
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js +38 -10
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/transactional-commit-receipts.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/transactional-commit-receipts.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/transactional-commit-receipts.resource.specification.js +100 -0
- package/dist/esm/engine/infrastructure/resources/transactional-commit-receipts.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/chat-identity-links.resource.specification.d.ts +37 -0
- package/dist/esm/engine/notifications/resources/chat-identity-links.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/chat-identity-links.resource.specification.js +181 -0
- package/dist/esm/engine/notifications/resources/chat-identity-links.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts +3 -3
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js +7 -7
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts +31 -1
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js +33 -7
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts +16 -14
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +56 -53
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts +6 -2
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +22 -4
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts +2 -2
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts +2 -0
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +3 -3
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts +1 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js +43 -2
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/index.d.ts +0 -1
- package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/index.js +1 -3
- package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/organization.system-emails.specification.d.ts +1 -1
- package/dist/esm/engine/notifications/system-emails/organization.system-emails.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/organization.system-emails.specification.js +25 -15
- package/dist/esm/engine/notifications/system-emails/organization.system-emails.specification.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/security.system-emails.specification.js +13 -13
- package/dist/esm/engine/notifications/system-emails/security.system-emails.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/index.d.ts +1 -2
- package/dist/esm/engine/organizations/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/index.js +1 -2
- package/dist/esm/engine/organizations/resources/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +5 -4
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +114 -51
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts +11 -10
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +10 -7
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/{service-provider-relationships.resource.specification.d.ts → organization-relationships.resource.specification.d.ts} +73 -56
- package/dist/esm/engine/organizations/resources/organization-relationships.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/organizations/resources/organization-relationships.resource.specification.js +643 -0
- package/dist/esm/engine/organizations/resources/organization-relationships.resource.specification.js.map +1 -0
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts +1 -1
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +6 -4
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +2 -2
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts +4 -4
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +93 -43
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/professional-qualifications.resource.specification.d.ts +39 -0
- package/dist/esm/engine/organizations/resources/professional-qualifications.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/organizations/resources/professional-qualifications.resource.specification.js +140 -0
- package/dist/esm/engine/organizations/resources/professional-qualifications.resource.specification.js.map +1 -0
- package/dist/esm/engine/providers/github.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/github.provider.specification.js +8 -5
- package/dist/esm/engine/providers/github.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/google-drive.provider.specification.d.ts +6 -0
- package/dist/esm/engine/providers/google-drive.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/google-drive.provider.specification.js +39 -0
- package/dist/esm/engine/providers/google-drive.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/index.d.ts +2 -0
- package/dist/esm/engine/providers/index.d.ts.map +1 -1
- package/dist/esm/engine/providers/index.js +5 -1
- package/dist/esm/engine/providers/index.js.map +1 -1
- package/dist/esm/engine/providers/microsoft-onedrive.provider.specification.d.ts +6 -0
- package/dist/esm/engine/providers/microsoft-onedrive.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/microsoft-onedrive.provider.specification.js +39 -0
- package/dist/esm/engine/providers/microsoft-onedrive.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/mistral.provider.specification.js +2 -2
- package/dist/esm/engine/providers/mistral.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/resend.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/resend.provider.specification.js +8 -6
- package/dist/esm/engine/providers/resend.provider.specification.js.map +1 -1
- package/dist/esm/engine/roles/app-audit-evidence-reader.role.specification.js +1 -1
- package/dist/esm/engine/roles/app-audit-evidence-reader.role.specification.js.map +1 -1
- package/dist/esm/engine/roles/index.d.ts +2 -2
- package/dist/esm/engine/roles/index.d.ts.map +1 -1
- package/dist/esm/engine/roles/index.js +5 -5
- package/dist/esm/engine/roles/index.js.map +1 -1
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts +1 -1
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts.map +1 -1
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js +24 -24
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js.map +1 -1
- package/dist/esm/engine/roles/org-representative.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/org-representative.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-representative.role.specification.js +22 -0
- package/dist/esm/engine/roles/org-representative.role.specification.js.map +1 -0
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +7 -5
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts +3 -3
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +3 -3
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +3 -3
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js +13 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +2 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +4 -0
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +3 -3
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +4 -0
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +6 -2
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.js +33 -0
- package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.d.ts +2 -1
- package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js +10 -4
- package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +17 -15
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
- package/package.json +8 -8
- package/dist/esm/engine/notifications/system-emails/subscription.system-emails.specification.d.ts +0 -6
- package/dist/esm/engine/notifications/system-emails/subscription.system-emails.specification.d.ts.map +0 -1
- package/dist/esm/engine/notifications/system-emails/subscription.system-emails.specification.js +0 -146
- package/dist/esm/engine/notifications/system-emails/subscription.system-emails.specification.js.map +0 -1
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts +0 -38
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts.map +0 -1
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js +0 -152
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js.map +0 -1
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts.map +0 -1
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js +0 -417
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js.map +0 -1
- package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts +0 -2
- package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts.map +0 -1
- package/dist/esm/engine/roles/org-service-provider.role.specification.js +0 -22
- package/dist/esm/engine/roles/org-service-provider.role.specification.js.map +0 -1
|
@@ -67,13 +67,13 @@ const referralsBase = resourceSpecification(referralsFactory, ReferralSchema, ({
|
|
|
67
67
|
},
|
|
68
68
|
operations: {
|
|
69
69
|
[Op.READ]: {
|
|
70
|
-
purpose: '
|
|
70
|
+
purpose: 'Open one of the organization\'s referrals: an owner from Organization → Referrals, or partner and support tools in the back office.',
|
|
71
71
|
outcome: 'Full state + reward config snapshot.',
|
|
72
72
|
responseStatuses: [
|
|
73
73
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The referral record was found and its full state + reward-config snapshot is returned.' },
|
|
74
74
|
],
|
|
75
75
|
errorScenarios: [
|
|
76
|
-
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller
|
|
76
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an owner of the organization the referral belongs to.' },
|
|
77
77
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No referral exists for the supplied id in the caller’s billing scope.' },
|
|
78
78
|
],
|
|
79
79
|
idempotent: true,
|
|
@@ -172,13 +172,13 @@ export const referralsResourceSpecification = resourceSpecificationFromFrontendC
|
|
|
172
172
|
label: { purpose: 'Preset `getFrontendResourceLabel` uses `referralCode` as the page title and card title.' },
|
|
173
173
|
layout: {
|
|
174
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
|
|
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.
|
|
175
|
+
headerPurpose: 'The READ header: the `referralCode` on the title line and the `status` badge on the facts line under 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. Both bundles carry LIST and READ as non-addressable views; the admin bundle also keeps UPDATE headless.',
|
|
177
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.',
|
|
178
178
|
},
|
|
179
179
|
views: {
|
|
180
|
-
[Op.LIST]: { purpose: '
|
|
181
|
-
[Op.READ]: { purpose: '
|
|
180
|
+
[Op.LIST]: { purpose: 'The organization\'s referrals, in both bundles, non-addressable: Organization → Referrals shows it.', whenToUse: 'An organization owner reviews the codes it issued and what each earned.' },
|
|
181
|
+
[Op.READ]: { purpose: 'One referral, opened from that list, in both bundles, non-addressable (#2324).', whenToUse: 'An owner checks one code\'s state, its two sides and their rewards.' },
|
|
182
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
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.' },
|
|
184
184
|
},
|
|
@@ -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,2BAA2B,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EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,qGAAqG,EAAE,SAAS,EAAE,qEAAqE,EAAE;QAC/M,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2DAA2D,EAAE,SAAS,EAAE,2CAA2C,EAAE;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"]}
|
|
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,GACzE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,E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AE,gFAAgF,EAAE,SAAS,EAAE,qEAAqE,EAAE;QAC1L,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: 'Open one of the organization\\'s referrals: an owner from Organization → Referrals, or partner and support tools in the back office.',\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 is not an owner of the organization the referral belongs to.' },\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 header: the `referralCode` on the title line and the `status` badge on the facts line under 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. Both bundles carry LIST and READ as non-addressable views; the admin bundle also keeps UPDATE headless.',\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: 'The organization\\'s referrals, in both bundles, non-addressable: Organization → Referrals shows it.', whenToUse: 'An organization owner reviews the codes it issued and what each earned.' },\n [Op.READ]: { purpose: 'One referral, opened from that list, in both bundles, non-addressable (#2324).', whenToUse: 'An owner checks one code\\'s state, its two sides and their rewards.' },\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"]}
|
|
@@ -10,7 +10,7 @@ export declare const organizationSubscriptionsResourceSpecification: import("../
|
|
|
10
10
|
quantity: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>;
|
|
11
11
|
providerSubscriptionItemId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
12
12
|
}, import("zod/v4/core").$strip>>;
|
|
13
|
-
currentPeriodStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate
|
|
13
|
+
currentPeriodStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate>>>;
|
|
14
14
|
currentPeriodEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate>>>;
|
|
15
15
|
trialStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodDate>>;
|
|
16
16
|
trialEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodDate>>>;
|
|
@@ -55,7 +55,7 @@ export declare const userSubscriptionsResourceSpecification: import("../../../_c
|
|
|
55
55
|
quantity: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>;
|
|
56
56
|
providerSubscriptionItemId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
57
57
|
}, import("zod/v4/core").$strip>>;
|
|
58
|
-
currentPeriodStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate
|
|
58
|
+
currentPeriodStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate>>>;
|
|
59
59
|
currentPeriodEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDate>>>;
|
|
60
60
|
trialStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodDate>>;
|
|
61
61
|
trialEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodDate>>>;
|
|
@@ -66,7 +66,7 @@ function buildSubscriptionBase(resourceType, memberName) {
|
|
|
66
66
|
{ collectionSymbol: { packageName: '@wildo-ai/presets-components', exportName: 'billingMainPresets', symbolKind: CodeSymbolKind.UI_BEHAVIOR }, identifierField: 'collectionKey', identifierValue: resourceType },
|
|
67
67
|
{ collectionSymbol: { packageName: '@wildo-ai/presets-components', exportName: 'billingAdminPresets', symbolKind: CodeSymbolKind.UI_BEHAVIOR }, identifierField: 'collectionKey', identifierValue: resourceType },
|
|
68
68
|
],
|
|
69
|
-
notes: ['
|
|
69
|
+
notes: ['Two billing notices are sent from these operations (#2929): `subscription-started` (CREATE and UPDATE, when the subscription first gives access) and `subscription-ending` (UPDATE and CANCEL, when its end is decided). An organization subscription notifies the organization\'s billing contact (`ORGANIZATION_BILLING`), a personal one the person it belongs to (`USERS_CUSTOM` on `userId`). Each fires on a change of the row (`subscriptionStartedByWrite`, `subscriptionCancellationDecidedByWrite`), so a renewal sends nothing. Templates: `resources/<organizationSubscriptions|userSubscriptions>/<operation>.<target>_<notice>`.'],
|
|
70
70
|
},
|
|
71
71
|
fields: {
|
|
72
72
|
_id: schemaShape._id.stringSpec({ meaning: 'Mongo id for this subscription document.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/subscriptions.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,wCAAwC,EACxC,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6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AC7B,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { billingAdminPresets, billingMainPresets } 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 BillingSubscriptionBaseSchema,\n BillingSubscription_Operations,\n CoreResourceOperation as Op,\n CoreResourceType,\n ResourcePrimaryScope,\n SubscriptionStatus,\n billingSubscriptionsPolymorphicFactories,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport {\n BILLING_API_REFERENCE_PAGE_REQUEST,\n billingApiReferencePage,\n createBillingApiReferenceScopeExample,\n type BillingApiReferenceExampleScope,\n} from './billing-api-reference-examples';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype SubResourceType = CoreResourceType.ORGANIZATION_SUBSCRIPTIONS | CoreResourceType.USER_SUBSCRIPTIONS;\ntype SubResourceTypeMember = 'ORGANIZATION_SUBSCRIPTIONS' | 'USER_SUBSCRIPTIONS';\n\nconst subResourcePrimaryScopeByResourceType: Record<SubResourceType, BillingApiReferenceExampleScope> = {\n [CoreResourceType.ORGANIZATION_SUBSCRIPTIONS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.USER_SUBSCRIPTIONS]: ResourcePrimaryScope.USER_SELF,\n};\n\ntype Cfg = ReturnType<(typeof billingSubscriptionsPolymorphicFactories)[CoreResourceType.ORGANIZATION_SUBSCRIPTIONS]>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof BillingSubscriptionBaseSchema;\ntype SubFrontend = ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nfunction resolveSubUI(source: Partial<Record<string, unknown>>, resourceType: SubResourceType, sourceName: string): SubFrontend {\n const uiBehavior = source[resourceType] as SubFrontend | undefined;\n if (!uiBehavior) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return uiBehavior;\n}\n\nfunction buildSubscriptionBase(resourceType: SubResourceType, memberName: SubResourceTypeMember) {\n const exampleScope = createBillingApiReferenceScopeExample(\n subResourcePrimaryScopeByResourceType[resourceType],\n );\n const baseItem = {\n _id: 'subscription_item_base_01HX2EXAMPLE',\n productId: 'product_team_plan',\n priceId: 'price_team_monthly',\n quantity: 25,\n };\n const subscriptionExample = {\n _id: 'subscription_01HX2EXAMPLE',\n ...exampleScope.billingAccountIdentity,\n status: SubscriptionStatus.ACTIVE,\n items: [baseItem],\n currentPeriodStart: '2026-06-01T00:00:00.000Z',\n currentPeriodEnd: '2026-07-01T00:00:00.000Z',\n cancelAtPeriodEnd: false,\n metadata: { contract: 'annual-commitment' },\n createdAt: '2026-05-10T09:00:00.000Z',\n updatedAt: '2026-06-01T00:05:00.000Z',\n ...exampleScope.scopeIdentity,\n };\n const subscriptionSummaryExample = {\n _id: subscriptionExample._id,\n ...exampleScope.billingAccountIdentity,\n status: subscriptionExample.status,\n currentPeriodEnd: subscriptionExample.currentPeriodEnd,\n cancelAtPeriodEnd: subscriptionExample.cancelAtPeriodEnd,\n };\n\n return resourceSpecification<Custom, Core, Main>(\n billingSubscriptionsPolymorphicFactories[resourceType],\n BillingSubscriptionBaseSchema,\n ({ schemaShape }) => ({\n purpose:\n 'Subscription for a billing account: exposes the selected plan and add-ons, lifecycle status, billing-period bounds, trial state, and cancellation state.',\n businessRole: 'Entitlement driver for seats and renewals — the object billing emails and plan changes refer to.',\n lifecycleRole:\n 'Created after a successful checkout and updated after subscription changes or billing-provider events. A cancelled subscription is retained as billing history rather than cascade-deleted with its account, and subject erasure terminates active billing.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'BillingSubscriptionBaseSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'billingSubscriptionsPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName },\n operationVocabulary: {\n coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n customEnum: { packageName: '@wildo-ai/saas-models', exportName: 'BillingSubscription_Operations', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n frontendConfigurationSourceEntries: [\n { collectionSymbol: { packageName: '@wildo-ai/presets-components', exportName: 'billingMainPresets', symbolKind: CodeSymbolKind.UI_BEHAVIOR }, identifierField: 'collectionKey', identifierValue: resourceType },\n { collectionSymbol: { packageName: '@wildo-ai/presets-components', exportName: 'billingAdminPresets', symbolKind: CodeSymbolKind.UI_BEHAVIOR }, identifierField: 'collectionKey', identifierValue: resourceType },\n ],\n notes: ['Renewal and payment-failed emails may fan out from subscription state changes — confirm `userNotifications[]` on the factory when documenting communications.'],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Mongo id for this subscription document.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n billingAccountId: schemaShape.billingAccountId.stringSpec({ meaning: 'Polymorphic FK to the parent billing account (`organizationBillingAccountId` or `userBillingAccountId` on concrete schema).', importance: FieldSemanticImportance.PRIMARY }),\n status: schemaShape.status.enumSpec({\n meaning: 'Provider subscription lifecycle state mirrored for gating and UI badges.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'SubscriptionStatus', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [SubscriptionStatus.ACTIVE]: { meaning: 'Currently billable and entitled per provider.' },\n [SubscriptionStatus.TRIALING]: { meaning: 'In trial window if applicable.' },\n [SubscriptionStatus.PAST_DUE]: { meaning: 'Payment failed; access may be degraded per product policy.' },\n [SubscriptionStatus.UNPAID]: { meaning: 'Severe payment failure state from provider semantics.' },\n [SubscriptionStatus.CANCELLED]: { meaning: 'Terminated; may still be visible for history.' },\n [SubscriptionStatus.INCOMPLETE]: { meaning: 'Checkout or first payment not completed.' },\n [SubscriptionStatus.INCOMPLETE_EXPIRED]: { meaning: 'Incomplete checkout expired at provider.' },\n [SubscriptionStatus.PAUSED]: { meaning: 'Paused per provider rules (if used).' },\n },\n }),\n items: schemaShape.items.arraySpec({\n meaning: 'Line items (product + price + quantity) that make up the commercial subscription.',\n elementMeaning: 'One `SubscriptionItemSchema` with `productId`, `priceId`, `quantity`, and optional provider item id.',\n }),\n currentPeriodStart: schemaShape.currentPeriodStart.dateSpec({ meaning: 'Start of the current invoice period.', temporalRole: 'scheduled' }),\n currentPeriodEnd: schemaShape.currentPeriodEnd.dateSpec({ meaning: 'End of the current invoice period / next renewal anchor.', importance: FieldSemanticImportance.PRIMARY }),\n trialStart: schemaShape.trialStart.dateSpec({ meaning: 'When the trial began, as the billing provider reports it. Kept after the trial ends; absent on a subscription that never had a trial.', temporalRole: 'scheduled' }),\n trialEnd: schemaShape.trialEnd.dateSpec({ meaning: 'When the trial ends, or ended, as the billing provider reports it. Kept after the trial is over, so it describes the subscription\\'s trial, not whether it is trialing now: `status` says that.', temporalRole: 'deadline' }),\n cancelAtPeriodEnd: schemaShape.cancelAtPeriodEnd.booleanSpec({ meaning: 'User/org requested cancel at end of current period.' }),\n pendingPlanChange: schemaShape.pendingPlanChange.objectSpec({ meaning: 'A plan change confirmed to take effect at the end of the current period (#1868): the target plan and price, when it applies, and the lines the subscription will then carry. Written by a change-plan confirmation whose new plan defers it; cleared when renewal applies it (the items then become these lines) or when cancel-plan-change withdraws it. Read-only.' }),\n cancellationReason: schemaShape.cancellationReason.stringSpec({ meaning: 'Current cancellation reason, cleared on resume and replaced on a later cancellation. Historical reasons are retained in committed cancellation audit events.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect one subscription for settings, entitlements, and support.',\n outcome: 'Current items, status, and period fields for UI.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The subscription was found and its items, status, and period bounds are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to read the subscription (the read path is an org-owner/org-admin-scoped API operation).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect the active team subscription',\n response: subscriptionExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect the subscription with available relationship context',\n response: subscriptionExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact subscription summary',\n response: subscriptionSummaryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'Enumerate subscriptions for a billing account or scope.',\n outcome: 'Table data for admin and self-serve subscription pickers.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of subscriptions for the billing account or scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to enumerate subscriptions in this scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse subscriptions for one billing account',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([subscriptionExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse subscriptions with relationship context',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([subscriptionExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact subscription summaries',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([subscriptionSummaryExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.CREATE]: {\n purpose: 'Repository path when server creates a subscription document from provider sync before first API read.',\n outcome: 'New row aligned to provider id in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A subscription document was materialised from provider sync and aligned to the provider subscription id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The synced subscription payload fails schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller holds no role this operation names. Subscription rows are materialised by the engine\\'s billing provider-event handler, which acts with the handler-only `ORG_BILLING_PROVIDER_EVENTS` (organization) or `APP_BILLING_PROVIDER_EVENTS` (personal) role; this is an internal service-pipeline write, not a public create endpoint.' },\n ],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Internal updates from billing provider events (the engine\\'s billing handler, authorized with its handler-only role) or migration; user-facing changes use custom ops.',\n outcome: 'Patched fields per DTO rules in factory.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The subscription fields were patched (typically reconciling provider webhook state) and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields fail schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner / system role required to reconcile subscription state (internal service-pipeline path, not HTTP-exposed).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n ],\n idempotent: true,\n },\n [BillingSubscription_Operations.CANCEL]: {\n operationId: BillingSubscription_Operations.CANCEL,\n purpose: 'Cancel at the end of the current period or immediately, within what the plan permits.',\n outcome: 'Provider and row updated; the supplied reason is retained in the committed RESOURCE_OPERATION_PERFORMED event independently of the current cancellationReason field. Emails may fire per runtime config. Timing is decided in this order: the request’s `cancelImmediately` when it names one, then the plan product’s authored default, then the application default, then the end of the current period. A plan may FORBID immediate cancellation, in which case effective immediate timing is refused, including inherited defaults, rather than quietly downgraded — a caller told their subscription ended when it has not is worse served than one told no.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The cancellation was accepted at the provider and mirrored locally — either `cancelAtPeriodEnd` is set or the subscription is now `CANCELLED` per the `cancelImmediately` flag. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to cancel the subscription (a CRITICAL-risk lifecycle action).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription is in a state the provider will not cancel (e.g. already terminated, or `INCOMPLETE_EXPIRED`).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Effective cancellation timing is immediate for a plan whose product forbids it, whether requested explicitly or inherited from a default. The subscription can still be cancelled at the end of the current period.', errorCode: 'billing_product_forbids_immediate_cancellation' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this cancellation and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the cancellation and applied nothing. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the cancellation was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent in effect (#535 S5a). A repeat with the same Idempotency-Key replays the committed cancellation without\n // contacting the provider again; the same key with a different request is refused 422. A repeat without a key is\n // admitted afresh and converges, because the provider treats re-cancelling an already-cancelling subscription as a no-op.\n idempotent: true,\n examples: [{\n title: 'Schedule cancellation at the current period end',\n request: { cancelImmediately: false, reason: 'Consolidating tools at renewal' },\n response: {\n ...subscriptionExample,\n cancelAtPeriodEnd: true,\n cancellationReason: 'Consolidating tools at renewal',\n updatedAt: '2026-06-20T15:15:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.RESUME]: {\n operationId: BillingSubscription_Operations.RESUME,\n purpose: 'Undo a pending cancel before period end when provider allows.',\n outcome: 'The pending cancellation is removed; the current subscription lifecycle status is preserved.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The pending cancellation was cleared at the provider and locally. A trial or overdue payment status is not changed by this operation. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to resume the subscription.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'There is no pending cancellation to undo. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_not_pending_cancellation' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this resume and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the resume and applied nothing. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the resume was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent in effect (#535 S5a). A repeat with the same Idempotency-Key replays the committed resume without contacting\n // the provider; the same key with a different request is refused 422. Without a key, a repeat after resume cleared\n // cancelAtPeriodEnd is refused before admission (`billing_subscription_not_pending_cancellation`), not a no-op success.\n idempotent: true,\n examples: [{\n title: 'Resume a subscription before renewal',\n request: {},\n response: {\n ...subscriptionExample,\n cancelAtPeriodEnd: false,\n updatedAt: '2026-06-21T10:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.CANCEL_PLAN_CHANGE]: {\n operationId: BillingSubscription_Operations.CANCEL_PLAN_CHANGE,\n purpose: 'Withdraw a plan change that was confirmed to take effect at the end of the current period (#1868).',\n outcome: 'The provider’s schedule for the change is released and `pendingPlanChange` is cleared, so the subscription renews on its current plan. Nothing is charged or refunded: the change had not taken effect.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The pending change was withdrawn at the provider and locally. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to withdraw a plan change.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'No plan change is pending on this subscription: there is nothing to withdraw. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_no_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The pending change is taking effect: its renewal is due within five minutes, or has passed and the subscription has not yet been updated. Releasing the schedule then would leave the provider billing the new plan while the change read as withdrawn. Let it land, then change plan again. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_taking_effect' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have released the schedule and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused to release the schedule and applied nothing — including when its next phase had already begun, so the change had taken effect. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the withdrawal was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent in effect, as RESUME: a repeat with the same Idempotency-Key replays the committed withdrawal; without a key, a\n // repeat after the pending change was cleared is refused before admission (`billing_subscription_no_plan_change_pending`).\n idempotent: true,\n examples: [{\n title: 'Keep the current plan: withdraw a downgrade pending at the end of the period',\n request: {},\n response: {\n ...subscriptionExample,\n updatedAt: '2026-06-23T09:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.PREVIEW_PLAN_CHANGE]: {\n operationId: BillingSubscription_Operations.PREVIEW_PLAN_CHANGE,\n purpose: 'Request a fresh provider invoice estimate for a target plan and price.',\n outcome: 'Returns the upcoming invoice amount, currency, lines, period, calculation instant, when the change would take effect (`timing`, `effectiveAt`) and a short-lived previewToken bound to the caller, subscription and selected plan. A change the new plan defers to the end of the period is previewed as the renewal invoice on the new plan, unprorated. The token carries reviewed inputs; normal authorization still applies to confirmation.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Provider estimate calculated; this amount is not necessarily an immediate charge.' }],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The subscription, billing account or scope does not match the authorized route context.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The target is not a plan or its selected price belongs to another product.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The target product or price is retired, or provider item identities are incomplete.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The new plan defers the change to the end of the period, and the subscription ends then: a cancellation is pending. Resume the subscription first. Refused before anything is sent.', errorCode: 'billing_plan_change_subscription_pending_cancellation' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The new plan defers the change to the end of the period, and the lines the subscription would then carry do not share one recurring billing interval (a yearly add-on beside a monthly plan): a deferred change is one provider phase, billed on one interval. Remove the add-on whose interval differs, or choose a price on the same interval. Refused before anything is sent.', errorCode: 'billing_plan_change_billing_interval_mismatch' },\n ],\n idempotent: true,\n },\n [BillingSubscription_Operations.CHANGE_PLAN]: {\n operationId: BillingSubscription_Operations.CHANGE_PLAN,\n purpose: 'Confirm a previously reviewed plan and price using its previewToken.',\n outcome: 'The new plan\\'s policy decides when the change takes effect (#1868). Immediately: the plan item is updated after provider confirmation, preserving its known provider item ID and unrelated add-on entries, and the new plan\\'s `proration` settles the unused part of the current period. At the end of the period (a downgrade\\'s default): the provider is given a schedule, the items are left as they are, and the subscription records the change as `pendingPlanChange` until renewal applies it.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'An immediate plan swap (with proration) was confirmed by the provider and the subscription’s plan item is updated with its provider identity preserved; or a change at the end of the period was scheduled by the provider and is returned as `pendingPlanChange`, with the items unchanged. Confirming the same preview again after it committed answers the subscription as it is now — a later change shows through — without contacting the provider or re-running any effect, for as long as the preview token is valid (10 minutes).' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`newProductKey` identifies a product that is not a PLAN. Add-ons and credit packs cannot replace the plan item.', customMessageReference: ErrorCustomMessageReference.BILLING_INVALID_PRODUCT_TYPE },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'An existing subscription item has no recorded provider item ID. Repair the missing provider identity before changing items; routine status reconciliation does not repair item IDs. The request is refused before provider mutation.', errorCode: 'billing_existing_provider_item_missing' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`newProductKey`, `newPriceId` or `previewToken` is missing or fails request-DTO validation.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The preview token is expired, altered or belongs to another actor, subscription or selection. Request a new preview before confirming.', errorCode: 'billing_plan_change_preview_invalid' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription terms or relevant catalogue policy changed after the preview, or another change to the subscription was admitted after it: a preview names the mutation generation it was computed against, and admission is a compare-and-swap on that generation, so of two previews of one generation only the first confirmation proceeds. The stale confirmation is rejected before contacting the provider.', errorCode: 'billing_plan_change_preview_stale' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same confirmation is already running. Nothing was sent to the provider by this request; retry later. A plan change that was admitted but never sent, and whose preview has expired, is released; a change the provider may have applied holds the subscription until recovery resolves it.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this change and nothing has yet established whether it did (a lost response, a timeout, a server error), or another request with this same preview is still dispatching it. Confirming again sends nothing; a genuinely unknown outcome holds the subscription until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the change and applied nothing, for example an invalid request. A failed proration payment is NOT a refusal: the change applies and the subscription moves to past_due. The refusal is recorded and the subscription is free again; request a new preview.', errorCode: 'billing_plan_change_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s items changed after the provider applied the change. The local write is refused so the applied change is not discarded, and the change stays owed to recovery.', errorCode: 'billing_plan_change_subscription_items_changed' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider applied the change but its answer does not identify the plan item it created (a subscription that had no plan item). The local write is refused rather than recording an item nothing can target later; the change stays applied, confirming again sends nothing, and it is owed to recovery.', errorCode: 'billing_created_provider_item_unresolved' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished — for example another request with the same preview completed it first. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the change was admitted, so a change admitted against the old identity is not applied to the new one. If the provider had already applied the change, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`newPriceId` names a price whose `productId` is not `newProductKey`’s product. The two are caller-supplied independently, and the provider is billed the PRICE while entitlements derive from the PRODUCT recorded on the item — so an unmatched pair would grant one plan’s entitlements at another plan’s price.', customMessageReference: ErrorCustomMessageReference.BILLING_PRICE_PRODUCT_MISMATCH },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to change the plan (a HIGH-risk commercial action).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id, or the target product/price is not in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The requested price is incompatible with the current subscription.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`newProductKey` (or the price named by `newPriceId`) has been RETIRED from the code catalogue. A subscription may not be MOVED ONTO a retired product; a subscription already on one keeps running, and REMOVE_ADDON deliberately still works so a customer is never trapped on a withdrawn add-on.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_RETIRED },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`newProductKey` is announced but not yet on sale (catalogue `availability` UPCOMING). A subscription may not be moved onto it until the catalogue puts it on sale.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_NOT_YET_AVAILABLE },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The new plan defers the change to the end of the period, and the subscription ends then: a cancellation is pending. Resume the subscription first. Refused before anything is sent.', errorCode: 'billing_plan_change_subscription_pending_cancellation' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The new plan defers the change to the end of the period, and the lines the subscription would then carry do not share one recurring billing interval (a yearly add-on beside a monthly plan): a deferred change is one provider phase, billed on one interval. Remove the add-on whose interval differs, or choose a price on the same interval. Refused before anything is sent.', errorCode: 'billing_plan_change_billing_interval_mismatch' },\n ],\n // One preview is at most one commercial change (#535): its generation is admitted once, the provider is sent the\n // change once under a store-owned key, and a replay after commit answers the subscription's CURRENT state with no\n // second call or effect. Bounded by the preview token's validity (10 minutes); a replay while the outcome is\n // unknown is refused rather than re-sent.\n idempotent: true,\n examples: [{\n title: 'Upgrade from Team to Business',\n request: { newProductKey: 'business_plan', newPriceId: 'price_business_monthly', previewToken: '<previewToken returned by preview-plan-change>' },\n response: {\n ...subscriptionExample,\n items: [{\n _id: 'subscription_item_business_01HX2EXAMPLE',\n productId: 'product_business_plan',\n priceId: 'price_business_monthly',\n quantity: 1,\n }],\n updatedAt: '2026-06-22T11:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }, {\n title: 'Downgrade from Business to Team at the end of the period',\n request: { newProductKey: 'team_plan', newPriceId: 'price_team_monthly', previewToken: '<previewToken returned by preview-plan-change>' },\n response: {\n ...subscriptionExample,\n pendingPlanChange: {\n productId: 'product_team_plan',\n priceId: 'price_team_monthly',\n effectiveAt: subscriptionExample.currentPeriodEnd,\n items: [{ _id: 'subscription_item_team_01HX2EXAMPLE', productId: 'product_team_plan', priceId: 'price_team_monthly', quantity: 1 }],\n },\n updatedAt: '2026-06-22T11:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.ADD_ADDON]: {\n operationId: BillingSubscription_Operations.ADD_ADDON,\n purpose: 'Attach an add-on line item to the subscription.',\n outcome: 'The provider is sent the subscription’s lines plus one new line correlated by a backend-generated key, and the items array gains that entry with its provider-confirmed item ID. Every request must carry an Idempotency-Key: adding an add-on that is already attached adds another line and another charge, so a retry after a lost response has to be recognizable as the same request. A request without one is refused before anything is admitted.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The add-on line item was confirmed by the provider and appended to the subscription’s items array. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'An existing subscription item has no recorded provider item ID. Repair the missing provider identity before changing items; routine status reconciliation does not repair item IDs. The request is refused before provider mutation.', errorCode: 'billing_existing_provider_item_missing' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider applied the add-on but its answer does not identify the item it created. The local write is refused rather than recording an item nothing can target later; the add-on stays applied, asking again sends nothing, and it is owed to recovery.', errorCode: 'billing_created_provider_item_unresolved' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `addonProductKey` / `priceId` is missing or fails request-DTO validation.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`addonProductKey` identifies a product that is not an ADDON.', customMessageReference: ErrorCustomMessageReference.BILLING_INVALID_PRODUCT_TYPE },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`priceId` names a price whose `productId` is not the add-on product’s. Same split as CHANGE_PLAN: the provider bills the price, the item records the product, and entitlements follow the product.', customMessageReference: ErrorCustomMessageReference.BILLING_PRICE_PRODUCT_MISMATCH },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The add-on requires a plan tier the subscription’s plan does not have. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.BILLING_PLAN_TIER_REQUIRED },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to add an add-on (a HIGH-risk commercial action).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id, or the add-on product is not in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`addonProductKey` (or the price named by `priceId`) has been RETIRED from the code catalogue and may no longer be bought.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_RETIRED },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`addonProductKey` is announced but not yet on sale (catalogue `availability` UPCOMING) and may not be bought yet.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_NOT_YET_AVAILABLE },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later with the same key.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this add-on and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the add-on and applied nothing. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the add-on was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s items changed after the provider applied the add-on, so writing the items it was computed against would discard that change. The add-on stays applied and the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_items_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent per key (#535 S5b). The key is REQUIRED: a repeat with it replays the committed addition without contacting the\n // provider, and the same key with a different request is refused 422. Without the key there is nothing to replay, so the\n // request is refused rather than admitted as a second addition.\n idempotent: true,\n examples: [{\n title: 'Add the audit-retention add-on',\n request: { addonProductKey: 'audit_retention', priceId: 'price_audit_retention_monthly' },\n response: {\n ...subscriptionExample,\n items: [\n baseItem,\n {\n _id: 'subscription_item_audit_01HX2EXAMPLE',\n productId: 'product_audit_retention',\n priceId: 'price_audit_retention_monthly',\n quantity: 1,\n },\n ],\n updatedAt: '2026-06-23T08:30:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.REMOVE_ADDON]: {\n operationId: BillingSubscription_Operations.REMOVE_ADDON,\n purpose: 'Remove the named add-on through explicit provider item deletion.',\n outcome: 'All entries of the named add-on are explicitly deleted by their recorded provider item IDs before the local items array shrinks. The plan and unrelated add-ons are unchanged; missing provider item IDs refuse the operation before mutation. Every request must carry an Idempotency-Key: a repeat after the removal committed no longer finds the add-on, so only the key lets a retry after a lost response learn that its removal succeeded.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The add-on line item was removed at the provider and dropped from the subscription’s items array. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `addonProductKey` is missing or fails request-DTO validation.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`addonProductKey` identifies a product that is not an ADDON.', customMessageReference: ErrorCustomMessageReference.BILLING_INVALID_PRODUCT_TYPE },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to remove an add-on (a HIGH-risk commercial action).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id, or the named add-on is not present on the subscription.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A matching add-on entry has no recorded provider subscription-item ID, so the deletion cannot be targeted safely.', errorCode: 'billing_addon_provider_item_missing' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later with the same key.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this removal and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the removal and applied nothing. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the removal was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s items changed after the provider applied the removal, so writing the items it was computed against would discard that change. The removal stays applied and the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_items_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent per key (#535 S5b). The key is REQUIRED: a repeat with it replays the committed removal without contacting the\n // provider, and the same key with a different request is refused 422.\n idempotent: true,\n examples: [{\n title: 'Remove the audit-retention add-on',\n request: { addonProductKey: 'audit_retention' },\n response: {\n ...subscriptionExample,\n items: [baseItem],\n updatedAt: '2026-06-24T08:30:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'The `discounts` list, `trialStart` and `trialEnd` are copied from the billing provider on every provider event and by the reconciliation sweep, and are cleared when the provider no longer holds them. They are read-only. `discounts` holds every discount the provider applies, in the order it applies them: a referral reward added beside a checkout promotion is a second entry, and both are charged.',\n ],\n }),\n { resourcePrimaryScope: subResourcePrimaryScopeByResourceType[resourceType] },\n );\n}\n\nfunction buildSubscriptionSpec(resourceType: SubResourceType, memberName: SubResourceTypeMember) {\n const base = buildSubscriptionBase(resourceType, memberName);\n const main = resolveSubUI(billingMainPresets as Partial<Record<string, unknown>>, resourceType, 'billingMainPresets');\n const admin = resolveSubUI(billingAdminPresets as Partial<Record<string, unknown>>, resourceType, 'billingAdminPresets');\n return resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)),\n base,\n () => ({\n label: { purpose: 'Preset uses `status` string for a compact row label in subscription lists.' },\n layout: {\n purpose: 'Inline summary template in billing presets (no `refs.sections`) shows status, cancel-at-period-end, period end, trial end, and billing-account id — child resources appear in parent billing-account tabs via `variantOverrides`.',\n displayPurpose: 'Self-serve “current plan” and org admin subscription management.',\n },\n views: {\n [BillingSubscription_Operations.CANCEL]: { purpose: 'Custom op host; entries are not addressable routes in merged `billing` presets but operations exist for action buttons.', whenToUse: 'Cancel plan flow in product UI.' },\n [BillingSubscription_Operations.RESUME]: { purpose: 'Resume before period end when user changes mind.', whenToUse: 'Reverse a scheduled cancel.' },\n [BillingSubscription_Operations.CHANGE_PLAN]: { purpose: 'Plan migration host for upgrade/downgrade UX.', whenToUse: 'When catalog offers multiple prices for the same product line.' },\n [BillingSubscription_Operations.ADD_ADDON]: { purpose: 'Attach add-on SKUs to the active subscription.', whenToUse: 'When add-on products exist in the catalog.' },\n [BillingSubscription_Operations.REMOVE_ADDON]: { purpose: 'Detach an add-on line item.', whenToUse: 'When seat-based or feature add-ons can be removed mid-cycle per policy.' },\n [BillingSubscription_Operations.CANCEL_PLAN_CHANGE]: { purpose: 'Withdraw a plan change pending at the end of the period.', whenToUse: 'When the customer changes their mind about a scheduled downgrade before renewal.' },\n },\n }),\n );\n}\n\nexport const organizationSubscriptionsResourceSpecification = buildSubscriptionSpec(\n CoreResourceType.ORGANIZATION_SUBSCRIPTIONS,\n 'ORGANIZATION_SUBSCRIPTIONS',\n);\n\nexport const userSubscriptionsResourceSpecification = buildSubscriptionSpec(CoreResourceType.USER_SUBSCRIPTIONS, 'USER_SUBSCRIPTIONS');\n"]}
|
|
1
|
+
{"version":3,"file":"subscriptions.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/subscriptions.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,wCAAwC,EACxC,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kCAAkC,EAClC,uBAAuB,EACvB,qCAAqC,GAEtC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,MAAM,qCAAqC,GAA6D;IACtG,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,EAAE,oBAAoB,CAAC,aAAa;IACjF,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,oBAAoB,CAAC,SAAS;CACtE,CAAC;AAQF,SAAS,YAAY,CAAC,MAAwC,EAAE,YAA6B,EAAE,UAAkB;IAC/G,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAA4B,CAAC;IACnE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,YAAY,YAAY,oBAAoB,UAAU,GAAG,C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AC,8BAA8B,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE,SAAS,EAAE,6BAA6B,EAAE;YAClJ,CAAC,8BAA8B,CAAC,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,+CAA+C,EAAE,SAAS,EAAE,gEAAgE,EAAE;YACvL,CAAC,8BAA8B,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,gDAAgD,EAAE,SAAS,EAAE,4CAA4C,EAAE;YAClK,CAAC,8BAA8B,CAAC,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE,SAAS,EAAE,yEAAyE,EAAE;YAC/K,CAAC,8BAA8B,CAAC,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,kFAAkF,EAAE;SAC5N;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,8CAA8C,GAAG,qBAAqB,CACjF,gBAAgB,CAAC,0BAA0B,EAC3C,4BAA4B,CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { billingAdminPresets, billingMainPresets } 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 BillingSubscriptionBaseSchema,\n BillingSubscription_Operations,\n CoreResourceOperation as Op,\n CoreResourceType,\n ResourcePrimaryScope,\n SubscriptionStatus,\n billingSubscriptionsPolymorphicFactories,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport {\n BILLING_API_REFERENCE_PAGE_REQUEST,\n billingApiReferencePage,\n createBillingApiReferenceScopeExample,\n type BillingApiReferenceExampleScope,\n} from './billing-api-reference-examples';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype SubResourceType = CoreResourceType.ORGANIZATION_SUBSCRIPTIONS | CoreResourceType.USER_SUBSCRIPTIONS;\ntype SubResourceTypeMember = 'ORGANIZATION_SUBSCRIPTIONS' | 'USER_SUBSCRIPTIONS';\n\nconst subResourcePrimaryScopeByResourceType: Record<SubResourceType, BillingApiReferenceExampleScope> = {\n [CoreResourceType.ORGANIZATION_SUBSCRIPTIONS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.USER_SUBSCRIPTIONS]: ResourcePrimaryScope.USER_SELF,\n};\n\ntype Cfg = ReturnType<(typeof billingSubscriptionsPolymorphicFactories)[CoreResourceType.ORGANIZATION_SUBSCRIPTIONS]>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof BillingSubscriptionBaseSchema;\ntype SubFrontend = ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nfunction resolveSubUI(source: Partial<Record<string, unknown>>, resourceType: SubResourceType, sourceName: string): SubFrontend {\n const uiBehavior = source[resourceType] as SubFrontend | undefined;\n if (!uiBehavior) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return uiBehavior;\n}\n\nfunction buildSubscriptionBase(resourceType: SubResourceType, memberName: SubResourceTypeMember) {\n const exampleScope = createBillingApiReferenceScopeExample(\n subResourcePrimaryScopeByResourceType[resourceType],\n );\n const baseItem = {\n _id: 'subscription_item_base_01HX2EXAMPLE',\n productId: 'product_team_plan',\n priceId: 'price_team_monthly',\n quantity: 25,\n };\n const subscriptionExample = {\n _id: 'subscription_01HX2EXAMPLE',\n ...exampleScope.billingAccountIdentity,\n status: SubscriptionStatus.ACTIVE,\n items: [baseItem],\n currentPeriodStart: '2026-06-01T00:00:00.000Z',\n currentPeriodEnd: '2026-07-01T00:00:00.000Z',\n cancelAtPeriodEnd: false,\n metadata: { contract: 'annual-commitment' },\n createdAt: '2026-05-10T09:00:00.000Z',\n updatedAt: '2026-06-01T00:05:00.000Z',\n ...exampleScope.scopeIdentity,\n };\n const subscriptionSummaryExample = {\n _id: subscriptionExample._id,\n ...exampleScope.billingAccountIdentity,\n status: subscriptionExample.status,\n currentPeriodEnd: subscriptionExample.currentPeriodEnd,\n cancelAtPeriodEnd: subscriptionExample.cancelAtPeriodEnd,\n };\n\n return resourceSpecification<Custom, Core, Main>(\n billingSubscriptionsPolymorphicFactories[resourceType],\n BillingSubscriptionBaseSchema,\n ({ schemaShape }) => ({\n purpose:\n 'Subscription for a billing account: exposes the selected plan and add-ons, lifecycle status, billing-period bounds, trial state, and cancellation state.',\n businessRole: 'Entitlement driver for seats and renewals — the object billing emails and plan changes refer to.',\n lifecycleRole:\n 'Created after a successful checkout and updated after subscription changes or billing-provider events. A cancelled subscription is retained as billing history rather than cascade-deleted with its account, and subject erasure terminates active billing.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'BillingSubscriptionBaseSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'billingSubscriptionsPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName },\n operationVocabulary: {\n coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n customEnum: { packageName: '@wildo-ai/saas-models', exportName: 'BillingSubscription_Operations', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n },\n frontendConfigurationSourceEntries: [\n { collectionSymbol: { packageName: '@wildo-ai/presets-components', exportName: 'billingMainPresets', symbolKind: CodeSymbolKind.UI_BEHAVIOR }, identifierField: 'collectionKey', identifierValue: resourceType },\n { collectionSymbol: { packageName: '@wildo-ai/presets-components', exportName: 'billingAdminPresets', symbolKind: CodeSymbolKind.UI_BEHAVIOR }, identifierField: 'collectionKey', identifierValue: resourceType },\n ],\n notes: ['Two billing notices are sent from these operations (#2929): `subscription-started` (CREATE and UPDATE, when the subscription first gives access) and `subscription-ending` (UPDATE and CANCEL, when its end is decided). An organization subscription notifies the organization\\'s billing contact (`ORGANIZATION_BILLING`), a personal one the person it belongs to (`USERS_CUSTOM` on `userId`). Each fires on a change of the row (`subscriptionStartedByWrite`, `subscriptionCancellationDecidedByWrite`), so a renewal sends nothing. Templates: `resources/<organizationSubscriptions|userSubscriptions>/<operation>.<target>_<notice>`.'],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Mongo id for this subscription document.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n billingAccountId: schemaShape.billingAccountId.stringSpec({ meaning: 'Polymorphic FK to the parent billing account (`organizationBillingAccountId` or `userBillingAccountId` on concrete schema).', importance: FieldSemanticImportance.PRIMARY }),\n status: schemaShape.status.enumSpec({\n meaning: 'Provider subscription lifecycle state mirrored for gating and UI badges.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'SubscriptionStatus', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [SubscriptionStatus.ACTIVE]: { meaning: 'Currently billable and entitled per provider.' },\n [SubscriptionStatus.TRIALING]: { meaning: 'In trial window if applicable.' },\n [SubscriptionStatus.PAST_DUE]: { meaning: 'Payment failed; access may be degraded per product policy.' },\n [SubscriptionStatus.UNPAID]: { meaning: 'Severe payment failure state from provider semantics.' },\n [SubscriptionStatus.CANCELLED]: { meaning: 'Terminated; may still be visible for history.' },\n [SubscriptionStatus.INCOMPLETE]: { meaning: 'Checkout or first payment not completed.' },\n [SubscriptionStatus.INCOMPLETE_EXPIRED]: { meaning: 'Incomplete checkout expired at provider.' },\n [SubscriptionStatus.PAUSED]: { meaning: 'Paused per provider rules (if used).' },\n },\n }),\n items: schemaShape.items.arraySpec({\n meaning: 'Line items (product + price + quantity) that make up the commercial subscription.',\n elementMeaning: 'One `SubscriptionItemSchema` with `productId`, `priceId`, `quantity`, and optional provider item id.',\n }),\n currentPeriodStart: schemaShape.currentPeriodStart.dateSpec({ meaning: 'Start of the current invoice period.', temporalRole: 'scheduled' }),\n currentPeriodEnd: schemaShape.currentPeriodEnd.dateSpec({ meaning: 'End of the current invoice period / next renewal anchor.', importance: FieldSemanticImportance.PRIMARY }),\n trialStart: schemaShape.trialStart.dateSpec({ meaning: 'When the trial began, as the billing provider reports it. Kept after the trial ends; absent on a subscription that never had a trial.', temporalRole: 'scheduled' }),\n trialEnd: schemaShape.trialEnd.dateSpec({ meaning: 'When the trial ends, or ended, as the billing provider reports it. Kept after the trial is over, so it describes the subscription\\'s trial, not whether it is trialing now: `status` says that.', temporalRole: 'deadline' }),\n cancelAtPeriodEnd: schemaShape.cancelAtPeriodEnd.booleanSpec({ meaning: 'User/org requested cancel at end of current period.' }),\n pendingPlanChange: schemaShape.pendingPlanChange.objectSpec({ meaning: 'A plan change confirmed to take effect at the end of the current period (#1868): the target plan and price, when it applies, and the lines the subscription will then carry. Written by a change-plan confirmation whose new plan defers it; cleared when renewal applies it (the items then become these lines) or when cancel-plan-change withdraws it. Read-only.' }),\n cancellationReason: schemaShape.cancellationReason.stringSpec({ meaning: 'Current cancellation reason, cleared on resume and replaced on a later cancellation. Historical reasons are retained in committed cancellation audit events.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect one subscription for settings, entitlements, and support.',\n outcome: 'Current items, status, and period fields for UI.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The subscription was found and its items, status, and period bounds are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to read the subscription (the read path is an org-owner/org-admin-scoped API operation).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect the active team subscription',\n response: subscriptionExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect the subscription with available relationship context',\n response: subscriptionExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact subscription summary',\n response: subscriptionSummaryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'Enumerate subscriptions for a billing account or scope.',\n outcome: 'Table data for admin and self-serve subscription pickers.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of subscriptions for the billing account or scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to enumerate subscriptions in this scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse subscriptions for one billing account',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([subscriptionExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse subscriptions with relationship context',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([subscriptionExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact subscription summaries',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([subscriptionSummaryExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.CREATE]: {\n purpose: 'Repository path when server creates a subscription document from provider sync before first API read.',\n outcome: 'New row aligned to provider id in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A subscription document was materialised from provider sync and aligned to the provider subscription id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The synced subscription payload fails schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller holds no role this operation names. Subscription rows are materialised by the engine\\'s billing provider-event handler, which acts with the handler-only `ORG_BILLING_PROVIDER_EVENTS` (organization) or `APP_BILLING_PROVIDER_EVENTS` (personal) role; this is an internal service-pipeline write, not a public create endpoint.' },\n ],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Internal updates from billing provider events (the engine\\'s billing handler, authorized with its handler-only role) or migration; user-facing changes use custom ops.',\n outcome: 'Patched fields per DTO rules in factory.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The subscription fields were patched (typically reconciling provider webhook state) and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields fail schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner / system role required to reconcile subscription state (internal service-pipeline path, not HTTP-exposed).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n ],\n idempotent: true,\n },\n [BillingSubscription_Operations.CANCEL]: {\n operationId: BillingSubscription_Operations.CANCEL,\n purpose: 'Cancel at the end of the current period or immediately, within what the plan permits.',\n outcome: 'Provider and row updated; the supplied reason is retained in the committed RESOURCE_OPERATION_PERFORMED event independently of the current cancellationReason field. Emails may fire per runtime config. Timing is decided in this order: the request’s `cancelImmediately` when it names one, then the plan product’s authored default, then the application default, then the end of the current period. A plan may FORBID immediate cancellation, in which case effective immediate timing is refused, including inherited defaults, rather than quietly downgraded — a caller told their subscription ended when it has not is worse served than one told no.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The cancellation was accepted at the provider and mirrored locally — either `cancelAtPeriodEnd` is set or the subscription is now `CANCELLED` per the `cancelImmediately` flag. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to cancel the subscription (a CRITICAL-risk lifecycle action).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription is in a state the provider will not cancel (e.g. already terminated, or `INCOMPLETE_EXPIRED`).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Effective cancellation timing is immediate for a plan whose product forbids it, whether requested explicitly or inherited from a default. The subscription can still be cancelled at the end of the current period.', errorCode: 'billing_product_forbids_immediate_cancellation' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this cancellation and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the cancellation and applied nothing. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the cancellation was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent in effect (#535 S5a). A repeat with the same Idempotency-Key replays the committed cancellation without\n // contacting the provider again; the same key with a different request is refused 422. A repeat without a key is\n // admitted afresh and converges, because the provider treats re-cancelling an already-cancelling subscription as a no-op.\n idempotent: true,\n examples: [{\n title: 'Schedule cancellation at the current period end',\n request: { cancelImmediately: false, reason: 'Consolidating tools at renewal' },\n response: {\n ...subscriptionExample,\n cancelAtPeriodEnd: true,\n cancellationReason: 'Consolidating tools at renewal',\n updatedAt: '2026-06-20T15:15:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.RESUME]: {\n operationId: BillingSubscription_Operations.RESUME,\n purpose: 'Undo a pending cancel before period end when provider allows.',\n outcome: 'The pending cancellation is removed; the current subscription lifecycle status is preserved.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The pending cancellation was cleared at the provider and locally. A trial or overdue payment status is not changed by this operation. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to resume the subscription.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'There is no pending cancellation to undo. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_not_pending_cancellation' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this resume and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the resume and applied nothing. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the resume was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent in effect (#535 S5a). A repeat with the same Idempotency-Key replays the committed resume without contacting\n // the provider; the same key with a different request is refused 422. Without a key, a repeat after resume cleared\n // cancelAtPeriodEnd is refused before admission (`billing_subscription_not_pending_cancellation`), not a no-op success.\n idempotent: true,\n examples: [{\n title: 'Resume a subscription before renewal',\n request: {},\n response: {\n ...subscriptionExample,\n cancelAtPeriodEnd: false,\n updatedAt: '2026-06-21T10:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.CANCEL_PLAN_CHANGE]: {\n operationId: BillingSubscription_Operations.CANCEL_PLAN_CHANGE,\n purpose: 'Withdraw a plan change that was confirmed to take effect at the end of the current period (#1868).',\n outcome: 'The provider’s schedule for the change is released and `pendingPlanChange` is cleared, so the subscription renews on its current plan. Nothing is charged or refunded: the change had not taken effect.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The pending change was withdrawn at the provider and locally. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to withdraw a plan change.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id under the caller’s billing account.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'No plan change is pending on this subscription: there is nothing to withdraw. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_no_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The pending change is taking effect: its renewal is due within five minutes, or has passed and the subscription has not yet been updated. Releasing the schedule then would leave the provider billing the new plan while the change read as withdrawn. Let it land, then change plan again. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_taking_effect' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have released the schedule and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused to release the schedule and applied nothing — including when its next phase had already begun, so the change had taken effect. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the withdrawal was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent in effect, as RESUME: a repeat with the same Idempotency-Key replays the committed withdrawal; without a key, a\n // repeat after the pending change was cleared is refused before admission (`billing_subscription_no_plan_change_pending`).\n idempotent: true,\n examples: [{\n title: 'Keep the current plan: withdraw a downgrade pending at the end of the period',\n request: {},\n response: {\n ...subscriptionExample,\n updatedAt: '2026-06-23T09:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.PREVIEW_PLAN_CHANGE]: {\n operationId: BillingSubscription_Operations.PREVIEW_PLAN_CHANGE,\n purpose: 'Request a fresh provider invoice estimate for a target plan and price.',\n outcome: 'Returns the upcoming invoice amount, currency, lines, period, calculation instant, when the change would take effect (`timing`, `effectiveAt`) and a short-lived previewToken bound to the caller, subscription and selected plan. A change the new plan defers to the end of the period is previewed as the renewal invoice on the new plan, unprorated. The token carries reviewed inputs; normal authorization still applies to confirmation.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Provider estimate calculated; this amount is not necessarily an immediate charge.' }],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The subscription, billing account or scope does not match the authorized route context.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The target is not a plan or its selected price belongs to another product.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The target product or price is retired, or provider item identities are incomplete.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The new plan defers the change to the end of the period, and the subscription ends then: a cancellation is pending. Resume the subscription first. Refused before anything is sent.', errorCode: 'billing_plan_change_subscription_pending_cancellation' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The new plan defers the change to the end of the period, and the lines the subscription would then carry do not share one recurring billing interval (a yearly add-on beside a monthly plan): a deferred change is one provider phase, billed on one interval. Remove the add-on whose interval differs, or choose a price on the same interval. Refused before anything is sent.', errorCode: 'billing_plan_change_billing_interval_mismatch' },\n ],\n idempotent: true,\n },\n [BillingSubscription_Operations.CHANGE_PLAN]: {\n operationId: BillingSubscription_Operations.CHANGE_PLAN,\n purpose: 'Confirm a previously reviewed plan and price using its previewToken.',\n outcome: 'The new plan\\'s policy decides when the change takes effect (#1868). Immediately: the plan item is updated after provider confirmation, preserving its known provider item ID and unrelated add-on entries, and the new plan\\'s `proration` settles the unused part of the current period. At the end of the period (a downgrade\\'s default): the provider is given a schedule, the items are left as they are, and the subscription records the change as `pendingPlanChange` until renewal applies it.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'An immediate plan swap (with proration) was confirmed by the provider and the subscription’s plan item is updated with its provider identity preserved; or a change at the end of the period was scheduled by the provider and is returned as `pendingPlanChange`, with the items unchanged. Confirming the same preview again after it committed answers the subscription as it is now — a later change shows through — without contacting the provider or re-running any effect, for as long as the preview token is valid (10 minutes).' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`newProductKey` identifies a product that is not a PLAN. Add-ons and credit packs cannot replace the plan item.', customMessageReference: ErrorCustomMessageReference.BILLING_INVALID_PRODUCT_TYPE },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'An existing subscription item has no recorded provider item ID. Repair the missing provider identity before changing items; routine status reconciliation does not repair item IDs. The request is refused before provider mutation.', errorCode: 'billing_existing_provider_item_missing' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`newProductKey`, `newPriceId` or `previewToken` is missing or fails request-DTO validation.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The preview token is expired, altered or belongs to another actor, subscription or selection. Request a new preview before confirming.', errorCode: 'billing_plan_change_preview_invalid' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription terms or relevant catalogue policy changed after the preview, or another change to the subscription was admitted after it: a preview names the mutation generation it was computed against, and admission is a compare-and-swap on that generation, so of two previews of one generation only the first confirmation proceeds. The stale confirmation is rejected before contacting the provider.', errorCode: 'billing_plan_change_preview_stale' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same confirmation is already running. Nothing was sent to the provider by this request; retry later. A plan change that was admitted but never sent, and whose preview has expired, is released; a change the provider may have applied holds the subscription until recovery resolves it.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this change and nothing has yet established whether it did (a lost response, a timeout, a server error), or another request with this same preview is still dispatching it. Confirming again sends nothing; a genuinely unknown outcome holds the subscription until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the change and applied nothing, for example an invalid request. A failed proration payment is NOT a refusal: the change applies and the subscription moves to past_due. The refusal is recorded and the subscription is free again; request a new preview.', errorCode: 'billing_plan_change_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s items changed after the provider applied the change. The local write is refused so the applied change is not discarded, and the change stays owed to recovery.', errorCode: 'billing_plan_change_subscription_items_changed' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider applied the change but its answer does not identify the plan item it created (a subscription that had no plan item). The local write is refused rather than recording an item nothing can target later; the change stays applied, confirming again sends nothing, and it is owed to recovery.', errorCode: 'billing_created_provider_item_unresolved' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished — for example another request with the same preview completed it first. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the change was admitted, so a change admitted against the old identity is not applied to the new one. If the provider had already applied the change, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`newPriceId` names a price whose `productId` is not `newProductKey`’s product. The two are caller-supplied independently, and the provider is billed the PRICE while entitlements derive from the PRODUCT recorded on the item — so an unmatched pair would grant one plan’s entitlements at another plan’s price.', customMessageReference: ErrorCustomMessageReference.BILLING_PRICE_PRODUCT_MISMATCH },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to change the plan (a HIGH-risk commercial action).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id, or the target product/price is not in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The requested price is incompatible with the current subscription.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`newProductKey` (or the price named by `newPriceId`) has been RETIRED from the code catalogue. A subscription may not be MOVED ONTO a retired product; a subscription already on one keeps running, and REMOVE_ADDON deliberately still works so a customer is never trapped on a withdrawn add-on.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_RETIRED },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`newProductKey` is announced but not yet on sale (catalogue `availability` UPCOMING). A subscription may not be moved onto it until the catalogue puts it on sale.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_NOT_YET_AVAILABLE },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The new plan defers the change to the end of the period, and the subscription ends then: a cancellation is pending. Resume the subscription first. Refused before anything is sent.', errorCode: 'billing_plan_change_subscription_pending_cancellation' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The new plan defers the change to the end of the period, and the lines the subscription would then carry do not share one recurring billing interval (a yearly add-on beside a monthly plan): a deferred change is one provider phase, billed on one interval. Remove the add-on whose interval differs, or choose a price on the same interval. Refused before anything is sent.', errorCode: 'billing_plan_change_billing_interval_mismatch' },\n ],\n // One preview is at most one commercial change (#535): its generation is admitted once, the provider is sent the\n // change once under a store-owned key, and a replay after commit answers the subscription's CURRENT state with no\n // second call or effect. Bounded by the preview token's validity (10 minutes); a replay while the outcome is\n // unknown is refused rather than re-sent.\n idempotent: true,\n examples: [{\n title: 'Upgrade from Team to Business',\n request: { newProductKey: 'business_plan', newPriceId: 'price_business_monthly', previewToken: '<previewToken returned by preview-plan-change>' },\n response: {\n ...subscriptionExample,\n items: [{\n _id: 'subscription_item_business_01HX2EXAMPLE',\n productId: 'product_business_plan',\n priceId: 'price_business_monthly',\n quantity: 1,\n }],\n updatedAt: '2026-06-22T11:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }, {\n title: 'Downgrade from Business to Team at the end of the period',\n request: { newProductKey: 'team_plan', newPriceId: 'price_team_monthly', previewToken: '<previewToken returned by preview-plan-change>' },\n response: {\n ...subscriptionExample,\n pendingPlanChange: {\n productId: 'product_team_plan',\n priceId: 'price_team_monthly',\n effectiveAt: subscriptionExample.currentPeriodEnd,\n items: [{ _id: 'subscription_item_team_01HX2EXAMPLE', productId: 'product_team_plan', priceId: 'price_team_monthly', quantity: 1 }],\n },\n updatedAt: '2026-06-22T11:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.ADD_ADDON]: {\n operationId: BillingSubscription_Operations.ADD_ADDON,\n purpose: 'Attach an add-on line item to the subscription.',\n outcome: 'The provider is sent the subscription’s lines plus one new line correlated by a backend-generated key, and the items array gains that entry with its provider-confirmed item ID. Every request must carry an Idempotency-Key: adding an add-on that is already attached adds another line and another charge, so a retry after a lost response has to be recognizable as the same request. A request without one is refused before anything is admitted.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The add-on line item was confirmed by the provider and appended to the subscription’s items array. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'An existing subscription item has no recorded provider item ID. Repair the missing provider identity before changing items; routine status reconciliation does not repair item IDs. The request is refused before provider mutation.', errorCode: 'billing_existing_provider_item_missing' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider applied the add-on but its answer does not identify the item it created. The local write is refused rather than recording an item nothing can target later; the add-on stays applied, asking again sends nothing, and it is owed to recovery.', errorCode: 'billing_created_provider_item_unresolved' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `addonProductKey` / `priceId` is missing or fails request-DTO validation.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`addonProductKey` identifies a product that is not an ADDON.', customMessageReference: ErrorCustomMessageReference.BILLING_INVALID_PRODUCT_TYPE },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`priceId` names a price whose `productId` is not the add-on product’s. Same split as CHANGE_PLAN: the provider bills the price, the item records the product, and entitlements follow the product.', customMessageReference: ErrorCustomMessageReference.BILLING_PRICE_PRODUCT_MISMATCH },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The add-on requires a plan tier the subscription’s plan does not have. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.BILLING_PLAN_TIER_REQUIRED },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to add an add-on (a HIGH-risk commercial action).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id, or the add-on product is not in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`addonProductKey` (or the price named by `priceId`) has been RETIRED from the code catalogue and may no longer be bought.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_RETIRED },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`addonProductKey` is announced but not yet on sale (catalogue `availability` UPCOMING) and may not be bought yet.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_NOT_YET_AVAILABLE },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later with the same key.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this add-on and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the add-on and applied nothing. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the add-on was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s items changed after the provider applied the add-on, so writing the items it was computed against would discard that change. The add-on stays applied and the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_items_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent per key (#535 S5b). The key is REQUIRED: a repeat with it replays the committed addition without contacting the\n // provider, and the same key with a different request is refused 422. Without the key there is nothing to replay, so the\n // request is refused rather than admitted as a second addition.\n idempotent: true,\n examples: [{\n title: 'Add the audit-retention add-on',\n request: { addonProductKey: 'audit_retention', priceId: 'price_audit_retention_monthly' },\n response: {\n ...subscriptionExample,\n items: [\n baseItem,\n {\n _id: 'subscription_item_audit_01HX2EXAMPLE',\n productId: 'product_audit_retention',\n priceId: 'price_audit_retention_monthly',\n quantity: 1,\n },\n ],\n updatedAt: '2026-06-23T08:30:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingSubscription_Operations.REMOVE_ADDON]: {\n operationId: BillingSubscription_Operations.REMOVE_ADDON,\n purpose: 'Remove the named add-on through explicit provider item deletion.',\n outcome: 'All entries of the named add-on are explicitly deleted by their recorded provider item IDs before the local items array shrinks. The plan and unrelated add-ons are unchanged; missing provider item IDs refuse the operation before mutation. Every request must carry an Idempotency-Key: a repeat after the removal committed no longer finds the add-on, so only the key lets a retry after a lost response learn that its removal succeeded.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The add-on line item was removed at the provider and dropped from the subscription’s items array. A repeat with the same Idempotency-Key after it committed answers the subscription as it is now, without contacting the provider again.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `addonProductKey` is missing or fails request-DTO validation.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`addonProductKey` identifies a product that is not an ADDON.', customMessageReference: ErrorCustomMessageReference.BILLING_INVALID_PRODUCT_TYPE },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-owner/org-admin role required to remove an add-on (a HIGH-risk commercial action).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No subscription exists for the supplied id, or the named add-on is not present on the subscription.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A matching add-on entry has no recorded provider subscription-item ID, so the deletion cannot be targeted safely.', errorCode: 'billing_addon_provider_item_missing' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another change holds this subscription’s mutation slot, or this same request (the same Idempotency-Key) is still running. Nothing was sent to the provider by this request; retry later with the same key.', errorCode: 'billing_subscription_mutation_in_progress' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider may have applied this removal and nothing has yet established whether it did (a lost response, a timeout, a server error). Asking again sends nothing; the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_outcome_unknown' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The provider refused the removal and applied nothing. The refusal is recorded and the subscription is free again.', errorCode: 'billing_subscription_mutation_provider_rejected' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A plan change is pending at the end of the period. Withdraw it with cancel-plan-change first; one pending change at a time, so the provider’s schedule and the subscription can never describe two different futures. Refused before anything is admitted or sent.', errorCode: 'billing_subscription_plan_change_pending' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'This request’s hold on the subscription’s mutation generation was taken over before it finished. Nothing was sent twice.', errorCode: 'billing_subscription_mutation_claim_lost' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s billing account or provider identity changed since its mutation slot was created, or since the removal was admitted. If the provider had already applied it, it stays owed to recovery.', errorCode: 'billing_subscription_mutation_slot_identity_changed' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The subscription’s items changed after the provider applied the removal, so writing the items it was computed against would discard that change. The removal stays applied and the subscription is held until recovery resolves it.', errorCode: 'billing_subscription_mutation_items_changed' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The Idempotency-Key was already used for a DIFFERENT request to this operation — another actor, or other request values. Nothing is sent or replayed; use a new key for a new request. A 422 carries no `error.code`: branch on its `customMessageReference`.', customMessageReference: ErrorCustomMessageReference.IDEMPOTENCY_KEY_REUSED },\n ],\n // Idempotent per key (#535 S5b). The key is REQUIRED: a repeat with it replays the committed removal without contacting the\n // provider, and the same key with a different request is refused 422.\n idempotent: true,\n examples: [{\n title: 'Remove the audit-retention add-on',\n request: { addonProductKey: 'audit_retention' },\n response: {\n ...subscriptionExample,\n items: [baseItem],\n updatedAt: '2026-06-24T08:30:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'The `discounts` list, `trialStart` and `trialEnd` are copied from the billing provider on every provider event and by the reconciliation sweep, and are cleared when the provider no longer holds them. They are read-only. `discounts` holds every discount the provider applies, in the order it applies them: a referral reward added beside a checkout promotion is a second entry, and both are charged.',\n ],\n }),\n { resourcePrimaryScope: subResourcePrimaryScopeByResourceType[resourceType] },\n );\n}\n\nfunction buildSubscriptionSpec(resourceType: SubResourceType, memberName: SubResourceTypeMember) {\n const base = buildSubscriptionBase(resourceType, memberName);\n const main = resolveSubUI(billingMainPresets as Partial<Record<string, unknown>>, resourceType, 'billingMainPresets');\n const admin = resolveSubUI(billingAdminPresets as Partial<Record<string, unknown>>, resourceType, 'billingAdminPresets');\n return resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)),\n base,\n () => ({\n label: { purpose: 'Preset uses `status` string for a compact row label in subscription lists.' },\n layout: {\n purpose: 'Inline summary template in billing presets (no `refs.sections`) shows status, cancel-at-period-end, period end, trial end, and billing-account id — child resources appear in parent billing-account tabs via `variantOverrides`.',\n displayPurpose: 'Self-serve “current plan” and org admin subscription management.',\n },\n views: {\n [BillingSubscription_Operations.CANCEL]: { purpose: 'Custom op host; entries are not addressable routes in merged `billing` presets but operations exist for action buttons.', whenToUse: 'Cancel plan flow in product UI.' },\n [BillingSubscription_Operations.RESUME]: { purpose: 'Resume before period end when user changes mind.', whenToUse: 'Reverse a scheduled cancel.' },\n [BillingSubscription_Operations.CHANGE_PLAN]: { purpose: 'Plan migration host for upgrade/downgrade UX.', whenToUse: 'When catalog offers multiple prices for the same product line.' },\n [BillingSubscription_Operations.ADD_ADDON]: { purpose: 'Attach add-on SKUs to the active subscription.', whenToUse: 'When add-on products exist in the catalog.' },\n [BillingSubscription_Operations.REMOVE_ADDON]: { purpose: 'Detach an add-on line item.', whenToUse: 'When seat-based or feature add-ons can be removed mid-cycle per policy.' },\n [BillingSubscription_Operations.CANCEL_PLAN_CHANGE]: { purpose: 'Withdraw a plan change pending at the end of the period.', whenToUse: 'When the customer changes their mind about a scheduled downgrade before renewal.' },\n },\n }),\n );\n}\n\nexport const organizationSubscriptionsResourceSpecification = buildSubscriptionSpec(\n CoreResourceType.ORGANIZATION_SUBSCRIPTIONS,\n 'ORGANIZATION_SUBSCRIPTIONS',\n);\n\nexport const userSubscriptionsResourceSpecification = buildSubscriptionSpec(CoreResourceType.USER_SUBSCRIPTIONS, 'USER_SUBSCRIPTIONS');\n"]}
|