@wildo-ai/saas-models 1.1.7 → 1.1.9
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.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.map +1 -1
- 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-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.map +1 -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.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
- 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.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/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/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
- 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 +32 -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 +32 -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.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.map +1 -1
- 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.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.map +1 -1
- 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.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.map +1 -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.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.map +1 -1
- 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 +32 -0
- 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 +66 -1
- 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.map +1 -1
- 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.map +1 -1
- 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 +70 -1
- 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.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/resources-config.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- 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.shared.defaults.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- 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.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/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
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected-feature.example.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"connected-feature.example.js","sourceRoot":"","sources":["../../../../src/features/connected-feature.example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AAC;AAEvD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAC1D,QAAQ,EAAE,CAAC,kBAAkB,CAAC,gBAAgB,CAAC;CAChD,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;AAEjF,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,uFAAuF;IACvF,wDAAuC,CAAA;AACzC,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,aAAa,CAAC,iBAAiB,EAAE;IACpF,KAAK,EAAE,oBAAoB,CAAC,aAAa;IACzC,OAAO,EAAE,kBAAkB;IAC3B,aAAa,EAAE,oBAAoB,CAAC,OAAO;CAC5C,CAAC,CAAC;AACH,4EAA4E","sourcesContent":["/**\n * Tier B usage example for the `engine-product-definitions` skill: ONE feature identifier followed\n * from its declaration to the contract that sells it and the contract that enforces it.\n *\n * WHY TIER B (and not Tier A against the dogfood application):\n *\n * 1. What this teaches is the JOIN between four declarations that live in four different files —\n * a definition, a module contribution, a product grant and an operation requirement. In a real\n * application those are correctly far apart, so a Tier-A anchor would either span unrelated\n * code or need four separate spans the reader has to reassemble mentally. The shape is stable;\n * the product identity around it is not, which is exactly what Tier B is for.\n * 2. Declaring a sellable feature in the dogfood application would change what that application\n * offers, which is a product decision rather than a documentation one.\n *\n * Imports are RELATIVE because this file lives inside `@wildo-ai/saas-models` itself and a package\n * may not import its own name — that resolves against its own `dist/` and is a known compile-storm\n * source. An application developer types the public specifier instead, which the anchored prose\n * below states explicitly, because the compiled skill is read by someone with no access to this\n * repository.\n *\n * This file is anchored but never imported by runtime code and never exported from the package\n * barrel. It is typechecked by the package's ordinary program (`include: [\"src\"]`), so a change to\n * any contract it names breaks the build here rather than silently rotting inside a shipped skill.\n * When an authoring surface below changes, edit this file directly and the compiled skill picks the\n * new shape up on the next `wildo fwk generate-docs`.\n */\n\nimport { defineFeature, defineLimitFeature, type FeatureDefinitionWithAutoRegister } from './feature-builders.shared';\nimport { FeatureLimitSemantic, FeatureUnavailabilityBehavior } from './feature-definition.shared.schemas';\nimport { FEATURES_UNLIMITED } from './scope-features.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport type { RequiredFeaturesConfig } from '../resources/resources-config.shared.schemas';\nimport type { ProductDefinition } from '../billing/product-definition.shared.schemas';\nimport type { SharedSaaSModule } from '../runtime/domain-module.shared.definitions';\n\n/** @wildo_source:part:start example.features.connected-feature.declaration facet:kind:usage-example facet:audience:app-developer */\n// One feature identifier, followed from declaration to enforcement.\n//\n// In an application every symbol below comes from the package root:\n//\n// import {\n// defineFeature, defineLimitFeature, FEATURES_UNLIMITED, FeatureLimitSemantic,\n// FeatureUnavailabilityBehavior, ResourcePrimaryScope,\n// type FeatureDefinitionWithAutoRegister, type ProductDefinition,\n// type RequiredFeaturesConfig, type SharedSaaSModule,\n// } from '@wildo-ai/saas-models';\n\n/**\n * The identifier is a NAMED ENUM MEMBER rather than a bare string, so the one place that explains\n * what the feature means travels with every use of it.\n */\nexport enum ApplicationFeature {\n /** Access the application's advanced reporting operation and interface. */\n ADVANCED_REPORTS = 'ADVANCED_REPORTS',\n}\n\nexport const CUSTOM_FEATURE_DEFINITIONS: FeatureDefinitionWithAutoRegister[] = [\n defineFeature(ApplicationFeature.ADVANCED_REPORTS, {\n scope: ResourcePrimaryScope.ORGANIZATIONS,\n defaultEnabled: false,\n unavailability: { behavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT },\n }),\n];\n\n// Merge these hooks into the EXISTING engine contribution; do not register a second engine module.\nexport const reportingContribution = {\n customFeatureDefinitions: CUSTOM_FEATURE_DEFINITIONS,\n customFeatureConfiguration: {\n profiles: { preview: { features: [ApplicationFeature.ADVANCED_REPORTS], limits: {} } },\n defaultProfile: 'preview',\n },\n} satisfies Pick<SharedSaaSModule, 'customFeatureDefinitions' | 'customFeatureConfiguration'>;\n\n// When billing is enabled, apply this fragment to the intended existing plan or add-on.\nexport const reportingProductGrant = {\n grantedFeatures: [ApplicationFeature.ADVANCED_REPORTS],\n} satisfies Pick<ProductDefinition, 'grantedFeatures'>;\n\n// Use this as requiredFeatures on EVERY externally reachable reporting operation variant.\nexport const reportingRequirement: RequiredFeaturesConfig = {\n features: [ApplicationFeature.ADVANCED_REPORTS],\n};\nexport const reportingOperationGate = { requiredFeatures: reportingRequirement };\n\nexport enum BudgetFeature {\n /** Upper bound measured by a token-consumption service, not a repository row count. */\n MONTHLY_TOKEN_CAP = 'MONTHLY_TOKEN_CAP',\n}\n\n// Contribute this definition alongside your other definitions only when a consumer enforces it.\nexport const tokenCapDefinition = defineLimitFeature(BudgetFeature.MONTHLY_TOKEN_CAP, {\n scope: ResourcePrimaryScope.ORGANIZATIONS,\n default: FEATURES_UNLIMITED,\n limitSemantic: FeatureLimitSemantic.CEILING,\n});\n/** @wildo_source:part:end example.features.connected-feature.declaration */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-feature-definitions.shared.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"core-feature-definitions.shared.d.ts","sourceRoot":"","sources":["../../../../src/features/core-feature-definitions.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,EA8HvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-feature-definitions.shared.js","sourceRoot":"","sources":["../../../src/features/core-feature-definitions.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MA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AgB,CAAC,YAAY,EAAE;KAC1D;IACD;QACE,0EAA0E;QAC1E,EAAE;QACF,0FAA0F;QAC1F,2DAA2D;QAC3D,EAAE;QACF,0FAA0F;QAC1F,+FAA+F;QAC/F,6FAA6F;QAC7F,8FAA8F;QAC9F,mDAAmD;QACnD,EAAE;QACF,4FAA4F;QAC5F,gGAAgG;QAChG,4FAA4F;QAC5F,6FAA6F;QAC7F,EAAE;QACF,sFAAsF;QACtF,+FAA+F;QAC/F,6FAA6F;QAC7F,+EAA+E;QAC/E,UAAU,EAAE,2BAA2B;QACvC,SAAS,EAAE,gBAAgB,CAAC,KAAK;QACjC,aAAa,EAAE,oBAAoB,CAAC,OAAO;QAC3C,wFAAwF;QACxF,sFAAsF;QACtF,6FAA6F;QAC7F,4FAA4F;QAC5F,6FAA6F;QAC7F,gBAAgB,EAAE;YAChB,oBAAoB,CAAC,SAAS;YAC9B,oBAAoB,CAAC,aAAa;YAClC,oBAAoB,CAAC,WAAW;SACjC;QACD,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,kBAAkB;KACjC;CACF,CAAC","sourcesContent":["/**\n * Framework Core Feature Definitions\n *\n * These are business features managed by the engine (not tied to external providers).\n * Enabled by config profiles, billing products, or manual admin overrides.\n *\n * Note: PRIORITY_SUPPORT, CUSTOM_INTEGRATIONS, ADVANCED_PERMISSIONS from the old CoreOrganizationFeature\n * enum were dropped:\n * - PRIORITY_SUPPORT → modeled as a custom app feature (not engine-level)\n * - CUSTOM_INTEGRATIONS → modeled by provider declarations, not entitlement features\n * - ADVANCED_PERMISSIONS → handled by RBAC system, not feature gating\n */\n\nimport { CoreFeature } from '../organizations/organization-features.shared.schemas';\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { FeatureLimitSemantic, FeatureValueType } from './feature-definition.shared.schemas';\nimport { FEATURES_UNLIMITED } from './scope-features.shared.schemas';\nimport type { FeatureDefinition } from './feature-definition.shared.schemas';\n\n/**\n * LIMIT-feature identifier for the inbound Agent2Agent (A2A) LLM **token budget**: how many LLM\n * tokens a tenant's A2A agent turns may consume per billing period. Grant it from a billing plan\n * (a `LimitGrant` on the product) and the A2A transport enforces it fail-closed, denying further\n * turns with HTTP 402 once exhausted.\n *\n * The single named source for this identifier — the backend budget service resolves the allowance\n * by this exact key, so definition and enforcement cannot drift.\n *\n * Measured in TOKENS, not currency: the framework's canonical provider-usage pricing registry is\n * deliberately not consulted by this A2A entitlement gate. The gate caps the transport's directly\n * metered token consumption; monetary reservation and settlement belong to the separate Work Cycle\n * budget authority.\n */\nexport const A2A_TOKEN_BUDGET_FEATURE_ID = 'a2a.llm.tokensPerPeriod';\n\n/**\n * Core feature definitions: every CoreFeature value + core LIMIT features.\n * Merged with custom app feature definitions at startup.\n */\nexport const CORE_FEATURE_DEFINITIONS: FeatureDefinition[] = [\n // ─── BOOLEAN features (on/off toggles) ───\n {\n identifier: CoreFeature.CUSTOM_BRANDING,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n identifier: CoreFeature.ADVANCED_ANALYTICS,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n identifier: CoreFeature.SINGLE_SIGN_ON,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n identifier: CoreFeature.AUDIT_LOGS,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n // Outbound delivery of audit-trail events to a tenant-owned SIEM /\n // compliance store. Depends on `AUDIT_LOGS` for the read-side surface,\n // but the gate is independent so admins can enable read-only auditing\n // without paying for outbound delivery.\n identifier: CoreFeature.SECURITY_EVENT_EXPORT,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n // SCIM-driven user/group provisioning. Typically procured alongside\n // `SINGLE_SIGN_ON` but each feature is an independent gate so an org\n // can run SSO without provisioning (or vice versa).\n identifier: CoreFeature.DIRECTORY_PROVISIONING,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n // M2M_WEBHOOK_DELIVERY is scope-bound: enabling it at the app level\n // does NOT auto-enable it for every organization. Each scope (app or\n // organization) opts in independently. See `FeatureDefinitionSchema.scopeBoundary`\n // and `FeatureResolutionBackendService.isFeatureEnabledAtScope`.\n identifier: CoreFeature.M2M_WEBHOOK_DELIVERY,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [\n ResourcePrimaryScope.APPLICATION,\n ResourcePrimaryScope.ORGANIZATIONS,\n ],\n dependencies: [],\n defaultValue: false,\n scopeBoundary: true,\n },\n // ─── LIMIT features with counting configs ───\n //\n // NOT auto-checked. `registerCoreFeatures` registers these definitions and stops there; the\n // auto-registration of a `limitChecks` entry runs only in `registerCustomFeatures`, for an\n // application-declared limit built with `countResource`. No operation declares a check for either\n // of the two below, so `counting` names the resource that WOULD be counted and nothing counts it.\n // An application that wants the cap enforced declares the check on the counted resource's CREATE.\n {\n identifier: 'MAX_MEMBERS',\n valueType: FeatureValueType.LIMIT,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: 5,\n counting: { resourceType: CoreResourceType.ORGANIZATION_MEMBERS },\n },\n {\n identifier: 'MAX_API_KEYS',\n valueType: FeatureValueType.LIMIT,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: 2,\n counting: { resourceType: CoreResourceType.ORG_API_KEYS },\n },\n {\n // Inbound A2A LLM token budget — see {@link A2A_TOKEN_BUDGET_FEATURE_ID}.\n //\n // Applies to all THREE A2A owner scopes: a user-delegated turn is owned by the delegating\n // user, a machine turn by its organization or application.\n //\n // NO `counting` config, deliberately: consumption here is a SUM OF TOKENS, not a count of\n // resource rows, so the gate's row-counting strategy cannot measure it. The A2A budget service\n // owns measurement (accumulating into the `a2aTokenBudgetState` singleton) and resolves this\n // limit directly — which is exactly the \"limit checking done in custom service code\" case the\n // `counting` field documents as its absent-branch.\n //\n // ⚠️ `limitSemantic: CEILING` is LOAD-BEARING — without it this feature is inert. Under the\n // default FLOOR semantic the merge is most-permissive-wins, so the `FEATURES_UNLIMITED` default\n // below would absorb every finite plan grant (`max(-1, 10_000) = -1`) and no cap could ever\n // engage. CEILING inverts it: `-1` means \"no ceiling\" and YIELDS to the plan's finite grant.\n //\n // With CEILING, `defaultValue: FEATURES_UNLIMITED` is both correct and required: this\n // definition is registered for EVERY application, so a finite default would silently cap every\n // tenant that never opted into A2A budgeting (and `0` would deny every A2A turn everywhere).\n // Budgeting stays opt-in — a real cap arrives only from a plan's `LimitGrant`.\n identifier: A2A_TOKEN_BUDGET_FEATURE_ID,\n valueType: FeatureValueType.LIMIT,\n limitSemantic: FeatureLimitSemantic.CEILING,\n // All three A2A owner scopes are declared because all three can OWN a turn. ⚠️ But only\n // ORGANIZATIONS and USER_SELF have a BILLING rail (`BILLING_SCOPE_TO_VARIANTS` has no\n // application variant), so an APPLICATION-scope cap cannot arrive from a plan `LimitGrant` —\n // it must come from a features profile or a manual `limitOverrides`. Declaring the scope is\n // still correct: without it an app-machine principal could never be capped by ANY mechanism.\n applicableScopes: [\n ResourcePrimaryScope.USER_SELF,\n ResourcePrimaryScope.ORGANIZATIONS,\n ResourcePrimaryScope.APPLICATION,\n ],\n dependencies: [],\n defaultValue: FEATURES_UNLIMITED,\n },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"core-feature-definitions.shared.js","sourceRoot":"","sources":["../../../../src/features/core-feature-definitions.shared.ts"],"names":[],"mappings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,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,EAAE,YAAY,EAAE,gBAAgB,CAAC,YAAY,EAAE;KAC1D;IACD;QACE,0EAA0E;QAC1E,EAAE;QACF,0FAA0F;QAC1F,2DAA2D;QAC3D,EAAE;QACF,0FAA0F;QAC1F,+FAA+F;QAC/F,6FAA6F;QAC7F,8FAA8F;QAC9F,mDAAmD;QACnD,EAAE;QACF,4FAA4F;QAC5F,gGAAgG;QAChG,4FAA4F;QAC5F,6FAA6F;QAC7F,EAAE;QACF,sFAAsF;QACtF,+FAA+F;QAC/F,6FAA6F;QAC7F,+EAA+E;QAC/E,UAAU,EAAE,2BAA2B;QACvC,SAAS,EAAE,gBAAgB,CAAC,KAAK;QACjC,aAAa,EAAE,oBAAoB,CAAC,OAAO;QAC3C,wFAAwF;QACxF,sFAAsF;QACtF,6FAA6F;QAC7F,4FAA4F;QAC5F,6FAA6F;QAC7F,gBAAgB,EAAE;YAChB,oBAAoB,CAAC,SAAS;YAC9B,oBAAoB,CAAC,aAAa;YAClC,oBAAoB,CAAC,WAAW;SACjC;QACD,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,kBAAkB;KACjC;CACF,CAAC","sourcesContent":["/**\n * Framework Core Feature Definitions\n *\n * These are business features managed by the engine (not tied to external providers).\n * Enabled by config profiles, billing products, or manual admin overrides.\n *\n * Note: PRIORITY_SUPPORT, CUSTOM_INTEGRATIONS, ADVANCED_PERMISSIONS from the old CoreOrganizationFeature\n * enum were dropped:\n * - PRIORITY_SUPPORT → modeled as a custom app feature (not engine-level)\n * - CUSTOM_INTEGRATIONS → modeled by provider declarations, not entitlement features\n * - ADVANCED_PERMISSIONS → handled by RBAC system, not feature gating\n */\n\nimport { CoreFeature } from '../organizations/organization-features.shared.schemas';\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { FeatureLimitSemantic, FeatureValueType } from './feature-definition.shared.schemas';\nimport { FEATURES_UNLIMITED } from './scope-features.shared.schemas';\nimport type { FeatureDefinition } from './feature-definition.shared.schemas';\n\n/**\n * LIMIT-feature identifier for the inbound Agent2Agent (A2A) LLM **token budget**: how many LLM\n * tokens a tenant's A2A agent turns may consume per billing period. Grant it from a billing plan\n * (a `LimitGrant` on the product) and the A2A transport enforces it fail-closed, denying further\n * turns with HTTP 402 once exhausted.\n *\n * The single named source for this identifier — the backend budget service resolves the allowance\n * by this exact key, so definition and enforcement cannot drift.\n *\n * Measured in TOKENS, not currency: the framework's canonical provider-usage pricing registry is\n * deliberately not consulted by this A2A entitlement gate. The gate caps the transport's directly\n * metered token consumption; monetary reservation and settlement belong to the separate Work Cycle\n * budget authority.\n */\nexport const A2A_TOKEN_BUDGET_FEATURE_ID = 'a2a.llm.tokensPerPeriod';\n\n/**\n * Core feature definitions: every CoreFeature value + core LIMIT features.\n * Merged with custom app feature definitions at startup.\n */\nexport const CORE_FEATURE_DEFINITIONS: FeatureDefinition[] = [\n // ─── BOOLEAN features (on/off toggles) ───\n {\n identifier: CoreFeature.CUSTOM_BRANDING,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n identifier: CoreFeature.ADVANCED_ANALYTICS,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n identifier: CoreFeature.SINGLE_SIGN_ON,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n identifier: CoreFeature.AUDIT_LOGS,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n // Outbound delivery of audit-trail events to a tenant-owned SIEM /\n // compliance store. Depends on `AUDIT_LOGS` for the read-side surface,\n // but the gate is independent so admins can enable read-only auditing\n // without paying for outbound delivery.\n identifier: CoreFeature.SECURITY_EVENT_EXPORT,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n // SCIM-driven user/group provisioning. Typically procured alongside\n // `SINGLE_SIGN_ON` but each feature is an independent gate so an org\n // can run SSO without provisioning (or vice versa).\n identifier: CoreFeature.DIRECTORY_PROVISIONING,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: false,\n },\n {\n // M2M_WEBHOOK_DELIVERY is scope-bound: enabling it at the app level\n // does NOT auto-enable it for every organization. Each scope (app or\n // organization) opts in independently. See `FeatureDefinitionSchema.scopeBoundary`\n // and `FeatureResolutionBackendService.isFeatureEnabledAtScope`.\n identifier: CoreFeature.M2M_WEBHOOK_DELIVERY,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: [\n ResourcePrimaryScope.APPLICATION,\n ResourcePrimaryScope.ORGANIZATIONS,\n ],\n dependencies: [],\n defaultValue: false,\n scopeBoundary: true,\n },\n // ─── LIMIT features with counting configs ───\n //\n // NOT auto-checked. `registerCoreFeatures` registers these definitions and stops there; the\n // auto-registration of a `limitChecks` entry runs only in `registerCustomFeatures`, for an\n // application-declared limit built with `countResource`. No operation declares a check for either\n // of the two below, so `counting` names the resource that WOULD be counted and nothing counts it.\n // An application that wants the cap enforced declares the check on the counted resource's CREATE.\n {\n identifier: 'MAX_MEMBERS',\n valueType: FeatureValueType.LIMIT,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: 5,\n counting: { resourceType: CoreResourceType.ORGANIZATION_MEMBERS },\n },\n {\n identifier: 'MAX_API_KEYS',\n valueType: FeatureValueType.LIMIT,\n applicableScopes: [ResourcePrimaryScope.ORGANIZATIONS],\n dependencies: [],\n defaultValue: 2,\n counting: { resourceType: CoreResourceType.ORG_API_KEYS },\n },\n {\n // Inbound A2A LLM token budget — see {@link A2A_TOKEN_BUDGET_FEATURE_ID}.\n //\n // Applies to all THREE A2A owner scopes: a user-delegated turn is owned by the delegating\n // user, a machine turn by its organization or application.\n //\n // NO `counting` config, deliberately: consumption here is a SUM OF TOKENS, not a count of\n // resource rows, so the gate's row-counting strategy cannot measure it. The A2A budget service\n // owns measurement (accumulating into the `a2aTokenBudgetState` singleton) and resolves this\n // limit directly — which is exactly the \"limit checking done in custom service code\" case the\n // `counting` field documents as its absent-branch.\n //\n // ⚠️ `limitSemantic: CEILING` is LOAD-BEARING — without it this feature is inert. Under the\n // default FLOOR semantic the merge is most-permissive-wins, so the `FEATURES_UNLIMITED` default\n // below would absorb every finite plan grant (`max(-1, 10_000) = -1`) and no cap could ever\n // engage. CEILING inverts it: `-1` means \"no ceiling\" and YIELDS to the plan's finite grant.\n //\n // With CEILING, `defaultValue: FEATURES_UNLIMITED` is both correct and required: this\n // definition is registered for EVERY application, so a finite default would silently cap every\n // tenant that never opted into A2A budgeting (and `0` would deny every A2A turn everywhere).\n // Budgeting stays opt-in — a real cap arrives only from a plan's `LimitGrant`.\n identifier: A2A_TOKEN_BUDGET_FEATURE_ID,\n valueType: FeatureValueType.LIMIT,\n limitSemantic: FeatureLimitSemantic.CEILING,\n // All three A2A owner scopes are declared because all three can OWN a turn. ⚠️ But only\n // ORGANIZATIONS and USER_SELF have a BILLING rail (`BILLING_SCOPE_TO_VARIANTS` has no\n // application variant), so an APPLICATION-scope cap cannot arrive from a plan `LimitGrant` —\n // it must come from a features profile or a manual `limitOverrides`. Declaring the scope is\n // still correct: without it an app-machine principal could never be capped by ANY mechanism.\n applicableScopes: [\n ResourcePrimaryScope.USER_SELF,\n ResourcePrimaryScope.ORGANIZATIONS,\n ResourcePrimaryScope.APPLICATION,\n ],\n dependencies: [],\n defaultValue: FEATURES_UNLIMITED,\n },\n];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-builders.shared.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"feature-builders.shared.d.ts","sourceRoot":"","sources":["../../../../src/features/feature-builders.shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAEL,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACzB,MAAM,qCAAqC,CAAC;AAM7C;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,eAA0C,CAAC;AAEjF;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,GAAG;IAClE,CAAC,yBAAyB,CAAC,CAAC,EAAE;QAC5B,oFAAoF;QACpF,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH,CAAC;AAcF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IACP,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,CAAC;IACrD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,6BAA6B,CAAC;CAChD,GACA,iBAAiB,CASnB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IACP,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,CAAC;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,kFAAkF;IAClF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,6BAA6B,CAAC;CAChD,GACA,iCAAiC,CA0BnC;AACD,sEAAsE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-builders.shared.js","sourceRoot":"","sources":["../../../src/features/feature-builders.shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EACL,gBAAgB,GAKjB,MAAM,qCAAqC,CAAC;AAE7C,wDAAwD;AACxD,iCAAiC;AACjC,wDAAwD;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAajF,wDAAwD;AACxD,sBAAsB;AACtB,wDAAwD;AAExD,SAAS,eAAe,CAAC,KAAoD;IAC3E,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,wDAAwD;AACxD,4CAA4C;AAC5C,wDAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAkB,EAClB,OAKC;IAED,OAAO;QACL,UAAU;QACV,SAAS,EAAE,gBAAgB,CAAC,OAAO;QACnC,gBAAgB,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;QAChD,YAAY,EAAE,OAAO,CAAC,cAAc,IAAI,KAAK;QAC7C,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC;AACJ,CAAC;AAED,wDAAwD;AACxD,+CAA+C;AAC/C,wDAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAkB,EAClB,OAsBC;IAED,8FAA8F;IAC9F,MAAM,QAAQ,GACZ,OAAO,CAAC,QAAQ;QAChB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEhF,MAAM,UAAU,GAAsC;QACpD,UAAU;QACV,SAAS,EAAE,gBAAgB,CAAC,KAAK;QACjC,gBAAgB,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;QAChD,YAAY,EAAE,OAAO,CAAC,OAAO;QAC7B,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,6FAA6F;QAC7F,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,QAAQ;QACR,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC;IAEF,kFAAkF;IAClF,IAAI,OAAO,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QACvD,UAAU,CAAC,yBAAyB,CAAC,GAAG;YACtC,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AACD,sEAAsE","sourcesContent":["/**\n * Feature Builder Utilities\n *\n * DX-oriented builder functions for defining features.\n * These handle boilerplate: scope normalization, default values, counting config generation.\n * Custom app developers should use these instead of raw FeatureDefinition objects.\n */\n\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { FEATURES_UNLIMITED } from './scope-features.shared.schemas';\nimport {\n FeatureValueType,\n FeatureLimitSemantic,\n type FeatureDefinition,\n type FeatureUnavailabilityOverride,\n type LimitCountingConfig,\n} from './feature-definition.shared.schemas';\n\n// =====================================================\n// Internal: Auto-register marker\n// =====================================================\n\n/**\n * Internal marker symbol for limit features that should auto-register\n * a limitCheck on the counted resource's CREATE operation.\n * Used by FeatureDefinitionRegistryBackendService at startup.\n */\nexport const AUTO_REGISTER_LIMIT_CHECK = Symbol.for('AUTO_REGISTER_LIMIT_CHECK');\n\n/**\n * Extended FeatureDefinition with auto-register metadata.\n * This is the internal type returned by defineLimitFeature when countResource is provided.\n */\nexport type FeatureDefinitionWithAutoRegister = FeatureDefinition & {\n [AUTO_REGISTER_LIMIT_CHECK]?: {\n /** Resource type whose CREATE operation should get a limitCheck for this feature */\n countResource: string;\n };\n};\n\n// =====================================================\n// Scope Normalization\n// =====================================================\n\nfunction normalizeScopes(scope: ResourcePrimaryScope | ResourcePrimaryScope[]): ResourcePrimaryScope[] {\n return Array.isArray(scope) ? scope : [scope];\n}\n\n// =====================================================\n// defineFeature() — Boolean Feature Builder\n// =====================================================\n\n/**\n * @wildo_source:part:start saas.models.features.definition-builders facet:layer:shared facet:audience:app-developer\n *\n * Declaring what an application can SELL or gate on. Two builders, from `@wildo-ai/saas-models`:\n * `defineFeature` for a boolean capability, `defineLimitFeature` for a numeric allowance.\n *\n * A product in the billing catalogue then grants them through `grantedFeatures` / `grantedLimits`,\n * and any surface gates on the identifier with `requiredFeatures` — a resource operation, a view, a\n * chart, a navigation item, a settings section.\n *\n * ## Two things that decide whether the gate actually fires\n *\n * (`limitSemantic` is the third and is covered by the product-definitions skill's own guidance —\n * the default `FLOOR` is an entitlement the tenant is ALLOWED, and a consumption CAP needs `CEILING`.)\n *\n * - **`countResource` is the one-call form.** It registers a limit check on that resource's CREATE\n * automatically, so \"at most ten projects per organisation\" is one declaration rather than a\n * definition plus a hand-written gate. A limit declared WITHOUT counting cannot be checked\n * automatically: `checkLimit` REFUSES rather than guessing at a remaining quota, and the caller\n * must pass a counting override or measure consumption itself. That is the right answer for a\n * quantity that is not a row count — a sum of tokens, for instance.\n * - **`rateLimit` on a definition is RESERVED and ignored by the gate.** A time-windowed allowance\n * like \"one hundred calls an hour\" is not expressible here at all; abuse throttling is a separate\n * mechanism with its own declaration.\n *\n * ## Granting a capability does not configure it\n *\n * An entitlement says the tenant MAY have the thing. Single sign-on entitles an organisation to\n * register an identity provider; somebody still has to register one. The same holds for provisioning\n * tokens, export destinations and webhook endpoints — so a plan that grants one of these still needs\n * an onboarding step behind it.\n *\n * Simple boolean feature builder.\n *\n * @example\n * defineFeature('AI_ASSISTANT', { scope: ResourcePrimaryScope.ORGANIZATIONS })\n *\n * @example\n * defineFeature('PREMIUM_THEMES', {\n * scope: ResourcePrimaryScope.USER_SELF,\n * unavailability: {\n * behavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n * },\n * })\n */\nexport function defineFeature(\n identifier: string,\n options: {\n scope: ResourcePrimaryScope | ResourcePrimaryScope[];\n defaultEnabled?: boolean;\n dependencies?: string[];\n unavailability?: FeatureUnavailabilityOverride;\n }\n): FeatureDefinition {\n return {\n identifier,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: normalizeScopes(options.scope),\n defaultValue: options.defaultEnabled ?? false,\n dependencies: options.dependencies ?? [],\n unavailability: options.unavailability,\n };\n}\n\n// =====================================================\n// defineLimitFeature() — Limit Feature Builder\n// =====================================================\n\n/**\n * Limit feature builder with auto-wiring support.\n *\n * Key DX improvement: when `countResource` is provided, the engine\n * auto-registers a `limitChecks` entry on the CREATE operation of the\n * referenced resource at startup (via FeatureDefinitionRegistryBackendService).\n *\n * This means: to add \"max 10 projects per org\", write ONE call and the\n * gate is automatically enforced. No need to manually add limitChecks on\n * the resource's operation variant.\n *\n * @example\n * defineLimitFeature('MAX_PROJECTS', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: 5,\n * countResource: CustomShared_ResourceType.PROJECTS,\n * })\n * // Equivalent to manually defining:\n * // { identifier: 'MAX_PROJECTS', valueType: LIMIT, applicableScopes: [ORGANIZATIONS],\n * // defaultValue: 5, counting: { resourceType: 'PROJECTS' } }\n * // + adding limitChecks: [{ featureId: 'MAX_PROJECTS' }] on PROJECTS.CREATE variant\n *\n * @example\n * defineLimitFeature('MAX_STORAGE_GB', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: 10,\n * counting: {\n * resourceType: 'FILES',\n * aggregate: { field: 'sizeBytes', operation: AggregationOperation.SUM },\n * },\n * })\n */\nexport function defineLimitFeature(\n identifier: string,\n options: {\n scope: ResourcePrimaryScope | ResourcePrimaryScope[];\n default: number;\n /**\n * How this limit COMPOSES when several sources supply a value (see {@link FeatureLimitSemantic}).\n * Omit for the default `FLOOR` — an entitlement the tenant is ALLOWED, where most-permissive\n * wins and add-ons stack upward (`MAX_MEMBERS`, `MAX_API_KEYS`).\n *\n * Pass `CEILING` for a consumption CAP the tenant may not exceed: most-RESTRICTIVE wins, and\n * `FEATURES_UNLIMITED` means \"no ceiling\" so it yields to any finite grant. Without it a cap is\n * inexpressible — under FLOOR an unlimited default absorbs every finite plan grant, so the cap\n * silently never engages.\n */\n limitSemantic?: FeatureLimitSemantic;\n /** Resource to count. Auto-registers a limitCheck on CREATE for this resource. */\n countResource?: string;\n /** Advanced: filter + aggregation for counting (overrides simple resource count) */\n counting?: LimitCountingConfig;\n /** If true, skip auto-registration of limitChecks on the resource's CREATE operation */\n skipAutoRegister?: boolean;\n dependencies?: string[];\n unavailability?: FeatureUnavailabilityOverride;\n }\n): FeatureDefinitionWithAutoRegister {\n // Build counting config: explicit counting takes precedence, then countResource, then nothing\n const counting: LimitCountingConfig | undefined =\n options.counting ??\n (options.countResource ? { resourceType: options.countResource } : undefined);\n\n const definition: FeatureDefinitionWithAutoRegister = {\n identifier,\n valueType: FeatureValueType.LIMIT,\n applicableScopes: normalizeScopes(options.scope),\n defaultValue: options.default,\n dependencies: options.dependencies ?? [],\n // Omitted ⇒ absent on the definition ⇒ read as FLOOR, so every existing caller is unchanged.\n ...(options.limitSemantic ? { limitSemantic: options.limitSemantic } : {}),\n counting,\n unavailability: options.unavailability,\n };\n\n // Add auto-register marker for limit features with countResource (unless skipped)\n if (options.countResource && !options.skipAutoRegister) {\n definition[AUTO_REGISTER_LIMIT_CHECK] = {\n countResource: options.countResource,\n };\n }\n\n return definition;\n}\n/** @wildo_source:part:end saas.models.features.definition-builders */\n"]}
|
|
1
|
+
{"version":3,"file":"feature-builders.shared.js","sourceRoot":"","sources":["../../../../src/features/feature-builders.shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EACL,gBAAgB,GAKjB,MAAM,qCAAqC,CAAC;AAE7C,wDAAwD;AACxD,iCAAiC;AACjC,wDAAwD;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAajF,wDAAwD;AACxD,sBAAsB;AACtB,wDAAwD;AAExD,SAAS,eAAe,CAAC,KAAoD;IAC3E,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,wDAAwD;AACxD,4CAA4C;AAC5C,wDAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAkB,EAClB,OAKC;IAED,OAAO;QACL,UAAU;QACV,SAAS,EAAE,gBAAgB,CAAC,OAAO;QACnC,gBAAgB,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;QAChD,YAAY,EAAE,OAAO,CAAC,cAAc,IAAI,KAAK;QAC7C,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC;AACJ,CAAC;AAED,wDAAwD;AACxD,+CAA+C;AAC/C,wDAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAkB,EAClB,OAsBC;IAED,8FAA8F;IAC9F,MAAM,QAAQ,GACZ,OAAO,CAAC,QAAQ;QAChB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEhF,MAAM,UAAU,GAAsC;QACpD,UAAU;QACV,SAAS,EAAE,gBAAgB,CAAC,KAAK;QACjC,gBAAgB,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;QAChD,YAAY,EAAE,OAAO,CAAC,OAAO;QAC7B,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;QACxC,6FAA6F;QAC7F,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,QAAQ;QACR,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC;IAEF,kFAAkF;IAClF,IAAI,OAAO,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QACvD,UAAU,CAAC,yBAAyB,CAAC,GAAG;YACtC,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AACD,sEAAsE","sourcesContent":["/**\n * Feature Builder Utilities\n *\n * DX-oriented builder functions for defining features.\n * These handle boilerplate: scope normalization, default values, counting config generation.\n * Custom app developers should use these instead of raw FeatureDefinition objects.\n */\n\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { FEATURES_UNLIMITED } from './scope-features.shared.schemas';\nimport {\n FeatureValueType,\n FeatureLimitSemantic,\n type FeatureDefinition,\n type FeatureUnavailabilityOverride,\n type LimitCountingConfig,\n} from './feature-definition.shared.schemas';\n\n// =====================================================\n// Internal: Auto-register marker\n// =====================================================\n\n/**\n * Internal marker symbol for limit features that should auto-register\n * a limitCheck on the counted resource's CREATE operation.\n * Used by FeatureDefinitionRegistryBackendService at startup.\n */\nexport const AUTO_REGISTER_LIMIT_CHECK = Symbol.for('AUTO_REGISTER_LIMIT_CHECK');\n\n/**\n * Extended FeatureDefinition with auto-register metadata.\n * This is the internal type returned by defineLimitFeature when countResource is provided.\n */\nexport type FeatureDefinitionWithAutoRegister = FeatureDefinition & {\n [AUTO_REGISTER_LIMIT_CHECK]?: {\n /** Resource type whose CREATE operation should get a limitCheck for this feature */\n countResource: string;\n };\n};\n\n// =====================================================\n// Scope Normalization\n// =====================================================\n\nfunction normalizeScopes(scope: ResourcePrimaryScope | ResourcePrimaryScope[]): ResourcePrimaryScope[] {\n return Array.isArray(scope) ? scope : [scope];\n}\n\n// =====================================================\n// defineFeature() — Boolean Feature Builder\n// =====================================================\n\n/**\n * @wildo_source:part:start saas.models.features.definition-builders facet:layer:shared facet:audience:app-developer\n *\n * Declaring what an application can SELL or gate on. Two builders, from `@wildo-ai/saas-models`:\n * `defineFeature` for a boolean capability, `defineLimitFeature` for a numeric allowance.\n *\n * A product in the billing catalogue then grants them through `grantedFeatures` / `grantedLimits`,\n * and any surface gates on the identifier with `requiredFeatures` — a resource operation, a view, a\n * chart, a navigation item, a settings section.\n *\n * ## Two things that decide whether the gate actually fires\n *\n * (`limitSemantic` is the third and is covered by the product-definitions skill's own guidance —\n * the default `FLOOR` is an entitlement the tenant is ALLOWED, and a consumption CAP needs `CEILING`.)\n *\n * - **`countResource` is the one-call form.** It registers a limit check on that resource's CREATE\n * automatically, so \"at most ten projects per organisation\" is one declaration rather than a\n * definition plus a hand-written gate. A limit declared WITHOUT counting cannot be checked\n * automatically: `checkLimit` REFUSES rather than guessing at a remaining quota, and the caller\n * must pass a counting override or measure consumption itself. That is the right answer for a\n * quantity that is not a row count — a sum of tokens, for instance.\n * - **`rateLimit` on a definition is RESERVED and ignored by the gate.** A time-windowed allowance\n * like \"one hundred calls an hour\" is not expressible here at all; abuse throttling is a separate\n * mechanism with its own declaration.\n *\n * ## Granting a capability does not configure it\n *\n * An entitlement says the tenant MAY have the thing. Single sign-on entitles an organisation to\n * register an identity provider; somebody still has to register one. The same holds for provisioning\n * tokens, export destinations and webhook endpoints — so a plan that grants one of these still needs\n * an onboarding step behind it.\n *\n * Simple boolean feature builder.\n *\n * @example\n * defineFeature('AI_ASSISTANT', { scope: ResourcePrimaryScope.ORGANIZATIONS })\n *\n * @example\n * defineFeature('PREMIUM_THEMES', {\n * scope: ResourcePrimaryScope.USER_SELF,\n * unavailability: {\n * behavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n * },\n * })\n */\nexport function defineFeature(\n identifier: string,\n options: {\n scope: ResourcePrimaryScope | ResourcePrimaryScope[];\n defaultEnabled?: boolean;\n dependencies?: string[];\n unavailability?: FeatureUnavailabilityOverride;\n }\n): FeatureDefinition {\n return {\n identifier,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: normalizeScopes(options.scope),\n defaultValue: options.defaultEnabled ?? false,\n dependencies: options.dependencies ?? [],\n unavailability: options.unavailability,\n };\n}\n\n// =====================================================\n// defineLimitFeature() — Limit Feature Builder\n// =====================================================\n\n/**\n * Limit feature builder with auto-wiring support.\n *\n * Key DX improvement: when `countResource` is provided, the engine\n * auto-registers a `limitChecks` entry on the CREATE operation of the\n * referenced resource at startup (via FeatureDefinitionRegistryBackendService).\n *\n * This means: to add \"max 10 projects per org\", write ONE call and the\n * gate is automatically enforced. No need to manually add limitChecks on\n * the resource's operation variant.\n *\n * @example\n * defineLimitFeature('MAX_PROJECTS', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: 5,\n * countResource: CustomShared_ResourceType.PROJECTS,\n * })\n * // Equivalent to manually defining:\n * // { identifier: 'MAX_PROJECTS', valueType: LIMIT, applicableScopes: [ORGANIZATIONS],\n * // defaultValue: 5, counting: { resourceType: 'PROJECTS' } }\n * // + adding limitChecks: [{ featureId: 'MAX_PROJECTS' }] on PROJECTS.CREATE variant\n *\n * @example\n * defineLimitFeature('MAX_STORAGE_GB', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: 10,\n * counting: {\n * resourceType: 'FILES',\n * aggregate: { field: 'sizeBytes', operation: AggregationOperation.SUM },\n * },\n * })\n */\nexport function defineLimitFeature(\n identifier: string,\n options: {\n scope: ResourcePrimaryScope | ResourcePrimaryScope[];\n default: number;\n /**\n * How this limit COMPOSES when several sources supply a value (see {@link FeatureLimitSemantic}).\n * Omit for the default `FLOOR` — an entitlement the tenant is ALLOWED, where most-permissive\n * wins and add-ons stack upward (`MAX_MEMBERS`, `MAX_API_KEYS`).\n *\n * Pass `CEILING` for a consumption CAP the tenant may not exceed: most-RESTRICTIVE wins, and\n * `FEATURES_UNLIMITED` means \"no ceiling\" so it yields to any finite grant. Without it a cap is\n * inexpressible — under FLOOR an unlimited default absorbs every finite plan grant, so the cap\n * silently never engages.\n */\n limitSemantic?: FeatureLimitSemantic;\n /** Resource to count. Auto-registers a limitCheck on CREATE for this resource. */\n countResource?: string;\n /** Advanced: filter + aggregation for counting (overrides simple resource count) */\n counting?: LimitCountingConfig;\n /** If true, skip auto-registration of limitChecks on the resource's CREATE operation */\n skipAutoRegister?: boolean;\n dependencies?: string[];\n unavailability?: FeatureUnavailabilityOverride;\n }\n): FeatureDefinitionWithAutoRegister {\n // Build counting config: explicit counting takes precedence, then countResource, then nothing\n const counting: LimitCountingConfig | undefined =\n options.counting ??\n (options.countResource ? { resourceType: options.countResource } : undefined);\n\n const definition: FeatureDefinitionWithAutoRegister = {\n identifier,\n valueType: FeatureValueType.LIMIT,\n applicableScopes: normalizeScopes(options.scope),\n defaultValue: options.default,\n dependencies: options.dependencies ?? [],\n // Omitted ⇒ absent on the definition ⇒ read as FLOOR, so every existing caller is unchanged.\n ...(options.limitSemantic ? { limitSemantic: options.limitSemantic } : {}),\n counting,\n unavailability: options.unavailability,\n };\n\n // Add auto-register marker for limit features with countResource (unless skipped)\n if (options.countResource && !options.skipAutoRegister) {\n definition[AUTO_REGISTER_LIMIT_CHECK] = {\n countResource: options.countResource,\n };\n }\n\n return definition;\n}\n/** @wildo_source:part:end saas.models.features.definition-builders */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-definition.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"feature-definition.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/feature-definition.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAO7E,oBAAY,gBAAgB;IAC1B,uDAAuD;IACvD,OAAO,YAAY;IACnB,6DAA6D;IAC7D,KAAK,UAAU;CAChB;AAMD;;;;GAIG;AACH,oBAAY,6BAA6B;IACvC,sCAAsC;IACtC,IAAI,SAAS;IACb,sCAAsC;IACtC,OAAO,YAAY;IACnB,8CAA8C;IAC9C,cAAc,mBAAmB;IACjC,iDAAiD;IACjD,YAAY,iBAAiB;IAC7B,wDAAwD;IACxD,aAAa,kBAAkB;IAC/B,gEAAgE;IAChE,oBAAoB,yBAAyB;IAC7C,wHAAwH;IACxH,MAAM,WAAW;CAClB;AAMD;;;GAGG;AACH,oBAAY,2BAA2B;IACrC,oDAAoD;IACpD,mBAAmB,wBAAwB;IAC3C,mDAAmD;IACnD,cAAc,mBAAmB;IACjC,qDAAqD;IACrD,cAAc,mBAAmB;CAClC;AAMD;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAMD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;iBAgBpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM5E;;;;;;;;;;;;;GAaG;AACH,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;kBASrB,CAAC;AACd,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE;;;;GAIG;AACH,eAAO,MAAM,mCAAmC;;;;;iBAS9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAMhG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,oBAAoB;IAC9B;;;;;OAKG;IACH,KAAK,UAAU;IACf;;;;;;;;;OASG;IACH,OAAO,YAAY;CACpB;AACD,gEAAgE;AAMhE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4ElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;mBAWvC,CAAC;AAMH;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0DrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-definition.shared.schemas.js","sourceRoot":"","sources":["../../../src/features/feature-definition.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,wDAAwD;AACxD,qB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F,CAAC;KACH,CAAC,CAAC,OAAO,CAAC;QACT,eAAe,EAAE,6BAA6B,CAAC,cAAc;QAC7D,mBAAmB,EAAE,6BAA6B,CAAC,IAAI;QACvD,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE;YACd,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,EAAE,6BAA6B,CAAC,cAAc;YAC/F,CAAC,2BAA2B,CAAC,cAAc,CAAC,EAAE,6BAA6B,CAAC,oBAAoB;YAChG,CAAC,2BAA2B,CAAC,cAAc,CAAC,EAAE,6BAA6B,CAAC,IAAI;SACjF;KACF,CAAC;IACF,qFAAqF;IACrF,gFAAgF;IAChF,+EAA+E;CAChF,CAAC,CAAC","sourcesContent":["/**\n * Feature Definition Schemas\n *\n * Core schemas for the feature system. These define the structure of:\n * - Feature definitions (what a feature is, how it's gated)\n * - Feature configuration (all definitions + profiles + unavailability policy)\n * - Supporting types (counting config, unavailability behavior, etc.)\n *\n * This is the DEFINITION layer — not the storage layer (that's ScopeFeaturesSchema in T1.3).\n */\n\nimport { z } from 'zod';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { ScopeFeaturesSchema } from './scope-features.shared.schemas';\n\n// =====================================================\n// Feature Value Type\n// =====================================================\n\nexport enum FeatureValueType {\n /** On/off toggle: checked via features.includes(id) */\n BOOLEAN = 'boolean',\n /** Numeric limit: checked via limits[id] vs current count */\n LIMIT = 'limit',\n}\n\n// =====================================================\n// Frontend Unavailability Behavior\n// =====================================================\n\n/**\n * What happens in the frontend when a feature is unavailable.\n * Used in FeatureDefinition.unavailability (per-feature) and FeatureConfiguration.unavailabilityPolicy (global).\n * Defined here in shared models so both backend (for API contracts) and frontend (for UI) share it.\n */\nexport enum FeatureUnavailabilityBehavior {\n /** Don't render the element at all */\n HIDE = 'hide',\n /** Render disabled, no explanation */\n DISABLE = 'disable',\n /** Render disabled with \"Upgrade plan\" CTA */\n UPGRADE_PROMPT = 'upgrade_prompt',\n /** Render disabled with \"Purchase add-on\" CTA */\n ADDON_PROMPT = 'addon_prompt',\n /** Render disabled with \"Contact your admin\" message */\n CONTACT_ADMIN = 'contact_admin',\n /** Show remaining quota with \"Upgrade for more\" (for limits) */\n LIMIT_UPGRADE_PROMPT = 'limit_upgrade_prompt',\n /** Custom: render a registered custom component (requires customComponentRef on the feature's unavailability config) */\n CUSTOM = 'custom',\n}\n\n// =====================================================\n// Unavailability Reason\n// =====================================================\n\n/**\n * Reason WHY a feature is unavailable. Used in FeatureAvailability.reason and as keys\n * in FeatureConfiguration.unavailabilityPolicy.reasonDefaults.\n */\nexport enum FeatureUnavailabilityReason {\n /** Boolean feature is not enabled for this scope */\n FEATURE_NOT_ENABLED = 'feature_not_enabled',\n /** Limit-type feature has exceeded its capacity */\n LIMIT_EXCEEDED = 'limit_exceeded',\n /** Feature has no definition or is not configured */\n NOT_CONFIGURED = 'not_configured',\n}\n\n// =====================================================\n// Aggregation Operation\n// =====================================================\n\n/**\n * Aggregation operation for limit counting (when using field aggregation instead of document count).\n */\nexport enum AggregationOperation {\n SUM = 'SUM',\n AVG = 'AVG',\n MAX = 'MAX',\n}\n\n// =====================================================\n// Limit Counting Config\n// =====================================================\n\n/**\n * How to measure current usage for a LIMIT feature.\n * Defines the \"counting\" strategy: what to query, how to aggregate.\n * When present, the gate can auto-check this limit. When absent, custom code handles it.\n */\nexport const LimitCountingConfigSchema = z.object({\n /** Resource type to count/aggregate in the current scope entity */\n resourceType: z.string().min(1),\n\n /** Optional static filter on resource fields (e.g., { status: 'ACTIVE' }) */\n filter: z.record(z.string(), z.unknown()).optional(),\n\n /**\n * Field aggregation instead of document count.\n * When absent: plain COUNT of matching documents.\n * When present: aggregate the specified field.\n */\n aggregate: z.object({\n field: z.string().min(1),\n operation: z.enum(AggregationOperation),\n }).optional(),\n});\nexport type LimitCountingConfig = z.infer<typeof LimitCountingConfigSchema>;\n\n// =====================================================\n// Rate Limit Config (Reserved)\n// =====================================================\n\n/**\n * Rate limiting configuration for features (data model prepared, implementation deferred).\n *\n * FUTURE: For features that need time-windowed restrictions (e.g., \"100 API calls per hour\",\n * \"10 report generations per day\"). This is distinct from:\n * - LIMIT features (total capacity, checked by counting resources)\n * - Usage metering (billing-side consumption for invoicing)\n *\n * Rate-limited features are about: \"can they do this RIGHT NOW given recent activity?\"\n * Implementation will use a sliding-window counter in Redis.\n *\n * NOT IMPLEMENTED in Phase 1. The schema is reserved to ensure the FeatureDefinition\n * shape doesn't need a breaking change when rate limiting is added.\n */\nexport enum RateWindowUnit {\n MINUTE = 'minute',\n HOUR = 'hour',\n DAY = 'day',\n}\n\nexport const RateLimitConfigSchema = z.object({\n /** Maximum operations in the window */\n maxPerWindow: z.number().min(1),\n /** Window size */\n window: z.enum(RateWindowUnit),\n /** Window count (e.g., 2 + HOUR = per 2 hours) */\n windowCount: z.number().min(1).default(1),\n /** Scope of the rate limit (per-user, per-org, per-api-key) */\n scope: z.enum(['per_user', 'per_org', 'per_api_key', 'per_scope_entity']).default('per_user'),\n}).optional();\nexport type RateLimitConfig = z.infer<typeof RateLimitConfigSchema>;\n\n// =====================================================\n// Feature Unavailability Override\n// =====================================================\n\n/**\n * Per-feature unavailability behavior override.\n * When this feature is not available, this config determines the frontend behavior.\n * If not set, the global FeatureConfiguration.unavailabilityPolicy defaults are used.\n */\nexport const FeatureUnavailabilityOverrideSchema = z.object({\n /** Default behavior for this feature (overrides global default) */\n behavior: z.enum(FeatureUnavailabilityBehavior).optional(),\n /** Role-specific overrides for this feature */\n byRole: z.record(z.string(), z.enum(FeatureUnavailabilityBehavior)).optional(),\n /** Product to suggest when prompting upgrade/addon */\n suggestedProductRef: z.string().optional(),\n /** Component reference for CUSTOM behavior (must be registered in the component registry) */\n customComponentRef: z.string().optional(),\n});\nexport type FeatureUnavailabilityOverride = z.infer<typeof FeatureUnavailabilityOverrideSchema>;\n\n// =====================================================\n// Limit Semantics\n// =====================================================\n\n/**\n * @wildo_source:part:start saas.models.feature-limit-semantic facet:layer:shared facet:family:features\n *\n * How a LIMIT feature's value composes when several sources supply one (plan grants, add-ons,\n * profile defaults, the definition default, and the parent scopes in a resolution chain).\n *\n * The two are genuine opposites, and picking the wrong one silently inverts enforcement — hence an\n * explicit vocabulary rather than an implicit convention. Pass it via `defineLimitFeature`'s\n * `limitSemantic` option. Import path: `@wildo-ai/saas-models`.\n *\n * @example\n * // An entitlement the plan RAISES (default — omit the option entirely):\n * defineLimitFeature('MAX_PROJECTS', { scope: ResourcePrimaryScope.ORGANIZATIONS, default: 5 });\n *\n * // A consumption CAP the plan TIGHTENS — note the unlimited default:\n * defineLimitFeature('MONTHLY_TOKEN_CAP', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: FEATURES_UNLIMITED,\n * limitSemantic: FeatureLimitSemantic.CEILING,\n * });\n */\nexport enum FeatureLimitSemantic {\n /**\n * **Entitlement floor** (the default, and how every pre-existing LIMIT feature behaves): the\n * limit is something the tenant is ALLOWED, so more is better and the MOST-PERMISSIVE value wins\n * — `max(a, b)`, with `FEATURES_UNLIMITED` beating everything. Add-ons stack upward on top of a\n * plan. Example: `MAX_MEMBERS` — a plan grants 5, an add-on raises it to 20.\n */\n FLOOR = 'floor',\n /**\n * **Consumption ceiling**: the limit is a CAP the tenant may not exceed, so less is safer and the\n * MOST-RESTRICTIVE value wins — `min(a, b)`, and `FEATURES_UNLIMITED` means \"imposes no ceiling\"\n * so it LOSES to any finite value.\n *\n * That inversion is what makes a cap expressible at all. Under FLOOR semantics a definition\n * default of `FEATURES_UNLIMITED` would absorb every finite plan grant (`max(-1, 10_000) = -1`),\n * so the cap could never engage; under CEILING the same default correctly means \"no cap until a\n * plan sets one\", and the plan's finite grant wins. Example: the A2A LLM token budget.\n */\n CEILING = 'ceiling',\n}\n/** @wildo_source:part:end saas.models.feature-limit-semantic */\n\n// =====================================================\n// Feature Definition\n// =====================================================\n\nexport const FeatureDefinitionSchema = z.object({\n /** Unique identifier (e.g., 'ADVANCED_ANALYTICS', 'MAX_PROJECTS') */\n identifier: z.string().min(1),\n\n /** Value type - determines how the gate checks this feature */\n valueType: z.enum(FeatureValueType),\n\n /** Which scopes this feature can be applied to (uses existing ResourcePrimaryScope) */\n applicableScopes: z.array(z.enum(ResourcePrimaryScope)).min(1),\n\n /** Default value when not explicitly set (false for BOOLEAN, number for LIMIT) */\n defaultValue: z.union([z.boolean(), z.number()]),\n\n /** Feature dependencies: these feature identifiers must also be enabled for this feature to be active */\n dependencies: z.array(z.string()).default([]),\n\n /**\n * For LIMIT features: how this limit COMPOSES when several sources supply a value\n * (see {@link FeatureLimitSemantic}). ABSENT means `FLOOR` — an entitlement the tenant is\n * allowed, most-permissive wins — which is how every limit behaved before this field existed, so\n * omitting it preserves existing behaviour exactly. Set `CEILING` for a consumption cap, where\n * the most-RESTRICTIVE value wins and `FEATURES_UNLIMITED` means \"no ceiling\".\n * Ignored for BOOLEAN features.\n *\n * Declared `.optional()` rather than `.default(FLOOR)` deliberately: a Zod default is REQUIRED on\n * the inferred output type, which would force every existing definition literal (and every app's)\n * to spell out a field that is only meaningful for caps. Both consumers apply the `FLOOR`\n * fallback when reading, so absence and an explicit `FLOOR` behave identically.\n */\n limitSemantic: z.enum(FeatureLimitSemantic).optional(),\n\n /**\n * For LIMIT features: how to measure current usage (the \"counting\" strategy).\n * When present: the gate can auto-check limits using this config.\n * When absent: limit checking must be done in custom service code.\n * Ignored for BOOLEAN features.\n */\n counting: LimitCountingConfigSchema.optional(),\n\n /**\n * RESERVED: Rate limiting config (implementation deferred, field exists for schema stability).\n * When implemented: gate will check sliding-window counter in Redis before allowing operation.\n * Until then: ignored by the gate.\n */\n rateLimit: RateLimitConfigSchema,\n\n /**\n * Frontend behavior when this feature is unavailable.\n * Overrides the global policy from FeatureConfiguration.unavailabilityPolicy.\n * When absent: global defaults apply (role > reason > app default).\n */\n unavailability: FeatureUnavailabilityOverrideSchema.optional(),\n\n /**\n * If true, this feature does NOT participate in the cross-scope chain-union\n * performed by `FeatureResolutionBackendService.resolve()`.\n *\n * Default behavior (`scopeBoundary === false / undefined`): a feature\n * enabled at the APPLICATION layer cascades down to every org/user\n * request — the resolver merges features from every scope in the chain\n * (`mergeScopeFeatures`). This is appropriate for capability-style\n * gates (\"audit logs available app-wide\").\n *\n * `scopeBoundary === true`: the feature is only \"on\" when the EXACT\n * scope it is queried against has it enabled. Callers MUST use\n * `featureResolution.isFeatureEnabledAtScope(featureId, scopeType, entityId)`\n * — the unscoped `isFeatureEnabled(featureId, ec)` throws for these\n * features (developer guidance: chain-union semantics would silently\n * defeat per-scope opt-in, which is the whole point of marking a\n * feature scope-bound).\n *\n * Use this for opt-in policies that MUST stay per-org / per-app\n * even when a parent scope has the same flag enabled (e.g.\n * `M2M_WEBHOOK_DELIVERY` — admins decide per organization).\n */\n scopeBoundary: z.boolean().optional(),\n});\nexport type FeatureDefinition = z.infer<typeof FeatureDefinitionSchema>;\n\n// =====================================================\n// Required Features Config Schema (Zod validation)\n// =====================================================\n\n/**\n * Zod schema for RequiredFeaturesConfig — used in view definition schemas\n * and anywhere a Zod-validated `requiredFeatures` field is needed.\n *\n * Matches the TypeScript type `RequiredFeaturesConfig` from resources-config.shared.schemas.ts.\n * Supports both shorthand (`string[]`) and full config forms.\n */\nexport const RequiredFeaturesConfigSchema = z.union([\n z.array(z.string()),\n z.object({\n features: z.array(z.string()).optional(),\n mode: z.enum(['OR', 'AND'] as const).optional(),\n limitChecks: z.array(z.object({\n featureId: z.string(),\n increment: z.number().optional(),\n countingOverride: LimitCountingConfigSchema.optional(),\n })).optional(),\n }),\n]);\n\n// =====================================================\n// Feature Configuration\n// =====================================================\n\n/**\n * Central feature configuration — ONE object per app, shared between frontend and backend.\n * Defines ALL feature definitions + the global unavailability policy.\n *\n * Custom apps export this from their shared lib.\n * Framework provides CORE_FEATURE_CONFIGURATION with core features + sensible defaults.\n * At startup, custom config is merged with core config.\n */\nexport const FeatureConfigurationSchema = z.object({\n /** All feature definitions (core + custom merged at startup) */\n definitions: z.array(FeatureDefinitionSchema),\n\n /**\n * Feature profiles: preset configurations for different deployment modes.\n * Used by the resolution service as the \"config profile\" source (source #2 in resolution).\n *\n * When billing is DISABLED: the `defaultProfile` is applied to all scope entities.\n * When billing is ENABLED: profiles are NOT used (features come from subscription products instead).\n *\n * Defined in the custom app shared lib alongside feature definitions.\n * Keys are profile identifiers (e.g., 'enterprise', 'free', 'starter').\n */\n profiles: z.record(z.string(), ScopeFeaturesSchema).default({}),\n\n /**\n * Default profile key (references a key in `profiles` above).\n * If undefined: no profile applied (only feature definition defaults are used).\n * Typical values: 'enterprise' (all features enabled), 'free' (baseline).\n */\n defaultProfile: z.string().optional(),\n\n /** Global unavailability policy defaults (frontend behavior) */\n unavailabilityPolicy: z.object({\n /** Fallback behavior when nothing else matches */\n defaultBehavior: z.enum(FeatureUnavailabilityBehavior)\n .default(FeatureUnavailabilityBehavior.UPGRADE_PROMPT),\n\n /** When billing is NOT enabled (enterprise/internal deployment) */\n whenBillingDisabled: z.enum(FeatureUnavailabilityBehavior)\n .default(FeatureUnavailabilityBehavior.HIDE),\n\n /** Role-specific defaults (key = role identifier) */\n roleDefaults: z.record(z.string(), z.enum(FeatureUnavailabilityBehavior)).default({}),\n\n /** Reason-specific defaults (keyed by FeatureUnavailabilityReason values) */\n reasonDefaults: z.record(\n z.enum(FeatureUnavailabilityReason),\n z.enum(FeatureUnavailabilityBehavior)\n ).default({\n [FeatureUnavailabilityReason.FEATURE_NOT_ENABLED]: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.LIMIT_EXCEEDED]: FeatureUnavailabilityBehavior.LIMIT_UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.NOT_CONFIGURED]: FeatureUnavailabilityBehavior.HIDE,\n }),\n }).default({\n defaultBehavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n whenBillingDisabled: FeatureUnavailabilityBehavior.HIDE,\n roleDefaults: {},\n reasonDefaults: {\n [FeatureUnavailabilityReason.FEATURE_NOT_ENABLED]: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.LIMIT_EXCEEDED]: FeatureUnavailabilityBehavior.LIMIT_UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.NOT_CONFIGURED]: FeatureUnavailabilityBehavior.HIDE,\n },\n }),\n // NOTE: The outer .default() must provide the full object because Zod 4's .default()\n // requires a value that matches the schema's output type (all fields required).\n // The inner .default() on each field still applies when parsing partial input.\n});\nexport type FeatureConfiguration = z.infer<typeof FeatureConfigurationSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"feature-definition.shared.schemas.js","sourceRoot":"","sources":["../../../../src/features/feature-definition.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,wDAAwD;AACxD,qBAAqB;AACrB,wDAAwD;AAExD,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,uDAAuD;IACvD,uCAAmB,CAAA;IACnB,6DAA6D;IAC7D,mCAAe,CAAA;AACjB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAED,wDAAwD;AACxD,mCAAmC;AACnC,wDAAwD;AAExD;;;;GAIG;AACH,MAAM,CAAN,IAAY,6BAeX;AAfD,WAAY,6BAA6B;IACvC,sCAAsC;IACtC,8CAAa,CAAA;IACb,sCAAsC;IACtC,oDAAmB,CAAA;IACnB,8CAA8C;IAC9C,kEAAiC,CAAA;IACjC,iDAAiD;IACjD,8DAA6B,CAAA;IAC7B,wDAAwD;IACxD,gEAA+B,CAAA;IAC/B,gEAAgE;IAChE,8EAA6C,CAAA;IAC7C,wHAAwH;IACxH,kDAAiB,CAAA;AACnB,CAAC,EAfW,6BAA6B,KAA7B,6BAA6B,QAexC;AAED,wDAAwD;AACxD,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EAAE,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC;aACvD,OAAO,CAAC,6BAA6B,CAAC,IAAI,CAAC;QAE9C,qDAAqD;QACrD,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAErF,6EAA6E;QAC7E,cAAc,EAAE,CAAC,CAAC,MAAM,CACtB,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,EACnC,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CACtC,CAAC,OAAO,CAAC;YACR,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,EAAE,6BAA6B,CAAC,cAAc;YAC/F,CAAC,2BAA2B,CAAC,cAAc,CAAC,EAAE,6BAA6B,CAAC,oBAAoB;YAChG,CAAC,2BAA2B,CAAC,cAAc,CAAC,EAAE,6BAA6B,CAAC,IAAI;SACjF,CAAC;KACH,CAAC,CAAC,OAAO,CAAC;QACT,eAAe,EAAE,6BAA6B,CAAC,cAAc;QAC7D,mBAAmB,EAAE,6BAA6B,CAAC,IAAI;QACvD,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE;YACd,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,EAAE,6BAA6B,CAAC,cAAc;YAC/F,CAAC,2BAA2B,CAAC,cAAc,CAAC,EAAE,6BAA6B,CAAC,oBAAoB;YAChG,CAAC,2BAA2B,CAAC,cAAc,CAAC,EAAE,6BAA6B,CAAC,IAAI;SACjF;KACF,CAAC;IACF,qFAAqF;IACrF,gFAAgF;IAChF,+EAA+E;CAChF,CAAC,CAAC","sourcesContent":["/**\n * Feature Definition Schemas\n *\n * Core schemas for the feature system. These define the structure of:\n * - Feature definitions (what a feature is, how it's gated)\n * - Feature configuration (all definitions + profiles + unavailability policy)\n * - Supporting types (counting config, unavailability behavior, etc.)\n *\n * This is the DEFINITION layer — not the storage layer (that's ScopeFeaturesSchema in T1.3).\n */\n\nimport { z } from 'zod';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { ScopeFeaturesSchema } from './scope-features.shared.schemas';\n\n// =====================================================\n// Feature Value Type\n// =====================================================\n\nexport enum FeatureValueType {\n /** On/off toggle: checked via features.includes(id) */\n BOOLEAN = 'boolean',\n /** Numeric limit: checked via limits[id] vs current count */\n LIMIT = 'limit',\n}\n\n// =====================================================\n// Frontend Unavailability Behavior\n// =====================================================\n\n/**\n * What happens in the frontend when a feature is unavailable.\n * Used in FeatureDefinition.unavailability (per-feature) and FeatureConfiguration.unavailabilityPolicy (global).\n * Defined here in shared models so both backend (for API contracts) and frontend (for UI) share it.\n */\nexport enum FeatureUnavailabilityBehavior {\n /** Don't render the element at all */\n HIDE = 'hide',\n /** Render disabled, no explanation */\n DISABLE = 'disable',\n /** Render disabled with \"Upgrade plan\" CTA */\n UPGRADE_PROMPT = 'upgrade_prompt',\n /** Render disabled with \"Purchase add-on\" CTA */\n ADDON_PROMPT = 'addon_prompt',\n /** Render disabled with \"Contact your admin\" message */\n CONTACT_ADMIN = 'contact_admin',\n /** Show remaining quota with \"Upgrade for more\" (for limits) */\n LIMIT_UPGRADE_PROMPT = 'limit_upgrade_prompt',\n /** Custom: render a registered custom component (requires customComponentRef on the feature's unavailability config) */\n CUSTOM = 'custom',\n}\n\n// =====================================================\n// Unavailability Reason\n// =====================================================\n\n/**\n * Reason WHY a feature is unavailable. Used in FeatureAvailability.reason and as keys\n * in FeatureConfiguration.unavailabilityPolicy.reasonDefaults.\n */\nexport enum FeatureUnavailabilityReason {\n /** Boolean feature is not enabled for this scope */\n FEATURE_NOT_ENABLED = 'feature_not_enabled',\n /** Limit-type feature has exceeded its capacity */\n LIMIT_EXCEEDED = 'limit_exceeded',\n /** Feature has no definition or is not configured */\n NOT_CONFIGURED = 'not_configured',\n}\n\n// =====================================================\n// Aggregation Operation\n// =====================================================\n\n/**\n * Aggregation operation for limit counting (when using field aggregation instead of document count).\n */\nexport enum AggregationOperation {\n SUM = 'SUM',\n AVG = 'AVG',\n MAX = 'MAX',\n}\n\n// =====================================================\n// Limit Counting Config\n// =====================================================\n\n/**\n * How to measure current usage for a LIMIT feature.\n * Defines the \"counting\" strategy: what to query, how to aggregate.\n * When present, the gate can auto-check this limit. When absent, custom code handles it.\n */\nexport const LimitCountingConfigSchema = z.object({\n /** Resource type to count/aggregate in the current scope entity */\n resourceType: z.string().min(1),\n\n /** Optional static filter on resource fields (e.g., { status: 'ACTIVE' }) */\n filter: z.record(z.string(), z.unknown()).optional(),\n\n /**\n * Field aggregation instead of document count.\n * When absent: plain COUNT of matching documents.\n * When present: aggregate the specified field.\n */\n aggregate: z.object({\n field: z.string().min(1),\n operation: z.enum(AggregationOperation),\n }).optional(),\n});\nexport type LimitCountingConfig = z.infer<typeof LimitCountingConfigSchema>;\n\n// =====================================================\n// Rate Limit Config (Reserved)\n// =====================================================\n\n/**\n * Rate limiting configuration for features (data model prepared, implementation deferred).\n *\n * FUTURE: For features that need time-windowed restrictions (e.g., \"100 API calls per hour\",\n * \"10 report generations per day\"). This is distinct from:\n * - LIMIT features (total capacity, checked by counting resources)\n * - Usage metering (billing-side consumption for invoicing)\n *\n * Rate-limited features are about: \"can they do this RIGHT NOW given recent activity?\"\n * Implementation will use a sliding-window counter in Redis.\n *\n * NOT IMPLEMENTED in Phase 1. The schema is reserved to ensure the FeatureDefinition\n * shape doesn't need a breaking change when rate limiting is added.\n */\nexport enum RateWindowUnit {\n MINUTE = 'minute',\n HOUR = 'hour',\n DAY = 'day',\n}\n\nexport const RateLimitConfigSchema = z.object({\n /** Maximum operations in the window */\n maxPerWindow: z.number().min(1),\n /** Window size */\n window: z.enum(RateWindowUnit),\n /** Window count (e.g., 2 + HOUR = per 2 hours) */\n windowCount: z.number().min(1).default(1),\n /** Scope of the rate limit (per-user, per-org, per-api-key) */\n scope: z.enum(['per_user', 'per_org', 'per_api_key', 'per_scope_entity']).default('per_user'),\n}).optional();\nexport type RateLimitConfig = z.infer<typeof RateLimitConfigSchema>;\n\n// =====================================================\n// Feature Unavailability Override\n// =====================================================\n\n/**\n * Per-feature unavailability behavior override.\n * When this feature is not available, this config determines the frontend behavior.\n * If not set, the global FeatureConfiguration.unavailabilityPolicy defaults are used.\n */\nexport const FeatureUnavailabilityOverrideSchema = z.object({\n /** Default behavior for this feature (overrides global default) */\n behavior: z.enum(FeatureUnavailabilityBehavior).optional(),\n /** Role-specific overrides for this feature */\n byRole: z.record(z.string(), z.enum(FeatureUnavailabilityBehavior)).optional(),\n /** Product to suggest when prompting upgrade/addon */\n suggestedProductRef: z.string().optional(),\n /** Component reference for CUSTOM behavior (must be registered in the component registry) */\n customComponentRef: z.string().optional(),\n});\nexport type FeatureUnavailabilityOverride = z.infer<typeof FeatureUnavailabilityOverrideSchema>;\n\n// =====================================================\n// Limit Semantics\n// =====================================================\n\n/**\n * @wildo_source:part:start saas.models.feature-limit-semantic facet:layer:shared facet:family:features\n *\n * How a LIMIT feature's value composes when several sources supply one (plan grants, add-ons,\n * profile defaults, the definition default, and the parent scopes in a resolution chain).\n *\n * The two are genuine opposites, and picking the wrong one silently inverts enforcement — hence an\n * explicit vocabulary rather than an implicit convention. Pass it via `defineLimitFeature`'s\n * `limitSemantic` option. Import path: `@wildo-ai/saas-models`.\n *\n * @example\n * // An entitlement the plan RAISES (default — omit the option entirely):\n * defineLimitFeature('MAX_PROJECTS', { scope: ResourcePrimaryScope.ORGANIZATIONS, default: 5 });\n *\n * // A consumption CAP the plan TIGHTENS — note the unlimited default:\n * defineLimitFeature('MONTHLY_TOKEN_CAP', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: FEATURES_UNLIMITED,\n * limitSemantic: FeatureLimitSemantic.CEILING,\n * });\n */\nexport enum FeatureLimitSemantic {\n /**\n * **Entitlement floor** (the default, and how every pre-existing LIMIT feature behaves): the\n * limit is something the tenant is ALLOWED, so more is better and the MOST-PERMISSIVE value wins\n * — `max(a, b)`, with `FEATURES_UNLIMITED` beating everything. Add-ons stack upward on top of a\n * plan. Example: `MAX_MEMBERS` — a plan grants 5, an add-on raises it to 20.\n */\n FLOOR = 'floor',\n /**\n * **Consumption ceiling**: the limit is a CAP the tenant may not exceed, so less is safer and the\n * MOST-RESTRICTIVE value wins — `min(a, b)`, and `FEATURES_UNLIMITED` means \"imposes no ceiling\"\n * so it LOSES to any finite value.\n *\n * That inversion is what makes a cap expressible at all. Under FLOOR semantics a definition\n * default of `FEATURES_UNLIMITED` would absorb every finite plan grant (`max(-1, 10_000) = -1`),\n * so the cap could never engage; under CEILING the same default correctly means \"no cap until a\n * plan sets one\", and the plan's finite grant wins. Example: the A2A LLM token budget.\n */\n CEILING = 'ceiling',\n}\n/** @wildo_source:part:end saas.models.feature-limit-semantic */\n\n// =====================================================\n// Feature Definition\n// =====================================================\n\nexport const FeatureDefinitionSchema = z.object({\n /** Unique identifier (e.g., 'ADVANCED_ANALYTICS', 'MAX_PROJECTS') */\n identifier: z.string().min(1),\n\n /** Value type - determines how the gate checks this feature */\n valueType: z.enum(FeatureValueType),\n\n /** Which scopes this feature can be applied to (uses existing ResourcePrimaryScope) */\n applicableScopes: z.array(z.enum(ResourcePrimaryScope)).min(1),\n\n /** Default value when not explicitly set (false for BOOLEAN, number for LIMIT) */\n defaultValue: z.union([z.boolean(), z.number()]),\n\n /** Feature dependencies: these feature identifiers must also be enabled for this feature to be active */\n dependencies: z.array(z.string()).default([]),\n\n /**\n * For LIMIT features: how this limit COMPOSES when several sources supply a value\n * (see {@link FeatureLimitSemantic}). ABSENT means `FLOOR` — an entitlement the tenant is\n * allowed, most-permissive wins — which is how every limit behaved before this field existed, so\n * omitting it preserves existing behaviour exactly. Set `CEILING` for a consumption cap, where\n * the most-RESTRICTIVE value wins and `FEATURES_UNLIMITED` means \"no ceiling\".\n * Ignored for BOOLEAN features.\n *\n * Declared `.optional()` rather than `.default(FLOOR)` deliberately: a Zod default is REQUIRED on\n * the inferred output type, which would force every existing definition literal (and every app's)\n * to spell out a field that is only meaningful for caps. Both consumers apply the `FLOOR`\n * fallback when reading, so absence and an explicit `FLOOR` behave identically.\n */\n limitSemantic: z.enum(FeatureLimitSemantic).optional(),\n\n /**\n * For LIMIT features: how to measure current usage (the \"counting\" strategy).\n * When present: the gate can auto-check limits using this config.\n * When absent: limit checking must be done in custom service code.\n * Ignored for BOOLEAN features.\n */\n counting: LimitCountingConfigSchema.optional(),\n\n /**\n * RESERVED: Rate limiting config (implementation deferred, field exists for schema stability).\n * When implemented: gate will check sliding-window counter in Redis before allowing operation.\n * Until then: ignored by the gate.\n */\n rateLimit: RateLimitConfigSchema,\n\n /**\n * Frontend behavior when this feature is unavailable.\n * Overrides the global policy from FeatureConfiguration.unavailabilityPolicy.\n * When absent: global defaults apply (role > reason > app default).\n */\n unavailability: FeatureUnavailabilityOverrideSchema.optional(),\n\n /**\n * If true, this feature does NOT participate in the cross-scope chain-union\n * performed by `FeatureResolutionBackendService.resolve()`.\n *\n * Default behavior (`scopeBoundary === false / undefined`): a feature\n * enabled at the APPLICATION layer cascades down to every org/user\n * request — the resolver merges features from every scope in the chain\n * (`mergeScopeFeatures`). This is appropriate for capability-style\n * gates (\"audit logs available app-wide\").\n *\n * `scopeBoundary === true`: the feature is only \"on\" when the EXACT\n * scope it is queried against has it enabled. Callers MUST use\n * `featureResolution.isFeatureEnabledAtScope(featureId, scopeType, entityId)`\n * — the unscoped `isFeatureEnabled(featureId, ec)` throws for these\n * features (developer guidance: chain-union semantics would silently\n * defeat per-scope opt-in, which is the whole point of marking a\n * feature scope-bound).\n *\n * Use this for opt-in policies that MUST stay per-org / per-app\n * even when a parent scope has the same flag enabled (e.g.\n * `M2M_WEBHOOK_DELIVERY` — admins decide per organization).\n */\n scopeBoundary: z.boolean().optional(),\n});\nexport type FeatureDefinition = z.infer<typeof FeatureDefinitionSchema>;\n\n// =====================================================\n// Required Features Config Schema (Zod validation)\n// =====================================================\n\n/**\n * Zod schema for RequiredFeaturesConfig — used in view definition schemas\n * and anywhere a Zod-validated `requiredFeatures` field is needed.\n *\n * Matches the TypeScript type `RequiredFeaturesConfig` from resources-config.shared.schemas.ts.\n * Supports both shorthand (`string[]`) and full config forms.\n */\nexport const RequiredFeaturesConfigSchema = z.union([\n z.array(z.string()),\n z.object({\n features: z.array(z.string()).optional(),\n mode: z.enum(['OR', 'AND'] as const).optional(),\n limitChecks: z.array(z.object({\n featureId: z.string(),\n increment: z.number().optional(),\n countingOverride: LimitCountingConfigSchema.optional(),\n })).optional(),\n }),\n]);\n\n// =====================================================\n// Feature Configuration\n// =====================================================\n\n/**\n * Central feature configuration — ONE object per app, shared between frontend and backend.\n * Defines ALL feature definitions + the global unavailability policy.\n *\n * Custom apps export this from their shared lib.\n * Framework provides CORE_FEATURE_CONFIGURATION with core features + sensible defaults.\n * At startup, custom config is merged with core config.\n */\nexport const FeatureConfigurationSchema = z.object({\n /** All feature definitions (core + custom merged at startup) */\n definitions: z.array(FeatureDefinitionSchema),\n\n /**\n * Feature profiles: preset configurations for different deployment modes.\n * Used by the resolution service as the \"config profile\" source (source #2 in resolution).\n *\n * When billing is DISABLED: the `defaultProfile` is applied to all scope entities.\n * When billing is ENABLED: profiles are NOT used (features come from subscription products instead).\n *\n * Defined in the custom app shared lib alongside feature definitions.\n * Keys are profile identifiers (e.g., 'enterprise', 'free', 'starter').\n */\n profiles: z.record(z.string(), ScopeFeaturesSchema).default({}),\n\n /**\n * Default profile key (references a key in `profiles` above).\n * If undefined: no profile applied (only feature definition defaults are used).\n * Typical values: 'enterprise' (all features enabled), 'free' (baseline).\n */\n defaultProfile: z.string().optional(),\n\n /** Global unavailability policy defaults (frontend behavior) */\n unavailabilityPolicy: z.object({\n /** Fallback behavior when nothing else matches */\n defaultBehavior: z.enum(FeatureUnavailabilityBehavior)\n .default(FeatureUnavailabilityBehavior.UPGRADE_PROMPT),\n\n /** When billing is NOT enabled (enterprise/internal deployment) */\n whenBillingDisabled: z.enum(FeatureUnavailabilityBehavior)\n .default(FeatureUnavailabilityBehavior.HIDE),\n\n /** Role-specific defaults (key = role identifier) */\n roleDefaults: z.record(z.string(), z.enum(FeatureUnavailabilityBehavior)).default({}),\n\n /** Reason-specific defaults (keyed by FeatureUnavailabilityReason values) */\n reasonDefaults: z.record(\n z.enum(FeatureUnavailabilityReason),\n z.enum(FeatureUnavailabilityBehavior)\n ).default({\n [FeatureUnavailabilityReason.FEATURE_NOT_ENABLED]: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.LIMIT_EXCEEDED]: FeatureUnavailabilityBehavior.LIMIT_UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.NOT_CONFIGURED]: FeatureUnavailabilityBehavior.HIDE,\n }),\n }).default({\n defaultBehavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n whenBillingDisabled: FeatureUnavailabilityBehavior.HIDE,\n roleDefaults: {},\n reasonDefaults: {\n [FeatureUnavailabilityReason.FEATURE_NOT_ENABLED]: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.LIMIT_EXCEEDED]: FeatureUnavailabilityBehavior.LIMIT_UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.NOT_CONFIGURED]: FeatureUnavailabilityBehavior.HIDE,\n },\n }),\n // NOTE: The outer .default() must provide the full object because Zod 4's .default()\n // requires a value that matches the schema's output type (all fields required).\n // The inner .default() on each field still applies when parsing partial input.\n});\nexport type FeatureConfiguration = z.infer<typeof FeatureConfigurationSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-registry.shared.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"feature-registry.shared.d.ts","sourceRoot":"","sources":["../../../../src/features/feature-registry.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACnG,OAAO,KAAK,EAAE,a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D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACnD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,qBAAqB,EAAE,CAa1B;AAED;;;;;;GAMG;AACH,wBAAgB,4CAA4C,CAC1D,gBAAgB,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,EAC3D,UAAU,GAAE;IACV,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,qBAAqB,EAAE,CAmBzB;AAED;;;;GAIG;AACH,wBAAgB,yCAAyC,CACvD,aAAa,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EAC/C,UAAU,GAAE;IACV,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,GACL,qBAAqB,EAAE,CAWzB;AAED;;;GAGG;AACH,wBAAgB,uCAAuC,CAAC,MAAM,EAAE;IAC9D,WAAW,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACzC,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC,GAAG,gCAAgC,CA+CnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-registry.shared.js","sourceRoot":"","sources":["../../../src/features/feature-registry.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAqB7E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,0BAA0B,CACxC,eAAgD,EAAE;IAElD,8DAA8D;IAC9D,MAAM,cAAc,GAAG;QACrB,G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G,CAAC,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Feature Registration Utilities\n * \n * Merges core entitlement and custom feature definitions\n * into a unified FeatureConfiguration object.\n * \n * Used at startup by both backend (FeatureDefinitionRegistryBackendService)\n * and frontend (feature context initialization).\n */\n\nimport type { FeatureConfiguration, FeatureDefinition } from './feature-definition.shared.schemas';\nimport type { ScopeFeatures } from './scope-features.shared.schemas';\nimport type { RequiredFeaturesConfig } from '../resources/resources-config.shared.schemas';\nimport {\n FeatureUnavailabilityBehavior,\n FeatureUnavailabilityReason,\n FeatureValueType,\n} from './feature-definition.shared.schemas';\nimport { CORE_FEATURE_DEFINITIONS } from './core-feature-definitions.shared';\n\n// =====================================================\n// Merge Feature Configurations\n// =====================================================\n\n/**\n * Input for merging: the custom app's feature configuration.\n * Fields are optional — core + platform definitions are always included.\n */\nexport interface CustomFeatureConfigurationInput {\n /** Custom feature definitions (in addition to core entitlement features) */\n definitions?: FeatureDefinition[];\n /** Feature profiles (preset configurations for deployment modes) */\n profiles?: Record<string, ScopeFeatures>;\n /** Default profile key (references a key in profiles) */\n defaultProfile?: string;\n /** Override unavailability policy */\n unavailabilityPolicy?: FeatureConfiguration['unavailabilityPolicy'];\n}\n\n/**\n * Merges core entitlement + custom feature definitions into a single FeatureConfiguration.\n * \n * Merge order (later definitions with same identifier take precedence):\n * 1. CORE_FEATURE_DEFINITIONS (engine business features)\n * 2. Custom definitions (app-specific features)\n * \n * Duplicate identifiers: the LAST definition wins. This allows custom apps to\n * override core feature defaults (e.g., change defaultValue, add unavailability config).\n * \n * @param customConfig - Custom app's feature configuration input\n * @returns Merged FeatureConfiguration ready for use by the registry\n */\nexport function mergeFeatureConfigurations(\n customConfig: CustomFeatureConfigurationInput = {}\n): FeatureConfiguration {\n // Merge definitions: core → custom (last wins for duplicates)\n const allDefinitions = [\n ...CORE_FEATURE_DEFINITIONS,\n ...(customConfig.definitions ?? []),\n ];\n\n // Deduplicate by identifier (last one wins)\n const definitionMap = new Map<string, FeatureDefinition>();\n for (const def of allDefinitions) {\n definitionMap.set(def.identifier, def);\n }\n const definitions = Array.from(definitionMap.values());\n\n // Build the merged configuration\n return {\n definitions,\n profiles: customConfig.profiles ?? {},\n defaultProfile: customConfig.defaultProfile,\n unavailabilityPolicy: customConfig.unavailabilityPolicy ?? {\n defaultBehavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n whenBillingDisabled: FeatureUnavailabilityBehavior.HIDE,\n roleDefaults: {},\n reasonDefaults: {\n [FeatureUnavailabilityReason.FEATURE_NOT_ENABLED]: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.LIMIT_EXCEEDED]: FeatureUnavailabilityBehavior.LIMIT_UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.NOT_CONFIGURED]: FeatureUnavailabilityBehavior.HIDE,\n },\n },\n };\n}\n\n// =====================================================\n// Feature Reference Validation Utilities\n// =====================================================\n\n/**\n * Normalized feature-reference usage coming from any authored surface.\n *\n * `surface` should be human-readable and precise enough to point developers\n * straight to the misconfigured authoring location in startup diagnostics.\n */\nexport interface FeatureReferenceUsage {\n surface: string;\n references: FeatureReferenceEntry[];\n}\n\n/**\n * One authored feature reference together with the slot semantics that explain\n * how runtime interprets it.\n */\nexport interface FeatureReferenceEntry {\n featureId: string;\n slotLabel: string;\n expectedValueType?: FeatureValueType;\n}\n\n/** Unknown feature references grouped by the surface that authored them. */\nexport interface UnknownFeatureReferenceIssue {\n surface: string;\n references: FeatureReferenceEntry[];\n}\n\n/** Known feature ids used in a slot whose semantics do not match the feature type. */\nexport interface IncompatibleFeatureReferenceIssue {\n surface: string;\n references: Array<FeatureReferenceEntry & { actualValueType: FeatureValueType }>;\n}\n\n/** Combined validation result for authored feature-reference surfaces. */\nexport interface FeatureReferenceValidationIssues {\n unknownIssues: UnknownFeatureReferenceIssue[];\n incompatibleIssues: IncompatibleFeatureReferenceIssue[];\n}\n\n/**\n * Shared slot builder for surfaces that separate boolean-style features from\n * limit-style grants/checks.\n */\nexport function buildFeatureReferenceEntries(params: {\n featureIds?: string[];\n limitFeatureIds?: string[];\n featureSlotLabel: string;\n limitSlotLabel: string;\n}): FeatureReferenceEntry[] {\n return [\n ...(params.featureIds ?? []).map((featureId) => ({\n featureId,\n slotLabel: params.featureSlotLabel,\n expectedValueType: FeatureValueType.BOOLEAN,\n })),\n ...(params.limitFeatureIds ?? []).map((featureId) => ({\n featureId,\n slotLabel: params.limitSlotLabel,\n expectedValueType: FeatureValueType.LIMIT,\n })),\n ];\n}\n\n/**\n * Extracts every feature identifier referenced by a `requiredFeatures` block.\n *\n * This centralizes the shorthand-vs-full-config branching so backend startup\n * diagnostics, frontend tooling, and future build-time validators all interpret\n * authored feature refs consistently.\n */\nexport function extractFeatureReferencesFromRequiredFeatures(\n requiredFeatures: RequiredFeaturesConfig | null | undefined,\n slotLabels: {\n featureSlotLabel?: string;\n limitSlotLabel?: string;\n } = {},\n): FeatureReferenceEntry[] {\n if (!requiredFeatures) {\n return [];\n }\n\n if (Array.isArray(requiredFeatures)) {\n return buildFeatureReferenceEntries({\n featureIds: requiredFeatures,\n featureSlotLabel: slotLabels.featureSlotLabel ?? 'features[]',\n limitSlotLabel: slotLabels.limitSlotLabel ?? 'limitChecks[].featureId',\n });\n }\n\n return buildFeatureReferenceEntries({\n featureIds: requiredFeatures.features ?? [],\n limitFeatureIds: requiredFeatures.limitChecks?.map(limitCheck => limitCheck.featureId) ?? [],\n featureSlotLabel: slotLabels.featureSlotLabel ?? 'features[]',\n limitSlotLabel: slotLabels.limitSlotLabel ?? 'limitChecks[].featureId',\n });\n}\n\n/**\n * Extracts feature references from a scope-state config surface such as a\n * feature profile. Boolean entries live in `features[]`, while limit grants are\n * represented by the keys of `limits`.\n */\nexport function extractFeatureReferencesFromScopeFeatures(\n scopeFeatures: ScopeFeatures | null | undefined,\n slotLabels: {\n featureSlotLabel?: string;\n limitSlotLabel?: string;\n } = {},\n): FeatureReferenceEntry[] {\n if (!scopeFeatures) {\n return [];\n }\n\n return buildFeatureReferenceEntries({\n featureIds: scopeFeatures.features ?? [],\n limitFeatureIds: Object.keys(scopeFeatures.limits ?? {}),\n featureSlotLabel: slotLabels.featureSlotLabel ?? 'features[]',\n limitSlotLabel: slotLabels.limitSlotLabel ?? 'limits{}',\n });\n}\n\n/**\n * Compares normalized usages against the known registry ids and returns the\n * unknown references together with known-but-slot-incompatible usages.\n */\nexport function collectFeatureReferenceValidationIssues(params: {\n definitions: Iterable<FeatureDefinition>;\n usages: FeatureReferenceUsage[];\n}): FeatureReferenceValidationIssues {\n const definitionValueTypes = new Map(\n Array.from(params.definitions, (definition) => [definition.identifier, definition.valueType]),\n );\n\n const unknownIssues: UnknownFeatureReferenceIssue[] = [];\n const incompatibleIssues: IncompatibleFeatureReferenceIssue[] = [];\n\n for (const usage of params.usages) {\n const unknownReferences = dedupeFeatureReferenceEntries(\n usage.references.filter(reference => !definitionValueTypes.has(reference.featureId)),\n );\n\n if (unknownReferences.length > 0) {\n unknownIssues.push({\n surface: usage.surface,\n references: unknownReferences,\n });\n }\n\n const incompatibleReferences = dedupeIncompatibleFeatureReferenceEntries(\n usage.references.flatMap((reference) => {\n if (!reference.expectedValueType) {\n return [];\n }\n\n const actualValueType = definitionValueTypes.get(reference.featureId);\n if (!actualValueType || actualValueType === reference.expectedValueType) {\n return [];\n }\n\n return [{\n ...reference,\n actualValueType,\n }];\n }),\n );\n\n if (incompatibleReferences.length > 0) {\n incompatibleIssues.push({\n surface: usage.surface,\n references: incompatibleReferences,\n });\n }\n }\n\n return { unknownIssues, incompatibleIssues };\n}\n\nfunction dedupeFeatureReferenceEntries(\n references: FeatureReferenceEntry[],\n): FeatureReferenceEntry[] {\n const seen = new Set<string>();\n\n return references.filter((reference) => {\n const key = `${reference.featureId}::${reference.slotLabel}::${reference.expectedValueType ?? 'any'}`;\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n\nfunction dedupeIncompatibleFeatureReferenceEntries(\n references: Array<FeatureReferenceEntry & { actualValueType: FeatureValueType }>,\n): Array<FeatureReferenceEntry & { actualValueType: FeatureValueType }> {\n const seen = new Set<string>();\n\n return references.filter((reference) => {\n const key = `${reference.featureId}::${reference.slotLabel}::${reference.expectedValueType ?? 'any'}::${reference.actualValueType}`;\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"feature-registry.shared.js","sourceRoot":"","sources":["../../../../src/features/feature-registry.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAqB7E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,0BAA0B,CACxC,eAAgD,EAAE;IAElD,8DAA8D;IAC9D,MAAM,cAAc,GAAG;QACrB,GAAG,wBAAwB;QAC3B,GAAG,CAAC,YAAY,CAAC,WAAW,IAAI,EAAE,CAAC;KACpC,CAAC;IAEF,4CAA4C;IAC5C,MAAM,aAAa,GAAG,IAAI,GAAG,EAA6B,CAAC;IAC3D,KAAK,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QACjC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;IAEvD,iCAAiC;IACjC,OAAO;QACL,WAAW;QACX,QAAQ,EAAE,YAAY,CAAC,QAAQ,IAAI,EAAE;QACrC,cAAc,EAAE,YAAY,CAAC,cAAc;QAC3C,oBAAoB,EAAE,YAAY,CAAC,oBAAoB,IAAI;YACzD,eAAe,EAAE,6BAA6B,CAAC,cAAc;YAC7D,mBAAmB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AiB,IAAI,KAAK,EAAE,CAAC;QACtG,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,yCAAyC,CAChD,UAAgF;IAEhF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE;QACrC,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC,iBAAiB,IAAI,KAAK,KAAK,SAAS,CAAC,eAAe,EAAE,CAAC;QACpI,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Feature Registration Utilities\n * \n * Merges core entitlement and custom feature definitions\n * into a unified FeatureConfiguration object.\n * \n * Used at startup by both backend (FeatureDefinitionRegistryBackendService)\n * and frontend (feature context initialization).\n */\n\nimport type { FeatureConfiguration, FeatureDefinition } from './feature-definition.shared.schemas';\nimport type { ScopeFeatures } from './scope-features.shared.schemas';\nimport type { RequiredFeaturesConfig } from '../resources/resources-config.shared.schemas';\nimport {\n FeatureUnavailabilityBehavior,\n FeatureUnavailabilityReason,\n FeatureValueType,\n} from './feature-definition.shared.schemas';\nimport { CORE_FEATURE_DEFINITIONS } from './core-feature-definitions.shared';\n\n// =====================================================\n// Merge Feature Configurations\n// =====================================================\n\n/**\n * Input for merging: the custom app's feature configuration.\n * Fields are optional — core + platform definitions are always included.\n */\nexport interface CustomFeatureConfigurationInput {\n /** Custom feature definitions (in addition to core entitlement features) */\n definitions?: FeatureDefinition[];\n /** Feature profiles (preset configurations for deployment modes) */\n profiles?: Record<string, ScopeFeatures>;\n /** Default profile key (references a key in profiles) */\n defaultProfile?: string;\n /** Override unavailability policy */\n unavailabilityPolicy?: FeatureConfiguration['unavailabilityPolicy'];\n}\n\n/**\n * Merges core entitlement + custom feature definitions into a single FeatureConfiguration.\n * \n * Merge order (later definitions with same identifier take precedence):\n * 1. CORE_FEATURE_DEFINITIONS (engine business features)\n * 2. Custom definitions (app-specific features)\n * \n * Duplicate identifiers: the LAST definition wins. This allows custom apps to\n * override core feature defaults (e.g., change defaultValue, add unavailability config).\n * \n * @param customConfig - Custom app's feature configuration input\n * @returns Merged FeatureConfiguration ready for use by the registry\n */\nexport function mergeFeatureConfigurations(\n customConfig: CustomFeatureConfigurationInput = {}\n): FeatureConfiguration {\n // Merge definitions: core → custom (last wins for duplicates)\n const allDefinitions = [\n ...CORE_FEATURE_DEFINITIONS,\n ...(customConfig.definitions ?? []),\n ];\n\n // Deduplicate by identifier (last one wins)\n const definitionMap = new Map<string, FeatureDefinition>();\n for (const def of allDefinitions) {\n definitionMap.set(def.identifier, def);\n }\n const definitions = Array.from(definitionMap.values());\n\n // Build the merged configuration\n return {\n definitions,\n profiles: customConfig.profiles ?? {},\n defaultProfile: customConfig.defaultProfile,\n unavailabilityPolicy: customConfig.unavailabilityPolicy ?? {\n defaultBehavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n whenBillingDisabled: FeatureUnavailabilityBehavior.HIDE,\n roleDefaults: {},\n reasonDefaults: {\n [FeatureUnavailabilityReason.FEATURE_NOT_ENABLED]: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.LIMIT_EXCEEDED]: FeatureUnavailabilityBehavior.LIMIT_UPGRADE_PROMPT,\n [FeatureUnavailabilityReason.NOT_CONFIGURED]: FeatureUnavailabilityBehavior.HIDE,\n },\n },\n };\n}\n\n// =====================================================\n// Feature Reference Validation Utilities\n// =====================================================\n\n/**\n * Normalized feature-reference usage coming from any authored surface.\n *\n * `surface` should be human-readable and precise enough to point developers\n * straight to the misconfigured authoring location in startup diagnostics.\n */\nexport interface FeatureReferenceUsage {\n surface: string;\n references: FeatureReferenceEntry[];\n}\n\n/**\n * One authored feature reference together with the slot semantics that explain\n * how runtime interprets it.\n */\nexport interface FeatureReferenceEntry {\n featureId: string;\n slotLabel: string;\n expectedValueType?: FeatureValueType;\n}\n\n/** Unknown feature references grouped by the surface that authored them. */\nexport interface UnknownFeatureReferenceIssue {\n surface: string;\n references: FeatureReferenceEntry[];\n}\n\n/** Known feature ids used in a slot whose semantics do not match the feature type. */\nexport interface IncompatibleFeatureReferenceIssue {\n surface: string;\n references: Array<FeatureReferenceEntry & { actualValueType: FeatureValueType }>;\n}\n\n/** Combined validation result for authored feature-reference surfaces. */\nexport interface FeatureReferenceValidationIssues {\n unknownIssues: UnknownFeatureReferenceIssue[];\n incompatibleIssues: IncompatibleFeatureReferenceIssue[];\n}\n\n/**\n * Shared slot builder for surfaces that separate boolean-style features from\n * limit-style grants/checks.\n */\nexport function buildFeatureReferenceEntries(params: {\n featureIds?: string[];\n limitFeatureIds?: string[];\n featureSlotLabel: string;\n limitSlotLabel: string;\n}): FeatureReferenceEntry[] {\n return [\n ...(params.featureIds ?? []).map((featureId) => ({\n featureId,\n slotLabel: params.featureSlotLabel,\n expectedValueType: FeatureValueType.BOOLEAN,\n })),\n ...(params.limitFeatureIds ?? []).map((featureId) => ({\n featureId,\n slotLabel: params.limitSlotLabel,\n expectedValueType: FeatureValueType.LIMIT,\n })),\n ];\n}\n\n/**\n * Extracts every feature identifier referenced by a `requiredFeatures` block.\n *\n * This centralizes the shorthand-vs-full-config branching so backend startup\n * diagnostics, frontend tooling, and future build-time validators all interpret\n * authored feature refs consistently.\n */\nexport function extractFeatureReferencesFromRequiredFeatures(\n requiredFeatures: RequiredFeaturesConfig | null | undefined,\n slotLabels: {\n featureSlotLabel?: string;\n limitSlotLabel?: string;\n } = {},\n): FeatureReferenceEntry[] {\n if (!requiredFeatures) {\n return [];\n }\n\n if (Array.isArray(requiredFeatures)) {\n return buildFeatureReferenceEntries({\n featureIds: requiredFeatures,\n featureSlotLabel: slotLabels.featureSlotLabel ?? 'features[]',\n limitSlotLabel: slotLabels.limitSlotLabel ?? 'limitChecks[].featureId',\n });\n }\n\n return buildFeatureReferenceEntries({\n featureIds: requiredFeatures.features ?? [],\n limitFeatureIds: requiredFeatures.limitChecks?.map(limitCheck => limitCheck.featureId) ?? [],\n featureSlotLabel: slotLabels.featureSlotLabel ?? 'features[]',\n limitSlotLabel: slotLabels.limitSlotLabel ?? 'limitChecks[].featureId',\n });\n}\n\n/**\n * Extracts feature references from a scope-state config surface such as a\n * feature profile. Boolean entries live in `features[]`, while limit grants are\n * represented by the keys of `limits`.\n */\nexport function extractFeatureReferencesFromScopeFeatures(\n scopeFeatures: ScopeFeatures | null | undefined,\n slotLabels: {\n featureSlotLabel?: string;\n limitSlotLabel?: string;\n } = {},\n): FeatureReferenceEntry[] {\n if (!scopeFeatures) {\n return [];\n }\n\n return buildFeatureReferenceEntries({\n featureIds: scopeFeatures.features ?? [],\n limitFeatureIds: Object.keys(scopeFeatures.limits ?? {}),\n featureSlotLabel: slotLabels.featureSlotLabel ?? 'features[]',\n limitSlotLabel: slotLabels.limitSlotLabel ?? 'limits{}',\n });\n}\n\n/**\n * Compares normalized usages against the known registry ids and returns the\n * unknown references together with known-but-slot-incompatible usages.\n */\nexport function collectFeatureReferenceValidationIssues(params: {\n definitions: Iterable<FeatureDefinition>;\n usages: FeatureReferenceUsage[];\n}): FeatureReferenceValidationIssues {\n const definitionValueTypes = new Map(\n Array.from(params.definitions, (definition) => [definition.identifier, definition.valueType]),\n );\n\n const unknownIssues: UnknownFeatureReferenceIssue[] = [];\n const incompatibleIssues: IncompatibleFeatureReferenceIssue[] = [];\n\n for (const usage of params.usages) {\n const unknownReferences = dedupeFeatureReferenceEntries(\n usage.references.filter(reference => !definitionValueTypes.has(reference.featureId)),\n );\n\n if (unknownReferences.length > 0) {\n unknownIssues.push({\n surface: usage.surface,\n references: unknownReferences,\n });\n }\n\n const incompatibleReferences = dedupeIncompatibleFeatureReferenceEntries(\n usage.references.flatMap((reference) => {\n if (!reference.expectedValueType) {\n return [];\n }\n\n const actualValueType = definitionValueTypes.get(reference.featureId);\n if (!actualValueType || actualValueType === reference.expectedValueType) {\n return [];\n }\n\n return [{\n ...reference,\n actualValueType,\n }];\n }),\n );\n\n if (incompatibleReferences.length > 0) {\n incompatibleIssues.push({\n surface: usage.surface,\n references: incompatibleReferences,\n });\n }\n }\n\n return { unknownIssues, incompatibleIssues };\n}\n\nfunction dedupeFeatureReferenceEntries(\n references: FeatureReferenceEntry[],\n): FeatureReferenceEntry[] {\n const seen = new Set<string>();\n\n return references.filter((reference) => {\n const key = `${reference.featureId}::${reference.slotLabel}::${reference.expectedValueType ?? 'any'}`;\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n\nfunction dedupeIncompatibleFeatureReferenceEntries(\n references: Array<FeatureReferenceEntry & { actualValueType: FeatureValueType }>,\n): Array<FeatureReferenceEntry & { actualValueType: FeatureValueType }> {\n const seen = new Set<string>();\n\n return references.filter((reference) => {\n const key = `${reference.featureId}::${reference.slotLabel}::${reference.expectedValueType ?? 'any'}::${reference.actualValueType}`;\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-resolution.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"feature-resolution.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/feature-resolution.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAMrE;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAM7C;;;;;;GAMG;AACH,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,+GAA+G;IAC/G,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAMD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,oBAAoB,EAAE,CAAA;KAAE,CAAC,CAAC;CAC1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-resolution.shared.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"feature-resolution.shared.schemas.js","sourceRoot":"","sources":["../../../../src/features/feature-resolution.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Feature Resolution Shared Types\n * \n * Output types from the feature resolution service.\n * Used by both backend (resolution service, gate service) and frontend (features API).\n */\n\nimport type { ScopeFeatures } from './scope-features.shared.schemas';\n\n// =====================================================\n// Resolved Features\n// =====================================================\n\n/**\n * Resolved effective features for a scope entity.\n * This is the output of the resolution algorithm — same shape as ScopeFeatures\n * (features: string[], limits: Record<string, number>).\n * \n * The resolved set is a CONSOLIDATED view across all applicable scope levels\n * (e.g., app + org + user for a JWT request). The gate checks this single object.\n */\nexport type ResolvedFeatures = ScopeFeatures;\n\n// =====================================================\n// Resolved Features With Usage\n// =====================================================\n\n/**\n * Resolved features enriched with current usage for limit features.\n * Used by the frontend API to show \"7/10 projects\" style indicators.\n * \n * `currentUsage` is keyed by feature identifier and contains the current count\n * for features that have a `counting` configuration in their FeatureDefinition.\n */\nexport interface ResolvedFeaturesWithUsage extends ScopeFeatures {\n /** Current usage for limit features with counting configs. Key = feature identifier, value = current count. */\n currentUsage: Record<string, number>;\n}\n\n// =====================================================\n// API Response Type\n// =====================================================\n\n/**\n * Upgrade path for a feature — describes how the user can get access.\n */\nexport interface FeatureUpgradeOption {\n type: 'plan_upgrade' | 'addon';\n productId: string;\n productLabel: string;\n /** Product key used for checkout (billing catalog identifier) */\n productKey: string;\n /** Default price ID for checkout */\n priceId: string;\n}\n\n/**\n * Full API response for `GET /api/v1/features/resolved`.\n * Extends ResolvedFeaturesWithUsage with upgrade options (from billing product catalog).\n */\nexport interface ResolvedFeaturesResponse extends ResolvedFeaturesWithUsage {\n /**\n * Upgrade options per feature — describes how to unlock unavailable features.\n * Populated by reverse-lookup from product catalog when billing is enabled.\n * Empty object when billing is disabled.\n */\n upgradeOptions: Record<string, { availableVia: FeatureUpgradeOption[] }>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-features.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"scope-features.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/scope-features.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAC;AAEpF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAMrC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;iBAgB9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMhE;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;iBAkB3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;iBAGpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-features.shared.schemas.js","sourceRoot":"","sources":["../../../src/features/scope-features.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAC;AAEpF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,CAAC;AAErC,wDAAwD;AACxD,wBAAwB;AACxB,wDAAwD;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,oDAAoD;IACpD,+FAA+F;IAC/F,0FAA0F;IAC1F,8FAA8F;IAC9F,0FAA0F;IAC1F,sCAAsC;IACtC,8FAA8F;IAC9F,6CAA6C;IAC7C,EAAE;IACF,2FAA2F;IAC3F,sHAAsH;IACtH,kBAAkB;IAClB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,W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,kBAAkB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;aAC7I,QAAQ,CAAC,mNAAmN,CAAC;KACjO,CAAC,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC,eAAe,EAAE;CAC7F,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,gCAAgC,CAAC,MAAM,CAAC;IAC/E,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE;IAC/C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE;CACvH,CAAC,CAAC;AAGH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC,MAAM,CAAC;IAChF,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE;IAC/C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE;CACxH,CAAC,CAAC","sourcesContent":["/**\n * Scope Features State Schemas\n * \n * Scope-agnostic feature state: what features are enabled and what limits are set\n * for any scope entity (org, user).\n * \n * Replaces the org-only OrganizationPlanFeaturesSchema with a universal shape.\n * Used by:\n * - Feature profiles in FeatureConfiguration\n * - Resource storage (ORGANIZATION_FEATURES, USER_FEATURES)\n * - Resolution service output\n */\n\nimport { z } from 'zod';\nimport '@wildo-ai/zod-decorators';\nimport { SectionedVocabulary } from '@wildo-ai/presets-components-models';\nimport { CoreFeature } from '../organizations/organization-features.shared.schemas';\n\n/**\n * Sentinel value for \"unlimited\" in limit-type features.\n * Used everywhere limits are stored, resolved, checked, or displayed.\n * Stored as an actual number in limits records, NOT as a magic number.\n * All gate checks, resolution merges, and UI rendering use this constant.\n *\n * Usage: limits[featureId] === FEATURES_UNLIMITED or a concrete number.\n *\n * Declared here, beside the `limits` it describes, and not in `feature-definition.shared.schemas.ts`, which imports\n * this file: the limits schemas below name it (`numberUI({ unlimitedAt })`, #1851), so it must be importable here\n * without a cycle.\n */\nexport const FEATURES_UNLIMITED = -1;\n\n// =====================================================\n// Scope Features Schema\n// =====================================================\n\n/**\n * Feature state for any scope entity (org, user).\n * Same simple shape: boolean features (present = enabled) + numeric limits.\n * Replaces the org-only OrganizationPlanFeaturesSchema.\n */\nexport const ScopeFeaturesSchema = z.object({\n /** Boolean features - present in array = enabled */\n // `.isAuditEvidence()` — the resolved ENTITLEMENT set. Features gate real capability (and some\n // gate security surfaces, e.g. DIRECTORY_PROVISIONING), so \"features changed\" without the\n // before/after sets cannot answer what a tenant was entitled to on a given day — the question\n // both an auditor and a billing dispute actually ask. Feature keys and numeric limits are\n // configuration, never personal data.\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE — the resolved entitlement set is what a\n // tenant was permitted to do on a given day.\n //\n // Each feature and each limit key names its vocabulary (#1851), so a screen shows its word\n // (`billing_features.<id>.label`, `billing_limits.<id>.label`, where `SectionedVocabulary` says they live) instead of\n // the identifier.\n features: z.array(z.union([z.enum(CoreFeature), z.string().min(1)]).systemEnum(SectionedVocabulary.FEATURE)).default([]).isSummaryField().isAuditEvidence(),\n /** Numeric limits - key = feature identifier, value = limit (FEATURES_UNLIMITED = unlimited) */\n limits: z.record(z.string().systemEnum(SectionedVocabulary.LIMIT), z.number().numberUI({ unlimitedAt: FEATURES_UNLIMITED })).default({}).isSummaryField().isAuditEvidence(),\n});\nexport type ScopeFeatures = z.infer<typeof ScopeFeaturesSchema>;\n\n// =====================================================\n// Scope Features With Overrides Schema\n// =====================================================\n\n/**\n * Extension on the scope features resource (not a separate resource).\n * Stores admin manual overrides that survive billing changes.\n * \n * Used as the `mainSchema` for ORGANIZATION_FEATURES, USER_FEATURES resources.\n * The resolution service computes `features` and `limits` (the effective state) from:\n * defaults + config profile + billing-derived + manual overrides.\n * The `manualOverrides` field stores admin changes that survive subscription changes.\n */\nexport const ScopeFeaturesWithOverridesSchema = ScopeFeaturesSchema.extend({\n /**\n * Manual overrides by admin (persisted across billing changes).\n *\n * `.isAuditEvidence()` — an admin GRANTING a capability outside the billing plan is precisely the\n * discretionary act a reviewer looks for, and it survives billing changes, so it is the durable\n * record of who was given what by hand. No descendant is `.isBackendOnly()`, so marking the\n * container is safe.\n * assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE — a discretionary grant outside the plan.\n */\n manualOverrides: z.object({\n addedFeatures: z.array(z.string().systemEnum(SectionedVocabulary.FEATURE)).default([])\n .describe('Features switched on by hand for this scope, whatever its defaults or billing plan provide. Kept across plan changes.'),\n removedFeatures: z.array(z.string().systemEnum(SectionedVocabulary.FEATURE)).default([])\n .describe('Features switched off by hand for this scope. Applied after `addedFeatures`, so a feature in both lists is off. It cannot withdraw a feature inherited from a broader scope (the application, or a user\\'s organization).'),\n limitOverrides: z.record(z.string().systemEnum(SectionedVocabulary.LIMIT), z.number().numberUI({ unlimitedAt: FEATURES_UNLIMITED })).default({})\n .describe('Limit values set by hand for this scope, keyed by limit feature. Each replaces the value this scope\\'s defaults and billing plan give, before it is combined with limits from broader scopes. -1 means unlimited.'),\n }).default({ addedFeatures: [], removedFeatures: [], limitOverrides: {} }).isAuditEvidence(),\n});\nexport type ScopeFeaturesWithOverrides = z.infer<typeof ScopeFeaturesWithOverridesSchema>;\n\n/**\n * The PERSISTED shape of a scope's feature ledger — the shared payload above plus the two things a\n * row needs to exist: its own id, and the scope it belongs to.\n *\n * ## Why these exist rather than the bare payload being the main schema\n *\n * `ScopeFeaturesWithOverridesSchema` is shared across scopes, so it can model neither\n * `organizationId` nor `applicationId` — and until 2026-09-19 both feature resources used it\n * DIRECTLY as their `mainSchema`. The column was contributed by the relationship and the table had\n * it, but the schema did not, with two consequences that only look unrelated:\n *\n * - **No business-key identity.** `resolveBusinessKeyFieldNames` walks the SCHEMA, so every\n * business-key repository helper refused these resources outright — \"Schema declares no\n * business-key identity\". That is what made the ledger unseedable by any mode, and the\n * Administration → Entitlements pane read a row that nothing could ever create.\n * - **The FK was invisible to every schema-driven mechanism**, which is the same class of defect\n * as the `appId` misspelling fixed the day before: the column exists, and nothing that reads\n * declarations can see it.\n *\n * The polymorphic config singletons (SSO / SCIM / SIEM / webhooks) never had this problem because\n * `createPolymorphicResourceConfigurations` contributes the scope FK to each variant's schema. These\n * two are built by the plain factory, so they declare it themselves — exactly as\n * `ApplicationMetadataSchema` does, and for the same stated reason.\n *\n * `.isBusinessKey().isUnique()` says the same thing twice on purpose: the marker gives the seeding\n * and upsert helpers an identity to address the row by, and the unique index carries the 1:1 down to\n * the database so two concurrent creates cannot leave a scope with two ledgers.\n */\nexport const ApplicationFeaturesSchema = ScopeFeaturesWithOverridesSchema.extend({\n _id: z.string().isPrimaryKey().isSummaryField(),\n applicationId: z.string().isDBIndexed().isForeignKey().isBusinessKey().isUnique().isSummaryField().excludeFromUpdate(),\n});\nexport type ApplicationFeatures = z.infer<typeof ApplicationFeaturesSchema>;\n\n/** The ORGANIZATION twin — same shape, same reasoning, one scope down. */\nexport const OrganizationFeaturesSchema = ScopeFeaturesWithOverridesSchema.extend({\n _id: z.string().isPrimaryKey().isSummaryField(),\n organizationId: z.string().isDBIndexed().isForeignKey().isBusinessKey().isUnique().isSummaryField().excludeFromUpdate(),\n});\nexport type OrganizationFeatures = z.infer<typeof OrganizationFeaturesSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"scope-features.shared.schemas.js","sourceRoot":"","sources":["../../../../src/features/scope-features.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAW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,iBAAiB,EAAE;CACvH,CAAC,CAAC;AAGH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC,MAAM,CAAC;IAChF,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE;IAC/C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE;CACxH,CAAC,CAAC","sourcesContent":["/**\n * Scope Features State Schemas\n * \n * Scope-agnostic feature state: what features are enabled and what limits are set\n * for any scope entity (org, user).\n * \n * Replaces the org-only OrganizationPlanFeaturesSchema with a universal shape.\n * Used by:\n * - Feature profiles in FeatureConfiguration\n * - Resource storage (ORGANIZATION_FEATURES, USER_FEATURES)\n * - Resolution service output\n */\n\nimport { z } from 'zod';\nimport '@wildo-ai/zod-decorators';\nimport { SectionedVocabulary } from '@wildo-ai/presets-components-models';\nimport { CoreFeature } from '../organizations/organization-features.shared.schemas';\n\n/**\n * Sentinel value for \"unlimited\" in limit-type features.\n * Used everywhere limits are stored, resolved, checked, or displayed.\n * Stored as an actual number in limits records, NOT as a magic number.\n * All gate checks, resolution merges, and UI rendering use this constant.\n *\n * Usage: limits[featureId] === FEATURES_UNLIMITED or a concrete number.\n *\n * Declared here, beside the `limits` it describes, and not in `feature-definition.shared.schemas.ts`, which imports\n * this file: the limits schemas below name it (`numberUI({ unlimitedAt })`, #1851), so it must be importable here\n * without a cycle.\n */\nexport const FEATURES_UNLIMITED = -1;\n\n// =====================================================\n// Scope Features Schema\n// =====================================================\n\n/**\n * Feature state for any scope entity (org, user).\n * Same simple shape: boolean features (present = enabled) + numeric limits.\n * Replaces the org-only OrganizationPlanFeaturesSchema.\n */\nexport const ScopeFeaturesSchema = z.object({\n /** Boolean features - present in array = enabled */\n // `.isAuditEvidence()` — the resolved ENTITLEMENT set. Features gate real capability (and some\n // gate security surfaces, e.g. DIRECTORY_PROVISIONING), so \"features changed\" without the\n // before/after sets cannot answer what a tenant was entitled to on a given day — the question\n // both an auditor and a billing dispute actually ask. Feature keys and numeric limits are\n // configuration, never personal data.\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE — the resolved entitlement set is what a\n // tenant was permitted to do on a given day.\n //\n // Each feature and each limit key names its vocabulary (#1851), so a screen shows its word\n // (`billing_features.<id>.label`, `billing_limits.<id>.label`, where `SectionedVocabulary` says they live) instead of\n // the identifier.\n features: z.array(z.union([z.enum(CoreFeature), z.string().min(1)]).systemEnum(SectionedVocabulary.FEATURE)).default([]).isSummaryField().isAuditEvidence(),\n /** Numeric limits - key = feature identifier, value = limit (FEATURES_UNLIMITED = unlimited) */\n limits: z.record(z.string().systemEnum(SectionedVocabulary.LIMIT), z.number().numberUI({ unlimitedAt: FEATURES_UNLIMITED })).default({}).isSummaryField().isAuditEvidence(),\n});\nexport type ScopeFeatures = z.infer<typeof ScopeFeaturesSchema>;\n\n// =====================================================\n// Scope Features With Overrides Schema\n// =====================================================\n\n/**\n * Extension on the scope features resource (not a separate resource).\n * Stores admin manual overrides that survive billing changes.\n * \n * Used as the `mainSchema` for ORGANIZATION_FEATURES, USER_FEATURES resources.\n * The resolution service computes `features` and `limits` (the effective state) from:\n * defaults + config profile + billing-derived + manual overrides.\n * The `manualOverrides` field stores admin changes that survive subscription changes.\n */\nexport const ScopeFeaturesWithOverridesSchema = ScopeFeaturesSchema.extend({\n /**\n * Manual overrides by admin (persisted across billing changes).\n *\n * `.isAuditEvidence()` — an admin GRANTING a capability outside the billing plan is precisely the\n * discretionary act a reviewer looks for, and it survives billing changes, so it is the durable\n * record of who was given what by hand. No descendant is `.isBackendOnly()`, so marking the\n * container is safe.\n * assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE — a discretionary grant outside the plan.\n */\n manualOverrides: z.object({\n addedFeatures: z.array(z.string().systemEnum(SectionedVocabulary.FEATURE)).default([])\n .describe('Features switched on by hand for this scope, whatever its defaults or billing plan provide. Kept across plan changes.'),\n removedFeatures: z.array(z.string().systemEnum(SectionedVocabulary.FEATURE)).default([])\n .describe('Features switched off by hand for this scope. Applied after `addedFeatures`, so a feature in both lists is off. It cannot withdraw a feature inherited from a broader scope (the application, or a user\\'s organization).'),\n limitOverrides: z.record(z.string().systemEnum(SectionedVocabulary.LIMIT), z.number().numberUI({ unlimitedAt: FEATURES_UNLIMITED })).default({})\n .describe('Limit values set by hand for this scope, keyed by limit feature. Each replaces the value this scope\\'s defaults and billing plan give, before it is combined with limits from broader scopes. -1 means unlimited.'),\n }).default({ addedFeatures: [], removedFeatures: [], limitOverrides: {} }).isAuditEvidence(),\n});\nexport type ScopeFeaturesWithOverrides = z.infer<typeof ScopeFeaturesWithOverridesSchema>;\n\n/**\n * The PERSISTED shape of a scope's feature ledger — the shared payload above plus the two things a\n * row needs to exist: its own id, and the scope it belongs to.\n *\n * ## Why these exist rather than the bare payload being the main schema\n *\n * `ScopeFeaturesWithOverridesSchema` is shared across scopes, so it can model neither\n * `organizationId` nor `applicationId` — and until 2026-09-19 both feature resources used it\n * DIRECTLY as their `mainSchema`. The column was contributed by the relationship and the table had\n * it, but the schema did not, with two consequences that only look unrelated:\n *\n * - **No business-key identity.** `resolveBusinessKeyFieldNames` walks the SCHEMA, so every\n * business-key repository helper refused these resources outright — \"Schema declares no\n * business-key identity\". That is what made the ledger unseedable by any mode, and the\n * Administration → Entitlements pane read a row that nothing could ever create.\n * - **The FK was invisible to every schema-driven mechanism**, which is the same class of defect\n * as the `appId` misspelling fixed the day before: the column exists, and nothing that reads\n * declarations can see it.\n *\n * The polymorphic config singletons (SSO / SCIM / SIEM / webhooks) never had this problem because\n * `createPolymorphicResourceConfigurations` contributes the scope FK to each variant's schema. These\n * two are built by the plain factory, so they declare it themselves — exactly as\n * `ApplicationMetadataSchema` does, and for the same stated reason.\n *\n * `.isBusinessKey().isUnique()` says the same thing twice on purpose: the marker gives the seeding\n * and upsert helpers an identity to address the row by, and the unique index carries the 1:1 down to\n * the database so two concurrent creates cannot leave a scope with two ledgers.\n */\nexport const ApplicationFeaturesSchema = ScopeFeaturesWithOverridesSchema.extend({\n _id: z.string().isPrimaryKey().isSummaryField(),\n applicationId: z.string().isDBIndexed().isForeignKey().isBusinessKey().isUnique().isSummaryField().excludeFromUpdate(),\n});\nexport type ApplicationFeatures = z.infer<typeof ApplicationFeaturesSchema>;\n\n/** The ORGANIZATION twin — same shape, same reasoning, one scope down. */\nexport const OrganizationFeaturesSchema = ScopeFeaturesWithOverridesSchema.extend({\n _id: z.string().isPrimaryKey().isSummaryField(),\n organizationId: z.string().isDBIndexed().isForeignKey().isBusinessKey().isUnique().isSummaryField().excludeFromUpdate(),\n});\nexport type OrganizationFeatures = z.infer<typeof OrganizationFeaturesSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-features.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"user-features.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/user-features.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAA8B,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAQzG,KAAK,0BAA0B,GAC3B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,uDAAuD,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;iCAyIpH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-features.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../src/features/user-features.shared.resources-config.schemas.ts"],"names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ACnC,CAAC;SACH;QAED,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,UAAU,EAAE,gCAAgC,CAAC,OAAO,EAAE;oBACtD,0FAA0F;oBAC1F,0FAA0F;oBAC1F,qFAAqF;oBACrF,0FAA0F;oBAC1F,2FAA2F;oBAC3F,wFAAwF;oBACxF,wEAAwE;oBACxE,oCAAoC,EAAE,IAAI;iBAC3C;aACF;SACF;QAED,kFAAkF;QAClF,4EAA4E;QAC5E,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,eAAe;oBACzD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * User Features Shared Resource Configuration\n *\n * Resource configuration for user-level feature management.\n * Controls which features are available to individual users (overrides/additions).\n * Uses ScopeFeaturesWithOverridesSchema as mainSchema (same pattern as org features).\n */\n\nimport { ScopeFeaturesWithOverridesSchema } from './scope-features.shared.schemas';\n\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\n\ntype UserFeaturesCoreOperations =\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.READ\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\nexport const userFeaturesResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n Record<string, never>,\n UserFeaturesCoreOperations,\n typeof ScopeFeaturesWithOverridesSchema\n>({\n mainSchema: ScopeFeaturesWithOverridesSchema,\n resourceIdentifier: CoreResourceType.USER_FEATURES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USER_FEATURES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n /** Subject-export disclosure. The subject's own data. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. */\n systemAccessPolicy: { exportSubject: ResourceSystemAccessMode.ALLOWED },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.DERIVED },\n\n\n /*\n * NO `retentionPolicy`, so a subject erasure DESTROYS this row (#1569, decided by Paul 2026-09-24).\n *\n * It declared `RETAIN_ONLY` — \"feature toggles and limit overrides, nothing to scrub\" — and since\n * #1279 an erasure takes a silent edge's treatment from that declaration, so an erased person's\n * entitlement overrides stayed live on a scrubbed profile. A per-person entitlement has no retention\n * value once the person is erased, so the USERS → USER_FEATURES edge AUTHORS `strategy: DELETE`,\n * dispatched through the DELETE below exactly as the parent-delete cascade dispatches it; re-adding a\n * retention mode here would be refused as a contradiction.\n *\n * And so no `dataSubjectPolicy` either: the factory pairs the two in both directions, because only a\n * retention-governed resource can be passed to an erasure as its SUBJECT. This row is never the\n * subject of an erasure; it is a child an erasure destroys.\n */\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): the scope-features ledger is not\n // API-deletable, but the composition `onParentDelete` cascade must physically\n // delete the row when its owning user is deleted, and a subject erasure dispatches\n // the same teardown (#1569). Without a DELETE op the cascade (`deleteChildrenImmediate`)\n // throws ErrorType.CONFIGURATION on any user that has a features row. The edge is 1:1,\n // so discovery READs the row — no LIST is needed.\n CoreResourceOperation.DELETE,\n ],\n\n customOperation: {} as Record<string, never>,\n\n // assurance-control: WILDO.ENTITLEMENT.NO_SELF_GRANT — a user cannot widen its own entitlements.\n //\n // The subject of this row is the person it belongs to, which is exactly why the write gate matters\n // more here than the read gate: READ and SEARCH are `ORG_MEMBER` so a principal can see its own\n // entitlements, and every write — CREATE, UPDATE, DELETE — is `APP_ADMIN_SUPER_ADMIN`, which no\n // organization-scope role confers.\n // So the self-grant this objective names is refused for the principal best placed to attempt it.\n //\n // The role decides WHO may write; WHOSE row is decided one level down, by the USER_SELF scope.\n // That scope refuses any row that is not the caller's unless the variant admits cross-subject\n // administration, and until #1030 the UPDATE variant did not — so the one routable write to a\n // user's entitlements let a super-administrator widen exactly their own, which is the inverse of\n // what this comment claimed. The UPDATE variant now declares `admitsCrossSubjectUserAdministration`;\n // the ORG_MEMBER reads deliberately do not.\n //\n // The role is the whole control for the same reason as the sibling ledgers: the super-admin path\n // writes these fields, so they cannot be field-protected. No route-less door exists either:\n // the retention-only LIST/UPDATE_MANY went with the retention policy (#1569). Pinned by\n // `security-sensitive-operation-reachability.backend.test.ts`.\n operationsConfiguration: {\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }\n ],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: false,\n searchableFields: [],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: {},\n sortFields: [],\n maxPaginatedResultPerPageLimit: 50,\n }],\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n requestDto: ScopeFeaturesWithOverridesSchema.partial(),\n // THE administrative write to another person's entitlements. This resource sits under the\n // USER_SELF scope, where `authorizeUserSelf` refuses any row whose user is not the caller\n // unless the VARIANT admits cross-subject addressing — so without this flag the only\n // routable write to a user's features let a super-administrator change exactly one user's\n // entitlements, their own, and nobody else's (#1030). The `roles` gate above still decides\n // WHO may call; this decides only WHOSE row. It stays OFF the `ORG_MEMBER` reads above:\n // admitting it there would let any member read any user's entitlements.\n admitsCrossSubjectUserAdministration: true,\n }\n ],\n },\n\n // Internal-only (REPOSITORY_ONLY): powers the composition onParentDelete cascade,\n // not a public API surface — the ledger is reset, never DELETEd, over HTTP.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"user-features.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/features/user-features.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAEnF,OAAO,EA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EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,UAAU,EAAE,gCAAgC,CAAC,OAAO,EAAE;oBACtD,0FAA0F;oBAC1F,0FAA0F;oBAC1F,qFAAqF;oBACrF,0FAA0F;oBAC1F,2FAA2F;oBAC3F,wFAAwF;oBACxF,wEAAwE;oBACxE,oCAAoC,EAAE,IAAI;iBAC3C;aACF;SACF;QAED,kFAAkF;QAClF,4EAA4E;QAC5E,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,eAAe;oBACzD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * User Features Shared Resource Configuration\n *\n * Resource configuration for user-level feature management.\n * Controls which features are available to individual users (overrides/additions).\n * Uses ScopeFeaturesWithOverridesSchema as mainSchema (same pattern as org features).\n */\n\nimport { ScopeFeaturesWithOverridesSchema } from './scope-features.shared.schemas';\n\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\n\ntype UserFeaturesCoreOperations =\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.READ\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\nexport const userFeaturesResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n Record<string, never>,\n UserFeaturesCoreOperations,\n typeof ScopeFeaturesWithOverridesSchema\n>({\n mainSchema: ScopeFeaturesWithOverridesSchema,\n resourceIdentifier: CoreResourceType.USER_FEATURES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USER_FEATURES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n /** Subject-export disclosure. The subject's own data. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. */\n systemAccessPolicy: { exportSubject: ResourceSystemAccessMode.ALLOWED },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.DERIVED },\n\n\n /*\n * NO `retentionPolicy`, so a subject erasure DESTROYS this row (#1569, decided by Paul 2026-09-24).\n *\n * It declared `RETAIN_ONLY` — \"feature toggles and limit overrides, nothing to scrub\" — and since\n * #1279 an erasure takes a silent edge's treatment from that declaration, so an erased person's\n * entitlement overrides stayed live on a scrubbed profile. A per-person entitlement has no retention\n * value once the person is erased, so the USERS → USER_FEATURES edge AUTHORS `strategy: DELETE`,\n * dispatched through the DELETE below exactly as the parent-delete cascade dispatches it; re-adding a\n * retention mode here would be refused as a contradiction.\n *\n * And so no `dataSubjectPolicy` either: the factory pairs the two in both directions, because only a\n * retention-governed resource can be passed to an erasure as its SUBJECT. This row is never the\n * subject of an erasure; it is a child an erasure destroys.\n */\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): the scope-features ledger is not\n // API-deletable, but the composition `onParentDelete` cascade must physically\n // delete the row when its owning user is deleted, and a subject erasure dispatches\n // the same teardown (#1569). Without a DELETE op the cascade (`deleteChildrenImmediate`)\n // throws ErrorType.CONFIGURATION on any user that has a features row. The edge is 1:1,\n // so discovery READs the row — no LIST is needed.\n CoreResourceOperation.DELETE,\n ],\n\n customOperation: {} as Record<string, never>,\n\n // assurance-control: WILDO.ENTITLEMENT.NO_SELF_GRANT — a user cannot widen its own entitlements.\n //\n // The subject of this row is the person it belongs to, which is exactly why the write gate matters\n // more here than the read gate: READ and SEARCH are `ORG_MEMBER` so a principal can see its own\n // entitlements, and every write — CREATE, UPDATE, DELETE — is `APP_ADMIN_SUPER_ADMIN`, which no\n // organization-scope role confers.\n // So the self-grant this objective names is refused for the principal best placed to attempt it.\n //\n // The role decides WHO may write; WHOSE row is decided one level down, by the USER_SELF scope.\n // That scope refuses any row that is not the caller's unless the variant admits cross-subject\n // administration, and until #1030 the UPDATE variant did not — so the one routable write to a\n // user's entitlements let a super-administrator widen exactly their own, which is the inverse of\n // what this comment claimed. The UPDATE variant now declares `admitsCrossSubjectUserAdministration`;\n // the ORG_MEMBER reads deliberately do not.\n //\n // The role is the whole control for the same reason as the sibling ledgers: the super-admin path\n // writes these fields, so they cannot be field-protected. No route-less door exists either:\n // the retention-only LIST/UPDATE_MANY went with the retention policy (#1569). Pinned by\n // `security-sensitive-operation-reachability.backend.test.ts`.\n operationsConfiguration: {\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }\n ],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: false,\n searchableFields: [],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: {},\n sortFields: [],\n maxPaginatedResultPerPageLimit: 50,\n }],\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n requestDto: ScopeFeaturesWithOverridesSchema.partial(),\n // THE administrative write to another person's entitlements. This resource sits under the\n // USER_SELF scope, where `authorizeUserSelf` refuses any row whose user is not the caller\n // unless the VARIANT admits cross-subject addressing — so without this flag the only\n // routable write to a user's features let a super-administrator change exactly one user's\n // entitlements, their own, and nobody else's (#1030). The `roles` gate above still decides\n // WHO may call; this decides only WHOSE row. It stays OFF the `ORG_MEMBER` reads above:\n // admitting it there would let any member read any user's entitlements.\n admitsCrossSubjectUserAdministration: true,\n }\n ],\n },\n\n // Internal-only (REPOSITORY_ONLY): powers the composition onParentDelete cascade,\n // not a public API surface — the ledger is reset, never DELETEd, over HTTP.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-remote-reference-link.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"file-remote-reference-link.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/files/file-remote-reference-link.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mCAAmC,oBAAoB,CAAC;AAErE,eAAO,MAAM,6BAA6B;IACxC,gJAAgJ;;IAEhJ,2EAA2E;;IAE3E;;;;OAIG;;;;kBAIH,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,oCAAoC;;QAf/C,gJAAgJ;;QAEhJ,2EAA2E;;QAE3E;;;;WAIG;;;;;iBASH,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,uFAAuF;AACvF,oBAAY,2BAA2B;IACrC,uFAAuF;IACvF,MAAM,WAAW;IACjB,+BAA+B;IAC/B,OAAO,YAAY;IACnB,qGAAqG;IACrG,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,iCAAiC,GACzC;IAAE,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAA;CAAE,GAC9F;IAAE,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE/F;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,OAAO,GAAG,iCAAiC,CAYnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-remote-reference-link.shared.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"file-remote-reference-link.shared.schemas.js","sourceRoot":"","sources":["../../../../src/files/file-remote-reference-link.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;GAaG;AACH,MAA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oC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACpE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO;YACL,IAAI,EAAE,2BAA2B,CAAC,OAAO;YACzC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;SACpG,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,2BAA2B,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,EAAE,CAAC;AAC/G,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Linking a file that STAYS at a vendor into a resource's file field (#394 P5).\n *\n * A provider's picker that delivers a `REMOTE_REFERENCE` hands the browser an\n * opaque id the vendor understands and nothing else — no bytes. The field then\n * POSTs this body to the SAME route a byte upload uses, so the route's\n * authorization, the field's `storageAccepted`, scope derivation and upload\n * grants all apply once, and the backend produces a FILES row whose\n * `storageProvider` is the vendor storage and whose `storageRef` is that id.\n *\n * One route, two bodies: a multipart `file` part carries bytes, a JSON\n * `remoteReference` carries a reference. The two are distinguished by which is\n * present, never by a header a client can get wrong.\n */\nexport const FILE_REMOTE_REFERENCE_LINK_BODY_KEY = 'remoteReference';\n\nexport const FileRemoteReferenceLinkSchema = z.strictObject({\n /** The provider whose picker produced the reference — `google-drive` (the connected provider's ref), never the storage value `google_drive`. */\n providerRef: z.string().min(1),\n /** The vendor's own id for the file, exactly as the picker returned it. */\n externalId: z.string().min(1),\n /**\n * What the picker showed the person. Advisory: the backend reads the vendor's\n * own metadata before creating the row and prefers it, because a display\n * name typed by a client is not evidence about the file.\n */\n displayName: z.string().min(1).optional(),\n mimeType: z.string().min(1).optional(),\n sizeBytes: z.number().int().min(0).optional(),\n});\nexport type FileRemoteReferenceLink = z.infer<typeof FileRemoteReferenceLinkSchema>;\n\nexport const FileRemoteReferenceLinkRequestSchema = z.object({\n [FILE_REMOTE_REFERENCE_LINK_BODY_KEY]: FileRemoteReferenceLinkSchema,\n});\nexport type FileRemoteReferenceLinkRequest = z.infer<typeof FileRemoteReferenceLinkRequestSchema>;\n\n/** What a request body says about a remote reference — three answers, all distinct. */\nexport enum FileRemoteReferenceLinkRead {\n /** The body carries no `remoteReference` at all: this is a byte upload, or nothing. */\n ABSENT = 'absent',\n /** A well-formed reference. */\n PRESENT = 'present',\n /** The key is there and its value is not a reference — a client defect, never silently an upload. */\n INVALID = 'invalid',\n}\n\nexport type FileRemoteReferenceLinkReadResult =\n | { readonly kind: FileRemoteReferenceLinkRead.ABSENT }\n | { readonly kind: FileRemoteReferenceLinkRead.PRESENT; readonly link: FileRemoteReferenceLink }\n | { readonly kind: FileRemoteReferenceLinkRead.INVALID; readonly issues: readonly string[] };\n\n/**\n * Reads a remote reference off a parsed request body. A multipart upload\n * arrives with an empty or `fileId`-only body and reads as ABSENT; a JSON body\n * naming the key is either PRESENT or INVALID. Nothing else is inferred.\n */\nexport function readFileRemoteReferenceLinkRequest(body: unknown): FileRemoteReferenceLinkReadResult {\n if (body === null || typeof body !== 'object' || !(FILE_REMOTE_REFERENCE_LINK_BODY_KEY in body)) {\n return { kind: FileRemoteReferenceLinkRead.ABSENT };\n }\n const parsed = FileRemoteReferenceLinkRequestSchema.safeParse(body);\n if (!parsed.success) {\n return {\n kind: FileRemoteReferenceLinkRead.INVALID,\n issues: parsed.error.issues.map((issue) => `${issue.path.join('.') || '(root)'}: ${issue.message}`),\n };\n }\n return { kind: FileRemoteReferenceLinkRead.PRESENT, link: parsed.data[FILE_REMOTE_REFERENCE_LINK_BODY_KEY] };\n}\n"]}
|