@wildo-ai/saas-models 1.1.5 → 1.1.6
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/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.js +2 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/applications-context.schemas.d.ts +176 -2
- package/dist/esm/applications/applications-context.schemas.d.ts.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 +3 -2
- package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/applications.shared.schemas.d.ts +7 -5
- package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.schemas.js +6 -4
- package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +10 -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 +49 -15
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.js +2 -2
- package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-configuration.shared.schemas.d.ts +25 -0
- package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-configuration.shared.schemas.js +19 -0
- package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.d.ts +27 -5
- package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.js +30 -4
- package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.d.ts +37 -11
- package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.js +31 -19
- package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +2 -0
- 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 +18 -7
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts +2 -0
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.js +7 -1
- package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js +6 -6
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.js +1 -1
- package/dist/esm/billing/invoice-ref.shared.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 +5 -3
- package/dist/esm/billing/price.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts +11 -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 +39 -23
- package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-definition.shared.schemas.d.ts +30 -2
- package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product-definition.shared.schemas.js +35 -0
- package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +6 -3
- package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.schemas.d.ts +7 -3
- package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.schemas.js +22 -7
- package/dist/esm/billing/product.shared.schemas.js.map +1 -1
- package/dist/esm/billing/promotions.shared.resources-config.schemas.js +8 -8
- package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts +135 -0
- package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -0
- package/dist/esm/billing/public-pricing-catalog.shared.atoms.js +112 -0
- package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -0
- package/dist/esm/billing/public-pricing-catalog.shared.d.ts +30 -0
- package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -0
- package/dist/esm/billing/public-pricing-catalog.shared.js +53 -0
- package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -0
- package/dist/esm/billing/referral-reward.shared.schemas.d.ts +51 -0
- package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -0
- package/dist/esm/billing/referral-reward.shared.schemas.js +92 -0
- package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -0
- package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts +54 -33
- package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.resources-config.schemas.js +56 -2
- package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.d.ts +22 -37
- package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.js +24 -44
- package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +9 -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 +55 -22
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.d.ts +80 -5
- package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.js +85 -25
- package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.js +5 -5
- package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +143 -2
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.js +84 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +14 -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 +4 -0
- 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 +70 -0
- 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 +87 -0
- 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 +34 -0
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js +137 -3
- 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 +7 -0
- 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 +28 -2
- 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 +29 -8
- 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 +29 -6
- 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 +38 -9
- 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 +1822 -146
- 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 +1777 -87
- 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 +10 -0
- 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 +148 -7
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts +2 -0
- 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 +2 -0
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts +0 -8
- package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts.map +0 -1
- package/dist/esm/compliance/privacy/data-retention.shared.schemas.js.map +0 -1
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts +17 -8
- 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 +43 -20
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +38 -0
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +39 -0
- 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 +35 -0
- package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js +82 -0
- package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -0
- package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts +37 -0
- package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js +223 -0
- package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts +222 -0
- package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js +331 -0
- package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +37 -3
- 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 +33 -4
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts +52 -0
- package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js +116 -0
- package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts +11 -0
- package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js +11 -0
- package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts +93 -0
- package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/retention-binding.shared.utils.js +149 -0
- package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -0
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts +43 -0
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js +106 -0
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts +209 -0
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js +226 -0
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts +129 -5
- package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js +128 -4
- 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 +53 -0
- package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js +74 -0
- package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -0
- package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts +311 -0
- package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js +355 -0
- package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts +178 -39
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js +145 -35
- 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 +26 -0
- 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 +9 -0
- 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/config/app-configuration-shared.shared.schemas.d.ts +109 -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 +57 -0
- package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +69 -0
- package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.js +93 -0
- package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +16 -16
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +160 -61
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.js +297 -65
- package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
- package/dist/esm/errors/caught-error-description.shared.utils.d.ts +69 -0
- package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -0
- package/dist/esm/errors/caught-error-description.shared.utils.js +77 -0
- package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -0
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +76 -3
- 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 +76 -2
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.d.ts +20 -1
- package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.js +16 -9
- package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
- package/dist/esm/errors/errors.shared.utils.d.ts +0 -24
- package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.utils.js +0 -39
- package/dist/esm/errors/errors.shared.utils.js.map +1 -1
- package/dist/esm/errors/thrown-value-description.shared.utils.d.ts +6 -7
- package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/thrown-value-description.shared.utils.js +6 -7
- package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts +70 -0
- package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -0
- package/dist/esm/external-data/external-data-pipeline-description.shared.js +92 -0
- package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -0
- package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts +154 -0
- package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -0
- package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js +161 -0
- package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -0
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +1071 -23
- 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 +1065 -17
- 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 +71 -0
- package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -0
- package/dist/esm/external-data/external-data-provenance.shared.js +88 -0
- package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -0
- package/dist/esm/external-data.exports.d.ts +5 -0
- package/dist/esm/external-data.exports.d.ts.map +1 -1
- package/dist/esm/external-data.exports.js +11 -0
- package/dist/esm/external-data.exports.js.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +17 -2
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +22 -4
- 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 +3 -0
- 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 +2 -0
- package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +152 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +4 -3
- 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 +4 -3
- 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 +45 -0
- 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 +14 -0
- 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 +188 -4
- 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 +76 -9
- 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 +175 -33
- 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 +247 -42
- 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 +53 -0
- package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js +41 -0
- package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts +150 -0
- package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js +22 -0
- package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -0
- package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts +42 -0
- package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js +49 -0
- package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts +53 -0
- 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 +56 -0
- 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 +34 -0
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.js +34 -0
- 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 +341 -4
- 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 +270 -20
- 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 +6 -2
- 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 +6 -2
- 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 +174 -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 +125 -0
- 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 +3 -3
- package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts +42 -0
- package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js +57 -0
- package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts +6 -0
- package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-protocol.shared.schemas.js +6 -0
- 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 +58 -0
- package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js +35 -0
- package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts +115 -0
- package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js +137 -0
- package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/provider-usage-cost.shared.d.ts +73 -0
- package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-usage-cost.shared.js +171 -0
- package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -0
- package/dist/esm/external-providers/provider-usage-pricing.example.d.ts +12 -0
- package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-usage-pricing.example.js +40 -0
- package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -0
- package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts +68 -32
- 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 +63 -52
- 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 +5 -5
- 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 +13 -5
- 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 +2 -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 +2 -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 +2 -11
- package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/feature-definition.shared.schemas.js +0 -12
- package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
- package/dist/esm/features/scope-features.shared.schemas.d.ts +31 -17
- package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/scope-features.shared.schemas.js +27 -5
- package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +5 -5
- package/dist/esm/flows-actors/actors.shared.schemas.d.ts +127 -11
- package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.js +32 -1
- package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts +16 -0
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.js +7 -0
- 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 +68 -0
- package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js +276 -0
- package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts +468 -0
- package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js +472 -0
- package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts +118 -0
- package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js +144 -0
- package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +142 -8
- 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 +209 -11
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +37 -2
- 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 +30 -2
- 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 +0 -11
- 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 +12 -5
- 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 +45 -6
- 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 +31 -5
- package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js +30 -30
- package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts +15 -7
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows.shared.schemas.d.ts +15 -0
- package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts +506 -0
- package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/human-decision.shared.schemas.js +502 -0
- package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts +46 -0
- package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js +65 -0
- package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts +120 -0
- package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js +165 -0
- package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts +45 -0
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js +127 -0
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts +83 -0
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js +97 -0
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts +136 -0
- package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js +90 -0
- package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts +5 -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 +19 -4
- 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 +13 -15
- 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 +30 -17
- 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 +268 -0
- package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/review-deadlines.shared.schemas.js +576 -0
- package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts +30 -0
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts +129 -0
- package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/work-attribution.shared.schemas.js +141 -0
- package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -0
- package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts +22 -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 +23 -0
- 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 +61 -0
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js +61 -0
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.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 +11 -10
- package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js +6 -6
- package/dist/esm/guidance/lifecycle-state.shared.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 +8 -7
- package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js +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 +550 -30
- 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 +498 -34
- 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 +62 -0
- package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -0
- package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js +66 -0
- package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -0
- package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts +133 -0
- package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -0
- package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js +191 -0
- package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -0
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts +37 -6
- 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 +37 -6
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
- package/dist/esm/i18n/application-config-vocabulary.shared.d.ts +36 -0
- package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -0
- package/dist/esm/i18n/application-config-vocabulary.shared.js +39 -0
- package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -0
- package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts +11 -0
- package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -0
- package/dist/esm/i18n/engine-open-vocabulary-values.shared.js +14 -0
- package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -0
- package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts +20 -0
- package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -0
- package/dist/esm/i18n/engine-open-vocabulary.shared.js +21 -0
- package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -0
- package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts +94 -0
- package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js +206 -0
- package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts +169 -0
- package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -0
- package/dist/esm/inbound/conversation-threads.shared.schemas.js +231 -0
- package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -0
- package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts +195 -0
- package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -0
- package/dist/esm/inbound/inbound-channels.shared.schemas.js +244 -0
- package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -0
- package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts +36 -0
- package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js +169 -0
- package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts +404 -0
- package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -0
- package/dist/esm/inbound/inbound-delivery.shared.schemas.js +449 -0
- package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -0
- package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts +46 -0
- package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -0
- package/dist/esm/inbound/inbound-endpoint-env.shared.js +57 -0
- package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -0
- package/dist/esm/index.d.ts +58 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +67 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts +28 -0
- 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 +29 -0
- package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +95 -1
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +121 -0
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows.exports.d.ts +0 -1
- package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
- package/dist/esm/meta-workflows.exports.js +0 -1
- package/dist/esm/meta-workflows.exports.js.map +1 -1
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +7 -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 +35 -0
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts +131 -0
- package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js +258 -0
- package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts +448 -0
- package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -0
- package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js +530 -0
- package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -0
- 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 +4 -3
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts +16 -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 +46 -16
- 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 +19 -12
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js +77 -12
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/notification-badges.schemas.d.ts +35 -3
- package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.schemas.js +43 -3
- package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.d.ts +66 -399
- package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.js +111 -58
- package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts +5 -5
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js +6 -6
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +3 -0
- 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 +60 -14
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.d.ts +3 -0
- package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.js +30 -0
- package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.schemas.js +9 -9
- package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.js +4 -4
- package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts +0 -1
- package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +5 -5
- package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.js +15 -10
- package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js +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 +2 -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 +63 -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 +106 -5
- package/dist/esm/organizations/organization-unit-narrowing-decision.shared.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 +9 -0
- package/dist/esm/organizations/organization-unit-narrowing.shared.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 +7 -2
- package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts +3 -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 +12 -8
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.schemas.d.ts +7 -2
- package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.schemas.js +51 -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 +58 -0
- package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js +188 -0
- package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts +122 -0
- package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -0
- package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js +136 -0
- package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -0
- package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts +36 -0
- package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js +155 -0
- package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts +229 -0
- package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -0
- package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js +290 -0
- package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -0
- package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts +48 -0
- package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -0
- package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js +50 -0
- package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -0
- package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts +97 -0
- package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js +572 -0
- package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts +590 -0
- package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -0
- package/dist/esm/organizations/service-provider-relationships.shared.schemas.js +869 -0
- package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -0
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts +36 -6
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js +57 -16
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.d.ts +0 -1
- package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.js +0 -1
- package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
- package/dist/esm/public-runtime/index.d.ts +30 -11
- package/dist/esm/public-runtime/index.d.ts.map +1 -1
- package/dist/esm/public-runtime/index.js +30 -11
- package/dist/esm/public-runtime/index.js.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.d.ts +36 -8
- package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.js +12 -0
- package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
- package/dist/esm/requests/header-keys.shared.d.ts +6 -0
- package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
- package/dist/esm/requests/header-keys.shared.js +7 -0
- package/dist/esm/requests/header-keys.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 +147 -8
- package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts +51 -23
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.js +64 -0
- package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.d.ts +78 -13
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js +91 -18
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts +21 -0
- package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -0
- package/dist/esm/resources/embedded-resource-mark.shared.utils.js +22 -0
- package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -0
- package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.js +812 -32
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +244 -48
- package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.js +151 -17
- 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 +353 -12
- package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.d.ts +45 -0
- package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.js +92 -0
- package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.d.ts +2 -17
- package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.js +24 -20
- package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources.shared.utils.d.ts +16 -8
- package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.utils.js +16 -8
- package/dist/esm/resources/resources.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/collection-export.shared.utils.d.ts +2 -2
- package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/collection-export.shared.utils.js +4 -2
- package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts +103 -0
- package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -0
- package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js +275 -0
- package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -0
- package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts +51 -0
- package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -0
- package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js +28 -0
- package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -0
- 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 +30 -19
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts +2 -0
- package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -0
- package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js +33 -0
- package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -0
- package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts +15 -0
- package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.factory.js +6 -1
- package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.schemas.js +30 -4
- package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +46 -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 +205 -22
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-serialization.utils.d.ts +19 -2
- package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-serialization.utils.js +4 -0
- package/dist/esm/resources/utils/resources-serialization.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 +15 -9
- package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
- package/dist/esm/resources/work-unit.shared.schemas.d.ts +20 -0
- package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -0
- package/dist/esm/resources/work-unit.shared.schemas.js +19 -0
- package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -0
- package/dist/esm/runtime/execution-context.shared.schemas.d.ts +48 -1
- package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/execution-context.shared.schemas.js +101 -9
- package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts +1 -0
- 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 +37 -20
- 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 +1 -0
- 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 +61 -48
- 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 +26 -0
- 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 +39 -5
- package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +5 -3
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +6 -0
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js +2 -2
- 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 +11 -0
- 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 +19 -8
- 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 +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +5 -5
- 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.js +11 -11
- 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 +2 -0
- 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 +9 -0
- 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 +169 -0
- package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js +162 -0
- package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -0
- 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 +10 -8
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js +8 -8
- 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 +17 -16
- 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 +28 -25
- 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 +17 -6
- 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 +90 -38
- 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 +0 -24
- 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 +79 -68
- 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 +8 -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 +7 -0
- 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.js +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +7 -7
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.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 +56 -0
- package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +77 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js +90 -0
- package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts +86 -0
- package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js +40 -0
- package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -0
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +2 -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 +2 -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 +2 -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 +2 -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 +46 -14
- 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 +81 -21
- 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 +69 -0
- package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -0
- package/dist/esm/security/credential-rotation-grace.shared.utils.js +77 -0
- package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -0
- 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 +28 -8
- 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 +3 -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 +89 -14
- 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 +1 -0
- 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 +25 -4
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
- package/dist/esm/security/outbound-target-control.shared.schemas.d.ts +7 -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 +6 -0
- package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
- package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts +143 -0
- package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -0
- package/dist/esm/security/submission-challenge/submission-challenge.shared.js +123 -0
- package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts +384 -0
- package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js +327 -0
- package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts +121 -8
- 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 +83 -4
- 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-error-codes.shared.d.ts +266 -8
- 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 +291 -7
- 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 +313 -3
- 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 +369 -3
- 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 +2 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts +5 -3
- 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 +19 -10
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.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 +6 -0
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-preferences-reset.shared.utils.js +2 -2
- 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 +0 -3
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +0 -3
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self.shared.resources-config.schemas.js +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 +82 -20
- package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.schemas.d.ts +12 -9
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js +49 -18
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/package.json +4 -4
- package/dist/esm/compliance/privacy/data-retention.shared.schemas.js +0 -7
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -51,7 +51,7 @@ export var ProviderCredentialValidationState;
|
|
|
51
51
|
* Why a write door refused to store a credential VALUE under the slot it named — the stable,
|
|
52
52
|
* client-branchable `code` every door carries (#624).
|
|
53
53
|
*
|
|
54
|
-
* A stored row is keyed `(owner,
|
|
54
|
+
* A stored row is keyed `(owner, connectionRef, secretSlug)` on the provider's secrets-contract KEY, and
|
|
55
55
|
* every reader asks for that key. A value written under any other name is a secret nothing can ever
|
|
56
56
|
* read, and before these refusals the write reported success — which is how a regenerated provider,
|
|
57
57
|
* a free-text slug or a test script produced rows that looked connected and resolved as absent.
|
|
@@ -74,9 +74,9 @@ export var ProviderCredentialSlotWriteRefusal;
|
|
|
74
74
|
*/
|
|
75
75
|
ProviderCredentialSlotWriteRefusal["SECRET_SLUG_NOT_A_CREDENTIAL"] = "SECRET_SLUG_NOT_A_CREDENTIAL";
|
|
76
76
|
/**
|
|
77
|
-
* An UPDATE named a different `providerRef` or `secretSlug` for an existing row. The sealed
|
|
78
|
-
* bound to
|
|
79
|
-
* deleted.
|
|
77
|
+
* An UPDATE named a different `providerRef`, `connectionRef` or `secretSlug` for an existing row. The sealed
|
|
78
|
+
* value is bound to the connection and the slot, and `providerRef` records which ref created the row, so a row
|
|
79
|
+
* cannot move: a credential for another slot or connection is a new row, and the old one is deleted.
|
|
80
80
|
*/
|
|
81
81
|
ProviderCredentialSlotWriteRefusal["CREDENTIAL_SLOT_IMMUTABLE"] = "CREDENTIAL_SLOT_IMMUTABLE";
|
|
82
82
|
})(ProviderCredentialSlotWriteRefusal || (ProviderCredentialSlotWriteRefusal = {}));
|
|
@@ -98,8 +98,8 @@ export var ProviderConnectionFactProvenance;
|
|
|
98
98
|
})(ProviderConnectionFactProvenance || (ProviderConnectionFactProvenance = {}));
|
|
99
99
|
/** One value in a credential row's `connectionFacts`. */
|
|
100
100
|
export const ProviderConnectionFactSchema = z.strictObject({
|
|
101
|
-
value: z.string(),
|
|
102
|
-
provenance: z.enum(ProviderConnectionFactProvenance),
|
|
101
|
+
value: z.string().describe("The fact's value, such as a tenant id or an instance URL."),
|
|
102
|
+
provenance: z.enum(ProviderConnectionFactProvenance).describe("Where the value came from: `ANSWERED_AT_CONNECT` was entered by the person connecting and changes only when they reconnect or re-enter the credential; `REPORTED_BY_VENDOR` came from the vendor's token response and may change at a token refresh."),
|
|
103
103
|
});
|
|
104
104
|
/**
|
|
105
105
|
* WHERE a resolved provider secret came from.
|
|
@@ -244,19 +244,27 @@ export var ProviderCredentialDeletionReason;
|
|
|
244
244
|
ProviderCredentialDeletionReason["USER_DELETED"] = "user_deleted";
|
|
245
245
|
})(ProviderCredentialDeletionReason || (ProviderCredentialDeletionReason = {}));
|
|
246
246
|
/**
|
|
247
|
-
* The fields that IDENTIFY a credential within its tenant
|
|
248
|
-
*
|
|
249
|
-
* One tenant holds at most one credential per (
|
|
250
|
-
* the
|
|
251
|
-
*
|
|
247
|
+
* The fields that IDENTIFY a credential within its tenant: `(organizationId, connectionRef, secretSlug)`.
|
|
248
|
+
*
|
|
249
|
+
* One tenant holds at most one credential per (CONNECTION, slug) — not per provider ref (#1670). A
|
|
250
|
+
* connection is the unit a vendor grant belongs to: by default every provider ref is its own connection
|
|
251
|
+
* (`connectionRef` = `providerRef`), and a vendor served by several refs (an engine part plus add-on
|
|
252
|
+
* packages) can hold ONE grant that all of them spend. Keying on the ref made that impossible — two refs
|
|
253
|
+
* of one vendor could never share a stored credential, whatever the client side did.
|
|
254
|
+
*
|
|
255
|
+
* Exported rather than repeated so the uniqueness contract, the resolver's lookup and the tests cannot
|
|
256
|
+
* drift apart — three copies of a compound key is how two of them come to disagree about what identity
|
|
257
|
+
* means. The sealed value binds the same three components (the connection, never the ref), so a row's
|
|
258
|
+
* key and its seal always name one identity.
|
|
252
259
|
*/
|
|
253
260
|
export const ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [
|
|
254
261
|
'organizationId',
|
|
255
|
-
'
|
|
262
|
+
'connectionRef',
|
|
256
263
|
'secretSlug',
|
|
257
264
|
];
|
|
265
|
+
/** @wildo_source:part:end saas.models.provider-credential-identity */
|
|
258
266
|
/**
|
|
259
|
-
* The organization's credential for one (
|
|
267
|
+
* The organization's credential for one (connection, secret slug) pair.
|
|
260
268
|
*
|
|
261
269
|
* ## The scope identifier is TOP-LEVEL and stays that way
|
|
262
270
|
*
|
|
@@ -280,8 +288,24 @@ export const OrganizationProviderCredentialSchema = z.object({
|
|
|
280
288
|
* ref). An OPEN string, matching `ProviderRef`'s own openness — the whole point of the provider
|
|
281
289
|
* work is that the set is not closed, so a closed enum here would refuse every generated
|
|
282
290
|
* provider.
|
|
291
|
+
*
|
|
292
|
+
* NOT the row's identity since #1670: it records which ref's connect flow (or write) CREATED the row,
|
|
293
|
+
* and `connectionRef` below is what the row is keyed and sealed on. A reconnect through another ref of
|
|
294
|
+
* the same connection replaces the value and leaves this unchanged.
|
|
283
295
|
*/
|
|
284
296
|
providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),
|
|
297
|
+
/**
|
|
298
|
+
* The CONNECTION this credential belongs to — the row's identity, where `providerRef` records only which
|
|
299
|
+
* ref's connect flow (or write) CREATED it (#1670).
|
|
300
|
+
*
|
|
301
|
+
* Derived by the server from `providerRef` through the provider registry's connection mapping, never
|
|
302
|
+
* supplied by a client: `.excludeFromCreate()` because a caller naming a connection would choose which
|
|
303
|
+
* grant its value lands beside, and `.excludeFromUpdate()` because the sealed value binds it — a row
|
|
304
|
+
* cannot move to another connection, only be replaced (`CREDENTIAL_SLOT_IMMUTABLE`). Every ref is its own
|
|
305
|
+
* connection until an application declares otherwise (#1725), so today it always equals `providerRef`,
|
|
306
|
+
* and every row stored before the field existed was backfilled to exactly that.
|
|
307
|
+
*/
|
|
308
|
+
connectionRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),
|
|
285
309
|
/**
|
|
286
310
|
* The provider's `secretsContract` KEY this value satisfies (`accessToken`, `clientSecret`) —
|
|
287
311
|
* NOT the slot's env-var spelling (`ASANA_ACCESS_TOKEN`), which is what the deployment's env
|
|
@@ -312,11 +336,18 @@ export const OrganizationProviderCredentialSchema = z.object({
|
|
|
312
336
|
* which matters during an incident, where deleting is not reversible and disabling is.
|
|
313
337
|
*/
|
|
314
338
|
enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),
|
|
339
|
+
/**
|
|
340
|
+
* What the last USE of this credential proved — written only by the credential store after a provider accepted
|
|
341
|
+
* or rejected it (#1809). Excluded from create and update like its three siblings, so the owner cannot declare a
|
|
342
|
+
* credential VALID that no provider ever accepted, or clear an INVALID the resolver recorded.
|
|
343
|
+
*/
|
|
315
344
|
validationState: z
|
|
316
345
|
.enum(ProviderCredentialValidationState)
|
|
317
346
|
.default(ProviderCredentialValidationState.UNVALIDATED)
|
|
318
347
|
.isDBIndexed()
|
|
319
|
-
.isSummaryField()
|
|
348
|
+
.isSummaryField()
|
|
349
|
+
.excludeFromCreate()
|
|
350
|
+
.excludeFromUpdate(),
|
|
320
351
|
/**
|
|
321
352
|
* Why the last use failed, when it did. PROVIDER-supplied text about the CREDENTIAL's status —
|
|
322
353
|
* never the credential. A resolver writing anything derived from `secretValue` here would defeat
|
|
@@ -366,7 +397,7 @@ export const OrganizationProviderCredentialSchema = z.object({
|
|
|
366
397
|
updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),
|
|
367
398
|
})
|
|
368
399
|
/**
|
|
369
|
-
* One credential per tenant per (
|
|
400
|
+
* One credential per tenant per (connection, slug), enforced by a compound UNIQUE index rather
|
|
370
401
|
* than by a read-then-write.
|
|
371
402
|
*
|
|
372
403
|
* The race it closes is not academic: two administrators saving a rotated Slack token in the
|
|
@@ -382,8 +413,10 @@ export const OrganizationProviderCredentialSchema = z.object({
|
|
|
382
413
|
// =============================================================================
|
|
383
414
|
// USER-OWNED CREDENTIALS
|
|
384
415
|
// =============================================================================
|
|
416
|
+
/** @wildo_source:part:start saas.models.provider-credential-identity facet:layer:shared facet:audience:app-developer */
|
|
385
417
|
/**
|
|
386
|
-
* The fields that IDENTIFY a credential within its OWNER
|
|
418
|
+
* The fields that IDENTIFY a credential within its OWNER: `(userId, connectionRef, secretSlug)` — keyed on
|
|
419
|
+
* the CONNECTION, never the provider ref, as the organization-owned sibling explains (#1670).
|
|
387
420
|
*
|
|
388
421
|
* Exported per owner rather than shared, because the compound key differs in its first component and
|
|
389
422
|
* a single constant would have to be assembled by each side — which is how two copies of a key come
|
|
@@ -391,9 +424,10 @@ export const OrganizationProviderCredentialSchema = z.object({
|
|
|
391
424
|
*/
|
|
392
425
|
export const USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [
|
|
393
426
|
'userId',
|
|
394
|
-
'
|
|
427
|
+
'connectionRef',
|
|
395
428
|
'secretSlug',
|
|
396
429
|
];
|
|
430
|
+
/** @wildo_source:part:end saas.models.provider-credential-identity */
|
|
397
431
|
/**
|
|
398
432
|
* A PERSON's own credential toward a third party — the key they authored for themselves.
|
|
399
433
|
*
|
|
@@ -430,8 +464,16 @@ export const UserProviderCredentialSchema = z.object({
|
|
|
430
464
|
* sibling relies on, which is what makes "another user's key" unreachable rather than filtered.
|
|
431
465
|
*/
|
|
432
466
|
userId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),
|
|
433
|
-
/**
|
|
467
|
+
/**
|
|
468
|
+
* As the organization-owned sibling: an OPEN string, because the provider set is not closed. Records which
|
|
469
|
+
* ref's connect flow (or write) CREATED the row; the row's identity is `connectionRef` (#1670).
|
|
470
|
+
*/
|
|
434
471
|
providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),
|
|
472
|
+
/**
|
|
473
|
+
* The CONNECTION this credential belongs to — the row's identity (#1670). Server-derived from `providerRef`,
|
|
474
|
+
* never client-supplied, and immutable because the seal binds it; see the organization-owned sibling.
|
|
475
|
+
*/
|
|
476
|
+
connectionRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),
|
|
435
477
|
/** The provider's `secretsContract` KEY this value satisfies — never the env-var spelling, as the
|
|
436
478
|
* sibling explains (#624). Immutable, for the same reason as the sibling: re-pointing a stored secret
|
|
437
479
|
* at a different slug would hand one vendor credential to a different vendor field. */
|
|
@@ -445,11 +487,18 @@ export const UserProviderCredentialSchema = z.object({
|
|
|
445
487
|
*/
|
|
446
488
|
secretValue: z.string().min(1).isWriteOnlySecret(),
|
|
447
489
|
enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),
|
|
490
|
+
/**
|
|
491
|
+
* What the last USE of this credential proved — written only by the credential store after a provider accepted
|
|
492
|
+
* or rejected it (#1809). Excluded from create and update like its three siblings, so the owner cannot declare a
|
|
493
|
+
* credential VALID that no provider ever accepted, or clear an INVALID the resolver recorded.
|
|
494
|
+
*/
|
|
448
495
|
validationState: z
|
|
449
496
|
.enum(ProviderCredentialValidationState)
|
|
450
497
|
.default(ProviderCredentialValidationState.UNVALIDATED)
|
|
451
498
|
.isDBIndexed()
|
|
452
|
-
.isSummaryField()
|
|
499
|
+
.isSummaryField()
|
|
500
|
+
.excludeFromCreate()
|
|
501
|
+
.excludeFromUpdate(),
|
|
453
502
|
/** Why the last use failed. PROVIDER text about the CREDENTIAL, never anything derived from it —
|
|
454
503
|
* this field IS client-readable. */
|
|
455
504
|
validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),
|
|
@@ -486,7 +535,7 @@ export const UserProviderCredentialSchema = z.object({
|
|
|
486
535
|
updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),
|
|
487
536
|
})
|
|
488
537
|
/**
|
|
489
|
-
* One credential per person per (
|
|
538
|
+
* One credential per person per (connection, slug), enforced by a compound UNIQUE index rather than
|
|
490
539
|
* a read-then-write — the same race the organization-owned sibling closes, and for the same
|
|
491
540
|
* reason: two rows would leave the resolver picking one arbitrarily, so half the holder's outbound
|
|
492
541
|
* calls would carry a rotated-away credential and nothing would say which half.
|
|
@@ -500,7 +549,7 @@ export const UserProviderCredentialSchema = z.object({
|
|
|
500
549
|
//
|
|
501
550
|
// ## Why the same rows rather than a third resource
|
|
502
551
|
//
|
|
503
|
-
// The identity is the same triple (owner,
|
|
552
|
+
// The identity is the same triple (owner, connectionRef, secretSlug), the ownership semantics are the
|
|
504
553
|
// same, the authorization is the same, the erasure is the same, and the resolver already routes by
|
|
505
554
|
// scope. Only the PAYLOAD differs. A separate resource would duplicate every one of those and force
|
|
506
555
|
// each consumer to ask "which store?" before it could ask anything useful.
|
|
@@ -650,6 +699,17 @@ export const ProviderOAuth2GrantSchema = z.object({
|
|
|
650
699
|
* answer for anyone who has two.
|
|
651
700
|
*/
|
|
652
701
|
accountRef: z.string().optional(),
|
|
702
|
+
/**
|
|
703
|
+
* An identifier minted when the person AUTHORIZES — at the code exchange — and carried unchanged through every
|
|
704
|
+
* renewal (#1725). A reconnect mints a new one.
|
|
705
|
+
*
|
|
706
|
+
* It is what a cached token of another resource audience is bound to: a Dataverse token minted from this grant's
|
|
707
|
+
* refresh token belongs to THIS authorization, and a reconnect — possibly to a different Microsoft account, on the
|
|
708
|
+
* same row — must never be answered from the previous authorization's cache. The row's id cannot do this (a
|
|
709
|
+
* reconnect updates the row in place) and the refresh token cannot either (Microsoft replaces it on every use).
|
|
710
|
+
* Absent on a grant stored before #1725, which then binds its cache entries to the row instead.
|
|
711
|
+
*/
|
|
712
|
+
grantId: z.string().min(1).optional(),
|
|
653
713
|
});
|
|
654
714
|
/**
|
|
655
715
|
* The marker that opens the sealed plaintext of a grant rather than a pasted credential.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-credentials.shared.schemas.js","sourceRoot":"","sources":["../../../../../src/security/connected-accounts/provider-credentials.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,iCAOX;AAPD,WAAY,iCAAiC;IAC3C,0FAA0F;IAC1F,gEAA2B,CAAA;IAC3B,gDAAgD;IAChD,oDAAe,CAAA;IACf,8EAA8E;IAC9E,wDAAmB,CAAA;AACrB,CAAC,EAPW,iCAAiC,KAAjC,iCAAiC,QAO5C;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,kCAmBX;AAnBD,WAAY,kCAAkC;IAC5C;;;;;OAKG;IACH,2FAAqD,CAAA;IACrD;;;OAGG;IACH,mGAA6D,CAAA;IAC7D;;;;OAIG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AAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,iGAAiG;cAC/F,oFAAoF,CACvF,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,yBAAyB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,gGAAgG;cAC9F,yFAAyF;cACzF,qCAAqC,CACxC,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,CAAC;AAEvD,MAAM,UAAU,+BAA+B,CAAC,KAA0B,EAAE,MAAY,IAAI,IAAI,EAAE;IAChG,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,oCAAoC,GAAG,IAAI,CAAC;AAC/E,CAAC","sourcesContent":["/**\n * Organization Provider Credentials — shared schemas.\n *\n * ## What this resource is, and what it is NOT\n *\n * It is an ORGANIZATION's OWN credential toward a third party: the Slack workspace token, the CRM\n * API key, the SMTP password that belongs to THAT tenant. The organization is the third-party\n * principal, and the credential is a service credential the tenant's administrator supplies.\n *\n * It is NOT a user's delegated OAuth grant. A delegated grant is a different object with a\n * different lifetime (a refresh loop, a revocation the USER can perform, a consent record) and it\n * lands as `connected accounts` beside this file — see issue #333. Merging the two would give one\n * row two owners and two revocation semantics.\n *\n * ## Why it has to exist\n *\n * Before this resource, every provider secret resolved from `process.env` through the\n * `SecretsContract`, so a credential was per-PROCESS and per-DEPLOYMENT. One application serving\n * many organizations therefore had ONE Slack token for all of them, and the failure was silent in\n * the worst direction: an operator sets one key and every tenant thereafter acts as the SAME\n * third-party principal, with nothing anywhere saying so.\n *\n * ## The value is sealed, and this file is where that is stated\n *\n * `secretValue` holds an AES-256-GCM envelope, never the plaintext an operator typed. The seal is\n * applied on the way in and opened only by the resolver — see\n * `provider-credential-envelope.backend.utils.ts` for its key domains and binding, over the shared\n * `bound-secret-envelope` core that does the sealing (#366). The\n * schema cannot enforce that (a string is a string), so the write path is what guarantees it and\n * the pins are what keep it guaranteed.\n */\n\nimport { z } from 'zod';\n\n/**\n * Whether the stored credential has been shown to work against the provider.\n *\n * A closed vocabulary rather than a boolean because \"we have never tried\" and \"we tried and it\n * failed\" are different states with different operator actions, and a boolean would merge them\n * into the same falsy answer. `UNVALIDATED` is the honest default: storing a credential proves\n * only that somebody typed one.\n */\nexport enum ProviderCredentialValidationState {\n /** Stored, never exercised against the provider. The state every credential starts in. */\n UNVALIDATED = 'unvalidated',\n /** The provider accepted it on its last use. */\n VALID = 'valid',\n /** The provider rejected it on its last use — the operator must rotate it. */\n INVALID = 'invalid',\n}\n\n/**\n * Why a write door refused to store a credential VALUE under the slot it named — the stable,\n * client-branchable `code` every door carries (#624).\n *\n * A stored row is keyed `(owner, providerRef, secretSlug)` on the provider's secrets-contract KEY, and\n * every reader asks for that key. A value written under any other name is a secret nothing can ever\n * read, and before these refusals the write reported success — which is how a regenerated provider,\n * a free-text slug or a test script produced rows that looked connected and resolved as absent.\n *\n * The member values are the wire codes the connect leg already answered with, so one vocabulary\n * serves the connect leg, the resource's own CREATE / UPDATE doors and any client that branches.\n */\nexport enum ProviderCredentialSlotWriteRefusal {\n /**\n * The provider's current secrets contract declares no slot by that name — under either of a slot's\n * two names. Also the answer for a provider that is not registered at all, and for ROTATING a value\n * into an existing row whose stored name is not a contract KEY — a retired name, or a spelling no\n * reader asks for: a fresh secret sealed there is as unreadable as the old one.\n */\n SECRET_SLUG_NOT_DECLARED = 'SECRET_SLUG_NOT_DECLARED',\n /**\n * The slot exists but holds the APPLICATION's own registration (an OAuth2 client id or secret),\n * which is authored in the deployment environment and never read from a credential row.\n */\n SECRET_SLUG_NOT_A_CREDENTIAL = 'SECRET_SLUG_NOT_A_CREDENTIAL',\n /**\n * An UPDATE named a different `providerRef` or `secretSlug` for an existing row. The sealed value is\n * bound to both, so a row cannot move: a credential for another slot is a new row, and the old one is\n * deleted.\n */\n CREDENTIAL_SLOT_IMMUTABLE = 'CREDENTIAL_SLOT_IMMUTABLE',\n}\n\n/**\n * How one connection fact got onto a credential row (#333, #1047). The distinction is what decides who may\n * change it: an answer changes only when the person reconnects, a vendor report whenever the vendor\n * reports it again.\n */\nexport enum ProviderConnectionFactProvenance {\n /**\n * Typed by the person connecting, for an endpoint or scope `{placeholder}` at the OAuth2 start — or, for a\n * vendor whose credential is PASTED, for a `{placeholder}` of the REST base URL at the typed-credential store\n * (#1097). Replaced only by reconnecting or re-entering the credential.\n */\n ANSWERED_AT_CONNECT = 'ANSWERED_AT_CONNECT',\n /** Reported by the vendor in its token answer, at the authorization or at a refresh. A refresh may move it. */\n REPORTED_BY_VENDOR = 'REPORTED_BY_VENDOR',\n}\n\n/** One value in a credential row's `connectionFacts`. */\nexport const ProviderConnectionFactSchema = z.strictObject({\n value: z.string(),\n provenance: z.enum(ProviderConnectionFactProvenance),\n});\n\nexport type ProviderConnectionFact = z.infer<typeof ProviderConnectionFactSchema>;\n\n/** A credential row's facts, keyed by fact name. */\nexport type ProviderConnectionFacts = Readonly<Record<string, ProviderConnectionFact>>;\n\n/**\n * WHERE a resolved provider secret came from.\n *\n * The whole point of this slice is that the answer used to be unanswerable: every secret came from\n * `process.env`, so \"which principal did this tenant act as?\" had one answer for every tenant and\n * nothing recorded it. Making the source an explicit, closed value means an audit reader can see a\n * tenant falling back to the shared deployment credential — the exact condition the resource exists\n * to make visible — instead of having to infer it from an absence.\n */\nexport enum ProviderCredentialResolutionSource {\n /** The organization's own credential row. The tenant acted as itself. */\n ORGANIZATION_CREDENTIAL = 'organization_credential',\n /**\n * The deployment's env-projected `SecretsContract`. Legitimate — a single-tenant deployment, or a\n * provider the operator intends every tenant to share — but never silent.\n */\n DEPLOYMENT_ENVIRONMENT = 'deployment_environment',\n /**\n * A PERSON's own credential row. The application acted as that individual.\n *\n * This member has no sibling fallback, and that asymmetry is deliberate rather than an omission.\n * An organization with no credential of its own may legitimately fall through to the deployment's\n * — an operator can intend every tenant to share one integration. A person cannot: the vendor\n * attributes the act to whoever's token was spent, so acting for someone under the deployment's\n * principal would put the wrong name on the record that outlives us. A person who has connected\n * nothing gets a refusal, not a substitute.\n */\n USER_CREDENTIAL = 'user_credential',\n}\n\n/**\n * What telling the VENDOR achieved when a credential was removed (#545).\n *\n * A separate axis from {@link ProviderCredentialDeletionReason} on purpose: that one says why OUR\n * COPY stopped existing, this one says whether the authorization itself was withdrawn where it\n * lives. They were one question for as long as the answer was always \"it was not\".\n *\n * Every member is EVIDENCE, and none of them is control flow — the local delete proceeds whatever\n * this says, because a vendor being unreachable must not stop somebody disconnecting.\n */\nexport enum ProviderOAuth2RevocationOutcome {\n /**\n * The vendor answered 200.\n *\n * Under RFC 7009 that also covers a token the server did not recognise, which is the intended\n * reading: the grant is gone either way.\n * spec-cite: RFC 7009 §2.2 — *\"The authorization server responds with HTTP status code 200 if the\n * token has been revoked successfully or if the client submitted an invalid token\"*.\n */\n REVOKED = 'revoked',\n /**\n * Nothing was sent, and that is the ordinary case rather than a failure.\n *\n * Three situations share this member because they are one fact from the person's side — the vendor\n * was not told: the provider declares no `rfc7009RevocationUrl`; the credential was a PASTED\n * long-lived key rather than a grant, so there is nothing to revoke; or the grant carried no token.\n */\n NOT_DECLARED = 'not_declared',\n /** The application's own client registration for this vendor is unset, so nothing could be sent. */\n NOT_CONFIGURED = 'not_configured',\n /** The endpoint could not be reached, or did not answer within the deadline. */\n UNREACHABLE = 'unreachable',\n /** The endpoint answered, and not with 200. */\n REFUSED = 'refused',\n}\n\n/** The wire values of {@link ProviderOAuth2RevocationOutcome}, for a Zod enum over them. */\nexport const ProviderOAuth2RevocationOutcomeValues = ProviderOAuth2RevocationOutcome;\n\n/**\n * Why a credential row stopped existing.\n *\n * ## Every member describes OUR COPY; whether the VENDOR was told is a SECOND axis (#545)\n *\n * Removing a credential deletes the token Wildo holds. Until 2026-09-18 it also did nothing else,\n * so the GRANT survived at the vendor: the person's connected-accounts screen showed the application\n * gone while Asana or Google still listed it as authorized, and a stored refresh token remained\n * valid until it expired on the vendor's schedule — which, for a refresh token, is frequently never.\n *\n * That is stated HERE because this vocabulary is what an operator points at when asked whether an\n * erasure reached someone's third-party credentials, and silence on a compliance surface reads as\n * \"done\".\n *\n * **It is no longer silent.** Both deletion events now carry\n * {@link ProviderOAuth2RevocationOutcome}, so the trail answers the vendor question separately from\n * the local one. What that outcome can SAY still depends on the vendor: RFC 7009 is the only\n * revocation standard and the vendors do not agree with it, so `google-drive` and `asana` declare an\n * endpoint and are told, while Slack's `auth.revoke` (a Web API method) and GitHub's\n * `DELETE /applications/{client_id}/token` (basic auth, JSON body) are not expressible as one and\n * record `not_declared` rather than implying they were reached.\n *\n * An earlier revision of this block argued the mechanism should NOT be built, because *\"no\n * admissible provider declares one today, so the field would ship inert\"*. That was true when it was\n * written and stopped being true when `google-drive` gained an admissible USER connection: Google's\n * `https://oauth2.googleapis.com/revoke` is RFC 7009-conformant, so the mechanism has a reachable\n * user and a proven vendor. Kept as history rather than deleted, because the reasoning was sound and\n * the thing that changed was the world, not the argument.\n */\nexport enum ProviderCredentialDeletionReason {\n /** An administrator of the owning tenant removed it. */\n ADMINISTRATOR_REVOKED = 'administrator_revoked',\n /** The owning organization was purged and the composition cascade removed it with the tenant. */\n ORGANIZATION_PURGED = 'organization_purged',\n /** The person whose credential it was removed it themselves. */\n OWNER_REVOKED = 'owner_revoked',\n /**\n * The owning user was erased and the composition cascade destroyed it with them.\n *\n * Distinct from `ORGANIZATION_PURGED` because this one is EVIDENCE: it is what an operator points\n * at when asked whether a subject-erasure request reached the person's third-party credentials.\n * Collapsing the two into a generic \"cascade\" would make that question unanswerable from the trail.\n *\n * **Who sets it:** the cascade observer, for a cascade declaring itself a `SUBJECT_ERASURE`. The record\n * carries `deletedBy` = whoever EXECUTED the erasure (a person's id when one was carried on the erasure's\n * context, else the `SYSTEM` sentinel), so the erased person is the record's SUBJECT and never its actor\n * (#1088).\n */\n USER_ERASED = 'user_erased',\n /**\n * The owning user ROW was deleted outright and the composition cascade destroyed the credential with it (#1016).\n *\n * **Who sets it:** the user-credential parent-cascade removal observer\n * (`registerUserProviderCredentialCascadeEvidence`), for a cascade that declares its cause as an ordinary parent\n * delete of the `users` row. Two doors reach it today: an administrator's hard `DELETE` (`deletedBy` is that\n * administrator), and the organization-member invitation sweep reaping an orphaned pending user under an internal\n * context (`deletedBy` is the `SYSTEM` sentinel). The record carries `deletedBy`, resolved from the deleting\n * execution context, so it names the principal who deleted the account rather than the person whose credential\n * it was.\n *\n * **Distinct from `USER_ERASED`**, and the distinction is the reason this member exists: an erasure answers a\n * data-subject request, keeps the person's row scrubbed and is evidence that the request reached their third-party\n * credentials. A deletion asserts no such request. Recording it as `USER_ERASED` would forge erasure evidence;\n * recording nothing left an account deletion that destroyed OAuth grants and API keys with no row naming them.\n *\n * **Distinct from `ORGANIZATION_PURGED`**: that is a tenant teardown removing the ORGANIZATION's credentials. This\n * removes one PERSON's own credentials, which no organization owns.\n *\n * Named for what happened to the owner, not for who did it: the cascade cannot tell an administrator's delete from\n * any other deletion of the row, and `deletedBy` is where the actor is stated.\n */\n USER_DELETED = 'user_deleted',\n}\n\n/**\n * The fields that IDENTIFY a credential within its tenant.\n *\n * One tenant holds at most one credential per (provider, slug). Exported rather than repeated so\n * the uniqueness contract, the resolver's lookup and the tests cannot drift apart — three copies\n * of a compound key is how two of them come to disagree about what identity means.\n */\nexport const ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [\n 'organizationId',\n 'providerRef',\n 'secretSlug',\n] as const;\n\n/**\n * The organization's credential for one (provider, secret slug) pair.\n *\n * ## The scope identifier is TOP-LEVEL and stays that way\n *\n * `organizationId` is the only `organizationId`-named path in this schema, and nothing nested may\n * ever be named `organizationId` or `userId`. `buildContextualFilter` injects the scope FK by\n * matching that field name at EVERY schema path, so a nested key of the same name adds a phantom\n * exact-subdocument clause and the scoped read silently matches zero rows — a credential that\n * exists and cannot be resolved, which reads exactly like a credential that was never set.\n * `setByUserId` is deliberately spelled so it cannot be caught by that matcher.\n */\nexport const OrganizationProviderCredentialSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The tenant that owns this credential. Injected by the context machinery from the request\n * scope, never from a caller-supplied field — which is what makes the isolation structural\n * rather than a filter somebody has to remember to write.\n */\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n /**\n * The provider this credential authenticates toward (`slack`, `stripe`, a generated package's\n * ref). An OPEN string, matching `ProviderRef`'s own openness — the whole point of the provider\n * work is that the set is not closed, so a closed enum here would refuse every generated\n * provider.\n */\n providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The provider's `secretsContract` KEY this value satisfies (`accessToken`, `clientSecret`) —\n * NOT the slot's env-var spelling (`ASANA_ACCESS_TOKEN`), which is what the deployment's env\n * projection carries and what a provider regeneration may rename. The two resolution places name\n * the same SLOT by different names, and only the key is stable enough to key a durable row on\n * (#624). Immutable: re-pointing a stored secret at a different slug would silently hand one vendor\n * credential to a different vendor field — and the sealed value binds the slug, so a row stored\n * under a name the provider no longer declares cannot be renamed, only replaced by reconnecting.\n */\n secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The credential, SEALED.\n *\n * `.isWriteOnlySecret()` is the framework's write-then-masked contract and is exactly right\n * here: the operator supplies and rotates the value, so it must stay in the CREATE/UPDATE\n * request DTO; the framework redacts it to a placeholder at the client boundary, so no read\n * ever returns it; and the backend keeps the stored content for its own resolution.\n *\n * `.isBackendOnly()` was rejected — it strips the field from the client DTO, so the operator's\n * typed value is dropped before it is ever stored and the surface silently accepts nothing.\n *\n * What is PERSISTED is the envelope, never the plaintext. The write path seals it; a value that\n * reaches persistence unsealed is a defect, not a tolerated legacy shape.\n */\n secretValue: z.string().min(1).isWriteOnlySecret(),\n\n /**\n * Whether this credential may be spent. An operator can park a credential without deleting it —\n * which matters during an incident, where deleting is not reversible and disabling is.\n */\n enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n validationState: z\n .enum(ProviderCredentialValidationState)\n .default(ProviderCredentialValidationState.UNVALIDATED)\n .isDBIndexed()\n .isSummaryField(),\n\n /**\n * Why the last use failed, when it did. PROVIDER-supplied text about the CREDENTIAL's status —\n * never the credential. A resolver writing anything derived from `secretValue` here would defeat\n * every other precaution in this file, because this field IS client-readable.\n */\n validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),\n\n lastValidatedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n lastUsedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /**\n * WHO set it — the acting user's id, recorded for the audit trail.\n *\n * Deliberately NOT a registered `USERS` relationship. Declaring that edge would put a CREDENTIAL\n * row on the Art. 15 subject-export graph, and a credential is precisely the class of row that\n * must never reach a data subject. The id is recorded because \"who set this\" is the first\n * question of any credential incident; the edge is withheld because the answer must not travel\n * with a subject export.\n */\n setByUserId: z.string().min(1).optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /** When the stored VALUE last changed — distinct from `updatedAt`, which any field write moves. */\n secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n\n /** Free-text operator note. Never a place for the value; enforced by the write-path pins. */\n /**\n * Every fact about the connected ACCOUNT, each value carrying how it got here — see\n * {@link ProviderConnectionFactProvenance} (#333, #1047).\n *\n * ONE record for two sources, by decision: the answers a person typed for the endpoints'\n * `{placeholder}` holes (which cloud, which directory, which region) — or, for a PASTED credential, for\n * the REST base URL's holes at the typed-credential store (#1097) — and the facts the vendor\n * reported in its token answer that operations consume (Salesforce's `instance_url`, Pipedrive's\n * `api_domain`). Two records would let an operation read one and a refresh update the other.\n *\n * On the ROW rather than only in the connect flow, because a REFRESH needs the answers again — a\n * templated token URL is still templated an hour later — and every CALL needs a reported origin.\n *\n * NOT secret, and deliberately client-readable: a tenant id or an instance URL is how a person\n * recognises which account they connected. The secret half is the grant, and it is sealed.\n *\n * `.excludeFromCreate().excludeFromUpdate()` — no CLIENT write may carry it, create included: the field holds\n * a provenance the resolver trusts, and a pasted-credential create that could type `REPORTED_BY_VENDOR` would\n * forge the one mark that decides where a request is sent (review F1). Answers change only by reconnecting, which REPLACES\n * the record with the grant; vendor-reported facts are also rewritten by a refresh that reports them\n * again. Both are server writes, allow-listed through `preserveServerInjectedFields`.\n */\n connectionFacts: z.record(z.string(), ProviderConnectionFactSchema).optional().excludeFromCreate().excludeFromUpdate(),\n\n\n description: z.string().max(500).optional(),\n\n createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n})\n /**\n * One credential per tenant per (provider, slug), enforced by a compound UNIQUE index rather\n * than by a read-then-write.\n *\n * The race it closes is not academic: two administrators saving a rotated Slack token in the\n * same minute would otherwise leave two rows, and the resolver would then pick one of them\n * arbitrarily — so half the tenant's outbound calls would carry the old credential and nobody\n * could tell which half.\n *\n * No `customMessageReference`: that option exists so an integrator can tell WHICH identity a\n * duplicate violated, and this resource declares exactly one. A dedicated reference here would\n * disambiguate nothing.\n */\n .businessKeySet([...ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS]);\n\nexport type OrganizationProviderCredential = z.infer<typeof OrganizationProviderCredentialSchema>;\n\n\n\n// =============================================================================\n// USER-OWNED CREDENTIALS\n// =============================================================================\n\n/**\n * The fields that IDENTIFY a credential within its OWNER.\n *\n * Exported per owner rather than shared, because the compound key differs in its first component and\n * a single constant would have to be assembled by each side — which is how two copies of a key come\n * to disagree about what identity means.\n */\nexport const USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [\n 'userId',\n 'providerRef',\n 'secretSlug',\n] as const;\n\n/**\n * A PERSON's own credential toward a third party — the key they authored for themselves.\n *\n * ## Why this is a separate resource and not a nullable column beside the organization's\n *\n * Wildo's tenancy is STRUCTURAL: the contextual filter injects the scope FK by matching a field name\n * at every schema path, so a resource belongs to exactly one primary scope. One table holding both a\n * nullable `organizationId` and a nullable `userId` would turn that structural guarantee into a\n * filter somebody has to remember to write, on the one resource where forgetting it discloses a\n * credential. Two resources, each scoped by construction, is the framework working as designed\n * rather than a duplication.\n *\n * ## Not a delegated OAuth grant, and the difference is not subtle\n *\n * This is a key the user PASTED: they hold an account with the vendor and chose to let this\n * application spend it. A delegated grant is the vendor minting a token because the user approved a\n * consent screen, and it carries a refresh loop, an expiry and a revocation the vendor also honours.\n * Merging them would give one row two lifecycles and two revocation semantics — see #333, which owns\n * the second.\n *\n * ## Only the holder may spend it\n *\n * Not an administrator of their organization, and not a platform operator. Consent to STORE a\n * personal key is not consent for somebody else to use it, and the vendor would record the act as\n * the holder's own. The authorization side of that is\n * `InitiatorMembershipConnectionTargetAuthorization`; this schema is what makes the row reachable\n * only through the owner's own scope.\n */\nexport const UserProviderCredentialSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The person who owns this credential. Injected by the context machinery from the authenticated\n * scope, never from a caller-supplied field — the same structural isolation the organization-owned\n * sibling relies on, which is what makes \"another user's key\" unreachable rather than filtered.\n */\n userId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n /** As the organization-owned sibling: an OPEN string, because the provider set is not closed. */\n providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /** The provider's `secretsContract` KEY this value satisfies — never the env-var spelling, as the\n * sibling explains (#624). Immutable, for the same reason as the sibling: re-pointing a stored secret\n * at a different slug would hand one vendor credential to a different vendor field. */\n secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The credential, SEALED — an AES-256-GCM envelope bound to this row's identity, never plaintext.\n *\n * `.isWriteOnlySecret()` for the same reason as the sibling: the holder supplies and rotates it, so\n * it must survive into the CREATE/UPDATE request DTO, and the framework masks it at the client\n * boundary so no read ever returns it.\n */\n secretValue: z.string().min(1).isWriteOnlySecret(),\n\n enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n validationState: z\n .enum(ProviderCredentialValidationState)\n .default(ProviderCredentialValidationState.UNVALIDATED)\n .isDBIndexed()\n .isSummaryField(),\n\n /** Why the last use failed. PROVIDER text about the CREDENTIAL, never anything derived from it —\n * this field IS client-readable. */\n validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),\n\n lastValidatedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n lastUsedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /** When the stored VALUE last changed — distinct from `updatedAt`, which any field write moves. */\n secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n\n /** The holder's own note. Never a place for the value; enforced by the write-path pins. */\n /**\n * Every fact about the connected ACCOUNT, each value carrying how it got here — see\n * {@link ProviderConnectionFactProvenance} (#333, #1047).\n *\n * ONE record for two sources, by decision: the answers a person typed for the endpoints'\n * `{placeholder}` holes (which cloud, which directory, which region) — or, for a PASTED credential, for\n * the REST base URL's holes at the typed-credential store (#1097) — and the facts the vendor\n * reported in its token answer that operations consume (Salesforce's `instance_url`, Pipedrive's\n * `api_domain`). Two records would let an operation read one and a refresh update the other.\n *\n * On the ROW rather than only in the connect flow, because a REFRESH needs the answers again — a\n * templated token URL is still templated an hour later — and every CALL needs a reported origin.\n *\n * NOT secret, and deliberately client-readable: a tenant id or an instance URL is how a person\n * recognises which account they connected. The secret half is the grant, and it is sealed.\n *\n * `.excludeFromCreate().excludeFromUpdate()` — no CLIENT write may carry it, create included: the field holds\n * a provenance the resolver trusts, and a pasted-credential create that could type `REPORTED_BY_VENDOR` would\n * forge the one mark that decides where a request is sent (review F1). Answers change only by reconnecting, which REPLACES\n * the record with the grant; vendor-reported facts are also rewritten by a refresh that reports them\n * again. Both are server writes, allow-listed through `preserveServerInjectedFields`.\n */\n connectionFacts: z.record(z.string(), ProviderConnectionFactSchema).optional().excludeFromCreate().excludeFromUpdate(),\n\n\n description: z.string().max(500).optional(),\n\n createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n})\n /**\n * One credential per person per (provider, slug), enforced by a compound UNIQUE index rather than\n * a read-then-write — the same race the organization-owned sibling closes, and for the same\n * reason: two rows would leave the resolver picking one arbitrarily, so half the holder's outbound\n * calls would carry a rotated-away credential and nothing would say which half.\n */\n .businessKeySet([...USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS]);\n\nexport type UserProviderCredential = z.infer<typeof UserProviderCredentialSchema>;\n\n\n// ══════════════════════════════════════════════════════════════════════════════════════════════\n// OAUTH2 GRANTS\n//\n// A credential a vendor MINTS rather than one a person pastes. It rides in the same `secretValue`\n// field of the same two resources — sealed, as JSON — and that reuse is deliberate.\n//\n// ## Why the same rows rather than a third resource\n//\n// The identity is the same triple (owner, providerRef, secretSlug), the ownership semantics are the\n// same, the authorization is the same, the erasure is the same, and the resolver already routes by\n// scope. Only the PAYLOAD differs. A separate resource would duplicate every one of those and force\n// each consumer to ask \"which store?\" before it could ask anything useful.\n//\n// Note this is the OPPOSITE call from the one that split USER from ORGANIZATION, and the difference\n// is what makes both right: there the TENANCY differed, and tenancy in this framework is structural\n// — one table with a nullable owner would turn a structural guarantee into a filter somebody must\n// remember to write. Here nothing about ownership changes; a string becomes an object.\n// ══════════════════════════════════════════════════════════════════════════════════════════════\n\n/**\n * What an authorization exchange gives back, as it is stored.\n *\n * Sealed as JSON into `secretValue`, so `.isWriteOnlySecret()` keeps masking it at the client\n * boundary and the envelope keeps binding it to its row — both mechanisms work on a string and\n * neither needs to know the string is structured.\n */\n/**\n * What SHAPE a sealed credential holds, once opened.\n *\n * One member today and a named vocabulary anyway, because the day a second sealed payload exists —\n * a service-account key, a signed JWT assertion — the discriminant is what tells them apart, and a\n * bare literal is where per-member explanation cannot live. It is also the value a reader needs to\n * understand `PROVIDER_OAUTH2_GRANT_PREFIX`: the prefix is how the shape is recognised WITHOUT\n * parsing, and this is what it recognises.\n */\n/**\n * Why a provider cannot be connected HERE, even though the vendor is in the catalogue.\n *\n * \"Connectable\" is a property of the DEPLOYMENT and not of the vendor, and conflating the two put a\n * Connect button on a screen that could only ever fail. Asana supports OAuth2 perfectly well; this\n * application has simply never registered with Asana, and no amount of pressing the button changes\n * that.\n *\n * The two members lead to different actions by different people, which is the whole reason they are\n * distinguished rather than collapsed into a boolean.\n */\n/**\n * HOW a connection to a provider is established — the shape of the act, which decides the screen.\n *\n * A connect surface cannot be one form. Granting consent at a vendor and typing a key are different\n * acts with different inputs and different failure modes, and a screen that offered one button for\n * both would be wrong for whichever it was not built around.\n */\nexport enum ProviderAuthMethod {\n /** The authorization-code round trip: leave, consent at the vendor, come back with a grant. */\n OAUTH2_AUTHORIZATION_CODE = 'oauth2-authorization-code',\n /**\n * A value somebody holds and types — an API key, a personal access token. The fields are DECLARED\n * by the provider's secrets contract, so a screen names them rather than asking for a slug.\n */\n DECLARED_SECRET = 'declared-secret',\n}\n\nexport enum ProviderConnectabilityBlocker {\n /**\n * The vendor has no authorization flow in the catalogue: its credential is PASTED, not granted.\n * Nothing is missing and nothing is broken — this provider is authored on the credential screen\n * instead, and an application author is the one who acts.\n */\n NO_AUTHORIZATION_FLOW = 'no-authorization-flow',\n /**\n * The vendor has a flow and THIS DEPLOYMENT has not registered with it — no client id, or no client\n * secret. An OPERATOR acts: register an application with the vendor and set the two environment\n * variables the provider's contract names. Distinct from the above because the vendor is perfectly\n * connectable and the gap is ours.\n */\n APPLICATION_NOT_REGISTERED = 'application-not-registered',\n /**\n * An OAuth2 endpoint's HOST or ORIGIN — or the origin a SCOPE names (`{hostUrl}/.default`, #991) — is a\n * placeholder the provider declares no allowance for, so no value can ever be admitted there (#623):\n * the token endpoint receives the application's client secret, and a host is never taken from what\n * somebody types. Nobody connecting can fix it; the provider needs a recorded host allowance.\n */\n ENDPOINT_HOST_NOT_DECLARED = 'endpoint-host-not-declared',\n /**\n * The provider's OAuth2 endpoint definition cannot be resolved safely whatever is supplied — a\n * malformed template, an unresolved source expression, or an allowance that cannot apply where its\n * placeholder sits. A provider-definition defect, not a deployment or account gap.\n */\n ENDPOINT_DEFINITION_INVALID = 'endpoint-definition-invalid',\n /**\n * The provider's OAuth2 origin is filled from this DEPLOYMENT's configured base URL (a self-hosted\n * vendor such as Gitea), and that base URL is unset or unusable. An OPERATOR acts.\n */\n DEPLOYMENT_BASE_URL_UNUSABLE = 'deployment-base-url-unusable',\n /**\n * An OAuth2 endpoint host is filled from a deployment environment variable dedicated to it (Workday's\n * `WORKDAY_AUTH_HOST` / `WORKDAY_API_HOST`, #992), and that variable is unset or not a DNS name. An\n * OPERATOR acts; the variable is named in the catalogue entry's `missingRegistration`.\n */\n DEPLOYMENT_CONFIGURED_HOST_UNUSABLE = 'deployment-configured-host-unusable',\n /**\n * The vendor's credential is PASTED and its REST base URL forms its HOST or ORIGIN from a placeholder the\n * provider declares no allowance for (`https://{subdomain}.vendor.com` with no `baseUrlHostAllowances`\n * entry), so no answer the typed-credential store could collect is ever admitted and every call would\n * refuse (#1097). Nobody connecting can fix it; the provider needs a recorded host allowance — the\n * base-URL twin of `ENDPOINT_HOST_NOT_DECLARED`.\n */\n BASE_URL_HOST_NOT_DECLARED = 'base-url-host-not-declared',\n}\n\n/**\n * One secret slot a provider declares, as a SCREEN needs it — never the value.\n *\n * Exists so nothing is typed by hand. The slug names the field, the environment variable tells an\n * operator exactly what to set, and `configured` lets a missing one be REPORTED rather than\n * discovered by pressing a button that fails.\n */\nexport interface ProviderSecretSlotView {\n readonly slug: string;\n readonly envVarName: string;\n readonly required: boolean;\n readonly description: string;\n /** Whether the deployment supplies it. There is deliberately no field for the value. */\n readonly configured: boolean;\n}\n\nexport enum ProviderStoredCredentialKind {\n /** An OAuth2 grant: an access token, and what is needed to renew it. */\n OAUTH2_GRANT = 'oauth2-grant',\n}\n\nexport const ProviderOAuth2GrantSchema = z.object({\n /**\n * A discriminant, so an opened envelope announces which shape it is.\n *\n * Without it the reader would have to guess from whether the plaintext parses as JSON — and a\n * pasted credential that happens to be JSON (a service-account key, which several vendors issue\n * exactly that way) would be misread as a grant. A guess that is right almost always is the worst\n * kind here, because the failure is a malformed Authorization header on somebody else's account.\n */\n kind: z.literal(ProviderStoredCredentialKind.OAUTH2_GRANT),\n\n /** The token that actually goes on the wire. */\n accessToken: z.string().min(1),\n\n /**\n * Present when the vendor issues one. Absent is normal and permanent for vendors that do not —\n * Slack's bot tokens do not expire and have no refresh — so its absence must not read as an\n * incomplete grant.\n */\n refreshToken: z.string().min(1).optional(),\n\n /**\n * When the access token stops being accepted, as an ISO instant.\n *\n * Optional because a non-expiring token genuinely has none. A grant with a refresh token and no\n * expiry is refreshed only after the vendor rejects it, which is correct but slower than\n * refreshing ahead of a known deadline.\n */\n expiresAt: z.iso.datetime().optional(),\n\n /**\n * What the vendor actually GRANTED, which is not always what was asked for.\n *\n * Recorded because the difference is invisible until a call fails: a vendor may issue a token for\n * a subset of the requested scopes, and the resulting `missing_scope` arrives on an unrelated\n * operation weeks later. Holding the granted set lets that be answered from the row.\n */\n grantedScopes: z.array(z.string()).optional(),\n\n /**\n * The vendor's own identifier for the account this grant is on — a Slack team id, a Google sub, a\n * Microsoft tenant id.\n *\n * Not used for lookup and deliberately not part of the row's identity. It exists so a person\n * reading their connections can tell WHICH account they connected, which a provider ref cannot\n * answer for anyone who has two.\n */\n accountRef: z.string().optional(),\n});\n\nexport type ProviderOAuth2Grant = z.infer<typeof ProviderOAuth2GrantSchema>;\n\n/**\n * The marker that opens the sealed plaintext of a grant rather than a pasted credential.\n *\n * A prefix on the JSON rather than a field inside it, so the decision can be made without parsing —\n * the same reason the envelope carries a prefix. Parsing first would mean feeding an arbitrary\n * pasted credential to `JSON.parse` on every resolution.\n */\nexport const PROVIDER_OAUTH2_GRANT_PREFIX = 'wildo-oauth2-grant:';\n\n/** Whether an OPENED credential is a grant. Cheap, and does not parse. */\nexport function isProviderOAuth2GrantPlaintext(plaintext: string): boolean {\n return plaintext.startsWith(PROVIDER_OAUTH2_GRANT_PREFIX);\n}\n\n/** Render a grant for sealing. The inverse of {@link parseProviderOAuth2Grant}. */\nexport function serializeProviderOAuth2Grant(grant: ProviderOAuth2Grant): string {\n return `${PROVIDER_OAUTH2_GRANT_PREFIX}${JSON.stringify(grant)}`;\n}\n\n/**\n * Read a grant back, or `undefined` when the plaintext is an ordinary pasted credential.\n *\n * THROWS when the value announces itself as a grant and then does not parse or does not validate.\n * That is the same posture the envelope takes toward a value the write path could not have\n * produced: a credential which claims a shape it does not have is a fault worth failing on, never\n * one worth falling back from — falling back would put a JSON blob on the wire as a bearer token.\n */\nexport function parseProviderOAuth2Grant(plaintext: string): ProviderOAuth2Grant | undefined {\n if (!isProviderOAuth2GrantPlaintext(plaintext)) return undefined;\n const body = plaintext.slice(PROVIDER_OAUTH2_GRANT_PREFIX.length);\n let parsed: unknown;\n try {\n parsed = JSON.parse(body);\n } catch {\n throw new Error(\n 'A stored provider credential announces itself as an OAuth2 grant and is not valid JSON. It was '\n + 'written by something other than the authorization exchange; reconnect the account.',\n );\n }\n const result = ProviderOAuth2GrantSchema.safeParse(parsed);\n if (!result.success) {\n throw new Error(\n 'A stored provider credential announces itself as an OAuth2 grant but does not match the grant '\n + 'shape. Reconnect the account rather than editing the row — the value on the wire would '\n + 'otherwise be a fragment of a token.',\n );\n }\n return result.data;\n}\n\n/**\n * Whether a grant should be refreshed BEFORE it is spent.\n *\n * The skew is what makes this useful rather than decorative: a token that expires in two seconds is\n * still \"valid\" and will have expired by the time the request reaches the vendor, so refreshing only\n * on expiry guarantees a population of calls that fail for a reason nothing recorded. Sixty seconds\n * is the industry's common floor and comfortably exceeds any plausible clock skew plus flight time.\n *\n * Returns false when there is no expiry — a non-expiring token is refreshed reactively, after the\n * vendor rejects it, because there is no deadline to act ahead of.\n */\nexport const PROVIDER_OAUTH2_REFRESH_SKEW_SECONDS = 60;\n\nexport function providerOAuth2GrantNeedsRefresh(grant: ProviderOAuth2Grant, now: Date = new Date()): boolean {\n if (grant.expiresAt === undefined) return false;\n const expiry = Date.parse(grant.expiresAt);\n if (Number.isNaN(expiry)) return true;\n return expiry - now.getTime() <= PROVIDER_OAUTH2_REFRESH_SKEW_SECONDS * 1000;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"provider-credentials.shared.schemas.js","sourceRoot":"","sources":["../../../../../src/security/connected-accounts/provider-credentials.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,iCAOX;AAPD,WAAY,iCAAiC;IAC3C,0FAA0F;IAC1F,gEAA2B,CAAA;IAC3B,gDAAgD;IAChD,oDAAe,CAAA;IACf,8EAA8E;IAC9E,wDAAmB,CAAA;AACrB,CAAC,EAPW,iCAAiC,KAAjC,iCAAiC,QAO5C;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,kCAmBX;AAnBD,WAAY,kCAAkC;IAC5C;;;;;OAKG;IACH,2FAAqD,CAAA;IACrD;;;OAGG;IACH,mGAA6D,CAAA;IAC7D;;;;OA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M,CAAC,MAAM,oCAAoC,GAAG,EAAE,CAAC;AAEvD,MAAM,UAAU,+BAA+B,CAAC,KAA0B,EAAE,MAAY,IAAI,IAAI,EAAE;IAChG,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,oCAAoC,GAAG,IAAI,CAAC;AAC/E,CAAC","sourcesContent":["/**\n * Organization Provider Credentials — shared schemas.\n *\n * ## What this resource is, and what it is NOT\n *\n * It is an ORGANIZATION's OWN credential toward a third party: the Slack workspace token, the CRM\n * API key, the SMTP password that belongs to THAT tenant. The organization is the third-party\n * principal, and the credential is a service credential the tenant's administrator supplies.\n *\n * It is NOT a user's delegated OAuth grant. A delegated grant is a different object with a\n * different lifetime (a refresh loop, a revocation the USER can perform, a consent record) and it\n * lands as `connected accounts` beside this file — see issue #333. Merging the two would give one\n * row two owners and two revocation semantics.\n *\n * ## Why it has to exist\n *\n * Before this resource, every provider secret resolved from `process.env` through the\n * `SecretsContract`, so a credential was per-PROCESS and per-DEPLOYMENT. One application serving\n * many organizations therefore had ONE Slack token for all of them, and the failure was silent in\n * the worst direction: an operator sets one key and every tenant thereafter acts as the SAME\n * third-party principal, with nothing anywhere saying so.\n *\n * ## The value is sealed, and this file is where that is stated\n *\n * `secretValue` holds an AES-256-GCM envelope, never the plaintext an operator typed. The seal is\n * applied on the way in and opened only by the resolver — see\n * `provider-credential-envelope.backend.utils.ts` for its key domains and binding, over the shared\n * `bound-secret-envelope` core that does the sealing (#366). The\n * schema cannot enforce that (a string is a string), so the write path is what guarantees it and\n * the pins are what keep it guaranteed.\n */\n\nimport { z } from 'zod';\n\n/**\n * Whether the stored credential has been shown to work against the provider.\n *\n * A closed vocabulary rather than a boolean because \"we have never tried\" and \"we tried and it\n * failed\" are different states with different operator actions, and a boolean would merge them\n * into the same falsy answer. `UNVALIDATED` is the honest default: storing a credential proves\n * only that somebody typed one.\n */\nexport enum ProviderCredentialValidationState {\n /** Stored, never exercised against the provider. The state every credential starts in. */\n UNVALIDATED = 'unvalidated',\n /** The provider accepted it on its last use. */\n VALID = 'valid',\n /** The provider rejected it on its last use — the operator must rotate it. */\n INVALID = 'invalid',\n}\n\n/**\n * Why a write door refused to store a credential VALUE under the slot it named — the stable,\n * client-branchable `code` every door carries (#624).\n *\n * A stored row is keyed `(owner, connectionRef, secretSlug)` on the provider's secrets-contract KEY, and\n * every reader asks for that key. A value written under any other name is a secret nothing can ever\n * read, and before these refusals the write reported success — which is how a regenerated provider,\n * a free-text slug or a test script produced rows that looked connected and resolved as absent.\n *\n * The member values are the wire codes the connect leg already answered with, so one vocabulary\n * serves the connect leg, the resource's own CREATE / UPDATE doors and any client that branches.\n */\nexport enum ProviderCredentialSlotWriteRefusal {\n /**\n * The provider's current secrets contract declares no slot by that name — under either of a slot's\n * two names. Also the answer for a provider that is not registered at all, and for ROTATING a value\n * into an existing row whose stored name is not a contract KEY — a retired name, or a spelling no\n * reader asks for: a fresh secret sealed there is as unreadable as the old one.\n */\n SECRET_SLUG_NOT_DECLARED = 'SECRET_SLUG_NOT_DECLARED',\n /**\n * The slot exists but holds the APPLICATION's own registration (an OAuth2 client id or secret),\n * which is authored in the deployment environment and never read from a credential row.\n */\n SECRET_SLUG_NOT_A_CREDENTIAL = 'SECRET_SLUG_NOT_A_CREDENTIAL',\n /**\n * An UPDATE named a different `providerRef`, `connectionRef` or `secretSlug` for an existing row. The sealed\n * value is bound to the connection and the slot, and `providerRef` records which ref created the row, so a row\n * cannot move: a credential for another slot or connection is a new row, and the old one is deleted.\n */\n CREDENTIAL_SLOT_IMMUTABLE = 'CREDENTIAL_SLOT_IMMUTABLE',\n}\n\n/**\n * How one connection fact got onto a credential row (#333, #1047). The distinction is what decides who may\n * change it: an answer changes only when the person reconnects, a vendor report whenever the vendor\n * reports it again.\n */\nexport enum ProviderConnectionFactProvenance {\n /**\n * Typed by the person connecting, for an endpoint or scope `{placeholder}` at the OAuth2 start — or, for a\n * vendor whose credential is PASTED, for a `{placeholder}` of the REST base URL at the typed-credential store\n * (#1097). Replaced only by reconnecting or re-entering the credential.\n */\n ANSWERED_AT_CONNECT = 'ANSWERED_AT_CONNECT',\n /** Reported by the vendor in its token answer, at the authorization or at a refresh. A refresh may move it. */\n REPORTED_BY_VENDOR = 'REPORTED_BY_VENDOR',\n}\n\n/** One value in a credential row's `connectionFacts`. */\nexport const ProviderConnectionFactSchema = z.strictObject({\n value: z.string().describe(\"The fact's value, such as a tenant id or an instance URL.\"),\n provenance: z.enum(ProviderConnectionFactProvenance).describe(\"Where the value came from: `ANSWERED_AT_CONNECT` was entered by the person connecting and changes only when they reconnect or re-enter the credential; `REPORTED_BY_VENDOR` came from the vendor's token response and may change at a token refresh.\"),\n});\n\nexport type ProviderConnectionFact = z.infer<typeof ProviderConnectionFactSchema>;\n\n/** A credential row's facts, keyed by fact name. */\nexport type ProviderConnectionFacts = Readonly<Record<string, ProviderConnectionFact>>;\n\n/**\n * WHERE a resolved provider secret came from.\n *\n * The whole point of this slice is that the answer used to be unanswerable: every secret came from\n * `process.env`, so \"which principal did this tenant act as?\" had one answer for every tenant and\n * nothing recorded it. Making the source an explicit, closed value means an audit reader can see a\n * tenant falling back to the shared deployment credential — the exact condition the resource exists\n * to make visible — instead of having to infer it from an absence.\n */\nexport enum ProviderCredentialResolutionSource {\n /** The organization's own credential row. The tenant acted as itself. */\n ORGANIZATION_CREDENTIAL = 'organization_credential',\n /**\n * The deployment's env-projected `SecretsContract`. Legitimate — a single-tenant deployment, or a\n * provider the operator intends every tenant to share — but never silent.\n */\n DEPLOYMENT_ENVIRONMENT = 'deployment_environment',\n /**\n * A PERSON's own credential row. The application acted as that individual.\n *\n * This member has no sibling fallback, and that asymmetry is deliberate rather than an omission.\n * An organization with no credential of its own may legitimately fall through to the deployment's\n * — an operator can intend every tenant to share one integration. A person cannot: the vendor\n * attributes the act to whoever's token was spent, so acting for someone under the deployment's\n * principal would put the wrong name on the record that outlives us. A person who has connected\n * nothing gets a refusal, not a substitute.\n */\n USER_CREDENTIAL = 'user_credential',\n}\n\n/**\n * What telling the VENDOR achieved when a credential was removed (#545).\n *\n * A separate axis from {@link ProviderCredentialDeletionReason} on purpose: that one says why OUR\n * COPY stopped existing, this one says whether the authorization itself was withdrawn where it\n * lives. They were one question for as long as the answer was always \"it was not\".\n *\n * Every member is EVIDENCE, and none of them is control flow — the local delete proceeds whatever\n * this says, because a vendor being unreachable must not stop somebody disconnecting.\n */\nexport enum ProviderOAuth2RevocationOutcome {\n /**\n * The vendor answered 200.\n *\n * Under RFC 7009 that also covers a token the server did not recognise, which is the intended\n * reading: the grant is gone either way.\n * spec-cite: RFC 7009 §2.2 — *\"The authorization server responds with HTTP status code 200 if the\n * token has been revoked successfully or if the client submitted an invalid token\"*.\n */\n REVOKED = 'revoked',\n /**\n * Nothing was sent, and that is the ordinary case rather than a failure.\n *\n * Three situations share this member because they are one fact from the person's side — the vendor\n * was not told: the provider declares no `rfc7009RevocationUrl`; the credential was a PASTED\n * long-lived key rather than a grant, so there is nothing to revoke; or the grant carried no token.\n */\n NOT_DECLARED = 'not_declared',\n /** The application's own client registration for this vendor is unset, so nothing could be sent. */\n NOT_CONFIGURED = 'not_configured',\n /** The endpoint could not be reached, or did not answer within the deadline. */\n UNREACHABLE = 'unreachable',\n /** The endpoint answered, and not with 200. */\n REFUSED = 'refused',\n}\n\n/** The wire values of {@link ProviderOAuth2RevocationOutcome}, for a Zod enum over them. */\nexport const ProviderOAuth2RevocationOutcomeValues = ProviderOAuth2RevocationOutcome;\n\n/**\n * Why a credential row stopped existing.\n *\n * ## Every member describes OUR COPY; whether the VENDOR was told is a SECOND axis (#545)\n *\n * Removing a credential deletes the token Wildo holds. Until 2026-09-18 it also did nothing else,\n * so the GRANT survived at the vendor: the person's connected-accounts screen showed the application\n * gone while Asana or Google still listed it as authorized, and a stored refresh token remained\n * valid until it expired on the vendor's schedule — which, for a refresh token, is frequently never.\n *\n * That is stated HERE because this vocabulary is what an operator points at when asked whether an\n * erasure reached someone's third-party credentials, and silence on a compliance surface reads as\n * \"done\".\n *\n * **It is no longer silent.** Both deletion events now carry\n * {@link ProviderOAuth2RevocationOutcome}, so the trail answers the vendor question separately from\n * the local one. What that outcome can SAY still depends on the vendor: RFC 7009 is the only\n * revocation standard and the vendors do not agree with it, so `google-drive` and `asana` declare an\n * endpoint and are told, while Slack's `auth.revoke` (a Web API method) and GitHub's\n * `DELETE /applications/{client_id}/token` (basic auth, JSON body) are not expressible as one and\n * record `not_declared` rather than implying they were reached.\n *\n * An earlier revision of this block argued the mechanism should NOT be built, because *\"no\n * admissible provider declares one today, so the field would ship inert\"*. That was true when it was\n * written and stopped being true when `google-drive` gained an admissible USER connection: Google's\n * `https://oauth2.googleapis.com/revoke` is RFC 7009-conformant, so the mechanism has a reachable\n * user and a proven vendor. Kept as history rather than deleted, because the reasoning was sound and\n * the thing that changed was the world, not the argument.\n */\nexport enum ProviderCredentialDeletionReason {\n /** An administrator of the owning tenant removed it. */\n ADMINISTRATOR_REVOKED = 'administrator_revoked',\n /** The owning organization was purged and the composition cascade removed it with the tenant. */\n ORGANIZATION_PURGED = 'organization_purged',\n /** The person whose credential it was removed it themselves. */\n OWNER_REVOKED = 'owner_revoked',\n /**\n * The owning user was erased and the composition cascade destroyed it with them.\n *\n * Distinct from `ORGANIZATION_PURGED` because this one is EVIDENCE: it is what an operator points\n * at when asked whether a subject-erasure request reached the person's third-party credentials.\n * Collapsing the two into a generic \"cascade\" would make that question unanswerable from the trail.\n *\n * **Who sets it:** the cascade observer, for a cascade declaring itself a `SUBJECT_ERASURE`. The record\n * carries `deletedBy` = whoever EXECUTED the erasure (a person's id when one was carried on the erasure's\n * context, else the `SYSTEM` sentinel), so the erased person is the record's SUBJECT and never its actor\n * (#1088).\n */\n USER_ERASED = 'user_erased',\n /**\n * The owning user ROW was deleted outright and the composition cascade destroyed the credential with it (#1016).\n *\n * **Who sets it:** the user-credential parent-cascade removal observer\n * (`registerUserProviderCredentialCascadeEvidence`), for a cascade that declares its cause as an ordinary parent\n * delete of the `users` row. Two doors reach it today: an administrator's hard `DELETE` (`deletedBy` is that\n * administrator), and the organization-member invitation sweep reaping an orphaned pending user under an internal\n * context (`deletedBy` is the `SYSTEM` sentinel). The record carries `deletedBy`, resolved from the deleting\n * execution context, so it names the principal who deleted the account rather than the person whose credential\n * it was.\n *\n * **Distinct from `USER_ERASED`**, and the distinction is the reason this member exists: an erasure answers a\n * data-subject request, keeps the person's row scrubbed and is evidence that the request reached their third-party\n * credentials. A deletion asserts no such request. Recording it as `USER_ERASED` would forge erasure evidence;\n * recording nothing left an account deletion that destroyed OAuth grants and API keys with no row naming them.\n *\n * **Distinct from `ORGANIZATION_PURGED`**: that is a tenant teardown removing the ORGANIZATION's credentials. This\n * removes one PERSON's own credentials, which no organization owns.\n *\n * Named for what happened to the owner, not for who did it: the cascade cannot tell an administrator's delete from\n * any other deletion of the row, and `deletedBy` is where the actor is stated.\n */\n USER_DELETED = 'user_deleted',\n}\n\n/** @wildo_source:part:start saas.models.provider-credential-identity facet:layer:shared facet:audience:app-developer */\n/**\n * Where a stored credential LIVES: the connection it belongs to and the slot within it (#1670).\n *\n * The owner is not part of it because every caller already holds the owner from its own trusted scope;\n * this is the half the provider registry answers. `ExternalProvidersRegistryBackendService.resolveCredentialAddress`\n * is the ONE producer, so \"which row does a call through ref R spend\" has one answer on every read path.\n */\nexport interface ProviderCredentialAddress {\n /**\n * The CONNECTION the credential belongs to — the key component that used to be the provider ref.\n * Today every ref is its own connection, so this equals the ref; #1725 lets an application declare\n * several refs of one vendor as one connection, and then every ref of it resolves the same row.\n */\n readonly connectionRef: string;\n /** The provider's secrets-contract KEY — see `canonicalCredentialSlug` (#624). */\n readonly secretSlug: string;\n}\n\n/**\n * The fields that IDENTIFY a credential within its tenant: `(organizationId, connectionRef, secretSlug)`.\n *\n * One tenant holds at most one credential per (CONNECTION, slug) — not per provider ref (#1670). A\n * connection is the unit a vendor grant belongs to: by default every provider ref is its own connection\n * (`connectionRef` = `providerRef`), and a vendor served by several refs (an engine part plus add-on\n * packages) can hold ONE grant that all of them spend. Keying on the ref made that impossible — two refs\n * of one vendor could never share a stored credential, whatever the client side did.\n *\n * Exported rather than repeated so the uniqueness contract, the resolver's lookup and the tests cannot\n * drift apart — three copies of a compound key is how two of them come to disagree about what identity\n * means. The sealed value binds the same three components (the connection, never the ref), so a row's\n * key and its seal always name one identity.\n */\nexport const ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [\n 'organizationId',\n 'connectionRef',\n 'secretSlug',\n] as const;\n/** @wildo_source:part:end saas.models.provider-credential-identity */\n\n/**\n * The organization's credential for one (connection, secret slug) pair.\n *\n * ## The scope identifier is TOP-LEVEL and stays that way\n *\n * `organizationId` is the only `organizationId`-named path in this schema, and nothing nested may\n * ever be named `organizationId` or `userId`. `buildContextualFilter` injects the scope FK by\n * matching that field name at EVERY schema path, so a nested key of the same name adds a phantom\n * exact-subdocument clause and the scoped read silently matches zero rows — a credential that\n * exists and cannot be resolved, which reads exactly like a credential that was never set.\n * `setByUserId` is deliberately spelled so it cannot be caught by that matcher.\n */\nexport const OrganizationProviderCredentialSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The tenant that owns this credential. Injected by the context machinery from the request\n * scope, never from a caller-supplied field — which is what makes the isolation structural\n * rather than a filter somebody has to remember to write.\n */\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n /**\n * The provider this credential authenticates toward (`slack`, `stripe`, a generated package's\n * ref). An OPEN string, matching `ProviderRef`'s own openness — the whole point of the provider\n * work is that the set is not closed, so a closed enum here would refuse every generated\n * provider.\n *\n * NOT the row's identity since #1670: it records which ref's connect flow (or write) CREATED the row,\n * and `connectionRef` below is what the row is keyed and sealed on. A reconnect through another ref of\n * the same connection replaces the value and leaves this unchanged.\n */\n providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The CONNECTION this credential belongs to — the row's identity, where `providerRef` records only which\n * ref's connect flow (or write) CREATED it (#1670).\n *\n * Derived by the server from `providerRef` through the provider registry's connection mapping, never\n * supplied by a client: `.excludeFromCreate()` because a caller naming a connection would choose which\n * grant its value lands beside, and `.excludeFromUpdate()` because the sealed value binds it — a row\n * cannot move to another connection, only be replaced (`CREDENTIAL_SLOT_IMMUTABLE`). Every ref is its own\n * connection until an application declares otherwise (#1725), so today it always equals `providerRef`,\n * and every row stored before the field existed was backfilled to exactly that.\n */\n connectionRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n\n /**\n * The provider's `secretsContract` KEY this value satisfies (`accessToken`, `clientSecret`) —\n * NOT the slot's env-var spelling (`ASANA_ACCESS_TOKEN`), which is what the deployment's env\n * projection carries and what a provider regeneration may rename. The two resolution places name\n * the same SLOT by different names, and only the key is stable enough to key a durable row on\n * (#624). Immutable: re-pointing a stored secret at a different slug would silently hand one vendor\n * credential to a different vendor field — and the sealed value binds the slug, so a row stored\n * under a name the provider no longer declares cannot be renamed, only replaced by reconnecting.\n */\n secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The credential, SEALED.\n *\n * `.isWriteOnlySecret()` is the framework's write-then-masked contract and is exactly right\n * here: the operator supplies and rotates the value, so it must stay in the CREATE/UPDATE\n * request DTO; the framework redacts it to a placeholder at the client boundary, so no read\n * ever returns it; and the backend keeps the stored content for its own resolution.\n *\n * `.isBackendOnly()` was rejected — it strips the field from the client DTO, so the operator's\n * typed value is dropped before it is ever stored and the surface silently accepts nothing.\n *\n * What is PERSISTED is the envelope, never the plaintext. The write path seals it; a value that\n * reaches persistence unsealed is a defect, not a tolerated legacy shape.\n */\n secretValue: z.string().min(1).isWriteOnlySecret(),\n\n /**\n * Whether this credential may be spent. An operator can park a credential without deleting it —\n * which matters during an incident, where deleting is not reversible and disabling is.\n */\n enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n /**\n * What the last USE of this credential proved — written only by the credential store after a provider accepted\n * or rejected it (#1809). Excluded from create and update like its three siblings, so the owner cannot declare a\n * credential VALID that no provider ever accepted, or clear an INVALID the resolver recorded.\n */\n validationState: z\n .enum(ProviderCredentialValidationState)\n .default(ProviderCredentialValidationState.UNVALIDATED)\n .isDBIndexed()\n .isSummaryField()\n .excludeFromCreate()\n .excludeFromUpdate(),\n\n /**\n * Why the last use failed, when it did. PROVIDER-supplied text about the CREDENTIAL's status —\n * never the credential. A resolver writing anything derived from `secretValue` here would defeat\n * every other precaution in this file, because this field IS client-readable.\n */\n validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),\n\n lastValidatedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n lastUsedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /**\n * WHO set it — the acting user's id, recorded for the audit trail.\n *\n * Deliberately NOT a registered `USERS` relationship. Declaring that edge would put a CREDENTIAL\n * row on the Art. 15 subject-export graph, and a credential is precisely the class of row that\n * must never reach a data subject. The id is recorded because \"who set this\" is the first\n * question of any credential incident; the edge is withheld because the answer must not travel\n * with a subject export.\n */\n setByUserId: z.string().min(1).optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /** When the stored VALUE last changed — distinct from `updatedAt`, which any field write moves. */\n secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n\n /** Free-text operator note. Never a place for the value; enforced by the write-path pins. */\n /**\n * Every fact about the connected ACCOUNT, each value carrying how it got here — see\n * {@link ProviderConnectionFactProvenance} (#333, #1047).\n *\n * ONE record for two sources, by decision: the answers a person typed for the endpoints'\n * `{placeholder}` holes (which cloud, which directory, which region) — or, for a PASTED credential, for\n * the REST base URL's holes at the typed-credential store (#1097) — and the facts the vendor\n * reported in its token answer that operations consume (Salesforce's `instance_url`, Pipedrive's\n * `api_domain`). Two records would let an operation read one and a refresh update the other.\n *\n * On the ROW rather than only in the connect flow, because a REFRESH needs the answers again — a\n * templated token URL is still templated an hour later — and every CALL needs a reported origin.\n *\n * NOT secret, and deliberately client-readable: a tenant id or an instance URL is how a person\n * recognises which account they connected. The secret half is the grant, and it is sealed.\n *\n * `.excludeFromCreate().excludeFromUpdate()` — no CLIENT write may carry it, create included: the field holds\n * a provenance the resolver trusts, and a pasted-credential create that could type `REPORTED_BY_VENDOR` would\n * forge the one mark that decides where a request is sent (review F1). Answers change only by reconnecting, which REPLACES\n * the record with the grant; vendor-reported facts are also rewritten by a refresh that reports them\n * again. Both are server writes, allow-listed through `preserveServerInjectedFields`.\n */\n connectionFacts: z.record(z.string(), ProviderConnectionFactSchema).optional().excludeFromCreate().excludeFromUpdate(),\n\n\n description: z.string().max(500).optional(),\n\n createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n})\n /**\n * One credential per tenant per (connection, slug), enforced by a compound UNIQUE index rather\n * than by a read-then-write.\n *\n * The race it closes is not academic: two administrators saving a rotated Slack token in the\n * same minute would otherwise leave two rows, and the resolver would then pick one of them\n * arbitrarily — so half the tenant's outbound calls would carry the old credential and nobody\n * could tell which half.\n *\n * No `customMessageReference`: that option exists so an integrator can tell WHICH identity a\n * duplicate violated, and this resource declares exactly one. A dedicated reference here would\n * disambiguate nothing.\n */\n .businessKeySet([...ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS]);\n\nexport type OrganizationProviderCredential = z.infer<typeof OrganizationProviderCredentialSchema>;\n\n\n\n// =============================================================================\n// USER-OWNED CREDENTIALS\n// =============================================================================\n\n/** @wildo_source:part:start saas.models.provider-credential-identity facet:layer:shared facet:audience:app-developer */\n/**\n * The fields that IDENTIFY a credential within its OWNER: `(userId, connectionRef, secretSlug)` — keyed on\n * the CONNECTION, never the provider ref, as the organization-owned sibling explains (#1670).\n *\n * Exported per owner rather than shared, because the compound key differs in its first component and\n * a single constant would have to be assembled by each side — which is how two copies of a key come\n * to disagree about what identity means.\n */\nexport const USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [\n 'userId',\n 'connectionRef',\n 'secretSlug',\n] as const;\n/** @wildo_source:part:end saas.models.provider-credential-identity */\n\n/**\n * A PERSON's own credential toward a third party — the key they authored for themselves.\n *\n * ## Why this is a separate resource and not a nullable column beside the organization's\n *\n * Wildo's tenancy is STRUCTURAL: the contextual filter injects the scope FK by matching a field name\n * at every schema path, so a resource belongs to exactly one primary scope. One table holding both a\n * nullable `organizationId` and a nullable `userId` would turn that structural guarantee into a\n * filter somebody has to remember to write, on the one resource where forgetting it discloses a\n * credential. Two resources, each scoped by construction, is the framework working as designed\n * rather than a duplication.\n *\n * ## Not a delegated OAuth grant, and the difference is not subtle\n *\n * This is a key the user PASTED: they hold an account with the vendor and chose to let this\n * application spend it. A delegated grant is the vendor minting a token because the user approved a\n * consent screen, and it carries a refresh loop, an expiry and a revocation the vendor also honours.\n * Merging them would give one row two lifecycles and two revocation semantics — see #333, which owns\n * the second.\n *\n * ## Only the holder may spend it\n *\n * Not an administrator of their organization, and not a platform operator. Consent to STORE a\n * personal key is not consent for somebody else to use it, and the vendor would record the act as\n * the holder's own. The authorization side of that is\n * `InitiatorMembershipConnectionTargetAuthorization`; this schema is what makes the row reachable\n * only through the owner's own scope.\n */\nexport const UserProviderCredentialSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The person who owns this credential. Injected by the context machinery from the authenticated\n * scope, never from a caller-supplied field — the same structural isolation the organization-owned\n * sibling relies on, which is what makes \"another user's key\" unreachable rather than filtered.\n */\n userId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n /**\n * As the organization-owned sibling: an OPEN string, because the provider set is not closed. Records which\n * ref's connect flow (or write) CREATED the row; the row's identity is `connectionRef` (#1670).\n */\n providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The CONNECTION this credential belongs to — the row's identity (#1670). Server-derived from `providerRef`,\n * never client-supplied, and immutable because the seal binds it; see the organization-owned sibling.\n */\n connectionRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n\n /** The provider's `secretsContract` KEY this value satisfies — never the env-var spelling, as the\n * sibling explains (#624). Immutable, for the same reason as the sibling: re-pointing a stored secret\n * at a different slug would hand one vendor credential to a different vendor field. */\n secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The credential, SEALED — an AES-256-GCM envelope bound to this row's identity, never plaintext.\n *\n * `.isWriteOnlySecret()` for the same reason as the sibling: the holder supplies and rotates it, so\n * it must survive into the CREATE/UPDATE request DTO, and the framework masks it at the client\n * boundary so no read ever returns it.\n */\n secretValue: z.string().min(1).isWriteOnlySecret(),\n\n enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n /**\n * What the last USE of this credential proved — written only by the credential store after a provider accepted\n * or rejected it (#1809). Excluded from create and update like its three siblings, so the owner cannot declare a\n * credential VALID that no provider ever accepted, or clear an INVALID the resolver recorded.\n */\n validationState: z\n .enum(ProviderCredentialValidationState)\n .default(ProviderCredentialValidationState.UNVALIDATED)\n .isDBIndexed()\n .isSummaryField()\n .excludeFromCreate()\n .excludeFromUpdate(),\n\n /** Why the last use failed. PROVIDER text about the CREDENTIAL, never anything derived from it —\n * this field IS client-readable. */\n validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),\n\n lastValidatedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n lastUsedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /** When the stored VALUE last changed — distinct from `updatedAt`, which any field write moves. */\n secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n\n /** The holder's own note. Never a place for the value; enforced by the write-path pins. */\n /**\n * Every fact about the connected ACCOUNT, each value carrying how it got here — see\n * {@link ProviderConnectionFactProvenance} (#333, #1047).\n *\n * ONE record for two sources, by decision: the answers a person typed for the endpoints'\n * `{placeholder}` holes (which cloud, which directory, which region) — or, for a PASTED credential, for\n * the REST base URL's holes at the typed-credential store (#1097) — and the facts the vendor\n * reported in its token answer that operations consume (Salesforce's `instance_url`, Pipedrive's\n * `api_domain`). Two records would let an operation read one and a refresh update the other.\n *\n * On the ROW rather than only in the connect flow, because a REFRESH needs the answers again — a\n * templated token URL is still templated an hour later — and every CALL needs a reported origin.\n *\n * NOT secret, and deliberately client-readable: a tenant id or an instance URL is how a person\n * recognises which account they connected. The secret half is the grant, and it is sealed.\n *\n * `.excludeFromCreate().excludeFromUpdate()` — no CLIENT write may carry it, create included: the field holds\n * a provenance the resolver trusts, and a pasted-credential create that could type `REPORTED_BY_VENDOR` would\n * forge the one mark that decides where a request is sent (review F1). Answers change only by reconnecting, which REPLACES\n * the record with the grant; vendor-reported facts are also rewritten by a refresh that reports them\n * again. Both are server writes, allow-listed through `preserveServerInjectedFields`.\n */\n connectionFacts: z.record(z.string(), ProviderConnectionFactSchema).optional().excludeFromCreate().excludeFromUpdate(),\n\n\n description: z.string().max(500).optional(),\n\n createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n})\n /**\n * One credential per person per (connection, slug), enforced by a compound UNIQUE index rather than\n * a read-then-write — the same race the organization-owned sibling closes, and for the same\n * reason: two rows would leave the resolver picking one arbitrarily, so half the holder's outbound\n * calls would carry a rotated-away credential and nothing would say which half.\n */\n .businessKeySet([...USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS]);\n\nexport type UserProviderCredential = z.infer<typeof UserProviderCredentialSchema>;\n\n\n// ══════════════════════════════════════════════════════════════════════════════════════════════\n// OAUTH2 GRANTS\n//\n// A credential a vendor MINTS rather than one a person pastes. It rides in the same `secretValue`\n// field of the same two resources — sealed, as JSON — and that reuse is deliberate.\n//\n// ## Why the same rows rather than a third resource\n//\n// The identity is the same triple (owner, connectionRef, secretSlug), the ownership semantics are the\n// same, the authorization is the same, the erasure is the same, and the resolver already routes by\n// scope. Only the PAYLOAD differs. A separate resource would duplicate every one of those and force\n// each consumer to ask \"which store?\" before it could ask anything useful.\n//\n// Note this is the OPPOSITE call from the one that split USER from ORGANIZATION, and the difference\n// is what makes both right: there the TENANCY differed, and tenancy in this framework is structural\n// — one table with a nullable owner would turn a structural guarantee into a filter somebody must\n// remember to write. Here nothing about ownership changes; a string becomes an object.\n// ══════════════════════════════════════════════════════════════════════════════════════════════\n\n/**\n * What an authorization exchange gives back, as it is stored.\n *\n * Sealed as JSON into `secretValue`, so `.isWriteOnlySecret()` keeps masking it at the client\n * boundary and the envelope keeps binding it to its row — both mechanisms work on a string and\n * neither needs to know the string is structured.\n */\n/**\n * What SHAPE a sealed credential holds, once opened.\n *\n * One member today and a named vocabulary anyway, because the day a second sealed payload exists —\n * a service-account key, a signed JWT assertion — the discriminant is what tells them apart, and a\n * bare literal is where per-member explanation cannot live. It is also the value a reader needs to\n * understand `PROVIDER_OAUTH2_GRANT_PREFIX`: the prefix is how the shape is recognised WITHOUT\n * parsing, and this is what it recognises.\n */\n/**\n * Why a provider cannot be connected HERE, even though the vendor is in the catalogue.\n *\n * \"Connectable\" is a property of the DEPLOYMENT and not of the vendor, and conflating the two put a\n * Connect button on a screen that could only ever fail. Asana supports OAuth2 perfectly well; this\n * application has simply never registered with Asana, and no amount of pressing the button changes\n * that.\n *\n * The two members lead to different actions by different people, which is the whole reason they are\n * distinguished rather than collapsed into a boolean.\n */\n/**\n * HOW a connection to a provider is established — the shape of the act, which decides the screen.\n *\n * A connect surface cannot be one form. Granting consent at a vendor and typing a key are different\n * acts with different inputs and different failure modes, and a screen that offered one button for\n * both would be wrong for whichever it was not built around.\n */\nexport enum ProviderAuthMethod {\n /** The authorization-code round trip: leave, consent at the vendor, come back with a grant. */\n OAUTH2_AUTHORIZATION_CODE = 'oauth2-authorization-code',\n /**\n * A value somebody holds and types — an API key, a personal access token. The fields are DECLARED\n * by the provider's secrets contract, so a screen names them rather than asking for a slug.\n */\n DECLARED_SECRET = 'declared-secret',\n}\n\nexport enum ProviderConnectabilityBlocker {\n /**\n * The vendor has no authorization flow in the catalogue: its credential is PASTED, not granted.\n * Nothing is missing and nothing is broken — this provider is authored on the credential screen\n * instead, and an application author is the one who acts.\n */\n NO_AUTHORIZATION_FLOW = 'no-authorization-flow',\n /**\n * The vendor has a flow and THIS DEPLOYMENT has not registered with it — no client id, or no client\n * secret. An OPERATOR acts: register an application with the vendor and set the two environment\n * variables the provider's contract names. Distinct from the above because the vendor is perfectly\n * connectable and the gap is ours.\n */\n APPLICATION_NOT_REGISTERED = 'application-not-registered',\n /**\n * An OAuth2 endpoint's HOST or ORIGIN — or the origin a SCOPE names (`{hostUrl}/.default`, #991) — is a\n * placeholder the provider declares no allowance for, so no value can ever be admitted there (#623):\n * the token endpoint receives the application's client secret, and a host is never taken from what\n * somebody types. Nobody connecting can fix it; the provider needs a recorded host allowance.\n */\n ENDPOINT_HOST_NOT_DECLARED = 'endpoint-host-not-declared',\n /**\n * The provider's OAuth2 endpoint definition cannot be resolved safely whatever is supplied — a\n * malformed template, an unresolved source expression, or an allowance that cannot apply where its\n * placeholder sits. A provider-definition defect, not a deployment or account gap.\n */\n ENDPOINT_DEFINITION_INVALID = 'endpoint-definition-invalid',\n /**\n * The provider's OAuth2 origin is filled from this DEPLOYMENT's configured base URL (a self-hosted\n * vendor such as Gitea), and that base URL is unset or unusable. An OPERATOR acts.\n */\n DEPLOYMENT_BASE_URL_UNUSABLE = 'deployment-base-url-unusable',\n /**\n * An OAuth2 endpoint host is filled from a deployment environment variable dedicated to it (Workday's\n * `WORKDAY_AUTH_HOST` / `WORKDAY_API_HOST`, #992), and that variable is unset or not a DNS name. An\n * OPERATOR acts; the variable is named in the catalogue entry's `missingRegistration`.\n */\n DEPLOYMENT_CONFIGURED_HOST_UNUSABLE = 'deployment-configured-host-unusable',\n /**\n * The vendor's credential is PASTED and its REST base URL forms its HOST or ORIGIN from a placeholder the\n * provider declares no allowance for (`https://{subdomain}.vendor.com` with no `baseUrlHostAllowances`\n * entry), so no answer the typed-credential store could collect is ever admitted and every call would\n * refuse (#1097). Nobody connecting can fix it; the provider needs a recorded host allowance — the\n * base-URL twin of `ENDPOINT_HOST_NOT_DECLARED`.\n */\n BASE_URL_HOST_NOT_DECLARED = 'base-url-host-not-declared',\n}\n\n/**\n * One secret slot a provider declares, as a SCREEN needs it — never the value.\n *\n * Exists so nothing is typed by hand. The slug names the field, the environment variable tells an\n * operator exactly what to set, and `configured` lets a missing one be REPORTED rather than\n * discovered by pressing a button that fails.\n */\nexport interface ProviderSecretSlotView {\n readonly slug: string;\n readonly envVarName: string;\n readonly required: boolean;\n readonly description: string;\n /** Whether the deployment supplies it. There is deliberately no field for the value. */\n readonly configured: boolean;\n}\n\nexport enum ProviderStoredCredentialKind {\n /** An OAuth2 grant: an access token, and what is needed to renew it. */\n OAUTH2_GRANT = 'oauth2-grant',\n}\n\nexport const ProviderOAuth2GrantSchema = z.object({\n /**\n * A discriminant, so an opened envelope announces which shape it is.\n *\n * Without it the reader would have to guess from whether the plaintext parses as JSON — and a\n * pasted credential that happens to be JSON (a service-account key, which several vendors issue\n * exactly that way) would be misread as a grant. A guess that is right almost always is the worst\n * kind here, because the failure is a malformed Authorization header on somebody else's account.\n */\n kind: z.literal(ProviderStoredCredentialKind.OAUTH2_GRANT),\n\n /** The token that actually goes on the wire. */\n accessToken: z.string().min(1),\n\n /**\n * Present when the vendor issues one. Absent is normal and permanent for vendors that do not —\n * Slack's bot tokens do not expire and have no refresh — so its absence must not read as an\n * incomplete grant.\n */\n refreshToken: z.string().min(1).optional(),\n\n /**\n * When the access token stops being accepted, as an ISO instant.\n *\n * Optional because a non-expiring token genuinely has none. A grant with a refresh token and no\n * expiry is refreshed only after the vendor rejects it, which is correct but slower than\n * refreshing ahead of a known deadline.\n */\n expiresAt: z.iso.datetime().optional(),\n\n /**\n * What the vendor actually GRANTED, which is not always what was asked for.\n *\n * Recorded because the difference is invisible until a call fails: a vendor may issue a token for\n * a subset of the requested scopes, and the resulting `missing_scope` arrives on an unrelated\n * operation weeks later. Holding the granted set lets that be answered from the row.\n */\n grantedScopes: z.array(z.string()).optional(),\n\n /**\n * The vendor's own identifier for the account this grant is on — a Slack team id, a Google sub, a\n * Microsoft tenant id.\n *\n * Not used for lookup and deliberately not part of the row's identity. It exists so a person\n * reading their connections can tell WHICH account they connected, which a provider ref cannot\n * answer for anyone who has two.\n */\n accountRef: z.string().optional(),\n\n /**\n * An identifier minted when the person AUTHORIZES — at the code exchange — and carried unchanged through every\n * renewal (#1725). A reconnect mints a new one.\n *\n * It is what a cached token of another resource audience is bound to: a Dataverse token minted from this grant's\n * refresh token belongs to THIS authorization, and a reconnect — possibly to a different Microsoft account, on the\n * same row — must never be answered from the previous authorization's cache. The row's id cannot do this (a\n * reconnect updates the row in place) and the refresh token cannot either (Microsoft replaces it on every use).\n * Absent on a grant stored before #1725, which then binds its cache entries to the row instead.\n */\n grantId: z.string().min(1).optional(),\n});\n\nexport type ProviderOAuth2Grant = z.infer<typeof ProviderOAuth2GrantSchema>;\n\n/**\n * The marker that opens the sealed plaintext of a grant rather than a pasted credential.\n *\n * A prefix on the JSON rather than a field inside it, so the decision can be made without parsing —\n * the same reason the envelope carries a prefix. Parsing first would mean feeding an arbitrary\n * pasted credential to `JSON.parse` on every resolution.\n */\nexport const PROVIDER_OAUTH2_GRANT_PREFIX = 'wildo-oauth2-grant:';\n\n/** Whether an OPENED credential is a grant. Cheap, and does not parse. */\nexport function isProviderOAuth2GrantPlaintext(plaintext: string): boolean {\n return plaintext.startsWith(PROVIDER_OAUTH2_GRANT_PREFIX);\n}\n\n/** Render a grant for sealing. The inverse of {@link parseProviderOAuth2Grant}. */\nexport function serializeProviderOAuth2Grant(grant: ProviderOAuth2Grant): string {\n return `${PROVIDER_OAUTH2_GRANT_PREFIX}${JSON.stringify(grant)}`;\n}\n\n/**\n * Read a grant back, or `undefined` when the plaintext is an ordinary pasted credential.\n *\n * THROWS when the value announces itself as a grant and then does not parse or does not validate.\n * That is the same posture the envelope takes toward a value the write path could not have\n * produced: a credential which claims a shape it does not have is a fault worth failing on, never\n * one worth falling back from — falling back would put a JSON blob on the wire as a bearer token.\n */\nexport function parseProviderOAuth2Grant(plaintext: string): ProviderOAuth2Grant | undefined {\n if (!isProviderOAuth2GrantPlaintext(plaintext)) return undefined;\n const body = plaintext.slice(PROVIDER_OAUTH2_GRANT_PREFIX.length);\n let parsed: unknown;\n try {\n parsed = JSON.parse(body);\n } catch {\n throw new Error(\n 'A stored provider credential announces itself as an OAuth2 grant and is not valid JSON. It was '\n + 'written by something other than the authorization exchange; reconnect the account.',\n );\n }\n const result = ProviderOAuth2GrantSchema.safeParse(parsed);\n if (!result.success) {\n throw new Error(\n 'A stored provider credential announces itself as an OAuth2 grant but does not match the grant '\n + 'shape. Reconnect the account rather than editing the row — the value on the wire would '\n + 'otherwise be a fragment of a token.',\n );\n }\n return result.data;\n}\n\n/**\n * Whether a grant should be refreshed BEFORE it is spent.\n *\n * The skew is what makes this useful rather than decorative: a token that expires in two seconds is\n * still \"valid\" and will have expired by the time the request reaches the vendor, so refreshing only\n * on expiry guarantees a population of calls that fail for a reason nothing recorded. Sixty seconds\n * is the industry's common floor and comfortably exceeds any plausible clock skew plus flight time.\n *\n * Returns false when there is no expiry — a non-expiring token is refreshed reactively, after the\n * vendor rejects it, because there is no deadline to act ahead of.\n */\nexport const PROVIDER_OAUTH2_REFRESH_SKEW_SECONDS = 60;\n\nexport function providerOAuth2GrantNeedsRefresh(grant: ProviderOAuth2Grant, now: Date = new Date()): boolean {\n if (grant.expiresAt === undefined) return false;\n const expiry = Date.parse(grant.expiresAt);\n if (Number.isNaN(expiry)) return true;\n return expiry - now.getTime() <= PROVIDER_OAUTH2_REFRESH_SKEW_SECONDS * 1000;\n}\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The credential-rotation rules every surface must agree on: whether a reissued credential's PREVIOUS secret still
|
|
3
|
+
* authenticates, and whether a credential has passed its expiry.
|
|
4
|
+
*
|
|
5
|
+
* They live here, in the shared models, because the backend is not their only reader. The request-auth handlers
|
|
6
|
+
* decide with them, and a screen that shows an operator a rotated key must answer the same question — "does the
|
|
7
|
+
* old secret still work?" — the same way, or it shows a dead secret as live, or a live one as nothing. Moved from
|
|
8
|
+
* `saas-backend-lib`'s `credential-rotation-grace.backend.utils.ts`, which now delegates here.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Whether a credential's PREVIOUS secret — moved into the rotation-grace slot when the credential
|
|
12
|
+
* was reissued — is still inside its grace window and may therefore still authenticate.
|
|
13
|
+
*
|
|
14
|
+
* `invalidationDate` is written by the ROTATE / REGENERATE reissue handlers on both api-keys and
|
|
15
|
+
* OAuth clients, and its three states carry distinct semantics:
|
|
16
|
+
*
|
|
17
|
+
* - `null` / `undefined` → **open-ended overlap**. This is what REGENERATE writes: the reissue is
|
|
18
|
+
* ADDITIVE — it mints a new secret WITHOUT invalidating the prior one, so the prior secret keeps
|
|
19
|
+
* authenticating until the NEXT reissue. REGENERATE is therefore NOT a way to cut off a leaked
|
|
20
|
+
* secret: to revoke a compromised credential you must either REVOKE it (status → non-ACTIVE,
|
|
21
|
+
* which fails the `status === ACTIVE` gate every caller applies to the resolved record) or ROTATE
|
|
22
|
+
* with an explicit invalidation date. This open-endedness is deliberate, not a bug.
|
|
23
|
+
* - a FUTURE date → still valid — a bounded overlap window (e.g. a ROTATE handover deadline).
|
|
24
|
+
* - `now` / a PAST date → expired.
|
|
25
|
+
*
|
|
26
|
+
* Callers MUST additionally require the resolved record's `status === ACTIVE`, so a
|
|
27
|
+
* deactivated/expired credential's previous secret never authenticates regardless of this window.
|
|
28
|
+
*
|
|
29
|
+
* SINGLE SOURCE OF TRUTH shared by the api-key request-auth handlers, the OAuth-client
|
|
30
|
+
* direct-secret handlers, the `/oauth/token` client-secret exchange, and the screens that show a
|
|
31
|
+
* rotated credential ({@link isPreviousCredentialSecretAccepted}) — they MUST agree on grace
|
|
32
|
+
* semantics, so the check lives here once rather than being copied per call site.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isRotationGraceWindowOpen(invalidationDate?: Date | null): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether a credential (api-key / OAuth client) has passed its `expiresAt`. `null`/`undefined` =
|
|
37
|
+
* no expiry set = never expires.
|
|
38
|
+
*
|
|
39
|
+
* Enforced at AUTH-TIME on every machine front, and that is where the enforcement STAYS.
|
|
40
|
+
*
|
|
41
|
+
* There IS an `EXPIRED` producer since 2026-09-08 — the nightly credential-expiry sweep (#413)
|
|
42
|
+
* dispatches each resource's `expire` verb — but it is BOOKKEEPING, never the control. It always
|
|
43
|
+
* lags: a credential that elapses at 09:00 still reads ACTIVE until 02:30 the next morning. This
|
|
44
|
+
* check is what makes that lag harmless, so a caller must never replace it with a `status` test.
|
|
45
|
+
* Do that and the sweep's lag becomes an authorization hole rather than a stale display, and
|
|
46
|
+
* `expiresAt` plus the `EXTEND_EXPIRY` operation go back to being decorative. Callers apply it
|
|
47
|
+
* alongside the ACTIVE gate:
|
|
48
|
+
* `!record || record.status !== ACTIVE || isCredentialExpired(record.expiresAt)`. SINGLE SOURCE OF
|
|
49
|
+
* TRUTH shared by the api-key + OAuth-client request-auth handlers and the `/oauth/token` exchange.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isCredentialExpired(expiresAt?: Date | null): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether a reissued credential's PREVIOUS secret would authenticate right now — the answer a screen owes an
|
|
54
|
+
* operator after a rotation, and the same three gates the request-auth handlers apply to a match on the previous
|
|
55
|
+
* secret: its grace window is open ({@link isRotationGraceWindowOpen}), the credential is ACTIVE, and it has not
|
|
56
|
+
* passed its expiry ({@link isCredentialExpired}).
|
|
57
|
+
*
|
|
58
|
+
* Why a screen needs it rather than the raw fields: the fields alone mislead in both directions. After a
|
|
59
|
+
* REGENERATE the invalidation date is empty and the old secret works indefinitely, so a screen that hides empty
|
|
60
|
+
* rows shows nothing at the riskiest moment; after a default ROTATE the date is the rotation instant and the old
|
|
61
|
+
* secret is dead, yet its prefix is still stored.
|
|
62
|
+
*/
|
|
63
|
+
export declare function isPreviousCredentialSecretAccepted(credential: {
|
|
64
|
+
hasPreviousSecret: boolean;
|
|
65
|
+
previousSecretInvalidationDate?: Date | null;
|
|
66
|
+
isActive: boolean;
|
|
67
|
+
expiresAt?: Date | null;
|
|
68
|
+
}): boolean;
|
|
69
|
+
//# sourceMappingURL=credential-rotation-grace.shared.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-rotation-grace.shared.utils.d.ts","sourceRoot":"","sources":["../../../../src/security/credential-rotation-grace.shared.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CAAC,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAGjF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAGpE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kCAAkC,CAAC,UAAU,EAAE;IAC7D,iBAAiB,EAAE,OAAO,CAAC;IAC3B,8BAA8B,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB,GAAG,OAAO,CAOV"}
|