@wildo-ai/saas-models 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/applications/applications-context.schemas.d.ts +16 -10
- package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/applications.shared.resources-config.schemas.js +4 -3
- package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +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 +36 -0
- 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 +8 -1
- package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-configuration.shared.schemas.d.ts +0 -4
- package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-configuration.shared.schemas.js +59 -17
- package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.d.ts +77 -21
- package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-enums.shared.schemas.js +85 -23
- package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.d.ts +5 -5
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +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 +39 -0
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts +6 -6
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.js +8 -4
- package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts +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 +35 -0
- 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 +8 -3
- package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
- package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.schemas.js +7 -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 +52 -11
- package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-definition.shared.schemas.d.ts +2 -2
- package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +2 -2
- package/dist/esm/billing/product.shared.schemas.d.ts +2 -2
- package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.schemas.js +7 -3
- package/dist/esm/billing/product.shared.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +2 -2
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js +54 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.d.ts +4 -4
- package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.js +6 -2
- package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts +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 +39 -0
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.d.ts +11 -7
- package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.js +29 -6
- package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +69 -2
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.js +20 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +85 -0
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +157 -0
- package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -0
- 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 +35 -2
- 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 +23 -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 +56 -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 +541 -20
- 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 +605 -23
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +96 -3
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts +49 -0
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js +124 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +11 -3
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +11 -3
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +94 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +211 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +67 -12
- 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 +95 -8
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts +17 -0
- package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/privacy.shared.schemas.js +27 -4
- package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts +89 -16
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.js +101 -15
- package/dist/esm/compliance/privacy/redaction.shared.schemas.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 +12 -5
- package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
- package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts +21 -0
- package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/analytics-value-moments.shared.schemas.js +20 -0
- package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +9 -5
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.js +29 -0
- package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
- package/dist/esm/config/auth-config-resolution.shared.utils.d.ts +8 -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 +29 -0
- package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +95 -17
- package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/entity-identity-config.shared.schemas.js +86 -8
- package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +12 -12
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +33 -0
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.js +32 -0
- package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +40 -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 +40 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +57 -11
- 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-providers/engine-capabilities.shared.schemas.d.ts +109 -64
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +200 -19
- 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 +15 -3
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +32 -7
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +84 -7
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +59 -0
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +61 -0
- package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts +97 -0
- package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -0
- package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js +41 -0
- package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -0
- package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +148 -2
- 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 +56 -1
- package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +9 -31
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.js +8 -5
- package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts +18 -8
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js +9 -4
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +338 -0
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +332 -0
- package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -0
- package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +178 -9
- package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-metadata.shared.schemas.js +181 -9
- package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts +7 -5
- package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-protocol.shared.schemas.js +7 -5
- package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts +40 -0
- package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-tier-rule.shared.utils.js +80 -0
- package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -0
- package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
- package/dist/esm/features/core-feature-definitions.shared.js +7 -1
- package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
- package/dist/esm/features/feature-builders.shared.d.ts +32 -0
- package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
- package/dist/esm/features/feature-builders.shared.js +32 -0
- package/dist/esm/features/feature-builders.shared.js.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.js +48 -0
- package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts +156 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.js +175 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -0
- package/dist/esm/files/files.shared.schemas.d.ts +52 -4
- package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/files.shared.schemas.js +55 -4
- package/dist/esm/files/files.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts +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 +33 -0
- 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 +6 -2
- 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 +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 +53 -0
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.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 +3 -2
- package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/agents.shared.schemas.d.ts +54 -5
- 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/apps-blueprint/apps-blueprint.shared.schemas.d.ts +6 -6
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +0 -3
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.js +0 -5
- package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts +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 +43 -0
- 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 +14 -0
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +48 -6
- 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 +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 +41 -0
- 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 +0 -7
- 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 +23 -13
- 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 +19 -0
- 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 +33 -0
- package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts +14 -9
- 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 +14 -9
- package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js +3 -2
- package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows.shared.schemas.js +3 -2
- package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts +128 -0
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.js +142 -0
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts +0 -3
- package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js +1 -4
- package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts +0 -16
- package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js +1 -17
- package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts +3 -3
- package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js +3 -3
- package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts +2 -8
- package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js +4 -15
- package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts +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 +51 -0
- 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 +8 -2
- 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 +1 -0
- package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts +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 +51 -0
- 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 +28 -3
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +9 -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 +51 -0
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts +46 -0
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.js +67 -4
- package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +356 -52
- 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 +166 -39
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +11 -2
- 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 +15 -0
- package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-template.shared.enums.js +15 -0
- package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts +70 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js +71 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -0
- package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts +1 -0
- 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 +19 -0
- 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 +30 -0
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js +65 -1
- package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/notification-badges.core.definitions.d.ts +6 -4
- package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.core.definitions.js +6 -4
- package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
- package/dist/esm/notifications/notification-badges.schemas.d.ts +167 -5
- package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.schemas.js +191 -6
- package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js +36 -0
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.d.ts +107 -0
- package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.js +149 -1
- package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +44 -0
- 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 +15 -4
- package/dist/esm/organizations/organization-members.shared.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 +22 -1
- package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts +26 -0
- package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-preferences.shared.schemas.js +25 -0
- package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +25 -0
- package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-profile.shared.schemas.js +42 -17
- package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts +3 -2
- package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.shared.js +9 -2
- package/dist/esm/organizations/organization-unit-narrowing.shared.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 +35 -12
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/public-runtime/index.d.ts +49 -2
- package/dist/esm/public-runtime/index.d.ts.map +1 -1
- package/dist/esm/public-runtime/index.js +48 -1
- package/dist/esm/public-runtime/index.js.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts +6 -5
- package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js +23 -5
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.d.ts +16 -3
- package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.schemas.js +16 -3
- package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-documentation.d.ts +137 -0
- package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -0
- package/dist/esm/requests/manual-controllers-routes-documentation.js +1201 -0
- package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -0
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts +67 -0
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.js +78 -0
- package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
- package/dist/esm/requests/rate-limits.shared.schemas.d.ts +11 -1
- package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/rate-limits.shared.schemas.js +11 -1
- package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.d.ts +86 -4
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js +138 -0
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- package/dist/esm/resources/collection-query-parameters.shared.d.ts +22 -0
- package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -0
- package/dist/esm/resources/collection-query-parameters.shared.js +22 -0
- package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -0
- package/dist/esm/resources/resources-config.shared.factory.d.ts +1 -0
- package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.js +189 -31
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +395 -92
- package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.js +109 -20
- 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 +97 -5
- 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 +15 -0
- package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.d.ts +37 -0
- package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.js +51 -0
- package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.d.ts +11 -2
- package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.schemas.js +34 -3
- package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
- package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts +51 -0
- package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -0
- package/dist/esm/resources/utils/field-value-disclosure.utils.js +53 -0
- package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -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 +21 -6
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
- package/dist/esm/resources/utils/resources-summary.utils.d.ts +16 -2
- package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-summary.utils.js +19 -5
- package/dist/esm/resources/utils/resources-summary.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 +11 -0
- package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
- package/dist/esm/runtime/domain-module.shared.definitions.d.ts +25 -0
- 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/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts +1 -0
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +38 -0
- package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts +1 -0
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +38 -0
- package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +4 -11
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +0 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +141 -5
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.js +147 -3
- package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts +17 -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 +16 -0
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts +28 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js +28 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -0
- package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts +1 -0
- package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/registration.shared.dto.schemas.js +11 -0
- package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +15 -0
- 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 +21 -4
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts +21 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js +21 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -0
- package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts +61 -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 +208 -6
- 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 +37 -27
- 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 +134 -12
- package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +0 -6
- 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 +17 -8
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts +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 +70 -0
- 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 +45 -8
- 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 +56 -10
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +16 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js +16 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts +54 -0
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.js +59 -0
- package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +31 -0
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js +198 -0
- package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +31 -0
- package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +191 -0
- package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +250 -0
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +486 -0
- package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -0
- package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts +4 -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 +29 -0
- 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 +4 -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 +29 -0
- 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 +67 -0
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +44 -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 +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 +35 -0
- 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 +13 -0
- 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 +31 -4
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts +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 +34 -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 +7 -4
- package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts +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 +37 -0
- 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 +17 -2
- 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 +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 +36 -0
- 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 +15 -5
- package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +5 -5
- 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 +53 -0
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts +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 +62 -0
- 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 +5 -5
- 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 +53 -0
- 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 +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 +62 -0
- 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 +33 -3
- 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 +17 -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 +136 -5
- package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.schemas.d.ts +62 -12
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js +79 -23
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -6
- package/dist/esm/.builder.pid +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.shared.schemas.js","sourceRoot":"","sources":["../../../../src/notifications/notifications.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,MAAM,CAAN,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACrC,8CAAe,CAAA;IACf,0CAAW,CAAA;IACX,4CAAa,CAAA;IACb,sDAAuB,CAAA;IACvB,sEAAuC,CAAA;AACzC,CAAC,EANW,2BAA2B,KAA3B,2BAA2B,QAMtC;AAED,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;AACjB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC;IACjD,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;IACnC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpB,CAAC,CAAC;AAGH,MAAM,CAAN,IAAY,0BAiBX;AAjBD,WAAY,0BAA0B;IAClC,qFAAuD,CAAA;IACvD,yEAA2C,CAAA;IAC3C,yFAA2D,CAAA;IAC3D,2EAA6C,CAAA;IAC7C,yEAA2C,CAAA;IAC3C,qEAAuC,CAAA;IACvC,mFAAqD,CAAA;IACrD,2DAA6B,CAAA;IAC7B,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CAAsC;IACtC,0CAA0C;IAC1C,gDAAgD;IAChD,oCAAoC;IACpC,qCAAqC;IACrC,8CAA8C;CACjD,CAAC,CAAC;AAGH;;GAEG;AAIH,MAAM,CAAN,IAAY,oBAIT;AAJH,WAAY,oBAAoB;IAC5B,qCAAa,CAAA;IACb,2CAAmB,CAAA;IACnB,uCAAe,CAAA;AACjB,CAAC,EAJS,oBAAoB,KAApB,oBAAoB,QAI7B;AAEH,MAAM,CAAN,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IAClC,2EAA6C,CAAA;IAC7C,yEAA2C,CAAA;AAC/C,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B,QAGrC;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC;IAChD,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC;IAClC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { ResourcePrimaryScope } from \"../resources/resources.shared.schemas\";\n\n\nexport enum CoreUserNotificationChannel {\n EMAIL = 'email',\n SMS = 'sms',\n PUSH = 'push',\n WEBSOCKET = 'websocket',\n FRONT_END_SUCCESS = 'front_end_success',\n}\n\nexport enum UserNotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n ERROR = 'error',\n}\n\nexport const UserNotificationChannelSchema = z.union([\n z.enum(CoreUserNotificationChannel),\n z.string().min(1)\n]);\n\n\nexport enum CoreUserNotificationTarget {\n APPLICATION_ADMINISTRATOR = 'application_administrator',\n APPLICATION_BILLING = 'application_billing',\n APPLICATION_USER_MANAGEMENT = 'application_user_management',\n APPLICATION_SECURITY = 'application_security',\n APPLICATION_SUPPORT = 'application_support',\n APPLICATION_OTHER = 'application_other',\n APPLICATION_ADMIN_VIEWER = 'application_admin_viewer',\n ORGANIZATION = 'organization',\n ORGANIZATION_USERS = 'organization_users',\n ORGANIZATION_BILLING = 'organization_billing',\n ORGANIZATION_USER_MANAGEMENT = 'organization_user_management',\n ORGANIZATION_ADMINISTRATIVE = 'organization_administrative',\n ORGANIZATION_SECURITY = 'organization_security',\n USER_SELF = 'user_self',\n USERS_CUSTOM = 'users_custom',\n INBOUND_CONTACT = 'inbound_contact',\n}\n\nexport const UserNotificationTargetSchema = z.union([\n z.enum(CoreUserNotificationTarget),\n z.string().min(1)\n]);\n\n\n\n// =====================================================\n// Celebration & Next-Step Enums (Phase 1a)\n// =====================================================\n\n/**\n * How the frontend renders a celebration after a successful operation.\n * - OVERLAY: Full-screen overlay with animation (e.g., confetti + message)\n * - CONFETTI: Lightweight confetti burst (no overlay)\n * - LOTTIE: Custom Lottie animation (resolved by notification identifier)\n */\nexport enum CelebrationDisplayMode {\n OVERLAY = 'overlay',\n CONFETTI = 'confetti',\n LOTTIE = 'lottie',\n}\n\n/**\n * Type of next-step suggestion attached to a notification.\n * - OPERATION: Navigate to and/or trigger a resource operation\n * - URL: Navigate to an arbitrary URL (internal or external)\n */\nexport enum NotificationNextStepType {\n OPERATION = 'operation',\n URL = 'url',\n}\n\n// =====================================================\n// Frontend Display Hints Schema (reusable)\n// =====================================================\n\nexport const FrontendDisplayHintsCelebrationSchema = z.object({\n mode: z.enum(CelebrationDisplayMode).default(CelebrationDisplayMode.OVERLAY),\n});\nexport type FrontendDisplayHintsCelebration = z.infer<typeof FrontendDisplayHintsCelebrationSchema>;\n\nexport const FrontendDisplayHintsNextStepSchema = z.object({\n /** Operation path (e.g., \"TASKS.CREATE.default\") or URL */\n operationRef: z.string(),\n type: z.enum(NotificationNextStepType).default(NotificationNextStepType.OPERATION),\n});\nexport type FrontendDisplayHintsNextStep = z.infer<typeof FrontendDisplayHintsNextStepSchema>;\n\nexport const FrontendDisplayHintsSchema = z.object({\n celebration: FrontendDisplayHintsCelebrationSchema.optional(),\n nextStep: FrontendDisplayHintsNextStepSchema.optional(),\n});\nexport type FrontendDisplayHints = z.infer<typeof FrontendDisplayHintsSchema>;\n\n// =====================================================\n// UserNotificationDefinition — Discriminated Union on `channel`\n// =====================================================\n\n/**\n * Base fields shared by all user notification channel variants.\n */\nexport const UserNotificationDefinition_BaseSchema = z.object({\n identifier: z.string().min(1),\n target: z.string(),\n level: z.enum(UserNotificationLevel).optional(),\n primaryScope: z.enum(ResourcePrimaryScope),\n userRoles: z.array(z.string()).optional(),\n userIdsSelector: z.custom<\n (params: {\n currentObject: any;\n inputDto: any;\n objectContext: { parents: Record<string, any>; children: Record<string, any> };\n initiatorIds: { userId?: string; organizationId?: string; applicationId?: string };\n }) => string[]\n >((val) => typeof val === 'function').optional(),\n /**\n * Optional gate — dispatch this notification ONLY when the predicate returns truthy\n * against the post-operation context. Absent = always dispatches (backward compatible).\n * Evaluated per-notification BEFORE channel resolution, so it uniformly gates every\n * channel (email/websocket/front-end-success/…).\n *\n * The canonical use is a POLYMORPHIC operation whose notification must fire for only one\n * branch: the org-member CREATE op serves both INVITE (`status` INVITED — send the invite\n * email to `userEmail`) and DIRECT-ADD (`status` ACTIVE — founder / SSO-JIT / SCIM, whose\n * `userEmail` is the member's OWN address, so an \"you've been invited\" email is a\n * misdelivery). Keying on `currentObject.status === INVITED` fires the invite email for\n * invites only.\n *\n * Params mirror `userIdsSelector` (its sibling), so an author writes the same\n * `({ currentObject }) => …` form used by the operation-variant `enabledCondition`.\n *\n * @example `({ currentObject }) => currentObject.status === OrganizationMemberStatus.INVITED`\n */\n condition: z.custom<\n (params: {\n currentObject: any;\n inputDto: any;\n objectContext: { parents: Record<string, any>; children: Record<string, any> };\n initiatorIds: { userId?: string; organizationId?: string; applicationId?: string };\n }) => boolean\n >((val) => typeof val === 'function').optional(),\n /**\n * Custom notification reference for disambiguating multiple notifications of the same type.\n *\n * REQUIRED when:\n * - There are 2+ notifications with the same target in the same operation\n * - Example: 2+ USERS_CUSTOM notifications (one for creator, one for assignee)\n *\n * This allows distinguishing between multiple similar notifications\n * in the same operation (e.g., \"notify-creator\" vs \"notify-assignee\").\n *\n * Format: lowercase-kebab-case (e.g., \"notify-creator\", \"task-assigned\")\n * Will be appended to auto-generated identifier for notification/template lookup.\n */\n customNotificationRef: z.string().min(1).optional(),\n});\n\n// --- Channel-specific variants ---\n\n/** EMAIL channel — template-oriented (email-specific fields handled by email templates) */\nexport const UserNotificationDefinition_EmailSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.EMAIL),\n /**\n * Deliver this email to a raw address read from the current object, rather than\n * to a resolved platform user.\n *\n * When set, the recipient is `currentObject[recipientEmailField]` (a top-level\n * string field — e.g. `'email'`). The dispatcher sends a single email directly to\n * that address using the application's default locale, BYPASSING the `userId`-based\n * `target` resolution entirely.\n *\n * This is the framework's mechanism for notifying a party who is **not (yet) a\n * platform user** — an organization-invitation invitee, an inbound lead — for whom\n * no `userId` exists. Without it, the only email recipients the dispatcher can\n * resolve are members/initiators by id (`fetchUserContext(userId).email`).\n *\n * When this is set, `target` no longer selects the recipient; it is retained only\n * to (a) classify the notification, (b) drive the email `templateRef` derivation,\n * and (c) route the dashboard URL (admin app vs main app). Choose a `target` whose\n * dashboard-routing class matches the recipient (e.g. `USER_SELF` for a main-app\n * link).\n *\n * All other context is built identically to a user-targeted email (organization\n * name, initiator name, and the token `acceptUrl` enricher), so token-bearing\n * emails such as invitations still carry their `<frontendBase><emailLinkPath>?token=`\n * acceptance link.\n */\n recipientEmailField: z.string().trim().min(1).optional(),\n});\n\n/** WEBSOCKET channel — pure WebSocket push (no frontend display) */\nexport const UserNotificationDefinition_WebSocketSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.WEBSOCKET),\n});\n\n/**\n * FRONT_END_SUCCESS channel — frontend display with optional celebration + nextStep.\n *\n * `celebration`: Tells the frontend to render richer feedback than a simple toast.\n * `nextStep`: Suggested next action rendered as a CTA button in the toast or celebration overlay.\n *\n * Example usage in operation config:\n * ```\n * userNotifications: [{\n * identifier: 'first-document-created',\n * target: CoreUserNotificationTarget.USER_SELF,\n * channel: CoreUserNotificationChannel.FRONT_END_SUCCESS,\n * primaryScope: ResourcePrimaryScope.ORGANIZATIONS,\n * celebration: { mode: CelebrationDisplayMode.OVERLAY },\n * nextStep: { operationRef: 'DOCUMENTS.LIST.default', type: NotificationNextStepType.OPERATION },\n * }]\n * ```\n */\nexport const UserNotificationDefinition_FrontEndSuccessSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.FRONT_END_SUCCESS),\n /** Celebration display hints — triggers richer frontend feedback (overlay/confetti/lottie) */\n celebration: FrontendDisplayHintsCelebrationSchema.optional(),\n /** Suggested next action after operation completes — rendered as CTA in toast or celebration */\n nextStep: FrontendDisplayHintsNextStepSchema.optional(),\n});\n\n/** SMS channel — not yet implemented, plain base */\nexport const UserNotificationDefinition_SMSSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.SMS),\n});\n\n/** PUSH channel — not yet implemented, plain base */\nexport const UserNotificationDefinition_PushSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.PUSH),\n});\n\n/** Catch-all for custom channels (any string not matching core channels) */\nexport const UserNotificationDefinition_CustomChannelSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.string().min(1),\n});\n\n/**\n * Final union of all notification channel variants.\n * Uses z.union() (not z.discriminatedUnion) because the catch-all custom channel\n * uses z.string() which is not a literal discriminant.\n * Order matters: specific literals are tried before the catch-all string.\n */\nexport const UserNotificationDefinitionSchema = z.union([\n UserNotificationDefinition_EmailSchema,\n UserNotificationDefinition_WebSocketSchema,\n UserNotificationDefinition_FrontEndSuccessSchema,\n UserNotificationDefinition_SMSSchema,\n UserNotificationDefinition_PushSchema,\n UserNotificationDefinition_CustomChannelSchema,\n]);\nexport type UserNotificationDefinition = z.infer<typeof UserNotificationDefinitionSchema>;\n\n/**\n * M2M Notification Channels\n */\n\n\n\nexport enum M2MNotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n ERROR = 'error',\n }\n\nexport enum CoreM2MNotificationChannel {\n WEBHOOK_ORGANIZATION = 'webhook_organization',\n WEBHOOK_APPLICATION = 'webhook_application',\n}\n\nexport const M2MNotificationChannelSchema = z.union([\n z.enum(CoreM2MNotificationChannel),\n z.string().min(1)\n]);\n\nexport const M2MNotificationDefinitionSchema = z.object({\n identifier: z.string().min(1),\n channel: z.string(),\n level: z.enum(M2MNotificationLevel).optional(),\n});\nexport type M2MNotificationDefinition = z.infer<typeof M2MNotificationDefinitionSchema>;\n\n/**\n * Inferred types (interfaces defined above for isolatedDeclarations compatibility)\n */\n\nexport type UserNotificationTarget = string;\nexport type NotificationChannel = string;\nexport type M2MNotificationChannel = string;\n"]}
|
|
1
|
+
{"version":3,"file":"notifications.shared.schemas.js","sourceRoot":"","sources":["../../../../src/notifications/notifications.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,MAAM,CAAN,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACrC,8CAAe,CAAA;IACf,0CAAW,CAAA;IACX,4CAAa,CAAA;IACb,sDAAuB,CAAA;IACvB,sEAAuC,CAAA;AACzC,CAAC,EANW,2BAA2B,KAA3B,2BAA2B,QAMtC;AAED,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,4CAAmB,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AAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { ResourcePrimaryScope } from \"../resources/resources.shared.schemas\";\n\n\nexport enum CoreUserNotificationChannel {\n EMAIL = 'email',\n SMS = 'sms',\n PUSH = 'push',\n WEBSOCKET = 'websocket',\n FRONT_END_SUCCESS = 'front_end_success',\n}\n\nexport enum UserNotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n ERROR = 'error',\n}\n\nexport const UserNotificationChannelSchema = z.union([\n z.enum(CoreUserNotificationChannel),\n z.string().min(1)\n]);\n\n\nexport enum CoreUserNotificationTarget {\n APPLICATION_ADMINISTRATOR = 'application_administrator',\n APPLICATION_BILLING = 'application_billing',\n APPLICATION_USER_MANAGEMENT = 'application_user_management',\n APPLICATION_SECURITY = 'application_security',\n APPLICATION_SUPPORT = 'application_support',\n APPLICATION_OTHER = 'application_other',\n APPLICATION_ADMIN_VIEWER = 'application_admin_viewer',\n ORGANIZATION = 'organization',\n ORGANIZATION_USERS = 'organization_users',\n ORGANIZATION_BILLING = 'organization_billing',\n ORGANIZATION_USER_MANAGEMENT = 'organization_user_management',\n ORGANIZATION_ADMINISTRATIVE = 'organization_administrative',\n ORGANIZATION_SECURITY = 'organization_security',\n USER_SELF = 'user_self',\n USERS_CUSTOM = 'users_custom',\n INBOUND_CONTACT = 'inbound_contact',\n}\n\n/**\n * Whether a notification aimed at this target may be SUPPRESSED by the recipient's own channel\n * preference (`UserPreferences.notifications.email` / `.sms` / `.push` / `.inApp`).\n *\n * DERIVED from the target rather than declared per notification, because the target already carries\n * the distinction and a second field would be one more thing to get wrong on 87 declarations.\n *\n * `USER_SELF` and `USERS_CUSTOM` reach a PERSON about their own affairs — those are the messages a\n * person is choosing about when they turn a channel off, and honouring that choice is the whole\n * point of the switch existing (#409).\n *\n * Every other target reaches somebody because of a ROLE they hold: an application administrator, an\n * organization's security or billing contact. A personal channel preference must not silently\n * disable a tenant's or an application's administrative monitoring — the recipient did not choose to\n * receive those as a person and cannot switch them off as one. A tenant that wants role mail\n * elsewhere routes it, which is what the organization notification-settings record is for.\n *\n * Nothing here reaches account RECOVERY. Password reset, magic link and email verification are sent\n * directly through the email service and never pass through the notification dispatcher, so no\n * channel preference can lock a person out of their own account. That measurement is what made\n * suppression safe to implement at all.\n */\nexport function userNotificationTargetIsSuppressibleByRecipientPreference(target: string): boolean {\n return target === CoreUserNotificationTarget.USER_SELF\n || target === CoreUserNotificationTarget.USERS_CUSTOM;\n}\n\n/**\n * The targets on which `userRoles` MEANS anything (#495).\n *\n * `userRoles` is not a recipient FILTER, which is how its name reads and how it has been authored. It\n * is the role-SELECTION override for the eleven role-scoped targets: `mapOrganizationTargetToRoles`\n * and `mapApplicationTargetToRoles` take it in place of their per-target default, and nothing else\n * anywhere reads it.\n *\n * On every other target it is inert, and inert in three different ways that all looked the same to an\n * author: `USER_SELF` addresses the initiator, `USERS_CUSTOM` goes straight to `userIdsSelector`, and\n * `ORGANIZATION`/`ORGANIZATION_USERS` mean everyone in the tenant by definition. Declaring it there\n * is a filter that silently does nothing, which is what the refinement below now refuses.\n *\n * Scoped as a POSITIVE list of targets that read it rather than a rule about one target, because the\n * defect was never specific to `USERS_CUSTOM` — refusing it there alone would leave the other three\n * free to mislead the next author in exactly the same way.\n */\nexport function userNotificationTargetReadsUserRoles(target: string): boolean {\n return target === CoreUserNotificationTarget.ORGANIZATION_BILLING\n || target === CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT\n || target === CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE\n || target === CoreUserNotificationTarget.ORGANIZATION_SECURITY\n || target === CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR\n || target === CoreUserNotificationTarget.APPLICATION_BILLING\n || target === CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT\n || target === CoreUserNotificationTarget.APPLICATION_SECURITY\n || target === CoreUserNotificationTarget.APPLICATION_SUPPORT\n || target === CoreUserNotificationTarget.APPLICATION_OTHER\n || target === CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER;\n}\n\nexport const UserNotificationTargetSchema = z.union([\n z.enum(CoreUserNotificationTarget),\n z.string().min(1)\n]);\n\n\n\n// =====================================================\n// Celebration & Next-Step Enums (Phase 1a)\n// =====================================================\n\n/**\n * How the frontend renders a celebration after a successful operation.\n * - OVERLAY: Full-screen overlay with animation (e.g., confetti + message)\n * - CONFETTI: Lightweight confetti burst (no overlay)\n * - LOTTIE: Custom Lottie animation (resolved by notification identifier)\n */\nexport enum CelebrationDisplayMode {\n OVERLAY = 'overlay',\n CONFETTI = 'confetti',\n LOTTIE = 'lottie',\n}\n\n/**\n * Type of next-step suggestion attached to a notification.\n * - OPERATION: Navigate to and/or trigger a resource operation\n * - URL: Navigate to an arbitrary URL (internal or external)\n */\nexport enum NotificationNextStepType {\n OPERATION = 'operation',\n URL = 'url',\n}\n\n// =====================================================\n// Frontend Display Hints Schema (reusable)\n// =====================================================\n\nexport const FrontendDisplayHintsCelebrationSchema = z.object({\n mode: z.enum(CelebrationDisplayMode).default(CelebrationDisplayMode.OVERLAY),\n});\nexport type FrontendDisplayHintsCelebration = z.infer<typeof FrontendDisplayHintsCelebrationSchema>;\n\nexport const FrontendDisplayHintsNextStepSchema = z.object({\n /** Operation path (e.g., \"TASKS.CREATE.default\") or URL */\n operationRef: z.string(),\n type: z.enum(NotificationNextStepType).default(NotificationNextStepType.OPERATION),\n});\nexport type FrontendDisplayHintsNextStep = z.infer<typeof FrontendDisplayHintsNextStepSchema>;\n\nexport const FrontendDisplayHintsSchema = z.object({\n celebration: FrontendDisplayHintsCelebrationSchema.optional(),\n nextStep: FrontendDisplayHintsNextStepSchema.optional(),\n});\nexport type FrontendDisplayHints = z.infer<typeof FrontendDisplayHintsSchema>;\n\n// =====================================================\n// UserNotificationDefinition — Discriminated Union on `channel`\n// =====================================================\n\n/**\n * @wildo_source:part:start saas.models.notifications.user-notification-definition facet:layer:shared facet:audience:app-developer\n *\n * One notification an operation sends. Declared as `userNotifications` on a resource operation, in\n * the resource config — an array, so one operation may send several.\n *\n * ```ts\n * userNotifications: [\n * { target: CoreUserNotificationTarget.USER_SELF, channel: CoreUserNotificationChannel.EMAIL,\n * condition: ({ currentObject }) => currentObject.status === 'INVITED' },\n * { target: CoreUserNotificationTarget.ORGANIZATION_USERS, channel: CoreUserNotificationChannel.WEBSOCKET },\n * ]\n * ```\n *\n * ## What actually sends\n *\n * `EMAIL`, `WEBSOCKET` and `FRONT_END_SUCCESS` deliver. **`SMS` and `PUSH` are declaration vocabulary\n * only** — the dispatcher's branch for them logs and returns without sending. The framework does have\n * an SMS transport (authentication's one-time codes use it) and this dispatcher is not wired to it,\n * so declaring an SMS notification is inert rather than pending.\n *\n * For an EMAIL, create the template directory the reference names. The startup validator resolves\n * every declared reference through the configured locale chain before the application takes traffic,\n * and prints the exact directory to create when one is missing.\n *\n * ## The recipient's preferences are honoured, and three things override them\n *\n * A recipient who has switched a channel off does not receive it. Three deliberate exceptions:\n *\n * - a ROLE-addressed target — the recipient did not choose to receive it as a person;\n * - `alwaysDeliver: true` — declare it on a security notice a compromised account's owner must still\n * receive;\n * - a recipient with NO preferences row at all, because preferences are created lazily and a missing\n * record must never read as \"everything off\".\n *\n * The `inApp` switch governs the notification CENTRE on the frontend rather than the socket frame —\n * suppressing the frame would also suppress the live UI updates that ride the same channel.\n *\n * ## `condition` gates the notification, not the operation\n *\n * The predicate goes on the notification. It decides only whether this one message is sent; refusing\n * the CALL is a separate declaration on the operation variant, and the two are independent — a\n * variant can be enabled while its notification is gated off, and the reverse. The form deliberately\n * matches an operation variant's `enabledCondition` so both read the same way.\n *\n * ## Emailing somebody who is not a user\n *\n * `recipientEmailField` names a TOP-LEVEL field on the record holding the address. There is no\n * recipient, so there are no recipient preferences and no recipient language: the message goes out in\n * the application's default locale. A nested address cannot be named, nor a list — the path sends\n * exactly one message per notification. Pair it with a `condition` when the same operation also\n * serves rows whose address belongs to somebody who must not be written to.\n *\n * Base fields shared by all user notification channel variants.\n */\nexport const UserNotificationDefinition_BaseSchema = z.object({\n identifier: z.string().min(1),\n target: z.string(),\n level: z.enum(UserNotificationLevel).optional(),\n primaryScope: z.enum(ResourcePrimaryScope),\n /**\n * Role-SELECTION override for a role-scoped target — NOT a recipient filter. See\n * {@link userNotificationTargetReadsUserRoles}, which is also what refuses it elsewhere.\n */\n userRoles: z.array(z.string()).optional(),\n userIdsSelector: z.custom<\n (params: {\n currentObject: any;\n inputDto: any;\n objectContext: { parents: Record<string, any>; children: Record<string, any> };\n initiatorIds: { userId?: string; organizationId?: string; applicationId?: string };\n }) => string[]\n >((val) => typeof val === 'function').optional(),\n /**\n * Optional gate — dispatch this notification ONLY when the predicate returns truthy\n * against the post-operation context. Absent = always dispatches (backward compatible).\n * Evaluated per-notification BEFORE channel resolution, so it uniformly gates every\n * channel (email/websocket/front-end-success/…).\n *\n * The canonical use is a POLYMORPHIC operation whose notification must fire for only one\n * branch: the org-member CREATE op serves both INVITE (`status` INVITED — send the invite\n * email to `userEmail`) and DIRECT-ADD (`status` ACTIVE — founder / SSO-JIT / SCIM, whose\n * `userEmail` is the member's OWN address, so an \"you've been invited\" email is a\n * misdelivery). Keying on `currentObject.status === INVITED` fires the invite email for\n * invites only.\n *\n * Params mirror `userIdsSelector` (its sibling), so an author writes the same\n * `({ currentObject }) => …` form used by the operation-variant `enabledCondition`.\n *\n * @example `({ currentObject }) => currentObject.status === OrganizationMemberStatus.INVITED`\n */\n condition: z.custom<\n (params: {\n currentObject: any;\n inputDto: any;\n objectContext: { parents: Record<string, any>; children: Record<string, any> };\n initiatorIds: { userId?: string; organizationId?: string; applicationId?: string };\n }) => boolean\n >((val) => typeof val === 'function').optional(),\n /**\n * Custom notification reference for disambiguating multiple notifications of the same type.\n *\n * REQUIRED when:\n * - There are 2+ notifications with the same target in the same operation\n * - Example: 2+ USERS_CUSTOM notifications (one for creator, one for assignee)\n *\n * This allows distinguishing between multiple similar notifications\n * in the same operation (e.g., \"notify-creator\" vs \"notify-assignee\").\n *\n * Format: lowercase-kebab-case (e.g., \"notify-creator\", \"task-assigned\")\n * Will be appended to auto-generated identifier for notification/template lookup.\n */\n customNotificationRef: z.string().min(1).optional(),\n /**\n * Deliver this notification even when the recipient has switched its channel OFF.\n *\n * Only meaningful on a target that is suppressible in the first place — `USER_SELF` and\n * `USERS_CUSTOM` (see `userNotificationTargetIsSuppressibleByRecipientPreference`). On a\n * role-addressed target the preference never applied, so this flag changes nothing there.\n *\n * The narrow escape, for the case the target axis cannot express: a message that reaches a\n * person about their OWN affairs and is nevertheless a security notice they should not be able\n * to silence — a credential minted or destroyed on their account, an authentication factor\n * changed. Those are the alerts a person most needs when they did NOT perform the action.\n *\n * Author it with the reason at the site. It is deliberately not a default and deliberately not\n * derived: \"is this alert one a compromised account's owner must still receive?\" is a judgement\n * about the message, and inventing a rule for it would be a rule nobody could check.\n */\n alwaysDeliver: z.boolean().optional(),\n});\n\n// --- Channel-specific variants ---\n\n/** EMAIL channel — template-oriented (email-specific fields handled by email templates) */\nexport const UserNotificationDefinition_EmailSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.EMAIL),\n /**\n * Deliver this email to a raw address read from the current object, rather than\n * to a resolved platform user.\n *\n * When set, the recipient is `currentObject[recipientEmailField]` (a top-level\n * string field — e.g. `'email'`). The dispatcher sends a single email directly to\n * that address using the application's default locale, BYPASSING the `userId`-based\n * `target` resolution entirely.\n *\n * This is the framework's mechanism for notifying a party who is **not (yet) a\n * platform user** — an organization-invitation invitee, an inbound lead — for whom\n * no `userId` exists. Without it, the only email recipients the dispatcher can\n * resolve are members/initiators by id (`fetchUserContext(userId).email`).\n *\n * When this is set, `target` no longer selects the recipient; it is retained only\n * to (a) classify the notification, (b) drive the email `templateRef` derivation,\n * and (c) route the dashboard URL (admin app vs main app). Choose a `target` whose\n * dashboard-routing class matches the recipient (e.g. `USER_SELF` for a main-app\n * link).\n *\n * All other context is built identically to a user-targeted email (organization\n * name, initiator name, and the token `acceptUrl` enricher), so token-bearing\n * emails such as invitations still carry their `<frontendBase><emailLinkPath>?token=`\n * acceptance link.\n */\n recipientEmailField: z.string().trim().min(1).optional(),\n});\n\n/** WEBSOCKET channel — pure WebSocket push (no frontend display) */\nexport const UserNotificationDefinition_WebSocketSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.WEBSOCKET),\n});\n\n/**\n * FRONT_END_SUCCESS channel — frontend display with optional celebration + nextStep.\n *\n * `celebration`: Tells the frontend to render richer feedback than a simple toast.\n * `nextStep`: Suggested next action rendered as a CTA button in the toast or celebration overlay.\n *\n * Example usage in operation config:\n * ```\n * userNotifications: [{\n * identifier: 'first-document-created',\n * target: CoreUserNotificationTarget.USER_SELF,\n * channel: CoreUserNotificationChannel.FRONT_END_SUCCESS,\n * primaryScope: ResourcePrimaryScope.ORGANIZATIONS,\n * celebration: { mode: CelebrationDisplayMode.OVERLAY },\n * nextStep: { operationRef: 'DOCUMENTS.LIST.default', type: NotificationNextStepType.OPERATION },\n * }]\n * ```\n */\nexport const UserNotificationDefinition_FrontEndSuccessSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.FRONT_END_SUCCESS),\n /** Celebration display hints — triggers richer frontend feedback (overlay/confetti/lottie) */\n celebration: FrontendDisplayHintsCelebrationSchema.optional(),\n /** Suggested next action after operation completes — rendered as CTA in toast or celebration */\n nextStep: FrontendDisplayHintsNextStepSchema.optional(),\n});\n\n/** SMS channel — not yet implemented, plain base */\nexport const UserNotificationDefinition_SMSSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.SMS),\n});\n\n/** PUSH channel — not yet implemented, plain base */\nexport const UserNotificationDefinition_PushSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.PUSH),\n});\n\n/** Catch-all for custom channels (any string not matching core channels) */\nexport const UserNotificationDefinition_CustomChannelSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.string().min(1),\n});\n\n/**\n * Final union of all notification channel variants.\n * Uses z.union() (not z.discriminatedUnion) because the catch-all custom channel\n * uses z.string() which is not a literal discriminant.\n * Order matters: specific literals are tried before the catch-all string.\n */\nexport const UserNotificationDefinitionSchema = z.union([\n UserNotificationDefinition_EmailSchema,\n UserNotificationDefinition_WebSocketSchema,\n UserNotificationDefinition_FrontEndSuccessSchema,\n UserNotificationDefinition_SMSSchema,\n UserNotificationDefinition_PushSchema,\n UserNotificationDefinition_CustomChannelSchema,\n])\n /**\n * `userRoles` on a target that never reads it is a filter that silently does nothing (#495).\n *\n * Refined on the UNION rather than on the base object, deliberately: the base is `.extend()`ed by\n * six channel variants, and a refinement there would be dropped by every one of them — the shape of\n * bug this refinement exists to prevent.\n */\n .superRefine((notification, context) => {\n if (notification.userRoles !== undefined && !userNotificationTargetReadsUserRoles(notification.target)) {\n context.addIssue({\n code: 'custom',\n path: ['userRoles'],\n message: `userRoles is only read for a role-scoped target and would be inert on \"${notification.target}\". `\n + 'It selects WHICH roles a role-scoped target reaches; it does not filter the recipients of any other '\n + 'target. Remove it, or address the notification to a role-scoped target.',\n });\n }\n });\nexport type UserNotificationDefinition = z.infer<typeof UserNotificationDefinitionSchema>;\n/** @wildo_source:part:end saas.models.notifications.user-notification-definition */\n\n/**\n * M2M Notification Channels\n */\n\n\n\nexport enum M2MNotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n ERROR = 'error',\n }\n\nexport enum CoreM2MNotificationChannel {\n WEBHOOK_ORGANIZATION = 'webhook_organization',\n WEBHOOK_APPLICATION = 'webhook_application',\n}\n\nexport const M2MNotificationChannelSchema = z.union([\n z.enum(CoreM2MNotificationChannel),\n z.string().min(1)\n]);\n\nexport const M2MNotificationDefinitionSchema = z.object({\n identifier: z.string().min(1),\n channel: z.string(),\n level: z.enum(M2MNotificationLevel).optional(),\n});\nexport type M2MNotificationDefinition = z.infer<typeof M2MNotificationDefinitionSchema>;\n\n/**\n * Inferred types (interfaces defined above for isolatedDeclarations compatibility)\n */\n\nexport type UserNotificationTarget = string;\nexport type NotificationChannel = string;\nexport type M2MNotificationChannel = string;\n"]}
|
|
@@ -29,7 +29,7 @@ export declare const ORGANIZATION_MEMBER_INVITATION_TOKEN_REVOCATION: {
|
|
|
29
29
|
tokenTypes: CoreConsumableTokenTypes[];
|
|
30
30
|
relatedIdField: string;
|
|
31
31
|
};
|
|
32
|
-
type OrganizationMembersCoreOperations = CoreResourceOperation.READ | CoreResourceOperation.LIST | CoreResourceOperation.SEARCH | CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE | CoreResourceOperation.COUNT;
|
|
32
|
+
type OrganizationMembersCoreOperations = CoreResourceOperation.READ | CoreResourceOperation.LIST | CoreResourceOperation.SEARCH | CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE | CoreResourceOperation.COUNT | CoreResourceOperation.UPDATE_MANY;
|
|
33
33
|
export declare const organizationMembersResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => import("..").ResourceConfiguration<typeof OrganizationMembers_Operations, OrganizationMembersCoreOperations, import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodObject<{
|
|
34
34
|
_id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
|
|
35
35
|
userId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>>>>;
|
package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-members.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,wBAAwB,EACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAoD,oBAAoB,EAA+B,MAAM,uCAAuC,CAAC;AAO5J,OAAO,EACL,wBAAwB,EAEzB,MAAM,6DAA6D,CAAC;AAMrE,OAAO,EAAkB,cAAc,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"organization-members.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,wBAAwB,EACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAoD,oBAAoB,EAA+B,MAAM,uCAAuC,CAAC;AAO5J,OAAO,EACL,wBAAwB,EAEzB,MAAM,6DAA6D,CAAC;AAMrE,OAAO,EAAkB,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAmCjG,oBAAY,8BAA8B;IACxC,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,eAAe,mBAAmB;CACnC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+CAA+C;;;CAK3B,CAAC;AAsBlC,KAAK,iCAAiC,GAClC,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,KAAK,GAE3B,qBAAqB,CAAC,WAAW,CAAC;AAKtC,eAAO,MAAM,8DAA8D,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;mBA4f3H,CAAC"}
|
|
@@ -17,6 +17,7 @@ import { CoreConsumableTokenTypes, ConsumableToken_ConsumptionMode, } from '../s
|
|
|
17
17
|
import { DurationUnit } from '@wildo-ai/zod-decorators';
|
|
18
18
|
import { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas.js';
|
|
19
19
|
import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
|
|
20
|
+
import { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas.js';
|
|
20
21
|
// Custom operations enum for organization members.
|
|
21
22
|
// NOTE: cross-organization member transfer is intentionally NOT a framework
|
|
22
23
|
// capability — moving a member between organizations is a tenant-boundary
|
|
@@ -111,6 +112,26 @@ export const organizationMembersResourceConfiguration_InitializationFactory = (r
|
|
|
111
112
|
* Subject-export disclosure. The subject's OWN membership rows (org, roles, title) — not other members' data.
|
|
112
113
|
*/
|
|
113
114
|
portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },
|
|
115
|
+
/**
|
|
116
|
+
* Subject erasure RETAINS this row and scrubs the person's contact and professional details.
|
|
117
|
+
*
|
|
118
|
+
* The membership survives because it is the tenant's record of who belonged to it and under what
|
|
119
|
+
* authority; what does not survive is `userEmail` and `userTitle`, the denormalized copies of the
|
|
120
|
+
* person held here so a row can be read without resolving the user.
|
|
121
|
+
*
|
|
122
|
+
* `roles` is deliberately NOT scrubbed. It is this application's authorization vocabulary rather than
|
|
123
|
+
* personal data — the field's own comment says so — and emptying it could leave a tenant with no
|
|
124
|
+
* administrator, which the administrative-continuity floors would refuse, making an erasure fail closed
|
|
125
|
+
* on a tenant. Keeping it means that interaction never arises.
|
|
126
|
+
*/
|
|
127
|
+
retentionPolicy: {
|
|
128
|
+
mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* Erasing one of these rows revokes NO session. A membership is a record ABOUT a person's place in a
|
|
132
|
+
* tenant, not the person — their session ends through the `USERS` row, which is `SELF_PRINCIPAL`.
|
|
133
|
+
*/
|
|
134
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
|
|
114
135
|
coreOperations: [
|
|
115
136
|
CoreResourceOperation.READ,
|
|
116
137
|
CoreResourceOperation.LIST,
|
|
@@ -119,9 +140,32 @@ export const organizationMembersResourceConfiguration_InitializationFactory = (r
|
|
|
119
140
|
CoreResourceOperation.UPDATE,
|
|
120
141
|
CoreResourceOperation.DELETE,
|
|
121
142
|
CoreResourceOperation.COUNT,
|
|
143
|
+
// Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.
|
|
144
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
122
145
|
],
|
|
123
146
|
customOperation: OrganizationMembers_Operations,
|
|
124
147
|
operationsConfiguration: {
|
|
148
|
+
/*
|
|
149
|
+
|
|
150
|
+
* Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it
|
|
151
|
+
|
|
152
|
+
* must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,
|
|
153
|
+
|
|
154
|
+
* which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the
|
|
155
|
+
|
|
156
|
+
* HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the
|
|
157
|
+
|
|
158
|
+
* verb the impersonalize writer uses to stamp the retention markers.
|
|
159
|
+
|
|
160
|
+
*/
|
|
161
|
+
[CoreResourceOperation.UPDATE_MANY]: {
|
|
162
|
+
variants: [{
|
|
163
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
164
|
+
isDefault: true,
|
|
165
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
166
|
+
riskLevel: ResourceOperationRiskLevel.CRITICAL,
|
|
167
|
+
}],
|
|
168
|
+
},
|
|
125
169
|
[CoreResourceOperation.COUNT]: {
|
|
126
170
|
variants: [
|
|
127
171
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-members.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAA8C,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAC5J,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;AACxF,OAAO,EACL,wBAAwB,EACxB,+BAA+B,GAChC,MAAM,6DAA6D,CAAC;AAIrE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CA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CAAC,KAAK;oBAC1C,qBAAqB,EAAE,OAAO;iBAC/B;aACF;SACF;QAED,iFAAiF;QACjF,gFAAgF;QAChF,2BAA2B;QAC3B,CAAC,8BAA8B,CAAC,MAAM,CAAC,EAAE;YACvC,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,GAAG;oBACzC,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;oBACxB,eAAe,EAAE;wBACf,SAAS,EAAE,wBAAwB,CAAC,8BAA8B;wBAClE,eAAe,EAAE,+BAA+B,CAAC,UAAU;wBAC3D,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE;wBAChD,cAAc,EAAE,KAAK;wBACrB,4BAA4B,EAAE,IAAI;wBAClC,aAAa,EAAE,aAAa;wBAC5B,SAAS,EAAE,qCAAqC;qBACjD;oBACD,+EAA+E;oBAC/E,+EAA+E;oBAC/E,gBAAgB,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,KAAK,wBAAwB,CAAC,OAAO;iBACnG;aACF;YACD,iBAAiB,EAAE;gBACjB;oBACE,MAAM,EAAE,0BAA0B,CAAC,SAAS;oBAC5C,OAAO,EAAE,2BAA2B,CAAC,KAAK;oBAC1C,mBAAmB,EAAE,WAAW;oBAChC,SAAS,EAAE,qCAAqC;iBACjD;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Organization Members Shared Resource Configuration\n *\n * Resource configuration for organization member management.\n * Comprehensive member lifecycle and role management.\n */\n\nimport { z } from 'zod';\nimport {\n OrganizationMemberSchema,\n OrganizationMemberStatus,\n} from './organization-members.shared.schemas';\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourcePrimaryScope, ResourceRelationship, DefaultDeleteResponseSchema } 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';\nimport {\n CoreConsumableTokenTypes,\n ConsumableToken_ConsumptionMode,\n} from '../security/authentications/consumable-token.shared.schemas';\nimport type {\n TokenRevocationConfig,\n} from '../security/authentications/consumable-token.shared.schemas';\nimport { DurationUnit } from '@wildo-ai/zod-decorators';\n\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\n\n// Custom operations enum for organization members.\n// NOTE: cross-organization member transfer is intentionally NOT a framework\n// capability — moving a member between organizations is a tenant-boundary\n// crossing the framework does not sanction. Re-invite the identity in the\n// target organization instead.\n//\n// A membership row IS the invitation (there is no separate invitation resource):\n// - CREATE = invite (creates an `INVITED` row + mints the accept token).\n// - REVOKE = inviter/admin cancels a still-`INVITED` membership.\n// - RESEND = re-mint + re-send the accept token for an `INVITED` membership.\n// - SUSPEND/REACTIVATE = lifecycle of an ACTIVE/SUSPENDED member.\n// Invitee-side accept/reject is the tokenized `/auth/acceptInvitation` flow\n// (auth controller + `Auth_Invitation` screen), NOT a resource operation.\n//\n// ROLE CHANGES ARE `UPDATE`, NOT A DEDICATED VERB. `PROMOTE` / `DEMOTE` were declared here\n// as `ORG_ADMIN`-gated `riskLevel: HIGH` operations taking `{ newRole, reason }`, and were\n// removed on 2026-08-01: they were ROUTED but never implemented, so the request fell through\n// to the generic core UPDATE, which persists only fields the resource schema declares.\n// `newRole` is not one, so every call answered **HTTP 200 having changed nothing** — and the\n// dangerous direction is DEMOTE: an admin demotes a compromised account, is told 200 OK, and\n// the account keeps its privileges. Re-declaring an explicit role-change verb is legitimate,\n// but only WITH a custom implementation that writes `roles` and calls\n// `assertRequestedRolesWithinCallerCeiling` — a custom implementation is addressed by an EXACT\n// operation path, so it does NOT inherit the UPDATE variant's ceiling gate. Follow the\n// organization-units MOVE/ARCHIVE pattern (a `prefixCoreOperations` hook returning the field\n// patch the core UPDATE persists). See\n// `.claude/plans/routed-unimplemented-operations-fail-closed.md`.\n//\n// GRANT_OWNERSHIP is the ONE exception to \"role changes are UPDATE\", and it exists for a reason\n// UPDATE structurally cannot serve: it is the only operation on this resource a caller who is NOT a\n// member of the organization may perform. See its config entry below.\nexport enum OrganizationMembers_Operations {\n SUSPEND = 'suspend',\n REACTIVATE = 'reactivate',\n REVOKE = 'revoke',\n RESEND = 'resend',\n GRANT_OWNERSHIP = 'grantOwnership',\n}\n\n/**\n * One semantic definition for invalidating an organization invitation.\n *\n * REVOKE attaches it declaratively, so HTTP and trusted service callers enter\n * the same transactional revocation pipeline. Ordinary DELETE is\n * intentionally excluded: it removes a non-INVITED membership, which has no\n * invitation token to revoke.\n */\nexport const ORGANIZATION_MEMBER_INVITATION_TOKEN_REVOCATION = {\n tokenTypes: [\n CoreConsumableTokenTypes.ORGANIZATION_MEMBER_INVITATION,\n ],\n relatedIdField: '_id',\n} satisfies TokenRevocationConfig;\n\n/**\n * One predicate owns both invitation-token generation and invitation-email\n * dispatch. Keeping the two declarative side effects on the same named gate\n * prevents the polymorphic CREATE operation from drifting: an ACTIVE direct\n * add must produce neither an accept token nor an invitation email.\n */\nconst isPendingOrganizationMemberInvitation = ({\n currentObject,\n}: {\n currentObject: Record<string, unknown>;\n}): boolean =>\n currentObject.status === OrganizationMemberStatus.INVITED;\n\nconst ORGANIZATION_MEMBERS_SORT_FIELDS = ['status', 'role', 'joinedAt'];\n\nconst ORGANIZATION_MEMBERS_FILTER_FIELDS = {\n status: z.enum(OrganizationMemberStatus),\n role: z.string(),\n};\n\ntype OrganizationMembersCoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE\n | CoreResourceOperation.COUNT;\n\n/*\nOrganization Members Resource Configuration Factory\n*/\nexport const organizationMembersResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof OrganizationMembers_Operations,\n OrganizationMembersCoreOperations,\n typeof OrganizationMemberSchema\n>({\n mainSchema: OrganizationMemberSchema,\n resourceIdentifier: CoreResourceType.ORGANIZATION_MEMBERS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATION_MEMBERS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n // create: invitation-accept was the historical opt-in; now the org-admin INVITE, SSO/SCIM\n // JIT, and org-auto-create-on-registration all create members in-process with explicit\n // `userId` + `organizationId` FKs on a request-context-less EC (stripped by the\n // client-shaped CREATE DTO, re-attached by `createAsSystem`).\n // read/list: the invitee's own pending-invitation inbox reads INVITED rows cross-org\n // BEFORE the invitee is a scoped member — authorized by `userId`-ownership at the\n // entry point (`listMyPendingInvitations`/`loadOwnedPendingInvitation`), not org role.\n // update: invitation ACCEPTANCE flips INVITED → ACTIVE in-process; the invitee is not an\n // org admin, so the status flip goes through the trusted system path.\n systemAccessPolicy: {\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n list: ResourceSystemAccessMode.ALLOWED,\n update: ResourceSystemAccessMode.ALLOWED,\n },\n\n /**\n * Subject-export disclosure. The subject's OWN membership rows (org, roles, title) — not other members' data.\n */\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n CoreResourceOperation.COUNT,\n ],\n\n customOperation: OrganizationMembers_Operations,\n\n operationsConfiguration: {\n [CoreResourceOperation.COUNT]: {\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 // CREATE is POLYMORPHIC — two intents on one op:\n // • INVITE (BRANCH B): the org admin supplies `userEmail` (the strict identity\n // anchor); the CREATE prefix find-or-creates the `User` by it (`PENDING_INVITATION`\n // if new) and FORCES `status: INVITED`. A single-use accept token is minted AFTER the\n // row is created (relatedId = the membership `_id`, STABLE across `INVITED → ACTIVE`\n // so the emailed link never orphans); the pipeline injects it into the invite email and\n // the dispatcher builds the accept link (`emailLinkPath → /invitation?token=…`, consumed\n // by `/auth/acceptInvitation`). No `grantedRoles`: the accept handler reads the\n // membership's own `roles` when it flips the row to ACTIVE.\n // • DIRECT-ADD (BRANCH A): the caller supplies `userId` (founder org-owner grant,\n // SSO-JIT, SCIM) and the row persists `ACTIVE` — there is nothing to accept.\n // Token generation and notification dispatch share one named predicate.\n // The INVITE branch mints one accept token and sends one post-commit email;\n // the ACTIVE direct-add branch does neither.\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can invite members\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n // requestDto auto-derived from decorators (userEmail + roles +\n // organizationUnitsMembership + userTitle; userId/status/invitedByUserId/\n // invitedAt are server-injected via `.excludeFromCreate()`).\n tokenGeneration: {\n tokenType: CoreConsumableTokenTypes.ORGANIZATION_MEMBER_INVITATION,\n consumptionMode: ConsumableToken_ConsumptionMode.SINGLE_USE,\n expiresIn: { value: 7, unit: DurationUnit.DAYS },\n relatedIdField: '_id',\n emailLinkPath: '/invitation',\n // Mint the accept token for real invites only — never for an ACTIVE direct-add.\n condition: isPendingOrganizationMemberInvitation,\n },\n }\n ],\n // Deliver the invite email to the INVITEE (`userEmail`) via the\n // email-by-address path — the invitee may be a brand-new `PENDING_INVITATION`\n // user with no session. Carries the `acceptUrl` (`/invitation?token=…`) built\n // from the token minted above. `target: USER_SELF` is retained only so the\n // derived template ref stays `…create.user-self` and the accept link routes to\n // the main (non-admin) app.\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n recipientEmailField: 'userEmail',\n condition: isPendingOrganizationMemberInvitation,\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], // Org members can read member info\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], // Org members can list organization members\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n // `userEmail` is a denormalized, immutable own-field (mirror of the linked\n // user's email, captured at membership creation). First/last name are NOT\n // denormalized onto the member row — they live on `USER_PROFILES` and are\n // mutable there — so they are searched RELATIONALLY: the framework runs a\n // secondary match on `USER_PROFILES` (its own searchable fields) and folds\n // the matching `userId`s into an `$in` on this row's `userId`. The member\n // query stays org-scoped, so this is tenant-safe; names are never stale\n // because they are read live from the profile at search time. See\n // SearchableRelationDescriptor in resources-config.shared.schemas.ts.\n searchableFields: [\n 'userEmail',\n {\n localField: 'userId',\n relatedResource: CoreResourceType.USER_PROFILES,\n relatedJoinField: 'userId',\n fields: ['firstName', 'lastName'],\n },\n ],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: ORGANIZATION_MEMBERS_FILTER_FIELDS,\n sortFields: ORGANIZATION_MEMBERS_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 50,\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], // Org admins can update member details\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n // requestDto auto-derived from decorators\n //\n // Audited despite being below the HIGH/CRITICAL floor: since PROMOTE / DEMOTE were removed\n // (2026-08-01), **this operation IS the only org-member role-change path**, and a role\n // change is an access-control decision whatever the verb's risk level says. MEDIUM is the\n // right answer for the UI axis riskLevel primarily serves — updating a member's details\n // does not deserve a danger-zone affordance or a typed confirmation — but it is the wrong\n // answer for the evidence axis, and this flag is exactly that divergence.\n //\n // This also closes the follow-up left open by the routed-unimplemented-operations sweep:\n // `CoreAuditableEventType.ORGANIZATION_MEMBER_ROLE_CHANGED` is declared and classified but\n // emitted by nothing, so org-member role changes produced no trail at all. The generic\n // mechanism covers it — with `roles` marked as audit evidence, the row carries the before\n // and after sets — rather than adding a sixth hand-rolled emission.\n //\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE — evidence of privilege grant/revocation.\n auditableEvent: { auditBelowRiskFloor: true },\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\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], // Org admins can remove members\n riskLevel: ResourceOperationRiskLevel.HIGH,\n // Accepted/non-pending members use ordinary DELETE. A pending invite\n // is cancelled through REVOKE, which atomically revokes its accept\n // token. Keeping the vocabularies disjoint avoids making every\n // active-member removal token-coupled.\n enabledCondition: ({ currentObject }) =>\n currentObject.status !== OrganizationMemberStatus.INVITED,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n /**\n * The higher-tier repair door for the organization-owner floor — the second half of the\n * industry pattern described in `.claude/rules/administrative-continuity-floors.md`.\n *\n * ## Why this cannot be UPDATE\n *\n * The floor refuses to let the last `ORG_OWNER` be removed, demoted or deactivated. That is the\n * correct tenant-tier answer, but on its own it converts every mistake that DID strand a tenant\n * — a direct database edit, a restore from a mid-erasure backup, an acknowledged erasure under\n * GDPR Art. 17, a seed that authored no owner — into a permanent lockout, because\n * `validateParentScopeAccess` denies a non-member on ORGANIZATIONS scope and there is no\n * `APP_ADMIN_SUPER_ADMIN` bypass. Both denials are pinned in\n * `cross-tenant-super-admin-reach.mongo.integration.test.ts`. So no tenant member can grant the\n * role (they would need the authority they just lost) and no platform administrator can reach\n * the row at all. GitHub solves this with an Enterprise owner one tier up; this is that tier.\n *\n * ## Why it is a distinct verb rather than a flag on UPDATE\n *\n * `admitsCrossTenantPlatformAdministration` relaxes the SCOPE check for the variant that carries\n * it. Putting it on generic UPDATE would open every field of every membership row in every\n * tenant to a cross-tenant caller. The whole safety argument is that the opened surface is\n * exactly one field with one direction, so it is authored as its own operation whose custom\n * implementation ignores the payload for anything but the justification.\n *\n * ## Deliberate narrowness\n *\n * - **Promotes an EXISTING member** (Microsoft Loop's rule). It cannot mint a membership, so it\n * never creates an identity inside a tenant nobody owns.\n * - **Additive only.** It adds the owner-conferring role; it cannot remove roles, so it can\n * never be used to demote and is not a second path through the floor.\n * - **`justification` is required**, not optional. This is a break-glass action against a tenant\n * the operator is not a member of; the audit row is worth nothing without the why. `AC-2(7)`\n * asks for privileged assignment to be monitored — the trail IS the control here, since by\n * construction no authorization check downstream can second-guess the caller.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — restore administrability of a scope\n * that has no usable administrator.\n * assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE — evidence of privilege grant.\n */\n [OrganizationMembers_Operations.GRANT_OWNERSHIP]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n // Platform tier only. This is the role set the operation-roles gate checks INDEPENDENTLY\n // of the scope admission below: a caller holding this key at ORGANIZATIONS scope resolves\n // it against the organization role table, which does not contain it, and is denied there.\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // THE cross-tenant admission. Without it the operation is unreachable by the only\n // principal it exists for, because a platform administrator is by definition not a member\n // of the stranded tenant.\n admitsCrossTenantPlatformAdministration: true,\n requestDto: z.object({\n justification: z.string().min(1).max(1000),\n }),\n // No `auditableEvent` declaration: CRITICAL is inside `AUTOMATIC_AUDIT_RISK_FLOOR`, so the\n // event emits on the risk level alone and `auditBelowRiskFloor` would be inert here. The\n // before/after role sets ride along because `roles` carries `.isAuditEvidence()` — which is\n // what makes the trail answer the question that matters about this door: WHO was made an\n // owner of a tenant, by a caller who was not in it.\n },\n ],\n userNotifications: [\n {\n // The tenant learns that its ownership changed from outside. An operator repairing a\n // stranded tenant is legitimate; an operator quietly granting themselves an ally inside a\n // customer's tenant is not, and the difference is only visible to the tenant if it is told.\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\n },\n ],\n },\n\n [OrganizationMembers_Operations.SUSPEND]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can suspend members\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n suspensionReason: z.string().min(1).max(500),\n suspensionEndDate: z.date().optional()\n }),\n // Implemented by the shared status-transition factory (ACTIVE → SUSPENDED, carrying\n // `suspensionEndDate` onto the row's `scheduledReactivationAt`). SUSPEND is legal only\n // from ACTIVE: an INVITED row has not accepted yet — cancel it with REVOKE, which also\n // revokes the accept token — and an INACTIVE one is already out.\n enabledCondition: ({ currentObject }) =>\n currentObject.status === OrganizationMemberStatus.ACTIVE,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n },\n {\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [OrganizationMembers_Operations.REACTIVATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can reactivate members\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n reason: z.string().max(500).optional()\n }),\n // Implemented by the shared status-transition factory (SUSPENDED → ACTIVE, clearing any\n // pending `scheduledReactivationAt`). Legal only from SUSPENDED: reactivating an INVITED\n // row would skip acceptance and grant a membership nobody agreed to.\n enabledCondition: ({ currentObject }) =>\n currentObject.status === OrganizationMemberStatus.SUSPENDED,\n // MEDIUM sits below `AUTOMATIC_AUDIT_RISK_FLOOR`, so without this the RESTORE half of the\n // pair would go untrailed while SUSPEND (CRITICAL) is recorded — a trail showing every\n // suspension and none of the lifts, which reads as a member still suspended a year after\n // they were reinstated. The risk level answers \"how alarming is the affordance\"; this\n // answers \"is it evidence an auditor needs\", and for the inverse of a CRITICAL verb it is.\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE\n auditableEvent: { auditBelowRiskFloor: true },\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n },\n {\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n // REVOKE — inviter/admin cancels a still-`INVITED` membership. The exact\n // custom implementation DELETES the row and atomically revokes its accept\n // token. The paired PENDING_INVITATION user is retained here and reaped by\n // deferred hygiene only after it is old and still has no memberships:\n // point-operation cleanup cannot predicate-lock \"zero memberships\" against\n // a concurrent invitation insert under Mongo snapshot isolation. `reason`\n // is captured in the audit payload, not persisted on the deleted row.\n [OrganizationMembers_Operations.REVOKE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.DELETE,\n requestDto: z.object({\n reason: z.string().max(500).optional()\n }),\n tokenRevocation:\n ORGANIZATION_MEMBER_INVITATION_TOKEN_REVOCATION,\n // REVOKE has an exact API custom registration; `resourceOperationLike`\n // selects DELETE persistence/DTO semantics but does not inherit the\n // core DELETE custom implementation. Its real return is the delete\n // envelope, declared explicitly so output validation matches runtime.\n customResponseDto: DefaultDeleteResponseSchema,\n // Only a still-pending invite can be revoked — an ACTIVE member is removed\n // via DELETE, not \"revoked\". Gates the roster action (paired with the preset's\n // `WHEN_AVAILABLE`, the button shows only on INVITED rows) AND fail-closes the\n // backend (`services-registry-handler` throws SERVICE_RESOURCE_OPERATION_DISABLED\n // → 403 if invoked on a non-INVITED row).\n enabledCondition: ({ currentObject }) => currentObject.status === OrganizationMemberStatus.INVITED,\n },\n ],\n // Two emails (distinct templates, disambiguated by `customNotificationRef`):\n // • the INVITEE (`recipientEmailField: 'userEmail'`) — \"your invitation was revoked\";\n // • the ADMIN/initiator (`USER_SELF`) — confirmation of the action.\n // Both USER_SELF+EMAIL, so each MUST carry a unique `customNotificationRef`.\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n recipientEmailField: 'userEmail',\n customNotificationRef: 'invitee',\n },\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n customNotificationRef: 'admin',\n }\n ]\n },\n\n // RESEND — re-mint the accept token (revoking any prior one for this membership)\n // and re-send the invite email with the fresh accept link. Only valid while the\n // membership is `INVITED`.\n [OrganizationMembers_Operations.RESEND]: {\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 tokenGeneration: {\n tokenType: CoreConsumableTokenTypes.ORGANIZATION_MEMBER_INVITATION,\n consumptionMode: ConsumableToken_ConsumptionMode.SINGLE_USE,\n expiresIn: { value: 7, unit: DurationUnit.DAYS },\n relatedIdField: '_id',\n revokeExistingForSameRelated: true,\n emailLinkPath: '/invitation',\n condition: isPendingOrganizationMemberInvitation,\n },\n // Resend is meaningful only while the invite is pending. Same dual enforcement\n // as REVOKE: hides the roster action on non-INVITED rows and 403s server-side.\n enabledCondition: ({ currentObject }) => currentObject.status === OrganizationMemberStatus.INVITED,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n recipientEmailField: 'userEmail',\n condition: isPendingOrganizationMemberInvitation,\n }\n ]\n }\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"organization-members.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,uCAAuC,C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AAE,OAAO;iBAC/B;aACF;SACF;QAED,iFAAiF;QACjF,gFAAgF;QAChF,2BAA2B;QAC3B,CAAC,8BAA8B,CAAC,MAAM,CAAC,EAAE;YACvC,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,GAAG;oBACzC,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;oBACxB,eAAe,EAAE;wBACf,SAAS,EAAE,wBAAwB,CAAC,8BAA8B;wBAClE,eAAe,EAAE,+BAA+B,CAAC,UAAU;wBAC3D,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE;wBAChD,cAAc,EAAE,KAAK;wBACrB,4BAA4B,EAAE,IAAI;wBAClC,aAAa,EAAE,aAAa;wBAC5B,SAAS,EAAE,qCAAqC;qBACjD;oBACD,+EAA+E;oBAC/E,+EAA+E;oBAC/E,gBAAgB,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,KAAK,wBAAwB,CAAC,OAAO;iBACnG;aACF;YACD,iBAAiB,EAAE;gBACjB;oBACE,MAAM,EAAE,0BAA0B,CAAC,SAAS;oBAC5C,OAAO,EAAE,2BAA2B,CAAC,KAAK;oBAC1C,mBAAmB,EAAE,WAAW;oBAChC,SAAS,EAAE,qCAAqC;iBACjD;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Organization Members Shared Resource Configuration\n *\n * Resource configuration for organization member management.\n * Comprehensive member lifecycle and role management.\n */\n\nimport { z } from 'zod';\nimport {\n OrganizationMemberSchema,\n OrganizationMemberStatus,\n} from './organization-members.shared.schemas';\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourcePrimaryScope, ResourceRelationship, DefaultDeleteResponseSchema } 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';\nimport {\n CoreConsumableTokenTypes,\n ConsumableToken_ConsumptionMode,\n} from '../security/authentications/consumable-token.shared.schemas';\nimport type {\n TokenRevocationConfig,\n} from '../security/authentications/consumable-token.shared.schemas';\nimport { DurationUnit } from '@wildo-ai/zod-decorators';\n\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\n\n// Custom operations enum for organization members.\n// NOTE: cross-organization member transfer is intentionally NOT a framework\n// capability — moving a member between organizations is a tenant-boundary\n// crossing the framework does not sanction. Re-invite the identity in the\n// target organization instead.\n//\n// A membership row IS the invitation (there is no separate invitation resource):\n// - CREATE = invite (creates an `INVITED` row + mints the accept token).\n// - REVOKE = inviter/admin cancels a still-`INVITED` membership.\n// - RESEND = re-mint + re-send the accept token for an `INVITED` membership.\n// - SUSPEND/REACTIVATE = lifecycle of an ACTIVE/SUSPENDED member.\n// Invitee-side accept/reject is the tokenized `/auth/acceptInvitation` flow\n// (auth controller + `Auth_Invitation` screen), NOT a resource operation.\n//\n// ROLE CHANGES ARE `UPDATE`, NOT A DEDICATED VERB. `PROMOTE` / `DEMOTE` were declared here\n// as `ORG_ADMIN`-gated `riskLevel: HIGH` operations taking `{ newRole, reason }`, and were\n// removed on 2026-08-01: they were ROUTED but never implemented, so the request fell through\n// to the generic core UPDATE, which persists only fields the resource schema declares.\n// `newRole` is not one, so every call answered **HTTP 200 having changed nothing** — and the\n// dangerous direction is DEMOTE: an admin demotes a compromised account, is told 200 OK, and\n// the account keeps its privileges. Re-declaring an explicit role-change verb is legitimate,\n// but only WITH a custom implementation that writes `roles` and calls\n// `assertRequestedRolesWithinCallerCeiling` — a custom implementation is addressed by an EXACT\n// operation path, so it does NOT inherit the UPDATE variant's ceiling gate. Follow the\n// organization-units MOVE/ARCHIVE pattern (a `prefixCoreOperations` hook returning the field\n// patch the core UPDATE persists). See\n// `.claude/plans/routed-unimplemented-operations-fail-closed.md`.\n//\n// GRANT_OWNERSHIP is the ONE exception to \"role changes are UPDATE\", and it exists for a reason\n// UPDATE structurally cannot serve: it is the only operation on this resource a caller who is NOT a\n// member of the organization may perform. See its config entry below.\nexport enum OrganizationMembers_Operations {\n SUSPEND = 'suspend',\n REACTIVATE = 'reactivate',\n REVOKE = 'revoke',\n RESEND = 'resend',\n GRANT_OWNERSHIP = 'grantOwnership',\n}\n\n/**\n * One semantic definition for invalidating an organization invitation.\n *\n * REVOKE attaches it declaratively, so HTTP and trusted service callers enter\n * the same transactional revocation pipeline. Ordinary DELETE is\n * intentionally excluded: it removes a non-INVITED membership, which has no\n * invitation token to revoke.\n */\nexport const ORGANIZATION_MEMBER_INVITATION_TOKEN_REVOCATION = {\n tokenTypes: [\n CoreConsumableTokenTypes.ORGANIZATION_MEMBER_INVITATION,\n ],\n relatedIdField: '_id',\n} satisfies TokenRevocationConfig;\n\n/**\n * One predicate owns both invitation-token generation and invitation-email\n * dispatch. Keeping the two declarative side effects on the same named gate\n * prevents the polymorphic CREATE operation from drifting: an ACTIVE direct\n * add must produce neither an accept token nor an invitation email.\n */\nconst isPendingOrganizationMemberInvitation = ({\n currentObject,\n}: {\n currentObject: Record<string, unknown>;\n}): boolean =>\n currentObject.status === OrganizationMemberStatus.INVITED;\n\nconst ORGANIZATION_MEMBERS_SORT_FIELDS = ['status', 'role', 'joinedAt'];\n\nconst ORGANIZATION_MEMBERS_FILTER_FIELDS = {\n status: z.enum(OrganizationMemberStatus),\n role: z.string(),\n};\n\ntype OrganizationMembersCoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE\n | CoreResourceOperation.COUNT\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n | CoreResourceOperation.UPDATE_MANY;\n\n/*\nOrganization Members Resource Configuration Factory\n*/\nexport const organizationMembersResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof OrganizationMembers_Operations,\n OrganizationMembersCoreOperations,\n typeof OrganizationMemberSchema\n>({\n mainSchema: OrganizationMemberSchema,\n resourceIdentifier: CoreResourceType.ORGANIZATION_MEMBERS,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATION_MEMBERS],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n // create: invitation-accept was the historical opt-in; now the org-admin INVITE, SSO/SCIM\n // JIT, and org-auto-create-on-registration all create members in-process with explicit\n // `userId` + `organizationId` FKs on a request-context-less EC (stripped by the\n // client-shaped CREATE DTO, re-attached by `createAsSystem`).\n // read/list: the invitee's own pending-invitation inbox reads INVITED rows cross-org\n // BEFORE the invitee is a scoped member — authorized by `userId`-ownership at the\n // entry point (`listMyPendingInvitations`/`loadOwnedPendingInvitation`), not org role.\n // update: invitation ACCEPTANCE flips INVITED → ACTIVE in-process; the invitee is not an\n // org admin, so the status flip goes through the trusted system path.\n systemAccessPolicy: {\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n list: ResourceSystemAccessMode.ALLOWED,\n update: ResourceSystemAccessMode.ALLOWED,\n },\n\n /**\n * Subject-export disclosure. The subject's OWN membership rows (org, roles, title) — not other members' data.\n */\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n /**\n * Subject erasure RETAINS this row and scrubs the person's contact and professional details.\n *\n * The membership survives because it is the tenant's record of who belonged to it and under what\n * authority; what does not survive is `userEmail` and `userTitle`, the denormalized copies of the\n * person held here so a row can be read without resolving the user.\n *\n * `roles` is deliberately NOT scrubbed. It is this application's authorization vocabulary rather than\n * personal data — the field's own comment says so — and emptying it could leave a tenant with no\n * administrator, which the administrative-continuity floors would refuse, making an erasure fail closed\n * on a tenant. Keeping it means that interaction never arises.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,\n },\n\n /**\n * Erasing one of these rows revokes NO session. A membership is a record ABOUT a person's place in a\n * tenant, not the person — their session ends through the `USERS` row, which is `SELF_PRINCIPAL`.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n CoreResourceOperation.COUNT,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n\n customOperation: OrganizationMembers_Operations,\n\n operationsConfiguration: {\n\n /*\n\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n\n * verb the impersonalize writer uses to stamp the retention markers.\n\n */\n\n [CoreResourceOperation.UPDATE_MANY]: {\n\n variants: [{\n\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n\n isDefault: true,\n\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n\n }],\n\n },\n\n [CoreResourceOperation.COUNT]: {\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 // CREATE is POLYMORPHIC — two intents on one op:\n // • INVITE (BRANCH B): the org admin supplies `userEmail` (the strict identity\n // anchor); the CREATE prefix find-or-creates the `User` by it (`PENDING_INVITATION`\n // if new) and FORCES `status: INVITED`. A single-use accept token is minted AFTER the\n // row is created (relatedId = the membership `_id`, STABLE across `INVITED → ACTIVE`\n // so the emailed link never orphans); the pipeline injects it into the invite email and\n // the dispatcher builds the accept link (`emailLinkPath → /invitation?token=…`, consumed\n // by `/auth/acceptInvitation`). No `grantedRoles`: the accept handler reads the\n // membership's own `roles` when it flips the row to ACTIVE.\n // • DIRECT-ADD (BRANCH A): the caller supplies `userId` (founder org-owner grant,\n // SSO-JIT, SCIM) and the row persists `ACTIVE` — there is nothing to accept.\n // Token generation and notification dispatch share one named predicate.\n // The INVITE branch mints one accept token and sends one post-commit email;\n // the ACTIVE direct-add branch does neither.\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can invite members\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n // requestDto auto-derived from decorators (userEmail + roles +\n // organizationUnitsMembership + userTitle; userId/status/invitedByUserId/\n // invitedAt are server-injected via `.excludeFromCreate()`).\n tokenGeneration: {\n tokenType: CoreConsumableTokenTypes.ORGANIZATION_MEMBER_INVITATION,\n consumptionMode: ConsumableToken_ConsumptionMode.SINGLE_USE,\n expiresIn: { value: 7, unit: DurationUnit.DAYS },\n relatedIdField: '_id',\n emailLinkPath: '/invitation',\n // Mint the accept token for real invites only — never for an ACTIVE direct-add.\n condition: isPendingOrganizationMemberInvitation,\n },\n }\n ],\n // Deliver the invite email to the INVITEE (`userEmail`) via the\n // email-by-address path — the invitee may be a brand-new `PENDING_INVITATION`\n // user with no session. Carries the `acceptUrl` (`/invitation?token=…`) built\n // from the token minted above. `target: USER_SELF` is retained only so the\n // derived template ref stays `…create.user-self` and the accept link routes to\n // the main (non-admin) app.\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n recipientEmailField: 'userEmail',\n condition: isPendingOrganizationMemberInvitation,\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], // Org members can read member info\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], // Org members can list organization members\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n // `userEmail` is a denormalized, immutable own-field (mirror of the linked\n // user's email, captured at membership creation). First/last name are NOT\n // denormalized onto the member row — they live on `USER_PROFILES` and are\n // mutable there — so they are searched RELATIONALLY: the framework runs a\n // secondary match on `USER_PROFILES` (its own searchable fields) and folds\n // the matching `userId`s into an `$in` on this row's `userId`. The member\n // query stays org-scoped, so this is tenant-safe; names are never stale\n // because they are read live from the profile at search time. See\n // SearchableRelationDescriptor in resources-config.shared.schemas.ts.\n searchableFields: [\n 'userEmail',\n {\n localField: 'userId',\n relatedResource: CoreResourceType.USER_PROFILES,\n relatedJoinField: 'userId',\n fields: ['firstName', 'lastName'],\n },\n ],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: ORGANIZATION_MEMBERS_FILTER_FIELDS,\n sortFields: ORGANIZATION_MEMBERS_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 50,\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], // Org admins can update member details\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n // requestDto auto-derived from decorators\n //\n // Audited despite being below the HIGH/CRITICAL floor: since PROMOTE / DEMOTE were removed\n // (2026-08-01), **this operation IS the only org-member role-change path**, and a role\n // change is an access-control decision whatever the verb's risk level says. MEDIUM is the\n // right answer for the UI axis riskLevel primarily serves — updating a member's details\n // does not deserve a danger-zone affordance or a typed confirmation — but it is the wrong\n // answer for the evidence axis, and this flag is exactly that divergence.\n //\n // This also closes the follow-up left open by the routed-unimplemented-operations sweep:\n // `CoreAuditableEventType.ORGANIZATION_MEMBER_ROLE_CHANGED` is declared and classified but\n // emitted by nothing, so org-member role changes produced no trail at all. The generic\n // mechanism covers it — with `roles` marked as audit evidence, the row carries the before\n // and after sets — rather than adding a sixth hand-rolled emission.\n //\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE — evidence of privilege grant/revocation.\n auditableEvent: { auditBelowRiskFloor: true },\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\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], // Org admins can remove members\n riskLevel: ResourceOperationRiskLevel.HIGH,\n // Accepted/non-pending members use ordinary DELETE. A pending invite\n // is cancelled through REVOKE, which atomically revokes its accept\n // token. Keeping the vocabularies disjoint avoids making every\n // active-member removal token-coupled.\n enabledCondition: ({ currentObject }) =>\n currentObject.status !== OrganizationMemberStatus.INVITED,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n /**\n * The higher-tier repair door for the organization-owner floor — the second half of the\n * industry pattern described in `.claude/rules/administrative-continuity-floors.md`.\n *\n * ## Why this cannot be UPDATE\n *\n * The floor refuses to let the last `ORG_OWNER` be removed, demoted or deactivated. That is the\n * correct tenant-tier answer, but on its own it converts every mistake that DID strand a tenant\n * — a direct database edit, a restore from a mid-erasure backup, an acknowledged erasure under\n * GDPR Art. 17, a seed that authored no owner — into a permanent lockout, because\n * `validateParentScopeAccess` denies a non-member on ORGANIZATIONS scope and there is no\n * `APP_ADMIN_SUPER_ADMIN` bypass. Both denials are pinned in\n * `cross-tenant-super-admin-reach.mongo.integration.test.ts`. So no tenant member can grant the\n * role (they would need the authority they just lost) and no platform administrator can reach\n * the row at all. GitHub solves this with an Enterprise owner one tier up; this is that tier.\n *\n * ## Why it is a distinct verb rather than a flag on UPDATE\n *\n * `admitsCrossTenantPlatformAdministration` relaxes the SCOPE check for the variant that carries\n * it. Putting it on generic UPDATE would open every field of every membership row in every\n * tenant to a cross-tenant caller. The whole safety argument is that the opened surface is\n * exactly one field with one direction, so it is authored as its own operation whose custom\n * implementation ignores the payload for anything but the justification.\n *\n * ## Deliberate narrowness\n *\n * - **Promotes an EXISTING member** (Microsoft Loop's rule). It cannot mint a membership, so it\n * never creates an identity inside a tenant nobody owns.\n * - **Additive only.** It adds the owner-conferring role; it cannot remove roles, so it can\n * never be used to demote and is not a second path through the floor.\n * - **`justification` is required**, not optional. This is a break-glass action against a tenant\n * the operator is not a member of; the audit row is worth nothing without the why. `AC-2(7)`\n * asks for privileged assignment to be monitored — the trail IS the control here, since by\n * construction no authorization check downstream can second-guess the caller.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — restore administrability of a scope\n * that has no usable administrator.\n * assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE — evidence of privilege grant.\n */\n [OrganizationMembers_Operations.GRANT_OWNERSHIP]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n // Platform tier only. This is the role set the operation-roles gate checks INDEPENDENTLY\n // of the scope admission below: a caller holding this key at ORGANIZATIONS scope resolves\n // it against the organization role table, which does not contain it, and is denied there.\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // THE cross-tenant admission. Without it the operation is unreachable by the only\n // principal it exists for, because a platform administrator is by definition not a member\n // of the stranded tenant.\n admitsCrossTenantPlatformAdministration: true,\n requestDto: z.object({\n justification: z.string().min(1).max(1000),\n }),\n // No `auditableEvent` declaration: CRITICAL is inside `AUTOMATIC_AUDIT_RISK_FLOOR`, so the\n // event emits on the risk level alone and `auditBelowRiskFloor` would be inert here. The\n // before/after role sets ride along because `roles` carries `.isAuditEvidence()` — which is\n // what makes the trail answer the question that matters about this door: WHO was made an\n // owner of a tenant, by a caller who was not in it.\n },\n ],\n userNotifications: [\n {\n // The tenant learns that its ownership changed from outside. An operator repairing a\n // stranded tenant is legitimate; an operator quietly granting themselves an ally inside a\n // customer's tenant is not, and the difference is only visible to the tenant if it is told.\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\n },\n ],\n },\n\n [OrganizationMembers_Operations.SUSPEND]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can suspend members\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n suspensionReason: z.string().min(1).max(500),\n suspensionEndDate: z.date().optional()\n }),\n // Implemented by the shared status-transition factory (ACTIVE → SUSPENDED, carrying\n // `suspensionEndDate` onto the row's `scheduledReactivationAt`). SUSPEND is legal only\n // from ACTIVE: an INVITED row has not accepted yet — cancel it with REVOKE, which also\n // revokes the accept token — and an INACTIVE one is already out.\n enabledCondition: ({ currentObject }) =>\n currentObject.status === OrganizationMemberStatus.ACTIVE,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n },\n {\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [OrganizationMembers_Operations.REACTIVATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can reactivate members\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: z.object({\n reason: z.string().max(500).optional()\n }),\n // Implemented by the shared status-transition factory (SUSPENDED → ACTIVE, clearing any\n // pending `scheduledReactivationAt`). Legal only from SUSPENDED: reactivating an INVITED\n // row would skip acceptance and grant a membership nobody agreed to.\n enabledCondition: ({ currentObject }) =>\n currentObject.status === OrganizationMemberStatus.SUSPENDED,\n // MEDIUM sits below `AUTOMATIC_AUDIT_RISK_FLOOR`, so without this the RESTORE half of the\n // pair would go untrailed while SUSPEND (CRITICAL) is recorded — a trail showing every\n // suspension and none of the lifts, which reads as a member still suspended a year after\n // they were reinstated. The risk level answers \"how alarming is the affordance\"; this\n // answers \"is it evidence an auditor needs\", and for the inverse of a CRITICAL verb it is.\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE\n auditableEvent: { auditBelowRiskFloor: true },\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n },\n {\n target: CoreUserNotificationTarget.ORGANIZATION_USERS,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n // REVOKE — inviter/admin cancels a still-`INVITED` membership. The exact\n // custom implementation DELETES the row and atomically revokes its accept\n // token. The paired PENDING_INVITATION user is retained here and reaped by\n // deferred hygiene only after it is old and still has no memberships:\n // point-operation cleanup cannot predicate-lock \"zero memberships\" against\n // a concurrent invitation insert under Mongo snapshot isolation. `reason`\n // is captured in the audit payload, not persisted on the deleted row.\n [OrganizationMembers_Operations.REVOKE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.DELETE,\n requestDto: z.object({\n reason: z.string().max(500).optional()\n }),\n tokenRevocation:\n ORGANIZATION_MEMBER_INVITATION_TOKEN_REVOCATION,\n // REVOKE has an exact API custom registration; `resourceOperationLike`\n // selects DELETE persistence/DTO semantics but does not inherit the\n // core DELETE custom implementation. Its real return is the delete\n // envelope, declared explicitly so output validation matches runtime.\n customResponseDto: DefaultDeleteResponseSchema,\n // Only a still-pending invite can be revoked — an ACTIVE member is removed\n // via DELETE, not \"revoked\". Gates the roster action (paired with the preset's\n // `WHEN_AVAILABLE`, the button shows only on INVITED rows) AND fail-closes the\n // backend (`services-registry-handler` throws SERVICE_RESOURCE_OPERATION_DISABLED\n // → 403 if invoked on a non-INVITED row).\n enabledCondition: ({ currentObject }) => currentObject.status === OrganizationMemberStatus.INVITED,\n },\n ],\n // Two emails (distinct templates, disambiguated by `customNotificationRef`):\n // • the INVITEE (`recipientEmailField: 'userEmail'`) — \"your invitation was revoked\";\n // • the ADMIN/initiator (`USER_SELF`) — confirmation of the action.\n // Both USER_SELF+EMAIL, so each MUST carry a unique `customNotificationRef`.\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n recipientEmailField: 'userEmail',\n customNotificationRef: 'invitee',\n },\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n customNotificationRef: 'admin',\n }\n ]\n },\n\n // RESEND — re-mint the accept token (revoking any prior one for this membership)\n // and re-send the invite email with the fresh accept link. Only valid while the\n // membership is `INVITED`.\n [OrganizationMembers_Operations.RESEND]: {\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 tokenGeneration: {\n tokenType: CoreConsumableTokenTypes.ORGANIZATION_MEMBER_INVITATION,\n consumptionMode: ConsumableToken_ConsumptionMode.SINGLE_USE,\n expiresIn: { value: 7, unit: DurationUnit.DAYS },\n relatedIdField: '_id',\n revokeExistingForSameRelated: true,\n emailLinkPath: '/invitation',\n condition: isPendingOrganizationMemberInvitation,\n },\n // Resend is meaningful only while the invite is pending. Same dual enforcement\n // as REVOKE: hides the roster action on non-INVITED rows and 403s server-side.\n enabledCondition: ({ currentObject }) => currentObject.status === OrganizationMemberStatus.INVITED,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.EMAIL,\n recipientEmailField: 'userEmail',\n condition: isPendingOrganizationMemberInvitation,\n }\n ]\n }\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-members.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.schemas.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAkB,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"organization-members.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.schemas.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAkB,MAAM,iDAAiD,CAAC;AAQjG;;;;;;;;;;;;;;;;;;GAkBG;AACH,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;CACxB;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;kBAiLnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -8,6 +8,8 @@ import { CORE_ORG_ROLES, OrgRolesSchema } from '../security/authorizations/roles
|
|
|
8
8
|
import { forwardedLabel } from '../resources/resources.shared.schemas.js';
|
|
9
9
|
import { CoreResourceType } from '../resources/resources.shared.core.definitions.js';
|
|
10
10
|
import { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas.js';
|
|
11
|
+
import { RedactionType } from '../compliance/privacy/redaction.shared.schemas.js';
|
|
12
|
+
import { addImpersonalizeWith } from '@wildo-ai/zod-decorators';
|
|
11
13
|
/**
|
|
12
14
|
* Organization member lifecycle status.
|
|
13
15
|
*
|
|
@@ -72,8 +74,15 @@ export const OrganizationMemberSchema = z.object({
|
|
|
72
74
|
* auto-rendered display cards/columns (the user-facing email is surfaced by
|
|
73
75
|
* resolving the `userId` reference) — it still renders on the CREATE form.
|
|
74
76
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
// REMOVE on erasure. A denormalized copy of the person's email, held here so a membership row can be
|
|
78
|
+
// read without resolving the user — which is exactly what makes it personal data this row HOLDS rather
|
|
79
|
+
// than a link it carries. Clearable (`.optional()`), so REMOVE resolves to a removed key.
|
|
80
|
+
//
|
|
81
|
+
// `roles` beside it is deliberately NOT scrubbed: it is this application's authorization vocabulary,
|
|
82
|
+
// not personal data, and emptying it could strand a tenant with no administrator — the interaction the
|
|
83
|
+
// administrative-continuity floors exist to refuse. Keeping it means that interaction never arises.
|
|
84
|
+
userEmail: addImpersonalizeWith(z.email().optional().isDBIndexed().isSummaryField().isHidden({ display: true }).excludeFromUpdate()
|
|
85
|
+
.dataCategories(PersonalDataCategory.CONTACT_DETAILS), RedactionType.REMOVE),
|
|
77
86
|
organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),
|
|
78
87
|
/*
|
|
79
88
|
* `organizationUnitsMembership` (an embedded `[{ organizationUnitId, role }]` array) was REMOVED
|
|
@@ -149,8 +158,10 @@ export const OrganizationMemberSchema = z.object({
|
|
|
149
158
|
scheduledReactivationAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),
|
|
150
159
|
// The person's role in the customer's organization — their working life, not this application's
|
|
151
160
|
// authorization model (`roles` is that, and it is a closed vocabulary rather than personal data).
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
// REMOVE on erasure — the person's role in the customer's organization is a fact about their working
|
|
162
|
+
// life, which is why it carries PROFESSIONAL. Clearable (`.optional()`).
|
|
163
|
+
userTitle: addImpersonalizeWith(z.string().max(100).optional().isDBIndexed().isSummaryField()
|
|
164
|
+
.dataCategories(PersonalDataCategory.PROFESSIONAL), RedactionType.REMOVE),
|
|
154
165
|
/**
|
|
155
166
|
* The `User._id` of the org admin who issued the invite. Server-set by the invite
|
|
156
167
|
* CREATE prefix from the execution-context actor; absent on direct/system
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-members.shared.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.schemas.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OA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CAAC;QAC5B,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,gBAAgB,CAAC,aAAa;QAC/C,gBAAgB,EAAE,QAAQ;QAC1B,MAAM,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC;QACjC,aAAa,EAAE,WAAW;KAC3B,CAAC;IACF,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IAC9G,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CAC/G,CAAC,CAAC,cAAc,CAAC;IAChB,QAAQ;IACR,gBAAgB;CACjB,CAAC,CAAC","sourcesContent":["\n/**\n * Organization Member Shared Schemas\n * \n * Junction entity between users and organizations with roles and permissions\n */\n\nimport { z } from 'zod';\n\nimport { CORE_ORG_ROLES, OrgRolesSchema } from '../security/authorizations/roles.shared.schemas';\nimport { forwardedLabel } from '../resources/resources.shared.schemas';\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\n\n\n/**\n * Organization member lifecycle status.\n *\n * A membership row IS the invitation — there is no separate invitation\n * collection. `INVITED` is the pending-membership state; acceptance flips it to\n * `ACTIVE` on the SAME row (stable `_id`, so the emailed accept-link token never\n * orphans). SSO JIT / SCIM provisioning find-or-activate an existing `INVITED`\n * row rather than blind-creating a second `ACTIVE` one.\n *\n * - `INVITED` — membership extended, invitee has not yet accepted. Paired with a\n * `User` in `PENDING_INVITATION` status when the invitee has no account yet.\n * - `ACTIVE` — accepted / directly provisioned membership.\n * - `INACTIVE` — deactivated (e.g. SCIM deprovision).\n * - `SUSPENDED` — temporarily suspended (optionally time-boxed).\n *\n * Invite OUTCOMES (declined / revoked / expired) are NOT statuses — the row is\n * deleted and the event recorded in the audit trail (keeps this enum about\n * membership, not invitation bookkeeping).\n */\nexport enum OrganizationMemberStatus {\n INVITED = 'INVITED',\n ACTIVE = 'ACTIVE',\n INACTIVE = 'INACTIVE',\n SUSPENDED = 'SUSPENDED'\n}\n\nexport const OrganizationMemberSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n /**\n * FK to the member `User`. ALWAYS present on a persisted row (a membership with\n * no member is meaningless) — even an `INVITED` invitee has an eagerly-created\n * `User` in `PENDING_INVITATION` status, so this FK is never null.\n *\n * SERVER-INJECTED on create (`.excludeFromCreate()`), via one of two paths:\n * - Invite (org-admin CREATE): the admin supplies {@link userEmail} instead;\n * the CREATE prefix find-or-creates the user by normalized email and injects\n * the resolved `_id` here (email is the strict unique identity anchor — see\n * `User.email.isUnique()`).\n * - System provisioning (invite-acceptance / SSO JIT / SCIM): passes `userId`\n * directly through `createAsSystem`, which re-attaches this context FK past\n * the strict-DTO strip.\n * `.excludeFromUpdate()` keeps the member↔user binding immutable.\n */\n userId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n /**\n * The linked user's email — DUAL ROLE:\n *\n * 1. INVITE CREATE INPUT. On the org-admin invite CREATE the admin supplies\n * an email (not a `userId`); the CREATE prefix normalizes it, find-or-creates\n * the `User` by it (unique identity anchor), and derives {@link userId}. This\n * is why the field is client-writable on CREATE (no `.excludeFromCreate()`).\n * 2. DENORMALIZED IMMUTABLE COPY. After creation it is the immutable mirror of\n * `USERS.email` (which is `.excludeFromUpdate()`, so this copy never drifts).\n * It feeds member SEARCH (`searchableFields: ['userEmail']` — no async hop)\n * and the {@link instanceLabel} fallback when the related profile/name is\n * unavailable (e.g. a `PENDING_INVITATION` invitee has no `USER_PROFILE` yet).\n *\n * For system creates (SSO/SCIM/acceptance) that pass `userId` instead of an\n * email, the CREATE prefix DERIVES this value from the authoritative user record,\n * so it is `.optional()` at the input boundary. `.excludeFromUpdate()` keeps it\n * immutable post-creation. `.isHidden({ display: true })` keeps it out of\n * auto-rendered display cards/columns (the user-facing email is surfaced by\n * resolving the `userId` reference) — it still renders on the CREATE form.\n */\n userEmail: z.email().optional().isDBIndexed().isSummaryField().isHidden({ display: true }).excludeFromUpdate()\n .dataCategories(PersonalDataCategory.CONTACT_DETAILS),\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n /*\n * `organizationUnitsMembership` (an embedded `[{ organizationUnitId, role }]` array) was REMOVED\n * here on 2026-07-31 and promoted to the `ORGANIZATION_UNIT_MEMBERS` junction resource\n * (plan decision D-B5). The array could not be queried portably — a dot-path filter into an\n * array field resolves to NULL on PostgreSQL and the LIST summary projection strips the field —\n * so every \"who is assigned to this unit?\" question failed OPEN, it could not carry a registered\n * relationship (no cascade), and it admitted two conflicting roles for the same unit. Read unit\n * assignments through `ORGANIZATION_UNIT_MEMBERS` filtered by `organizationMemberId`.\n */\n // `.isAuditEvidence()` — this member's authority INSIDE the organization. Roles are the\n // framework's single authorization axis, so a change here is an access-control decision and the\n // before/after sets ARE the evidence: a trail that records only \"roles changed\" proves nothing\n // about what authority resulted. Safe to record in full — a role name is vocabulary, not personal\n // data, so it carries no erasure obligation into the immutable audit ledger.\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE\n roles: z.array(OrgRolesSchema).default([CORE_ORG_ROLES.ORG_MEMBER]).isDBIndexed().isSummaryField().isAuditEvidence(),\n /**\n * Server-owned lifecycle state. Default `ACTIVE` covers direct/system\n * provisioning (SSO JIT / SCIM / self-registration org-owner grant), while\n * the org-admin invite CREATE prefix forces `INVITED`.\n *\n * Neither CREATE nor generic UPDATE may accept this field from a client:\n * lifecycle transitions carry security side effects that a field update\n * cannot reproduce. In particular, invitation acceptance must validate and\n * consume the invitation token, grant the derived user type, and serialize\n * against revocation; suspension/reactivation likewise have dedicated\n * operations. Keeping status out of both DTOs makes those trusted transition\n * operations the only way to change it.\n */\n status: z.enum(OrganizationMemberStatus)\n .default(OrganizationMemberStatus.ACTIVE)\n .isDBIndexed()\n .isSummaryField()\n .excludeFromCreate()\n .excludeFromUpdate()\n // Lifecycle state gates access as surely as roles do — a SUSPENDED member is denied, an ACTIVE\n // one is not — so a suspension or reactivation is an authorization event and its before/after\n // values are the evidence. The enum's values are closed vocabulary, never personal data, so\n // recording them carries no GDPR Art. 17 obligation into the immutable ledger — the same\n // reasoning `UserSchema.status` records. Without this the framework's\n // `RESOURCE_OPERATION_PERFORMED` event notes only that `status` was among the changed fields,\n // never what it changed FROM or TO, which is the half an access review actually reads.\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE\n .isAuditEvidence(),\n /**\n * When an automated sweep must return this membership to `ACTIVE`.\n *\n * Set by SUSPEND when the caller time-boxes the suspension (`suspensionEndDate` in that verb's\n * request contract), cleared by REACTIVATE. Absent means the suspension is indefinite and only a\n * deliberate REACTIVATE lifts it — which is the default, since an unbounded suspension is the\n * safer reading of \"suspend\".\n *\n * NAMED FOR THE EFFECT, NOT THE CAUSE. `scheduledReactivationAt` says what the system will do;\n * a `suspensionEndsAt` would describe only the suspension branch while the identical field on\n * `USERS` also serves self-service deactivation. One concept, one name across both resources,\n * so the reactivation sweep reads the same field everywhere. The request contracts keep their\n * own caller-facing vocabulary and the transition hook translates — the same split\n * `ORGANIZATION_UNITS` MOVE uses (`newParentUnitId` in, `parentUnitId` + `path` persisted).\n *\n * Server-owned on both sides (`.excludeFromCreate().excludeFromUpdate()`): only the transition\n * operations write it, exactly as for {@link status} above. Indexed because the sweep's whole\n * query is \"rows whose scheduled reactivation has passed\".\n *\n * ⚠️ A value here is a PROMISE the framework keeps: the reactivation batch is what makes it\n * true. Persisting the date without that sweep would be the same defect as a verb that answers\n * success and writes nothing — an authored intention nothing honors.\n */\n // Deliberately NOT `.isAuditEvidence()`. The rationale that briefly sat here — \"lifecycle state\n // gates access as surely as roles do\" — is true of {@link status}, which is where it now lives.\n // This field decides nothing about what the principal may do; it is a scheduling detail, and the\n // transition's audit row already records the resulting status.\n scheduledReactivationAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n // The person's role in the customer's organization — their working life, not this application's\n // authorization model (`roles` is that, and it is a closed vocabulary rather than personal data).\n userTitle: z.string().max(100).optional().isDBIndexed().isSummaryField()\n .dataCategories(PersonalDataCategory.PROFESSIONAL),\n /**\n * The `User._id` of the org admin who issued the invite. Server-set by the invite\n * CREATE prefix from the execution-context actor; absent on direct/system\n * provisioning. Immutable. Feeds the audit trail and the user-facing \"invited by\"\n * cue in the pending-invitations inbox.\n *\n * PROVENANCE STAMP, NOT a navigable FK — deliberately a plain indexed string (same\n * idiom as `scim-tokens.createdByUserId`), NOT `.isForeignKey()`. The primary\n * member↔user link is `userId` (registered M2M relationship); adding `.isForeignKey()`\n * here would demand a SECOND `ORGANIZATION_MEMBERS → USERS` relationship (else the\n * registry warns \"cannot be resolved to a resource type\") and would graft nested-route /\n * parent-scope machinery onto a field that only records who clicked \"invite\". Resolve\n * the inviter's display name with a bounded lookup at render time if the cue needs it.\n */\n invitedByUserId: z.string().min(1).optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n /**\n * When the invite was issued. Server-set by the invite CREATE prefix; absent on\n * direct/system provisioning. Immutable. Used by the inbox ordering and the\n * expiry-reap CRON batch.\n */\n invitedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n /**\n * Computed instance label — the linked user's name, forwarded live from\n * `USER_PROFILES`. A junction row has no inherent name; its identity is the\n * related party. {@link forwardedLabel} resolves it SERVER-SIDE at read time\n * (joining `userId` → `USER_PROFILES.userId`, rendering `firstName lastName`)\n * and projects it onto the summary/read DTO via the virtual-field pipeline, so\n * the frontend label is a plain field ref (`getFrontendResourceLabel:\n * ['instanceLabel']`). Never stale (read live), never denormalized, tenant-safe\n * (a bounded system read over the userIds already on the org-scoped page). NOT\n * persisted (virtual). When the profile/name is unavailable it falls back to the\n * immutable {@link userEmail} (`fallbackField`) rather than a raw id.\n */\n instanceLabel: forwardedLabel({\n localField: 'userId',\n relatedResource: CoreResourceType.USER_PROFILES,\n relatedJoinField: 'userId',\n fields: ['firstName', 'lastName'],\n fallbackField: 'userEmail',\n }),\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 'userId',\n 'organizationId',\n]);\nexport type OrganizationMember = z.infer<typeof OrganizationMemberSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"organization-members.shared.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.schemas.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,6CAAiB,CAAA;IACjB,iDAAqB,CAAA;IACrB,mDAAuB,CAAA;AACzB,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,GAAG,EAAE,CAAC,C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AC;IACF,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IAC9G,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CAC/G,CAAC,CAAC,cAAc,CAAC;IAChB,QAAQ;IACR,gBAAgB;CACjB,CAAC,CAAC","sourcesContent":["\n/**\n * Organization Member Shared Schemas\n * \n * Junction entity between users and organizations with roles and permissions\n */\n\nimport { z } from 'zod';\n\nimport { CORE_ORG_ROLES, OrgRolesSchema } from '../security/authorizations/roles.shared.schemas';\nimport { forwardedLabel } from '../resources/resources.shared.schemas';\nimport { CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport { addImpersonalizeWith } from '@wildo-ai/zod-decorators';\n\n\n/**\n * Organization member lifecycle status.\n *\n * A membership row IS the invitation — there is no separate invitation\n * collection. `INVITED` is the pending-membership state; acceptance flips it to\n * `ACTIVE` on the SAME row (stable `_id`, so the emailed accept-link token never\n * orphans). SSO JIT / SCIM provisioning find-or-activate an existing `INVITED`\n * row rather than blind-creating a second `ACTIVE` one.\n *\n * - `INVITED` — membership extended, invitee has not yet accepted. Paired with a\n * `User` in `PENDING_INVITATION` status when the invitee has no account yet.\n * - `ACTIVE` — accepted / directly provisioned membership.\n * - `INACTIVE` — deactivated (e.g. SCIM deprovision).\n * - `SUSPENDED` — temporarily suspended (optionally time-boxed).\n *\n * Invite OUTCOMES (declined / revoked / expired) are NOT statuses — the row is\n * deleted and the event recorded in the audit trail (keeps this enum about\n * membership, not invitation bookkeeping).\n */\nexport enum OrganizationMemberStatus {\n INVITED = 'INVITED',\n ACTIVE = 'ACTIVE',\n INACTIVE = 'INACTIVE',\n SUSPENDED = 'SUSPENDED'\n}\n\nexport const OrganizationMemberSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n /**\n * FK to the member `User`. ALWAYS present on a persisted row (a membership with\n * no member is meaningless) — even an `INVITED` invitee has an eagerly-created\n * `User` in `PENDING_INVITATION` status, so this FK is never null.\n *\n * SERVER-INJECTED on create (`.excludeFromCreate()`), via one of two paths:\n * - Invite (org-admin CREATE): the admin supplies {@link userEmail} instead;\n * the CREATE prefix find-or-creates the user by normalized email and injects\n * the resolved `_id` here (email is the strict unique identity anchor — see\n * `User.email.isUnique()`).\n * - System provisioning (invite-acceptance / SSO JIT / SCIM): passes `userId`\n * directly through `createAsSystem`, which re-attaches this context FK past\n * the strict-DTO strip.\n * `.excludeFromUpdate()` keeps the member↔user binding immutable.\n */\n userId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n /**\n * The linked user's email — DUAL ROLE:\n *\n * 1. INVITE CREATE INPUT. On the org-admin invite CREATE the admin supplies\n * an email (not a `userId`); the CREATE prefix normalizes it, find-or-creates\n * the `User` by it (unique identity anchor), and derives {@link userId}. This\n * is why the field is client-writable on CREATE (no `.excludeFromCreate()`).\n * 2. DENORMALIZED IMMUTABLE COPY. After creation it is the immutable mirror of\n * `USERS.email` (which is `.excludeFromUpdate()`, so this copy never drifts).\n * It feeds member SEARCH (`searchableFields: ['userEmail']` — no async hop)\n * and the {@link instanceLabel} fallback when the related profile/name is\n * unavailable (e.g. a `PENDING_INVITATION` invitee has no `USER_PROFILE` yet).\n *\n * For system creates (SSO/SCIM/acceptance) that pass `userId` instead of an\n * email, the CREATE prefix DERIVES this value from the authoritative user record,\n * so it is `.optional()` at the input boundary. `.excludeFromUpdate()` keeps it\n * immutable post-creation. `.isHidden({ display: true })` keeps it out of\n * auto-rendered display cards/columns (the user-facing email is surfaced by\n * resolving the `userId` reference) — it still renders on the CREATE form.\n */\n // REMOVE on erasure. A denormalized copy of the person's email, held here so a membership row can be\n // read without resolving the user — which is exactly what makes it personal data this row HOLDS rather\n // than a link it carries. Clearable (`.optional()`), so REMOVE resolves to a removed key.\n //\n // `roles` beside it is deliberately NOT scrubbed: it is this application's authorization vocabulary,\n // not personal data, and emptying it could strand a tenant with no administrator — the interaction the\n // administrative-continuity floors exist to refuse. Keeping it means that interaction never arises.\n userEmail: addImpersonalizeWith(\n z.email().optional().isDBIndexed().isSummaryField().isHidden({ display: true }).excludeFromUpdate()\n .dataCategories(PersonalDataCategory.CONTACT_DETAILS),\n RedactionType.REMOVE,\n ),\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n /*\n * `organizationUnitsMembership` (an embedded `[{ organizationUnitId, role }]` array) was REMOVED\n * here on 2026-07-31 and promoted to the `ORGANIZATION_UNIT_MEMBERS` junction resource\n * (plan decision D-B5). The array could not be queried portably — a dot-path filter into an\n * array field resolves to NULL on PostgreSQL and the LIST summary projection strips the field —\n * so every \"who is assigned to this unit?\" question failed OPEN, it could not carry a registered\n * relationship (no cascade), and it admitted two conflicting roles for the same unit. Read unit\n * assignments through `ORGANIZATION_UNIT_MEMBERS` filtered by `organizationMemberId`.\n */\n // `.isAuditEvidence()` — this member's authority INSIDE the organization. Roles are the\n // framework's single authorization axis, so a change here is an access-control decision and the\n // before/after sets ARE the evidence: a trail that records only \"roles changed\" proves nothing\n // about what authority resulted. Safe to record in full — a role name is vocabulary, not personal\n // data, so it carries no erasure obligation into the immutable audit ledger.\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE\n roles: z.array(OrgRolesSchema).default([CORE_ORG_ROLES.ORG_MEMBER]).isDBIndexed().isSummaryField().isAuditEvidence(),\n /**\n * Server-owned lifecycle state. Default `ACTIVE` covers direct/system\n * provisioning (SSO JIT / SCIM / self-registration org-owner grant), while\n * the org-admin invite CREATE prefix forces `INVITED`.\n *\n * Neither CREATE nor generic UPDATE may accept this field from a client:\n * lifecycle transitions carry security side effects that a field update\n * cannot reproduce. In particular, invitation acceptance must validate and\n * consume the invitation token, grant the derived user type, and serialize\n * against revocation; suspension/reactivation likewise have dedicated\n * operations. Keeping status out of both DTOs makes those trusted transition\n * operations the only way to change it.\n */\n status: z.enum(OrganizationMemberStatus)\n .default(OrganizationMemberStatus.ACTIVE)\n .isDBIndexed()\n .isSummaryField()\n .excludeFromCreate()\n .excludeFromUpdate()\n // Lifecycle state gates access as surely as roles do — a SUSPENDED member is denied, an ACTIVE\n // one is not — so a suspension or reactivation is an authorization event and its before/after\n // values are the evidence. The enum's values are closed vocabulary, never personal data, so\n // recording them carries no GDPR Art. 17 obligation into the immutable ledger — the same\n // reasoning `UserSchema.status` records. Without this the framework's\n // `RESOURCE_OPERATION_PERFORMED` event notes only that `status` was among the changed fields,\n // never what it changed FROM or TO, which is the half an access review actually reads.\n // assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE\n .isAuditEvidence(),\n /**\n * When an automated sweep must return this membership to `ACTIVE`.\n *\n * Set by SUSPEND when the caller time-boxes the suspension (`suspensionEndDate` in that verb's\n * request contract), cleared by REACTIVATE. Absent means the suspension is indefinite and only a\n * deliberate REACTIVATE lifts it — which is the default, since an unbounded suspension is the\n * safer reading of \"suspend\".\n *\n * NAMED FOR THE EFFECT, NOT THE CAUSE. `scheduledReactivationAt` says what the system will do;\n * a `suspensionEndsAt` would describe only the suspension branch while the identical field on\n * `USERS` also serves self-service deactivation. One concept, one name across both resources,\n * so the reactivation sweep reads the same field everywhere. The request contracts keep their\n * own caller-facing vocabulary and the transition hook translates — the same split\n * `ORGANIZATION_UNITS` MOVE uses (`newParentUnitId` in, `parentUnitId` + `path` persisted).\n *\n * Server-owned on both sides (`.excludeFromCreate().excludeFromUpdate()`): only the transition\n * operations write it, exactly as for {@link status} above. Indexed because the sweep's whole\n * query is \"rows whose scheduled reactivation has passed\".\n *\n * ⚠️ A value here is a PROMISE the framework keeps: the reactivation batch is what makes it\n * true. Persisting the date without that sweep would be the same defect as a verb that answers\n * success and writes nothing — an authored intention nothing honors.\n */\n // Deliberately NOT `.isAuditEvidence()`. The rationale that briefly sat here — \"lifecycle state\n // gates access as surely as roles do\" — is true of {@link status}, which is where it now lives.\n // This field decides nothing about what the principal may do; it is a scheduling detail, and the\n // transition's audit row already records the resulting status.\n scheduledReactivationAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n // The person's role in the customer's organization — their working life, not this application's\n // authorization model (`roles` is that, and it is a closed vocabulary rather than personal data).\n // REMOVE on erasure — the person's role in the customer's organization is a fact about their working\n // life, which is why it carries PROFESSIONAL. Clearable (`.optional()`).\n userTitle: addImpersonalizeWith(\n z.string().max(100).optional().isDBIndexed().isSummaryField()\n .dataCategories(PersonalDataCategory.PROFESSIONAL),\n RedactionType.REMOVE,\n ),\n /**\n * The `User._id` of the org admin who issued the invite. Server-set by the invite\n * CREATE prefix from the execution-context actor; absent on direct/system\n * provisioning. Immutable. Feeds the audit trail and the user-facing \"invited by\"\n * cue in the pending-invitations inbox.\n *\n * PROVENANCE STAMP, NOT a navigable FK — deliberately a plain indexed string (same\n * idiom as `scim-tokens.createdByUserId`), NOT `.isForeignKey()`. The primary\n * member↔user link is `userId` (registered M2M relationship); adding `.isForeignKey()`\n * here would demand a SECOND `ORGANIZATION_MEMBERS → USERS` relationship (else the\n * registry warns \"cannot be resolved to a resource type\") and would graft nested-route /\n * parent-scope machinery onto a field that only records who clicked \"invite\". Resolve\n * the inviter's display name with a bounded lookup at render time if the cue needs it.\n */\n invitedByUserId: z.string().min(1).optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n /**\n * When the invite was issued. Server-set by the invite CREATE prefix; absent on\n * direct/system provisioning. Immutable. Used by the inbox ordering and the\n * expiry-reap CRON batch.\n */\n invitedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n /**\n * Computed instance label — the linked user's name, forwarded live from\n * `USER_PROFILES`. A junction row has no inherent name; its identity is the\n * related party. {@link forwardedLabel} resolves it SERVER-SIDE at read time\n * (joining `userId` → `USER_PROFILES.userId`, rendering `firstName lastName`)\n * and projects it onto the summary/read DTO via the virtual-field pipeline, so\n * the frontend label is a plain field ref (`getFrontendResourceLabel:\n * ['instanceLabel']`). Never stale (read live), never denormalized, tenant-safe\n * (a bounded system read over the userIds already on the org-scoped page). NOT\n * persisted (virtual). When the profile/name is unavailable it falls back to the\n * immutable {@link userEmail} (`fallbackField`) rather than a raw id.\n */\n instanceLabel: forwardedLabel({\n localField: 'userId',\n relatedResource: CoreResourceType.USER_PROFILES,\n relatedJoinField: 'userId',\n fields: ['firstName', 'lastName'],\n fallbackField: 'userEmail',\n }),\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 'userId',\n 'organizationId',\n]);\nexport type OrganizationMember = z.infer<typeof OrganizationMemberSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-notifications.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/organizations/organization-notifications.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"organization-notifications.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/organizations/organization-notifications.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;iBAiC/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;iBAoB1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
|
|
@@ -15,12 +15,33 @@ import { z } from 'zod';
|
|
|
15
15
|
* `Schema.default(Schema.parse({}))` idiom — see the `emailNotifications` field.
|
|
16
16
|
*/
|
|
17
17
|
export const OrganizationEmailNotificationsSchema = z.object({
|
|
18
|
+
/**
|
|
19
|
+
* Where a tenant's organization-flavoured email goes, and whether it goes at all. READ by the
|
|
20
|
+
* notification dispatcher since 2026-09-08 (#410).
|
|
21
|
+
*
|
|
22
|
+
* It was read by NOTHING before that. The record was seeded by apps-manager at provisioning,
|
|
23
|
+
* rendered and edited through the organizations preset and audited, while organization-targeted
|
|
24
|
+
* notifications resolved to member user ids by role and went to each member's own address — so a
|
|
25
|
+
* tenant that filled this screen in changed nothing.
|
|
26
|
+
*
|
|
27
|
+
* The category a notification belongs to is DERIVED from its target: the notification-target
|
|
28
|
+
* vocabulary and these four categories line up one-for-one, so a per-notification declaration
|
|
29
|
+
* would only be a place for the two to disagree. `ORGANIZATION_USERS` is deliberately outside the
|
|
30
|
+
* mapping — it fans out to every member by design, and routing it to one address would change who
|
|
31
|
+
* the message is FOR rather than where it lands.
|
|
32
|
+
*
|
|
33
|
+
* An address REPLACES the member fan-out rather than adding to it: a tenant routing security mail
|
|
34
|
+
* to a SOC address is saying where it goes, not asking for a copy.
|
|
35
|
+
*/
|
|
18
36
|
defaultEmailAddress: z.email().optional().isSummaryField(),
|
|
19
37
|
billingAddress: z.email().optional(),
|
|
20
38
|
securityAddress: z.email().optional(),
|
|
21
39
|
administrativeAddress: z.email().optional(),
|
|
22
40
|
usersManagementAddress: z.email().optional(),
|
|
23
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Category opt-ins. A `false` SUPPRESSES that category entirely — for the members too, not only
|
|
43
|
+
* for the routing address — because a tenant turning billing notifications off means it.
|
|
44
|
+
*/
|
|
24
45
|
billing: z.boolean().default(true),
|
|
25
46
|
administrative: z.boolean().default(true),
|
|
26
47
|
security: z.boolean().default(true),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-notifications.shared.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-notifications.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,mBAAmB,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE;IAC1D,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACpC,eAAe,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IACrC,qBAAqB,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC3C,sBAAsB,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAE5C
|
|
1
|
+
{"version":3,"file":"organization-notifications.shared.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-notifications.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE;IAC1D,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,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,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 Notifications Shared Schemas\n * \n * Notification preferences and settings.\n * Separated from core organization for performance optimization.\n */\n\nimport { z } from 'zod';\n\n/**\n * Per-category notification routing block for an organization.\n *\n * Every interior field is optional (the routing addresses) or carries a\n * `.default(...)` (the category opt-in booleans), so the object is fully\n * materializable from `{}`. Extracted as a named schema so\n * {@link OrganizationNotificationsSchema} can default it via the Zod-4-safe\n * `Schema.default(Schema.parse({}))` idiom — see the `emailNotifications` field.\n */\nexport const OrganizationEmailNotificationsSchema = z.object({\n /**\n * Where a tenant's organization-flavoured email goes, and whether it goes at all. READ by the\n * notification dispatcher since 2026-09-08 (#410).\n *\n * It was read by NOTHING before that. The record was seeded by apps-manager at provisioning,\n * rendered and edited through the organizations preset and audited, while organization-targeted\n * notifications resolved to member user ids by role and went to each member's own address — so a\n * tenant that filled this screen in changed nothing.\n *\n * The category a notification belongs to is DERIVED from its target: the notification-target\n * vocabulary and these four categories line up one-for-one, so a per-notification declaration\n * would only be a place for the two to disagree. `ORGANIZATION_USERS` is deliberately outside the\n * mapping — it fans out to every member by design, and routing it to one address would change who\n * the message is FOR rather than where it lands.\n *\n * An address REPLACES the member fan-out rather than adding to it: a tenant routing security mail\n * to a SOC address is saying where it goes, not asking for a copy.\n */\n defaultEmailAddress: z.email().optional().isSummaryField(),\n billingAddress: z.email().optional(),\n securityAddress: z.email().optional(),\n administrativeAddress: z.email().optional(),\n usersManagementAddress: z.email().optional(),\n\n /**\n * Category opt-ins. A `false` SUPPRESSES that category entirely — for the members too, not only\n * for the routing address — because a tenant turning billing notifications off means it.\n */\n billing: z.boolean().default(true),\n administrative: z.boolean().default(true),\n security: z.boolean().default(true),\n usersManagement: z.boolean().default(true),\n});\nexport type OrganizationEmailNotifications = z.infer<typeof OrganizationEmailNotificationsSchema>;\n\nexport const OrganizationNotificationsSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n // `.isUnique()` = idempotency backstop for onParentCreate seeding: the eager\n // `createAsSystem` seed on ORGANIZATIONS create writes one notifications row per\n // org; the unique index makes a re-fire (retry / replay) fail-closed instead of\n // duplicating.\n organizationId: z.string().min(1).isDBIndexed().isUnique().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n // Email notification preferences. `.default(OrganizationEmailNotificationsSchema.parse({}))`\n // makes the block materialize to its interior defaults when omitted, so the\n // resource is default-seedable from its CREATE DTO + parent FK alone (required\n // by the onParentCreate lifecycle guard). The output type keeps the block\n // required, so downstream readers are unaffected.\n emailNotifications: OrganizationEmailNotificationsSchema\n .default(OrganizationEmailNotificationsSchema.parse({}))\n .isSummaryField(),\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 OrganizationNotifications = z.infer<typeof OrganizationNotificationsSchema>;\n\n"]}
|