@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-pools.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/credit-pools.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,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,MAAM,sCAAsC,GAAmD;IAC7F,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,EAAE,oBAAoB,CAAC,aAAa;IAChF,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,oBAAoB,CAAC,SAAS;CACrE,CAAC;AAQF,SAAS,aAAa,CAAC,MAAwC,EAAE,YAA8B,EAAE,UAAkB;IACjH,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAA6B,CAAC;IACpE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,YAAY,YAAY,oBAAoB,UAAU,GAAG,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,UAAU,CAA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,kBAAsD,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;IACvH,MAAM,KAAK,GAAG,aAAa,CAAC,mBAAuD,EAAE,YAAY,EAAE,qBAAqB,CAAC,CAAC;IAC1H,OAAO,8CAA8C,CACnD,mCAAmC,CAAC,6BAA6B,CAAC,IAAI,CAAC,EAAE,6BAA6B,CAAC,KAAK,CAAC,CAAC,EAC9G,IAAI,EACJ,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,EAAE,OAAO,EAAE,wEAAwE,EAAE;QAC5F,MAAM,EAAE;YACN,OAAO,EAAE,0KAA0K;YACnL,cAAc,EAAE,qHAAqH;SACtI;QACD,KAAK,EAAE;YACL,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,6KAA6K,EAAE,SAAS,EAAE,kIAAkI,EAAE;SAC1W;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,4CAA4C,GAAG,mBAAmB,CAC7E,gBAAgB,CAAC,yBAAyB,EAC1C,2BAA2B,CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { billingAdminPresets, billingMainPresets } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n CoreResourceType,\n CreditPool_Operations,\n ResourcePrimaryScope,\n CreditPoolSchema,\n creditPoolsPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype PoolResourceType = CoreResourceType.ORGANIZATION_CREDIT_POOLS | CoreResourceType.USER_CREDIT_POOLS;\ntype PoolResourceTypeMember = 'ORGANIZATION_CREDIT_POOLS' | 'USER_CREDIT_POOLS';\n\nconst poolResourcePrimaryScopeByResourceType: Record<PoolResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.ORGANIZATION_CREDIT_POOLS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.USER_CREDIT_POOLS]: ResourcePrimaryScope.USER_SELF,\n};\n\ntype Cfg = ReturnType<(typeof creditPoolsPolymorphicFactories)[CoreResourceType.ORGANIZATION_CREDIT_POOLS]>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof CreditPoolSchema;\ntype PoolFrontend = ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nfunction resolvePoolUI(source: Partial<Record<string, unknown>>, resourceType: PoolResourceType, sourceName: string): PoolFrontend {\n const uiBehavior = source[resourceType] as PoolFrontend | undefined;\n if (!uiBehavior) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return uiBehavior;\n}\n\nfunction buildCreditPoolBase(resourceType: PoolResourceType, memberName: PoolResourceTypeMember) {\n return resourceSpecification<Custom, Core, Main>(\n creditPoolsPolymorphicFactories[resourceType],\n CreditPoolSchema,\n ({ schemaShape }) => ({\n purpose: 'Per–billing-account, per–`poolKey` credit balance (available / purchased / consumed) for CREDIT_PACK products.',\n businessRole: 'Holds the spendable balance used by feature gates. BOTH balance mutations are system-only (INTERNAL_CALL, no client route): `CONSUME` decrements as a metered capability is used, `TOP_UP` increments after a purchase webhook. Neither is client-initiated.',\n lifecycleRole: 'Row created on first need; monotonic counters updated by service layer — not a general ledger in Wildo.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'CreditPoolSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'creditPoolsPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName },\n operationVocabulary: {\n coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n customEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CreditPool_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: ['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.'],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Credit pool document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n billingAccountId: schemaShape.billingAccountId.stringSpec({ meaning: 'Parent billing account polymorphic FK.', importance: FieldSemanticImportance.PRIMARY }),\n poolKey: schemaShape.poolKey.stringSpec({ meaning: 'Logical pool identifier matching catalog `creditPoolKey` (e.g. ai_tokens).', importance: FieldSemanticImportance.PRIMARY }),\n available: schemaShape.available.numberSpec({ meaning: 'Spendable credits right now — blocks usage when zero under policy.', importance: FieldSemanticImportance.PRIMARY }),\n totalPurchased: schemaShape.totalPurchased.numberSpec({ meaning: 'Cumulative top-ups for transparency and support.' }),\n totalConsumed: schemaShape.totalConsumed.numberSpec({ meaning: 'Cumulative `CONSUME` deductions for lifetime reporting.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'First pool record creation.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last balance change.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read current balances for in-app credit meters and admin inspection.',\n outcome: 'Available, purchased, and consumed numbers.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The credit pool was found and its available / purchased / consumed counters are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Enumerate pools for a scope when multiple `poolKey` values exist under one account.',\n outcome: 'Table of pools for finance review.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of credit pools for the billing account / scope.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Bootstrap a pool on first credit-backed purchase for that key.',\n outcome: 'Initial available/totals in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new credit pool was created for the `(billingAccountId, poolKey)` pair and is returned with its initial balances.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The pool payload fails schema validation (e.g. missing `poolKey` or `billingAccountId`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to provision credit pools in this scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `billingAccountId` does not exist in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A pool already exists for this `(billingAccountId, poolKey)` pair — the pair is unique in Mongo.', errorCode: 'CREDIT_POOL_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Bootstrap an ai_tokens pool for a billing account',\n request: {\n billingAccountId: 'billacct_01HX2…',\n poolKey: 'ai_tokens',\n available: 0,\n },\n response: {\n _id: 'creditpool_01HX2…',\n billingAccountId: 'billacct_01HX2…',\n poolKey: 'ai_tokens',\n available: 0,\n totalPurchased: 0,\n totalConsumed: 0,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'System-level adjustments when not using custom ops; prefer `TOP_UP` / `CONSUME` in services.',\n outcome: 'Patched non-editable fields per factory rules in edge cases.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The pool record was patched and the updated balances are 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 directly adjust credit pool balances (balance moves should use TOP_UP / CONSUME).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [CreditPool_Operations.CONSUME]: {\n operationId: CreditPool_Operations.CONSUME,\n purpose: 'Decrement `available` by a positive credit amount as a metered capability is used. **System-only (INTERNAL_CALL, no HTTP route)** — invoked by service code that meters a paid feature, not by a client; a client never spends credits directly.',\n outcome: 'Balance reduced by the service-supplied amount, or an error if credits are insufficient.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The credit amount was deducted and the new `available` / `totalConsumed` balances are returned to the internal caller.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The requested amount is missing, zero, or negative.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The pool has insufficient `available` credits to satisfy the requested deduction.', errorCode: 'INSUFFICIENT_CREDITS' },\n ],\n idempotent: false,\n },\n [CreditPool_Operations.TOP_UP]: {\n operationId: CreditPool_Operations.TOP_UP,\n purpose: 'Add credits after a verified CREDIT_PACK purchase. **System-only (INTERNAL_CALL, no HTTP route)** — invoked by the billing webhook router 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.',\n outcome: 'Increments available and totalPurchased when applied by the webhook.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The webhook-computed credit amount was added and the new `available` / `totalPurchased` balances are returned to the internal caller.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The computed amount is missing, zero, or negative.', errorCode: 'VALIDATION_FAILED' },\n { 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).' },\n ],\n idempotent: false,\n },\n },\n businessConstraints: ['`poolKey` + `billingAccountId` is unique in Mongo — do not create duplicate keys for the same account.'],\n }),\n { resourcePrimaryScope: poolResourcePrimaryScopeByResourceType[resourceType] },\n );\n}\n\nfunction buildCreditPoolSpec(resourceType: PoolResourceType, memberName: PoolResourceTypeMember) {\n const base = buildCreditPoolBase(resourceType, memberName);\n const main = resolvePoolUI(billingMainPresets as Partial<Record<string, unknown>>, resourceType, 'billingMainPresets');\n const admin = resolvePoolUI(billingAdminPresets as Partial<Record<string, unknown>>, resourceType, 'billingAdminPresets');\n return resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)),\n base,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` returns `poolKey` for the row title.' },\n layout: {\n purpose: 'Inline summary template (no `refs.sections`) stacks pool name, available/totals, and `billingAccountId` — `TOP_UP` is the only custom op listed in merged admin `views`.',\n displayPurpose: 'Self-serve and org-admin credit balance; `CONSUME` is for automated service calls, not a primary nav op in presets.',\n },\n views: {\n [CreditPool_Operations.TOP_UP]: { purpose: 'System-only grant op (INTERNAL_CALL); listed for structural parity with the admin preset but not client-invocable — the frontend registry strips it. Kept `notAddressable`.', whenToUse: 'Never client-wired. The credit-purchase UX is OPEN_CHECKOUT on the billing account; the grant is applied by the payment webhook.' },\n },\n }),\n );\n}\n\nexport const organizationCreditPoolsResourceSpecification = buildCreditPoolSpec(\n CoreResourceType.ORGANIZATION_CREDIT_POOLS,\n 'ORGANIZATION_CREDIT_POOLS',\n);\n\nexport const userCreditPoolsResourceSpecification = buildCreditPoolSpec(CoreResourceType.USER_CREDIT_POOLS, 'USER_CREDIT_POOLS');\n"]}
|
|
1
|
+
{"version":3,"file":"credit-pools.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/credit-pools.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,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,uBAAuB,C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AyB,EAC1C,2BAA2B,CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { billingAdminPresets, billingMainPresets } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n CoreResourceType,\n CreditPool_Operations,\n ResourcePrimaryScope,\n CreditPoolSchema,\n creditPoolsPolymorphicFactories,\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 { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype PoolResourceType = CoreResourceType.ORGANIZATION_CREDIT_POOLS | CoreResourceType.USER_CREDIT_POOLS;\ntype PoolResourceTypeMember = 'ORGANIZATION_CREDIT_POOLS' | 'USER_CREDIT_POOLS';\n\nconst poolResourcePrimaryScopeByResourceType: Record<PoolResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.ORGANIZATION_CREDIT_POOLS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.USER_CREDIT_POOLS]: ResourcePrimaryScope.USER_SELF,\n};\n\ntype Cfg = ReturnType<(typeof creditPoolsPolymorphicFactories)[CoreResourceType.ORGANIZATION_CREDIT_POOLS]>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof CreditPoolSchema;\ntype PoolFrontend = ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nfunction resolvePoolUI(source: Partial<Record<string, unknown>>, resourceType: PoolResourceType, sourceName: string): PoolFrontend {\n const uiBehavior = source[resourceType] as PoolFrontend | undefined;\n if (!uiBehavior) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return uiBehavior;\n}\n\nfunction buildCreditPoolBase(resourceType: PoolResourceType, memberName: PoolResourceTypeMember) {\n return resourceSpecification<Custom, Core, Main>(\n creditPoolsPolymorphicFactories[resourceType],\n CreditPoolSchema,\n ({ schemaShape }) => ({\n purpose: 'Per–billing-account, per–`poolKey` credit balance (available / purchased / consumed) for CREDIT_PACK products.',\n businessRole: 'Holds the spendable balance used by feature gates. BOTH balance mutations are system-only (INTERNAL_CALL, no client route): `CONSUME` decrements as a metered capability is used, `TOP_UP` increments after a purchase webhook. Neither is client-initiated.',\n lifecycleRole: 'Row created on first need; monotonic counters updated by service layer — not a general ledger in Wildo.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'CreditPoolSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'creditPoolsPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName },\n operationVocabulary: {\n coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n customEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CreditPool_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: ['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.'],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Credit pool document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n billingAccountId: schemaShape.billingAccountId.stringSpec({ meaning: 'Parent billing account polymorphic FK.', importance: FieldSemanticImportance.PRIMARY }),\n poolKey: schemaShape.poolKey.stringSpec({ meaning: 'Logical pool identifier matching catalog `creditPoolKey` (e.g. ai_tokens).', importance: FieldSemanticImportance.PRIMARY }),\n available: schemaShape.available.numberSpec({ meaning: 'Spendable credits right now — blocks usage when zero under policy.', importance: FieldSemanticImportance.PRIMARY }),\n totalPurchased: schemaShape.totalPurchased.numberSpec({ meaning: 'Credits bought in total, through credit-pack checkouts.' }),\n totalGranted: schemaShape.totalGranted.numberSpec({ meaning: 'Credits given in total without a purchase, such as referral rewards. `available` is `totalPurchased + totalGranted - totalConsumed`.' }),\n totalConsumed: schemaShape.totalConsumed.numberSpec({ meaning: 'Cumulative `CONSUME` deductions for lifetime reporting.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'First pool record creation.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last balance change.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read current balances for in-app credit meters and admin inspection.',\n outcome: 'Available, purchased, and consumed numbers.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The credit pool was found and its available / purchased / consumed counters are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Enumerate pools for a scope when multiple `poolKey` values exist under one account.',\n outcome: 'Table of pools for finance review.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of credit pools for the billing account / scope.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Bootstrap a pool on first credit-backed purchase for that key.',\n outcome: 'Initial available/totals in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new credit pool was created for the `(billingAccountId, poolKey)` pair and is returned with its initial balances.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The pool payload fails schema validation (e.g. missing `poolKey` or `billingAccountId`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the entitlement to provision credit pools in this scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `billingAccountId` does not exist in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A pool already exists for this `(billingAccountId, poolKey)` pair — the pair is unique in Mongo.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Bootstrap an ai_tokens pool for a billing account',\n request: {\n billingAccountId: 'billacct_01HX2…',\n poolKey: 'ai_tokens',\n available: 0,\n },\n response: {\n _id: 'creditpool_01HX2…',\n billingAccountId: 'billacct_01HX2…',\n poolKey: 'ai_tokens',\n available: 0,\n totalPurchased: 0,\n totalConsumed: 0,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'System-level adjustments when not using custom ops; prefer `TOP_UP` / `CONSUME` in services.',\n outcome: 'Patched non-editable fields per factory rules in edge cases.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The pool record was patched and the updated balances are 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 directly adjust credit pool balances (balance moves should use TOP_UP / CONSUME).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [CreditPool_Operations.CONSUME]: {\n operationId: CreditPool_Operations.CONSUME,\n purpose: 'Decrement `available` by a positive credit amount as a metered capability is used. **System-only (INTERNAL_CALL, no HTTP route)** — invoked by service code that meters a paid feature, not by a client; a client never spends credits directly.',\n outcome: 'Balance reduced by the service-supplied amount, or an error if credits are insufficient.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The credit amount was deducted and the new `available` / `totalConsumed` balances are returned to the internal caller.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The requested amount is missing, zero, or negative.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No credit pool exists for the supplied id.' },\n { 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 },\n ],\n idempotent: false,\n },\n [CreditPool_Operations.TOP_UP]: {\n operationId: CreditPool_Operations.TOP_UP,\n 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.',\n outcome: 'Increments available and totalPurchased when applied by the webhook.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The webhook-computed credit amount was added and the new `available` / `totalPurchased` balances are returned to the internal caller.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The computed amount is missing, zero, or negative.' },\n { 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).' },\n ],\n idempotent: false,\n },\n },\n businessConstraints: ['`poolKey` + `billingAccountId` is unique in Mongo — do not create duplicate keys for the same account.'],\n }),\n { resourcePrimaryScope: poolResourcePrimaryScopeByResourceType[resourceType] },\n );\n}\n\nfunction buildCreditPoolSpec(resourceType: PoolResourceType, memberName: PoolResourceTypeMember) {\n const base = buildCreditPoolBase(resourceType, memberName);\n const main = resolvePoolUI(billingMainPresets as Partial<Record<string, unknown>>, resourceType, 'billingMainPresets');\n const admin = resolvePoolUI(billingAdminPresets as Partial<Record<string, unknown>>, resourceType, 'billingAdminPresets');\n return resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)),\n base,\n () => ({\n 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).' },\n layout: {\n 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`.',\n displayPurpose: 'Self-serve and org-admin credit balance; `CONSUME` is for automated service calls, not a primary nav op in presets.',\n },\n views: {\n [CreditPool_Operations.TOP_UP]: { purpose: 'System-only grant op (INTERNAL_CALL); listed for structural parity with the admin preset but not client-invocable — the frontend registry strips it. Kept `notAddressable`.', whenToUse: 'Never client-wired. The credit-purchase UX is OPEN_CHECKOUT on the billing account; the grant is applied by the payment webhook.' },\n },\n }),\n );\n}\n\nexport const organizationCreditPoolsResourceSpecification = buildCreditPoolSpec(\n CoreResourceType.ORGANIZATION_CREDIT_POOLS,\n 'ORGANIZATION_CREDIT_POOLS',\n);\n\nexport const userCreditPoolsResourceSpecification = buildCreditPoolSpec(CoreResourceType.USER_CREDIT_POOLS, 'USER_CREDIT_POOLS');\n"]}
|
|
@@ -158,10 +158,10 @@ function buildInvoiceRefBase(resourceType, memberName) {
|
|
|
158
158
|
{ code: HttpResponseStatusCode.CREATED_201, meaning: 'An invoice ref mirror was inserted (internal/repository path) and is returned keyed to its provider invoice id. Not a client-facing create — invoice refs are system-written from provider webhooks or backfills.' },
|
|
159
159
|
],
|
|
160
160
|
errorScenarios: [
|
|
161
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The ingested payload fails schema validation (e.g. missing `billingAccountId` or `providerInvoiceId`).'
|
|
162
|
-
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller
|
|
161
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The ingested payload fails schema validation (e.g. missing `billingAccountId` or `providerInvoiceId`).' },
|
|
162
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller holds no role this operation names. Invoice mirrors are inserted by the engine\'s billing provider-event handler, acting with the handler-only `ORG_BILLING_PROVIDER_EVENTS` / `APP_BILLING_PROVIDER_EVENTS` role.' },
|
|
163
163
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `billingAccountId` does not exist in the caller’s scope.' },
|
|
164
|
-
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'An invoice ref already mirrors this `providerInvoiceId` (idempotent webhook re-delivery target).'
|
|
164
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'An invoice ref already mirrors this `providerInvoiceId` (idempotent webhook re-delivery target).' },
|
|
165
165
|
],
|
|
166
166
|
idempotent: false,
|
|
167
167
|
examples: [
|
|
@@ -186,8 +186,8 @@ function buildInvoiceRefBase(resourceType, memberName) {
|
|
|
186
186
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The invoice ref’s provider-mirrored fields (status, total, urls) were synced and the updated record is returned.' },
|
|
187
187
|
],
|
|
188
188
|
errorScenarios: [
|
|
189
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The synced fields fail schema validation.'
|
|
190
|
-
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller
|
|
189
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The synced fields fail schema validation.' },
|
|
190
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller holds no role this operation names. Invoice mirrors are synchronised by the engine\'s billing provider-event handler, acting with the handler-only `ORG_BILLING_PROVIDER_EVENTS` / `APP_BILLING_PROVIDER_EVENTS` role.' },
|
|
191
191
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No invoice ref exists for the supplied id in the caller’s scope.' },
|
|
192
192
|
],
|
|
193
193
|
idempotent: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice-refs.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/invoice-refs.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,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,gB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,KAAK,EAAE;YACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,+FAA+F,EAAE,SAAS,EAAE,8CAA8C,EAAE;YAClL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,8DAA8D,EAAE,SAAS,EAAE,4CAA4C,EAAE;SAChJ;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,4CAA4C,GAAG,mBAAmB,CAC7E,gBAAgB,CAAC,yBAAyB,EAC1C,2BAA2B,CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { billingAdminPresets, billingMainPresets } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n CoreResourceType,\n InvoiceStatus,\n ResourcePrimaryScope,\n InvoiceRefSchema,\n invoiceRefsPolymorphicFactories,\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 InvResourceType = CoreResourceType.ORGANIZATION_INVOICE_REFS | CoreResourceType.USER_INVOICE_REFS;\ntype InvResourceTypeMember = 'ORGANIZATION_INVOICE_REFS' | 'USER_INVOICE_REFS';\n\nconst invResourcePrimaryScopeByResourceType: Record<InvResourceType, BillingApiReferenceExampleScope> = {\n [CoreResourceType.ORGANIZATION_INVOICE_REFS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.USER_INVOICE_REFS]: ResourcePrimaryScope.USER_SELF,\n};\n\ntype Cfg = ReturnType<(typeof invoiceRefsPolymorphicFactories)[CoreResourceType.ORGANIZATION_INVOICE_REFS]>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof InvoiceRefSchema;\ntype InvFrontend = ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nfunction resolveInvUI(source: Partial<Record<string, unknown>>, resourceType: InvResourceType, sourceName: string): InvFrontend {\n const uiBehavior = source[resourceType] as InvFrontend | undefined;\n if (!uiBehavior) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return uiBehavior;\n}\n\nfunction buildInvoiceRefBase(resourceType: InvResourceType, memberName: InvResourceTypeMember) {\n const exampleScope = createBillingApiReferenceScopeExample(\n invResourcePrimaryScopeByResourceType[resourceType],\n );\n const invoiceTotalExample = { amount: 4900, currency: 'USD', decimals: 2 };\n const invoiceRefExample = {\n _id: 'invoice_ref_01HX2EXAMPLE',\n ...exampleScope.billingAccountIdentity,\n status: InvoiceStatus.PAID,\n total: invoiceTotalExample,\n createdAt: '2026-06-02T08:00:00.000Z',\n updatedAt: '2026-06-02T08:05:00.000Z',\n ...exampleScope.scopeIdentity,\n };\n const invoiceRefSummaryExample = {\n _id: invoiceRefExample._id,\n status: invoiceRefExample.status,\n total: invoiceRefExample.total,\n };\n\n return resourceSpecification<undefined, Core, Main>(\n invoiceRefsPolymorphicFactories[resourceType],\n InvoiceRefSchema,\n ({ schemaShape }) => ({\n purpose:\n 'Invoice summary for a billing account: exposes lifecycle status, money total, and timestamps without leaking provider identifiers or provider-hosted document locations.',\n businessRole: 'Lets billing surfaces show recent invoice state and money totals while invoice documents remain available through the protected billing portal.',\n lifecycleRole: 'Created and updated from billing-provider events. The public API exposes invoice summaries as read-only records; it does not provide create, update, or delete operations.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'InvoiceRefSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'invoiceRefsPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\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: ['Payment-failed and invoice-ready emails may reference these rows — verify `userNotifications[]` on operations in the factory before claiming fan-outs.'],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Invoice ref document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n billingAccountId: schemaShape.billingAccountId.stringSpec({ meaning: 'Polymorphic parent billing account FK.', importance: FieldSemanticImportance.PRIMARY }),\n status: schemaShape.status.enumSpec({\n meaning: 'Provider invoice payment state for past-due surfacing.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'InvoiceStatus', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [InvoiceStatus.DRAFT]: { meaning: 'Not finalized for collection.' },\n [InvoiceStatus.OPEN]: { meaning: 'Awaiting payment.' },\n [InvoiceStatus.PAID]: { meaning: 'Settled successfully.' },\n [InvoiceStatus.VOID]: { meaning: 'Voided at provider.' },\n [InvoiceStatus.UNCOLLECTIBLE]: { meaning: 'Written off or uncollectible per provider.' },\n },\n }),\n total: schemaShape.total.objectSpec({ meaning: 'Money object (amount + currency) for invoice total display.' }),\n hostedInvoiceUrl: schemaShape.hostedInvoiceUrl.stringSpec({ meaning: 'Provider-hosted invoice page. BACKEND-ONLY — never returned to a client: it is an unauthenticated capability link to a tax invoice, which legally carries the customer name and billing address. Clients reach invoice documents through the billing account\\'s open_portal operation instead.' }),\n invoicePdfUrl: schemaShape.invoicePdfUrl.stringSpec({ meaning: 'Provider-hosted invoice PDF. BACKEND-ONLY for the same reason as hostedInvoiceUrl.' }),\n providerInvoiceId: schemaShape.providerInvoiceId.stringSpec({ meaning: 'Opaque provider id — backend-only. Also the upsert key the billing webhook uses to find an existing invoice record.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last sync time.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Open one invoice ref for detail panes.',\n outcome: 'Status and total for support and user self-serve. The invoice DOCUMENT is not linked from here — clients open it through the billing account\\'s open_portal operation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The invoice ref was found and its status and total are returned. The provider-hosted URLs are backend-only and deliberately absent from the response.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No invoice ref exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect a paid invoice header',\n response: invoiceRefExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect an invoice header with available relationship context',\n response: invoiceRefExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact invoice summary',\n response: invoiceRefSummaryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'History table under a billing account.',\n outcome: 'Chronological refs for org or user scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) chronological page of invoice refs for the billing account / scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent invoice headers',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([invoiceRefExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse invoice headers with relationship context',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([invoiceRefExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact invoice summaries',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([invoiceRefSummaryExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Repository search (status and similar) for admin tooling.',\n outcome: 'Filtered page of invoice refs when search is enabled in factory.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of invoice refs matching the status/repository search query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the admin entitlement required to run repository-level invoice searches.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Backfill or webhook ingestion path when the service inserts a new ref document.',\n outcome: 'New row keyed to provider invoice id in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'An invoice ref mirror was inserted (internal/repository path) and is returned keyed to its provider invoice id. Not a client-facing create — invoice refs are system-written from provider webhooks or backfills.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The ingested payload fails schema validation (e.g. missing `billingAccountId` or `providerInvoiceId`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not the internal/webhook/repository path permitted to insert invoice mirrors.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `billingAccountId` does not exist in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'An invoice ref already mirrors this `providerInvoiceId` (idempotent webhook re-delivery target).', errorCode: 'INVOICE_REF_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Internal ingestion of a provider invoice mirror',\n request: {\n ...exampleScope.billingAccountIdentity,\n providerInvoiceId: 'in_01HX2EXAMPLE',\n status: InvoiceStatus.OPEN,\n total: invoiceTotalExample,\n hostedInvoiceUrl: 'https://billing.example.test/invoices/in_01HX2EXAMPLE',\n },\n response: { ...invoiceRefExample, status: InvoiceStatus.OPEN },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Sync status/total/url fields when webhooks arrive.',\n outcome: 'Patched provider-mirrored fields.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The invoice ref’s provider-mirrored fields (status, total, urls) were synced and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The synced fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not the internal/webhook path permitted to sync invoice mirrors.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No invoice ref exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: ['Line-item detail lives at the provider — this row is intentionally shallow.'],\n }),\n { resourcePrimaryScope: invResourcePrimaryScopeByResourceType[resourceType] },\n );\n}\n\nfunction buildInvoiceRefSpec(resourceType: InvResourceType, memberName: InvResourceTypeMember) {\n const base = buildInvoiceRefBase(resourceType, memberName);\n const main = resolveInvUI(billingMainPresets as Partial<Record<string, unknown>>, resourceType, 'billingMainPresets');\n const admin = resolveInvUI(billingAdminPresets as Partial<Record<string, unknown>>, resourceType, 'billingAdminPresets');\n return resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)),\n base,\n () => ({\n label: { purpose: 'Preset builds `Invoice ${status}` as a readable list label.' },\n views: {\n [Op.LIST]: { purpose: 'List op present in merged preset `views` as non-addressable — document for overlay alignment.', whenToUse: 'Account invoice history surfaces when wired.' },\n [Op.READ]: { purpose: 'Read op present in merged preset `views` as non-addressable.', whenToUse: 'Invoice detail drawer from list selection.' },\n },\n }),\n );\n}\n\nexport const organizationInvoiceRefsResourceSpecification = buildInvoiceRefSpec(\n CoreResourceType.ORGANIZATION_INVOICE_REFS,\n 'ORGANIZATION_INVOICE_REFS',\n);\n\nexport const userInvoiceRefsResourceSpecification = buildInvoiceRefSpec(CoreResourceType.USER_INVOICE_REFS, 'USER_INVOICE_REFS');\n"]}
|
|
1
|
+
{"version":3,"file":"invoice-refs.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/invoice-refs.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,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/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CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,8DAA8D,EAAE,SAAS,EAAE,4CAA4C,EAAE;SAChJ;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,4CAA4C,GAAG,mBAAmB,CAC7E,gBAAgB,CAAC,yBAAyB,EAC1C,2BAA2B,CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { billingAdminPresets, billingMainPresets } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n CoreResourceType,\n InvoiceStatus,\n ResourcePrimaryScope,\n InvoiceRefSchema,\n invoiceRefsPolymorphicFactories,\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 InvResourceType = CoreResourceType.ORGANIZATION_INVOICE_REFS | CoreResourceType.USER_INVOICE_REFS;\ntype InvResourceTypeMember = 'ORGANIZATION_INVOICE_REFS' | 'USER_INVOICE_REFS';\n\nconst invResourcePrimaryScopeByResourceType: Record<InvResourceType, BillingApiReferenceExampleScope> = {\n [CoreResourceType.ORGANIZATION_INVOICE_REFS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.USER_INVOICE_REFS]: ResourcePrimaryScope.USER_SELF,\n};\n\ntype Cfg = ReturnType<(typeof invoiceRefsPolymorphicFactories)[CoreResourceType.ORGANIZATION_INVOICE_REFS]>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof InvoiceRefSchema;\ntype InvFrontend = ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nfunction resolveInvUI(source: Partial<Record<string, unknown>>, resourceType: InvResourceType, sourceName: string): InvFrontend {\n const uiBehavior = source[resourceType] as InvFrontend | undefined;\n if (!uiBehavior) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return uiBehavior;\n}\n\nfunction buildInvoiceRefBase(resourceType: InvResourceType, memberName: InvResourceTypeMember) {\n const exampleScope = createBillingApiReferenceScopeExample(\n invResourcePrimaryScopeByResourceType[resourceType],\n );\n const invoiceTotalExample = { amount: 4900, currency: 'USD', decimals: 2 };\n const invoiceRefExample = {\n _id: 'invoice_ref_01HX2EXAMPLE',\n ...exampleScope.billingAccountIdentity,\n status: InvoiceStatus.PAID,\n total: invoiceTotalExample,\n createdAt: '2026-06-02T08:00:00.000Z',\n updatedAt: '2026-06-02T08:05:00.000Z',\n ...exampleScope.scopeIdentity,\n };\n const invoiceRefSummaryExample = {\n _id: invoiceRefExample._id,\n status: invoiceRefExample.status,\n total: invoiceRefExample.total,\n };\n\n return resourceSpecification<undefined, Core, Main>(\n invoiceRefsPolymorphicFactories[resourceType],\n InvoiceRefSchema,\n ({ schemaShape }) => ({\n purpose:\n 'Invoice summary for a billing account: exposes lifecycle status, money total, and timestamps without leaking provider identifiers or provider-hosted document locations.',\n businessRole: 'Lets billing surfaces show recent invoice state and money totals while invoice documents remain available through the protected billing portal.',\n lifecycleRole: 'Created and updated from billing-provider events. The public API exposes invoice summaries as read-only records; it does not provide create, update, or delete operations.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'InvoiceRefSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'invoiceRefsPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\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: ['Payment-failed and invoice-ready emails may reference these rows — verify `userNotifications[]` on operations in the factory before claiming fan-outs.'],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Invoice ref document id.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n billingAccountId: schemaShape.billingAccountId.stringSpec({ meaning: 'Polymorphic parent billing account FK.', importance: FieldSemanticImportance.PRIMARY }),\n status: schemaShape.status.enumSpec({\n meaning: 'Provider invoice payment state for past-due surfacing.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'InvoiceStatus', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [InvoiceStatus.DRAFT]: { meaning: 'Not finalized for collection.' },\n [InvoiceStatus.OPEN]: { meaning: 'Awaiting payment.' },\n [InvoiceStatus.PAID]: { meaning: 'Settled successfully.' },\n [InvoiceStatus.VOID]: { meaning: 'Voided at provider.' },\n [InvoiceStatus.UNCOLLECTIBLE]: { meaning: 'Written off or uncollectible per provider.' },\n },\n }),\n total: schemaShape.total.objectSpec({ meaning: 'Money object (amount + currency) for invoice total display.' }),\n hostedInvoiceUrl: schemaShape.hostedInvoiceUrl.stringSpec({ meaning: 'Provider-hosted invoice page. BACKEND-ONLY — never returned to a client: it is an unauthenticated capability link to a tax invoice, which legally carries the customer name and billing address. Clients reach invoice documents through the billing account\\'s open_portal operation instead.' }),\n invoicePdfUrl: schemaShape.invoicePdfUrl.stringSpec({ meaning: 'Provider-hosted invoice PDF. BACKEND-ONLY for the same reason as hostedInvoiceUrl.' }),\n providerInvoiceId: schemaShape.providerInvoiceId.stringSpec({ meaning: 'Opaque provider id — backend-only. Also the upsert key the billing webhook uses to find an existing invoice record.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'Last sync time.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Open one invoice ref for detail panes.',\n outcome: 'Status and total for support and user self-serve. The invoice DOCUMENT is not linked from here — clients open it through the billing account\\'s open_portal operation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The invoice ref was found and its status and total are returned. The provider-hosted URLs are backend-only and deliberately absent from the response.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No invoice ref exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect a paid invoice header',\n response: invoiceRefExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect an invoice header with available relationship context',\n response: invoiceRefExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact invoice summary',\n response: invoiceRefSummaryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'History table under a billing account.',\n outcome: 'Chronological refs for org or user scope.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) chronological page of invoice refs for the billing account / scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent invoice headers',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([invoiceRefExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse invoice headers with relationship context',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([invoiceRefExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact invoice summaries',\n request: BILLING_API_REFERENCE_PAGE_REQUEST,\n response: billingApiReferencePage([invoiceRefSummaryExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Repository search (status and similar) for admin tooling.',\n outcome: 'Filtered page of invoice refs when search is enabled in factory.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of invoice refs matching the status/repository search query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the admin entitlement required to run repository-level invoice searches.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Backfill or webhook ingestion path when the service inserts a new ref document.',\n outcome: 'New row keyed to provider invoice id in implementation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'An invoice ref mirror was inserted (internal/repository path) and is returned keyed to its provider invoice id. Not a client-facing create — invoice refs are system-written from provider webhooks or backfills.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The ingested payload fails schema validation (e.g. missing `billingAccountId` or `providerInvoiceId`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller holds no role this operation names. Invoice mirrors are inserted by the engine\\'s billing provider-event handler, acting with the handler-only `ORG_BILLING_PROVIDER_EVENTS` / `APP_BILLING_PROVIDER_EVENTS` role.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `billingAccountId` does not exist in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'An invoice ref already mirrors this `providerInvoiceId` (idempotent webhook re-delivery target).' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Internal ingestion of a provider invoice mirror',\n request: {\n ...exampleScope.billingAccountIdentity,\n providerInvoiceId: 'in_01HX2EXAMPLE',\n status: InvoiceStatus.OPEN,\n total: invoiceTotalExample,\n hostedInvoiceUrl: 'https://billing.example.test/invoices/in_01HX2EXAMPLE',\n },\n response: { ...invoiceRefExample, status: InvoiceStatus.OPEN },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Sync status/total/url fields when webhooks arrive.',\n outcome: 'Patched provider-mirrored fields.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The invoice ref’s provider-mirrored fields (status, total, urls) were synced and the updated record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The synced fields fail schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller holds no role this operation names. Invoice mirrors are synchronised by the engine\\'s billing provider-event handler, acting with the handler-only `ORG_BILLING_PROVIDER_EVENTS` / `APP_BILLING_PROVIDER_EVENTS` role.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No invoice ref exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: ['Line-item detail lives at the provider — this row is intentionally shallow.'],\n }),\n { resourcePrimaryScope: invResourcePrimaryScopeByResourceType[resourceType] },\n );\n}\n\nfunction buildInvoiceRefSpec(resourceType: InvResourceType, memberName: InvResourceTypeMember) {\n const base = buildInvoiceRefBase(resourceType, memberName);\n const main = resolveInvUI(billingMainPresets as Partial<Record<string, unknown>>, resourceType, 'billingMainPresets');\n const admin = resolveInvUI(billingAdminPresets as Partial<Record<string, unknown>>, resourceType, 'billingAdminPresets');\n return resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)),\n base,\n () => ({\n label: { purpose: 'Preset builds `Invoice ${status}` as a readable list label.' },\n views: {\n [Op.LIST]: { purpose: 'List op present in merged preset `views` as non-addressable — document for overlay alignment.', whenToUse: 'Account invoice history surfaces when wired.' },\n [Op.READ]: { purpose: 'Read op present in merged preset `views` as non-addressable.', whenToUse: 'Invoice detail drawer from list selection.' },\n },\n }),\n );\n}\n\nexport const organizationInvoiceRefsResourceSpecification = buildInvoiceRefSpec(\n CoreResourceType.ORGANIZATION_INVOICE_REFS,\n 'ORGANIZATION_INVOICE_REFS',\n);\n\nexport const userInvoiceRefsResourceSpecification = buildInvoiceRefSpec(CoreResourceType.USER_INVOICE_REFS, 'USER_INVOICE_REFS');\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prices.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/prices.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,eAAe,EAEf,YAAY,EAEZ,cAAc,EACd,oBAAoB,EAErB,MAAM,uBAAuB,CAAC;AA8K/B,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"prices.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/prices.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,eAAe,EAEf,YAAY,EAEZ,cAAc,EACd,oBAAoB,EAErB,MAAM,uBAAuB,CAAC;AA8K/B,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;iCAuBvC,CAAC"}
|
|
@@ -100,10 +100,10 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
|
|
|
100
100
|
{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The price offer was created under its product and is returned with its server-assigned `priceId`.' },
|
|
101
101
|
],
|
|
102
102
|
errorScenarios: [
|
|
103
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The price payload fails schema validation (e.g. a TIERED model with no `tiers`, or a missing `unitPrice` for FLAT/PER_UNIT).'
|
|
103
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The price payload fails schema validation (e.g. a TIERED model with no `tiers`, or a missing `unitPrice` for FLAT/PER_UNIT).' },
|
|
104
104
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to extend the price catalog.' },
|
|
105
105
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `productId` does not exist in the catalog.' },
|
|
106
|
-
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'A price already maps to the same provider price id (duplicate provider sync target).'
|
|
106
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'A price already maps to the same provider price id (duplicate provider sync target).' },
|
|
107
107
|
],
|
|
108
108
|
idempotent: false,
|
|
109
109
|
examples: [
|
|
@@ -136,7 +136,7 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
|
|
|
136
136
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The price record was patched (activation / default flag / money fields) and the updated DTO is returned.' },
|
|
137
137
|
],
|
|
138
138
|
errorScenarios: [
|
|
139
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.'
|
|
139
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },
|
|
140
140
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the price catalog.' },
|
|
141
141
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },
|
|
142
142
|
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The price is already synced/locked at the provider in a way that forbids mutating immutable money fields (provider prices are immutable after creation).' },
|
|
@@ -158,15 +158,18 @@ const pricesBase = resourceSpecification(pricesFactory, PriceSchema, ({ schemaSh
|
|
|
158
158
|
],
|
|
159
159
|
}), { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION });
|
|
160
160
|
export const pricesResourceSpecification = resourceSpecificationFromFrontendConfiguration(mergeResourceFrontendConfigurations(resourceFrontendConfiguration(pricesMainUI), resourceFrontendConfiguration(pricesAdminUI)), pricesBase, () => ({
|
|
161
|
-
label: { purpose: 'Preset `getFrontendResourceLabel`
|
|
161
|
+
label: { purpose: 'Preset `getFrontendResourceLabel` names a price by its pricing model and, when it recurs, its billing interval — both in the application\'s own enum words; a one-time price is named by its model alone.' },
|
|
162
162
|
layout: {
|
|
163
163
|
purpose: 'Section refs `pricing`, `tiers`, `tax`, `availability` in billing presets: money + cadence, tier ladders, tax behavior, default/active flags.',
|
|
164
|
-
|
|
164
|
+
headerPurpose: 'The READ identity line: the model (and cadence) as the title and the availability (Active / Inactive) as a word beside it.',
|
|
165
|
+
displayPurpose: 'Settings rows, no section descriptions. The `pricing` card has no heading and carries the amount, cadence and default flag; `tiers` and `tax` render only when the price holds them. The owning product is not repeated — a price is read inside its product. Merged admin adds LIST+READ+UPDATE (non-addressable) for catalogue admin.',
|
|
166
|
+
summaryPurpose: 'A card in the product\'s Prices tab: the amount, the cadence and the model badge, bare.',
|
|
167
|
+
editPurpose: 'The model takes the focus; `tiers` keeps its description because those fields apply to some models only.',
|
|
165
168
|
sections: {
|
|
166
|
-
pricing: { purpose: 'Model, `unitPrice`, and interval for the headline commercial terms.', whenToUse: 'Checkout price selection and subscription diff tools.', textSlots: { title: { purpose: 'Pricing block
|
|
167
|
-
tiers: { purpose: 'Volume tiers, package size, and usage aggregation for advanced models.', whenToUse: 'Metered and tiered SKUs only.', textSlots: { title: { purpose: 'Tiers block.' }, description: { purpose: '
|
|
168
|
-
tax: { purpose: 'Tax display behavior on invoices for this price.', whenToUse: 'Jurisdictional checkout messaging.', textSlots: { title: { purpose: 'Tax block.' }
|
|
169
|
-
availability: { purpose: '`isDefault` and `isActive`
|
|
169
|
+
pricing: { purpose: 'Model, `unitPrice`, and interval for the headline commercial terms.', whenToUse: 'Checkout price selection and subscription diff tools.', textSlots: { title: { purpose: 'Pricing block (edit form only; the read card has no heading).' } } },
|
|
170
|
+
tiers: { purpose: 'Volume tiers, package size, and usage aggregation for advanced models.', whenToUse: 'Metered and tiered SKUs only.', textSlots: { title: { purpose: 'Tiers block.' }, description: { purpose: 'Edit prompt: only tiered, graduated, package and metered prices use these fields.' } } },
|
|
171
|
+
tax: { purpose: 'Tax display behavior on invoices for this price.', whenToUse: 'Jurisdictional checkout messaging.', textSlots: { title: { purpose: 'Tax block.' } } },
|
|
172
|
+
availability: { purpose: '`isDefault` and `isActive` switches on the form; on read the default flag sits in the pricing card and availability in the header.', whenToUse: 'When multiple active prices per product are normal (regional, promo base, etc.).', textSlots: { title: { purpose: 'Availability block (edit form).' } } },
|
|
170
173
|
},
|
|
171
174
|
},
|
|
172
175
|
views: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prices.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/prices.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,IAAI,iBAAiB,EAClD,4BAA4B,IAAI,gBAAgB,GACjD,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAA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AAE,yGAAyG,EAAE,EAAE,EAAE;SAChY;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,2BAA2B,EAAE;QAC3I,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,mCAAmC,EAAE;KACpJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n pricesAdminResourceUIBehavior as pricesAdminSource,\n pricesMainResourceUIBehavior as pricesMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n BillingInterval,\n PriceSchema,\n PricingModel,\n ResourcePrimaryScope,\n TaxDisplayMode,\n UsageAggregationType,\n pricesResourceConfiguration_InitializationFactory as pricesFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof pricesFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst pricesMainUI = pricesMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst pricesAdminUI = pricesAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst pricesBase = resourceSpecification<undefined, Core, Main>(\n pricesFactory,\n PriceSchema,\n ({ schemaShape }) => ({\n purpose: 'One way to pay for a product: its pricing model, amount, currency, billing interval and tiers. Checkout and subscriptions refer to a price by its identifier.',\n businessRole: 'Binds a catalog product to a billable money shape (flat, per-unit, tiered, …) the provider can invoice.',\n lifecycleRole: 'Admin-managed: created with products; activation toggles hide from new purchases without mutating old subscriptions in typical flows.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PriceSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'pricesResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PRICES' },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'pricesMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'pricesAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Price record id; referenced as `priceId` on subscription items.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n productId: schemaShape.productId.stringSpec({ meaning: 'FK to the owning `PRODUCTS` document.', importance: FieldSemanticImportance.PRIMARY }),\n model: schemaShape.model.enumSpec({\n meaning: 'Stripe-style pricing model for how quantity maps to line items.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PricingModel', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PricingModel.FLAT]: { meaning: 'One fixed price without per-seat scaling.' },\n [PricingModel.PER_UNIT]: { meaning: 'Linear in quantity (seats, tokens bucket).' },\n [PricingModel.TIERED]: { meaning: 'Volume pricing: the reached tier supplies the unit rate for the whole quantity.' },\n [PricingModel.GRADUATED]: { meaning: 'Graduated pricing: each quantity bracket is priced independently and the bracket amounts are added.' },\n [PricingModel.PACKAGE]: { meaning: 'Blocks of units sold as packages.' },\n },\n }),\n unitPrice: schemaShape.unitPrice.objectSpec({ meaning: 'Money object (amount + currency) for FLAT/PER_UNIT models; not used for pure tiered/graduated records that rely on `tiers` instead.' }),\n interval: schemaShape.interval.enumSpec({\n meaning: 'Billing period anchor when recurring.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingInterval', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [BillingInterval.MONTH]: { meaning: 'Monthly cadence at provider.' },\n [BillingInterval.YEAR]: { meaning: 'Annual cadence at provider.' },\n },\n }),\n intervalCount: schemaShape.intervalCount.numberSpec({ meaning: 'Multiplier on interval (e.g. every 3 months).' }),\n tiers: schemaShape.tiers.arraySpec({ meaning: 'Tier ladder for TIERED/GRADUATED models with per-tier money blocks.', elementMeaning: 'One `PriceTierSchema` row with `upTo`, `unitPrice`, and `flatPrice` money objects.' }),\n packageSize: schemaShape.packageSize.numberSpec({ meaning: 'Units per price package for PACKAGE model pricing.' }),\n usageAggregation: schemaShape.usageAggregation.enumSpec({\n meaning:\n 'Authored intent for how a provider meter should roll up usage. The current application metering flush always groups pending local records by account and product and sums their quantities; it does not consume this field, so the provider meter configuration and observed invoice remain the effective billing proof.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'UsageAggregationType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [UsageAggregationType.SUM]: { meaning: 'Sum raw quantities in the period.' },\n [UsageAggregationType.MAX]: { meaning: 'Use peak usage in the period when the price model calls for it.' },\n [UsageAggregationType.LAST]: { meaning: 'Use the last reported sample in the window for certain meter designs.' },\n },\n }),\n taxBehavior: schemaShape.taxBehavior.enumSpec({\n meaning: 'Per-price tax display — overrides product-level `taxDisplayMode` when set.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'TaxDisplayMode', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [TaxDisplayMode.EXCLUSIVE]: { meaning: 'HT list amounts before tax in invoices using this price.' },\n [TaxDisplayMode.INCLUSIVE]: { meaning: 'TTC amounts embedded in the published price point.' },\n },\n }),\n providerPriceId: schemaShape.providerPriceId.stringSpec({ meaning: 'Provider price id for sync; backend-only in many responses.' }),\n isDefault: schemaShape.isDefault.booleanSpec({ meaning: 'Preferred default price for UIs that pick one price per product if multiple exist.' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether new checkouts can select this price when multiple exist.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read price details for plan pickers, invoice lines, and admin audit.',\n outcome: 'Money + interval + tier blocks per schema.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was found and its money / interval / tier blocks are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'List prices; often filter by `productId` in application code.',\n outcome: 'All offers for a product in admin.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of price offers, optionally narrowed by `productId`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to browse the full price catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Add a new offer row under a product when catalog expands.',\n outcome: 'New price id in catalog.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The price offer was created under its product and is returned with its server-assigned `priceId`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The price payload fails schema validation (e.g. a TIERED model with no `tiers`, or a missing `unitPrice` for FLAT/PER_UNIT).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to extend the price catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `productId` does not exist in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A price already maps to the same provider price id (duplicate provider sync target).', errorCode: 'PROVIDER_PRICE_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Add a recurring per-seat monthly price to a product',\n request: {\n productId: 'prod_01HX2…',\n model: PricingModel.PER_UNIT,\n unitPrice: { amount: 1200, currency: 'usd' },\n interval: BillingInterval.MONTH,\n intervalCount: 1,\n isDefault: true,\n isActive: true,\n },\n response: {\n _id: 'price_01HX2…',\n productId: 'prod_01HX2…',\n model: PricingModel.PER_UNIT,\n interval: BillingInterval.MONTH,\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Change activation, default flag, or money fields in controlled admin flows.',\n outcome: 'Patched row — verify provider sync rules before claiming invoices update retroactively.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was patched (activation / default flag / money fields) and the updated DTO is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the price catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The price is already synced/locked at the provider in a way that forbids mutating immutable money fields (provider prices are immutable after creation).' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the price row when its owning product is deleted (composition `onParentDelete` cascade).',\n outcome: 'Every price under the product is removed together with the product — the composition parts do not outlive their whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was deleted as part of the owning product’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (ORG_OWNER) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Tax behavior and tier arrays can be large — UI should paginate or collapse in admin when many tiers exist.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const pricesResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(pricesMainUI), resourceFrontendConfiguration(pricesAdminUI)),\n pricesBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` uses `model — interval` (or one-time) for a compact sublabel under the product context.' },\n layout: {\n purpose: 'Section refs `pricing`, `tiers`, `tax`, `availability` in billing presets: money + cadence, tier ladders, tax behavior, default/active flags.',\n displayPurpose: 'Merged admin adds LIST+READ `views` (non-addressable) on top of main empty-views for catalog admin browse.',\n sections: {\n pricing: { purpose: 'Model, `unitPrice`, and interval for the headline commercial terms.', whenToUse: 'Checkout price selection and subscription diff tools.', textSlots: { title: { purpose: 'Pricing block.' }, description: { purpose: 'Provider ids may exist as backend-only fields in implementation — not in this spec layer.' } } },\n tiers: { purpose: 'Volume tiers, package size, and usage aggregation for advanced models.', whenToUse: 'Metered and tiered SKUs only.', textSlots: { title: { purpose: 'Tiers block.' }, description: { purpose: 'Empty in flat pricing — UI should not imply misconfiguration when absent.' } } },\n tax: { purpose: 'Tax display behavior on invoices for this price.', whenToUse: 'Jurisdictional checkout messaging.', textSlots: { title: { purpose: 'Tax block.' }, description: { purpose: 'Not a legal tax engine in Wildo — provider calculates actual tax.' } } },\n availability: { purpose: '`isDefault` and `isActive` to steer which price auto-selects in UIs.', whenToUse: 'When multiple active prices per product are normal (regional, promo base, etc.).', textSlots: { title: { purpose: 'Availability block.' }, description: { purpose: 'Deactivating a price does not by itself change existing subscription items until change-plan flows run.' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin LIST view entry (non-addressable in billing `views` wiring).', whenToUse: 'Catalog admin for prices.' },\n [Op.READ]: { purpose: 'Merged admin READ view entry (non-addressable in billing `views` wiring).', whenToUse: 'Admin drill-down on one price id.' },\n },\n }),\n);\n"]}
|
|
1
|
+
{"version":3,"file":"prices.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/prices.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,IAAI,iBAAiB,EAClD,4BAA4B,IAAI,gBAAgB,GACjD,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,eAAe,EACf,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,iDAAiD,IAAI,aAAa,GACnE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,MAAM,YAAY,GAAG,gBAAmE,CAAC;AACzF,MAAM,aAAa,GAAG,iBAAoE,CAAC;AAE3F,MAAM,UAAU,GAAG,qBAAqB,CACtC,aAAa,EACb,WAAW,EACX,C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E,EAAE,OAAO,EAAE,qEAAqE,EAAE,SAAS,EAAE,uDAAuD,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,+DAA+D,EAAE,EAAE,EAAE;YACnQ,KAAK,EAAE,EAAE,OAAO,EAAE,wEAAwE,EAAE,SAAS,EAAE,+BAA+B,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,mFAAmF,EAAE,EAAE,EAAE;YAC1S,GAAG,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE,SAAS,EAAE,oCAAoC,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;YACtK,YAAY,EAAE,EAAE,OAAO,EAAE,oIAAoI,EAAE,SAAS,EAAE,kFAAkF,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iCAAiC,EAAE,EAAE,EAAE;SACrU;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,2BAA2B,EAAE;QAC3I,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2EAA2E,EAAE,SAAS,EAAE,mCAAmC,EAAE;KACpJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n pricesAdminResourceUIBehavior as pricesAdminSource,\n pricesMainResourceUIBehavior as pricesMainSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n BillingInterval,\n PriceSchema,\n PricingModel,\n ResourcePrimaryScope,\n TaxDisplayMode,\n UsageAggregationType,\n pricesResourceConfiguration_InitializationFactory as pricesFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof pricesFactory>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\nconst pricesMainUI = pricesMainSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\nconst pricesAdminUI = pricesAdminSource as ResourceUIBehaviorConfig<undefined, Core, Main>;\n\nconst pricesBase = resourceSpecification<undefined, Core, Main>(\n pricesFactory,\n PriceSchema,\n ({ schemaShape }) => ({\n purpose: 'One way to pay for a product: its pricing model, amount, currency, billing interval and tiers. Checkout and subscriptions refer to a price by its identifier.',\n businessRole: 'Binds a catalog product to a billable money shape (flat, per-unit, tiered, …) the provider can invoice.',\n lifecycleRole: 'Admin-managed: created with products; activation toggles hide from new purchases without mutating old subscriptions in typical flows.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.BILLING,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'PriceSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'pricesResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM }, memberName: 'PRICES' },\n operationVocabulary: { coreEnum: { packageName: '@wildo-ai/saas-models', exportName: 'CoreResourceOperation', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM } },\n frontendConfigurationSources: [\n { packageName: '@wildo-ai/presets-components', exportName: 'pricesMainResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n { packageName: '@wildo-ai/presets-components', exportName: 'pricesAdminResourceUIBehavior', symbolKind: CodeSymbolKind.UI_BEHAVIOR },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Price record id; referenced as `priceId` on subscription items.', importance: FieldSemanticImportance.PRIMARY, semanticRole: 'identifier' }),\n productId: schemaShape.productId.stringSpec({ meaning: 'FK to the owning `PRODUCTS` document.', importance: FieldSemanticImportance.PRIMARY }),\n model: schemaShape.model.enumSpec({\n meaning: 'Stripe-style pricing model for how quantity maps to line items.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'PricingModel', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [PricingModel.FLAT]: { meaning: 'One fixed price without per-seat scaling.' },\n [PricingModel.PER_UNIT]: { meaning: 'Linear in quantity (seats, tokens bucket).' },\n [PricingModel.TIERED]: { meaning: 'Volume pricing: the reached tier supplies the unit rate for the whole quantity.' },\n [PricingModel.GRADUATED]: { meaning: 'Graduated pricing: each quantity bracket is priced independently and the bracket amounts are added.' },\n [PricingModel.PACKAGE]: { meaning: 'Blocks of units sold as packages.' },\n },\n }),\n unitPrice: schemaShape.unitPrice.objectSpec({ meaning: 'Money object (amount + currency) for FLAT/PER_UNIT models; not used for pure tiered/graduated records that rely on `tiers` instead.' }),\n interval: schemaShape.interval.enumSpec({\n meaning: 'Billing period anchor when recurring.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'BillingInterval', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [BillingInterval.MONTH]: { meaning: 'Monthly cadence at provider.' },\n [BillingInterval.YEAR]: { meaning: 'Annual cadence at provider.' },\n },\n }),\n intervalCount: schemaShape.intervalCount.numberSpec({ meaning: 'Multiplier on interval (e.g. every 3 months).' }),\n tiers: schemaShape.tiers.arraySpec({ meaning: 'Tier ladder for TIERED/GRADUATED models with per-tier money blocks.', elementMeaning: 'One `PriceTierSchema` row with `upTo`, `unitPrice`, and `flatPrice` money objects.' }),\n packageSize: schemaShape.packageSize.numberSpec({ meaning: 'Units per price package for PACKAGE model pricing.' }),\n usageAggregation: schemaShape.usageAggregation.enumSpec({\n meaning:\n 'Authored intent for how a provider meter should roll up usage. The current application metering flush always groups pending local records by account and product and sums their quantities; it does not consume this field, so the provider meter configuration and observed invoice remain the effective billing proof.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'UsageAggregationType', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [UsageAggregationType.SUM]: { meaning: 'Sum raw quantities in the period.' },\n [UsageAggregationType.MAX]: { meaning: 'Use peak usage in the period when the price model calls for it.' },\n [UsageAggregationType.LAST]: { meaning: 'Use the last reported sample in the window for certain meter designs.' },\n },\n }),\n taxBehavior: schemaShape.taxBehavior.enumSpec({\n meaning: 'Per-price tax display — overrides product-level `taxDisplayMode` when set.',\n enumDeclaration: { packageName: '@wildo-ai/saas-models', exportName: 'TaxDisplayMode', symbolKind: CodeSymbolKind.ENUM, declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM },\n values: {\n [TaxDisplayMode.EXCLUSIVE]: { meaning: 'HT list amounts before tax in invoices using this price.' },\n [TaxDisplayMode.INCLUSIVE]: { meaning: 'TTC amounts embedded in the published price point.' },\n },\n }),\n providerPriceId: schemaShape.providerPriceId.stringSpec({ meaning: 'Provider price id for sync; backend-only in many responses.' }),\n isDefault: schemaShape.isDefault.booleanSpec({ meaning: 'Preferred default price for UIs that pick one price per product if multiple exist.' }),\n isActive: schemaShape.isActive.booleanSpec({ meaning: 'Whether new checkouts can select this price when multiple exist.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'Record creation time.', temporalRole: 'creation' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read price details for plan pickers, invoice lines, and admin audit.',\n outcome: 'Money + interval + tier blocks per schema.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was found and its money / interval / tier blocks are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'List prices; often filter by `productId` in application code.',\n outcome: 'All offers for a product in admin.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of price offers, optionally narrowed by `productId`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to browse the full price catalog.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Add a new offer row under a product when catalog expands.',\n outcome: 'New price id in catalog.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The price offer was created under its product and is returned with its server-assigned `priceId`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The price payload fails schema validation (e.g. a TIERED model with no `tiers`, or a missing `unitPrice` for FLAT/PER_UNIT).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to extend the price catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent `productId` does not exist in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A price already maps to the same provider price id (duplicate provider sync target).' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Add a recurring per-seat monthly price to a product',\n request: {\n productId: 'prod_01HX2…',\n model: PricingModel.PER_UNIT,\n unitPrice: { amount: 1200, currency: 'usd' },\n interval: BillingInterval.MONTH,\n intervalCount: 1,\n isDefault: true,\n isActive: true,\n },\n response: {\n _id: 'price_01HX2…',\n productId: 'prod_01HX2…',\n model: PricingModel.PER_UNIT,\n interval: BillingInterval.MONTH,\n isActive: true,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Change activation, default flag, or money fields in controlled admin flows.',\n outcome: 'Patched row — verify provider sync rules before claiming invoices update retroactively.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was patched (activation / default flag / money fields) and the updated DTO is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/admin entitlement required to mutate the price catalog.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No price exists for the supplied id in the catalog.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The price is already synced/locked at the provider in a way that forbids mutating immutable money fields (provider prices are immutable after creation).' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the price row when its owning product is deleted (composition `onParentDelete` cascade).',\n outcome: 'Every price under the product is removed together with the product — the composition parts do not outlive their whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The price record was deleted as part of the owning product’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (ORG_OWNER) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Tax behavior and tier arrays can be large — UI should paginate or collapse in admin when many tiers exist.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\nexport const pricesResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(pricesMainUI), resourceFrontendConfiguration(pricesAdminUI)),\n pricesBase,\n () => ({\n label: { purpose: 'Preset `getFrontendResourceLabel` names a price by its pricing model and, when it recurs, its billing interval — both in the application\\'s own enum words; a one-time price is named by its model alone.' },\n layout: {\n purpose: 'Section refs `pricing`, `tiers`, `tax`, `availability` in billing presets: money + cadence, tier ladders, tax behavior, default/active flags.',\n headerPurpose: 'The READ identity line: the model (and cadence) as the title and the availability (Active / Inactive) as a word beside it.',\n displayPurpose: 'Settings rows, no section descriptions. The `pricing` card has no heading and carries the amount, cadence and default flag; `tiers` and `tax` render only when the price holds them. The owning product is not repeated — a price is read inside its product. Merged admin adds LIST+READ+UPDATE (non-addressable) for catalogue admin.',\n summaryPurpose: 'A card in the product\\'s Prices tab: the amount, the cadence and the model badge, bare.',\n editPurpose: 'The model takes the focus; `tiers` keeps its description because those fields apply to some models only.',\n sections: {\n pricing: { purpose: 'Model, `unitPrice`, and interval for the headline commercial terms.', whenToUse: 'Checkout price selection and subscription diff tools.', textSlots: { title: { purpose: 'Pricing block (edit form only; the read card has no heading).' } } },\n tiers: { purpose: 'Volume tiers, package size, and usage aggregation for advanced models.', whenToUse: 'Metered and tiered SKUs only.', textSlots: { title: { purpose: 'Tiers block.' }, description: { purpose: 'Edit prompt: only tiered, graduated, package and metered prices use these fields.' } } },\n tax: { purpose: 'Tax display behavior on invoices for this price.', whenToUse: 'Jurisdictional checkout messaging.', textSlots: { title: { purpose: 'Tax block.' } } },\n availability: { purpose: '`isDefault` and `isActive` switches on the form; on read the default flag sits in the pricing card and availability in the header.', whenToUse: 'When multiple active prices per product are normal (regional, promo base, etc.).', textSlots: { title: { purpose: 'Availability block (edit form).' } } },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'Merged admin LIST view entry (non-addressable in billing `views` wiring).', whenToUse: 'Catalog admin for prices.' },\n [Op.READ]: { purpose: 'Merged admin READ view entry (non-addressable in billing `views` wiring).', whenToUse: 'Admin drill-down on one price id.' },\n },\n }),\n);\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CoreResourceOperation as Op, ProductType, ResourcePrimaryScope, TaxDisplayMode } from '@wildo-ai/saas-models';
|
|
1
|
+
import { CoreResourceOperation as Op, ProductType, ResourcePrimaryScope, TaxDisplayMode, ProductPriceDisclosure, ProductAvailability } from '@wildo-ai/saas-models';
|
|
2
2
|
export declare const productsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<undefined, Op.READ | Op.UPDATE | Op.CREATE | Op.LIST | Op.SEARCH, import("zod").ZodObject<{
|
|
3
3
|
_id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
|
|
4
4
|
type: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodEnum<typeof ProductType>>>>>;
|
|
5
5
|
key: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>;
|
|
6
6
|
targetScopes: import("zod").ZodArray<import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").ResourcePrimaryScope>>;
|
|
7
|
-
grantedFeatures: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString
|
|
8
|
-
grantedLimits: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString
|
|
9
|
-
value: import("zod").ZodNumber
|
|
7
|
+
grantedFeatures: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodArray<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>>;
|
|
8
|
+
grantedLimits: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodRecord<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>, import("zod").ZodObject<{
|
|
9
|
+
value: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodNumber>;
|
|
10
10
|
mode: import("zod").ZodDefault<import("zod").ZodEnum<typeof import("@wildo-ai/saas-models").LimitGrantMode>>;
|
|
11
11
|
}, import("zod/v4/core").$strip>>>>;
|
|
12
12
|
planTier: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
@@ -49,6 +49,9 @@ export declare const productsResourceSpecification: import("../../../_core").Res
|
|
|
49
49
|
sortOrder: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
50
50
|
isPublic: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
51
51
|
isActive: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>>;
|
|
52
|
+
isRecommended: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>>;
|
|
53
|
+
priceDisclosure: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodEnum<typeof ProductPriceDisclosure>>>>;
|
|
54
|
+
availability: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodEnum<typeof ProductAvailability>>>>>;
|
|
52
55
|
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
53
56
|
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
|
|
54
57
|
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":"products.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/products.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,WAAW,EAEX,oBAAoB,EACpB,cAAc,
|
|
1
|
+
{"version":3,"file":"products.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/billing/resources/products.resource.specification.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,WAAW,EAEX,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EAEpB,MAAM,uBAAuB,CAAC;AAgM/B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAuBzC,CAAC"}
|