@wildo-ai/saas-specifications 1.1.0 → 1.1.2
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/assurance/external-framework-mapping.json +980 -0
- package/dist/esm/_core/brand/brand.family-aspects.d.ts +3 -0
- package/dist/esm/_core/brand/brand.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/brand/brand.family-aspects.js +51 -0
- package/dist/esm/_core/brand/brand.family-aspects.js.map +1 -0
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts +3 -0
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +28 -0
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -0
- package/dist/esm/_core/business-model-lite/business-model.family-aspects.d.ts +3 -0
- package/dist/esm/_core/business-model-lite/business-model.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/business-model-lite/business-model.family-aspects.js +21 -0
- package/dist/esm/_core/business-model-lite/business-model.family-aspects.js.map +1 -0
- package/dist/esm/_core/chart-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/chart-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/chart-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.d.ts +85 -0
- package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.js +41 -0
- package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +168 -2
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +98 -9
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.d.ts +12 -0
- package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.js +47 -0
- package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.js.map +1 -0
- package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.js +8 -3
- package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.family-aspects.d.ts +21 -0
- package/dist/esm/_core/compliance-documents/processor-register.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/processor-register.family-aspects.js +40 -0
- package/dist/esm/_core/compliance-documents/processor-register.family-aspects.js.map +1 -0
- package/dist/esm/_core/composite-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/composite-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/composite-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +3 -0
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +32 -0
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -0
- package/dist/esm/_core/execution-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/execution-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/execution-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/family-aspects.registry.d.ts +18 -0
- package/dist/esm/_core/family-aspects.registry.d.ts.map +1 -0
- package/dist/esm/_core/family-aspects.registry.js +60 -0
- package/dist/esm/_core/family-aspects.registry.js.map +1 -0
- package/dist/esm/_core/family-aspects.schemas.d.ts +122 -0
- package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -0
- package/dist/esm/_core/family-aspects.schemas.js +15 -0
- package/dist/esm/_core/family-aspects.schemas.js.map +1 -0
- package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +11 -11
- package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.d.ts +3 -0
- package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.js +25 -0
- package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.js.map +1 -0
- package/dist/esm/_core/flows-actors-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/flows-actors-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/flows-actors-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/frontend-component-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/frontend-component-specification.schemas.js +19 -1
- package/dist/esm/_core/frontend-component-specification.schemas.js.map +1 -1
- package/dist/esm/_core/full-custom-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/full-custom-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/full-custom-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/guidance-flow-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/guidance-flow-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/guidance-flow-specification.schemas.js +14 -0
- package/dist/esm/_core/guidance-flow-specification.schemas.js.map +1 -1
- package/dist/esm/_core/index.d.ts +2 -0
- package/dist/esm/_core/index.d.ts.map +1 -1
- package/dist/esm/_core/index.js +2 -0
- package/dist/esm/_core/index.js.map +1 -1
- package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +22 -22
- package/dist/esm/_core/market/market.family-aspects.d.ts +9 -0
- package/dist/esm/_core/market/market.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/market/market.family-aspects.js +227 -0
- package/dist/esm/_core/market/market.family-aspects.js.map +1 -0
- package/dist/esm/_core/onboarding-view-specification.schemas.d.ts +11 -0
- package/dist/esm/_core/onboarding-view-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/onboarding-view-specification.schemas.js +14 -0
- package/dist/esm/_core/onboarding-view-specification.schemas.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts +3 -0
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js +31 -0
- package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js.map +1 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.d.ts +9 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.js +40 -0
- package/dist/esm/_core/requirements/requirements.family-aspects.js.map +1 -0
- package/dist/esm/_core/resource-specification.schemas.d.ts +22 -0
- package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
- package/dist/esm/_core/roadmap/roadmap.family-aspects.d.ts +3 -0
- package/dist/esm/_core/roadmap/roadmap.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/roadmap/roadmap.family-aspects.js +26 -0
- package/dist/esm/_core/roadmap/roadmap.family-aspects.js.map +1 -0
- package/dist/esm/_core/vision/vision.family-aspects.d.ts +11 -0
- package/dist/esm/_core/vision/vision.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/vision/vision.family-aspects.js +63 -0
- package/dist/esm/_core/vision/vision.family-aspects.js.map +1 -0
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +188 -33
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +158 -57
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts +38 -4
- package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js +37 -3
- package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/document-facts.family-aspects.d.ts +12 -0
- package/dist/esm/application-creation/document-facts.family-aspects.d.ts.map +1 -0
- package/dist/esm/application-creation/document-facts.family-aspects.js +37 -0
- package/dist/esm/application-creation/document-facts.family-aspects.js.map +1 -0
- package/dist/esm/application-creation/document-release-policy.family-aspects.d.ts +3 -0
- package/dist/esm/application-creation/document-release-policy.family-aspects.d.ts.map +1 -0
- package/dist/esm/application-creation/document-release-policy.family-aspects.js +23 -0
- package/dist/esm/application-creation/document-release-policy.family-aspects.js.map +1 -0
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +93 -62
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +114 -59
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts +2 -0
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js +2 -0
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +11 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +11 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +976 -2
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +2026 -61
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +1 -0
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.definitions.js +18 -3
- package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts +32 -2
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.js +32 -2
- package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-external-framework-mapping.d.ts +90 -0
- package/dist/esm/assurance/assurance-external-framework-mapping.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-external-framework-mapping.js +134 -0
- package/dist/esm/assurance/assurance-external-framework-mapping.js.map +1 -0
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts +71 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +545 -5
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +141 -0
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-program-generation.schemas.js +377 -0
- package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -0
- package/dist/esm/assurance/assurance-program.family-aspects.d.ts +13 -0
- package/dist/esm/assurance/assurance-program.family-aspects.d.ts.map +1 -0
- package/dist/esm/assurance/assurance-program.family-aspects.js +16 -0
- package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -0
- package/dist/esm/assurance/assurance-program.schemas.d.ts +30 -6
- package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.js +29 -6
- package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts +1 -0
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.js +12 -0
- package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-sources.schemas.d.ts +76 -0
- package/dist/esm/assurance/assurance-sources.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-sources.schemas.js +59 -0
- package/dist/esm/assurance/assurance-sources.schemas.js.map +1 -1
- package/dist/esm/assurance/document-publication.family-aspects.d.ts +29 -0
- package/dist/esm/assurance/document-publication.family-aspects.d.ts.map +1 -0
- package/dist/esm/assurance/document-publication.family-aspects.js +48 -0
- package/dist/esm/assurance/document-publication.family-aspects.js.map +1 -0
- package/dist/esm/assurance.exports.d.ts +2 -0
- package/dist/esm/assurance.exports.d.ts.map +1 -1
- package/dist/esm/assurance.exports.js +2 -0
- package/dist/esm/assurance.exports.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +19 -2
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +2 -0
- package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +3 -1
- package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +3 -1
- package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +3 -1
- package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.js +3 -1
- package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.d.ts +36 -0
- package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js +193 -0
- package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js.map +1 -0
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts +1 -1
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +3 -1
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +6 -4
- package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js +2 -0
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts +2 -2
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +8 -8
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts +2 -2
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.js +3 -1
- package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js +3 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js +3 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +6 -6
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts +6 -6
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +2 -0
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +2 -0
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +5 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/engine-resource-sub-domain.d.ts +63 -0
- package/dist/esm/engine/engine-resource-sub-domain.d.ts.map +1 -0
- package/dist/esm/engine/engine-resource-sub-domain.js +87 -0
- package/dist/esm/engine/engine-resource-sub-domain.js.map +1 -0
- package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
- package/dist/esm/engine/errors/error-messages.specification.js +30 -1
- package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.js +2 -0
- package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/organization-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js +2 -0
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts +1 -1
- package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/features/resources/user-features.resource.specification.js +2 -0
- package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -1
- package/dist/esm/engine/files/resources/files.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/files/resources/files.resource.specification.js +2 -0
- package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts +3 -3
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +12 -0
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.d.ts +3 -3
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +2 -0
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +2 -0
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js +8 -3
- package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.d.ts +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +3 -0
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +3 -0
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +3 -0
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/index.d.ts +1 -0
- package/dist/esm/engine/index.d.ts.map +1 -1
- package/dist/esm/engine/index.js +1 -0
- package/dist/esm/engine/index.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +2 -0
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +2 -0
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +2 -0
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +2 -0
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +3 -0
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +2 -0
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +2 -0
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.d.ts +1 -1
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.js +3 -1
- package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js +2 -0
- package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts +5 -0
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +385 -9
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
- package/dist/esm/technical-documentation/technical-documentation-units.schemas.js +1 -1
- package/dist/esm/technical-documentation/technical-documentation-units.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +8 -8
- package/dist/esm/.builder.pid +0 -9
- package/dist/esm/_core/business-coverage/coverage-findings-validation.d.ts +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings-validation.d.ts.map +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings-validation.js.map +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings.schemas.d.ts +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings.schemas.d.ts.map +0 -0
- package/dist/esm/_core/business-coverage/coverage-findings.schemas.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-profiles.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-profiles.resource.specification.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,oBAAoB,EAEpB,8BAA8B,EAC9B,gBAAgB,EAGjB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"organization-profiles.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-profiles.resource.specification.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,oBAAoB,EAEpB,8BAA8B,EAC9B,gBAAgB,EAGjB,MAAM,uBAAuB,CAAC;AA0G/B,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAoOrD,CAAC"}
|
package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js
CHANGED
|
@@ -3,6 +3,7 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
|
3
3
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
|
|
4
4
|
import { CoreResourceOperation as Op, OrganizationIndustry, OrganizationProfileSchema, OrganizationProfile_Operations, OrganizationSize, ResourcePrimaryScope, organizationProfileResourceConfiguration_InitializationFactory as organizationProfilesFactory, } from '@wildo-ai/saas-models';
|
|
5
5
|
import { HttpResponseStatusCode, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
|
|
6
|
+
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
6
7
|
const organizationProfilesResourceUIBehavior = organizationProfilesUIBehaviorSource;
|
|
7
8
|
const ORGANIZATION_PROFILE_EXAMPLE = {
|
|
8
9
|
_id: 'organization_profile_01JEXAMPLE',
|
|
@@ -92,6 +93,7 @@ export const organizationProfilesResourceSpecification = resourceSpecificationFr
|
|
|
92
93
|
businessRole: 'Gives authorized members and integrations one consistent organization profile for product surfaces, directories, and connected systems.',
|
|
93
94
|
lifecycleRole: 'The profile is created with its organization, evolves through company and brand changes, and is removed with the owning organization.',
|
|
94
95
|
audience: LabelAudience.ADMIN,
|
|
96
|
+
subDomain: EngineResourceSubDomain.ORGANIZATIONS,
|
|
95
97
|
codeHandling: {
|
|
96
98
|
mainSchema: {
|
|
97
99
|
packageName: '@wildo-ai/saas-models',
|
package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-profiles.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-profiles.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,IAAI,oCAAoC,EAAE,MAAM,8BAA8B,CAAC;AAClI,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,oBAAoB,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,gBAAgB,EAChB,oBAAoB,EACpB,8DAA8D,IAAI,2BAA2B,GAC9F,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AAOrC,MAAM,sCAAsC,GAAG,oCAAoF,CAAC;AAEpI,MAAM,4BAA4B,GAAG;IACnC,GAAG,EAAE,iCAAiC;IACtC,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,cAAc;IACtB,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,0BAA0B;IACnC,WAAW,EAAE,yDAAyD;IACtE,QAAQ,EAAE,oBAAoB,CAAC,UAAU;IACzC,IAAI,EAAE,gBAAgB,CAAC,MAAM;IAC7B,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE;QACP,KAAK,EAAE,oBAAoB;QAC3B,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,QAAQ;KACrB;IACD,QAAQ,EAAE,mBAAmB;IAC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AAmB,EAAE;gBAC5M,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,mFAAmF,EAAE;gBACzI,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+EAA+E,EAAE;aACtI;YACD,QAAQ,EAAE,CAAC;oBACT,KAAK,EAAE,oCAAoC;oBAC3C,OAAO,EAAE;wBACP,cAAc,EAAE,4BAA4B,CAAC,cAAc;wBAC3D,GAAG,6CAA6C;qBACjD;oBACD,QAAQ,EAAE,8CAA8C;oBACxD,SAAS,EAAE,sBAAsB,CAAC,MAAM;iBACzC,CAAC;YACF,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,qIAAqI;QACrI,4HAA4H;KAC7H;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,EACD,GAAG,EAAE,CAAC,CAAC;IACL,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE,SAAS,EAAE,mEAAmE,EAAE;QACjJ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE,SAAS,EAAE,2DAA2D,EAAE;QAC9I,CAAC,8BAA8B,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,sCAAsC,EAAE;KAC7K;CACF,CAAC,CACH,CAAC","sourcesContent":["import { organizationProfilesMainResourceUIBehavior as organizationProfilesUIBehaviorSource } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n OrganizationIndustry,\n OrganizationProfileSchema,\n OrganizationProfile_Operations,\n OrganizationSize,\n ResourcePrimaryScope,\n organizationProfileResourceConfiguration_InitializationFactory as organizationProfilesFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\n\ntype Cfg = ReturnType<typeof organizationProfilesFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst organizationProfilesResourceUIBehavior = organizationProfilesUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst ORGANIZATION_PROFILE_EXAMPLE = {\n _id: 'organization_profile_01JEXAMPLE',\n organizationId: 'org_01JEXAMPLE',\n displayName: 'Acme Europe',\n domain: 'acme.example',\n phone: '+352 26 00 00 00',\n website: 'https://www.acme.example',\n description: 'European operations and customer delivery hub for Acme.',\n industry: OrganizationIndustry.TECHNOLOGY,\n size: OrganizationSize.MEDIUM,\n founded: '2018-06-14T00:00:00.000Z',\n address: {\n line1: '12 Boulevard Royal',\n city: 'Luxembourg',\n country: 'LU',\n postalCode: 'L-2449',\n },\n timezone: 'Europe/Luxembourg',\n branding: {\n logo: 'https://cdn.acme.example/brand/logo.svg',\n favicon: 'https://cdn.acme.example/brand/favicon.png',\n primaryColor: '#635BFF',\n secondaryColor: '#0A2540',\n customDomain: 'workspace.acme.example',\n },\n socialLinks: {\n linkedin: 'https://www.linkedin.com/company/acme-europe',\n github: 'https://github.com/acme-europe',\n },\n createdAt: '2026-01-12T09:00:00.000Z',\n updatedAt: '2026-08-20T16:30:00.000Z',\n _version: 7,\n} as const;\n\nconst ORGANIZATION_PROFILE_CONTEXT_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n organization: { _id: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n} as const;\n\nconst ORGANIZATION_PROFILE_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_PROFILE_EXAMPLE._id,\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n displayName: ORGANIZATION_PROFILE_EXAMPLE.displayName,\n _version: ORGANIZATION_PROFILE_EXAMPLE._version,\n} as const;\n\nconst ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE = {\n displayName: 'Acme Europe & Middle East',\n website: 'https://emea.acme.example',\n description: 'European and Middle East operations and customer delivery hub for Acme.',\n industry: OrganizationIndustry.TECHNOLOGY,\n size: OrganizationSize.LARGE,\n timezone: 'Europe/Luxembourg',\n address: {\n line1: '12 Boulevard Royal',\n line2: 'Floor 4',\n city: 'Luxembourg',\n country: 'LU',\n postalCode: 'L-2449',\n },\n socialLinks: {\n linkedin: 'https://www.linkedin.com/company/acme-emea',\n github: 'https://github.com/acme-emea',\n },\n} as const;\n\nconst ORGANIZATION_PROFILE_UPDATE_RESPONSE_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n ...ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE,\n updatedAt: '2026-08-21T08:45:00.000Z',\n _version: 8,\n} as const;\n\nconst ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE = {\n branding: {\n logo: 'https://cdn.acme.example/brand/logo-2026.svg',\n favicon: 'https://cdn.acme.example/brand/favicon-2026.png',\n primaryColor: '#4F46E5',\n secondaryColor: '#111827',\n customDomain: 'portal.acme.example',\n },\n} as const;\n\nconst ORGANIZATION_PROFILE_BRANDING_RESPONSE_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n branding: ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE.branding,\n updatedAt: '2026-08-21T09:10:00.000Z',\n _version: 8,\n} as const;\n\nexport const organizationProfilesResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(organizationProfilesResourceUIBehavior),\n resourceSpecification(\n organizationProfilesFactory,\n OrganizationProfileSchema,\n ({ schemaShape }) => ({\n purpose: 'Business identity and presentation metadata for one organization: company facts, location, branding, and social links.',\n businessRole: 'Gives authorized members and integrations one consistent organization profile for product surfaces, directories, and connected systems.',\n lifecycleRole: 'The profile is created with its organization, evolves through company and brand changes, and is removed with the owning organization.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationProfileSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationProfileResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ORGANIZATION_PROFILES',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationProfile_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationProfilesMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Stable identifier of the organization-profile record.',\n whyItMatters: 'Identifies this profile document independently from the organization id used to address the route.',\n }),\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization this public/directory profile describes.',\n whyItMatters: 'Ties branding and company facts to exactly one tenant so directory cards and connector metadata resolve per organization and cannot surface another tenant’s profile.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n displayName: schemaShape.displayName.stringSpec({ meaning: 'Customer-facing name when different from the canonical org `name`.' }),\n domain: schemaShape.domain.stringSpec({ meaning: 'Organization-owned internet domain used as profile and directory metadata; it is not an authentication-domain verification claim.' }),\n phone: schemaShape.phone.stringSpec({ meaning: 'Organization contact telephone number as entered by an authorized profile editor.' }),\n website: schemaShape.website.stringSpec({ meaning: 'Primary marketing or product URL for the tenant.' }),\n description: schemaShape.description.stringSpec({ meaning: 'Short organization description for about panels, directories, and connected systems.' }),\n industry: schemaShape.industry.enumSpec({\n meaning: 'Business sector classification for the tenant, used in directory facets and segmentation.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationIndustry',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationIndustry.TECHNOLOGY]: { meaning: 'Technology / software.' },\n [OrganizationIndustry.FINANCE]: { meaning: 'Finance, banking, or insurance.' },\n [OrganizationIndustry.HEALTHCARE]: { meaning: 'Healthcare and life sciences.' },\n [OrganizationIndustry.EDUCATION]: { meaning: 'Education and academia.' },\n [OrganizationIndustry.RETAIL]: { meaning: 'Retail and commerce.' },\n [OrganizationIndustry.MANUFACTURING]: { meaning: 'Manufacturing and industry.' },\n [OrganizationIndustry.CONSULTING]: { meaning: 'Professional services and consulting.' },\n [OrganizationIndustry.MEDIA]: { meaning: 'Media, entertainment, and publishing.' },\n [OrganizationIndustry.GOVERNMENT]: { meaning: 'Government and public sector.' },\n [OrganizationIndustry.NONPROFIT]: { meaning: 'Nonprofit and NGO.' },\n [OrganizationIndustry.OTHER]: { meaning: 'Any sector not covered by the named categories.' },\n },\n }),\n size: schemaShape.size.enumSpec({\n meaning: 'Employee-count band for the tenant, used for directory facets and plan/segment heuristics.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationSize',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationSize.STARTUP]: { meaning: 'Startup, roughly 1–10 employees.' },\n [OrganizationSize.SMALL]: { meaning: 'Small, roughly 11–50 employees.' },\n [OrganizationSize.MEDIUM]: { meaning: 'Medium, roughly 51–200 employees.' },\n [OrganizationSize.LARGE]: { meaning: 'Large, roughly 201–1000 employees.' },\n [OrganizationSize.ENTERPRISE]: { meaning: 'Enterprise, 1000+ employees.' },\n },\n }),\n founded: schemaShape.founded.dateSpec({ meaning: 'Date associated with the organization’s founding for profile and directory presentation.' }),\n address: schemaShape.address.objectSpec({ meaning: 'Primary organization address, including ISO two-letter country code and postal information.' }),\n timezone: schemaShape.timezone.stringSpec({ meaning: 'Default IANA timezone used when organization-facing surfaces need a local time context.' }),\n branding: schemaShape.branding.objectSpec({ meaning: 'Organization-specific logo, favicon, colors, and custom-domain overrides. Omitted values fall back to application branding.' }),\n socialLinks: schemaShape.socialLinks.objectSpec({ meaning: 'Optional public profile URLs for the organization’s supported social and developer channels.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When this profile row was created by the organization lifecycle.' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When any stored profile field was last changed.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read the addressed organization’s complete profile.',\n outcome: 'The caller receives company facts, location, branding, social links, and the current resource version.',\n whenToUse: 'Use this representation when synchronizing a complete organization profile or rendering a full about/settings surface.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The profile was found and its directory/branding metadata is returned for the addressed organization.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record has been provisioned for the addressed organization in the caller’s scope.' },\n ],\n examples: [{\n title: 'Read the organization profile',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n purpose: 'Read the organization profile with its configured relationship context.',\n outcome: 'The complete profile is returned with the related organization identifier when that relationship is available.',\n examples: [{\n title: 'Read the profile with organization context',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_CONTEXT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n purpose: 'Read the compact organization-profile identity.',\n outcome: 'Only the profile id, organization id, display name, and current resource version are returned.',\n examples: [{\n title: 'Read the compact organization profile',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_SUMMARY_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n idempotent: true,\n },\n [Op.UPDATE]: {\n purpose: 'Update one or more editable organization-profile fields.',\n outcome: 'The stored profile is changed and the complete updated representation, including its new resource version, is returned.',\n whenToUse: 'Use this operation for company, classification, location, social-link, or combined profile changes. Use the branding operation when the request changes only the brand kit.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The profile fields were patched and the updated profile is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited profile fields fail schema validation (e.g. a malformed `website` URL).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not hold the organization-manager authority required by this route.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record exists for the addressed organization to update.' },\n ],\n examples: [{\n title: 'Update organization company and directory details',\n request: {\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n ...ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE,\n },\n response: ORGANIZATION_PROFILE_UPDATE_RESPONSE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the organization profile row when its owning organization is deleted (composition `onParentDelete` cascade).',\n outcome: 'The eager-seeded singleton profile row is removed together with the organization — the composition part does not outlive its whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization profile row was deleted as part of the owning organization’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (ORG_ADMIN) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.\n idempotent: true,\n },\n [OrganizationProfile_Operations.UPDATE_BRANDING]: {\n operationId: OrganizationProfile_Operations.UPDATE_BRANDING,\n purpose: 'Replace the organization-specific logo, favicon, colors, and custom-domain overrides as one brand kit.',\n outcome: 'The brand kit is validated, stored, and returned inside the complete updated profile with its new resource version.',\n whenToUse: 'Use this operation for a branding-only change that should not carry unrelated company-profile fields.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The brand kit (colors, logo, favicon) was applied and the updated profile is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The branding bundle fails validation (e.g. an invalid color token or an unsupported logo/favicon asset reference).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not hold the organization-admin authority required by this route.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record exists for the addressed organization to apply branding to.' },\n ],\n examples: [{\n title: 'Replace the organization brand kit',\n request: {\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n ...ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE,\n },\n response: ORGANIZATION_PROFILE_BRANDING_RESPONSE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Each organization owns one profile. The framework creates it with the organization and removes it when the organization is deleted.',\n 'Organization-specific branding fields are overrides; when an override is absent, clients should use the application brand.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n views: {\n [Op.READ]: { purpose: 'Settings read for company/about panels.', whenToUse: 'Org profile in admin and member-visible about pages when exposed.' },\n [Op.UPDATE]: { purpose: 'General field edits in multi-section form.', whenToUse: 'IT and marketing co-own updates through governance roles.' },\n [OrganizationProfile_Operations.UPDATE_BRANDING]: { purpose: 'Branding wizard path separate from long-form text edits.', whenToUse: 'White-label and theme management UX.' },\n },\n }),\n);\n"]}
|
|
1
|
+
{"version":3,"file":"organization-profiles.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-profiles.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,IAAI,oCAAoC,EAAE,MAAM,8BAA8B,CAAC;AAClI,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,oBAAoB,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,gBAAgB,EAChB,oBAAoB,EACpB,8DAA8D,IAAI,2BAA2B,GAC9F,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAO3E,MAAM,sCAAsC,GAAG,oCAAoF,CAAC;AAEpI,MAAM,4BAA4B,GAAG;IACnC,GAAG,EAAE,iCAAiC;IACtC,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,cAAc;IACtB,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,0BAA0B;IACnC,WAAW,EAAE,yDAAyD;IACtE,QAAQ,EAAE,oBAAoB,CAAC,UAAU;IACzC,IAAI,EAAE,gBAAgB,CAAC,MA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uGAAuG;YAClH,gBAAgB,EAAE;gBAChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,wFAAwF,EAAE;aAC3I;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,oHAAoH,EAAE,SAAS,EAAE,mBAAmB,EAAE;gBAC5M,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,mFAAmF,EAAE;gBACzI,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+EAA+E,EAAE;aACtI;YACD,QAAQ,EAAE,CAAC;oBACT,KAAK,EAAE,oCAAoC;oBAC3C,OAAO,EAAE;wBACP,cAAc,EAAE,4BAA4B,CAAC,cAAc;wBAC3D,GAAG,6CAA6C;qBACjD;oBACD,QAAQ,EAAE,8CAA8C;oBACxD,SAAS,EAAE,sBAAsB,CAAC,MAAM;iBACzC,CAAC;YACF,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,qIAAqI;QACrI,4HAA4H;KAC7H;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,EACD,GAAG,EAAE,CAAC,CAAC;IACL,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE,SAAS,EAAE,mEAAmE,EAAE;QACjJ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE,SAAS,EAAE,2DAA2D,EAAE;QAC9I,CAAC,8BAA8B,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,sCAAsC,EAAE;KAC7K;CACF,CAAC,CACH,CAAC","sourcesContent":["import { organizationProfilesMainResourceUIBehavior as organizationProfilesUIBehaviorSource } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n OrganizationIndustry,\n OrganizationProfileSchema,\n OrganizationProfile_Operations,\n OrganizationSize,\n ResourcePrimaryScope,\n organizationProfileResourceConfiguration_InitializationFactory as organizationProfilesFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof organizationProfilesFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst organizationProfilesResourceUIBehavior = organizationProfilesUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst ORGANIZATION_PROFILE_EXAMPLE = {\n _id: 'organization_profile_01JEXAMPLE',\n organizationId: 'org_01JEXAMPLE',\n displayName: 'Acme Europe',\n domain: 'acme.example',\n phone: '+352 26 00 00 00',\n website: 'https://www.acme.example',\n description: 'European operations and customer delivery hub for Acme.',\n industry: OrganizationIndustry.TECHNOLOGY,\n size: OrganizationSize.MEDIUM,\n founded: '2018-06-14T00:00:00.000Z',\n address: {\n line1: '12 Boulevard Royal',\n city: 'Luxembourg',\n country: 'LU',\n postalCode: 'L-2449',\n },\n timezone: 'Europe/Luxembourg',\n branding: {\n logo: 'https://cdn.acme.example/brand/logo.svg',\n favicon: 'https://cdn.acme.example/brand/favicon.png',\n primaryColor: '#635BFF',\n secondaryColor: '#0A2540',\n customDomain: 'workspace.acme.example',\n },\n socialLinks: {\n linkedin: 'https://www.linkedin.com/company/acme-europe',\n github: 'https://github.com/acme-europe',\n },\n createdAt: '2026-01-12T09:00:00.000Z',\n updatedAt: '2026-08-20T16:30:00.000Z',\n _version: 7,\n} as const;\n\nconst ORGANIZATION_PROFILE_CONTEXT_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n organization: { _id: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n} as const;\n\nconst ORGANIZATION_PROFILE_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_PROFILE_EXAMPLE._id,\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n displayName: ORGANIZATION_PROFILE_EXAMPLE.displayName,\n _version: ORGANIZATION_PROFILE_EXAMPLE._version,\n} as const;\n\nconst ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE = {\n displayName: 'Acme Europe & Middle East',\n website: 'https://emea.acme.example',\n description: 'European and Middle East operations and customer delivery hub for Acme.',\n industry: OrganizationIndustry.TECHNOLOGY,\n size: OrganizationSize.LARGE,\n timezone: 'Europe/Luxembourg',\n address: {\n line1: '12 Boulevard Royal',\n line2: 'Floor 4',\n city: 'Luxembourg',\n country: 'LU',\n postalCode: 'L-2449',\n },\n socialLinks: {\n linkedin: 'https://www.linkedin.com/company/acme-emea',\n github: 'https://github.com/acme-emea',\n },\n} as const;\n\nconst ORGANIZATION_PROFILE_UPDATE_RESPONSE_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n ...ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE,\n updatedAt: '2026-08-21T08:45:00.000Z',\n _version: 8,\n} as const;\n\nconst ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE = {\n branding: {\n logo: 'https://cdn.acme.example/brand/logo-2026.svg',\n favicon: 'https://cdn.acme.example/brand/favicon-2026.png',\n primaryColor: '#4F46E5',\n secondaryColor: '#111827',\n customDomain: 'portal.acme.example',\n },\n} as const;\n\nconst ORGANIZATION_PROFILE_BRANDING_RESPONSE_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n branding: ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE.branding,\n updatedAt: '2026-08-21T09:10:00.000Z',\n _version: 8,\n} as const;\n\nexport const organizationProfilesResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(organizationProfilesResourceUIBehavior),\n resourceSpecification(\n organizationProfilesFactory,\n OrganizationProfileSchema,\n ({ schemaShape }) => ({\n purpose: 'Business identity and presentation metadata for one organization: company facts, location, branding, and social links.',\n businessRole: 'Gives authorized members and integrations one consistent organization profile for product surfaces, directories, and connected systems.',\n lifecycleRole: 'The profile is created with its organization, evolves through company and brand changes, and is removed with the owning organization.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationProfileSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationProfileResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ORGANIZATION_PROFILES',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationProfile_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationProfilesMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Stable identifier of the organization-profile record.',\n whyItMatters: 'Identifies this profile document independently from the organization id used to address the route.',\n }),\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization this public/directory profile describes.',\n whyItMatters: 'Ties branding and company facts to exactly one tenant so directory cards and connector metadata resolve per organization and cannot surface another tenant’s profile.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n displayName: schemaShape.displayName.stringSpec({ meaning: 'Customer-facing name when different from the canonical org `name`.' }),\n domain: schemaShape.domain.stringSpec({ meaning: 'Organization-owned internet domain used as profile and directory metadata; it is not an authentication-domain verification claim.' }),\n phone: schemaShape.phone.stringSpec({ meaning: 'Organization contact telephone number as entered by an authorized profile editor.' }),\n website: schemaShape.website.stringSpec({ meaning: 'Primary marketing or product URL for the tenant.' }),\n description: schemaShape.description.stringSpec({ meaning: 'Short organization description for about panels, directories, and connected systems.' }),\n industry: schemaShape.industry.enumSpec({\n meaning: 'Business sector classification for the tenant, used in directory facets and segmentation.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationIndustry',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationIndustry.TECHNOLOGY]: { meaning: 'Technology / software.' },\n [OrganizationIndustry.FINANCE]: { meaning: 'Finance, banking, or insurance.' },\n [OrganizationIndustry.HEALTHCARE]: { meaning: 'Healthcare and life sciences.' },\n [OrganizationIndustry.EDUCATION]: { meaning: 'Education and academia.' },\n [OrganizationIndustry.RETAIL]: { meaning: 'Retail and commerce.' },\n [OrganizationIndustry.MANUFACTURING]: { meaning: 'Manufacturing and industry.' },\n [OrganizationIndustry.CONSULTING]: { meaning: 'Professional services and consulting.' },\n [OrganizationIndustry.MEDIA]: { meaning: 'Media, entertainment, and publishing.' },\n [OrganizationIndustry.GOVERNMENT]: { meaning: 'Government and public sector.' },\n [OrganizationIndustry.NONPROFIT]: { meaning: 'Nonprofit and NGO.' },\n [OrganizationIndustry.OTHER]: { meaning: 'Any sector not covered by the named categories.' },\n },\n }),\n size: schemaShape.size.enumSpec({\n meaning: 'Employee-count band for the tenant, used for directory facets and plan/segment heuristics.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationSize',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationSize.STARTUP]: { meaning: 'Startup, roughly 1–10 employees.' },\n [OrganizationSize.SMALL]: { meaning: 'Small, roughly 11–50 employees.' },\n [OrganizationSize.MEDIUM]: { meaning: 'Medium, roughly 51–200 employees.' },\n [OrganizationSize.LARGE]: { meaning: 'Large, roughly 201–1000 employees.' },\n [OrganizationSize.ENTERPRISE]: { meaning: 'Enterprise, 1000+ employees.' },\n },\n }),\n founded: schemaShape.founded.dateSpec({ meaning: 'Date associated with the organization’s founding for profile and directory presentation.' }),\n address: schemaShape.address.objectSpec({ meaning: 'Primary organization address, including ISO two-letter country code and postal information.' }),\n timezone: schemaShape.timezone.stringSpec({ meaning: 'Default IANA timezone used when organization-facing surfaces need a local time context.' }),\n branding: schemaShape.branding.objectSpec({ meaning: 'Organization-specific logo, favicon, colors, and custom-domain overrides. Omitted values fall back to application branding.' }),\n socialLinks: schemaShape.socialLinks.objectSpec({ meaning: 'Optional public profile URLs for the organization’s supported social and developer channels.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When this profile row was created by the organization lifecycle.' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When any stored profile field was last changed.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read the addressed organization’s complete profile.',\n outcome: 'The caller receives company facts, location, branding, social links, and the current resource version.',\n whenToUse: 'Use this representation when synchronizing a complete organization profile or rendering a full about/settings surface.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The profile was found and its directory/branding metadata is returned for the addressed organization.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record has been provisioned for the addressed organization in the caller’s scope.' },\n ],\n examples: [{\n title: 'Read the organization profile',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n purpose: 'Read the organization profile with its configured relationship context.',\n outcome: 'The complete profile is returned with the related organization identifier when that relationship is available.',\n examples: [{\n title: 'Read the profile with organization context',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_CONTEXT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n purpose: 'Read the compact organization-profile identity.',\n outcome: 'Only the profile id, organization id, display name, and current resource version are returned.',\n examples: [{\n title: 'Read the compact organization profile',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_SUMMARY_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n idempotent: true,\n },\n [Op.UPDATE]: {\n purpose: 'Update one or more editable organization-profile fields.',\n outcome: 'The stored profile is changed and the complete updated representation, including its new resource version, is returned.',\n whenToUse: 'Use this operation for company, classification, location, social-link, or combined profile changes. Use the branding operation when the request changes only the brand kit.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The profile fields were patched and the updated profile is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited profile fields fail schema validation (e.g. a malformed `website` URL).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not hold the organization-manager authority required by this route.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record exists for the addressed organization to update.' },\n ],\n examples: [{\n title: 'Update organization company and directory details',\n request: {\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n ...ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE,\n },\n response: ORGANIZATION_PROFILE_UPDATE_RESPONSE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the organization profile row when its owning organization is deleted (composition `onParentDelete` cascade).',\n outcome: 'The eager-seeded singleton profile row is removed together with the organization — the composition part does not outlive its whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization profile row was deleted as part of the owning organization’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (ORG_ADMIN) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.\n idempotent: true,\n },\n [OrganizationProfile_Operations.UPDATE_BRANDING]: {\n operationId: OrganizationProfile_Operations.UPDATE_BRANDING,\n purpose: 'Replace the organization-specific logo, favicon, colors, and custom-domain overrides as one brand kit.',\n outcome: 'The brand kit is validated, stored, and returned inside the complete updated profile with its new resource version.',\n whenToUse: 'Use this operation for a branding-only change that should not carry unrelated company-profile fields.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The brand kit (colors, logo, favicon) was applied and the updated profile is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The branding bundle fails validation (e.g. an invalid color token or an unsupported logo/favicon asset reference).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not hold the organization-admin authority required by this route.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record exists for the addressed organization to apply branding to.' },\n ],\n examples: [{\n title: 'Replace the organization brand kit',\n request: {\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n ...ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE,\n },\n response: ORGANIZATION_PROFILE_BRANDING_RESPONSE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Each organization owns one profile. The framework creates it with the organization and removes it when the organization is deleted.',\n 'Organization-specific branding fields are overrides; when an override is absent, clients should use the application brand.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n views: {\n [Op.READ]: { purpose: 'Settings read for company/about panels.', whenToUse: 'Org profile in admin and member-visible about pages when exposed.' },\n [Op.UPDATE]: { purpose: 'General field edits in multi-section form.', whenToUse: 'IT and marketing co-own updates through governance roles.' },\n [OrganizationProfile_Operations.UPDATE_BRANDING]: { purpose: 'Branding wizard path separate from long-form text edits.', whenToUse: 'White-label and theme management UX.' },\n },\n }),\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-members.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-unit-members.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,OAAO,EACL,cAAc,EACd,qBAAqB,IAAI,EAAE,EAI5B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"organization-unit-members.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-unit-members.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,OAAO,EACL,cAAc,EACd,qBAAqB,IAAI,EAAE,EAI5B,MAAM,uBAAuB,CAAC;AAI/B,eAAO,MAAM,4CAA4C;;;;;;;;kCA6SxD,CAAC"}
|
package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js
CHANGED
|
@@ -13,11 +13,13 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
|
13
13
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
|
|
14
14
|
import { CORE_ORG_ROLES, CoreResourceOperation as Op, OrganizationUnitMemberSchema, ResourcePrimaryScope, organizationUnitMemberResourceConfiguration_InitializationFactory as organizationUnitMembersFactory, } from '@wildo-ai/saas-models';
|
|
15
15
|
import { HttpResponseStatusCode, resourceSpecification } from '../../../_core/index.js';
|
|
16
|
+
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
16
17
|
export const organizationUnitMembersResourceSpecification = resourceSpecification(organizationUnitMembersFactory, OrganizationUnitMemberSchema, ({ schemaShape }) => ({
|
|
17
18
|
purpose: 'Junction between an organization MEMBERSHIP and an organization UNIT: "this member holds this role inside this unit of the org chart".',
|
|
18
19
|
businessRole: 'The per-unit half of a member’s authority, complementing the organization-wide `roles` array on the membership row. Replaced an embedded array on `ORGANIZATION_MEMBERS` so unit assignment became queryable on every persistence adapter, cascade-governed, and unique per (member, unit).',
|
|
19
20
|
lifecycleRole: 'Created when an org admin assigns a member to a unit; the role may be re-graded in place; deleted on revocation, and cascade-deleted with the owning membership or the tenant.',
|
|
20
21
|
audience: LabelAudience.ADMIN,
|
|
22
|
+
subDomain: EngineResourceSubDomain.ORGANIZATIONS,
|
|
21
23
|
codeHandling: {
|
|
22
24
|
mainSchema: {
|
|
23
25
|
packageName: '@wildo-ai/saas-models',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-unit-members.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-unit-members.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,cAAc,EACd,qBAAqB,IAAI,EAAE,EAC3B,4BAA4B,EAC5B,oBAAoB,EACpB,iEAAiE,I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AAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,0CAA0C,EAAE;gBAChG,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uEAAuE,EAAE;aAC9H;YACD,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,+NAA+N;QAC/N,kBAAkB,cAAc,CAAC,SAAS,0IAA0I,cAAc,CAAC,SAAS,yBAAyB,cAAc,CAAC,WAAW,OAAO,cAAc,CAAC,UAAU,6BAA6B,cAAc,CAAC,SAAS,eAAe,cAAc,CAAC,UAAU,4EAA4E;QACxc,+YAA+Y;QAC/Y,2NAA2N;QAC3N,qOAAqO;QACrO,uLAAuL;QACvL,kWAAkW;QAClW,uyBAAuyB;KACxyB;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `organizationUnitMembers` — Wildo SaaS engine specification (backend-managed, org-scoped).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/organizations/organization-unit-members.shared.schemas.ts → `OrganizationUnitMemberSchema`\n * - Factory: engine/saas-models/src/organizations/organization-unit-members.shared.resources-config.schemas.ts\n * → `organizationUnitMemberResourceConfiguration_InitializationFactory`\n * - Custom operations: none\n * - UI presets: none (no engine `resourceUIBehavior` preset; unit assignment is administered through\n * the org-structure admin surface, which consumes this resource's API directly).\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CORE_ORG_ROLES,\n CoreResourceOperation as Op,\n OrganizationUnitMemberSchema,\n ResourcePrimaryScope,\n organizationUnitMemberResourceConfiguration_InitializationFactory as organizationUnitMembersFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\n\nexport const organizationUnitMembersResourceSpecification = resourceSpecification(\n organizationUnitMembersFactory,\n OrganizationUnitMemberSchema,\n ({ schemaShape }) => ({\n purpose: 'Junction between an organization MEMBERSHIP and an organization UNIT: \"this member holds this role inside this unit of the org chart\".',\n businessRole: 'The per-unit half of a member’s authority, complementing the organization-wide `roles` array on the membership row. Replaced an embedded array on `ORGANIZATION_MEMBERS` so unit assignment became queryable on every persistence adapter, cascade-governed, and unique per (member, unit).',\n lifecycleRole: 'Created when an org admin assigns a member to a unit; the role may be re-graded in place; deleted on revocation, and cascade-deleted with the owning membership or the tenant.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitMemberSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationUnitMemberResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ORGANIZATION_UNIT_MEMBERS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n // No `customEnum`: the factory is typed `Record<string, never>` for custom operations — this\n // resource exposes the five core verbs and nothing else.\n },\n notes: [\n // DF-1 evidence. Recorded so a later reader can tell a VERIFIED absence from an omission and\n // does not \"helpfully\" add an assignment-notification block the runtime never emits.\n 'Runtime has no `userNotifications` / `m2mNotifications` on any operation — do not add communications.* (DF-1). Unit assignment is evidenced through the audit trail (`organization_unit_member_role_changed` / `organization_unit_member_removed`), not through user-facing messaging.',\n ],\n },\n fields: {\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The tenant this assignment belongs to.',\n whyItMatters: 'Denormalized from the parent membership so tenant scoping and the contextual filter resolve on this row alone — an authorization-adjacent read must never depend on a join to establish which tenant a row belongs to.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n organizationUnitId: schemaShape.organizationUnitId.foreignKeySpec({\n meaning: 'The org-chart node this assignment targets.',\n whyItMatters: 'Half of the business key, and the field a future unit-narrowed authorization read would filter on. Immutable: an edit may change what the assignment GRANTS, never what it is ABOUT.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n organizationMemberId: schemaShape.organizationMemberId.foreignKeySpec({\n meaning: 'The organization MEMBERSHIP being assigned — deliberately the membership, not the user.',\n whyItMatters: 'A unit assignment presupposes membership of the owning organization, so the membership row is the semantic parent: it carries the tenant binding, and its deletion is exactly when the assignment stops meaning anything (hence the cascade). Pointing at `userId` instead would model a user as assignable to a unit of an organization they do not belong to.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n // `role` carries no field spec: it is `OrgRolesSchema`, a `z.union` of the core org-role enum\n // and an open app-defined string, and the spec decorators live on concrete Zod types\n // (`z.string()`, `z.enum()`, `z.array()`) rather than on a union. The members resource hits the\n // same limit and describes its element through `arraySpec` metadata for the same reason. The\n // field's meaning, its ceiling governance and its immutability are documented in\n // `businessConstraints` below instead of being silently dropped.\n },\n operations: {\n [Op.CREATE]: {\n purpose: 'Assign a member to an organization unit with a role.',\n outcome: 'The member holds the given role inside that unit, and an `organization_unit_member_role_changed` audit event records the grant against an empty baseline. The event is an AUTHORIZATION-category record rather than org-chart bookkeeping because the assigned role is live authority: it is emitted into the member’s `initiatorRoles` carrying an `organizationUnitId` discriminator that narrows it to this one unit.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The assignment was created and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The payload fails schema validation, omits `organizationUnitId`, or names a unit that does not belong to the caller’s organization.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin, OR the requested role exceeds the caller’s own organization-wide ceiling (a principal cannot grant authority it does not hold).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The member already holds an assignment in that unit — the (membership, unit) pair is the business key.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Assign a member as a manager of one delivery unit',\n request: {\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n response: {\n _id: 'unit_member_01HX2…',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.READ]: {\n purpose: 'Fetch one unit assignment.',\n outcome: 'The assignment row is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignment is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a member of the organization.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id in the caller’s organization.' },\n ],\n idempotent: true,\n variants: {\n default: {\n examples: [\n {\n title: 'Read a delivery-unit manager assignment',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n context: {\n examples: [\n {\n title: 'Read a unit assignment with organization context',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n organization: { _id: 'org_acme' },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n summary: {\n examples: [\n {\n title: 'Read the compact unit-assignment summary',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List unit assignments, filterable by unit, membership, or role.',\n outcome: 'Who sits where in the org chart — the input to org-structure admin screens.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignments visible in the caller’s organization are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a member of the organization.' },\n ],\n idempotent: true,\n variants: {\n default: {\n examples: [\n {\n title: 'List delivery-unit role assignments',\n response: {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n context: {\n examples: [\n {\n title: 'List unit assignments with organization context',\n response: {\n data: [\n {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n organization: { _id: 'org_acme' },\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n summary: {\n examples: [\n {\n title: 'List compact unit-assignment summaries',\n response: {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Re-grade an existing assignment.',\n outcome: 'The member holds a different role inside the same unit, and an `organization_unit_member_role_changed` audit event records both the previous and the new role. Re-stating the role the assignment already carries changes no authority and emits nothing.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignment was updated and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The payload fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin, OR the requested role exceeds the caller’s own organization-wide ceiling.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id in the caller’s organization.' },\n ],\n idempotent: true,\n examples: [\n {\n title: 'Re-grade an existing unit assignment',\n request: { role: CORE_ORG_ROLES.ORG_MEMBER },\n response: {\n _id: 'unit_member_01HX2…',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MEMBER,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n [Op.DELETE]: {\n purpose: 'Revoke a member’s assignment to a unit.',\n outcome: 'The assignment row is removed; the member keeps their organization-wide roles. An `organization_unit_member_removed` audit event records the revocation, carrying the role that was removed — the row is hard-deleted, so nothing else in the system can afterwards answer what authority was lost. It is classified as an AUTHORIZATION event rather than org-chart record-keeping because an assignment row exists only to confer a role, so deleting it IS the revocation; the trail would otherwise show unit privileges granted and never removed. Cascade removals — deleting the parent membership, or the whole organization — do not emit this event: those cascades run through the raw repository, below the service tier, and the auditable act there is losing the membership or the tenant. Deleting the UNIT is not one of those paths: it is refused while any assignment remains, so dismantling a unit necessarily goes through this operation and is fully evidenced.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The assignment was removed; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id (or it was already removed).' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n '`role` is the role this member holds WITHIN this unit — a core org role token (`CORE_ORG_ROLES`) or an app-defined custom role string, the same open vocabulary as the organization-wide `roles` array on the membership row.',\n `Every WRITE is ${CORE_ORG_ROLES.ORG_ADMIN}-gated and additionally bounded by the role-ceiling gate: a principal may only grant a role its OWN organization-wide role confers. An ${CORE_ORG_ROLES.ORG_ADMIN} can therefore assign ${CORE_ORG_ROLES.ORG_MANAGER} or ${CORE_ORG_ROLES.ORG_MEMBER} inside a unit, but never ${CORE_ORG_ROLES.ORG_OWNER}. Reads are ${CORE_ORG_ROLES.ORG_MEMBER}-gated — who sits where is ordinary directory information inside a tenant.`,\n 'The ceiling derives from ORGANIZATION-WIDE grants only. That is load-bearing: if it counted unit grants, a member who is admin of one unit could grant themselves that role in every other unit and union up to organization-wide admin. This resource is also permanently barred from unit narrowing for the same reason — a resource that ISSUES authority must not be governed by the authority it issues.',\n 'CREATE validates that the target unit belongs to the caller’s organization. `organizationUnitId` is a caller-supplied FK, so without that check an org admin could bind their own member into another tenant’s org chart.',\n '`role` is the only mutable field; `organizationUnitId` and `organizationMemberId` are immutable. An edit may change what an assignment GRANTS, never what it is ABOUT — which keeps the business key the whole identity of the row.',\n 'The (membership, unit) business key makes \"one role per member per unit\" a persisted invariant. The embedded array this resource replaced admitted duplicates with no defined winner.',\n 'Deleting the owning membership or the organization cascades these rows away, so an assignment cannot outlive the membership that justified it. Deleting a UNIT does NOT cascade: that delete is refused while assignments remain, so an operator decides where the affected people belong rather than having roles silently dropped behind a single-node delete.',\n '`role` IS an authorization axis as of 2026-08-01. Each assignment is emitted into the caller’s `initiatorRoles` as a NARROWED grant carrying its `organizationUnitId`, which every organization-wide consumer partitions out. On a resource that opted into unit narrowing, such a grant admits the member at the operation gate when no organization-wide role of theirs satisfies it, and then confines their reads and writes to that unit — plus its descendants where the unit declares downward inheritance. On every other resource the grant confers nothing at all, which is what stops one unit’s role from becoming tenant-wide authority. Governing these writes BEFORE the wiring landed was deliberate: it meant no above-ceiling role could be pre-planted and then silently become live on the day narrowing shipped.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"organization-unit-members.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-unit-members.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,cAAc,EACd,qBAAqB,IAAI,EAAE,EAC3B,4BAA4B,EAC5B,oBAAoB,EACpB,iEAAiE,IAAI,8BAA8B,GACpG,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;A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IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uEAAuE,EAAE;aAC9H;YACD,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,+NAA+N;QAC/N,kBAAkB,cAAc,CAAC,SAAS,0IAA0I,cAAc,CAAC,SAAS,yBAAyB,cAAc,CAAC,WAAW,OAAO,cAAc,CAAC,UAAU,6BAA6B,cAAc,CAAC,SAAS,eAAe,cAAc,CAAC,UAAU,4EAA4E;QACxc,+YAA+Y;QAC/Y,2NAA2N;QAC3N,qOAAqO;QACrO,uLAAuL;QACvL,kWAAkW;QAClW,uyBAAuyB;KACxyB;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `organizationUnitMembers` — Wildo SaaS engine specification (backend-managed, org-scoped).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/organizations/organization-unit-members.shared.schemas.ts → `OrganizationUnitMemberSchema`\n * - Factory: engine/saas-models/src/organizations/organization-unit-members.shared.resources-config.schemas.ts\n * → `organizationUnitMemberResourceConfiguration_InitializationFactory`\n * - Custom operations: none\n * - UI presets: none (no engine `resourceUIBehavior` preset; unit assignment is administered through\n * the org-structure admin surface, which consumes this resource's API directly).\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CORE_ORG_ROLES,\n CoreResourceOperation as Op,\n OrganizationUnitMemberSchema,\n ResourcePrimaryScope,\n organizationUnitMemberResourceConfiguration_InitializationFactory as organizationUnitMembersFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nexport const organizationUnitMembersResourceSpecification = resourceSpecification(\n organizationUnitMembersFactory,\n OrganizationUnitMemberSchema,\n ({ schemaShape }) => ({\n purpose: 'Junction between an organization MEMBERSHIP and an organization UNIT: \"this member holds this role inside this unit of the org chart\".',\n businessRole: 'The per-unit half of a member’s authority, complementing the organization-wide `roles` array on the membership row. Replaced an embedded array on `ORGANIZATION_MEMBERS` so unit assignment became queryable on every persistence adapter, cascade-governed, and unique per (member, unit).',\n lifecycleRole: 'Created when an org admin assigns a member to a unit; the role may be re-graded in place; deleted on revocation, and cascade-deleted with the owning membership or the tenant.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitMemberSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationUnitMemberResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ORGANIZATION_UNIT_MEMBERS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n // No `customEnum`: the factory is typed `Record<string, never>` for custom operations — this\n // resource exposes the five core verbs and nothing else.\n },\n notes: [\n // DF-1 evidence. Recorded so a later reader can tell a VERIFIED absence from an omission and\n // does not \"helpfully\" add an assignment-notification block the runtime never emits.\n 'Runtime has no `userNotifications` / `m2mNotifications` on any operation — do not add communications.* (DF-1). Unit assignment is evidenced through the audit trail (`organization_unit_member_role_changed` / `organization_unit_member_removed`), not through user-facing messaging.',\n ],\n },\n fields: {\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The tenant this assignment belongs to.',\n whyItMatters: 'Denormalized from the parent membership so tenant scoping and the contextual filter resolve on this row alone — an authorization-adjacent read must never depend on a join to establish which tenant a row belongs to.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n organizationUnitId: schemaShape.organizationUnitId.foreignKeySpec({\n meaning: 'The org-chart node this assignment targets.',\n whyItMatters: 'Half of the business key, and the field a future unit-narrowed authorization read would filter on. Immutable: an edit may change what the assignment GRANTS, never what it is ABOUT.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n organizationMemberId: schemaShape.organizationMemberId.foreignKeySpec({\n meaning: 'The organization MEMBERSHIP being assigned — deliberately the membership, not the user.',\n whyItMatters: 'A unit assignment presupposes membership of the owning organization, so the membership row is the semantic parent: it carries the tenant binding, and its deletion is exactly when the assignment stops meaning anything (hence the cascade). Pointing at `userId` instead would model a user as assignable to a unit of an organization they do not belong to.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n // `role` carries no field spec: it is `OrgRolesSchema`, a `z.union` of the core org-role enum\n // and an open app-defined string, and the spec decorators live on concrete Zod types\n // (`z.string()`, `z.enum()`, `z.array()`) rather than on a union. The members resource hits the\n // same limit and describes its element through `arraySpec` metadata for the same reason. The\n // field's meaning, its ceiling governance and its immutability are documented in\n // `businessConstraints` below instead of being silently dropped.\n },\n operations: {\n [Op.CREATE]: {\n purpose: 'Assign a member to an organization unit with a role.',\n outcome: 'The member holds the given role inside that unit, and an `organization_unit_member_role_changed` audit event records the grant against an empty baseline. The event is an AUTHORIZATION-category record rather than org-chart bookkeeping because the assigned role is live authority: it is emitted into the member’s `initiatorRoles` carrying an `organizationUnitId` discriminator that narrows it to this one unit.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The assignment was created and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The payload fails schema validation, omits `organizationUnitId`, or names a unit that does not belong to the caller’s organization.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin, OR the requested role exceeds the caller’s own organization-wide ceiling (a principal cannot grant authority it does not hold).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The member already holds an assignment in that unit — the (membership, unit) pair is the business key.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Assign a member as a manager of one delivery unit',\n request: {\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n response: {\n _id: 'unit_member_01HX2…',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.READ]: {\n purpose: 'Fetch one unit assignment.',\n outcome: 'The assignment row is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignment is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a member of the organization.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id in the caller’s organization.' },\n ],\n idempotent: true,\n variants: {\n default: {\n examples: [\n {\n title: 'Read a delivery-unit manager assignment',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n context: {\n examples: [\n {\n title: 'Read a unit assignment with organization context',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n organization: { _id: 'org_acme' },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n summary: {\n examples: [\n {\n title: 'Read the compact unit-assignment summary',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List unit assignments, filterable by unit, membership, or role.',\n outcome: 'Who sits where in the org chart — the input to org-structure admin screens.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignments visible in the caller’s organization are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a member of the organization.' },\n ],\n idempotent: true,\n variants: {\n default: {\n examples: [\n {\n title: 'List delivery-unit role assignments',\n response: {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n context: {\n examples: [\n {\n title: 'List unit assignments with organization context',\n response: {\n data: [\n {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n organization: { _id: 'org_acme' },\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n summary: {\n examples: [\n {\n title: 'List compact unit-assignment summaries',\n response: {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Re-grade an existing assignment.',\n outcome: 'The member holds a different role inside the same unit, and an `organization_unit_member_role_changed` audit event records both the previous and the new role. Re-stating the role the assignment already carries changes no authority and emits nothing.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignment was updated and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The payload fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin, OR the requested role exceeds the caller’s own organization-wide ceiling.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id in the caller’s organization.' },\n ],\n idempotent: true,\n examples: [\n {\n title: 'Re-grade an existing unit assignment',\n request: { role: CORE_ORG_ROLES.ORG_MEMBER },\n response: {\n _id: 'unit_member_01HX2…',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MEMBER,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n [Op.DELETE]: {\n purpose: 'Revoke a member’s assignment to a unit.',\n outcome: 'The assignment row is removed; the member keeps their organization-wide roles. An `organization_unit_member_removed` audit event records the revocation, carrying the role that was removed — the row is hard-deleted, so nothing else in the system can afterwards answer what authority was lost. It is classified as an AUTHORIZATION event rather than org-chart record-keeping because an assignment row exists only to confer a role, so deleting it IS the revocation; the trail would otherwise show unit privileges granted and never removed. Cascade removals — deleting the parent membership, or the whole organization — do not emit this event: those cascades run through the raw repository, below the service tier, and the auditable act there is losing the membership or the tenant. Deleting the UNIT is not one of those paths: it is refused while any assignment remains, so dismantling a unit necessarily goes through this operation and is fully evidenced.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The assignment was removed; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id (or it was already removed).' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n '`role` is the role this member holds WITHIN this unit — a core org role token (`CORE_ORG_ROLES`) or an app-defined custom role string, the same open vocabulary as the organization-wide `roles` array on the membership row.',\n `Every WRITE is ${CORE_ORG_ROLES.ORG_ADMIN}-gated and additionally bounded by the role-ceiling gate: a principal may only grant a role its OWN organization-wide role confers. An ${CORE_ORG_ROLES.ORG_ADMIN} can therefore assign ${CORE_ORG_ROLES.ORG_MANAGER} or ${CORE_ORG_ROLES.ORG_MEMBER} inside a unit, but never ${CORE_ORG_ROLES.ORG_OWNER}. Reads are ${CORE_ORG_ROLES.ORG_MEMBER}-gated — who sits where is ordinary directory information inside a tenant.`,\n 'The ceiling derives from ORGANIZATION-WIDE grants only. That is load-bearing: if it counted unit grants, a member who is admin of one unit could grant themselves that role in every other unit and union up to organization-wide admin. This resource is also permanently barred from unit narrowing for the same reason — a resource that ISSUES authority must not be governed by the authority it issues.',\n 'CREATE validates that the target unit belongs to the caller’s organization. `organizationUnitId` is a caller-supplied FK, so without that check an org admin could bind their own member into another tenant’s org chart.',\n '`role` is the only mutable field; `organizationUnitId` and `organizationMemberId` are immutable. An edit may change what an assignment GRANTS, never what it is ABOUT — which keeps the business key the whole identity of the row.',\n 'The (membership, unit) business key makes \"one role per member per unit\" a persisted invariant. The embedded array this resource replaced admitted duplicates with no defined winner.',\n 'Deleting the owning membership or the organization cascades these rows away, so an assignment cannot outlive the membership that justified it. Deleting a UNIT does NOT cascade: that delete is refused while assignments remain, so an operator decides where the affected people belong rather than having roles silently dropped behind a single-node delete.',\n '`role` IS an authorization axis as of 2026-08-01. Each assignment is emitted into the caller’s `initiatorRoles` as a NARROWED grant carrying its `organizationUnitId`, which every organization-wide consumer partitions out. On a resource that opted into unit narrowing, such a grant admits the member at the operation gate when no organization-wide role of theirs satisfies it, and then confines their reads and writes to that unit — plus its descendants where the unit declares downward inheritance. On every other resource the grant confers nothing at all, which is what stops one unit’s role from becoming tenant-wide authority. Governing these writes BEFORE the wiring landed was deliberate: it meant no above-ceiling role could be pre-planted and then silently become live on the day narrowing shipped.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
package/dist/esm/engine/organizations/resources/organization-units.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-units.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-units.resource.specification.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAK3B,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,0CAA0C,EAG3C,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"organization-units.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-units.resource.specification.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAK3B,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,0CAA0C,EAG3C,MAAM,uBAAuB,CAAC;AAiD/B,eAAO,MAAM,sCAAsC;;;;;;;;;;;;kCAmZlD,CAAC"}
|
package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js
CHANGED
|
@@ -3,6 +3,7 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
|
3
3
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
|
|
4
4
|
import { CoreResourceOperation as Op, ErrorCustomMessageReference, ErrorSeverity, ErrorType, OrganizationUnitSchema, OrganizationUnitStatus, OrganizationUnitType, OrganizationUnit_Operations, OrganizationUnit_PermissionInheritanceType, ResourcePrimaryScope, organizationUnitResourceConfiguration_InitializationFactory as organizationUnitsFactory, } from '@wildo-ai/saas-models';
|
|
5
5
|
import { HttpResponseStatusCode, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
|
|
6
|
+
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
6
7
|
const organizationUnitsResourceUIBehavior = organizationUnitsUIBehaviorSource;
|
|
7
8
|
const ORGANIZATION_UNIT_EXAMPLE = {
|
|
8
9
|
_id: 'organization_unit_emea_sales',
|
|
@@ -38,6 +39,7 @@ export const organizationUnitsResourceSpecification = resourceSpecificationFromF
|
|
|
38
39
|
businessRole: 'Organization units support org charts, unit-scoped membership, and downward permission inheritance in larger organizations.',
|
|
39
40
|
lifecycleRole: 'Units can be created, renamed, moved, archived, restored, and deleted when they no longer have child units or member assignments.',
|
|
40
41
|
audience: LabelAudience.ADMIN,
|
|
42
|
+
subDomain: EngineResourceSubDomain.ORGANIZATIONS,
|
|
41
43
|
codeHandling: {
|
|
42
44
|
mainSchema: {
|
|
43
45
|
packageName: '@wildo-ai/saas-models',
|
package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-units.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-units.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,IAAI,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,2BAA2B,EAC3B,aAAa,EACb,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,0CAA0C,EAC1C,oBAAoB,EACpB,2DAA2D,IAAI,wBAAwB,GACxF,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AAOrC,MAAM,mCAAmC,GAAG,iCAAiF,CAAC;AAE9H,MAAM,yBAAyB,GAAG;IAChC,GAAG,EAAE,8BAA8B;IACnC,cAAc,EAAE,2BAA2B;IAC3C,YAAY,EAAE,yBAAyB;IACvC,MAAM,EAAE,sBAAsB,CAAC,MAAM;IACrC,eAAe,EAAE,0CAA0C,CAAC,YAAY;IACxE,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,oBAAoB,CAAC,UAAU;IACrC,SAAS,EAAE,0BAA0B;IACrC,SAAS,EAAE,0BAA0B;IACrC,QAAQ,EAAE,CAAC;CACH,CAAC;AAEX,MAAM,iCAAiC,GAAG;IACxC,GAAG,EAAE,yBAAyB,CAAC,GAAG;IAClC,cAAc,EAAE,yBAAyB,CAAC,cAAc;IACxD,MAAM,EAAE,yBAAyB,CAAC,MAAM;IACxC,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACp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E,uCAAuC,EAAE,SAAS,EAAE,yCAAyC,EAAE;QAC9I,CAAC,2BAA2B,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,mDAAmD,EAAE,SAAS,EAAE,kCAAkC,EAAE;QACtJ,CAAC,2BAA2B,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,qDAAqD,EAAE,SAAS,EAAE,kCAAkC,EAAE;KACzJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import { organizationUnitsMainResourceUIBehavior as organizationUnitsUIBehaviorSource } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ErrorCustomMessageReference,\n ErrorSeverity,\n ErrorType,\n OrganizationUnitSchema,\n OrganizationUnitStatus,\n OrganizationUnitType,\n OrganizationUnit_Operations,\n OrganizationUnit_PermissionInheritanceType,\n ResourcePrimaryScope,\n organizationUnitResourceConfiguration_InitializationFactory as organizationUnitsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\n\ntype Cfg = ReturnType<typeof organizationUnitsFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst organizationUnitsResourceUIBehavior = organizationUnitsUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst ORGANIZATION_UNIT_EXAMPLE = {\n _id: 'organization_unit_emea_sales',\n organizationId: 'organization_01HX2EXAMPLE',\n parentUnitId: 'organization_unit_sales',\n status: OrganizationUnitStatus.ACTIVE,\n inheritanceType: OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN,\n path: '/organization_unit_sales/',\n name: 'EMEA Sales',\n code: 'emea-sales',\n type: OrganizationUnitType.DEPARTMENT,\n createdAt: '2026-07-03T09:15:00.000Z',\n updatedAt: '2026-08-18T08:00:00.000Z',\n _version: 3,\n} as const;\n\nconst ORGANIZATION_UNIT_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_UNIT_EXAMPLE._id,\n organizationId: ORGANIZATION_UNIT_EXAMPLE.organizationId,\n status: ORGANIZATION_UNIT_EXAMPLE.status,\n name: ORGANIZATION_UNIT_EXAMPLE.name,\n type: ORGANIZATION_UNIT_EXAMPLE.type,\n _version: ORGANIZATION_UNIT_EXAMPLE._version,\n} as const;\n\nfunction organizationUnitsPage<T>(data: readonly T[]) {\n return {\n data,\n pagination: { page: 1, limit: 20, total: data.length, totalPages: data.length === 0 ? 0 : 1 },\n };\n}\n\nconst ORGANIZATION_UNITS_PAGE_REQUEST = { page: 1, limit: 20, sort: 'createdAt:desc' } as const;\n\nexport const organizationUnitsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(organizationUnitsResourceUIBehavior),\n resourceSpecification(\n organizationUnitsFactory,\n OrganizationUnitSchema,\n ({ schemaShape }) => ({\n purpose: 'Represents a department, team, region, project group, or other node in an organization’s hierarchy.',\n businessRole: 'Organization units support org charts, unit-scoped membership, and downward permission inheritance in larger organizations.',\n lifecycleRole: 'Units can be created, renamed, moved, archived, restored, and deleted when they no longer have child units or member assignments.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationUnitResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ORGANIZATION_UNITS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnit_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationUnitsMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n parentUnitId: schemaShape.parentUnitId.foreignKeySpec({\n meaning: 'The parent org-unit this node hangs under (absent/root when the unit is a top-level node directly beneath the organization).',\n whyItMatters: 'Defines the tree edge that drives org-chart rendering, path materialization, and downward-only permission inheritance through the hierarchy.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n name: schemaShape.name.stringSpec({ meaning: 'Unit display name.', importance: FieldSemanticImportance.PRIMARY }),\n code: schemaShape.code.stringSpec({ meaning: 'Short stable code for APIs and HR imports. Optional, and unique among the siblings that carry one — the resource business key is (`organizationId`, `parentUnitId`, `code`).' }),\n type: schemaShape.type.enumSpec({\n meaning: 'Structural classification of the node in the org hierarchy (department, region, team, …).',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnitType.COMPANY]: { meaning: 'Top-level company entity within the tenant.' },\n [OrganizationUnitType.DIVISION]: { meaning: 'A division grouping multiple departments.' },\n [OrganizationUnitType.DEPARTMENT]: { meaning: 'A department within a division or company.' },\n [OrganizationUnitType.TEAM]: { meaning: 'A team within a department.' },\n [OrganizationUnitType.SUBTEAM]: { meaning: 'A sub-team nested under a team.' },\n [OrganizationUnitType.PROJECT_GROUP]: { meaning: 'A cross-cutting project or working group.' },\n [OrganizationUnitType.GEOGRAPHIC]: { meaning: 'A geography/region-based grouping.' },\n [OrganizationUnitType.FUNCTIONAL]: { meaning: 'A function-based grouping (e.g. a shared discipline).' },\n [OrganizationUnitType.CUSTOM]: { meaning: 'A tenant-defined unit kind that does not fit the named categories.' },\n },\n }),\n inheritanceType: schemaShape.inheritanceType.enumSpec({\n meaning: 'Controls whether a unit-scoped role also applies to descendant units. Permission inheritance is downward-only; a role on a child never grants authority over its parent or ancestors.',\n whyItMatters: 'With `inherit_down`, one assignment can cover an entire branch. With `no_inheritance`, the assignment applies only to this exact unit.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnit_PermissionInheritanceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN]: { meaning: 'A role held at this unit also applies to its descendant units.' },\n [OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE]: { meaning: 'No propagation; the node is isolated for permission purposes.' },\n },\n }),\n path: schemaShape.path.stringSpec({\n meaning: 'Server-maintained ancestor path for this node, excluding the node itself (for example `/division-id/department-id/`).',\n whyItMatters: 'Lets clients identify the node’s hierarchy and lets authorization apply inherited unit access across a branch. Change parents through MOVE; clients do not write this field directly.',\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Lifecycle state of the node (archived, suspended, etc.).',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnitStatus.ACTIVE]: { meaning: 'Normal visibility in pickers and policy.' },\n [OrganizationUnitStatus.INACTIVE]: { meaning: 'Retained for history, hidden from most UIs.' },\n [OrganizationUnitStatus.ARCHIVED]: { meaning: 'Soft-closed; restore via RESTORE when applicable.' },\n [OrganizationUnitStatus.SUSPENDED]: { meaning: 'Policy-hold; treat as non-assignable for new work.' },\n },\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Retrieve one organization unit by its route identity.',\n outcome: 'The unit’s hierarchy, classification, lifecycle state, and inheritance policy are returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization unit was found and its node record (name, code, status, hierarchy links) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to read organization units.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization unit exists for the supplied id within the caller’s tenant scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect an active department',\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect a unit with its organization relationship',\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n organization: { _id: ORGANIZATION_UNIT_EXAMPLE.organizationId },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact organization-unit summary',\n response: ORGANIZATION_UNIT_SUMMARY_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'Browse organization units under an organization or a specific parent unit.',\n outcome: 'A page of organization-unit nodes and pagination metadata is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of units under the addressed org or parent node.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to list organization units.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent organization units',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([ORGANIZATION_UNIT_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse units with organization relationship context',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([{\n ...ORGANIZATION_UNIT_EXAMPLE,\n organization: { _id: ORGANIZATION_UNIT_EXAMPLE.organizationId },\n }]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact organization-unit summaries',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([ORGANIZATION_UNIT_SUMMARY_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Search organization units by name or description and narrow the result with supported filters.',\n outcome: 'A page of matching units in the addressed organization or parent branch is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of units matching the name or description query within the tenant.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to search organization units.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Find sales units by name and parent',\n request: {\n q: 'sales',\n name: 'EMEA Sales',\n parentUnitId: ORGANIZATION_UNIT_EXAMPLE.parentUnitId,\n page: 1,\n limit: 20,\n sort: 'name:asc',\n },\n response: organizationUnitsPage([ORGANIZATION_UNIT_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.CREATE]: {\n purpose: 'Create a root organization unit or add a child under an existing parent unit.',\n outcome: 'The new unit is returned with its server-assigned identifier and hierarchy path, ready for unit-scoped membership and access policies.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new unit node was created under the supplied parent and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The unit payload fails schema validation (e.g. missing `name`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to add nodes to the org tree.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent unit does not exist within the caller’s organization.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling unit under the same parent already uses the requested `code`; unit codes must be unique within a parent.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Create a unit under a parent node',\n request: {\n name: 'EMEA Sales',\n code: 'emea-sales',\n parentUnitId: ORGANIZATION_UNIT_EXAMPLE.parentUnitId,\n type: OrganizationUnitType.DEPARTMENT,\n inheritanceType: OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN,\n status: OrganizationUnitStatus.ACTIVE,\n },\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Update a unit’s name, code, type, lifecycle state, or permission-inheritance policy. Use MOVE to change its parent.',\n outcome: 'The updated unit is returned. Changes to inheritance affect subsequent unit-scoped authorization decisions.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was updated and the new node state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to edit org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The requested `code` is already used by a sibling under the same parent. Reparenting is not accepted by UPDATE; use MOVE.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: true,\n examples: [{\n title: 'Rename a unit and isolate its permissions',\n request: {\n name: 'EMEA Revenue',\n code: 'emea-revenue',\n inheritanceType: OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE,\n },\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n name: 'EMEA Revenue',\n code: 'emea-revenue',\n inheritanceType: OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.DELETE]: {\n purpose: 'Remove an empty leaf node from the org tree; refused while the node still has child units or assigned members.',\n outcome: 'The unit row is deleted. A node with dependents is refused, so no subtree is stranded behind a dangling parent link and no member assignment outlives the unit it names.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The unit was deleted; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to remove org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id (or it was already removed).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit still has dependents, and neither is cascade-deleted with it. Either child units remain — re-parent each onto another node with MOVE, or delete the subtree bottom-up — or organization members are still assigned to this unit, in which case the assignments must be removed first. Only a node with no children and no assignments can be deleted.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_HAS_DEPENDENTS },\n ],\n idempotent: true,\n examples: [{\n title: 'Refuse deletion while a child unit remains',\n response: {\n error: {\n type: ErrorType.CONFLICT,\n severity: ErrorSeverity.MEDIUM,\n message: 'Resource conflict detected',\n customMessage: 'Move or delete child units and remove member assignments before deleting this unit.',\n customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_HAS_DEPENDENTS,\n timestamp: '2026-08-18T08:00:00.000Z',\n },\n },\n forStatus: HttpResponseStatusCode.CONFLICT_409,\n }],\n },\n [OrganizationUnit_Operations.MOVE]: {\n operationId: OrganizationUnit_Operations.MOVE,\n purpose: 'Move a unit beneath a different parent, or to the organization root when `newParentUnitId` is omitted.',\n outcome: 'The unit keeps its identity and member assignments. Its ancestor path and every descendant path are updated to reflect the new location.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was re-parented and the updated node (with its new path) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The optional destination-parent identifier or reason has an invalid type or length.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to restructure the org tree.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The unit being moved, or the destination parent unit, does not exist in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The destination would create a cycle — the target parent sits inside the moved unit’s own subtree, or is the unit itself.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_MOVE_CONFLICT },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling under the new parent already uses the moved unit’s `code`. The destination itself is valid; rename the unit or choose another parent.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: false,\n examples: [{\n title: 'Move a department below a new division',\n request: {\n newParentUnitId: 'organization_unit_revenue',\n reason: 'Sales now reports through the global revenue division.',\n },\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n parentUnitId: 'organization_unit_revenue',\n path: '/organization_unit_revenue/',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationUnit_Operations.ARCHIVE]: {\n operationId: OrganizationUnit_Operations.ARCHIVE,\n purpose: 'Archive one organization unit without deleting its history or changing descendant states.',\n outcome: 'The unit becomes ARCHIVED and is hidden from default active-unit pickers. Descendants retain their own states.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit transitioned to `ARCHIVED` and the updated node is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to archive org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit is already `ARCHIVED`, so archiving is not a legal transition from its current state.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Archive a department after a reorganization',\n request: { reason: 'The EMEA Sales department was consolidated into Global Revenue.' },\n response: { ...ORGANIZATION_UNIT_EXAMPLE, status: OrganizationUnitStatus.ARCHIVED },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationUnit_Operations.RESTORE]: {\n operationId: OrganizationUnit_Operations.RESTORE,\n purpose: 'Restore an archived unit after its parent branch is active.',\n outcome: 'The unit becomes ACTIVE and is available again to active-unit pickers and policies.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit transitioned back to `ACTIVE` and the restored node is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to restore archived org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit is not `ARCHIVED` (so there is nothing to restore), or its parent branch is still archived and must be restored first.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Restore an archived department',\n request: { reason: 'The department is active again for the new fiscal year.' },\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'Admin org presets do not add alternate variants for `ORGANIZATION_UNITS` — only main `organizations` presets apply.',\n 'Per-unit DELETE is refused while child units remain, but deleting the whole ORGANIZATION is not: that cascade is enabled and removes every unit of the tenant at once (each unit carries the tenant id, so tree depth is irrelevant). Tearing a tenant down does not require dismantling its org chart leaf-by-leaf.',\n // Scope note, recorded so the narrower guard is not later read as an oversight. An earlier\n // revision of this spec also named \"assigned members\" as a DELETE blocker; it was dropped\n // (2026-07-29) because it cannot be enforced honestly today, not because it stopped mattering.\n 'Unit assignments ARE checked on unit DELETE (since 2026-07-31). They live in the `ORGANIZATION_UNIT_MEMBERS` junction resource, promoted out of the members row precisely so this dependent could be guarded: as an embedded array it was not a registered relationship and not adapter-neutrally queryable (a nested-path filter resolves to null on the SQL adapter, and the list projection dropped the field), so either available check would have passed silently instead of blocking.',\n 'MOVE, ARCHIVE and RESTORE are implemented (2026-07-31). Their request payloads name no schema field, so each custom implementation translates the payload into the real field mutation: MOVE writes `parentUnitId` + `path` and rewrites the materialized `path` of every descendant in one transaction; ARCHIVE/RESTORE write `status`.',\n 'Re-parenting is owned exclusively by MOVE — `parentUnitId` is `.excludeFromUpdate()`. A reparent has a subtree-wide side effect (every descendant path must be rewritten) and must be refused when the destination sits inside the moved node’s own subtree; generic UPDATE performs neither check, so allowing it there would silently produce stale paths or a detached cycle.',\n '`path` is a materialized ANCESTOR chain (`/`, `/R/`, `/R/C/`) — the route TO the node, excluding the node itself. It is written by the CREATE prefix on the same write that inserts the row, because a CREATE custom implementation never receives the new row’s id and a second write would leave a window with no path at all. Descendants of a node are addressed by `path + _id + \"/\"`, which is also the O(1) cycle test MOVE relies on.',\n 'ARCHIVE is node-only: descendants keep their own status, which keeps ARCHIVE O(1) and makes restore order explicit. RESTORE pays for that by validating the ancestor chain, so a node cannot be restored underneath a still-archived parent.',\n 'Sibling `code` uniqueness is the schema business key (`organizationId`, `parentUnitId`, `code`) — sibling-scoped, so two teams called `sales` under different divisions are legitimate. Rows carrying NO `code` are outside the constraint entirely (any number of code-less siblings is fine), while roots ARE covered: an absent `parentUnitId` is a real position, so two roots may not share a code.',\n 'That business key is enforced at BOTH layers, and both raise `ORGANIZATION_UNIT_CODE_EXISTS`. On MongoDB a partial compound unique index closes the concurrency window. On a SQL adapter there is no index yet — the planner records uniqueness as intent and leaves enforcement migration-owned — so the application guard at CREATE, UPDATE (rename) and MOVE is retained as the cross-adapter backstop. That guard is a read-then-write and therefore still racy on its own; the index, not the guard, is what makes the constraint hold under concurrency. Treat schema-declared uniqueness as a MongoDB guarantee until the SQL migration lane closes the gap.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n views: {\n [Op.READ]: { purpose: 'Detail drawer for a single unit in org settings.', whenToUse: 'Org structure admin and HR flows.' },\n [Op.LIST]: { purpose: 'Flat or nested listing under an org.', whenToUse: 'Unit pickers in assignment UI.' },\n [Op.SEARCH]: { purpose: 'Searchable listing when the factory marks search enabled.', whenToUse: 'Large orgs with many nodes.' },\n [Op.CREATE]: { purpose: 'Create under an org from structure settings.', whenToUse: 'HR or IT modeling new groups.' },\n [Op.UPDATE]: { purpose: 'Edit name, code, type, status, and inheritance policy inline.', whenToUse: 'Organization-directory corrections that do not change the parent.' },\n [Op.DELETE]: { purpose: 'Remove an empty leaf unit.', whenToUse: 'After its child units and member assignments have been removed or moved.' },\n [OrganizationUnit_Operations.MOVE]: { purpose: 'Drag/drop or form-driven reparenting.', whenToUse: 'Rebalancing regions or reporting lines.' },\n [OrganizationUnit_Operations.ARCHIVE]: { purpose: 'Soft-close one unit without changing descendants.', whenToUse: 'Mergers and seasonal structures.' },\n [OrganizationUnit_Operations.RESTORE]: { purpose: 'Bring an archived unit back under an active parent.', whenToUse: 'Mistakes or revived departments.' },\n },\n }),\n);\n"]}
|
|
1
|
+
{"version":3,"file":"organization-units.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-units.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,IAAI,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AAC5H,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B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BAA2B,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,qDAAqD,EAAE,SAAS,EAAE,kCAAkC,EAAE;KACzJ;CACF,CAAC,CACH,CAAC","sourcesContent":["import { organizationUnitsMainResourceUIBehavior as organizationUnitsUIBehaviorSource } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n ErrorCustomMessageReference,\n ErrorSeverity,\n ErrorType,\n OrganizationUnitSchema,\n OrganizationUnitStatus,\n OrganizationUnitType,\n OrganizationUnit_Operations,\n OrganizationUnit_PermissionInheritanceType,\n ResourcePrimaryScope,\n organizationUnitResourceConfiguration_InitializationFactory as organizationUnitsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof organizationUnitsFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst organizationUnitsResourceUIBehavior = organizationUnitsUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst ORGANIZATION_UNIT_EXAMPLE = {\n _id: 'organization_unit_emea_sales',\n organizationId: 'organization_01HX2EXAMPLE',\n parentUnitId: 'organization_unit_sales',\n status: OrganizationUnitStatus.ACTIVE,\n inheritanceType: OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN,\n path: '/organization_unit_sales/',\n name: 'EMEA Sales',\n code: 'emea-sales',\n type: OrganizationUnitType.DEPARTMENT,\n createdAt: '2026-07-03T09:15:00.000Z',\n updatedAt: '2026-08-18T08:00:00.000Z',\n _version: 3,\n} as const;\n\nconst ORGANIZATION_UNIT_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_UNIT_EXAMPLE._id,\n organizationId: ORGANIZATION_UNIT_EXAMPLE.organizationId,\n status: ORGANIZATION_UNIT_EXAMPLE.status,\n name: ORGANIZATION_UNIT_EXAMPLE.name,\n type: ORGANIZATION_UNIT_EXAMPLE.type,\n _version: ORGANIZATION_UNIT_EXAMPLE._version,\n} as const;\n\nfunction organizationUnitsPage<T>(data: readonly T[]) {\n return {\n data,\n pagination: { page: 1, limit: 20, total: data.length, totalPages: data.length === 0 ? 0 : 1 },\n };\n}\n\nconst ORGANIZATION_UNITS_PAGE_REQUEST = { page: 1, limit: 20, sort: 'createdAt:desc' } as const;\n\nexport const organizationUnitsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(organizationUnitsResourceUIBehavior),\n resourceSpecification(\n organizationUnitsFactory,\n OrganizationUnitSchema,\n ({ schemaShape }) => ({\n purpose: 'Represents a department, team, region, project group, or other node in an organization’s hierarchy.',\n businessRole: 'Organization units support org charts, unit-scoped membership, and downward permission inheritance in larger organizations.',\n lifecycleRole: 'Units can be created, renamed, moved, archived, restored, and deleted when they no longer have child units or member assignments.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationUnitResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ORGANIZATION_UNITS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnit_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationUnitsMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n parentUnitId: schemaShape.parentUnitId.foreignKeySpec({\n meaning: 'The parent org-unit this node hangs under (absent/root when the unit is a top-level node directly beneath the organization).',\n whyItMatters: 'Defines the tree edge that drives org-chart rendering, path materialization, and downward-only permission inheritance through the hierarchy.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n name: schemaShape.name.stringSpec({ meaning: 'Unit display name.', importance: FieldSemanticImportance.PRIMARY }),\n code: schemaShape.code.stringSpec({ meaning: 'Short stable code for APIs and HR imports. Optional, and unique among the siblings that carry one — the resource business key is (`organizationId`, `parentUnitId`, `code`).' }),\n type: schemaShape.type.enumSpec({\n meaning: 'Structural classification of the node in the org hierarchy (department, region, team, …).',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnitType.COMPANY]: { meaning: 'Top-level company entity within the tenant.' },\n [OrganizationUnitType.DIVISION]: { meaning: 'A division grouping multiple departments.' },\n [OrganizationUnitType.DEPARTMENT]: { meaning: 'A department within a division or company.' },\n [OrganizationUnitType.TEAM]: { meaning: 'A team within a department.' },\n [OrganizationUnitType.SUBTEAM]: { meaning: 'A sub-team nested under a team.' },\n [OrganizationUnitType.PROJECT_GROUP]: { meaning: 'A cross-cutting project or working group.' },\n [OrganizationUnitType.GEOGRAPHIC]: { meaning: 'A geography/region-based grouping.' },\n [OrganizationUnitType.FUNCTIONAL]: { meaning: 'A function-based grouping (e.g. a shared discipline).' },\n [OrganizationUnitType.CUSTOM]: { meaning: 'A tenant-defined unit kind that does not fit the named categories.' },\n },\n }),\n inheritanceType: schemaShape.inheritanceType.enumSpec({\n meaning: 'Controls whether a unit-scoped role also applies to descendant units. Permission inheritance is downward-only; a role on a child never grants authority over its parent or ancestors.',\n whyItMatters: 'With `inherit_down`, one assignment can cover an entire branch. With `no_inheritance`, the assignment applies only to this exact unit.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnit_PermissionInheritanceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN]: { meaning: 'A role held at this unit also applies to its descendant units.' },\n [OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE]: { meaning: 'No propagation; the node is isolated for permission purposes.' },\n },\n }),\n path: schemaShape.path.stringSpec({\n meaning: 'Server-maintained ancestor path for this node, excluding the node itself (for example `/division-id/department-id/`).',\n whyItMatters: 'Lets clients identify the node’s hierarchy and lets authorization apply inherited unit access across a branch. Change parents through MOVE; clients do not write this field directly.',\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Lifecycle state of the node (archived, suspended, etc.).',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationUnitStatus.ACTIVE]: { meaning: 'Normal visibility in pickers and policy.' },\n [OrganizationUnitStatus.INACTIVE]: { meaning: 'Retained for history, hidden from most UIs.' },\n [OrganizationUnitStatus.ARCHIVED]: { meaning: 'Soft-closed; restore via RESTORE when applicable.' },\n [OrganizationUnitStatus.SUSPENDED]: { meaning: 'Policy-hold; treat as non-assignable for new work.' },\n },\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Retrieve one organization unit by its route identity.',\n outcome: 'The unit’s hierarchy, classification, lifecycle state, and inheritance policy are returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization unit was found and its node record (name, code, status, hierarchy links) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to read organization units.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization unit exists for the supplied id within the caller’s tenant scope.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect an active department',\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Inspect a unit with its organization relationship',\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n organization: { _id: ORGANIZATION_UNIT_EXAMPLE.organizationId },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Inspect the compact organization-unit summary',\n response: ORGANIZATION_UNIT_SUMMARY_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'Browse organization units under an organization or a specific parent unit.',\n outcome: 'A page of organization-unit nodes and pagination metadata is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of units under the addressed org or parent node.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to list organization units.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent organization units',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([ORGANIZATION_UNIT_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Browse units with organization relationship context',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([{\n ...ORGANIZATION_UNIT_EXAMPLE,\n organization: { _id: ORGANIZATION_UNIT_EXAMPLE.organizationId },\n }]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Browse compact organization-unit summaries',\n request: ORGANIZATION_UNITS_PAGE_REQUEST,\n response: organizationUnitsPage([ORGANIZATION_UNIT_SUMMARY_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Search organization units by name or description and narrow the result with supported filters.',\n outcome: 'A page of matching units in the addressed organization or parent branch is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of units matching the name or description query within the tenant.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the organization-member role required to search organization units.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Find sales units by name and parent',\n request: {\n q: 'sales',\n name: 'EMEA Sales',\n parentUnitId: ORGANIZATION_UNIT_EXAMPLE.parentUnitId,\n page: 1,\n limit: 20,\n sort: 'name:asc',\n },\n response: organizationUnitsPage([ORGANIZATION_UNIT_EXAMPLE]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.CREATE]: {\n purpose: 'Create a root organization unit or add a child under an existing parent unit.',\n outcome: 'The new unit is returned with its server-assigned identifier and hierarchy path, ready for unit-scoped membership and access policies.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new unit node was created under the supplied parent and is returned with its server-assigned id.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The unit payload fails schema validation (e.g. missing `name`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to add nodes to the org tree.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The referenced parent unit does not exist within the caller’s organization.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling unit under the same parent already uses the requested `code`; unit codes must be unique within a parent.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Create a unit under a parent node',\n request: {\n name: 'EMEA Sales',\n code: 'emea-sales',\n parentUnitId: ORGANIZATION_UNIT_EXAMPLE.parentUnitId,\n type: OrganizationUnitType.DEPARTMENT,\n inheritanceType: OrganizationUnit_PermissionInheritanceType.INHERIT_DOWN,\n status: OrganizationUnitStatus.ACTIVE,\n },\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Update a unit’s name, code, type, lifecycle state, or permission-inheritance policy. Use MOVE to change its parent.',\n outcome: 'The updated unit is returned. Changes to inheritance affect subsequent unit-scoped authorization decisions.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was updated and the new node state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to edit org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The requested `code` is already used by a sibling under the same parent. Reparenting is not accepted by UPDATE; use MOVE.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: true,\n examples: [{\n title: 'Rename a unit and isolate its permissions',\n request: {\n name: 'EMEA Revenue',\n code: 'emea-revenue',\n inheritanceType: OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE,\n },\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n name: 'EMEA Revenue',\n code: 'emea-revenue',\n inheritanceType: OrganizationUnit_PermissionInheritanceType.NO_INHERITANCE,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.DELETE]: {\n purpose: 'Remove an empty leaf node from the org tree; refused while the node still has child units or assigned members.',\n outcome: 'The unit row is deleted. A node with dependents is refused, so no subtree is stranded behind a dangling parent link and no member assignment outlives the unit it names.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The unit was deleted; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to remove org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id (or it was already removed).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit still has dependents, and neither is cascade-deleted with it. Either child units remain — re-parent each onto another node with MOVE, or delete the subtree bottom-up — or organization members are still assigned to this unit, in which case the assignments must be removed first. Only a node with no children and no assignments can be deleted.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_HAS_DEPENDENTS },\n ],\n idempotent: true,\n examples: [{\n title: 'Refuse deletion while a child unit remains',\n response: {\n error: {\n type: ErrorType.CONFLICT,\n severity: ErrorSeverity.MEDIUM,\n message: 'Resource conflict detected',\n customMessage: 'Move or delete child units and remove member assignments before deleting this unit.',\n customMessageReference: ErrorCustomMessageReference.ORGANIZATION_UNIT_HAS_DEPENDENTS,\n timestamp: '2026-08-18T08:00:00.000Z',\n },\n },\n forStatus: HttpResponseStatusCode.CONFLICT_409,\n }],\n },\n [OrganizationUnit_Operations.MOVE]: {\n operationId: OrganizationUnit_Operations.MOVE,\n purpose: 'Move a unit beneath a different parent, or to the organization root when `newParentUnitId` is omitted.',\n outcome: 'The unit keeps its identity and member assignments. Its ancestor path and every descendant path are updated to reflect the new location.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit was re-parented and the updated node (with its new path) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The optional destination-parent identifier or reason has an invalid type or length.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / HR-structure role required to restructure the org tree.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'The unit being moved, or the destination parent unit, does not exist in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The destination would create a cycle — the target parent sits inside the moved unit’s own subtree, or is the unit itself.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_MOVE_CONFLICT },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A sibling under the new parent already uses the moved unit’s `code`. The destination itself is valid; rename the unit or choose another parent.', errorCode: ErrorCustomMessageReference.ORGANIZATION_UNIT_CODE_EXISTS },\n ],\n idempotent: false,\n examples: [{\n title: 'Move a department below a new division',\n request: {\n newParentUnitId: 'organization_unit_revenue',\n reason: 'Sales now reports through the global revenue division.',\n },\n response: {\n ...ORGANIZATION_UNIT_EXAMPLE,\n parentUnitId: 'organization_unit_revenue',\n path: '/organization_unit_revenue/',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationUnit_Operations.ARCHIVE]: {\n operationId: OrganizationUnit_Operations.ARCHIVE,\n purpose: 'Archive one organization unit without deleting its history or changing descendant states.',\n outcome: 'The unit becomes ARCHIVED and is hidden from default active-unit pickers. Descendants retain their own states.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit transitioned to `ARCHIVED` and the updated node is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to archive org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit is already `ARCHIVED`, so archiving is not a legal transition from its current state.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Archive a department after a reorganization',\n request: { reason: 'The EMEA Sales department was consolidated into Global Revenue.' },\n response: { ...ORGANIZATION_UNIT_EXAMPLE, status: OrganizationUnitStatus.ARCHIVED },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [OrganizationUnit_Operations.RESTORE]: {\n operationId: OrganizationUnit_Operations.RESTORE,\n purpose: 'Restore an archived unit after its parent branch is active.',\n outcome: 'The unit becomes ACTIVE and is available again to active-unit pickers and policies.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The unit transitioned back to `ACTIVE` and the restored node is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role required to restore archived org tree nodes.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No unit exists for the supplied id in the caller’s scope.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The unit is not `ARCHIVED` (so there is nothing to restore), or its parent branch is still archived and must be restored first.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Restore an archived department',\n request: { reason: 'The department is active again for the new fiscal year.' },\n response: ORGANIZATION_UNIT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'Admin org presets do not add alternate variants for `ORGANIZATION_UNITS` — only main `organizations` presets apply.',\n 'Per-unit DELETE is refused while child units remain, but deleting the whole ORGANIZATION is not: that cascade is enabled and removes every unit of the tenant at once (each unit carries the tenant id, so tree depth is irrelevant). Tearing a tenant down does not require dismantling its org chart leaf-by-leaf.',\n // Scope note, recorded so the narrower guard is not later read as an oversight. An earlier\n // revision of this spec also named \"assigned members\" as a DELETE blocker; it was dropped\n // (2026-07-29) because it cannot be enforced honestly today, not because it stopped mattering.\n 'Unit assignments ARE checked on unit DELETE (since 2026-07-31). They live in the `ORGANIZATION_UNIT_MEMBERS` junction resource, promoted out of the members row precisely so this dependent could be guarded: as an embedded array it was not a registered relationship and not adapter-neutrally queryable (a nested-path filter resolves to null on the SQL adapter, and the list projection dropped the field), so either available check would have passed silently instead of blocking.',\n 'MOVE, ARCHIVE and RESTORE are implemented (2026-07-31). Their request payloads name no schema field, so each custom implementation translates the payload into the real field mutation: MOVE writes `parentUnitId` + `path` and rewrites the materialized `path` of every descendant in one transaction; ARCHIVE/RESTORE write `status`.',\n 'Re-parenting is owned exclusively by MOVE — `parentUnitId` is `.excludeFromUpdate()`. A reparent has a subtree-wide side effect (every descendant path must be rewritten) and must be refused when the destination sits inside the moved node’s own subtree; generic UPDATE performs neither check, so allowing it there would silently produce stale paths or a detached cycle.',\n '`path` is a materialized ANCESTOR chain (`/`, `/R/`, `/R/C/`) — the route TO the node, excluding the node itself. It is written by the CREATE prefix on the same write that inserts the row, because a CREATE custom implementation never receives the new row’s id and a second write would leave a window with no path at all. Descendants of a node are addressed by `path + _id + \"/\"`, which is also the O(1) cycle test MOVE relies on.',\n 'ARCHIVE is node-only: descendants keep their own status, which keeps ARCHIVE O(1) and makes restore order explicit. RESTORE pays for that by validating the ancestor chain, so a node cannot be restored underneath a still-archived parent.',\n 'Sibling `code` uniqueness is the schema business key (`organizationId`, `parentUnitId`, `code`) — sibling-scoped, so two teams called `sales` under different divisions are legitimate. Rows carrying NO `code` are outside the constraint entirely (any number of code-less siblings is fine), while roots ARE covered: an absent `parentUnitId` is a real position, so two roots may not share a code.',\n 'That business key is enforced at BOTH layers, and both raise `ORGANIZATION_UNIT_CODE_EXISTS`. On MongoDB a partial compound unique index closes the concurrency window. On a SQL adapter there is no index yet — the planner records uniqueness as intent and leaves enforcement migration-owned — so the application guard at CREATE, UPDATE (rename) and MOVE is retained as the cross-adapter backstop. That guard is a read-then-write and therefore still racy on its own; the index, not the guard, is what makes the constraint hold under concurrency. Treat schema-declared uniqueness as a MongoDB guarantee until the SQL migration lane closes the gap.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n views: {\n [Op.READ]: { purpose: 'Detail drawer for a single unit in org settings.', whenToUse: 'Org structure admin and HR flows.' },\n [Op.LIST]: { purpose: 'Flat or nested listing under an org.', whenToUse: 'Unit pickers in assignment UI.' },\n [Op.SEARCH]: { purpose: 'Searchable listing when the factory marks search enabled.', whenToUse: 'Large orgs with many nodes.' },\n [Op.CREATE]: { purpose: 'Create under an org from structure settings.', whenToUse: 'HR or IT modeling new groups.' },\n [Op.UPDATE]: { purpose: 'Edit name, code, type, status, and inheritance policy inline.', whenToUse: 'Organization-directory corrections that do not change the parent.' },\n [Op.DELETE]: { purpose: 'Remove an empty leaf unit.', whenToUse: 'After its child units and member assignments have been removed or moved.' },\n [OrganizationUnit_Operations.MOVE]: { purpose: 'Drag/drop or form-driven reparenting.', whenToUse: 'Rebalancing regions or reporting lines.' },\n [OrganizationUnit_Operations.ARCHIVE]: { purpose: 'Soft-close one unit without changing descendants.', whenToUse: 'Mergers and seasonal structures.' },\n [OrganizationUnit_Operations.RESTORE]: { purpose: 'Bring an archived unit back under an active parent.', whenToUse: 'Mistakes or revived departments.' },\n },\n }),\n);\n"]}
|
package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organizations.resource.specification.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAE3B,kBAAkB,EAClB,iCAAiC,EAGlC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"organizations.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organizations.resource.specification.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,qBAAqB,IAAI,EAAE,EAE3B,kBAAkB,EAClB,iCAAiC,EAGlC,MAAM,uBAAuB,CAAC;AA0B/B;;;GAGG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;iCA2V9C,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
|
3
3
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
|
|
4
4
|
import { CoreResourceOperation as Op, OrganizationSchema, OrganizationStatus, Organization_Lifecycle_Operations, ResourcePrimaryScope, organizationResourceConfiguration_InitializationFactory as organizationsFactory, } from '@wildo-ai/saas-models';
|
|
5
5
|
import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
|
|
6
|
+
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
6
7
|
const organizationsMainUIBehavior = organizationsMainUIBehaviorSource;
|
|
7
8
|
const organizationsAdminUIBehavior = organizationsAdminUIBehaviorSource;
|
|
8
9
|
/**
|
|
@@ -14,6 +15,7 @@ export const organizationsResourceSpecification = resourceSpecificationFromFront
|
|
|
14
15
|
businessRole: 'The anchor for org-scoped data: members, units, entitlements, billing, and security configuration all hang off this key.',
|
|
15
16
|
lifecycleRole: 'Progresses from trial through active use, suspension, and eventual cancellation or deletion under policy.',
|
|
16
17
|
audience: LabelAudience.ADMIN,
|
|
18
|
+
subDomain: EngineResourceSubDomain.ORGANIZATIONS,
|
|
17
19
|
codeHandling: {
|
|
18
20
|
mainSchema: {
|
|
19
21
|
packageName: '@wildo-ai/saas-models',
|