@wildo-ai/saas-models 1.1.2 → 1.1.4
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/__tests__/setup.d.ts.map +1 -1
- package/dist/esm/_inspect.d.ts.map +1 -1
- package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-subject.shared.schemas.d.ts.map +1 -1
- package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
- 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/applications/applications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.d.ts.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 +4 -3
- package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.js +45 -0
- package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/price.shared.schemas.js +7 -1
- package/dist/esm/billing/price.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product-behavior-policy.shared.schemas.js +52 -11
- package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
- package/dist/esm/billing/product-definition.shared.schemas.d.ts +2 -2
- package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +2 -2
- package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
- 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/promotions.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/promotions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/referral.shared.schemas.d.ts.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/subscription.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.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/charts/aggregation-query.shared.schemas.d.ts.map +1 -1
- package/dist/esm/charts/chart-definition-builder.shared.d.ts.map +1 -1
- package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +71 -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/companion/shared-library-companion.shared.definitions.d.ts.map +1 -1
- package/dist/esm/companion-exports.d.ts.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-log-sink.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-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 +658 -26
- 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 +873 -27
- 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 +104 -3
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +54 -26
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +132 -3
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.d.ts.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/retention-schedule.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/subject-export.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/brand-assets.shared.schemas.d.ts.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 +26 -26
- package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts +139 -3
- package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
- package/dist/esm/config/frontend/chart-registration-alignment.shared.js +151 -4
- package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/registration-acquisition-policy.shared.utils.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/crdt/crdt-merge.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/data-seeding-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +34 -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 +34 -0
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
- package/dist/esm/errors/errors.shared.definitions.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/errors/errors.shared.utils.d.ts.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-data.exports.d.ts.map +1 -1
- package/dist/esm/external-providers/compose-provider-registry.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +110 -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 +183 -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/external-providers.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +87 -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 +205 -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 +85 -1
- package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts +175 -0
- package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -0
- package/dist/esm/external-providers/frontend-provider-public-config.shared.js +207 -0
- package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -0
- 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 +28 -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 +15 -4
- package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts +165 -0
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -0
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js +39 -0
- package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -0
- 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/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/application-features.shared.resources-config.schemas.js +12 -0
- package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
- package/dist/esm/features/core-feature-definitions.shared.js +7 -1
- package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
- package/dist/esm/features/feature-builders.shared.d.ts +32 -0
- package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
- package/dist/esm/features/feature-builders.shared.js +32 -0
- package/dist/esm/features/feature-builders.shared.js.map +1 -1
- package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/feature-registry.shared.d.ts.map +1 -1
- package/dist/esm/features/feature-resolution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.js +12 -0
- package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts +73 -0
- package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -0
- package/dist/esm/files/file-remote-reference-link.shared.schemas.js +62 -0
- package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -0
- 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.resources-config.schemas.d.ts.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/files/files.shared.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.d.ts.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/agent-traceability.shared.schemas.d.ts.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.map +1 -1
- package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +0 -3
- package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/deliberation.shared.schemas.js +0 -5
- package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.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-task.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.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.configuration.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors.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.definitions.d.ts.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 +130 -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 +153 -0
- package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -0
- package/dist/esm/flows-actors/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -1
- 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/catalog.meta-workflows.shared.schemas.d.ts.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/continuity-identifiers.meta-workflows.shared.schemas.d.ts.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.d.ts.map +1 -1
- 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/flows-actors/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/prompt-ir.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts +112 -0
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -0
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js +113 -0
- package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -0
- package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.utils.js +1 -0
- package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
- package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
- package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.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-id.shared.utils.d.ts.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/i18n/labelling.dto.shared.schemas.d.ts.map +1 -1
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
- package/dist/esm/monitoring/monitoring.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-context.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +11 -2
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
- package/dist/esm/notifications/email/email-template.shared.enums.d.ts +15 -0
- package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
- package/dist/esm/notifications/email/email-template.shared.enums.js +15 -0
- package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.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/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.d.ts +158 -0
- package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notifications.shared.schemas.js +200 -1
- package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js +13 -0
- package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-notifications.shared.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.resources-config.schemas.d.ts.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.resources-config.schemas.d.ts.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-inheritance.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
- package/dist/esm/organizations/organization-unit-narrowing.example.d.ts.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/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-units.shared.schemas.d.ts.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/organizations/organizations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts +13 -0
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js +13 -0
- package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
- package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
- package/dist/esm/public-runtime/index.d.ts +71 -2
- package/dist/esm/public-runtime/index.d.ts.map +1 -1
- package/dist/esm/public-runtime/index.js +62 -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/queue/jobs.shared.utils.d.ts.map +1 -1
- package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
- package/dist/esm/queue/queues.shared.utils.d.ts.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 +1255 -0
- package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -0
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts +114 -0
- package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
- package/dist/esm/requests/manual-controllers-routes-urls.js +129 -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 +28 -3
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js +52 -0
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/relationship-display.shared.schemas.d.ts.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 +203 -25
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +297 -68
- 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 +151 -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-serialization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.d.ts +54 -0
- package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.core.definitions.js +69 -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/resources.shared.utils.d.ts +32 -7
- package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/resources.shared.utils.js +32 -7
- package/dist/esm/resources/resources.shared.utils.js.map +1 -1
- package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/composition-seedability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/duplicate-relationship-registration.validation.d.ts.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/persistence-adapter-discrimination.shared.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/repository-dto-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/required-fk-fillability.validation.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-operation-type-guards.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.relationships.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.schemas.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-polymorphism.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-subtree.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-context-needs.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.path.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-summary.utils.d.ts +16 -2
- package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-summary.utils.js +19 -5
- package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
- package/dist/esm/resources/utils/schema-family-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-type-inference.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-type-utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/schema-variant-resolver.utils.d.ts.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/resources/utils/templatable-file-fields.shared.utils.d.ts.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/runtime/execution-context.shared.schemas.d.ts.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/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +5 -12
- 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/authentication.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/password-reset.shared.dto.schemas.d.ts.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-organization-unit-mapping.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.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/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.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 +238 -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.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +2 -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 +32 -8
- package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts +45 -2
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js +45 -2
- package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts +35 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js +257 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts +143 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js +219 -0
- package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -0
- 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 +75 -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 +69 -8
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts.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 +307 -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 +530 -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.resources-config.schemas.d.ts.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/security/oauth-clients/oauth-resource-server.shared.schemas.d.ts.map +1 -1
- package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
- package/dist/esm/testing.d.ts.map +1 -1
- package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-preferences-reset.shared.utils.d.ts.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +4 -4
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +4 -4
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self.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 +60 -13
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js +56 -9
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.shared.schemas.js","sourceRoot":"","sources":["../../../../src/resources/resources.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAE/B,kBAAkB,GACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,uCAAuC,GAExC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AAKxF;;;;GAIG;AACH,MAAM,CAAN,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACpC,yCAAW,CAAA;IACX,+CAAiB,CAAA;I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qE;gBACrE,kEAAkE;gBAClE,qEAAqE;gBACrE,wDAAwD;gBACxD,IAAI,CAAC;oBACH,MAAM,WAAW,GACf,MAAM,iBAAiB,CAAC,0BAA0B,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;oBAChG,OAAO,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACpC,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CACnB,4CAA4C,UAAU,CAAC,eAAe,IAAI,SAAS,IAAI,SAAS,kBAAkB,EAClH,KAAK,CACN,CAAC;oBACF,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,wEAAwE;YACxE,0EAA0E;YAC1E,MAAM,QAAQ,GAAG,oBAAoB,CAAC,UAAU,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;YACnF,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC;QAC5D,CAAC;KACF,CAAC;SACD,cAAc,EAAE;SAChB,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACjC,CAAC","sourcesContent":["/**\n * Operations Shared Schemas\n *\n * Reusable operation schemas for bulk actions and common operations\n */\n\nimport { z } from 'zod';\nimport type { DecoratedPrimitiveZodType } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation,\n OPERATIONS_WITHOUT_REQUEST_BODY,\n ResourceType,\n ResourceTypeSchema,\n} from './resources.shared.core.definitions';\nimport { RelationshipContextPolicySchema } from './context-policy.shared.schemas';\nimport {\n ChildLifecycleMode,\n ChildLifecycleStrategy,\n ChildOperationsConfigSchema,\n ResourceRelationshipDiscriminatorSchema,\n type ChildOperationsConfig_Parsed,\n} from './child-operations.shared.schemas';\nimport { RelationshipDisplayConfigSchema } from './relationship-display.shared.schemas';\nimport { SchemaInfer } from './utils/schema-type-inference.utils';\n\nexport type { ResourceType } from './resources.shared.core.definitions';\n\n/**\n * @wildo_source:part:start saas.models.resource-operation-display-risk facet:layer:shared facet:family:resource-config\n *\n * Operation bar risk level and UI density (summary vs detail).\n */\nexport enum ResourceOperationRiskLevel {\n LOW = 'low',\n MEDIUM = 'medium',\n HIGH = 'high',\n CRITICAL = 'critical'\n}\n\n/**\n * The **frontend surface** of a resource operation — whether (and how) the\n * operation is presented in the UI. This is a per-app, per-operation DISPLAY\n * axis, orthogonal to authorization (roles remain the only security authority).\n *\n * Three mutually-exclusive surfaces:\n *\n * - `ADDRESSABLE` — the operation has a **URL-routable** view (a deep-linkable\n * page that lives in the navigation area; row-click resolves a route). Has an\n * action button.\n * - `EMBEDDED` — the operation has a view that is **not URL-addressable**: it has\n * no route of its own and is rendered **within a host**, however that host\n * surfaces it — as an overlay/drill-in when invoked standalone, or inline when\n * embedded in a composite view or a nested relationship view. Has an action\n * button. (This is what `notAddressable()` produces.) Named for the host\n * relationship, NOT one presentation: do not assume it always renders as an overlay.\n * - `API_ONLY` — the operation is **headless**: callable from frontend code as a\n * typed API, but has NO rendered interface at all (no page, no embedded view, no\n * action button). For operations driven by the system / a workflow / signup rather\n * than a user form (e.g. auto-created profiles, engine-authored state).\n *\n * `ADDRESSABLE` vs `EMBEDDED` is the URL-routability axis (both have a real view);\n * `API_ONLY` is the has-no-interface axis. The button-visibility axis\n * (`ActionVisibility`) is a further orthogonal refinement that only applies to the\n * two view surfaces.\n *\n * Authored on the frontend preset per operation via `addressable()` /\n * `notAddressable()` / `apiOnly()`; an operation may also declare a\n * `defaultFrontendPosture` so the framework defaults its surface when no app\n * preset surfaces it.\n *\n * Imported from `@wildo-ai/saas-models`.\n */\nexport enum ResourceOperationFrontendSurface {\n /** URL-routable view (deep-linkable page in the navigation area). */\n ADDRESSABLE = 'addressable',\n /** Non-addressable view rendered within a host — overlay/drill-in when standalone, inline when embedded in a composite or nested relationship view. */\n EMBEDDED = 'embedded',\n /** Headless — callable from code as an API, with no rendered interface at all. */\n API_ONLY = 'api_only',\n}\n\n/**\n * Display mode for resource operation action bars — controls operation bar density.\n * SUMMARY = compact row actions (icon-only, in list/table rows).\n *\n * Note: \"summary\" here is about *UI density*, not API data shape (see DataMode.SUMMARY)\n * or FK rendering (see ForeignKeyDisplayMode.SUMMARY).\n */\nexport enum ResourceOperationDisplayMode {\n /** In a list/table row — compact, icon-only, includes \"View Details\" */\n SUMMARY = 'summary',\n /** In a full read/detail view — can show inline labels */\n DETAIL = 'detail',\n}\n/** @wildo_source:part:end saas.models.resource-operation-display-risk */\n\n/**\n * @wildo_source:part:start saas.models.resource-primary-scope facet:layer:shared facet:family:resource-config\n *\n * Primary execution scope (org, user self, app, anonymous) + anonymous transposition policy.\n */\nexport enum ResourcePrimaryScope {\n USER_SELF = 'user_self',\n ORGANIZATIONS = 'organizations',\n APPLICATION = 'applications',\n ANONYMOUS = 'anonymous',\n}\n\n/**\n * W7.3a: Controls how anonymous resources are handled during transposition\n * (when an anonymous user registers/logs in as an authenticated user).\n */\nexport enum ResourceTranspositionPolicy {\n /** Simply reassign ownership (anonymousUserId → userId). No conflict check. Default. */\n ADD = 'ADD',\n /** Delete the authenticated user's existing records of this type, then reassign anonymous ones. */\n REPLACE = 'REPLACE',\n /** Delegate to a custom service hook (app-developer-defined merge logic). */\n MERGE = 'MERGE',\n /** Skip transposition entirely — anonymous records are not carried over. */\n DISCARD = 'DISCARD',\n}\n/** @wildo_source:part:end saas.models.resource-primary-scope */\n\n// ============================================================================\n// Primary Scope Field Mappings (Single Source of Truth)\n// ============================================================================\n\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from './resources.shared.core.definitions';\n\n/**\n * Map from ResourcePrimaryScope to the CoreResourceType it represents.\n * This is the foundation - other mappings derive from this.\n */\nexport const PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE: Record<ResourcePrimaryScope, CoreResourceType> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: CoreResourceType.ORGANIZATIONS,\n [ResourcePrimaryScope.USER_SELF]: CoreResourceType.USERS,\n [ResourcePrimaryScope.APPLICATION]: CoreResourceType.APPLICATION,\n [ResourcePrimaryScope.ANONYMOUS]: CoreResourceType.ANONYMOUS_USERS,\n};\n\n/**\n * Map from ResourcePrimaryScope to its field identifier.\n * Uses coreResourceShared_FieldIdentifier as the source of truth for field names.\n */\nexport const PRIMARY_SCOPE_TO_FIELD_IDENTIFIER: Record<ResourcePrimaryScope, string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS],\n [ResourcePrimaryScope.USER_SELF]: coreResourceShared_FieldIdentifier[CoreResourceType.USERS],\n [ResourcePrimaryScope.APPLICATION]: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION],\n [ResourcePrimaryScope.ANONYMOUS]: coreResourceShared_FieldIdentifier[CoreResourceType.ANONYMOUS_USERS],\n};\n\n/**\n * Primary scope field identifiers - auto-populated from execution context.\n * These fields should be excluded from CREATE/UPDATE DTOs because they are\n * automatically injected by the backend based on the authenticated user's context.\n *\n * Derived from PRIMARY_SCOPE_TO_FIELD_IDENTIFIER values.\n */\nexport const PRIMARY_SCOPE_FIELD_IDENTIFIERS = Object.values(PRIMARY_SCOPE_TO_FIELD_IDENTIFIER) as readonly string[];\nexport type PrimaryScopeFieldIdentifier = (typeof PRIMARY_SCOPE_FIELD_IDENTIFIERS)[number];\n\n/**\n * Field identifiers the framework AUTO-POPULATES on a write and therefore omits\n * from every client-shaped CREATE/UPDATE request DTO — the primary-scope FKs\n * (`organizationId` / `applicationId` / `userId` / `anonymousUserId`, injected\n * from the execution context) PLUS the audit FK `createdByUserId` (stamped by\n * the repository from the initiator). A client is never allowed to author these;\n * the auto-derivation strips them by NAME (see\n * `resources-config-operations.dtos-builder.utils.ts` — `applyCreate/UpdateOmissionsToSchema`).\n *\n * Single source of truth: the DTO builder consumes this for its omit list, and\n * `deriveTrustedSystemWritePreservedFields` consumes it to know which\n * name-stripped fields a TRUSTED in-process system write (via\n * `SystemAccessBackendService.createAsSystem` / `updateAsSystem`) must re-attach.\n * Keeping both consumers on one const prevents the two lists from drifting.\n *\n * NOTE: intentionally EXCLUDES `_id` / `createdAt` / `updatedAt` / `deletedAt` —\n * those are timestamp/PK fields handled by `createOrUpdateMandatoryDiscardFields`\n * (force-removed before validation), never re-attached by a trusted write.\n */\nexport const CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS: readonly string[] = [\n 'createdByUserId',\n ...PRIMARY_SCOPE_FIELD_IDENTIFIERS,\n];\n\n/**\n * Map from field identifier to ResourcePrimaryScope.\n * Built by inverting PRIMARY_SCOPE_TO_FIELD_IDENTIFIER.\n */\nexport const FIELD_IDENTIFIER_TO_PRIMARY_SCOPE: Record<string, ResourcePrimaryScope> = Object.fromEntries(\n Object.entries(PRIMARY_SCOPE_TO_FIELD_IDENTIFIER).map(([scope, field]) => [field, scope as ResourcePrimaryScope])\n);\n\n/**\n * Map from ResourcePrimaryScope to the CoreResourceType(s) it represents.\n * Returns as array for compatibility (though each scope maps to a single type).\n */\nexport const PRIMARY_SCOPE_TO_RESOURCE_TYPES: Record<ResourcePrimaryScope, CoreResourceType[]> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: [PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE[ResourcePrimaryScope.ORGANIZATIONS]],\n [ResourcePrimaryScope.USER_SELF]: [PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE[ResourcePrimaryScope.USER_SELF]],\n [ResourcePrimaryScope.APPLICATION]: [PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE[ResourcePrimaryScope.APPLICATION]],\n [ResourcePrimaryScope.ANONYMOUS]: [PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE[ResourcePrimaryScope.ANONYMOUS]],\n};\n\n/**\n * Get the field identifier for a primary scope.\n */\nexport function getPrimaryScopeFieldIdentifier(primaryScope: ResourcePrimaryScope): string {\n return PRIMARY_SCOPE_TO_FIELD_IDENTIFIER[primaryScope];\n}\n\n// ============================================================================\n// Billing Scope → Resource Type Mapping\n// ============================================================================\n\n/**\n * The 2 scopes that have billing polymorphic variants.\n * APPLICATION scope is intentionally absent — it has no billing variants;\n * scope-agnostic billing resources (Products, Prices, etc.) are not per-scope.\n */\nexport const BILLING_SCOPES: readonly ResourcePrimaryScope[] = [\n ResourcePrimaryScope.ORGANIZATIONS,\n ResourcePrimaryScope.USER_SELF,\n] as const;\n\n/**\n * Per-scope billing resource types.\n * Maps each billing scope to the set of polymorphic resource type variants\n * that belong to it. Used to selectively exclude disabled scopes while\n * keeping enabled scopes and scope-agnostic resources (Products, Prices, etc.).\n */\nexport const BILLING_SCOPE_RESOURCE_TYPES: Readonly<Partial<Record<ResourcePrimaryScope, ReadonlySet<CoreResourceType>>>> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: new Set([\n CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS,\n CoreResourceType.ORGANIZATION_SUBSCRIPTIONS,\n CoreResourceType.ORGANIZATION_INVOICE_REFS,\n CoreResourceType.ORGANIZATION_USAGE_RECORDS,\n CoreResourceType.ORGANIZATION_CREDIT_POOLS,\n ]),\n [ResourcePrimaryScope.USER_SELF]: new Set([\n CoreResourceType.USER_BILLING_ACCOUNTS,\n CoreResourceType.USER_SUBSCRIPTIONS,\n CoreResourceType.USER_INVOICE_REFS,\n CoreResourceType.USER_USAGE_RECORDS,\n CoreResourceType.USER_CREDIT_POOLS,\n ]),\n};\n\n/**\n * Get the primary scope for a field identifier.\n * Returns undefined if the field is not a primary scope field.\n */\nexport function getPrimaryScopeFromFieldIdentifier(fieldIdentifier: string): ResourcePrimaryScope | undefined {\n return FIELD_IDENTIFIER_TO_PRIMARY_SCOPE[fieldIdentifier];\n}\n\n/**\n * Check if a field identifier is a primary scope field.\n */\nexport function isPrimaryScopeFieldIdentifier(fieldIdentifier: string): fieldIdentifier is PrimaryScopeFieldIdentifier {\n return PRIMARY_SCOPE_FIELD_IDENTIFIERS.includes(fieldIdentifier as PrimaryScopeFieldIdentifier);\n}\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-cardinality facet:layer:shared facet:family:resource-config\n *\n * Cardinality literals plus helpers (`isOneToOneCardinality`, `isArrayCardinality`).\n */\nexport enum ResourceRelationshipCardinality {\n ONE = 'one',\n ZERO_OR_ONE = 'zero_or_one',\n ONE_OR_MANY = 'one_or_many',\n MANY = 'many',\n}\n\n/**\n * Check if a cardinality represents a 1:1 relationship (single object).\n * Both `ONE` (mandatory) and `ZERO_OR_ONE` (optional) are single-object cardinalities.\n *\n * Use this utility instead of checking `=== ONE` directly, to avoid\n * the common bug of missing `ZERO_OR_ONE` (optional 1:1) handling.\n *\n * Determines:\n * - DTO shape: single optional object (not array)\n * - Nested field naming: singular (e.g., \"profile\" not \"profiles\")\n * - Fetch strategy: READ (not LIST)\n * - URL path: singular entity path\n */\nexport function isOneToOneCardinality(cardinality: ResourceRelationshipCardinality): boolean {\n return cardinality === ResourceRelationshipCardinality.ONE ||\n cardinality === ResourceRelationshipCardinality.ZERO_OR_ONE;\n}\n\n/**\n * Check if a cardinality represents a 1:N relationship (array/collection).\n * Both `MANY` (zero or more) and `ONE_OR_MANY` (at least one) are array cardinalities.\n *\n * Use this utility instead of checking `=== MANY` directly, to avoid\n * the common bug of missing `ONE_OR_MANY` (mandatory at-least-one) handling.\n *\n * Determines:\n * - DTO shape: array of objects\n * - Nested field naming: plural (e.g., \"tasks\" not \"task\")\n * - Fetch strategy: LIST\n * - URL path: collection path\n */\nexport function isArrayCardinality(cardinality: ResourceRelationshipCardinality): boolean {\n return cardinality === ResourceRelationshipCardinality.MANY ||\n cardinality === ResourceRelationshipCardinality.ONE_OR_MANY;\n}\n/** @wildo_source:part:end saas.models.resource-relationship-cardinality */\n\n/**\n * @wildo_source:part:start saas.models.resource-operation-variant-runtime facet:layer:shared facet:family:resource-config\n *\n * How an operation variant is invoked and executed (API, cron, repository-only, …).\n */\nexport enum ResourceOperationVariantType {\n API_CALL = \"api_call\",\n API_CALL_WITH_CALLBACK = \"api_call_with_callback\",\n CRON_JOB = \"cron_job\",\n BATCH_JOB = \"batch_job\",\n INTERNAL_CALL = \"internal_call\",\n REPOSITORY_ONLY = \"repository_only\",\n}\n\nexport enum ResourceOperation_ServiceRuntimeMode {\n INLINE = \"inline\",\n INLINE_NOT_AWAITABLE = \"inline_not_awaitable\",\n BACKGROUND_JOB = \"background_job\",\n QUEUED = \"queued\",\n QUEUED_NOT_AWAITABLE = \"queued_not_awaitable\",\n NONE = \"none\",\n}\n\nexport enum ResourceOperation_CustomServiceImplementationMode {\n OVERRIDE_ALL = \"override_all\",\n PREFIX_CORE_OPERARTIONS = \"prefix_core_operations\",\n POSTFIX_CORE_OPERARTIONS = \"postfix_core_operations\",\n REPLACE_CORE_OPERARTIONS = \"between_core_operations\",\n AFTER_USER_NOTIFICATIONS = \"after_user_notifications\",\n AT_THE_END = \"at_the_end\",\n}\n\nexport enum ResourceParentResourceRequirement {\n MANDATORY = \"mandatory\",\n OPTIONAL = \"optional\",\n}\n\nexport enum ResourceOperation_InputPolicy {\n DEFAULT = \"default\",\n CUSTOM = \"custom\",\n}\n\nexport enum ResourceOperation_OutputPolicy {\n DEFAULT = \"default\",\n CUSTOM = \"custom\",\n SUMMARY = \"summary\",\n CONTEXT = \"context\",\n}\n/** @wildo_source:part:end saas.models.resource-operation-variant-runtime */\n\n\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-access-scope facet:layer:shared facet:family:resource-config\n *\n * Route/service access strategy for a relationship (nested vs standalone URLs).\n */\n/*\n accessScopeStrategy defines how a related resource should be accessed in service, controller, and route generation:\nREQUIRES_CONTEXT: the resource must be accessed within the context of its parent (e.g. nested route, scoped service)\nOPTIONAL_CONTEXT: the resource can be accessed either within its parent context or independently.\nSTANDALONE: the resource must be accessed independently, even if a parent relationship exists.\n */\nexport enum ResourceRelationshipAccessScopeStrategy {\n REQUIRES_CONTEXT = \"requires_context\",\n OPTIONAL_CONTEXT = \"optional_context\",\n STANDALONE = \"standalone\",\n}\n/** @wildo_source:part:end saas.models.resource-relationship-access-scope */\n\n/**\n * @wildo_source:part:start saas.models.relationship-nature-and-models facet:layer:shared facet:family:resource-config\n *\n * High-level semantic kind of relationship.\n *\n * This is the primary shared meaning. Resolver/runtime layers may later derive\n * engine-facing handling from it, but the declaration should start here rather\n * than from low-level DTO or lifecycle toggles.\n *\n * Developer-facing interpretation:\n *\n * - `COMPOSITION`\n * The parent owns an aggregate boundary around the child. The relationship is\n * about parent-managed nested resources. Child lifecycle is typically\n * dependent on the parent, and nested create/update/delete is the natural UX.\n *\n * - `REFERENCE`\n * The current resource points to another independent resource. The default UX\n * is \"select existing / clear / navigate\". A future \"quick create\" shortcut\n * may exist, but it still means \"create independent resource, then set the\n * reference\" rather than aggregate-managed nested creation.\n *\n * - `ASSOCIATION`\n * The current resource is linked to peer resources through membership/link\n * semantics. The default UX is \"link / unlink / replace peer set\". A future\n * \"quick create\" shortcut may exist, but it still means \"create independent\n * peer, then link it\" rather than treating the peer as an owned child.\n *\n * Important rule:\n * - \"quick create\" is a frontend workflow capability layered on top of a\n * relationship, not a fourth relationship nature.\n */\nexport enum RelationshipNature {\n COMPOSITION = 'composition',\n REFERENCE = 'reference',\n ASSOCIATION = 'association',\n}\n\n/**\n * Parent-surface DTO model implied by relationship semantics.\n *\n * This tells the framework what kind of shape the parent-facing interaction\n * should expose:\n * - `NESTED_RESOURCE` → full nested child payloads\n * - `REFERENCE_HANDLE` → handle/pointer semantics to an independent resource\n * - `ASSOCIATION_HANDLE` → peer membership/link semantics\n */\nexport enum RelationshipDtoModel {\n NESTED_RESOURCE = 'nested_resource',\n REFERENCE_HANDLE = 'reference_handle',\n ASSOCIATION_HANDLE = 'association_handle',\n}\n\n/**\n * Parent-driven mutation semantics for the relationship.\n *\n * Interpretation:\n * - `AGGREGATE_MANAGED` → parent can orchestrate nested child CRUD\n * - `REFERENCE_MANAGED` → parent mutates only the reference handle/pointer\n * - `ASSOCIATION_MANAGED` → parent mutates membership/link state to peers\n * - `NONE` → no parent-driven relationship-object mutation contract\n */\nexport enum RelationshipMutationModel {\n AGGREGATE_MANAGED = 'aggregate_managed',\n REFERENCE_MANAGED = 'reference_managed',\n ASSOCIATION_MANAGED = 'association_managed',\n NONE = 'none',\n}\n\n/**\n * Lifecycle dependency semantics between the parent and the related element.\n *\n * This is about dependency, not frontend chrome:\n * - `DEPENDENT` → child lifecycle follows parent ownership\n * - `INDEPENDENT` → related resource lives independently\n * - `LINK_ONLY` → only the relationship membership/link is owned here\n */\nexport enum RelationshipLifecycleModel {\n DEPENDENT = 'dependent',\n INDEPENDENT = 'independent',\n LINK_ONLY = 'link_only',\n}\n\n/**\n * Shared read intent for the relationship.\n *\n * Important: this is NOT the same semantic plane as `DataMode`,\n * `ContextPolicy_ObjectMode`, or `childOperations.nested.onRead`.\n * It is the high-level engine-facing read intent that later resolver steps may\n * project into those operational surfaces where the meaning is truly identical.\n *\n * Interpretation:\n * - `EMBEDDED` → read as an owned nested child/children\n * - `REFERENCE_ONLY` → read as a pointer/reference surface\n * - `ASSOCIATION_EMBEDDED` → read as associated peers, while preserving peer\n * semantics rather than collapsing them into composition\n */\nexport enum RelationshipReadModel {\n EMBEDDED = 'embedded',\n REFERENCE_ONLY = 'reference_only',\n ASSOCIATION_EMBEDDED = 'association_embedded',\n}\n/** @wildo_source:part:end saas.models.relationship-nature-and-models */\n\n/**\n * @wildo_source:part:start saas.models.relationship-handling-settings facet:layer:shared facet:family:resource-config\n *\n * Explicit semantic read contract for a relationship.\n *\n * This answers the semantic question \"how should this relationship read?\" and\n * intentionally stays separate from the low-level nested projection in\n * `childOperations.nested.onRead`, which still carries payload-shaping details\n * like `dataMode`, list behavior, limits, and sort order.\n */\nexport const RelationshipHandlingReadSettingsSchema = z.object({\n model: z.enum(RelationshipReadModel),\n});\nexport type RelationshipHandlingReadSettings = z.infer<typeof RelationshipHandlingReadSettingsSchema>;\n\n/**\n * Narrow mutation refinements under the semantic handling contract.\n *\n * These are still low-level operational hints, not a replacement for\n * `nature` or the top-level handling models.\n */\nexport const RelationshipHandlingMutationSettingsSchema = z.object({\n allowParentCreate: z.boolean().optional(),\n allowParentUpdate: z.boolean().optional(),\n allowParentDelete: z.boolean().optional(),\n maxDepth: z.number().int().min(0).optional(),\n});\nexport type RelationshipHandlingMutationSettings = z.infer<typeof RelationshipHandlingMutationSettingsSchema>;\n\n/**\n * Narrow lifecycle refinements under the semantic handling contract.\n */\nexport const RelationshipHandlingLifecycleOnParentDeleteSettingsSchema = z.object({\n enabled: z.boolean().optional(),\n /** Execution TIMING of the cascade (IMMEDIATE / LAZY) — orthogonal to `strategy`. */\n mode: z.enum(ChildLifecycleMode).optional(),\n /**\n * What the cascade DOES to the child — hard-delete vs impersonalize-and-retain (scrub the personal\n * fields, keep the row for a legal/audit obligation). Carried on the derived semantic contract so a\n * consumer reading `handling.lifecycle.onParentDelete` can tell the two apart; omitting it here\n * would merge two semantically distinct teardowns, which is exactly what splitting this axis from\n * `mode` exists to prevent.\n */\n strategy: z.enum(ChildLifecycleStrategy).optional(),\n maxDepth: z.number().int().min(0).optional(),\n});\nexport type RelationshipHandlingLifecycleOnParentDeleteSettings = z.infer<typeof RelationshipHandlingLifecycleOnParentDeleteSettingsSchema>;\n\nexport const RelationshipHandlingLifecycleSettingsSchema = z.object({\n onParentDelete: RelationshipHandlingLifecycleOnParentDeleteSettingsSchema.optional(),\n});\nexport type RelationshipHandlingLifecycleSettings = z.infer<typeof RelationshipHandlingLifecycleSettingsSchema>;\n/** @wildo_source:part:end saas.models.relationship-handling-settings */\n\n/**\n * Explicit multi-target relationship actions.\n *\n * These actions are intentionally narrower than generic nested CRUD replay:\n * - `SET` / `CLEAR` target reference relationships from the current resource as child\n * - `CREATE` targets composition relationships from the current resource as parent\n * - `LINK` / `UNLINK` target peer associations while keeping junction-row\n * persistence an internal implementation detail\n * - `REPLACE` atomically expresses the desired peer set for association-backed\n * form controls without forcing the client to orchestrate unlink/link diffs\n */\nexport enum ResourceRelationshipBulkAction {\n SET = 'set',\n CLEAR = 'clear',\n CREATE = 'create',\n LINK = 'link',\n UNLINK = 'unlink',\n REPLACE = 'replace',\n}\n\nexport const ResourceRelationshipBulkOperationIdentifierPrefix = {\n [ResourceRelationshipBulkAction.SET]: 'bulk_set_',\n [ResourceRelationshipBulkAction.CLEAR]: 'bulk_clear_',\n [ResourceRelationshipBulkAction.CREATE]: 'bulk_create_',\n [ResourceRelationshipBulkAction.LINK]: 'bulk_link_',\n [ResourceRelationshipBulkAction.UNLINK]: 'bulk_unlink_',\n [ResourceRelationshipBulkAction.REPLACE]: 'bulk_replace_',\n} as const;\n\nexport const ResourceRelationshipBulkSetActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.SET),\n targetId: z.string().min(1),\n});\nexport type ResourceRelationshipBulkSetActionRequest = z.infer<typeof ResourceRelationshipBulkSetActionRequestSchema>;\n\nexport const ResourceRelationshipBulkClearActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.CLEAR),\n});\nexport type ResourceRelationshipBulkClearActionRequest = z.infer<typeof ResourceRelationshipBulkClearActionRequestSchema>;\n\nexport const ResourceRelationshipBulkCreateActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.CREATE),\n data: z.record(z.string(), z.any()).refine(\n (data) => Object.keys(data).length > 0,\n 'data must not be empty'\n ),\n});\nexport type ResourceRelationshipBulkCreateActionRequest = z.infer<typeof ResourceRelationshipBulkCreateActionRequestSchema>;\n\nexport const ResourceRelationshipBulkLinkActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.LINK),\n peerIds: z.array(z.string().min(1)).min(1),\n});\nexport type ResourceRelationshipBulkLinkActionRequest = z.infer<typeof ResourceRelationshipBulkLinkActionRequestSchema>;\n\nexport const ResourceRelationshipBulkUnlinkActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.UNLINK),\n peerIds: z.array(z.string().min(1)).min(1),\n});\nexport type ResourceRelationshipBulkUnlinkActionRequest = z.infer<typeof ResourceRelationshipBulkUnlinkActionRequestSchema>;\n\nexport const ResourceRelationshipBulkReplaceActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.REPLACE),\n peerIds: z.array(z.string().min(1)),\n});\nexport type ResourceRelationshipBulkReplaceActionRequest = z.infer<typeof ResourceRelationshipBulkReplaceActionRequestSchema>;\n\nexport const ResourceRelationshipBulkActionRequestSchema = z.discriminatedUnion('action', [\n ResourceRelationshipBulkSetActionRequestSchema,\n ResourceRelationshipBulkClearActionRequestSchema,\n ResourceRelationshipBulkCreateActionRequestSchema,\n ResourceRelationshipBulkLinkActionRequestSchema,\n ResourceRelationshipBulkUnlinkActionRequestSchema,\n ResourceRelationshipBulkReplaceActionRequestSchema,\n]);\nexport type ResourceRelationshipBulkActionRequest = z.infer<typeof ResourceRelationshipBulkActionRequestSchema>;\n\nconst ResourceRelationshipBulkFilterSelectorSchema = z.object({\n filter: z.record(z.string(), z.any()).refine(\n (filter) => Object.keys(filter).length > 0,\n 'filter must not be empty'\n ),\n _ids: z.undefined().optional(),\n});\n\nconst ResourceRelationshipBulkIdsSelectorSchema = z.object({\n _ids: z.array(z.string().min(1)).min(1),\n filter: z.undefined().optional(),\n});\n\n/**\n * Public request selector for explicit bulk relationship operations.\n *\n * Unlike the legacy bulk DTO base, this selector intentionally supports either:\n * - `_ids` for UI-driven selection over a finite checked list\n * - `filter` for backend/automation-driven targeting over a query\n *\n * The exposed operation surface stays one-selector / one-action / one-payload.\n */\nexport const ResourceRelationshipBulkOperationSelectorSchema = z.union([\n ResourceRelationshipBulkIdsSelectorSchema,\n ResourceRelationshipBulkFilterSelectorSchema,\n]);\nexport type ResourceRelationshipBulkOperationSelector = z.infer<typeof ResourceRelationshipBulkOperationSelectorSchema>;\n\nexport const ResourceRelationshipBulkSetOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n targetId: z.string().min(1),\n })\n );\nexport type ResourceRelationshipBulkSetOperationRequest = z.infer<typeof ResourceRelationshipBulkSetOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkClearOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema;\nexport type ResourceRelationshipBulkClearOperationRequest = z.infer<typeof ResourceRelationshipBulkClearOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkCreateOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n data: z.record(z.string(), z.any()).refine(\n (data) => Object.keys(data).length > 0,\n 'data must not be empty'\n ),\n })\n );\nexport type ResourceRelationshipBulkCreateOperationRequest = z.infer<typeof ResourceRelationshipBulkCreateOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkLinkOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n peerIds: z.array(z.string().min(1)).min(1),\n })\n );\nexport type ResourceRelationshipBulkLinkOperationRequest = z.infer<typeof ResourceRelationshipBulkLinkOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkUnlinkOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n peerIds: z.array(z.string().min(1)).min(1),\n })\n );\nexport type ResourceRelationshipBulkUnlinkOperationRequest = z.infer<typeof ResourceRelationshipBulkUnlinkOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkReplaceOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n peerIds: z.array(z.string().min(1)),\n })\n );\nexport type ResourceRelationshipBulkReplaceOperationRequest = z.infer<typeof ResourceRelationshipBulkReplaceOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkActionResultSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.enum(ResourceRelationshipBulkAction),\n matchedTargetIds: z.array(z.string()),\n affectedCount: z.number().int().min(0),\n results: z.array(z.any()),\n});\nexport type ResourceRelationshipBulkActionResult = z.infer<typeof ResourceRelationshipBulkActionResultSchema>;\n\n/**\n * @wildo_source:part:start saas.models.relationship-handling-contract facet:layer:shared facet:family:resource-config\n *\n * Fully resolved relationship handling contract.\n *\n * This describes the engine-facing semantic handling after `nature` has been\n * resolved. The `read` block is the semantic source of truth, while\n * `childOperations.nested.onRead` remains the low-level operational projection\n * for payload shaping.\n */\nexport const RelationshipHandlingContractSchema = z.object({\n dtoModelMode: z.enum(RelationshipDtoModel),\n mutationModelMode: z.enum(RelationshipMutationModel),\n lifecycleModelMode: z.enum(RelationshipLifecycleModel),\n readModelMode: z.enum(RelationshipReadModel),\n read: RelationshipHandlingReadSettingsSchema,\n mutation: RelationshipHandlingMutationSettingsSchema.optional(),\n lifecycle: RelationshipHandlingLifecycleSettingsSchema.optional(),\n});\nexport type RelationshipHandlingContract = z.infer<typeof RelationshipHandlingContractSchema>;\n/** @wildo_source:part:end saas.models.relationship-handling-contract */\n\nexport const RelationshipPersistenceForeignKeyContractSchema = z.object({\n fieldIdentifier: z.string().min(1),\n /**\n * The resource that OWNS the FK column (the \"holder\") — the side whose\n * documents/rows physically carry `fieldIdentifier`.\n *\n * Resolved from cardinality topology (the collection side of a 1:N carries\n * the FK; 1:1 falls back to the parent-first child convention =\n * `resourceType2`; self-references hold their own FK). Declaration order is\n * NOT a holder signal: parent-first `(ORGANIZATIONS, TODOS, ONE, MANY)` and\n * child-first `(TODOS, USERS, MANY, ONE)` are both valid authoring shapes,\n * and a positional `resourceType2` read materializes the FK onto the\n * referenced TARGET of every child-first relationship (e.g. `users` growing\n * a required `assignedToUserId`/`postedByUserId` column) instead of the\n * holder. Storage adapters MUST gate FK materialization/validation on\n * `holderResourceType === <resource under build>`, never on positional\n * `resourceType1`/`resourceType2` checks.\n */\n holderResourceType: ResourceTypeSchema,\n isArray: z.boolean(),\n materializeField: z.boolean(),\n required: z.boolean(),\n unique: z.boolean(),\n});\nexport type RelationshipPersistenceForeignKeyContract = z.infer<typeof RelationshipPersistenceForeignKeyContractSchema>;\n\nexport const RelationshipPersistenceContractSchema = z.object({\n foreignKey: RelationshipPersistenceForeignKeyContractSchema.optional(),\n});\nexport type RelationshipPersistenceContract = z.infer<typeof RelationshipPersistenceContractSchema>;\n\nexport const ResourceRelationshipBaseSchema = z.object({\n resourceType1: ResourceTypeSchema,\n resourceType2: ResourceTypeSchema,\n});\nexport type ResourceRelationshipBase = z.infer<typeof ResourceRelationshipBaseSchema>;\n\n/**\n * @wildo_source:part:start saas.models.scope-membership facet:layer:shared facet:family:resource-config\n *\n * Write-time scope confinement of a REFERENCE foreign key — the STRUCTURE half.\n *\n * A lateral `REFERENCE` FK to a target that is NOT itself tenant-scoped — a `users` id on an\n * org-scoped row, another `organizations` id — carries no `organizationId` column to compare, so the\n * ordinary write-integrity tenant check can only confirm the target EXISTS, never that it belongs to\n * the writer's tenant. That admits a cross-tenant reference (assign a todo to a user from another org).\n * Declaring `scopeMembership` closes it: the referenced target must have a row in a junction linking it\n * to the writing row's scope — enforced on CREATE and UPDATE, refused with `404` (identical to the\n * existing cross-tenant refusal, so nothing leaks).\n *\n * **This type carries STRUCTURE ONLY — which junction, and which columns.** It is a fact about the data\n * shape, uniform across every write. The POLICY half (status / role / field tightening, or disabling)\n * varies per operation VARIANT and therefore lives on the operation config as `referenceConstraints`\n * (see {@link ReferenceScopeConstraintSchema}) — beside the caller-side `roles`, where authorization\n * already lives. Keeping them apart is what stops a relationship from growing its own per-variant\n * authorization table duplicating the operation/variant structure.\n *\n * Fully OPT-IN: a relationship without `scopeMembership` keeps its existing existence-only behavior.\n */\nexport const ScopeMembershipStructureSchema = z.object({\n /**\n * The writing row's scope field whose value the target must be a member of. Defaults to the\n * resource's primary-scope FK (e.g. `organizationId`). Set only when the confining scope is a\n * non-primary field.\n */\n scopeField: z.string().optional(),\n /**\n * The junction resource linking scope → target (e.g. `organizationMembers`, `organizationPartnerships`).\n * Omit to auto-resolve from the registry's `(target, scope)` M:N scope-junction map — which works when\n * the junction's two sides are DIFFERENT resource types (organizations ↔ users). Name it explicitly for\n * a SELF-REFERENTIAL junction (organizations ↔ organizations), which the map does not infer.\n */\n junction: ResourceTypeSchema.optional(),\n /**\n * The junction column holding the SCOPE id (the writer's tenant), e.g. `organizationId`.\n *\n * Needed only when convention cannot pick it: for a self-referential junction both columns have the\n * same resource type, so the guard takes the column NAMED LIKE the writing row's scope field as the\n * scope side and the other same-typed column as the target side. Set this (with\n * {@link junctionTargetField}) when the junction names its columns differently\n * (e.g. `sourceOrganizationId` / `targetOrganizationId`).\n */\n junctionScopeField: z.string().optional(),\n /**\n * The junction column holding the TARGET id (the referenced row), e.g. `partnerOrganizationId`.\n * See {@link junctionScopeField} — set both or neither.\n */\n junctionTargetField: z.string().optional(),\n});\nexport type ScopeMembershipStructure = z.infer<typeof ScopeMembershipStructureSchema>;\n\n/**\n * Relationship `scopeMembership` value: `true` for the simple case (junction auto-resolved from the\n * registry's M:N scope-junction map), or a {@link ScopeMembershipStructureSchema} when the junction or\n * its columns must be named (self-referential junctions, non-primary scope fields).\n *\n * Policy — status, roles, junction-field and target-row constraints, or disabling — is NOT here; it is\n * per-variant and lives on the operation config's `referenceConstraints`.\n */\nexport const ScopeMembershipSchema = z.union([z.literal(true), ScopeMembershipStructureSchema]);\nexport type ScopeMembership = z.infer<typeof ScopeMembershipSchema>;\n\n/**\n * Write-time scope confinement of a REFERENCE foreign key — the POLICY half, declared PER OPERATION\n * VARIANT on the operation config (`referenceConstraints`), keyed by foreign-key field.\n *\n * The relationship's {@link ScopeMembershipSchema} already guarantees the baseline: the referenced\n * target must be linked to the writing row's scope through the junction. This type TIGHTENS that\n * baseline for one variant — the ordinary \"assign\" accepts any member while a \"make reviewer\" variant\n * requires an `ORG_ADMIN`; a plain \"share\" accepts any partnership while \"share with write access\"\n * requires a typed one. It sits beside the operation's own `roles`, which gate the CALLER; these gate\n * the TARGET.\n *\n * Absent for a foreign key ⇒ the relationship's baseline membership applies unchanged. `false` ⇒\n * enforcement is DISABLED for that foreign key on that variant.\n *\n * Note on rigor: the baseline membership check is TENANT ISOLATION and is enforced strictly. The\n * refinements below are ACCESS MANAGEMENT — `requiredRoles` reuses the shared hierarchy matcher\n * (`userRolesSatisfyRequiredRoles`), which is deliberately permissive about app-custom roles it cannot\n * expand rather than fail-closed on them.\n */\nexport const ReferenceScopeConstraintSchema = z.object({\n /**\n * Junction-row `status` values that qualify (e.g. `['ACTIVE']`). Omit ⇒ any status qualifies (mere\n * membership — still refuses a cross-tenant reference). Use to reject e.g. a `SUSPENDED` member.\n */\n qualifyingStatuses: z.array(z.string()).optional(),\n /**\n * Hierarchy-aware role requirement on the qualifying junction row's `roles` (e.g. the referenced user\n * must be an `ORG_ADMIN` of the row's organization). Matched with the SAME hierarchy walk the\n * operation role gate uses — a member holding an ancestor role (e.g. `ORG_OWNER`) satisfies a\n * requirement of `ORG_ADMIN`. Omit ⇒ no role constraint.\n */\n requiredRoles: z.object({\n scope: z.enum(ResourcePrimaryScope),\n roles: z.array(z.string()).min(1),\n }).optional(),\n /**\n * Equality constraints on the qualifying JUNCTION row beyond status (e.g. a typed partnership:\n * `{ partnershipType: 'collaboration' }`). All entries must match. Omit ⇒ no field constraint.\n */\n qualifyingFields: z.record(z.string(), z.unknown()).optional(),\n /**\n * Equality constraints on the referenced TARGET ROW itself (not the junction) — e.g. the assignee must\n * be a user of a given type `{ userTypes: 'agent' }`, or a partner org of a given type\n * `{ type: 'enterprise' }`. Applied to the target row the guard already reads. Omit ⇒ none.\n */\n targetConstraints: z.record(z.string(), z.unknown()).optional(),\n});\nexport type ReferenceScopeConstraint = z.infer<typeof ReferenceScopeConstraintSchema>;\n\n/**\n * An operation variant's per-foreign-key reference policy: `foreignKeyField → constraint | false`.\n *\n * `false` WAIVES the scope-membership requirement for that foreign key on this variant (a break-glass\n * verb that must write a not-yet-member reference). It waives that and nothing else: the target must\n * still EXIST, and an ORG-SCOPED target must still share the write's tenant.\n *\n * ⚠️ **On an ORG-LESS target the junction IS the tenant signal.** `users` and `organizations` carry no\n * tenant column to fall back on, so waiving membership there reduces the check to existence and a\n * cross-tenant id becomes admissible. That is occasionally the intent (an incident override), but it is\n * never incidental — reach for a narrower policy first (a wider `qualifyingStatuses`, or a second\n * junction that models the exception) and use `false` only when the variant genuinely means\n * \"any existing row, tenant notwithstanding\".\n */\nexport const ReferenceConstraintsSchema = z.record(\n z.string(),\n z.union([z.literal(false), ReferenceScopeConstraintSchema]),\n);\nexport type ReferenceConstraints = z.infer<typeof ReferenceConstraintsSchema>;\n/** @wildo_source:part:end saas.models.scope-membership */\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-schema facet:layer:shared facet:family:resource-config\n *\n * Serializable relationship declaration fields validated at registry build.\n */\nexport const ResourceRelationshipSchema = z.object({\n cardinality1: z.enum(ResourceRelationshipCardinality),\n cardinality2: z.enum(ResourceRelationshipCardinality),\n resourceType1: ResourceTypeSchema,\n resourceType2: ResourceTypeSchema,\n accessScopeStrategy: z.enum(ResourceRelationshipAccessScopeStrategy).default(ResourceRelationshipAccessScopeStrategy.REQUIRES_CONTEXT),\n parentResourceRequirement: z.enum(ResourceParentResourceRequirement).default(ResourceParentResourceRequirement.MANDATORY),\n jointResourceType : ResourceTypeSchema.optional(),\n isPrimaryScope : z.boolean().optional().default(false),\n primaryScope : z.enum(ResourcePrimaryScope).optional(),\n /**\n * Opt-in flag for relationships that form cycles in the resource graph.\n * When `true`, schema-level cycle detection (at registration) allows this edge.\n * Applies to all cycle types: direct self-reference (A→A), M:N self-reference\n * (A↔A via junction), and edges participating in transitive cycles (A→B→C→A).\n *\n * Default `false` — cycles are rejected at registration unless every edge\n * in the cycle has `allowCycle: true`.\n */\n allowCycle : z.boolean().optional().default(false),\n isDisabled : z.boolean().optional().default(false),\n\n // Context policy for this relationship - controls how related resources are fetched\n contextPolicy: RelationshipContextPolicySchema.optional(),\n\n /**\n * High-level shared meaning of the relationship.\n *\n * Greenfield direction:\n * - `nature` remains the primary semantic field app developers author.\n * - `read` is the explicit semantic read intent when the default read meaning\n * derived from low-level nested projection is not precise enough.\n * - The framework derives its internal handling contract from that semantic\n * declaration plus structural topology.\n *\n */\n nature: z.enum(RelationshipNature),\n\n /**\n * Explicit semantic read contract for this relationship.\n *\n * This is the authored read intent. It does NOT replace\n * `childOperations.nested.onRead`, which still carries the low-level nested\n * response projection details when embedding is operationally enabled.\n */\n read: RelationshipHandlingReadSettingsSchema.optional(),\n\n /**\n * Child operations configuration for this relationship.\n * Handles BACKEND concerns: lifecycle cascade and nested DTO aggregation.\n *\n * - lifecycle.onParentDelete: Delete children when parent is deleted\n * - nested.onRead: Include children in parent READ response\n * - nested.onCreate/onUpdate: Allow child mutations in parent requests\n */\n childOperations: ChildOperationsConfigSchema.optional(),\n\n /**\n * Static discriminator filter for conditional relationships.\n * When specified, this relationship only applies when the PARENT resource's\n * discriminator field matches one of the specified values.\n *\n * This field is part of the Zod schema (serializable). For arbitrary function-based\n * conditions, use the `condition` field on the `ResourceRelationship` TypeScript type\n * (which extends this schema via intersection).\n *\n * Runtime evaluation uses the shared\n * `Resources_SharedUtils.matchesRelationshipDiscriminator()` helper, which\n * applies `String()` coercion:\n * `values.includes(String(parent[discriminatorField]))`.\n *\n * @see ResourceRelationshipDiscriminatorSchema — for the full schema definition\n * @see ResourceRelationship — for the full type including the `condition` function\n *\n * @example Recurring todos have occurrences, one-time todos don't:\n * { discriminatorField: 'recurringType', values: ['RECURRING'] }\n */\n discriminator: ResourceRelationshipDiscriminatorSchema.optional(),\n\n /**\n * Frontend relationship presentation configuration.\n *\n * This remains on the frontend/UI plane:\n * - read composition in parent/child views\n * - narrow interaction hints such as `interaction.allowQuickCreate`\n *\n * It must NOT redefine the core meaning of the relationship. In particular,\n * `display.interaction.allowQuickCreate` is only a workflow shortcut hint:\n * - for `REFERENCE`: \"create independent resource, then set reference\"\n * - for `ASSOCIATION`: \"create independent peer, then link/replace\"\n * - for `COMPOSITION`: usually ignored because nested creation is already the\n * native aggregate workflow\n *\n * Labels remain managed by the i18n mechanism.\n */\n display: RelationshipDisplayConfigSchema.optional(),\n\n /**\n * Foreign key field name for this relationship.\n *\n * When omitted: Inferred from parent's resourceFieldIdentifier via allResourceFieldIdentifiers map.\n * When specified: Used for disambiguation when multiple FKs point to same resource type,\n * or when FK field name differs from standard naming convention.\n *\n * Examples:\n * - Standard: ORGANIZATIONS → TODOS uses organizationId (inferred)\n * - Disambiguation: TODOS → USERS via assignedToUserId vs createdByUserId (explicit)\n * - M:N self-reference: TODOS → TODOS via junction table uses todoId/targetTodoId (explicit)\n */\n foreignKeyField: z.string().optional(),\n\n /**\n * Scope-via-junction tag (scope-required reference search).\n *\n * Set ONLY on the synthetic `S → T` edge the M:N expansion adds so a target\n * `T` (e.g. `users`) becomes addressable under a scope `S` (e.g.\n * `organizations`) for SEARCH/LIST — e.g.\n * `GET /organizations/{organizationId}/users/search`. Names the junction `J`\n * (e.g. `organizationMembers`) the scope is resolved through. `T` carries NO\n * real foreign-key column for `S`, so the backend contextual filter scopes via\n * a junction subquery (`T._id ∈ { J.targetFk : J.scopeFk = S_id }`) and\n * authorization keys off `S`-membership instead of `T`'s own primary scope.\n * Absent on every normal relationship.\n *\n * NOTE: this is a READ/SEARCH-side tag on a synthetic scope-anchored edge. To constrain a WRITE — a\n * real reference FK must point at a member of the writer's scope — declare {@link scopeMembership},\n * NOT this field.\n */\n scopeViaJunction: ResourceTypeSchema.optional(),\n\n /**\n * Write-time SCOPE CONFINEMENT for this reference FK — the STRUCTURE half (see\n * {@link ScopeMembershipSchema}).\n *\n * Opt-in and additive: absent ⇒ unchanged existence-only behavior. `scopeMembership: true` requires\n * the referenced target to be linked to the writing row's scope through the auto-resolved junction;\n * the object form names the junction / columns when convention cannot (self-referential junctions).\n * Enforced on CREATE and UPDATE by the adapter-neutral write-integrity authority; a non-member /\n * cross-tenant reference is refused with `404`, leaking nothing.\n *\n * POLICY (status, roles, junction-field / target-row constraints, or disabling) is NOT declared here —\n * it varies per operation variant and lives on the operation config as `referenceConstraints`\n * (see {@link ReferenceScopeConstraintSchema}), beside the caller-side `roles`.\n */\n scopeMembership: ScopeMembershipSchema.optional(),\n\n /**\n * Restricts which core operations' URLs this relationship contributes to.\n *\n * When set, the URL builder emits this parent edge ONLY for the listed core\n * operations (e.g. `[SEARCH, LIST]`). Used by the scope-via-junction edge so it\n * produces `/{scope}/{target}/search|list` without leaking onto\n * READ/CREATE/UPDATE/DELETE routes — a peer-under-scope path is a read-only\n * access pattern. Absent ⇒ the edge contributes to every operation's URLs.\n */\n urlOperationScope: z.array(z.enum(CoreResourceOperation)).optional(),\n});\n/** @wildo_source:part:end saas.models.resource-relationship-schema */\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-resolved-semantics facet:layer:shared facet:family:resource-config\n *\n * Condition function, resolved semantics contract (factory output shape).\n */\n/**\n * Function-based condition for conditional relationships.\n * Evaluated at runtime with the PARENT resource data.\n * Return `true` to include the relationship, `false` to exclude it.\n *\n * Unlike the static `discriminator` (which is a simple field+values match),\n * this allows arbitrary logic: cross-field checks, computed conditions, etc.\n *\n * When both `discriminator` and `condition` are present on a relationship,\n * they are combined with AND semantics — the relationship is active only when\n * both pass.\n *\n * Error handling is selected by the runtime caller through\n * `Resources_SharedUtils.isRelationshipActiveForParent()`:\n * - Backend callers propagate condition errors normally.\n * - Frontend callers may fail safe and exclude the relationship.\n *\n * @param parentResource - The parent resource's data object.\n * @returns `true` to include the relationship, `false` to exclude it.\n */\nexport type ResourceRelationshipConditionFn = (parentResource: Record<string, any>) => boolean;\n\nexport type ResolvedRelationshipNatureCalculationMode = 'explicit';\nexport type ResolvedRelationshipReadCalculationMode =\n | 'explicit'\n | 'legacy_nested_read_fallback'\n | 'default_reference_only';\n\n/**\n * Internal relationship contract built once from the developer-authored\n * declaration and then reused by runtime consumers.\n */\nexport interface ResolvedRelationshipSemantics {\n nature: RelationshipNature;\n natureCalculationMode: ResolvedRelationshipNatureCalculationMode;\n /**\n * Documents whether the semantic read intent came from explicit authored\n * `read`, from the legacy `childOperations.nested.onRead` compatibility seam,\n * or from the default non-embedded fallback when neither is authored.\n */\n readCalculationMode: ResolvedRelationshipReadCalculationMode;\n handling: RelationshipHandlingContract;\n persistence: RelationshipPersistenceContract;\n childOperations?: ChildOperationsConfig_Parsed;\n}\n/** @wildo_source:part:end saas.models.resource-relationship-resolved-semantics */\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-declaration facet:layer:shared facet:family:resource-config\n *\n * Developer-authored relationship declaration.\n *\n * The `condition` function cannot be represented in a Zod schema (functions aren't\n * serializable), so we extend via a TypeScript intersection type. This means:\n * - The Zod schema (`ResourceRelationshipSchema`) defines all serializable fields,\n * including the static `discriminator` object.\n * - This intersection adds the optional `condition` function on top.\n * - The `createResourcesRelationship()` factory accepts both and returns this type.\n * - `nature` + optional `read` form the authored semantic surface; the\n * framework compiles that into `resolvedSemantics.handling`.\n *\n * ## Conditional Relationship Architecture\n *\n * Relationships may optionally carry two kinds of runtime filters:\n *\n * 1. **`discriminator`** (static) — A simple field+values match on the parent resource.\n * Defined as `{ discriminatorField: string, values: string[] }`.\n * Example: \"this relationship only applies when `recurringType === 'RECURRING'`\".\n *\n * 2. **`condition`** (dynamic) — An arbitrary function evaluated with the parent\n * resource data. Use for cross-field logic, computed conditions, etc.\n *\n * Both are evaluated against the PARENT resource, never the child. When both are\n * present, they use AND semantics (both must pass for the relationship to be active).\n *\n * ## Where Conditions Are Evaluated at Runtime\n *\n * | Layer | Evaluates discriminator/condition? | Against which resource? |\n * |-------------------------------|------------------------------------|-------------------------|\n * | **Factory** (startup) | No — stores them inline | N/A |\n * | **DTO Builder** (startup) | No — generates DTOs for ALL rels | N/A |\n * | **URL Builder** (startup) | No — synthetic parents clear them | N/A |\n * | **ResourceContext** (backend) | Yes, via shared activation helper | parentResource |\n * | **ServicesRegistryHandler** | Yes, via shared activation helper | parentResult/state |\n * | **ContainerNested** (frontend)| Yes, via shared activation helper | parentData |\n *\n * The key design insight is that conditions are a RUNTIME concern. At startup\n * (factory/DTO/URL), all relationships are processed unconditionally — conditions\n * are evaluated only when actual parent data is available.\n *\n * Runtime registry rows also carry `resolvedSemantics` (see `ResourceRelationship`).\n */\nexport type ResourceRelationshipDeclaration = z.infer<typeof ResourceRelationshipSchema> & {\n condition?: ResourceRelationshipConditionFn;\n};\n\n/**\n * Internal runtime relationship shape.\n *\n * This mirrors the resource-configuration pattern: app developers author the\n * declaration shape, and the factory compiles/stores the internal semantics\n * once so runtime consumers reuse the resolved form instead of rebuilding it.\n */\nexport type ResourceRelationship = ResourceRelationshipDeclaration & {\n resolvedSemantics: ResolvedRelationshipSemantics;\n};\n/** @wildo_source:part:end saas.models.resource-relationship-declaration */\n\n// --------------------------------\n// Default Operation Response Patterns\n// --------------------------------\n\n/**\n * Default response patterns for resource operations based on best practices\n */\n\nexport const DefaultDeleteResponseSchema = z.object({\n id: z.string(),\n deletedAt: z.date().optional()\n});\nexport type DefaultDeleteResponse = z.infer<typeof DefaultDeleteResponseSchema>;\n\nexport const DefaultBulkDeleteResponseSchema = z.object({\n deletedIds: z.array(z.string()),\n deletedCount: z.number(),\n deletedAt: z.date().optional()\n});\nexport type DefaultBulkDeleteResponse = z.infer<typeof DefaultBulkDeleteResponseSchema>;\n\nexport const DefaultUpdateManyResponseSchema = z.object({\n updatedCount: z.number(),\n updatedIds: z.array(z.string()).optional(),\n updatedAt: z.date().optional()\n});\nexport type DefaultUpdateManyResponse = z.infer<typeof DefaultUpdateManyResponseSchema>;\n\nexport const DefaultCountResponseSchema = z.object({\n count: z.number().int().min(0),\n});\nexport type DefaultCountResponse = z.infer<typeof DefaultCountResponseSchema>;\n\n// Standard result with count for create many operations - generic function\nexport interface DefaultCreateManyResponse<T> {\n items: T[];\n createdCount: number;\n createdAt?: Date;\n}\n\nexport const DefaultCreateManyResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T): z.ZodType<DefaultCreateManyResponse<SchemaInfer<T>>> => z.object({\n items: z.array(itemSchema),\n createdCount: z.number(),\n createdAt: z.date().optional()\n});\n\n/**\n * Generic success envelope for explicit custom action-style operations.\n *\n * This schema is intentionally transport-oriented. It can be attached through\n * explicit `customResponseDto` / `responseDto` config when a custom operation\n * returns a generic success envelope instead of a resource DTO.\n */\nexport const DefaultActionResponseSchema = z.object({\n success: z.boolean(),\n message: z.string().optional(),\n executedAt: z.date(),\n result: z.any().optional()\n});\nexport type DefaultActionResponse = z.infer<typeof DefaultActionResponseSchema>;\n\n/**\n * Fields that are always discarded from create/update payloads at runtime.\n * These are auto-generated or system-managed fields.\n *\n * Note: _id is also handled by the isPrimaryKey decorator at the schema level,\n * but is kept here as a runtime safety net for backward compatibility.\n */\nexport const createOrUpdateMandatoryDiscardFields: readonly string[] = [\n '_id', // Also handled by isPrimaryKey decorator\n 'createdAt',\n 'updatedAt',\n 'deletedAt',\n '_version_db_doc',\n]\n\n// Utility to get default response schema based on operation\nexport function getDefaultResponseSchemaForOperation<T extends z.ZodTypeAny>(\n operation: string,\n mainSchema: T\n): z.ZodTypeAny {\n switch (operation) {\n case CoreResourceOperation.READ:\n case CoreResourceOperation.CREATE:\n case CoreResourceOperation.UPDATE:\n return mainSchema;\n\n case CoreResourceOperation.DELETE:\n return DefaultDeleteResponseSchema;\n\n case CoreResourceOperation.DELETE_MANY:\n return DefaultBulkDeleteResponseSchema;\n\n case CoreResourceOperation.UPDATE_MANY:\n return DefaultUpdateManyResponseSchema;\n\n case CoreResourceOperation.CREATE_MANY:\n return DefaultCreateManyResponseSchema(mainSchema);\n\n case CoreResourceOperation.LIST:\n // List operations should use pagination wrapper - handled separately\n return mainSchema;\n case CoreResourceOperation.COUNT:\n return DefaultCountResponseSchema;\n case CoreResourceOperation.SEARCH:\n return mainSchema;\n\n default:\n // For custom operations, default to mainSchema\n return mainSchema;\n }\n}\n\n/**\n * Core operations whose service-layer OUTPUT is validated against their declared RESPONSE\n * envelope (a framework `Default*ResponseSchema`), NOT against the resource object. For these,\n * the DTO builder sets `internalDto` to the response envelope (`responseDtoInternal`) instead of\n * `enhancedMainSchema` — otherwise output validation parses the envelope value against the resource\n * schema and throws `service_resource_transformation_failed` (HTTP 500).\n *\n * ⚠️ KEY ON THE OPERATION'S OWN `operationIdentifier`, NOT `resourceOperationLike` /\n * `effectiveOperation`. `resourceOperationLike` is a ROUTING / HTTP-verb / authorization hint — a\n * CUSTOM operation may borrow `DELETE`/`COUNT` semantics for its URL and permissions while returning\n * its own object shape (via `REPLACE_CORE_OPERATIONS` or a `customResponseDto`, e.g. SIEM\n * `PURGE_ALL` → `{ purgedCount, … }`). Only\n * the genuine core operation carries `operationIdentifier === CoreResourceOperation.DELETE` etc.;\n * custom ops carry a custom identifier. Keying on `operationIdentifier` is what stops the composer\n * wrapping a custom op's object as `{ id: <object> }`.\n *\n * Membership rationale:\n * - `DELETE` / `DELETE_MANY` — the service+repository layer returns the deleted id(s) as a bare\n * scalar; {@link composeDefaultOperationResponse} lifts that into the envelope.\n * - `COUNT` — the service already returns `{ count }`, so no composition is needed, but its\n * `internalDto` must still be the `{ count }` envelope rather than the resource object.\n *\n * Deliberately EXCLUDED: bulk mutations (`CREATE_MANY` / `UPDATE_MANY`). At runtime they return an\n * ARRAY of resource items that the transform/serializer validate PER-ITEM against the resource\n * schema (see the `isBulkOperation` branch in `getDefaultResponseSchemaForOperation` /\n * `buildEnhancedResponseDto`) — they are object-shaped per item, not a count envelope, so they\n * must keep `enhancedMainSchema`.\n *\n * Keep this set, {@link composeDefaultOperationResponse}, and the `internalDto` routing in the DTO\n * builder in lockstep.\n */\nexport const OUTPUT_ENVELOPE_OPERATIONS: readonly string[] = [\n CoreResourceOperation.DELETE,\n CoreResourceOperation.DELETE_MANY,\n CoreResourceOperation.COUNT,\n];\n\n/** True when this is a genuine core envelope operation (see {@link OUTPUT_ENVELOPE_OPERATIONS}).\n * Pass the operation's OWN `operationIdentifier`, never `resourceOperationLike`/`effectiveOperation`\n * (a custom op borrowing the verb has a custom identifier and returns its own shape). */\nexport function isOutputEnvelopeOperation(operationIdentifier: string): boolean {\n return OUTPUT_ENVELOPE_OPERATIONS.includes(operationIdentifier);\n}\n\n/**\n * Value-level twin of {@link getDefaultResponseSchemaForOperation}: composes an operation's\n * DECLARED default response value from the raw service/repository output, so the value that flows\n * into output validation (`transformOutput`) and response serialization matches the declared\n * schema. This is the single, GENERAL seam for \"the runtime returns a lower-level value than the\n * declared response envelope\" — callers invoke it uniformly instead of special-casing operations.\n *\n * ⚠️ Pass the operation's OWN `operationIdentifier`, NOT `resourceOperationLike`/`effectiveOperation`\n * (see {@link OUTPUT_ENVELOPE_OPERATIONS}). And callers MUST skip composition when the operation\n * declares its own `customResponseDto` (`hasCustomResponseDto`) — that op returns its custom shape\n * directly, exactly as `buildEnhancedResponseDto` lets a custom `responseDto` win over the default.\n * Both guards together keep this a true identity for every operation that already returns its final\n * shape, so ONLY genuine core `DELETE`/`DELETE_MANY` are ever transformed.\n *\n * Identity for every operation whose service output already IS its declared shape: `READ` /\n * `CREATE` / `UPDATE` (resource object), `CREATE_MANY` / `UPDATE_MANY` (array of items, validated\n * per-item), `COUNT` (`{ count }`), `LIST` / `SEARCH` (`{ data, pagination }`), and every custom\n * operation (its own DTO value). The only non-identity cases are the core deletes, whose repository\n * layer returns the deleted id(s) as a bare scalar (`delete(): Promise<string>` — the `_id`, or\n * `''` when nothing matched; `deleteMany(): Promise<string[]>`):\n * - `DELETE` → `{ id }` (`DefaultDeleteResponseSchema`)\n * - `DELETE_MANY` → `{ deletedIds, deletedCount }` (`DefaultBulkDeleteResponseSchema`)\n *\n * `DELETE` always wraps as `{ id }`. If a singular `DELETE` is invoked with a filter it delegates to\n * `deleteMany` and returns a `string[]` (a misuse that should target `DELETE_MANY`); that becomes\n * `{ id: string[] }` and downstream `internalDto` validation surfaces the anomaly rather than\n * silently coercing it. Likewise a non-array `DELETE_MANY` output passes through to fail validation.\n * Keep this switch in lockstep with {@link getDefaultResponseSchemaForOperation} and\n * {@link OUTPUT_ENVELOPE_OPERATIONS}.\n */\nexport function composeDefaultOperationResponse(operationIdentifier: string, serviceOutput: unknown): unknown {\n switch (operationIdentifier) {\n case CoreResourceOperation.DELETE:\n return { id: serviceOutput };\n case CoreResourceOperation.DELETE_MANY:\n return Array.isArray(serviceOutput)\n ? { deletedIds: serviceOutput, deletedCount: serviceOutput.length }\n : serviceOutput;\n default:\n return serviceOutput;\n }\n}\n\n// Utility to determine if operation should have request DTO\nexport function operationShouldHaveRequestDto(operation: string): boolean {\n return !OPERATIONS_WITHOUT_REQUEST_BODY.includes(operation as CoreResourceOperation);\n}\n\n// ============================================================================\n// Resource ID Types and Enums\n// ============================================================================\n\n/**\n * Database-agnostic Resource ID utilities\n *\n * Supports both MongoDB ObjectId (24-char hex) and PostgreSQL UUID formats.\n * Used across the entire stack for ID validation and format detection.\n *\n * @see DATABASE_AGNOSTIC_REPOSITORY_ANALYSIS.md Section 28\n */\n\n/**\n * Abstract resource ID type - string that can be either ObjectId or UUID format\n */\nexport type ResourceId = string;\n\n/**\n * Supported ID format types\n */\nexport enum ResourceIdFormat {\n /** MongoDB ObjectId - 24 character hexadecimal string */\n OBJECT_ID = 'OBJECT_ID',\n /** PostgreSQL UUID - 36 character UUID with dashes */\n UUID = 'UUID',\n /**\n * The synthesized id of an `HTTP_API`-backed resource: encoded (or charset-safe verbatim) remote\n * key components, produced ONLY by the codec authority in\n * `http-api-binding/http-api-binding-id.shared.utils.ts` — never minted. Lexical shape: the\n * charset law `^[A-Za-z0-9._~-]+$`. Deliberately NOT added to `detectIdFormat` /\n * `isValidResourceId` (the strict two-format world stays strict for platform-backed rows —\n * paper A: never loosen a shared validator silently); it participates only where the RESOURCE\n * is known to be HTTP_API-backed (`ResourceIdBackendService.getFormatForResource`).\n */\n HTTP_API_SYNTHESIZED = 'HTTP_API_SYNTHESIZED',\n /**\n * The synthesized id of an `INTROSPECTION`-backed resource: the key of a row DERIVED from the\n * application's own structure, never minted and never stored.\n *\n * A distinct member from {@link HTTP_API_SYNTHESIZED} even though both admit the same charset,\n * because they answer different questions and will diverge: an HTTP-API id encodes a REMOTE\n * entity's key through a codec that can round-trip it, while an introspected id is whatever the\n * companion behavior's projection already calls the row — a module name, a composed structural\n * key. Merging them would put one name on two origins, and the next reader could not tell which\n * validator's rules a given id was admitted under.\n *\n * Like its sibling it is deliberately absent from `detectIdFormat` / `isValidResourceId`: the\n * strict two-format world stays strict for platform-backed rows, and this widening applies only\n * where the RESOURCE is known to be INTROSPECTION-backed.\n */\n INTROSPECTION_SYNTHESIZED = 'INTROSPECTION_SYNTHESIZED',\n}\n\n/**\n * Descriptor for a **scope-required reference search** through an M:N junction.\n *\n * When a foreign key targets resource `T` and the holder resource's primary\n * scope is `S`, and `T ↔ S` is a MANY-to-MANY relationship via junction `J`,\n * a reference people-picker for that FK must search `T` **scoped to the caller's\n * current `S`** through `J` (rather than enumerating every `T` globally) — see\n * `.claude/plans/fk-filter-reference-search.md`. This descriptor names the\n * junction and the two foreign-key columns the junction carries to each peer.\n *\n * The junction's FK columns are resolved by convention as each peer's\n * `resourceFieldIdentifier` (e.g. `organizationMembers` carries `userId` for the\n * USERS peer and `organizationId` for the ORGANIZATIONS peer).\n */\nexport interface ManyToManyScopeJunction {\n /** The junction resource that joins the two peers (e.g. `organizationMembers`). */\n junctionResourceType: string;\n /** The junction's FK column referencing the search TARGET `T` (e.g. `userId`). */\n targetFkField: string;\n /** The junction's FK column referencing the SCOPE `S` (e.g. `organizationId`). */\n scopeFkField: string;\n}\n\n/**\n * Lookup keyed by `${targetResourceType}|${scopeResourceType}` →\n * {@link ManyToManyScopeJunction}. Both orderings of every M:N are recorded, so\n * either peer can be the search target with the other as the scope. Built once\n * at registry init via `Resources_SharedUtils.buildManyToManyScopeJunctionMap`.\n */\nexport type ManyToManyScopeJunctionMap = ReadonlyMap<string, ManyToManyScopeJunction>;\n\n// ── Label forwarding — server-resolved, never-stale, via a virtual field ──────\n//\n// Reuses TWO existing framework capabilities instead of inventing a bespoke\n// projection:\n// 1. The relational-join SHAPE of `SearchableRelationDescriptor`\n// (`resources-config.shared.schemas.ts`) — same authored vocabulary, resolved\n// in the OPPOSITE direction (values → related rows, not query → ids).\n// 2. The VIRTUAL-FIELD pipeline (`isVirtual().isSummaryField()`,\n// `VirtualFieldsBackendService`) — the framework's idiomatic \"compute a value\n// onto the response DTO\" mechanism. It already runs on READ/LIST/SEARCH, is\n// included in the summary schema, and survives the response DTO, so the\n// frontend just references the field name in `getFrontendResourceLabel`.\n\n/**\n * @wildo_source:part:start saas.models.resource-config.forwarded-label facet:layer:shared facet:family:resource-config\n *\n * A **label-forwarding descriptor** — declares how a junction (or any) resource\n * row labels itself using fields from a RELATED resource, resolved SERVER-SIDE\n * and projected onto the response DTO via {@link forwardedLabel}.\n *\n * Reuses the join vocabulary of `SearchableRelationDescriptor` (from\n * `@wildo-ai/saas-models`), resolved in the read direction. WHY a\n * descriptor and not denormalization: the human-meaningful label lives on a\n * RELATED resource and is MUTABLE there (a user's first/last name on\n * `USER_PROFILES`); copying it onto the junction would go stale and demand a sync\n * hook on every mutation path. Resolving the related resource's own fields at read\n * time is single-source-of-truth, never stale, and reaches a resource DIFFERENT\n * from the foreign key's declared target (the name lives on `USER_PROFILES`, not\n * on `users`, the FK target — joined on the shared `userId`).\n *\n * TENANT SAFETY (by construction): the descriptor only resolves related rows for\n * `localField` values that appear on rows the caller can ALREADY see (its own\n * already-scoped page), so the related read is a bounded SYSTEM read that can\n * never widen visibility — the same contract `SearchableRelationDescriptor`\n * relies on, mirrored for reads. The viewer therefore needs no read access to the\n * related row itself (e.g. another member's `user_profile`).\n *\n * @remarks Resolution requires the related resource to be MongoDB-backed. If the\n * related resource is PostgreSQL-backed the read is skipped and the label degrades\n * to `fallback` — parity is a future enhancement, mirroring the same adapter gap\n * on `SearchableRelationDescriptor`. Import from `@wildo-ai/saas-models`.\n *\n * @example\n * // organizationMembers labels itself by the linked user's name. firstName/\n * // lastName live on USER_PROFILES (mutable, deliberately NOT denormalized);\n * // both members and profiles carry the same `userId`, so join on it.\n * instanceLabel: forwardedLabel({\n * localField: 'userId',\n * relatedResource: CoreResourceType.USER_PROFILES,\n * relatedJoinField: 'userId',\n * fields: ['firstName', 'lastName'],\n * fallbackField: 'userEmail', // shown when the profile/name is unavailable\n * })\n */\nexport type LabelRelationDescriptor = {\n /** Field on THIS resource holding the join value (e.g. `userId`). */\n localField: string;\n /** The related resource whose fields are rendered into the label (e.g. `USER_PROFILES`). */\n relatedResource: ResourceType;\n /**\n * Field on the related resource matched against {@link localField}'s value.\n * Defaults to the related primary key (`_id`) — set it explicitly when joining\n * on a shared key other than the primary key (e.g. members and profiles both\n * carry `userId`).\n */\n relatedJoinField?: string;\n /**\n * Related fields to render, in order. Required: unlike search (which can default\n * to the related resource's own `searchableFields`), a label must declare what\n * to show. Resolving the related resource's OWN label as a default is a possible\n * future enhancement (it needs server-side label resolution that does not exist\n * in this path today).\n */\n fields: string[];\n /** Join separator between rendered field values. Default `' '` (single space). */\n separator?: string;\n /**\n * OWN-field on THIS resource used as the fallback label when the related row is\n * missing or every rendered field is empty — preferred over the static\n * {@link fallback}. Use an immutable own identifier (e.g. a denormalized\n * `userEmail`) so a row without a resolvable related label still shows a human\n * value instead of degrading to a raw id. Must be on the summary row (a summary\n * field) to be available to the resolver.\n */\n fallbackField?: string;\n /**\n * Static label of last resort, when the related row is missing/empty AND\n * {@link fallbackField} is unset or also empty. Default `''` (empty).\n */\n fallback?: string;\n};\n/** @wildo_source:part:end saas.models.resource-config.forwarded-label */\n\n/**\n * Stringify one forwarded field value, locale-aware where a localized\n * representation exists. Strings pass through verbatim (the canonical\n * label case — names, emails). `Date`/`number` use `Intl` with the optional\n * request locale. Enum-value LABEL translation is intentionally NOT done here:\n * resolving an app's enum labels is a frontend/display concern with no\n * server-side resolver in this path; forwarded labels are identity/text by\n * design. The `locale` param is the extension point if that ever changes.\n */\nfunction stringifyForwardedValue(value: unknown, locale?: string): string {\n if (value === null || value === undefined) {\n return '';\n }\n if (value instanceof Date) {\n return new Intl.DateTimeFormat(locale).format(value);\n }\n if (typeof value === 'number') {\n return new Intl.NumberFormat(locale).format(value);\n }\n return String(value);\n}\n\n/**\n * Pure renderer for a {@link LabelRelationDescriptor}: join the descriptor's\n * `fields` (in declared order, skipping empty values) from a resolved related\n * row, using `separator`, falling back to `fallback` when the row is absent or\n * the result is empty. Exported so it is unit-testable independently of the\n * virtual-field runtime.\n */\nexport function renderForwardedLabel(\n relatedRow: Record<string, unknown> | undefined | null,\n descriptor: LabelRelationDescriptor,\n options?: { locale?: string },\n): string {\n const fallback = descriptor.fallback ?? '';\n if (!relatedRow) {\n return fallback;\n }\n const separator = descriptor.separator ?? ' ';\n const rendered = descriptor.fields\n .map((field) => stringifyForwardedValue(relatedRow[field], options?.locale))\n .filter((part) => part.trim().length > 0)\n .join(separator)\n .trim();\n return rendered.length > 0 ? rendered : fallback;\n}\n\n/**\n * Request-scoped dedup cache for forwarded-label related reads. Keyed by the\n * `executionContext` object (one per request), so concurrent per-row virtual-field\n * computations across a single LIST/SEARCH page that resolve the SAME related key\n * share one in-flight read. This matches the framework's existing batch standard\n * (`populateListForSummary`: dedup + parallel, one read per UNIQUE key), without a\n * separate batch pre-pass. The `WeakMap` lets a finished request's cache be GC'd.\n */\nconst labelForwardingRequestCache = new WeakMap<\n object,\n Map<string, Promise<Record<string, unknown> | undefined>>\n>();\n\nfunction resolveRelatedRowDeduped(\n executionContext: unknown,\n cacheKey: string,\n loader: () => Promise<Record<string, unknown> | undefined>,\n): Promise<Record<string, unknown> | undefined> {\n // No usable request key (e.g. a direct unit invocation) → resolve uncached.\n if (executionContext === null || typeof executionContext !== 'object') {\n return loader();\n }\n let perRequest = labelForwardingRequestCache.get(executionContext as object);\n if (!perRequest) {\n perRequest = new Map();\n labelForwardingRequestCache.set(executionContext as object, perRequest);\n }\n let inFlight = perRequest.get(cacheKey);\n if (!inFlight) {\n inFlight = loader();\n perRequest.set(cacheKey, inFlight);\n }\n return inFlight;\n}\n\n/**\n * Build a VIRTUAL summary field that labels a row from a related resource per a\n * {@link LabelRelationDescriptor}. Drop it into a resource's main schema; the\n * frontend then references the field name in `getFrontendResourceLabel` (a plain,\n * synchronous field ref — no async resolver).\n *\n * The returned field is `isVirtual` (computed, never persisted; excluded from\n * request DTOs), `isSummaryField` (included in the SUMMARY DTO, so it is present\n * in LIST/collection rows, not only on READ), and `isHidden({ display: true })`\n * (it IS the row/title label, so it must never ALSO auto-render as a standalone\n * card field or table column — `detectSummaryFields` skips display-hidden fields;\n * the value still reaches the frontend label, which reads the field by name). At\n * read time the framework's\n * `VirtualFieldsBackendService` invokes the `calculate` below with the backend\n * `utils`. `calculate`:\n * 1. reads the join value from `currentObject[localField]`;\n * 2. resolves the related row via the related repository's system read\n * `findFieldValuesByJoinField` (the read-direction sibling of the search\n * join's `findSearchMatchTargetIds`), deduped per request (see\n * {@link resolveRelatedRowDeduped});\n * 3. renders the label via {@link renderForwardedLabel}.\n * Failure modes (missing value, unavailable repo, absent/empty related row) degrade\n * to the fallback chain — `descriptor.fallbackField`'s own-field value first, else\n * `descriptor.fallback`; `calculate` never throws.\n *\n * @remarks `dependencies: [localField]` is consumed by the repository DTO builder\n * (`repository-dto-builder.utils.ts`), which adds the dependency to the read\n * projection — so `calculate` receives the join value even when `localField` is\n * not itself a summary field. (On `organizationMembers`, `userId` is independently\n * a summary field too.)\n */\nexport function forwardedLabel(\n descriptor: LabelRelationDescriptor,\n): DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>> {\n const joinField = descriptor.relatedJoinField ?? '_id';\n\n return z\n .string()\n .optional()\n .isVirtual({\n dependencies: [descriptor.localField],\n calculate: async ({ currentObject, executionContext, utils }) => {\n const row = currentObject as Record<string, unknown> | undefined;\n\n // Fallback chain: prefer an own-field identifier (e.g. an immutable\n // `userEmail`) over the static string, so an unresolvable related label\n // degrades to a human value rather than a raw id. Applied on EVERY\n // non-resolution path (no join value, no repo, missing/empty related row).\n const resolveFallback = (): string => {\n if (descriptor.fallbackField) {\n const own = row?.[descriptor.fallbackField];\n if (own !== null && own !== undefined && String(own).trim().length > 0) {\n return String(own);\n }\n }\n return descriptor.fallback ?? '';\n };\n\n const rawValue = row?.[descriptor.localField];\n if (rawValue === null || rawValue === undefined || rawValue === '') {\n return resolveFallback();\n }\n const joinValue = String(rawValue);\n\n const relatedRepository = utils?.repositories?.getRepository?.(descriptor.relatedResource);\n if (!relatedRepository || typeof relatedRepository.findFieldValuesByJoinField !== 'function') {\n return resolveFallback();\n }\n\n const cacheKey = `${descriptor.relatedResource}|${joinField}|${joinValue}`;\n const relatedRow = await resolveRelatedRowDeduped(executionContext, cacheKey, async () => {\n // Fail-safe: a related-read error resolves to \"no row\" (→ fallback),\n // never a throw. Resolving (rather than rejecting) also keeps the\n // per-request dedup cache from storing a rejected promise that would\n // re-throw for every other row sharing this join value.\n try {\n const rowsByValue: Map<string, Record<string, unknown>> =\n await relatedRepository.findFieldValuesByJoinField(joinField, [joinValue], descriptor.fields);\n return rowsByValue.get(joinValue);\n } catch (error) {\n utils?.logger?.warn?.(\n `[forwardedLabel] related read failed for ${descriptor.relatedResource}.${joinField}=${joinValue}; using fallback`,\n error,\n );\n return undefined;\n }\n });\n\n // Render the related fields; if nothing renders, run the fallback chain\n // (own-field → static) — pass an empty static fallback to detect \"empty\".\n const rendered = renderForwardedLabel(relatedRow, { ...descriptor, fallback: '' });\n return rendered.length > 0 ? rendered : resolveFallback();\n },\n })\n .isSummaryField()\n .isHidden({ display: true });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"resources.shared.schemas.js","sourceRoot":"","sources":["../../../src/resources/resources.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAE/B,kBAAkB,GACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,E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C,iBAAiB,IAAI,OAAO,iBAAiB,CAAC,0BAA0B,KAAK,UAAU,EAAE,CAAC;gBAC7F,OAAO,eAAe,EAAE,CAAC;YAC3B,CAAC;YAED,MAAM,QAAQ,GAAG,GAAG,UAAU,CAAC,eAAe,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;YAC3E,MAAM,UAAU,GAAG,MAAM,wBAAwB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE;gBACvF,qEAAqE;gBACrE,kEAAkE;gBAClE,qEAAqE;gBACrE,wDAAwD;gBACxD,IAAI,CAAC;oBACH,MAAM,WAAW,GACf,MAAM,iBAAiB,CAAC,0BAA0B,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;oBAChG,OAAO,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACpC,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CACnB,4CAA4C,UAAU,CAAC,eAAe,IAAI,SAAS,IAAI,SAAS,kBAAkB,EAClH,KAAK,CACN,CAAC;oBACF,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,wEAAwE;YACxE,0EAA0E;YAC1E,MAAM,QAAQ,GAAG,oBAAoB,CAAC,UAAU,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;YACnF,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC;QAC5D,CAAC;KACF,CAAC;SACD,cAAc,EAAE;SAChB,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACjC,CAAC","sourcesContent":["/**\n * Operations Shared Schemas\n *\n * Reusable operation schemas for bulk actions and common operations\n */\n\nimport { z } from 'zod';\nimport type { DecoratedPrimitiveZodType } from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation,\n OPERATIONS_WITHOUT_REQUEST_BODY,\n ResourceType,\n ResourceTypeSchema,\n} from './resources.shared.core.definitions';\nimport { RelationshipContextPolicySchema } from './context-policy.shared.schemas';\nimport {\n ChildLifecycleMode,\n ChildLifecycleStrategy,\n ChildOperationsConfigSchema,\n ResourceRelationshipDiscriminatorSchema,\n type ChildOperationsConfig_Parsed,\n} from './child-operations.shared.schemas';\nimport { RelationshipDisplayConfigSchema } from './relationship-display.shared.schemas';\nimport { SchemaInfer } from './utils/schema-type-inference.utils';\n\nexport type { ResourceType } from './resources.shared.core.definitions';\n\n/**\n * @wildo_source:part:start saas.models.resource-operation-display-risk facet:layer:shared facet:family:resource-config\n *\n * Operation bar risk level and UI density (summary vs detail).\n */\nexport enum ResourceOperationRiskLevel {\n LOW = 'low',\n MEDIUM = 'medium',\n HIGH = 'high',\n CRITICAL = 'critical'\n}\n\n/**\n * The **frontend surface** of a resource operation — whether (and how) the\n * operation is presented in the UI. This is a per-app, per-operation DISPLAY\n * axis, orthogonal to authorization (roles remain the only security authority).\n *\n * Three mutually-exclusive surfaces:\n *\n * - `ADDRESSABLE` — the operation has a **URL-routable** view (a deep-linkable\n * page that lives in the navigation area; row-click resolves a route). Has an\n * action button.\n * - `EMBEDDED` — the operation has a view that is **not URL-addressable**: it has\n * no route of its own and is rendered **within a host**, however that host\n * surfaces it — as an overlay/drill-in when invoked standalone, or inline when\n * embedded in a composite view or a nested relationship view. Has an action\n * button. (This is what `notAddressable()` produces.) Named for the host\n * relationship, NOT one presentation: do not assume it always renders as an overlay.\n * - `API_ONLY` — the operation is **headless**: callable from frontend code as a\n * typed API, but has NO rendered interface at all (no page, no embedded view, no\n * action button). For operations driven by the system / a workflow / signup rather\n * than a user form (e.g. auto-created profiles, engine-authored state).\n *\n * `ADDRESSABLE` vs `EMBEDDED` is the URL-routability axis (both have a real view);\n * `API_ONLY` is the has-no-interface axis. The button-visibility axis\n * (`ActionVisibility`) is a further orthogonal refinement that only applies to the\n * two view surfaces.\n *\n * Authored on the frontend preset per operation via `addressable()` /\n * `notAddressable()` / `apiOnly()`; an operation may also declare a\n * `defaultFrontendPosture` so the framework defaults its surface when no app\n * preset surfaces it.\n *\n * Imported from `@wildo-ai/saas-models`.\n */\nexport enum ResourceOperationFrontendSurface {\n /** URL-routable view (deep-linkable page in the navigation area). */\n ADDRESSABLE = 'addressable',\n /** Non-addressable view rendered within a host — overlay/drill-in when standalone, inline when embedded in a composite or nested relationship view. */\n EMBEDDED = 'embedded',\n /** Headless — callable from code as an API, with no rendered interface at all. */\n API_ONLY = 'api_only',\n}\n\n/**\n * Display mode for resource operation action bars — controls operation bar density.\n * SUMMARY = compact row actions (icon-only, in list/table rows).\n *\n * Note: \"summary\" here is about *UI density*, not API data shape (see DataMode.SUMMARY)\n * or FK rendering (see ForeignKeyDisplayMode.SUMMARY).\n */\nexport enum ResourceOperationDisplayMode {\n /** In a list/table row — compact, icon-only, includes \"View Details\" */\n SUMMARY = 'summary',\n /** In a full read/detail view — can show inline labels */\n DETAIL = 'detail',\n}\n/** @wildo_source:part:end saas.models.resource-operation-display-risk */\n\n/**\n * @wildo_source:part:start saas.models.resource-primary-scope facet:layer:shared facet:family:resource-config\n *\n * Primary execution scope (org, user self, app, anonymous) + anonymous transposition policy.\n */\nexport enum ResourcePrimaryScope {\n USER_SELF = 'user_self',\n ORGANIZATIONS = 'organizations',\n APPLICATION = 'applications',\n ANONYMOUS = 'anonymous',\n}\n\n/**\n * W7.3a: Controls how anonymous resources are handled during transposition\n * (when an anonymous user registers/logs in as an authenticated user).\n *\n * A `MERGE` member — \"delegate to a custom service hook\" — was declared here until 2026-09-08 and\n * REMOVED because it never had one. `transposeOwnership` logged a warning and fell through to\n * `ADD`, so a resource selecting it got plain reassignment and no application merge logic ever ran.\n * It was selectable, validated, and silent: the shape this framework treats as a defect rather than\n * a gap. Nothing selected it, so removing it needed no migration.\n *\n * Identity merge is not foreclosed, but it is not a member of this enum: it needs a per-resource\n * hook that resolves conflicts an application defines, and a cross-resource transaction the\n * framework does not have (see the note in `users.shared.resources-config.schemas.ts`). Re-add a\n * member here when that primitive exists, not before.\n */\nexport enum ResourceTranspositionPolicy {\n /** Simply reassign ownership (anonymousUserId → userId). No conflict check. Default. */\n ADD = 'ADD',\n /** Delete the authenticated user's existing records of this type, then reassign anonymous ones. */\n REPLACE = 'REPLACE',\n /** Skip transposition entirely — anonymous records are not carried over. */\n DISCARD = 'DISCARD',\n}\n/** @wildo_source:part:end saas.models.resource-primary-scope */\n\n// ============================================================================\n// Primary Scope Field Mappings (Single Source of Truth)\n// ============================================================================\n\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from './resources.shared.core.definitions';\n\n/**\n * Map from ResourcePrimaryScope to the CoreResourceType it represents.\n * This is the foundation - other mappings derive from this.\n */\nexport const PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE: Record<ResourcePrimaryScope, CoreResourceType> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: CoreResourceType.ORGANIZATIONS,\n [ResourcePrimaryScope.USER_SELF]: CoreResourceType.USERS,\n [ResourcePrimaryScope.APPLICATION]: CoreResourceType.APPLICATION,\n [ResourcePrimaryScope.ANONYMOUS]: CoreResourceType.ANONYMOUS_USERS,\n};\n\n/**\n * Map from ResourcePrimaryScope to its field identifier.\n * Uses coreResourceShared_FieldIdentifier as the source of truth for field names.\n */\nexport const PRIMARY_SCOPE_TO_FIELD_IDENTIFIER: Record<ResourcePrimaryScope, string> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS],\n [ResourcePrimaryScope.USER_SELF]: coreResourceShared_FieldIdentifier[CoreResourceType.USERS],\n [ResourcePrimaryScope.APPLICATION]: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION],\n [ResourcePrimaryScope.ANONYMOUS]: coreResourceShared_FieldIdentifier[CoreResourceType.ANONYMOUS_USERS],\n};\n\n/**\n * Primary scope field identifiers - auto-populated from execution context.\n * These fields should be excluded from CREATE/UPDATE DTOs because they are\n * automatically injected by the backend based on the authenticated user's context.\n *\n * Derived from PRIMARY_SCOPE_TO_FIELD_IDENTIFIER values.\n */\nexport const PRIMARY_SCOPE_FIELD_IDENTIFIERS = Object.values(PRIMARY_SCOPE_TO_FIELD_IDENTIFIER) as readonly string[];\nexport type PrimaryScopeFieldIdentifier = (typeof PRIMARY_SCOPE_FIELD_IDENTIFIERS)[number];\n\n/**\n * Field identifiers the framework AUTO-POPULATES on a write and therefore omits\n * from every client-shaped CREATE/UPDATE request DTO — the primary-scope FKs\n * (`organizationId` / `applicationId` / `userId` / `anonymousUserId`, injected\n * from the execution context) PLUS the audit FK `createdByUserId` (stamped by\n * the repository from the initiator). A client is never allowed to author these;\n * the auto-derivation strips them by NAME (see\n * `resources-config-operations.dtos-builder.utils.ts` — `applyCreate/UpdateOmissionsToSchema`).\n *\n * Single source of truth: the DTO builder consumes this for its omit list, and\n * `deriveTrustedSystemWritePreservedFields` consumes it to know which\n * name-stripped fields a TRUSTED in-process system write (via\n * `SystemAccessBackendService.createAsSystem` / `updateAsSystem`) must re-attach.\n * Keeping both consumers on one const prevents the two lists from drifting.\n *\n * NOTE: intentionally EXCLUDES `_id` / `createdAt` / `updatedAt` / `deletedAt` —\n * those are timestamp/PK fields handled by `createOrUpdateMandatoryDiscardFields`\n * (force-removed before validation), never re-attached by a trusted write.\n */\nexport const CONTEXT_AUTO_POPULATED_FIELD_IDENTIFIERS: readonly string[] = [\n 'createdByUserId',\n ...PRIMARY_SCOPE_FIELD_IDENTIFIERS,\n];\n\n/**\n * Map from field identifier to ResourcePrimaryScope.\n * Built by inverting PRIMARY_SCOPE_TO_FIELD_IDENTIFIER.\n */\nexport const FIELD_IDENTIFIER_TO_PRIMARY_SCOPE: Record<string, ResourcePrimaryScope> = Object.fromEntries(\n Object.entries(PRIMARY_SCOPE_TO_FIELD_IDENTIFIER).map(([scope, field]) => [field, scope as ResourcePrimaryScope])\n);\n\n/**\n * Map from ResourcePrimaryScope to the CoreResourceType(s) it represents.\n * Returns as array for compatibility (though each scope maps to a single type).\n */\nexport const PRIMARY_SCOPE_TO_RESOURCE_TYPES: Record<ResourcePrimaryScope, CoreResourceType[]> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: [PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE[ResourcePrimaryScope.ORGANIZATIONS]],\n [ResourcePrimaryScope.USER_SELF]: [PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE[ResourcePrimaryScope.USER_SELF]],\n [ResourcePrimaryScope.APPLICATION]: [PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE[ResourcePrimaryScope.APPLICATION]],\n [ResourcePrimaryScope.ANONYMOUS]: [PRIMARY_SCOPE_TO_CORE_RESOURCE_TYPE[ResourcePrimaryScope.ANONYMOUS]],\n};\n\n/**\n * Get the field identifier for a primary scope.\n */\nexport function getPrimaryScopeFieldIdentifier(primaryScope: ResourcePrimaryScope): string {\n return PRIMARY_SCOPE_TO_FIELD_IDENTIFIER[primaryScope];\n}\n\n// ============================================================================\n// Billing Scope → Resource Type Mapping\n// ============================================================================\n\n/**\n * The 2 scopes that have billing polymorphic variants.\n * APPLICATION scope is intentionally absent — it has no billing variants;\n * scope-agnostic billing resources (Products, Prices, etc.) are not per-scope.\n */\nexport const BILLING_SCOPES: readonly ResourcePrimaryScope[] = [\n ResourcePrimaryScope.ORGANIZATIONS,\n ResourcePrimaryScope.USER_SELF,\n] as const;\n\n/**\n * Per-scope billing resource types.\n * Maps each billing scope to the set of polymorphic resource type variants\n * that belong to it. Used to selectively exclude disabled scopes while\n * keeping enabled scopes and scope-agnostic resources (Products, Prices, etc.).\n */\nexport const BILLING_SCOPE_RESOURCE_TYPES: Readonly<Partial<Record<ResourcePrimaryScope, ReadonlySet<CoreResourceType>>>> = {\n [ResourcePrimaryScope.ORGANIZATIONS]: new Set([\n CoreResourceType.ORGANIZATION_BILLING_ACCOUNTS,\n CoreResourceType.ORGANIZATION_SUBSCRIPTIONS,\n CoreResourceType.ORGANIZATION_INVOICE_REFS,\n CoreResourceType.ORGANIZATION_USAGE_RECORDS,\n CoreResourceType.ORGANIZATION_CREDIT_POOLS,\n ]),\n [ResourcePrimaryScope.USER_SELF]: new Set([\n CoreResourceType.USER_BILLING_ACCOUNTS,\n CoreResourceType.USER_SUBSCRIPTIONS,\n CoreResourceType.USER_INVOICE_REFS,\n CoreResourceType.USER_USAGE_RECORDS,\n CoreResourceType.USER_CREDIT_POOLS,\n ]),\n};\n\n/**\n * Get the primary scope for a field identifier.\n * Returns undefined if the field is not a primary scope field.\n */\nexport function getPrimaryScopeFromFieldIdentifier(fieldIdentifier: string): ResourcePrimaryScope | undefined {\n return FIELD_IDENTIFIER_TO_PRIMARY_SCOPE[fieldIdentifier];\n}\n\n/**\n * Check if a field identifier is a primary scope field.\n */\nexport function isPrimaryScopeFieldIdentifier(fieldIdentifier: string): fieldIdentifier is PrimaryScopeFieldIdentifier {\n return PRIMARY_SCOPE_FIELD_IDENTIFIERS.includes(fieldIdentifier as PrimaryScopeFieldIdentifier);\n}\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-cardinality facet:layer:shared facet:family:resource-config\n *\n * Cardinality literals plus helpers (`isOneToOneCardinality`, `isArrayCardinality`).\n */\nexport enum ResourceRelationshipCardinality {\n ONE = 'one',\n ZERO_OR_ONE = 'zero_or_one',\n ONE_OR_MANY = 'one_or_many',\n MANY = 'many',\n}\n\n/**\n * Check if a cardinality represents a 1:1 relationship (single object).\n * Both `ONE` (mandatory) and `ZERO_OR_ONE` (optional) are single-object cardinalities.\n *\n * Use this utility instead of checking `=== ONE` directly, to avoid\n * the common bug of missing `ZERO_OR_ONE` (optional 1:1) handling.\n *\n * Determines:\n * - DTO shape: single optional object (not array)\n * - Nested field naming: singular (e.g., \"profile\" not \"profiles\")\n * - Fetch strategy: READ (not LIST)\n * - URL path: singular entity path\n */\nexport function isOneToOneCardinality(cardinality: ResourceRelationshipCardinality): boolean {\n return cardinality === ResourceRelationshipCardinality.ONE ||\n cardinality === ResourceRelationshipCardinality.ZERO_OR_ONE;\n}\n\n/**\n * Check if a cardinality represents a 1:N relationship (array/collection).\n * Both `MANY` (zero or more) and `ONE_OR_MANY` (at least one) are array cardinalities.\n *\n * Use this utility instead of checking `=== MANY` directly, to avoid\n * the common bug of missing `ONE_OR_MANY` (mandatory at-least-one) handling.\n *\n * Determines:\n * - DTO shape: array of objects\n * - Nested field naming: plural (e.g., \"tasks\" not \"task\")\n * - Fetch strategy: LIST\n * - URL path: collection path\n */\nexport function isArrayCardinality(cardinality: ResourceRelationshipCardinality): boolean {\n return cardinality === ResourceRelationshipCardinality.MANY ||\n cardinality === ResourceRelationshipCardinality.ONE_OR_MANY;\n}\n/** @wildo_source:part:end saas.models.resource-relationship-cardinality */\n\n/**\n * @wildo_source:part:start saas.models.resource-operation-variant-runtime facet:layer:shared facet:family:resource-config\n *\n * How an operation variant is invoked and executed (API, cron, repository-only, …).\n */\nexport enum ResourceOperationVariantType {\n API_CALL = \"api_call\",\n API_CALL_WITH_CALLBACK = \"api_call_with_callback\",\n CRON_JOB = \"cron_job\",\n BATCH_JOB = \"batch_job\",\n INTERNAL_CALL = \"internal_call\",\n REPOSITORY_ONLY = \"repository_only\",\n}\n\nexport enum ResourceOperation_ServiceRuntimeMode {\n INLINE = \"inline\",\n INLINE_NOT_AWAITABLE = \"inline_not_awaitable\",\n BACKGROUND_JOB = \"background_job\",\n QUEUED = \"queued\",\n QUEUED_NOT_AWAITABLE = \"queued_not_awaitable\",\n NONE = \"none\",\n}\n\nexport enum ResourceOperation_CustomServiceImplementationMode {\n OVERRIDE_ALL = \"override_all\",\n PREFIX_CORE_OPERARTIONS = \"prefix_core_operations\",\n POSTFIX_CORE_OPERARTIONS = \"postfix_core_operations\",\n REPLACE_CORE_OPERARTIONS = \"between_core_operations\",\n AFTER_USER_NOTIFICATIONS = \"after_user_notifications\",\n AT_THE_END = \"at_the_end\",\n}\n\nexport enum ResourceParentResourceRequirement {\n MANDATORY = \"mandatory\",\n OPTIONAL = \"optional\",\n}\n\nexport enum ResourceOperation_InputPolicy {\n DEFAULT = \"default\",\n CUSTOM = \"custom\",\n}\n\nexport enum ResourceOperation_OutputPolicy {\n DEFAULT = \"default\",\n CUSTOM = \"custom\",\n SUMMARY = \"summary\",\n CONTEXT = \"context\",\n}\n/** @wildo_source:part:end saas.models.resource-operation-variant-runtime */\n\n\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-access-scope facet:layer:shared facet:family:resource-config\n *\n * Route/service access strategy for a relationship (nested vs standalone URLs).\n */\n/*\n accessScopeStrategy defines how a related resource should be accessed in service, controller, and route generation:\nREQUIRES_CONTEXT: the resource must be accessed within the context of its parent (e.g. nested route, scoped service)\nOPTIONAL_CONTEXT: the resource can be accessed either within its parent context or independently.\nSTANDALONE: the resource must be accessed independently, even if a parent relationship exists.\n */\nexport enum ResourceRelationshipAccessScopeStrategy {\n REQUIRES_CONTEXT = \"requires_context\",\n OPTIONAL_CONTEXT = \"optional_context\",\n STANDALONE = \"standalone\",\n}\n/** @wildo_source:part:end saas.models.resource-relationship-access-scope */\n\n/**\n * @wildo_source:part:start saas.models.relationship-nature-and-models facet:layer:shared facet:family:resource-config\n *\n * High-level semantic kind of relationship.\n *\n * This is the primary shared meaning. Resolver/runtime layers may later derive\n * engine-facing handling from it, but the declaration should start here rather\n * than from low-level DTO or lifecycle toggles.\n *\n * Developer-facing interpretation:\n *\n * - `COMPOSITION`\n * The parent owns an aggregate boundary around the child. The relationship is\n * about parent-managed nested resources. Child lifecycle is typically\n * dependent on the parent, and nested create/update/delete is the natural UX.\n *\n * - `REFERENCE`\n * The current resource points to another independent resource. The default UX\n * is \"select existing / clear / navigate\". A future \"quick create\" shortcut\n * may exist, but it still means \"create independent resource, then set the\n * reference\" rather than aggregate-managed nested creation.\n *\n * - `ASSOCIATION`\n * The current resource is linked to peer resources through membership/link\n * semantics. The default UX is \"link / unlink / replace peer set\". A future\n * \"quick create\" shortcut may exist, but it still means \"create independent\n * peer, then link it\" rather than treating the peer as an owned child.\n *\n * Important rule:\n * - \"quick create\" is a frontend workflow capability layered on top of a\n * relationship, not a fourth relationship nature.\n */\nexport enum RelationshipNature {\n COMPOSITION = 'composition',\n REFERENCE = 'reference',\n ASSOCIATION = 'association',\n}\n\n/**\n * Parent-surface DTO model implied by relationship semantics.\n *\n * This tells the framework what kind of shape the parent-facing interaction\n * should expose:\n * - `NESTED_RESOURCE` → full nested child payloads\n * - `REFERENCE_HANDLE` → handle/pointer semantics to an independent resource\n * - `ASSOCIATION_HANDLE` → peer membership/link semantics\n */\nexport enum RelationshipDtoModel {\n NESTED_RESOURCE = 'nested_resource',\n REFERENCE_HANDLE = 'reference_handle',\n ASSOCIATION_HANDLE = 'association_handle',\n}\n\n/**\n * Parent-driven mutation semantics for the relationship.\n *\n * Interpretation:\n * - `AGGREGATE_MANAGED` → parent can orchestrate nested child CRUD\n * - `REFERENCE_MANAGED` → parent mutates only the reference handle/pointer\n * - `ASSOCIATION_MANAGED` → parent mutates membership/link state to peers\n * - `NONE` → no parent-driven relationship-object mutation contract\n */\nexport enum RelationshipMutationModel {\n AGGREGATE_MANAGED = 'aggregate_managed',\n REFERENCE_MANAGED = 'reference_managed',\n ASSOCIATION_MANAGED = 'association_managed',\n NONE = 'none',\n}\n\n/**\n * Lifecycle dependency semantics between the parent and the related element.\n *\n * This is about dependency, not frontend chrome:\n * - `DEPENDENT` → child lifecycle follows parent ownership\n * - `INDEPENDENT` → related resource lives independently\n * - `LINK_ONLY` → only the relationship membership/link is owned here\n */\nexport enum RelationshipLifecycleModel {\n DEPENDENT = 'dependent',\n INDEPENDENT = 'independent',\n LINK_ONLY = 'link_only',\n}\n\n/**\n * Shared read intent for the relationship.\n *\n * Important: this is NOT the same semantic plane as `DataMode`,\n * `ContextPolicy_ObjectMode`, or `childOperations.nested.onRead`.\n * It is the high-level engine-facing read intent that later resolver steps may\n * project into those operational surfaces where the meaning is truly identical.\n *\n * Interpretation:\n * - `EMBEDDED` → read as an owned nested child/children\n * - `REFERENCE_ONLY` → read as a pointer/reference surface\n * - `ASSOCIATION_EMBEDDED` → read as associated peers, while preserving peer\n * semantics rather than collapsing them into composition\n */\nexport enum RelationshipReadModel {\n EMBEDDED = 'embedded',\n REFERENCE_ONLY = 'reference_only',\n ASSOCIATION_EMBEDDED = 'association_embedded',\n}\n/** @wildo_source:part:end saas.models.relationship-nature-and-models */\n\n/**\n * @wildo_source:part:start saas.models.relationship-handling-settings facet:layer:shared facet:family:resource-config\n *\n * Explicit semantic read contract for a relationship.\n *\n * This answers the semantic question \"how should this relationship read?\" and\n * intentionally stays separate from the low-level nested projection in\n * `childOperations.nested.onRead`, which still carries payload-shaping details\n * like `dataMode`, list behavior, limits, and sort order.\n */\nexport const RelationshipHandlingReadSettingsSchema = z.object({\n model: z.enum(RelationshipReadModel),\n});\nexport type RelationshipHandlingReadSettings = z.infer<typeof RelationshipHandlingReadSettingsSchema>;\n\n/**\n * Narrow mutation refinements under the semantic handling contract.\n *\n * These are still low-level operational hints, not a replacement for\n * `nature` or the top-level handling models.\n */\nexport const RelationshipHandlingMutationSettingsSchema = z.object({\n allowParentCreate: z.boolean().optional(),\n allowParentUpdate: z.boolean().optional(),\n allowParentDelete: z.boolean().optional(),\n maxDepth: z.number().int().min(0).optional(),\n});\nexport type RelationshipHandlingMutationSettings = z.infer<typeof RelationshipHandlingMutationSettingsSchema>;\n\n/**\n * Narrow lifecycle refinements under the semantic handling contract.\n */\nexport const RelationshipHandlingLifecycleOnParentDeleteSettingsSchema = z.object({\n enabled: z.boolean().optional(),\n /**\n * Execution TIMING of the cascade: `IMMEDIATE` inside the parent's own transaction, or `LAZY`\n * deferred onto the background queue.\n *\n * ⚠️ **The two axes are NOT fully orthogonal — one combination refuses.** `LAZY` is implemented for\n * the `DELETE` strategy only. Declaring `LAZY` beside `IMPERSONALIZE_AND_RETAIN` type-checks,\n * configures, boots, and THROWS when a parent is actually deleted, because an asynchronous\n * retain-and-scrub does not exist yet and the alternatives are both unacceptable (hard-deleting the\n * child loses data the strategy exists to keep; skipping the scrub leaves personal data behind).\n *\n * | | `IMMEDIATE` | `LAZY` |\n * |---|---|---|\n * | `DELETE` | teardown inside the parent's transaction | deferred to the queue |\n * | `IMPERSONALIZE_AND_RETAIN` | scrub + keep, direct children only | **refuses at cascade time** |\n *\n * What `LAZY` changes, and what it does not: the teardown is re-derived from the parent's CURRENT\n * configuration when the job runs and goes through the same path `IMMEDIATE` uses, so grandchild\n * recursion, file teardown and retrieval-chunk removal all still happen. It moves WHEN the teardown\n * happens, never whether it happens — and if the job cannot be enqueued the parent's delete fails\n * rather than silently orphaning the children.\n *\n * Omitted ⇒ `IMMEDIATE`.\n */\n mode: z.enum(ChildLifecycleMode).optional(),\n /**\n * What the cascade DOES to the child — hard-delete vs impersonalize-and-retain (scrub the personal\n * fields, keep the row for a legal/audit obligation). Carried on the derived semantic contract so a\n * consumer reading `handling.lifecycle.onParentDelete` can tell the two apart; omitting it here\n * would merge two semantically distinct teardowns, which is exactly what splitting this axis from\n * `mode` exists to prevent.\n */\n strategy: z.enum(ChildLifecycleStrategy).optional(),\n maxDepth: z.number().int().min(0).optional(),\n});\nexport type RelationshipHandlingLifecycleOnParentDeleteSettings = z.infer<typeof RelationshipHandlingLifecycleOnParentDeleteSettingsSchema>;\n\nexport const RelationshipHandlingLifecycleSettingsSchema = z.object({\n onParentDelete: RelationshipHandlingLifecycleOnParentDeleteSettingsSchema.optional(),\n});\nexport type RelationshipHandlingLifecycleSettings = z.infer<typeof RelationshipHandlingLifecycleSettingsSchema>;\n/** @wildo_source:part:end saas.models.relationship-handling-settings */\n\n/**\n * Explicit multi-target relationship actions.\n *\n * These actions are intentionally narrower than generic nested CRUD replay:\n * - `SET` / `CLEAR` target reference relationships from the current resource as child\n * - `CREATE` targets composition relationships from the current resource as parent\n * - `LINK` / `UNLINK` target peer associations while keeping junction-row\n * persistence an internal implementation detail\n * - `REPLACE` atomically expresses the desired peer set for association-backed\n * form controls without forcing the client to orchestrate unlink/link diffs\n */\nexport enum ResourceRelationshipBulkAction {\n SET = 'set',\n CLEAR = 'clear',\n CREATE = 'create',\n LINK = 'link',\n UNLINK = 'unlink',\n REPLACE = 'replace',\n}\n\nexport const ResourceRelationshipBulkOperationIdentifierPrefix = {\n [ResourceRelationshipBulkAction.SET]: 'bulk_set_',\n [ResourceRelationshipBulkAction.CLEAR]: 'bulk_clear_',\n [ResourceRelationshipBulkAction.CREATE]: 'bulk_create_',\n [ResourceRelationshipBulkAction.LINK]: 'bulk_link_',\n [ResourceRelationshipBulkAction.UNLINK]: 'bulk_unlink_',\n [ResourceRelationshipBulkAction.REPLACE]: 'bulk_replace_',\n} as const;\n\nexport const ResourceRelationshipBulkSetActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.SET),\n targetId: z.string().min(1),\n});\nexport type ResourceRelationshipBulkSetActionRequest = z.infer<typeof ResourceRelationshipBulkSetActionRequestSchema>;\n\nexport const ResourceRelationshipBulkClearActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.CLEAR),\n});\nexport type ResourceRelationshipBulkClearActionRequest = z.infer<typeof ResourceRelationshipBulkClearActionRequestSchema>;\n\nexport const ResourceRelationshipBulkCreateActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.CREATE),\n data: z.record(z.string(), z.any()).refine(\n (data) => Object.keys(data).length > 0,\n 'data must not be empty'\n ),\n});\nexport type ResourceRelationshipBulkCreateActionRequest = z.infer<typeof ResourceRelationshipBulkCreateActionRequestSchema>;\n\nexport const ResourceRelationshipBulkLinkActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.LINK),\n peerIds: z.array(z.string().min(1)).min(1),\n});\nexport type ResourceRelationshipBulkLinkActionRequest = z.infer<typeof ResourceRelationshipBulkLinkActionRequestSchema>;\n\nexport const ResourceRelationshipBulkUnlinkActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.UNLINK),\n peerIds: z.array(z.string().min(1)).min(1),\n});\nexport type ResourceRelationshipBulkUnlinkActionRequest = z.infer<typeof ResourceRelationshipBulkUnlinkActionRequestSchema>;\n\nexport const ResourceRelationshipBulkReplaceActionRequestSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.literal(ResourceRelationshipBulkAction.REPLACE),\n peerIds: z.array(z.string().min(1)),\n});\nexport type ResourceRelationshipBulkReplaceActionRequest = z.infer<typeof ResourceRelationshipBulkReplaceActionRequestSchema>;\n\nexport const ResourceRelationshipBulkActionRequestSchema = z.discriminatedUnion('action', [\n ResourceRelationshipBulkSetActionRequestSchema,\n ResourceRelationshipBulkClearActionRequestSchema,\n ResourceRelationshipBulkCreateActionRequestSchema,\n ResourceRelationshipBulkLinkActionRequestSchema,\n ResourceRelationshipBulkUnlinkActionRequestSchema,\n ResourceRelationshipBulkReplaceActionRequestSchema,\n]);\nexport type ResourceRelationshipBulkActionRequest = z.infer<typeof ResourceRelationshipBulkActionRequestSchema>;\n\nconst ResourceRelationshipBulkFilterSelectorSchema = z.object({\n filter: z.record(z.string(), z.any()).refine(\n (filter) => Object.keys(filter).length > 0,\n 'filter must not be empty'\n ),\n _ids: z.undefined().optional(),\n});\n\nconst ResourceRelationshipBulkIdsSelectorSchema = z.object({\n _ids: z.array(z.string().min(1)).min(1),\n filter: z.undefined().optional(),\n});\n\n/**\n * Public request selector for explicit bulk relationship operations.\n *\n * Unlike the legacy bulk DTO base, this selector intentionally supports either:\n * - `_ids` for UI-driven selection over a finite checked list\n * - `filter` for backend/automation-driven targeting over a query\n *\n * The exposed operation surface stays one-selector / one-action / one-payload.\n */\nexport const ResourceRelationshipBulkOperationSelectorSchema = z.union([\n ResourceRelationshipBulkIdsSelectorSchema,\n ResourceRelationshipBulkFilterSelectorSchema,\n]);\nexport type ResourceRelationshipBulkOperationSelector = z.infer<typeof ResourceRelationshipBulkOperationSelectorSchema>;\n\nexport const ResourceRelationshipBulkSetOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n targetId: z.string().min(1),\n })\n );\nexport type ResourceRelationshipBulkSetOperationRequest = z.infer<typeof ResourceRelationshipBulkSetOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkClearOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema;\nexport type ResourceRelationshipBulkClearOperationRequest = z.infer<typeof ResourceRelationshipBulkClearOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkCreateOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n data: z.record(z.string(), z.any()).refine(\n (data) => Object.keys(data).length > 0,\n 'data must not be empty'\n ),\n })\n );\nexport type ResourceRelationshipBulkCreateOperationRequest = z.infer<typeof ResourceRelationshipBulkCreateOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkLinkOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n peerIds: z.array(z.string().min(1)).min(1),\n })\n );\nexport type ResourceRelationshipBulkLinkOperationRequest = z.infer<typeof ResourceRelationshipBulkLinkOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkUnlinkOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n peerIds: z.array(z.string().min(1)).min(1),\n })\n );\nexport type ResourceRelationshipBulkUnlinkOperationRequest = z.infer<typeof ResourceRelationshipBulkUnlinkOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkReplaceOperationRequestSchema =\n ResourceRelationshipBulkOperationSelectorSchema.and(\n z.object({\n peerIds: z.array(z.string().min(1)),\n })\n );\nexport type ResourceRelationshipBulkReplaceOperationRequest = z.infer<typeof ResourceRelationshipBulkReplaceOperationRequestSchema>;\n\nexport const ResourceRelationshipBulkActionResultSchema = z.object({\n relationshipField: z.string().min(1),\n action: z.enum(ResourceRelationshipBulkAction),\n matchedTargetIds: z.array(z.string()),\n affectedCount: z.number().int().min(0),\n results: z.array(z.any()),\n});\nexport type ResourceRelationshipBulkActionResult = z.infer<typeof ResourceRelationshipBulkActionResultSchema>;\n\n/**\n * @wildo_source:part:start saas.models.relationship-handling-contract facet:layer:shared facet:family:resource-config\n *\n * Fully resolved relationship handling contract.\n *\n * This describes the engine-facing semantic handling after `nature` has been\n * resolved. The `read` block is the semantic source of truth, while\n * `childOperations.nested.onRead` remains the low-level operational projection\n * for payload shaping.\n */\nexport const RelationshipHandlingContractSchema = z.object({\n dtoModelMode: z.enum(RelationshipDtoModel),\n mutationModelMode: z.enum(RelationshipMutationModel),\n lifecycleModelMode: z.enum(RelationshipLifecycleModel),\n readModelMode: z.enum(RelationshipReadModel),\n read: RelationshipHandlingReadSettingsSchema,\n mutation: RelationshipHandlingMutationSettingsSchema.optional(),\n lifecycle: RelationshipHandlingLifecycleSettingsSchema.optional(),\n});\nexport type RelationshipHandlingContract = z.infer<typeof RelationshipHandlingContractSchema>;\n/** @wildo_source:part:end saas.models.relationship-handling-contract */\n\nexport const RelationshipPersistenceForeignKeyContractSchema = z.object({\n fieldIdentifier: z.string().min(1),\n /**\n * The resource that OWNS the FK column (the \"holder\") — the side whose\n * documents/rows physically carry `fieldIdentifier`.\n *\n * Resolved from cardinality topology (the collection side of a 1:N carries\n * the FK; 1:1 falls back to the parent-first child convention =\n * `resourceType2`; self-references hold their own FK). Declaration order is\n * NOT a holder signal: parent-first `(ORGANIZATIONS, TODOS, ONE, MANY)` and\n * child-first `(TODOS, USERS, MANY, ONE)` are both valid authoring shapes,\n * and a positional `resourceType2` read materializes the FK onto the\n * referenced TARGET of every child-first relationship (e.g. `users` growing\n * a required `assignedToUserId`/`postedByUserId` column) instead of the\n * holder. Storage adapters MUST gate FK materialization/validation on\n * `holderResourceType === <resource under build>`, never on positional\n * `resourceType1`/`resourceType2` checks.\n */\n holderResourceType: ResourceTypeSchema,\n isArray: z.boolean(),\n materializeField: z.boolean(),\n required: z.boolean(),\n unique: z.boolean(),\n});\nexport type RelationshipPersistenceForeignKeyContract = z.infer<typeof RelationshipPersistenceForeignKeyContractSchema>;\n\nexport const RelationshipPersistenceContractSchema = z.object({\n foreignKey: RelationshipPersistenceForeignKeyContractSchema.optional(),\n});\nexport type RelationshipPersistenceContract = z.infer<typeof RelationshipPersistenceContractSchema>;\n\nexport const ResourceRelationshipBaseSchema = z.object({\n resourceType1: ResourceTypeSchema,\n resourceType2: ResourceTypeSchema,\n});\nexport type ResourceRelationshipBase = z.infer<typeof ResourceRelationshipBaseSchema>;\n\n/**\n * @wildo_source:part:start saas.models.scope-membership facet:layer:shared facet:family:resource-config\n *\n * Write-time scope confinement of a REFERENCE foreign key — the STRUCTURE half.\n *\n * A lateral `REFERENCE` FK to a target that is NOT itself tenant-scoped — a `users` id on an\n * org-scoped row, another `organizations` id — carries no `organizationId` column to compare, so the\n * ordinary write-integrity tenant check can only confirm the target EXISTS, never that it belongs to\n * the writer's tenant. That admits a cross-tenant reference (assign a todo to a user from another org).\n * Declaring `scopeMembership` closes it: the referenced target must have a row in a junction linking it\n * to the writing row's scope — enforced on CREATE and UPDATE, refused with `404` (identical to the\n * existing cross-tenant refusal, so nothing leaks).\n *\n * **This type carries STRUCTURE ONLY — which junction, and which columns.** It is a fact about the data\n * shape, uniform across every write. The POLICY half (status / role / field tightening, or disabling)\n * varies per operation VARIANT and therefore lives on the operation config as `referenceConstraints`\n * (see {@link ReferenceScopeConstraintSchema}) — beside the caller-side `roles`, where authorization\n * already lives. Keeping them apart is what stops a relationship from growing its own per-variant\n * authorization table duplicating the operation/variant structure.\n *\n * Fully OPT-IN: a relationship without `scopeMembership` keeps its existing existence-only behavior.\n */\nexport const ScopeMembershipStructureSchema = z.object({\n /**\n * The writing row's scope field whose value the target must be a member of. Defaults to the\n * resource's primary-scope FK (e.g. `organizationId`). Set only when the confining scope is a\n * non-primary field.\n */\n scopeField: z.string().optional(),\n /**\n * The junction resource linking scope → target (e.g. `organizationMembers`, `organizationPartnerships`).\n * Omit to auto-resolve from the registry's `(target, scope)` M:N scope-junction map — which works when\n * the junction's two sides are DIFFERENT resource types (organizations ↔ users). Name it explicitly for\n * a SELF-REFERENTIAL junction (organizations ↔ organizations), which the map does not infer.\n */\n junction: ResourceTypeSchema.optional(),\n /**\n * The junction column holding the SCOPE id (the writer's tenant), e.g. `organizationId`.\n *\n * Needed only when convention cannot pick it: for a self-referential junction both columns have the\n * same resource type, so the guard takes the column NAMED LIKE the writing row's scope field as the\n * scope side and the other same-typed column as the target side. Set this (with\n * {@link junctionTargetField}) when the junction names its columns differently\n * (e.g. `sourceOrganizationId` / `targetOrganizationId`).\n */\n junctionScopeField: z.string().optional(),\n /**\n * The junction column holding the TARGET id (the referenced row), e.g. `partnerOrganizationId`.\n * See {@link junctionScopeField} — set both or neither.\n */\n junctionTargetField: z.string().optional(),\n});\nexport type ScopeMembershipStructure = z.infer<typeof ScopeMembershipStructureSchema>;\n\n/**\n * Relationship `scopeMembership` value: `true` for the simple case (junction auto-resolved from the\n * registry's M:N scope-junction map), or a {@link ScopeMembershipStructureSchema} when the junction or\n * its columns must be named (self-referential junctions, non-primary scope fields).\n *\n * Policy — status, roles, junction-field and target-row constraints, or disabling — is NOT here; it is\n * per-variant and lives on the operation config's `referenceConstraints`.\n */\nexport const ScopeMembershipSchema = z.union([z.literal(true), ScopeMembershipStructureSchema]);\nexport type ScopeMembership = z.infer<typeof ScopeMembershipSchema>;\n\n/**\n * Write-time scope confinement of a REFERENCE foreign key — the POLICY half, declared PER OPERATION\n * VARIANT on the operation config (`referenceConstraints`), keyed by foreign-key field.\n *\n * The relationship's {@link ScopeMembershipSchema} already guarantees the baseline: the referenced\n * target must be linked to the writing row's scope through the junction. This type TIGHTENS that\n * baseline for one variant — the ordinary \"assign\" accepts any member while a \"make reviewer\" variant\n * requires an `ORG_ADMIN`; a plain \"share\" accepts any partnership while \"share with write access\"\n * requires a typed one. It sits beside the operation's own `roles`, which gate the CALLER; these gate\n * the TARGET.\n *\n * Absent for a foreign key ⇒ the relationship's baseline membership applies unchanged. `false` ⇒\n * enforcement is DISABLED for that foreign key on that variant.\n *\n * Note on rigor: the baseline membership check is TENANT ISOLATION and is enforced strictly. The\n * refinements below are ACCESS MANAGEMENT — `requiredRoles` reuses the shared hierarchy matcher\n * (`userRolesSatisfyRequiredRoles`), which is deliberately permissive about app-custom roles it cannot\n * expand rather than fail-closed on them.\n */\nexport const ReferenceScopeConstraintSchema = z.object({\n /**\n * Junction-row `status` values that qualify (e.g. `['ACTIVE']`). Omit ⇒ any status qualifies (mere\n * membership — still refuses a cross-tenant reference). Use to reject e.g. a `SUSPENDED` member.\n */\n qualifyingStatuses: z.array(z.string()).optional(),\n /**\n * Hierarchy-aware role requirement on the qualifying junction row's `roles` (e.g. the referenced user\n * must be an `ORG_ADMIN` of the row's organization). Matched with the SAME hierarchy walk the\n * operation role gate uses — a member holding an ancestor role (e.g. `ORG_OWNER`) satisfies a\n * requirement of `ORG_ADMIN`. Omit ⇒ no role constraint.\n */\n requiredRoles: z.object({\n scope: z.enum(ResourcePrimaryScope),\n roles: z.array(z.string()).min(1),\n }).optional(),\n /**\n * Equality constraints on the qualifying JUNCTION row beyond status (e.g. a typed partnership:\n * `{ partnershipType: 'collaboration' }`). All entries must match. Omit ⇒ no field constraint.\n */\n qualifyingFields: z.record(z.string(), z.unknown()).optional(),\n /**\n * Equality constraints on the referenced TARGET ROW itself (not the junction) — e.g. the assignee must\n * be a user of a given type `{ userTypes: 'agent' }`, or a partner org of a given type\n * `{ type: 'enterprise' }`. Applied to the target row the guard already reads. Omit ⇒ none.\n */\n targetConstraints: z.record(z.string(), z.unknown()).optional(),\n});\nexport type ReferenceScopeConstraint = z.infer<typeof ReferenceScopeConstraintSchema>;\n\n/**\n * An operation variant's per-foreign-key reference policy: `foreignKeyField → constraint | false`.\n *\n * `false` WAIVES the scope-membership requirement for that foreign key on this variant (a break-glass\n * verb that must write a not-yet-member reference). It waives that and nothing else: the target must\n * still EXIST, and an ORG-SCOPED target must still share the write's tenant.\n *\n * ⚠️ **On an ORG-LESS target the junction IS the tenant signal.** `users` and `organizations` carry no\n * tenant column to fall back on, so waiving membership there reduces the check to existence and a\n * cross-tenant id becomes admissible. That is occasionally the intent (an incident override), but it is\n * never incidental — reach for a narrower policy first (a wider `qualifyingStatuses`, or a second\n * junction that models the exception) and use `false` only when the variant genuinely means\n * \"any existing row, tenant notwithstanding\".\n */\nexport const ReferenceConstraintsSchema = z.record(\n z.string(),\n z.union([z.literal(false), ReferenceScopeConstraintSchema]),\n);\nexport type ReferenceConstraints = z.infer<typeof ReferenceConstraintsSchema>;\n/** @wildo_source:part:end saas.models.scope-membership */\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-schema facet:layer:shared facet:family:resource-config\n *\n * Serializable relationship declaration fields validated at registry build.\n */\nexport const ResourceRelationshipSchema = z.object({\n cardinality1: z.enum(ResourceRelationshipCardinality),\n cardinality2: z.enum(ResourceRelationshipCardinality),\n resourceType1: ResourceTypeSchema,\n resourceType2: ResourceTypeSchema,\n accessScopeStrategy: z.enum(ResourceRelationshipAccessScopeStrategy).default(ResourceRelationshipAccessScopeStrategy.REQUIRES_CONTEXT),\n parentResourceRequirement: z.enum(ResourceParentResourceRequirement).default(ResourceParentResourceRequirement.MANDATORY),\n jointResourceType : ResourceTypeSchema.optional(),\n isPrimaryScope : z.boolean().optional().default(false),\n primaryScope : z.enum(ResourcePrimaryScope).optional(),\n /**\n * Opt-in flag for relationships that form cycles in the resource graph.\n * When `true`, schema-level cycle detection (at registration) allows this edge.\n * Applies to all cycle types: direct self-reference (A→A), M:N self-reference\n * (A↔A via junction), and edges participating in transitive cycles (A→B→C→A).\n *\n * Default `false` — cycles are rejected at registration unless every edge\n * in the cycle has `allowCycle: true`.\n */\n allowCycle : z.boolean().optional().default(false),\n isDisabled : z.boolean().optional().default(false),\n\n // Context policy for this relationship - controls how related resources are fetched\n contextPolicy: RelationshipContextPolicySchema.optional(),\n\n /**\n * High-level shared meaning of the relationship.\n *\n * Greenfield direction:\n * - `nature` remains the primary semantic field app developers author.\n * - `read` is the explicit semantic read intent when the default read meaning\n * derived from low-level nested projection is not precise enough.\n * - The framework derives its internal handling contract from that semantic\n * declaration plus structural topology.\n *\n */\n nature: z.enum(RelationshipNature),\n\n /**\n * Explicit semantic read contract for this relationship.\n *\n * This is the authored read intent. It does NOT replace\n * `childOperations.nested.onRead`, which still carries the low-level nested\n * response projection details when embedding is operationally enabled.\n */\n read: RelationshipHandlingReadSettingsSchema.optional(),\n\n /**\n * Child operations configuration for this relationship.\n * Handles BACKEND concerns: lifecycle cascade and nested DTO aggregation.\n *\n * - lifecycle.onParentDelete: Delete children when parent is deleted\n * - nested.onRead: Include children in parent READ response\n * - nested.onCreate/onUpdate: Allow child mutations in parent requests\n */\n childOperations: ChildOperationsConfigSchema.optional(),\n\n /**\n * Static discriminator filter for conditional relationships.\n * When specified, this relationship only applies when the PARENT resource's\n * discriminator field matches one of the specified values.\n *\n * This field is part of the Zod schema (serializable). For arbitrary function-based\n * conditions, use the `condition` field on the `ResourceRelationship` TypeScript type\n * (which extends this schema via intersection).\n *\n * Runtime evaluation uses the shared\n * `Resources_SharedUtils.matchesRelationshipDiscriminator()` helper, which\n * applies `String()` coercion:\n * `values.includes(String(parent[discriminatorField]))`.\n *\n * @see ResourceRelationshipDiscriminatorSchema — for the full schema definition\n * @see ResourceRelationship — for the full type including the `condition` function\n *\n * @example Recurring todos have occurrences, one-time todos don't:\n * { discriminatorField: 'recurringType', values: ['RECURRING'] }\n */\n discriminator: ResourceRelationshipDiscriminatorSchema.optional(),\n\n /**\n * Frontend relationship presentation configuration.\n *\n * This remains on the frontend/UI plane:\n * - read composition in parent/child views\n * - narrow interaction hints such as `interaction.allowQuickCreate`\n *\n * It must NOT redefine the core meaning of the relationship. In particular,\n * `display.interaction.allowQuickCreate` is only a workflow shortcut hint:\n * - for `REFERENCE`: \"create independent resource, then set reference\"\n * - for `ASSOCIATION`: \"create independent peer, then link/replace\"\n * - for `COMPOSITION`: usually ignored because nested creation is already the\n * native aggregate workflow\n *\n * Labels remain managed by the i18n mechanism.\n */\n display: RelationshipDisplayConfigSchema.optional(),\n\n /**\n * Foreign key field name for this relationship.\n *\n * When omitted: Inferred from parent's resourceFieldIdentifier via allResourceFieldIdentifiers map.\n * When specified: Used for disambiguation when multiple FKs point to same resource type,\n * or when FK field name differs from standard naming convention.\n *\n * Examples:\n * - Standard: ORGANIZATIONS → TODOS uses organizationId (inferred)\n * - Disambiguation: TODOS → USERS via assignedToUserId vs createdByUserId (explicit)\n * - M:N self-reference: TODOS → TODOS via junction table uses todoId/targetTodoId (explicit)\n */\n foreignKeyField: z.string().optional(),\n\n /**\n * Scope-via-junction tag (scope-required reference search).\n *\n * Set ONLY on the synthetic `S → T` edge the M:N expansion adds so a target\n * `T` (e.g. `users`) becomes addressable under a scope `S` (e.g.\n * `organizations`) for SEARCH/LIST — e.g.\n * `GET /organizations/{organizationId}/users/search`. Names the junction `J`\n * (e.g. `organizationMembers`) the scope is resolved through. `T` carries NO\n * real foreign-key column for `S`, so the backend contextual filter scopes via\n * a junction subquery (`T._id ∈ { J.targetFk : J.scopeFk = S_id }`) and\n * authorization keys off `S`-membership instead of `T`'s own primary scope.\n * Absent on every normal relationship.\n *\n * NOTE: this is a READ/SEARCH-side tag on a synthetic scope-anchored edge. To constrain a WRITE — a\n * real reference FK must point at a member of the writer's scope — declare {@link scopeMembership},\n * NOT this field.\n */\n scopeViaJunction: ResourceTypeSchema.optional(),\n\n /**\n * Write-time SCOPE CONFINEMENT for this reference FK — the STRUCTURE half (see\n * {@link ScopeMembershipSchema}).\n *\n * Opt-in and additive: absent ⇒ unchanged existence-only behavior. `scopeMembership: true` requires\n * the referenced target to be linked to the writing row's scope through the auto-resolved junction;\n * the object form names the junction / columns when convention cannot (self-referential junctions).\n * Enforced on CREATE and UPDATE by the adapter-neutral write-integrity authority; a non-member /\n * cross-tenant reference is refused with `404`, leaking nothing.\n *\n * POLICY (status, roles, junction-field / target-row constraints, or disabling) is NOT declared here —\n * it varies per operation variant and lives on the operation config as `referenceConstraints`\n * (see {@link ReferenceScopeConstraintSchema}), beside the caller-side `roles`.\n */\n scopeMembership: ScopeMembershipSchema.optional(),\n\n /**\n * Restricts which core operations' URLs this relationship contributes to.\n *\n * When set, the URL builder emits this parent edge ONLY for the listed core\n * operations (e.g. `[SEARCH, LIST]`). Used by the scope-via-junction edge so it\n * produces `/{scope}/{target}/search|list` without leaking onto\n * READ/CREATE/UPDATE/DELETE routes — a peer-under-scope path is a read-only\n * access pattern. Absent ⇒ the edge contributes to every operation's URLs.\n */\n urlOperationScope: z.array(z.enum(CoreResourceOperation)).optional(),\n});\n/** @wildo_source:part:end saas.models.resource-relationship-schema */\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-resolved-semantics facet:layer:shared facet:family:resource-config\n *\n * Condition function, resolved semantics contract (factory output shape).\n */\n/**\n * Function-based condition for conditional relationships.\n * Evaluated at runtime with the PARENT resource data.\n * Return `true` to include the relationship, `false` to exclude it.\n *\n * Unlike the static `discriminator` (which is a simple field+values match),\n * this allows arbitrary logic: cross-field checks, computed conditions, etc.\n *\n * When both `discriminator` and `condition` are present on a relationship,\n * they are combined with AND semantics — the relationship is active only when\n * both pass.\n *\n * Error handling is selected by the runtime caller through\n * `Resources_SharedUtils.isRelationshipActiveForParent()`:\n * - Backend callers propagate condition errors normally.\n * - Frontend callers may fail safe and exclude the relationship.\n *\n * @param parentResource - The parent resource's data object.\n * @returns `true` to include the relationship, `false` to exclude it.\n */\nexport type ResourceRelationshipConditionFn = (parentResource: Record<string, any>) => boolean;\n\nexport type ResolvedRelationshipNatureCalculationMode = 'explicit';\nexport type ResolvedRelationshipReadCalculationMode =\n | 'explicit'\n | 'legacy_nested_read_fallback'\n | 'default_reference_only';\n\n/**\n * Internal relationship contract built once from the developer-authored\n * declaration and then reused by runtime consumers.\n */\nexport interface ResolvedRelationshipSemantics {\n nature: RelationshipNature;\n natureCalculationMode: ResolvedRelationshipNatureCalculationMode;\n /**\n * Documents whether the semantic read intent came from explicit authored\n * `read`, from the legacy `childOperations.nested.onRead` compatibility seam,\n * or from the default non-embedded fallback when neither is authored.\n */\n readCalculationMode: ResolvedRelationshipReadCalculationMode;\n handling: RelationshipHandlingContract;\n persistence: RelationshipPersistenceContract;\n childOperations?: ChildOperationsConfig_Parsed;\n}\n/** @wildo_source:part:end saas.models.resource-relationship-resolved-semantics */\n\n/**\n * @wildo_source:part:start saas.models.resource-relationship-declaration facet:layer:shared facet:family:resource-config\n *\n * Developer-authored relationship declaration.\n *\n * The `condition` function cannot be represented in a Zod schema (functions aren't\n * serializable), so we extend via a TypeScript intersection type. This means:\n * - The Zod schema (`ResourceRelationshipSchema`) defines all serializable fields,\n * including the static `discriminator` object.\n * - This intersection adds the optional `condition` function on top.\n * - The `createResourcesRelationship()` factory accepts both and returns this type.\n * - `nature` + optional `read` form the authored semantic surface; the\n * framework compiles that into `resolvedSemantics.handling`.\n *\n * ## Conditional Relationship Architecture\n *\n * Relationships may optionally carry two kinds of runtime filters:\n *\n * 1. **`discriminator`** (static) — A simple field+values match on the parent resource.\n * Defined as `{ discriminatorField: string, values: string[] }`.\n * Example: \"this relationship only applies when `recurringType === 'RECURRING'`\".\n *\n * 2. **`condition`** (dynamic) — An arbitrary function evaluated with the parent\n * resource data. Use for cross-field logic, computed conditions, etc.\n *\n * Both are evaluated against the PARENT resource, never the child. When both are\n * present, they use AND semantics (both must pass for the relationship to be active).\n *\n * ## Where Conditions Are Evaluated at Runtime\n *\n * | Layer | Evaluates discriminator/condition? | Against which resource? |\n * |-------------------------------|------------------------------------|-------------------------|\n * | **Factory** (startup) | No — stores them inline | N/A |\n * | **DTO Builder** (startup) | No — generates DTOs for ALL rels | N/A |\n * | **URL Builder** (startup) | No — synthetic parents clear them | N/A |\n * | **ResourceContext** (backend) | Yes, via shared activation helper | parentResource |\n * | **ServicesRegistryHandler** | Yes, via shared activation helper | parentResult/state |\n * | **ContainerNested** (frontend)| Yes, via shared activation helper | parentData |\n *\n * The key design insight is that conditions are a RUNTIME concern. At startup\n * (factory/DTO/URL), all relationships are processed unconditionally — conditions\n * are evaluated only when actual parent data is available.\n *\n * Runtime registry rows also carry `resolvedSemantics` (see `ResourceRelationship`).\n */\nexport type ResourceRelationshipDeclaration = z.infer<typeof ResourceRelationshipSchema> & {\n condition?: ResourceRelationshipConditionFn;\n};\n\n/**\n * Internal runtime relationship shape.\n *\n * This mirrors the resource-configuration pattern: app developers author the\n * declaration shape, and the factory compiles/stores the internal semantics\n * once so runtime consumers reuse the resolved form instead of rebuilding it.\n */\nexport type ResourceRelationship = ResourceRelationshipDeclaration & {\n resolvedSemantics: ResolvedRelationshipSemantics;\n};\n/** @wildo_source:part:end saas.models.resource-relationship-declaration */\n\n// --------------------------------\n// Default Operation Response Patterns\n// --------------------------------\n\n/**\n * Default response patterns for resource operations based on best practices\n */\n\nexport const DefaultDeleteResponseSchema = z.object({\n id: z.string(),\n deletedAt: z.date().optional()\n});\nexport type DefaultDeleteResponse = z.infer<typeof DefaultDeleteResponseSchema>;\n\nexport const DefaultBulkDeleteResponseSchema = z.object({\n deletedIds: z.array(z.string()),\n deletedCount: z.number(),\n deletedAt: z.date().optional()\n});\nexport type DefaultBulkDeleteResponse = z.infer<typeof DefaultBulkDeleteResponseSchema>;\n\nexport const DefaultUpdateManyResponseSchema = z.object({\n updatedCount: z.number(),\n updatedIds: z.array(z.string()).optional(),\n updatedAt: z.date().optional()\n});\nexport type DefaultUpdateManyResponse = z.infer<typeof DefaultUpdateManyResponseSchema>;\n\nexport const DefaultCountResponseSchema = z.object({\n count: z.number().int().min(0),\n});\nexport type DefaultCountResponse = z.infer<typeof DefaultCountResponseSchema>;\n\n// Standard result with count for create many operations - generic function\nexport interface DefaultCreateManyResponse<T> {\n items: T[];\n createdCount: number;\n createdAt?: Date;\n}\n\nexport const DefaultCreateManyResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T): z.ZodType<DefaultCreateManyResponse<SchemaInfer<T>>> => z.object({\n items: z.array(itemSchema),\n createdCount: z.number(),\n createdAt: z.date().optional()\n});\n\n/**\n * Generic success envelope for explicit custom action-style operations.\n *\n * This schema is intentionally transport-oriented. It can be attached through\n * explicit `customResponseDto` / `responseDto` config when a custom operation\n * returns a generic success envelope instead of a resource DTO.\n */\nexport const DefaultActionResponseSchema = z.object({\n success: z.boolean(),\n message: z.string().optional(),\n executedAt: z.date(),\n result: z.any().optional()\n});\nexport type DefaultActionResponse = z.infer<typeof DefaultActionResponseSchema>;\n\n/**\n * Fields that are always discarded from create/update payloads at runtime.\n * These are auto-generated or system-managed fields.\n *\n * Note: _id is also handled by the isPrimaryKey decorator at the schema level,\n * but is kept here as a runtime safety net for backward compatibility.\n */\nexport const createOrUpdateMandatoryDiscardFields: readonly string[] = [\n '_id', // Also handled by isPrimaryKey decorator\n 'createdAt',\n 'updatedAt',\n 'deletedAt',\n '_version_db_doc',\n]\n\n// Utility to get default response schema based on operation\nexport function getDefaultResponseSchemaForOperation<T extends z.ZodTypeAny>(\n operation: string,\n mainSchema: T\n): z.ZodTypeAny {\n switch (operation) {\n case CoreResourceOperation.READ:\n case CoreResourceOperation.CREATE:\n case CoreResourceOperation.UPDATE:\n return mainSchema;\n\n case CoreResourceOperation.DELETE:\n return DefaultDeleteResponseSchema;\n\n case CoreResourceOperation.DELETE_MANY:\n return DefaultBulkDeleteResponseSchema;\n\n case CoreResourceOperation.UPDATE_MANY:\n return DefaultUpdateManyResponseSchema;\n\n case CoreResourceOperation.CREATE_MANY:\n return DefaultCreateManyResponseSchema(mainSchema);\n\n case CoreResourceOperation.LIST:\n // List operations should use pagination wrapper - handled separately\n return mainSchema;\n case CoreResourceOperation.COUNT:\n return DefaultCountResponseSchema;\n case CoreResourceOperation.SEARCH:\n return mainSchema;\n\n default:\n // For custom operations, default to mainSchema\n return mainSchema;\n }\n}\n\n/**\n * Core operations whose service-layer OUTPUT is validated against their declared RESPONSE\n * envelope (a framework `Default*ResponseSchema`), NOT against the resource object. For these,\n * the DTO builder sets `internalDto` to the response envelope (`responseDtoInternal`) instead of\n * `enhancedMainSchema` — otherwise output validation parses the envelope value against the resource\n * schema and throws `service_resource_transformation_failed` (HTTP 500).\n *\n * ⚠️ KEY ON THE OPERATION'S OWN `operationIdentifier`, NOT `resourceOperationLike` /\n * `effectiveOperation`. `resourceOperationLike` is a ROUTING / HTTP-verb / authorization hint — a\n * CUSTOM operation may borrow `DELETE`/`COUNT` semantics for its URL and permissions while returning\n * its own object shape (via `REPLACE_CORE_OPERATIONS` or a `customResponseDto`, e.g. SIEM\n * `PURGE_ALL` → `{ purgedCount, … }`). Only\n * the genuine core operation carries `operationIdentifier === CoreResourceOperation.DELETE` etc.;\n * custom ops carry a custom identifier. Keying on `operationIdentifier` is what stops the composer\n * wrapping a custom op's object as `{ id: <object> }`.\n *\n * Membership rationale:\n * - `DELETE` / `DELETE_MANY` — the service+repository layer returns the deleted id(s) as a bare\n * scalar; {@link composeDefaultOperationResponse} lifts that into the envelope.\n * - `COUNT` — the service already returns `{ count }`, so no composition is needed, but its\n * `internalDto` must still be the `{ count }` envelope rather than the resource object.\n *\n * Deliberately EXCLUDED: bulk mutations (`CREATE_MANY` / `UPDATE_MANY`). At runtime they return an\n * ARRAY of resource items that the transform/serializer validate PER-ITEM against the resource\n * schema (see the `isBulkOperation` branch in `getDefaultResponseSchemaForOperation` /\n * `buildEnhancedResponseDto`) — they are object-shaped per item, not a count envelope, so they\n * must keep `enhancedMainSchema`.\n *\n * Keep this set, {@link composeDefaultOperationResponse}, and the `internalDto` routing in the DTO\n * builder in lockstep.\n */\nexport const OUTPUT_ENVELOPE_OPERATIONS: readonly string[] = [\n CoreResourceOperation.DELETE,\n CoreResourceOperation.DELETE_MANY,\n CoreResourceOperation.COUNT,\n];\n\n/** True when this is a genuine core envelope operation (see {@link OUTPUT_ENVELOPE_OPERATIONS}).\n * Pass the operation's OWN `operationIdentifier`, never `resourceOperationLike`/`effectiveOperation`\n * (a custom op borrowing the verb has a custom identifier and returns its own shape). */\nexport function isOutputEnvelopeOperation(operationIdentifier: string): boolean {\n return OUTPUT_ENVELOPE_OPERATIONS.includes(operationIdentifier);\n}\n\n/**\n * Value-level twin of {@link getDefaultResponseSchemaForOperation}: composes an operation's\n * DECLARED default response value from the raw service/repository output, so the value that flows\n * into output validation (`transformOutput`) and response serialization matches the declared\n * schema. This is the single, GENERAL seam for \"the runtime returns a lower-level value than the\n * declared response envelope\" — callers invoke it uniformly instead of special-casing operations.\n *\n * ⚠️ Pass the operation's OWN `operationIdentifier`, NOT `resourceOperationLike`/`effectiveOperation`\n * (see {@link OUTPUT_ENVELOPE_OPERATIONS}). And callers MUST skip composition when the operation\n * declares its own `customResponseDto` (`hasCustomResponseDto`) — that op returns its custom shape\n * directly, exactly as `buildEnhancedResponseDto` lets a custom `responseDto` win over the default.\n * Both guards together keep this a true identity for every operation that already returns its final\n * shape, so ONLY genuine core `DELETE`/`DELETE_MANY` are ever transformed.\n *\n * Identity for every operation whose service output already IS its declared shape: `READ` /\n * `CREATE` / `UPDATE` (resource object), `CREATE_MANY` / `UPDATE_MANY` (array of items, validated\n * per-item), `COUNT` (`{ count }`), `LIST` / `SEARCH` (`{ data, pagination }`), and every custom\n * operation (its own DTO value). The only non-identity cases are the core deletes, whose repository\n * layer returns the deleted id(s) as a bare scalar (`delete(): Promise<string>` — the `_id`, or\n * `''` when nothing matched; `deleteMany(): Promise<string[]>`):\n * - `DELETE` → `{ id }` (`DefaultDeleteResponseSchema`)\n * - `DELETE_MANY` → `{ deletedIds, deletedCount }` (`DefaultBulkDeleteResponseSchema`)\n *\n * `DELETE` always wraps as `{ id }`. If a singular `DELETE` is invoked with a filter it delegates to\n * `deleteMany` and returns a `string[]` (a misuse that should target `DELETE_MANY`); that becomes\n * `{ id: string[] }` and downstream `internalDto` validation surfaces the anomaly rather than\n * silently coercing it. Likewise a non-array `DELETE_MANY` output passes through to fail validation.\n * Keep this switch in lockstep with {@link getDefaultResponseSchemaForOperation} and\n * {@link OUTPUT_ENVELOPE_OPERATIONS}.\n */\nexport function composeDefaultOperationResponse(operationIdentifier: string, serviceOutput: unknown): unknown {\n switch (operationIdentifier) {\n case CoreResourceOperation.DELETE:\n return { id: serviceOutput };\n case CoreResourceOperation.DELETE_MANY:\n return Array.isArray(serviceOutput)\n ? { deletedIds: serviceOutput, deletedCount: serviceOutput.length }\n : serviceOutput;\n default:\n return serviceOutput;\n }\n}\n\n// Utility to determine if operation should have request DTO\nexport function operationShouldHaveRequestDto(operation: string): boolean {\n return !OPERATIONS_WITHOUT_REQUEST_BODY.includes(operation as CoreResourceOperation);\n}\n\n// ============================================================================\n// Resource ID Types and Enums\n// ============================================================================\n\n/**\n * Database-agnostic Resource ID utilities\n *\n * Supports both MongoDB ObjectId (24-char hex) and PostgreSQL UUID formats.\n * Used across the entire stack for ID validation and format detection.\n *\n * @see DATABASE_AGNOSTIC_REPOSITORY_ANALYSIS.md Section 28\n */\n\n/**\n * Abstract resource ID type - string that can be either ObjectId or UUID format\n */\nexport type ResourceId = string;\n\n/**\n * Supported ID format types\n */\nexport enum ResourceIdFormat {\n /** MongoDB ObjectId - 24 character hexadecimal string */\n OBJECT_ID = 'OBJECT_ID',\n /** PostgreSQL UUID - 36 character UUID with dashes */\n UUID = 'UUID',\n /**\n * The synthesized id of an `HTTP_API`-backed resource: encoded (or charset-safe verbatim) remote\n * key components, produced ONLY by the codec authority in\n * `http-api-binding/http-api-binding-id.shared.utils.ts` — never minted. Lexical shape: the\n * charset law `^[A-Za-z0-9._~-]+$`. Deliberately NOT added to `detectIdFormat` /\n * `isValidResourceId` (the strict two-format world stays strict for platform-backed rows —\n * paper A: never loosen a shared validator silently); it participates only where the RESOURCE\n * is known to be HTTP_API-backed (`ResourceIdBackendService.getFormatForResource`).\n */\n HTTP_API_SYNTHESIZED = 'HTTP_API_SYNTHESIZED',\n /**\n * The synthesized id of an `INTROSPECTION`-backed resource: the key of a row DERIVED from the\n * application's own structure, never minted and never stored.\n *\n * A distinct member from {@link HTTP_API_SYNTHESIZED} even though both admit the same charset,\n * because they answer different questions and will diverge: an HTTP-API id encodes a REMOTE\n * entity's key through a codec that can round-trip it, while an introspected id is whatever the\n * companion behavior's projection already calls the row — a module name, a composed structural\n * key. Merging them would put one name on two origins, and the next reader could not tell which\n * validator's rules a given id was admitted under.\n *\n * Like its sibling it is deliberately absent from `detectIdFormat` / `isValidResourceId`: the\n * strict two-format world stays strict for platform-backed rows, and this widening applies only\n * where the RESOURCE is known to be INTROSPECTION-backed.\n */\n INTROSPECTION_SYNTHESIZED = 'INTROSPECTION_SYNTHESIZED',\n}\n\n/**\n * Descriptor for a **scope-required reference search** through an M:N junction.\n *\n * When a foreign key targets resource `T` and the holder resource's primary\n * scope is `S`, and `T ↔ S` is a MANY-to-MANY relationship via junction `J`,\n * a reference people-picker for that FK must search `T` **scoped to the caller's\n * current `S`** through `J` (rather than enumerating every `T` globally) — see\n * `.claude/plans/fk-filter-reference-search.md`. This descriptor names the\n * junction and the two foreign-key columns the junction carries to each peer.\n *\n * The junction's FK columns are resolved by convention as each peer's\n * `resourceFieldIdentifier` (e.g. `organizationMembers` carries `userId` for the\n * USERS peer and `organizationId` for the ORGANIZATIONS peer).\n */\nexport interface ManyToManyScopeJunction {\n /** The junction resource that joins the two peers (e.g. `organizationMembers`). */\n junctionResourceType: string;\n /** The junction's FK column referencing the search TARGET `T` (e.g. `userId`). */\n targetFkField: string;\n /** The junction's FK column referencing the SCOPE `S` (e.g. `organizationId`). */\n scopeFkField: string;\n}\n\n/**\n * Lookup keyed by `${targetResourceType}|${scopeResourceType}` →\n * {@link ManyToManyScopeJunction}. Both orderings of every M:N are recorded, so\n * either peer can be the search target with the other as the scope. Built once\n * at registry init via `Resources_SharedUtils.buildManyToManyScopeJunctionMap`.\n */\nexport type ManyToManyScopeJunctionMap = ReadonlyMap<string, ManyToManyScopeJunction>;\n\n// ── Label forwarding — server-resolved, never-stale, via a virtual field ──────\n//\n// Reuses TWO existing framework capabilities instead of inventing a bespoke\n// projection:\n// 1. The relational-join SHAPE of `SearchableRelationDescriptor`\n// (`resources-config.shared.schemas.ts`) — same authored vocabulary, resolved\n// in the OPPOSITE direction (values → related rows, not query → ids).\n// 2. The VIRTUAL-FIELD pipeline (`isVirtual().isSummaryField()`,\n// `VirtualFieldsBackendService`) — the framework's idiomatic \"compute a value\n// onto the response DTO\" mechanism. It already runs on READ/LIST/SEARCH, is\n// included in the summary schema, and survives the response DTO, so the\n// frontend just references the field name in `getFrontendResourceLabel`.\n\n/**\n * @wildo_source:part:start saas.models.resource-config.forwarded-label facet:layer:shared facet:family:resource-config\n *\n * A **label-forwarding descriptor** — declares how a junction (or any) resource\n * row labels itself using fields from a RELATED resource, resolved SERVER-SIDE\n * and projected onto the response DTO via {@link forwardedLabel}.\n *\n * Reuses the join vocabulary of `SearchableRelationDescriptor` (from\n * `@wildo-ai/saas-models`), resolved in the read direction. WHY a\n * descriptor and not denormalization: the human-meaningful label lives on a\n * RELATED resource and is MUTABLE there (a user's first/last name on\n * `USER_PROFILES`); copying it onto the junction would go stale and demand a sync\n * hook on every mutation path. Resolving the related resource's own fields at read\n * time is single-source-of-truth, never stale, and reaches a resource DIFFERENT\n * from the foreign key's declared target (the name lives on `USER_PROFILES`, not\n * on `users`, the FK target — joined on the shared `userId`).\n *\n * TENANT SAFETY (by construction): the descriptor only resolves related rows for\n * `localField` values that appear on rows the caller can ALREADY see (its own\n * already-scoped page), so the related read is a bounded SYSTEM read that can\n * never widen visibility — the same contract `SearchableRelationDescriptor`\n * relies on, mirrored for reads. The viewer therefore needs no read access to the\n * related row itself (e.g. another member's `user_profile`).\n *\n * @remarks Resolution requires the related resource to be MongoDB-backed. If the\n * related resource is PostgreSQL-backed the read is skipped and the label degrades\n * to `fallback` — parity is a future enhancement, mirroring the same adapter gap\n * on `SearchableRelationDescriptor`. Import from `@wildo-ai/saas-models`.\n *\n * @example\n * // organizationMembers labels itself by the linked user's name. firstName/\n * // lastName live on USER_PROFILES (mutable, deliberately NOT denormalized);\n * // both members and profiles carry the same `userId`, so join on it.\n * instanceLabel: forwardedLabel({\n * localField: 'userId',\n * relatedResource: CoreResourceType.USER_PROFILES,\n * relatedJoinField: 'userId',\n * fields: ['firstName', 'lastName'],\n * fallbackField: 'userEmail', // shown when the profile/name is unavailable\n * })\n */\nexport type LabelRelationDescriptor = {\n /** Field on THIS resource holding the join value (e.g. `userId`). */\n localField: string;\n /** The related resource whose fields are rendered into the label (e.g. `USER_PROFILES`). */\n relatedResource: ResourceType;\n /**\n * Field on the related resource matched against {@link localField}'s value.\n * Defaults to the related primary key (`_id`) — set it explicitly when joining\n * on a shared key other than the primary key (e.g. members and profiles both\n * carry `userId`).\n */\n relatedJoinField?: string;\n /**\n * Related fields to render, in order. Required: unlike search (which can default\n * to the related resource's own `searchableFields`), a label must declare what\n * to show. Resolving the related resource's OWN label as a default is a possible\n * future enhancement (it needs server-side label resolution that does not exist\n * in this path today).\n */\n fields: string[];\n /** Join separator between rendered field values. Default `' '` (single space). */\n separator?: string;\n /**\n * OWN-field on THIS resource used as the fallback label when the related row is\n * missing or every rendered field is empty — preferred over the static\n * {@link fallback}. Use an immutable own identifier (e.g. a denormalized\n * `userEmail`) so a row without a resolvable related label still shows a human\n * value instead of degrading to a raw id. Must be on the summary row (a summary\n * field) to be available to the resolver.\n */\n fallbackField?: string;\n /**\n * Static label of last resort, when the related row is missing/empty AND\n * {@link fallbackField} is unset or also empty. Default `''` (empty).\n */\n fallback?: string;\n};\n/** @wildo_source:part:end saas.models.resource-config.forwarded-label */\n\n/**\n * Stringify one forwarded field value, locale-aware where a localized\n * representation exists. Strings pass through verbatim (the canonical\n * label case — names, emails). `Date`/`number` use `Intl` with the optional\n * request locale. Enum-value LABEL translation is intentionally NOT done here:\n * resolving an app's enum labels is a frontend/display concern with no\n * server-side resolver in this path; forwarded labels are identity/text by\n * design. The `locale` param is the extension point if that ever changes.\n */\nfunction stringifyForwardedValue(value: unknown, locale?: string): string {\n if (value === null || value === undefined) {\n return '';\n }\n if (value instanceof Date) {\n return new Intl.DateTimeFormat(locale).format(value);\n }\n if (typeof value === 'number') {\n return new Intl.NumberFormat(locale).format(value);\n }\n return String(value);\n}\n\n/**\n * Pure renderer for a {@link LabelRelationDescriptor}: join the descriptor's\n * `fields` (in declared order, skipping empty values) from a resolved related\n * row, using `separator`, falling back to `fallback` when the row is absent or\n * the result is empty. Exported so it is unit-testable independently of the\n * virtual-field runtime.\n */\nexport function renderForwardedLabel(\n relatedRow: Record<string, unknown> | undefined | null,\n descriptor: LabelRelationDescriptor,\n options?: { locale?: string },\n): string {\n const fallback = descriptor.fallback ?? '';\n if (!relatedRow) {\n return fallback;\n }\n const separator = descriptor.separator ?? ' ';\n const rendered = descriptor.fields\n .map((field) => stringifyForwardedValue(relatedRow[field], options?.locale))\n .filter((part) => part.trim().length > 0)\n .join(separator)\n .trim();\n return rendered.length > 0 ? rendered : fallback;\n}\n\n/**\n * Request-scoped dedup cache for forwarded-label related reads. Keyed by the\n * `executionContext` object (one per request), so concurrent per-row virtual-field\n * computations across a single LIST/SEARCH page that resolve the SAME related key\n * share one in-flight read. This matches the framework's existing batch standard\n * (`populateListForSummary`: dedup + parallel, one read per UNIQUE key), without a\n * separate batch pre-pass. The `WeakMap` lets a finished request's cache be GC'd.\n */\nconst labelForwardingRequestCache = new WeakMap<\n object,\n Map<string, Promise<Record<string, unknown> | undefined>>\n>();\n\nfunction resolveRelatedRowDeduped(\n executionContext: unknown,\n cacheKey: string,\n loader: () => Promise<Record<string, unknown> | undefined>,\n): Promise<Record<string, unknown> | undefined> {\n // No usable request key (e.g. a direct unit invocation) → resolve uncached.\n if (executionContext === null || typeof executionContext !== 'object') {\n return loader();\n }\n let perRequest = labelForwardingRequestCache.get(executionContext as object);\n if (!perRequest) {\n perRequest = new Map();\n labelForwardingRequestCache.set(executionContext as object, perRequest);\n }\n let inFlight = perRequest.get(cacheKey);\n if (!inFlight) {\n inFlight = loader();\n perRequest.set(cacheKey, inFlight);\n }\n return inFlight;\n}\n\n/**\n * Build a VIRTUAL summary field that labels a row from a related resource per a\n * {@link LabelRelationDescriptor}. Drop it into a resource's main schema; the\n * frontend then references the field name in `getFrontendResourceLabel` (a plain,\n * synchronous field ref — no async resolver).\n *\n * The returned field is `isVirtual` (computed, never persisted; excluded from\n * request DTOs), `isSummaryField` (included in the SUMMARY DTO, so it is present\n * in LIST/collection rows, not only on READ), and `isHidden({ display: true })`\n * (it IS the row/title label, so it must never ALSO auto-render as a standalone\n * card field or table column — `detectSummaryFields` skips display-hidden fields;\n * the value still reaches the frontend label, which reads the field by name). At\n * read time the framework's\n * `VirtualFieldsBackendService` invokes the `calculate` below with the backend\n * `utils`. `calculate`:\n * 1. reads the join value from `currentObject[localField]`;\n * 2. resolves the related row via the related repository's system read\n * `findFieldValuesByJoinField` (the read-direction sibling of the search\n * join's `findSearchMatchTargetIds`), deduped per request (see\n * {@link resolveRelatedRowDeduped});\n * 3. renders the label via {@link renderForwardedLabel}.\n * Failure modes (missing value, unavailable repo, absent/empty related row) degrade\n * to the fallback chain — `descriptor.fallbackField`'s own-field value first, else\n * `descriptor.fallback`; `calculate` never throws.\n *\n * @remarks `dependencies: [localField]` is consumed by the repository DTO builder\n * (`repository-dto-builder.utils.ts`), which adds the dependency to the read\n * projection — so `calculate` receives the join value even when `localField` is\n * not itself a summary field. (On `organizationMembers`, `userId` is independently\n * a summary field too.)\n */\nexport function forwardedLabel(\n descriptor: LabelRelationDescriptor,\n): DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>> {\n const joinField = descriptor.relatedJoinField ?? '_id';\n\n return z\n .string()\n .optional()\n .isVirtual({\n dependencies: [descriptor.localField],\n calculate: async ({ currentObject, executionContext, utils }) => {\n const row = currentObject as Record<string, unknown> | undefined;\n\n // Fallback chain: prefer an own-field identifier (e.g. an immutable\n // `userEmail`) over the static string, so an unresolvable related label\n // degrades to a human value rather than a raw id. Applied on EVERY\n // non-resolution path (no join value, no repo, missing/empty related row).\n const resolveFallback = (): string => {\n if (descriptor.fallbackField) {\n const own = row?.[descriptor.fallbackField];\n if (own !== null && own !== undefined && String(own).trim().length > 0) {\n return String(own);\n }\n }\n return descriptor.fallback ?? '';\n };\n\n const rawValue = row?.[descriptor.localField];\n if (rawValue === null || rawValue === undefined || rawValue === '') {\n return resolveFallback();\n }\n const joinValue = String(rawValue);\n\n const relatedRepository = utils?.repositories?.getRepository?.(descriptor.relatedResource);\n if (!relatedRepository || typeof relatedRepository.findFieldValuesByJoinField !== 'function') {\n return resolveFallback();\n }\n\n const cacheKey = `${descriptor.relatedResource}|${joinField}|${joinValue}`;\n const relatedRow = await resolveRelatedRowDeduped(executionContext, cacheKey, async () => {\n // Fail-safe: a related-read error resolves to \"no row\" (→ fallback),\n // never a throw. Resolving (rather than rejecting) also keeps the\n // per-request dedup cache from storing a rejected promise that would\n // re-throw for every other row sharing this join value.\n try {\n const rowsByValue: Map<string, Record<string, unknown>> =\n await relatedRepository.findFieldValuesByJoinField(joinField, [joinValue], descriptor.fields);\n return rowsByValue.get(joinValue);\n } catch (error) {\n utils?.logger?.warn?.(\n `[forwardedLabel] related read failed for ${descriptor.relatedResource}.${joinField}=${joinValue}; using fallback`,\n error,\n );\n return undefined;\n }\n });\n\n // Render the related fields; if nothing renders, run the fallback chain\n // (own-field → static) — pass an empty static fallback to detect \"empty\".\n const rendered = renderForwardedLabel(relatedRow, { ...descriptor, fallback: '' });\n return rendered.length > 0 ? rendered : resolveFallback();\n },\n })\n .isSummaryField()\n .isHidden({ display: true });\n}\n"]}
|
|
@@ -204,13 +204,38 @@ export declare class Resources_SharedUtils {
|
|
|
204
204
|
* for semantic differentiation (`parentDocumentId` → `'parentDocument'`
|
|
205
205
|
* vs `childDocumentId` → `'childDocument'`).
|
|
206
206
|
*
|
|
207
|
-
*
|
|
208
|
-
* `
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
207
|
+
* **This function is the ONE authority for a CONTEXT projection's field name.**
|
|
208
|
+
* `ResourcesConfigOperations_DtosBuilderUtils.addRelationshipPlaceholders` declares the
|
|
209
|
+
* placeholder with it, and `ResourcePopulationBackendService.populateForContext` writes the
|
|
210
|
+
* populated value with it. Do not re-derive a context field name anywhere else.
|
|
211
|
+
*
|
|
212
|
+
* Population used to derive its own — `singularize(resourceType2)` for 1:1, `resourceType2`
|
|
213
|
+
* verbatim for 1:many — and this comment asserted the two were "structurally equivalent".
|
|
214
|
+
* **They are not, and the false claim stood here while the defect it describes was live.**
|
|
215
|
+
* The FK-anchor-side branch below derives from the related resource's AUTHORED
|
|
216
|
+
* `resourceFieldIdentifier`, whose stem need not be the singular of the resource type
|
|
217
|
+
* (`userSelfPreferencesId` → `userSelfPreferences`, while `singularize('userSelfPreferences')`
|
|
218
|
+
* is `userSelfPreference`), and `toResourceName` re-pluralizes that stem for 1:many
|
|
219
|
+
* (`organizationInvoiceRef` → `organizationInvoiceReves`). Measured over the core registry on
|
|
220
|
+
* 2026-09-10: of its 111 relationships **37 carry an enabled `contextPolicy`, and the two
|
|
221
|
+
* derivations disagreed on 11 of those 37** — every one of those fields was populated by the
|
|
222
|
+
* backend and then silently Zod-stripped on the way out the controller, with no error and no log
|
|
223
|
+
* on any surface. That is what left every date in every generated application formatted at the
|
|
224
|
+
* i18n floor: the member's own regional preferences never reached the client (issue #563).
|
|
225
|
+
*
|
|
226
|
+
* Pinned by `engine/saas-models/src/resources/__tests__/context-projection-field-name-agreement.test.ts`
|
|
227
|
+
* and by `saas-backend-lib`'s `resource-population.context-field-name.test.ts`. What those pin,
|
|
228
|
+
* precisely: that the DTO declares THIS function's name, that the producer writes THIS
|
|
229
|
+
* function's name, and that the live core registry still contains a relationship where the
|
|
230
|
+
* retired local derivation would disagree. They do NOT enumerate every generated DTO.
|
|
231
|
+
*
|
|
232
|
+
* ⚠️ A THIRD derivation of the same name exists and is NOT covered — the API-reference /
|
|
233
|
+
* OpenAPI path builds its DTOs from `createResourceConfiguration_Initialization`, which passes
|
|
234
|
+
* an EMPTY registry map, so this function falls through to
|
|
235
|
+
* `toResourceFieldIdentifier(relatedResourceType)` and produces the singular fallback. The
|
|
236
|
+
* published reference therefore says `userSelfPreference` where the runtime says
|
|
237
|
+
* `userSelfPreferences`. Pre-existing (the divergence long predates #563) and tracked
|
|
238
|
+
* separately; do not assume the generated reference agrees with the runtime.
|
|
214
239
|
*/
|
|
215
240
|
static resolveRelationshipObjectIdentity(relationship: Pick<ResourceRelationship, 'foreignKeyField' | 'resourceType1' | 'resourceType2'>, relatedResourceType: ResourceType, cardinality: ResourceRelationshipCardinality, allResourceFieldIdentifiers: Partial<Record<ResourceType, string>> | Record<string, string>): ResolvedRelationshipObjectIdentity;
|
|
216
241
|
/**
|