@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
|
@@ -25,6 +25,37 @@ function normalizeScopes(scope) {
|
|
|
25
25
|
// defineFeature() — Boolean Feature Builder
|
|
26
26
|
// =====================================================
|
|
27
27
|
/**
|
|
28
|
+
* @wildo_source:part:start saas.models.features.definition-builders facet:layer:shared facet:audience:app-developer
|
|
29
|
+
*
|
|
30
|
+
* Declaring what an application can SELL or gate on. Two builders, from `@wildo-ai/saas-models`:
|
|
31
|
+
* `defineFeature` for a boolean capability, `defineLimitFeature` for a numeric allowance.
|
|
32
|
+
*
|
|
33
|
+
* A product in the billing catalogue then grants them through `grantedFeatures` / `grantedLimits`,
|
|
34
|
+
* and any surface gates on the identifier with `requiredFeatures` — a resource operation, a view, a
|
|
35
|
+
* chart, a navigation item, a settings section.
|
|
36
|
+
*
|
|
37
|
+
* ## Two things that decide whether the gate actually fires
|
|
38
|
+
*
|
|
39
|
+
* (`limitSemantic` is the third and is covered by the product-definitions skill's own guidance —
|
|
40
|
+
* the default `FLOOR` is an entitlement the tenant is ALLOWED, and a consumption CAP needs `CEILING`.)
|
|
41
|
+
*
|
|
42
|
+
* - **`countResource` is the one-call form.** It registers a limit check on that resource's CREATE
|
|
43
|
+
* automatically, so "at most ten projects per organisation" is one declaration rather than a
|
|
44
|
+
* definition plus a hand-written gate. A limit declared WITHOUT counting cannot be checked
|
|
45
|
+
* automatically: `checkLimit` REFUSES rather than guessing at a remaining quota, and the caller
|
|
46
|
+
* must pass a counting override or measure consumption itself. That is the right answer for a
|
|
47
|
+
* quantity that is not a row count — a sum of tokens, for instance.
|
|
48
|
+
* - **`rateLimit` on a definition is RESERVED and ignored by the gate.** A time-windowed allowance
|
|
49
|
+
* like "one hundred calls an hour" is not expressible here at all; abuse throttling is a separate
|
|
50
|
+
* mechanism with its own declaration.
|
|
51
|
+
*
|
|
52
|
+
* ## Granting a capability does not configure it
|
|
53
|
+
*
|
|
54
|
+
* An entitlement says the tenant MAY have the thing. Single sign-on entitles an organisation to
|
|
55
|
+
* register an identity provider; somebody still has to register one. The same holds for provisioning
|
|
56
|
+
* tokens, export destinations and webhook endpoints — so a plan that grants one of these still needs
|
|
57
|
+
* an onboarding step behind it.
|
|
58
|
+
*
|
|
28
59
|
* Simple boolean feature builder.
|
|
29
60
|
*
|
|
30
61
|
* @example
|
|
@@ -106,4 +137,5 @@ export function defineLimitFeature(identifier, options) {
|
|
|
106
137
|
}
|
|
107
138
|
return definition;
|
|
108
139
|
}
|
|
140
|
+
/** @wildo_source:part:end saas.models.features.definition-builders */
|
|
109
141
|
//# sourceMappingURL=feature-builders.shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-builders.shared.js","sourceRoot":"","sources":["../../../../src/features/feature-builders.shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,gBAAgB,GAMjB,MAAM,qCAAqC,CAAC;AAE7C,wDAAwD;AACxD,iCAAiC;AACjC,wDAAwD;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAajF,wDAAwD;AACxD,sBAAsB;AACtB,wDAAwD;AAExD,SAAS,eAAe,CAAC,KAAoD;IAC3E,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,wDAAwD;AACxD,4CAA4C;AAC5C,wDAAwD;AAExD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAkB,EAClB,OAKC;IAED,OAAO;QACL,U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cesContent":["/**\n * Feature Builder Utilities\n *\n * DX-oriented builder functions for defining features.\n * These handle boilerplate: scope normalization, default values, counting config generation.\n * Custom app developers should use these instead of raw FeatureDefinition objects.\n */\n\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n FeatureValueType,\n FEATURES_UNLIMITED,\n FeatureLimitSemantic,\n type FeatureDefinition,\n type FeatureUnavailabilityOverride,\n type LimitCountingConfig,\n} from './feature-definition.shared.schemas';\n\n// =====================================================\n// Internal: Auto-register marker\n// =====================================================\n\n/**\n * Internal marker symbol for limit features that should auto-register\n * a limitCheck on the counted resource's CREATE operation.\n * Used by FeatureDefinitionRegistryBackendService at startup.\n */\nexport const AUTO_REGISTER_LIMIT_CHECK = Symbol.for('AUTO_REGISTER_LIMIT_CHECK');\n\n/**\n * Extended FeatureDefinition with auto-register metadata.\n * This is the internal type returned by defineLimitFeature when countResource is provided.\n */\nexport type FeatureDefinitionWithAutoRegister = FeatureDefinition & {\n [AUTO_REGISTER_LIMIT_CHECK]?: {\n /** Resource type whose CREATE operation should get a limitCheck for this feature */\n countResource: string;\n };\n};\n\n// =====================================================\n// Scope Normalization\n// =====================================================\n\nfunction normalizeScopes(scope: ResourcePrimaryScope | ResourcePrimaryScope[]): ResourcePrimaryScope[] {\n return Array.isArray(scope) ? scope : [scope];\n}\n\n// =====================================================\n// defineFeature() — Boolean Feature Builder\n// =====================================================\n\n/**\n * Simple boolean feature builder.\n *\n * @example\n * defineFeature('AI_ASSISTANT', { scope: ResourcePrimaryScope.ORGANIZATIONS })\n *\n * @example\n * defineFeature('PREMIUM_THEMES', {\n * scope: ResourcePrimaryScope.USER_SELF,\n * unavailability: {\n * behavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n * },\n * })\n */\nexport function defineFeature(\n identifier: string,\n options: {\n scope: ResourcePrimaryScope | ResourcePrimaryScope[];\n defaultEnabled?: boolean;\n dependencies?: string[];\n unavailability?: FeatureUnavailabilityOverride;\n }\n): FeatureDefinition {\n return {\n identifier,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: normalizeScopes(options.scope),\n defaultValue: options.defaultEnabled ?? false,\n dependencies: options.dependencies ?? [],\n unavailability: options.unavailability,\n };\n}\n\n// =====================================================\n// defineLimitFeature() — Limit Feature Builder\n// =====================================================\n\n/**\n * Limit feature builder with auto-wiring support.\n *\n * Key DX improvement: when `countResource` is provided, the engine\n * auto-registers a `limitChecks` entry on the CREATE operation of the\n * referenced resource at startup (via FeatureDefinitionRegistryBackendService).\n *\n * This means: to add \"max 10 projects per org\", write ONE call and the\n * gate is automatically enforced. No need to manually add limitChecks on\n * the resource's operation variant.\n *\n * @example\n * defineLimitFeature('MAX_PROJECTS', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: 5,\n * countResource: CustomShared_ResourceType.PROJECTS,\n * })\n * // Equivalent to manually defining:\n * // { identifier: 'MAX_PROJECTS', valueType: LIMIT, applicableScopes: [ORGANIZATIONS],\n * // defaultValue: 5, counting: { resourceType: 'PROJECTS' } }\n * // + adding limitChecks: [{ featureId: 'MAX_PROJECTS' }] on PROJECTS.CREATE variant\n *\n * @example\n * defineLimitFeature('MAX_STORAGE_GB', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: 10,\n * counting: {\n * resourceType: 'FILES',\n * aggregate: { field: 'sizeBytes', operation: AggregationOperation.SUM },\n * },\n * })\n */\nexport function defineLimitFeature(\n identifier: string,\n options: {\n scope: ResourcePrimaryScope | ResourcePrimaryScope[];\n default: number;\n /**\n * How this limit COMPOSES when several sources supply a value (see {@link FeatureLimitSemantic}).\n * Omit for the default `FLOOR` — an entitlement the tenant is ALLOWED, where most-permissive\n * wins and add-ons stack upward (`MAX_MEMBERS`, `MAX_API_KEYS`).\n *\n * Pass `CEILING` for a consumption CAP the tenant may not exceed: most-RESTRICTIVE wins, and\n * `FEATURES_UNLIMITED` means \"no ceiling\" so it yields to any finite grant. Without it a cap is\n * inexpressible — under FLOOR an unlimited default absorbs every finite plan grant, so the cap\n * silently never engages.\n */\n limitSemantic?: FeatureLimitSemantic;\n /** Resource to count. Auto-registers a limitCheck on CREATE for this resource. */\n countResource?: string;\n /** Advanced: filter + aggregation for counting (overrides simple resource count) */\n counting?: LimitCountingConfig;\n /** If true, skip auto-registration of limitChecks on the resource's CREATE operation */\n skipAutoRegister?: boolean;\n dependencies?: string[];\n unavailability?: FeatureUnavailabilityOverride;\n }\n): FeatureDefinitionWithAutoRegister {\n // Build counting config: explicit counting takes precedence, then countResource, then nothing\n const counting: LimitCountingConfig | undefined =\n options.counting ??\n (options.countResource ? { resourceType: options.countResource } : undefined);\n\n const definition: FeatureDefinitionWithAutoRegister = {\n identifier,\n valueType: FeatureValueType.LIMIT,\n applicableScopes: normalizeScopes(options.scope),\n defaultValue: options.default,\n dependencies: options.dependencies ?? [],\n // Omitted ⇒ absent on the definition ⇒ read as FLOOR, so every existing caller is unchanged.\n ...(options.limitSemantic ? { limitSemantic: options.limitSemantic } : {}),\n counting,\n unavailability: options.unavailability,\n };\n\n // Add auto-register marker for limit features with countResource (unless skipped)\n if (options.countResource && !options.skipAutoRegister) {\n definition[AUTO_REGISTER_LIMIT_CHECK] = {\n countResource: options.countResource,\n };\n }\n\n return definition;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"feature-builders.shared.js","sourceRoot":"","sources":["../../../../src/features/feature-builders.shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,gBAAgB,GAMjB,MAAM,qCAAqC,CAAC;AAE7C,wDAAwD;AACxD,iCAAiC;AACjC,wDAAwD;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAajF,wDAAwD;AACxD,sBAAsB;AACtB,wDAAwD;AAExD,SAAS,eAAe,CAAC,KAAoD;IAC3E,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CA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;IAEF,kFAAkF;IAClF,IAAI,OAAO,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QACvD,UAAU,CAAC,yBAAyB,CAAC,GAAG;YACtC,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AACD,sEAAsE","sourcesContent":["/**\n * Feature Builder Utilities\n *\n * DX-oriented builder functions for defining features.\n * These handle boilerplate: scope normalization, default values, counting config generation.\n * Custom app developers should use these instead of raw FeatureDefinition objects.\n */\n\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n FeatureValueType,\n FEATURES_UNLIMITED,\n FeatureLimitSemantic,\n type FeatureDefinition,\n type FeatureUnavailabilityOverride,\n type LimitCountingConfig,\n} from './feature-definition.shared.schemas';\n\n// =====================================================\n// Internal: Auto-register marker\n// =====================================================\n\n/**\n * Internal marker symbol for limit features that should auto-register\n * a limitCheck on the counted resource's CREATE operation.\n * Used by FeatureDefinitionRegistryBackendService at startup.\n */\nexport const AUTO_REGISTER_LIMIT_CHECK = Symbol.for('AUTO_REGISTER_LIMIT_CHECK');\n\n/**\n * Extended FeatureDefinition with auto-register metadata.\n * This is the internal type returned by defineLimitFeature when countResource is provided.\n */\nexport type FeatureDefinitionWithAutoRegister = FeatureDefinition & {\n [AUTO_REGISTER_LIMIT_CHECK]?: {\n /** Resource type whose CREATE operation should get a limitCheck for this feature */\n countResource: string;\n };\n};\n\n// =====================================================\n// Scope Normalization\n// =====================================================\n\nfunction normalizeScopes(scope: ResourcePrimaryScope | ResourcePrimaryScope[]): ResourcePrimaryScope[] {\n return Array.isArray(scope) ? scope : [scope];\n}\n\n// =====================================================\n// defineFeature() — Boolean Feature Builder\n// =====================================================\n\n/**\n * @wildo_source:part:start saas.models.features.definition-builders facet:layer:shared facet:audience:app-developer\n *\n * Declaring what an application can SELL or gate on. Two builders, from `@wildo-ai/saas-models`:\n * `defineFeature` for a boolean capability, `defineLimitFeature` for a numeric allowance.\n *\n * A product in the billing catalogue then grants them through `grantedFeatures` / `grantedLimits`,\n * and any surface gates on the identifier with `requiredFeatures` — a resource operation, a view, a\n * chart, a navigation item, a settings section.\n *\n * ## Two things that decide whether the gate actually fires\n *\n * (`limitSemantic` is the third and is covered by the product-definitions skill's own guidance —\n * the default `FLOOR` is an entitlement the tenant is ALLOWED, and a consumption CAP needs `CEILING`.)\n *\n * - **`countResource` is the one-call form.** It registers a limit check on that resource's CREATE\n * automatically, so \"at most ten projects per organisation\" is one declaration rather than a\n * definition plus a hand-written gate. A limit declared WITHOUT counting cannot be checked\n * automatically: `checkLimit` REFUSES rather than guessing at a remaining quota, and the caller\n * must pass a counting override or measure consumption itself. That is the right answer for a\n * quantity that is not a row count — a sum of tokens, for instance.\n * - **`rateLimit` on a definition is RESERVED and ignored by the gate.** A time-windowed allowance\n * like \"one hundred calls an hour\" is not expressible here at all; abuse throttling is a separate\n * mechanism with its own declaration.\n *\n * ## Granting a capability does not configure it\n *\n * An entitlement says the tenant MAY have the thing. Single sign-on entitles an organisation to\n * register an identity provider; somebody still has to register one. The same holds for provisioning\n * tokens, export destinations and webhook endpoints — so a plan that grants one of these still needs\n * an onboarding step behind it.\n *\n * Simple boolean feature builder.\n *\n * @example\n * defineFeature('AI_ASSISTANT', { scope: ResourcePrimaryScope.ORGANIZATIONS })\n *\n * @example\n * defineFeature('PREMIUM_THEMES', {\n * scope: ResourcePrimaryScope.USER_SELF,\n * unavailability: {\n * behavior: FeatureUnavailabilityBehavior.UPGRADE_PROMPT,\n * },\n * })\n */\nexport function defineFeature(\n identifier: string,\n options: {\n scope: ResourcePrimaryScope | ResourcePrimaryScope[];\n defaultEnabled?: boolean;\n dependencies?: string[];\n unavailability?: FeatureUnavailabilityOverride;\n }\n): FeatureDefinition {\n return {\n identifier,\n valueType: FeatureValueType.BOOLEAN,\n applicableScopes: normalizeScopes(options.scope),\n defaultValue: options.defaultEnabled ?? false,\n dependencies: options.dependencies ?? [],\n unavailability: options.unavailability,\n };\n}\n\n// =====================================================\n// defineLimitFeature() — Limit Feature Builder\n// =====================================================\n\n/**\n * Limit feature builder with auto-wiring support.\n *\n * Key DX improvement: when `countResource` is provided, the engine\n * auto-registers a `limitChecks` entry on the CREATE operation of the\n * referenced resource at startup (via FeatureDefinitionRegistryBackendService).\n *\n * This means: to add \"max 10 projects per org\", write ONE call and the\n * gate is automatically enforced. No need to manually add limitChecks on\n * the resource's operation variant.\n *\n * @example\n * defineLimitFeature('MAX_PROJECTS', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: 5,\n * countResource: CustomShared_ResourceType.PROJECTS,\n * })\n * // Equivalent to manually defining:\n * // { identifier: 'MAX_PROJECTS', valueType: LIMIT, applicableScopes: [ORGANIZATIONS],\n * // defaultValue: 5, counting: { resourceType: 'PROJECTS' } }\n * // + adding limitChecks: [{ featureId: 'MAX_PROJECTS' }] on PROJECTS.CREATE variant\n *\n * @example\n * defineLimitFeature('MAX_STORAGE_GB', {\n * scope: ResourcePrimaryScope.ORGANIZATIONS,\n * default: 10,\n * counting: {\n * resourceType: 'FILES',\n * aggregate: { field: 'sizeBytes', operation: AggregationOperation.SUM },\n * },\n * })\n */\nexport function defineLimitFeature(\n identifier: string,\n options: {\n scope: ResourcePrimaryScope | ResourcePrimaryScope[];\n default: number;\n /**\n * How this limit COMPOSES when several sources supply a value (see {@link FeatureLimitSemantic}).\n * Omit for the default `FLOOR` — an entitlement the tenant is ALLOWED, where most-permissive\n * wins and add-ons stack upward (`MAX_MEMBERS`, `MAX_API_KEYS`).\n *\n * Pass `CEILING` for a consumption CAP the tenant may not exceed: most-RESTRICTIVE wins, and\n * `FEATURES_UNLIMITED` means \"no ceiling\" so it yields to any finite grant. Without it a cap is\n * inexpressible — under FLOOR an unlimited default absorbs every finite plan grant, so the cap\n * silently never engages.\n */\n limitSemantic?: FeatureLimitSemantic;\n /** Resource to count. Auto-registers a limitCheck on CREATE for this resource. */\n countResource?: string;\n /** Advanced: filter + aggregation for counting (overrides simple resource count) */\n counting?: LimitCountingConfig;\n /** If true, skip auto-registration of limitChecks on the resource's CREATE operation */\n skipAutoRegister?: boolean;\n dependencies?: string[];\n unavailability?: FeatureUnavailabilityOverride;\n }\n): FeatureDefinitionWithAutoRegister {\n // Build counting config: explicit counting takes precedence, then countResource, then nothing\n const counting: LimitCountingConfig | undefined =\n options.counting ??\n (options.countResource ? { resourceType: options.countResource } : undefined);\n\n const definition: FeatureDefinitionWithAutoRegister = {\n identifier,\n valueType: FeatureValueType.LIMIT,\n applicableScopes: normalizeScopes(options.scope),\n defaultValue: options.default,\n dependencies: options.dependencies ?? [],\n // Omitted ⇒ absent on the definition ⇒ read as FLOOR, so every existing caller is unchanged.\n ...(options.limitSemantic ? { limitSemantic: options.limitSemantic } : {}),\n counting,\n unavailability: options.unavailability,\n };\n\n // Add auto-register marker for limit features with countResource (unless skipped)\n if (options.countResource && !options.skipAutoRegister) {\n definition[AUTO_REGISTER_LIMIT_CHECK] = {\n countResource: options.countResource,\n };\n }\n\n return definition;\n}\n/** @wildo_source:part:end saas.models.features.definition-builders */\n"]}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { CoreResourceOperation } from '../resources/resources.shared.core.definitions';
|
|
9
9
|
import { ResourceRelationship } from '../resources/resources.shared.schemas';
|
|
10
|
-
type UserFeaturesCoreOperations = CoreResourceOperation.CREATE | CoreResourceOperation.READ | CoreResourceOperation.SEARCH | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE;
|
|
10
|
+
type UserFeaturesCoreOperations = CoreResourceOperation.CREATE | CoreResourceOperation.READ | CoreResourceOperation.LIST | CoreResourceOperation.UPDATE_MANY | CoreResourceOperation.SEARCH | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE;
|
|
11
11
|
export declare const userFeaturesResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => import("..").ResourceConfiguration<Record<string, never>, UserFeaturesCoreOperations, import("zod").ZodObject<{
|
|
12
12
|
features: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodEnum<typeof import("..").CoreFeature>, import("zod").ZodString]>>>>>;
|
|
13
13
|
limits: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodNumber>>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-features.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/user-features.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"user-features.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/features/user-features.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAA8B,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAQzG,KAAK,0BAA0B,GAC3B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,WAAW,GACjC,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,uDAAuD,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;iCA+IpH,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Uses ScopeFeaturesWithOverridesSchema as mainSchema (same pattern as org features).
|
|
7
7
|
*/
|
|
8
8
|
import { ScopeFeaturesWithOverridesSchema } from './scope-features.shared.schemas.js';
|
|
9
|
+
import { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas.js';
|
|
9
10
|
import { CoreResourceOperation } from '../resources/resources.shared.core.definitions.js';
|
|
10
11
|
import { ResourceOperationRiskLevel } from '../resources/resources.shared.schemas.js';
|
|
11
12
|
import { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions.js';
|
|
@@ -23,11 +24,31 @@ export const userFeaturesResourceConfiguration_InitializationFactory = (resource
|
|
|
23
24
|
/** 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. */
|
|
24
25
|
systemAccessPolicy: { exportSubject: ResourceSystemAccessMode.ALLOWED },
|
|
25
26
|
portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.DERIVED },
|
|
27
|
+
/**
|
|
28
|
+
* Subject erasure RETAINS this row and scrubs nothing, because there is nothing here to scrub.
|
|
29
|
+
*
|
|
30
|
+
* `RETAIN_ONLY` is a positive assertion, not a default: this resource holds feature toggles, added
|
|
31
|
+
* and removed feature keys, and numeric limit overrides. Its only link to a person is the scope
|
|
32
|
+
* foreign key, which the never-scrub floor protects in every mode. Declaring the mode is what lets a
|
|
33
|
+
* notice say what erasure does to these rows instead of reporting them as undeclared.
|
|
34
|
+
*
|
|
35
|
+
* The assertion is CHECKED: the factory refuses `RETAIN_ONLY` if any field declares an impersonalize
|
|
36
|
+
* treatment, because a treatment that would never run is a config claiming something the runtime
|
|
37
|
+
* would not honour.
|
|
38
|
+
*/
|
|
39
|
+
retentionPolicy: {
|
|
40
|
+
mode: ErasureRetentionMode.RETAIN_ONLY,
|
|
41
|
+
},
|
|
42
|
+
/** The subject is the person whose features these are, reached through the scope key. */
|
|
43
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.SELF_PRINCIPAL },
|
|
26
44
|
coreOperations: [
|
|
27
45
|
CoreResourceOperation.CREATE,
|
|
28
46
|
CoreResourceOperation.READ,
|
|
29
47
|
CoreResourceOperation.SEARCH,
|
|
30
48
|
CoreResourceOperation.UPDATE,
|
|
49
|
+
// Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY (see the variants).
|
|
50
|
+
CoreResourceOperation.LIST,
|
|
51
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
31
52
|
// DELETE is REPOSITORY_ONLY (no HTTP route): the scope-features ledger is not
|
|
32
53
|
// API-deletable, but the composition `onParentDelete` cascade must physically
|
|
33
54
|
// delete the row when its owning user is deleted. Without a DELETE op the cascade
|
|
@@ -37,6 +58,33 @@ export const userFeaturesResourceConfiguration_InitializationFactory = (resource
|
|
|
37
58
|
],
|
|
38
59
|
customOperation: {},
|
|
39
60
|
operationsConfiguration: {
|
|
61
|
+
/*
|
|
62
|
+
* Route-less retention plumbing — INTERNAL_CALL registers no route. Not REPOSITORY_ONLY: the
|
|
63
|
+
* retention primitives resolve through `getServiceOperationPathDefault`, which excludes it, so
|
|
64
|
+
* that spelling passes the boot guard and fails when an erasure runs. LIST is LOW because a
|
|
65
|
+
* read-shaped operation may not claim the HIGH/CRITICAL band — that band carries an audit-emission
|
|
66
|
+
* obligation, checked over the real engine catalogue.
|
|
67
|
+
*/
|
|
68
|
+
[CoreResourceOperation.LIST]: {
|
|
69
|
+
variants: [
|
|
70
|
+
{
|
|
71
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
72
|
+
isDefault: true,
|
|
73
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
74
|
+
riskLevel: ResourceOperationRiskLevel.LOW,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
[CoreResourceOperation.UPDATE_MANY]: {
|
|
79
|
+
variants: [
|
|
80
|
+
{
|
|
81
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
82
|
+
isDefault: true,
|
|
83
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
84
|
+
riskLevel: ResourceOperationRiskLevel.CRITICAL,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
40
88
|
[CoreResourceOperation.CREATE]: {
|
|
41
89
|
variants: [
|
|
42
90
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-features.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/features/user-features.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAwB,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAShG,MAAM,CAAC,MAAM,uDAAuD,GAAG,CAAC,sBAA8C,EAAE,EAAE,CAAC,0CAA0C,CAInK;IACA,UAAU,EAAE,gCAAgC;IAC5C,kBAAkB,EAAE,gBAAgB,CAAC,aAAa;IAClD,uBAAuB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,aAAa,CAAC;IAC3F,qBAAqB,EAAE,sBAAsB;IAC7C,gBAAgB,EAAE,IAAI;IAEtB,+JAA+J;IAC/J,kBAAkB,EAAE,EAAE,aAAa,EAAE,wBAAwB,CAAC,OAAO,EAAE;IACvE,iBAAiB,EAAE,EAAE,iBAAiB,EAAE,yBAAyB,CAAC,OAAO,EAAE;IAE3E,cAAc,EAAE;QACd,qBAAqB,CAAC,M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EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,UAAU,EAAE,gCAAgC,CAAC,OAAO,EAAE;iBACvD;aACF;SACF;QAED,kFAAkF;QAClF,4EAA4E;QAC5E,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,eAAe;oBACzD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * User Features Shared Resource Configuration\n *\n * Resource configuration for user-level feature management.\n * Controls which features are available to individual users (overrides/additions).\n * Uses ScopeFeaturesWithOverridesSchema as mainSchema (same pattern as org features).\n */\n\nimport { ScopeFeaturesWithOverridesSchema } from './scope-features.shared.schemas';\n\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\n\ntype UserFeaturesCoreOperations =\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.READ\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\nexport const userFeaturesResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n Record<string, never>,\n UserFeaturesCoreOperations,\n typeof ScopeFeaturesWithOverridesSchema\n>({\n mainSchema: ScopeFeaturesWithOverridesSchema,\n resourceIdentifier: CoreResourceType.USER_FEATURES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USER_FEATURES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n /** 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. */\n systemAccessPolicy: { exportSubject: ResourceSystemAccessMode.ALLOWED },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.DERIVED },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): the scope-features ledger is not\n // API-deletable, but the composition `onParentDelete` cascade must physically\n // delete the row when its owning user is deleted. Without a DELETE op the cascade\n // (`deleteChildrenImmediate`) throws ErrorType.CONFIGURATION on any user that has a\n // features row. See .claude/plans/composition-oncreate-lifecycle.md (FEATURES wave).\n CoreResourceOperation.DELETE,\n ],\n\n customOperation: {} as Record<string, never>,\n\n operationsConfiguration: {\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }\n ],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: false,\n searchableFields: [],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: {},\n sortFields: [],\n maxPaginatedResultPerPageLimit: 50,\n }],\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n requestDto: ScopeFeaturesWithOverridesSchema.partial(),\n }\n ],\n },\n\n // Internal-only (REPOSITORY_ONLY): powers the composition onParentDelete cascade,\n // not a public API surface — the ledger is reset, never DELETEd, over HTTP.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"user-features.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/features/user-features.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AAEvH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAwB,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iD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,EAAE;iBACnC,CAAC;SACH;QAED,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,UAAU,EAAE,gCAAgC,CAAC,OAAO,EAAE;iBACvD;aACF;SACF;QAED,kFAAkF;QAClF,4EAA4E;QAC5E,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,eAAe;oBACzD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * User Features Shared Resource Configuration\n *\n * Resource configuration for user-level feature management.\n * Controls which features are available to individual users (overrides/additions).\n * Uses ScopeFeaturesWithOverridesSchema as mainSchema (same pattern as org features).\n */\n\nimport { ScopeFeaturesWithOverridesSchema } from './scope-features.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\n\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\n\ntype UserFeaturesCoreOperations =\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.UPDATE_MANY\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\nexport const userFeaturesResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n Record<string, never>,\n UserFeaturesCoreOperations,\n typeof ScopeFeaturesWithOverridesSchema\n>({\n mainSchema: ScopeFeaturesWithOverridesSchema,\n resourceIdentifier: CoreResourceType.USER_FEATURES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USER_FEATURES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n /** 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. */\n systemAccessPolicy: { exportSubject: ResourceSystemAccessMode.ALLOWED },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.DERIVED },\n\n\n /**\n * Subject erasure RETAINS this row and scrubs nothing, because there is nothing here to scrub.\n *\n * `RETAIN_ONLY` is a positive assertion, not a default: this resource holds feature toggles, added\n * and removed feature keys, and numeric limit overrides. Its only link to a person is the scope\n * foreign key, which the never-scrub floor protects in every mode. Declaring the mode is what lets a\n * notice say what erasure does to these rows instead of reporting them as undeclared.\n *\n * The assertion is CHECKED: the factory refuses `RETAIN_ONLY` if any field declares an impersonalize\n * treatment, because a treatment that would never run is a config claiming something the runtime\n * would not honour.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_ONLY,\n },\n\n /** The subject is the person whose features these are, reached through the scope key. */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.SELF_PRINCIPAL },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.UPDATE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY (see the variants).\n CoreResourceOperation.LIST,\n CoreResourceOperation.UPDATE_MANY,\n // DELETE is REPOSITORY_ONLY (no HTTP route): the scope-features ledger is not\n // API-deletable, but the composition `onParentDelete` cascade must physically\n // delete the row when its owning user is deleted. Without a DELETE op the cascade\n // (`deleteChildrenImmediate`) throws ErrorType.CONFIGURATION on any user that has a\n // features row. See .claude/plans/composition-oncreate-lifecycle.md (FEATURES wave).\n CoreResourceOperation.DELETE,\n ],\n\n customOperation: {} as Record<string, never>,\n\n operationsConfiguration: {\n /*\n * Route-less retention plumbing — INTERNAL_CALL registers no route. Not REPOSITORY_ONLY: the\n * retention primitives resolve through `getServiceOperationPathDefault`, which excludes it, so\n * that spelling passes the boot guard and fails when an erasure runs. LIST is LOW because a\n * read-shaped operation may not claim the HIGH/CRITICAL band — that band carries an audit-emission\n * obligation, checked over the real engine catalogue.\n */\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n [CoreResourceOperation.UPDATE_MANY]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n },\n ],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }\n ],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: false,\n searchableFields: [],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: {},\n sortFields: [],\n maxPaginatedResultPerPageLimit: 50,\n }],\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n requestDto: ScopeFeaturesWithOverridesSchema.partial(),\n }\n ],\n },\n\n // Internal-only (REPOSITORY_ONLY): powers the composition onParentDelete cascade,\n // not a public API surface — the ledger is reset, never DELETEd, over HTTP.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n },\n});\n"]}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FileUploaderEntityType } from '@wildo-ai/zod-decorators';
|
|
3
|
+
import { CoreResourceOperation } from '../resources/resources.shared.core.definitions';
|
|
4
|
+
import { FileStatus } from './files.shared.schemas';
|
|
5
|
+
/**
|
|
6
|
+
* File upload grant — the shared contract between the two mint doors (REST, MCP), the upload route,
|
|
7
|
+
* the status read, and the browser drop page (issue #312).
|
|
8
|
+
*
|
|
9
|
+
* A grant is a single-use consumable token. Nothing durable is created at mint but the token: an
|
|
10
|
+
* abandoned grant leaves a dead token and nothing else. The upload itself goes through the resource's
|
|
11
|
+
* EXISTING file-upload route, authenticated by the grant alone, and the ordinary authorizer decides.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Public frontend route the browser drop page lives on; the token follows as the next path segment
|
|
15
|
+
* (`/upload-grant/<token>`). Declared HERE so the backend (which builds `uploadPageUrl`) and the
|
|
16
|
+
* frontend (which mounts the route) read one source — the backend cannot import frontend route
|
|
17
|
+
* constants.
|
|
18
|
+
*/
|
|
19
|
+
export declare const FILE_UPLOAD_GRANT_PAGE_PATH = "/upload-grant";
|
|
20
|
+
/** @wildo_source:part:start saas.models.file-upload-grant facet:layer:shared facet:family:files
|
|
21
|
+
*
|
|
22
|
+
* Lifetime bounds of an upload grant, in minutes. The ceiling is fixed by the framework and enforced
|
|
23
|
+
* when the grant is minted — a request above it is REFUSED, never clamped, so a caller that asked for
|
|
24
|
+
* two hours learns from an error that the bound is sixty minutes rather than from an expiry it did not
|
|
25
|
+
* expect. The bound is the framework's to own because the grant is designed to leave the trust
|
|
26
|
+
* boundary: it lands in an AI agent's transcript, a model provider's logs, a shell history.
|
|
27
|
+
*/
|
|
28
|
+
export declare const FILE_UPLOAD_GRANT_DEFAULT_MINUTES = 15;
|
|
29
|
+
export declare const FILE_UPLOAD_GRANT_ABSOLUTE_MAX_MINUTES = 60;
|
|
30
|
+
/**
|
|
31
|
+
* Which write the grant is for. A grant minted on the CREATE upload route uploads a file that a
|
|
32
|
+
* later CREATE will reference; one minted on the UPDATE route (`…/{resourceId}/files/<field>`) is
|
|
33
|
+
* bound to that row. The two routes authorize differently, so a grant may not cross from one to the
|
|
34
|
+
* other — the upload middleware checks this against the route it is presented on.
|
|
35
|
+
*/
|
|
36
|
+
export declare const FILE_UPLOAD_GRANT_OPERATIONS: readonly [CoreResourceOperation.CREATE, CoreResourceOperation.UPDATE];
|
|
37
|
+
export type FileUploadGrantOperation = (typeof FILE_UPLOAD_GRANT_OPERATIONS)[number];
|
|
38
|
+
/** Derived from `CoreResourceOperation` — the named source — rather than a second enum spelling the same two words. */
|
|
39
|
+
export declare const FileUploadGrantOperationSchema: z.ZodEnum<{
|
|
40
|
+
[K in FileUploadGrantOperation]: K;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Lifecycle of a grant as the status read reports it. Derived from the token row — `isConsumed`,
|
|
44
|
+
* `expiresAt`, `revokedAt` — never stored, so it cannot drift from the row.
|
|
45
|
+
*/
|
|
46
|
+
export declare enum FileUploadGrantState {
|
|
47
|
+
/** Minted, unexpired, unrevoked, not yet redeemed: an upload will be accepted. */
|
|
48
|
+
PENDING = "pending",
|
|
49
|
+
/** Redeemed by exactly one upload. `file` names what it produced when the write-back succeeded. */
|
|
50
|
+
REDEEMED = "redeemed",
|
|
51
|
+
/** Past `expiresAt` without being redeemed. Mint a new one. */
|
|
52
|
+
EXPIRED = "expired",
|
|
53
|
+
/** Revoked by the minter or an administrator before redemption. */
|
|
54
|
+
REVOKED = "revoked"
|
|
55
|
+
}
|
|
56
|
+
export declare const FileUploadGrantStateSchema: z.ZodEnum<typeof FileUploadGrantState>;
|
|
57
|
+
/**
|
|
58
|
+
* The `metadata` a FILE_UPLOAD_GRANT token carries — the ROUTE binding, as opposed to the identity
|
|
59
|
+
* the typed token fields carry. The upload middleware reads this; the execution-context creator
|
|
60
|
+
* deliberately does not.
|
|
61
|
+
*/
|
|
62
|
+
export declare const FileUploadGrantMetadataSchema: z.ZodObject<{
|
|
63
|
+
fieldName: z.ZodString;
|
|
64
|
+
operation: z.ZodEnum<{
|
|
65
|
+
[K in FileUploadGrantOperation]: K;
|
|
66
|
+
}>;
|
|
67
|
+
minter: z.ZodObject<{
|
|
68
|
+
entityType: z.ZodEnum<typeof FileUploaderEntityType>;
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
}>;
|
|
71
|
+
uploadUrl: z.ZodString;
|
|
72
|
+
producedFileId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}>;
|
|
74
|
+
export type FileUploadGrantMetadata = z.infer<typeof FileUploadGrantMetadataSchema>;
|
|
75
|
+
/**
|
|
76
|
+
* What a mint returns — identical on the REST door and the MCP tool. Two affordances for one
|
|
77
|
+
* token: `uploadCommand` for a caller that can execute, `uploadPageUrl` for one that must hand a
|
|
78
|
+
* human a link. The token appears in `uploadHeader.value` and inside both commands and the page URL;
|
|
79
|
+
* it is the credential and cannot be omitted. It never appears in any audit row.
|
|
80
|
+
*/
|
|
81
|
+
export declare const FileUploadGrantSchema: z.ZodObject<{
|
|
82
|
+
grantId: z.ZodString;
|
|
83
|
+
state: z.ZodEnum<typeof FileUploadGrantState>;
|
|
84
|
+
expiresAt: z.ZodString;
|
|
85
|
+
singleUse: z.ZodLiteral<true>;
|
|
86
|
+
target: z.ZodObject<{
|
|
87
|
+
resourceType: z.ZodString;
|
|
88
|
+
fieldName: z.ZodString;
|
|
89
|
+
operation: z.ZodEnum<{
|
|
90
|
+
[K in FileUploadGrantOperation]: K;
|
|
91
|
+
}>;
|
|
92
|
+
resourceId: z.ZodNullable<z.ZodString>;
|
|
93
|
+
}>;
|
|
94
|
+
constraints: z.ZodObject<{
|
|
95
|
+
maxBytes: z.ZodNumber;
|
|
96
|
+
allowedMimeTypes: z.ZodArray<z.ZodString>;
|
|
97
|
+
}>;
|
|
98
|
+
uploadUrl: z.ZodString;
|
|
99
|
+
uploadHeader: z.ZodObject<{
|
|
100
|
+
name: z.ZodString;
|
|
101
|
+
value: z.ZodString;
|
|
102
|
+
}>;
|
|
103
|
+
uploadCommand: z.ZodString;
|
|
104
|
+
uploadCommandPowerShell: z.ZodString;
|
|
105
|
+
uploadPageUrl: z.ZodNullable<z.ZodString>;
|
|
106
|
+
statusUrl: z.ZodString;
|
|
107
|
+
note: z.ZodString;
|
|
108
|
+
}>;
|
|
109
|
+
export type FileUploadGrant = z.infer<typeof FileUploadGrantSchema>;
|
|
110
|
+
/**
|
|
111
|
+
* What the public status read returns. The token is the credential, so the read is unauthenticated
|
|
112
|
+
* and returns only what the drop page needs to render and the agent needs to learn the `fileId`:
|
|
113
|
+
* never the file's name (the status URL may be pasted around).
|
|
114
|
+
*/
|
|
115
|
+
export declare const FileUploadGrantStatusSchema: z.ZodObject<{
|
|
116
|
+
grantId: z.ZodString;
|
|
117
|
+
state: z.ZodEnum<typeof FileUploadGrantState>;
|
|
118
|
+
expiresAt: z.ZodString;
|
|
119
|
+
target: z.ZodObject<{
|
|
120
|
+
resourceType: z.ZodString;
|
|
121
|
+
fieldName: z.ZodString;
|
|
122
|
+
operation: z.ZodEnum<{
|
|
123
|
+
[K in FileUploadGrantOperation]: K;
|
|
124
|
+
}>;
|
|
125
|
+
resourceId: z.ZodNullable<z.ZodString>;
|
|
126
|
+
}>;
|
|
127
|
+
constraints: z.ZodObject<{
|
|
128
|
+
maxBytes: z.ZodNumber;
|
|
129
|
+
allowedMimeTypes: z.ZodArray<z.ZodString>;
|
|
130
|
+
}>;
|
|
131
|
+
uploadUrl: z.ZodString;
|
|
132
|
+
uploadHeaderName: z.ZodString;
|
|
133
|
+
file: z.ZodNullable<z.ZodObject<{
|
|
134
|
+
fileId: z.ZodString;
|
|
135
|
+
status: z.ZodEnum<typeof FileStatus>;
|
|
136
|
+
}>>;
|
|
137
|
+
}>;
|
|
138
|
+
export type FileUploadGrantStatus = z.infer<typeof FileUploadGrantStatusSchema>;
|
|
139
|
+
/**
|
|
140
|
+
* Body accepted by both mint doors.
|
|
141
|
+
*
|
|
142
|
+
* The three optional file facts mirror what the MCP File Objects proposal has a client declare when
|
|
143
|
+
* it asks to upload (`name`, `mimeType`, `size`): declaring them lets the server refuse a file the
|
|
144
|
+
* field would never accept BEFORE handing out a link, instead of at redemption when the link is
|
|
145
|
+
* already spent. They are advisory for the upload itself — the bytes are validated on receipt
|
|
146
|
+
* regardless — and a declaration that later disagrees with the bytes is refused on receipt too.
|
|
147
|
+
*/
|
|
148
|
+
export declare const FileUploadGrantMintRequestSchema: z.ZodObject<{
|
|
149
|
+
expiresInMinutes: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
name: z.ZodOptional<z.ZodString>;
|
|
151
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
152
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
}>;
|
|
154
|
+
export type FileUploadGrantMintRequest = z.infer<typeof FileUploadGrantMintRequestSchema>;
|
|
155
|
+
/** @wildo_source:part:end saas.models.file-upload-grant */
|
|
156
|
+
//# sourceMappingURL=file-upload-grant.shared.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload-grant.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/files/file-upload-grant.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAE3D;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,KAAK,CAAC;AACpD,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,uEAAwE,CAAC;AAClH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AACrF,uHAAuH;AACvH,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CAAC;KAAG,CAAC,IAAI,wBAAwB,GAAG,CAAC;CAAE,CAAwC,CAAC;AAEtI;;;GAGG;AACH,oBAAY,oBAAoB;IAC9B,kFAAkF;IAClF,OAAO,YAAY;IACnB,mGAAmG;IACnG,QAAQ,aAAa;IACrB,+DAA+D;IAC/D,OAAO,YAAY;IACnB,mEAAmE;IACnE,OAAO,YAAY;CACpB;AACD,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,oBAAoB,CAAgC,CAAC;AAE/G;;;;GAIG;AAC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C,CAAC,SAAS,CAAC;QAAE,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC;QAAC,gBAAgB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;KAAE,CAAC,CAAC;IAC/F,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;QAAE,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC;QAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,UAAU,CAAC,CAAA;KAAE,CAAC,CAAC,CAAC;CACjG,CAgBC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,SAAS,CAAC;IACzD,gBAAgB,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACjC,QAAQ,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;CAClC,CAQU,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,2DAA2D"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FileUploaderEntityType } from '@wildo-ai/zod-decorators';
|
|
3
|
+
import { CoreResourceOperation } from '../resources/resources.shared.core.definitions.js';
|
|
4
|
+
import { FileStatus } from './files.shared.schemas.js';
|
|
5
|
+
/**
|
|
6
|
+
* File upload grant — the shared contract between the two mint doors (REST, MCP), the upload route,
|
|
7
|
+
* the status read, and the browser drop page (issue #312).
|
|
8
|
+
*
|
|
9
|
+
* A grant is a single-use consumable token. Nothing durable is created at mint but the token: an
|
|
10
|
+
* abandoned grant leaves a dead token and nothing else. The upload itself goes through the resource's
|
|
11
|
+
* EXISTING file-upload route, authenticated by the grant alone, and the ordinary authorizer decides.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Public frontend route the browser drop page lives on; the token follows as the next path segment
|
|
15
|
+
* (`/upload-grant/<token>`). Declared HERE so the backend (which builds `uploadPageUrl`) and the
|
|
16
|
+
* frontend (which mounts the route) read one source — the backend cannot import frontend route
|
|
17
|
+
* constants.
|
|
18
|
+
*/
|
|
19
|
+
export const FILE_UPLOAD_GRANT_PAGE_PATH = '/upload-grant';
|
|
20
|
+
/** @wildo_source:part:start saas.models.file-upload-grant facet:layer:shared facet:family:files
|
|
21
|
+
*
|
|
22
|
+
* Lifetime bounds of an upload grant, in minutes. The ceiling is fixed by the framework and enforced
|
|
23
|
+
* when the grant is minted — a request above it is REFUSED, never clamped, so a caller that asked for
|
|
24
|
+
* two hours learns from an error that the bound is sixty minutes rather than from an expiry it did not
|
|
25
|
+
* expect. The bound is the framework's to own because the grant is designed to leave the trust
|
|
26
|
+
* boundary: it lands in an AI agent's transcript, a model provider's logs, a shell history.
|
|
27
|
+
*/
|
|
28
|
+
export const FILE_UPLOAD_GRANT_DEFAULT_MINUTES = 15;
|
|
29
|
+
export const FILE_UPLOAD_GRANT_ABSOLUTE_MAX_MINUTES = 60;
|
|
30
|
+
/**
|
|
31
|
+
* Which write the grant is for. A grant minted on the CREATE upload route uploads a file that a
|
|
32
|
+
* later CREATE will reference; one minted on the UPDATE route (`…/{resourceId}/files/<field>`) is
|
|
33
|
+
* bound to that row. The two routes authorize differently, so a grant may not cross from one to the
|
|
34
|
+
* other — the upload middleware checks this against the route it is presented on.
|
|
35
|
+
*/
|
|
36
|
+
export const FILE_UPLOAD_GRANT_OPERATIONS = [CoreResourceOperation.CREATE, CoreResourceOperation.UPDATE];
|
|
37
|
+
/** Derived from `CoreResourceOperation` — the named source — rather than a second enum spelling the same two words. */
|
|
38
|
+
export const FileUploadGrantOperationSchema = z.enum(FILE_UPLOAD_GRANT_OPERATIONS);
|
|
39
|
+
/**
|
|
40
|
+
* Lifecycle of a grant as the status read reports it. Derived from the token row — `isConsumed`,
|
|
41
|
+
* `expiresAt`, `revokedAt` — never stored, so it cannot drift from the row.
|
|
42
|
+
*/
|
|
43
|
+
export var FileUploadGrantState;
|
|
44
|
+
(function (FileUploadGrantState) {
|
|
45
|
+
/** Minted, unexpired, unrevoked, not yet redeemed: an upload will be accepted. */
|
|
46
|
+
FileUploadGrantState["PENDING"] = "pending";
|
|
47
|
+
/** Redeemed by exactly one upload. `file` names what it produced when the write-back succeeded. */
|
|
48
|
+
FileUploadGrantState["REDEEMED"] = "redeemed";
|
|
49
|
+
/** Past `expiresAt` without being redeemed. Mint a new one. */
|
|
50
|
+
FileUploadGrantState["EXPIRED"] = "expired";
|
|
51
|
+
/** Revoked by the minter or an administrator before redemption. */
|
|
52
|
+
FileUploadGrantState["REVOKED"] = "revoked";
|
|
53
|
+
})(FileUploadGrantState || (FileUploadGrantState = {}));
|
|
54
|
+
export const FileUploadGrantStateSchema = z.enum(FileUploadGrantState);
|
|
55
|
+
/**
|
|
56
|
+
* The `metadata` a FILE_UPLOAD_GRANT token carries — the ROUTE binding, as opposed to the identity
|
|
57
|
+
* the typed token fields carry. The upload middleware reads this; the execution-context creator
|
|
58
|
+
* deliberately does not.
|
|
59
|
+
*/
|
|
60
|
+
export const FileUploadGrantMetadataSchema = z.object({
|
|
61
|
+
/** The `z_file()` field the upload lands on, as authored (dotted for nested fields). */
|
|
62
|
+
fieldName: z.string().min(1),
|
|
63
|
+
operation: FileUploadGrantOperationSchema,
|
|
64
|
+
/**
|
|
65
|
+
* Who minted — recorded so the uploaded file is attributed to a PERSON or MACHINE, not to the
|
|
66
|
+
* grant.
|
|
67
|
+
*
|
|
68
|
+
* `entityType` is the ENUM, not a string. It was `z.string().min(1)` until 2026-09-08, with the
|
|
69
|
+
* stated reason that "the uploader enum lives in `zod-decorators`, upstream of this package" —
|
|
70
|
+
* which is exactly backwards: upstream is what a package MAY import, and this one already does.
|
|
71
|
+
* `files.shared.schemas.ts` in this very directory imports `FileUploaderEntityType` from
|
|
72
|
+
* `@wildo-ai/zod-decorators`, re-exports it, and writes `z.enum(FileUploaderEntityType)` on the
|
|
73
|
+
* FILES row's own `uploadedByEntityType`. So the vocabulary was one import away the whole time and
|
|
74
|
+
* the metadata's copy of the same field was the only one left open.
|
|
75
|
+
*
|
|
76
|
+
* What the enum buys: `metadata` is an UNTYPED bag on the token row, so nothing between the write
|
|
77
|
+
* and the read guarantees its shape — the read is the only place that can. Every reader here goes
|
|
78
|
+
* through `FileUploadGrantMetadataSchema.safeParse`, so an out-of-vocabulary entity type now makes
|
|
79
|
+
* the whole metadata unparseable and the redemption path refuses the grant instead of casting the
|
|
80
|
+
* value into `FileUploaderPrincipal` and carrying it three layers to `validateUploadedByEntityType`.
|
|
81
|
+
*
|
|
82
|
+
* NOT narrowed to the three values `mint` can actually produce (mint refuses an anonymous and a
|
|
83
|
+
* token-borne minter, so `ANONYMOUS_USER` is unreachable): that refusal is a MINT policy, enforced
|
|
84
|
+
* and explained at mint, and re-encoding it here would put half a policy in a schema that cannot
|
|
85
|
+
* say why. The vocabulary of this field is the vocabulary of the principal it names.
|
|
86
|
+
*/
|
|
87
|
+
minter: z.object({ entityType: z.enum(FileUploaderEntityType), id: z.string().min(1) }),
|
|
88
|
+
/**
|
|
89
|
+
* The concrete upload URL the grant was minted for. Two jobs, and the second one is why it must be
|
|
90
|
+
* absolute: the status read hands it to the drop page, AND the redemption path compares its PATH
|
|
91
|
+
* against the route the token is presented on (`assertGrantMatchesRoute`). Until 2026-09-08 it was
|
|
92
|
+
* recorded and never read back, so a grant bound to one concrete route could be redeemed on any
|
|
93
|
+
* other route reaching the same (resource, field, operation, row).
|
|
94
|
+
*/
|
|
95
|
+
uploadUrl: z.string().url(),
|
|
96
|
+
/** Written after a successful redemption; absent until then. */
|
|
97
|
+
producedFileId: z.string().min(1).optional(),
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* What a mint returns — identical on the REST door and the MCP tool. Two affordances for one
|
|
101
|
+
* token: `uploadCommand` for a caller that can execute, `uploadPageUrl` for one that must hand a
|
|
102
|
+
* human a link. The token appears in `uploadHeader.value` and inside both commands and the page URL;
|
|
103
|
+
* it is the credential and cannot be omitted. It never appears in any audit row.
|
|
104
|
+
*/
|
|
105
|
+
export const FileUploadGrantSchema = z.object({
|
|
106
|
+
grantId: z.string().min(1),
|
|
107
|
+
state: FileUploadGrantStateSchema,
|
|
108
|
+
expiresAt: z.string().datetime(),
|
|
109
|
+
singleUse: z.literal(true),
|
|
110
|
+
target: z.object({
|
|
111
|
+
resourceType: z.string().min(1),
|
|
112
|
+
fieldName: z.string().min(1),
|
|
113
|
+
operation: FileUploadGrantOperationSchema,
|
|
114
|
+
resourceId: z.string().min(1).nullable(),
|
|
115
|
+
}),
|
|
116
|
+
/** From the field's own constraint resolver — the same one the upload enforces, so the two cannot disagree. */
|
|
117
|
+
constraints: z.object({
|
|
118
|
+
maxBytes: z.number().int().positive(),
|
|
119
|
+
/** Empty means every type is accepted. */
|
|
120
|
+
allowedMimeTypes: z.array(z.string()),
|
|
121
|
+
}),
|
|
122
|
+
uploadUrl: z.string().url(),
|
|
123
|
+
/** The credential travels in a HEADER on the curl form: paths are logged by every proxy, headers are not. */
|
|
124
|
+
uploadHeader: z.object({ name: z.string().min(1), value: z.string().min(1) }),
|
|
125
|
+
/** No `-f`: on a refusal the JSON error body is the only thing that tells the caller why. */
|
|
126
|
+
uploadCommand: z.string().min(1),
|
|
127
|
+
/** In PowerShell `curl` aliases Invoke-WebRequest, which does not understand `-F`; the real binary is `curl.exe`. */
|
|
128
|
+
uploadCommandPowerShell: z.string().min(1),
|
|
129
|
+
/** `null` when the application declares no frontend service — a headless API has no page to hand a human. */
|
|
130
|
+
uploadPageUrl: z.string().url().nullable(),
|
|
131
|
+
statusUrl: z.string().url(),
|
|
132
|
+
note: z.string().min(1),
|
|
133
|
+
});
|
|
134
|
+
/**
|
|
135
|
+
* What the public status read returns. The token is the credential, so the read is unauthenticated
|
|
136
|
+
* and returns only what the drop page needs to render and the agent needs to learn the `fileId`:
|
|
137
|
+
* never the file's name (the status URL may be pasted around).
|
|
138
|
+
*/
|
|
139
|
+
export const FileUploadGrantStatusSchema = z.object({
|
|
140
|
+
grantId: z.string().min(1),
|
|
141
|
+
state: FileUploadGrantStateSchema,
|
|
142
|
+
expiresAt: z.string().datetime(),
|
|
143
|
+
target: z.object({
|
|
144
|
+
resourceType: z.string().min(1),
|
|
145
|
+
fieldName: z.string().min(1),
|
|
146
|
+
operation: FileUploadGrantOperationSchema,
|
|
147
|
+
resourceId: z.string().min(1).nullable(),
|
|
148
|
+
}),
|
|
149
|
+
constraints: z.object({ maxBytes: z.number().int().positive(), allowedMimeTypes: z.array(z.string()) }),
|
|
150
|
+
uploadUrl: z.string().url(),
|
|
151
|
+
/** The page sets this header itself; the token it already holds is the value. */
|
|
152
|
+
uploadHeaderName: z.string().min(1),
|
|
153
|
+
/** `null` until redeemed, or when the post-redemption write-back failed (re-read the resource instead). */
|
|
154
|
+
file: z.object({ fileId: z.string().min(1), status: z.enum(FileStatus) }).nullable(),
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Body accepted by both mint doors.
|
|
158
|
+
*
|
|
159
|
+
* The three optional file facts mirror what the MCP File Objects proposal has a client declare when
|
|
160
|
+
* it asks to upload (`name`, `mimeType`, `size`): declaring them lets the server refuse a file the
|
|
161
|
+
* field would never accept BEFORE handing out a link, instead of at redemption when the link is
|
|
162
|
+
* already spent. They are advisory for the upload itself — the bytes are validated on receipt
|
|
163
|
+
* regardless — and a declaration that later disagrees with the bytes is refused on receipt too.
|
|
164
|
+
*/
|
|
165
|
+
export const FileUploadGrantMintRequestSchema = z.object({
|
|
166
|
+
expiresInMinutes: z.number().int().min(1).max(FILE_UPLOAD_GRANT_ABSOLUTE_MAX_MINUTES).optional(),
|
|
167
|
+
/** The file name the caller intends to upload; used for the curl example and checked against nothing else. */
|
|
168
|
+
name: z.string().min(1).max(255).optional(),
|
|
169
|
+
/** Declared MIME type; refused at mint when the field does not accept it. */
|
|
170
|
+
mimeType: z.string().min(1).max(255).optional(),
|
|
171
|
+
/** Declared size in bytes; refused at mint when above the field's maximum. */
|
|
172
|
+
size: z.number().int().positive().optional(),
|
|
173
|
+
}).strict();
|
|
174
|
+
/** @wildo_source:part:end saas.models.file-upload-grant */
|
|
175
|
+
//# sourceMappingURL=file-upload-grant.shared.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload-grant.shared.schemas.js","sourceRoot":"","sources":["../../../../src/files/file-upload-grant.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAC;AACpD,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,CAAC,MAAM,CAAU,CAAC;AAElH,uHAAuH;AACvH,MAAM,CAAC,MAAM,8BAA8B,GAAsD,C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AAC;AAGH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAKxC,CAAC,CAAC,MAAM,CAAC;IACZ,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC,QAAQ,EAAE;IAChG,8GAA8G;IAC9G,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3C,6EAA6E;IAC7E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC/C,8EAA8E;IAC9E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC,MAAM,EAAE,CAAC;AAEZ,2DAA2D","sourcesContent":["import { z } from 'zod';\nimport { FileUploaderEntityType } from '@wildo-ai/zod-decorators';\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { FileStatus } from './files.shared.schemas';\n\n/**\n * File upload grant — the shared contract between the two mint doors (REST, MCP), the upload route,\n * the status read, and the browser drop page (issue #312).\n *\n * A grant is a single-use consumable token. Nothing durable is created at mint but the token: an\n * abandoned grant leaves a dead token and nothing else. The upload itself goes through the resource's\n * EXISTING file-upload route, authenticated by the grant alone, and the ordinary authorizer decides.\n */\n\n/**\n * Public frontend route the browser drop page lives on; the token follows as the next path segment\n * (`/upload-grant/<token>`). Declared HERE so the backend (which builds `uploadPageUrl`) and the\n * frontend (which mounts the route) read one source — the backend cannot import frontend route\n * constants.\n */\nexport const FILE_UPLOAD_GRANT_PAGE_PATH = '/upload-grant';\n\n/** @wildo_source:part:start saas.models.file-upload-grant facet:layer:shared facet:family:files\n *\n * Lifetime bounds of an upload grant, in minutes. The ceiling is fixed by the framework and enforced\n * when the grant is minted — a request above it is REFUSED, never clamped, so a caller that asked for\n * two hours learns from an error that the bound is sixty minutes rather than from an expiry it did not\n * expect. The bound is the framework's to own because the grant is designed to leave the trust\n * boundary: it lands in an AI agent's transcript, a model provider's logs, a shell history.\n */\nexport const FILE_UPLOAD_GRANT_DEFAULT_MINUTES = 15;\nexport const FILE_UPLOAD_GRANT_ABSOLUTE_MAX_MINUTES = 60;\n\n/**\n * Which write the grant is for. A grant minted on the CREATE upload route uploads a file that a\n * later CREATE will reference; one minted on the UPDATE route (`…/{resourceId}/files/<field>`) is\n * bound to that row. The two routes authorize differently, so a grant may not cross from one to the\n * other — the upload middleware checks this against the route it is presented on.\n */\nexport const FILE_UPLOAD_GRANT_OPERATIONS = [CoreResourceOperation.CREATE, CoreResourceOperation.UPDATE] as const;\nexport type FileUploadGrantOperation = (typeof FILE_UPLOAD_GRANT_OPERATIONS)[number];\n/** Derived from `CoreResourceOperation` — the named source — rather than a second enum spelling the same two words. */\nexport const FileUploadGrantOperationSchema: z.ZodEnum<{ [K in FileUploadGrantOperation]: K }> = z.enum(FILE_UPLOAD_GRANT_OPERATIONS);\n\n/**\n * Lifecycle of a grant as the status read reports it. Derived from the token row — `isConsumed`,\n * `expiresAt`, `revokedAt` — never stored, so it cannot drift from the row.\n */\nexport enum FileUploadGrantState {\n /** Minted, unexpired, unrevoked, not yet redeemed: an upload will be accepted. */\n PENDING = 'pending',\n /** Redeemed by exactly one upload. `file` names what it produced when the write-back succeeded. */\n REDEEMED = 'redeemed',\n /** Past `expiresAt` without being redeemed. Mint a new one. */\n EXPIRED = 'expired',\n /** Revoked by the minter or an administrator before redemption. */\n REVOKED = 'revoked',\n}\nexport const FileUploadGrantStateSchema: z.ZodEnum<typeof FileUploadGrantState> = z.enum(FileUploadGrantState);\n\n/**\n * The `metadata` a FILE_UPLOAD_GRANT token carries — the ROUTE binding, as opposed to the identity\n * the typed token fields carry. The upload middleware reads this; the execution-context creator\n * deliberately does not.\n */\nexport const FileUploadGrantMetadataSchema: z.ZodObject<{\n fieldName: z.ZodString;\n operation: z.ZodEnum<{ [K in FileUploadGrantOperation]: K }>;\n minter: z.ZodObject<{ entityType: z.ZodEnum<typeof FileUploaderEntityType>; id: z.ZodString }>;\n uploadUrl: z.ZodString;\n producedFileId: z.ZodOptional<z.ZodString>;\n}> = z.object({\n /** The `z_file()` field the upload lands on, as authored (dotted for nested fields). */\n fieldName: z.string().min(1),\n operation: FileUploadGrantOperationSchema,\n /**\n * Who minted — recorded so the uploaded file is attributed to a PERSON or MACHINE, not to the\n * grant.\n *\n * `entityType` is the ENUM, not a string. It was `z.string().min(1)` until 2026-09-08, with the\n * stated reason that \"the uploader enum lives in `zod-decorators`, upstream of this package\" —\n * which is exactly backwards: upstream is what a package MAY import, and this one already does.\n * `files.shared.schemas.ts` in this very directory imports `FileUploaderEntityType` from\n * `@wildo-ai/zod-decorators`, re-exports it, and writes `z.enum(FileUploaderEntityType)` on the\n * FILES row's own `uploadedByEntityType`. So the vocabulary was one import away the whole time and\n * the metadata's copy of the same field was the only one left open.\n *\n * What the enum buys: `metadata` is an UNTYPED bag on the token row, so nothing between the write\n * and the read guarantees its shape — the read is the only place that can. Every reader here goes\n * through `FileUploadGrantMetadataSchema.safeParse`, so an out-of-vocabulary entity type now makes\n * the whole metadata unparseable and the redemption path refuses the grant instead of casting the\n * value into `FileUploaderPrincipal` and carrying it three layers to `validateUploadedByEntityType`.\n *\n * NOT narrowed to the three values `mint` can actually produce (mint refuses an anonymous and a\n * token-borne minter, so `ANONYMOUS_USER` is unreachable): that refusal is a MINT policy, enforced\n * and explained at mint, and re-encoding it here would put half a policy in a schema that cannot\n * say why. The vocabulary of this field is the vocabulary of the principal it names.\n */\n minter: z.object({ entityType: z.enum(FileUploaderEntityType), id: z.string().min(1) }),\n /**\n * The concrete upload URL the grant was minted for. Two jobs, and the second one is why it must be\n * absolute: the status read hands it to the drop page, AND the redemption path compares its PATH\n * against the route the token is presented on (`assertGrantMatchesRoute`). Until 2026-09-08 it was\n * recorded and never read back, so a grant bound to one concrete route could be redeemed on any\n * other route reaching the same (resource, field, operation, row).\n */\n uploadUrl: z.string().url(),\n /** Written after a successful redemption; absent until then. */\n producedFileId: z.string().min(1).optional(),\n});\nexport type FileUploadGrantMetadata = z.infer<typeof FileUploadGrantMetadataSchema>;\n\n/**\n * What a mint returns — identical on the REST door and the MCP tool. Two affordances for one\n * token: `uploadCommand` for a caller that can execute, `uploadPageUrl` for one that must hand a\n * human a link. The token appears in `uploadHeader.value` and inside both commands and the page URL;\n * it is the credential and cannot be omitted. It never appears in any audit row.\n */\nexport const FileUploadGrantSchema: z.ZodObject<{\n grantId: z.ZodString;\n state: z.ZodEnum<typeof FileUploadGrantState>;\n expiresAt: z.ZodString;\n singleUse: z.ZodLiteral<true>;\n target: z.ZodObject<{\n resourceType: z.ZodString;\n fieldName: z.ZodString;\n operation: z.ZodEnum<{ [K in FileUploadGrantOperation]: K }>;\n resourceId: z.ZodNullable<z.ZodString>;\n }>;\n constraints: z.ZodObject<{\n maxBytes: z.ZodNumber;\n allowedMimeTypes: z.ZodArray<z.ZodString>;\n }>;\n uploadUrl: z.ZodString;\n uploadHeader: z.ZodObject<{ name: z.ZodString; value: z.ZodString }>;\n uploadCommand: z.ZodString;\n uploadCommandPowerShell: z.ZodString;\n uploadPageUrl: z.ZodNullable<z.ZodString>;\n statusUrl: z.ZodString;\n note: z.ZodString;\n}> = z.object({\n grantId: z.string().min(1),\n state: FileUploadGrantStateSchema,\n expiresAt: z.string().datetime(),\n singleUse: z.literal(true),\n target: z.object({\n resourceType: z.string().min(1),\n fieldName: z.string().min(1),\n operation: FileUploadGrantOperationSchema,\n resourceId: z.string().min(1).nullable(),\n }),\n /** From the field's own constraint resolver — the same one the upload enforces, so the two cannot disagree. */\n constraints: z.object({\n maxBytes: z.number().int().positive(),\n /** Empty means every type is accepted. */\n allowedMimeTypes: z.array(z.string()),\n }),\n uploadUrl: z.string().url(),\n /** The credential travels in a HEADER on the curl form: paths are logged by every proxy, headers are not. */\n uploadHeader: z.object({ name: z.string().min(1), value: z.string().min(1) }),\n /** No `-f`: on a refusal the JSON error body is the only thing that tells the caller why. */\n uploadCommand: z.string().min(1),\n /** In PowerShell `curl` aliases Invoke-WebRequest, which does not understand `-F`; the real binary is `curl.exe`. */\n uploadCommandPowerShell: z.string().min(1),\n /** `null` when the application declares no frontend service — a headless API has no page to hand a human. */\n uploadPageUrl: z.string().url().nullable(),\n statusUrl: z.string().url(),\n note: z.string().min(1),\n});\nexport type FileUploadGrant = z.infer<typeof FileUploadGrantSchema>;\n\n/**\n * What the public status read returns. The token is the credential, so the read is unauthenticated\n * and returns only what the drop page needs to render and the agent needs to learn the `fileId`:\n * never the file's name (the status URL may be pasted around).\n */\nexport const FileUploadGrantStatusSchema: z.ZodObject<{\n grantId: z.ZodString;\n state: z.ZodEnum<typeof FileUploadGrantState>;\n expiresAt: z.ZodString;\n target: z.ZodObject<{\n resourceType: z.ZodString;\n fieldName: z.ZodString;\n operation: z.ZodEnum<{ [K in FileUploadGrantOperation]: K }>;\n resourceId: z.ZodNullable<z.ZodString>;\n }>;\n constraints: z.ZodObject<{ maxBytes: z.ZodNumber; allowedMimeTypes: z.ZodArray<z.ZodString> }>;\n uploadUrl: z.ZodString;\n uploadHeaderName: z.ZodString;\n file: z.ZodNullable<z.ZodObject<{ fileId: z.ZodString; status: z.ZodEnum<typeof FileStatus> }>>;\n}> = z.object({\n grantId: z.string().min(1),\n state: FileUploadGrantStateSchema,\n expiresAt: z.string().datetime(),\n target: z.object({\n resourceType: z.string().min(1),\n fieldName: z.string().min(1),\n operation: FileUploadGrantOperationSchema,\n resourceId: z.string().min(1).nullable(),\n }),\n constraints: z.object({ maxBytes: z.number().int().positive(), allowedMimeTypes: z.array(z.string()) }),\n uploadUrl: z.string().url(),\n /** The page sets this header itself; the token it already holds is the value. */\n uploadHeaderName: z.string().min(1),\n /** `null` until redeemed, or when the post-redemption write-back failed (re-read the resource instead). */\n file: z.object({ fileId: z.string().min(1), status: z.enum(FileStatus) }).nullable(),\n});\nexport type FileUploadGrantStatus = z.infer<typeof FileUploadGrantStatusSchema>;\n\n/**\n * Body accepted by both mint doors.\n *\n * The three optional file facts mirror what the MCP File Objects proposal has a client declare when\n * it asks to upload (`name`, `mimeType`, `size`): declaring them lets the server refuse a file the\n * field would never accept BEFORE handing out a link, instead of at redemption when the link is\n * already spent. They are advisory for the upload itself — the bytes are validated on receipt\n * regardless — and a declaration that later disagrees with the bytes is refused on receipt too.\n */\nexport const FileUploadGrantMintRequestSchema: z.ZodObject<{\n expiresInMinutes: z.ZodOptional<z.ZodNumber>;\n name: z.ZodOptional<z.ZodString>;\n mimeType: z.ZodOptional<z.ZodString>;\n size: z.ZodOptional<z.ZodNumber>;\n}> = z.object({\n expiresInMinutes: z.number().int().min(1).max(FILE_UPLOAD_GRANT_ABSOLUTE_MAX_MINUTES).optional(),\n /** The file name the caller intends to upload; used for the curl example and checked against nothing else. */\n name: z.string().min(1).max(255).optional(),\n /** Declared MIME type; refused at mint when the field does not accept it. */\n mimeType: z.string().min(1).max(255).optional(),\n /** Declared size in bytes; refused at mint when above the field's maximum. */\n size: z.number().int().positive().optional(),\n}).strict();\nexport type FileUploadGrantMintRequest = z.infer<typeof FileUploadGrantMintRequestSchema>;\n/** @wildo_source:part:end saas.models.file-upload-grant */\n"]}
|