@wildo-ai/saas-models 1.1.8 → 1.1.10
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/_inspect.d.ts.map +1 -1
- package/dist/esm/_inspect.js.map +1 -1
- package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-metadata.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/application-subject.shared.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-subject.shared.schemas.js.map +1 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/applications-context.schemas.d.ts +68 -2
- package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications-context.schemas.js.map +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
- package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.schemas.js.map +1 -1
- package/dist/esm/billing/promotions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/promotions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/promotions.shared.schemas.js.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -1
- package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -1
- package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-flush-evidence.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
- package/dist/esm/charts/aggregation-query.shared.schemas.d.ts.map +1 -1
- package/dist/esm/charts/aggregation-query.shared.schemas.js.map +1 -1
- package/dist/esm/charts/aggregation.shared.definitions.d.ts.map +1 -1
- package/dist/esm/charts/aggregation.shared.definitions.js.map +1 -1
- package/dist/esm/charts/chart-definition-builder.shared.d.ts.map +1 -1
- package/dist/esm/charts/chart-definition-builder.shared.js.map +1 -1
- package/dist/esm/companion/artifact-placement.shared.definitions.d.ts.map +1 -1
- package/dist/esm/companion/artifact-placement.shared.definitions.js.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +13 -0
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.js +13 -0
- package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
- package/dist/esm/companion/shared-library-companion.shared.definitions.d.ts.map +1 -1
- package/dist/esm/companion/shared-library-companion.shared.definitions.js.map +1 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +5 -2
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-event-classification.shared.d.ts +28 -0
- package/dist/esm/compliance/audit-trails/audit-event-classification.shared.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-event-classification.shared.js +30 -0
- package/dist/esm/compliance/audit-trails/audit-event-classification.shared.js.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +2 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +20 -0
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +40 -0
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +1 -14
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +1 -16
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts +17 -4
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +25 -5
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/data-classification/data-classification.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/data-classification/data-classification.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts +0 -50
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.js +4 -51
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/public-governed-documents.shared.d.ts +67 -0
- package/dist/esm/compliance/documents/public-governed-documents.shared.d.ts.map +1 -0
- package/dist/esm/compliance/documents/public-governed-documents.shared.js +69 -0
- package/dist/esm/compliance/documents/public-governed-documents.shared.js.map +1 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/consent-purposes.shared.js.map +1 -1
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js +1 -1
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/jurisdiction-containment.shared.d.ts +32 -0
- package/dist/esm/compliance/privacy/jurisdiction-containment.shared.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/jurisdiction-containment.shared.js +46 -0
- package/dist/esm/compliance/privacy/jurisdiction-containment.shared.js.map +1 -0
- package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/legal-notice-obligation.shared.d.ts +47 -0
- package/dist/esm/compliance/privacy/legal-notice-obligation.shared.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/legal-notice-obligation.shared.js +54 -0
- package/dist/esm/compliance/privacy/legal-notice-obligation.shared.js.map +1 -0
- package/dist/esm/compliance/privacy/legal-notice.shared.d.ts +105 -0
- package/dist/esm/compliance/privacy/legal-notice.shared.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/legal-notice.shared.js +112 -0
- package/dist/esm/compliance/privacy/legal-notice.shared.js.map +1 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +1 -27
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +2 -41
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +83 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +97 -0
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts +8 -8
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/sharing.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/sharing.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/review-cadence.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/review-cadence.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/risk-posture.shared.schemas.d.ts +15 -3
- package/dist/esm/compliance/risk-posture.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/risk-posture.shared.schemas.js +14 -2
- package/dist/esm/compliance/risk-posture.shared.schemas.js.map +1 -1
- package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +63 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.js +11 -0
- package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
- package/dist/esm/config/app-frontend-type.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/app-frontend-type.shared.schemas.js.map +1 -1
- package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
- package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
- package/dist/esm/config/brand-assets.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/brand-assets.shared.schemas.js.map +1 -1
- package/dist/esm/config/configuration-validation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/configuration-validation.shared.schemas.js.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +16 -16
- package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/chart-definition.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
- package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/onboarding.shared.schemas.js.map +1 -1
- package/dist/esm/config/postgresql.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/postgresql.shared.schemas.js.map +1 -1
- package/dist/esm/config/registration-acquisition-policy.shared.utils.d.ts.map +1 -1
- package/dist/esm/config/registration-acquisition-policy.shared.utils.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/crdt/crdt-merge.shared.utils.d.ts.map +1 -1
- package/dist/esm/crdt/crdt-merge.shared.utils.js.map +1 -1
- package/dist/esm/data-seeding/data-seeding-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/data-seeding-config.shared.schemas.js.map +1 -1
- package/dist/esm/errors/caught-error-description.shared.utils.d.ts +5 -1
- package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/caught-error-description.shared.utils.js +48 -4
- package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
- package/dist/esm/errors/errors.shared.definitions.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.definitions.js.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
- package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.utils.js.map +1 -1
- package/dist/esm/errors/resource-access-forbidden.shared.error.d.ts.map +1 -1
- package/dist/esm/errors/resource-access-forbidden.shared.error.js.map +1 -1
- package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
- package/dist/esm/errors/zod-issue-formatting.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/zod-issue-formatting.shared.utils.js.map +1 -1
- package/dist/esm/exports/tabular-csv.shared.utils.d.ts.map +1 -1
- package/dist/esm/exports/tabular-csv.shared.utils.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
- package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -1
- package/dist/esm/external-data.exports.d.ts.map +1 -1
- package/dist/esm/external-data.exports.js.map +1 -1
- package/dist/esm/external-providers/compose-provider-registry.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/compose-provider-registry.shared.js.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
- package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
- package/dist/esm/external-providers/external-providers.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/external-providers.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +34 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
- package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
- package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -1
- package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -1
- package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -1
- package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -1
- package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js.map +1 -1
- package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/features/connected-feature.example.d.ts.map +1 -1
- package/dist/esm/features/connected-feature.example.js.map +1 -1
- package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
- package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
- package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
- package/dist/esm/features/feature-builders.shared.js.map +1 -1
- package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
- package/dist/esm/features/feature-registry.shared.d.ts.map +1 -1
- package/dist/esm/features/feature-registry.shared.js.map +1 -1
- package/dist/esm/features/feature-resolution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/feature-resolution.shared.schemas.js.map +1 -1
- package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -1
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -1
- package/dist/esm/files/files.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/files/files.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/files.shared.schemas.js.map +1 -1
- package/dist/esm/files/files.shared.utils.d.ts.map +1 -1
- package/dist/esm/files/files.shared.utils.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +2 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.js +2 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.definitions.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/prompt-ir.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/prompt-ir.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -1
- package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts.map +1 -1
- package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js.map +1 -1
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
- package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-flow.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
- package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts +2 -2
- package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-config.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
- package/dist/esm/guidance/milestone-builders.shared.js.map +1 -1
- package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/milestone-definition.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-presentation.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
- package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts.map +1 -1
- package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js.map +1 -1
- package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -1
- package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -1
- package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -1
- package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -1
- package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -1
- package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -1
- package/dist/esm/i18n/interpolate-label-params.shared.utils.d.ts.map +1 -1
- package/dist/esm/i18n/interpolate-label-params.shared.utils.js.map +1 -1
- package/dist/esm/i18n/labelling.dto.shared.schemas.d.ts.map +1 -1
- package/dist/esm/i18n/labelling.dto.shared.schemas.js.map +1 -1
- package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -1
- package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -1
- package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -1
- package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -1
- package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -1
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.d.ts +128 -0
- package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.js +136 -0
- package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +45 -1
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +87 -2
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows.exports.d.ts +1 -0
- package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
- package/dist/esm/meta-workflows.exports.js +1 -0
- package/dist/esm/meta-workflows.exports.js.map +1 -1
- package/dist/esm/monitoring/monitoring.shared.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/monitoring.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/email/email-context.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-context.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/email/email-submission.shared.enums.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-submission.shared.enums.js.map +1 -1
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
- package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.d.ts +5 -3
- package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.js +5 -3
- package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/application-owner-organization.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-features.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-features.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-inheritance.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-inheritance.shared.js.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.example.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.example.js.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
- package/dist/esm/organizations/organization-units.shared.path.d.ts.map +1 -1
- package/dist/esm/organizations/organization-units.shared.path.js.map +1 -1
- package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-units.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-units.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
- package/dist/esm/public-runtime/index.d.ts +13 -0
- package/dist/esm/public-runtime/index.d.ts.map +1 -1
- package/dist/esm/public-runtime/index.js +13 -0
- package/dist/esm/public-runtime/index.js.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.d.ts +71 -2
- package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.js +85 -2
- package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.utils.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.utils.js.map +1 -1
- package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/queues.shared.schemas.js.map +1 -1
- package/dist/esm/queue/queues.shared.utils.d.ts.map +1 -1
- package/dist/esm/queue/queues.shared.utils.js.map +1 -1
- package/dist/esm/queue/rabbitmq-queue-args.shared.d.ts.map +1 -1
- package/dist/esm/queue/rabbitmq-queue-args.shared.js.map +1 -1
- package/dist/esm/rag/rag-retrieval-health.shared.d.ts.map +1 -1
- package/dist/esm/rag/rag-retrieval-health.shared.js.map +1 -1
- package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
- package/dist/esm/requests/header-keys.shared.js.map +1 -1
- package/dist/esm/requests/http-requests.shared.d.ts.map +1 -1
- package/dist/esm/requests/http-requests.shared.js.map +1 -1
- package/dist/esm/requests/idempotency-key.shared.d.ts.map +1 -1
- package/dist/esm/requests/idempotency-key.shared.js.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
- package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.d.ts +2 -2
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/child-operations.shared.schemas.js.map +1 -1
- package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -1
- package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -1
- package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/context-policy.shared.schemas.js.map +1 -1
- package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -1
- package/dist/esm/resources/relationship-display.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/relationship-display.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resource-status-lifecycle.example.d.ts +100 -0
- package/dist/esm/resources/resource-status-lifecycle.example.d.ts.map +1 -0
- package/dist/esm/resources/resource-status-lifecycle.example.js +156 -0
- package/dist/esm/resources/resource-status-lifecycle.example.js.map +1 -0
- package/dist/esm/resources/resources-config.shared.factory.d.ts +25 -1
- package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.js +31 -8
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +33 -0
- package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-serialization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-serialization.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.js.map +1 -1
- package/dist/esm/resources/utils/composition-seedability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/composition-seedability.validation.js.map +1 -1
- package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js.map +1 -1
- package/dist/esm/resources/utils/duplicate-relationship-registration.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/duplicate-relationship-registration.validation.js.map +1 -1
- package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -1
- package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js.map +1 -1
- package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/repository-dto-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/repository-dto-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/required-fk-fillability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/required-fk-fillability.validation.js.map +1 -1
- package/dist/esm/resources/utils/resource-operation-type-guards.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-operation-type-guards.utils.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.relationships.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.relationships.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.schemas.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.utils.js.map +1 -1
- package/dist/esm/resources/utils/resource-subtree.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-subtree.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-context-needs.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-context-needs.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-naming.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-naming.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +25 -0
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +47 -19
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.path.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.path.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-serialization.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-family-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-family-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-type-inference.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-type-inference.utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-type-utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-type-utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-variant-resolver.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-variant-resolver.utils.js.map +1 -1
- package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
- package/dist/esm/resources/utils/templatable-file-fields.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js.map +1 -1
- package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -1
- package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
- package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
- package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
- package/dist/esm/runtime/runtime.shared.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/runtime.shared.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.d.ts.map +1 -1
- package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.utils.js.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -1
- package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/password-blocklist.shared.utils.js.map +1 -1
- package/dist/esm/security/authentications/password-reset.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/password-reset.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/same-origin-redirect-path.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/same-origin-redirect-path.shared.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.application-roles.example.d.ts +37 -0
- package/dist/esm/security/authorizations/roles.application-roles.example.d.ts.map +1 -0
- package/dist/esm/security/authorizations/roles.application-roles.example.js +50 -0
- package/dist/esm/security/authorizations/roles.application-roles.example.js.map +1 -0
- package/dist/esm/security/authorizations/roles.shared.defaults.d.ts +13 -0
- package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.defaults.js +13 -0
- package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +29 -0
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js +28 -0
- package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
- package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -1
- package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.js.map +1 -1
- package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
- package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -1
- package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-env.shared.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js.map +1 -1
- package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
- package/dist/esm/testing/resource-config-builders.js.map +1 -1
- package/dist/esm/testing.d.ts.map +1 -1
- package/dist/esm/testing.js.map +1 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js.map +1 -1
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
- package/dist/esm/users/anonymous-users.shared.schema.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +2 -0
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-consent-decision.shared.utils.d.ts.map +1 -1
- package/dist/esm/users/user-consent-decision.shared.utils.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-preferences-reset.shared.utils.d.ts.map +1 -1
- package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/esm/__tests__/setup.d.ts +0 -2
- package/dist/esm/__tests__/setup.d.ts.map +0 -1
- package/dist/esm/__tests__/setup.js +0 -19
- package/dist/esm/__tests__/setup.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-account.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,oCAAoC,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrI,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,M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AAC,GAAG,EAAE,CAAC,QAAQ,CAAC,kJAAkJ,CAAC;qBAC1K,CAAC;iBACH,CAAC;SACH;QACD,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE;YACrC,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE;wBACf,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;wBACtF,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;qBACpD;oBACD,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,qBAAqB,EAAE,qBAAqB,CAAC,KAAK;oBAClD,sEAAsE;oBACtE,sEAAsE;oBACtE,sEAAsE;oBACtE,sDAAsD;oBACtD,iBAAiB,EAAE,0BAA0B;iBAC9C,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Billing Account Resource Configuration — Polymorphic\n *\n * Produces 3 factory functions (one per scope variant) via the polymorphic factory.\n * Spread into the registry factory map:\n * ...billingAccountsPolymorphicFactories\n *\n * @see polymorphic-scope-approach-A-expansion.md — Phase 3\n */\n\nimport { z } from 'zod';\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { BILLING_CHECKOUT_MAX_QUANTITY, BILLING_RESERVED_METADATA_KEY_PREFIX, ReferralStatus } from './billing-enums.shared.schemas';\nimport { ReferredRewardSchema } from './referral-reward.shared.schemas';\nimport { billingAccountsPolymorphicDeclaration } from './billing-account.shared.schemas';\nimport { BillingStateResponseSchema } from './billing-types.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\n\n// ── Custom Operations ────────────────────────────────────────────────\n\nexport enum BillingAccount_Operations {\n /** Create a Stripe Checkout Session for the user to complete payment */\n OPEN_CHECKOUT = 'open_checkout',\n /** Open the Stripe Customer Portal for self-service management */\n OPEN_PORTAL = 'open_portal',\n /** Fetch aggregated billing state (account, subscription, products, prices, credit pools) */\n GET_STATE = 'get_state',\n /**\n * Redeem another account's referral code (#1802). Only a new customer may: an account that has never\n * subscribed, is not already referred, and is not the referrer.\n */\n REDEEM_REFERRAL = 'redeem_referral',\n}\n\n// ── Request DTOs ─────────────────────────────────────────────────────\n\n/** Request DTO for OPEN_CHECKOUT. Trial duration is server-owned product/application policy, never a payer option. */\nexport const BillingAccount_OpenCheckoutRequestDto = z.object({\n productKey: z.string().min(1).describe(\"The key of the product to buy. It must be available for purchase and offered to this account's scope.\"),\n priceId: z.string().min(1).describe(\"The id of the price to buy the product at. It must be a price of that product.\"),\n successUrl: z.url().describe(\"Where the billing provider sends the customer after a completed checkout.\"),\n cancelUrl: z.url().describe(\"Where the billing provider sends the customer if they leave checkout without paying.\"),\n /**\n * Bounded by the same constant the webhook consumer honours. An unbounded quantity here would be\n * billed by the provider and then refused on the way back in, charging the customer for credits\n * that never arrive.\n */\n quantity: z.number().int().min(1).max(BILLING_CHECKOUT_MAX_QUANTITY).default(1).describe(\"How many units to buy, such as seats or credit packs. Defaults to 1.\"),\n promotionCode: z.string().optional().describe(\"A promotion code to apply. It is checked before checkout opens, and refused when it is unknown, inactive, outside its validity dates, used up, not valid for this product, or not set up with the billing provider. The checkout page accepts no code of its own.\"),\n /**\n * Caller-supplied tags mirrored to the provider for the application's own analytics or\n * reconciliation. They carry NO authority.\n *\n * Keys in the framework-reserved namespace are REFUSED here rather than silently dropped: the\n * caller is trying to write into the namespace that decides which billing account gets credited\n * and by how much, and an app developer who typed a reserved key deserves to be told, not to\n * watch their tag vanish. Refusal at the DTO is the loud, outermost half of the boundary; the\n * builder's write-reserved-last ordering and the consumer's read-only-reserved rule are the two\n * structural halves. See {@link BILLING_RESERVED_METADATA_KEY_PREFIX}.\n *\n * The refinement sits on the KEY schema, not on the record: it keeps the DTO a plain `ZodRecord`\n * for the OpenAPI projector and the request-validation pipeline, where a wrapping effect would\n * change the node type every consumer of this DTO narrows on.\n */\n metadata: z\n .record(\n z.string().refine(\n (key) => !key.startsWith(BILLING_RESERVED_METADATA_KEY_PREFIX),\n `Metadata keys starting with \"${BILLING_RESERVED_METADATA_KEY_PREFIX}\" are reserved by the framework and cannot be supplied by the caller`,\n ),\n z.string(),\n )\n .optional(),\n});\n\n/** Request DTO for REDEEM_REFERRAL (#1802). */\nexport const BillingAccount_RedeemReferralRequestDto = z.strictObject({\n referralCode: z.string().trim().min(1).max(64).describe('The referral code to redeem, as the referrer shared it.'),\n});\n\n/** Request DTO for OPEN_PORTAL operation */\nexport const BillingAccount_OpenPortalRequestDto = z.object({\n returnUrl: z.url().describe('Absolute URL the billing portal sends the customer back to when they leave it.'),\n});\n\n// =============================================================================\n// POLYMORPHIC FACTORY — 2 variants (org, user)\n// =============================================================================\n\n/**\n * Polymorphic factory map for billing accounts.\n * Spread into `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...billingAccountsPolymorphicFactories\n *\n * Produces entries for:\n * - organizationBillingAccounts\n * - userBillingAccounts\n */\nexport const billingAccountsPolymorphicFactories = createPolymorphicResourceConfigurations(\n billingAccountsPolymorphicDeclaration,\n {\n isSystemResource: true,\n // System-context CREATE opt-in (fail-closed default is FORBIDDEN). The billing\n // account is auto-created by `BillingStateBackendService.getState()` on first\n // access via `SystemAccessBackendService.createAsSystem` — a trusted in-process\n // write with no HTTP surface and no request context to seed the scope FK. That\n // path relocates the ACL onto the billing service (which has already resolved\n // the scope) and injects the scope FK (`organizationId` / `userId`) through the\n // execution context map. Resource-level and shared by BOTH scope variants\n // (org + user) per the polymorphic-resource contract on ResourceSystemAccessPolicy.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own billing account. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n // System-context LIST opt-in. Subject erasure must enumerate the erased person's billing\n // accounts to reach their provider customer (cancel subscriptions, anonymize, detach payment\n // methods). That runs with no request context — the subject is being erased — so it reads\n // through `SystemAccessBackendService.listAsSystem`, which is fail-closed and refuses a\n // resource that has not opted in here.\n //\n // Safe to grant: LIST is the READ side, and the erasure path filters by the subject's own\n // scope FK. The default LIST variant is API_CALL, so it resolves through\n // `getServiceOperationPathDefault` — a REPOSITORY_ONLY-only LIST would pass this grant and\n // then fail to resolve at erasure time, which is the failure mode this comment exists to\n // stop someone from reintroducing.\n list: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n /**\n * Subject erasure RETAINS this row and scrubs the provider customer id.\n *\n * The financial record is kept for the tax/audit obligation this family exists to serve, and — as the\n * family's authoring rule states — erasure scrubs the linked USER rather than these rows, because the\n * person is a foreign key. `providerCustomerId` is the exception the rule does not cover: it is a stable\n * handle that re-identifies the person INSIDE the payment provider, so it is personal data this row holds.\n * It takes `REMOVE`; everything else is retained.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is not a person — its owner FK names the ACTOR the\n * record belongs to — and the enum prescribes `NO_PRINCIPAL` for exactly that shape. The subject's own\n * session ends through the `USERS` row, which is `SELF_PRINCIPAL`.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n customOperation: BillingAccount_Operations,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n operationsConfiguration: {\n /*\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n * verb the impersonalize writer uses to stamp the retention markers.\n */\n [CoreResourceOperation.UPDATE_MANY]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n }],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [{\n // API_CALL: the billing account is a user-facing record (Settings Hub → Billing →\n // Account, and the resource presets' LIST/READ views). REPOSITORY_ONLY would strip\n // the op from the frontend registry and register no HTTP route. Writes (auto-create\n // + webhook sync) are INTERNAL_CALL — run through the service pipeline, no HTTP surface.\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN, CORE_ORG_ROLES.ORG_BILLING_PROVIDER_EVENTS],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER, CORE_APP_ROLES.APP_BILLING_PROVIDER_EVENTS],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN, CORE_ORG_ROLES.ORG_BILLING_PROVIDER_EVENTS],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER, CORE_APP_ROLES.APP_BILLING_PROVIDER_EVENTS],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n }],\n },\n [BillingAccount_Operations.OPEN_CHECKOUT]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingAccount_OpenCheckoutRequestDto,\n // Borrows UPDATE for its route/verb but returns the provider checkout\n // session, NOT the billing-account resource. Without this the DTO builder\n // would validate the service output against the resource schema and 500.\n customResponseDto: z.object({\n url: z.url().describe(\"The billing provider's hosted checkout page. Send the customer there to pay.\"),\n sessionId: z.string().describe(\"The billing provider's id for this checkout session.\"),\n }),\n }],\n },\n /*\n * #1802 — the account that was referred redeems the code. Refusals are the ones a person can act on:\n * an unusable code, and an account that cannot be referred. The rewards are the referrer's policy,\n * copied when the code was issued, and are reported back so the purchase screen can show them.\n */\n [BillingAccount_Operations.REDEEM_REFERRAL]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingAccount_RedeemReferralRequestDto,\n // Returns the redemption, not the billing account.\n customResponseDto: z.object({\n referralId: z.string().describe('The id of the referral that was redeemed.'),\n status: z.enum(ReferralStatus).systemEnum('ReferralStatus').describe('`accepted`: the account is now the referred side, and the rewards are granted when it pays its first invoice.'),\n referredReward: ReferredRewardSchema.optional().describe('What this account receives. Absent when the referral gives the referred side nothing.'),\n }),\n }],\n },\n [BillingAccount_Operations.OPEN_PORTAL]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.READ,\n requestDto: BillingAccount_OpenPortalRequestDto,\n // Borrows READ for its route/verb but returns the provider portal\n // redirect URL, NOT the billing-account resource.\n customResponseDto: z.object({\n url: z.url().describe(\"The billing provider's customer portal, where the customer manages their billing. Send the customer there; the portal links back to `returnUrl`.\"),\n }),\n }],\n },\n [BillingAccount_Operations.GET_STATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.COUNT,\n // Borrows COUNT for its route/verb but returns the aggregated billing\n // state bundle, NOT a `{ count }`. Without this the DTO builder would\n // assign the COUNT default envelope and the service output would fail\n // `transformOutput`'s `internalDto.parse` → HTTP 500.\n customResponseDto: BillingStateResponseSchema,\n }],\n },\n },\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"billing-account.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../src/billing/billing-account.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,oCAAoC,EAAE,cAAc,EAAE,MAAM,gC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AS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,qBAAqB,EAAE,qBAAqB,CAAC,IAAI;oBACjD,UAAU,EAAE,mCAAmC;oBAC/C,kEAAkE;oBAClE,kDAAkD;oBAClD,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC;wBAC1B,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,kJAAkJ,CAAC;qBAC1K,CAAC;iBACH,CAAC;SACH;QACD,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE;YACrC,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE;wBACf,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;wBACtF,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;qBACpD;oBACD,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,qBAAqB,EAAE,qBAAqB,CAAC,KAAK;oBAClD,sEAAsE;oBACtE,sEAAsE;oBACtE,sEAAsE;oBACtE,sDAAsD;oBACtD,iBAAiB,EAAE,0BAA0B;iBAC9C,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Billing Account Resource Configuration — Polymorphic\n *\n * Produces 3 factory functions (one per scope variant) via the polymorphic factory.\n * Spread into the registry factory map:\n * ...billingAccountsPolymorphicFactories\n *\n * @see polymorphic-scope-approach-A-expansion.md — Phase 3\n */\n\nimport { z } from 'zod';\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { BILLING_CHECKOUT_MAX_QUANTITY, BILLING_RESERVED_METADATA_KEY_PREFIX, ReferralStatus } from './billing-enums.shared.schemas';\nimport { ReferredRewardSchema } from './referral-reward.shared.schemas';\nimport { billingAccountsPolymorphicDeclaration } from './billing-account.shared.schemas';\nimport { BillingStateResponseSchema } from './billing-types.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\n\n// ── Custom Operations ────────────────────────────────────────────────\n\nexport enum BillingAccount_Operations {\n /** Create a Stripe Checkout Session for the user to complete payment */\n OPEN_CHECKOUT = 'open_checkout',\n /** Open the Stripe Customer Portal for self-service management */\n OPEN_PORTAL = 'open_portal',\n /** Fetch aggregated billing state (account, subscription, products, prices, credit pools) */\n GET_STATE = 'get_state',\n /**\n * Redeem another account's referral code (#1802). Only a new customer may: an account that has never\n * subscribed, is not already referred, and is not the referrer.\n */\n REDEEM_REFERRAL = 'redeem_referral',\n}\n\n// ── Request DTOs ─────────────────────────────────────────────────────\n\n/** Request DTO for OPEN_CHECKOUT. Trial duration is server-owned product/application policy, never a payer option. */\nexport const BillingAccount_OpenCheckoutRequestDto = z.object({\n productKey: z.string().min(1).describe(\"The key of the product to buy. It must be available for purchase and offered to this account's scope.\"),\n priceId: z.string().min(1).describe(\"The id of the price to buy the product at. It must be a price of that product.\"),\n successUrl: z.url().describe(\"Where the billing provider sends the customer after a completed checkout.\"),\n cancelUrl: z.url().describe(\"Where the billing provider sends the customer if they leave checkout without paying.\"),\n /**\n * Bounded by the same constant the webhook consumer honours. An unbounded quantity here would be\n * billed by the provider and then refused on the way back in, charging the customer for credits\n * that never arrive.\n */\n quantity: z.number().int().min(1).max(BILLING_CHECKOUT_MAX_QUANTITY).default(1).describe(\"How many units to buy, such as seats or credit packs. Defaults to 1.\"),\n promotionCode: z.string().optional().describe(\"A promotion code to apply. It is checked before checkout opens, and refused when it is unknown, inactive, outside its validity dates, used up, not valid for this product, or not set up with the billing provider. The checkout page accepts no code of its own.\"),\n /**\n * Caller-supplied tags mirrored to the provider for the application's own analytics or\n * reconciliation. They carry NO authority.\n *\n * Keys in the framework-reserved namespace are REFUSED here rather than silently dropped: the\n * caller is trying to write into the namespace that decides which billing account gets credited\n * and by how much, and an app developer who typed a reserved key deserves to be told, not to\n * watch their tag vanish. Refusal at the DTO is the loud, outermost half of the boundary; the\n * builder's write-reserved-last ordering and the consumer's read-only-reserved rule are the two\n * structural halves. See {@link BILLING_RESERVED_METADATA_KEY_PREFIX}.\n *\n * The refinement sits on the KEY schema, not on the record: it keeps the DTO a plain `ZodRecord`\n * for the OpenAPI projector and the request-validation pipeline, where a wrapping effect would\n * change the node type every consumer of this DTO narrows on.\n */\n metadata: z\n .record(\n z.string().refine(\n (key) => !key.startsWith(BILLING_RESERVED_METADATA_KEY_PREFIX),\n `Metadata keys starting with \"${BILLING_RESERVED_METADATA_KEY_PREFIX}\" are reserved by the framework and cannot be supplied by the caller`,\n ),\n z.string(),\n )\n .optional(),\n});\n\n/** Request DTO for REDEEM_REFERRAL (#1802). */\nexport const BillingAccount_RedeemReferralRequestDto = z.strictObject({\n referralCode: z.string().trim().min(1).max(64).describe('The referral code to redeem, as the referrer shared it.'),\n});\n\n/** Request DTO for OPEN_PORTAL operation */\nexport const BillingAccount_OpenPortalRequestDto = z.object({\n returnUrl: z.url().describe('Absolute URL the billing portal sends the customer back to when they leave it.'),\n});\n\n// =============================================================================\n// POLYMORPHIC FACTORY — 2 variants (org, user)\n// =============================================================================\n\n/**\n * Polymorphic factory map for billing accounts.\n * Spread into `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...billingAccountsPolymorphicFactories\n *\n * Produces entries for:\n * - organizationBillingAccounts\n * - userBillingAccounts\n */\nexport const billingAccountsPolymorphicFactories = createPolymorphicResourceConfigurations(\n billingAccountsPolymorphicDeclaration,\n {\n isSystemResource: true,\n // System-context CREATE opt-in (fail-closed default is FORBIDDEN). The billing\n // account is auto-created by `BillingStateBackendService.getState()` on first\n // access via `SystemAccessBackendService.createAsSystem` — a trusted in-process\n // write with no HTTP surface and no request context to seed the scope FK. That\n // path relocates the ACL onto the billing service (which has already resolved\n // the scope) and injects the scope FK (`organizationId` / `userId`) through the\n // execution context map. Resource-level and shared by BOTH scope variants\n // (org + user) per the polymorphic-resource contract on ResourceSystemAccessPolicy.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own billing account. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n // System-context LIST opt-in. Subject erasure must enumerate the erased person's billing\n // accounts to reach their provider customer (cancel subscriptions, anonymize, detach payment\n // methods). That runs with no request context — the subject is being erased — so it reads\n // through `SystemAccessBackendService.listAsSystem`, which is fail-closed and refuses a\n // resource that has not opted in here.\n //\n // Safe to grant: LIST is the READ side, and the erasure path filters by the subject's own\n // scope FK. The default LIST variant is API_CALL, so it resolves through\n // `getServiceOperationPathDefault` — a REPOSITORY_ONLY-only LIST would pass this grant and\n // then fail to resolve at erasure time, which is the failure mode this comment exists to\n // stop someone from reintroducing.\n list: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n /**\n * Subject erasure RETAINS this row and scrubs the provider customer id.\n *\n * The financial record is kept for the tax/audit obligation this family exists to serve, and — as the\n * family's authoring rule states — erasure scrubs the linked USER rather than these rows, because the\n * person is a foreign key. `providerCustomerId` is the exception the rule does not cover: it is a stable\n * handle that re-identifies the person INSIDE the payment provider, so it is personal data this row holds.\n * It takes `REMOVE`; everything else is retained.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is not a person — its owner FK names the ACTOR the\n * record belongs to — and the enum prescribes `NO_PRINCIPAL` for exactly that shape. The subject's own\n * session ends through the `USERS` row, which is `SELF_PRINCIPAL`.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n customOperation: BillingAccount_Operations,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n operationsConfiguration: {\n /*\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n * verb the impersonalize writer uses to stamp the retention markers.\n */\n [CoreResourceOperation.UPDATE_MANY]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n }],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [{\n // API_CALL: the billing account is a user-facing record (Settings Hub → Billing →\n // Account, and the resource presets' LIST/READ views). REPOSITORY_ONLY would strip\n // the op from the frontend registry and register no HTTP route. Writes (auto-create\n // + webhook sync) are INTERNAL_CALL — run through the service pipeline, no HTTP surface.\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN, CORE_ORG_ROLES.ORG_BILLING_PROVIDER_EVENTS],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER, CORE_APP_ROLES.APP_BILLING_PROVIDER_EVENTS],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN, CORE_ORG_ROLES.ORG_BILLING_PROVIDER_EVENTS],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER, CORE_APP_ROLES.APP_BILLING_PROVIDER_EVENTS],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n }],\n },\n [BillingAccount_Operations.OPEN_CHECKOUT]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingAccount_OpenCheckoutRequestDto,\n // Borrows UPDATE for its route/verb but returns the provider checkout\n // session, NOT the billing-account resource. Without this the DTO builder\n // would validate the service output against the resource schema and 500.\n customResponseDto: z.object({\n url: z.url().describe(\"The billing provider's hosted checkout page. Send the customer there to pay.\"),\n sessionId: z.string().describe(\"The billing provider's id for this checkout session.\"),\n }),\n }],\n },\n /*\n * #1802 — the account that was referred redeems the code. Refusals are the ones a person can act on:\n * an unusable code, and an account that cannot be referred. The rewards are the referrer's policy,\n * copied when the code was issued, and are reported back so the purchase screen can show them.\n */\n [BillingAccount_Operations.REDEEM_REFERRAL]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingAccount_RedeemReferralRequestDto,\n // Returns the redemption, not the billing account.\n customResponseDto: z.object({\n referralId: z.string().describe('The id of the referral that was redeemed.'),\n status: z.enum(ReferralStatus).systemEnum('ReferralStatus').describe('`accepted`: the account is now the referred side, and the rewards are granted when it pays its first invoice.'),\n referredReward: ReferredRewardSchema.optional().describe('What this account receives. Absent when the referral gives the referred side nothing.'),\n }),\n }],\n },\n [BillingAccount_Operations.OPEN_PORTAL]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.READ,\n requestDto: BillingAccount_OpenPortalRequestDto,\n // Borrows READ for its route/verb but returns the provider portal\n // redirect URL, NOT the billing-account resource.\n customResponseDto: z.object({\n url: z.url().describe(\"The billing provider's customer portal, where the customer manages their billing. Send the customer there; the portal links back to `returnUrl`.\"),\n }),\n }],\n },\n [BillingAccount_Operations.GET_STATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.COUNT,\n // Borrows COUNT for its route/verb but returns the aggregated billing\n // state bundle, NOT a `{ count }`. Without this the DTO builder would\n // assign the COUNT default envelope and the service output would fail\n // `transformOutput`'s `internalDto.parse` → HTTP 500.\n customResponseDto: BillingStateResponseSchema,\n }],\n },\n },\n },\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-account.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"billing-account.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-account.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAA6B,KAAK,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAShI;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,4BAA4B,EAGhE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,oBAAoB,EAGzD,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,uCAAuC,EAAE,oBAAoB,EAWzE,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;iBAkDnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;kBAMhD,CAAC;AAMH,eAAO,MAAM,oBAAoB;;;;;;;;iBAA2B,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-account.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AAEnG,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,yBAAyB,EAAqC,MAAM,kDAAkD,CAAC;AAChI,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,gFAAgF;AAChF,6BAA6B;AAC7B,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAA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AAkB;IACvC,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,wBAAwB;IACpC,QAAQ,EAAE,sBAAsB;CACjC,CAAC,CAAC;AAEH,gFAAgF;AAChF,yBAAyB;AACzB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC","sourcesContent":["/**\n * Billing Account Schema (Shared) — Polymorphic\n *\n * BillingAccount is the PURE SCOPE BRIDGE between a Wildo entity and the billing provider.\n *\n * POLYMORPHIC EXPANSION: The base schema does NOT contain identity scope fields\n * (organizationId, userId). These are injected per variant by\n * `declarePolymorphicSchemas()`, producing 2 concrete resources:\n * - organizationBillingAccounts (with organizationId)\n * - userBillingAccounts (with userId)\n *\n * DELEGATION PRINCIPLE: All customer details (contact info, billing address, tax IDs,\n * payment methods) are managed by the provider. BillingAccount stores ONLY:\n * 1. The provider reference (which provider customer this maps to)\n * 2. Status\n * The scope reference is the injected identity FK.\n *\n * @see polymorphic-scope-approach-A-expansion.md\n * @see billing-and-features-system.md §6.1 (Core Design)\n */\n\nimport { z } from 'zod';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport type { PolymorphicFkVariant } from '@wildo-ai/zod-decorators';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { declarePolymorphicSchemas, type PolymorphicVariantDefinition } from '../resources/utils/resource-polymorphism.schemas';\nimport { BillingScopeType } from './billing-enums.shared.schemas';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport { addImpersonalizeWith } from '@wildo-ai/zod-decorators';\n\n// =============================================================================\n// SHARED VARIANT DEFINITIONS\n// =============================================================================\n\n/**\n * The 2 billing scope variants — shared across BillingAccounts, Subscriptions, and children.\n * Centralised here to avoid repetition (DX concern from plan remarks #1).\n */\nexport const BILLING_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n];\n\n/**\n * FK variant definitions for child resources referencing polymorphic billing accounts.\n * Used on `billingAccountId` fields as: `.isForeignKey({ polymorphicVariants: BILLING_SCOPE_FK_VARIANTS })`\n *\n * This tells the polymorphic engine to rename `billingAccountId` per variant:\n * - organizations → `organizationBillingAccountId`\n * - users → `userBillingAccountId`\n */\nexport const BILLING_SCOPE_FK_VARIANTS: PolymorphicFkVariant[] = BILLING_SCOPE_VARIANTS.map(v => ({\n parentResourceType: v.parentResourceType,\n parentFieldIdentifier: v.parentFieldIdentifier,\n}));\n\n/**\n * FK variant definitions for a SHARED-FIELD DISCRIMINATED polymorphic\n * billing-account FK — e.g. a referral's `referrerBillingAccountId`, a single\n * column on the flat `referrals` resource that points at EITHER a user OR an\n * organization billing account, with the branch chosen PER RECORD by a sibling\n * `*ScopeType` field.\n *\n * Same scope branches as {@link BILLING_SCOPE_FK_VARIANTS}, but each variant\n * additionally carries the `discriminatorValue` ({@link BillingScopeType}) that\n * the holder record's discriminator field uses to select the branch. Declare as:\n *\n * ```ts\n * referrerBillingAccountId: z.string().min(1).isForeignKey({\n * polymorphicVariants: BILLING_SCOPE_DISCRIMINATED_FK_VARIANTS,\n * polymorphicDiscriminatorField: 'referrerScopeType',\n * })\n * ```\n *\n * Contrast with {@link BILLING_SCOPE_FK_VARIANTS} (rename-only, used when the\n * HOLDER is itself polymorphically expanded). The branch TARGET is resolved at\n * runtime via the scope bridge: `discriminatorValue` selects the variant, whose\n * `parentResourceType` scope root matches the branch's `resourcePrimaryScope`.\n */\nexport const BILLING_SCOPE_DISCRIMINATED_FK_VARIANTS: PolymorphicFkVariant[] = [\n {\n parentResourceType: CoreResourceType.ORGANIZATIONS,\n parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS],\n discriminatorValue: BillingScopeType.ORGANIZATIONS,\n },\n {\n parentResourceType: CoreResourceType.USERS,\n parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS],\n discriminatorValue: BillingScopeType.USER_SELF,\n },\n];\n\n// =============================================================================\n// BASE SCHEMA\n// =============================================================================\n\n/**\n * BillingAccount base schema — NO identity scope fields.\n * The polymorphic declaration injects the parent FK (organizationId / userId)\n * automatically per variant.\n */\nexport const BillingAccountBaseSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /** Provider sync - the ONLY provider-side reference we store */\n // ── FINANCIAL, and declared on the SHARED base rather than per scope variant ──\n //\n // This family is polymorphic: `userBillingAccounts` holds a person's billing relationship,\n // `organizationBillingAccounts` a company's, and both are built from this one schema. A category\n // declared here therefore reaches both, and that is the direction to err in — an organization on a\n // single-seat plan is one person, and the framework cannot tell which. Declaring only on a\n // hypothetical user-only variant would UNDER-report, which is the silent failure a notice must\n // never make; declaring on both at worst tells a reader the operator holds financial data, which\n // it does. The same note applies to the invoice, usage, credit-pool and subscription siblings.\n // REMOVE on erasure. This is the person's identifier AT THE PAYMENT PROVIDER — a stable handle that\n // re-identifies them in a system we do not own, which is personal data this row HOLDS rather than a\n // link it merely carries. The provider-side customer is retired by the billing subject-erasure\n // external effect, so keeping the id afterwards would leave a dangling pointer at a deleted person.\n // Clearable: the field is `.optional()`, so REMOVE resolves to a removed key rather than a rejected null.\n providerCustomerId: addImpersonalizeWith(\n z.string().optional().isBackendOnly().dataCategories(PersonalDataCategory.FINANCIAL),\n RedactionType.REMOVE,\n ),\n /** Which provider (e.g., 'stripe') */\n providerRef: z.string().optional().isBackendOnly(),\n\n /** Status */\n isActive: z.boolean().default(true).isDBIndexed().isSummaryField().describe(\"Whether the account is active. It becomes `false` when the customer is deleted at the billing provider, and an inactive account is skipped when every account's features are recomputed.\"),\n\n /**\n * Open key-value bag for operational tagging (cost-centre, campaign ref, internal correlation id).\n *\n * ⚠️ **AUTHORING RULE — never store personal data here.** This row is RETAINED when its subject is\n * erased: the billing-retention decision keeps the financial record for tax/audit obligations, and\n * subject erasure scrubs the linked USER rather than these rows, because a billing row holds no\n * personal data of its own — the person is a foreign key. An open bag is the one place that\n * assumption can be broken by an app author, and nothing would catch it: the erasure scrub is\n * field-directed (`.impersonalizeWith()`), and it cannot reach inside an arbitrary record whose\n * keys it does not know.\n *\n * Concretely: no names, emails, phone numbers, addresses, free-text notes about a person, or\n * anything else that identifies one. Personal data written here SURVIVES an erasure — a compliance\n * breach that the retained label makes look intentional.\n *\n * Enforcement is deliberately NOT built (Q3, 2026-07-31): scrubbing these rows would require\n * hide/freeze to become separable from scrub — a real capability change with no current consumer.\n * Revisit only if an app is found using the bag this way.\n */\n metadata: z.record(z.string(), z.string()).optional().describe(\"String tags the application's own code may attach to the account. Do not store personal data here: this record is kept when its owner is erased.\"),\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type BillingAccountBase = z.infer<typeof BillingAccountBaseSchema>;\n\n// =============================================================================\n// POLYMORPHIC DECLARATION\n// =============================================================================\n\n/**\n * Polymorphic declaration for BillingAccounts.\n * Produces 2 variants:\n * - organizations → organizationBillingAccounts (organizationId injected)\n * - users → userBillingAccounts (userId injected)\n */\nexport const billingAccountsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'billingAccounts',\n baseFieldIdentifier: 'billingAccountId',\n baseEnumKey: 'BILLING_ACCOUNTS',\n baseSchema: BillingAccountBaseSchema,\n variants: BILLING_SCOPE_VARIANTS,\n});\n\n// =============================================================================\n// EXPORTED SCHEMA & TYPE\n// =============================================================================\n\nexport const BillingAccountSchema = BillingAccountBaseSchema;\nexport type BillingAccount = z.infer<typeof BillingAccountBaseSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"billing-account.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/billing-account.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AAQ,EAAE,CAAC,QAAQ,CAAC,kJAAkJ,CAAC;IAClN,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IACrF,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC;AAGH,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,yBAAyB,CAAC;IAC7E,gBAAgB,EAAE,iBAAiB;IACnC,mBAAmB,EAAE,kBAAkB;IACvC,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,wBAAwB;IACpC,QAAQ,EAAE,sBAAsB;CACjC,CAAC,CAAC;AAEH,gFAAgF;AAChF,yBAAyB;AACzB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC","sourcesContent":["/**\n * Billing Account Schema (Shared) — Polymorphic\n *\n * BillingAccount is the PURE SCOPE BRIDGE between a Wildo entity and the billing provider.\n *\n * POLYMORPHIC EXPANSION: The base schema does NOT contain identity scope fields\n * (organizationId, userId). These are injected per variant by\n * `declarePolymorphicSchemas()`, producing 2 concrete resources:\n * - organizationBillingAccounts (with organizationId)\n * - userBillingAccounts (with userId)\n *\n * DELEGATION PRINCIPLE: All customer details (contact info, billing address, tax IDs,\n * payment methods) are managed by the provider. BillingAccount stores ONLY:\n * 1. The provider reference (which provider customer this maps to)\n * 2. Status\n * The scope reference is the injected identity FK.\n *\n * @see polymorphic-scope-approach-A-expansion.md\n * @see billing-and-features-system.md §6.1 (Core Design)\n */\n\nimport { z } from 'zod';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport type { PolymorphicFkVariant } from '@wildo-ai/zod-decorators';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { declarePolymorphicSchemas, type PolymorphicVariantDefinition } from '../resources/utils/resource-polymorphism.schemas';\nimport { BillingScopeType } from './billing-enums.shared.schemas';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport { addImpersonalizeWith } from '@wildo-ai/zod-decorators';\n\n// =============================================================================\n// SHARED VARIANT DEFINITIONS\n// =============================================================================\n\n/**\n * The 2 billing scope variants — shared across BillingAccounts, Subscriptions, and children.\n * Centralised here to avoid repetition (DX concern from plan remarks #1).\n */\nexport const BILLING_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n];\n\n/**\n * FK variant definitions for child resources referencing polymorphic billing accounts.\n * Used on `billingAccountId` fields as: `.isForeignKey({ polymorphicVariants: BILLING_SCOPE_FK_VARIANTS })`\n *\n * This tells the polymorphic engine to rename `billingAccountId` per variant:\n * - organizations → `organizationBillingAccountId`\n * - users → `userBillingAccountId`\n */\nexport const BILLING_SCOPE_FK_VARIANTS: PolymorphicFkVariant[] = BILLING_SCOPE_VARIANTS.map(v => ({\n parentResourceType: v.parentResourceType,\n parentFieldIdentifier: v.parentFieldIdentifier,\n}));\n\n/**\n * FK variant definitions for a SHARED-FIELD DISCRIMINATED polymorphic\n * billing-account FK — e.g. a referral's `referrerBillingAccountId`, a single\n * column on the flat `referrals` resource that points at EITHER a user OR an\n * organization billing account, with the branch chosen PER RECORD by a sibling\n * `*ScopeType` field.\n *\n * Same scope branches as {@link BILLING_SCOPE_FK_VARIANTS}, but each variant\n * additionally carries the `discriminatorValue` ({@link BillingScopeType}) that\n * the holder record's discriminator field uses to select the branch. Declare as:\n *\n * ```ts\n * referrerBillingAccountId: z.string().min(1).isForeignKey({\n * polymorphicVariants: BILLING_SCOPE_DISCRIMINATED_FK_VARIANTS,\n * polymorphicDiscriminatorField: 'referrerScopeType',\n * })\n * ```\n *\n * Contrast with {@link BILLING_SCOPE_FK_VARIANTS} (rename-only, used when the\n * HOLDER is itself polymorphically expanded). The branch TARGET is resolved at\n * runtime via the scope bridge: `discriminatorValue` selects the variant, whose\n * `parentResourceType` scope root matches the branch's `resourcePrimaryScope`.\n */\nexport const BILLING_SCOPE_DISCRIMINATED_FK_VARIANTS: PolymorphicFkVariant[] = [\n {\n parentResourceType: CoreResourceType.ORGANIZATIONS,\n parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS],\n discriminatorValue: BillingScopeType.ORGANIZATIONS,\n },\n {\n parentResourceType: CoreResourceType.USERS,\n parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS],\n discriminatorValue: BillingScopeType.USER_SELF,\n },\n];\n\n// =============================================================================\n// BASE SCHEMA\n// =============================================================================\n\n/**\n * BillingAccount base schema — NO identity scope fields.\n * The polymorphic declaration injects the parent FK (organizationId / userId)\n * automatically per variant.\n */\nexport const BillingAccountBaseSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /** Provider sync - the ONLY provider-side reference we store */\n // ── FINANCIAL, and declared on the SHARED base rather than per scope variant ──\n //\n // This family is polymorphic: `userBillingAccounts` holds a person's billing relationship,\n // `organizationBillingAccounts` a company's, and both are built from this one schema. A category\n // declared here therefore reaches both, and that is the direction to err in — an organization on a\n // single-seat plan is one person, and the framework cannot tell which. Declaring only on a\n // hypothetical user-only variant would UNDER-report, which is the silent failure a notice must\n // never make; declaring on both at worst tells a reader the operator holds financial data, which\n // it does. The same note applies to the invoice, usage, credit-pool and subscription siblings.\n // REMOVE on erasure. This is the person's identifier AT THE PAYMENT PROVIDER — a stable handle that\n // re-identifies them in a system we do not own, which is personal data this row HOLDS rather than a\n // link it merely carries. The provider-side customer is retired by the billing subject-erasure\n // external effect, so keeping the id afterwards would leave a dangling pointer at a deleted person.\n // Clearable: the field is `.optional()`, so REMOVE resolves to a removed key rather than a rejected null.\n providerCustomerId: addImpersonalizeWith(\n z.string().optional().isBackendOnly().dataCategories(PersonalDataCategory.FINANCIAL),\n RedactionType.REMOVE,\n ),\n /** Which provider (e.g., 'stripe') */\n providerRef: z.string().optional().isBackendOnly(),\n\n /** Status */\n isActive: z.boolean().default(true).isDBIndexed().isSummaryField().describe(\"Whether the account is active. It becomes `false` when the customer is deleted at the billing provider, and an inactive account is skipped when every account's features are recomputed.\"),\n\n /**\n * Open key-value bag for operational tagging (cost-centre, campaign ref, internal correlation id).\n *\n * ⚠️ **AUTHORING RULE — never store personal data here.** This row is RETAINED when its subject is\n * erased: the billing-retention decision keeps the financial record for tax/audit obligations, and\n * subject erasure scrubs the linked USER rather than these rows, because a billing row holds no\n * personal data of its own — the person is a foreign key. An open bag is the one place that\n * assumption can be broken by an app author, and nothing would catch it: the erasure scrub is\n * field-directed (`.impersonalizeWith()`), and it cannot reach inside an arbitrary record whose\n * keys it does not know.\n *\n * Concretely: no names, emails, phone numbers, addresses, free-text notes about a person, or\n * anything else that identifies one. Personal data written here SURVIVES an erasure — a compliance\n * breach that the retained label makes look intentional.\n *\n * Enforcement is deliberately NOT built (Q3, 2026-07-31): scrubbing these rows would require\n * hide/freeze to become separable from scrub — a real capability change with no current consumer.\n * Revisit only if an app is found using the bag this way.\n */\n metadata: z.record(z.string(), z.string()).optional().describe(\"String tags the application's own code may attach to the account. Do not store personal data here: this record is kept when its owner is erased.\"),\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type BillingAccountBase = z.infer<typeof BillingAccountBaseSchema>;\n\n// =============================================================================\n// POLYMORPHIC DECLARATION\n// =============================================================================\n\n/**\n * Polymorphic declaration for BillingAccounts.\n * Produces 2 variants:\n * - organizations → organizationBillingAccounts (organizationId injected)\n * - users → userBillingAccounts (userId injected)\n */\nexport const billingAccountsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'billingAccounts',\n baseFieldIdentifier: 'billingAccountId',\n baseEnumKey: 'BILLING_ACCOUNTS',\n baseSchema: BillingAccountBaseSchema,\n variants: BILLING_SCOPE_VARIANTS,\n});\n\n// =============================================================================\n// EXPORTED SCHEMA & TYPE\n// =============================================================================\n\nexport const BillingAccountSchema = BillingAccountBaseSchema;\nexport type BillingAccount = z.infer<typeof BillingAccountBaseSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-configuration.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"billing-configuration.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-configuration.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACd,MAAM,gCAAgC,CAAC;AAGxC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyJrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-configuration.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-configuration.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC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C,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5D,kEAAkE;IAElE,uFAAuF;IACvF,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC;QAC9B,8DAA8D;QAC9D,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9C;;;;;WAKG;QACH,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACpD,uDAAuD;QACvD,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/C,uFAAuF;QACvF,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;QACxF;;;;;;;;WAQG;QACH,mBAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC;KAChF,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChB,gBAAgB,EAAE,CAAC;QACnB,sBAAsB,EAAE,CAAC;QACzB,iBAAiB,EAAE,CAAC;QACpB,gBAAgB,EAAE,iBAAiB,CAAC,iBAAiB;QACrD,mBAAmB,EAAE,aAAa,CAAC,aAAa;KACjD,CAAC,CAAC;CACJ,CAAC,CAAC","sourcesContent":["/**\n * Billing Configuration Schema (Shared)\n *\n * Top-level billing configuration that custom apps provide at startup.\n * Controls: provider selection, currency, tax policy, enabled scopes,\n * and default behavior policies.\n *\n * @see billing-and-features-system.md §6.7 (Billing Configuration)\n */\n\nimport { z } from 'zod';\nimport { CurrencySchema } from '@wildo-ai/zod-decorators';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n TaxCalculationMode,\n TaxDisplayMode,\n ProrationBehavior,\n BillingTiming,\n} from './billing-enums.shared.schemas';\nimport { ReferredRewardSchema, ReferrerRewardSchema } from './referral-reward.shared.schemas';\n\nexport const BillingConfigurationSchema = z.object({\n /** Master switch: is billing enabled for this app? */\n enabled: z.boolean().default(false),\n /** Which billing provider to use (e.g., 'stripe') */\n providerRef: z.string().optional(),\n\n /*\n * NO `webhooks` block. `path` and `signingSecretRef` were declared here and read by NOTHING —\n * `signingSecretRef` had zero references outside its own declaration — and they were removed on\n * 2026-09-08 (#408) rather than relabelled, because unlike the commercial-intent keys below they\n * were not even an input to anything.\n *\n * The route and the signing secret both come from the provider module's `WEBHOOK_ORIGINATOR`\n * contract: `buildWebhookEndpoints` mounts it at `/api/v1/webhooks/<provider>/billing`. That is\n * the single authority, and `webhook-auto-controller.backend.service.ts` already recorded the\n * same conclusion when endpoint-level path/secret extras were dropped as dead in the 2026-05-06\n * reshape. This block was the copy that survived that sweep.\n */\n\n /**\n * DECLARATION-ONLY (#408, 2026-09-08). Read by the application-creation commercial-model brief and\n * by no runtime billing path: nothing validates a product's currency against these, and what\n * reaches the provider is each price's own `currency`. Authoring them records the commercial\n * intent a reviewer reads; it enforces nothing.\n */\n defaultCurrency: CurrencySchema.default('USD'),\n /** DECLARATION-ONLY — see `defaultCurrency`. */\n supportedCurrencies: z.array(CurrencySchema).default(['USD']),\n\n /**\n * Tax configuration — calculation is ALWAYS delegated to provider (Stripe Tax, etc.).\n * We never calculate tax locally.\n */\n tax: z.object({\n /**\n * Whether the PROVIDER computes tax on a purchase. READ since 2026-09-08 (#408): the checkout\n * path — the only production purchase route — sends `automaticTax` from this value.\n *\n * It reached nothing before that, so `PROVIDER_MANAGED` changed no behaviour and the provider\n * account's own configuration silently decided. Enabling it changes invoice totals and the tax\n * amounts persisted against them, which is why it is a decision an application makes rather\n * than a default the framework picks.\n */\n calculationMode: z.enum(TaxCalculationMode).default(TaxCalculationMode.DISABLED),\n\n /**\n * How prices are DISPLAYED to users (does not affect provider calculation).\n * - 'exclusive': Prices shown excluding tax (HT / ex-VAT). Tax added at checkout.\n * Common for B2B. Shows \"$49/mo\" and tax is added separately.\n * - 'inclusive': Prices shown including tax (TTC / inc-VAT). Tax is embedded.\n * Common for consumer-facing. Shows \"€49/mo TTC\" and tax is extracted at checkout.\n *\n * DECLARATIVE ONLY: nothing reads this value. It is not an application-wide default that\n * `product.taxDisplayMode` and `price.taxBehavior` override, because there is no resolution\n * chain between the three. What reaches the billing provider is each price's own\n * `taxBehavior`, and only that.\n */\n defaultDisplayMode: z.enum(TaxDisplayMode).default(TaxDisplayMode.EXCLUSIVE),\n }).default(() => ({\n calculationMode: TaxCalculationMode.DISABLED,\n defaultDisplayMode: TaxDisplayMode.EXCLUSIVE,\n })),\n\n /**\n * Which scopes can have billing accounts (default: ORGANIZATIONS only).\n * Can be extended to include USER_SELF (personal billing).\n */\n enabledScopes: z.array(z.enum(ResourcePrimaryScope)).default([ResourcePrimaryScope.ORGANIZATIONS]),\n\n /**\n * Promotions configuration.\n * Controls whether the promotions subsystem is active.\n */\n promotions: z.object({\n /**\n * DECLARATION-ONLY (#408, 2026-09-08), and the sharpest of them: the promotions subsystem runs\n * UNCONDITIONALLY. Promotion codes are applied at `billing-account.mutations` and resolved in\n * `billing-state`, neither of which consults this flag — so setting it `false` disables\n * nothing, which is a stronger statement than \"is not read\".\n */\n enabled: z.boolean().default(true),\n }).default(() => ({\n enabled: true,\n })),\n\n /**\n * Credit pool configuration.\n * Controls whether credit pools are enabled and defines default pool behavior.\n */\n creditPools: z.object({\n /**\n * DECLARATION-ONLY (#408, 2026-09-08) — same shape as `promotions.enabled` above, and the same\n * correction: credit pools run unconditionally in `billing-state`, so `false` disables nothing.\n */\n enabled: z.boolean().default(true),\n /** Default initial balance for auto-created pools (default 0) */\n defaultInitialBalance: z.number().min(0).default(0),\n }).default(() => ({\n enabled: true,\n defaultInitialBalance: 0,\n })),\n\n /** @wildo_source:part:start saas.models.billing.referral-program facet:layer:shared facet:audience:app-developer */\n /**\n * The referral program (#1802): whether organizations may issue referral codes, and what each side\n * receives when a referral converts (the referred account's first paid invoice).\n *\n * The rewards are copied onto each referral when its code is issued, so changing them here affects\n * codes issued afterwards and never re-prices a referral already made. A reward's `featureKey` must\n * name a registered boolean feature; startup WARNS about one that does not, like every other feature\n * reference, and a feature nobody registered grants nothing.\n */\n referrals: z.object({\n /** Off by default: issuing codes that promise rewards is a commercial decision the application makes. */\n enabled: z.boolean().default(false).describe('Whether organizations may issue referral codes. Redeeming and converting codes already issued keeps working when this is turned off.'),\n referrerReward: ReferrerRewardSchema.optional().describe('What the referrer receives when a referral converts. Absent means nothing.'),\n referredReward: ReferredRewardSchema.optional().describe('What the referred account receives. Absent means nothing.'),\n codeValidityDays: z.number().int().min(1).default(30).describe('How many days a referral code can be redeemed after it is issued. Defaults to 30.'),\n }).default(() => ({ enabled: false, codeValidityDays: 30 })),\n /** @wildo_source:part:end saas.models.billing.referral-program */\n\n /** Global billing policy defaults (overridden by ProductBehaviorPolicy per product) */\n defaultBehaviorPolicy: z.object({\n /** Default trial days for new subscriptions (0 = no trial) */\n defaultTrialDays: z.number().min(0).default(0),\n /**\n * DECLARATION-ONLY (#408, 2026-09-08). Dunning — how long to wait and how often to retry after a\n * failed payment — is configured at the PROVIDER, on its own schedule, and nothing here reaches\n * it. Binding them would mean writing a provider's retry settings from application config, which\n * is a different feature from reading a policy at a call site.\n */\n paymentGracePeriodDays: z.number().min(0).default(3),\n /** DECLARATION-ONLY — see `paymentGracePeriodDays`. */\n maxPaymentRetries: z.number().min(0).default(3),\n /** Default proration when no product-specific policy. READ by the change-plan path. */\n defaultProration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS),\n /**\n * Default cancellation timing when neither the caller nor the plan product names one.\n *\n * READ since 2026-09-08 (#408). It was dead until then, and it is bound rather than relabelled\n * because — unlike its neighbours above — it needs no provider call at all: cancellation timing\n * is resolved locally, so the only thing standing between this key and meaning something was a\n * reader. The chain is caller → product `behaviorPolicy.cancellation.defaultBehavior` → this →\n * period-end.\n */\n defaultCancellation: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),\n }).default(() => ({\n defaultTrialDays: 0,\n paymentGracePeriodDays: 3,\n maxPaymentRetries: 3,\n defaultProration: ProrationBehavior.CREATE_PRORATIONS,\n defaultCancellation: BillingTiming.AT_PERIOD_END,\n })),\n});\nexport type BillingConfiguration = z.infer<typeof BillingConfigurationSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"billing-configuration.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/billing-configuration.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE9F,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,sDAAsD;IACtD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACnC,qDAAqD;IACrD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAElC;;;;;;;;;;;OAWG;IAEH;;;;;OAKG;IACH,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC;IAC9C,gDAAgD;IAChD,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;IAE7D;;;OAGG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AI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC;KAChF,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChB,gBAAgB,EAAE,CAAC;QACnB,sBAAsB,EAAE,CAAC;QACzB,iBAAiB,EAAE,CAAC;QACpB,gBAAgB,EAAE,iBAAiB,CAAC,iBAAiB;QACrD,mBAAmB,EAAE,aAAa,CAAC,aAAa;KACjD,CAAC,CAAC;CACJ,CAAC,CAAC","sourcesContent":["/**\n * Billing Configuration Schema (Shared)\n *\n * Top-level billing configuration that custom apps provide at startup.\n * Controls: provider selection, currency, tax policy, enabled scopes,\n * and default behavior policies.\n *\n * @see billing-and-features-system.md §6.7 (Billing Configuration)\n */\n\nimport { z } from 'zod';\nimport { CurrencySchema } from '@wildo-ai/zod-decorators';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n TaxCalculationMode,\n TaxDisplayMode,\n ProrationBehavior,\n BillingTiming,\n} from './billing-enums.shared.schemas';\nimport { ReferredRewardSchema, ReferrerRewardSchema } from './referral-reward.shared.schemas';\n\nexport const BillingConfigurationSchema = z.object({\n /** Master switch: is billing enabled for this app? */\n enabled: z.boolean().default(false),\n /** Which billing provider to use (e.g., 'stripe') */\n providerRef: z.string().optional(),\n\n /*\n * NO `webhooks` block. `path` and `signingSecretRef` were declared here and read by NOTHING —\n * `signingSecretRef` had zero references outside its own declaration — and they were removed on\n * 2026-09-08 (#408) rather than relabelled, because unlike the commercial-intent keys below they\n * were not even an input to anything.\n *\n * The route and the signing secret both come from the provider module's `WEBHOOK_ORIGINATOR`\n * contract: `buildWebhookEndpoints` mounts it at `/api/v1/webhooks/<provider>/billing`. That is\n * the single authority, and `webhook-auto-controller.backend.service.ts` already recorded the\n * same conclusion when endpoint-level path/secret extras were dropped as dead in the 2026-05-06\n * reshape. This block was the copy that survived that sweep.\n */\n\n /**\n * DECLARATION-ONLY (#408, 2026-09-08). Read by the application-creation commercial-model brief and\n * by no runtime billing path: nothing validates a product's currency against these, and what\n * reaches the provider is each price's own `currency`. Authoring them records the commercial\n * intent a reviewer reads; it enforces nothing.\n */\n defaultCurrency: CurrencySchema.default('USD'),\n /** DECLARATION-ONLY — see `defaultCurrency`. */\n supportedCurrencies: z.array(CurrencySchema).default(['USD']),\n\n /**\n * Tax configuration — calculation is ALWAYS delegated to provider (Stripe Tax, etc.).\n * We never calculate tax locally.\n */\n tax: z.object({\n /**\n * Whether the PROVIDER computes tax on a purchase. READ since 2026-09-08 (#408): the checkout\n * path — the only production purchase route — sends `automaticTax` from this value.\n *\n * It reached nothing before that, so `PROVIDER_MANAGED` changed no behaviour and the provider\n * account's own configuration silently decided. Enabling it changes invoice totals and the tax\n * amounts persisted against them, which is why it is a decision an application makes rather\n * than a default the framework picks.\n */\n calculationMode: z.enum(TaxCalculationMode).default(TaxCalculationMode.DISABLED),\n\n /**\n * How prices are DISPLAYED to users (does not affect provider calculation).\n * - 'exclusive': Prices shown excluding tax (HT / ex-VAT). Tax added at checkout.\n * Common for B2B. Shows \"$49/mo\" and tax is added separately.\n * - 'inclusive': Prices shown including tax (TTC / inc-VAT). Tax is embedded.\n * Common for consumer-facing. Shows \"€49/mo TTC\" and tax is extracted at checkout.\n *\n * DECLARATIVE ONLY: nothing reads this value. It is not an application-wide default that\n * `product.taxDisplayMode` and `price.taxBehavior` override, because there is no resolution\n * chain between the three. What reaches the billing provider is each price's own\n * `taxBehavior`, and only that.\n */\n defaultDisplayMode: z.enum(TaxDisplayMode).default(TaxDisplayMode.EXCLUSIVE),\n }).default(() => ({\n calculationMode: TaxCalculationMode.DISABLED,\n defaultDisplayMode: TaxDisplayMode.EXCLUSIVE,\n })),\n\n /**\n * Which scopes can have billing accounts (default: ORGANIZATIONS only).\n * Can be extended to include USER_SELF (personal billing).\n */\n enabledScopes: z.array(z.enum(ResourcePrimaryScope)).default([ResourcePrimaryScope.ORGANIZATIONS]),\n\n /**\n * Promotions configuration.\n * Controls whether the promotions subsystem is active.\n */\n promotions: z.object({\n /**\n * DECLARATION-ONLY (#408, 2026-09-08), and the sharpest of them: the promotions subsystem runs\n * UNCONDITIONALLY. Promotion codes are applied at `billing-account.mutations` and resolved in\n * `billing-state`, neither of which consults this flag — so setting it `false` disables\n * nothing, which is a stronger statement than \"is not read\".\n */\n enabled: z.boolean().default(true),\n }).default(() => ({\n enabled: true,\n })),\n\n /**\n * Credit pool configuration.\n * Controls whether credit pools are enabled and defines default pool behavior.\n */\n creditPools: z.object({\n /**\n * DECLARATION-ONLY (#408, 2026-09-08) — same shape as `promotions.enabled` above, and the same\n * correction: credit pools run unconditionally in `billing-state`, so `false` disables nothing.\n */\n enabled: z.boolean().default(true),\n /** Default initial balance for auto-created pools (default 0) */\n defaultInitialBalance: z.number().min(0).default(0),\n }).default(() => ({\n enabled: true,\n defaultInitialBalance: 0,\n })),\n\n /** @wildo_source:part:start saas.models.billing.referral-program facet:layer:shared facet:audience:app-developer */\n /**\n * The referral program (#1802): whether organizations may issue referral codes, and what each side\n * receives when a referral converts (the referred account's first paid invoice).\n *\n * The rewards are copied onto each referral when its code is issued, so changing them here affects\n * codes issued afterwards and never re-prices a referral already made. A reward's `featureKey` must\n * name a registered boolean feature; startup WARNS about one that does not, like every other feature\n * reference, and a feature nobody registered grants nothing.\n */\n referrals: z.object({\n /** Off by default: issuing codes that promise rewards is a commercial decision the application makes. */\n enabled: z.boolean().default(false).describe('Whether organizations may issue referral codes. Redeeming and converting codes already issued keeps working when this is turned off.'),\n referrerReward: ReferrerRewardSchema.optional().describe('What the referrer receives when a referral converts. Absent means nothing.'),\n referredReward: ReferredRewardSchema.optional().describe('What the referred account receives. Absent means nothing.'),\n codeValidityDays: z.number().int().min(1).default(30).describe('How many days a referral code can be redeemed after it is issued. Defaults to 30.'),\n }).default(() => ({ enabled: false, codeValidityDays: 30 })),\n /** @wildo_source:part:end saas.models.billing.referral-program */\n\n /** Global billing policy defaults (overridden by ProductBehaviorPolicy per product) */\n defaultBehaviorPolicy: z.object({\n /** Default trial days for new subscriptions (0 = no trial) */\n defaultTrialDays: z.number().min(0).default(0),\n /**\n * DECLARATION-ONLY (#408, 2026-09-08). Dunning — how long to wait and how often to retry after a\n * failed payment — is configured at the PROVIDER, on its own schedule, and nothing here reaches\n * it. Binding them would mean writing a provider's retry settings from application config, which\n * is a different feature from reading a policy at a call site.\n */\n paymentGracePeriodDays: z.number().min(0).default(3),\n /** DECLARATION-ONLY — see `paymentGracePeriodDays`. */\n maxPaymentRetries: z.number().min(0).default(3),\n /** Default proration when no product-specific policy. READ by the change-plan path. */\n defaultProration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS),\n /**\n * Default cancellation timing when neither the caller nor the plan product names one.\n *\n * READ since 2026-09-08 (#408). It was dead until then, and it is bound rather than relabelled\n * because — unlike its neighbours above — it needs no provider call at all: cancellation timing\n * is resolved locally, so the only thing standing between this key and meaning something was a\n * reader. The chain is caller → product `behaviorPolicy.cancellation.defaultBehavior` → this →\n * period-end.\n */\n defaultCancellation: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),\n }).default(() => ({\n defaultTrialDays: 0,\n paymentGracePeriodDays: 3,\n maxPaymentRetries: 3,\n defaultProration: ProrationBehavior.CREATE_PRORATIONS,\n defaultCancellation: BillingTiming.AT_PERIOD_END,\n })),\n});\nexport type BillingConfiguration = z.infer<typeof BillingConfigurationSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-enums.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"billing-enums.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-enums.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAI3J;;;;;;;;;;;;;;;;;;;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AA0B;IACpC;;;;;;OAMG;IACH,kBAAkB,2BAA2B;IAC7C,kGAAkG;IAClG,WAAW,qBAAqB;IAChC;;;;;;;;;;;;OAYG;IACH,YAAY,sBAAsB;IAClC;;;OAGG;IACH,QAAQ,mBAAmB;CAC5B;AAED;;;;GAIG;AACH,oBAAY,8BAA8B;IACxC;;;;OAIG;IACH,QAAQ,mBAAmB;CAC5B;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,SAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-enums.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-enums.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE3J,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,gEAAgE;IAChE,4BAAa,CAAA;IACb,6DAA6D;IAC7D,8BAAe,CAAA;IACf,kEAAkE;IAClE,kCAAmB,CAAA;IACnB,6EAA6E;IAC7E,oCAAqB,CAAA;IACrB,sEAAsE;IACtE,0CAA2B,CAAA;IAC3B,0EAA0E;IAC1E,4BAAa,CAAA;AACf,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED,oGAAoG;AACpG,8EAA8E;AAC9E,mGAAmG;AAEnG;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,6BAAW,CAAA;AACb,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,sEAAsE;AAEtE;;GAEG;AACH,8FAA8F;AAC9F,gGAAgG;AAChG,gGAAgG;AAEhG;;;;GAIG;AACH,MAAM,CAAN,IAAY,aAGX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AGG;IACH,yDAA2B,CAAA;AAC7B,CAAC,EA9BW,0BAA0B,KAA1B,0BAA0B,QA8BrC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,8BAOX;AAPD,WAAY,8BAA8B;IACxC;;;;OAIG;IACH,6DAA2B,CAAA;AAC7B,CAAC,EAPW,8BAA8B,KAA9B,8BAA8B,QAOzC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAO,CAAC","sourcesContent":["/**\n * Billing Enums (Shared)\n *\n * All billing-system enums used across backend, frontend, and shared models.\n * These supersede the legacy enums from billing.shared.schemas.ts.\n *\n * Enums shared with the standard billing interface (PricingModel, BillingInterval,\n * TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior) are defined in\n * @wildo-ai/external-connectors-models and re-exported here for convenience.\n *\n * @see billing-and-features-system.md §6 (Billing Schemas)\n */\n\nexport { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior } from '@wildo-ai/external-connectors-models';\n\n// ── Product & Pricing ──────────────────────────────────────────────\n\n/**\n * @wildo_source:part:start saas.models.billing.catalog-vocabularies facet:layer:shared facet:audience:app-developer\n *\n * The vocabularies an application types into its own product catalogue — the `ProductDefinition[]`\n * it exports from its shared library and hands to the engine with its module declarations.\n *\n * Imported from `@wildo-ai/saas-models`. `PricingModel`, `BillingInterval` and `ProrationBehavior`\n * are re-exported from the connector models, because their values ARE the provider's wire values.\n *\n * The authored catalogue is the source of truth; provider-dashboard edits are not read back.\n * A complete sync detects active local product keys absent from the array and deactivates those\n * products and their active local prices, retaining the rows and reporting live subscribers.\n * It does not archive provider products/prices or migrate/cancel subscribers. Treat provider\n * retirement and customer migration as separate decisions, and inspect the complete sync result.\n *\n * Product types available in the billing catalog.\n *\n * | Type | Creates subscription? | Repeatable? | Grants features? | Usage tracked? |\n * |-------------|----------------------|-------------|------------------|----------------|\n * | PLAN | Yes (exclusive) | No (switch) | Yes | No |\n * | ADDON | Yes (stackable) | No (toggle) | Yes | No |\n * | METERED | Yes | No | Optional | Yes |\n * | ONE_TIME | No | No (once) | Optional | No |\n * | CREDIT_PACK | No | Yes | No (credits) | Credits-based |\n * | ITEM | No | Yes | Optional | No |\n */\nexport enum ProductType {\n /** Subscription plan, mutually exclusive per billing account */\n PLAN = 'plan',\n /** Optional subscription add-on, stackable on top of plan */\n ADDON = 'addon',\n /** Usage-based subscription (consumption reported to provider) */\n METERED = 'metered',\n /** Single purchase, once per billing account (e.g., setup fee, migration) */\n ONE_TIME = 'one_time',\n /** Buy a pack of credits/tokens (repeatable, consumable over time) */\n CREDIT_PACK = 'credit_pack',\n /** Purchasable item, repeatable (e.g., report generation, data export) */\n ITEM = 'item',\n}\n\n// ProductPriceDisclosure / ProductAvailability: declared in `./public-pricing-catalog.shared.atoms`\n// (#1835) — import-free so the website's browser bundle can name them through\n// `@wildo-ai/saas-models/public-runtime`. Not re-exported here; the package root exports the atom.\n\n/**\n * Limit grant mode: how this product's limits compose with other products.\n * - SET: absolute value (replaces, used for PLAN base limits)\n * - ADD: additive (stacks on top, used for ADDON bonus limits)\n */\nexport enum LimitGrantMode {\n SET = 'set',\n ADD = 'add',\n}\n\n// ── Billing Lifecycle ──────────────────────────────────────────────\n\n/**\n * Proration behavior for plan changes (upgrade/downgrade).\n */\n// ProrationBehavior: re-exported from @wildo-ai/external-connectors-models (see top of file).\n// Moved there 2026-09-08 (#516) because its three values ARE the provider's wire values, so the\n// request contract has to be able to name the type — see TaxDisplayMode for the same reasoning.\n\n/**\n * Billing timing: when a cancellation takes effect (`behaviorPolicy.cancellation.defaultBehavior`), and when a plan\n * change takes effect (`behaviorPolicy.upgrade.timing` / `downgrade.timing`, #1868). A plan change `at_period_end` is\n * carried as the subscription's `pendingPlanChange` and applied at renewal through a provider subscription schedule.\n */\nexport enum BillingTiming {\n IMMEDIATE = 'immediate',\n AT_PERIOD_END = 'at_period_end',\n}\n/** @wildo_source:part:end saas.models.billing.catalog-vocabularies */\n\n// BillingInterval: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n// ── Metering & Usage ───────────────────────────────────────────────\n\n/**\n * Metering aggregation window for usage records.\n */\nexport enum MeteringAggregationWindow {\n PER_FLUSH = 'per_flush',\n PER_BILLING_PERIOD = 'per_billing_period',\n}\n\n/**\n * Usage aggregation type for metered prices.\n */\nexport enum UsageAggregationType {\n SUM = 'sum',\n MAX = 'max',\n LAST = 'last',\n}\n\n/**\n * Usage record source type.\n */\nexport enum UsageSourceType {\n OPERATION = 'operation',\n RESOURCE_COUNT = 'resource_count',\n CUSTOM = 'custom',\n}\n\n/**\n * Where one metered usage row stands with respect to the provider flush.\n *\n * This was a BOOLEAN (`reportedToProvider`) until 2026-09-09, and the third state is the whole\n * reason it is an enum now (#512). A boolean can say \"not yet reported\" and \"reported\", and the\n * flush selects on the first — so a row that can NEVER be reported has nowhere to go. It stays\n * pending, is re-selected by every run, fails identically, and grows an error backlog that no\n * operator action can drain, on a five-minute schedule.\n *\n * The three states are genuinely distinct and must not be collapsed:\n *\n * - {@link PENDING} — the flush will try again. Every newly recorded row starts here.\n * - {@link REPORTED} — the provider acknowledged the quantity. `reportedAt` says when. Terminal,\n * and money has moved: never move a row back out of this state.\n * - {@link UNREPORTABLE} — the flush determined the row can never be reported, for a reason named\n * in `unreportableReason`. Terminal, and NO money moved. Marking such a row `REPORTED` instead\n * would drain the backlog just as well and would be a lie no later reader could detect, which is\n * exactly why the state exists rather than a shortcut.\n */\nexport enum UsageRecordFlushState {\n PENDING = 'pending',\n REPORTED = 'reported',\n UNREPORTABLE = 'unreportable',\n}\n\n/**\n * Why a usage row was determined to be permanently unreportable.\n *\n * One member today, and it is a closed vocabulary rather than a free string because the operator\n * reading a retained financial record needs to know which permanent condition applies — and because\n * the distinction between a PERMANENT and a TRANSIENT failure is the judgement this whole state\n * turns on. A billing account that merely has no `providerCustomerId` yet is transient: the account\n * exists, provisioning may still complete, and such a row stays {@link UsageRecordFlushState.PENDING}.\n * Only a condition that cannot resolve itself belongs here.\n */\nexport enum UsageRecordUnreportableReason {\n /**\n * The billing account row no longer exists.\n *\n * Reachable by design: usage rows are RETAINED when their subject is erased (the tax/audit\n * obligation on `usage-record.shared.schemas.ts`), so a deleted account legitimately leaves rows\n * behind with no provider customer to report them to. Nothing can restore the mapping, so the\n * quantity will never be billed and saying so on the row is the only honest outcome.\n */\n BILLING_ACCOUNT_DELETED = 'billing_account_deleted',\n}\n\n// ── Provider reconciliation ────────────────────────────────────────\n\n/**\n * What KIND of disagreement a billing reconciliation run found between local billing state and the\n * provider.\n *\n * A closed vocabulary rather than free text on a log line, because each kind has a different\n * treatment and a different meaning when it persists, and a recorded run has to be able to say\n * which one it saw how many times:\n *\n * - the two DRIFT kinds and the MISSING kind are REPAIRED, within the provider-authoritative field\n * set only;\n * - {@link SUBSCRIPTION_PROVIDER_STATE_UNREADABLE} is NEVER repaired — a failed read, including a\n * provider saying the subscription does not exist, is not evidence the subscription ended, so it\n * is reported and nothing is written.\n *\n * A steady non-zero count of any repaired kind means webhook delivery is failing and the sweep is\n * papering over it; that is a different problem from the sweep failing, and only a per-kind count\n * can tell them apart.\n */\nexport enum BillingReconciliationDivergenceKind {\n /** A live, provider-linked subscription disagreed with the provider on at least one provider-authoritative field. */\n SUBSCRIPTION_FIELD_DRIFT = 'subscription_field_drift',\n /** The provider's state for a provider-linked subscription could not be read. Reported only; local state is untouched. */\n SUBSCRIPTION_PROVIDER_STATE_UNREADABLE = 'subscription_provider_state_unreadable',\n /** An invoice the provider holds for a known customer had no local record — its webhook was never delivered. */\n INVOICE_MISSING_LOCALLY = 'invoice_missing_locally',\n /** A locally recorded invoice carried a different status from the provider's. */\n INVOICE_STATUS_DRIFT = 'invoice_status_drift',\n}\n\n/**\n * A population a reconciliation run met and deliberately did NOT compare against the provider.\n *\n * Counted per run, because a sweep that silently skips rows is indistinguishable from one that\n * compared them and found agreement — and \"we reconciled everything\" is only a true sentence when\n * the skipped populations are stated beside it. Each member is a DECISION with a reason, not a gap:\n *\n * Populations that are never compared by design and therefore never met at all — terminal\n * subscriptions, subscriptions known only to the provider, subscription items, invoice totals, and\n * invoices older than the per-customer lookback — are named on `BillingReconciliationBackendService`\n * rather than here, because a run cannot count what it never selects.\n */\nexport enum BillingReconciliationUncomparedPopulation {\n /** A local subscription with no provider link: there is no provider record to compare it against. */\n SUBSCRIPTION_WITHOUT_PROVIDER_LINK = 'subscription_without_provider_link',\n /**\n * A provider-linked subscription whose mutation slot holds a PREPARED admission: one of its mutations is\n * about to call the provider, so the run neither read nor wrote it. Its next run re-reads it.\n */\n SUBSCRIPTION_MUTATION_ADMISSION_PREPARED = 'subscription_mutation_admission_prepared',\n /**\n * A provider-linked subscription the run read and found disagreeing, but whose mutation slot was written after that read, so nothing\n * was written: the difference may already be gone. The writer is not always a mutation or a webhook — recovery moving a held\n * generation behind newer ones advances the same version without settling anything — so this counts a read to REPEAT, never a\n * mutation observed. Counted here rather than as a divergence the run cannot confirm. Its next run re-reads it.\n */\n SUBSCRIPTION_SUPERSEDED_BEFORE_REPAIR = 'subscription_superseded_before_repair',\n /**\n * A provider-linked subscription whose billing account or provider link no longer matches the identity its mutation slot\n * records. A mutation refuses the same condition as `slot_identity_changed`; the run neither compares nor writes it, and it\n * stays held until recovery resolves the slot.\n */\n SUBSCRIPTION_SLOT_IDENTITY_CHANGED = 'subscription_slot_identity_changed',\n /** A billing account with no provider customer: nothing at the provider can hold its invoices. */\n BILLING_ACCOUNT_WITHOUT_PROVIDER_CUSTOMER = 'billing_account_without_provider_customer',\n /**\n * A billing scope whose rows exceeded one run's page ceiling. The remainder is left to the next run:\n * reconciliation is idempotent, so a prefix is safe, but the count says the run did not cover the scope.\n */\n SCOPE_TRUNCATED_AT_PAGE_CEILING = 'scope_truncated_at_page_ceiling',\n}\n\n// ── Tax ────────────────────────────────────────────────────────────\n\n// TaxDisplayMode: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n/**\n * Tax calculation mode: provider-managed or disabled.\n */\nexport enum TaxCalculationMode {\n PROVIDER_MANAGED = 'provider_managed',\n DISABLED = 'disabled',\n}\n\n// ── Subscription & Invoice Status ──────────────────────────────────\n\n// SubscriptionStatus: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n// InvoiceStatus: re-exported from @wildo-ai/external-connectors-models (see top of file).\n// It moved there on 2026-09-09 so `StandardBilling_InvoiceData` could name it; the specifier every\n// consumer imports is unchanged.\n\n// ── Billing Scope ──────────────────────────────────────────────────\n\n/**\n * Billing-compatible scope types.\n * Subset of ResourcePrimaryScope — excludes APPLICATION which has no billing variants.\n * Used by scope-agnostic billing resources (e.g., Referrals) that reference\n * billing accounts across different polymorphic collections.\n */\nexport enum BillingScopeType {\n ORGANIZATIONS = 'organizations',\n USER_SELF = 'user_self',\n}\n\n// ── Promotions & Referrals ─────────────────────────────────────────\n\n/**\n * Promotion type.\n */\nexport enum PromotionType {\n /** Direct discount */\n COUPON = 'coupon',\n /** Code-based discount */\n PROMOTION_CODE = 'promotion_code',\n /** Referral program */\n REFERRAL = 'referral',\n /** Special deal/offer */\n DEAL = 'deal',\n}\n\n/**\n * Discount type for promotions.\n */\nexport enum DiscountType {\n PERCENTAGE = 'percentage',\n FIXED_AMOUNT = 'fixed_amount',\n}\n\n/**\n * Promotion duration (how long the discount applies).\n */\nexport enum PromotionDuration {\n ONCE = 'once',\n REPEATING = 'repeating',\n FOREVER = 'forever',\n}\n\n/**\n * Referral status lifecycle.\n */\nexport enum ReferralStatus {\n PENDING = 'pending',\n ACCEPTED = 'accepted',\n CONVERTED = 'converted',\n EXPIRED = 'expired',\n CANCELLED = 'cancelled',\n}\n\n/**\n * What a referrer receives when a referral converts (#1802). Each member names the fields it reads in\n * `ReferrerRewardSchema` and how it is delivered:\n *\n * - `CREDIT` — `credits` added to the `creditPoolKey` credit pool, as a GRANT (not a purchase).\n * - `DISCOUNT` — a `percentOff` coupon on the account's active subscription, for `discountDuration`.\n * - `FEATURE` — the boolean feature `featureKey`, for `durationDays` after conversion or permanently.\n *\n * `COMMISSION` was removed: a commission is a payout to the referrer, and the framework has no payout\n * mechanism, so a declared commission could only ever be recorded and never paid.\n */\nexport enum ReferrerRewardType {\n CREDIT = 'credit',\n DISCOUNT = 'discount',\n FEATURE = 'feature',\n}\n\n/**\n * What a referred account receives (#1802). The first three are delivered like the referrer's, when the\n * referral converts. `TRIAL_EXTENSION` shapes the purchase itself: every subscription checkout the\n * referred account opens while the referral is ACCEPTED gets `trialExtensionDays` more trial.\n */\nexport enum ReferredRewardType {\n CREDIT = 'credit',\n DISCOUNT = 'discount',\n FEATURE = 'feature',\n TRIAL_EXTENSION = 'trial_extension',\n}\n\n/**\n * Where credits added to a pool came from (#1802). A pool counts them separately — `totalPurchased` for\n * credits a customer paid for, `totalGranted` for credits given to them — because the two answer\n * different questions: what was sold, and what was given away.\n */\nexport enum CreditPoolTopUpSource {\n /** Credits from a paid purchase (a credit-pack checkout). */\n PURCHASE = 'purchase',\n /** Credits given without a purchase, such as a referral reward. */\n GRANT = 'grant',\n}\n\n// ── Provider checkout metadata: the framework/caller trust boundary ─────────────\n\n/**\n * Prefix that marks a provider-metadata key as FRAMEWORK-AUTHORITATIVE.\n *\n * ## Why a reserved namespace exists at all\n *\n * A provider checkout session carries ONE flat `metadata` map, and two parties want to write into\n * it: the framework (which needs to recognise the purchase when the provider echoes the session\n * back on `checkout.session.completed`) and the application's own caller (who legitimately wants\n * to tag the purchase for their analytics or reconciliation).\n *\n * Those two writers do not have the same authority. The framework's entries decide WHICH billing\n * account is credited and HOW MUCH — the provider replays them verbatim inside a genuinely SIGNED\n * webhook, so a signature proves the provider sent them, never that the framework wrote them. The\n * caller's entries decide nothing.\n *\n * Sharing one un-partitioned namespace between those two authorities is what turned a caller-supplied\n * map into a credit-minting primitive: the producer spread caller metadata LAST, so `billingAccountId`\n * / `productKey` / `quantity` were simply overwritable, and the webhook consumer read the result back\n * as trusted framework state. Ordering alone is not the fix — swapping the spread leaves an\n * unmarked namespace in which the NEXT authoritative key is one careless line from being overridable\n * again. The prefix makes the trust boundary a property of the KEY, so it survives refactors.\n *\n * The boundary is enforced in three places, deliberately overlapping:\n * 1. the OPEN_CHECKOUT request DTO REFUSES any caller key carrying this prefix (loud, at the edge);\n * 2. the metadata builder writes the reserved entries LAST (structural, cannot be forgotten);\n * 3. the webhook consumer reads ONLY reserved keys, and re-derives the billing account from\n * provider-authoritative data rather than trusting the echoed value.\n *\n * @see BillingCheckoutMetadataKey for the reserved key vocabulary itself.\n */\nexport const BILLING_RESERVED_METADATA_KEY_PREFIX = 'wildo_';\n\n/**\n * The closed vocabulary of framework-authoritative provider-metadata keys.\n *\n * Every member MUST start with {@link BILLING_RESERVED_METADATA_KEY_PREFIX} — that is what makes the\n * DTO's caller-key refusal and the consumer's read-only-reserved rule line up. A member added\n * without the prefix would be silently overridable by a caller, which is the whole defect this\n * vocabulary exists to prevent, so a pinned test asserts the prefix across every member.\n *\n * Named rather than inlined because each member carries a different obligation on the consumer side\n * (one is cross-checked against provider truth, one selects the product, one is bounded and\n * strictly parsed) and a bare string literal has nowhere to record that.\n */\nexport enum BillingCheckoutMetadataKey {\n /**\n * The billing account the checkout was opened FOR.\n *\n * Written for traceability and cross-checking only. The webhook consumer re-derives the account\n * from the provider-authoritative customer id on the event and REFUSES the event if the echoed\n * value disagrees — it is never used as the account to credit.\n */\n BILLING_ACCOUNT_ID = 'wildo_billingAccountId',\n /** The catalog product key purchased — selects the credit pool and credits-per-unit on top-up. */\n PRODUCT_KEY = 'wildo_productKey',\n /**\n * The PROMOTION row whose code the framework validated when it opened this checkout, so the\n * redemption can be counted when the session COMPLETES (#518).\n *\n * Absent when the purchase used no code, which is the common case.\n *\n * Stamped rather than re-derived from the completed session, because the provider reports the\n * DISCOUNT it applied and not the Wildo row that authorised it — and the row is what carries\n * `maxRedemptions`. Like every key here it is written for the framework's own reconciliation and is\n * never trusted as authority on its own: the redemption is counted with a compare-and-swap that\n * refuses past the cap, so a tampered value can at worst count a redemption against a promotion\n * that has room for one.\n */\n PROMOTION_ID = 'wildo_promotionId',\n /**\n * The purchased quantity, as a decimal integer string (provider metadata values are strings).\n * Strictly parsed and bounded by {@link BILLING_CHECKOUT_MAX_QUANTITY} on the way back in.\n */\n QUANTITY = 'wildo_quantity',\n}\n\n/**\n * Framework-authoritative metadata keys the engine writes on a provider SUBSCRIPTION (#535), in the same reserved namespace\n * as {@link BillingCheckoutMetadataKey} and under the same rule: every member starts with\n * {@link BILLING_RESERVED_METADATA_KEY_PREFIX}, so no caller-authored metadata can be mistaken for it.\n */\nexport enum BillingSubscriptionMetadataKey {\n /**\n * `<slotId>:<generation>` of the subscription mutation that sent the update. Written so reconciliation can match a\n * provider object to the durable mutation that caused it — including a change whose response was lost. A reference, never\n * authority on its own: a match is confirmed against the stored mutation's identity.\n */\n MUTATION = 'wildo_mutation',\n}\n\n/**\n * Upper bound on a single checkout's line-item quantity, applied on BOTH sides of the provider\n * round trip: the OPEN_CHECKOUT request DTO refuses more, and the webhook consumer refuses to\n * honour more.\n *\n * One shared constant rather than two, because a consumer bound lower than the producer bound would\n * silently refuse legitimate large purchases the framework itself allowed to be billed — the\n * failure mode where the customer is charged and the credits never arrive.\n *\n * The value is a framework policy ceiling, not a provider-derived one: it is deliberately far above\n * any plausible self-serve purchase and far below the range where an unbounded quantity becomes a\n * credit-minting primitive. An application whose catalog genuinely sells in larger units should\n * raise it here, where both sides read it, rather than at either end.\n */\nexport const BILLING_CHECKOUT_MAX_QUANTITY = 999_999;\n"]}
|
|
1
|
+
{"version":3,"file":"billing-enums.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/billing-enums.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE3J,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,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ACrB,yCAAmB,CAAA;IACnB,yDAAmC,CAAA;AACrC,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,6DAA6D;IAC7D,8CAAqB,CAAA;IACrB,mEAAmE;IACnE,wCAAe,CAAA;AACjB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,mFAAmF;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,QAAQ,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,0BA8BX;AA9BD,WAAY,0BAA0B;IACpC;;;;;;OAMG;IACH,2EAA6C,CAAA;IAC7C,kGAAkG;IAClG,8DAAgC,CAAA;IAChC;;;;;;;;;;;;OAYG;IACH,gEAAkC,CAAA;IAClC;;;OAGG;IACH,yDAA2B,CAAA;AAC7B,CAAC,EA9BW,0BAA0B,KAA1B,0BAA0B,QA8BrC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,8BAOX;AAPD,WAAY,8BAA8B;IACxC;;;;OAIG;IACH,6DAA2B,CAAA;AAC7B,CAAC,EAPW,8BAA8B,KAA9B,8BAA8B,QAOzC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAO,CAAC","sourcesContent":["/**\n * Billing Enums (Shared)\n *\n * All billing-system enums used across backend, frontend, and shared models.\n * These supersede the legacy enums from billing.shared.schemas.ts.\n *\n * Enums shared with the standard billing interface (PricingModel, BillingInterval,\n * TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior) are defined in\n * @wildo-ai/external-connectors-models and re-exported here for convenience.\n *\n * @see billing-and-features-system.md §6 (Billing Schemas)\n */\n\nexport { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior } from '@wildo-ai/external-connectors-models';\n\n// ── Product & Pricing ──────────────────────────────────────────────\n\n/**\n * @wildo_source:part:start saas.models.billing.catalog-vocabularies facet:layer:shared facet:audience:app-developer\n *\n * The vocabularies an application types into its own product catalogue — the `ProductDefinition[]`\n * it exports from its shared library and hands to the engine with its module declarations.\n *\n * Imported from `@wildo-ai/saas-models`. `PricingModel`, `BillingInterval` and `ProrationBehavior`\n * are re-exported from the connector models, because their values ARE the provider's wire values.\n *\n * The authored catalogue is the source of truth; provider-dashboard edits are not read back.\n * A complete sync detects active local product keys absent from the array and deactivates those\n * products and their active local prices, retaining the rows and reporting live subscribers.\n * It does not archive provider products/prices or migrate/cancel subscribers. Treat provider\n * retirement and customer migration as separate decisions, and inspect the complete sync result.\n *\n * Product types available in the billing catalog.\n *\n * | Type | Creates subscription? | Repeatable? | Grants features? | Usage tracked? |\n * |-------------|----------------------|-------------|------------------|----------------|\n * | PLAN | Yes (exclusive) | No (switch) | Yes | No |\n * | ADDON | Yes (stackable) | No (toggle) | Yes | No |\n * | METERED | Yes | No | Optional | Yes |\n * | ONE_TIME | No | No (once) | Optional | No |\n * | CREDIT_PACK | No | Yes | No (credits) | Credits-based |\n * | ITEM | No | Yes | Optional | No |\n */\nexport enum ProductType {\n /** Subscription plan, mutually exclusive per billing account */\n PLAN = 'plan',\n /** Optional subscription add-on, stackable on top of plan */\n ADDON = 'addon',\n /** Usage-based subscription (consumption reported to provider) */\n METERED = 'metered',\n /** Single purchase, once per billing account (e.g., setup fee, migration) */\n ONE_TIME = 'one_time',\n /** Buy a pack of credits/tokens (repeatable, consumable over time) */\n CREDIT_PACK = 'credit_pack',\n /** Purchasable item, repeatable (e.g., report generation, data export) */\n ITEM = 'item',\n}\n\n// ProductPriceDisclosure / ProductAvailability: declared in `./public-pricing-catalog.shared.atoms`\n// (#1835) — import-free so the website's browser bundle can name them through\n// `@wildo-ai/saas-models/public-runtime`. Not re-exported here; the package root exports the atom.\n\n/**\n * Limit grant mode: how this product's limits compose with other products.\n * - SET: absolute value (replaces, used for PLAN base limits)\n * - ADD: additive (stacks on top, used for ADDON bonus limits)\n */\nexport enum LimitGrantMode {\n SET = 'set',\n ADD = 'add',\n}\n\n// ── Billing Lifecycle ──────────────────────────────────────────────\n\n/**\n * Proration behavior for plan changes (upgrade/downgrade).\n */\n// ProrationBehavior: re-exported from @wildo-ai/external-connectors-models (see top of file).\n// Moved there 2026-09-08 (#516) because its three values ARE the provider's wire values, so the\n// request contract has to be able to name the type — see TaxDisplayMode for the same reasoning.\n\n/**\n * Billing timing: when a cancellation takes effect (`behaviorPolicy.cancellation.defaultBehavior`), and when a plan\n * change takes effect (`behaviorPolicy.upgrade.timing` / `downgrade.timing`, #1868). A plan change `at_period_end` is\n * carried as the subscription's `pendingPlanChange` and applied at renewal through a provider subscription schedule.\n */\nexport enum BillingTiming {\n IMMEDIATE = 'immediate',\n AT_PERIOD_END = 'at_period_end',\n}\n/** @wildo_source:part:end saas.models.billing.catalog-vocabularies */\n\n// BillingInterval: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n// ── Metering & Usage ───────────────────────────────────────────────\n\n/**\n * Metering aggregation window for usage records.\n */\nexport enum MeteringAggregationWindow {\n PER_FLUSH = 'per_flush',\n PER_BILLING_PERIOD = 'per_billing_period',\n}\n\n/**\n * Usage aggregation type for metered prices.\n */\nexport enum UsageAggregationType {\n SUM = 'sum',\n MAX = 'max',\n LAST = 'last',\n}\n\n/**\n * Usage record source type.\n */\nexport enum UsageSourceType {\n OPERATION = 'operation',\n RESOURCE_COUNT = 'resource_count',\n CUSTOM = 'custom',\n}\n\n/**\n * Where one metered usage row stands with respect to the provider flush.\n *\n * This was a BOOLEAN (`reportedToProvider`) until 2026-09-09, and the third state is the whole\n * reason it is an enum now (#512). A boolean can say \"not yet reported\" and \"reported\", and the\n * flush selects on the first — so a row that can NEVER be reported has nowhere to go. It stays\n * pending, is re-selected by every run, fails identically, and grows an error backlog that no\n * operator action can drain, on a five-minute schedule.\n *\n * The three states are genuinely distinct and must not be collapsed:\n *\n * - {@link PENDING} — the flush will try again. Every newly recorded row starts here.\n * - {@link REPORTED} — the provider acknowledged the quantity. `reportedAt` says when. Terminal,\n * and money has moved: never move a row back out of this state.\n * - {@link UNREPORTABLE} — the flush determined the row can never be reported, for a reason named\n * in `unreportableReason`. Terminal, and NO money moved. Marking such a row `REPORTED` instead\n * would drain the backlog just as well and would be a lie no later reader could detect, which is\n * exactly why the state exists rather than a shortcut.\n */\nexport enum UsageRecordFlushState {\n PENDING = 'pending',\n REPORTED = 'reported',\n UNREPORTABLE = 'unreportable',\n}\n\n/**\n * Why a usage row was determined to be permanently unreportable.\n *\n * One member today, and it is a closed vocabulary rather than a free string because the operator\n * reading a retained financial record needs to know which permanent condition applies — and because\n * the distinction between a PERMANENT and a TRANSIENT failure is the judgement this whole state\n * turns on. A billing account that merely has no `providerCustomerId` yet is transient: the account\n * exists, provisioning may still complete, and such a row stays {@link UsageRecordFlushState.PENDING}.\n * Only a condition that cannot resolve itself belongs here.\n */\nexport enum UsageRecordUnreportableReason {\n /**\n * The billing account row no longer exists.\n *\n * Reachable by design: usage rows are RETAINED when their subject is erased (the tax/audit\n * obligation on `usage-record.shared.schemas.ts`), so a deleted account legitimately leaves rows\n * behind with no provider customer to report them to. Nothing can restore the mapping, so the\n * quantity will never be billed and saying so on the row is the only honest outcome.\n */\n BILLING_ACCOUNT_DELETED = 'billing_account_deleted',\n}\n\n// ── Provider reconciliation ────────────────────────────────────────\n\n/**\n * What KIND of disagreement a billing reconciliation run found between local billing state and the\n * provider.\n *\n * A closed vocabulary rather than free text on a log line, because each kind has a different\n * treatment and a different meaning when it persists, and a recorded run has to be able to say\n * which one it saw how many times:\n *\n * - the two DRIFT kinds and the MISSING kind are REPAIRED, within the provider-authoritative field\n * set only;\n * - {@link SUBSCRIPTION_PROVIDER_STATE_UNREADABLE} is NEVER repaired — a failed read, including a\n * provider saying the subscription does not exist, is not evidence the subscription ended, so it\n * is reported and nothing is written.\n *\n * A steady non-zero count of any repaired kind means webhook delivery is failing and the sweep is\n * papering over it; that is a different problem from the sweep failing, and only a per-kind count\n * can tell them apart.\n */\nexport enum BillingReconciliationDivergenceKind {\n /** A live, provider-linked subscription disagreed with the provider on at least one provider-authoritative field. */\n SUBSCRIPTION_FIELD_DRIFT = 'subscription_field_drift',\n /** The provider's state for a provider-linked subscription could not be read. Reported only; local state is untouched. */\n SUBSCRIPTION_PROVIDER_STATE_UNREADABLE = 'subscription_provider_state_unreadable',\n /** An invoice the provider holds for a known customer had no local record — its webhook was never delivered. */\n INVOICE_MISSING_LOCALLY = 'invoice_missing_locally',\n /** A locally recorded invoice carried a different status from the provider's. */\n INVOICE_STATUS_DRIFT = 'invoice_status_drift',\n}\n\n/**\n * A population a reconciliation run met and deliberately did NOT compare against the provider.\n *\n * Counted per run, because a sweep that silently skips rows is indistinguishable from one that\n * compared them and found agreement — and \"we reconciled everything\" is only a true sentence when\n * the skipped populations are stated beside it. Each member is a DECISION with a reason, not a gap:\n *\n * Populations that are never compared by design and therefore never met at all — terminal\n * subscriptions, subscriptions known only to the provider, subscription items, invoice totals, and\n * invoices older than the per-customer lookback — are named on `BillingReconciliationBackendService`\n * rather than here, because a run cannot count what it never selects.\n */\nexport enum BillingReconciliationUncomparedPopulation {\n /** A local subscription with no provider link: there is no provider record to compare it against. */\n SUBSCRIPTION_WITHOUT_PROVIDER_LINK = 'subscription_without_provider_link',\n /**\n * A provider-linked subscription whose mutation slot holds a PREPARED admission: one of its mutations is\n * about to call the provider, so the run neither read nor wrote it. Its next run re-reads it.\n */\n SUBSCRIPTION_MUTATION_ADMISSION_PREPARED = 'subscription_mutation_admission_prepared',\n /**\n * A provider-linked subscription the run read and found disagreeing, but whose mutation slot was written after that read, so nothing\n * was written: the difference may already be gone. The writer is not always a mutation or a webhook — recovery moving a held\n * generation behind newer ones advances the same version without settling anything — so this counts a read to REPEAT, never a\n * mutation observed. Counted here rather than as a divergence the run cannot confirm. Its next run re-reads it.\n */\n SUBSCRIPTION_SUPERSEDED_BEFORE_REPAIR = 'subscription_superseded_before_repair',\n /**\n * A provider-linked subscription whose billing account or provider link no longer matches the identity its mutation slot\n * records. A mutation refuses the same condition as `slot_identity_changed`; the run neither compares nor writes it, and it\n * stays held until recovery resolves the slot.\n */\n SUBSCRIPTION_SLOT_IDENTITY_CHANGED = 'subscription_slot_identity_changed',\n /** A billing account with no provider customer: nothing at the provider can hold its invoices. */\n BILLING_ACCOUNT_WITHOUT_PROVIDER_CUSTOMER = 'billing_account_without_provider_customer',\n /**\n * A billing scope whose rows exceeded one run's page ceiling. The remainder is left to the next run:\n * reconciliation is idempotent, so a prefix is safe, but the count says the run did not cover the scope.\n */\n SCOPE_TRUNCATED_AT_PAGE_CEILING = 'scope_truncated_at_page_ceiling',\n}\n\n// ── Tax ────────────────────────────────────────────────────────────\n\n// TaxDisplayMode: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n/**\n * Tax calculation mode: provider-managed or disabled.\n */\nexport enum TaxCalculationMode {\n PROVIDER_MANAGED = 'provider_managed',\n DISABLED = 'disabled',\n}\n\n// ── Subscription & Invoice Status ──────────────────────────────────\n\n// SubscriptionStatus: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n// InvoiceStatus: re-exported from @wildo-ai/external-connectors-models (see top of file).\n// It moved there on 2026-09-09 so `StandardBilling_InvoiceData` could name it; the specifier every\n// consumer imports is unchanged.\n\n// ── Billing Scope ──────────────────────────────────────────────────\n\n/**\n * Billing-compatible scope types.\n * Subset of ResourcePrimaryScope — excludes APPLICATION which has no billing variants.\n * Used by scope-agnostic billing resources (e.g., Referrals) that reference\n * billing accounts across different polymorphic collections.\n */\nexport enum BillingScopeType {\n ORGANIZATIONS = 'organizations',\n USER_SELF = 'user_self',\n}\n\n// ── Promotions & Referrals ─────────────────────────────────────────\n\n/**\n * Promotion type.\n */\nexport enum PromotionType {\n /** Direct discount */\n COUPON = 'coupon',\n /** Code-based discount */\n PROMOTION_CODE = 'promotion_code',\n /** Referral program */\n REFERRAL = 'referral',\n /** Special deal/offer */\n DEAL = 'deal',\n}\n\n/**\n * Discount type for promotions.\n */\nexport enum DiscountType {\n PERCENTAGE = 'percentage',\n FIXED_AMOUNT = 'fixed_amount',\n}\n\n/**\n * Promotion duration (how long the discount applies).\n */\nexport enum PromotionDuration {\n ONCE = 'once',\n REPEATING = 'repeating',\n FOREVER = 'forever',\n}\n\n/**\n * Referral status lifecycle.\n */\nexport enum ReferralStatus {\n PENDING = 'pending',\n ACCEPTED = 'accepted',\n CONVERTED = 'converted',\n EXPIRED = 'expired',\n CANCELLED = 'cancelled',\n}\n\n/**\n * What a referrer receives when a referral converts (#1802). Each member names the fields it reads in\n * `ReferrerRewardSchema` and how it is delivered:\n *\n * - `CREDIT` — `credits` added to the `creditPoolKey` credit pool, as a GRANT (not a purchase).\n * - `DISCOUNT` — a `percentOff` coupon on the account's active subscription, for `discountDuration`.\n * - `FEATURE` — the boolean feature `featureKey`, for `durationDays` after conversion or permanently.\n *\n * `COMMISSION` was removed: a commission is a payout to the referrer, and the framework has no payout\n * mechanism, so a declared commission could only ever be recorded and never paid.\n */\nexport enum ReferrerRewardType {\n CREDIT = 'credit',\n DISCOUNT = 'discount',\n FEATURE = 'feature',\n}\n\n/**\n * What a referred account receives (#1802). The first three are delivered like the referrer's, when the\n * referral converts. `TRIAL_EXTENSION` shapes the purchase itself: every subscription checkout the\n * referred account opens while the referral is ACCEPTED gets `trialExtensionDays` more trial.\n */\nexport enum ReferredRewardType {\n CREDIT = 'credit',\n DISCOUNT = 'discount',\n FEATURE = 'feature',\n TRIAL_EXTENSION = 'trial_extension',\n}\n\n/**\n * Where credits added to a pool came from (#1802). A pool counts them separately — `totalPurchased` for\n * credits a customer paid for, `totalGranted` for credits given to them — because the two answer\n * different questions: what was sold, and what was given away.\n */\nexport enum CreditPoolTopUpSource {\n /** Credits from a paid purchase (a credit-pack checkout). */\n PURCHASE = 'purchase',\n /** Credits given without a purchase, such as a referral reward. */\n GRANT = 'grant',\n}\n\n// ── Provider checkout metadata: the framework/caller trust boundary ─────────────\n\n/**\n * Prefix that marks a provider-metadata key as FRAMEWORK-AUTHORITATIVE.\n *\n * ## Why a reserved namespace exists at all\n *\n * A provider checkout session carries ONE flat `metadata` map, and two parties want to write into\n * it: the framework (which needs to recognise the purchase when the provider echoes the session\n * back on `checkout.session.completed`) and the application's own caller (who legitimately wants\n * to tag the purchase for their analytics or reconciliation).\n *\n * Those two writers do not have the same authority. The framework's entries decide WHICH billing\n * account is credited and HOW MUCH — the provider replays them verbatim inside a genuinely SIGNED\n * webhook, so a signature proves the provider sent them, never that the framework wrote them. The\n * caller's entries decide nothing.\n *\n * Sharing one un-partitioned namespace between those two authorities is what turned a caller-supplied\n * map into a credit-minting primitive: the producer spread caller metadata LAST, so `billingAccountId`\n * / `productKey` / `quantity` were simply overwritable, and the webhook consumer read the result back\n * as trusted framework state. Ordering alone is not the fix — swapping the spread leaves an\n * unmarked namespace in which the NEXT authoritative key is one careless line from being overridable\n * again. The prefix makes the trust boundary a property of the KEY, so it survives refactors.\n *\n * The boundary is enforced in three places, deliberately overlapping:\n * 1. the OPEN_CHECKOUT request DTO REFUSES any caller key carrying this prefix (loud, at the edge);\n * 2. the metadata builder writes the reserved entries LAST (structural, cannot be forgotten);\n * 3. the webhook consumer reads ONLY reserved keys, and re-derives the billing account from\n * provider-authoritative data rather than trusting the echoed value.\n *\n * @see BillingCheckoutMetadataKey for the reserved key vocabulary itself.\n */\nexport const BILLING_RESERVED_METADATA_KEY_PREFIX = 'wildo_';\n\n/**\n * The closed vocabulary of framework-authoritative provider-metadata keys.\n *\n * Every member MUST start with {@link BILLING_RESERVED_METADATA_KEY_PREFIX} — that is what makes the\n * DTO's caller-key refusal and the consumer's read-only-reserved rule line up. A member added\n * without the prefix would be silently overridable by a caller, which is the whole defect this\n * vocabulary exists to prevent, so a pinned test asserts the prefix across every member.\n *\n * Named rather than inlined because each member carries a different obligation on the consumer side\n * (one is cross-checked against provider truth, one selects the product, one is bounded and\n * strictly parsed) and a bare string literal has nowhere to record that.\n */\nexport enum BillingCheckoutMetadataKey {\n /**\n * The billing account the checkout was opened FOR.\n *\n * Written for traceability and cross-checking only. The webhook consumer re-derives the account\n * from the provider-authoritative customer id on the event and REFUSES the event if the echoed\n * value disagrees — it is never used as the account to credit.\n */\n BILLING_ACCOUNT_ID = 'wildo_billingAccountId',\n /** The catalog product key purchased — selects the credit pool and credits-per-unit on top-up. */\n PRODUCT_KEY = 'wildo_productKey',\n /**\n * The PROMOTION row whose code the framework validated when it opened this checkout, so the\n * redemption can be counted when the session COMPLETES (#518).\n *\n * Absent when the purchase used no code, which is the common case.\n *\n * Stamped rather than re-derived from the completed session, because the provider reports the\n * DISCOUNT it applied and not the Wildo row that authorised it — and the row is what carries\n * `maxRedemptions`. Like every key here it is written for the framework's own reconciliation and is\n * never trusted as authority on its own: the redemption is counted with a compare-and-swap that\n * refuses past the cap, so a tampered value can at worst count a redemption against a promotion\n * that has room for one.\n */\n PROMOTION_ID = 'wildo_promotionId',\n /**\n * The purchased quantity, as a decimal integer string (provider metadata values are strings).\n * Strictly parsed and bounded by {@link BILLING_CHECKOUT_MAX_QUANTITY} on the way back in.\n */\n QUANTITY = 'wildo_quantity',\n}\n\n/**\n * Framework-authoritative metadata keys the engine writes on a provider SUBSCRIPTION (#535), in the same reserved namespace\n * as {@link BillingCheckoutMetadataKey} and under the same rule: every member starts with\n * {@link BILLING_RESERVED_METADATA_KEY_PREFIX}, so no caller-authored metadata can be mistaken for it.\n */\nexport enum BillingSubscriptionMetadataKey {\n /**\n * `<slotId>:<generation>` of the subscription mutation that sent the update. Written so reconciliation can match a\n * provider object to the durable mutation that caused it — including a change whose response was lost. A reference, never\n * authority on its own: a match is confirmed against the stored mutation's identity.\n */\n MUTATION = 'wildo_mutation',\n}\n\n/**\n * Upper bound on a single checkout's line-item quantity, applied on BOTH sides of the provider\n * round trip: the OPEN_CHECKOUT request DTO refuses more, and the webhook consumer refuses to\n * honour more.\n *\n * One shared constant rather than two, because a consumer bound lower than the producer bound would\n * silently refuse legitimate large purchases the framework itself allowed to be billed — the\n * failure mode where the customer is charged and the credits never arrive.\n *\n * The value is a framework policy ceiling, not a provider-derived one: it is deliberately far above\n * any plausible self-serve purchase and far below the range where an unbounded quantity becomes a\n * credit-minting primitive. An application whose catalog genuinely sells in larger units should\n * raise it here, where both sides read it, rather than at either end.\n */\nexport const BILLING_CHECKOUT_MAX_QUANTITY = 999_999;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-types.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"billing-types.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/billing-types.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAOpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAQ7E,YAAY,EAAE,gCAAgC,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAI7H;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,MAAM,EAAE,UAAU,CAAC;IACnB,4DAA4D;IAC5D,SAAS,EAAE,KAAK,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,UAAU,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,+DAA+D;IAC/D,WAAW,EAAE,IAAI,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,aAAa,CAAC;IACtB,2EAA2E;IAC3E,WAAW,EAAE,IAAI,CAAC;CACnB;AAID;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;iBAc7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;;;;;;;GAaG;AACH,gGAAgG;AAChG,oBAAY,iBAAiB;IAC3B,eAAe,mBAAmB;IAClC,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,YAAY,gBAAgB;IAC5B,iBAAiB,qBAAqB;CACvC;AAED,0FAA0F;AAC1F,oBAAY,wBAAwB;IAClC,SAAS,cAAc;IACvB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,8BAA8B,8FAAwE,CAAC;AACpH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-types.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-types.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,oBAAo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EAAE,CAAC,QAAQ,CAAC,uQAAuQ,CAAC;IACvU,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC7F,CAAC,CAAC","sourcesContent":["/**\n * Billing Supporting Types (Shared)\n *\n * Types used by the billing API, frontend hooks, and provider interface.\n * These are NOT DB schemas — they are API response shapes, provider abstractions,\n * and aggregated views.\n *\n * @see billing-and-features-system.md §6.2c (Supporting Types)\n */\n\nimport { z } from 'zod';\nimport type { MoneyValue } from '@wildo-ai/zod-decorators';\nimport type { BillingTiming } from './billing-enums.shared.schemas';\nimport { BillingAccountSchema } from './billing-account.shared.schemas';\nimport { BillingSubscriptionBaseSchema } from './subscription.shared.schemas';\nimport { ProductSchema } from './product.shared.schemas';\nimport { PriceSchema } from './price.shared.schemas';\nimport { InvoiceRefSchema } from './invoice-ref.shared.schemas';\nimport { PromotionSchema } from './promotions.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport { markEmbeddedResourceSchema } from '../resources/embedded-resource-mark.shared.utils';\n\n// ── Provider Canonical Types ───────────────────────────────────────\n// StandardBilling_SubscriptionData and StandardBilling_InvoicePreview are\n// defined in @wildo-ai/external-connectors-models (standard billing interface)\n// and re-exported here for convenience.\nexport type { StandardBilling_SubscriptionData, StandardBilling_InvoicePreview } from '@wildo-ai/external-connectors-models';\n\n// ── Invoice Preview ────────────────────────────────────────────────\n\n/**\n * Presentation value used by the billing plan-change preview. BillingContext transports the\n * provider DTO; the plan-change flow converts its minor-unit amounts into this money shape.\n * Invoice amount due must not be presented as an immediate charge without the resolved settlement policy.\n *\n * All monetary amounts use MoneyValue for bigint precision and self-contained currency.\n */\nexport interface InvoicePreview {\n /** Previewed invoice amount due; settlement timing must be stated separately. */\n amount: MoneyValue;\n /** Line items breakdown (what changed, prorated amounts) */\n lineItems: Array<{\n description: string;\n amount: MoneyValue;\n quantity: number;\n }>;\n /** Invoice period boundaries, not a guaranteed charge time. */\n periodStart: Date;\n periodEnd: Date;\n /**\n * When the change takes effect (#1868): `immediate`, or `at_period_end` — then the previewed invoice is the renewal invoice on the\n * new plan, and confirming charges nothing now.\n */\n timing: BillingTiming;\n /** When the change takes effect: now, or the end of the current period. */\n effectiveAt: Date;\n}\n\n// ── Usage Summary ──────────────────────────────────────────────────\n\n/**\n * Usage summary: aggregated usage data for the frontend UsageDashboard.\n * Computed from UsageRecords, keyed by metered product key.\n *\n * Authored as a Zod schema (not a bare interface) so it can compose into\n * `BillingStateResponseSchema` — the runtime contract wired as the `GET_STATE`\n * custom operation's `customResponseDto`. `UsageSummary` is derived from it to\n * keep the type and the runtime shape from drifting.\n */\nexport const UsageSummarySchema = z.object({\n /** Usage per metered product, keyed by product key */\n byProduct: z.record(\n z.string(),\n z.object({\n currentPeriodUsage: z.number().describe(\"Usage recorded in the current billing period.\"),\n /** Previous period (for trend display) */\n previousPeriodUsage: z.number().optional().describe(\"Usage recorded in the previous billing period.\"),\n /** Usage limit (from product/subscription, if applicable) */\n limit: z.number().optional().describe(\"The usage limit set by the product or subscription, when one applies.\"),\n /** Last usage recorded at */\n lastRecordedAt: z.date().optional().describe(\"When usage was last recorded.\"),\n }),\n ).describe(\"Usage per metered product, keyed by product key.\"),\n});\nexport type UsageSummary = z.infer<typeof UsageSummarySchema>;\n\n// ── Billing State Response ─────────────────────────────────────────\n\n/**\n * Per-pool credit balance projection embedded in the aggregated billing state.\n *\n * A lean view (NOT the full `CreditPool` resource) built by the billing-state\n * facade purely for the frontend balance display, keyed by pool key.\n */\nexport const CreditPoolBalanceSchema = z.object({\n available: z.number().describe(\"Credits available to spend.\"),\n totalPurchased: z.number().describe(\"Credits purchased in total.\"),\n totalGranted: z.number().describe(\"Credits given without a purchase in total, such as referral rewards.\"),\n totalConsumed: z.number().describe(\"Credits consumed in total.\"),\n});\nexport type CreditPoolBalance = z.infer<typeof CreditPoolBalanceSchema>;\n\n/**\n * Aggregated billing state returned by the lazy facade endpoint.\n * Single source of truth for frontend BillingProvider and backend controller.\n *\n * Authored as a Zod schema (not a bare interface) because the `GET_STATE`\n * custom operation wires it as its `customResponseDto`. That operation borrows\n * the COUNT verb for its route/verb via `resourceOperationLike` but returns\n * THIS aggregated shape — so without a `customResponseDto` the DTO builder would\n * assign it the COUNT default envelope (`{ count }`), and the service output\n * would fail `transformOutput`'s `internalDto.parse` → HTTP 500. The composed\n * schema gives the builder the real runtime contract to validate against and to\n * project the external response. `BillingStateResponse` is derived from it so the\n * type and the runtime contract cannot drift.\n */\n/** Independently loaded portions of the aggregate. Derived catalog projections use PRODUCTS. */\nexport enum BillingStateSlice {\n BILLING_ACCOUNT = 'billingAccount',\n SUBSCRIPTION = 'subscription',\n PRODUCTS = 'products',\n PRICES = 'prices',\n INVOICES = 'invoices',\n USAGE = 'usage',\n CREDIT_POOLS = 'creditPools',\n ACTIVE_PROMOTIONS = 'activePromotions',\n}\n\n/** Empty data is meaningful only when its query (and required dependencies) succeeded. */\nexport enum BillingSliceAvailability {\n AVAILABLE = 'available',\n UNAVAILABLE = 'unavailable',\n}\n\nexport const BillingStateAvailabilitySchema = z.record(z.enum(BillingStateSlice), z.enum(BillingSliceAvailability));\nexport type BillingStateAvailability = z.infer<typeof BillingStateAvailabilitySchema>;\n\nexport const BillingStateResponseSchema = z.object({\n /** Query failures keep their empty transport placeholders but MUST NOT be presented as absence. */\n availability: BillingStateAvailabilitySchema.describe(\"Whether each part of this response loaded. A part marked `unavailable` failed to load: its empty value means nothing, and must not be read as absence.\"),\n billingAccount: BillingAccountSchema.nullable().describe(\"The billing account of the caller's scope, or `null` when the scope has none.\"),\n // The subscription and the invoice refs are not marked as embedded records like the products below: which resource\n // they are depends on the caller's scope. So the few fields no other source describes here are described in place\n // (#1625), rather than on the base schemas, where they would replace each resource's own, richer description.\n subscription: BillingSubscriptionBaseSchema.extend({\n status: BillingSubscriptionBaseSchema.shape.status.describe(\"The subscription's lifecycle state as the billing provider reports it, such as `active`, `trialing` or `past_due`.\"),\n }).nullable().describe(\"The scope's current subscription, or `null` when it has none.\"),\n // Products, prices and promotions are each one resource's records, described by that resource (#1625).\n products: z.array(markEmbeddedResourceSchema(ProductSchema, CoreResourceType.PRODUCTS)).describe(\"Every product visible in this scope, including ones no longer on sale, so a plan someone already holds can still be named. Which of them can be acquired now is `acquirableProductKeys`.\"),\n prices: z.array(markEmbeddedResourceSchema(PriceSchema, CoreResourceType.PRICES)).describe(\"The prices visible in this scope.\"),\n invoices: z.array(InvoiceRefSchema.extend({\n status: InvoiceRefSchema.shape.status.describe(\"The invoice's payment state as the billing provider reports it, such as `open`, `paid` or `void`.\"),\n total: InvoiceRefSchema.shape.total.describe('The invoice total: an amount in minor units, with its currency.'),\n })).describe(\"References to the scope's invoices.\"),\n usage: UsageSummarySchema.describe(\"Metered usage in this scope.\"),\n creditPools: z.record(z.string(), CreditPoolBalanceSchema).describe(\"Credit balances, keyed by credit pool.\"),\n /**\n * Scope/product-visible promotions for the current billing surface.\n *\n * This list intentionally excludes promotions that are inactive, exhausted,\n * unsynced with the billing provider, or targeted only at products outside the\n * current scope. It is not a promise that every entry is redeemable for any\n * arbitrary checkout item the user might pick next.\n */\n activePromotions: z.array(markEmbeddedResourceSchema(PromotionSchema, CoreResourceType.PROMOTIONS)).describe(\"Promotions visible in this scope: active, not exhausted, synced with the billing provider, and targeting a product in scope. Not a promise that each one applies to a particular checkout.\"),\n /**\n * The subset of `products` (by `key`) a caller may ACQUIRE right now — buy, or move a\n * subscription onto.\n *\n * ## Why a sibling key set rather than a filter on `products`\n *\n * One call serves two surfaces that want OPPOSITE things from it. An acquisition surface (a\n * pricing table) must not offer a plan the purchase gate will refuse; a holding surface (the\n * \"your current plan\" panel, the subscription-item → product resolution in the frontend billing\n * context) must still be able to NAME a plan the catalogue has withdrawn, because a customer\n * already on a retired plan is exactly who needs to see what they hold. Filtering `products` by\n * `isActive` would serve the first and break the second — the same trade the `REMOVE_ADDON` call\n * site settles by reading with `REFERENCE` intent rather than `ACQUIRE`.\n *\n * So the response DISTINGUISHES instead of filtering: `products` stays the full scope-visible\n * catalog, and this set states which of them acquisition may offer.\n *\n * ## Why the server answers it at all\n *\n * `Product.isActive` is the declared off-boarding path, and the backend gate that makes\n * retirement TRUE (`readProductByKey` with `ACQUIRE` intent) applies ONE predicate to it. A\n * listing surface holds rows, not keys, so it cannot use that reader — and every listing left to\n * itself re-derives the rule from the raw column. That had already happened twice by 2026-09-09,\n * in a frontend component and in the reader, agreeing only by luck. This set is computed by the\n * gate's own predicate, so a surface that reads it cannot drift from what checkout will accept.\n *\n * NOT a visibility answer: `isPublic` is a per-surface decision the server cannot take for every\n * caller (a back-office catalog shows non-public rows). A customer pricing table composes the\n * two; it must not re-spell either.\n *\n * The aggregate producer sets this field and BillingContext preserves it. Consumers\n * must check PRODUCTS availability before interpreting this projection: an empty set\n * from an unavailable catalog does not prove that nothing can be acquired.\n *\n * Absence therefore means \"the producer did not project acquirability\", never \"nothing is\n * acquirable\" and never \"everything is\". A consumer that receives the set MUST use it in\n * preference to re-deriving the rule; a consumer that does not is on the older, weaker footing\n * this field exists to retire.\n */\n acquirableProductKeys: z.array(z.string()).optional().describe(\"The keys of the products in `products` that may be bought, or moved onto, right now. Absent means this was not computed, not that nothing can be acquired. Check `availability` for products first: from a catalog that failed to load, an empty list proves nothing.\"),\n scopeType: z.enum(ResourcePrimaryScope).describe(\"The scope this billing state belongs to.\"),\n});\nexport type BillingStateResponse = z.infer<typeof BillingStateResponseSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"billing-types.shared.schemas.js","sourceRoot":"","sources":["../../../src/billing/billing-types.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC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C,oBAAoB,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC7F,CAAC,CAAC","sourcesContent":["/**\n * Billing Supporting Types (Shared)\n *\n * Types used by the billing API, frontend hooks, and provider interface.\n * These are NOT DB schemas — they are API response shapes, provider abstractions,\n * and aggregated views.\n *\n * @see billing-and-features-system.md §6.2c (Supporting Types)\n */\n\nimport { z } from 'zod';\nimport type { MoneyValue } from '@wildo-ai/zod-decorators';\nimport type { BillingTiming } from './billing-enums.shared.schemas';\nimport { BillingAccountSchema } from './billing-account.shared.schemas';\nimport { BillingSubscriptionBaseSchema } from './subscription.shared.schemas';\nimport { ProductSchema } from './product.shared.schemas';\nimport { PriceSchema } from './price.shared.schemas';\nimport { InvoiceRefSchema } from './invoice-ref.shared.schemas';\nimport { PromotionSchema } from './promotions.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport { markEmbeddedResourceSchema } from '../resources/embedded-resource-mark.shared.utils';\n\n// ── Provider Canonical Types ───────────────────────────────────────\n// StandardBilling_SubscriptionData and StandardBilling_InvoicePreview are\n// defined in @wildo-ai/external-connectors-models (standard billing interface)\n// and re-exported here for convenience.\nexport type { StandardBilling_SubscriptionData, StandardBilling_InvoicePreview } from '@wildo-ai/external-connectors-models';\n\n// ── Invoice Preview ────────────────────────────────────────────────\n\n/**\n * Presentation value used by the billing plan-change preview. BillingContext transports the\n * provider DTO; the plan-change flow converts its minor-unit amounts into this money shape.\n * Invoice amount due must not be presented as an immediate charge without the resolved settlement policy.\n *\n * All monetary amounts use MoneyValue for bigint precision and self-contained currency.\n */\nexport interface InvoicePreview {\n /** Previewed invoice amount due; settlement timing must be stated separately. */\n amount: MoneyValue;\n /** Line items breakdown (what changed, prorated amounts) */\n lineItems: Array<{\n description: string;\n amount: MoneyValue;\n quantity: number;\n }>;\n /** Invoice period boundaries, not a guaranteed charge time. */\n periodStart: Date;\n periodEnd: Date;\n /**\n * When the change takes effect (#1868): `immediate`, or `at_period_end` — then the previewed invoice is the renewal invoice on the\n * new plan, and confirming charges nothing now.\n */\n timing: BillingTiming;\n /** When the change takes effect: now, or the end of the current period. */\n effectiveAt: Date;\n}\n\n// ── Usage Summary ──────────────────────────────────────────────────\n\n/**\n * Usage summary: aggregated usage data for the frontend UsageDashboard.\n * Computed from UsageRecords, keyed by metered product key.\n *\n * Authored as a Zod schema (not a bare interface) so it can compose into\n * `BillingStateResponseSchema` — the runtime contract wired as the `GET_STATE`\n * custom operation's `customResponseDto`. `UsageSummary` is derived from it to\n * keep the type and the runtime shape from drifting.\n */\nexport const UsageSummarySchema = z.object({\n /** Usage per metered product, keyed by product key */\n byProduct: z.record(\n z.string(),\n z.object({\n currentPeriodUsage: z.number().describe(\"Usage recorded in the current billing period.\"),\n /** Previous period (for trend display) */\n previousPeriodUsage: z.number().optional().describe(\"Usage recorded in the previous billing period.\"),\n /** Usage limit (from product/subscription, if applicable) */\n limit: z.number().optional().describe(\"The usage limit set by the product or subscription, when one applies.\"),\n /** Last usage recorded at */\n lastRecordedAt: z.date().optional().describe(\"When usage was last recorded.\"),\n }),\n ).describe(\"Usage per metered product, keyed by product key.\"),\n});\nexport type UsageSummary = z.infer<typeof UsageSummarySchema>;\n\n// ── Billing State Response ─────────────────────────────────────────\n\n/**\n * Per-pool credit balance projection embedded in the aggregated billing state.\n *\n * A lean view (NOT the full `CreditPool` resource) built by the billing-state\n * facade purely for the frontend balance display, keyed by pool key.\n */\nexport const CreditPoolBalanceSchema = z.object({\n available: z.number().describe(\"Credits available to spend.\"),\n totalPurchased: z.number().describe(\"Credits purchased in total.\"),\n totalGranted: z.number().describe(\"Credits given without a purchase in total, such as referral rewards.\"),\n totalConsumed: z.number().describe(\"Credits consumed in total.\"),\n});\nexport type CreditPoolBalance = z.infer<typeof CreditPoolBalanceSchema>;\n\n/**\n * Aggregated billing state returned by the lazy facade endpoint.\n * Single source of truth for frontend BillingProvider and backend controller.\n *\n * Authored as a Zod schema (not a bare interface) because the `GET_STATE`\n * custom operation wires it as its `customResponseDto`. That operation borrows\n * the COUNT verb for its route/verb via `resourceOperationLike` but returns\n * THIS aggregated shape — so without a `customResponseDto` the DTO builder would\n * assign it the COUNT default envelope (`{ count }`), and the service output\n * would fail `transformOutput`'s `internalDto.parse` → HTTP 500. The composed\n * schema gives the builder the real runtime contract to validate against and to\n * project the external response. `BillingStateResponse` is derived from it so the\n * type and the runtime contract cannot drift.\n */\n/** Independently loaded portions of the aggregate. Derived catalog projections use PRODUCTS. */\nexport enum BillingStateSlice {\n BILLING_ACCOUNT = 'billingAccount',\n SUBSCRIPTION = 'subscription',\n PRODUCTS = 'products',\n PRICES = 'prices',\n INVOICES = 'invoices',\n USAGE = 'usage',\n CREDIT_POOLS = 'creditPools',\n ACTIVE_PROMOTIONS = 'activePromotions',\n}\n\n/** Empty data is meaningful only when its query (and required dependencies) succeeded. */\nexport enum BillingSliceAvailability {\n AVAILABLE = 'available',\n UNAVAILABLE = 'unavailable',\n}\n\nexport const BillingStateAvailabilitySchema = z.record(z.enum(BillingStateSlice), z.enum(BillingSliceAvailability));\nexport type BillingStateAvailability = z.infer<typeof BillingStateAvailabilitySchema>;\n\nexport const BillingStateResponseSchema = z.object({\n /** Query failures keep their empty transport placeholders but MUST NOT be presented as absence. */\n availability: BillingStateAvailabilitySchema.describe(\"Whether each part of this response loaded. A part marked `unavailable` failed to load: its empty value means nothing, and must not be read as absence.\"),\n billingAccount: BillingAccountSchema.nullable().describe(\"The billing account of the caller's scope, or `null` when the scope has none.\"),\n // The subscription and the invoice refs are not marked as embedded records like the products below: which resource\n // they are depends on the caller's scope. So the few fields no other source describes here are described in place\n // (#1625), rather than on the base schemas, where they would replace each resource's own, richer description.\n subscription: BillingSubscriptionBaseSchema.extend({\n status: BillingSubscriptionBaseSchema.shape.status.describe(\"The subscription's lifecycle state as the billing provider reports it, such as `active`, `trialing` or `past_due`.\"),\n }).nullable().describe(\"The scope's current subscription, or `null` when it has none.\"),\n // Products, prices and promotions are each one resource's records, described by that resource (#1625).\n products: z.array(markEmbeddedResourceSchema(ProductSchema, CoreResourceType.PRODUCTS)).describe(\"Every product visible in this scope, including ones no longer on sale, so a plan someone already holds can still be named. Which of them can be acquired now is `acquirableProductKeys`.\"),\n prices: z.array(markEmbeddedResourceSchema(PriceSchema, CoreResourceType.PRICES)).describe(\"The prices visible in this scope.\"),\n invoices: z.array(InvoiceRefSchema.extend({\n status: InvoiceRefSchema.shape.status.describe(\"The invoice's payment state as the billing provider reports it, such as `open`, `paid` or `void`.\"),\n total: InvoiceRefSchema.shape.total.describe('The invoice total: an amount in minor units, with its currency.'),\n })).describe(\"References to the scope's invoices.\"),\n usage: UsageSummarySchema.describe(\"Metered usage in this scope.\"),\n creditPools: z.record(z.string(), CreditPoolBalanceSchema).describe(\"Credit balances, keyed by credit pool.\"),\n /**\n * Scope/product-visible promotions for the current billing surface.\n *\n * This list intentionally excludes promotions that are inactive, exhausted,\n * unsynced with the billing provider, or targeted only at products outside the\n * current scope. It is not a promise that every entry is redeemable for any\n * arbitrary checkout item the user might pick next.\n */\n activePromotions: z.array(markEmbeddedResourceSchema(PromotionSchema, CoreResourceType.PROMOTIONS)).describe(\"Promotions visible in this scope: active, not exhausted, synced with the billing provider, and targeting a product in scope. Not a promise that each one applies to a particular checkout.\"),\n /**\n * The subset of `products` (by `key`) a caller may ACQUIRE right now — buy, or move a\n * subscription onto.\n *\n * ## Why a sibling key set rather than a filter on `products`\n *\n * One call serves two surfaces that want OPPOSITE things from it. An acquisition surface (a\n * pricing table) must not offer a plan the purchase gate will refuse; a holding surface (the\n * \"your current plan\" panel, the subscription-item → product resolution in the frontend billing\n * context) must still be able to NAME a plan the catalogue has withdrawn, because a customer\n * already on a retired plan is exactly who needs to see what they hold. Filtering `products` by\n * `isActive` would serve the first and break the second — the same trade the `REMOVE_ADDON` call\n * site settles by reading with `REFERENCE` intent rather than `ACQUIRE`.\n *\n * So the response DISTINGUISHES instead of filtering: `products` stays the full scope-visible\n * catalog, and this set states which of them acquisition may offer.\n *\n * ## Why the server answers it at all\n *\n * `Product.isActive` is the declared off-boarding path, and the backend gate that makes\n * retirement TRUE (`readProductByKey` with `ACQUIRE` intent) applies ONE predicate to it. A\n * listing surface holds rows, not keys, so it cannot use that reader — and every listing left to\n * itself re-derives the rule from the raw column. That had already happened twice by 2026-09-09,\n * in a frontend component and in the reader, agreeing only by luck. This set is computed by the\n * gate's own predicate, so a surface that reads it cannot drift from what checkout will accept.\n *\n * NOT a visibility answer: `isPublic` is a per-surface decision the server cannot take for every\n * caller (a back-office catalog shows non-public rows). A customer pricing table composes the\n * two; it must not re-spell either.\n *\n * The aggregate producer sets this field and BillingContext preserves it. Consumers\n * must check PRODUCTS availability before interpreting this projection: an empty set\n * from an unavailable catalog does not prove that nothing can be acquired.\n *\n * Absence therefore means \"the producer did not project acquirability\", never \"nothing is\n * acquirable\" and never \"everything is\". A consumer that receives the set MUST use it in\n * preference to re-deriving the rule; a consumer that does not is on the older, weaker footing\n * this field exists to retire.\n */\n acquirableProductKeys: z.array(z.string()).optional().describe(\"The keys of the products in `products` that may be bought, or moved onto, right now. Absent means this was not computed, not that nothing can be acquired. Check `availability` for products first: from a catalog that failed to load, an empty list proves nothing.\"),\n scopeType: z.enum(ResourcePrimaryScope).describe(\"The scope this billing state belongs to.\"),\n});\nexport type BillingStateResponse = z.infer<typeof BillingStateResponseSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-pool.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"credit-pool.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/billing/credit-pool.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AAQzG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,oBAAY,qBAAqB;IAC/B;gEAC4D;IAC5D,OAAO,YAAY;IACnB;8GAC0G;IAC1G,MAAM,WAAW;CAClB;AAID,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;iBAOrC,CAAC;AAEH,eAAO,MAAM,+BAA+B,wQA+J3C,CAAC"}
|