@wildo-ai/saas-models 1.1.8 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/_inspect.d.ts.map +1 -1
- package/dist/esm/_inspect.js.map +1 -1
- package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-metadata.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/application-subject.shared.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-subject.shared.schemas.js.map +1 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/applications-context.schemas.d.ts +68 -2
- package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications-context.schemas.js.map +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
- package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.schemas.js.map +1 -1
- package/dist/esm/billing/promotions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/promotions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/promotions.shared.schemas.js.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -1
- package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -1
- package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -1
- package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-flush-evidence.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
- package/dist/esm/charts/aggregation-query.shared.schemas.d.ts.map +1 -1
- package/dist/esm/charts/aggregation-query.shared.schemas.js.map +1 -1
- package/dist/esm/charts/aggregation.shared.definitions.d.ts.map +1 -1
- package/dist/esm/charts/aggregation.shared.definitions.js.map +1 -1
- package/dist/esm/charts/chart-definition-builder.shared.d.ts.map +1 -1
- package/dist/esm/charts/chart-definition-builder.shared.js.map +1 -1
- package/dist/esm/companion/artifact-placement.shared.definitions.d.ts.map +1 -1
- package/dist/esm/companion/artifact-placement.shared.definitions.js.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +13 -0
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.js +13 -0
- package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
- package/dist/esm/companion/shared-library-companion.shared.definitions.d.ts.map +1 -1
- package/dist/esm/companion/shared-library-companion.shared.definitions.js.map +1 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +5 -2
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-event-classification.shared.d.ts +28 -0
- package/dist/esm/compliance/audit-trails/audit-event-classification.shared.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-event-classification.shared.js +30 -0
- package/dist/esm/compliance/audit-trails/audit-event-classification.shared.js.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +2 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +20 -0
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +40 -0
- package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +1 -14
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +1 -16
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts +17 -4
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +25 -5
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/data-classification/data-classification.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/data-classification/data-classification.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts +0 -50
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.js +4 -51
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/public-governed-documents.shared.d.ts +67 -0
- package/dist/esm/compliance/documents/public-governed-documents.shared.d.ts.map +1 -0
- package/dist/esm/compliance/documents/public-governed-documents.shared.js +69 -0
- package/dist/esm/compliance/documents/public-governed-documents.shared.js.map +1 -0
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/consent-purposes.shared.js.map +1 -1
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js +1 -1
- package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/jurisdiction-containment.shared.d.ts +32 -0
- package/dist/esm/compliance/privacy/jurisdiction-containment.shared.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/jurisdiction-containment.shared.js +46 -0
- package/dist/esm/compliance/privacy/jurisdiction-containment.shared.js.map +1 -0
- package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/legal-notice-obligation.shared.d.ts +47 -0
- package/dist/esm/compliance/privacy/legal-notice-obligation.shared.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/legal-notice-obligation.shared.js +54 -0
- package/dist/esm/compliance/privacy/legal-notice-obligation.shared.js.map +1 -0
- package/dist/esm/compliance/privacy/legal-notice.shared.d.ts +105 -0
- package/dist/esm/compliance/privacy/legal-notice.shared.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/legal-notice.shared.js +112 -0
- package/dist/esm/compliance/privacy/legal-notice.shared.js.map +1 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +1 -27
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +2 -41
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +83 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +97 -0
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts +8 -8
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/sharing.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/sharing.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/review-cadence.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/review-cadence.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/risk-posture.shared.schemas.d.ts +15 -3
- package/dist/esm/compliance/risk-posture.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/risk-posture.shared.schemas.js +14 -2
- package/dist/esm/compliance/risk-posture.shared.schemas.js.map +1 -1
- package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +63 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.js +11 -0
- package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
- package/dist/esm/config/app-frontend-type.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/app-frontend-type.shared.schemas.js.map +1 -1
- package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
- package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
- package/dist/esm/config/brand-assets.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/brand-assets.shared.schemas.js.map +1 -1
- package/dist/esm/config/configuration-validation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/configuration-validation.shared.schemas.js.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +16 -16
- package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/chart-definition.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
- package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/onboarding.shared.schemas.js.map +1 -1
- package/dist/esm/config/postgresql.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/postgresql.shared.schemas.js.map +1 -1
- package/dist/esm/config/registration-acquisition-policy.shared.utils.d.ts.map +1 -1
- package/dist/esm/config/registration-acquisition-policy.shared.utils.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/crdt/crdt-merge.shared.utils.d.ts.map +1 -1
- package/dist/esm/crdt/crdt-merge.shared.utils.js.map +1 -1
- package/dist/esm/data-seeding/data-seeding-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/data-seeding-config.shared.schemas.js.map +1 -1
- package/dist/esm/errors/caught-error-description.shared.utils.d.ts +5 -1
- package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/caught-error-description.shared.utils.js +48 -4
- package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
- package/dist/esm/errors/errors.shared.definitions.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.definitions.js.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
- package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.utils.js.map +1 -1
- package/dist/esm/errors/resource-access-forbidden.shared.error.d.ts.map +1 -1
- package/dist/esm/errors/resource-access-forbidden.shared.error.js.map +1 -1
- package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
- package/dist/esm/errors/zod-issue-formatting.shared.utils.d.ts.map +1 -1
- package/dist/esm/errors/zod-issue-formatting.shared.utils.js.map +1 -1
- package/dist/esm/exports/tabular-csv.shared.utils.d.ts.map +1 -1
- package/dist/esm/exports/tabular-csv.shared.utils.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
- package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -1
- package/dist/esm/external-data.exports.d.ts.map +1 -1
- package/dist/esm/external-data.exports.js.map +1 -1
- package/dist/esm/external-providers/compose-provider-registry.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/compose-provider-registry.shared.js.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
- package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
- package/dist/esm/external-providers/external-providers.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/external-providers.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +34 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
- package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
- package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -1
- package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -1
- package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -1
- package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -1
- package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js.map +1 -1
- package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/features/connected-feature.example.d.ts.map +1 -1
- package/dist/esm/features/connected-feature.example.js.map +1 -1
- package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
- package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
- package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
- package/dist/esm/features/feature-builders.shared.js.map +1 -1
- package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
- package/dist/esm/features/feature-registry.shared.d.ts.map +1 -1
- package/dist/esm/features/feature-registry.shared.js.map +1 -1
- package/dist/esm/features/feature-resolution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/feature-resolution.shared.schemas.js.map +1 -1
- package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -1
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -1
- package/dist/esm/files/files.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/files/files.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/files.shared.schemas.js.map +1 -1
- package/dist/esm/files/files.shared.utils.d.ts.map +1 -1
- package/dist/esm/files/files.shared.utils.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agent-traceability.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +2 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.js +2 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.definitions.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/prompt-ir.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/prompt-ir.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -1
- package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts.map +1 -1
- package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js.map +1 -1
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
- package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-flow.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
- package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts +2 -2
- package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-config.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
- package/dist/esm/guidance/milestone-builders.shared.js.map +1 -1
- package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/milestone-definition.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-presentation.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
- package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts.map +1 -1
- package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js.map +1 -1
- package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -1
- package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -1
- package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -1
- package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -1
- package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -1
- package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -1
- package/dist/esm/i18n/interpolate-label-params.shared.utils.d.ts.map +1 -1
- package/dist/esm/i18n/interpolate-label-params.shared.utils.js.map +1 -1
- package/dist/esm/i18n/labelling.dto.shared.schemas.d.ts.map +1 -1
- package/dist/esm/i18n/labelling.dto.shared.schemas.js.map +1 -1
- package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -1
- package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -1
- package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -1
- package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -1
- package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -1
- package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -1
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.d.ts +128 -0
- package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.d.ts.map +1 -0
- package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.js +136 -0
- package/dist/esm/meta-workflows/elicitation-depth.meta-workflows.shared.schemas.js.map +1 -0
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +45 -1
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +87 -2
- package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/meta-workflows.exports.d.ts +1 -0
- package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
- package/dist/esm/meta-workflows.exports.js +1 -0
- package/dist/esm/meta-workflows.exports.js.map +1 -1
- package/dist/esm/monitoring/monitoring.shared.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/monitoring.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/email/email-context.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-context.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/email/email-submission.shared.enums.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-submission.shared.enums.js.map +1 -1
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
- package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.d.ts +5 -3
- package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.js +5 -3
- package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/application-owner-organization.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-features.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-features.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-inheritance.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-inheritance.shared.js.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.example.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.example.js.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
- package/dist/esm/organizations/organization-units.shared.path.d.ts.map +1 -1
- package/dist/esm/organizations/organization-units.shared.path.js.map +1 -1
- package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-units.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-units.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
- package/dist/esm/public-runtime/index.d.ts +13 -0
- package/dist/esm/public-runtime/index.d.ts.map +1 -1
- package/dist/esm/public-runtime/index.js +13 -0
- package/dist/esm/public-runtime/index.js.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.d.ts +71 -2
- package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.js +85 -2
- package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.utils.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.utils.js.map +1 -1
- package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/queues.shared.schemas.js.map +1 -1
- package/dist/esm/queue/queues.shared.utils.d.ts.map +1 -1
- package/dist/esm/queue/queues.shared.utils.js.map +1 -1
- package/dist/esm/queue/rabbitmq-queue-args.shared.d.ts.map +1 -1
- package/dist/esm/queue/rabbitmq-queue-args.shared.js.map +1 -1
- package/dist/esm/rag/rag-retrieval-health.shared.d.ts.map +1 -1
- package/dist/esm/rag/rag-retrieval-health.shared.js.map +1 -1
- package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
- package/dist/esm/requests/header-keys.shared.js.map +1 -1
- package/dist/esm/requests/http-requests.shared.d.ts.map +1 -1
- package/dist/esm/requests/http-requests.shared.js.map +1 -1
- package/dist/esm/requests/idempotency-key.shared.d.ts.map +1 -1
- package/dist/esm/requests/idempotency-key.shared.js.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
- package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.d.ts +2 -2
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/child-operations.shared.schemas.js.map +1 -1
- package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -1
- package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -1
- package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/context-policy.shared.schemas.js.map +1 -1
- package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -1
- package/dist/esm/resources/relationship-display.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/relationship-display.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resource-status-lifecycle.example.d.ts +100 -0
- package/dist/esm/resources/resource-status-lifecycle.example.d.ts.map +1 -0
- package/dist/esm/resources/resource-status-lifecycle.example.js +156 -0
- package/dist/esm/resources/resource-status-lifecycle.example.js.map +1 -0
- package/dist/esm/resources/resources-config.shared.factory.d.ts +25 -1
- package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.js +31 -8
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +33 -0
- package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-serialization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-serialization.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.js.map +1 -1
- package/dist/esm/resources/utils/composition-seedability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/composition-seedability.validation.js.map +1 -1
- package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js.map +1 -1
- package/dist/esm/resources/utils/duplicate-relationship-registration.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/duplicate-relationship-registration.validation.js.map +1 -1
- package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -1
- package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js.map +1 -1
- package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/repository-dto-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/repository-dto-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/required-fk-fillability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/required-fk-fillability.validation.js.map +1 -1
- package/dist/esm/resources/utils/resource-operation-type-guards.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-operation-type-guards.utils.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.relationships.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.relationships.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.schemas.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.utils.js.map +1 -1
- package/dist/esm/resources/utils/resource-subtree.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-subtree.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-context-needs.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-context-needs.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-naming.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-naming.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +25 -0
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +47 -19
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.path.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.path.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-serialization.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-family-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-family-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-type-inference.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-type-inference.utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-type-utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-type-utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-variant-resolver.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-variant-resolver.utils.js.map +1 -1
- package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
- package/dist/esm/resources/utils/templatable-file-fields.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js.map +1 -1
- package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -1
- package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
- package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
- package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
- package/dist/esm/runtime/runtime.shared.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/runtime.shared.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.d.ts.map +1 -1
- package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.utils.js.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -1
- package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/password-blocklist.shared.utils.js.map +1 -1
- package/dist/esm/security/authentications/password-reset.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/password-reset.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/same-origin-redirect-path.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/same-origin-redirect-path.shared.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.application-roles.example.d.ts +37 -0
- package/dist/esm/security/authorizations/roles.application-roles.example.d.ts.map +1 -0
- package/dist/esm/security/authorizations/roles.application-roles.example.js +50 -0
- package/dist/esm/security/authorizations/roles.application-roles.example.js.map +1 -0
- package/dist/esm/security/authorizations/roles.shared.defaults.d.ts +13 -0
- package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.defaults.js +13 -0
- package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +29 -0
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js +28 -0
- package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
- package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -1
- package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/crypto-keys/crypto-keys.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.js.map +1 -1
- package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
- package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -1
- package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-env.shared.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts.map +1 -1
- package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js.map +1 -1
- package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
- package/dist/esm/testing/resource-config-builders.js.map +1 -1
- package/dist/esm/testing.d.ts.map +1 -1
- package/dist/esm/testing.js.map +1 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js.map +1 -1
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
- package/dist/esm/users/anonymous-users.shared.schema.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +2 -0
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-consent-decision.shared.utils.d.ts.map +1 -1
- package/dist/esm/users/user-consent-decision.shared.utils.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-preferences-reset.shared.utils.d.ts.map +1 -1
- package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/esm/__tests__/setup.d.ts +0 -2
- package/dist/esm/__tests__/setup.d.ts.map +0 -1
- package/dist/esm/__tests__/setup.js +0 -19
- package/dist/esm/__tests__/setup.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-profile.shared.resources-config.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-profile.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../src/organizations/organization-profile.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,yBAAyB,EAG1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAA8C,MAAM,uCAAuC,CAAC;AAC/H,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAExH,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAExF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,k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AAE,0BAA0B,CAAC,SAAS;oBAC5C,OAAO,EAAE,2BAA2B,CAAC,iBAAiB;iBACvD;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Organization Profile Shared Resource Configuration\n *\n * Resource configuration for organization profile management.\n * App-focused management for company information and branding.\n */\n\nimport { z } from 'zod';\nimport {\n OrganizationProfileSchema,\n OrganizationIndustry,\n OrganizationSize\n} from './organization-profile.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 { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\n\nimport { CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\n\n// Custom operations enum for organization profile\nexport enum OrganizationProfile_Operations {\n UPDATE_BRANDING = 'update_branding', // Update only branding information\n}\n\ntype OrganizationProfileCoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.DELETE;\n\n/*\nOrganization Profile Resource Configuration Factory\n*/\nexport const organizationProfileResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof OrganizationProfile_Operations,\n OrganizationProfileCoreOperations,\n typeof OrganizationProfileSchema\n>({\n mainSchema: OrganizationProfileSchema,\n resourceIdentifier: CoreResourceType.ORGANIZATION_PROFILES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATION_PROFILES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n // onParentCreate eager-seeding writes through createAsSystem → opt into the\n // fail-closed system-write policy (composition-oncreate-lifecycle plan).\n systemAccessPolicy: { create: ResourceSystemAccessMode.ALLOWED },\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.CREATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition\n // onParentDelete cascade so the eager-seeded 1:1 profile row is physically\n // removed when its owning organization is deleted. Without it the cascade\n // throws ErrorType.CONFIGURATION on any org that has a profile row.\n CoreResourceOperation.DELETE,\n ],\n\n customOperation: OrganizationProfile_Operations,\n\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n // INTERNAL_CALL (not REPOSITORY_ONLY): the onParentCreate seed's\n // `createAsSystem` resolves the CREATE op via the service tier\n // (`getServiceOperationPathDefault`), which rejects REPOSITORY_ONLY →\n // OPERATION_PATH_NOT_FOUND, silent no-seed. See the org-preferences config\n // + composition-oncreate plan for the full rationale.\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n // requestDto auto-derived from decorators\n }\n ]\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MANAGER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n // requestDto auto-derived from decorators\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.FRONT_END_SUCCESS,\n }\n ]\n },\n\n // Internal-only (REPOSITORY_ONLY, no HTTP route): powers the composition\n // onParentDelete cascade so this eager-seeded 1:1 profile row is physically\n // removed when its owning organization is deleted. Without a DELETE op the\n // cascade (deleteChildrenImmediate) throws ErrorType.CONFIGURATION — the row\n // is seeded on org create, so every org has one. ORG_ADMIN/HIGH: the org-scope\n // admin tier for a privileged teardown. See composition-oncreate-lifecycle plan.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n\n [OrganizationProfile_Operations.UPDATE_BRANDING]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n branding: OrganizationProfileSchema.shape.branding\n }),\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.FRONT_END_SUCCESS,\n }\n ]\n }\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-profile.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-profile.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-profile.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,oBAAY,gBAAgB;IAC1B,OAAO,YAAY,CAAY,iBAAiB;IAChD,KAAK,UAAU,CAAgB,kBAAkB;IACjD,MAAM,WAAW,CAAc,mBAAmB;IAClD,KAAK,UAAU,CAAgB,qBAAqB;IACpD,UAAU,eAAe;CAC1B;AAED,oBAAY,oBAAoB;IAC9B,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,KAAK,UAAU;CAChB;AAID,eAAO,MAAM,0BAA0B;;;;;iBAkCrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,EACjD,gBAAgB,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAMlE;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoCpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-profile.shared.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-profile.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAkB,MAAM,qCAAqC,CAAC;AAErF,oCAAoC;AACpC,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,mCAAe,CAAA;IACf,qCAAiB,CAAA;IACjB,mCAAe,CAAA;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C,MAAM,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE;IAE9D,WAAW;IACX,mFAAmF;IACnF,kFAAkF;IAClF,QAAQ,EAAE,0BAA0B,CAAC,OAAO,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAElF,eAAe;IACf,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACjF,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QACtF,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACjF,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;KACjF,CAAC,CAAC,QAAQ,EAAE;IAEb,eAAe;IACf,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IACnG,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACpG,CAAC,CAAC","sourcesContent":["/**\n * Organization Profile Shared Schemas\n * \n * Company information, branding, and public profile data.\n * Separated from core organization for performance optimization.\n */\n\nimport { z } from 'zod';\nimport { AddressSchema } from '@wildo-ai/presets-components-models';\nimport { ZodTypeForColors } from '@wildo-ai/zod-decorators';\nimport { CommonTimezone, TimezoneSchema } from '@wildo-ai/presets-components-models';\n\n// Organization classification enums\nexport enum OrganizationSize {\n STARTUP = 'STARTUP', // 1-10 employees\n SMALL = 'SMALL', // 11-50 employees\n MEDIUM = 'MEDIUM', // 51-200 employees\n LARGE = 'LARGE', // 201-1000 employees\n ENTERPRISE = 'ENTERPRISE' // 1000+ employees\n}\n\nexport enum OrganizationIndustry {\n TECHNOLOGY = 'TECHNOLOGY',\n FINANCE = 'FINANCE',\n HEALTHCARE = 'HEALTHCARE',\n EDUCATION = 'EDUCATION',\n RETAIL = 'RETAIL',\n MANUFACTURING = 'MANUFACTURING',\n CONSULTING = 'CONSULTING',\n MEDIA = 'MEDIA',\n GOVERNMENT = 'GOVERNMENT',\n NONPROFIT = 'NONPROFIT',\n OTHER = 'OTHER'\n}\n\n// Address Schema\n\nexport const OrganizationBrandingSchema = z.object({\n /**\n * Per-org logo (user-authored, absolute URL), resolved into identification by #410 and consumed by the standard login card in #651.\n *\n * A tenant that uploads a logo now sees it on its own sign-in page: the identification response\n * resolves this first and falls back to the application's own brand assets. See\n * {@link resolveTenantBrandPresentation}, which owns the precedence.\n *\n * **The audit note this replaces was accurate and its conclusion was wrong**, and the way it went\n * wrong is worth keeping. It read: *\"the one place that surfaces an organization's branding logo\n * to a DTO is the auth login response, and it ALREADY applies the app-level default: at\n * identification time only a domain was matched (the org profile is not loaded) … Because the only\n * surfacing seam is already handled, no additional backend fallback seam is introduced here\n * (invented seams are avoided by design).\"*\n *\n * Every factual clause held. But \"the org profile is not loaded\" described what the code DID, not\n * what it could do — the domain lookup resolves `scopeId`, which is the organization id, so the\n * profile was always one read away. Reasoning from the current call graph to \"no seam is needed\"\n * turned an unfinished implementation into a documented design decision, and it then justified\n * leaving the field inert for as long as anyone read the note. Avoiding invented seams is right;\n * this seam was not invented, it was the one the field exists for.\n *\n * Kept `z.url()` (absolute) because this is direct user input, unlike the\n * backend-populated `logoUrl` output fields (auth-response / email context)\n * that accept app-relative brand-asset paths.\n */\n logo: z.url().optional().describe(\"Absolute URL of the organization's logo. On the sign-in page, people whose email domain signs in through this organization's single sign-on see it in place of the application's logo.\"),\n favicon: z.url().optional().describe(\"Absolute URL of the organization's browser-tab icon. On the sign-in page, people whose email domain signs in through this organization's single sign-on see it in the tab while the organization's sign-in card is shown.\"),\n primaryColor: ZodTypeForColors.optional(),\n secondaryColor: ZodTypeForColors.optional(),\n // `customDomain` was removed (#1799). Nothing resolved an organization from a request's host, and\n // serving an application on a tenant's own domain needs host routing, certificates, CORS, cookie and\n // redirect-URI handling and domain verification — a feature, not a field. An administrator who set it\n // believed a domain was configured and nothing was.\n});\nexport type OrganizationBranding = z.infer<typeof OrganizationBrandingSchema>;\n\n/**\n * What a tenant's own sign-in screen should show: the ORGANIZATION's branding when it declared any,\n * otherwise the application's (#410).\n *\n * Per field, not per record — a tenant that uploaded a logo and never picked a colour keeps the\n * caller's colour fallback, if one exists. Authentication identification supplies no application colour;\n * its standard login consumer keeps application theme tokens and uses a supplied tenant colour only as\n * a decorative identity accent. Resolving the record as a unit would make one\n * expressed field silence the others, which is the same trap the regional-preferences layer had to\n * avoid.\n *\n * A pure function taking the application's ALREADY-RESOLVED values, so it can live beside the schema\n * it resolves without this module knowing anything about brand assets, configuration services or\n * how the application's own logo is chosen. The caller keeps that; this owns only the precedence,\n * which is the part worth having one copy of.\n *\n * `faviconUrl` is the tenant's or nothing: the application's own icon is already the page's, so the\n * sign-in page swaps it only for a tenant that set one (#1799). `secondaryColor` is deliberately\n * absent: the DTO that carries this to a login screen has no field for it, so resolving it would\n * produce a value nothing transports. Adding it is a DTO decision first.\n */\nexport function resolveTenantBrandPresentation(\n branding: OrganizationBranding | null | undefined,\n applicationBrand: { logoUrl?: string; primaryColor?: string },\n): { logoUrl?: string; primaryColor?: string; faviconUrl?: string } {\n return {\n logoUrl: branding?.logo ?? applicationBrand.logoUrl,\n primaryColor: branding?.primaryColor ?? applicationBrand.primaryColor,\n ...(branding?.favicon ? { faviconUrl: branding.favicon } : {}),\n };\n}\n\nexport const OrganizationProfileSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n \n // Company information\n displayName: z.string().max(100).optional().isDBIndexed().isSummaryField(),\n domain: z.string().min(1).max(100).optional().isDBIndexed(),\n phone: z.string().max(20).optional(),\n website: z.url().optional(),\n description: z.string().max(500).optional(),\n \n // Classification\n industry: z.enum(OrganizationIndustry).optional().isDBIndexed(),\n size: z.enum(OrganizationSize).optional().isDBIndexed(),\n founded: z.date().optional(),\n \n // Location\n address: AddressSchema.optional(),\n timezone: z.string().default(CommonTimezone.UTC).isDBIndexed(),\n \n // Branding\n // `.default(...)` (interior fully optional/defaulted) so the row is eager-seedable\n // via onParentCreate — root-cause fix, consistent with sibling defaulted objects.\n branding: OrganizationBrandingSchema.default(OrganizationBrandingSchema.parse({})),\n \n // Social links\n socialLinks: z.object({\n linkedin: z.url().optional().describe(\"URL of the organization's LinkedIn page.\"),\n twitter: z.url().optional().describe(\"URL of the organization's X (Twitter) profile.\"),\n facebook: z.url().optional().describe(\"URL of the organization's Facebook page.\"),\n github: z.url().optional().describe(\"URL of the organization's GitHub profile.\")\n }).optional(),\n \n // Audit fields\n createdAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate()\n});\nexport type OrganizationProfile = z.infer<typeof OrganizationProfileSchema>; "]}
|
|
1
|
+
{"version":3,"file":"organization-profile.shared.schemas.js","sourceRoot":"","sources":["../../../src/organizations/organization-profile.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAkB,MAAM,q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ile data.\n * Separated from core organization for performance optimization.\n */\n\nimport { z } from 'zod';\nimport { AddressSchema } from '@wildo-ai/presets-components-models';\nimport { ZodTypeForColors } from '@wildo-ai/zod-decorators';\nimport { CommonTimezone, TimezoneSchema } from '@wildo-ai/presets-components-models';\n\n// Organization classification enums\nexport enum OrganizationSize {\n STARTUP = 'STARTUP', // 1-10 employees\n SMALL = 'SMALL', // 11-50 employees\n MEDIUM = 'MEDIUM', // 51-200 employees\n LARGE = 'LARGE', // 201-1000 employees\n ENTERPRISE = 'ENTERPRISE' // 1000+ employees\n}\n\nexport enum OrganizationIndustry {\n TECHNOLOGY = 'TECHNOLOGY',\n FINANCE = 'FINANCE',\n HEALTHCARE = 'HEALTHCARE',\n EDUCATION = 'EDUCATION',\n RETAIL = 'RETAIL',\n MANUFACTURING = 'MANUFACTURING',\n CONSULTING = 'CONSULTING',\n MEDIA = 'MEDIA',\n GOVERNMENT = 'GOVERNMENT',\n NONPROFIT = 'NONPROFIT',\n OTHER = 'OTHER'\n}\n\n// Address Schema\n\nexport const OrganizationBrandingSchema = z.object({\n /**\n * Per-org logo (user-authored, absolute URL), resolved into identification by #410 and consumed by the standard login card in #651.\n *\n * A tenant that uploads a logo now sees it on its own sign-in page: the identification response\n * resolves this first and falls back to the application's own brand assets. See\n * {@link resolveTenantBrandPresentation}, which owns the precedence.\n *\n * **The audit note this replaces was accurate and its conclusion was wrong**, and the way it went\n * wrong is worth keeping. It read: *\"the one place that surfaces an organization's branding logo\n * to a DTO is the auth login response, and it ALREADY applies the app-level default: at\n * identification time only a domain was matched (the org profile is not loaded) … Because the only\n * surfacing seam is already handled, no additional backend fallback seam is introduced here\n * (invented seams are avoided by design).\"*\n *\n * Every factual clause held. But \"the org profile is not loaded\" described what the code DID, not\n * what it could do — the domain lookup resolves `scopeId`, which is the organization id, so the\n * profile was always one read away. Reasoning from the current call graph to \"no seam is needed\"\n * turned an unfinished implementation into a documented design decision, and it then justified\n * leaving the field inert for as long as anyone read the note. Avoiding invented seams is right;\n * this seam was not invented, it was the one the field exists for.\n *\n * Kept `z.url()` (absolute) because this is direct user input, unlike the\n * backend-populated `logoUrl` output fields (auth-response / email context)\n * that accept app-relative brand-asset paths.\n */\n logo: z.url().optional().describe(\"Absolute URL of the organization's logo. On the sign-in page, people whose email domain signs in through this organization's single sign-on see it in place of the application's logo.\"),\n favicon: z.url().optional().describe(\"Absolute URL of the organization's browser-tab icon. On the sign-in page, people whose email domain signs in through this organization's single sign-on see it in the tab while the organization's sign-in card is shown.\"),\n primaryColor: ZodTypeForColors.optional(),\n secondaryColor: ZodTypeForColors.optional(),\n // `customDomain` was removed (#1799). Nothing resolved an organization from a request's host, and\n // serving an application on a tenant's own domain needs host routing, certificates, CORS, cookie and\n // redirect-URI handling and domain verification — a feature, not a field. An administrator who set it\n // believed a domain was configured and nothing was.\n});\nexport type OrganizationBranding = z.infer<typeof OrganizationBrandingSchema>;\n\n/**\n * What a tenant's own sign-in screen should show: the ORGANIZATION's branding when it declared any,\n * otherwise the application's (#410).\n *\n * Per field, not per record — a tenant that uploaded a logo and never picked a colour keeps the\n * caller's colour fallback, if one exists. Authentication identification supplies no application colour;\n * its standard login consumer keeps application theme tokens and uses a supplied tenant colour only as\n * a decorative identity accent. Resolving the record as a unit would make one\n * expressed field silence the others, which is the same trap the regional-preferences layer had to\n * avoid.\n *\n * A pure function taking the application's ALREADY-RESOLVED values, so it can live beside the schema\n * it resolves without this module knowing anything about brand assets, configuration services or\n * how the application's own logo is chosen. The caller keeps that; this owns only the precedence,\n * which is the part worth having one copy of.\n *\n * `faviconUrl` is the tenant's or nothing: the application's own icon is already the page's, so the\n * sign-in page swaps it only for a tenant that set one (#1799). `secondaryColor` is deliberately\n * absent: the DTO that carries this to a login screen has no field for it, so resolving it would\n * produce a value nothing transports. Adding it is a DTO decision first.\n */\nexport function resolveTenantBrandPresentation(\n branding: OrganizationBranding | null | undefined,\n applicationBrand: { logoUrl?: string; primaryColor?: string },\n): { logoUrl?: string; primaryColor?: string; faviconUrl?: string } {\n return {\n logoUrl: branding?.logo ?? applicationBrand.logoUrl,\n primaryColor: branding?.primaryColor ?? applicationBrand.primaryColor,\n ...(branding?.favicon ? { faviconUrl: branding.favicon } : {}),\n };\n}\n\nexport const OrganizationProfileSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n \n // Company information\n displayName: z.string().max(100).optional().isDBIndexed().isSummaryField(),\n domain: z.string().min(1).max(100).optional().isDBIndexed(),\n phone: z.string().max(20).optional(),\n website: z.url().optional(),\n description: z.string().max(500).optional(),\n \n // Classification\n industry: z.enum(OrganizationIndustry).optional().isDBIndexed(),\n size: z.enum(OrganizationSize).optional().isDBIndexed(),\n founded: z.date().optional(),\n \n // Location\n address: AddressSchema.optional(),\n timezone: z.string().default(CommonTimezone.UTC).isDBIndexed(),\n \n // Branding\n // `.default(...)` (interior fully optional/defaulted) so the row is eager-seedable\n // via onParentCreate — root-cause fix, consistent with sibling defaulted objects.\n branding: OrganizationBrandingSchema.default(OrganizationBrandingSchema.parse({})),\n \n // Social links\n socialLinks: z.object({\n linkedin: z.url().optional().describe(\"URL of the organization's LinkedIn page.\"),\n twitter: z.url().optional().describe(\"URL of the organization's X (Twitter) profile.\"),\n facebook: z.url().optional().describe(\"URL of the organization's Facebook page.\"),\n github: z.url().optional().describe(\"URL of the organization's GitHub profile.\")\n }).optional(),\n \n // Audit fields\n createdAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate()\n});\nexport type OrganizationProfile = z.infer<typeof OrganizationProfileSchema>; "]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-inheritance.shared.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-inheritance.shared.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-unit-inheritance.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,0CAA0C,EAAE,MAAM,qCAAqC,CAAC;AAGjG;;;;;;;GAOG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,0CAA0C,GAAG,IAAI,CAAC;CAC9E,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,wFAAwF;IACxF,QAAQ,CAAC,4BAA4B,EAAE,MAAM,EAAE,CAAC;IAChD,yFAAyF;IACzF,QAAQ,CAAC,4BAA4B,EAAE,MAAM,EAAE,CAAC;CACjD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,uCAAuC,CAAC,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAEtG;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,6CAA6C,CAC3D,YAAY,EAAE,SAAS,+BAA+B,EAAE,EACxD,iBAAiB,EAAE,SAAS,+BAA+B,EAAE,GAC5D,8BAA8B,CAyBhC;AAED;;;;;GAKG;AACH,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,SAAS,+BAA+B,EAAE,GACvD,OAAO,CAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-inheritance.shared.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-inheritance.shared.js","sourceRoot":"","sources":["../../../src/organizations/organization-unit-inheritance.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,0CAA0C,EAAE,MAAM,qCAAqC,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAA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AAgB,CAAC;QACnD,4BAA4B,EAAE,CAAC,GAAG,gBAAgB,CAAC;KACpD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wCAAwC,CACtD,YAAwD;IAExD,OAAO,YAAY,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/**\n * Downward inheritance of a unit-scoped grant across the organization tree (plan decision D-C2).\n *\n * assurance-control: WILDO.ACCESS.SCOPE_CONFINEMENT — expands a unit grant to exactly the subtree its\n * `inheritanceType` declares, and to nothing else.\n *\n * ## What this expresses\n *\n * A role held at unit U reaches U's DESCENDANTS when U declares\n * {@link OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN}, and reaches U alone when it\n * declares `NO_INHERITANCE`. There is no third direction: upward propagation was removed from the\n * vocabulary (D-C2) because a role held at a leaf conferring authority over its ancestors is\n * privilege escalation along the org chart.\n *\n * ## Prefix, never recursion\n *\n * The expansion is a PREFIX TEST over the materialized `path`, not a tree walk. That is the whole\n * reason `path` is materialized: `descendants(U)` is `row.path.startsWith(subtreePrefix(U))`, an O(1)\n * test per candidate with no per-level query. A recursive walk would reintroduce the N+1 the\n * materialized path exists to remove, and would do it on the authorization hot path.\n *\n * ## Why this is pure, and where the I/O lives\n *\n * Reading the unit rows is the caller's job (the authorization gate, which holds the repositories).\n * Keeping the rule itself pure means the traversal can be pinned exhaustively without a database, and\n * means one function answers \"which units does this grant actually reach\" for every caller that ever\n * needs it — the row filter, the write guard, and the audit record all consume the same answer.\n */\n\nimport { OrganizationUnit_PermissionInheritanceType } from './organization-units.shared.schemas';\nimport { isOrganizationUnitInSubtree } from './organization-units.shared.path';\n\n/**\n * The unit fields inheritance depends on, read structurally so callers can pass whatever row shape\n * they already hold without projecting it first.\n *\n * `path` and `inheritanceType` are optional because a row can reach this function without them — a\n * projection that dropped them, or a row written before the field existed. Both cases resolve to the\n * conservative answer; see {@link resolveOrganizationUnitInheritsDownward}.\n */\nexport type OrganizationUnitInheritanceNode = {\n readonly _id: string;\n readonly path?: string | null;\n readonly inheritanceType?: OrganizationUnit_PermissionInheritanceType | null;\n};\n\n/**\n * The result of expanding a grant: what it reaches, and which part of that came from inheritance.\n *\n * The split is not cosmetic. A grant at a ROOT unit with downward inheritance reaches the entire\n * organization chart, which is functionally organization-wide access assembled from one narrow grant\n * (plan decision D-C4, watch item 4). That must be LEGIBLE in the access record rather than looking\n * like a narrow grant, so the two sets are reported separately and the audit surface keeps both.\n */\nexport type OrganizationUnitGrantExpansion = {\n /** Every unit the grant reaches — the set the row predicate and the write guard use. */\n readonly effectiveOrganizationUnitIds: string[];\n /** The units reached ONLY through downward inheritance. Empty when nothing inherited. */\n readonly inheritedOrganizationUnitIds: string[];\n};\n\n/**\n * Does a role held at this unit propagate to its descendants?\n *\n * ⚠️ An ABSENT value resolves to `false`, which deliberately DIFFERS from the schema's write-time\n * default of `INHERIT_DOWN`. A row that reaches an authorization decision without the field has\n * bypassed the schema that would have supplied that default, and an authorization primitive must not\n * widen a grant on data it cannot vouch for. The divergence is one-directional and fail-closed: the\n * worst case is a grant that reaches fewer units than intended, never more.\n */\nexport function resolveOrganizationUnitInheritsDownward(unit: OrganizationUnitInheritanceNode): boolean {\n return unit.inheritanceType === OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN;\n}\n\n/**\n * Expand directly-held unit grants across the tree.\n *\n * `grantedUnits` are the units whose role actually satisfied the operation — NOT every unit the\n * principal belongs to. `organizationUnits` is the candidate set to test against; the caller scopes it\n * (in practice, to the units of the organization the grants belong to), and this function never widens\n * beyond what it is given.\n *\n * Units are matched by PREFIX, so a grant with downward inheritance reaches the whole subtree at any\n * depth in one pass — a grandchild is found by the same test as a child, with no recursion.\n *\n * ## Status is deliberately NOT filtered\n *\n * An ARCHIVED or SUSPENDED descendant stays inside the grant. Archiving a branch records that it is no\n * longer operationally active; it is not a revocation of access to the records that branch owns. Making\n * it one would mean archiving silently removes rows from their manager's view — a data-visibility\n * change disguised as a lifecycle change, and one that surfaces as missing data rather than as a\n * refusal. If unit status should ever gate access, it belongs in an explicit, separately-audited rule.\n */\nexport function expandOrganizationUnitGrantThroughInheritance(\n grantedUnits: readonly OrganizationUnitInheritanceNode[],\n organizationUnits: readonly OrganizationUnitInheritanceNode[],\n): OrganizationUnitGrantExpansion {\n const effectiveUnitIds = new Set<string>();\n const inheritedUnitIds = new Set<string>();\n\n for (const grantedUnit of grantedUnits) {\n if (grantedUnit._id) effectiveUnitIds.add(grantedUnit._id);\n }\n\n for (const grantedUnit of grantedUnits) {\n if (!grantedUnit._id || !resolveOrganizationUnitInheritsDownward(grantedUnit)) continue;\n\n const subtreeRoot = { _id: grantedUnit._id, path: grantedUnit.path ?? '' };\n for (const candidateUnit of organizationUnits) {\n if (!candidateUnit._id || effectiveUnitIds.has(candidateUnit._id)) continue;\n if (isOrganizationUnitInSubtree({ path: candidateUnit.path ?? '' }, subtreeRoot)) {\n effectiveUnitIds.add(candidateUnit._id);\n inheritedUnitIds.add(candidateUnit._id);\n }\n }\n }\n\n return {\n effectiveOrganizationUnitIds: [...effectiveUnitIds],\n inheritedOrganizationUnitIds: [...inheritedUnitIds],\n };\n}\n\n/**\n * Does any of these grants propagate downward?\n *\n * The caller's cheap pre-check: when nothing inherits, the candidate set never has to be loaded at\n * all, so a `NO_INHERITANCE` organization pays one lookup instead of two.\n */\nexport function anyOrganizationUnitGrantInheritsDownward(\n grantedUnits: readonly OrganizationUnitInheritanceNode[],\n): boolean {\n return grantedUnits.some(resolveOrganizationUnitInheritsDownward);\n}\n"]}
|
package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-members.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-members.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-unit-members.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAA8B,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAMzG,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAQjF,KAAK,oCAAoC,GACrC,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,iEAAiE,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;mBA8E9H,CAAC"}
|
package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-members.shared.resources-config.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-members.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../src/organizations/organization-unit-members.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAwB,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAErF,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAE1G,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,MAAM,sCAAsC,GAAG;IAC7C,k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BACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC;oBAClC,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,YAAY,EAAE,sCAAsC;iBACrD;aACF;SACF;QAED,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;iBAC7C;aACF;SACF;QAED,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;iBAC7C;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Organization Unit Member Shared Resource Configuration\n *\n * The junction resource that replaced `OrganizationMember.organizationUnitsMembership` (plan\n * decision D-B5). See {@link OrganizationUnitMemberSchema} for why the embedded array could not\n * carry these semantics.\n */\n\nimport { z } from 'zod';\nimport { OrganizationUnitMemberSchema } from './organization-unit-members.shared.schemas';\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\n\nimport { CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\n\nconst ORGANIZATION_UNIT_MEMBER_FILTER_FIELDS = {\n organizationUnitId: z.string(),\n organizationMemberId: z.string(),\n role: z.string().describe('Only return assignments that hold exactly this role inside their unit.'),\n};\n\ntype OrganizationUnitMemberCoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\n/**\n * Organization Unit Member Resource Configuration Factory.\n *\n * Read access is ORG_MEMBER (the org chart and who sits where is ordinary directory information\n * inside a tenant); every WRITE is ORG_ADMIN, because a unit assignment is a role grant and becomes\n * live authority once WS-C wires units into authorization.\n */\nexport const organizationUnitMemberResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n Record<string, never>,\n OrganizationUnitMemberCoreOperations,\n typeof OrganizationUnitMemberSchema\n>({\n mainSchema: OrganizationUnitMemberSchema,\n resourceIdentifier: CoreResourceType.ORGANIZATION_UNIT_MEMBERS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATION_UNIT_MEMBERS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n ],\n\n operationsConfiguration: {\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n // A unit assignment is a role grant; the role-ceiling gate additionally bounds WHICH role\n // an admin may grant here.\n roles: [CORE_ORG_ROLES.ORG_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n },\n ],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n filterFields: ORGANIZATION_UNIT_MEMBER_FILTER_FIELDS,\n },\n ],\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n },\n ],\n },\n\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n },\n ],\n },\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-members.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-members.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-unit-members.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,4BAA4B;;;;;;;;kBA6CvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-members.shared.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-members.shared.schemas.js","sourceRoot":"","sources":["../../../src/organizations/organization-unit-members.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,CAAC,EAAE,MA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AAC,cAAc,CAAC;IAChB,sBAAsB;IACtB,oBAAoB;CACrB,CAAC,CAAC","sourcesContent":["/**\n * Organization Unit Member Shared Schemas\n *\n * The junction between an organization MEMBERSHIP and an organization UNIT: \"this member holds this\n * role inside this unit of the org chart\".\n *\n * ## Why this is a resource and not an embedded array (plan decision D-B5)\n *\n * This started life as `OrganizationMember.organizationUnitsMembership` — an embedded\n * `[{ organizationUnitId, role }]` array. That shape could not carry the semantics it claimed:\n *\n * - **It was not portably queryable.** A dot-path filter into an array-valued field works on Mongo\n * and resolves to `NULL` on PostgreSQL (matching nothing), there is no first-class containment\n * operator, and the application-side fallback is stripped by the LIST summary projection. BOTH\n * available routes fail **OPEN**. Anything that had to ask \"who is assigned to this unit?\" —\n * the unit DELETE dependents guard, and any future authorization read — would have silently\n * passed on one adapter.\n * - **It could not be a relationship.** With no registered edge there was no cascade, so unit\n * assignments outlived both the unit and the membership that justified them.\n * - **It admitted duplicates.** An array has no uniqueness; a member could carry two different\n * roles for the same unit with no defined winner.\n *\n * As a first-class junction all three close: the assignment is queryable on every adapter, the\n * `ORGANIZATION_UNITS → ORGANIZATION_UNIT_MEMBERS` edge lets the unit DELETE guard finally cover\n * assigned members, and {@link OrganizationUnitMemberSchema}'s business key makes \"one role per\n * member per unit\" a persisted invariant instead of a convention.\n *\n * ## An authorization axis — live since WS-C phase 2\n *\n * ⚠️ `role` here IS read by the authorization path. `appendUnitScopedRoles` emits one\n * `initiatorRoles` entry per assignment, carrying `organizationUnitId` as a NARROWING discriminator\n * beside the organization-wide entry; every consumer that unions `initiatorRoles` partitions on that\n * field first (`isOrganizationWideRoleInfo`). So a unit role is live authority — bounded to one unit,\n * never tenant-wide. Two consequences for anything touching this field:\n *\n * - The role-ceiling gate governs who may ASSIGN it (both write paths carry it explicitly, see\n * {@link OrganizationUnitMemberSchema.shape.role}).\n * - Every change to it is an access-control decision and emits\n * `ORGANIZATION_UNIT_MEMBER_ROLE_CHANGED`, the narrowed twin of the organization-wide\n * `ORGANIZATION_MEMBER_ROLE_CHANGED`.\n *\n * assurance-control: WILDO.ACCESS.LEAST_PRIVILEGE · WILDO.ACCESS.PRIVILEGE_EVIDENCE — least-privilege and evidence on unit-scoped\n * role assignment.\n */\n\nimport { z } from 'zod';\n\nimport { OrgRolesSchema } from '../security/authorizations/roles.shared.schemas';\n\nexport const OrganizationUnitMemberSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n /**\n * Tenant anchor. Denormalized from the parent membership so tenant scoping and the contextual\n * filter resolve on this row alone — an authorization-adjacent read must never depend on a join\n * to establish which tenant a row belongs to.\n */\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n /** The unit of the org chart this assignment targets. */\n organizationUnitId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n /**\n * The organization MEMBERSHIP being assigned — deliberately the membership, not the user.\n *\n * A unit assignment presupposes membership of the owning organization, so the membership row is\n * the true semantic parent: it carries the tenant binding and its deletion is exactly when the\n * assignment stops meaning anything (hence the cascade on that edge). Pointing at `userId`\n * instead would model a user as assignable to a unit of an organization they may not belong to.\n *\n * A denormalized `userId` copy was considered for a one-hop \"unit roles for this user\" read and\n * REJECTED: the execution-context builder already holds the member rows (and therefore their\n * `_id`s) at the point it would need this, so the copy would buy nothing and add a field that can\n * drift.\n */\n organizationMemberId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n /**\n * The role this member holds WITHIN this unit.\n *\n * The only mutable field on the row, and deliberately so: re-grading an assignment through UPDATE\n * keeps the row's identity (and its `createdAt` provenance) intact, where a delete-plus-create\n * would silently reset both. The two coordinates that IDENTIFY the assignment\n * (`organizationMemberId`, `organizationUnitId`) are `.excludeFromUpdate()`, so an edit can change\n * what the assignment GRANTS but never what it is ABOUT.\n *\n * Both write paths — CREATE and UPDATE — are governed by the role-ceiling gate\n * (`assertRequestedRolesWithinCallerCeiling`): a principal cannot grant a unit role it does not\n * itself hold. Because a custom implementation resolves by an exact operation-path key, each path\n * carries the gate explicitly; neither inherits it from the other.\n */\n role: OrgRolesSchema.isDBIndexed().isSummaryField()\n .describe('The role the member holds inside this unit: a core organization role or one the application defines. A caller cannot grant a role it does not hold itself.'),\n createdAt: z.date().default(() => new Date()).optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n}).businessKeySet([\n 'organizationMemberId',\n 'organizationUnitId',\n]);\n\nexport type OrganizationUnitMember = z.infer<typeof OrganizationUnitMemberSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-narrowing-decision.shared.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-narrowing-decision.shared.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-unit-narrowing-decision.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAE7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AAGjG,sDAAsD;AACtD,oBAAY,qCAAqC;IAC/C,6FAA6F;IAC7F,YAAY,iBAAiB;IAC7B,2FAA2F;IAC3F,iBAAiB,sBAAsB;IACvC,oFAAoF;IACpF,aAAa,kBAAkB;IAC/B,6EAA6E;IAC7E,MAAM,WAAW;IACjB;;;;;OAKG;IACH,kCAAkC,uCAAuC;CAC1E;AAED,MAAM,MAAM,iCAAiC,GACzC;IAAE,IAAI,EAAE,qCAAqC,CAAC,YAAY,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,qCAAqC,CAAC,iBAAiB,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,qCAAqC,CAAC,aAAa,CAAC;IA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AC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,oCAAoC,CAAC,CAAC,CAAC,CAAC;IACpG,QAAQ,CAAC,qBAAqB,EAAE,qCAAqC,CAAC;IACtE;;;OAGG;IACH,QAAQ,CAAC,qCAAqC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,gDAAgD,CAAC,CAAC,CAAC,CAAC;IACrI,uHAAuH;IACvH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC,GAAG,iCAAiC,CAuCpC;AAED;;;;GAIG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9F;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,+CAA+C,EAAE,WAAW,CAAC,MAAM,CAAqD,CAAC;AA0CtI,kFAAkF;AAClF,oBAAY,kDAAkD;IAC5D,0HAA0H;IAC1H,4BAA4B,iCAAiC;IAC7D,sHAAsH;IACtH,wBAAwB,6BAA6B;IACrD,sFAAsF;IACtF,iBAAiB,sBAAsB;CACxC;AAED;;;GAGG;AACH,wBAAgB,sDAAsD,CACpE,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,gDAAgD,CAAC,CAAC,CAAC,GAAG,SAAS,EAC7G,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,oCAAoC,CAAC,CAAC,CAAC,GACzF;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,kDAAkD,CAAA;CAAE,EAAE,CAetF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-narrowing-decision.shared.js","sourceRoot":"","sources":["../../../../src/organizations/organization-unit-narrowing-decision.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,0BAA0B,EAAE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U,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,kDAAkD,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAChH,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The single authority deciding whether — and how — a request is narrowed by organization unit.\n *\n * ## Why one function rather than two checks\n *\n * The decision is consumed in two places that live in different services: the OPERATION GATE (may\n * this caller attempt this at all?) and the ROW FILTER / WRITE VALIDATION (which rows may they\n * touch?). Those must agree exactly. If the gate admits a caller on the strength of a unit grant and\n * the filter then fails to narrow, that unit grant has silently become organization-wide access —\n * the precise escalation the narrowing model exists to avoid. Deriving both from one function makes\n * disagreement impossible rather than merely unlikely.\n *\n * It is also the \"record the conferring grant\" surface: the returned decision names WHY access was\n * allowed, which is what an access review needs in order to answer \"why does this person have access\n * to this record?\".\n *\n * ## The algebra (plan decision D-C3b — ADDITIVE)\n *\n * Unit grants ADD reach; they never subtract. An organization-wide grant that already satisfies the\n * operation wins outright and is not narrowed — so opting a resource in can never shrink a result\n * set that a principal could already see.\n */\n\nimport type { ExecutionContext_RoleInfo } from '../runtime/execution-context.shared.schemas';\nimport { isOrganizationWideRoleInfo, selectRoleInfosActingInOrganization, selectUnitScopedRoleGrants } from '../runtime/execution-context.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport type { OrganizationUnitNarrowingDeclaration } from './organization-unit-narrowing.shared';\nimport { ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES, resolveOrganizationUnitNarrowing } from './organization-unit-narrowing.shared';\n\n/** Why a request was allowed — or that it was not. */\nexport enum OrganizationUnitNarrowingDecisionKind {\n /** The resource does not participate in unit narrowing; authorization proceeds unchanged. */\n NOT_NARROWED = 'NOT_NARROWED',\n /** An organization-wide grant satisfies the operation. No narrowing applies (additive). */\n ORGANIZATION_WIDE = 'ORGANIZATION_WIDE',\n /** ONLY unit grants satisfy the operation, so access is confined to those units. */\n UNIT_NARROWED = 'UNIT_NARROWED',\n /** Neither an organization-wide nor a unit grant satisfies the operation. */\n DENIED = 'DENIED',\n /**\n * A UNIT-ONLY principal — one holding no organization-wide entry in the target organization, which\n * only a unit-scoped service-provider relationship produces (#1597) — reads a resource the application\n * declared organization-wide for providers (`serviceProviderOrganizationWideAccess`). Admitted with NO\n * row confinement, read-class operations only. Never produced for a resource that narrows by unit.\n */\n SERVICE_PROVIDER_ORGANIZATION_WIDE = 'SERVICE_PROVIDER_ORGANIZATION_WIDE',\n}\n\nexport type OrganizationUnitNarrowingDecision =\n | { kind: OrganizationUnitNarrowingDecisionKind.NOT_NARROWED }\n | { kind: OrganizationUnitNarrowingDecisionKind.ORGANIZATION_WIDE }\n | { kind: OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED; unitFieldName: string; organizationUnitIds: string[] }\n | { kind: OrganizationUnitNarrowingDecisionKind.DENIED }\n | { kind: OrganizationUnitNarrowingDecisionKind.SERVICE_PROVIDER_ORGANIZATION_WIDE };\n\n/**\n * A decision as STAMPED on an execution context — the conferring-grant record.\n *\n * assurance-control: WILDO.ACCESS.SCOPE_CONFINEMENT — records WHY a principal reached a\n * record, which is the input an access review needs to answer \"why does this person have access to\n * this?\" without reconstructing it from role tables.\n *\n * The extra fields beyond {@link decision} exist for that review, not for the runtime rule: the\n * runtime only ever reads `decision`. `requiredRoles` is what the operation demanded and\n * `operationIdentifier` is what was attempted, so a reviewer can see the demand, the answer and the\n * units it resolved to in one record.\n */\nexport type OrganizationUnitNarrowingStamp = {\n /** The resource the decision was computed FOR. A stamp is only ever valid for this resource. */\n readonly resourceType: string;\n /** The operation whose role set was evaluated. Diagnostic/audit only — never a lookup key. */\n readonly operationIdentifier: string;\n /** The operation's declared role set at evaluation time. */\n readonly requiredRoles: readonly string[];\n /** The decision itself — the only field the runtime rule reads. */\n readonly decision: OrganizationUnitNarrowingDecision;\n /**\n * Of the units in a `UNIT_NARROWED` decision, the ones reached ONLY through downward inheritance\n * rather than held directly.\n *\n * Audit-only, and the reason it exists is specific: with `INHERIT_DOWN`, a grant at a ROOT unit\n * reaches the entire organization chart — functionally organization-wide access assembled from one\n * narrow grant (plan decision D-C4, watch item 4). Reporting only the effective set would make that\n * indistinguishable from a genuinely narrow grant in the access record. Splitting it lets a reviewer\n * see \"granted at Sales, effective across Sales and 12 descendants\" and judge whether that is what\n * was intended.\n */\n readonly inheritedOrganizationUnitIds?: readonly string[];\n};\n\n/**\n * How restrictive a decision is. Higher wins when two stamps meet — see\n * {@link mergeOrganizationUnitNarrowingStamps}.\n */\nconst NARROWING_RESTRICTIVENESS: Readonly<Record<OrganizationUnitNarrowingDecisionKind, number>> = {\n [OrganizationUnitNarrowingDecisionKind.NOT_NARROWED]: 0,\n [OrganizationUnitNarrowingDecisionKind.ORGANIZATION_WIDE]: 0,\n [OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED]: 1,\n [OrganizationUnitNarrowingDecisionKind.DENIED]: 2,\n // Admits without confinement — and only ever on a resource that does not narrow, so it never meets a\n // UNIT_NARROWED stamp for the same resource. BELOW every other kind (#1597 review 7): it is the one\n // decision that admits a principal holding NO organization-wide entry, so any other decision for the same\n // resource in the same context — a NOT_NARROWED, an ORGANIZATION_WIDE, a DENIED — must replace it rather\n // than let the admission ride on. At an equal weight the FIRST stamp won, so an admitting read's stamp\n // could have outlived a later refusal on the same context.\n [OrganizationUnitNarrowingDecisionKind.SERVICE_PROVIDER_ORGANIZATION_WIDE]: -1,\n};\n\n/**\n * Combine an existing stamp with a new one for the SAME resource — a stamp may only ever TIGHTEN.\n *\n * ## Why this is not \"last write wins\", and not \"throw on conflict\"\n *\n * The execution context is reachable by any backend code holding it, so a plain overwrite would let\n * a later `ORGANIZATION_WIDE` stamp erase an earlier `UNIT_NARROWED` one and lift the narrowing —\n * the same privilege-escalation surface the retention see-through setter is guarded against.\n * Throwing on a conflict was rejected instead: the gate is legitimately re-entered within one request\n * (field-validation pre-checks, the MCP tool dispatcher re-running the controller gate), and turning\n * a legitimate re-entry into an exception converts a safe situation into a 500.\n *\n * Monotonic tightening satisfies both: a second evaluation can restrict further, never widen. Two\n * `UNIT_NARROWED` stamps INTERSECT their unit sets for the same reason.\n *\n * The cost is deliberate over-restriction in one edge case: if two operations on the same resource\n * within one request legitimately resolve differently (one satisfied organization-wide, one only by a\n * unit grant), the narrower answer governs both. That is the fail-safe direction.\n */\nexport function mergeOrganizationUnitNarrowingStamps(\n existingStamp: OrganizationUnitNarrowingStamp | undefined,\n incomingStamp: OrganizationUnitNarrowingStamp,\n): OrganizationUnitNarrowingStamp {\n if (!existingStamp) return incomingStamp;\n\n const existingWeight = NARROWING_RESTRICTIVENESS[existingStamp.decision.kind];\n const incomingWeight = NARROWING_RESTRICTIVENESS[incomingStamp.decision.kind];\n\n if (\n existingStamp.decision.kind === OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED &&\n incomingStamp.decision.kind === OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED\n ) {\n const existingUnitIds = new Set(existingStamp.decision.organizationUnitIds);\n const intersectedUnitIds = incomingStamp.decision.organizationUnitIds.filter((unitId) => existingUnitIds.has(unitId));\n // The audit split follows the intersection: an inherited unit that did not survive is no longer\n // reached, so reporting it would overstate the grant in the very record a reviewer reads.\n const survivingIntersectedUnitIds = new Set(intersectedUnitIds);\n return {\n ...incomingStamp,\n decision: { ...incomingStamp.decision, organizationUnitIds: intersectedUnitIds },\n inheritedOrganizationUnitIds: (incomingStamp.inheritedOrganizationUnitIds ?? []).filter((unitId) =>\n survivingIntersectedUnitIds.has(unitId)),\n };\n }\n\n return incomingWeight > existingWeight ? incomingStamp : existingStamp;\n}\n\n/** Expands one role into everything it confers within a scope — the runtime `inheritFrom` chain. */\nexport type OrganizationUnitRoleHierarchyResolver = (role: string, scope: ResourcePrimaryScope) => string[];\n\n/** Does any of `heldRoles` confer at least one of `requiredRoles`, within `scope`? */\nfunction satisfiesAnyRequiredRole(\n heldRoles: readonly string[],\n requiredRoles: readonly string[],\n scope: ResourcePrimaryScope,\n roleHierarchyResolver: OrganizationUnitRoleHierarchyResolver,\n): boolean {\n if (requiredRoles.length === 0) return false;\n const conferred = new Set<string>(heldRoles.flatMap((role) => roleHierarchyResolver(role, scope)));\n return requiredRoles.some((requiredRole) => conferred.has(requiredRole));\n}\n\n/**\n * Decide the narrowing posture for one request.\n *\n * `requiredRoles` is the operation's declared role set. An operation declaring NO roles is not\n * treated as \"anyone passes\" here — this function only ever ANSWERS the unit question, and returns\n * {@link OrganizationUnitNarrowingDecisionKind.NOT_NARROWED} so the caller's existing authorization\n * logic remains the authority for every non-unit consideration.\n *\n * Evaluation order encodes the additive rule:\n * 1. resource not opted in → NOT_NARROWED (nothing to say)\n * 2. organization-wide grant suffices → ORGANIZATION_WIDE (widest wins; no narrowing)\n * 3. unit grant suffices → UNIT_NARROWED, confined to the units that supplied it\n * 4. otherwise → DENIED\n *\n * Step 3 confines access to the units whose grant ACTUALLY satisfied the operation, not to every\n * unit the principal belongs to. A member who is ORG_MANAGER of Sales and ORG_GUEST of Legal, acting\n * on a MANAGER-gated operation, reaches Sales only — carrying Legal along would grant reach that no\n * held role justifies.\n */\nexport function resolveOrganizationUnitNarrowingDecision(input: {\n readonly resourceType: string;\n readonly requiredRoles: readonly string[];\n readonly initiatorRoles: readonly ExecutionContext_RoleInfo[] | undefined;\n /**\n * The organization the request acts inside. Only role entries held IN it are evaluated — an\n * ORG_ADMIN of another tenant must neither satisfy the organization-wide step nor lift narrowing\n * here (see `selectRoleInfosActingInOrganization`). Absent ⇒ no organization entry counts.\n */\n readonly organizationId: string | undefined;\n readonly narrowingRegistry: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>;\n readonly roleHierarchyResolver: OrganizationUnitRoleHierarchyResolver;\n /**\n * Resources the application declared readable organization-wide by a UNIT-scoped service provider\n * (`serviceProviderOrganizationWideAccess`). Absent ⇒ none.\n */\n readonly serviceProviderOrganizationWideAccess?: Readonly<Partial<Record<string, ServiceProviderOrganizationWideAccessDeclaration>>>;\n /** Whether the operation only READS (`READ`/`LIST`/`SEARCH`/`COUNT`). The provider declaration admits nothing else. */\n readonly operationIsReadOnly?: boolean;\n}): OrganizationUnitNarrowingDecision {\n const { resourceType, requiredRoles, narrowingRegistry, roleHierarchyResolver } = input;\n const initiatorRoles = selectRoleInfosActingInOrganization(input.initiatorRoles, input.organizationId);\n\n const narrowing = resolveOrganizationUnitNarrowing(narrowingRegistry, resourceType);\n if (!narrowing) {\n return resolveServiceProviderOrganizationWideAdmission({\n resourceType,\n requiredRoles,\n initiatorRoles,\n roleHierarchyResolver,\n declarations: input.serviceProviderOrganizationWideAccess,\n operationIsReadOnly: input.operationIsReadOnly === true,\n });\n }\n\n // ADDITIVE: an organization-wide grant that already satisfies the operation wins outright, so\n // opting a resource in can never shrink what a principal could already see.\n const organizationWideRoles = (initiatorRoles ?? []).filter(isOrganizationWideRoleInfo);\n for (const roleInfo of organizationWideRoles) {\n if (satisfiesAnyRequiredRole(roleInfo.roles, requiredRoles, roleInfo.relatedPrimaryScope, roleHierarchyResolver)) {\n return { kind: OrganizationUnitNarrowingDecisionKind.ORGANIZATION_WIDE };\n }\n }\n\n // Only the units whose grant actually satisfies the operation confer reach.\n const qualifyingUnitIds = selectUnitScopedRoleGrants(initiatorRoles)\n .filter((grant) =>\n satisfiesAnyRequiredRole(grant.roles, requiredRoles, ResourcePrimaryScope.ORGANIZATIONS, roleHierarchyResolver))\n .map((grant) => grant.organizationUnitId);\n\n if (qualifyingUnitIds.length === 0) return { kind: OrganizationUnitNarrowingDecisionKind.DENIED };\n\n return {\n kind: OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED,\n unitFieldName: narrowing.unitFieldName,\n // De-duplicated: several grants can name the same unit, and the value becomes a query predicate.\n organizationUnitIds: [...new Set(qualifyingUnitIds)],\n };\n}\n\n/**\n * An application's statement that a UNIT-scoped service-provider expert may READ a resource across the\n * whole client organization — a shared reference list, say — even though the resource does not narrow\n * by unit. The rationale is required: it is what a reviewer reads to judge whether the widening is right.\n */\nexport type ServiceProviderOrganizationWideAccessDeclaration = { readonly rationale: string };\n\n/**\n * The ENGINE's own organization-wide reads for a unit-only service-provider principal (#1597) — exactly one resource,\n * and it is the organization row itself.\n *\n * A principal who works in an organization must be able to read which organization that is: its name, type and status,\n * the row an ordinary member reads (its READ requires ORG_MEMBER, which the provider role inherits). Without it the organization switcher — one READ of the row per membership —\n * never lists a client whose relationship is confined to units, so unit scope is unusable through the shipped UI.\n * Reading the row grants nothing else: no other resource, and (by the admission below) no write.\n *\n * Engine-owned rather than an application declaration because the application MAY NOT declare it: ORGANIZATIONS is in\n * the authorization plane, which `collectServiceProviderOrganizationWideAccessViolations` refuses — rightly, since an\n * application widening it could expose a future authority field. The engine owns the row's shape, so the engine is the\n * party that can say its READ is safe. Widening this set is a framework decision, made here and nowhere else.\n */\nexport const ENGINE_SERVICE_PROVIDER_ORGANIZATION_WIDE_READS: ReadonlySet<string> = new Set<string>([CoreResourceType.ORGANIZATIONS]);\n\n/**\n * The non-narrowed half of the decision (#1597).\n *\n * A resource that does not narrow by unit has nothing to say about a principal who holds an\n * organization-wide entry: `NOT_NARROWED`, and ordinary authorization decides. What is new is the\n * UNIT-ONLY principal — one who holds unit entries in the target organization and NO organization-wide\n * entry there. Only a unit-scoped service-provider relationship produces one: an ordinary unit member\n * always also holds the organization-wide entry of the membership their unit role hangs from.\n *\n * Detected STRUCTURALLY (no org-wide entry), never by reading the relationship attribution on the role\n * entry — that field is audit-only by contract, and an authority decision reading it would make audit\n * metadata a control.\n *\n * Such a principal is admitted only when all hold, and otherwise gets `NOT_NARROWED`, which ordinary\n * authorization then refuses because no organization-wide entry satisfies anything (fail closed):\n * - the application declared the resource in `serviceProviderOrganizationWideAccess`, or the engine did\n * ({@link ENGINE_SERVICE_PROVIDER_ORGANIZATION_WIDE_READS} — the organization's own row);\n * - the operation only reads;\n * - one of the unit entries satisfies the operation's roles.\n */\nfunction resolveServiceProviderOrganizationWideAdmission(input: {\n readonly resourceType: string;\n readonly requiredRoles: readonly string[];\n readonly initiatorRoles: readonly ExecutionContext_RoleInfo[];\n readonly roleHierarchyResolver: OrganizationUnitRoleHierarchyResolver;\n readonly declarations: Readonly<Partial<Record<string, ServiceProviderOrganizationWideAccessDeclaration>>> | undefined;\n readonly operationIsReadOnly: boolean;\n}): OrganizationUnitNarrowingDecision {\n const notNarrowed = { kind: OrganizationUnitNarrowingDecisionKind.NOT_NARROWED } as const;\n if (!input.declarations?.[input.resourceType] && !ENGINE_SERVICE_PROVIDER_ORGANIZATION_WIDE_READS.has(input.resourceType)) return notNarrowed;\n if (!input.operationIsReadOnly) return notNarrowed;\n\n const organizationEntries = input.initiatorRoles.filter((roleInfo) => roleInfo.relatedPrimaryScope === ResourcePrimaryScope.ORGANIZATIONS);\n if (organizationEntries.some(isOrganizationWideRoleInfo)) return notNarrowed;\n\n const satisfied = selectUnitScopedRoleGrants(organizationEntries).some((grant) =>\n satisfiesAnyRequiredRole(grant.roles, input.requiredRoles, ResourcePrimaryScope.ORGANIZATIONS, input.roleHierarchyResolver));\n return satisfied ? { kind: OrganizationUnitNarrowingDecisionKind.SERVICE_PROVIDER_ORGANIZATION_WIDE } : notNarrowed;\n}\n\n/** Why a `serviceProviderOrganizationWideAccess` entry was refused at startup. */\nexport enum ServiceProviderOrganizationWideAccessViolationKind {\n /** The resource issues authority (the authorization plane) — a provider must never read it tenant-wide by declaration. */\n AUTHORIZATION_PLANE_RESOURCE = 'AUTHORIZATION_PLANE_RESOURCE',\n /** The resource already narrows by unit; declaring it organization-wide for providers would make one decision two. */\n RESOURCE_NARROWS_BY_UNIT = 'RESOURCE_NARROWS_BY_UNIT',\n /** No rationale — the declaration's whole review value is the sentence saying why. */\n MISSING_RATIONALE = 'MISSING_RATIONALE',\n}\n\n/**\n * Validate an application's `serviceProviderOrganizationWideAccess` against the MERGED narrowing map.\n * Fail closed at startup on any violation: a misdeclared widening is a silent authorization hole.\n */\nexport function collectServiceProviderOrganizationWideAccessViolations(\n declarations: Readonly<Partial<Record<string, ServiceProviderOrganizationWideAccessDeclaration>>> | undefined,\n narrowingRegistry: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n): { resourceType: string; kind: ServiceProviderOrganizationWideAccessViolationKind }[] {\n const forbidden = new Set<string>(ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES);\n const violations: { resourceType: string; kind: ServiceProviderOrganizationWideAccessViolationKind }[] = [];\n for (const [resourceType, declaration] of Object.entries(declarations ?? {})) {\n if (forbidden.has(resourceType)) {\n violations.push({ resourceType, kind: ServiceProviderOrganizationWideAccessViolationKind.AUTHORIZATION_PLANE_RESOURCE });\n }\n if (narrowingRegistry[resourceType]) {\n violations.push({ resourceType, kind: ServiceProviderOrganizationWideAccessViolationKind.RESOURCE_NARROWS_BY_UNIT });\n }\n if (typeof declaration?.rationale !== 'string' || declaration.rationale.trim().length === 0) {\n violations.push({ resourceType, kind: ServiceProviderOrganizationWideAccessViolationKind.MISSING_RATIONALE });\n }\n }\n return violations;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"organization-unit-narrowing-decision.shared.js","sourceRoot":"","sources":["../../../src/organizations/organization-unit-narrowing-decision.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,0BAA0B,EAAE,mCAAmC,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAC1J,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAElF,OAAO,EAAE,+CAA+C,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AAEzI,sDAAsD;AACtD,MAAM,CAAN,IAAY,qCAgBX;AAhBD,WAAY,qCAAqC;IAC/C,6FAA6F;IAC7F,sEAA6B,CAAA;IAC7B,2FAA2F;IAC3F,gFAAuC,CAAA;IAC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,2GAAqD,CAAA;IACrD,sFAAsF;IACtF,6FAAuC,CAAA;AACzC,CAAC,EAPW,kDAAkD,KAAlD,kDAAkD,QAO7D;AAED;;;GAGG;AACH,MAAM,UAAU,sDAAsD,CACpE,YAA6G,EAC7G,iBAA0F;IAE1F,MAAM,SAAS,GAAG,IAAI,GAAG,CAAS,+CAA+C,CAAC,CAAC;IACnF,MAAM,UAAU,GAAyF,EAAE,CAAC;IAC5G,KAAK,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,CAAC;QAC7E,IAAI,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;YAChC,UAAU,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,kDAAkD,CAAC,4BAA4B,EAAE,CAAC,CAAC;QAC3H,CAAC;QACD,IAAI,iBAAiB,CAAC,YAAY,CAAC,EAAE,CAAC;YACpC,UAAU,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,kDAAkD,CAAC,wBAAwB,EAAE,CAAC,CAAC;QACvH,CAAC;QACD,IAAI,OAAO,WAAW,EAAE,SAAS,KAAK,QAAQ,IAAI,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5F,UAAU,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,kDAAkD,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAChH,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * The single authority deciding whether — and how — a request is narrowed by organization unit.\n *\n * ## Why one function rather than two checks\n *\n * The decision is consumed in two places that live in different services: the OPERATION GATE (may\n * this caller attempt this at all?) and the ROW FILTER / WRITE VALIDATION (which rows may they\n * touch?). Those must agree exactly. If the gate admits a caller on the strength of a unit grant and\n * the filter then fails to narrow, that unit grant has silently become organization-wide access —\n * the precise escalation the narrowing model exists to avoid. Deriving both from one function makes\n * disagreement impossible rather than merely unlikely.\n *\n * It is also the \"record the conferring grant\" surface: the returned decision names WHY access was\n * allowed, which is what an access review needs in order to answer \"why does this person have access\n * to this record?\".\n *\n * ## The algebra (plan decision D-C3b — ADDITIVE)\n *\n * Unit grants ADD reach; they never subtract. An organization-wide grant that already satisfies the\n * operation wins outright and is not narrowed — so opting a resource in can never shrink a result\n * set that a principal could already see.\n */\n\nimport type { ExecutionContext_RoleInfo } from '../runtime/execution-context.shared.schemas';\nimport { isOrganizationWideRoleInfo, selectRoleInfosActingInOrganization, selectUnitScopedRoleGrants } from '../runtime/execution-context.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport type { OrganizationUnitNarrowingDeclaration } from './organization-unit-narrowing.shared';\nimport { ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES, resolveOrganizationUnitNarrowing } from './organization-unit-narrowing.shared';\n\n/** Why a request was allowed — or that it was not. */\nexport enum OrganizationUnitNarrowingDecisionKind {\n /** The resource does not participate in unit narrowing; authorization proceeds unchanged. */\n NOT_NARROWED = 'NOT_NARROWED',\n /** An organization-wide grant satisfies the operation. No narrowing applies (additive). */\n ORGANIZATION_WIDE = 'ORGANIZATION_WIDE',\n /** ONLY unit grants satisfy the operation, so access is confined to those units. */\n UNIT_NARROWED = 'UNIT_NARROWED',\n /** Neither an organization-wide nor a unit grant satisfies the operation. */\n DENIED = 'DENIED',\n /**\n * A UNIT-ONLY principal — one holding no organization-wide entry in the target organization, which\n * only a unit-scoped service-provider relationship produces (#1597) — reads a resource the application\n * declared organization-wide for providers (`serviceProviderOrganizationWideAccess`). Admitted with NO\n * row confinement, read-class operations only. Never produced for a resource that narrows by unit.\n */\n SERVICE_PROVIDER_ORGANIZATION_WIDE = 'SERVICE_PROVIDER_ORGANIZATION_WIDE',\n}\n\nexport type OrganizationUnitNarrowingDecision =\n | { kind: OrganizationUnitNarrowingDecisionKind.NOT_NARROWED }\n | { kind: OrganizationUnitNarrowingDecisionKind.ORGANIZATION_WIDE }\n | { kind: OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED; unitFieldName: string; organizationUnitIds: string[] }\n | { kind: OrganizationUnitNarrowingDecisionKind.DENIED }\n | { kind: OrganizationUnitNarrowingDecisionKind.SERVICE_PROVIDER_ORGANIZATION_WIDE };\n\n/**\n * A decision as STAMPED on an execution context — the conferring-grant record.\n *\n * assurance-control: WILDO.ACCESS.SCOPE_CONFINEMENT — records WHY a principal reached a\n * record, which is the input an access review needs to answer \"why does this person have access to\n * this?\" without reconstructing it from role tables.\n *\n * The extra fields beyond {@link decision} exist for that review, not for the runtime rule: the\n * runtime only ever reads `decision`. `requiredRoles` is what the operation demanded and\n * `operationIdentifier` is what was attempted, so a reviewer can see the demand, the answer and the\n * units it resolved to in one record.\n */\nexport type OrganizationUnitNarrowingStamp = {\n /** The resource the decision was computed FOR. A stamp is only ever valid for this resource. */\n readonly resourceType: string;\n /** The operation whose role set was evaluated. Diagnostic/audit only — never a lookup key. */\n readonly operationIdentifier: string;\n /** The operation's declared role set at evaluation time. */\n readonly requiredRoles: readonly string[];\n /** The decision itself — the only field the runtime rule reads. */\n readonly decision: OrganizationUnitNarrowingDecision;\n /**\n * Of the units in a `UNIT_NARROWED` decision, the ones reached ONLY through downward inheritance\n * rather than held directly.\n *\n * Audit-only, and the reason it exists is specific: with `INHERIT_DOWN`, a grant at a ROOT unit\n * reaches the entire organization chart — functionally organization-wide access assembled from one\n * narrow grant (plan decision D-C4, watch item 4). Reporting only the effective set would make that\n * indistinguishable from a genuinely narrow grant in the access record. Splitting it lets a reviewer\n * see \"granted at Sales, effective across Sales and 12 descendants\" and judge whether that is what\n * was intended.\n */\n readonly inheritedOrganizationUnitIds?: readonly string[];\n};\n\n/**\n * How restrictive a decision is. Higher wins when two stamps meet — see\n * {@link mergeOrganizationUnitNarrowingStamps}.\n */\nconst NARROWING_RESTRICTIVENESS: Readonly<Record<OrganizationUnitNarrowingDecisionKind, number>> = {\n [OrganizationUnitNarrowingDecisionKind.NOT_NARROWED]: 0,\n [OrganizationUnitNarrowingDecisionKind.ORGANIZATION_WIDE]: 0,\n [OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED]: 1,\n [OrganizationUnitNarrowingDecisionKind.DENIED]: 2,\n // Admits without confinement — and only ever on a resource that does not narrow, so it never meets a\n // UNIT_NARROWED stamp for the same resource. BELOW every other kind (#1597 review 7): it is the one\n // decision that admits a principal holding NO organization-wide entry, so any other decision for the same\n // resource in the same context — a NOT_NARROWED, an ORGANIZATION_WIDE, a DENIED — must replace it rather\n // than let the admission ride on. At an equal weight the FIRST stamp won, so an admitting read's stamp\n // could have outlived a later refusal on the same context.\n [OrganizationUnitNarrowingDecisionKind.SERVICE_PROVIDER_ORGANIZATION_WIDE]: -1,\n};\n\n/**\n * Combine an existing stamp with a new one for the SAME resource — a stamp may only ever TIGHTEN.\n *\n * ## Why this is not \"last write wins\", and not \"throw on conflict\"\n *\n * The execution context is reachable by any backend code holding it, so a plain overwrite would let\n * a later `ORGANIZATION_WIDE` stamp erase an earlier `UNIT_NARROWED` one and lift the narrowing —\n * the same privilege-escalation surface the retention see-through setter is guarded against.\n * Throwing on a conflict was rejected instead: the gate is legitimately re-entered within one request\n * (field-validation pre-checks, the MCP tool dispatcher re-running the controller gate), and turning\n * a legitimate re-entry into an exception converts a safe situation into a 500.\n *\n * Monotonic tightening satisfies both: a second evaluation can restrict further, never widen. Two\n * `UNIT_NARROWED` stamps INTERSECT their unit sets for the same reason.\n *\n * The cost is deliberate over-restriction in one edge case: if two operations on the same resource\n * within one request legitimately resolve differently (one satisfied organization-wide, one only by a\n * unit grant), the narrower answer governs both. That is the fail-safe direction.\n */\nexport function mergeOrganizationUnitNarrowingStamps(\n existingStamp: OrganizationUnitNarrowingStamp | undefined,\n incomingStamp: OrganizationUnitNarrowingStamp,\n): OrganizationUnitNarrowingStamp {\n if (!existingStamp) return incomingStamp;\n\n const existingWeight = NARROWING_RESTRICTIVENESS[existingStamp.decision.kind];\n const incomingWeight = NARROWING_RESTRICTIVENESS[incomingStamp.decision.kind];\n\n if (\n existingStamp.decision.kind === OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED &&\n incomingStamp.decision.kind === OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED\n ) {\n const existingUnitIds = new Set(existingStamp.decision.organizationUnitIds);\n const intersectedUnitIds = incomingStamp.decision.organizationUnitIds.filter((unitId) => existingUnitIds.has(unitId));\n // The audit split follows the intersection: an inherited unit that did not survive is no longer\n // reached, so reporting it would overstate the grant in the very record a reviewer reads.\n const survivingIntersectedUnitIds = new Set(intersectedUnitIds);\n return {\n ...incomingStamp,\n decision: { ...incomingStamp.decision, organizationUnitIds: intersectedUnitIds },\n inheritedOrganizationUnitIds: (incomingStamp.inheritedOrganizationUnitIds ?? []).filter((unitId) =>\n survivingIntersectedUnitIds.has(unitId)),\n };\n }\n\n return incomingWeight > existingWeight ? incomingStamp : existingStamp;\n}\n\n/** Expands one role into everything it confers within a scope — the runtime `inheritFrom` chain. */\nexport type OrganizationUnitRoleHierarchyResolver = (role: string, scope: ResourcePrimaryScope) => string[];\n\n/** Does any of `heldRoles` confer at least one of `requiredRoles`, within `scope`? */\nfunction satisfiesAnyRequiredRole(\n heldRoles: readonly string[],\n requiredRoles: readonly string[],\n scope: ResourcePrimaryScope,\n roleHierarchyResolver: OrganizationUnitRoleHierarchyResolver,\n): boolean {\n if (requiredRoles.length === 0) return false;\n const conferred = new Set<string>(heldRoles.flatMap((role) => roleHierarchyResolver(role, scope)));\n return requiredRoles.some((requiredRole) => conferred.has(requiredRole));\n}\n\n/**\n * Decide the narrowing posture for one request.\n *\n * `requiredRoles` is the operation's declared role set. An operation declaring NO roles is not\n * treated as \"anyone passes\" here — this function only ever ANSWERS the unit question, and returns\n * {@link OrganizationUnitNarrowingDecisionKind.NOT_NARROWED} so the caller's existing authorization\n * logic remains the authority for every non-unit consideration.\n *\n * Evaluation order encodes the additive rule:\n * 1. resource not opted in → NOT_NARROWED (nothing to say)\n * 2. organization-wide grant suffices → ORGANIZATION_WIDE (widest wins; no narrowing)\n * 3. unit grant suffices → UNIT_NARROWED, confined to the units that supplied it\n * 4. otherwise → DENIED\n *\n * Step 3 confines access to the units whose grant ACTUALLY satisfied the operation, not to every\n * unit the principal belongs to. A member who is ORG_MANAGER of Sales and ORG_GUEST of Legal, acting\n * on a MANAGER-gated operation, reaches Sales only — carrying Legal along would grant reach that no\n * held role justifies.\n */\nexport function resolveOrganizationUnitNarrowingDecision(input: {\n readonly resourceType: string;\n readonly requiredRoles: readonly string[];\n readonly initiatorRoles: readonly ExecutionContext_RoleInfo[] | undefined;\n /**\n * The organization the request acts inside. Only role entries held IN it are evaluated — an\n * ORG_ADMIN of another tenant must neither satisfy the organization-wide step nor lift narrowing\n * here (see `selectRoleInfosActingInOrganization`). Absent ⇒ no organization entry counts.\n */\n readonly organizationId: string | undefined;\n readonly narrowingRegistry: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>;\n readonly roleHierarchyResolver: OrganizationUnitRoleHierarchyResolver;\n /**\n * Resources the application declared readable organization-wide by a UNIT-scoped service provider\n * (`serviceProviderOrganizationWideAccess`). Absent ⇒ none.\n */\n readonly serviceProviderOrganizationWideAccess?: Readonly<Partial<Record<string, ServiceProviderOrganizationWideAccessDeclaration>>>;\n /** Whether the operation only READS (`READ`/`LIST`/`SEARCH`/`COUNT`). The provider declaration admits nothing else. */\n readonly operationIsReadOnly?: boolean;\n}): OrganizationUnitNarrowingDecision {\n const { resourceType, requiredRoles, narrowingRegistry, roleHierarchyResolver } = input;\n const initiatorRoles = selectRoleInfosActingInOrganization(input.initiatorRoles, input.organizationId);\n\n const narrowing = resolveOrganizationUnitNarrowing(narrowingRegistry, resourceType);\n if (!narrowing) {\n return resolveServiceProviderOrganizationWideAdmission({\n resourceType,\n requiredRoles,\n initiatorRoles,\n roleHierarchyResolver,\n declarations: input.serviceProviderOrganizationWideAccess,\n operationIsReadOnly: input.operationIsReadOnly === true,\n });\n }\n\n // ADDITIVE: an organization-wide grant that already satisfies the operation wins outright, so\n // opting a resource in can never shrink what a principal could already see.\n const organizationWideRoles = (initiatorRoles ?? []).filter(isOrganizationWideRoleInfo);\n for (const roleInfo of organizationWideRoles) {\n if (satisfiesAnyRequiredRole(roleInfo.roles, requiredRoles, roleInfo.relatedPrimaryScope, roleHierarchyResolver)) {\n return { kind: OrganizationUnitNarrowingDecisionKind.ORGANIZATION_WIDE };\n }\n }\n\n // Only the units whose grant actually satisfies the operation confer reach.\n const qualifyingUnitIds = selectUnitScopedRoleGrants(initiatorRoles)\n .filter((grant) =>\n satisfiesAnyRequiredRole(grant.roles, requiredRoles, ResourcePrimaryScope.ORGANIZATIONS, roleHierarchyResolver))\n .map((grant) => grant.organizationUnitId);\n\n if (qualifyingUnitIds.length === 0) return { kind: OrganizationUnitNarrowingDecisionKind.DENIED };\n\n return {\n kind: OrganizationUnitNarrowingDecisionKind.UNIT_NARROWED,\n unitFieldName: narrowing.unitFieldName,\n // De-duplicated: several grants can name the same unit, and the value becomes a query predicate.\n organizationUnitIds: [...new Set(qualifyingUnitIds)],\n };\n}\n\n/**\n * An application's statement that a UNIT-scoped service-provider expert may READ a resource across the\n * whole client organization — a shared reference list, say — even though the resource does not narrow\n * by unit. The rationale is required: it is what a reviewer reads to judge whether the widening is right.\n */\nexport type ServiceProviderOrganizationWideAccessDeclaration = { readonly rationale: string };\n\n/**\n * The ENGINE's own organization-wide reads for a unit-only service-provider principal (#1597) — exactly one resource,\n * and it is the organization row itself.\n *\n * A principal who works in an organization must be able to read which organization that is: its name, type and status,\n * the row an ordinary member reads (its READ requires ORG_MEMBER, which the provider role inherits). Without it the organization switcher — one READ of the row per membership —\n * never lists a client whose relationship is confined to units, so unit scope is unusable through the shipped UI.\n * Reading the row grants nothing else: no other resource, and (by the admission below) no write.\n *\n * Engine-owned rather than an application declaration because the application MAY NOT declare it: ORGANIZATIONS is in\n * the authorization plane, which `collectServiceProviderOrganizationWideAccessViolations` refuses — rightly, since an\n * application widening it could expose a future authority field. The engine owns the row's shape, so the engine is the\n * party that can say its READ is safe. Widening this set is a framework decision, made here and nowhere else.\n */\nexport const ENGINE_SERVICE_PROVIDER_ORGANIZATION_WIDE_READS: ReadonlySet<string> = new Set<string>([CoreResourceType.ORGANIZATIONS]);\n\n/**\n * The non-narrowed half of the decision (#1597).\n *\n * A resource that does not narrow by unit has nothing to say about a principal who holds an\n * organization-wide entry: `NOT_NARROWED`, and ordinary authorization decides. What is new is the\n * UNIT-ONLY principal — one who holds unit entries in the target organization and NO organization-wide\n * entry there. Only a unit-scoped service-provider relationship produces one: an ordinary unit member\n * always also holds the organization-wide entry of the membership their unit role hangs from.\n *\n * Detected STRUCTURALLY (no org-wide entry), never by reading the relationship attribution on the role\n * entry — that field is audit-only by contract, and an authority decision reading it would make audit\n * metadata a control.\n *\n * Such a principal is admitted only when all hold, and otherwise gets `NOT_NARROWED`, which ordinary\n * authorization then refuses because no organization-wide entry satisfies anything (fail closed):\n * - the application declared the resource in `serviceProviderOrganizationWideAccess`, or the engine did\n * ({@link ENGINE_SERVICE_PROVIDER_ORGANIZATION_WIDE_READS} — the organization's own row);\n * - the operation only reads;\n * - one of the unit entries satisfies the operation's roles.\n */\nfunction resolveServiceProviderOrganizationWideAdmission(input: {\n readonly resourceType: string;\n readonly requiredRoles: readonly string[];\n readonly initiatorRoles: readonly ExecutionContext_RoleInfo[];\n readonly roleHierarchyResolver: OrganizationUnitRoleHierarchyResolver;\n readonly declarations: Readonly<Partial<Record<string, ServiceProviderOrganizationWideAccessDeclaration>>> | undefined;\n readonly operationIsReadOnly: boolean;\n}): OrganizationUnitNarrowingDecision {\n const notNarrowed = { kind: OrganizationUnitNarrowingDecisionKind.NOT_NARROWED } as const;\n if (!input.declarations?.[input.resourceType] && !ENGINE_SERVICE_PROVIDER_ORGANIZATION_WIDE_READS.has(input.resourceType)) return notNarrowed;\n if (!input.operationIsReadOnly) return notNarrowed;\n\n const organizationEntries = input.initiatorRoles.filter((roleInfo) => roleInfo.relatedPrimaryScope === ResourcePrimaryScope.ORGANIZATIONS);\n if (organizationEntries.some(isOrganizationWideRoleInfo)) return notNarrowed;\n\n const satisfied = selectUnitScopedRoleGrants(organizationEntries).some((grant) =>\n satisfiesAnyRequiredRole(grant.roles, input.requiredRoles, ResourcePrimaryScope.ORGANIZATIONS, input.roleHierarchyResolver));\n return satisfied ? { kind: OrganizationUnitNarrowingDecisionKind.SERVICE_PROVIDER_ORGANIZATION_WIDE } : notNarrowed;\n}\n\n/** Why a `serviceProviderOrganizationWideAccess` entry was refused at startup. */\nexport enum ServiceProviderOrganizationWideAccessViolationKind {\n /** The resource issues authority (the authorization plane) — a provider must never read it tenant-wide by declaration. */\n AUTHORIZATION_PLANE_RESOURCE = 'AUTHORIZATION_PLANE_RESOURCE',\n /** The resource already narrows by unit; declaring it organization-wide for providers would make one decision two. */\n RESOURCE_NARROWS_BY_UNIT = 'RESOURCE_NARROWS_BY_UNIT',\n /** No rationale — the declaration's whole review value is the sentence saying why. */\n MISSING_RATIONALE = 'MISSING_RATIONALE',\n}\n\n/**\n * Validate an application's `serviceProviderOrganizationWideAccess` against the MERGED narrowing map.\n * Fail closed at startup on any violation: a misdeclared widening is a silent authorization hole.\n */\nexport function collectServiceProviderOrganizationWideAccessViolations(\n declarations: Readonly<Partial<Record<string, ServiceProviderOrganizationWideAccessDeclaration>>> | undefined,\n narrowingRegistry: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n): { resourceType: string; kind: ServiceProviderOrganizationWideAccessViolationKind }[] {\n const forbidden = new Set<string>(ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES);\n const violations: { resourceType: string; kind: ServiceProviderOrganizationWideAccessViolationKind }[] = [];\n for (const [resourceType, declaration] of Object.entries(declarations ?? {})) {\n if (forbidden.has(resourceType)) {\n violations.push({ resourceType, kind: ServiceProviderOrganizationWideAccessViolationKind.AUTHORIZATION_PLANE_RESOURCE });\n }\n if (narrowingRegistry[resourceType]) {\n violations.push({ resourceType, kind: ServiceProviderOrganizationWideAccessViolationKind.RESOURCE_NARROWS_BY_UNIT });\n }\n if (typeof declaration?.rationale !== 'string' || declaration.rationale.trim().length === 0) {\n violations.push({ resourceType, kind: ServiceProviderOrganizationWideAccessViolationKind.MISSING_RATIONALE });\n }\n }\n return violations;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-narrowing.example.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-narrowing.example.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-unit-narrowing.example.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AAEjG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oCAAoC,CAAC,CAG3G,CAAC;AACF,8EAA8E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-narrowing.example.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-narrowing.example.js","sourceRoot":"","sources":["../../../src/organizations/organization-unit-narrowing.example.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAmE;IAC9G,QAAQ,EAAE,EAAE,aAAa,EAAE,oBAAoB,EAAE;IACjD,cAAc,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE;CAClD,CAAC;AACF,8EAA8E","sourcesContent":["/**\n * Illustrative declaration of organization-unit narrowing, for the app-facing skill.\n *\n * TIER B (framework-owned illustrative sample): there is no real usage to anchor against — the engine\n * opts NO resource in, deliberately, and an application's own resource types live outside this\n * repository. Anchoring a minimal sample beside the contract keeps the skill's worked example\n * type-checked and in step with the type, rather than drifting as prose in markdown.\n */\n\nimport type { OrganizationUnitNarrowingDeclaration } from './organization-unit-narrowing.shared';\n\n/**\n * @wildo_source:part:start example.authorization.unit-narrowing.declaration facet:kind:usage-example facet:audience:app-developer\n *\n * Declaring two of an application's own resources unit-narrowable. This map is passed to application\n * startup as `organizationUnitNarrowing`.\n *\n * Each value names the field on THAT resource holding the owning organization unit's id. The field\n * must exist on the resource's schema: it becomes a query predicate on every read and a check on\n * every write, so a misspelled name is an access-control defect rather than a typo.\n *\n * Effect: a member whose only qualifying role is inside a unit is admitted for these resources and\n * confined to that unit's rows (plus its descendants, where the unit inherits downward). A member\n * whose organization-wide role already satisfies the operation is not narrowed at all — so declaring\n * this can widen who can reach a resource, never shrink what someone could already see.\n */\nexport const exampleOrganizationUnitNarrowing: Readonly<Record<string, OrganizationUnitNarrowingDeclaration>> = {\n projects: { unitFieldName: 'organizationUnitId' },\n supportTickets: { unitFieldName: 'owningUnitId' },\n};\n/** @wildo_source:part:end example.authorization.unit-narrowing.declaration */\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-narrowing.shared.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-unit-narrowing.shared.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-unit-narrowing.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,CAAC;AACF,iFAAiF;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,+CAA+C,EAAE,SAA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,EAAE,oCAAoC,CAAC,CAAC,CAAC,GACzF,kCAAkC,EAAE,CAgBtC;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,oCAAoC,CAAC,CAAC,CAAC,EAC1F,YAAY,EAAE,MAAM,GACnB,oCAAoC,GAAG,SAAS,CAKlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-narrowing.shared.js","sourceRoot":"","sources":["../../../../src/organizations/organization-unit-narrowing.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAkClF,iFAAiF;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAgC;IAC1F,gBAAgB,CAAC,yBAAyB;IAC1C,gBAAgB,CAAC,oBAAoB;IACrC,gBAAgB,CAAC,kBAAkB;IACnC,2FAA2F;IAC3F,mFAAmF;IACnF,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,YAAY;IAC7B,gBAAgB,CAAC,0BAA0B;IAC3C,kGAAkG;IAClG,gGAAgG;IAChG,8FAA8F;IAC9F,iGAAiG;IACjG,8BAA8B;IAC9B,gBAAgB,CAAC,wBAAwB;IACzC,yGAAyG;IACzG,uGAAuG;IACvG,sGAAsG;IACtG,gBAAgB,CAAC,8BAA8B;IAC/C,gBAAgB,CAAC,mBAAmB;IACpC,gBAAgB,CAAC,8BAA8B;IAC/C,kHAAkH;IAClH,6CAA6C;IAC7C,gBAAgB,CAAC,kCAAkC;CACpD,CAAC;AACF,iFAAiF;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAsF,EAAE,CAAC;AAExI;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,0CAA0C,C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AAwD,EAAE,CAAC,CAAC;YACpG,SAAS;QACX,CAAC;QACD,IAAI,OAAO,WAAW,CAAC,aAAa,KAAK,QAAQ,IAAI,WAAW,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5F,UAAU,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAC9C,iBAA0F,EAC1F,YAAoB;IAEpB,IAAI,+CAA+C,CAAC,QAAQ,CAAC,YAAgC,CAAC;QAAE,OAAO,SAAS,CAAC;IACjH,MAAM,WAAW,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACpD,IAAI,CAAC,WAAW,EAAE,aAAa;QAAE,OAAO,SAAS,CAAC;IAClD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["/**\n * Organization-unit narrowing — the opt-in registry and its hard containment rule.\n *\n * Unit grants are ADDITIVE (plan decision D-C3b): they widen a principal's reach, never shrink it.\n * A caller whose organization-wide grant already satisfies an operation is not narrowed at all; a\n * caller who would otherwise be denied gains access to the rows of the units they hold.\n *\n * A resource participates ONLY by opting in here. Narrowing is never implicit: inferring it from the\n * presence of an `organizationUnitId` field would silently change the result set of every existing\n * LIST the moment such a field was added.\n */\n\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\n\n/**\n * @wildo_source:part:start saas.models.organization-unit-narrowing-declaration facet:layer:shared facet:family:authorization\n *\n * How one resource is narrowed: the field carrying the unit a row belongs to.\n *\n * Import from `@wildo-ai/saas-models`. Declare narrowing by passing an\n * `organizationUnitNarrowing` map to application startup, keyed by resource type:\n *\n * ```ts\n * organizationUnitNarrowing: {\n * [MyResourceType.PROJECTS]: { unitFieldName: 'organizationUnitId' },\n * }\n * ```\n *\n * `unitFieldName` must name a real field on the resource's main schema that stores the owning\n * `ORGANIZATION_UNITS` id — it becomes a query predicate on every read and a write-time check on\n * every create/update, so a misspelled field is an authorization defect, not a typo.\n *\n * Opting in is ADDITIVE: a caller whose organization-wide role already satisfies the operation is\n * never narrowed and keeps seeing the whole tenant, while a caller who would otherwise be denied\n * gains access to the rows of the units they hold. Opting a resource in therefore cannot shrink any\n * existing result set.\n *\n * Deliberately an object rather than a bare boolean so per-operation narrowing can be added later as\n * an optional property (D-C5) without migrating any existing declaration — Dynamics carries depth\n * per privilege, and Wildo already declares roles per operation variant, so that is the likely next\n * shape. Resource-level is a strict subset of it.\n */\nexport type OrganizationUnitNarrowingDeclaration = {\n /** The field on the resource holding the owning `ORGANIZATION_UNITS` id. */\n readonly unitFieldName: string;\n};\n/** @wildo_source:part:end saas.models.organization-unit-narrowing-declaration */\n\n/**\n * @wildo_source:part:start saas.models.organization-unit-narrowing-containment facet:layer:shared facet:family:authorization facet:audience:app-developer\n *\n * Resources that may NEVER be unit-narrowable — the authorization plane.\n *\n * ## The loop this closes\n *\n * A resource that ISSUES authority must not be governed by the authority it issues. Were\n * `ORGANIZATION_UNIT_MEMBERS` narrowable:\n *\n * 1. a principal who is organization-wide `ORG_MEMBER` but `ORG_ADMIN` of ONE unit\n * 2. satisfies the `ORG_ADMIN` gate on the grant surface via that unit grant,\n * 3. grants themselves `ORG_ADMIN` in every other unit,\n * 4. and the union of all units is organization-wide admin — assembled from a single unit grant.\n *\n * Step 3 is blocked today only because the role ceiling derives from organization-wide grants. That\n * is one refactor away from being undone (see the `D-C4 LOCK` regression test), so the containment\n * is also structural: a unit grant can never reach these resources at all.\n *\n * Every major suite enforces the same separation — SAP puts user↔role assignment behind dedicated\n * authorization objects, Azure puts role assignment outside the data plane behind\n * `Microsoft.Authorization/roleAssignments/write`, and Dynamics forbids assigning a role you do not\n * hold.\n *\n * `ORGANIZATION_MEMBERS` is listed for the same reason one level up: it carries the organization-wide\n * `roles` array that produces `initiatorRoles`. The roles-bearing machine credentials are listed\n * because the roles written at CREATE become the authority of every token minted from them.\n *\n * ## `ORGANIZATIONS` is listed for a SECOND, distinct reason — scope inversion\n *\n * The rule above is \"a resource that ISSUES authority may not be governed by the authority it\n * issues\". `ORGANIZATIONS` is barred by its sibling: **a resource that DEFINES a scope may not be\n * governed by a narrowing INSIDE that scope.** A unit is owned BY an organization, so letting the\n * owned thing gate access to its owner inverts the containment.\n *\n * That is not abstract. The tenant lifecycle verbs live on this resource, and\n * `request_deletion` / `suspend` are `ORG_ADMIN`-gated. Were `ORGANIZATIONS` narrowable, a principal\n * who is organization-wide `ORG_MEMBER` but `ORG_ADMIN` of ONE unit would satisfy that gate through\n * the unit grant — and one division's administrator could mark the ENTIRE tenant for deletion, or\n * halt it. The blast radius is the whole organization, reached from a grant that was supposed to\n * confine them to a subtree of it.\n *\n * It is also meaningless independently of the hazard: an organization is not located inside one of\n * its own units, so there is no honest `unitFieldName` to declare. Listing it turns a declaration\n * that could never be correct into a boot failure instead of a silent authorization hole.\n */\nexport const ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES: readonly CoreResourceType[] = [\n CoreResourceType.ORGANIZATION_UNIT_MEMBERS,\n CoreResourceType.ORGANIZATION_MEMBERS,\n CoreResourceType.ORGANIZATION_UNITS,\n // The tenant itself — scope inversion, and the door to the tenant lifecycle verbs. See the\n // dedicated section above; this is a different rule from the issues-authority one.\n CoreResourceType.ORGANIZATIONS,\n CoreResourceType.ORG_API_KEYS,\n CoreResourceType.OAUTH_CLIENTS_ORGANIZATION,\n // A credential authenticates the WHOLE TENANT toward a third party — there is one Slack workspace\n // behind it, not one per division. Narrowing it to a unit would let a unit-scoped administrator\n // rotate or delete the credential every other unit spends, which is the same issues-authority\n // hazard the sibling entries above record: the grant confines them to a subtree, the object they\n // reach does not live in one.\n CoreResourceType.ORG_PROVIDER_CREDENTIALS,\n // Service-provider relationships (#1597) ISSUE authority: accepting one, amending its scope or assigning\n // an expert to it hands a person outside the organization a membership inside it. A unit administrator\n // must never reach the verbs that do that, for the same issues-authority reason as the entries above.\n CoreResourceType.SERVICE_PROVIDER_RELATIONSHIPS,\n CoreResourceType.SERVICE_ENGAGEMENTS,\n CoreResourceType.SERVICE_ENGAGEMENT_ASSIGNMENTS,\n // A capability grant (#1631) issues ADMINISTRATIVE authority to people outside the organization — the most direct\n // form of the issues-authority hazard above.\n CoreResourceType.SERVICE_PROVIDER_CAPABILITY_GRANTS,\n];\n/** @wildo_source:part:end saas.models.organization-unit-narrowing-containment */\n\n/**\n * The engine's opted-in resources.\n *\n * EMPTY BY DESIGN. No engine resource carries a unit FK yet, and opting one in is a deliberate\n * per-resource decision, not a default. The mechanism ships ahead of its first consumer so that the\n * containment rule is enforced from the start rather than retrofitted after a resource has already\n * been narrowed incorrectly.\n */\nexport const ENGINE_ORGANIZATION_UNIT_NARROWING: Readonly<Partial<Record<CoreResourceType, OrganizationUnitNarrowingDeclaration>>> = {};\n\n/**\n * Merge the engine's opt-ins with an application's into the map that GOVERNS RUNTIME.\n *\n * The engine ships none today, so in practice this is the application's own map — but the merge\n * exists rather than the application map being used directly, because the containment validation and\n * every runtime lookup must see ONE map. A second, unmerged source is how a resource ends up narrowed\n * on the read path and not on the write path.\n *\n * An application declaration for a resource the engine also declares REPLACES it: the application\n * owns the field name on its own schema. Nothing here validates the result — the caller passes the\n * merged map to {@link collectOrganizationUnitNarrowingViolations} and fails closed at boot, so that\n * an application cannot narrow the authorization plane merely by declaring it later than the engine.\n */\nexport function mergeOrganizationUnitNarrowingDeclarations(\n engineNarrowing: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n applicationNarrowing: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>> | undefined,\n): Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>> {\n return { ...engineNarrowing, ...(applicationNarrowing ?? {}) };\n}\n\n/** A declaration that violates the D-C4 containment rule, or contradicts a DERIVED one. */\nexport type OrganizationUnitNarrowingViolation = {\n readonly resourceType: string;\n readonly reason:\n | 'authorization_plane_resource_cannot_be_unit_narrowable'\n | 'missing_unit_field_name'\n /**\n * An application named a different `unitFieldName` for a resource the ENGINE derives (#1058 R7).\n *\n * Refused rather than resolved either way. Letting the application win puts a read-through\n * resource's confinement on a field no projector writes, so every caller sees nothing; letting\n * the engine win silently makes the application's own declaration a lie it can read in its\n * source and never observe. The remedy is to delete the declaration, which is why the message\n * says so — the engine supplies it.\n */\n | 'derived_narrowing_contradicted';\n};\n\n/**\n * Fold the ENGINE's derived declarations over an application's, refusing any disagreement.\n *\n * Separate from {@link mergeOrganizationUnitNarrowingDeclarations}, and the asymmetry is the point.\n * That merge lets an APPLICATION replace an engine opt-in, because the application owns the field\n * name on its own schema. A DERIVED declaration is the opposite case: the field is the engine's, it\n * is written by the engine's own projector, and an application has no way to change where it lands.\n * So a disagreement there is not an override — it is a statement that cannot be true.\n *\n * An application declaration that AGREES is left alone rather than reported: it is redundant, not\n * wrong, and refusing redundancy would break every application that wrote down what the engine\n * would have derived anyway.\n */\nexport function foldDerivedOrganizationUnitNarrowing(\n declared: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n derived: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n): {\n readonly merged: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>;\n readonly violations: OrganizationUnitNarrowingViolation[];\n} {\n const violations: OrganizationUnitNarrowingViolation[] = [];\n const merged: Record<string, OrganizationUnitNarrowingDeclaration> = { ...declared };\n\n for (const [resourceType, declaration] of Object.entries(derived)) {\n if (!declaration) continue;\n const existing = declared[resourceType];\n if (existing !== undefined && existing.unitFieldName !== declaration.unitFieldName) {\n violations.push({ resourceType, reason: 'derived_narrowing_contradicted' });\n }\n merged[resourceType] = declaration;\n }\n\n return { merged, violations };\n}\n\n/**\n * Validate a narrowing registry against the containment rule.\n *\n * Returns violations rather than throwing so the caller owns the failure mode — the engine boot path\n * turns these into a startup error (fail closed: a misdeclared narrowing is a silent authorization\n * hole, so the application must not start), while tooling can report them without dying.\n */\nexport function collectOrganizationUnitNarrowingViolations(\n narrowingRegistry: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n): OrganizationUnitNarrowingViolation[] {\n const forbidden = new Set<string>(ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES);\n const violations: OrganizationUnitNarrowingViolation[] = [];\n\n for (const [resourceType, declaration] of Object.entries(narrowingRegistry)) {\n if (!declaration) continue;\n if (forbidden.has(resourceType)) {\n violations.push({ resourceType, reason: 'authorization_plane_resource_cannot_be_unit_narrowable' });\n continue;\n }\n if (typeof declaration.unitFieldName !== 'string' || declaration.unitFieldName.length === 0) {\n violations.push({ resourceType, reason: 'missing_unit_field_name' });\n }\n }\n\n return violations;\n}\n\n/**\n * Is this resource narrowed by organization unit?\n *\n * The single question every consumer asks. Reading the registry directly is how a call site ends up\n * disagreeing with the containment rule — the forbidden set is re-checked here so a registry that\n * was assembled without validation still cannot narrow the authorization plane.\n */\nexport function resolveOrganizationUnitNarrowing(\n narrowingRegistry: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n resourceType: string,\n): OrganizationUnitNarrowingDeclaration | undefined {\n if (ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES.includes(resourceType as CoreResourceType)) return undefined;\n const declaration = narrowingRegistry[resourceType];\n if (!declaration?.unitFieldName) return undefined;\n return declaration;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"organization-unit-narrowing.shared.js","sourceRoot":"","sources":["../../../src/organizations/organization-unit-narrowing.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAkClF,iFAAiF;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAgC;IAC1F,gBAAgB,CAAC,yBAAyB;IAC1C,gBAAgB,CAAC,oB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registry and its hard containment rule.\n *\n * Unit grants are ADDITIVE (plan decision D-C3b): they widen a principal's reach, never shrink it.\n * A caller whose organization-wide grant already satisfies an operation is not narrowed at all; a\n * caller who would otherwise be denied gains access to the rows of the units they hold.\n *\n * A resource participates ONLY by opting in here. Narrowing is never implicit: inferring it from the\n * presence of an `organizationUnitId` field would silently change the result set of every existing\n * LIST the moment such a field was added.\n */\n\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\n\n/**\n * @wildo_source:part:start saas.models.organization-unit-narrowing-declaration facet:layer:shared facet:family:authorization\n *\n * How one resource is narrowed: the field carrying the unit a row belongs to.\n *\n * Import from `@wildo-ai/saas-models`. Declare narrowing by passing an\n * `organizationUnitNarrowing` map to application startup, keyed by resource type:\n *\n * ```ts\n * organizationUnitNarrowing: {\n * [MyResourceType.PROJECTS]: { unitFieldName: 'organizationUnitId' },\n * }\n * ```\n *\n * `unitFieldName` must name a real field on the resource's main schema that stores the owning\n * `ORGANIZATION_UNITS` id — it becomes a query predicate on every read and a write-time check on\n * every create/update, so a misspelled field is an authorization defect, not a typo.\n *\n * Opting in is ADDITIVE: a caller whose organization-wide role already satisfies the operation is\n * never narrowed and keeps seeing the whole tenant, while a caller who would otherwise be denied\n * gains access to the rows of the units they hold. Opting a resource in therefore cannot shrink any\n * existing result set.\n *\n * Deliberately an object rather than a bare boolean so per-operation narrowing can be added later as\n * an optional property (D-C5) without migrating any existing declaration — Dynamics carries depth\n * per privilege, and Wildo already declares roles per operation variant, so that is the likely next\n * shape. Resource-level is a strict subset of it.\n */\nexport type OrganizationUnitNarrowingDeclaration = {\n /** The field on the resource holding the owning `ORGANIZATION_UNITS` id. */\n readonly unitFieldName: string;\n};\n/** @wildo_source:part:end saas.models.organization-unit-narrowing-declaration */\n\n/**\n * @wildo_source:part:start saas.models.organization-unit-narrowing-containment facet:layer:shared facet:family:authorization facet:audience:app-developer\n *\n * Resources that may NEVER be unit-narrowable — the authorization plane.\n *\n * ## The loop this closes\n *\n * A resource that ISSUES authority must not be governed by the authority it issues. Were\n * `ORGANIZATION_UNIT_MEMBERS` narrowable:\n *\n * 1. a principal who is organization-wide `ORG_MEMBER` but `ORG_ADMIN` of ONE unit\n * 2. satisfies the `ORG_ADMIN` gate on the grant surface via that unit grant,\n * 3. grants themselves `ORG_ADMIN` in every other unit,\n * 4. and the union of all units is organization-wide admin — assembled from a single unit grant.\n *\n * Step 3 is blocked today only because the role ceiling derives from organization-wide grants. That\n * is one refactor away from being undone (see the `D-C4 LOCK` regression test), so the containment\n * is also structural: a unit grant can never reach these resources at all.\n *\n * Every major suite enforces the same separation — SAP puts user↔role assignment behind dedicated\n * authorization objects, Azure puts role assignment outside the data plane behind\n * `Microsoft.Authorization/roleAssignments/write`, and Dynamics forbids assigning a role you do not\n * hold.\n *\n * `ORGANIZATION_MEMBERS` is listed for the same reason one level up: it carries the organization-wide\n * `roles` array that produces `initiatorRoles`. The roles-bearing machine credentials are listed\n * because the roles written at CREATE become the authority of every token minted from them.\n *\n * ## `ORGANIZATIONS` is listed for a SECOND, distinct reason — scope inversion\n *\n * The rule above is \"a resource that ISSUES authority may not be governed by the authority it\n * issues\". `ORGANIZATIONS` is barred by its sibling: **a resource that DEFINES a scope may not be\n * governed by a narrowing INSIDE that scope.** A unit is owned BY an organization, so letting the\n * owned thing gate access to its owner inverts the containment.\n *\n * That is not abstract. The tenant lifecycle verbs live on this resource, and\n * `request_deletion` / `suspend` are `ORG_ADMIN`-gated. Were `ORGANIZATIONS` narrowable, a principal\n * who is organization-wide `ORG_MEMBER` but `ORG_ADMIN` of ONE unit would satisfy that gate through\n * the unit grant — and one division's administrator could mark the ENTIRE tenant for deletion, or\n * halt it. The blast radius is the whole organization, reached from a grant that was supposed to\n * confine them to a subtree of it.\n *\n * It is also meaningless independently of the hazard: an organization is not located inside one of\n * its own units, so there is no honest `unitFieldName` to declare. Listing it turns a declaration\n * that could never be correct into a boot failure instead of a silent authorization hole.\n */\nexport const ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES: readonly CoreResourceType[] = [\n CoreResourceType.ORGANIZATION_UNIT_MEMBERS,\n CoreResourceType.ORGANIZATION_MEMBERS,\n CoreResourceType.ORGANIZATION_UNITS,\n // The tenant itself — scope inversion, and the door to the tenant lifecycle verbs. See the\n // dedicated section above; this is a different rule from the issues-authority one.\n CoreResourceType.ORGANIZATIONS,\n CoreResourceType.ORG_API_KEYS,\n CoreResourceType.OAUTH_CLIENTS_ORGANIZATION,\n // A credential authenticates the WHOLE TENANT toward a third party — there is one Slack workspace\n // behind it, not one per division. Narrowing it to a unit would let a unit-scoped administrator\n // rotate or delete the credential every other unit spends, which is the same issues-authority\n // hazard the sibling entries above record: the grant confines them to a subtree, the object they\n // reach does not live in one.\n CoreResourceType.ORG_PROVIDER_CREDENTIALS,\n // Service-provider relationships (#1597) ISSUE authority: accepting one, amending its scope or assigning\n // an expert to it hands a person outside the organization a membership inside it. A unit administrator\n // must never reach the verbs that do that, for the same issues-authority reason as the entries above.\n CoreResourceType.SERVICE_PROVIDER_RELATIONSHIPS,\n CoreResourceType.SERVICE_ENGAGEMENTS,\n CoreResourceType.SERVICE_ENGAGEMENT_ASSIGNMENTS,\n // A capability grant (#1631) issues ADMINISTRATIVE authority to people outside the organization — the most direct\n // form of the issues-authority hazard above.\n CoreResourceType.SERVICE_PROVIDER_CAPABILITY_GRANTS,\n];\n/** @wildo_source:part:end saas.models.organization-unit-narrowing-containment */\n\n/**\n * The engine's opted-in resources.\n *\n * EMPTY BY DESIGN. No engine resource carries a unit FK yet, and opting one in is a deliberate\n * per-resource decision, not a default. The mechanism ships ahead of its first consumer so that the\n * containment rule is enforced from the start rather than retrofitted after a resource has already\n * been narrowed incorrectly.\n */\nexport const ENGINE_ORGANIZATION_UNIT_NARROWING: Readonly<Partial<Record<CoreResourceType, OrganizationUnitNarrowingDeclaration>>> = {};\n\n/**\n * Merge the engine's opt-ins with an application's into the map that GOVERNS RUNTIME.\n *\n * The engine ships none today, so in practice this is the application's own map — but the merge\n * exists rather than the application map being used directly, because the containment validation and\n * every runtime lookup must see ONE map. A second, unmerged source is how a resource ends up narrowed\n * on the read path and not on the write path.\n *\n * An application declaration for a resource the engine also declares REPLACES it: the application\n * owns the field name on its own schema. Nothing here validates the result — the caller passes the\n * merged map to {@link collectOrganizationUnitNarrowingViolations} and fails closed at boot, so that\n * an application cannot narrow the authorization plane merely by declaring it later than the engine.\n */\nexport function mergeOrganizationUnitNarrowingDeclarations(\n engineNarrowing: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n applicationNarrowing: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>> | undefined,\n): Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>> {\n return { ...engineNarrowing, ...(applicationNarrowing ?? {}) };\n}\n\n/** A declaration that violates the D-C4 containment rule, or contradicts a DERIVED one. */\nexport type OrganizationUnitNarrowingViolation = {\n readonly resourceType: string;\n readonly reason:\n | 'authorization_plane_resource_cannot_be_unit_narrowable'\n | 'missing_unit_field_name'\n /**\n * An application named a different `unitFieldName` for a resource the ENGINE derives (#1058 R7).\n *\n * Refused rather than resolved either way. Letting the application win puts a read-through\n * resource's confinement on a field no projector writes, so every caller sees nothing; letting\n * the engine win silently makes the application's own declaration a lie it can read in its\n * source and never observe. The remedy is to delete the declaration, which is why the message\n * says so — the engine supplies it.\n */\n | 'derived_narrowing_contradicted';\n};\n\n/**\n * Fold the ENGINE's derived declarations over an application's, refusing any disagreement.\n *\n * Separate from {@link mergeOrganizationUnitNarrowingDeclarations}, and the asymmetry is the point.\n * That merge lets an APPLICATION replace an engine opt-in, because the application owns the field\n * name on its own schema. A DERIVED declaration is the opposite case: the field is the engine's, it\n * is written by the engine's own projector, and an application has no way to change where it lands.\n * So a disagreement there is not an override — it is a statement that cannot be true.\n *\n * An application declaration that AGREES is left alone rather than reported: it is redundant, not\n * wrong, and refusing redundancy would break every application that wrote down what the engine\n * would have derived anyway.\n */\nexport function foldDerivedOrganizationUnitNarrowing(\n declared: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n derived: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n): {\n readonly merged: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>;\n readonly violations: OrganizationUnitNarrowingViolation[];\n} {\n const violations: OrganizationUnitNarrowingViolation[] = [];\n const merged: Record<string, OrganizationUnitNarrowingDeclaration> = { ...declared };\n\n for (const [resourceType, declaration] of Object.entries(derived)) {\n if (!declaration) continue;\n const existing = declared[resourceType];\n if (existing !== undefined && existing.unitFieldName !== declaration.unitFieldName) {\n violations.push({ resourceType, reason: 'derived_narrowing_contradicted' });\n }\n merged[resourceType] = declaration;\n }\n\n return { merged, violations };\n}\n\n/**\n * Validate a narrowing registry against the containment rule.\n *\n * Returns violations rather than throwing so the caller owns the failure mode — the engine boot path\n * turns these into a startup error (fail closed: a misdeclared narrowing is a silent authorization\n * hole, so the application must not start), while tooling can report them without dying.\n */\nexport function collectOrganizationUnitNarrowingViolations(\n narrowingRegistry: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n): OrganizationUnitNarrowingViolation[] {\n const forbidden = new Set<string>(ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES);\n const violations: OrganizationUnitNarrowingViolation[] = [];\n\n for (const [resourceType, declaration] of Object.entries(narrowingRegistry)) {\n if (!declaration) continue;\n if (forbidden.has(resourceType)) {\n violations.push({ resourceType, reason: 'authorization_plane_resource_cannot_be_unit_narrowable' });\n continue;\n }\n if (typeof declaration.unitFieldName !== 'string' || declaration.unitFieldName.length === 0) {\n violations.push({ resourceType, reason: 'missing_unit_field_name' });\n }\n }\n\n return violations;\n}\n\n/**\n * Is this resource narrowed by organization unit?\n *\n * The single question every consumer asks. Reading the registry directly is how a call site ends up\n * disagreeing with the containment rule — the forbidden set is re-checked here so a registry that\n * was assembled without validation still cannot narrow the authorization plane.\n */\nexport function resolveOrganizationUnitNarrowing(\n narrowingRegistry: Readonly<Partial<Record<string, OrganizationUnitNarrowingDeclaration>>>,\n resourceType: string,\n): OrganizationUnitNarrowingDeclaration | undefined {\n if (ORGANIZATION_UNIT_NARROWING_FORBIDDEN_RESOURCES.includes(resourceType as CoreResourceType)) return undefined;\n const declaration = narrowingRegistry[resourceType];\n if (!declaration?.unitFieldName) return undefined;\n return declaration;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-units.shared.path.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-units.shared.path.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-units.shared.path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,sFAAsF;AACtF,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGnH;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEzF;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAC3B,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC,OAAO,CAET;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAI/G;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAE5E;AAED,sDAAsD;AACtD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-units.shared.path.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-units.shared.path.js","sourceRoot":"","sources":["../../../src/organizations/organization-units.shared.path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAAC,UAA4D;IACzG,IAAI,CAAC,UAAU;QAAE,OAAO,2BAA2B,CAAC;IACpD,OAAO,GAAG,6BAA6B,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC;AAC/E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAAC,IAAmC;IAC/E,OAAO,GAAG,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC;AACnE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,SAA2B,EAC3B,IAAmC;IAEnC,OAAO,6BAA6B,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC,CAAC;AACvG,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,0BAA0B,CAAC,cAAsB,EAAE,SAAiB,EAAE,SAAiB;IACrG,MAAM,UAAU,GAAG,6BAA6B,CAAC,cAAc,CAAC,CAAC;IACjE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,UAAU,CAAC;IACzD,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;AAC7D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,IAAsB;IAChE,OAAO,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACrG,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,qBAAqB,CAAC,IAAsB;IAC1D,OAAO,2BAA2B,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,6BAA6B,CAAC,IAA+B;IACpE,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,2BAA2B;QAAE,OAAO,2BAA2B,CAAC;IACtF,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IAC7D,OAAO,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,GAAG,CAAC;AACrE,CAAC","sourcesContent":["/**\n * Organization-unit materialized-path contract (plan decision D-B1).\n *\n * ## Format\n *\n * `path` is the slash-delimited chain of a node's ANCESTOR ids, with a leading AND trailing slash.\n * It describes the route TO the node and deliberately does NOT include the node's own id:\n *\n * ```\n * root R path = \"/\" fullKey = \"/R\"\n * child C of R path = \"/R/\" fullKey = \"/R/C\"\n * grandchild G of C path = \"/R/C/\" fullKey = \"/R/C/G\"\n * ```\n *\n * ## Why ancestors-only, rather than a self-inclusive `/R/C/G`\n *\n * A self-inclusive path cannot be computed where it must be written. The materialized path has to\n * be set on the SAME write that inserts the row (a second write would leave a window in exactly the\n * broken state this field exists to remove — a row whose `path` is empty), but a CREATE custom\n * implementation never receives the new row's `_id`: the framework passes\n * `IdOrIdsOrFilterType | undefined` as the operation target, and for CREATE there is no target yet.\n *\n * The two alternatives were rejected:\n * - **Pre-generate the `_id` in the prefix** — id generation is adapter-specific (Mongo `ObjectId`\n * vs SQL uuid). Minting one in domain code couples the org-unit domain to a persistence adapter.\n * - **Write the path in a POSTFIX, after insert** — two writes per CREATE, and a failure between\n * them persists a unit with no path. Fixing \"the required `path` is never written\" by introducing\n * a new way for it to be missing is not a fix.\n *\n * Ancestors-only needs only the PARENT, which the prefix can read, so one write does the whole job.\n * Every property the format was chosen for survives: it is rename-stable (ids, not codes), the\n * cycle test stays a prefix comparison, and MOVE stays a prefix rewrite. The only cost is that\n * \"descendants of N\" keys off {@link organizationUnitSubtreePrefix} (`path + _id + '/'`) rather\n * than off `path` directly.\n *\n * ## Invariants\n *\n * - Always starts and ends with `/`. A root's path is exactly `/`.\n * - Contains ONLY ancestor ids, ordered root-first.\n * - Depth of a node = number of segments in `path` (a root has depth 0).\n * - Ids are opaque strings; this module never parses or validates them beyond emptiness.\n */\n\n/** The path of a unit that hangs directly under the organization (no parent unit). */\nexport const ORGANIZATION_UNIT_ROOT_PATH = '/';\n\n/**\n * The path to give a NEW child of `parentUnit`, or {@link ORGANIZATION_UNIT_ROOT_PATH} when the new\n * node is a root.\n *\n * This is the single place the \"descend one level\" rule is expressed — CREATE and MOVE both use it,\n * so a format change can never apply to one and miss the other.\n */\nexport function buildOrganizationUnitChildPath(parentUnit: { _id: string; path: string } | null | undefined): string {\n if (!parentUnit) return ORGANIZATION_UNIT_ROOT_PATH;\n return `${normalizeOrganizationUnitPath(parentUnit.path)}${parentUnit._id}/`;\n}\n\n/**\n * The prefix EVERY descendant of `unit` carries in its own `path`.\n *\n * `descendants(N) === { row | row.path.startsWith(subtreePrefix(N)) }`. Note this correctly EXCLUDES\n * `N` itself, whose path stops one level short.\n */\nexport function organizationUnitSubtreePrefix(unit: { _id: string; path: string }): string {\n return `${normalizeOrganizationUnitPath(unit.path)}${unit._id}/`;\n}\n\n/**\n * Is `candidate` inside `unit`'s subtree (strictly below it)?\n *\n * The O(1) cycle test MOVE depends on: re-parenting `unit` under one of its own descendants would\n * detach the branch from the tree and strand it in a ring.\n */\nexport function isOrganizationUnitInSubtree(\n candidate: { path: string },\n unit: { _id: string; path: string },\n): boolean {\n return normalizeOrganizationUnitPath(candidate.path).startsWith(organizationUnitSubtreePrefix(unit));\n}\n\n/**\n * Rewrite one descendant's path when its ancestor moves.\n *\n * MOVE changes only the prefix above the moved node; everything from the moved node downward keeps\n * its relative shape. Swapping the old subtree prefix for the new one therefore re-homes an entire\n * branch without re-deriving any node's position.\n *\n * Returns the path unchanged when it does not carry `oldPrefix`, so a caller that over-scans cannot\n * corrupt unrelated rows.\n */\nexport function rebaseOrganizationUnitPath(descendantPath: string, oldPrefix: string, newPrefix: string): string {\n const normalized = normalizeOrganizationUnitPath(descendantPath);\n if (!normalized.startsWith(oldPrefix)) return normalized;\n return `${newPrefix}${normalized.slice(oldPrefix.length)}`;\n}\n\n/**\n * The ancestor ids of a node, root-first — the ready-made input for a breadcrumb.\n *\n * Human-readable breadcrumbs are rendered from these ids against already-loaded ancestor rows; a\n * second, name-based path is deliberately NOT persisted (it would have to be rewritten on every\n * rename, and `code` is optional so it is not always well-formed).\n */\nexport function organizationUnitAncestorIds(unit: { path: string }): string[] {\n return normalizeOrganizationUnitPath(unit.path).split('/').filter((segment) => segment.length > 0);\n}\n\n/** Depth of a node in the tree; a root is depth 0. */\nexport function organizationUnitDepth(unit: { path: string }): number {\n return organizationUnitAncestorIds(unit).length;\n}\n\n/**\n * Coerce a stored path to the canonical bounded form.\n *\n * Defensive rather than decorative: rows written before `path` was materialized carry `undefined` or\n * `''`, and treating those as the root path keeps a legacy row addressable instead of throwing\n * mid-traversal. A value missing its delimiters would otherwise make `startsWith` comparisons match\n * across sibling ids (`/R1` would prefix-match `/R12`), which is precisely how a materialized-path\n * scheme silently leaks rows between branches.\n */\nfunction normalizeOrganizationUnitPath(path: string | null | undefined): string {\n if (!path || path === ORGANIZATION_UNIT_ROOT_PATH) return ORGANIZATION_UNIT_ROOT_PATH;\n const withLeading = path.startsWith('/') ? path : `/${path}`;\n return withLeading.endsWith('/') ? withLeading : `${withLeading}/`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-units.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"organization-units.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/organizations/organization-units.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAoD,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAU/H,oBAAY,2BAA2B;IACrC,IAAI,SAAS,CAAE,gCAAgC;IAC/C,OAAO,YAAY,CAAE,eAAe;IACpC,OAAO,YAAY;CACpB;AASD,KAAK,8BAA8B,GAC/B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAKjC,eAAO,MAAM,2DAA2D,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;mBA2LxH,CAAC"}
|