@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,14 +1,35 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { IndicatorVariant } from '@wildo-ai/presets-components-models';
|
|
3
3
|
import { ResourcePrimaryScope } from "../resources/resources.shared.schemas";
|
|
4
|
+
/**
|
|
5
|
+
* The one character that separates the parts of a badge KEY and a badge REFERENCE.
|
|
6
|
+
*
|
|
7
|
+
* Both formats are positional, so the separator may not appear inside a part or the parse is
|
|
8
|
+
* ambiguous. `NotificationBadgeIdentifierSchema` refuses it in an identifier for exactly that
|
|
9
|
+
* reason, and `collectNotificationBadgeDeclarationViolations` re-states the refusal at boot,
|
|
10
|
+
* because a declaration object is authored in TypeScript and never `.parse()`d.
|
|
11
|
+
*/
|
|
12
|
+
export declare const NOTIFICATION_BADGE_KEY_SEPARATOR = ":";
|
|
13
|
+
/** Any string that does not contain {@link NOTIFICATION_BADGE_KEY_SEPARATOR}. */
|
|
14
|
+
export declare const NOTIFICATION_BADGE_IDENTIFIER_PATTERN: RegExp;
|
|
4
15
|
/**
|
|
5
16
|
* Notification badge identifier.
|
|
6
17
|
*
|
|
7
|
-
*
|
|
8
|
-
* (`new messages` / `unpaid invoices`) were removed because nothing
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
18
|
+
* The identifier is an open string because no canonical (core) identifier ships: the two
|
|
19
|
+
* aspirational placeholders (`new messages` / `unpaid invoices`) were removed because nothing
|
|
20
|
+
* produced them.
|
|
21
|
+
*
|
|
22
|
+
* The SURFACING is not missing. A navigation item declares `notificationBadgeRef` and the sidebar
|
|
23
|
+
* renders it, and an application declares its own badges, so the open string is what an application
|
|
24
|
+
* uses today. What is still absent is a FRAMEWORK-shipped identifier with a framework producer
|
|
25
|
+
* behind it; when one lands, core identifiers come back as a `CoreNotificationBadgeIdentifiers`
|
|
26
|
+
* enum unioned in here.
|
|
27
|
+
*
|
|
28
|
+
* Open, but not unconstrained: an identifier may not contain
|
|
29
|
+
* {@link NOTIFICATION_BADGE_KEY_SEPARATOR}, because it is the LAST part of a badge key and of a
|
|
30
|
+
* badge reference and both are positional. A definition object is authored in TypeScript and never
|
|
31
|
+
* `.parse()`d, so this constraint is also re-stated as a boot check — see
|
|
32
|
+
* {@link collectNotificationBadgeDeclarationViolations}.
|
|
12
33
|
*/
|
|
13
34
|
export declare const NotificationBadgeIdentifierSchema: z.ZodString;
|
|
14
35
|
/**
|
|
@@ -30,6 +51,22 @@ export declare const NotificationScopeSchema: z.ZodEnum<{
|
|
|
30
51
|
user_self: ResourcePrimaryScope.USER_SELF;
|
|
31
52
|
organizations: ResourcePrimaryScope.ORGANIZATIONS;
|
|
32
53
|
}>;
|
|
54
|
+
/**
|
|
55
|
+
* @wildo_source:part:start saas.models.notifications.badge-vocabularies facet:layer:shared facet:audience:app-developer
|
|
56
|
+
*
|
|
57
|
+
* The four vocabularies a badge definition picks from: how its count is CALCULATED, how it is
|
|
58
|
+
* PRESENTED, whether it draws attention, and — for a stored counter — what an operation does to it.
|
|
59
|
+
*
|
|
60
|
+
* ⚠️ **Choosing the source kind wrongly produces a number that DRIFTS.** Reach for `EVENT_COUNTER`
|
|
61
|
+
* only when the count is a fact the badge itself owns ("unread messages": arrive → increment, seen →
|
|
62
|
+
* reset). For any quantity derived from data an operation could change by another route — incomplete
|
|
63
|
+
* todos, unpaid invoices — use `DERIVED_QUERY`, which recomputes a live aggregate. A stored counter
|
|
64
|
+
* on a derived quantity is right on the day it is written and wrong thereafter.
|
|
65
|
+
*
|
|
66
|
+
* An `EVENT_COUNTER` badge additionally needs `notificationBadgeOperations` declared on the
|
|
67
|
+
* operations that move it; a `DERIVED_QUERY` badge needs none, because the recompute hangs off the
|
|
68
|
+
* source resource's own mutations.
|
|
69
|
+
*/
|
|
33
70
|
export declare enum NotificationBadgeOperation {
|
|
34
71
|
INCREMENT = "increment",
|
|
35
72
|
DECREMENT = "decrement",
|
|
@@ -71,6 +108,7 @@ export declare enum NotificationBadgePulse {
|
|
|
71
108
|
/** Persistent — pulse while the count is > 0. */
|
|
72
109
|
WHILE_ACTIVE = "while_active"
|
|
73
110
|
}
|
|
111
|
+
/** @wildo_source:part:end saas.models.notifications.badge-vocabularies */
|
|
74
112
|
/** EVENT_COUNTER source — no extra config; the stored counter is the truth. */
|
|
75
113
|
export declare const NotificationBadgeEventCounterSourceSchema: z.ZodObject<{
|
|
76
114
|
kind: z.ZodLiteral<NotificationBadgeSourceKind.EVENT_COUNTER>;
|
|
@@ -176,4 +214,128 @@ export type NotificationBadge = z.infer<typeof NotificationBadgeSchema>;
|
|
|
176
214
|
export type NotificationBadgeSource = z.infer<typeof NotificationBadgeSourceSchema>;
|
|
177
215
|
export type NotificationBadgeDerivedQuerySource = z.infer<typeof NotificationBadgeDerivedQuerySourceSchema>;
|
|
178
216
|
export type NotificationBadgeDisplay = z.infer<typeof NotificationBadgeDisplaySchema>;
|
|
217
|
+
/**
|
|
218
|
+
* A badge KEY: `<scope>:<identifier>` — the DEFINITION's identity, and the only thing that may be
|
|
219
|
+
* used to look a definition up.
|
|
220
|
+
*
|
|
221
|
+
* ## Why the identifier alone is not an identity
|
|
222
|
+
*
|
|
223
|
+
* A definition is `(scope, identifier)`. Nothing ever stopped two definitions declaring the same
|
|
224
|
+
* `identifier` at different scopes, and until this type existed every lookup matched on the
|
|
225
|
+
* identifier alone — so the second definition was unreachable and silently shared the first's
|
|
226
|
+
* count. The key makes both reachable and makes the collision that DOES matter (two definitions at
|
|
227
|
+
* one scope and identifier) something a boot check can refuse.
|
|
228
|
+
*
|
|
229
|
+
* ## Why `scopeId` is NOT in the key
|
|
230
|
+
*
|
|
231
|
+
* `scopeId` says WHOSE badge — a user id, an organization id. It is per-viewer instance data that a
|
|
232
|
+
* navigation declaration cannot possibly carry, and a browser session only ever receives pushes for
|
|
233
|
+
* its own scope ids (the backend routes USER badges to that user's socket and ORG badges to that
|
|
234
|
+
* organization's room). So the key is what a DECLARATION can name, and the reference below is what
|
|
235
|
+
* an INSTANCE is addressed by.
|
|
236
|
+
*/
|
|
237
|
+
export type NotificationBadgeKey = string;
|
|
238
|
+
/**
|
|
239
|
+
* A badge REFERENCE: `<scope>:<scopeId>:<identifier>` — one badge ROW, on the wire.
|
|
240
|
+
*
|
|
241
|
+
* Carried by `WS_BadgeUpdatePayload.badgeReference` because emission needs the scopeId to route.
|
|
242
|
+
* The browser reduces it to a {@link NotificationBadgeKey} on arrival via
|
|
243
|
+
* {@link notificationBadgeKeyFromReference}, which is what makes the store's key and the navigation
|
|
244
|
+
* item's lookup the same key rather than two conventions that agree by luck.
|
|
245
|
+
*/
|
|
246
|
+
export type NotificationBadgeReference = string;
|
|
247
|
+
/** Build the DEFINITION-identity key from its parts. */
|
|
248
|
+
export declare function buildNotificationBadgeKey(scope: NotificationScope, identifier: NotificationBadgeIdentifier): NotificationBadgeKey;
|
|
249
|
+
/**
|
|
250
|
+
* The key of a definition (or of anything else carrying a badge identity, such as a persisted row).
|
|
251
|
+
*
|
|
252
|
+
* Takes the identity fields rather than the whole definition so a `NotificationBadge` row and a
|
|
253
|
+
* `NotificationBadgeDefinition` resolve through the SAME function — a second copy for the row shape
|
|
254
|
+
* is how the two come to disagree.
|
|
255
|
+
*/
|
|
256
|
+
export declare function notificationBadgeIdentityKey(identity: Pick<NotificationBadgeDefinition, 'scope' | 'identifier'>): NotificationBadgeKey;
|
|
257
|
+
/**
|
|
258
|
+
* Parse a key, returning `null` when it is not a well-formed key at a SUPPORTED scope.
|
|
259
|
+
*
|
|
260
|
+
* The scope check is not cosmetic: the APPLICATION variant was dropped in the polymorphism refactor
|
|
261
|
+
* and no resource type backs it, so `application:foo` must fail here rather than reach a dispatch
|
|
262
|
+
* that has no repository for it.
|
|
263
|
+
*/
|
|
264
|
+
export declare function parseNotificationBadgeKey(key: string): {
|
|
265
|
+
scope: NotificationScope;
|
|
266
|
+
identifier: NotificationBadgeIdentifier;
|
|
267
|
+
} | null;
|
|
268
|
+
/** Build the INSTANCE address carried on the wire. */
|
|
269
|
+
export declare function buildNotificationBadgeReference(scope: NotificationScope, scopeId: string, identifier: NotificationBadgeIdentifier): NotificationBadgeReference;
|
|
270
|
+
/** Parse a wire reference, returning `null` for a malformed one or an unsupported scope. */
|
|
271
|
+
export declare function parseNotificationBadgeReference(reference: string): {
|
|
272
|
+
scope: NotificationScope;
|
|
273
|
+
scopeId: string;
|
|
274
|
+
identifier: NotificationBadgeIdentifier;
|
|
275
|
+
} | null;
|
|
276
|
+
/**
|
|
277
|
+
* Reduce a wire reference to the DEFINITION key it addresses — the one hop the browser badge store
|
|
278
|
+
* takes, so that what it keys on is what a navigation item resolves against.
|
|
279
|
+
*/
|
|
280
|
+
export declare function notificationBadgeKeyFromReference(reference: string): NotificationBadgeKey | null;
|
|
281
|
+
/** Whether a raw string names one of the two surviving badge scopes. */
|
|
282
|
+
export declare function isSupportedNotificationBadgeScope(scope: string): scope is NotificationScope;
|
|
283
|
+
/**
|
|
284
|
+
* Why a badge declaration is refused. A closed vocabulary with a named runtime source, so a
|
|
285
|
+
* diagnostic can be branched on and each member can carry its own explanation.
|
|
286
|
+
*/
|
|
287
|
+
export declare enum NotificationBadgeDeclarationViolationReason {
|
|
288
|
+
/**
|
|
289
|
+
* Two definitions declare the same `(scope, identifier)`. Every lookup resolves the FIRST, so
|
|
290
|
+
* the second is unreachable while silently sharing the first's count — the shape that made
|
|
291
|
+
* identifier-only lookup unsafe in the first place. Two definitions at DIFFERENT scopes are
|
|
292
|
+
* fine and are exactly what the key makes reachable.
|
|
293
|
+
*/
|
|
294
|
+
DUPLICATE_DEFINITION_KEY = "duplicate_definition_key",
|
|
295
|
+
/**
|
|
296
|
+
* An identifier contains the key separator, which would make its key and every reference built
|
|
297
|
+
* from it parse into the wrong parts. Refused rather than escaped: a positional format with an
|
|
298
|
+
* escaping rule is a format two implementations will eventually disagree about.
|
|
299
|
+
*/
|
|
300
|
+
IDENTIFIER_CONTAINS_KEY_SEPARATOR = "identifier_contains_key_separator",
|
|
301
|
+
/** An operation declares a `badgeRef` that names no registered definition. */
|
|
302
|
+
OPERATION_REF_UNRESOLVED = "operation_ref_unresolved"
|
|
303
|
+
}
|
|
304
|
+
/** One refused declaration, carrying enough to name the author's own file without re-deriving it. */
|
|
305
|
+
export interface NotificationBadgeDeclarationViolation {
|
|
306
|
+
reason: NotificationBadgeDeclarationViolationReason;
|
|
307
|
+
/** The badge key at issue — the definition's, or the unresolved `badgeRef` as authored. */
|
|
308
|
+
badgeKey: string;
|
|
309
|
+
/** Present when the violation belongs to a definition rather than to an operation declaration. */
|
|
310
|
+
identifier?: NotificationBadgeIdentifier;
|
|
311
|
+
/** Present when the violation belongs to an operation declaration. */
|
|
312
|
+
resourceType?: string;
|
|
313
|
+
/** Present when the violation belongs to an operation declaration. */
|
|
314
|
+
operationIdentifier?: string;
|
|
315
|
+
}
|
|
316
|
+
/** Where an operation declared a badge reference — one row per authored `notificationBadgeOperations` entry. */
|
|
317
|
+
export interface NotificationBadgeOperationDeclarationSite {
|
|
318
|
+
resourceType: string;
|
|
319
|
+
operationIdentifier: string;
|
|
320
|
+
badgeRef: string;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* The whole declaration-coherence check, as a pure function over what an application declared.
|
|
324
|
+
*
|
|
325
|
+
* Pure and shared on purpose: the backend registry runs it as a fail-closed boot gate and the
|
|
326
|
+
* frontend launcher verifier reports it in development, and a second implementation is how the two
|
|
327
|
+
* come to disagree about what a valid declaration is.
|
|
328
|
+
*
|
|
329
|
+
* It answers the question `derive-before-you-ask.md` asks — who owes this, and what says so. The
|
|
330
|
+
* population is exactly the registered definitions plus every authored
|
|
331
|
+
* `notificationBadgeOperations` entry; nothing is inferred and nothing is sampled.
|
|
332
|
+
*/
|
|
333
|
+
export declare function collectNotificationBadgeDeclarationViolations(definitions: readonly NotificationBadgeDefinition[], operationSites?: readonly NotificationBadgeOperationDeclarationSite[]): NotificationBadgeDeclarationViolation[];
|
|
334
|
+
/**
|
|
335
|
+
* Index the registered definitions by key, so a dispatch resolves in one lookup rather than a scan.
|
|
336
|
+
*
|
|
337
|
+
* Built from the SAME key function the boot check uses, so a definition the boot check accepted is
|
|
338
|
+
* a definition this map can serve.
|
|
339
|
+
*/
|
|
340
|
+
export declare function buildNotificationBadgeDefinitionIndex(definitions: readonly NotificationBadgeDefinition[]): ReadonlyMap<NotificationBadgeKey, NotificationBadgeDefinition>;
|
|
179
341
|
//# sourceMappingURL=notification-badges.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-badges.schemas.d.ts","sourceRoot":"","sources":["../../../../src/notifications/notification-badges.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E
|
|
1
|
+
{"version":3,"file":"notification-badges.schemas.d.ts","sourceRoot":"","sources":["../../../../src/notifications/notification-badges.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAEpD,iFAAiF;AACjF,eAAO,MAAM,qCAAqC,QAAY,CAAC;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iCAAiC,aAKxC,CAAC;AAEP;;;;;;;;;;;;;;GAcG;AACH,eAAO,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,CAM/F;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAGhG;AAED,wEAAwE;AACxE,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAE3F;AAMD;;;GAGG;AACH,oBAAY,2CAA2C;IACnD;;;;;OAKG;IACH,wBAAwB,6BAA6B;IACrD;;;;OAIG;IACH,iCAAiC,sCAAsC;IACvE,8EAA8E;IAC9E,wBAAwB,6BAA6B;CACxD;AAED,qGAAqG;AACrG,MAAM,WAAW,qCAAqC;IAClD,MAAM,EAAE,2CAA2C,CAAC;IACpD,2FAA2F;IAC3F,QAAQ,EAAE,MAAM,CAAC;IACjB,kGAAkG;IAClG,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,gHAAgH;AAChH,MAAM,WAAW,yCAAyC;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6CAA6C,CACzD,WAAW,EAAE,SAAS,2BAA2B,EAAE,EACnD,cAAc,GAAE,SAAS,yCAAyC,EAAO,GAC1E,qCAAqC,EAAE,CAsCzC;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACjD,WAAW,EAAE,SAAS,2BAA2B,EAAE,GACpD,WAAW,CAAC,oBAAoB,EAAE,2BAA2B,CAAC,CAOhE"}
|
|
@@ -3,16 +3,42 @@ import { initZodDecorators } from '@wildo-ai/zod-decorators';
|
|
|
3
3
|
initZodDecorators(z);
|
|
4
4
|
import { IndicatorVariant } from '@wildo-ai/presets-components-models';
|
|
5
5
|
import { ResourcePrimaryScope } from "../resources/resources.shared.schemas.js";
|
|
6
|
+
/**
|
|
7
|
+
* The one character that separates the parts of a badge KEY and a badge REFERENCE.
|
|
8
|
+
*
|
|
9
|
+
* Both formats are positional, so the separator may not appear inside a part or the parse is
|
|
10
|
+
* ambiguous. `NotificationBadgeIdentifierSchema` refuses it in an identifier for exactly that
|
|
11
|
+
* reason, and `collectNotificationBadgeDeclarationViolations` re-states the refusal at boot,
|
|
12
|
+
* because a declaration object is authored in TypeScript and never `.parse()`d.
|
|
13
|
+
*/
|
|
14
|
+
export const NOTIFICATION_BADGE_KEY_SEPARATOR = ':';
|
|
15
|
+
/** Any string that does not contain {@link NOTIFICATION_BADGE_KEY_SEPARATOR}. */
|
|
16
|
+
export const NOTIFICATION_BADGE_IDENTIFIER_PATTERN = /^[^:]+$/;
|
|
6
17
|
/**
|
|
7
18
|
* Notification badge identifier.
|
|
8
19
|
*
|
|
9
|
-
*
|
|
10
|
-
* (`new messages` / `unpaid invoices`) were removed because nothing
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
20
|
+
* The identifier is an open string because no canonical (core) identifier ships: the two
|
|
21
|
+
* aspirational placeholders (`new messages` / `unpaid invoices`) were removed because nothing
|
|
22
|
+
* produced them.
|
|
23
|
+
*
|
|
24
|
+
* The SURFACING is not missing. A navigation item declares `notificationBadgeRef` and the sidebar
|
|
25
|
+
* renders it, and an application declares its own badges, so the open string is what an application
|
|
26
|
+
* uses today. What is still absent is a FRAMEWORK-shipped identifier with a framework producer
|
|
27
|
+
* behind it; when one lands, core identifiers come back as a `CoreNotificationBadgeIdentifiers`
|
|
28
|
+
* enum unioned in here.
|
|
29
|
+
*
|
|
30
|
+
* Open, but not unconstrained: an identifier may not contain
|
|
31
|
+
* {@link NOTIFICATION_BADGE_KEY_SEPARATOR}, because it is the LAST part of a badge key and of a
|
|
32
|
+
* badge reference and both are positional. A definition object is authored in TypeScript and never
|
|
33
|
+
* `.parse()`d, so this constraint is also re-stated as a boot check — see
|
|
34
|
+
* {@link collectNotificationBadgeDeclarationViolations}.
|
|
14
35
|
*/
|
|
15
|
-
export const NotificationBadgeIdentifierSchema = z
|
|
36
|
+
export const NotificationBadgeIdentifierSchema = z
|
|
37
|
+
.string()
|
|
38
|
+
.min(1, { error: 'Notification badge identifier is required' })
|
|
39
|
+
.regex(NOTIFICATION_BADGE_IDENTIFIER_PATTERN, {
|
|
40
|
+
error: `Notification badge identifier must not contain "${NOTIFICATION_BADGE_KEY_SEPARATOR}" — that character separates the parts of a badge key and reference`,
|
|
41
|
+
});
|
|
16
42
|
/**
|
|
17
43
|
* Notification badge scope. Tightened to USER_SELF | ORGANIZATIONS only.
|
|
18
44
|
*
|
|
@@ -32,6 +58,22 @@ export const NotificationScopeSchema = z.enum([
|
|
|
32
58
|
ResourcePrimaryScope.USER_SELF,
|
|
33
59
|
ResourcePrimaryScope.ORGANIZATIONS,
|
|
34
60
|
]);
|
|
61
|
+
/**
|
|
62
|
+
* @wildo_source:part:start saas.models.notifications.badge-vocabularies facet:layer:shared facet:audience:app-developer
|
|
63
|
+
*
|
|
64
|
+
* The four vocabularies a badge definition picks from: how its count is CALCULATED, how it is
|
|
65
|
+
* PRESENTED, whether it draws attention, and — for a stored counter — what an operation does to it.
|
|
66
|
+
*
|
|
67
|
+
* ⚠️ **Choosing the source kind wrongly produces a number that DRIFTS.** Reach for `EVENT_COUNTER`
|
|
68
|
+
* only when the count is a fact the badge itself owns ("unread messages": arrive → increment, seen →
|
|
69
|
+
* reset). For any quantity derived from data an operation could change by another route — incomplete
|
|
70
|
+
* todos, unpaid invoices — use `DERIVED_QUERY`, which recomputes a live aggregate. A stored counter
|
|
71
|
+
* on a derived quantity is right on the day it is written and wrong thereafter.
|
|
72
|
+
*
|
|
73
|
+
* An `EVENT_COUNTER` badge additionally needs `notificationBadgeOperations` declared on the
|
|
74
|
+
* operations that move it; a `DERIVED_QUERY` badge needs none, because the recompute hangs off the
|
|
75
|
+
* source resource's own mutations.
|
|
76
|
+
*/
|
|
35
77
|
export var NotificationBadgeOperation;
|
|
36
78
|
(function (NotificationBadgeOperation) {
|
|
37
79
|
NotificationBadgeOperation["INCREMENT"] = "increment";
|
|
@@ -77,6 +119,7 @@ export var NotificationBadgePulse;
|
|
|
77
119
|
/** Persistent — pulse while the count is > 0. */
|
|
78
120
|
NotificationBadgePulse["WHILE_ACTIVE"] = "while_active";
|
|
79
121
|
})(NotificationBadgePulse || (NotificationBadgePulse = {}));
|
|
122
|
+
/** @wildo_source:part:end saas.models.notifications.badge-vocabularies */
|
|
80
123
|
/** EVENT_COUNTER source — no extra config; the stored counter is the truth. */
|
|
81
124
|
export const NotificationBadgeEventCounterSourceSchema = z.object({
|
|
82
125
|
kind: z.literal(NotificationBadgeSourceKind.EVENT_COUNTER),
|
|
@@ -156,4 +199,146 @@ export const NotificationBadgeSchema = z.discriminatedUnion('scope', [
|
|
|
156
199
|
NotificationBadgeOrganizationSchema,
|
|
157
200
|
NotificationBadgeUserSelfSchema,
|
|
158
201
|
]);
|
|
202
|
+
/** Build the DEFINITION-identity key from its parts. */
|
|
203
|
+
export function buildNotificationBadgeKey(scope, identifier) {
|
|
204
|
+
return `${scope}${NOTIFICATION_BADGE_KEY_SEPARATOR}${identifier}`;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The key of a definition (or of anything else carrying a badge identity, such as a persisted row).
|
|
208
|
+
*
|
|
209
|
+
* Takes the identity fields rather than the whole definition so a `NotificationBadge` row and a
|
|
210
|
+
* `NotificationBadgeDefinition` resolve through the SAME function — a second copy for the row shape
|
|
211
|
+
* is how the two come to disagree.
|
|
212
|
+
*/
|
|
213
|
+
export function notificationBadgeIdentityKey(identity) {
|
|
214
|
+
return buildNotificationBadgeKey(identity.scope, identity.identifier);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Parse a key, returning `null` when it is not a well-formed key at a SUPPORTED scope.
|
|
218
|
+
*
|
|
219
|
+
* The scope check is not cosmetic: the APPLICATION variant was dropped in the polymorphism refactor
|
|
220
|
+
* and no resource type backs it, so `application:foo` must fail here rather than reach a dispatch
|
|
221
|
+
* that has no repository for it.
|
|
222
|
+
*/
|
|
223
|
+
export function parseNotificationBadgeKey(key) {
|
|
224
|
+
const parts = key.split(NOTIFICATION_BADGE_KEY_SEPARATOR);
|
|
225
|
+
if (parts.length !== 2)
|
|
226
|
+
return null;
|
|
227
|
+
const [scope, identifier] = parts;
|
|
228
|
+
if (!isSupportedNotificationBadgeScope(scope) || identifier.length === 0)
|
|
229
|
+
return null;
|
|
230
|
+
return { scope, identifier };
|
|
231
|
+
}
|
|
232
|
+
/** Build the INSTANCE address carried on the wire. */
|
|
233
|
+
export function buildNotificationBadgeReference(scope, scopeId, identifier) {
|
|
234
|
+
return `${scope}${NOTIFICATION_BADGE_KEY_SEPARATOR}${scopeId}${NOTIFICATION_BADGE_KEY_SEPARATOR}${identifier}`;
|
|
235
|
+
}
|
|
236
|
+
/** Parse a wire reference, returning `null` for a malformed one or an unsupported scope. */
|
|
237
|
+
export function parseNotificationBadgeReference(reference) {
|
|
238
|
+
const parts = reference.split(NOTIFICATION_BADGE_KEY_SEPARATOR);
|
|
239
|
+
if (parts.length !== 3)
|
|
240
|
+
return null;
|
|
241
|
+
const [scope, scopeId, identifier] = parts;
|
|
242
|
+
if (!isSupportedNotificationBadgeScope(scope) || scopeId.length === 0 || identifier.length === 0)
|
|
243
|
+
return null;
|
|
244
|
+
return { scope, scopeId, identifier };
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Reduce a wire reference to the DEFINITION key it addresses — the one hop the browser badge store
|
|
248
|
+
* takes, so that what it keys on is what a navigation item resolves against.
|
|
249
|
+
*/
|
|
250
|
+
export function notificationBadgeKeyFromReference(reference) {
|
|
251
|
+
const parsed = parseNotificationBadgeReference(reference);
|
|
252
|
+
return parsed ? buildNotificationBadgeKey(parsed.scope, parsed.identifier) : null;
|
|
253
|
+
}
|
|
254
|
+
/** Whether a raw string names one of the two surviving badge scopes. */
|
|
255
|
+
export function isSupportedNotificationBadgeScope(scope) {
|
|
256
|
+
return scope === ResourcePrimaryScope.USER_SELF || scope === ResourcePrimaryScope.ORGANIZATIONS;
|
|
257
|
+
}
|
|
258
|
+
// ════════════════════════════════════════════════════════════════
|
|
259
|
+
// Declaration coherence — checked at CONFIGURATION time
|
|
260
|
+
// ════════════════════════════════════════════════════════════════
|
|
261
|
+
/**
|
|
262
|
+
* Why a badge declaration is refused. A closed vocabulary with a named runtime source, so a
|
|
263
|
+
* diagnostic can be branched on and each member can carry its own explanation.
|
|
264
|
+
*/
|
|
265
|
+
export var NotificationBadgeDeclarationViolationReason;
|
|
266
|
+
(function (NotificationBadgeDeclarationViolationReason) {
|
|
267
|
+
/**
|
|
268
|
+
* Two definitions declare the same `(scope, identifier)`. Every lookup resolves the FIRST, so
|
|
269
|
+
* the second is unreachable while silently sharing the first's count — the shape that made
|
|
270
|
+
* identifier-only lookup unsafe in the first place. Two definitions at DIFFERENT scopes are
|
|
271
|
+
* fine and are exactly what the key makes reachable.
|
|
272
|
+
*/
|
|
273
|
+
NotificationBadgeDeclarationViolationReason["DUPLICATE_DEFINITION_KEY"] = "duplicate_definition_key";
|
|
274
|
+
/**
|
|
275
|
+
* An identifier contains the key separator, which would make its key and every reference built
|
|
276
|
+
* from it parse into the wrong parts. Refused rather than escaped: a positional format with an
|
|
277
|
+
* escaping rule is a format two implementations will eventually disagree about.
|
|
278
|
+
*/
|
|
279
|
+
NotificationBadgeDeclarationViolationReason["IDENTIFIER_CONTAINS_KEY_SEPARATOR"] = "identifier_contains_key_separator";
|
|
280
|
+
/** An operation declares a `badgeRef` that names no registered definition. */
|
|
281
|
+
NotificationBadgeDeclarationViolationReason["OPERATION_REF_UNRESOLVED"] = "operation_ref_unresolved";
|
|
282
|
+
})(NotificationBadgeDeclarationViolationReason || (NotificationBadgeDeclarationViolationReason = {}));
|
|
283
|
+
/**
|
|
284
|
+
* The whole declaration-coherence check, as a pure function over what an application declared.
|
|
285
|
+
*
|
|
286
|
+
* Pure and shared on purpose: the backend registry runs it as a fail-closed boot gate and the
|
|
287
|
+
* frontend launcher verifier reports it in development, and a second implementation is how the two
|
|
288
|
+
* come to disagree about what a valid declaration is.
|
|
289
|
+
*
|
|
290
|
+
* It answers the question `derive-before-you-ask.md` asks — who owes this, and what says so. The
|
|
291
|
+
* population is exactly the registered definitions plus every authored
|
|
292
|
+
* `notificationBadgeOperations` entry; nothing is inferred and nothing is sampled.
|
|
293
|
+
*/
|
|
294
|
+
export function collectNotificationBadgeDeclarationViolations(definitions, operationSites = []) {
|
|
295
|
+
const violations = [];
|
|
296
|
+
const seenKeys = new Set();
|
|
297
|
+
for (const definition of definitions) {
|
|
298
|
+
if (!NOTIFICATION_BADGE_IDENTIFIER_PATTERN.test(definition.identifier)) {
|
|
299
|
+
violations.push({
|
|
300
|
+
reason: NotificationBadgeDeclarationViolationReason.IDENTIFIER_CONTAINS_KEY_SEPARATOR,
|
|
301
|
+
badgeKey: notificationBadgeIdentityKey(definition),
|
|
302
|
+
identifier: definition.identifier,
|
|
303
|
+
});
|
|
304
|
+
// Still recorded below, so a malformed identifier declared twice is reported as both.
|
|
305
|
+
}
|
|
306
|
+
const key = notificationBadgeIdentityKey(definition);
|
|
307
|
+
if (seenKeys.has(key)) {
|
|
308
|
+
violations.push({
|
|
309
|
+
reason: NotificationBadgeDeclarationViolationReason.DUPLICATE_DEFINITION_KEY,
|
|
310
|
+
badgeKey: key,
|
|
311
|
+
identifier: definition.identifier,
|
|
312
|
+
});
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
seenKeys.add(key);
|
|
316
|
+
}
|
|
317
|
+
for (const site of operationSites) {
|
|
318
|
+
if (!seenKeys.has(site.badgeRef)) {
|
|
319
|
+
violations.push({
|
|
320
|
+
reason: NotificationBadgeDeclarationViolationReason.OPERATION_REF_UNRESOLVED,
|
|
321
|
+
badgeKey: site.badgeRef,
|
|
322
|
+
resourceType: site.resourceType,
|
|
323
|
+
operationIdentifier: site.operationIdentifier,
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return violations;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Index the registered definitions by key, so a dispatch resolves in one lookup rather than a scan.
|
|
331
|
+
*
|
|
332
|
+
* Built from the SAME key function the boot check uses, so a definition the boot check accepted is
|
|
333
|
+
* a definition this map can serve.
|
|
334
|
+
*/
|
|
335
|
+
export function buildNotificationBadgeDefinitionIndex(definitions) {
|
|
336
|
+
const index = new Map();
|
|
337
|
+
for (const definition of definitions) {
|
|
338
|
+
const key = notificationBadgeIdentityKey(definition);
|
|
339
|
+
if (!index.has(key))
|
|
340
|
+
index.set(key, definition);
|
|
341
|
+
}
|
|
342
|
+
return index;
|
|
343
|
+
}
|
|
159
344
|
//# sourceMappingURL=notification-badges.schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-badges.schemas.js","sourceRoot":"","sources":["../../../../src/notifications/notification-badges.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,2CAA2C,EAAE,CAAC,CAAC;AAE3H;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC1C,oBAAoB,CAAC,SAAS;IAC9B,oBAAoB,CAAC,aAAa;CACrC,CAAC,CAAC;AAEH,MAAM,CAAN,IAAY,0BAKX;A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CAAC","sourcesContent":["import { z } from \"zod\";\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\ninitZodDecorators(z);\n\nimport { IndicatorVariant } from '@wildo-ai/presets-components-models';\nimport { ResourcePrimaryScope } from \"../resources/resources.shared.schemas\";\n\n\n/**\n * Notification badge identifier.\n *\n * No canonical (core) identifiers ship today — the two aspirational placeholders\n * (`new messages` / `unpaid invoices`) were removed because nothing produced them\n * (see `.claude/plans/badge-launcher-retract.md`). When the badge surfacing is\n * reintroduced with a real producer (Reintroduction Contract R1), core identifiers\n * come back as a `CoreNotificationBadgeIdentifiers` enum unioned in here.\n */\nexport const NotificationBadgeIdentifierSchema = z.string().min(1, { error: 'Notification badge identifier is required' });\n\n/**\n * Notification badge scope. Tightened to USER_SELF | ORGANIZATIONS only.\n *\n * The APPLICATION variant was dropped in the polymorphism refactor\n * (`.cursor/plans/notification-badges-polymorphism-refactor.md`):\n * - No canonical badges were ever declared at APPLICATION scope (see\n * `notification-badges.core.definitions.ts`).\n * - The two surviving variants (USER + ORG) each own their own resource type\n * and MongoDB collection. Allowing APPLICATION here would let consumers\n * write a payload that no resource configuration / collection accepts.\n *\n * `WS_BadgeUpdatePayload` semantics are unchanged — the dispatcher in\n * `NotificationBadgeBackendService.emitBadgeUpdate` still routes USER badges to\n * `sendToUser` and ORG badges to `sendToOrganization`.\n */\nexport const NotificationScopeSchema = z.enum([\n ResourcePrimaryScope.USER_SELF,\n ResourcePrimaryScope.ORGANIZATIONS,\n]);\n\nexport enum NotificationBadgeOperation {\n INCREMENT = 'increment',\n DECREMENT = 'decrement',\n SET = 'set',\n RESET = 'reset',\n}\n\n/**\n * How a badge's count is CALCULATED — the load-bearing distinction (R1).\n *\n * - `EVENT_COUNTER`: a stored counter mutated imperatively on domain events\n * (arrive → increment, seen → reset). Correct for \"unread messages\" style\n * badges. The count lives in the badge document.\n * - `DERIVED_QUERY`: the count is a LIVE aggregate over a resource collection\n * (`count(resourceType where filter, scoped)`), recomputed on that resource's\n * mutations. Correct for \"incomplete todos\" / \"unpaid invoices\" — quantities\n * derived from data that would DRIFT if tracked with a stored counter.\n */\nexport enum NotificationBadgeSourceKind {\n EVENT_COUNTER = 'event_counter',\n DERIVED_QUERY = 'derived_query',\n}\n\n/** How the badge is presented. `NONE` = suppressed even when the count is > 0. */\nexport enum NotificationBadgeDisplayMode {\n /** A colored signal dot (\"≥ 1\"), no number. */\n DOT = 'dot',\n /** The numeric count (truncated at the display cap). */\n COUNT = 'count',\n /** Rendered as nothing (count still computed/available). */\n NONE = 'none',\n}\n\n/**\n * WHETHER / WHEN a badge draws attention. The LOOK of the pulse is theme-owned\n * (`UIBehaviorRecipe.motion.attention`), so a definition only declares intent.\n */\nexport enum NotificationBadgePulse {\n NONE = 'none',\n /** Transitional — pulse briefly when the count rises (recommended). */\n ON_INCREASE = 'on_increase',\n /** Persistent — pulse while the count is > 0. */\n WHILE_ACTIVE = 'while_active',\n}\n\n/** EVENT_COUNTER source — no extra config; the stored counter is the truth. */\nexport const NotificationBadgeEventCounterSourceSchema = z.object({\n kind: z.literal(NotificationBadgeSourceKind.EVENT_COUNTER),\n});\n\n/**\n * DERIVED_QUERY source — the count is `count(resourceType where filter)` with the\n * scope bound via `scopeField` (the FK field on the counted resource that equals\n * the badge's `scopeId`, e.g. `userId` for a USER_SELF badge). Recomputed by the\n * backend on any mutation of `resourceType` (see backend R5).\n */\nexport const NotificationBadgeDerivedQuerySourceSchema = z.object({\n kind: z.literal(NotificationBadgeSourceKind.DERIVED_QUERY),\n resourceType: z.string().min(1, { error: 'Derived-badge resourceType is required' }),\n filter: z.record(z.string(), z.unknown()),\n scopeField: z.string().min(1, { error: 'Derived-badge scopeField is required' }),\n});\n\n/** Discriminated union over the calculation kinds. */\nexport const NotificationBadgeSourceSchema = z.discriminatedUnion('kind', [\n NotificationBadgeEventCounterSourceSchema,\n NotificationBadgeDerivedQuerySourceSchema,\n]);\n\n/**\n * Presentation declaration. `tone` reuses the design-system `IndicatorVariant`\n * (single source — the `Badge` component maps the same enum). `pulse` is a\n * trigger only; the theme owns the animation.\n */\nexport const NotificationBadgeDisplaySchema = z.object({\n mode: z.enum(NotificationBadgeDisplayMode).default(NotificationBadgeDisplayMode.COUNT),\n tone: z.enum(IndicatorVariant).default(IndicatorVariant.NEUTRAL),\n pulse: z.enum(NotificationBadgePulse).default(NotificationBadgePulse.NONE),\n});\n\n/**\n * Badge IDENTITY — the (identifier, scope) tuple shared by the declaration and\n * the persisted document. Kept separate so the stored badge doc does NOT absorb\n * declaration-only fields (`source` / `display`).\n */\nconst NotificationBadgeIdentitySchema = z.object({\n identifier: NotificationBadgeIdentifierSchema,\n scope: NotificationScopeSchema,\n});\n\n/**\n * Badge DEFINITION — the declaration app/framework authors register: identity +\n * how the count is calculated (`source`) + how it is presented (`display`).\n */\nexport const NotificationBadgeDefinitionSchema = NotificationBadgeIdentitySchema.extend({\n source: NotificationBadgeSourceSchema,\n display: NotificationBadgeDisplaySchema,\n});\n\nconst NotificationBadgeBaseSchema = NotificationBadgeIdentitySchema.extend({\n // A compact badge without its application-defined identifier is not interpretable: callers\n // could see a number but not what the number counts. Override the identity field here (rather\n // than decorating NotificationBadgeIdentitySchema) so persisted API rows gain summary metadata\n // while application-authored badge definitions remain a plain declaration schema.\n identifier: NotificationBadgeIdentifierSchema.isSummaryField(),\n // `isPrimaryKey` (composite: excludeFromCreate + isHidden + isUnique + isDBIndexed) —\n // the server generates `_id`, so it must NOT be required on the create DTO. Using bare\n // `.isDBIndexed()` here left `_id` create-required, which failed the dispatcher-driven\n // badge materialization (`buildNewBadge` supplies no `_id`).\n _id: z.string().min(1, { error: 'Notification badge ID is required' }).isPrimaryKey(),\n count: z.number().min(0, { error: 'Notification badge count must be greater than or equal to 0' }).isSummaryField(),\n createdAt: z.date().default(() => new Date()).isDBIndexed(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField(),\n});\n\nexport const NotificationBadgeOrganizationSchema = NotificationBadgeBaseSchema.extend({\n scope: z.literal(ResourcePrimaryScope.ORGANIZATIONS),\n organizationId: z.string().min(1, { error: 'Organization ID is required' }).isDBIndexed().isForeignKey(),\n});\n\nexport const NotificationBadgeUserSelfSchema = NotificationBadgeBaseSchema.extend({\n scope: z.literal(ResourcePrimaryScope.USER_SELF),\n userId: z.string().min(1, { error: 'User ID is required' }).isDBIndexed().isForeignKey(),\n});\n\n/**\n * Discriminated union over the two surviving badge scopes (USER_SELF / ORGANIZATIONS).\n * The APPLICATION variant was dropped — see `NotificationScopeSchema` JSDoc above.\n */\nexport const NotificationBadgeSchema = z.discriminatedUnion('scope', [\n NotificationBadgeOrganizationSchema,\n NotificationBadgeUserSelfSchema,\n]);\n\nexport type NotificationBadgeDefinition = z.infer<typeof NotificationBadgeDefinitionSchema>;\nexport type NotificationBadgeIdentifier = z.infer<typeof NotificationBadgeIdentifierSchema>;\nexport type NotificationScope = z.infer<typeof NotificationScopeSchema>;\nexport type NotificationBadge = z.infer<typeof NotificationBadgeSchema>;\nexport type NotificationBadgeSource = z.infer<typeof NotificationBadgeSourceSchema>;\nexport type NotificationBadgeDerivedQuerySource = z.infer<typeof NotificationBadgeDerivedQuerySourceSchema>;\nexport type NotificationBadgeDisplay = z.infer<typeof NotificationBadgeDisplaySchema>;\n\n"]}
|
|
1
|
+
{"version":3,"file":"notification-badges.schemas.js","sourceRoot":"","sources":["../../../../src/notifications/notification-badges.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,CAAC;AAEpD,iFAAiF;AACjF,MAAM,CAAC,MAAM,q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IAAI,CAAC,YAAY;gBAC/B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aAChD,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qCAAqC,CACjD,WAAmD;IAEnD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAqD,CAAC;IAC3E,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,4BAA4B,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\ninitZodDecorators(z);\n\nimport { IndicatorVariant } from '@wildo-ai/presets-components-models';\nimport { ResourcePrimaryScope } from \"../resources/resources.shared.schemas\";\n\n\n/**\n * The one character that separates the parts of a badge KEY and a badge REFERENCE.\n *\n * Both formats are positional, so the separator may not appear inside a part or the parse is\n * ambiguous. `NotificationBadgeIdentifierSchema` refuses it in an identifier for exactly that\n * reason, and `collectNotificationBadgeDeclarationViolations` re-states the refusal at boot,\n * because a declaration object is authored in TypeScript and never `.parse()`d.\n */\nexport const NOTIFICATION_BADGE_KEY_SEPARATOR = ':';\n\n/** Any string that does not contain {@link NOTIFICATION_BADGE_KEY_SEPARATOR}. */\nexport const NOTIFICATION_BADGE_IDENTIFIER_PATTERN = /^[^:]+$/;\n\n/**\n * Notification badge identifier.\n *\n * The identifier is an open string because no canonical (core) identifier ships: the two\n * aspirational placeholders (`new messages` / `unpaid invoices`) were removed because nothing\n * produced them.\n *\n * The SURFACING is not missing. A navigation item declares `notificationBadgeRef` and the sidebar\n * renders it, and an application declares its own badges, so the open string is what an application\n * uses today. What is still absent is a FRAMEWORK-shipped identifier with a framework producer\n * behind it; when one lands, core identifiers come back as a `CoreNotificationBadgeIdentifiers`\n * enum unioned in here.\n *\n * Open, but not unconstrained: an identifier may not contain\n * {@link NOTIFICATION_BADGE_KEY_SEPARATOR}, because it is the LAST part of a badge key and of a\n * badge reference and both are positional. A definition object is authored in TypeScript and never\n * `.parse()`d, so this constraint is also re-stated as a boot check — see\n * {@link collectNotificationBadgeDeclarationViolations}.\n */\nexport const NotificationBadgeIdentifierSchema = z\n .string()\n .min(1, { error: 'Notification badge identifier is required' })\n .regex(NOTIFICATION_BADGE_IDENTIFIER_PATTERN, {\n error: `Notification badge identifier must not contain \"${NOTIFICATION_BADGE_KEY_SEPARATOR}\" — that character separates the parts of a badge key and reference`,\n });\n\n/**\n * Notification badge scope. Tightened to USER_SELF | ORGANIZATIONS only.\n *\n * The APPLICATION variant was dropped in the polymorphism refactor\n * (`.cursor/plans/notification-badges-polymorphism-refactor.md`):\n * - No canonical badges were ever declared at APPLICATION scope (see\n * `notification-badges.core.definitions.ts`).\n * - The two surviving variants (USER + ORG) each own their own resource type\n * and MongoDB collection. Allowing APPLICATION here would let consumers\n * write a payload that no resource configuration / collection accepts.\n *\n * `WS_BadgeUpdatePayload` semantics are unchanged — the dispatcher in\n * `NotificationBadgeBackendService.emitBadgeUpdate` still routes USER badges to\n * `sendToUser` and ORG badges to `sendToOrganization`.\n */\nexport const NotificationScopeSchema = z.enum([\n ResourcePrimaryScope.USER_SELF,\n ResourcePrimaryScope.ORGANIZATIONS,\n]);\n\n/**\n * @wildo_source:part:start saas.models.notifications.badge-vocabularies facet:layer:shared facet:audience:app-developer\n *\n * The four vocabularies a badge definition picks from: how its count is CALCULATED, how it is\n * PRESENTED, whether it draws attention, and — for a stored counter — what an operation does to it.\n *\n * ⚠️ **Choosing the source kind wrongly produces a number that DRIFTS.** Reach for `EVENT_COUNTER`\n * only when the count is a fact the badge itself owns (\"unread messages\": arrive → increment, seen →\n * reset). For any quantity derived from data an operation could change by another route — incomplete\n * todos, unpaid invoices — use `DERIVED_QUERY`, which recomputes a live aggregate. A stored counter\n * on a derived quantity is right on the day it is written and wrong thereafter.\n *\n * An `EVENT_COUNTER` badge additionally needs `notificationBadgeOperations` declared on the\n * operations that move it; a `DERIVED_QUERY` badge needs none, because the recompute hangs off the\n * source resource's own mutations.\n */\nexport enum NotificationBadgeOperation {\n INCREMENT = 'increment',\n DECREMENT = 'decrement',\n SET = 'set',\n RESET = 'reset',\n}\n\n/**\n * How a badge's count is CALCULATED — the load-bearing distinction (R1).\n *\n * - `EVENT_COUNTER`: a stored counter mutated imperatively on domain events\n * (arrive → increment, seen → reset). Correct for \"unread messages\" style\n * badges. The count lives in the badge document.\n * - `DERIVED_QUERY`: the count is a LIVE aggregate over a resource collection\n * (`count(resourceType where filter, scoped)`), recomputed on that resource's\n * mutations. Correct for \"incomplete todos\" / \"unpaid invoices\" — quantities\n * derived from data that would DRIFT if tracked with a stored counter.\n */\nexport enum NotificationBadgeSourceKind {\n EVENT_COUNTER = 'event_counter',\n DERIVED_QUERY = 'derived_query',\n}\n\n/** How the badge is presented. `NONE` = suppressed even when the count is > 0. */\nexport enum NotificationBadgeDisplayMode {\n /** A colored signal dot (\"≥ 1\"), no number. */\n DOT = 'dot',\n /** The numeric count (truncated at the display cap). */\n COUNT = 'count',\n /** Rendered as nothing (count still computed/available). */\n NONE = 'none',\n}\n\n/**\n * WHETHER / WHEN a badge draws attention. The LOOK of the pulse is theme-owned\n * (`UIBehaviorRecipe.motion.attention`), so a definition only declares intent.\n */\nexport enum NotificationBadgePulse {\n NONE = 'none',\n /** Transitional — pulse briefly when the count rises (recommended). */\n ON_INCREASE = 'on_increase',\n /** Persistent — pulse while the count is > 0. */\n WHILE_ACTIVE = 'while_active',\n}\n/** @wildo_source:part:end saas.models.notifications.badge-vocabularies */\n\n/** EVENT_COUNTER source — no extra config; the stored counter is the truth. */\nexport const NotificationBadgeEventCounterSourceSchema = z.object({\n kind: z.literal(NotificationBadgeSourceKind.EVENT_COUNTER),\n});\n\n/**\n * DERIVED_QUERY source — the count is `count(resourceType where filter)` with the\n * scope bound via `scopeField` (the FK field on the counted resource that equals\n * the badge's `scopeId`, e.g. `userId` for a USER_SELF badge). Recomputed by the\n * backend on any mutation of `resourceType` (see backend R5).\n */\nexport const NotificationBadgeDerivedQuerySourceSchema = z.object({\n kind: z.literal(NotificationBadgeSourceKind.DERIVED_QUERY),\n resourceType: z.string().min(1, { error: 'Derived-badge resourceType is required' }),\n filter: z.record(z.string(), z.unknown()),\n scopeField: z.string().min(1, { error: 'Derived-badge scopeField is required' }),\n});\n\n/** Discriminated union over the calculation kinds. */\nexport const NotificationBadgeSourceSchema = z.discriminatedUnion('kind', [\n NotificationBadgeEventCounterSourceSchema,\n NotificationBadgeDerivedQuerySourceSchema,\n]);\n\n/**\n * Presentation declaration. `tone` reuses the design-system `IndicatorVariant`\n * (single source — the `Badge` component maps the same enum). `pulse` is a\n * trigger only; the theme owns the animation.\n */\nexport const NotificationBadgeDisplaySchema = z.object({\n mode: z.enum(NotificationBadgeDisplayMode).default(NotificationBadgeDisplayMode.COUNT),\n tone: z.enum(IndicatorVariant).default(IndicatorVariant.NEUTRAL),\n pulse: z.enum(NotificationBadgePulse).default(NotificationBadgePulse.NONE),\n});\n\n/**\n * Badge IDENTITY — the (identifier, scope) tuple shared by the declaration and\n * the persisted document. Kept separate so the stored badge doc does NOT absorb\n * declaration-only fields (`source` / `display`).\n */\nconst NotificationBadgeIdentitySchema = z.object({\n identifier: NotificationBadgeIdentifierSchema,\n scope: NotificationScopeSchema,\n});\n\n/**\n * Badge DEFINITION — the declaration app/framework authors register: identity +\n * how the count is calculated (`source`) + how it is presented (`display`).\n */\nexport const NotificationBadgeDefinitionSchema = NotificationBadgeIdentitySchema.extend({\n source: NotificationBadgeSourceSchema,\n display: NotificationBadgeDisplaySchema,\n});\n\nconst NotificationBadgeBaseSchema = NotificationBadgeIdentitySchema.extend({\n // A compact badge without its application-defined identifier is not interpretable: callers\n // could see a number but not what the number counts. Override the identity field here (rather\n // than decorating NotificationBadgeIdentitySchema) so persisted API rows gain summary metadata\n // while application-authored badge definitions remain a plain declaration schema.\n identifier: NotificationBadgeIdentifierSchema.isSummaryField(),\n // `isPrimaryKey` (composite: excludeFromCreate + isHidden + isUnique + isDBIndexed) —\n // the server generates `_id`, so it must NOT be required on the create DTO. Using bare\n // `.isDBIndexed()` here left `_id` create-required, which failed the dispatcher-driven\n // badge materialization (`buildNewBadge` supplies no `_id`).\n _id: z.string().min(1, { error: 'Notification badge ID is required' }).isPrimaryKey(),\n count: z.number().min(0, { error: 'Notification badge count must be greater than or equal to 0' }).isSummaryField(),\n createdAt: z.date().default(() => new Date()).isDBIndexed(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField(),\n});\n\nexport const NotificationBadgeOrganizationSchema = NotificationBadgeBaseSchema.extend({\n scope: z.literal(ResourcePrimaryScope.ORGANIZATIONS),\n organizationId: z.string().min(1, { error: 'Organization ID is required' }).isDBIndexed().isForeignKey(),\n});\n\nexport const NotificationBadgeUserSelfSchema = NotificationBadgeBaseSchema.extend({\n scope: z.literal(ResourcePrimaryScope.USER_SELF),\n userId: z.string().min(1, { error: 'User ID is required' }).isDBIndexed().isForeignKey(),\n});\n\n/**\n * Discriminated union over the two surviving badge scopes (USER_SELF / ORGANIZATIONS).\n * The APPLICATION variant was dropped — see `NotificationScopeSchema` JSDoc above.\n */\nexport const NotificationBadgeSchema = z.discriminatedUnion('scope', [\n NotificationBadgeOrganizationSchema,\n NotificationBadgeUserSelfSchema,\n]);\n\nexport type NotificationBadgeDefinition = z.infer<typeof NotificationBadgeDefinitionSchema>;\nexport type NotificationBadgeIdentifier = z.infer<typeof NotificationBadgeIdentifierSchema>;\nexport type NotificationScope = z.infer<typeof NotificationScopeSchema>;\nexport type NotificationBadge = z.infer<typeof NotificationBadgeSchema>;\nexport type NotificationBadgeSource = z.infer<typeof NotificationBadgeSourceSchema>;\nexport type NotificationBadgeDerivedQuerySource = z.infer<typeof NotificationBadgeDerivedQuerySourceSchema>;\nexport type NotificationBadgeDisplay = z.infer<typeof NotificationBadgeDisplaySchema>;\n\n\n// ════════════════════════════════════════════════════════════════\n// Badge IDENTITY — the one place the key and reference formats live\n// ════════════════════════════════════════════════════════════════\n\n/**\n * A badge KEY: `<scope>:<identifier>` — the DEFINITION's identity, and the only thing that may be\n * used to look a definition up.\n *\n * ## Why the identifier alone is not an identity\n *\n * A definition is `(scope, identifier)`. Nothing ever stopped two definitions declaring the same\n * `identifier` at different scopes, and until this type existed every lookup matched on the\n * identifier alone — so the second definition was unreachable and silently shared the first's\n * count. The key makes both reachable and makes the collision that DOES matter (two definitions at\n * one scope and identifier) something a boot check can refuse.\n *\n * ## Why `scopeId` is NOT in the key\n *\n * `scopeId` says WHOSE badge — a user id, an organization id. It is per-viewer instance data that a\n * navigation declaration cannot possibly carry, and a browser session only ever receives pushes for\n * its own scope ids (the backend routes USER badges to that user's socket and ORG badges to that\n * organization's room). So the key is what a DECLARATION can name, and the reference below is what\n * an INSTANCE is addressed by.\n */\nexport type NotificationBadgeKey = string;\n\n/**\n * A badge REFERENCE: `<scope>:<scopeId>:<identifier>` — one badge ROW, on the wire.\n *\n * Carried by `WS_BadgeUpdatePayload.badgeReference` because emission needs the scopeId to route.\n * The browser reduces it to a {@link NotificationBadgeKey} on arrival via\n * {@link notificationBadgeKeyFromReference}, which is what makes the store's key and the navigation\n * item's lookup the same key rather than two conventions that agree by luck.\n */\nexport type NotificationBadgeReference = string;\n\n/** Build the DEFINITION-identity key from its parts. */\nexport function buildNotificationBadgeKey(\n scope: NotificationScope,\n identifier: NotificationBadgeIdentifier,\n): NotificationBadgeKey {\n return `${scope}${NOTIFICATION_BADGE_KEY_SEPARATOR}${identifier}`;\n}\n\n/**\n * The key of a definition (or of anything else carrying a badge identity, such as a persisted row).\n *\n * Takes the identity fields rather than the whole definition so a `NotificationBadge` row and a\n * `NotificationBadgeDefinition` resolve through the SAME function — a second copy for the row shape\n * is how the two come to disagree.\n */\nexport function notificationBadgeIdentityKey(\n identity: Pick<NotificationBadgeDefinition, 'scope' | 'identifier'>,\n): NotificationBadgeKey {\n return buildNotificationBadgeKey(identity.scope, identity.identifier);\n}\n\n/**\n * Parse a key, returning `null` when it is not a well-formed key at a SUPPORTED scope.\n *\n * The scope check is not cosmetic: the APPLICATION variant was dropped in the polymorphism refactor\n * and no resource type backs it, so `application:foo` must fail here rather than reach a dispatch\n * that has no repository for it.\n */\nexport function parseNotificationBadgeKey(\n key: string,\n): { scope: NotificationScope; identifier: NotificationBadgeIdentifier } | null {\n const parts = key.split(NOTIFICATION_BADGE_KEY_SEPARATOR);\n if (parts.length !== 2) return null;\n const [scope, identifier] = parts;\n if (!isSupportedNotificationBadgeScope(scope) || identifier.length === 0) return null;\n return { scope, identifier };\n}\n\n/** Build the INSTANCE address carried on the wire. */\nexport function buildNotificationBadgeReference(\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n): NotificationBadgeReference {\n return `${scope}${NOTIFICATION_BADGE_KEY_SEPARATOR}${scopeId}${NOTIFICATION_BADGE_KEY_SEPARATOR}${identifier}`;\n}\n\n/** Parse a wire reference, returning `null` for a malformed one or an unsupported scope. */\nexport function parseNotificationBadgeReference(\n reference: string,\n): { scope: NotificationScope; scopeId: string; identifier: NotificationBadgeIdentifier } | null {\n const parts = reference.split(NOTIFICATION_BADGE_KEY_SEPARATOR);\n if (parts.length !== 3) return null;\n const [scope, scopeId, identifier] = parts;\n if (!isSupportedNotificationBadgeScope(scope) || scopeId.length === 0 || identifier.length === 0) return null;\n return { scope, scopeId, identifier };\n}\n\n/**\n * Reduce a wire reference to the DEFINITION key it addresses — the one hop the browser badge store\n * takes, so that what it keys on is what a navigation item resolves against.\n */\nexport function notificationBadgeKeyFromReference(reference: string): NotificationBadgeKey | null {\n const parsed = parseNotificationBadgeReference(reference);\n return parsed ? buildNotificationBadgeKey(parsed.scope, parsed.identifier) : null;\n}\n\n/** Whether a raw string names one of the two surviving badge scopes. */\nexport function isSupportedNotificationBadgeScope(scope: string): scope is NotificationScope {\n return scope === ResourcePrimaryScope.USER_SELF || scope === ResourcePrimaryScope.ORGANIZATIONS;\n}\n\n// ════════════════════════════════════════════════════════════════\n// Declaration coherence — checked at CONFIGURATION time\n// ════════════════════════════════════════════════════════════════\n\n/**\n * Why a badge declaration is refused. A closed vocabulary with a named runtime source, so a\n * diagnostic can be branched on and each member can carry its own explanation.\n */\nexport enum NotificationBadgeDeclarationViolationReason {\n /**\n * Two definitions declare the same `(scope, identifier)`. Every lookup resolves the FIRST, so\n * the second is unreachable while silently sharing the first's count — the shape that made\n * identifier-only lookup unsafe in the first place. Two definitions at DIFFERENT scopes are\n * fine and are exactly what the key makes reachable.\n */\n DUPLICATE_DEFINITION_KEY = 'duplicate_definition_key',\n /**\n * An identifier contains the key separator, which would make its key and every reference built\n * from it parse into the wrong parts. Refused rather than escaped: a positional format with an\n * escaping rule is a format two implementations will eventually disagree about.\n */\n IDENTIFIER_CONTAINS_KEY_SEPARATOR = 'identifier_contains_key_separator',\n /** An operation declares a `badgeRef` that names no registered definition. */\n OPERATION_REF_UNRESOLVED = 'operation_ref_unresolved',\n}\n\n/** One refused declaration, carrying enough to name the author's own file without re-deriving it. */\nexport interface NotificationBadgeDeclarationViolation {\n reason: NotificationBadgeDeclarationViolationReason;\n /** The badge key at issue — the definition's, or the unresolved `badgeRef` as authored. */\n badgeKey: string;\n /** Present when the violation belongs to a definition rather than to an operation declaration. */\n identifier?: NotificationBadgeIdentifier;\n /** Present when the violation belongs to an operation declaration. */\n resourceType?: string;\n /** Present when the violation belongs to an operation declaration. */\n operationIdentifier?: string;\n}\n\n/** Where an operation declared a badge reference — one row per authored `notificationBadgeOperations` entry. */\nexport interface NotificationBadgeOperationDeclarationSite {\n resourceType: string;\n operationIdentifier: string;\n badgeRef: string;\n}\n\n/**\n * The whole declaration-coherence check, as a pure function over what an application declared.\n *\n * Pure and shared on purpose: the backend registry runs it as a fail-closed boot gate and the\n * frontend launcher verifier reports it in development, and a second implementation is how the two\n * come to disagree about what a valid declaration is.\n *\n * It answers the question `derive-before-you-ask.md` asks — who owes this, and what says so. The\n * population is exactly the registered definitions plus every authored\n * `notificationBadgeOperations` entry; nothing is inferred and nothing is sampled.\n */\nexport function collectNotificationBadgeDeclarationViolations(\n definitions: readonly NotificationBadgeDefinition[],\n operationSites: readonly NotificationBadgeOperationDeclarationSite[] = [],\n): NotificationBadgeDeclarationViolation[] {\n const violations: NotificationBadgeDeclarationViolation[] = [];\n const seenKeys = new Set<NotificationBadgeKey>();\n\n for (const definition of definitions) {\n if (!NOTIFICATION_BADGE_IDENTIFIER_PATTERN.test(definition.identifier)) {\n violations.push({\n reason: NotificationBadgeDeclarationViolationReason.IDENTIFIER_CONTAINS_KEY_SEPARATOR,\n badgeKey: notificationBadgeIdentityKey(definition),\n identifier: definition.identifier,\n });\n // Still recorded below, so a malformed identifier declared twice is reported as both.\n }\n\n const key = notificationBadgeIdentityKey(definition);\n if (seenKeys.has(key)) {\n violations.push({\n reason: NotificationBadgeDeclarationViolationReason.DUPLICATE_DEFINITION_KEY,\n badgeKey: key,\n identifier: definition.identifier,\n });\n continue;\n }\n seenKeys.add(key);\n }\n\n for (const site of operationSites) {\n if (!seenKeys.has(site.badgeRef)) {\n violations.push({\n reason: NotificationBadgeDeclarationViolationReason.OPERATION_REF_UNRESOLVED,\n badgeKey: site.badgeRef,\n resourceType: site.resourceType,\n operationIdentifier: site.operationIdentifier,\n });\n }\n }\n\n return violations;\n}\n\n/**\n * Index the registered definitions by key, so a dispatch resolves in one lookup rather than a scan.\n *\n * Built from the SAME key function the boot check uses, so a definition the boot check accepted is\n * a definition this map can serve.\n */\nexport function buildNotificationBadgeDefinitionIndex(\n definitions: readonly NotificationBadgeDefinition[],\n): ReadonlyMap<NotificationBadgeKey, NotificationBadgeDefinition> {\n const index = new Map<NotificationBadgeKey, NotificationBadgeDefinition>();\n for (const definition of definitions) {\n const key = notificationBadgeIdentityKey(definition);\n if (!index.has(key)) index.set(key, definition);\n }\n return index;\n}\n"]}
|
|
@@ -39,7 +39,7 @@ import { NotificationBadgeUserSelfSchema, NotificationBadgeOrganizationSchema }
|
|
|
39
39
|
import { CoreResourceOperation } from '../resources/resources.shared.core.definitions';
|
|
40
40
|
import { ResourceRelationship } from '../resources/resources.shared.schemas';
|
|
41
41
|
import { ResourceConfiguration } from '../resources/resources-config.shared.schemas';
|
|
42
|
-
type UserNotificationBadgesCoreOperations = CoreResourceOperation.READ | CoreResourceOperation.LIST | CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE;
|
|
42
|
+
type UserNotificationBadgesCoreOperations = CoreResourceOperation.READ | CoreResourceOperation.LIST | CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE | CoreResourceOperation.UPDATE_MANY;
|
|
43
43
|
export declare const userNotificationBadgesResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => ResourceConfiguration<undefined, UserNotificationBadgesCoreOperations, typeof NotificationBadgeUserSelfSchema>;
|
|
44
44
|
type OrganizationNotificationBadgesCoreOperations = CoreResourceOperation.READ | CoreResourceOperation.LIST | CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE;
|
|
45
45
|
export declare const organizationNotificationBadgesResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => ResourceConfiguration<undefined, OrganizationNotificationBadgesCoreOperations, typeof NotificationBadgeOrganizationSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-badges.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/notifications/notification-badges.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,EACpC,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"notification-badges.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/notifications/notification-badges.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,EACpC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,qBAAqB,EAGtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAOrF,KAAK,oCAAoC,GACrC,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,WAAW,CAAC;AAEtC,eAAO,MAAM,iEAAiE,GAC5E,wBAAwB,oBAAoB,EAAE,KAC7C,qBAAqB,CACtB,SAAS,EACT,oCAAoC,EACpC,OAAO,+BAA+B,CA+HtC,CAAC;AAIH,KAAK,4CAA4C,GAC7C,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,yEAAyE,GACpF,wBAAwB,oBAAoB,EAAE,KAC7C,qBAAqB,CACtB,SAAS,EACT,4CAA4C,EAC5C,OAAO,mCAAmC,CAoF1C,CAAC"}
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
import { NotificationBadgeUserSelfSchema, NotificationBadgeOrganizationSchema, } from './notification-badges.schemas.js';
|
|
39
39
|
import { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory.js';
|
|
40
|
+
import { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas.js';
|
|
40
41
|
import { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier, } from '../resources/resources.shared.core.definitions.js';
|
|
41
42
|
import { ResourceOperationRiskLevel, ResourceOperationVariantType, } from '../resources/resources.shared.schemas.js';
|
|
42
43
|
import { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas.js';
|
|
@@ -51,6 +52,24 @@ export const userNotificationBadgesResourceConfiguration_InitializationFactory =
|
|
|
51
52
|
/** Subject-export disclosure. The subject's own data. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. */
|
|
52
53
|
systemAccessPolicy: { exportSubject: ResourceSystemAccessMode.ALLOWED },
|
|
53
54
|
portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.DERIVED },
|
|
55
|
+
/**
|
|
56
|
+
* Subject erasure RETAINS the badge row and scrubs nothing, because a badge holds nothing to scrub.
|
|
57
|
+
*
|
|
58
|
+
* `RETAIN_ONLY` is a positive assertion: a badge is a COUNTER and the reference to what it counts.
|
|
59
|
+
* Its only link to a person is the scope foreign key, which the never-scrub floor protects in every
|
|
60
|
+
* mode. The factory refuses this mode if any field declares an impersonalize treatment, so the
|
|
61
|
+
* claim is checked rather than trusted.
|
|
62
|
+
*
|
|
63
|
+
* Only the USER_SELF badge declares this. The organization badge is scoped to a tenant rather than
|
|
64
|
+
* a person and declares no `exportSubject`, so it is outside the subject-erasure population
|
|
65
|
+
* entirely — the two configs live in one file but address different collections, and nothing
|
|
66
|
+
* pairs them.
|
|
67
|
+
*/
|
|
68
|
+
retentionPolicy: {
|
|
69
|
+
mode: ErasureRetentionMode.RETAIN_ONLY,
|
|
70
|
+
},
|
|
71
|
+
/** The subject is the person whose unread counts these are, reached through the scope key. */
|
|
72
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.SELF_PRINCIPAL },
|
|
54
73
|
coreOperations: [
|
|
55
74
|
CoreResourceOperation.READ,
|
|
56
75
|
CoreResourceOperation.LIST,
|
|
@@ -61,8 +80,25 @@ export const userNotificationBadgesResourceConfiguration_InitializationFactory =
|
|
|
61
80
|
// must physically remove the row when its owning user/org is deleted. Without it
|
|
62
81
|
// the cascade throws ErrorType.CONFIGURATION on any parent that has a badge row.
|
|
63
82
|
CoreResourceOperation.DELETE,
|
|
83
|
+
// Route-less; `retentionPolicy` requires it (READ + LIST are already declared above).
|
|
84
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
64
85
|
],
|
|
65
86
|
operationsConfiguration: {
|
|
87
|
+
/*
|
|
88
|
+
* Route-less retention plumbing. INTERNAL_CALL registers no route, and must not be
|
|
89
|
+
* REPOSITORY_ONLY — the retention primitives resolve through `getServiceOperationPathDefault`,
|
|
90
|
+
* which excludes it, so that spelling passes the boot guard and fails when an erasure runs.
|
|
91
|
+
*/
|
|
92
|
+
[CoreResourceOperation.UPDATE_MANY]: {
|
|
93
|
+
variants: [
|
|
94
|
+
{
|
|
95
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
96
|
+
isDefault: true,
|
|
97
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
98
|
+
riskLevel: ResourceOperationRiskLevel.CRITICAL,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
66
102
|
[CoreResourceOperation.READ]: {
|
|
67
103
|
variants: [
|
|
68
104
|
{
|