@wildo-ai/saas-models 1.1.2 → 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 +14 -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-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 +3 -3
- 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 +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js +15 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.d.ts +7 -3
- package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.js +22 -3
- 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-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 +480 -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 +547 -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 +82 -3
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +31 -30
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +98 -3
- package/dist/esm/compliance/privacy/operating-jurisdictions.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 +82 -29
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.js +95 -29
- 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 +7 -5
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.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/errors/errors.custom-message-ref.shared.definitions.d.ts +28 -0
- 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 +28 -0
- 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 +45 -12
- 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 +103 -58
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +176 -15
- 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 -5
- 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 +83 -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 +5 -28
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.js +4 -2
- 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/files/file-upload-grant.shared.schemas.d.ts +14 -2
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/file-upload-grant.shared.schemas.js +44 -5
- package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -1
- package/dist/esm/files/files.shared.schemas.d.ts +15 -8
- package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/files.shared.schemas.js +15 -8
- package/dist/esm/files/files.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/actors.shared.schemas.js +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.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 +40 -3
- package/dist/esm/flows-actors/flows-actors-execution.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.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/progression-state.shared.resources-config.schemas.d.ts +8 -0
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts +46 -0
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.js +49 -0
- 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 +320 -50
- 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 +137 -36
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +9 -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/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/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-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 +18 -3
- 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 +6 -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 +27 -4
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js +35 -0
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- 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 +105 -20
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +254 -72
- package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
- package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources-registry.shared.core.definitions.js +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-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 +84 -5
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.js +83 -3
- package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
- 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/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.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +27 -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 +52 -7
- 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 +45 -8
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.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 +6 -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 +31 -0
- package/dist/esm/security/oauth-clients/oauth-clients.shared.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 +24 -3
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +4 -4
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +4 -4
- 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 +43 -12
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js +38 -7
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -33,7 +33,21 @@ export var BillingSubscription_Operations;
|
|
|
33
33
|
// ── Request DTOs ─────────────────────────────────────────────────────
|
|
34
34
|
/** Request DTO for CANCEL operation — shared between resource config and custom impl */
|
|
35
35
|
export const BillingSubscription_CancelRequestDto = z.object({
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* OPTIONAL, with no default — and the absence of a default is the point (#408, 2026-09-08).
|
|
38
|
+
*
|
|
39
|
+
* It carried `.default(false)` until then, which materialized `false` at parse and made "the
|
|
40
|
+
* caller expressed no preference" a state the handler could never observe. That erased the only
|
|
41
|
+
* input `ProductBehaviorPolicy.cancellation.defaultBehavior` exists to answer, so an authored
|
|
42
|
+
* product default was unimplementable rather than merely unimplemented — a field one layer up
|
|
43
|
+
* had already decided for it.
|
|
44
|
+
*
|
|
45
|
+
* The resolution order is now: the caller's explicit choice, then the plan product's
|
|
46
|
+
* `defaultBehavior`, then period-end as the framework floor. Omitting it still ends in period-end
|
|
47
|
+
* for a product that authors no policy, so nothing changes for an existing caller — what changes
|
|
48
|
+
* is that a product declaring IMMEDIATE now gets it.
|
|
49
|
+
*/
|
|
50
|
+
cancelImmediately: z.boolean().optional(),
|
|
37
51
|
reason: z.string().max(500).optional(),
|
|
38
52
|
});
|
|
39
53
|
/** Request DTO for CHANGE_PLAN operation — shared between resource config and custom impl */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/subscription.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,0CAA0C,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AAEvH,wEAAwE;AAExE,MAAM,CAAN,IAAY,8BAWX;AAXD,WAAY,8BAA8B;IACxC,6DAA6D;IAC7D,mDAAiB,CAAA;IACjB,wDAAwD;IACxD,mDAAiB,CAAA;IACjB,qDAAqD;IACrD,6DAA2B,CAAA;IAC3B,+CAA+C;IAC/C,yDAAuB,CAAA;IACvB,oDAAoD;IACpD,+DAA6B,CAAA;AAC/B,CAAC,EAXW,8BAA8B,KAA9B,8BAA8B,QAWzC;AAED,wEAAwE;AAExE,wFAAwF;AACxF,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,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C;iBACrD,CAAC;SACH;QACD,CAAC,8BAA8B,CAAC,SAAS,CAAC,EAAE;YAC1C,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE;wBACf,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;wBACtF,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;qBACpD;oBACD,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,UAAU,EAAE,sCAAsC;iBACnD,CAAC;SACH;QACD,CAAC,8BAA8B,CAAC,YAAY,CAAC,EAAE;YAC7C,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE;wBACf,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;wBACtF,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;qBACpD;oBACD,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,UAAU,EAAE,yCAAyC;iBACtD,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Subscription Resource Configuration — Polymorphic\n *\n * Produces 3 factory functions (one per scope variant) via the polymorphic factory.\n * Spread into the registry factory map:\n * ...billingSubscriptionsPolymorphicFactories\n *\n * @see polymorphic-scope-approach-A-expansion.md — Phase 3\n */\n\nimport { z } from 'zod';\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { billingSubscriptionsPolymorphicDeclaration } from './subscription.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\n\n// ── Custom Operations ────────────────────────────────────────────────\n\nexport enum BillingSubscription_Operations {\n /** Cancel the subscription (at period end or immediately) */\n CANCEL = 'cancel',\n /** Resume a cancelled subscription before period end */\n RESUME = 'resume',\n /** Change to a different plan (upgrade/downgrade) */\n CHANGE_PLAN = 'change_plan',\n /** Add an addon product to the subscription */\n ADD_ADDON = 'add_addon',\n /** Remove an addon product from the subscription */\n REMOVE_ADDON = 'remove_addon',\n}\n\n// ── Request DTOs ─────────────────────────────────────────────────────\n\n/** Request DTO for CANCEL operation — shared between resource config and custom impl */\nexport const BillingSubscription_CancelRequestDto = z.object({\n cancelImmediately: z.boolean().default(false),\n reason: z.string().max(500).optional(),\n});\n\n/** Request DTO for CHANGE_PLAN operation — shared between resource config and custom impl */\nexport const BillingSubscription_ChangePlanRequestDto = z.object({\n newProductKey: z.string().min(1),\n newPriceId: z.string().min(1),\n});\n\n/** Request DTO for ADD_ADDON operation — shared between resource config and custom impl */\nexport const BillingSubscription_AddAddonRequestDto = z.object({\n addonProductKey: z.string().min(1),\n priceId: z.string().min(1),\n});\n\n/** Request DTO for REMOVE_ADDON operation — shared between resource config and custom impl */\nexport const BillingSubscription_RemoveAddonRequestDto = z.object({\n addonProductKey: z.string().min(1),\n});\n\n// =============================================================================\n// POLYMORPHIC FACTORY — 2 variants (org, user)\n// =============================================================================\n\n/**\n * Polymorphic factory map for subscriptions.\n * Spread into `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...billingSubscriptionsPolymorphicFactories\n *\n * Produces entries for:\n * - organizationSubscriptions\n * - userSubscriptions\n */\nexport const billingSubscriptionsPolymorphicFactories = createPolymorphicResourceConfigurations(\n billingSubscriptionsPolymorphicDeclaration,\n {\n isSystemResource: true,\n // System-context LIST opt-in (fail-closed default is FORBIDDEN). Subject erasure enumerates the\n // erased person's live subscriptions so it can cancel them at the provider immediately — an\n // erased subject must stop being billed. There is no request context on that path (the subject\n // is being erased), so it reads through `SystemAccessBackendService.listAsSystem`, which refuses\n // any resource that has not opted in here. LIST's default variant is API_CALL and therefore\n // resolves through `getServiceOperationPathDefault`; a REPOSITORY_ONLY-only LIST would satisfy\n // this grant and still fail to resolve at erasure time.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own subscriptions. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n list: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\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 that this resource holds no personal data of its own. The row is\n * subscription terms — plan and price references, status and period boundaries — amounts and contract terms about the ACCOUNT. They\n * describe nobody once the linked USER row is scrubbed, and they must survive erasure for the tax/audit\n * obligation this family exists to serve, so they can be neither scrubbed nor honestly declared as\n * personal data the row holds. The person is the scope foreign key, which the never-scrub floor protects.\n *\n * The assertion is CHECKED in both directions: the factory refuses `RETAIN_ONLY` if any field declares an\n * impersonalize treatment, and (since 2026-08-31) if any non-floor field declares `.dataCategories()`.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_ONLY,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is not a person — its owner FK names the ACTOR the\n * record belongs to — and the enum prescribes `NO_PRINCIPAL` for exactly that shape. The subject's own\n * session ends through the `USERS` row, which is `SELF_PRINCIPAL`.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n customOperation: BillingSubscription_Operations,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n operationsConfiguration: {\n /*\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n * verb the impersonalize writer uses to stamp the retention markers.\n */\n [CoreResourceOperation.UPDATE_MANY]: {\n variants: [{\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.READ]: {\n variants: [{\n // API_CALL: subscriptions are a user-facing collection (Settings Hub → Billing →\n // Subscriptions, and the resource presets' LIST/READ views). REPOSITORY_ONLY would\n // strip the op from the frontend registry and register no HTTP route. Writes\n // (checkout + webhook sync) are INTERNAL_CALL (service-pipeline) / custom API_CALL ops.\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [BillingSubscription_Operations.CANCEL]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingSubscription_CancelRequestDto,\n }],\n },\n [BillingSubscription_Operations.RESUME]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // RESUME clears a pending cancellation at the provider and mirrors the result — it\n // takes no caller input. Its implementation already ignores the payload, but the\n // dispatcher MERGES a prefix's return onto the caller payload rather than replacing\n // it, so an unnarrowed contract is still writable. Omitting `requestDto` would\n // auto-derive the FULL subscription update DTO (`status`, `items`, `discount`,\n // `currentPeriodEnd`, `cancelledAt`, …), letting a subscriber rewrite their own\n // billing state through \"resume\".\n requestDto: z.object({}),\n }],\n },\n [BillingSubscription_Operations.CHANGE_PLAN]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingSubscription_ChangePlanRequestDto,\n }],\n },\n [BillingSubscription_Operations.ADD_ADDON]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingSubscription_AddAddonRequestDto,\n }],\n },\n [BillingSubscription_Operations.REMOVE_ADDON]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingSubscription_RemoveAddonRequestDto,\n }],\n },\n },\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"subscription.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/subscription.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,0CAA0C,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AAEvH,wEAAwE;AAExE,MAAM,CAAN,IAAY,8BAWX;AAXD,WAAY,8BAA8B;IACxC,6DAA6D;IAC7D,mDAAiB,CAAA;IACjB,wDAAwD;IACxD,mDAAiB,CAAA;IACjB,qDAAqD;IACrD,6DAA2B,CAAA;IAC3B,+CAA+C;IAC/C,yDAAuB,CAAA;IACvB,oDAAoD;IACpD,+DAA6B,CAAA;AAC/B,CAAC,EAXW,8BAA8B,KAA9B,8BAA8B,QAWzC;AAED,wEAAwE;AAExE,wFAAwF;AACxF,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D;;;;;;;;;;;;;OAaG;IACH,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAA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AAE,0BAA0B,CAAC,IAAI;oBAC1C,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,UAAU,EAAE,wCAAwC;iBACrD,CAAC;SACH;QACD,CAAC,8BAA8B,CAAC,SAAS,CAAC,EAAE;YAC1C,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE;wBACf,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;wBACtF,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;qBACpD;oBACD,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,UAAU,EAAE,sCAAsC;iBACnD,CAAC;SACH;QACD,CAAC,8BAA8B,CAAC,YAAY,CAAC,EAAE;YAC7C,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE;wBACf,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;wBACtF,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;qBACpD;oBACD,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,qBAAqB,EAAE,qBAAqB,CAAC,MAAM;oBACnD,UAAU,EAAE,yCAAyC;iBACtD,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Subscription Resource Configuration — Polymorphic\n *\n * Produces 3 factory functions (one per scope variant) via the polymorphic factory.\n * Spread into the registry factory map:\n * ...billingSubscriptionsPolymorphicFactories\n *\n * @see polymorphic-scope-approach-A-expansion.md — Phase 3\n */\n\nimport { z } from 'zod';\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { billingSubscriptionsPolymorphicDeclaration } from './subscription.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\n\n// ── Custom Operations ────────────────────────────────────────────────\n\nexport enum BillingSubscription_Operations {\n /** Cancel the subscription (at period end or immediately) */\n CANCEL = 'cancel',\n /** Resume a cancelled subscription before period end */\n RESUME = 'resume',\n /** Change to a different plan (upgrade/downgrade) */\n CHANGE_PLAN = 'change_plan',\n /** Add an addon product to the subscription */\n ADD_ADDON = 'add_addon',\n /** Remove an addon product from the subscription */\n REMOVE_ADDON = 'remove_addon',\n}\n\n// ── Request DTOs ─────────────────────────────────────────────────────\n\n/** Request DTO for CANCEL operation — shared between resource config and custom impl */\nexport const BillingSubscription_CancelRequestDto = z.object({\n /**\n * OPTIONAL, with no default — and the absence of a default is the point (#408, 2026-09-08).\n *\n * It carried `.default(false)` until then, which materialized `false` at parse and made \"the\n * caller expressed no preference\" a state the handler could never observe. That erased the only\n * input `ProductBehaviorPolicy.cancellation.defaultBehavior` exists to answer, so an authored\n * product default was unimplementable rather than merely unimplemented — a field one layer up\n * had already decided for it.\n *\n * The resolution order is now: the caller's explicit choice, then the plan product's\n * `defaultBehavior`, then period-end as the framework floor. Omitting it still ends in period-end\n * for a product that authors no policy, so nothing changes for an existing caller — what changes\n * is that a product declaring IMMEDIATE now gets it.\n */\n cancelImmediately: z.boolean().optional(),\n reason: z.string().max(500).optional(),\n});\n\n/** Request DTO for CHANGE_PLAN operation — shared between resource config and custom impl */\nexport const BillingSubscription_ChangePlanRequestDto = z.object({\n newProductKey: z.string().min(1),\n newPriceId: z.string().min(1),\n});\n\n/** Request DTO for ADD_ADDON operation — shared between resource config and custom impl */\nexport const BillingSubscription_AddAddonRequestDto = z.object({\n addonProductKey: z.string().min(1),\n priceId: z.string().min(1),\n});\n\n/** Request DTO for REMOVE_ADDON operation — shared between resource config and custom impl */\nexport const BillingSubscription_RemoveAddonRequestDto = z.object({\n addonProductKey: z.string().min(1),\n});\n\n// =============================================================================\n// POLYMORPHIC FACTORY — 2 variants (org, user)\n// =============================================================================\n\n/**\n * Polymorphic factory map for subscriptions.\n * Spread into `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...billingSubscriptionsPolymorphicFactories\n *\n * Produces entries for:\n * - organizationSubscriptions\n * - userSubscriptions\n */\nexport const billingSubscriptionsPolymorphicFactories = createPolymorphicResourceConfigurations(\n billingSubscriptionsPolymorphicDeclaration,\n {\n isSystemResource: true,\n // System-context LIST opt-in (fail-closed default is FORBIDDEN). Subject erasure enumerates the\n // erased person's live subscriptions so it can cancel them at the provider immediately — an\n // erased subject must stop being billed. There is no request context on that path (the subject\n // is being erased), so it reads through `SystemAccessBackendService.listAsSystem`, which refuses\n // any resource that has not opted in here. LIST's default variant is API_CALL and therefore\n // resolves through `getServiceOperationPathDefault`; a REPOSITORY_ONLY-only LIST would satisfy\n // this grant and still fail to resolve at erasure time.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own subscriptions. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n list: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\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 that this resource holds no personal data of its own. The row is\n * subscription terms — plan and price references, status and period boundaries — amounts and contract terms about the ACCOUNT. They\n * describe nobody once the linked USER row is scrubbed, and they must survive erasure for the tax/audit\n * obligation this family exists to serve, so they can be neither scrubbed nor honestly declared as\n * personal data the row holds. The person is the scope foreign key, which the never-scrub floor protects.\n *\n * The assertion is CHECKED in both directions: the factory refuses `RETAIN_ONLY` if any field declares an\n * impersonalize treatment, and (since 2026-08-31) if any non-floor field declares `.dataCategories()`.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_ONLY,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is not a person — its owner FK names the ACTOR the\n * record belongs to — and the enum prescribes `NO_PRINCIPAL` for exactly that shape. The subject's own\n * session ends through the `USERS` row, which is `SELF_PRINCIPAL`.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n customOperation: BillingSubscription_Operations,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n operationsConfiguration: {\n /*\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n * verb the impersonalize writer uses to stamp the retention markers.\n */\n [CoreResourceOperation.UPDATE_MANY]: {\n variants: [{\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.READ]: {\n variants: [{\n // API_CALL: subscriptions are a user-facing collection (Settings Hub → Billing →\n // Subscriptions, and the resource presets' LIST/READ views). REPOSITORY_ONLY would\n // strip the op from the frontend registry and register no HTTP route. Writes\n // (checkout + webhook sync) are INTERNAL_CALL (service-pipeline) / custom API_CALL ops.\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [BillingSubscription_Operations.CANCEL]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingSubscription_CancelRequestDto,\n }],\n },\n [BillingSubscription_Operations.RESUME]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n // RESUME clears a pending cancellation at the provider and mirrors the result — it\n // takes no caller input. Its implementation already ignores the payload, but the\n // dispatcher MERGES a prefix's return onto the caller payload rather than replacing\n // it, so an unnarrowed contract is still writable. Omitting `requestDto` would\n // auto-derive the FULL subscription update DTO (`status`, `items`, `discount`,\n // `currentPeriodEnd`, `cancelledAt`, …), letting a subscriber rewrite their own\n // billing state through \"resume\".\n requestDto: z.object({}),\n }],\n },\n [BillingSubscription_Operations.CHANGE_PLAN]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingSubscription_ChangePlanRequestDto,\n }],\n },\n [BillingSubscription_Operations.ADD_ADDON]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingSubscription_AddAddonRequestDto,\n }],\n },\n [BillingSubscription_Operations.REMOVE_ADDON]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingSubscription_RemoveAddonRequestDto,\n }],\n },\n },\n },\n);\n"]}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @see billing-and-features-system.md §6.6 (Usage Records)
|
|
17
17
|
*/
|
|
18
18
|
import { z } from 'zod';
|
|
19
|
-
import { UsageSourceType } from './billing-enums.shared.schemas';
|
|
19
|
+
import { UsageRecordFlushState, UsageRecordUnreportableReason, UsageSourceType } from './billing-enums.shared.schemas';
|
|
20
20
|
export declare const UsageRecordSchema: z.ZodObject<{
|
|
21
21
|
_id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>;
|
|
22
22
|
billingAccountId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>>;
|
|
@@ -29,8 +29,10 @@ export declare const UsageRecordSchema: z.ZodObject<{
|
|
|
29
29
|
operationIdentifier: z.ZodOptional<z.ZodString>;
|
|
30
30
|
description: z.ZodOptional<z.ZodString>;
|
|
31
31
|
}, z.core.$strip>>>;
|
|
32
|
-
|
|
32
|
+
flushState: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodEnum<typeof UsageRecordFlushState>>>>>;
|
|
33
33
|
reportedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodDate>>;
|
|
34
|
+
unreportableReason: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodEnum<typeof UsageRecordUnreportableReason>>>>;
|
|
35
|
+
unreportableAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodDate>>;
|
|
34
36
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
35
37
|
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodDate>>>;
|
|
36
38
|
}, z.core.$strip>;
|
|
@@ -47,8 +49,10 @@ export declare const usageRecordsPolymorphicDeclaration: import("..").Polymorphi
|
|
|
47
49
|
operationIdentifier: z.ZodOptional<z.ZodString>;
|
|
48
50
|
description: z.ZodOptional<z.ZodString>;
|
|
49
51
|
}, z.core.$strip>>>;
|
|
50
|
-
|
|
52
|
+
flushState: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodEnum<typeof UsageRecordFlushState>>>>>;
|
|
51
53
|
reportedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodDate>>;
|
|
54
|
+
unreportableReason: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodEnum<typeof UsageRecordUnreportableReason>>>>;
|
|
55
|
+
unreportableAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodDate>>;
|
|
52
56
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
53
57
|
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodDate>>>;
|
|
54
58
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-record.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/usage-record.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"usage-record.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/usage-record.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEvH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;iBAsE5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI5D,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;kBAQ7C,CAAC"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { declarePolymorphicSchemas, optOutPolymorphicAutoBusinessKey } from '../resources/utils/resource-polymorphism.schemas.js';
|
|
20
20
|
import { BILLING_SCOPE_VARIANTS, BILLING_SCOPE_FK_VARIANTS } from './billing-account.shared.schemas.js';
|
|
21
|
-
import { UsageSourceType } from './billing-enums.shared.schemas.js';
|
|
21
|
+
import { UsageRecordFlushState, UsageRecordUnreportableReason, UsageSourceType } from './billing-enums.shared.schemas.js';
|
|
22
22
|
export const UsageRecordSchema = z.object({
|
|
23
23
|
_id: z.string().min(1).isPrimaryKey(),
|
|
24
24
|
billingAccountId: z.string().min(1).isForeignKey({ polymorphicVariants: BILLING_SCOPE_FK_VARIANTS }).isDBIndexed().isSummaryField(),
|
|
@@ -42,9 +42,28 @@ export const UsageRecordSchema = z.object({
|
|
|
42
42
|
operationIdentifier: z.string().optional(),
|
|
43
43
|
description: z.string().optional(),
|
|
44
44
|
}).optional().isNotEditable(),
|
|
45
|
-
/**
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Where this row stands with respect to the provider flush.
|
|
47
|
+
*
|
|
48
|
+
* The flush selects exactly `PENDING`, so this ONE indexed field decides whether a row is still
|
|
49
|
+
* work. It replaced a `reportedToProvider` boolean on 2026-09-09 (#512): a boolean has no way to
|
|
50
|
+
* say "this can never be reported", so rows whose billing account had been deleted were
|
|
51
|
+
* re-selected by every run forever. See {@link UsageRecordFlushState} for why all three states are
|
|
52
|
+
* semantically distinct and why the shortcut of marking them reported was refused.
|
|
53
|
+
*/
|
|
54
|
+
flushState: z.enum(UsageRecordFlushState).default(UsageRecordFlushState.PENDING).isDBIndexed().isNotEditable().systemEnum('UsageRecordFlushState'),
|
|
55
|
+
/** When the PROVIDER acknowledged the quantity. Set only alongside `flushState: reported`. */
|
|
47
56
|
reportedAt: z.date().optional().isNotEditable(),
|
|
57
|
+
/**
|
|
58
|
+
* Why this row can never be reported. Set only alongside `flushState: unreportable`.
|
|
59
|
+
*
|
|
60
|
+
* Separate from `reportedAt` on purpose: that timestamp records an acknowledgement by the
|
|
61
|
+
* provider, this pair records a determination made locally, and merging them would put two
|
|
62
|
+
* different events under one name.
|
|
63
|
+
*/
|
|
64
|
+
unreportableReason: z.enum(UsageRecordUnreportableReason).optional().isNotEditable().systemEnum('UsageRecordUnreportableReason'),
|
|
65
|
+
/** When the flush determined this row unreportable. Set only alongside `unreportableReason`. */
|
|
66
|
+
unreportableAt: z.date().optional().isNotEditable(),
|
|
48
67
|
/**
|
|
49
68
|
* Open key-value bag for operational tagging (cost-centre, campaign ref, internal correlation id).
|
|
50
69
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-record.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/usage-record.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AAC/H,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"usage-record.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/usage-record.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AAC/H,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AACrG,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEvH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE;IACrC,gBAAgB,EAAE,CAAC,CAAC,M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E;IAC/C;;;;;;OAMG;IACH,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC,+BAA+B,CAAC;IAChI,gGAAgG;IAChG,cAAc,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE;IAEnD;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC;AAGH,sEAAsE;AAEtE,MAAM,CAAC,MAAM,kCAAkC,GAAG,yBAAyB,CAAC;IAC1E,gBAAgB,EAAE,cAAc;IAChC,mBAAmB,EAAE,eAAe;IACpC,WAAW,EAAE,eAAe;IAC5B,UAAU,EAAE,iBAAiB;IAC7B,2EAA2E;IAC3E,iDAAiD;IACjD,QAAQ,EAAE,sBAAsB,CAAC,GAAG,CAAC,gCAAgC,CAAC;CACvE,CAAC,CAAC","sourcesContent":["/**\n * Usage Record Schema (Shared) — Polymorphic\n *\n * Tracks metered usage for METERED products. The current metering service groups\n * unreported rows by billing account and product when its scheduled flush runs.\n * `ProductBehaviorPolicy.metering` is an authored policy surface, but the current\n * flush scheduler does not consume its interval, window or retry members; do not\n * present those values as an effective reporting schedule until that runtime join exists.\n *\n * POLYMORPHIC EXPANSION: Like subscriptions, usage records are scope-expanded.\n * The `billingAccountId` FK is renamed per variant via polymorphic FK transformation:\n * - organizationUsageRecords (with organizationId + organizationBillingAccountId)\n * - userUsageRecords (with userId + userBillingAccountId)\n *\n *\n * @see billing-and-features-system.md §6.6 (Usage Records)\n */\n\nimport { z } from 'zod';\nimport { declarePolymorphicSchemas, optOutPolymorphicAutoBusinessKey } from '../resources/utils/resource-polymorphism.schemas';\nimport { BILLING_SCOPE_VARIANTS, BILLING_SCOPE_FK_VARIANTS } from './billing-account.shared.schemas';\nimport { UsageRecordFlushState, UsageRecordUnreportableReason, UsageSourceType } from './billing-enums.shared.schemas';\n\nexport const UsageRecordSchema = z.object({\n _id: z.string().min(1).isPrimaryKey(),\n billingAccountId: z.string().min(1).isForeignKey({ polymorphicVariants: BILLING_SCOPE_FK_VARIANTS }).isDBIndexed().isSummaryField(),\n /** Product key for grouping/lookup (matches ProductDefinition.key) */\n // No `.dataCategories()`: this is an amount/term about the ACCOUNT, not a description of a person.\n // The person is the scope foreign key, which the never-scrub floor preserves in every mode, and the\n // value must survive erasure for the tax/audit obligation this family exists to serve — so it can be\n // neither scrubbed nor honestly declared as personal data the row holds. See `retentionPolicy` on the\n // resource config (#138).\n productKey: z.string().min(1).isDBIndexed().isSummaryField().isNotEditable(),\n\n /** Usage quantity */\n // USAGE, not FINANCIAL. A metered quantity is what the person DID in the product; the money it\n // becomes lives on the invoice. Two different sentences in a notice, and they read differently.\n quantity: z.number().min(0).isSummaryField(),\n /** When the usage occurred */\n timestamp: z.date().isDBIndexed().isSummaryField().isNotEditable(),\n\n /** What generated this usage */\n source: z.object({\n type: z.enum(UsageSourceType),\n resourceType: z.string().optional(),\n operationIdentifier: z.string().optional(),\n description: z.string().optional(),\n }).optional().isNotEditable(),\n\n /**\n * Where this row stands with respect to the provider flush.\n *\n * The flush selects exactly `PENDING`, so this ONE indexed field decides whether a row is still\n * work. It replaced a `reportedToProvider` boolean on 2026-09-09 (#512): a boolean has no way to\n * say \"this can never be reported\", so rows whose billing account had been deleted were\n * re-selected by every run forever. See {@link UsageRecordFlushState} for why all three states are\n * semantically distinct and why the shortcut of marking them reported was refused.\n */\n flushState: z.enum(UsageRecordFlushState).default(UsageRecordFlushState.PENDING).isDBIndexed().isNotEditable().systemEnum('UsageRecordFlushState'),\n /** When the PROVIDER acknowledged the quantity. Set only alongside `flushState: reported`. */\n reportedAt: z.date().optional().isNotEditable(),\n /**\n * Why this row can never be reported. Set only alongside `flushState: unreportable`.\n *\n * Separate from `reportedAt` on purpose: that timestamp records an acknowledgement by the\n * provider, this pair records a determination made locally, and merging them would put two\n * different events under one name.\n */\n unreportableReason: z.enum(UsageRecordUnreportableReason).optional().isNotEditable().systemEnum('UsageRecordUnreportableReason'),\n /** When the flush determined this row unreportable. Set only alongside `unreportableReason`. */\n unreportableAt: z.date().optional().isNotEditable(),\n\n /**\n * Open key-value bag for operational tagging (cost-centre, campaign ref, internal correlation id).\n *\n * ⚠️ **AUTHORING RULE — never store personal data here.** This row is RETAINED when its subject is\n * erased: the billing-retention decision keeps the financial record for tax/audit obligations, and\n * subject erasure scrubs the linked USER rather than these rows, because a billing row holds no\n * personal data of its own — the person is a foreign key. An open bag is the one place that\n * assumption can be broken by an app author, and nothing would catch it: the erasure scrub is\n * field-directed (`.impersonalizeWith()`), and it cannot reach inside an arbitrary record whose\n * keys it does not know.\n *\n * Concretely: no names, emails, phone numbers, addresses, free-text notes about a person, or\n * anything else that identifies one. Personal data written here SURVIVES an erasure — a compliance\n * breach that the retained label makes look intentional.\n *\n * Enforcement is deliberately NOT built (Q3, 2026-07-31): scrubbing these rows would require\n * hide/freeze to become separable from scrub — a real capability change with no current consumer.\n * Revisit only if an app is found using the bag this way.\n */\n metadata: z.record(z.string(), z.string()).optional(),\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type UsageRecord = z.infer<typeof UsageRecordSchema>;\n\n// ── Polymorphic Declaration ────────────────────────────────────────\n\nexport const usageRecordsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'usageRecords',\n baseFieldIdentifier: 'usageRecordId',\n baseEnumKey: 'USAGE_RECORDS',\n baseSchema: UsageRecordSchema,\n // Many metered usage rows per scope — opt out of the polymorphism engine's\n // singleton-per-scope business-key auto-default.\n variants: BILLING_SCOPE_VARIANTS.map(optOutPolymorphicAutoBusinessKey),\n});\n"]}
|
|
@@ -70,8 +70,38 @@ export declare const ProviderSecretContractShapeSchema: z.ZodArray<z.ZodObject<{
|
|
|
70
70
|
description: z.ZodString;
|
|
71
71
|
}, z.core.$strict>>;
|
|
72
72
|
export type ProviderSecretContractShape = z.infer<typeof ProviderSecretContractShapeSchema>;
|
|
73
|
+
/**
|
|
74
|
+
* A contribution is a wire record produced by one package version and read by
|
|
75
|
+
* another (the CLI, the companion, a generated artifact), so it is a LOOSE
|
|
76
|
+
* object: an additive field from a newer producer rides through an older
|
|
77
|
+
* consumer instead of hard-failing the parse (#328 — it used to be strict,
|
|
78
|
+
* which made every additive field a five-surface change and every old/new
|
|
79
|
+
* mix a boot failure). Required fields stay required; only UNKNOWN keys are
|
|
80
|
+
* tolerated, and they are kept rather than stripped so a re-emitting
|
|
81
|
+
* consumer does not silently drop what it did not understand.
|
|
82
|
+
*/
|
|
73
83
|
export declare const ProviderCompanionContributionSchema: z.ZodObject<{
|
|
74
84
|
ref: z.ZodString;
|
|
85
|
+
/**
|
|
86
|
+
* The provider's identity (package, tier, vendor, origin) as declared on
|
|
87
|
+
* its module metadata, so tooling can display tiers and group vendors
|
|
88
|
+
* without loading the runtime module. Optional on the wire for one
|
|
89
|
+
* reason only: contributions emitted before #328 carry none, and a
|
|
90
|
+
* discovery walk must still read them.
|
|
91
|
+
*/
|
|
92
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
origin: z.ZodObject<{
|
|
94
|
+
kind: z.ZodEnum<typeof import("..").ProviderOriginKind>;
|
|
95
|
+
catalogue: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
source: z.ZodEnum<typeof import("..").ProviderCatalogueSource>;
|
|
97
|
+
sourceRef: z.ZodString;
|
|
98
|
+
sourceVersion: z.ZodString;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
packageName: z.ZodString;
|
|
102
|
+
tier: z.ZodEnum<typeof import("..").ProviderTier>;
|
|
103
|
+
vendor: z.ZodString;
|
|
104
|
+
}, z.core.$strip>>;
|
|
75
105
|
/**
|
|
76
106
|
* Stable package import path that makes the provider implementation reachable
|
|
77
107
|
* from the contributing package at runtime. This validates owner-package
|
|
@@ -110,6 +140,17 @@ export declare const ProviderCompanionContributionSchema: z.ZodObject<{
|
|
|
110
140
|
frontendEntry: z.ZodOptional<z.ZodObject<{
|
|
111
141
|
metadata: z.ZodObject<{
|
|
112
142
|
ref: z.ZodString;
|
|
143
|
+
packageName: z.ZodString;
|
|
144
|
+
tier: z.ZodEnum<typeof import("..").ProviderTier>;
|
|
145
|
+
vendor: z.ZodString;
|
|
146
|
+
origin: z.ZodObject<{
|
|
147
|
+
kind: z.ZodEnum<typeof import("..").ProviderOriginKind>;
|
|
148
|
+
catalogue: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
source: z.ZodEnum<typeof import("..").ProviderCatalogueSource>;
|
|
150
|
+
sourceRef: z.ZodString;
|
|
151
|
+
sourceVersion: z.ZodString;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
}, z.core.$strip>;
|
|
113
154
|
displayNameLabelKey: z.ZodOptional<z.ZodString>;
|
|
114
155
|
displayName: z.ZodOptional<z.ZodString>;
|
|
115
156
|
iconRef: z.ZodOptional<z.ZodString>;
|
|
@@ -117,13 +158,39 @@ export declare const ProviderCompanionContributionSchema: z.ZodObject<{
|
|
|
117
158
|
providerCapabilities: z.ZodArray<z.ZodString>;
|
|
118
159
|
protocols: z.ZodArray<z.ZodString>;
|
|
119
160
|
publicConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
120
|
-
|
|
161
|
+
csp: z.ZodOptional<z.ZodObject<{
|
|
162
|
+
scriptOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
163
|
+
connectOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
164
|
+
frameOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
165
|
+
imgOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
166
|
+
styleOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
167
|
+
fontOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
168
|
+
derivedOrigins: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
169
|
+
publicConfigKey: z.ZodString;
|
|
170
|
+
bucket: z.ZodEnum<typeof import("..").ProviderFrontendCspOriginBucket>;
|
|
171
|
+
}, z.core.$strict>>>;
|
|
172
|
+
}, z.core.$strict>>;
|
|
173
|
+
sdk: z.ZodOptional<z.ZodObject<{
|
|
174
|
+
packageName: z.ZodString;
|
|
175
|
+
versionRange: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, z.core.$strict>>;
|
|
177
|
+
scripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
src: z.ZodString;
|
|
179
|
+
integrity: z.ZodOptional<z.ZodString>;
|
|
180
|
+
crossOrigin: z.ZodOptional<z.ZodEnum<typeof import("..").ProviderFrontendScriptCrossOrigin>>;
|
|
181
|
+
async: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
defer: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
}, z.core.$strict>>>;
|
|
184
|
+
components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
185
|
+
selectionDelivery: z.ZodOptional<z.ZodEnum<typeof import("..").ProviderFrontendSelectionDelivery>>;
|
|
186
|
+
}, z.core.$strict>>>;
|
|
187
|
+
}, z.core.$loose>>;
|
|
121
188
|
/**
|
|
122
189
|
* Optional app module owner when the provider implementation belongs to one
|
|
123
190
|
* concrete module instead of the whole package/runtime.
|
|
124
191
|
*/
|
|
125
192
|
sourceModuleId: z.ZodOptional<z.ZodString>;
|
|
126
|
-
}, z.core.$
|
|
193
|
+
}, z.core.$loose>;
|
|
127
194
|
export type ProviderCompanionContribution = z.infer<typeof ProviderCompanionContributionSchema>;
|
|
128
195
|
export interface RuntimeOwnerCompanionExports {
|
|
129
196
|
providerContributions?: ProviderCompanionContribution[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-discovery.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/companion/provider-discovery.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-discovery.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/companion/provider-discovery.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAI5F;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0CAA0C;;;kBAGrD,CAAC;AACH,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0CAA0C,CAAC,CAAC;AAE9G,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;4BAgB/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;;;GAMG;AACH,eAAO,MAAM,sCAAsC;;;;;kBAKjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEtG;;;;;;;;;GASG;AACH,eAAO,MAAM,iCAAiC;;;;;mBA+B5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;;;;;;;;GASG;AACH,eAAO,MAAM,mCAAmC;;IAE9C;;;;;;OAMG;;;;;;;;;;;;;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;IAOH;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;;OAGG;;iBAEH,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB,CAAC,EAAE,6BAA6B,EAAE,CAAC;CACzD"}
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { AppFrontendType } from '../config/app-frontend-type.shared.schemas.js';
|
|
3
3
|
import { EngineCapability } from '../external-providers/engine-capabilities.shared.schemas.js';
|
|
4
4
|
import { FrontendProviderEntrySchema } from '../external-providers/frontend-bootstrap.shared.schemas.js';
|
|
5
|
+
import { ProviderIdentitySchema } from '../external-providers/provider-metadata.shared.schemas.js';
|
|
5
6
|
/**
|
|
6
7
|
* Companion-safe provider implementation declaration.
|
|
7
8
|
*
|
|
@@ -93,8 +94,26 @@ export const ProviderSecretContractShapeSchema = z.array(ProviderSecretContractS
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
|
-
|
|
97
|
+
/**
|
|
98
|
+
* A contribution is a wire record produced by one package version and read by
|
|
99
|
+
* another (the CLI, the companion, a generated artifact), so it is a LOOSE
|
|
100
|
+
* object: an additive field from a newer producer rides through an older
|
|
101
|
+
* consumer instead of hard-failing the parse (#328 — it used to be strict,
|
|
102
|
+
* which made every additive field a five-surface change and every old/new
|
|
103
|
+
* mix a boot failure). Required fields stay required; only UNKNOWN keys are
|
|
104
|
+
* tolerated, and they are kept rather than stripped so a re-emitting
|
|
105
|
+
* consumer does not silently drop what it did not understand.
|
|
106
|
+
*/
|
|
107
|
+
export const ProviderCompanionContributionSchema = z.looseObject({
|
|
97
108
|
ref: z.string().min(1),
|
|
109
|
+
/**
|
|
110
|
+
* The provider's identity (package, tier, vendor, origin) as declared on
|
|
111
|
+
* its module metadata, so tooling can display tiers and group vendors
|
|
112
|
+
* without loading the runtime module. Optional on the wire for one
|
|
113
|
+
* reason only: contributions emitted before #328 carry none, and a
|
|
114
|
+
* discovery walk must still read them.
|
|
115
|
+
*/
|
|
116
|
+
identity: ProviderIdentitySchema.optional(),
|
|
98
117
|
/**
|
|
99
118
|
* Stable package import path that makes the provider implementation reachable
|
|
100
119
|
* from the contributing package at runtime. This validates owner-package
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-discovery.shared.schemas.js","sourceRoot":"","sources":["../../../../src/companion/provider-discovery.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAEtG;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC,CAAC,YAAY,CAAC;IACvE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;IAClC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;CACrC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/E,CAAC,CAAC,YAAY,CAAC;QACb,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;KAC3B,CAAC;IACF,CAAC,CAAC,YAAY,CAAC;QACb,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,C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CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACjE,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5D,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACjD,oBAAoB,EAAE,iCAAiC;IACvD;;;;;OAKG;IACH,aAAa,EAAE,2BAA2B,CAAC,QAAQ,EAAE;IACrD;;;OAGG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { AppFrontendType } from '../config/app-frontend-type.shared.schemas';\nimport { EngineCapability } from '../external-providers/engine-capabilities.shared.schemas';\nimport { FrontendProviderEntrySchema } from '../external-providers/frontend-bootstrap.shared.schemas';\n\n/**\n * Companion-safe provider implementation declaration.\n *\n * App/runtime-owner packages expose these entries through their `./companion`\n * default export so tooling can discover which provider refs are actually\n * reachable from which runtime owners before materializing generated artifacts.\n */\n\n/**\n * Discriminator branch for `frontendService` runtime targets.\n *\n * Targets a frontend service by its `AppFrontendType` (the closed kind set\n * — SAAS_APP, STATIC_WEBSITE, TECH_DOC) rather than by an app-defined\n * `serviceKey` string. Engine-shipped packages (`external-connectors-public`,\n * etc.) have no way to know app-defined service keys, so the discovery\n * contract is keyed on the type. Apps with multiple frontend services of\n * the same type currently broadcast the contribution to all of them; if\n * per-service-key targeting becomes a need, add a second variant.\n */\nexport const ProviderFrontendServiceRuntimeTargetSchema = z.strictObject({\n kind: z.literal('frontendService'),\n serviceType: z.enum(AppFrontendType),\n});\nexport type ProviderFrontendServiceRuntimeTarget = z.infer<typeof ProviderFrontendServiceRuntimeTargetSchema>;\n\nexport const ProviderCompanionRuntimeTargetSchema = z.discriminatedUnion('kind', [\n z.strictObject({\n kind: z.literal('backend'),\n }),\n z.strictObject({\n kind: z.literal('companion'),\n }),\n ProviderFrontendServiceRuntimeTargetSchema,\n z.strictObject({\n kind: z.literal('minion'),\n minionKey: z.string().min(1),\n }),\n z.strictObject({\n kind: z.literal('worker'),\n workerKey: z.string().min(1),\n }),\n]);\nexport type ProviderCompanionRuntimeTarget = z.infer<typeof ProviderCompanionRuntimeTargetSchema>;\n\n/**\n * Values-free projection of one backend provider secret requirement.\n *\n * The stable provider-owned `slug` is preserved separately from the concrete\n * environment-variable name so a rename on either axis changes the lockfile\n * integrity digest. Secret values never cross this companion-safe boundary.\n */\nexport const ProviderSecretContractShapeEntrySchema = z.strictObject({\n slug: z.string().min(1),\n envVarName: z.string().min(1),\n required: z.boolean(),\n description: z.string().min(1),\n});\nexport type ProviderSecretContractShapeEntry = z.infer<typeof ProviderSecretContractShapeEntrySchema>;\n\n/**\n * Deterministic, values-free secret-contract shape used by provider discovery\n * and lockfile integrity checks.\n *\n * Every contribution must declare this field. `[]` means the provider is\n * authoritatively known to require no secrets; omission is rejected rather\n * than being silently interpreted as an empty contract. Entries must be\n * sorted by `slug`, and both slugs and environment-variable names are unique,\n * so independently contributed facets cannot produce order-dependent digests.\n */\nexport const ProviderSecretContractShapeSchema = z.array(ProviderSecretContractShapeEntrySchema).superRefine((entries, context) => {\n const seenSlugs = new Set<string>();\n const seenEnvVarNames = new Set<string>();\n\n for (const [index, entry] of entries.entries()) {\n if (seenSlugs.has(entry.slug)) {\n context.addIssue({\n code: 'custom',\n path: [index, 'slug'],\n message: `Duplicate provider secret-contract slug \"${entry.slug}\".`,\n });\n }\n seenSlugs.add(entry.slug);\n\n if (seenEnvVarNames.has(entry.envVarName)) {\n context.addIssue({\n code: 'custom',\n path: [index, 'envVarName'],\n message: `Duplicate provider secret-contract envVarName \"${entry.envVarName}\".`,\n });\n }\n seenEnvVarNames.add(entry.envVarName);\n\n if (index > 0 && entries[index - 1].slug.localeCompare(entry.slug) >= 0) {\n context.addIssue({\n code: 'custom',\n path: [index, 'slug'],\n message: 'Provider secret-contract entries must be sorted by slug.',\n });\n }\n }\n});\nexport type ProviderSecretContractShape = z.infer<typeof ProviderSecretContractShapeSchema>;\n\nexport const ProviderCompanionContributionSchema = z.strictObject({\n ref: z.string().min(1),\n /**\n * Stable package import path that makes the provider implementation reachable\n * from the contributing package at runtime. This validates owner-package\n * reachability without coupling discovery to source-file paths.\n */\n runtimeImportPath: z.string().min(1),\n runtimeTargets: z.array(ProviderCompanionRuntimeTargetSchema).min(1),\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(z.string().min(1)).default([]),\n protocols: z.array(z.string().min(1)).default([]),\n secretsContractShape: ProviderSecretContractShapeSchema,\n /**\n * Optional frontend-safe provider payload for `frontendService` runtime\n * targets. Tooling materializes this into generated runtime artifacts so the\n * backend bootstrap endpoint can serve app-owned public providers without\n * importing frontend packages at runtime.\n */\n frontendEntry: FrontendProviderEntrySchema.optional(),\n /**\n * Optional app module owner when the provider implementation belongs to one\n * concrete module instead of the whole package/runtime.\n */\n sourceModuleId: z.string().min(1).optional(),\n});\nexport type ProviderCompanionContribution = z.infer<typeof ProviderCompanionContributionSchema>;\n\nexport interface RuntimeOwnerCompanionExports {\n providerContributions?: ProviderCompanionContribution[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"provider-discovery.shared.schemas.js","sourceRoot":"","sources":["../../../../src/companion/provider-discovery.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAC5F,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;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gBACrB,OAAO,EAAE,0DAA0D;aACpE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC;AAGH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC,WAAW,CAAC;IAC/D,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IAC3C;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpE,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACjE,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC5D,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACjD,oBAAoB,EAAE,iCAAiC;IACvD;;;;;OAKG;IACH,aAAa,EAAE,2BAA2B,CAAC,QAAQ,EAAE;IACrD;;;OAGG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { AppFrontendType } from '../config/app-frontend-type.shared.schemas';\nimport { EngineCapability } from '../external-providers/engine-capabilities.shared.schemas';\nimport { FrontendProviderEntrySchema } from '../external-providers/frontend-bootstrap.shared.schemas';\nimport { ProviderIdentitySchema } from '../external-providers/provider-metadata.shared.schemas';\n\n/**\n * Companion-safe provider implementation declaration.\n *\n * App/runtime-owner packages expose these entries through their `./companion`\n * default export so tooling can discover which provider refs are actually\n * reachable from which runtime owners before materializing generated artifacts.\n */\n\n/**\n * Discriminator branch for `frontendService` runtime targets.\n *\n * Targets a frontend service by its `AppFrontendType` (the closed kind set\n * — SAAS_APP, STATIC_WEBSITE, TECH_DOC) rather than by an app-defined\n * `serviceKey` string. Engine-shipped packages (`external-connectors-public`,\n * etc.) have no way to know app-defined service keys, so the discovery\n * contract is keyed on the type. Apps with multiple frontend services of\n * the same type currently broadcast the contribution to all of them; if\n * per-service-key targeting becomes a need, add a second variant.\n */\nexport const ProviderFrontendServiceRuntimeTargetSchema = z.strictObject({\n kind: z.literal('frontendService'),\n serviceType: z.enum(AppFrontendType),\n});\nexport type ProviderFrontendServiceRuntimeTarget = z.infer<typeof ProviderFrontendServiceRuntimeTargetSchema>;\n\nexport const ProviderCompanionRuntimeTargetSchema = z.discriminatedUnion('kind', [\n z.strictObject({\n kind: z.literal('backend'),\n }),\n z.strictObject({\n kind: z.literal('companion'),\n }),\n ProviderFrontendServiceRuntimeTargetSchema,\n z.strictObject({\n kind: z.literal('minion'),\n minionKey: z.string().min(1),\n }),\n z.strictObject({\n kind: z.literal('worker'),\n workerKey: z.string().min(1),\n }),\n]);\nexport type ProviderCompanionRuntimeTarget = z.infer<typeof ProviderCompanionRuntimeTargetSchema>;\n\n/**\n * Values-free projection of one backend provider secret requirement.\n *\n * The stable provider-owned `slug` is preserved separately from the concrete\n * environment-variable name so a rename on either axis changes the lockfile\n * integrity digest. Secret values never cross this companion-safe boundary.\n */\nexport const ProviderSecretContractShapeEntrySchema = z.strictObject({\n slug: z.string().min(1),\n envVarName: z.string().min(1),\n required: z.boolean(),\n description: z.string().min(1),\n});\nexport type ProviderSecretContractShapeEntry = z.infer<typeof ProviderSecretContractShapeEntrySchema>;\n\n/**\n * Deterministic, values-free secret-contract shape used by provider discovery\n * and lockfile integrity checks.\n *\n * Every contribution must declare this field. `[]` means the provider is\n * authoritatively known to require no secrets; omission is rejected rather\n * than being silently interpreted as an empty contract. Entries must be\n * sorted by `slug`, and both slugs and environment-variable names are unique,\n * so independently contributed facets cannot produce order-dependent digests.\n */\nexport const ProviderSecretContractShapeSchema = z.array(ProviderSecretContractShapeEntrySchema).superRefine((entries, context) => {\n const seenSlugs = new Set<string>();\n const seenEnvVarNames = new Set<string>();\n\n for (const [index, entry] of entries.entries()) {\n if (seenSlugs.has(entry.slug)) {\n context.addIssue({\n code: 'custom',\n path: [index, 'slug'],\n message: `Duplicate provider secret-contract slug \"${entry.slug}\".`,\n });\n }\n seenSlugs.add(entry.slug);\n\n if (seenEnvVarNames.has(entry.envVarName)) {\n context.addIssue({\n code: 'custom',\n path: [index, 'envVarName'],\n message: `Duplicate provider secret-contract envVarName \"${entry.envVarName}\".`,\n });\n }\n seenEnvVarNames.add(entry.envVarName);\n\n if (index > 0 && entries[index - 1].slug.localeCompare(entry.slug) >= 0) {\n context.addIssue({\n code: 'custom',\n path: [index, 'slug'],\n message: 'Provider secret-contract entries must be sorted by slug.',\n });\n }\n }\n});\nexport type ProviderSecretContractShape = z.infer<typeof ProviderSecretContractShapeSchema>;\n\n/**\n * A contribution is a wire record produced by one package version and read by\n * another (the CLI, the companion, a generated artifact), so it is a LOOSE\n * object: an additive field from a newer producer rides through an older\n * consumer instead of hard-failing the parse (#328 — it used to be strict,\n * which made every additive field a five-surface change and every old/new\n * mix a boot failure). Required fields stay required; only UNKNOWN keys are\n * tolerated, and they are kept rather than stripped so a re-emitting\n * consumer does not silently drop what it did not understand.\n */\nexport const ProviderCompanionContributionSchema = z.looseObject({\n ref: z.string().min(1),\n /**\n * The provider's identity (package, tier, vendor, origin) as declared on\n * its module metadata, so tooling can display tiers and group vendors\n * without loading the runtime module. Optional on the wire for one\n * reason only: contributions emitted before #328 carry none, and a\n * discovery walk must still read them.\n */\n identity: ProviderIdentitySchema.optional(),\n /**\n * Stable package import path that makes the provider implementation reachable\n * from the contributing package at runtime. This validates owner-package\n * reachability without coupling discovery to source-file paths.\n */\n runtimeImportPath: z.string().min(1),\n runtimeTargets: z.array(ProviderCompanionRuntimeTargetSchema).min(1),\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(z.string().min(1)).default([]),\n protocols: z.array(z.string().min(1)).default([]),\n secretsContractShape: ProviderSecretContractShapeSchema,\n /**\n * Optional frontend-safe provider payload for `frontendService` runtime\n * targets. Tooling materializes this into generated runtime artifacts so the\n * backend bootstrap endpoint can serve app-owned public providers without\n * importing frontend packages at runtime.\n */\n frontendEntry: FrontendProviderEntrySchema.optional(),\n /**\n * Optional app module owner when the provider implementation belongs to one\n * concrete module instead of the whole package/runtime.\n */\n sourceModuleId: z.string().min(1).optional(),\n});\nexport type ProviderCompanionContribution = z.infer<typeof ProviderCompanionContributionSchema>;\n\nexport interface RuntimeOwnerCompanionExports {\n providerContributions?: ProviderCompanionContribution[];\n}\n"]}
|
package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AuditEventCategory, AuditEventSeverity } from './auditable-events.shared.schema';
|
|
3
|
+
import { CoreResourceOperation } from '../../resources/resources.shared.core.definitions';
|
|
4
|
+
import { ResourceOperationRiskLevel, ResourceRelationship } from '../../resources/resources.shared.schemas';
|
|
5
|
+
/**
|
|
6
|
+
* The APPLICATION-scoped door onto the audit trail.
|
|
7
|
+
*
|
|
8
|
+
* ## Why this exists at all
|
|
9
|
+
*
|
|
10
|
+
* `AUDIT_LOGS` is organization-scoped and its only route is
|
|
11
|
+
* `/organizations/{organizationId}/audit-logs`, so it returns exactly the rows carrying that
|
|
12
|
+
* tenant. A large share of security events carry NO organization by design — `logUserLogin` takes
|
|
13
|
+
* `organizationId` as optional because no organization is selected at login, and the same is true
|
|
14
|
+
* of session eviction, token refresh and application-wide authentication-policy changes. Measured
|
|
15
|
+
* on a dogfood application (#317): **94 of 127 rows had no organization**, and were reachable
|
|
16
|
+
* through no API. An operator could see 26% of the trail and could not attest the rest, while a
|
|
17
|
+
* reader querying the only available surface saw `user_login: 0` for a control that had emitted 21.
|
|
18
|
+
*
|
|
19
|
+
* ## Why a SEPARATE resource type rather than a second route
|
|
20
|
+
*
|
|
21
|
+
* `generateParentCombinations` composes every URL as
|
|
22
|
+
* `[...primaryScope, ...mandatoryContext, ...optionalCombo]`, so a routed application edge on
|
|
23
|
+
* `AUDIT_LOGS` would appear in EVERY combination and rewrite the organization route to
|
|
24
|
+
* `/applications/{applicationId}/organizations/{organizationId}/audit-logs` — breaking all eight of
|
|
25
|
+
* its documented paths and their consumers. Making the organization edge optional does not help:
|
|
26
|
+
* the empty combination is skipped whenever any parent exists, so no bare route is emitted either.
|
|
27
|
+
* A sibling type carrying ONE application parent takes the route it needs and leaves the existing
|
|
28
|
+
* door byte-identical. The pattern is the engine's own: notification badges are dual-scope with a
|
|
29
|
+
* type per scope, `APPLICATION_API_KEYS` shows the application routing shape, and `USER_SELF`
|
|
30
|
+
* shows a distinct type addressing another's rows.
|
|
31
|
+
*
|
|
32
|
+
* ## Two doors, ONE record set — the security contract
|
|
33
|
+
*
|
|
34
|
+
* Both types resolve to the `auditLogs` collection through
|
|
35
|
+
* `RESOURCE_SHARED_PERSISTENCE_COLLECTION_ALIASES`. That makes the isolation properties a
|
|
36
|
+
* per-DOOR obligation rather than a property of the rows:
|
|
37
|
+
*
|
|
38
|
+
* - the organization door keeps its tenant filter and its organization roles, unchanged;
|
|
39
|
+
* - this door is `APP_ADMIN_SUPER_ADMIN`-ONLY on every operation. An organization role must never
|
|
40
|
+
* reach it — the rows behind it span every tenant;
|
|
41
|
+
* - a read here that touches a tenant-attributed row is a CROSS-TENANT read and OWES an audit
|
|
42
|
+
* emission. **It is wired**, by the two halves below acting together, and neither is optional:
|
|
43
|
+
* each read variant declares `admitsCrossTenantPlatformAdministration`, and
|
|
44
|
+
* `ServicesRegistryHandler.recordCrossTenantReadAccess` observes every enrolled read and emits
|
|
45
|
+
* `CROSS_TENANT_ADMINISTRATIVE_ACCESS` once per TENANT the returned rows belong to. The
|
|
46
|
+
* declaration is what enrols the read: `authorizeOrganizations` — where that event is otherwise
|
|
47
|
+
* emitted — runs only for ORGANIZATIONS-scoped resources and decides on ONE fetched row, so it
|
|
48
|
+
* never sees this door at all. Grouping per tenant is what makes the crossing visible to the
|
|
49
|
+
* REACHED tenant, in its own organization-scoped viewer, rather than only to the operator.
|
|
50
|
+
* `.claude/rules/administrative-continuity-floors.md` requires every crossing to be named in the
|
|
51
|
+
* trail, and the trail is the worst possible surface on which to make an operator read invisible.
|
|
52
|
+
* See `security/authorizations/cross-tenant-read-observation.backend.ts` for why an UNDECLARED
|
|
53
|
+
* door is deliberately not observed instead of being observed with a false `admissionDeclared`.
|
|
54
|
+
*
|
|
55
|
+
* ## Deliberately mirrored from the organization resource
|
|
56
|
+
*
|
|
57
|
+
* `isSystemResource`, `systemAccessPolicy.exportSubject: FORBIDDEN` and the ABSENCE of a
|
|
58
|
+
* `retentionPolicy` are copied ON PURPOSE. They are properties of the ROWS, and the rows are the
|
|
59
|
+
* same ones — a second door that disagreed about whether the audit trail is subject-exportable, or
|
|
60
|
+
* about how long it is kept, would be a policy fork over one record set. See the organization
|
|
61
|
+
* config for the reasoning behind each; do not change one without the other.
|
|
62
|
+
*
|
|
63
|
+
* ## Deliberately NOT mirrored
|
|
64
|
+
*
|
|
65
|
+
* There is no CREATE. The organization resource carries a `REPOSITORY_ONLY` CREATE because that is
|
|
66
|
+
* how audit rows are written; writing is not a scope question and must keep exactly one door.
|
|
67
|
+
*/
|
|
68
|
+
export declare const applicationAuditLogsResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => import("../..").ResourceConfiguration<undefined, CoreResourceOperation.READ | CoreResourceOperation.LIST | CoreResourceOperation.SEARCH, z.ZodObject<{
|
|
69
|
+
_id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
|
|
70
|
+
eventId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>;
|
|
71
|
+
userId: z.ZodOptional<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
|
|
72
|
+
organizationId: z.ZodOptional<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
|
|
73
|
+
applicationId: z.ZodOptional<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
|
|
74
|
+
correlationId: z.ZodOptional<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>>;
|
|
75
|
+
frontendServiceName: z.ZodOptional<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
|
|
76
|
+
clientInstanceId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>>>;
|
|
77
|
+
riskLevel: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodEnum<typeof ResourceOperationRiskLevel>>;
|
|
78
|
+
eventType: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
|
|
79
|
+
eventData: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
80
|
+
eventCategory: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodEnum<typeof AuditEventCategory>>;
|
|
81
|
+
severity: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodEnum<typeof AuditEventSeverity>>;
|
|
82
|
+
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodDate>>>>;
|
|
83
|
+
updatedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodDate>>>;
|
|
84
|
+
}, z.core.$strip>>;
|
|
85
|
+
//# sourceMappingURL=application-audit-logs.shared.resources-config.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-audit-logs.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAA6B,MAAM,kCAAkC,CAAC;AAErH,OAAO,EAAE,qBAAqB,EAAwD,MAAM,mDAAmD,CAAC;AAChJ,OAAO,EAAE,0BAA0B,EAAgC,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAI1I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,eAAO,MAAM,+DAA+D,GAC1E,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;kBA8F9C,CAAC"}
|