@wildo-ai/saas-specifications 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts +10 -8
- 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 +14 -13
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts +3 -2
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js +4 -3
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/index.d.ts +31 -15
- package/dist/esm/_catalogs/schema-org/index.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/index.js +34 -13
- package/dist/esm/_catalogs/schema-org/index.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.d.ts +2 -2
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.js +4 -4
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts +45 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts.map +1 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js +58 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js.map +1 -0
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts +3 -2
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts.map +1 -1
- package/dist/esm/_core/application-specification-family-identity.schemas.js +3 -2
- package/dist/esm/_core/application-specification-family-identity.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts +18 -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 +39 -13
- 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 +43 -13
- 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 +90 -2
- 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 +70 -6
- 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.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +26 -4
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/business-semantics.specifications.schemas.d.ts +14 -0
- package/dist/esm/_core/business-semantics.specifications.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-semantics.specifications.schemas.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.js +1 -0
- package/dist/esm/_core/capability-composition/capability-composition-validation.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts +21 -2
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js +20 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +11 -32
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +70 -3
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts +142 -17
- 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 +285 -30
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +183 -18
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js +165 -18
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts +139 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js +172 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts +306 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.js +502 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts +107 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js +118 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts +56 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js +100 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js.map +1 -0
- package/dist/esm/_core/composite-view-specification.schemas.js +8 -1
- package/dist/esm/_core/composite-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +3 -2
- 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 +3 -2
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts +16 -3
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js +70 -5
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js.map +1 -1
- package/dist/esm/_core/family-aspects.schemas.d.ts +10 -0
- package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -1
- 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 +2 -2
- package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts +1 -0
- package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts.map +1 -1
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts +16 -0
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js +8 -0
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js.map +1 -1
- package/dist/esm/_core/index.d.ts +3 -0
- package/dist/esm/_core/index.d.ts.map +1 -1
- package/dist/esm/_core/index.js +3 -0
- package/dist/esm/_core/index.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +5 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +3 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.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 +12 -2
- 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 +30 -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 +32 -2
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/market/feature-benefit.schemas.js +2 -2
- package/dist/esm/_core/market/feature-benefit.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-alternative.schemas.js +2 -2
- package/dist/esm/_core/market/market-alternative.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-buying-journey.schemas.js +2 -2
- package/dist/esm/_core/market/market-buying-journey.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-category.schemas.js +2 -2
- package/dist/esm/_core/market/market-category.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-channel.schemas.js +2 -2
- package/dist/esm/_core/market/market-channel.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-gain.schemas.js +2 -2
- package/dist/esm/_core/market/market-gain.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-icp.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-icp.schemas.js +2 -2
- package/dist/esm/_core/market/market-icp.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-job.schemas.js +2 -2
- package/dist/esm/_core/market/market-job.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-message-template.schemas.js +2 -2
- package/dist/esm/_core/market/market-message-template.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-objection.schemas.js +2 -2
- package/dist/esm/_core/market/market-objection.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-pain.schemas.js +2 -2
- package/dist/esm/_core/market/market-pain.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-persona.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-persona.schemas.js +2 -2
- package/dist/esm/_core/market/market-persona.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-positioning.schemas.js +2 -2
- package/dist/esm/_core/market/market-positioning.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-proof.schemas.js +2 -2
- package/dist/esm/_core/market/market-proof.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-references.schemas.d.ts +6 -0
- package/dist/esm/_core/market/market-references.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-references.schemas.js +6 -0
- package/dist/esm/_core/market/market-references.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +4 -4
- package/dist/esm/_core/market/market-tone-of-voice.schemas.js +2 -2
- package/dist/esm/_core/market/market-tone-of-voice.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-trigger.schemas.js +2 -2
- package/dist/esm/_core/market/market-trigger.schemas.js.map +1 -1
- package/dist/esm/_core/market/market.family-aspects.js +1 -1
- package/dist/esm/_core/market/market.family-aspects.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.js +6 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts +1 -0
- package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts.map +1 -1
- package/dist/esm/_core/requirements/functional-requirement.schemas.js +8 -0
- package/dist/esm/_core/requirements/functional-requirement.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts +1 -0
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.d.ts +86 -28
- package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.js +110 -24
- package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
- package/dist/esm/_core/utils/retention-clock-field-specs.d.ts +13 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.d.ts.map +1 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.js +26 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.js.map +1 -0
- package/dist/esm/_core/website-plan/website-plan.schemas.d.ts +31 -6
- package/dist/esm/_core/website-plan/website-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/website-plan/website-plan.schemas.js +35 -6
- package/dist/esm/_core/website-plan/website-plan.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts +142 -3
- 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 +148 -14
- 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 +70 -10
- 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 +98 -11
- 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 +215 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.js +253 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts +39 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js +37 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/journey.application-creation.schemas.d.ts +5 -49
- package/dist/esm/application-creation/journey.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/journey.application-creation.schemas.js +25 -60
- package/dist/esm/application-creation/journey.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts +28 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js +32 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +26 -6
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +28 -1
- package/dist/esm/application-creation/playbooks.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/__tests__/authority-evaluation-instant.fixture.d.ts +1 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js +1 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +24 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +75 -5
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +6 -0
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts +11 -0
- package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-blueprint-selection.js +22 -3
- package/dist/esm/assurance/assurance-document-blueprint-selection.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.js +39 -6
- package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts +11 -0
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.js +19 -0
- package/dist/esm/assurance/assurance-document-system.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 +295 -31
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-foundation.schemas.d.ts +7 -0
- package/dist/esm/assurance/assurance-foundation.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-foundation.schemas.js +7 -0
- package/dist/esm/assurance/assurance-foundation.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +17 -0
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +5 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.js +6 -3
- package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-program.family-aspects.js +1 -1
- package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.d.ts +232 -3
- package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.js +107 -14
- package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.js +77 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.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 +23 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/governed-document-release.d.ts +7 -0
- package/dist/esm/assurance/governed-document-release.d.ts.map +1 -1
- package/dist/esm/assurance/governed-document-release.js +11 -2
- package/dist/esm/assurance/governed-document-release.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +6 -5
- 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 -0
- 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 +35 -33
- 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 +6 -2
- 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.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +13 -12
- 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.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +26 -2
- 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.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.js +4 -4
- 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.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +11 -9
- 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.js +2 -2
- 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 -0
- 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 +45 -32
- 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 -23
- 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 +185 -31
- 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 +2 -1
- 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 +29 -7
- 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.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +7 -1
- 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.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +9 -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 +11 -7
- 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 +18 -16
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +9 -11
- package/dist/esm/engine/auth/resources/siem-export-config.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 +238 -219
- 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 +0 -24
- 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 +76 -16
- 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 +2 -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 +28 -6
- 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.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +29 -11
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js +1 -1
- package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +2 -0
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +13 -12
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +5 -5
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.js +12 -9
- package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.d.ts +7 -4
- package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js +36 -16
- package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js +13 -10
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts +13 -8
- package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js +54 -20
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +30 -4
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +85 -25
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +2 -2
- 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 +15 -2
- 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 +45 -10
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts +15 -2
- 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 +52 -12
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/index.d.ts +1 -0
- package/dist/esm/engine/compliance/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/index.js +1 -0
- package/dist/esm/engine/compliance/resources/index.js.map +1 -1
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts +39 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js +325 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js.map +1 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts +23 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js +197 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js.map +1 -0
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +59 -0
- 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 +69 -0
- package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts +5 -5
- package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.js +9 -10
- 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 +5 -5
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js +11 -11
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts +5 -5
- package/dist/esm/engine/features/resources/user-features.resource.specification.js +3 -3
- package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -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 +7 -8
- 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 +16 -4
- 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 +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts +11 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js +382 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +139 -1
- 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 +150 -4
- 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.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +9 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js +162 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js +158 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts +2 -1
- 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 +16 -9
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js +1 -1
- 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/decision/ai-approval-request.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js +3 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js.map +1 -1
- 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 +5 -4
- 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 +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js +1 -1
- 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/billing/billing-pricing-table.frontend-component.specification.js +2 -2
- 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/formatters/display-field-number.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.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 +1 -1
- 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/form/fields/form-field-address.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/index.d.ts +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/index.js +3 -0
- package/dist/esm/engine/frontend-components/index.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js +9 -4
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +4 -4
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +34 -0
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +26 -0
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js +122 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js +152 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts +10 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js +94 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts +10 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js +64 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts +4 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js +20 -16
- 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-run-records.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js +200 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js.map +1 -0
- 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 +19 -6
- 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 +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js +97 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts +8 -0
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts +2 -2
- 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/system-of-record-partition-assignments.resource.specification.js +4 -4
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js +153 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts +81 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js +437 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts +112 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js +287 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts +131 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +594 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/index.d.ts +1 -0
- package/dist/esm/engine/notifications/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/index.js +1 -0
- package/dist/esm/engine/notifications/resources/index.js.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts +6 -3
- 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 +20 -5
- 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.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +12 -2
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts +6 -6
- 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 +8 -11
- 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 +4 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js +62 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js.map +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts +2 -1
- package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/index.js +4 -2
- package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/index.d.ts +2 -0
- package/dist/esm/engine/organizations/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/index.js +2 -0
- package/dist/esm/engine/organizations/resources/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +3 -0
- 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 +40 -12
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +2 -2
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +2 -2
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts +0 -1
- 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 +4 -6
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +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 +7 -3
- 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.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +15 -8
- 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 +3 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +36 -21
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts +38 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js +152 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts +106 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js +417 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js.map +1 -0
- package/dist/esm/engine/providers/apple.provider.specification.js +1 -1
- package/dist/esm/engine/providers/apple.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/github.provider.specification.js +1 -1
- package/dist/esm/engine/providers/github.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/google-places.provider.specification.d.ts +6 -0
- package/dist/esm/engine/providers/google-places.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/google-places.provider.specification.js +44 -0
- package/dist/esm/engine/providers/google-places.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/google.provider.specification.js +1 -1
- package/dist/esm/engine/providers/google.provider.specification.js.map +1 -1
- 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.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/microsoft.provider.specification.js +10 -6
- package/dist/esm/engine/providers/microsoft.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts +6 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.js +38 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/resend.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/resend.provider.specification.js +3 -1
- package/dist/esm/engine/providers/resend.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/stripe.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/stripe.provider.specification.js +3 -2
- package/dist/esm/engine/providers/stripe.provider.specification.js.map +1 -1
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js +21 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js +21 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/index.d.ts +13 -5
- package/dist/esm/engine/roles/index.d.ts.map +1 -1
- package/dist/esm/engine/roles/index.js +19 -6
- package/dist/esm/engine/roles/index.js.map +1 -1
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js +21 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts +7 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js +72 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.js +22 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.js.map +1 -0
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +2 -2
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
- 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/self-service-user-notifications.shared.d.ts +1 -1
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js +3 -6
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js.map +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -2
- 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.js +2 -2
- 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 +0 -4
- 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 +0 -3
- 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 +0 -3
- 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 +7 -7
- 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 +5 -5
- 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 +0 -3
- 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 +11 -18
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +6 -6
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
- 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 +5 -1
- 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 +8 -5
- package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js +49 -16
- 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 +29 -10
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/dist/assurance/external-framework-mapping.json +0 -1228
|
@@ -143,9 +143,9 @@ function buildBillingAccountBase(resourceType, resourceTypeMemberName) {
|
|
|
143
143
|
{ code: HttpResponseStatusCode.CREATED_201, meaning: 'A billing account was provisioned for the scope (with its provider customer linked) and is returned with its server-assigned id.' },
|
|
144
144
|
],
|
|
145
145
|
errorScenarios: [
|
|
146
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The account payload fails schema validation (e.g. missing `providerRef`).'
|
|
146
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The account payload fails schema validation (e.g. missing `providerRef`).' },
|
|
147
147
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to provision a billing account in this scope.' },
|
|
148
|
-
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'A billing account already links this scope to the provider customer (the scope→customer link is unique).'
|
|
148
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'A billing account already links this scope to the provider customer (the scope→customer link is unique).' },
|
|
149
149
|
],
|
|
150
150
|
idempotent: false,
|
|
151
151
|
examples: [
|
|
@@ -174,7 +174,7 @@ function buildBillingAccountBase(resourceType, resourceTypeMemberName) {
|
|
|
174
174
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The account’s `metadata` / `isActive` fields were patched and the updated record is returned.' },
|
|
175
175
|
],
|
|
176
176
|
errorScenarios: [
|
|
177
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.'
|
|
177
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },
|
|
178
178
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to mutate this billing account.' },
|
|
179
179
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id in the caller’s scope.' },
|
|
180
180
|
],
|
|
@@ -189,7 +189,7 @@ function buildBillingAccountBase(resourceType, resourceTypeMemberName) {
|
|
|
189
189
|
errorScenarios: [
|
|
190
190
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the elevated entitlement required for billing-account off-boarding.' },
|
|
191
191
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id (or it was already removed).' },
|
|
192
|
-
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The account still has retained financial children — subscriptions, invoice refs, usage records, or credit pools — that reference it. Those rows survive scope and account deletion by design (billing-retention decision), and this account holds the only local `providerCustomerId` that maps them back to the provider customer, so the delete is refused before anything is written. Each blocking child resource is named in the error context (`blockingDependents`).',
|
|
192
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The account still has retained financial children — subscriptions, invoice refs, usage records, or credit pools — that reference it. Those rows survive scope and account deletion by design (billing-retention decision), and this account holds the only local `providerCustomerId` that maps them back to the provider customer, so the delete is refused before anything is written. Each blocking child resource is named in the error context (`blockingDependents`).', customMessageReference: ErrorCustomMessageReference.RESOURCE_HAS_DEPENDENTS },
|
|
193
193
|
],
|
|
194
194
|
idempotent: true,
|
|
195
195
|
},
|
|
@@ -201,13 +201,15 @@ function buildBillingAccountBase(resourceType, resourceTypeMemberName) {
|
|
|
201
201
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'A provider checkout session was created; the redirect URL / client secret to complete the purchase is returned.' },
|
|
202
202
|
],
|
|
203
203
|
errorScenarios: [
|
|
204
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The requested product/price is missing or malformed in the checkout request.'
|
|
205
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'A caller-supplied `metadata` key uses the framework-reserved `wildo_` namespace, or `quantity` is not an integer within the supported bound. Reserved keys are refused rather than dropped: that namespace carries the values the completion webhook reads back to decide which account is credited and by how much.'
|
|
206
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`priceId` names a price whose `productId` is not `productKey`’s product. The provider is billed the PRICE while the purchase is recorded against the PRODUCT, so an unmatched pair would deliver one product’s goods at another’s price.',
|
|
204
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The requested product/price is missing or malformed in the checkout request.' },
|
|
205
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'A caller-supplied `metadata` key uses the framework-reserved `wildo_` namespace, or `quantity` is not an integer within the supported bound. Reserved keys are refused rather than dropped: that namespace carries the values the completion webhook reads back to decide which account is credited and by how much.' },
|
|
206
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`priceId` names a price whose `productId` is not `productKey`’s product. The provider is billed the PRICE while the purchase is recorded against the PRODUCT, so an unmatched pair would deliver one product’s goods at another’s price.', customMessageReference: ErrorCustomMessageReference.BILLING_PRICE_PRODUCT_MISMATCH },
|
|
207
207
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not own this billing account and may not open checkout for it.' },
|
|
208
|
+
{ code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: '`quantity` is more than the product\'s `purchaseConfig.maxQuantityPerPurchase` allows in one purchase. The cap applies to one-time products (one-time, credit pack, item); a subscription product ignores it.', customMessageReference: ErrorCustomMessageReference.BILLING_PURCHASE_QUANTITY_EXCEEDS_LIMIT },
|
|
208
209
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id, or the referenced price is not in the catalog.' },
|
|
209
210
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The account is inactive or has no linked provider customer, so a checkout session cannot be opened.' },
|
|
210
|
-
{ code: HttpResponseStatusCode.CONFLICT_409, when: '`productKey` (or the price named by `priceId`) has been RETIRED — the product left the code catalogue and the catalogue sync soft-retired it. It still exists, and existing subscribers keep it, but it may no longer be bought: its entitlements are frozen at whatever the last sync wrote and nobody maintains them.',
|
|
211
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: '`productKey` (or the price named by `priceId`) has been RETIRED — the product left the code catalogue and the catalogue sync soft-retired it. It still exists, and existing subscribers keep it, but it may no longer be bought: its entitlements are frozen at whatever the last sync wrote and nobody maintains them.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_RETIRED },
|
|
212
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: '`productKey` is announced but not yet on sale — its catalogue `availability` is UPCOMING. Pricing surfaces list it so a visitor can see it coming; checkout refuses it until the catalogue puts it on sale.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_NOT_YET_AVAILABLE },
|
|
211
213
|
],
|
|
212
214
|
idempotent: false,
|
|
213
215
|
examples: [{
|
|
@@ -248,6 +250,21 @@ function buildBillingAccountBase(resourceType, resourceTypeMemberName) {
|
|
|
248
250
|
forStatus: HttpResponseStatusCode.OK_200,
|
|
249
251
|
}],
|
|
250
252
|
},
|
|
253
|
+
[BillingAccount_Operations.REDEEM_REFERRAL]: {
|
|
254
|
+
operationId: BillingAccount_Operations.REDEEM_REFERRAL,
|
|
255
|
+
purpose: 'Redeem a referral code for this account, as the new customer the referral brought in (#1802).',
|
|
256
|
+
outcome: 'The referral is ACCEPTED with this account as its referred side. The rewards are granted when this account pays its first invoice; a trial-extension reward lengthens the trial of every subscription checkout this account opens until then.',
|
|
257
|
+
responseStatuses: [
|
|
258
|
+
{ code: HttpResponseStatusCode.OK_200, meaning: 'The code was redeemed; the response names the referral and what this account receives.' },
|
|
259
|
+
],
|
|
260
|
+
errorScenarios: [
|
|
261
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`referralCode` is missing or empty.' },
|
|
262
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not own this billing account.' },
|
|
263
|
+
{ code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The code is unknown, expired, withdrawn or already used. Which one is not said, so codes cannot be probed.', customMessageReference: ErrorCustomMessageReference.BILLING_REFERRAL_CODE_INVALID },
|
|
264
|
+
{ code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'This account cannot be referred: it is the referrer\'s own, it has subscribed or paid before, or it already redeemed a code.', customMessageReference: ErrorCustomMessageReference.BILLING_REFERRAL_ACCOUNT_NOT_ELIGIBLE },
|
|
265
|
+
],
|
|
266
|
+
idempotent: false,
|
|
267
|
+
},
|
|
251
268
|
[BillingAccount_Operations.GET_STATE]: {
|
|
252
269
|
operationId: BillingAccount_Operations.GET_STATE,
|
|
253
270
|
purpose: 'Collection-scoped aggregate read of account + subscriptions + catalog slices for billing home widgets. The billing service auto-creates the scope’s account only after a successful lookup confirms absence.',
|
|
@@ -256,9 +273,9 @@ function buildBillingAccountBase(resourceType, resourceTypeMemberName) {
|
|
|
256
273
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The billing snapshot is returned with per-slice availability: healthy slices remain usable and unavailable slices must not be read as confirmed empty data.' },
|
|
257
274
|
],
|
|
258
275
|
errorScenarios: [
|
|
259
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The authenticated request context does not contain the scope identifier required to resolve billing state.'
|
|
276
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The authenticated request context does not contain the scope identifier required to resolve billing state.' },
|
|
260
277
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The requested scope does not match the caller’s authenticated scope.' },
|
|
261
|
-
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'Billing is not enabled for this scope type.',
|
|
278
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'Billing is not enabled for this scope type.', customMessageReference: ErrorCustomMessageReference.BILLING_SCOPE_NOT_ENABLED },
|
|
262
279
|
],
|
|
263
280
|
idempotent: true,
|
|
264
281
|
examples: [{
|
|
@@ -309,12 +326,13 @@ function buildBillingAccountResourceSpecification(resourceType, memberName) {
|
|
|
309
326
|
label: { purpose: 'Preset uses the Mongo id string as a compact label when the row is the anchor for self-serve and admin lists.' },
|
|
310
327
|
layout: {
|
|
311
328
|
purpose: 'Inline summary template (no named `layout.refs.sections` in billing presets) shows `isActive` and `_id`; `variantOverrides` wire subscription/invoice/usage/credit child tabs in org vs user parent views at different `orderIndex` values.',
|
|
312
|
-
displayPurpose: 'Not a public directory — org-owner/org-admin or user self-serve billing surfaces; LIST/READ are org-owner/org-admin-gated API operations, while writes (auto-create +
|
|
329
|
+
displayPurpose: 'Not a public directory — org-owner/org-admin or user self-serve billing surfaces; LIST/READ are org-owner/org-admin-gated API operations, while writes (auto-create + provider-event sync) stay internal service-pipeline ops, not HTTP-exposed. Provider events act with the handler-only `ORG_BILLING_PROVIDER_EVENTS` / `APP_BILLING_PROVIDER_EVENTS` role, which the LIST grant and the UPDATE that deactivates an account on `customer.deleted` name; READ does not.',
|
|
313
330
|
},
|
|
314
331
|
views: {
|
|
315
332
|
[BillingAccount_Operations.OPEN_CHECKOUT]: { purpose: 'Custom flow entry that behaves like a purchase wizard linked to the account.', whenToUse: '“Upgrade” or “Buy credits” in product UI when checkout is the next step.' },
|
|
316
333
|
[BillingAccount_Operations.OPEN_PORTAL]: { purpose: 'Custom flow entry for hosted portal; non-addressable `views` entry in merged presets (still documented as surfaced op).', whenToUse: '“Manage payment method / invoices” in settings.' },
|
|
317
334
|
[BillingAccount_Operations.GET_STATE]: { purpose: 'Aggregate “billing snapshot” for dashboards; not a CRUD read replacement.', whenToUse: 'Billing home that needs a denormalized bundle in one call.' },
|
|
335
|
+
[BillingAccount_Operations.REDEEM_REFERRAL]: { purpose: 'Action for entering a referral code on the account, non-addressable.', whenToUse: 'A new customer was given a code before their first purchase.' },
|
|
318
336
|
},
|
|
319
337
|
}));
|
|
320
338
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-accounts.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/billing-accounts.resource.specification.ts"],"names":[],"mappings":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,6BAA6B,CAAC,KAAK,CAAC,CAAC,EAC9G,IAAI,EACJ,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,EAAE,OAAO,EAAE,+GAA+G,EAAE;QACnI,MAAM,EAAE;YACN,OAAO,EAAE,6OAA6O;YACtP,cAAc,EAAE,2OAA2O;SAC5P;QACD,KAAK,EAAE;YACL,CAAC,yBAAyB,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,EAAE,8EAA8E,EAAE,SAAS,EAAE,0EAA0E,EAAE;YAC7N,CAAC,yBAAyB,CAAC,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE,yHAAyH,EAAE,SAAS,EAAE,iDAAiD,EAAE;YAC7O,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,4DAA4D,EAAE;SACzM;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,gDAAgD,GAAG,wCAAwC,CACtG,gBAAgB,CAAC,6BAA6B,EAC9C,+BAA+B,CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,wCAAwC,GAAG,wCAAwC,CAC9F,gBAAgB,CAAC,qBAAqB,EACtC,uBAAuB,CACxB,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 BillingAccount_Operations,\n BillingAccountBaseSchema,\n BillingSliceAvailability,\n BillingStateSlice,\n CoreResourceOperation as Op,\n CoreResourceType,\n ResourcePrimaryScope,\n billingAccountsPolymorphicFactories,\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 BillingAccountResourceType = CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS | CoreResourceType.USER_BILLING_ACCOUNTS;\ntype BillingAccountResourceTypeMember = 'ORGANIZATION_BILLING_ACCOUNTS' | 'USER_BILLING_ACCOUNTS';\n\nconst billingAccountResourcePrimaryScopeByResourceType: Record<BillingAccountResourceType, BillingApiReferenceExampleScope> = {\n [CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.USER_BILLING_ACCOUNTS]: ResourcePrimaryScope.USER_SELF,\n};\n\ntype Cfg = ReturnType<(typeof billingAccountsPolymorphicFactories)[CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS]>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof BillingAccountBaseSchema;\ntype BillAcctFrontend = ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nfunction resolveBillingAccountUI(\n source: Partial<Record<string, unknown>>,\n resourceType: BillingAccountResourceType,\n sourceName: string,\n): BillAcctFrontend {\n const uiBehavior = source[resourceType] as BillAcctFrontend | undefined;\n if (!uiBehavior) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return uiBehavior;\n}\n\nfunction buildBillingAccountBase(\n resourceType: BillingAccountResourceType,\n resourceTypeMemberName: BillingAccountResourceTypeMember,\n) {\n const exampleScope = createBillingApiReferenceScopeExample(\n billingAccountResourcePrimaryScopeByResourceType[resourceType],\n );\n const billingAccountExample = {\n _id: exampleScope.billingAccountId,\n isActive: true,\n metadata: { costCentre: 'customer-success' },\n createdAt: '2026-06-01T09:00:00.000Z',\n updatedAt: '2026-06-18T14:30:00.000Z',\n ...exampleScope.scopeIdentity,\n };\n const billingAccountSummaryExample = {\n _id: billingAccountExample._id,\n isActive: billingAccountExample.isActive,\n };\n\n return resourceSpecification<Custom, Core, Main>(\n billingAccountsPolymorphicFactories[resourceType],\n BillingAccountBaseSchema,\n ({ schemaShape }) => ({\n purpose:\n `Billing account for ${exampleScope.scopeLabel === 'organization' ? 'an organization' : 'a user'}: exposes activation state and safe metadata, and provides the entry point for checkout, the billing portal, and aggregated billing state.`,\n businessRole: 'Anchor row for subscriptions, invoices, credit pools, and self-serve `OPEN_CHECKOUT` / `OPEN_PORTAL` flows in user/org billing settings.',\n lifecycleRole:\n 'Created automatically the first time billing state is requested, then synchronized from billing-provider events. An inactive account remains readable for billing history but cannot start a new checkout or portal session. There is no client-facing create operation.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'BillingAccountBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'billingAccountsPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: {\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n memberName: resourceTypeMemberName,\n },\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: 'BillingAccount_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 variants under `BILLING_SCOPE_VARIANTS` — org primary catalog scope is `ORGANIZATIONS`; user row is `USER_SELF`.'],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Document id in Mongo for this billing account record.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether the account should participate in new purchases and portal sessions.', importance: FieldSemanticImportance.PRIMARY }),\n providerRef: schemaShape.providerRef.stringSpec({ meaning: 'Which billing adapter integration backs this account (e.g. stripe) — backend-only in typical responses.', whyItMatters: 'Drives which SDK and webhook namespace hydrate the row.' }),\n providerCustomerId: schemaShape.providerCustomerId.stringSpec({ meaning: 'Provider-side customer id; master link for subscription and invoice fetch.', whyItMatters: 'Without it the row cannot call provider APIs for portal or state.', importance: FieldSemanticImportance.PRIMARY }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Key/value tags mirrored to the provider for analytics or tax hints — not the full address book.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the record was first created.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last backend sync with provider or local patch.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Load the account row and derived UI flags for settings surfaces.',\n outcome: 'Owner sees the account id, activation state, and non-sensitive metadata needed for support correlation. Provider customer identifiers remain backend-only.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The billing account was found and its public id, activation state, and metadata are returned. Backend-only provider identifiers are omitted.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n examples: [{\n title: `Inspect an active ${exampleScope.scopeLabel} billing account`,\n response: billingAccountExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect the billing account with available relationship context',\n response: billingAccountExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact billing-account summary',\n response: billingAccountSummaryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List billing account rows in org or user scope (often singleton).',\n outcome: 'Picker or table for rare multi-account orgs in admin.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty, often singleton) page of billing accounts for the scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse billing accounts for the current scope',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([billingAccountExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse billing accounts with relationship context',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([billingAccountExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact billing-account summaries',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([billingAccountSummaryExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.CREATE]: {\n purpose: 'System-context bootstrap when a scope first needs a billing account: auto-created in-process by the billing service (INTERNAL_CALL, no HTTP surface) through the `systemAccessPolicy.create` opt-in, which injects the scope FK via the execution context map.',\n outcome: 'New row for the scope after provider customer linkage in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A billing account was provisioned for the scope (with its provider customer linked) and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The account payload fails schema validation (e.g. missing `providerRef`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to provision a billing account in this scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A billing account already links this scope to the provider customer (the scope→customer link is unique).', errorCode: 'BILLING_ACCOUNT_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Provision a Stripe-backed billing account for a scope',\n request: {\n providerRef: 'stripe',\n providerCustomerId: 'cus_01HX2…',\n isActive: true,\n metadata: { tier: 'pro' },\n },\n response: {\n _id: 'billacct_01HX2…',\n providerRef: 'stripe',\n providerCustomerId: 'cus_01HX2…',\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Metadata or activation toggles; heavy provider writes often go through webhooks or custom ops instead.',\n outcome: 'Patched `metadata` or `isActive` per DTO in factory config.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The account’s `metadata` / `isActive` fields were patched and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to mutate this billing account.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Dangerous off-boarding: in-process hard removal of the account row (INTERNAL_CALL, no HTTP surface). The product off-boarding path is the soft retire (`isActive: false`), not this.',\n outcome: 'Row removed — but only once the account has no retained financial children left. The dependents check is enforced by the engine before the delete, not left to the caller.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The billing account had no retained financial children and was removed; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the elevated entitlement required for billing-account off-boarding.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id (or it was already removed).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The account still has retained financial children — subscriptions, invoice refs, usage records, or credit pools — that reference it. Those rows survive scope and account deletion by design (billing-retention decision), and this account holds the only local `providerCustomerId` that maps them back to the provider customer, so the delete is refused before anything is written. Each blocking child resource is named in the error context (`blockingDependents`).', errorCode: ErrorCustomMessageReference.RESOURCE_HAS_DEPENDENTS },\n ],\n idempotent: true,\n },\n [BillingAccount_Operations.OPEN_CHECKOUT]: {\n operationId: BillingAccount_Operations.OPEN_CHECKOUT,\n purpose: 'Start a hosted checkout session (product+price) for the connected customer. Trial duration comes from the server-owned product policy or application default, never from payer input.',\n outcome: 'Redirect URL or client secret to complete purchase in the provider UI.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A provider checkout session was created; the redirect URL / client secret to complete the purchase is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The requested product/price is missing or malformed in the checkout request.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'A caller-supplied `metadata` key uses the framework-reserved `wildo_` namespace, or `quantity` is not an integer within the supported bound. Reserved keys are refused rather than dropped: that namespace carries the values the completion webhook reads back to decide which account is credited and by how much.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`priceId` names a price whose `productId` is not `productKey`’s product. The provider is billed the PRICE while the purchase is recorded against the PRODUCT, so an unmatched pair would deliver one product’s goods at another’s price.', errorCode: 'BILLING_PRICE_PRODUCT_MISMATCH' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not own this billing account and may not open checkout for it.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id, or the referenced price is not in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The account is inactive or has no linked provider customer, so a checkout session cannot be opened.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`productKey` (or the price named by `priceId`) has been RETIRED — the product left the code catalogue and the catalogue sync soft-retired it. It still exists, and existing subscribers keep it, but it may no longer be bought: its entitlements are frozen at whatever the last sync wrote and nobody maintains them.', errorCode: 'BILLING_PRODUCT_RETIRED' },\n ],\n idempotent: false,\n examples: [{\n title: 'Open checkout for the Pro plan',\n request: {\n productKey: 'pro_plan',\n priceId: 'price_pro_monthly',\n successUrl: 'https://app.example.test/settings/billing?checkout=success',\n cancelUrl: 'https://app.example.test/settings/billing?checkout=cancelled',\n quantity: 25,\n promotionCode: 'WELCOME20',\n metadata: { campaign: 'customer-expansion' },\n },\n response: {\n url: 'https://billing.example.test/checkout/cs_01HX2EXAMPLE',\n sessionId: 'cs_01HX2EXAMPLE',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingAccount_Operations.OPEN_PORTAL]: {\n operationId: BillingAccount_Operations.OPEN_PORTAL,\n purpose: 'Open the provider customer portal (payment methods, cancel at period end) with a return URL.',\n outcome: 'Session URL for self-serve management.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A provider customer-portal session was created; its session URL is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not own this billing account and may not open its portal.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The account has no linked provider customer, so a portal session cannot be opened.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Open the hosted billing portal',\n request: { returnUrl: 'https://app.example.test/settings/billing' },\n response: { url: 'https://billing.example.test/portal/bps_01HX2EXAMPLE' },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingAccount_Operations.GET_STATE]: {\n operationId: BillingAccount_Operations.GET_STATE,\n purpose: 'Collection-scoped aggregate read of account + subscriptions + catalog slices for billing home widgets. The billing service auto-creates the scope’s account only after a successful lookup confirms absence.',\n outcome: 'Convenience bundle for a single call instead of N reads in the client; the absence of an existing account is a bootstrap condition, not a 404.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The billing snapshot is returned with per-slice availability: healthy slices remain usable and unavailable slices must not be read as confirmed empty data.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The authenticated request context does not contain the scope identifier required to resolve billing state.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The requested scope does not match the caller’s authenticated scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Billing is not enabled for this scope type.', errorCode: 'BILLING_SCOPE_NOT_ENABLED' },\n ],\n idempotent: true,\n examples: [{\n title: 'Load the billing home state before a subscription exists',\n response: {\n billingAccount: {\n _id: billingAccountExample._id,\n isActive: true,\n createdAt: billingAccountExample.createdAt,\n updatedAt: billingAccountExample.updatedAt,\n },\n availability: {\n [BillingStateSlice.BILLING_ACCOUNT]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.SUBSCRIPTION]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.PRODUCTS]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.PRICES]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.INVOICES]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.USAGE]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.CREDIT_POOLS]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.ACTIVE_PROMOTIONS]: BillingSliceAvailability.AVAILABLE,\n },\n subscription: null,\n products: [],\n prices: [],\n invoices: [],\n usage: { byProduct: {} },\n creditPools: {},\n activePromotions: [],\n scopeType: exampleScope.scopeType,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'Contact, tax, and payment instruments live in the provider — do not expect them duplicated on this document.',\n 'Checkout-session metadata is split by trust: keys prefixed `wildo_` are framework-authoritative (they are what the signed completion webhook reads back to credit an account), and caller-supplied keys in that namespace are refused at the request DTO. A provider signature proves the provider sent the echoed metadata, never that the framework wrote it, so the completion handler re-derives the billing account from the provider CUSTOMER and only cross-checks the echoed value.',\n 'Polymorphic scope FKs (`organizationId` / `userId`) are injected on concrete variant schemas, not on `BillingAccountBaseSchema` itself.',\n 'The account outlives its scope: deleting the owning org or user does NOT cascade to this row, and its financial children (subscriptions, invoice refs, usage records, credit pools) are retained too. Consequently a hard DELETE is refused with 409 while any of those children remain — this row carries the only local `providerCustomerId`, so removing it would leave the retained financial records unreconcilable against the provider.',\n ],\n }),\n { resourcePrimaryScope: billingAccountResourcePrimaryScopeByResourceType[resourceType] },\n );\n}\n\nfunction buildBillingAccountResourceSpecification(\n resourceType: BillingAccountResourceType,\n memberName: BillingAccountResourceTypeMember,\n) {\n const base = buildBillingAccountBase(resourceType, memberName);\n const main = resolveBillingAccountUI(billingMainPresets as Partial<Record<string, unknown>>, resourceType, 'billingMainPresets');\n const admin = resolveBillingAccountUI(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 the Mongo id string as a compact label when the row is the anchor for self-serve and admin lists.' },\n layout: {\n purpose: 'Inline summary template (no named `layout.refs.sections` in billing presets) shows `isActive` and `_id`; `variantOverrides` wire subscription/invoice/usage/credit child tabs in org vs user parent views at different `orderIndex` values.',\n displayPurpose: 'Not a public directory — org-owner/org-admin or user self-serve billing surfaces; LIST/READ are org-owner/org-admin-gated API operations, while writes (auto-create + webhook sync) stay internal service-pipeline ops, not HTTP-exposed.',\n },\n views: {\n [BillingAccount_Operations.OPEN_CHECKOUT]: { purpose: 'Custom flow entry that behaves like a purchase wizard linked to the account.', whenToUse: '“Upgrade” or “Buy credits” in product UI when checkout is the next step.' },\n [BillingAccount_Operations.OPEN_PORTAL]: { purpose: 'Custom flow entry for hosted portal; non-addressable `views` entry in merged presets (still documented as surfaced op).', whenToUse: '“Manage payment method / invoices” in settings.' },\n [BillingAccount_Operations.GET_STATE]: { purpose: 'Aggregate “billing snapshot” for dashboards; not a CRUD read replacement.', whenToUse: 'Billing home that needs a denormalized bundle in one call.' },\n },\n }),\n );\n}\n\nexport const organizationBillingAccountsResourceSpecification = buildBillingAccountResourceSpecification(\n CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS,\n 'ORGANIZATION_BILLING_ACCOUNTS',\n);\n\nexport const userBillingAccountsResourceSpecification = buildBillingAccountResourceSpecification(\n CoreResourceType.USER_BILLING_ACCOUNTS,\n 'USER_BILLING_ACCOUNTS',\n);\n"]}
|
|
1
|
+
{"version":3,"file":"billing-accounts.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/billing-accounts.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,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,oBAAoB,EACpB,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM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BAAuB,CACxB,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 BillingAccount_Operations,\n BillingAccountBaseSchema,\n BillingSliceAvailability,\n BillingStateSlice,\n CoreResourceOperation as Op,\n CoreResourceType,\n ResourcePrimaryScope,\n billingAccountsPolymorphicFactories,\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 BillingAccountResourceType = CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS | CoreResourceType.USER_BILLING_ACCOUNTS;\ntype BillingAccountResourceTypeMember = 'ORGANIZATION_BILLING_ACCOUNTS' | 'USER_BILLING_ACCOUNTS';\n\nconst billingAccountResourcePrimaryScopeByResourceType: Record<BillingAccountResourceType, BillingApiReferenceExampleScope> = {\n [CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.USER_BILLING_ACCOUNTS]: ResourcePrimaryScope.USER_SELF,\n};\n\ntype Cfg = ReturnType<(typeof billingAccountsPolymorphicFactories)[CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS]>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof BillingAccountBaseSchema;\ntype BillAcctFrontend = ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nfunction resolveBillingAccountUI(\n source: Partial<Record<string, unknown>>,\n resourceType: BillingAccountResourceType,\n sourceName: string,\n): BillAcctFrontend {\n const uiBehavior = source[resourceType] as BillAcctFrontend | undefined;\n if (!uiBehavior) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return uiBehavior;\n}\n\nfunction buildBillingAccountBase(\n resourceType: BillingAccountResourceType,\n resourceTypeMemberName: BillingAccountResourceTypeMember,\n) {\n const exampleScope = createBillingApiReferenceScopeExample(\n billingAccountResourcePrimaryScopeByResourceType[resourceType],\n );\n const billingAccountExample = {\n _id: exampleScope.billingAccountId,\n isActive: true,\n metadata: { costCentre: 'customer-success' },\n createdAt: '2026-06-01T09:00:00.000Z',\n updatedAt: '2026-06-18T14:30:00.000Z',\n ...exampleScope.scopeIdentity,\n };\n const billingAccountSummaryExample = {\n _id: billingAccountExample._id,\n isActive: billingAccountExample.isActive,\n };\n\n return resourceSpecification<Custom, Core, Main>(\n billingAccountsPolymorphicFactories[resourceType],\n BillingAccountBaseSchema,\n ({ schemaShape }) => ({\n purpose:\n `Billing account for ${exampleScope.scopeLabel === 'organization' ? 'an organization' : 'a user'}: exposes activation state and safe metadata, and provides the entry point for checkout, the billing portal, and aggregated billing state.`,\n businessRole: 'Anchor row for subscriptions, invoices, credit pools, and self-serve `OPEN_CHECKOUT` / `OPEN_PORTAL` flows in user/org billing settings.',\n lifecycleRole:\n 'Created automatically the first time billing state is requested, then synchronized from billing-provider events. An inactive account remains readable for billing history but cannot start a new checkout or portal session. There is no client-facing create operation.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'BillingAccountBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'billingAccountsPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: {\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n memberName: resourceTypeMemberName,\n },\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: 'BillingAccount_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 variants under `BILLING_SCOPE_VARIANTS` — org primary catalog scope is `ORGANIZATIONS`; user row is `USER_SELF`.'],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Document id in Mongo for this billing account record.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether the account should participate in new purchases and portal sessions.', importance: FieldSemanticImportance.PRIMARY }),\n providerRef: schemaShape.providerRef.stringSpec({ meaning: 'Which billing adapter integration backs this account (e.g. stripe) — backend-only in typical responses.', whyItMatters: 'Drives which SDK and webhook namespace hydrate the row.' }),\n providerCustomerId: schemaShape.providerCustomerId.stringSpec({ meaning: 'Provider-side customer id; master link for subscription and invoice fetch.', whyItMatters: 'Without it the row cannot call provider APIs for portal or state.', importance: FieldSemanticImportance.PRIMARY }),\n metadata: schemaShape.metadata.objectSpec({ meaning: 'Key/value tags mirrored to the provider for analytics or tax hints — not the full address book.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the record was first created.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last backend sync with provider or local patch.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Load the account row and derived UI flags for settings surfaces.',\n outcome: 'Owner sees the account id, activation state, and non-sensitive metadata needed for support correlation. Provider customer identifiers remain backend-only.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The billing account was found and its public id, activation state, and metadata are returned. Backend-only provider identifiers are omitted.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n examples: [{\n title: `Inspect an active ${exampleScope.scopeLabel} billing account`,\n response: billingAccountExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect the billing account with available relationship context',\n response: billingAccountExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact billing-account summary',\n response: billingAccountSummaryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List billing account rows in org or user scope (often singleton).',\n outcome: 'Picker or table for rare multi-account orgs in admin.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty, often singleton) page of billing accounts for the scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse billing accounts for the current scope',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([billingAccountExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse billing accounts with relationship context',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([billingAccountExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact billing-account summaries',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([billingAccountSummaryExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.CREATE]: {\n purpose: 'System-context bootstrap when a scope first needs a billing account: auto-created in-process by the billing service (INTERNAL_CALL, no HTTP surface) through the `systemAccessPolicy.create` opt-in, which injects the scope FK via the execution context map.',\n outcome: 'New row for the scope after provider customer linkage in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A billing account was provisioned for the scope (with its provider customer linked) and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The account payload fails schema validation (e.g. missing `providerRef`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to provision a billing account in this scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A billing account already links this scope to the provider customer (the scope→customer link is unique).' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Provision a Stripe-backed billing account for a scope',\n request: {\n providerRef: 'stripe',\n providerCustomerId: 'cus_01HX2…',\n isActive: true,\n metadata: { tier: 'pro' },\n },\n response: {\n _id: 'billacct_01HX2…',\n providerRef: 'stripe',\n providerCustomerId: 'cus_01HX2…',\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Metadata or activation toggles; heavy provider writes often go through webhooks or custom ops instead.',\n outcome: 'Patched `metadata` or `isActive` per DTO in factory config.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The account’s `metadata` / `isActive` fields were patched and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to mutate this billing account.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Dangerous off-boarding: in-process hard removal of the account row (INTERNAL_CALL, no HTTP surface). The product off-boarding path is the soft retire (`isActive: false`), not this.',\n outcome: 'Row removed — but only once the account has no retained financial children left. The dependents check is enforced by the engine before the delete, not left to the caller.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The billing account had no retained financial children and was removed; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the elevated entitlement required for billing-account off-boarding.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id (or it was already removed).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The account still has retained financial children — subscriptions, invoice refs, usage records, or credit pools — that reference it. Those rows survive scope and account deletion by design (billing-retention decision), and this account holds the only local `providerCustomerId` that maps them back to the provider customer, so the delete is refused before anything is written. Each blocking child resource is named in the error context (`blockingDependents`).', customMessageReference: ErrorCustomMessageReference.RESOURCE_HAS_DEPENDENTS },\n ],\n idempotent: true,\n },\n [BillingAccount_Operations.OPEN_CHECKOUT]: {\n operationId: BillingAccount_Operations.OPEN_CHECKOUT,\n purpose: 'Start a hosted checkout session (product+price) for the connected customer. Trial duration comes from the server-owned product policy or application default, never from payer input.',\n outcome: 'Redirect URL or client secret to complete purchase in the provider UI.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A provider checkout session was created; the redirect URL / client secret to complete the purchase is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The requested product/price is missing or malformed in the checkout request.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'A caller-supplied `metadata` key uses the framework-reserved `wildo_` namespace, or `quantity` is not an integer within the supported bound. Reserved keys are refused rather than dropped: that namespace carries the values the completion webhook reads back to decide which account is credited and by how much.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`priceId` names a price whose `productId` is not `productKey`’s product. The provider is billed the PRICE while the purchase is recorded against the PRODUCT, so an unmatched pair would deliver one product’s goods at another’s price.', customMessageReference: ErrorCustomMessageReference.BILLING_PRICE_PRODUCT_MISMATCH },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not own this billing account and may not open checkout for it.' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: '`quantity` is more than the product\\'s `purchaseConfig.maxQuantityPerPurchase` allows in one purchase. The cap applies to one-time products (one-time, credit pack, item); a subscription product ignores it.', customMessageReference: ErrorCustomMessageReference.BILLING_PURCHASE_QUANTITY_EXCEEDS_LIMIT },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id, or the referenced price is not in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The account is inactive or has no linked provider customer, so a checkout session cannot be opened.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`productKey` (or the price named by `priceId`) has been RETIRED — the product left the code catalogue and the catalogue sync soft-retired it. It still exists, and existing subscribers keep it, but it may no longer be bought: its entitlements are frozen at whatever the last sync wrote and nobody maintains them.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_RETIRED },\n { code: HttpResponseStatusCode.CONFLICT_409, when: '`productKey` is announced but not yet on sale — its catalogue `availability` is UPCOMING. Pricing surfaces list it so a visitor can see it coming; checkout refuses it until the catalogue puts it on sale.', customMessageReference: ErrorCustomMessageReference.BILLING_PRODUCT_NOT_YET_AVAILABLE },\n ],\n idempotent: false,\n examples: [{\n title: 'Open checkout for the Pro plan',\n request: {\n productKey: 'pro_plan',\n priceId: 'price_pro_monthly',\n successUrl: 'https://app.example.test/settings/billing?checkout=success',\n cancelUrl: 'https://app.example.test/settings/billing?checkout=cancelled',\n quantity: 25,\n promotionCode: 'WELCOME20',\n metadata: { campaign: 'customer-expansion' },\n },\n response: {\n url: 'https://billing.example.test/checkout/cs_01HX2EXAMPLE',\n sessionId: 'cs_01HX2EXAMPLE',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingAccount_Operations.OPEN_PORTAL]: {\n operationId: BillingAccount_Operations.OPEN_PORTAL,\n purpose: 'Open the provider customer portal (payment methods, cancel at period end) with a return URL.',\n outcome: 'Session URL for self-serve management.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A provider customer-portal session was created; its session URL is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not own this billing account and may not open its portal.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No billing account exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The account has no linked provider customer, so a portal session cannot be opened.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Open the hosted billing portal',\n request: { returnUrl: 'https://app.example.test/settings/billing' },\n response: { url: 'https://billing.example.test/portal/bps_01HX2EXAMPLE' },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [BillingAccount_Operations.REDEEM_REFERRAL]: {\n operationId: BillingAccount_Operations.REDEEM_REFERRAL,\n purpose: 'Redeem a referral code for this account, as the new customer the referral brought in (#1802).',\n outcome: 'The referral is ACCEPTED with this account as its referred side. The rewards are granted when this account pays its first invoice; a trial-extension reward lengthens the trial of every subscription checkout this account opens until then.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The code was redeemed; the response names the referral and what this account receives.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`referralCode` is missing or empty.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not own this billing account.' },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The code is unknown, expired, withdrawn or already used. Which one is not said, so codes cannot be probed.', customMessageReference: ErrorCustomMessageReference.BILLING_REFERRAL_CODE_INVALID },\n { code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'This account cannot be referred: it is the referrer\\'s own, it has subscribed or paid before, or it already redeemed a code.', customMessageReference: ErrorCustomMessageReference.BILLING_REFERRAL_ACCOUNT_NOT_ELIGIBLE },\n ],\n idempotent: false,\n },\n [BillingAccount_Operations.GET_STATE]: {\n operationId: BillingAccount_Operations.GET_STATE,\n purpose: 'Collection-scoped aggregate read of account + subscriptions + catalog slices for billing home widgets. The billing service auto-creates the scope’s account only after a successful lookup confirms absence.',\n outcome: 'Convenience bundle for a single call instead of N reads in the client; the absence of an existing account is a bootstrap condition, not a 404.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The billing snapshot is returned with per-slice availability: healthy slices remain usable and unavailable slices must not be read as confirmed empty data.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The authenticated request context does not contain the scope identifier required to resolve billing state.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The requested scope does not match the caller’s authenticated scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Billing is not enabled for this scope type.', customMessageReference: ErrorCustomMessageReference.BILLING_SCOPE_NOT_ENABLED },\n ],\n idempotent: true,\n examples: [{\n title: 'Load the billing home state before a subscription exists',\n response: {\n billingAccount: {\n _id: billingAccountExample._id,\n isActive: true,\n createdAt: billingAccountExample.createdAt,\n updatedAt: billingAccountExample.updatedAt,\n },\n availability: {\n [BillingStateSlice.BILLING_ACCOUNT]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.SUBSCRIPTION]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.PRODUCTS]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.PRICES]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.INVOICES]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.USAGE]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.CREDIT_POOLS]: BillingSliceAvailability.AVAILABLE,\n [BillingStateSlice.ACTIVE_PROMOTIONS]: BillingSliceAvailability.AVAILABLE,\n },\n subscription: null,\n products: [],\n prices: [],\n invoices: [],\n usage: { byProduct: {} },\n creditPools: {},\n activePromotions: [],\n scopeType: exampleScope.scopeType,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'Contact, tax, and payment instruments live in the provider — do not expect them duplicated on this document.',\n 'Checkout-session metadata is split by trust: keys prefixed `wildo_` are framework-authoritative (they are what the signed completion webhook reads back to credit an account), and caller-supplied keys in that namespace are refused at the request DTO. A provider signature proves the provider sent the echoed metadata, never that the framework wrote it, so the completion handler re-derives the billing account from the provider CUSTOMER and only cross-checks the echoed value.',\n 'Polymorphic scope FKs (`organizationId` / `userId`) are injected on concrete variant schemas, not on `BillingAccountBaseSchema` itself.',\n 'The account outlives its scope: deleting the owning org or user does NOT cascade to this row, and its financial children (subscriptions, invoice refs, usage records, credit pools) are retained too. Consequently a hard DELETE is refused with 409 while any of those children remain — this row carries the only local `providerCustomerId`, so removing it would leave the retained financial records unreconcilable against the provider.',\n ],\n }),\n { resourcePrimaryScope: billingAccountResourcePrimaryScopeByResourceType[resourceType] },\n );\n}\n\nfunction buildBillingAccountResourceSpecification(\n resourceType: BillingAccountResourceType,\n memberName: BillingAccountResourceTypeMember,\n) {\n const base = buildBillingAccountBase(resourceType, memberName);\n const main = resolveBillingAccountUI(billingMainPresets as Partial<Record<string, unknown>>, resourceType, 'billingMainPresets');\n const admin = resolveBillingAccountUI(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 the Mongo id string as a compact label when the row is the anchor for self-serve and admin lists.' },\n layout: {\n purpose: 'Inline summary template (no named `layout.refs.sections` in billing presets) shows `isActive` and `_id`; `variantOverrides` wire subscription/invoice/usage/credit child tabs in org vs user parent views at different `orderIndex` values.',\n displayPurpose: 'Not a public directory — org-owner/org-admin or user self-serve billing surfaces; LIST/READ are org-owner/org-admin-gated API operations, while writes (auto-create + provider-event sync) stay internal service-pipeline ops, not HTTP-exposed. Provider events act with the handler-only `ORG_BILLING_PROVIDER_EVENTS` / `APP_BILLING_PROVIDER_EVENTS` role, which the LIST grant and the UPDATE that deactivates an account on `customer.deleted` name; READ does not.',\n },\n views: {\n [BillingAccount_Operations.OPEN_CHECKOUT]: { purpose: 'Custom flow entry that behaves like a purchase wizard linked to the account.', whenToUse: '“Upgrade” or “Buy credits” in product UI when checkout is the next step.' },\n [BillingAccount_Operations.OPEN_PORTAL]: { purpose: 'Custom flow entry for hosted portal; non-addressable `views` entry in merged presets (still documented as surfaced op).', whenToUse: '“Manage payment method / invoices” in settings.' },\n [BillingAccount_Operations.GET_STATE]: { purpose: 'Aggregate “billing snapshot” for dashboards; not a CRUD read replacement.', whenToUse: 'Billing home that needs a denormalized bundle in one call.' },\n [BillingAccount_Operations.REDEEM_REFERRAL]: { purpose: 'Action for entering a referral code on the account, non-addressable.', whenToUse: 'A new customer was given a code before their first purchase.' },\n },\n }),\n );\n}\n\nexport const organizationBillingAccountsResourceSpecification = buildBillingAccountResourceSpecification(\n CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS,\n 'ORGANIZATION_BILLING_ACCOUNTS',\n);\n\nexport const userBillingAccountsResourceSpecification = buildBillingAccountResourceSpecification(\n CoreResourceType.USER_BILLING_ACCOUNTS,\n 'USER_BILLING_ACCOUNTS',\n);\n"]}
|
|
@@ -17,7 +17,7 @@ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
|
17
17
|
*/
|
|
18
18
|
export const billingProviderEventSettlementsResourceSpecification = resourceSpecification(settlementFactory, BillingProviderEventSettlementSchema, ({ schemaShape }) => ({
|
|
19
19
|
purpose: 'Record, once per money-affecting provider event, that its effect was claimed and applied, so a redelivered event can never grant the same money twice.',
|
|
20
|
-
businessRole: 'Durable
|
|
20
|
+
businessRole: 'Durable BUSINESS idempotency ledger shared by every backend replica: a retry delivered to another instance, after a restart, a replay, or long after the first delivery finds the settlement instead of repeating the grant. It sits behind the inbound delivery store, which stores each provider event once; this ledger makes the money effect happen once even when the same event is run again.',
|
|
21
21
|
lifecycleRole: 'Claimed when a handler starts applying an event, and marked applied when the money-affecting work completes. A claim left without an applied instant past its lease may be taken over by a later delivery of the same event.',
|
|
22
22
|
audience: LabelAudience.DEVELOPER,
|
|
23
23
|
subDomain: EngineResourceSubDomain.BILLING,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-provider-event-settlements.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/billing-provider-event-settlements.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,oCAAoC,EACpC,wCAAwC,EACxC,yEAAyE,IAAI,iBAAiB,GAC/F,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oDAAoD,GAAmC,qBAAqB,CACvH,iBAAiB,EACjB,oCAAoC,EACpC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,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AAC,EAAE;oBACnD,OAAO,EAAE,+DAA+D;iBACzE;aACF;SACF;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,2DAA2D;YACpE,OAAO,EAAE,8GAA8G;YACvH,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,6CAA6C,EAAE,CAAC;YACnH,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,YAAY,EAAE,IAAI,EAAE,wDAAwD,EAAE,CAAC;YAC/H,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE;gBACR,CAAC,wCAAwC,CAAC,QAAQ,CAAC,EAAE;oBACnD,OAAO,EAAE,sFAAsF;iBAChG;aACF;SACF;KACF;IAED,mBAAmB,EAAE;QACnB,oIAAoI;QACpI,oGAAoG;KACrG;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n BillingProviderEventSettlementSchema,\n BillingProviderEventSettlementVariantKey,\n billingProviderEventSettlementResourceConfiguration_InitializationFactory as settlementFactory,\n} from '@wildo-ai/saas-backend-lib/billing-models';\nimport { CoreResourceOperation as Op, ResourcePrimaryScope } from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the internal `billingProviderEventSettlements` resource — the durable idempotency ledger\n * for money-affecting billing webhook events.\n *\n * Authored 2026-09-15: the resource shipped on 2026-09-12 without a specification, which kept the engine sub-domain test's\n * \"every registered resource has a specification\" pin red. The runtime reasoning — why the claim is the primary key, and why\n * the lease window is measured against the provider's retry cadence — lives in the schema file's header and is not\n * restated here.\n *\n * Registry-key and type-annotation notes: identical situation to `dataSeedRuns` — see that spec's header.\n */\nexport const billingProviderEventSettlementsResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n settlementFactory,\n BillingProviderEventSettlementSchema,\n ({ schemaShape }) => ({\n purpose: 'Record, once per money-affecting provider event, that its effect was claimed and applied, so a redelivered event can never grant the same money twice.',\n businessRole: 'Durable webhook idempotency ledger shared by every backend replica: a retry delivered to another instance, after a restart, or long after the first delivery finds the settlement instead of repeating the grant.',\n lifecycleRole: 'Claimed when a handler starts applying an event, and marked applied when the money-affecting work completes. A claim left without an applied instant past its lease may be taken over by a later delivery of the same event.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'BillingProviderEventSettlementSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'billingProviderEventSettlementResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'BackendResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'BILLING_PROVIDER_EVENT_SETTLEMENTS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Identifier derived from the claim key.',\n whyItMatters: 'Two deliveries of the same provider event compute the same identifier, so the second claim collides at the store instead of granting twice.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n claimKey: schemaShape.claimKey.stringSpec({\n meaning: 'The claim in readable form: the event type and the checkout session or provider event it belongs to.',\n whyItMatters: 'It is what an operator filters on to answer whether a given session or event was already settled.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n eventType: schemaShape.eventType.stringSpec({\n meaning: 'The provider event type the claim was taken for.',\n }),\n claimedAt: schemaShape.claimedAt.dateSpec({\n meaning: 'When a handler took the claim, refreshed when a stale claim is taken over.',\n whyItMatters: 'It is the lease timestamp: an unapplied claim older than the lease window may be taken over by a later delivery.',\n }),\n appliedAt: schemaShape.appliedAt.dateSpec({\n meaning: 'When the money-affecting work completed. Empty while a handler still holds the claim.',\n whyItMatters: 'Its absence is what distinguishes a claim in flight, or abandoned by a crashed process, from a settled event.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Take the claim for a provider event before applying its effect.',\n outcome: 'Exactly one delivery of the event proceeds to apply it.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The claim was taken.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The event was already claimed; the delivery reads the existing settlement instead.' }],\n idempotent: false,\n variants: {\n [BillingProviderEventSettlementVariantKey.INTERNAL]: {\n purpose: 'Let the billing webhook router claim a money-affecting event.',\n },\n },\n },\n [Op.READ]: {\n purpose: 'Read an event\\'s settlement.',\n outcome: 'A delivery learns whether the event is settled, in flight, or abandoned past its lease.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The settlement was found and is returned.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The event was never claimed.' }],\n idempotent: true,\n variants: {\n [BillingProviderEventSettlementVariantKey.INTERNAL]: {\n purpose: 'Let the billing webhook router inspect a claim that collided.',\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Mark a claimed event applied, or take over a stale claim.',\n outcome: 'The ledger records that the grant happened, or hands an abandoned claim to the delivery that will finish it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The settlement was updated and is returned.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.CONFLICT_409, when: 'Another delivery settled or took over the claim first.' }],\n idempotent: false,\n variants: {\n [BillingProviderEventSettlementVariantKey.INTERNAL]: {\n purpose: 'Let the billing webhook router settle its own claim or take over one past its lease.',\n },\n },\n },\n },\n\n businessConstraints: [\n 'Money already granted cannot be un-granted by a later correction, so the suppression lives in a durable row every replica can see.',\n 'The ledger is not a webhook audit log: it records only what a second delivery must be able to ask.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"billing-provider-event-settlements.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/billing-provider-event-settlements.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,oCAAoC,EACpC,wCAAwC,EACxC,yEAAyE,IAAI,iBAAiB,GAC/F,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oDAAoD,GAAmC,qBAAqB,CACvH,iBAAiB,EACjB,oCAAoC,EACpC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,wJAAwJ;IACjK,YAAY,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AE,+DAA+D;iBACzE;aACF;SACF;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,2DAA2D;YACpE,OAAO,EAAE,8GAA8G;YACvH,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,6CAA6C,EAAE,CAAC;YACnH,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,YAAY,EAAE,IAAI,EAAE,wDAAwD,EAAE,CAAC;YAC/H,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE;gBACR,CAAC,wCAAwC,CAAC,QAAQ,CAAC,EAAE;oBACnD,OAAO,EAAE,sFAAsF;iBAChG;aACF;SACF;KACF;IAED,mBAAmB,EAAE;QACnB,oIAAoI;QACpI,oGAAoG;KACrG;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n BillingProviderEventSettlementSchema,\n BillingProviderEventSettlementVariantKey,\n billingProviderEventSettlementResourceConfiguration_InitializationFactory as settlementFactory,\n} from '@wildo-ai/saas-backend-lib/billing-models';\nimport { CoreResourceOperation as Op, ResourcePrimaryScope } from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the internal `billingProviderEventSettlements` resource — the durable idempotency ledger\n * for money-affecting billing webhook events.\n *\n * Authored 2026-09-15: the resource shipped on 2026-09-12 without a specification, which kept the engine sub-domain test's\n * \"every registered resource has a specification\" pin red. The runtime reasoning — why the claim is the primary key, and why\n * the lease window is measured against the provider's retry cadence — lives in the schema file's header and is not\n * restated here.\n *\n * Registry-key and type-annotation notes: identical situation to `dataSeedRuns` — see that spec's header.\n */\nexport const billingProviderEventSettlementsResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n settlementFactory,\n BillingProviderEventSettlementSchema,\n ({ schemaShape }) => ({\n purpose: 'Record, once per money-affecting provider event, that its effect was claimed and applied, so a redelivered event can never grant the same money twice.',\n businessRole: 'Durable BUSINESS idempotency ledger shared by every backend replica: a retry delivered to another instance, after a restart, a replay, or long after the first delivery finds the settlement instead of repeating the grant. It sits behind the inbound delivery store, which stores each provider event once; this ledger makes the money effect happen once even when the same event is run again.',\n lifecycleRole: 'Claimed when a handler starts applying an event, and marked applied when the money-affecting work completes. A claim left without an applied instant past its lease may be taken over by a later delivery of the same event.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'BillingProviderEventSettlementSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'billingProviderEventSettlementResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'BackendResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'BILLING_PROVIDER_EVENT_SETTLEMENTS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Identifier derived from the claim key.',\n whyItMatters: 'Two deliveries of the same provider event compute the same identifier, so the second claim collides at the store instead of granting twice.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n claimKey: schemaShape.claimKey.stringSpec({\n meaning: 'The claim in readable form: the event type and the checkout session or provider event it belongs to.',\n whyItMatters: 'It is what an operator filters on to answer whether a given session or event was already settled.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n eventType: schemaShape.eventType.stringSpec({\n meaning: 'The provider event type the claim was taken for.',\n }),\n claimedAt: schemaShape.claimedAt.dateSpec({\n meaning: 'When a handler took the claim, refreshed when a stale claim is taken over.',\n whyItMatters: 'It is the lease timestamp: an unapplied claim older than the lease window may be taken over by a later delivery.',\n }),\n appliedAt: schemaShape.appliedAt.dateSpec({\n meaning: 'When the money-affecting work completed. Empty while a handler still holds the claim.',\n whyItMatters: 'Its absence is what distinguishes a claim in flight, or abandoned by a crashed process, from a settled event.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Take the claim for a provider event before applying its effect.',\n outcome: 'Exactly one delivery of the event proceeds to apply it.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The claim was taken.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The event was already claimed; the delivery reads the existing settlement instead.' }],\n idempotent: false,\n variants: {\n [BillingProviderEventSettlementVariantKey.INTERNAL]: {\n purpose: 'Let the billing webhook router claim a money-affecting event.',\n },\n },\n },\n [Op.READ]: {\n purpose: 'Read an event\\'s settlement.',\n outcome: 'A delivery learns whether the event is settled, in flight, or abandoned past its lease.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The settlement was found and is returned.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The event was never claimed.' }],\n idempotent: true,\n variants: {\n [BillingProviderEventSettlementVariantKey.INTERNAL]: {\n purpose: 'Let the billing webhook router inspect a claim that collided.',\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Mark a claimed event applied, or take over a stale claim.',\n outcome: 'The ledger records that the grant happened, or hands an abandoned claim to the delivery that will finish it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The settlement was updated and is returned.' }],\n errorScenarios: [{ code: HttpResponseStatusCode.CONFLICT_409, when: 'Another delivery settled or took over the claim first.' }],\n idempotent: false,\n variants: {\n [BillingProviderEventSettlementVariantKey.INTERNAL]: {\n purpose: 'Let the billing webhook router settle its own claim or take over one past its lease.',\n },\n },\n },\n },\n\n businessConstraints: [\n 'Money already granted cannot be un-granted by a later correction, so the suppression lives in a durable row every replica can see.',\n 'The ledger is not a webhook audit log: it records only what a second delivery must be able to ask.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
|
|
@@ -5,6 +5,7 @@ export declare const organizationCreditPoolsResourceSpecification: import("../..
|
|
|
5
5
|
poolKey: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>>;
|
|
6
6
|
available: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>>;
|
|
7
7
|
totalPurchased: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>>;
|
|
8
|
+
totalGranted: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>>;
|
|
8
9
|
totalConsumed: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>>;
|
|
9
10
|
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
|
|
10
11
|
updatedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
|
|
@@ -15,6 +16,7 @@ export declare const userCreditPoolsResourceSpecification: import("../../../_cor
|
|
|
15
16
|
poolKey: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>>;
|
|
16
17
|
available: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>>;
|
|
17
18
|
totalPurchased: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>>;
|
|
19
|
+
totalGranted: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>>;
|
|
18
20
|
totalConsumed: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodNumber>>>;
|
|
19
21
|
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
|
|
20
22
|
updatedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-pools.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/credit-pools.resource.specification.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAE3B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"credit-pools.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/credit-pools.resource.specification.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAE3B,qBAAqB,EAKtB,MAAM,uBAAuB,CAAC;AA+L/B,eAAO,MAAM,4CAA4C;;;;;;;;;;iCAGxD,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;;;iCAA+E,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { billingAdminPresets, billingMainPresets } from '@wildo-ai/presets-components';
|
|
2
2
|
import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
3
3
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
|
|
4
|
-
import { CoreResourceOperation as Op, CoreResourceType, CreditPool_Operations, ResourcePrimaryScope, CreditPoolSchema, creditPoolsPolymorphicFactories, } from '@wildo-ai/saas-models';
|
|
4
|
+
import { CoreResourceOperation as Op, CoreResourceType, CreditPool_Operations, ResourcePrimaryScope, CreditPoolSchema, creditPoolsPolymorphicFactories, ErrorCustomMessageReference, } from '@wildo-ai/saas-models';
|
|
5
5
|
import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
|
|
6
6
|
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
7
7
|
const poolResourcePrimaryScopeByResourceType = {
|
|
@@ -38,14 +38,15 @@ function buildCreditPoolBase(resourceType, memberName) {
|
|
|
38
38
|
{ collectionSymbol: { packageName: '@wildo-ai/presets-components', exportName: 'billingMainPresets', symbolKind: CodeSymbolKind.UI_BEHAVIOR }, identifierField: 'collectionKey', identifierValue: resourceType },
|
|
39
39
|
{ collectionSymbol: { packageName: '@wildo-ai/presets-components', exportName: 'billingAdminPresets', symbolKind: CodeSymbolKind.UI_BEHAVIOR }, identifierField: 'collectionKey', identifierValue: resourceType },
|
|
40
40
|
],
|
|
41
|
-
notes: ['Both `CONSUME` and `TOP_UP` are INTERNAL_CALL (system-only): `CONSUME` is invoked by service code metering a paid capability; `TOP_UP` is applied by the purchase webhook. The frontend registry strips both — the client credit-purchase action is OPEN_CHECKOUT on the billing account, never a direct balance write. The billing presets still list `TOP_UP` in `views` as `notAddressable`; that entry is retained for structural parity but is inert at runtime.'],
|
|
41
|
+
notes: ['Both `CONSUME` and `TOP_UP` are INTERNAL_CALL (system-only): `CONSUME` is invoked by service code metering a paid capability; `TOP_UP` is applied by the purchase webhook (source `purchase`) and by a converted referral\'s credit reward (source `grant`). The frontend registry strips both — the client credit-purchase action is OPEN_CHECKOUT on the billing account, never a direct balance write. The billing presets still list `TOP_UP` in `views` as `notAddressable`; that entry is retained for structural parity but is inert at runtime.'],
|
|
42
42
|
},
|
|
43
43
|
fields: {
|
|
44
44
|
_id: schemaShape._id.stringSpec({ meaning: 'Credit pool document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),
|
|
45
45
|
billingAccountId: schemaShape.billingAccountId.stringSpec({ meaning: 'Parent billing account polymorphic FK.', importance: FieldSemanticImportance.PRIMARY }),
|
|
46
46
|
poolKey: schemaShape.poolKey.stringSpec({ meaning: 'Logical pool identifier matching catalog `creditPoolKey` (e.g. ai_tokens).', importance: FieldSemanticImportance.PRIMARY }),
|
|
47
47
|
available: schemaShape.available.numberSpec({ meaning: 'Spendable credits right now — blocks usage when zero under policy.', importance: FieldSemanticImportance.PRIMARY }),
|
|
48
|
-
totalPurchased: schemaShape.totalPurchased.numberSpec({ meaning: '
|
|
48
|
+
totalPurchased: schemaShape.totalPurchased.numberSpec({ meaning: 'Credits bought in total, through credit-pack checkouts.' }),
|
|
49
|
+
totalGranted: schemaShape.totalGranted.numberSpec({ meaning: 'Credits given in total without a purchase, such as referral rewards. `available` is `totalPurchased + totalGranted - totalConsumed`.' }),
|
|
49
50
|
totalConsumed: schemaShape.totalConsumed.numberSpec({ meaning: 'Cumulative `CONSUME` deductions for lifetime reporting.' }),
|
|
50
51
|
createdAt: schemaShape.createdAt.dateSpec({ meaning: 'First pool record creation.', temporalRole: 'creation' }),
|
|
51
52
|
updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last balance change.', temporalRole: 'modified' }),
|
|
@@ -77,10 +78,10 @@ function buildCreditPoolBase(resourceType, memberName) {
|
|
|
77
78
|
{ code: HttpResponseStatusCode.CREATED_201, meaning: 'A new credit pool was created for the `(billingAccountId, poolKey)` pair and is returned with its initial balances.' },
|
|
78
79
|
],
|
|
79
80
|
errorScenarios: [
|
|
80
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The pool payload fails schema validation (e.g. missing `poolKey` or `billingAccountId`).'
|
|
81
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The pool payload fails schema validation (e.g. missing `poolKey` or `billingAccountId`).' },
|
|
81
82
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to provision credit pools in this scope.' },
|
|
82
83
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `billingAccountId` does not exist in the caller’s scope.' },
|
|
83
|
-
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'A pool already exists for this `(billingAccountId, poolKey)` pair — the pair is unique in Mongo.'
|
|
84
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'A pool already exists for this `(billingAccountId, poolKey)` pair — the pair is unique in Mongo.' },
|
|
84
85
|
],
|
|
85
86
|
idempotent: false,
|
|
86
87
|
examples: [
|
|
@@ -110,7 +111,7 @@ function buildCreditPoolBase(resourceType, memberName) {
|
|
|
110
111
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The pool record was patched and the updated balances are returned.' },
|
|
111
112
|
],
|
|
112
113
|
errorScenarios: [
|
|
113
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.'
|
|
114
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },
|
|
114
115
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to directly adjust credit pool balances (balance moves should use TOP_UP / CONSUME).' },
|
|
115
116
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id in the caller’s scope.' },
|
|
116
117
|
],
|
|
@@ -124,21 +125,21 @@ function buildCreditPoolBase(resourceType, memberName) {
|
|
|
124
125
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The credit amount was deducted and the new `available` / `totalConsumed` balances are returned to the internal caller.' },
|
|
125
126
|
],
|
|
126
127
|
errorScenarios: [
|
|
127
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The requested amount is missing, zero, or negative.'
|
|
128
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The requested amount is missing, zero, or negative.' },
|
|
128
129
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id.' },
|
|
129
|
-
{ code: HttpResponseStatusCode.
|
|
130
|
+
{ code: HttpResponseStatusCode.UNPROCESSABLE_ENTITY_422, when: 'The pool has insufficient `available` credits to satisfy the requested deduction. Nothing is deducted.', customMessageReference: ErrorCustomMessageReference.BILLING_INSUFFICIENT_CREDITS },
|
|
130
131
|
],
|
|
131
132
|
idempotent: false,
|
|
132
133
|
},
|
|
133
134
|
[CreditPool_Operations.TOP_UP]: {
|
|
134
135
|
operationId: CreditPool_Operations.TOP_UP,
|
|
135
|
-
purpose: 'Add credits after a verified CREDIT_PACK purchase. **System-only (INTERNAL_CALL, no HTTP route)** — invoked by the billing
|
|
136
|
+
purpose: 'Add credits after a verified CREDIT_PACK purchase. **System-only (INTERNAL_CALL, no HTTP route)** — invoked by the engine\'s billing provider-event handler, authorized with its handler-only `ORG_BILLING_PROVIDER_EVENTS` / `APP_BILLING_PROVIDER_EVENTS` role, with a server-computed `credits` amount derived from the paid quantity; it is not client-reachable. The client "buy credits" action is OPEN_CHECKOUT on the billing account, which starts payment; this op applies the grant only once payment is confirmed. Gating credit grants to the payment webhook (never a tenant-owner route) prevents self-granting paid credits.',
|
|
136
137
|
outcome: 'Increments available and totalPurchased when applied by the webhook.',
|
|
137
138
|
responseStatuses: [
|
|
138
139
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The webhook-computed credit amount was added and the new `available` / `totalPurchased` balances are returned to the internal caller.' },
|
|
139
140
|
],
|
|
140
141
|
errorScenarios: [
|
|
141
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The computed amount is missing, zero, or negative.'
|
|
142
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The computed amount is missing, zero, or negative.' },
|
|
142
143
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id (the webhook auto-creates the pool before top-up, so this indicates an internal inconsistency).' },
|
|
143
144
|
],
|
|
144
145
|
idempotent: false,
|
|
@@ -152,9 +153,9 @@ function buildCreditPoolSpec(resourceType, memberName) {
|
|
|
152
153
|
const main = resolvePoolUI(billingMainPresets, resourceType, 'billingMainPresets');
|
|
153
154
|
const admin = resolvePoolUI(billingAdminPresets, resourceType, 'billingAdminPresets');
|
|
154
155
|
return resourceSpecificationFromFrontendConfiguration(mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)), base, () => ({
|
|
155
|
-
label: { purpose: 'Preset `getFrontendResourceLabel`
|
|
156
|
+
label: { purpose: 'Preset `getFrontendResourceLabel` names a pool by the application\'s word for it (`billing_credit_pools.<poolKey>.name`), and by its `poolKey` only while that word is missing. `instanceLabelSections` declares the billing section so every surface that names a pool loads the words (#1851).' },
|
|
156
157
|
layout: {
|
|
157
|
-
purpose: 'Inline summary template (no `refs.sections`)
|
|
158
|
+
purpose: 'Inline summary template (no `refs.sections`) titles the card with the pool\'s name (its word), then stacks `poolKey`, available/totals, and `billingAccountId` — `TOP_UP` is the only custom op listed in merged admin `views`.',
|
|
158
159
|
displayPurpose: 'Self-serve and org-admin credit balance; `CONSUME` is for automated service calls, not a primary nav op in presets.',
|
|
159
160
|
},
|
|
160
161
|
views: {
|