@wildo-ai/saas-models 1.1.3 → 1.1.5
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-metadata.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.js +2 -2
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/applications-context.schemas.d.ts +236 -18
- package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts +1 -0
- package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.js +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/applications.shared.schemas.d.ts +3 -2
- package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.schemas.js +40 -5
- package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +1 -2
- 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 +1 -2
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.d.ts +87 -5
- package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.js +91 -5
- package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.d.ts +25 -4
- package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.js +61 -0
- package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
- package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.resources-config.schemas.js +32 -2
- package/dist/esm/billing/price.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.js +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.resources-config.schemas.js +32 -2
- package/dist/esm/billing/product.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/product.shared.schemas.d.ts +1 -0
- package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.schemas.js +3 -0
- package/dist/esm/billing/product.shared.schemas.js.map +1 -1
- package/dist/esm/billing/promotions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/promotions.shared.resources-config.schemas.js +33 -3
- package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.resources-config.schemas.js +22 -2
- package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.d.ts +1 -0
- package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.js +3 -0
- package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +23 -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 +48 -2
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.d.ts +1 -0
- package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.js +3 -0
- package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts +49 -0
- package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts.map +1 -0
- package/dist/esm/billing/usage-flush-evidence.shared.schemas.js +48 -0
- package/dist/esm/billing/usage-flush-evidence.shared.schemas.js.map +1 -0
- package/dist/esm/billing/usage-record.shared.schemas.d.ts +1 -0
- package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.js +3 -0
- package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +8 -0
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +14 -3
- 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 +21 -7
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts +450 -0
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js +723 -0
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts +2 -2
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +8 -0
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +15 -0
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +787 -21
- 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 +1079 -26
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +51 -0
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts +463 -0
- package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js +526 -0
- package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts +539 -15
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.js +402 -14
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts +18 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js +89 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts +47 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js +73 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts +21 -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 +39 -1
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts +33 -0
- package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js +30 -0
- package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js.map +1 -0
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts +6 -5
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.js +15 -5
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts +127 -0
- package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js +94 -0
- package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts +125 -0
- package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/consent-purposes.shared.js +136 -0
- package/dist/esm/compliance/privacy/consent-purposes.shared.js.map +1 -0
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts +91 -0
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js +123 -0
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +27 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +36 -2
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +68 -25
- 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 +74 -22
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts +9 -17
- package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/privacy.shared.schemas.js +74 -31
- package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts +47 -0
- package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js +98 -0
- package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts +368 -35
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js +403 -17
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/review-cadence.shared.schemas.d.ts +56 -0
- package/dist/esm/compliance/review-cadence.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/review-cadence.shared.schemas.js +71 -0
- package/dist/esm/compliance/review-cadence.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/risk-posture.shared.schemas.d.ts +161 -0
- package/dist/esm/compliance/risk-posture.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/risk-posture.shared.schemas.js +166 -0
- package/dist/esm/compliance/risk-posture.shared.schemas.js.map +1 -0
- package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts +4 -3
- package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/analytics-value-moments.shared.schemas.js +4 -3
- package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +222 -9
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.js +232 -9
- package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
- package/dist/esm/config/auth-config-resolution.shared.utils.d.ts +75 -3
- package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
- package/dist/esm/config/auth-config-resolution.shared.utils.js +93 -4
- package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
- package/dist/esm/config/brand-assets.shared.schemas.d.ts +5 -4
- package/dist/esm/config/brand-assets.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/brand-assets.shared.schemas.js +14 -4
- package/dist/esm/config/brand-assets.shared.schemas.js.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +463 -19
- package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.js +535 -28
- package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +14 -14
- package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts +139 -3
- package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
- package/dist/esm/config/frontend/chart-registration-alignment.shared.js +151 -4
- package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +21 -17
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.js +58 -40
- package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts +90 -133
- package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/onboarding.shared.schemas.js +148 -100
- package/dist/esm/config/frontend/onboarding.shared.schemas.js.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +146 -43
- 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 +147 -42
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
- package/dist/esm/errors/errors.shared.definitions.js +1 -1
- package/dist/esm/errors/errors.shared.definitions.js.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.d.ts +29 -40
- package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.js +37 -54
- package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
- package/dist/esm/errors/errors.shared.utils.d.ts +24 -0
- package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.utils.js +39 -0
- package/dist/esm/errors/errors.shared.utils.js.map +1 -1
- package/dist/esm/errors/thrown-value-description.shared.utils.d.ts +27 -0
- package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -0
- package/dist/esm/errors/thrown-value-description.shared.utils.js +67 -0
- package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -0
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +48 -73
- 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 +103 -9
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
- package/dist/esm/external-data.exports.d.ts +1 -0
- package/dist/esm/external-data.exports.d.ts.map +1 -1
- package/dist/esm/external-data.exports.js +1 -0
- package/dist/esm/external-data.exports.js.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +18 -12
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +18 -12
- 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 +5 -3
- 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 +5 -3
- 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 +77 -0
- package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -0
- package/dist/esm/external-providers/engine-capability-surface.shared.js +173 -0
- package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -0
- package/dist/esm/external-providers/external-providers.shared.schemas.d.ts +2 -0
- package/dist/esm/external-providers/external-providers.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/external-providers.shared.schemas.js +21 -0
- package/dist/esm/external-providers/external-providers.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +131 -7
- 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 +114 -0
- 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 +148 -0
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +108 -0
- 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 +86 -0
- 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 +184 -0
- package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -0
- package/dist/esm/external-providers/frontend-provider-public-config.shared.js +216 -0
- package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -0
- package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts +30 -0
- package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js +32 -0
- package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts +86 -0
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js +85 -0
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +14 -13
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.js +10 -10
- 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 +18 -8
- 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 +10 -4
- 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 +165 -0
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js +39 -0
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -0
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +7 -5
- 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 +7 -5
- 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 +8 -5
- package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-metadata.shared.schemas.js +5 -2
- package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
- package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts +2 -0
- 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 +42 -3
- package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/features/connected-feature.example.d.ts +64 -0
- package/dist/esm/features/connected-feature.example.d.ts.map +1 -0
- package/dist/esm/features/connected-feature.example.js +86 -0
- package/dist/esm/features/connected-feature.example.js.map +1 -0
- package/dist/esm/features/scope-features.shared.schemas.d.ts +53 -0
- package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/scope-features.shared.schemas.js +37 -0
- package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.js +42 -48
- package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts +73 -0
- package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -0
- package/dist/esm/files/file-remote-reference-link.shared.schemas.js +62 -0
- package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -0
- package/dist/esm/files/files.shared.resources-config.schemas.d.ts +3 -3
- package/dist/esm/files/files.shared.resources-config.schemas.js +3 -3
- package/dist/esm/files/files.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.d.ts +152 -129
- package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.js +99 -2
- package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts +6 -0
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agents.shared.schemas.d.ts +3 -3
- package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agents.shared.schemas.js +11 -5
- package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +13 -0
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts +45 -0
- package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js +51 -0
- package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js.map +1 -0
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +31 -0
- 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 +61 -3
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts +2 -2
- package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +16 -8
- 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 +23 -11
- 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 -189
- 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 +14 -50
- 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 +0 -3
- 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 +0 -1
- package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts +1 -67
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js +1 -2
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows.shared.schemas.d.ts +0 -1
- package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts +121 -0
- package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/human-decision.shared.schemas.js +252 -0
- package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts +2 -0
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.js +13 -0
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts +24 -0
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js +80 -0
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts +123 -0
- package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/provider-call-records.shared.schemas.js +181 -0
- package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts +58 -81
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.js +75 -38
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.js.map +1 -1
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts +217 -0
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -0
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js +230 -0
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -0
- package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts +106 -24
- package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-flow.shared.schemas.js +152 -14
- package/dist/esm/guidance/guidance-flow.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts +0 -6
- package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js +0 -19
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/milestone-builders.shared.d.ts +4 -2
- package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
- package/dist/esm/guidance/milestone-builders.shared.js +4 -2
- package/dist/esm/guidance/milestone-builders.shared.js.map +1 -1
- package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts +66 -4
- package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/milestone-definition.shared.schemas.js +50 -0
- package/dist/esm/guidance/milestone-definition.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts +71 -0
- package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts.map +1 -0
- package/dist/esm/guidance/progression-presentation.shared.schemas.js +72 -0
- package/dist/esm/guidance/progression-presentation.shared.schemas.js.map +1 -0
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +2 -0
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts +4 -0
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.js +5 -0
- package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js +2 -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 +181 -412
- 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 +249 -199
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts +107 -0
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -0
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js +108 -0
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -0
- package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts +38 -0
- package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts.map +1 -0
- package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js +42 -0
- package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js.map +1 -0
- package/dist/esm/index.d.ts +47 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +77 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts +130 -0
- package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js +104 -0
- package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/decisions.meta-workflows.shared.schemas.d.ts +64 -0
- package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/decisions.meta-workflows.shared.schemas.js +47 -0
- package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +544 -0
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +638 -0
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/portable-primitives.meta-workflows.shared.schemas.d.ts +15 -8
- package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/portable-primitives.meta-workflows.shared.schemas.js +15 -8
- package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/meta-workflows.exports.d.ts +21 -25
- package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
- package/dist/esm/meta-workflows.exports.js +21 -25
- package/dist/esm/meta-workflows.exports.js.map +1 -1
- package/dist/esm/notifications/email/email-submission.shared.enums.d.ts +16 -0
- package/dist/esm/notifications/email/email-submission.shared.enums.d.ts.map +1 -0
- package/dist/esm/notifications/email/email-submission.shared.enums.js +17 -0
- package/dist/esm/notifications/email/email-submission.shared.enums.js.map +1 -0
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +36 -0
- 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 +50 -3
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js +4 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts +2 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js +3 -2
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +44 -3
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js +12 -33
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.d.ts +68 -6
- package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.js +68 -6
- package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts +145 -0
- package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts.map +1 -0
- package/dist/esm/organizations/application-owner-organization.shared.schemas.js +146 -0
- package/dist/esm/organizations/application-owner-organization.shared.schemas.js.map +1 -0
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts +2 -0
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js +39 -3
- 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 +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +18 -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 +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.js +9 -1
- package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts +2 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.js +3 -0
- package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +3 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.js +4 -2
- package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts +29 -2
- package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.shared.js +27 -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 +2 -0
- 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 +3 -0
- package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-units.shared.schemas.d.ts +17 -5
- package/dist/esm/organizations/organization-units.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-units.shared.schemas.js +65 -5
- package/dist/esm/organizations/organization-units.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts +51 -7
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +151 -7
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.schemas.d.ts +18 -83
- package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.schemas.js +37 -19
- package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts +13 -0
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js +13 -0
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.d.ts +1 -0
- package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.js +1 -0
- package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
- package/dist/esm/public-runtime/index.d.ts +53 -2
- package/dist/esm/public-runtime/index.d.ts.map +1 -1
- package/dist/esm/public-runtime/index.js +45 -2
- package/dist/esm/public-runtime/index.js.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts +7 -8
- package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js +30 -6
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.d.ts +388 -2
- package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.js +315 -11
- package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.utils.d.ts +6 -4
- package/dist/esm/queue/jobs.shared.utils.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.utils.js +5 -4
- package/dist/esm/queue/jobs.shared.utils.js.map +1 -1
- package/dist/esm/queue/queues.shared.schemas.d.ts +20 -8
- package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/queues.shared.schemas.js +23 -18
- package/dist/esm/queue/queues.shared.schemas.js.map +1 -1
- package/dist/esm/queue/queues.shared.utils.d.ts +4 -2
- package/dist/esm/queue/queues.shared.utils.d.ts.map +1 -1
- package/dist/esm/queue/queues.shared.utils.js +4 -2
- package/dist/esm/queue/queues.shared.utils.js.map +1 -1
- package/dist/esm/rag/rag-retrieval-health.shared.d.ts +27 -0
- package/dist/esm/rag/rag-retrieval-health.shared.d.ts.map +1 -0
- package/dist/esm/rag/rag-retrieval-health.shared.js +29 -0
- package/dist/esm/rag/rag-retrieval-health.shared.js.map +1 -0
- 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/idempotency-key.shared.d.ts +76 -0
- package/dist/esm/requests/idempotency-key.shared.d.ts.map +1 -0
- package/dist/esm/requests/idempotency-key.shared.js +112 -0
- package/dist/esm/requests/idempotency-key.shared.js.map +1 -0
- package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-documentation.js +275 -20
- package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts +134 -0
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.js +153 -0
- package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.d.ts +198 -20
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js +236 -5
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- package/dist/esm/resources/child-operations.shared.schemas.d.ts +56 -5
- package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/child-operations.shared.schemas.js +97 -5
- package/dist/esm/resources/child-operations.shared.schemas.js.map +1 -1
- package/dist/esm/resources/context-policy.shared.schemas.d.ts +20 -0
- package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/context-policy.shared.schemas.js +3 -0
- package/dist/esm/resources/context-policy.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.js +596 -34
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +665 -40
- package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.js +315 -22
- 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 +431 -69
- package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.d.ts +36 -0
- package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.js +46 -0
- package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.d.ts +256 -10
- package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.js +209 -9
- package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources.shared.utils.d.ts +34 -8
- package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.utils.js +69 -12
- package/dist/esm/resources/resources.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts +44 -12
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.js +46 -23
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.js.map +1 -1
- package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts +61 -0
- package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts.map +1 -0
- package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js +79 -0
- package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js.map +1 -0
- package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts +60 -0
- package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts.map +1 -0
- package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js +80 -0
- package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js.map +1 -0
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts +21 -0
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -0
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.js +159 -0
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -0
- package/dist/esm/resources/utils/resources-config-naming.utils.d.ts +15 -0
- package/dist/esm/resources/utils/resources-config-naming.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-naming.utils.js +56 -11
- package/dist/esm/resources/utils/resources-config-naming.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +51 -1
- 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 +210 -51
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts +34 -0
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js +45 -1
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts +29 -0
- package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/shared-persistence-collection.utils.js +30 -0
- package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
- package/dist/esm/resources/utils/templatable-file-fields.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js +49 -11
- package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +4 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +4 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +129 -17
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +160 -6
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +324 -9
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.js +411 -8
- package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.utils.d.ts +87 -4
- package/dist/esm/security/authentications/authentication.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.utils.js +95 -6
- package/dist/esm/security/authentications/authentication.shared.utils.js.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts +23 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js +23 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts +7 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js +7 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts +74 -0
- package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts.map +1 -0
- package/dist/esm/security/authentications/password-blocklist.shared.utils.js +122 -0
- package/dist/esm/security/authentications/password-blocklist.shared.utils.js.map +1 -0
- package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts +88 -2
- package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/registration.shared.dto.schemas.js +149 -2
- package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts +57 -11
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js +44 -11
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js +20 -7
- 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 +16 -2
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +32 -2
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js +7 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js +4 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts +27 -0
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js +109 -0
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts +66 -0
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js +107 -0
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js.map +1 -0
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts +19 -0
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js +50 -13
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts +18 -6
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js +133 -4
- 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 +29 -3
- 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 +81 -22
- 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 +0 -40
- 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 +100 -26
- 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 +9 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js +9 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +8 -2
- 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 +91 -4
- 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 +50 -6
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js +50 -6
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts +39 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js +265 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts +187 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js +271 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -0
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts +23 -0
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js +24 -0
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.defaults.js +6 -0
- package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +14 -0
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js +19 -0
- package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.js +2 -0
- package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +4 -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-user.shared.resources-config.schemas.d.ts +5 -2
- 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 +13 -42
- 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 +257 -13
- 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 +281 -49
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts +6 -3
- 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 +74 -4
- 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 +5 -2
- 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 +105 -3
- package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/outbound-target-control.shared.schemas.d.ts +67 -0
- package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/outbound-target-control.shared.schemas.js +69 -0
- package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts +159 -0
- package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js +164 -0
- package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts +209 -0
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js +150 -0
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts +79 -0
- package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-env.shared.js +116 -0
- package/dist/esm/systems-of-record/system-of-record-env.shared.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts +145 -0
- package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js +146 -0
- package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts +478 -0
- package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js +619 -0
- package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts +31 -0
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js +232 -0
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts +127 -0
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts.map +1 -0
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js +204 -0
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js.map +1 -0
- package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
- package/dist/esm/testing/resource-config-builders.js +10 -4
- package/dist/esm/testing/resource-config-builders.js.map +1 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts +2 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js +2 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js.map +1 -1
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts +139 -24
- 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 +255 -0
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/anonymous-users.shared.schema.d.ts +5 -3
- package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
- package/dist/esm/users/anonymous-users.shared.schema.js +18 -1
- package/dist/esm/users/anonymous-users.shared.schema.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts +2 -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 +23 -0
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.d.ts +2 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-consent-decision.shared.utils.d.ts +127 -0
- package/dist/esm/users/user-consent-decision.shared.utils.d.ts.map +1 -0
- package/dist/esm/users/user-consent-decision.shared.utils.js +189 -0
- package/dist/esm/users/user-consent-decision.shared.utils.js.map +1 -0
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts +1 -0
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.d.ts +1 -0
- package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.js +30 -0
- package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-preferences-reset.shared.utils.d.ts +6 -6
- package/dist/esm/users/user-preferences-reset.shared.utils.js +6 -6
- 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 +74 -29
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js +99 -0
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.js +25 -9
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +4 -4
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js +12 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts +1 -0
- package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self.shared.resources-config.schemas.js +2 -2
- 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 +1 -0
- package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.resources-config.schemas.js +2 -2
- package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.schemas.d.ts +28 -10
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js +86 -11
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +14 -35
- package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.d.ts +0 -19
- package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.d.ts.map +0 -1
- package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.js +0 -35
- package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.js.map +0 -1
- package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts +0 -213
- package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.js +0 -287
- package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.d.ts +0 -236
- package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.js +0 -212
- package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/actions.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts +0 -17
- package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js +0 -31
- package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.d.ts +0 -28
- package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.js +0 -28
- package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts +0 -100
- package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js +0 -232
- package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.d.ts +0 -29
- package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.js +0 -58
- package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.d.ts +0 -81
- package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.d.ts.map +0 -1
- package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.js +0 -82
- package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.js.map +0 -1
- package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.d.ts +0 -2
- package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.d.ts.map +0 -1
- package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.js +0 -1
- package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.js.map +0 -1
- /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/actions.meta-workflows.shared.schemas.d.ts +0 -0
- /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/actions.meta-workflows.shared.schemas.js +0 -0
- /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/catalog.meta-workflows.shared.schemas.d.ts +0 -0
- /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/catalog.meta-workflows.shared.schemas.js +0 -0
- /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/context-selection.meta-workflows.shared.schemas.d.ts +0 -0
- /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/context-selection.meta-workflows.shared.schemas.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-persistence-collection.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/shared-persistence-collection.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAC;AAEjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,8CAA8C,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAe3F,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAEzF;AAED,iGAAiG;AACjG,MAAM,WAAW,2CAA2C;IAC1D,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAC1C,yFAAyF;IACzF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;CAClE;AAED,gFAAgF;AAChF,MAAM,WAAW,6CAA6C;IAC5D,sEAAsE;IACtE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,YAAY,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,sBAAsB,CAAA;KAAE,EAAE,CAAC;IAC9F,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,kDAAkD,CAChE,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,2CAA2C,CAAC,EACnF,yBAAyB,EAAE,sBAAsB,GAChD,6CAA6C,EAAE,CAsDjD;AAED,mGAAmG;AACnG,MAAM,WAAW,6CAA6C;IAC5D,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAC1C,QAAQ,CAAC,eAAe,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,oBAAoB,CAAA;KAAE,GAAG,SAAS,CAAC;CACxE;AAyBD,iFAAiF;AACjF,MAAM,WAAW,+CAA+C;IAC9D,8DAA8D;IAC9D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,YAAY,EAAE,YAAY,CAAC;QAAC,IAAI,EAAE,oBAAoB,GAAG,SAAS,CAAA;KAAE,EAAE,CAAC;IACrG,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,oDAAoD,CAClE,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,6CAA6C,CAAC,GACpF,+CAA+C,EAAE,CA0DnD"}
|
|
1
|
+
{"version":3,"file":"shared-persistence-collection.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/shared-persistence-collection.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAC;AAEjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,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AE,oBAAoB,GAAG,SAAS,CAAA;KAAE,EAAE,CAAC;IACrG,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,oDAAoD,CAClE,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,6CAA6C,CAAC,GACpF,+CAA+C,EAAE,CA0DnD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,oBAAY,iCAAiC;IAC3C,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB"}
|
|
@@ -292,4 +292,34 @@ export function findSharedPersistenceCollectionRetentionIncoherences(resourceCon
|
|
|
292
292
|
}
|
|
293
293
|
return incoherences;
|
|
294
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* The privilege AXES a database credential issued to a named runtime principal (a minion) is built
|
|
297
|
+
* from — one closed vocabulary shared by every storage adapter that mints such a credential.
|
|
298
|
+
*
|
|
299
|
+
* Each axis is a distinct verb set, not a strength on a scale, and they must never be merged:
|
|
300
|
+
*
|
|
301
|
+
* - {@link READ} — read rows.
|
|
302
|
+
* - {@link WRITE} — insert, update and delete. The only axis that can REMOVE a row.
|
|
303
|
+
* - {@link APPEND} — insert only. A principal can add a row and never amend or remove it, which is
|
|
304
|
+
* what makes it the axis for evidence: an audit trail a principal can rewrite is not an audit trail.
|
|
305
|
+
* - {@link MAINTAIN} — insert and update, never delete, for durable runtime state whose history must
|
|
306
|
+
* survive the principal that advances it.
|
|
307
|
+
*
|
|
308
|
+
* It lives beside the collection aliases because a grant is issued per COLLECTION: the alias map says
|
|
309
|
+
* which rows a grant on a resource type reaches, and this says which verbs it carries there. The
|
|
310
|
+
* derivation that fills each axis, and the engine floor it adds, live in `platform-config-lib`
|
|
311
|
+
* (`deriveMinionDatabaseGrants`); the MongoDB and PostgreSQL adapters each translate an axis into
|
|
312
|
+
* their own privilege dialect.
|
|
313
|
+
*
|
|
314
|
+
* Scope, stated because it is easy to over-read: this governs NAMED runtime principals only. The
|
|
315
|
+
* application backend is not issued an axis-scoped credential — it owns its database — so nothing
|
|
316
|
+
* here constrains what the backend's own credential can do to a row.
|
|
317
|
+
*/
|
|
318
|
+
export var RuntimePrincipalDatabaseGrantAxis;
|
|
319
|
+
(function (RuntimePrincipalDatabaseGrantAxis) {
|
|
320
|
+
RuntimePrincipalDatabaseGrantAxis["READ"] = "read";
|
|
321
|
+
RuntimePrincipalDatabaseGrantAxis["WRITE"] = "write";
|
|
322
|
+
RuntimePrincipalDatabaseGrantAxis["APPEND"] = "append";
|
|
323
|
+
RuntimePrincipalDatabaseGrantAxis["MAINTAIN"] = "maintain";
|
|
324
|
+
})(RuntimePrincipalDatabaseGrantAxis || (RuntimePrincipalDatabaseGrantAxis = {}));
|
|
295
325
|
//# sourceMappingURL=shared-persistence-collection.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-persistence-collection.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/shared-persistence-collection.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAKxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,CAAC,MAAM,8CAA8C,GAAqC;IAC9F,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC,KAAK;IACpD,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,gBAAgB,CAAC,aAAa;IACrE,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB;IAC3E;;;;;;;;;OASG;IACH,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,gBAAgB,CAAC,UAAU;CACvE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU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AC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,OAAO,CAAC,IAAI,IAAI,wBAAwB,EAAE,CAAC;aACnG,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,YAAY,CAAC,IAAI,CAAC;YAChB,cAAc;YACd,QAAQ;YACR,OAAO,EACL,qBAAqB,QAAQ,uBAAuB,cAAc,2BAA2B;gBAC7F,gGAAgG;gBAChG,+FAA+F;gBAC/F,iGAAiG;gBACjG,+FAA+F;gBAC/F,2FAA2F;gBAC3F,6FAA6F;gBAC7F,gGAAgG;gBAChG,6FAA6F;gBAC7F,8BAA8B;SACjC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import { CoreResourceType } from '../resources.shared.core.definitions';\nimport type { ResourceType } from '../resources.shared.schemas';\nimport type { PersistenceAdapterType } from '../resources-config.shared.schemas';\nimport { ErasureRetentionMode } from '../../compliance/privacy/impersonalization.shared.schemas';\n\n/**\n * Resource types that deliberately project onto ANOTHER resource type's\n * persistence collection — THE authority for \"which configs address the same\n * physical rows?\".\n *\n * ## What this expresses\n *\n * A `USER_SELF*` resource is not a different record set; it is a different DOOR\n * onto the SAME record set, with its own operations, roles and scoping. The\n * `USERS` door is the admin surface (list every user, delete a user); the\n * `USER_SELF` door is the self surface (read/update MY row). They intentionally\n * share `UserSchema` and they intentionally share storage — the persistence\n * layer builds a SEPARATE model per resource config over ONE collection.\n *\n * Anything not listed here stores under its own resource type.\n *\n * ## Why it is a single named authority\n *\n * This mapping had already been copied twice inside the backend (the\n * zod→mongoose model builder, which is what actually creates and reads the\n * collection, and the aggregation collection resolver — whose earlier\n * divergence made every aggregation query a non-existent collection and return\n * zero rows). It now has a third consumer of a completely different kind:\n * {@link findSharedPersistenceCollectionRetentionIncoherences}, a boot-time\n * coherence guard. A per-resource config factory structurally cannot see this\n * relationship — it validates ONE config at a time — so the fact has to live\n * where every layer can read it, and it has to live exactly once.\n *\n * ## The alias belongs to the RESOURCE, not to the storage adapter\n *\n * Every persistence path resolves through this map, and each adapter has\n * exactly ONE composition point that does so: MongoDB's model builder and its\n * aggregation resolver, and — on the SQL side — the single\n * `resolveTableNameForResource` helper that the hybrid planner, the PostgreSQL\n * repository and the boot-time table verifier all call.\n *\n * This was NOT always true, and the way it failed is the reason to keep it\n * true: PostgreSQL used to derive its table name straight from\n * `resourceIdentifier`, so `USER_SELF` planned, wrote and verified a `userself`\n * table while `USERS` used `users`. An adapter choice must never silently\n * change WHICH RECORDS a resource addresses — that is not a storage detail, it\n * is the \"two doors, one record set\" contract itself. On the SQL side the\n * resolved name is additionally normalised into a SQL identifier; casing is an\n * adapter concern, the alias is not.\n *\n * The one thing a shared resolver still cannot see is an alias group whose\n * members are pointed at DIFFERENT adapters — each config is individually\n * valid, and only the pair is wrong. That is what\n * {@link findSharedPersistenceCollectionAdapterIncoherences} fails closed on.\n */\nexport const RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES: Readonly<Record<string, string>> = {\n [CoreResourceType.USER_SELF]: CoreResourceType.USERS,\n [CoreResourceType.USER_SELF_PROFILES]: CoreResourceType.USER_PROFILES,\n [CoreResourceType.USER_SELF_PREFERENCES]: CoreResourceType.USER_PREFERENCES,\n /*\n * The application-scoped audit door addresses the organization-scoped resource's rows (#317).\n *\n * Unlike the `USER_SELF` group above — where the alias exists so a principal can address its OWN\n * row through a narrower door — this pair exists because the two doors see DIFFERENT SUBSETS of\n * one set: the organization door is tenant-filtered and structurally cannot return the rows that\n * carry no organization (logins, session evictions, application-wide policy changes), which is\n * 74% of them on a measured dogfood application. Splitting the storage would split the audit\n * trail itself, so the alias is load-bearing rather than a convenience.\n */\n [CoreResourceType.APPLICATION_AUDIT_LOGS]: CoreResourceType.AUDIT_LOGS,\n};\n\n/**\n * The persistence collection a resource type's rows live in — its alias target\n * when it declares one, otherwise the resource type itself.\n *\n * @param resourceType - the resource type whose storage location is wanted.\n * @returns the collection name, as a plain string.\n */\nexport function resolveSharedPersistenceCollectionName(resourceType: ResourceType): string {\n return RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES[resourceType as string] ?? (resourceType as string);\n}\n\n/** The minimal config shape {@link findSharedPersistenceCollectionAdapterIncoherences} reads. */\nexport interface SharedPersistenceCollectionAdapterCandidate {\n readonly resourceIdentifier: ResourceType;\n /** The config's OWN declaration; `undefined` means \"inherit the application default\". */\n readonly persistenceAdapter?: PersistenceAdapterType | undefined;\n}\n\n/** One collection whose resource configs are pointed at different databases. */\nexport interface SharedPersistenceCollectionAdapterIncoherence {\n /** The shared collection the disagreeing configs claim to address. */\n readonly collectionName: string;\n /** Every resource config addressing that collection, with the adapter it RESOLVED to. */\n readonly adapters: readonly { resourceType: ResourceType; adapter: PersistenceAdapterType }[];\n /** Operator-facing explanation naming the consequence and the fix. */\n readonly message: string;\n}\n\n/**\n * Registry-ASSEMBLY guardrail: every resource config that resolves to the SAME\n * persistence collection must resolve to the SAME persistence adapter.\n *\n * ## Why the shared resolver cannot cover this on its own\n *\n * {@link resolveSharedPersistenceCollectionName} makes the alias\n * adapter-independent: whichever database a resource lands in, it addresses the\n * aliased NAME. That is necessary and not sufficient. A name is only an address\n * WITHIN one database, so pointing `USERS` at PostgreSQL while `USER_SELF`\n * inherits MongoDB yields two stores that both believe they own the same rows.\n * Nothing downstream can detect it: each config is individually valid, each\n * repository is correctly built, and every per-resource check passes.\n *\n * ## The failure it prevents\n *\n * The doors silently stop sharing records. The admin door lists users the self\n * door cannot read; a self-service update writes to a row the admin door will\n * never see; and — because retention is enforced against ROWS — an erasure\n * performed through one door leaves the other door's copy completely\n * untouched, which is the same compliance-grade lie that\n * {@link findSharedPersistenceCollectionRetentionIncoherences} exists to\n * prevent, arrived at from a different direction.\n *\n * The table name is not the only thing that follows from the adapter. Id FORMAT\n * does too — the PostgreSQL repository validates ids as UUIDs while Mongo\n * expects ObjectIds, each resolved from its OWN resource's adapter — so a split\n * group would also reject through one door the very ids the other door mints.\n * Anything keyed on \"this resource's adapter\" inherits this invariant.\n *\n * ## Why this is permanent, not a capability gate\n *\n * Unlike adapter gaps that close when the missing support is implemented, this\n * one has no future in which it becomes valid: two databases cannot hold one\n * set of rows. It is deliberately NOT a ban on aliased resources using\n * PostgreSQL — an alias group that agrees on PostgreSQL resolves to one shared\n * table, and whether that table was actually provisioned is a separate,\n * already-enforced question (the boot-time table verifier).\n *\n * Resources inherit the application default when they declare nothing, so the\n * caller supplies the resolved default rather than this function guessing it.\n *\n * Pure and side-effect free: it reports, the caller throws.\n *\n * @param resourceConfigurations - every assembled resource config, keyed by resource type.\n * @param defaultPersistenceAdapter - the adapter a config with no declaration inherits.\n * @returns one entry per incoherent collection; empty when the registry is coherent.\n */\nexport function findSharedPersistenceCollectionAdapterIncoherences(\n resourceConfigurations: Record<string, SharedPersistenceCollectionAdapterCandidate>,\n defaultPersistenceAdapter: PersistenceAdapterType,\n): SharedPersistenceCollectionAdapterIncoherence[] {\n const adaptersByCollection = new Map<\n string,\n { resourceType: ResourceType; adapter: PersistenceAdapterType }[]\n >();\n\n for (const [resourceTypeKey, resourceConfig] of Object.entries(resourceConfigurations)) {\n // Same reasoning as the retention guard: prefer the config's OWN identifier so a mis-keyed\n // registry entry is diagnosed against the name its author actually wrote.\n const resourceType = (resourceConfig?.resourceIdentifier ?? resourceTypeKey) as ResourceType;\n const collectionName = resolveSharedPersistenceCollectionName(resourceType);\n const entry = {\n resourceType,\n adapter: resourceConfig?.persistenceAdapter ?? defaultPersistenceAdapter,\n };\n\n const existing = adaptersByCollection.get(collectionName);\n if (existing) {\n existing.push(entry);\n } else {\n adaptersByCollection.set(collectionName, [entry]);\n }\n }\n\n const incoherences: SharedPersistenceCollectionAdapterIncoherence[] = [];\n\n for (const [collectionName, adapters] of adaptersByCollection) {\n if (adapters.length < 2) {\n continue;\n }\n if (new Set(adapters.map((entry) => entry.adapter)).size < 2) {\n continue;\n }\n\n const declared = adapters\n .map((entry) => `'${String(entry.resourceType)}' → ${entry.adapter}`)\n .join(', ');\n\n incoherences.push({\n collectionName,\n adapters,\n message:\n `Resource configs [${declared}] all address the '${collectionName}' persistence collection but ` +\n `resolve to DIFFERENT persistence adapters. These configs are separate doors onto ONE set of ` +\n `rows, and a collection name only addresses rows within a single database, so this splits them ` +\n `across two stores that each believe they own the records: the admin door lists rows the self ` +\n `door cannot read, a self-service write lands where the admin door will never see it, and an ` +\n `erasure performed through one door leaves the other door's copy fully intact. Give every ` +\n `config listed above the same persistenceAdapter (a resource sharing a collection cannot pick ` +\n `its database alone), or stop sharing the collection.`,\n });\n }\n\n return incoherences;\n}\n\n/** The minimal config shape {@link findSharedPersistenceCollectionRetentionIncoherences} reads. */\nexport interface SharedPersistenceCollectionRetentionCandidate {\n readonly resourceIdentifier: ResourceType;\n readonly retentionPolicy?: { mode?: ErasureRetentionMode } | undefined;\n}\n\n/**\n * Canonical comparison key for a resource's retention POSTURE.\n *\n * Compares the WHOLE resolved policy, not just `mode`. `ResourceRetentionPolicy` carries a single\n * axis today, so `mode` alone would be exhaustive — but this guard exists precisely because config\n * checks that look sufficient go quietly wrong later, and a second axis (a disposal clock, a\n * jurisdiction) added to the policy would otherwise escape the comparison with no compile-time\n * signal. Two configs over one collection must agree on ALL of it.\n *\n * Key order is normalised so authoring order cannot masquerade as a disagreement. `undefined` gets\n * its own key rather than being skipped: \"rows of this resource are hard-deleted\" is a positive\n * claim, and the in-vs-out asymmetry is what produces both failure modes documented below.\n */\nfunction buildRetentionPostureKey(retentionPolicy: { mode?: ErasureRetentionMode } | undefined): string {\n if (retentionPolicy === undefined || retentionPolicy === null) {\n return 'NOT_GOVERNED';\n }\n const entries = Object.entries(retentionPolicy as Record<string, unknown>)\n .filter(([, value]) => value !== undefined)\n .sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey));\n return entries.length === 0 ? 'NOT_GOVERNED' : JSON.stringify(entries);\n}\n\n/** One collection whose resource configs disagree about retention governance. */\nexport interface SharedPersistenceCollectionRetentionIncoherence {\n /** The shared collection the disagreeing configs write to. */\n readonly collectionName: string;\n /** Every resource config addressing that collection, with the posture it declared. */\n readonly postures: readonly { resourceType: ResourceType; mode: ErasureRetentionMode | undefined }[];\n /** Operator-facing explanation naming both failure modes and the fix. */\n readonly message: string;\n}\n\n/**\n * Registry-ASSEMBLY guardrail: every resource config that resolves to the SAME\n * persistence collection must declare the SAME retention posture.\n *\n * ## Why a config that passes every per-resource check can still be broken\n *\n * `retentionPolicy` is validated PER RESOURCE CONFIG by the config factory: it\n * checks that resource's operations, its field treatments, its system-access\n * grants. It cannot check what a SIBLING config declares, because a factory\n * invocation never sees one. But retention is enforced against ROWS, and two\n * configs can own the same rows (see\n * {@link RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES}). So a pair that\n * disagrees produces a config where every individual resource is valid and the\n * COLLECTION is not.\n *\n * ## The two concrete failure modes\n *\n * **1. Fail-open erasure.** The retention hide filter (rows marked `RETAINED`\n * are invisible) and the immutability freeze are injected per resource config,\n * in `buildContextualFilter`. A row erased through the governed door stays\n * fully READABLE and UPDATABLE through the ungoverned one. For the\n * `USERS`/`USER_SELF` pair that ungoverned door exposes READ + UPDATE to\n * `APP_USER` — i.e. the erased subject can still read and edit their own\n * \"erased\" record. The row is erased only from the door that was opted in,\n * which is a compliance-grade lie about the record.\n *\n * **2. Unique-index collision — a hard functional abort.** A retention-governed\n * config scopes each unique index to NON-retained rows (a partial filter on the\n * retention marker), precisely so scrubbed rows leave the index and cannot\n * collide on the shared mask value. An ungoverned config over the same\n * collection emits a PLAIN unique index on the same field. The FIRST erasure\n * succeeds; the SECOND writes the same mask value, hits the plain index, and\n * fails E11000 — inside the erasure transaction, so the whole erasure rolls\n * back. The capability is silently single-use.\n *\n * Both modes are invisible until a real erasure runs, which is why this is a\n * BOOT-time guard and not a test: the point is that a config which passes at\n * boot must actually be able to perform an erasure.\n *\n * ## Why \"one opted in, one not\" is a disagreement, not a default\n *\n * An absent `retentionPolicy` is a positive statement — \"rows of this resource\n * are hard-deleted\" — not an unset value the governed sibling can supply. Both\n * failure modes above are produced by exactly that asymmetry, so `undefined`\n * participates in the comparison as its own posture rather than being skipped.\n *\n * Pure and side-effect free: it reports, the caller throws. That keeps the\n * shared-collection fact and its invariant in the layer both persistence and\n * validation can import, while the registry owns the error shape.\n *\n * @param resourceConfigurations - every assembled resource config, keyed by resource type.\n * @returns one entry per incoherent collection; empty when the registry is coherent.\n */\nexport function findSharedPersistenceCollectionRetentionIncoherences(\n resourceConfigurations: Record<string, SharedPersistenceCollectionRetentionCandidate>,\n): SharedPersistenceCollectionRetentionIncoherence[] {\n const posturesByCollection = new Map<\n string,\n { resourceType: ResourceType; mode: ErasureRetentionMode | undefined; postureKey: string }[]\n >();\n\n for (const [resourceTypeKey, resourceConfig] of Object.entries(resourceConfigurations)) {\n // Prefer the config's OWN identifier over the map key: the registry keys by resource type, but a\n // host that mis-keyed an entry would otherwise be diagnosed against a name it never authored.\n const resourceType = (resourceConfig?.resourceIdentifier ?? resourceTypeKey) as ResourceType;\n const collectionName = resolveSharedPersistenceCollectionName(resourceType);\n const posture = {\n resourceType,\n mode: resourceConfig?.retentionPolicy?.mode,\n postureKey: buildRetentionPostureKey(resourceConfig?.retentionPolicy),\n };\n\n const existing = posturesByCollection.get(collectionName);\n if (existing) {\n existing.push(posture);\n } else {\n posturesByCollection.set(collectionName, [posture]);\n }\n }\n\n const incoherences: SharedPersistenceCollectionRetentionIncoherence[] = [];\n\n for (const [collectionName, postures] of posturesByCollection) {\n if (postures.length < 2) {\n continue;\n }\n const distinctPostures = new Set(postures.map((posture) => posture.postureKey));\n if (distinctPostures.size < 2) {\n continue;\n }\n\n const declared = postures\n .map((posture) => `'${String(posture.resourceType)}' → ${posture.mode ?? 'NOT retention-governed'}`)\n .join(', ');\n\n incoherences.push({\n collectionName,\n postures,\n message:\n `Resource configs [${declared}] all store in the '${collectionName}' collection but declare ` +\n `DIFFERENT retention postures. They are separate models over ONE set of rows, and retention is ` +\n `enforced per resource config, so this ships two defects that only appear when a real erasure ` +\n `runs: (1) FAIL-OPEN ERASURE — the retention hide filter and the immutability freeze are absent ` +\n `on the ungoverned door, leaving an erased row readable and updatable there; (2) UNIQUE-INDEX ` +\n `COLLISION — the governed config scopes its unique indexes to non-retained rows while the ` +\n `ungoverned one emits plain unique indexes on the same collection, so the SECOND erased row ` +\n `collides (E11000) and the erasure transaction rolls back. Declare the SAME retentionPolicy on ` +\n `every config listed above (a resource sharing a collection cannot opt in or out alone), or ` +\n `stop sharing the collection.`,\n });\n }\n\n return incoherences;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shared-persistence-collection.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/shared-persistence-collection.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAKxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,CAAC,MAAM,8CAA8C,GAAqC;IAC9F,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC,KAAK;IACpD,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,gBAAgB,CAAC,aAAa;IACrE,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB;IAC3E;;;;;;;;;OASG;IACH,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,gBAAgB,CAAC,UAAU;CACvE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,sCAAsC,CAAC,YAA0B;IAC/E,OAAO,8CAA8C,CAAC,YAAsB,CAAC,IAAK,YAAuB,CAAC;AAC5G,CAAC;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,UAAU,kDAAkD,CAChE,sBAAmF,EACnF,yBAAiD;IAEjD,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAGjC,CAAC;IAEJ,KAAK,MAAM,CAAC,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FAA+F;gBAC/F,2FAA2F;gBAC3F,6FAA6F;gBAC7F,gGAAgG;gBAChG,6FAA6F;gBAC7F,8BAA8B;SACjC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAN,IAAY,iCAKX;AALD,WAAY,iCAAiC;IAC3C,kDAAa,CAAA;IACb,oDAAe,CAAA;IACf,sDAAiB,CAAA;IACjB,0DAAqB,CAAA;AACvB,CAAC,EALW,iCAAiC,KAAjC,iCAAiC,QAK5C","sourcesContent":["import { CoreResourceType } from '../resources.shared.core.definitions';\nimport type { ResourceType } from '../resources.shared.schemas';\nimport type { PersistenceAdapterType } from '../resources-config.shared.schemas';\nimport { ErasureRetentionMode } from '../../compliance/privacy/impersonalization.shared.schemas';\n\n/**\n * Resource types that deliberately project onto ANOTHER resource type's\n * persistence collection — THE authority for \"which configs address the same\n * physical rows?\".\n *\n * ## What this expresses\n *\n * A `USER_SELF*` resource is not a different record set; it is a different DOOR\n * onto the SAME record set, with its own operations, roles and scoping. The\n * `USERS` door is the admin surface (list every user, delete a user); the\n * `USER_SELF` door is the self surface (read/update MY row). They intentionally\n * share `UserSchema` and they intentionally share storage — the persistence\n * layer builds a SEPARATE model per resource config over ONE collection.\n *\n * Anything not listed here stores under its own resource type.\n *\n * ## Why it is a single named authority\n *\n * This mapping had already been copied twice inside the backend (the\n * zod→mongoose model builder, which is what actually creates and reads the\n * collection, and the aggregation collection resolver — whose earlier\n * divergence made every aggregation query a non-existent collection and return\n * zero rows). It now has a third consumer of a completely different kind:\n * {@link findSharedPersistenceCollectionRetentionIncoherences}, a boot-time\n * coherence guard. A per-resource config factory structurally cannot see this\n * relationship — it validates ONE config at a time — so the fact has to live\n * where every layer can read it, and it has to live exactly once.\n *\n * ## The alias belongs to the RESOURCE, not to the storage adapter\n *\n * Every persistence path resolves through this map, and each adapter has\n * exactly ONE composition point that does so: MongoDB's model builder and its\n * aggregation resolver, and — on the SQL side — the single\n * `resolveTableNameForResource` helper that the hybrid planner, the PostgreSQL\n * repository and the boot-time table verifier all call.\n *\n * This was NOT always true, and the way it failed is the reason to keep it\n * true: PostgreSQL used to derive its table name straight from\n * `resourceIdentifier`, so `USER_SELF` planned, wrote and verified a `userself`\n * table while `USERS` used `users`. An adapter choice must never silently\n * change WHICH RECORDS a resource addresses — that is not a storage detail, it\n * is the \"two doors, one record set\" contract itself. On the SQL side the\n * resolved name is additionally normalised into a SQL identifier; casing is an\n * adapter concern, the alias is not.\n *\n * The one thing a shared resolver still cannot see is an alias group whose\n * members are pointed at DIFFERENT adapters — each config is individually\n * valid, and only the pair is wrong. That is what\n * {@link findSharedPersistenceCollectionAdapterIncoherences} fails closed on.\n */\nexport const RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES: Readonly<Record<string, string>> = {\n [CoreResourceType.USER_SELF]: CoreResourceType.USERS,\n [CoreResourceType.USER_SELF_PROFILES]: CoreResourceType.USER_PROFILES,\n [CoreResourceType.USER_SELF_PREFERENCES]: CoreResourceType.USER_PREFERENCES,\n /*\n * The application-scoped audit door addresses the organization-scoped resource's rows (#317).\n *\n * Unlike the `USER_SELF` group above — where the alias exists so a principal can address its OWN\n * row through a narrower door — this pair exists because the two doors see DIFFERENT SUBSETS of\n * one set: the organization door is tenant-filtered and structurally cannot return the rows that\n * carry no organization (logins, session evictions, application-wide policy changes), which is\n * 74% of them on a measured dogfood application. Splitting the storage would split the audit\n * trail itself, so the alias is load-bearing rather than a convenience.\n */\n [CoreResourceType.APPLICATION_AUDIT_LOGS]: CoreResourceType.AUDIT_LOGS,\n};\n\n/**\n * The persistence collection a resource type's rows live in — its alias target\n * when it declares one, otherwise the resource type itself.\n *\n * @param resourceType - the resource type whose storage location is wanted.\n * @returns the collection name, as a plain string.\n */\nexport function resolveSharedPersistenceCollectionName(resourceType: ResourceType): string {\n return RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES[resourceType as string] ?? (resourceType as string);\n}\n\n/** The minimal config shape {@link findSharedPersistenceCollectionAdapterIncoherences} reads. */\nexport interface SharedPersistenceCollectionAdapterCandidate {\n readonly resourceIdentifier: ResourceType;\n /** The config's OWN declaration; `undefined` means \"inherit the application default\". */\n readonly persistenceAdapter?: PersistenceAdapterType | undefined;\n}\n\n/** One collection whose resource configs are pointed at different databases. */\nexport interface SharedPersistenceCollectionAdapterIncoherence {\n /** The shared collection the disagreeing configs claim to address. */\n readonly collectionName: string;\n /** Every resource config addressing that collection, with the adapter it RESOLVED to. */\n readonly adapters: readonly { resourceType: ResourceType; adapter: PersistenceAdapterType }[];\n /** Operator-facing explanation naming the consequence and the fix. */\n readonly message: string;\n}\n\n/**\n * Registry-ASSEMBLY guardrail: every resource config that resolves to the SAME\n * persistence collection must resolve to the SAME persistence adapter.\n *\n * ## Why the shared resolver cannot cover this on its own\n *\n * {@link resolveSharedPersistenceCollectionName} makes the alias\n * adapter-independent: whichever database a resource lands in, it addresses the\n * aliased NAME. That is necessary and not sufficient. A name is only an address\n * WITHIN one database, so pointing `USERS` at PostgreSQL while `USER_SELF`\n * inherits MongoDB yields two stores that both believe they own the same rows.\n * Nothing downstream can detect it: each config is individually valid, each\n * repository is correctly built, and every per-resource check passes.\n *\n * ## The failure it prevents\n *\n * The doors silently stop sharing records. The admin door lists users the self\n * door cannot read; a self-service update writes to a row the admin door will\n * never see; and — because retention is enforced against ROWS — an erasure\n * performed through one door leaves the other door's copy completely\n * untouched, which is the same compliance-grade lie that\n * {@link findSharedPersistenceCollectionRetentionIncoherences} exists to\n * prevent, arrived at from a different direction.\n *\n * The table name is not the only thing that follows from the adapter. Id FORMAT\n * does too — the PostgreSQL repository validates ids as UUIDs while Mongo\n * expects ObjectIds, each resolved from its OWN resource's adapter — so a split\n * group would also reject through one door the very ids the other door mints.\n * Anything keyed on \"this resource's adapter\" inherits this invariant.\n *\n * ## Why this is permanent, not a capability gate\n *\n * Unlike adapter gaps that close when the missing support is implemented, this\n * one has no future in which it becomes valid: two databases cannot hold one\n * set of rows. It is deliberately NOT a ban on aliased resources using\n * PostgreSQL — an alias group that agrees on PostgreSQL resolves to one shared\n * table, and whether that table was actually provisioned is a separate,\n * already-enforced question (the boot-time table verifier).\n *\n * Resources inherit the application default when they declare nothing, so the\n * caller supplies the resolved default rather than this function guessing it.\n *\n * Pure and side-effect free: it reports, the caller throws.\n *\n * @param resourceConfigurations - every assembled resource config, keyed by resource type.\n * @param defaultPersistenceAdapter - the adapter a config with no declaration inherits.\n * @returns one entry per incoherent collection; empty when the registry is coherent.\n */\nexport function findSharedPersistenceCollectionAdapterIncoherences(\n resourceConfigurations: Record<string, SharedPersistenceCollectionAdapterCandidate>,\n defaultPersistenceAdapter: PersistenceAdapterType,\n): SharedPersistenceCollectionAdapterIncoherence[] {\n const adaptersByCollection = new Map<\n string,\n { resourceType: ResourceType; adapter: PersistenceAdapterType }[]\n >();\n\n for (const [resourceTypeKey, resourceConfig] of Object.entries(resourceConfigurations)) {\n // Same reasoning as the retention guard: prefer the config's OWN identifier so a mis-keyed\n // registry entry is diagnosed against the name its author actually wrote.\n const resourceType = (resourceConfig?.resourceIdentifier ?? resourceTypeKey) as ResourceType;\n const collectionName = resolveSharedPersistenceCollectionName(resourceType);\n const entry = {\n resourceType,\n adapter: resourceConfig?.persistenceAdapter ?? defaultPersistenceAdapter,\n };\n\n const existing = adaptersByCollection.get(collectionName);\n if (existing) {\n existing.push(entry);\n } else {\n adaptersByCollection.set(collectionName, [entry]);\n }\n }\n\n const incoherences: SharedPersistenceCollectionAdapterIncoherence[] = [];\n\n for (const [collectionName, adapters] of adaptersByCollection) {\n if (adapters.length < 2) {\n continue;\n }\n if (new Set(adapters.map((entry) => entry.adapter)).size < 2) {\n continue;\n }\n\n const declared = adapters\n .map((entry) => `'${String(entry.resourceType)}' → ${entry.adapter}`)\n .join(', ');\n\n incoherences.push({\n collectionName,\n adapters,\n message:\n `Resource configs [${declared}] all address the '${collectionName}' persistence collection but ` +\n `resolve to DIFFERENT persistence adapters. These configs are separate doors onto ONE set of ` +\n `rows, and a collection name only addresses rows within a single database, so this splits them ` +\n `across two stores that each believe they own the records: the admin door lists rows the self ` +\n `door cannot read, a self-service write lands where the admin door will never see it, and an ` +\n `erasure performed through one door leaves the other door's copy fully intact. Give every ` +\n `config listed above the same persistenceAdapter (a resource sharing a collection cannot pick ` +\n `its database alone), or stop sharing the collection.`,\n });\n }\n\n return incoherences;\n}\n\n/** The minimal config shape {@link findSharedPersistenceCollectionRetentionIncoherences} reads. */\nexport interface SharedPersistenceCollectionRetentionCandidate {\n readonly resourceIdentifier: ResourceType;\n readonly retentionPolicy?: { mode?: ErasureRetentionMode } | undefined;\n}\n\n/**\n * Canonical comparison key for a resource's retention POSTURE.\n *\n * Compares the WHOLE resolved policy, not just `mode`. `ResourceRetentionPolicy` carries a single\n * axis today, so `mode` alone would be exhaustive — but this guard exists precisely because config\n * checks that look sufficient go quietly wrong later, and a second axis (a disposal clock, a\n * jurisdiction) added to the policy would otherwise escape the comparison with no compile-time\n * signal. Two configs over one collection must agree on ALL of it.\n *\n * Key order is normalised so authoring order cannot masquerade as a disagreement. `undefined` gets\n * its own key rather than being skipped: \"rows of this resource are hard-deleted\" is a positive\n * claim, and the in-vs-out asymmetry is what produces both failure modes documented below.\n */\nfunction buildRetentionPostureKey(retentionPolicy: { mode?: ErasureRetentionMode } | undefined): string {\n if (retentionPolicy === undefined || retentionPolicy === null) {\n return 'NOT_GOVERNED';\n }\n const entries = Object.entries(retentionPolicy as Record<string, unknown>)\n .filter(([, value]) => value !== undefined)\n .sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey));\n return entries.length === 0 ? 'NOT_GOVERNED' : JSON.stringify(entries);\n}\n\n/** One collection whose resource configs disagree about retention governance. */\nexport interface SharedPersistenceCollectionRetentionIncoherence {\n /** The shared collection the disagreeing configs write to. */\n readonly collectionName: string;\n /** Every resource config addressing that collection, with the posture it declared. */\n readonly postures: readonly { resourceType: ResourceType; mode: ErasureRetentionMode | undefined }[];\n /** Operator-facing explanation naming both failure modes and the fix. */\n readonly message: string;\n}\n\n/**\n * Registry-ASSEMBLY guardrail: every resource config that resolves to the SAME\n * persistence collection must declare the SAME retention posture.\n *\n * ## Why a config that passes every per-resource check can still be broken\n *\n * `retentionPolicy` is validated PER RESOURCE CONFIG by the config factory: it\n * checks that resource's operations, its field treatments, its system-access\n * grants. It cannot check what a SIBLING config declares, because a factory\n * invocation never sees one. But retention is enforced against ROWS, and two\n * configs can own the same rows (see\n * {@link RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES}). So a pair that\n * disagrees produces a config where every individual resource is valid and the\n * COLLECTION is not.\n *\n * ## The two concrete failure modes\n *\n * **1. Fail-open erasure.** The retention hide filter (rows marked `RETAINED`\n * are invisible) and the immutability freeze are injected per resource config,\n * in `buildContextualFilter`. A row erased through the governed door stays\n * fully READABLE and UPDATABLE through the ungoverned one. For the\n * `USERS`/`USER_SELF` pair that ungoverned door exposes READ + UPDATE to\n * `APP_USER` — i.e. the erased subject can still read and edit their own\n * \"erased\" record. The row is erased only from the door that was opted in,\n * which is a compliance-grade lie about the record.\n *\n * **2. Unique-index collision — a hard functional abort.** A retention-governed\n * config scopes each unique index to NON-retained rows (a partial filter on the\n * retention marker), precisely so scrubbed rows leave the index and cannot\n * collide on the shared mask value. An ungoverned config over the same\n * collection emits a PLAIN unique index on the same field. The FIRST erasure\n * succeeds; the SECOND writes the same mask value, hits the plain index, and\n * fails E11000 — inside the erasure transaction, so the whole erasure rolls\n * back. The capability is silently single-use.\n *\n * Both modes are invisible until a real erasure runs, which is why this is a\n * BOOT-time guard and not a test: the point is that a config which passes at\n * boot must actually be able to perform an erasure.\n *\n * ## Why \"one opted in, one not\" is a disagreement, not a default\n *\n * An absent `retentionPolicy` is a positive statement — \"rows of this resource\n * are hard-deleted\" — not an unset value the governed sibling can supply. Both\n * failure modes above are produced by exactly that asymmetry, so `undefined`\n * participates in the comparison as its own posture rather than being skipped.\n *\n * Pure and side-effect free: it reports, the caller throws. That keeps the\n * shared-collection fact and its invariant in the layer both persistence and\n * validation can import, while the registry owns the error shape.\n *\n * @param resourceConfigurations - every assembled resource config, keyed by resource type.\n * @returns one entry per incoherent collection; empty when the registry is coherent.\n */\nexport function findSharedPersistenceCollectionRetentionIncoherences(\n resourceConfigurations: Record<string, SharedPersistenceCollectionRetentionCandidate>,\n): SharedPersistenceCollectionRetentionIncoherence[] {\n const posturesByCollection = new Map<\n string,\n { resourceType: ResourceType; mode: ErasureRetentionMode | undefined; postureKey: string }[]\n >();\n\n for (const [resourceTypeKey, resourceConfig] of Object.entries(resourceConfigurations)) {\n // Prefer the config's OWN identifier over the map key: the registry keys by resource type, but a\n // host that mis-keyed an entry would otherwise be diagnosed against a name it never authored.\n const resourceType = (resourceConfig?.resourceIdentifier ?? resourceTypeKey) as ResourceType;\n const collectionName = resolveSharedPersistenceCollectionName(resourceType);\n const posture = {\n resourceType,\n mode: resourceConfig?.retentionPolicy?.mode,\n postureKey: buildRetentionPostureKey(resourceConfig?.retentionPolicy),\n };\n\n const existing = posturesByCollection.get(collectionName);\n if (existing) {\n existing.push(posture);\n } else {\n posturesByCollection.set(collectionName, [posture]);\n }\n }\n\n const incoherences: SharedPersistenceCollectionRetentionIncoherence[] = [];\n\n for (const [collectionName, postures] of posturesByCollection) {\n if (postures.length < 2) {\n continue;\n }\n const distinctPostures = new Set(postures.map((posture) => posture.postureKey));\n if (distinctPostures.size < 2) {\n continue;\n }\n\n const declared = postures\n .map((posture) => `'${String(posture.resourceType)}' → ${posture.mode ?? 'NOT retention-governed'}`)\n .join(', ');\n\n incoherences.push({\n collectionName,\n postures,\n message:\n `Resource configs [${declared}] all store in the '${collectionName}' collection but declare ` +\n `DIFFERENT retention postures. They are separate models over ONE set of rows, and retention is ` +\n `enforced per resource config, so this ships two defects that only appear when a real erasure ` +\n `runs: (1) FAIL-OPEN ERASURE — the retention hide filter and the immutability freeze are absent ` +\n `on the ungoverned door, leaving an erased row readable and updatable there; (2) UNIQUE-INDEX ` +\n `COLLISION — the governed config scopes its unique indexes to non-retained rows while the ` +\n `ungoverned one emits plain unique indexes on the same collection, so the SECOND erased row ` +\n `collides (E11000) and the erasure transaction rolls back. Declare the SAME retentionPolicy on ` +\n `every config listed above (a resource sharing a collection cannot opt in or out alone), or ` +\n `stop sharing the collection.`,\n });\n }\n\n return incoherences;\n}\n\n/**\n * The privilege AXES a database credential issued to a named runtime principal (a minion) is built\n * from — one closed vocabulary shared by every storage adapter that mints such a credential.\n *\n * Each axis is a distinct verb set, not a strength on a scale, and they must never be merged:\n *\n * - {@link READ} — read rows.\n * - {@link WRITE} — insert, update and delete. The only axis that can REMOVE a row.\n * - {@link APPEND} — insert only. A principal can add a row and never amend or remove it, which is\n * what makes it the axis for evidence: an audit trail a principal can rewrite is not an audit trail.\n * - {@link MAINTAIN} — insert and update, never delete, for durable runtime state whose history must\n * survive the principal that advances it.\n *\n * It lives beside the collection aliases because a grant is issued per COLLECTION: the alias map says\n * which rows a grant on a resource type reaches, and this says which verbs it carries there. The\n * derivation that fills each axis, and the engine floor it adds, live in `platform-config-lib`\n * (`deriveMinionDatabaseGrants`); the MongoDB and PostgreSQL adapters each translate an axis into\n * their own privilege dialect.\n *\n * Scope, stated because it is easy to over-read: this governs NAMED runtime principals only. The\n * application backend is not issued an axis-scoped credential — it owns its database — so nothing\n * here constrains what the backend's own credential can do to a row.\n */\nexport enum RuntimePrincipalDatabaseGrantAxis {\n READ = 'read',\n WRITE = 'write',\n APPEND = 'append',\n MAINTAIN = 'maintain',\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templatable-file-fields.shared.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/templatable-file-fields.shared.utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"templatable-file-fields.shared.utils.d.ts","sourceRoot":"","sources":["../../../../../src/resources/utils/templatable-file-fields.shared.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAkBL,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,CAAC,EAAE,CACpB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,KAChC,CAAC,CAAC,UAAU,CAAC;CACnB;AAiBD,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,yCAA0C,SAAQ,KAAK;aAEhD,SAAS,EAAE,MAAM;aACjB,gBAAgB,EAAE,kBAAkB,GAAG,SAAS;aAChD,mBAAmB,EAAE,kBAAkB,GAAG,SAAS;gBAFnD,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,kBAAkB,GAAG,SAAS,EAChD,mBAAmB,EAAE,kBAAkB,GAAG,SAAS;CAOtE;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,CAAC,CAAC,UAAU,EACpB,UAAU,SAAK,EACf,aAAa,UAAQ,EACrB,aAAa,GAAE,OAAO,CAAC,MAAM,CAAyB,GACrD,wBAAwB,EAAE,CAmG5B;AAmDD;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,CAAC,CAAC,UAAU,EACpB,OAAO,GAAE,iCAAsC,EAC/C,aAAa,GAAE,OAAO,CAAC,MAAM,CAAyB,GACrD,CAAC,CAAC,UAAU,CAgOd"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import { getFileMetadata, getZodDefArrayProperty, getZodDef, getZodDefProperty, getZodDefSchemaProperty, getZodDefStringProperty, getZodObjectShape, getZodType, isTemplatableFileField, isZodArray, isZodDefault, isZodNullable, isZodObject, isZodOptional, unwrapSchema, withArrayElement, } from '@wildo-ai/zod-decorators';
|
|
1
|
+
import { getFileMetadata, getZodDefArrayProperty, getZodDef, getZodDefProperty, getZodDefSchemaProperty, getZodDefStringProperty, getZodObjectShape, getZodType, isTemplatableFileField, isZodArray, isZodDefault, isZodNullable, isZodObject, isZodOptional, SCHEMA_METADATA, unwrapSchema, withArrayElement, } from '@wildo-ai/zod-decorators';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Carry decorator metadata (`SCHEMA_METADATA`) from a schema onto the instance that replaces it.
|
|
5
|
+
*
|
|
6
|
+
* Structured value types (`z_address`, `z_file`, `z_money`, `z_range`, …) record their identity as
|
|
7
|
+
* metadata on the schema INSTANCE. A rebuild that does not carry it turns the field into a plain
|
|
8
|
+
* object, and the form then renders its parts as unrelated inputs.
|
|
9
|
+
*/
|
|
10
|
+
function carrySchemaMetadata(source, rebuilt) {
|
|
11
|
+
const metadata = source[SCHEMA_METADATA];
|
|
12
|
+
if (metadata !== undefined) {
|
|
13
|
+
rebuilt[SCHEMA_METADATA] = metadata;
|
|
14
|
+
}
|
|
15
|
+
return rebuilt;
|
|
16
|
+
}
|
|
3
17
|
export class IncompatibleTemplatableFileFieldPathError extends Error {
|
|
4
18
|
fieldName;
|
|
5
19
|
existingMetadata;
|
|
@@ -136,17 +150,30 @@ export function stripTemplatableFileFieldsRecursively(schema, options = {}, acti
|
|
|
136
150
|
}
|
|
137
151
|
activeSchemas.add(schema);
|
|
138
152
|
try {
|
|
153
|
+
/*
|
|
154
|
+
* Wrappers hand back the ORIGINAL instance when nothing beneath them changed (#989).
|
|
155
|
+
*
|
|
156
|
+
* They used to rebuild `inner.optional()` unconditionally. A fresh wrapper is a different
|
|
157
|
+
* instance, so the enclosing object read it as "changed" and was rebuilt too — and the rebuild
|
|
158
|
+
* dropped the object's decorator metadata. A `z_address()` nested in any object therefore reached
|
|
159
|
+
* the create and update request DTOs as a plain object, and the form rendered its parts as
|
|
160
|
+
* unrelated text inputs. Identity is what tells the object branch nothing was stripped.
|
|
161
|
+
*/
|
|
139
162
|
if (isZodOptional(schema)) {
|
|
140
163
|
const innerSchema = getZodDefSchemaProperty(schema, 'innerType');
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
164
|
+
if (!innerSchema) {
|
|
165
|
+
return schema;
|
|
166
|
+
}
|
|
167
|
+
const strippedInner = stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas);
|
|
168
|
+
return strippedInner === innerSchema ? schema : carrySchemaMetadata(schema, strippedInner.optional());
|
|
144
169
|
}
|
|
145
170
|
if (isZodNullable(schema)) {
|
|
146
171
|
const innerSchema = getZodDefSchemaProperty(schema, 'innerType');
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
172
|
+
if (!innerSchema) {
|
|
173
|
+
return schema;
|
|
174
|
+
}
|
|
175
|
+
const strippedInner = stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas);
|
|
176
|
+
return strippedInner === innerSchema ? schema : carrySchemaMetadata(schema, strippedInner.nullable());
|
|
150
177
|
}
|
|
151
178
|
if (isZodDefault(schema)) {
|
|
152
179
|
const innerSchema = getZodDefSchemaProperty(schema, 'innerType');
|
|
@@ -154,13 +181,16 @@ export function stripTemplatableFileFieldsRecursively(schema, options = {}, acti
|
|
|
154
181
|
return schema;
|
|
155
182
|
}
|
|
156
183
|
const strippedInner = stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas);
|
|
184
|
+
if (strippedInner === innerSchema) {
|
|
185
|
+
return schema;
|
|
186
|
+
}
|
|
157
187
|
// Re-READ the default per parse rather than carrying a value across. In Zod 4
|
|
158
188
|
// `def.defaultValue` is a GETTER, so reading it here EVALUATES the default —
|
|
159
189
|
// and this stripped schema is built once, at configuration time, so a value
|
|
160
190
|
// read here would be frozen into every parse the process performs. (The old
|
|
161
191
|
// `typeof defaultValue === 'function'` branch could never fire for a dynamic
|
|
162
192
|
// default for the same reason: the getter returns the VALUE, not the factory.)
|
|
163
|
-
return strippedInner.default(() => getZodDefProperty(schema, 'defaultValue'));
|
|
193
|
+
return carrySchemaMetadata(schema, strippedInner.default(() => getZodDefProperty(schema, 'defaultValue')));
|
|
164
194
|
}
|
|
165
195
|
const schemaType = getZodType(schema);
|
|
166
196
|
if (schemaType === 'pipe') {
|
|
@@ -210,9 +240,13 @@ export function stripTemplatableFileFieldsRecursively(schema, options = {}, acti
|
|
|
210
240
|
if (strippedOptions.length < 2) {
|
|
211
241
|
return strippedOptions[0] ?? schema;
|
|
212
242
|
}
|
|
213
|
-
|
|
243
|
+
if (strippedOptions.every((option, index) => option === unionOptions[index])) {
|
|
244
|
+
return schema;
|
|
245
|
+
}
|
|
246
|
+
const rebuiltUnion = discriminator
|
|
214
247
|
? z.discriminatedUnion(discriminator, strippedOptions)
|
|
215
248
|
: z.union(strippedOptions);
|
|
249
|
+
return carrySchemaMetadata(schema, rebuiltUnion);
|
|
216
250
|
}
|
|
217
251
|
if (isZodArray(schema)) {
|
|
218
252
|
const elementSchema = getZodDefProperty(schema, 'element');
|
|
@@ -311,12 +345,16 @@ function rebuildObjectSchemaPreservingSemantics(schema, strippedShape) {
|
|
|
311
345
|
const omittedSchema = removedFields.length > 0
|
|
312
346
|
? schema.omit(Object.fromEntries(removedFields.map((fieldName) => [fieldName, true])))
|
|
313
347
|
: schema;
|
|
314
|
-
|
|
348
|
+
const extended = omittedSchema.extend(strippedShape);
|
|
349
|
+
// Same field set, only a nested field replaced: the object is still what its metadata describes.
|
|
350
|
+
// A field REMOVED means it may not be, so the metadata stays behind on that path (#989).
|
|
351
|
+
return removedFields.length === 0 ? carrySchemaMetadata(schema, extended) : extended;
|
|
315
352
|
}
|
|
316
353
|
catch {
|
|
317
354
|
const rebuiltSchema = z.object(strippedShape);
|
|
318
355
|
const catchallSchema = getZodDefProperty(schema, 'catchall');
|
|
319
|
-
|
|
356
|
+
const rebuilt = catchallSchema ? rebuiltSchema.catchall(catchallSchema) : rebuiltSchema;
|
|
357
|
+
return removedFields.length === 0 ? carrySchemaMetadata(schema, rebuilt) : rebuilt;
|
|
320
358
|
}
|
|
321
359
|
}
|
|
322
360
|
//# sourceMappingURL=templatable-file-fields.shared.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templatable-file-fields.shared.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/templatable-file-fields.shared.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,gBAAgB,GAEjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,MAAM,OAAO,yCAA0C,SAAQ,KAAK;IAEhD;IACA;IACA;IAHlB,YACkB,SAAiB,EACjB,gBAAgD,EAChD,mBAAmD;QAEnE,KAAK,CACH,kFAAkF,SAAS,IAAI,CAChG,CAAC;QANc,cAAS,GAAT,SAAS,CAAQ;QACjB,qBAAgB,GAAhB,gBAAgB,CAAgC;QAChD,wBAAmB,GAAnB,mBAAmB,CAAgC;QAKnE,IAAI,CAAC,IAAI,GAAG,2CAA2C,CAAC;IAC1D,CAAC;CACF;AAED,MAAM,UAAU,gCAAgC,CAC9C,MAAoB,EACpB,UAAU,GAAG,EAAE,EACf,aAAa,GAAG,KAAK,EACrB,gBAAiC,IAAI,OAAO,EAAU;IAEtD,IAAI,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,aAA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AAM,CAAC,CAAC;IAChD,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,aAAa,CAAC,CAAC,CAAC;IAEtG,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC;YAC5C,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAyB,CAAC;YAC9G,CAAC,CAAC,MAAM,CAAC;QAEX,OAAO,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC9C,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAA6B,CAAC;QACzF,OAAO,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IACjF,CAAC;AACH,CAAC","sourcesContent":["import {\n getFileMetadata,\n getZodDefArrayProperty,\n getZodDef,\n getZodDefProperty,\n getZodDefSchemaProperty,\n getZodDefStringProperty,\n getZodObjectShape,\n getZodType,\n isTemplatableFileField,\n isZodArray,\n isZodDefault,\n isZodNullable,\n isZodObject,\n isZodOptional,\n unwrapSchema,\n withArrayElement,\n type FileSchemaMetadata,\n} from '@wildo-ai/zod-decorators';\nimport { z } from 'zod';\n\nexport interface StripTemplatableFileFieldsOptions {\n rebuildObjectSchema?: (\n schema: z.ZodObject<any>,\n shape: Record<string, z.ZodTypeAny>,\n ) => z.ZodTypeAny;\n}\n\nexport interface TemplatableFileFieldPath {\n fieldName: string;\n schema: z.ZodTypeAny;\n isInsideArray: boolean;\n}\n\nexport class IncompatibleTemplatableFileFieldPathError extends Error {\n constructor(\n public readonly fieldName: string,\n public readonly existingMetadata: FileSchemaMetadata | undefined,\n public readonly conflictingMetadata: FileSchemaMetadata | undefined,\n ) {\n super(\n `Incompatible generated file metadata detected for templatable file field path \"${fieldName}\".`,\n );\n this.name = 'IncompatibleTemplatableFileFieldPathError';\n }\n}\n\nexport function collectTemplatableFileFieldPaths(\n schema: z.ZodTypeAny,\n pathPrefix = '',\n isInsideArray = false,\n activeSchemas: WeakSet<object> = new WeakSet<object>(),\n): TemplatableFileFieldPath[] {\n if (activeSchemas.has(schema)) {\n return [];\n }\n\n activeSchemas.add(schema);\n try {\n const rawSchemaType = getZodType(schema);\n if (rawSchemaType === 'pipe') {\n const inSchema = getZodDefSchemaProperty(schema, 'in');\n const outSchema = getZodDefSchemaProperty(schema, 'out');\n return mergeTemplatableFileFieldPaths([\n ...(inSchema ? collectTemplatableFileFieldPaths(inSchema, pathPrefix, isInsideArray, activeSchemas) : []),\n ...(outSchema ? collectTemplatableFileFieldPaths(outSchema, pathPrefix, isInsideArray, activeSchemas) : []),\n ]);\n }\n\n if (isZodOptional(schema) || isZodNullable(schema) || isZodDefault(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n return innerSchema\n ? collectTemplatableFileFieldPaths(innerSchema, pathPrefix, isInsideArray, activeSchemas)\n : [];\n }\n\n const unwrappedSchema = unwrapSchema(schema);\n if (unwrappedSchema !== schema) {\n return collectTemplatableFileFieldPaths(unwrappedSchema, pathPrefix, isInsideArray, activeSchemas);\n }\n\n if (isTemplatableFileField(unwrappedSchema)) {\n return pathPrefix ? [{ fieldName: pathPrefix, schema: unwrappedSchema, isInsideArray }] : [];\n }\n\n const schemaType = getZodType(unwrappedSchema);\n if (schemaType === 'lazy') {\n const lazyGetter = getZodDef(unwrappedSchema)?.getter;\n const lazySchema = typeof lazyGetter === 'function'\n ? lazyGetter()\n : undefined;\n return lazySchema\n ? collectTemplatableFileFieldPaths(lazySchema as z.ZodTypeAny, pathPrefix, isInsideArray, activeSchemas)\n : [];\n }\n\n if (schemaType === 'intersection') {\n const leftSchema = getZodDefSchemaProperty(unwrappedSchema, 'left');\n const rightSchema = getZodDefSchemaProperty(unwrappedSchema, 'right');\n return mergeTemplatableFileFieldPaths([\n ...(leftSchema ? collectTemplatableFileFieldPaths(leftSchema, pathPrefix, isInsideArray, activeSchemas) : []),\n ...(rightSchema ? collectTemplatableFileFieldPaths(rightSchema, pathPrefix, isInsideArray, activeSchemas) : []),\n ]);\n }\n\n if (schemaType === 'union') {\n const unionOptions = getZodDefArrayProperty(unwrappedSchema, 'options') as z.ZodTypeAny[] | undefined;\n return mergeTemplatableFileFieldPaths(\n (unionOptions ?? []).flatMap((option) =>\n collectTemplatableFileFieldPaths(option, pathPrefix, isInsideArray, activeSchemas)\n ),\n );\n }\n\n if (isZodArray(unwrappedSchema)) {\n const elementSchema = getZodDefProperty(unwrappedSchema, 'element') as z.ZodTypeAny | undefined;\n return elementSchema ? collectTemplatableFileFieldPaths(elementSchema, pathPrefix, true, activeSchemas) : [];\n }\n\n if (schemaType === 'record' || schemaType === 'map' || schemaType === 'set') {\n const valueSchema = getZodDefSchemaProperty(unwrappedSchema, 'valueType');\n return valueSchema\n ? collectTemplatableFileFieldPaths(valueSchema, pathPrefix, true, activeSchemas)\n : [];\n }\n\n if (schemaType === 'tuple') {\n const tupleItems = getZodDefArrayProperty(unwrappedSchema, 'items') as z.ZodTypeAny[] | undefined;\n const restSchema = getZodDefSchemaProperty(unwrappedSchema, 'rest');\n return mergeTemplatableFileFieldPaths([\n ...((tupleItems ?? []).flatMap((item) =>\n collectTemplatableFileFieldPaths(item, pathPrefix, true, activeSchemas)\n )),\n ...(restSchema ? collectTemplatableFileFieldPaths(restSchema, pathPrefix, true, activeSchemas) : []),\n ]);\n }\n\n if (!isZodObject(unwrappedSchema)) {\n return [];\n }\n\n const shape = getZodObjectShape(unwrappedSchema);\n return mergeTemplatableFileFieldPaths(\n Object.entries(shape).flatMap(([fieldName, fieldSchema]) => {\n const nextPath = pathPrefix ? `${pathPrefix}.${fieldName}` : fieldName;\n return collectTemplatableFileFieldPaths(fieldSchema as z.ZodTypeAny, nextPath, isInsideArray, activeSchemas);\n }),\n );\n } finally {\n activeSchemas.delete(schema);\n }\n}\n\nfunction mergeTemplatableFileFieldPaths(\n fields: TemplatableFileFieldPath[],\n): TemplatableFileFieldPath[] {\n const byFieldName = new Map<string, TemplatableFileFieldPath>();\n for (const field of fields) {\n const existing = byFieldName.get(field.fieldName);\n if (existing && !areTemplatableFileMetadataCompatible(existing.schema, field.schema)) {\n throw new IncompatibleTemplatableFileFieldPathError(\n field.fieldName,\n getFileMetadata(existing.schema),\n getFileMetadata(field.schema),\n );\n }\n byFieldName.set(field.fieldName, existing\n ? {\n ...existing,\n isInsideArray: existing.isInsideArray || field.isInsideArray,\n }\n : field);\n }\n return Array.from(byFieldName.values()).sort((left, right) =>\n left.fieldName.localeCompare(right.fieldName)\n );\n}\n\nfunction normalizeMetadataForComparison(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(normalizeMetadataForComparison);\n }\n\n if (value && typeof value === 'object') {\n return Object.fromEntries(\n Object.entries(value as Record<string, unknown>)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, childValue]) => [key, normalizeMetadataForComparison(childValue)]),\n );\n }\n\n return value;\n}\n\nfunction areTemplatableFileMetadataCompatible(\n leftSchema: z.ZodTypeAny,\n rightSchema: z.ZodTypeAny,\n): boolean {\n return JSON.stringify(normalizeMetadataForComparison(getFileMetadata(leftSchema)))\n === JSON.stringify(normalizeMetadataForComparison(getFileMetadata(rightSchema)));\n}\n\n/**\n * Remove generated PDF file fields from request DTO schemas, including nested\n * structures and union arms. These fields are framework-owned outputs, so they\n * must never appear in frontend/authored write DTOs even when custom DTOs are\n * provided by an application.\n */\nexport function stripTemplatableFileFieldsRecursively(\n schema: z.ZodTypeAny,\n options: StripTemplatableFileFieldsOptions = {},\n activeSchemas: WeakSet<object> = new WeakSet<object>(),\n): z.ZodTypeAny {\n if (activeSchemas.has(schema)) {\n return schema;\n }\n activeSchemas.add(schema);\n\n try {\n if (isZodOptional(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n return innerSchema\n ? stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas).optional()\n : schema;\n }\n\n if (isZodNullable(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n return innerSchema\n ? stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas).nullable()\n : schema;\n }\n\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerSchema) {\n return schema;\n }\n const strippedInner = stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas);\n // Re-READ the default per parse rather than carrying a value across. In Zod 4\n // `def.defaultValue` is a GETTER, so reading it here EVALUATES the default —\n // and this stripped schema is built once, at configuration time, so a value\n // read here would be frozen into every parse the process performs. (The old\n // `typeof defaultValue === 'function'` branch could never fire for a dynamic\n // default for the same reason: the getter returns the VALUE, not the factory.)\n return strippedInner.default(() => getZodDefProperty(schema, 'defaultValue') as unknown);\n }\n\n const schemaType = getZodType(schema);\n if (schemaType === 'pipe') {\n const inSchema = getZodDefSchemaProperty(schema, 'in');\n const outSchema = getZodDefSchemaProperty(schema, 'out');\n const strippedIn = inSchema\n ? stripTemplatableFileFieldsRecursively(inSchema, options, activeSchemas)\n : inSchema;\n const strippedOut = outSchema\n ? stripTemplatableFileFieldsRecursively(outSchema, options, activeSchemas)\n : outSchema;\n if (strippedIn === inSchema && strippedOut === outSchema) {\n return schema;\n }\n if (strippedIn && strippedOut) {\n return z.pipe(strippedIn, strippedOut);\n }\n return strippedOut ?? strippedIn ?? schema;\n }\n\n if (schemaType === 'lazy') {\n const lazyGetter = getZodDef(schema)?.getter;\n if (typeof lazyGetter !== 'function') {\n return schema;\n }\n return z.lazy(() =>\n stripTemplatableFileFieldsRecursively(lazyGetter() as z.ZodTypeAny, options, activeSchemas)\n );\n }\n\n if (schemaType === 'intersection') {\n const leftSchema = getZodDefSchemaProperty(schema, 'left');\n const rightSchema = getZodDefSchemaProperty(schema, 'right');\n const strippedLeft = leftSchema\n ? stripTemplatableFileFieldsRecursively(leftSchema, options, activeSchemas)\n : leftSchema;\n const strippedRight = rightSchema\n ? stripTemplatableFileFieldsRecursively(rightSchema, options, activeSchemas)\n : rightSchema;\n return strippedLeft === leftSchema && strippedRight === rightSchema\n ? schema\n : z.intersection(strippedLeft ?? z.object({}), strippedRight ?? z.object({}));\n }\n\n if (schemaType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n if (!unionOptions?.length) {\n return schema;\n }\n\n const strippedOptions = unionOptions.map((option) =>\n stripTemplatableFileFieldsRecursively(option, options, activeSchemas)\n );\n if (strippedOptions.length < 2) {\n return strippedOptions[0] ?? schema;\n }\n\n return discriminator\n ? z.discriminatedUnion(\n discriminator,\n strippedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]],\n )\n : z.union(strippedOptions as [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]);\n }\n\n if (isZodArray(schema)) {\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny | undefined;\n if (!elementSchema) {\n return schema;\n }\n\n const strippedElement = stripTemplatableFileFieldsRecursively(elementSchema, options, activeSchemas);\n\n // Nothing to strip inside the element — hand back the ORIGINAL schema, the same way the\n // intersection / record / map branches do.\n if (strippedElement === elementSchema) {\n return schema;\n }\n\n // The element WAS rewritten. `withArrayElement` keeps the array's own `.min()` / `.max()` /\n // `.length()` checks across the swap; a plain `z.array(strippedElement)` — what this branch\n // used to do unconditionally — drops them, so an authored constraint never reached the DTO\n // the controller and repository validate against.\n return withArrayElement(schema, strippedElement);\n }\n\n if (schemaType === 'record') {\n const keySchema = getZodDefSchemaProperty(schema, 'keyType');\n const valueSchema = getZodDefSchemaProperty(schema, 'valueType');\n const strippedValue = valueSchema\n ? stripTemplatableFileFieldsRecursively(valueSchema, options, activeSchemas)\n : valueSchema;\n return valueSchema && strippedValue !== valueSchema\n ? z.record((keySchema ?? z.string()) as any, strippedValue)\n : schema;\n }\n\n if (schemaType === 'map') {\n const keySchema = getZodDefSchemaProperty(schema, 'keyType');\n const valueSchema = getZodDefSchemaProperty(schema, 'valueType');\n const strippedValue = valueSchema\n ? stripTemplatableFileFieldsRecursively(valueSchema, options, activeSchemas)\n : valueSchema;\n return keySchema && valueSchema && strippedValue !== valueSchema\n ? z.map(keySchema, strippedValue)\n : schema;\n }\n\n if (schemaType === 'set') {\n const valueSchema = getZodDefSchemaProperty(schema, 'valueType');\n const strippedValue = valueSchema\n ? stripTemplatableFileFieldsRecursively(valueSchema, options, activeSchemas)\n : valueSchema;\n return valueSchema && strippedValue !== valueSchema\n ? z.set(strippedValue)\n : schema;\n }\n\n if (schemaType === 'tuple') {\n const tupleItems = getZodDefArrayProperty(schema, 'items') as z.ZodTypeAny[] | undefined;\n const restSchema = getZodDefSchemaProperty(schema, 'rest');\n const strippedItems = (tupleItems ?? []).map((item) =>\n stripTemplatableFileFieldsRecursively(item, options, activeSchemas)\n );\n const strippedRest = restSchema\n ? stripTemplatableFileFieldsRecursively(restSchema, options, activeSchemas)\n : restSchema;\n const changed = strippedItems.some((item, index) => item !== tupleItems?.[index])\n || strippedRest !== restSchema;\n if (!changed) {\n return schema;\n }\n const rebuiltTuple = z.tuple(strippedItems as any);\n return strippedRest ? rebuiltTuple.rest(strippedRest) : rebuiltTuple;\n }\n\n if (!isZodObject(schema)) {\n return schema;\n }\n\n const shape = getZodObjectShape(schema);\n const strippedShape: Record<string, z.ZodTypeAny> = {};\n let changed = false;\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const typedSchema = fieldSchema as z.ZodTypeAny;\n if (isTemplatableFileField(typedSchema)) {\n changed = true;\n continue;\n }\n\n const strippedSchema = stripTemplatableFileFieldsRecursively(typedSchema, options, activeSchemas);\n if (strippedSchema !== typedSchema) {\n changed = true;\n }\n strippedShape[fieldName] = strippedSchema;\n }\n\n if (!changed) {\n return schema;\n }\n\n return options.rebuildObjectSchema\n ? options.rebuildObjectSchema(schema, strippedShape)\n : rebuildObjectSchemaPreservingSemantics(schema, strippedShape);\n } finally {\n activeSchemas.delete(schema);\n }\n}\n\nfunction rebuildObjectSchemaPreservingSemantics(\n schema: z.ZodObject<any>,\n strippedShape: Record<string, z.ZodTypeAny>,\n): z.ZodTypeAny {\n const originalShape = getZodObjectShape(schema);\n const removedFields = Object.keys(originalShape).filter((fieldName) => !(fieldName in strippedShape));\n\n try {\n const omittedSchema = removedFields.length > 0\n ? schema.omit(Object.fromEntries(removedFields.map((fieldName) => [fieldName, true])) as Record<string, true>)\n : schema;\n\n return omittedSchema.extend(strippedShape);\n } catch {\n const rebuiltSchema = z.object(strippedShape);\n const catchallSchema = getZodDefProperty(schema, 'catchall') as z.ZodTypeAny | undefined;\n return catchallSchema ? rebuiltSchema.catchall(catchallSchema) : rebuiltSchema;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"templatable-file-fields.shared.utils.js","sourceRoot":"","sources":["../../../../../src/resources/utils/templatable-file-fields.shared.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,YAAY,EACZ,gBAAgB,GAEjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;;;;GAMG;AACH,SAAS,mBAAmB,CAA+B,MAAoB,EAAE,OAAgB;IAC/F,MAAM,QAAQ,GAAI,MAA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AAa,CAAC;QACxF,OAAO,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACrF,CAAC;AACH,CAAC","sourcesContent":["import {\n getFileMetadata,\n getZodDefArrayProperty,\n getZodDef,\n getZodDefProperty,\n getZodDefSchemaProperty,\n getZodDefStringProperty,\n getZodObjectShape,\n getZodType,\n isTemplatableFileField,\n isZodArray,\n isZodDefault,\n isZodNullable,\n isZodObject,\n isZodOptional,\n SCHEMA_METADATA,\n unwrapSchema,\n withArrayElement,\n type FileSchemaMetadata,\n} from '@wildo-ai/zod-decorators';\nimport { z } from 'zod';\n\nexport interface StripTemplatableFileFieldsOptions {\n rebuildObjectSchema?: (\n schema: z.ZodObject<any>,\n shape: Record<string, z.ZodTypeAny>,\n ) => z.ZodTypeAny;\n}\n\n/**\n * Carry decorator metadata (`SCHEMA_METADATA`) from a schema onto the instance that replaces it.\n *\n * Structured value types (`z_address`, `z_file`, `z_money`, `z_range`, …) record their identity as\n * metadata on the schema INSTANCE. A rebuild that does not carry it turns the field into a plain\n * object, and the form then renders its parts as unrelated inputs.\n */\nfunction carrySchemaMetadata<TSchema extends z.ZodTypeAny>(source: z.ZodTypeAny, rebuilt: TSchema): TSchema {\n const metadata = (source as any)[SCHEMA_METADATA];\n if (metadata !== undefined) {\n (rebuilt as any)[SCHEMA_METADATA] = metadata;\n }\n return rebuilt;\n}\n\nexport interface TemplatableFileFieldPath {\n fieldName: string;\n schema: z.ZodTypeAny;\n isInsideArray: boolean;\n}\n\nexport class IncompatibleTemplatableFileFieldPathError extends Error {\n constructor(\n public readonly fieldName: string,\n public readonly existingMetadata: FileSchemaMetadata | undefined,\n public readonly conflictingMetadata: FileSchemaMetadata | undefined,\n ) {\n super(\n `Incompatible generated file metadata detected for templatable file field path \"${fieldName}\".`,\n );\n this.name = 'IncompatibleTemplatableFileFieldPathError';\n }\n}\n\nexport function collectTemplatableFileFieldPaths(\n schema: z.ZodTypeAny,\n pathPrefix = '',\n isInsideArray = false,\n activeSchemas: WeakSet<object> = new WeakSet<object>(),\n): TemplatableFileFieldPath[] {\n if (activeSchemas.has(schema)) {\n return [];\n }\n\n activeSchemas.add(schema);\n try {\n const rawSchemaType = getZodType(schema);\n if (rawSchemaType === 'pipe') {\n const inSchema = getZodDefSchemaProperty(schema, 'in');\n const outSchema = getZodDefSchemaProperty(schema, 'out');\n return mergeTemplatableFileFieldPaths([\n ...(inSchema ? collectTemplatableFileFieldPaths(inSchema, pathPrefix, isInsideArray, activeSchemas) : []),\n ...(outSchema ? collectTemplatableFileFieldPaths(outSchema, pathPrefix, isInsideArray, activeSchemas) : []),\n ]);\n }\n\n if (isZodOptional(schema) || isZodNullable(schema) || isZodDefault(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n return innerSchema\n ? collectTemplatableFileFieldPaths(innerSchema, pathPrefix, isInsideArray, activeSchemas)\n : [];\n }\n\n const unwrappedSchema = unwrapSchema(schema);\n if (unwrappedSchema !== schema) {\n return collectTemplatableFileFieldPaths(unwrappedSchema, pathPrefix, isInsideArray, activeSchemas);\n }\n\n if (isTemplatableFileField(unwrappedSchema)) {\n return pathPrefix ? [{ fieldName: pathPrefix, schema: unwrappedSchema, isInsideArray }] : [];\n }\n\n const schemaType = getZodType(unwrappedSchema);\n if (schemaType === 'lazy') {\n const lazyGetter = getZodDef(unwrappedSchema)?.getter;\n const lazySchema = typeof lazyGetter === 'function'\n ? lazyGetter()\n : undefined;\n return lazySchema\n ? collectTemplatableFileFieldPaths(lazySchema as z.ZodTypeAny, pathPrefix, isInsideArray, activeSchemas)\n : [];\n }\n\n if (schemaType === 'intersection') {\n const leftSchema = getZodDefSchemaProperty(unwrappedSchema, 'left');\n const rightSchema = getZodDefSchemaProperty(unwrappedSchema, 'right');\n return mergeTemplatableFileFieldPaths([\n ...(leftSchema ? collectTemplatableFileFieldPaths(leftSchema, pathPrefix, isInsideArray, activeSchemas) : []),\n ...(rightSchema ? collectTemplatableFileFieldPaths(rightSchema, pathPrefix, isInsideArray, activeSchemas) : []),\n ]);\n }\n\n if (schemaType === 'union') {\n const unionOptions = getZodDefArrayProperty(unwrappedSchema, 'options') as z.ZodTypeAny[] | undefined;\n return mergeTemplatableFileFieldPaths(\n (unionOptions ?? []).flatMap((option) =>\n collectTemplatableFileFieldPaths(option, pathPrefix, isInsideArray, activeSchemas)\n ),\n );\n }\n\n if (isZodArray(unwrappedSchema)) {\n const elementSchema = getZodDefProperty(unwrappedSchema, 'element') as z.ZodTypeAny | undefined;\n return elementSchema ? collectTemplatableFileFieldPaths(elementSchema, pathPrefix, true, activeSchemas) : [];\n }\n\n if (schemaType === 'record' || schemaType === 'map' || schemaType === 'set') {\n const valueSchema = getZodDefSchemaProperty(unwrappedSchema, 'valueType');\n return valueSchema\n ? collectTemplatableFileFieldPaths(valueSchema, pathPrefix, true, activeSchemas)\n : [];\n }\n\n if (schemaType === 'tuple') {\n const tupleItems = getZodDefArrayProperty(unwrappedSchema, 'items') as z.ZodTypeAny[] | undefined;\n const restSchema = getZodDefSchemaProperty(unwrappedSchema, 'rest');\n return mergeTemplatableFileFieldPaths([\n ...((tupleItems ?? []).flatMap((item) =>\n collectTemplatableFileFieldPaths(item, pathPrefix, true, activeSchemas)\n )),\n ...(restSchema ? collectTemplatableFileFieldPaths(restSchema, pathPrefix, true, activeSchemas) : []),\n ]);\n }\n\n if (!isZodObject(unwrappedSchema)) {\n return [];\n }\n\n const shape = getZodObjectShape(unwrappedSchema);\n return mergeTemplatableFileFieldPaths(\n Object.entries(shape).flatMap(([fieldName, fieldSchema]) => {\n const nextPath = pathPrefix ? `${pathPrefix}.${fieldName}` : fieldName;\n return collectTemplatableFileFieldPaths(fieldSchema as z.ZodTypeAny, nextPath, isInsideArray, activeSchemas);\n }),\n );\n } finally {\n activeSchemas.delete(schema);\n }\n}\n\nfunction mergeTemplatableFileFieldPaths(\n fields: TemplatableFileFieldPath[],\n): TemplatableFileFieldPath[] {\n const byFieldName = new Map<string, TemplatableFileFieldPath>();\n for (const field of fields) {\n const existing = byFieldName.get(field.fieldName);\n if (existing && !areTemplatableFileMetadataCompatible(existing.schema, field.schema)) {\n throw new IncompatibleTemplatableFileFieldPathError(\n field.fieldName,\n getFileMetadata(existing.schema),\n getFileMetadata(field.schema),\n );\n }\n byFieldName.set(field.fieldName, existing\n ? {\n ...existing,\n isInsideArray: existing.isInsideArray || field.isInsideArray,\n }\n : field);\n }\n return Array.from(byFieldName.values()).sort((left, right) =>\n left.fieldName.localeCompare(right.fieldName)\n );\n}\n\nfunction normalizeMetadataForComparison(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(normalizeMetadataForComparison);\n }\n\n if (value && typeof value === 'object') {\n return Object.fromEntries(\n Object.entries(value as Record<string, unknown>)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, childValue]) => [key, normalizeMetadataForComparison(childValue)]),\n );\n }\n\n return value;\n}\n\nfunction areTemplatableFileMetadataCompatible(\n leftSchema: z.ZodTypeAny,\n rightSchema: z.ZodTypeAny,\n): boolean {\n return JSON.stringify(normalizeMetadataForComparison(getFileMetadata(leftSchema)))\n === JSON.stringify(normalizeMetadataForComparison(getFileMetadata(rightSchema)));\n}\n\n/**\n * Remove generated PDF file fields from request DTO schemas, including nested\n * structures and union arms. These fields are framework-owned outputs, so they\n * must never appear in frontend/authored write DTOs even when custom DTOs are\n * provided by an application.\n */\nexport function stripTemplatableFileFieldsRecursively(\n schema: z.ZodTypeAny,\n options: StripTemplatableFileFieldsOptions = {},\n activeSchemas: WeakSet<object> = new WeakSet<object>(),\n): z.ZodTypeAny {\n if (activeSchemas.has(schema)) {\n return schema;\n }\n activeSchemas.add(schema);\n\n try {\n /*\n * Wrappers hand back the ORIGINAL instance when nothing beneath them changed (#989).\n *\n * They used to rebuild `inner.optional()` unconditionally. A fresh wrapper is a different\n * instance, so the enclosing object read it as \"changed\" and was rebuilt too — and the rebuild\n * dropped the object's decorator metadata. A `z_address()` nested in any object therefore reached\n * the create and update request DTOs as a plain object, and the form rendered its parts as\n * unrelated text inputs. Identity is what tells the object branch nothing was stripped.\n */\n if (isZodOptional(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerSchema) {\n return schema;\n }\n const strippedInner = stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas);\n return strippedInner === innerSchema ? schema : carrySchemaMetadata(schema, strippedInner.optional());\n }\n\n if (isZodNullable(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerSchema) {\n return schema;\n }\n const strippedInner = stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas);\n return strippedInner === innerSchema ? schema : carrySchemaMetadata(schema, strippedInner.nullable());\n }\n\n if (isZodDefault(schema)) {\n const innerSchema = getZodDefSchemaProperty(schema, 'innerType');\n if (!innerSchema) {\n return schema;\n }\n const strippedInner = stripTemplatableFileFieldsRecursively(innerSchema, options, activeSchemas);\n if (strippedInner === innerSchema) {\n return schema;\n }\n // Re-READ the default per parse rather than carrying a value across. In Zod 4\n // `def.defaultValue` is a GETTER, so reading it here EVALUATES the default —\n // and this stripped schema is built once, at configuration time, so a value\n // read here would be frozen into every parse the process performs. (The old\n // `typeof defaultValue === 'function'` branch could never fire for a dynamic\n // default for the same reason: the getter returns the VALUE, not the factory.)\n return carrySchemaMetadata(schema, strippedInner.default(() => getZodDefProperty(schema, 'defaultValue') as unknown));\n }\n\n const schemaType = getZodType(schema);\n if (schemaType === 'pipe') {\n const inSchema = getZodDefSchemaProperty(schema, 'in');\n const outSchema = getZodDefSchemaProperty(schema, 'out');\n const strippedIn = inSchema\n ? stripTemplatableFileFieldsRecursively(inSchema, options, activeSchemas)\n : inSchema;\n const strippedOut = outSchema\n ? stripTemplatableFileFieldsRecursively(outSchema, options, activeSchemas)\n : outSchema;\n if (strippedIn === inSchema && strippedOut === outSchema) {\n return schema;\n }\n if (strippedIn && strippedOut) {\n return z.pipe(strippedIn, strippedOut);\n }\n return strippedOut ?? strippedIn ?? schema;\n }\n\n if (schemaType === 'lazy') {\n const lazyGetter = getZodDef(schema)?.getter;\n if (typeof lazyGetter !== 'function') {\n return schema;\n }\n return z.lazy(() =>\n stripTemplatableFileFieldsRecursively(lazyGetter() as z.ZodTypeAny, options, activeSchemas)\n );\n }\n\n if (schemaType === 'intersection') {\n const leftSchema = getZodDefSchemaProperty(schema, 'left');\n const rightSchema = getZodDefSchemaProperty(schema, 'right');\n const strippedLeft = leftSchema\n ? stripTemplatableFileFieldsRecursively(leftSchema, options, activeSchemas)\n : leftSchema;\n const strippedRight = rightSchema\n ? stripTemplatableFileFieldsRecursively(rightSchema, options, activeSchemas)\n : rightSchema;\n return strippedLeft === leftSchema && strippedRight === rightSchema\n ? schema\n : z.intersection(strippedLeft ?? z.object({}), strippedRight ?? z.object({}));\n }\n\n if (schemaType === 'union') {\n const discriminator = getZodDefStringProperty(schema, 'discriminator');\n const unionOptions = getZodDefArrayProperty(schema, 'options') as z.ZodTypeAny[] | undefined;\n if (!unionOptions?.length) {\n return schema;\n }\n\n const strippedOptions = unionOptions.map((option) =>\n stripTemplatableFileFieldsRecursively(option, options, activeSchemas)\n );\n if (strippedOptions.length < 2) {\n return strippedOptions[0] ?? schema;\n }\n if (strippedOptions.every((option, index) => option === unionOptions[index])) {\n return schema;\n }\n\n const rebuiltUnion: z.ZodTypeAny = discriminator\n ? z.discriminatedUnion(\n discriminator,\n strippedOptions as [z.ZodObject<any>, z.ZodObject<any>, ...z.ZodObject<any>[]],\n )\n : z.union(strippedOptions as [z.ZodTypeAny, z.ZodTypeAny, ...z.ZodTypeAny[]]);\n return carrySchemaMetadata(schema, rebuiltUnion);\n }\n\n if (isZodArray(schema)) {\n const elementSchema = getZodDefProperty(schema, 'element') as z.ZodTypeAny | undefined;\n if (!elementSchema) {\n return schema;\n }\n\n const strippedElement = stripTemplatableFileFieldsRecursively(elementSchema, options, activeSchemas);\n\n // Nothing to strip inside the element — hand back the ORIGINAL schema, the same way the\n // intersection / record / map branches do.\n if (strippedElement === elementSchema) {\n return schema;\n }\n\n // The element WAS rewritten. `withArrayElement` keeps the array's own `.min()` / `.max()` /\n // `.length()` checks across the swap; a plain `z.array(strippedElement)` — what this branch\n // used to do unconditionally — drops them, so an authored constraint never reached the DTO\n // the controller and repository validate against.\n return withArrayElement(schema, strippedElement);\n }\n\n if (schemaType === 'record') {\n const keySchema = getZodDefSchemaProperty(schema, 'keyType');\n const valueSchema = getZodDefSchemaProperty(schema, 'valueType');\n const strippedValue = valueSchema\n ? stripTemplatableFileFieldsRecursively(valueSchema, options, activeSchemas)\n : valueSchema;\n return valueSchema && strippedValue !== valueSchema\n ? z.record((keySchema ?? z.string()) as any, strippedValue)\n : schema;\n }\n\n if (schemaType === 'map') {\n const keySchema = getZodDefSchemaProperty(schema, 'keyType');\n const valueSchema = getZodDefSchemaProperty(schema, 'valueType');\n const strippedValue = valueSchema\n ? stripTemplatableFileFieldsRecursively(valueSchema, options, activeSchemas)\n : valueSchema;\n return keySchema && valueSchema && strippedValue !== valueSchema\n ? z.map(keySchema, strippedValue)\n : schema;\n }\n\n if (schemaType === 'set') {\n const valueSchema = getZodDefSchemaProperty(schema, 'valueType');\n const strippedValue = valueSchema\n ? stripTemplatableFileFieldsRecursively(valueSchema, options, activeSchemas)\n : valueSchema;\n return valueSchema && strippedValue !== valueSchema\n ? z.set(strippedValue)\n : schema;\n }\n\n if (schemaType === 'tuple') {\n const tupleItems = getZodDefArrayProperty(schema, 'items') as z.ZodTypeAny[] | undefined;\n const restSchema = getZodDefSchemaProperty(schema, 'rest');\n const strippedItems = (tupleItems ?? []).map((item) =>\n stripTemplatableFileFieldsRecursively(item, options, activeSchemas)\n );\n const strippedRest = restSchema\n ? stripTemplatableFileFieldsRecursively(restSchema, options, activeSchemas)\n : restSchema;\n const changed = strippedItems.some((item, index) => item !== tupleItems?.[index])\n || strippedRest !== restSchema;\n if (!changed) {\n return schema;\n }\n const rebuiltTuple = z.tuple(strippedItems as any);\n return strippedRest ? rebuiltTuple.rest(strippedRest) : rebuiltTuple;\n }\n\n if (!isZodObject(schema)) {\n return schema;\n }\n\n const shape = getZodObjectShape(schema);\n const strippedShape: Record<string, z.ZodTypeAny> = {};\n let changed = false;\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n const typedSchema = fieldSchema as z.ZodTypeAny;\n if (isTemplatableFileField(typedSchema)) {\n changed = true;\n continue;\n }\n\n const strippedSchema = stripTemplatableFileFieldsRecursively(typedSchema, options, activeSchemas);\n if (strippedSchema !== typedSchema) {\n changed = true;\n }\n strippedShape[fieldName] = strippedSchema;\n }\n\n if (!changed) {\n return schema;\n }\n\n return options.rebuildObjectSchema\n ? options.rebuildObjectSchema(schema, strippedShape)\n : rebuildObjectSchemaPreservingSemantics(schema, strippedShape);\n } finally {\n activeSchemas.delete(schema);\n }\n}\n\nfunction rebuildObjectSchemaPreservingSemantics(\n schema: z.ZodObject<any>,\n strippedShape: Record<string, z.ZodTypeAny>,\n): z.ZodTypeAny {\n const originalShape = getZodObjectShape(schema);\n const removedFields = Object.keys(originalShape).filter((fieldName) => !(fieldName in strippedShape));\n\n try {\n const omittedSchema = removedFields.length > 0\n ? schema.omit(Object.fromEntries(removedFields.map((fieldName) => [fieldName, true])) as Record<string, true>)\n : schema;\n\n const extended = omittedSchema.extend(strippedShape);\n // Same field set, only a nested field replaced: the object is still what its metadata describes.\n // A field REMOVED means it may not be, so the metadata stays behind on that path (#989).\n return removedFields.length === 0 ? carrySchemaMetadata(schema, extended) : extended;\n } catch {\n const rebuiltSchema = z.object(strippedShape);\n const catchallSchema = getZodDefProperty(schema, 'catchall') as z.ZodTypeAny | undefined;\n const rebuilt = catchallSchema ? rebuiltSchema.catchall(catchallSchema) : rebuiltSchema;\n return removedFields.length === 0 ? carrySchemaMetadata(schema, rebuilt) : rebuilt;\n }\n}\n"]}
|
package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys-application.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/security/api-keys/api-keys-application.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,YAAY,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,
|
|
1
|
+
{"version":3,"file":"api-keys-application.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/security/api-keys/api-keys-application.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,YAAY,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAoF,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAMlK,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAgBxE,oBAAY,qBAAqB;IAC/B,MAAM,WAAW,CAAE,0CAA0C;IAC7D,UAAU,eAAe,CAAE,gDAAgD;IAC3E,UAAU,eAAe,CAAE,iBAAiB;IAC5C,UAAU,eAAe,CAAE,iBAAiB;IAC5C,aAAa,kBAAkB,CAAE,yBAAyB;IAC1D,MAAM,WAAW,CAAE,6FAA6F;IAChH,WAAW,gBAAgB;CAC5B;AAED,KAAK,wBAAwB,GACzB,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAKjC,eAAO,MAAM,qDAAqD,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;kBA4TlH,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import { ApiKeyApplicationSchema, ApiKeyStatus } from './api-keys.shared.schemas.js';
|
|
9
9
|
import { CoreResourceOperation } from '../../resources/resources.shared.core.definitions.js';
|
|
10
|
-
import { ResourceOperationRiskLevel } from '../../resources/resources.shared.schemas.js';
|
|
10
|
+
import { ResourceOperationRiskLevel, ResourceOperationReversibility } from '../../resources/resources.shared.schemas.js';
|
|
11
11
|
import { CoreResourceType, coreResourceShared_FieldIdentifier } from '../../resources/resources.shared.core.definitions.js';
|
|
12
12
|
import { ResourceOperationVariantType } from '../../resources/resources.shared.schemas.js';
|
|
13
13
|
import { CoreUserNotificationTarget, CoreUserNotificationChannel } from '../../notifications/notifications.shared.schemas.js';
|
|
@@ -134,6 +134,9 @@ export const appApiKeysResourceConfiguration_InitializationFactory = (resourcesR
|
|
|
134
134
|
isDefault: true,
|
|
135
135
|
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation
|
|
136
136
|
riskLevel: ResourceOperationRiskLevel.HIGH,
|
|
137
|
+
// IRREVERSIBLE: Replaces the secret. Only the SHA-256 hash is persisted, so the previous key is unrecoverable.
|
|
138
|
+
// This is what admits it to the danger zone; risk alone no longer does.
|
|
139
|
+
reversibility: ResourceOperationReversibility.IRREVERSIBLE,
|
|
137
140
|
// Irreversible reissue AND a secret handback. ROTATE schedules the prior credential's
|
|
138
141
|
// invalidation at the requested boundary (default: now) and returns the replacement in
|
|
139
142
|
// plaintext (`plainKey`, `.isEphemeral()`). Once that boundary passes, integrations still
|
package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys-application.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../../src/security/api-keys/api-keys-application.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,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,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;wBAClC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;wBACnC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;wBAC/B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;wBACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,aAAa;wBACpD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;qBACjC,CAAC;iBACH;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Application API Keys Shared Resource Configuration\n *\n * Resource configuration for managing application-scoped API keys.\n * Handles creation, management, rotation, and monitoring of API keys within applications.\n */\n\nimport { z } from 'zod';\nimport {\n ApiKeyApplicationSchema,\n ApiKeyStatus\n} from './api-keys.shared.schemas';\nimport { CoreResourceOperation } from '../../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourcePrimaryScope, ResourceRelationship } from '../../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../../resources/resources.shared.core.definitions';\nimport { ResourceOperationVariantType } from '../../resources/resources.shared.schemas';\nimport { CoreUserNotificationTarget, CoreUserNotificationChannel } from '../../notifications/notifications.shared.schemas';\n\nimport { createResourceConfiguration_Initialization } from '../../resources/resources-config.shared.factory';\nimport { CORE_APP_ROLES } from '../authorizations/roles.shared.schemas';\n\n// Sort and filter fields for application API keys\n\n// App Admin gets enhanced filter fields with additional capabilities\nconst APP_API_KEYS_ADMIN_FILTER_FIELDS = {\n status: z.enum(ApiKeyStatus),\n hasExpiration: z.boolean(),\n lastUsedAt: z.date(), // Admin can filter by last usage\n expiresAt: z.date(), // Admin can filter by expiration\n};\n\n// App Admin gets additional sorting capabilities\nconst APP_API_KEYS_ADMIN_SORT_FIELDS = ['createdAt', 'updatedAt', 'lastUsedAt', 'expiresAt', 'status'] as const;\n\n// Custom operations enum for application API keys\nexport enum AppApiKeys_Operations {\n ROTATE = 'rotate', // Generate new key and invalidate old one\n REGENERATE = 'regenerate', // Generate new key without invalidating old one\n DEACTIVATE = 'deactivate', // Deactivate key\n REACTIVATE = 'reactivate', // Reactivate key\n EXTEND_EXPIRY = 'extend_expiry', // Extend expiration date\n EXPIRE = 'expire', // ACTIVE → EXPIRED once `expiresAt` has passed (dispatched by the sweep, not by an operator)\n USAGE_STATS = 'usage_stats', // Get usage statistics\n}\n\ntype AppApiKeysCoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.DELETE;\n\n/*\nApplication API Keys Resource Configuration Factory\n*/\nexport const appApiKeysResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof AppApiKeys_Operations,\n AppApiKeysCoreOperations,\n typeof ApiKeyApplicationSchema\n>({\n mainSchema: ApiKeyApplicationSchema,\n resourceIdentifier: CoreResourceType.APPLICATION_API_KEYS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION_API_KEYS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true, // Application API keys are a core system resource\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition\n // onParentDelete cascade so key rows are physically removed when their owning\n // application is deleted. Without it the cascade throws ErrorType.CONFIGURATION\n // on any application that still has API-key rows.\n CoreResourceOperation.DELETE\n ],\n\n customOperation: AppApiKeys_Operations,\n\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: false,\n searchableFields: [],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: APP_API_KEYS_ADMIN_FILTER_FIELDS,\n sortFields: APP_API_KEYS_ADMIN_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 100,\n }\n ],\n },\n\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.HIGH,\n // requestDto auto-derived from decorators\n customResponseDto: ApiKeyApplicationSchema.extend({\n plainKey: z.string().min(1).isEphemeral()\n }),\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n // Internal-only (REPOSITORY_ONLY, no HTTP route): powers the composition\n // onParentDelete cascade so API-key rows are physically removed when their\n // owning application is deleted. Without a DELETE op the cascade\n // (deleteChildrenImmediate) throws ErrorType.CONFIGURATION on any application\n // that still has key rows. Super-admin/HIGH: the app API-key admin tier.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n\n [AppApiKeys_Operations.ROTATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.HIGH,\n // Irreversible reissue AND a secret handback. ROTATE schedules the prior credential's\n // invalidation at the requested boundary (default: now) and returns the replacement in\n // plaintext (`plainKey`, `.isEphemeral()`). Once that boundary passes, integrations still\n // using the prior value break and it cannot be restored. An unauthorized rotate is not\n // merely destructive: the caller WALKS AWAY WITH the replacement credential.\n // A live session alone is deliberately not sufficient for that.\n //\n // Its sibling REGENERATE is NOT gated, and the difference is the whole criterion: a\n // regenerate \"keeps the prior secret working\" (see its own declaration), so it is additive\n // and recoverable. Gate the irreversible, not merely the sensitive.\n //\n // assurance-control: WILDO.IDENTITY.STEP_UP_AUTHENTICATION — re-proof of identity before a\n // high-impact action.\n requiresStepUpAuthentication: true,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n oldKeyInvalidationDate: z.date().min(new Date(), 'Invalidation date must be in the future or now').default(() => new Date())\n }),\n customResponseDto: ApiKeyApplicationSchema.extend({\n plainKey: z.string().min(1).isEphemeral(),\n oldKeyId: z.string(),\n oldKeyInvalidationDate: z.date()\n }),\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [AppApiKeys_Operations.REGENERATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // REGENERATE mints and hands over a LIVE credential, so it needs an audit row — but its\n // MEDIUM risk sits below the automatic HIGH/CRITICAL floor, which is why it previously\n // recorded nothing on either axis while its HIGH sibling ROTATE recorded the operation.\n // MEDIUM is correct on the UI axis (no danger-zone affordance for a reissue that keeps\n // the prior secret working) and wrong on the evidence axis; this declaration is exactly\n // that divergence. Raising `riskLevel` instead would buy the row by mis-declaring the\n // verb's danger. Same reasoning as `organizationMembers | UPDATE`.\n // assurance-control: WILDO.SECRETS.DISCLOSURE_AUDIT — credential issuance is attributable.\n auditableEvent: { auditBelowRiskFloor: true },\n // REGENERATE reissues the secret and nothing else — it takes no caller input\n // (contrast ROTATE, which accepts `oldKeyInvalidationDate`). Without this the\n // auto-derived UPDATE contract would apply: the reissue prefix returns\n // `{ ...input, hashedKey, … }` and the dispatcher MERGES that onto the caller\n // payload, so `roles` would be writable through \"regenerate\" — bypassing the\n // ceiling gate that guards minting (`assertRequestedRolesWithinCallerCeiling`\n // runs in the CREATE handler only) on a resource with no core UPDATE.\n requestDto: z.object({}),\n customResponseDto: ApiKeyApplicationSchema.extend({\n plainKey: z.string().min(1).isEphemeral(),\n }),\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [AppApiKeys_Operations.DEACTIVATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // The transition is SERVER-DECIDED, so the verb takes no input. Borrowing UPDATE\n // selects the core path that persists; it must NOT also hand the caller UPDATE's\n // request contract. Omitting `requestDto` here would auto-derive the resource's\n // FULL update DTO (`{name, description, roles, status, expiresAt}`) — letting\n // `PUT .../deactivate` carry `status: active` (the exact opposite of the verb) and\n // rewrite `roles` with no ceiling gate, on a resource that deliberately exposes no\n // core UPDATE at all. `status` is forced to INACTIVE by the paired prefix\n // implementation; see `api-keys.custom-impl.backend.service.ts`.\n requestDto: z.object({}),\n enabledCondition: ({ currentObject }) => {\n return currentObject.status === ApiKeyStatus.ACTIVE;\n }\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [AppApiKeys_Operations.REACTIVATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // No input: `status` is forced to ACTIVE by the paired prefix implementation.\n // See the DEACTIVATE note above for why the auto-derived UPDATE contract is unsafe here.\n requestDto: z.object({}),\n enabledCondition: ({ currentObject }) => {\n return currentObject.status === ApiKeyStatus.INACTIVE;\n }\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n /**\n * ACTIVE → EXPIRED, dispatched by the credential-expiry sweep once `expiresAt` has passed\n * (#413). INTERNAL_CALL, so no HTTP route is mounted and no frontend affordance is offered:\n * the sweep is the only caller.\n *\n * Not an operator verb, deliberately. An administrator who wants a key gone uses DEACTIVATE and\n * one who wants it to last longer uses EXTEND_EXPIRY; there is no reason for a human to declare\n * that a date has passed. Being INTERNAL_CALL also removes, rather than defends against, the\n * hazard DEACTIVATE documents at length — with no route there is no request contract to\n * auto-derive and no `PUT .../expire` that could carry `status: active`.\n *\n * It exists so the sweep writes through a GUARDED door rather than setting `status` directly: a\n * direct write would be a second authority over the field and would skip the ACTIVE-only\n * precondition, which lives in the paired prefix implementation\n * (`api-keys.custom-impl.backend.service.ts`) because that is the enforcement an\n * `enabledCondition` cannot be.\n */\n [AppApiKeys_Operations.EXPIRE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // EMPTY BY CONTRACT, not by omission. The credential-expiry sweep dispatches this verb with `{}`\n // and the paired prefix implementation forces the status transition itself, so there is no field\n // a caller may supply. Declaring nothing is NOT the same as declaring this: an operation without\n // a `requestDto` inherits the resource's ENTIRE update contract, which would let an INTERNAL_CALL\n // that accepts nothing advertise every field — `status` included, the one field this verb owns.\n requestDto: z.object({}),\n }\n ],\n // No notification: expiry is the scheduled consequence of a date the administrator set, not\n // an event. The signal that would be worth sending — a key ABOUT to expire — is a different\n // feature and is not this one.\n },\n\n [AppApiKeys_Operations.EXTEND_EXPIRY]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n newExpiresAt: z.date().min(new Date(), 'New expiration date must be in the future')\n }),\n enabledCondition: ({ currentObject }) => {\n return currentObject.expiresAt !== null && currentObject.expiresAt !== undefined;\n }\n }\n ]\n },\n\n [AppApiKeys_Operations.USAGE_STATS]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.READ,\n customResponseDto: z.object({\n keyId: z.string(),\n totalRequests: z.number().min(0),\n requestsLastHour: z.number().min(0),\n requestsLastDay: z.number().min(0),\n requestsLastWeek: z.number().min(0),\n lastUsedAt: z.date().optional(),\n mostUsedEndpoint: z.string().optional(),\n errorRate: z.number().min(0).max(100), // Percentage\n rateLimitHits: z.number().min(0)\n }),\n }\n ]\n }\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"api-keys-application.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../../src/security/api-keys/api-keys-application.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,EACvB,YAAY,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAA8C,MAAM,0CAA0C,CAAC;AAClK,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AACzH,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAE3H,OAAO,EAAE,0CAA0C,EAAE,MAAM,iDAAiD,CAAC;AAC7G,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,kDAAkD;AAElD,qEAAqE;AACrE,MAAM,gCAAgC,GAAG;IACvC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;IAC5B,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,iCAAiC;IACvD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,iCAAiC;CACvD,CAAC;AAEF,iDAAiD;AACjD,MAAM,8BAA8B,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAEhH,kDAAkD;AAClD,MAAM,CAAN,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,0CAAiB,CAAA;IACjB,k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AAG;oBACzC,qBAAqB,EAAE,qBAAqB,CAAC,IAAI;oBACjD,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC;wBAC1B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;wBACjB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;wBAChC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;wBACnC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;wBAClC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;wBACnC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;wBAC/B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;wBACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,aAAa;wBACpD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;qBACjC,CAAC;iBACH;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Application API Keys Shared Resource Configuration\n *\n * Resource configuration for managing application-scoped API keys.\n * Handles creation, management, rotation, and monitoring of API keys within applications.\n */\n\nimport { z } from 'zod';\nimport {\n ApiKeyApplicationSchema,\n ApiKeyStatus\n} from './api-keys.shared.schemas';\nimport { CoreResourceOperation } from '../../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourceOperationReversibility, ResourcePrimaryScope, ResourceRelationship } from '../../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../../resources/resources.shared.core.definitions';\nimport { ResourceOperationVariantType } from '../../resources/resources.shared.schemas';\nimport { CoreUserNotificationTarget, CoreUserNotificationChannel } from '../../notifications/notifications.shared.schemas';\n\nimport { createResourceConfiguration_Initialization } from '../../resources/resources-config.shared.factory';\nimport { CORE_APP_ROLES } from '../authorizations/roles.shared.schemas';\n\n// Sort and filter fields for application API keys\n\n// App Admin gets enhanced filter fields with additional capabilities\nconst APP_API_KEYS_ADMIN_FILTER_FIELDS = {\n status: z.enum(ApiKeyStatus),\n hasExpiration: z.boolean(),\n lastUsedAt: z.date(), // Admin can filter by last usage\n expiresAt: z.date(), // Admin can filter by expiration\n};\n\n// App Admin gets additional sorting capabilities\nconst APP_API_KEYS_ADMIN_SORT_FIELDS = ['createdAt', 'updatedAt', 'lastUsedAt', 'expiresAt', 'status'] as const;\n\n// Custom operations enum for application API keys\nexport enum AppApiKeys_Operations {\n ROTATE = 'rotate', // Generate new key and invalidate old one\n REGENERATE = 'regenerate', // Generate new key without invalidating old one\n DEACTIVATE = 'deactivate', // Deactivate key\n REACTIVATE = 'reactivate', // Reactivate key\n EXTEND_EXPIRY = 'extend_expiry', // Extend expiration date\n EXPIRE = 'expire', // ACTIVE → EXPIRED once `expiresAt` has passed (dispatched by the sweep, not by an operator)\n USAGE_STATS = 'usage_stats', // Get usage statistics\n}\n\ntype AppApiKeysCoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.DELETE;\n\n/*\nApplication API Keys Resource Configuration Factory\n*/\nexport const appApiKeysResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof AppApiKeys_Operations,\n AppApiKeysCoreOperations,\n typeof ApiKeyApplicationSchema\n>({\n mainSchema: ApiKeyApplicationSchema,\n resourceIdentifier: CoreResourceType.APPLICATION_API_KEYS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION_API_KEYS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true, // Application API keys are a core system resource\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition\n // onParentDelete cascade so key rows are physically removed when their owning\n // application is deleted. Without it the cascade throws ErrorType.CONFIGURATION\n // on any application that still has API-key rows.\n CoreResourceOperation.DELETE\n ],\n\n customOperation: AppApiKeys_Operations,\n\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: false,\n searchableFields: [],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: APP_API_KEYS_ADMIN_FILTER_FIELDS,\n sortFields: APP_API_KEYS_ADMIN_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 100,\n }\n ],\n },\n\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.HIGH,\n // requestDto auto-derived from decorators\n customResponseDto: ApiKeyApplicationSchema.extend({\n plainKey: z.string().min(1).isEphemeral()\n }),\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n // Internal-only (REPOSITORY_ONLY, no HTTP route): powers the composition\n // onParentDelete cascade so API-key rows are physically removed when their\n // owning application is deleted. Without a DELETE op the cascade\n // (deleteChildrenImmediate) throws ErrorType.CONFIGURATION on any application\n // that still has key rows. Super-admin/HIGH: the app API-key admin tier.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n\n [AppApiKeys_Operations.ROTATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.HIGH,\n // IRREVERSIBLE: Replaces the secret. Only the SHA-256 hash is persisted, so the previous key is unrecoverable.\n // This is what admits it to the danger zone; risk alone no longer does.\n reversibility: ResourceOperationReversibility.IRREVERSIBLE,\n // Irreversible reissue AND a secret handback. ROTATE schedules the prior credential's\n // invalidation at the requested boundary (default: now) and returns the replacement in\n // plaintext (`plainKey`, `.isEphemeral()`). Once that boundary passes, integrations still\n // using the prior value break and it cannot be restored. An unauthorized rotate is not\n // merely destructive: the caller WALKS AWAY WITH the replacement credential.\n // A live session alone is deliberately not sufficient for that.\n //\n // Its sibling REGENERATE is NOT gated, and the difference is the whole criterion: a\n // regenerate \"keeps the prior secret working\" (see its own declaration), so it is additive\n // and recoverable. Gate the irreversible, not merely the sensitive.\n //\n // assurance-control: WILDO.IDENTITY.STEP_UP_AUTHENTICATION — re-proof of identity before a\n // high-impact action.\n requiresStepUpAuthentication: true,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n oldKeyInvalidationDate: z.date().min(new Date(), 'Invalidation date must be in the future or now').default(() => new Date())\n }),\n customResponseDto: ApiKeyApplicationSchema.extend({\n plainKey: z.string().min(1).isEphemeral(),\n oldKeyId: z.string(),\n oldKeyInvalidationDate: z.date()\n }),\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [AppApiKeys_Operations.REGENERATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // REGENERATE mints and hands over a LIVE credential, so it needs an audit row — but its\n // MEDIUM risk sits below the automatic HIGH/CRITICAL floor, which is why it previously\n // recorded nothing on either axis while its HIGH sibling ROTATE recorded the operation.\n // MEDIUM is correct on the UI axis (no danger-zone affordance for a reissue that keeps\n // the prior secret working) and wrong on the evidence axis; this declaration is exactly\n // that divergence. Raising `riskLevel` instead would buy the row by mis-declaring the\n // verb's danger. Same reasoning as `organizationMembers | UPDATE`.\n // assurance-control: WILDO.SECRETS.DISCLOSURE_AUDIT — credential issuance is attributable.\n auditableEvent: { auditBelowRiskFloor: true },\n // REGENERATE reissues the secret and nothing else — it takes no caller input\n // (contrast ROTATE, which accepts `oldKeyInvalidationDate`). Without this the\n // auto-derived UPDATE contract would apply: the reissue prefix returns\n // `{ ...input, hashedKey, … }` and the dispatcher MERGES that onto the caller\n // payload, so `roles` would be writable through \"regenerate\" — bypassing the\n // ceiling gate that guards minting (`assertRequestedRolesWithinCallerCeiling`\n // runs in the CREATE handler only) on a resource with no core UPDATE.\n requestDto: z.object({}),\n customResponseDto: ApiKeyApplicationSchema.extend({\n plainKey: z.string().min(1).isEphemeral(),\n }),\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [AppApiKeys_Operations.DEACTIVATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // The transition is SERVER-DECIDED, so the verb takes no input. Borrowing UPDATE\n // selects the core path that persists; it must NOT also hand the caller UPDATE's\n // request contract. Omitting `requestDto` here would auto-derive the resource's\n // FULL update DTO (`{name, description, roles, status, expiresAt}`) — letting\n // `PUT .../deactivate` carry `status: active` (the exact opposite of the verb) and\n // rewrite `roles` with no ceiling gate, on a resource that deliberately exposes no\n // core UPDATE at all. `status` is forced to INACTIVE by the paired prefix\n // implementation; see `api-keys.custom-impl.backend.service.ts`.\n requestDto: z.object({}),\n enabledCondition: ({ currentObject }) => {\n return currentObject.status === ApiKeyStatus.ACTIVE;\n }\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [AppApiKeys_Operations.REACTIVATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // No input: `status` is forced to ACTIVE by the paired prefix implementation.\n // See the DEACTIVATE note above for why the auto-derived UPDATE contract is unsafe here.\n requestDto: z.object({}),\n enabledCondition: ({ currentObject }) => {\n return currentObject.status === ApiKeyStatus.INACTIVE;\n }\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n /**\n * ACTIVE → EXPIRED, dispatched by the credential-expiry sweep once `expiresAt` has passed\n * (#413). INTERNAL_CALL, so no HTTP route is mounted and no frontend affordance is offered:\n * the sweep is the only caller.\n *\n * Not an operator verb, deliberately. An administrator who wants a key gone uses DEACTIVATE and\n * one who wants it to last longer uses EXTEND_EXPIRY; there is no reason for a human to declare\n * that a date has passed. Being INTERNAL_CALL also removes, rather than defends against, the\n * hazard DEACTIVATE documents at length — with no route there is no request contract to\n * auto-derive and no `PUT .../expire` that could carry `status: active`.\n *\n * It exists so the sweep writes through a GUARDED door rather than setting `status` directly: a\n * direct write would be a second authority over the field and would skip the ACTIVE-only\n * precondition, which lives in the paired prefix implementation\n * (`api-keys.custom-impl.backend.service.ts`) because that is the enforcement an\n * `enabledCondition` cannot be.\n */\n [AppApiKeys_Operations.EXPIRE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // EMPTY BY CONTRACT, not by omission. The credential-expiry sweep dispatches this verb with `{}`\n // and the paired prefix implementation forces the status transition itself, so there is no field\n // a caller may supply. Declaring nothing is NOT the same as declaring this: an operation without\n // a `requestDto` inherits the resource's ENTIRE update contract, which would let an INTERNAL_CALL\n // that accepts nothing advertise every field — `status` included, the one field this verb owns.\n requestDto: z.object({}),\n }\n ],\n // No notification: expiry is the scheduled consequence of a date the administrator set, not\n // an event. The signal that would be worth sending — a key ABOUT to expire — is a different\n // feature and is not this one.\n },\n\n [AppApiKeys_Operations.EXTEND_EXPIRY]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n newExpiresAt: z.date().min(new Date(), 'New expiration date must be in the future')\n }),\n enabledCondition: ({ currentObject }) => {\n return currentObject.expiresAt !== null && currentObject.expiresAt !== undefined;\n }\n }\n ]\n },\n\n [AppApiKeys_Operations.USAGE_STATS]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Admin-only operation\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.READ,\n customResponseDto: z.object({\n keyId: z.string(),\n totalRequests: z.number().min(0),\n requestsLastHour: z.number().min(0),\n requestsLastDay: z.number().min(0),\n requestsLastWeek: z.number().min(0),\n lastUsedAt: z.date().optional(),\n mostUsedEndpoint: z.string().optional(),\n errorRate: z.number().min(0).max(100), // Percentage\n rateLimitHits: z.number().min(0)\n }),\n }\n ]\n }\n },\n});\n"]}
|
package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys-organization.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/security/api-keys/api-keys-organization.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,YAAY,EACb,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,
|
|
1
|
+
{"version":3,"file":"api-keys-organization.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/security/api-keys/api-keys-organization.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,YAAY,EACb,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAoF,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAMlK,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AA0BxF,oBAAY,qBAAqB;IAC/B,MAAM,WAAW,CAAE,0CAA0C;IAC7D,UAAU,eAAe,CAAE,gDAAgD;IAC3E,UAAU,eAAe,CAAE,iBAAiB;IAC5C,UAAU,eAAe,CAAE,iBAAiB;IAC5C,aAAa,kBAAkB,CAAE,yBAAyB;IAC1D,MAAM,WAAW,CAAE,6FAA6F;IAChH,WAAW,gBAAgB;CAC5B;AAED,KAAK,wBAAwB,GACzB,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,KAAK,CAAC;AAKhC,eAAO,MAAM,qDAAqD,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;kBAuhBlH,CAAC"}
|