@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":"m2m-webhook-delivery-log.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAA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BAC5C,WAAW,EAAE,gCAAgC,CAAC,SAAS;gBACvD,OAAO,EAAE,8FAA8F;gBACvG,OAAO,EAAE,wFAAwF;gBACjG,SAAS,EAAE,mGAAmG;gBAC9G,UAAU,EAAE,uBAAuB,CAAC,OAAO;gBAC3C,gBAAgB,EAAE;oBAChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,+GAA+G,EAAE;iBAClK;gBACD,cAAc,EAAE;oBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,yGAAyG,EAAE,SAAS,EAAE,mBAAmB,EAAE;oBACjM,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+FAA+F,EAAE;iBACtJ;gBACD,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,CAAC;wBACT,KAAK,EAAE,oDAAoD;wBAC3D,OAAO,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE;wBAC9B,QAAQ,EAAE;4BACR,WAAW,EAAE,EAAE;4BACf,OAAO,EAAE,qEAAqE;yBAC/E;wBACD,SAAS,EAAE,sBAAsB,CAAC,MAAM;qBACzC,CAAC;aACH;SACF;QACD,mBAAmB,EAAE;YACnB,sQAAsQ;YACtQ,iJAAiJ;YACjJ,qKAAqK;SACtK;KACF,CAAC,EACF,EAAE,oBAAoB,EAAE,kCAAkC,CAAC,YAAY,CAAC,EAAE,CAC3E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sDAAsD,GAAG,uCAAuC,CAC3G,gBAAgB,CAAC,qCAAqC,EACtD,uCAAuC,CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,qDAAqD,GAAG,uCAAuC,CAC1G,gBAAgB,CAAC,oCAAoC,EACrD,sCAAsC,CACvC,CAAC","sourcesContent":["/**\n * Resources: `organizationM2mWebhookDeliveryLog` + `applicationM2mWebhookDeliveryLog` — Wildo SaaS engine specification (backend-only).\n *\n * Polymorphic ORG + APP pair sharing `M2MWebhookDeliveryLogBaseSchema` and `m2mWebhookDeliveryLogPolymorphicFactories`.\n *\n * Inputs:\n * - Base schema: `M2MWebhookDeliveryLogBaseSchema` (`m2m-webhook-delivery-log.shared.schemas.ts`)\n * - Polymorphic factories: `m2mWebhookDeliveryLogPolymorphicFactories` (`m2m-webhook-delivery-log.shared.resources-config.schemas.ts`)\n * - Custom operations: `M2MWebhookDeliveryLog_Operations` (`retry`, `purgeOld`)\n * - UI presets: `webhooksMainPresets` / `webhooksAdminPresets`\n * (engine/presets-components/src/config/resources/webhooks.resource-presets.tsx) —\n * layout-less auto-render surfaced in the org Settings Hub `webhooks` section\n * (Delivery log sub-tab), dashboard-style via generic collection capabilities:\n * status quick-filter tab strip (`collectionDisplayConfig.quickFilterField`)\n * + day-bucket date headings (`temporalGroupField: 'createdAt'`) on LIST,\n * EMBEDDED READ (row click → companion drawer; opaque `payload` renders as\n * pretty JSON), `retry` / `purgeOld` actions, status badge.\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 CoreM2MNotificationChannel,\n CoreResourceOperation as Op,\n CoreResourceType,\n M2MWebhookDeliveryLog_Operations,\n M2MWebhookDeliveryLogBaseSchema,\n M2MWebhookDeliveryLogStatus,\n ResourcePrimaryScope,\n m2mWebhookDeliveryLogPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification, type ResourceSpecificationConfig } from '~wildo-specifications/_core';\n\ntype M2mDeliveryLogResourceType =\n | CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG\n | CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG;\n\ntype M2mDeliveryLogResourceTypeMember =\n | 'ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG'\n | 'APPLICATION_M2M_WEBHOOK_DELIVERY_LOG';\n\nconst m2mDeliveryLogResourcePrimaryScope: Record<M2mDeliveryLogResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype M2mDeliveryFactoryCfg = ReturnType<\n (typeof m2mWebhookDeliveryLogPolymorphicFactories)[CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG]\n>;\ntype M2mDeliveryCustomOp = NonNullable<M2mDeliveryFactoryCfg['customOperation']>;\ntype M2mDeliveryCoreOp =\n | Op.READ\n | Op.LIST\n | Op.SEARCH\n | Op.CREATE\n | Op.UPDATE\n | Op.DELETE\n | Op.DELETE_MANY;\ntype M2mDeliveryMain = typeof M2MWebhookDeliveryLogBaseSchema;\n\nfunction buildM2mWebhookDeliveryLogSpecification(\n resourceType: M2mDeliveryLogResourceType,\n memberName: M2mDeliveryLogResourceTypeMember,\n): ResourceSpecificationConfig<M2mDeliveryCustomOp, M2mDeliveryCoreOp, M2mDeliveryMain> {\n const isOrganizationScope = resourceType === CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG;\n const scopeIdentity = isOrganizationScope\n ? { organizationId: 'org_01JEXAMPLE' }\n : { applicationId: 'app_01JEXAMPLE' };\n const channel = isOrganizationScope\n ? CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION\n : CoreM2MNotificationChannel.WEBHOOK_APPLICATION;\n const deliveryIdentity = {\n _id: 'delivery_01JEXAMPLE',\n endpointId: 'orders-primary',\n channel,\n resourceIdentifier: 'orders',\n operationIdentifier: 'create',\n httpUrl: 'https://partners.example.com/webhooks/orders',\n payloadHash: '31da863f127a6c22b91b5cc85081c382b02039a9c8c4b30db2cc3172de31d2d8',\n payload: { event: 'order.created', orderId: 'order_01JEXAMPLE' },\n signatureJti: 'webhook-signature-01JEXAMPLE',\n createdAt: '2026-08-18T09:30:00.000Z',\n updatedAt: '2026-08-18T09:32:12.000Z',\n ...scopeIdentity,\n } as const;\n const failedDeliveryExample = {\n ...deliveryIdentity,\n status: M2MWebhookDeliveryLogStatus.FAILED,\n attemptCount: 5,\n lastAttemptAt: '2026-08-18T09:32:12.000Z',\n responseStatus: 503,\n responseBodyTruncated: 'Service temporarily unavailable',\n failureReason: 'The receiver returned HTTP 503 after the final retry.',\n failedAt: '2026-08-18T09:32:12.000Z',\n } as const;\n const retriedDeliveryExample = {\n ...deliveryIdentity,\n status: M2MWebhookDeliveryLogStatus.PENDING,\n attemptCount: 0,\n nextAttemptAt: '2026-08-18T09:35:00.000Z',\n } as const;\n const deliveryPageExample = {\n data: [failedDeliveryExample],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n } as const;\n\n return resourceSpecification<M2mDeliveryCustomOp, M2mDeliveryCoreOp, M2mDeliveryMain>(\n m2mWebhookDeliveryLogPolymorphicFactories[resourceType],\n M2MWebhookDeliveryLogBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Persist every outbound M2M webhook POST (queue entry, delivery status, HTTP evidence, and signing metadata) for org- or app-scoped admin review and retry.',\n businessRole: 'The user-visible event log and the worker’s durable queue for asynchronous webhook delivery — one row per (scope × target endpoint × fire).',\n lifecycleRole: 'Rows move PENDING → IN_FLIGHT → DELIVERED, or PENDING/IN_FLIGHT → FAILED, with `attemptCount` and `nextAttemptAt` governing back-off; RETRY and PURGE_OLD custom ops re-queue or clean history.',\n audience: LabelAudience.DEVELOPER,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLogBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'm2mWebhookDeliveryLogPolymorphicFactories',\n symbolKind: CodeSymbolKind.FACTORY,\n },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\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,\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: 'M2MWebhookDeliveryLog_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'The polymorphism engine injects `organizationId` (ORG variant) or `applicationId` (APP variant) on the document — those FKs are not on the base Zod object.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Unique id for a single delivery log row and lease token anchor for the worker.',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'identifier',\n }),\n endpointId: schemaShape.endpointId.stringSpec({\n meaning: 'Stable FK to `webhookConfig.endpoints[].id` at enqueue time so historical rows survive endpoint renames/URL changes.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n channel: schemaShape.channel.enumSpec({\n meaning: 'Which M2M channel the originating operation fired (must be compatible with the resource’s primary scope in the dispatcher).',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreM2MNotificationChannel',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION]: { meaning: 'Org-scoped outbound webhook (requires an org id in the execution context).' },\n [CoreM2MNotificationChannel.WEBHOOK_APPLICATION]: { meaning: 'App-scoped outbound webhook (resolves the app id from `appConfigService`).' },\n },\n }),\n resourceIdentifier: schemaShape.resourceIdentifier.stringSpec({\n meaning: 'Originating `CoreResourceType` string (or app resource key) that produced the M2M payload.',\n semanticRole: 'code',\n }),\n operationIdentifier: schemaShape.operationIdentifier.stringSpec({\n meaning: 'Operation or custom-op identifier that the serializer used when building the POST body (used for support correlation).',\n semanticRole: 'code',\n }),\n variantKey: schemaShape.variantKey.stringSpec({\n meaning: 'Optional default vs named operation variant, when the originating op exposed multiple API variants.',\n }),\n httpUrl: schemaShape.httpUrl.stringSpec({\n meaning: 'Snapshot of the destination URL that was used for this attempt (duplicated from the config so URL edits do not rewrite history).',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'uri',\n }),\n payloadHash: schemaShape.payloadHash.stringSpec({\n meaning: 'SHA-256 of the JSON body, mirrored into the signed JWT and used to detect replays or tampering.',\n semanticRole: 'code',\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Current queue/delivery state for the worker and admin filters.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLogStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.CONST_OBJECT,\n },\n values: {\n [M2MWebhookDeliveryLogStatus.PENDING]: { meaning: 'Row is either waiting in the queue or has been re-queued for another attempt after a transient failure.' },\n [M2MWebhookDeliveryLogStatus.IN_FLIGHT]: { meaning: 'A worker currently holds a lease and is trying to send the HTTP request.' },\n [M2MWebhookDeliveryLogStatus.DELIVERED]: { meaning: 'HTTP success path with signature validated at the consumer; terminal success.' },\n [M2MWebhookDeliveryLogStatus.FAILED]: { meaning: 'Terminal failure: exhausted attempt budget or a non-retryable 4xx class error.' },\n },\n }),\n attemptCount: schemaShape.attemptCount.numberSpec({\n meaning: 'Number of send attempts (including successes that still increment the counter, per worker policy).',\n unit: 'count',\n }),\n lastAttemptAt: schemaShape.lastAttemptAt.dateSpec({\n meaning: 'When the most recent send attempt started or finished, depending on writer semantics.',\n temporalRole: 'occurred',\n }),\n nextAttemptAt: schemaShape.nextAttemptAt.dateSpec({\n meaning: 'When the next retry is eligible; indexed for the worker’s polling query on `(status, nextAttemptAt)`.',\n temporalRole: 'scheduled',\n }),\n responseStatus: schemaShape.responseStatus.numberSpec({\n meaning: 'Last observed HTTP status code (present even for successes for observability).',\n }),\n responseBodyTruncated: schemaShape.responseBodyTruncated.stringSpec({\n meaning: 'First 4 KB of the HTTP response (when captured) to help debug remote listener failures.',\n }),\n failureReason: schemaShape.failureReason.stringSpec({\n meaning: 'Human-readable last error string when `status=failed` (worker-set).',\n }),\n signatureJti: schemaShape.signatureJti.stringSpec({\n meaning: 'Matches the JWT `jti` and `X-Webhook-Signature` header so the consumer can look up the exact signing key material.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n deliveredAt: schemaShape.deliveredAt.dateSpec({\n meaning: 'Timestamp when a terminal `DELIVERED` state was recorded.',\n temporalRole: 'occurred',\n }),\n failedAt: schemaShape.failedAt.dateSpec({\n meaning: 'Timestamp when a terminal `FAILED` state was recorded.',\n temporalRole: 'occurred',\n }),\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the row was enqueued (immutable upper bound for retention policies).',\n temporalRole: 'creation',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When status / attempt counters / timestamps last changed for this id.',\n temporalRole: 'modified',\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect a single log row in admin or support UIs using the fields documented above (status, URL snapshot, hashes, HTTP evidence, correlation ids). The Mongo `payload` column is `z.unknown()` at rest and is not expanded in `fields.*` — when the runtime returns it, treat it as sensitive; see `businessConstraints`.',\n outcome: 'Operators can see whether a business event was delivered and, if not, the precise failure class.',\n whenToUse: 'Use when triaging a customer ticket referencing a `deliveryLogId` or `signatureJti`.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The delivery log row for the supplied id was found and its status, URL snapshot, HTTP evidence, and signing metadata are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id in this scope (never enqueued, or already removed by `PURGE_OLD`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role; because `payload` may embed serialized customer data, reads are gated to roles that already see that data (see `businessConstraints`).' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect a failed order webhook delivery',\n response: failedDeliveryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: { examples: [] },\n summary: { examples: [] },\n },\n },\n [Op.LIST]: {\n purpose: 'Browse recent delivery attempts in chronological order, filtered by the repository’s search defaults.',\n outcome: 'Admins can scan for spikes in `FAILED` rows or revalidation after URL rotation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) chronological page of delivery log rows in this scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to browse the delivery log (rows may carry serialized customer payloads).' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent delivery attempts',\n request: { page: 1, limit: 20, sort: 'createdAt:desc' },\n response: deliveryPageExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: { examples: [] },\n summary: { examples: [] },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Filter log rows on status, `endpointId`, channel, date windows, and operation identifiers to isolate incidents.',\n outcome: 'Security and ops can produce CSV-grade subsets without an external data warehouse in small deployments.',\n whenToUse: 'Use in admin dashboards; heavy analytics may still go to a warehouse — this is the operational “small query” path.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of delivery log rows matching the status / endpoint / channel / date-window / operation filters.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to search the delivery log.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Find failures for one endpoint',\n request: {\n q: 'orders',\n status: M2MWebhookDeliveryLogStatus.FAILED,\n channel,\n endpointId: 'orders-primary',\n page: 1,\n limit: 20,\n sort: 'createdAt:desc',\n },\n response: deliveryPageExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.CREATE]: {\n purpose: 'Enqueue a new delivery row when a resource operation with an M2M channel fires.',\n outcome: 'The worker pool can find ready rows via the `(status, nextAttemptAt)` index.',\n whenToUse: 'Repository-only: invoked by the dispatcher, never by a human HTTP client.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A `PENDING` delivery row was enqueued and is now discoverable by the worker pool. Internal/service write path — the dispatcher fires this, never a human HTTP client.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The enqueue payload fails schema validation (e.g. missing `endpointId`, `httpUrl`, or `channel`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-dispatcher caller attempts to enqueue a delivery row directly.' },\n ],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Drive the delivery lifecycle status transitions (PENDING → IN_FLIGHT → DELIVERED/FAILED) with `attemptCount` / `nextAttemptAt` / terminal-timestamp writes.',\n outcome: 'The worker can advance a row through its lifecycle so the `(status, nextAttemptAt)` index stays accurate for polling and back-off.',\n whenToUse: 'Repository-only: invoked by the dispatcher/worker (`markInFlight` / `markDelivered` / `markFailedAttempt` / `markFinallyFailed`), never by a human HTTP client — admins act via the `RETRY` custom operation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The delivery row’s status / attempt counters / timestamps were updated. Internal/service write path — the worker fires this, never a human HTTP client.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to update.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-dispatcher caller attempts to mutate a delivery row directly; UI flows must use the `RETRY` custom operation.' },\n ],\n idempotent: false,\n },\n [Op.DELETE]: {\n purpose: 'Reserved for `PURGE_OLD` and internal cleanup — no public single-row delete to keep the audit trail honest.',\n outcome: 'Old rows are removed in bulk, not opportunistically per UI click, matching the high-risk gating in the config.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'An internal/maintenance single-row delete completed; no body is returned. Intentionally not a public per-click operation — routine cleanup goes through `PURGE_OLD`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to delete.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an operator authorized for exceptional single-row maintenance deletes; UI flows must use `PURGE_OLD` instead.' },\n ],\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'Bulk twin of `DELETE` — the actual `PURGE_OLD` write path: one repository round trip drops every terminal `DELIVERED`/`FAILED` row older than the requested retention window.',\n outcome: 'Retention purges scale with one bulk delete instead of N per-row deletes; non-terminal rows are never touched (the drain owns them).',\n whenToUse: 'Repository-only — never a public HTTP surface. Admins purge via the `PURGE_OLD` custom operation, which owns request validation and the purge summary response.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The matched terminal rows were bulk-deleted; the `PURGE_OLD` wrapper reports the count in its own summary response.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-system caller attempts the repository-only bulk delete directly; UI/API flows must use `PURGE_OLD`.' },\n ],\n idempotent: true,\n },\n [M2MWebhookDeliveryLog_Operations.RETRY]: {\n operationId: M2MWebhookDeliveryLog_Operations.RETRY,\n purpose: 'Re-queue a `FAILED` row (reset to pending / zero attempts per worker contract) for manual replay.',\n outcome: 'Operators can attempt redelivery after fixing the downstream listener without re-sending the originating business event.',\n whenToUse: 'Use after a partner confirms their endpoint or certificate is healthy again.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The `FAILED` row was reset to `PENDING` with attempt counters cleared, and the worker pool will re-attempt delivery; the re-queued row is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to retry.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to trigger a manual redelivery.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The row is not in a retryable terminal `FAILED` state (e.g. it is still `PENDING`/`IN_FLIGHT`, or already `DELIVERED`), so a manual re-queue is illegal.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Retry after the receiver recovers',\n request: {},\n response: retriedDeliveryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [M2MWebhookDeliveryLog_Operations.PURGE_OLD]: {\n operationId: M2MWebhookDeliveryLog_Operations.PURGE_OLD,\n purpose: 'Bulk-delete rows older than `N` days (delivered or failed) to bound storage in busy tenants.',\n outcome: 'Tenants can comply with data-retention policy without manual Mongo shell intervention.',\n whenToUse: 'Use in scheduled admin jobs (or manual compliance runs) with explicit `olderThanDays` guardrails.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'Rows older than the supplied `olderThanDays` window were bulk-deleted and a count of purged rows is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `olderThanDays` guardrail is missing, non-numeric, or below the configured minimum retention floor.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to run a bulk retention purge.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Purge terminal delivery history older than 30 days',\n request: { olderThanDays: 30 },\n response: {\n purgedCount: 47,\n message: 'Purged 47 delivered/failed webhook deliveries older than 30 day(s).',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'The `payload` field stores `z.unknown()` JSON at rest (full operation serialization per plan). It is intentionally not expanded into `fields.*` here because the shape is the arbitrary API response; treat any READ that surfaces `payload` as PII/secret handling.',\n 'Do not use `Op.DELETE` for routine UI — prefer `PURGE_OLD` to maintain structured audit logs; single-row delete is for exceptional maintenance.',\n 'Because payloads may embed serialized API responses, treat READ/LIST as sensitive: scope RBAC to org-admin or app-super-admin roles that already see customer data.',\n ],\n }),\n { resourcePrimaryScope: m2mDeliveryLogResourcePrimaryScope[resourceType] },\n );\n}\n\nexport const organizationM2mWebhookDeliveryLogResourceSpecification = buildM2mWebhookDeliveryLogSpecification(\n CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG,\n 'ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG',\n);\n\nexport const applicationM2mWebhookDeliveryLogResourceSpecification = buildM2mWebhookDeliveryLogSpecification(\n CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG,\n 'APPLICATION_M2M_WEBHOOK_DELIVERY_LOG',\n);\n"]}
|
|
1
|
+
{"version":3,"file":"m2m-webhook-delivery-log.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,gCAAgC,EAChC,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,yCAAyC,GAC1C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAoC,MAAM,6BAA6B,CAA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,MAAM,EAAE,OAAO,EAAE,+GAA+G,EAAE;iBAClK;gBACD,cAAc,EAAE;oBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,yGAAyG,EAAE,SAAS,EAAE,mBAAmB,EAAE;oBACjM,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+FAA+F,EAAE;iBACtJ;gBACD,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,CAAC;wBACT,KAAK,EAAE,oDAAoD;wBAC3D,OAAO,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE;wBAC9B,QAAQ,EAAE;4BACR,WAAW,EAAE,EAAE;4BACf,OAAO,EAAE,qEAAqE;yBAC/E;wBACD,SAAS,EAAE,sBAAsB,CAAC,MAAM;qBACzC,CAAC;aACH;SACF;QACD,mBAAmB,EAAE;YACnB,sQAAsQ;YACtQ,iJAAiJ;YACjJ,qKAAqK;SACtK;KACF,CAAC,EACF,EAAE,oBAAoB,EAAE,kCAAkC,CAAC,YAAY,CAAC,EAAE,CAC3E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sDAAsD,GAAG,uCAAuC,CAC3G,gBAAgB,CAAC,qCAAqC,EACtD,uCAAuC,CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,qDAAqD,GAAG,uCAAuC,CAC1G,gBAAgB,CAAC,oCAAoC,EACrD,sCAAsC,CACvC,CAAC","sourcesContent":["/**\n * Resources: `organizationM2mWebhookDeliveryLog` + `applicationM2mWebhookDeliveryLog` — Wildo SaaS engine specification (backend-only).\n *\n * Polymorphic ORG + APP pair sharing `M2MWebhookDeliveryLogBaseSchema` and `m2mWebhookDeliveryLogPolymorphicFactories`.\n *\n * Inputs:\n * - Base schema: `M2MWebhookDeliveryLogBaseSchema` (`m2m-webhook-delivery-log.shared.schemas.ts`)\n * - Polymorphic factories: `m2mWebhookDeliveryLogPolymorphicFactories` (`m2m-webhook-delivery-log.shared.resources-config.schemas.ts`)\n * - Custom operations: `M2MWebhookDeliveryLog_Operations` (`retry`, `purgeOld`)\n * - UI presets: `webhooksMainPresets` / `webhooksAdminPresets`\n * (engine/presets-components/src/config/resources/webhooks.resource-presets.tsx) —\n * layout-less auto-render surfaced in the org Settings Hub `webhooks` section\n * (Delivery log sub-tab), dashboard-style via generic collection capabilities:\n * status quick-filter tab strip (`collectionDisplayConfig.quickFilterField`)\n * + day-bucket date headings (`temporalGroupField: 'createdAt'`) on LIST,\n * EMBEDDED READ (row click → companion drawer; opaque `payload` renders as\n * pretty JSON), `retry` / `purgeOld` actions, status badge.\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 CoreM2MNotificationChannel,\n CoreResourceOperation as Op,\n CoreResourceType,\n M2MWebhookDeliveryLog_Operations,\n M2MWebhookDeliveryLogBaseSchema,\n M2MWebhookDeliveryLogStatus,\n ResourcePrimaryScope,\n m2mWebhookDeliveryLogPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification, type ResourceSpecificationConfig } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype M2mDeliveryLogResourceType =\n | CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG\n | CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG;\n\ntype M2mDeliveryLogResourceTypeMember =\n | 'ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG'\n | 'APPLICATION_M2M_WEBHOOK_DELIVERY_LOG';\n\nconst m2mDeliveryLogResourcePrimaryScope: Record<M2mDeliveryLogResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype M2mDeliveryFactoryCfg = ReturnType<\n (typeof m2mWebhookDeliveryLogPolymorphicFactories)[CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG]\n>;\ntype M2mDeliveryCustomOp = NonNullable<M2mDeliveryFactoryCfg['customOperation']>;\ntype M2mDeliveryCoreOp =\n | Op.READ\n | Op.LIST\n | Op.SEARCH\n | Op.CREATE\n | Op.UPDATE\n | Op.DELETE\n | Op.DELETE_MANY;\ntype M2mDeliveryMain = typeof M2MWebhookDeliveryLogBaseSchema;\n\nfunction buildM2mWebhookDeliveryLogSpecification(\n resourceType: M2mDeliveryLogResourceType,\n memberName: M2mDeliveryLogResourceTypeMember,\n): ResourceSpecificationConfig<M2mDeliveryCustomOp, M2mDeliveryCoreOp, M2mDeliveryMain> {\n const isOrganizationScope = resourceType === CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG;\n const scopeIdentity = isOrganizationScope\n ? { organizationId: 'org_01JEXAMPLE' }\n : { applicationId: 'app_01JEXAMPLE' };\n const channel = isOrganizationScope\n ? CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION\n : CoreM2MNotificationChannel.WEBHOOK_APPLICATION;\n const deliveryIdentity = {\n _id: 'delivery_01JEXAMPLE',\n endpointId: 'orders-primary',\n channel,\n resourceIdentifier: 'orders',\n operationIdentifier: 'create',\n httpUrl: 'https://partners.example.com/webhooks/orders',\n payloadHash: '31da863f127a6c22b91b5cc85081c382b02039a9c8c4b30db2cc3172de31d2d8',\n payload: { event: 'order.created', orderId: 'order_01JEXAMPLE' },\n signatureJti: 'webhook-signature-01JEXAMPLE',\n createdAt: '2026-08-18T09:30:00.000Z',\n updatedAt: '2026-08-18T09:32:12.000Z',\n ...scopeIdentity,\n } as const;\n const failedDeliveryExample = {\n ...deliveryIdentity,\n status: M2MWebhookDeliveryLogStatus.FAILED,\n attemptCount: 5,\n lastAttemptAt: '2026-08-18T09:32:12.000Z',\n responseStatus: 503,\n responseBodyTruncated: 'Service temporarily unavailable',\n failureReason: 'The receiver returned HTTP 503 after the final retry.',\n failedAt: '2026-08-18T09:32:12.000Z',\n } as const;\n const retriedDeliveryExample = {\n ...deliveryIdentity,\n status: M2MWebhookDeliveryLogStatus.PENDING,\n attemptCount: 0,\n nextAttemptAt: '2026-08-18T09:35:00.000Z',\n } as const;\n const deliveryPageExample = {\n data: [failedDeliveryExample],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n } as const;\n\n return resourceSpecification<M2mDeliveryCustomOp, M2mDeliveryCoreOp, M2mDeliveryMain>(\n m2mWebhookDeliveryLogPolymorphicFactories[resourceType],\n M2MWebhookDeliveryLogBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Persist every outbound M2M webhook POST (queue entry, delivery status, HTTP evidence, and signing metadata) for org- or app-scoped admin review and retry.',\n businessRole: 'The user-visible event log and the worker’s durable queue for asynchronous webhook delivery — one row per (scope × target endpoint × fire).',\n lifecycleRole: 'Rows move PENDING → IN_FLIGHT → DELIVERED, or PENDING/IN_FLIGHT → FAILED, with `attemptCount` and `nextAttemptAt` governing back-off; RETRY and PURGE_OLD custom ops re-queue or clean history.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.NOTIFICATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLogBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'm2mWebhookDeliveryLogPolymorphicFactories',\n symbolKind: CodeSymbolKind.FACTORY,\n },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\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,\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: 'M2MWebhookDeliveryLog_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'The polymorphism engine injects `organizationId` (ORG variant) or `applicationId` (APP variant) on the document — those FKs are not on the base Zod object.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Unique id for a single delivery log row and lease token anchor for the worker.',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'identifier',\n }),\n endpointId: schemaShape.endpointId.stringSpec({\n meaning: 'Stable FK to `webhookConfig.endpoints[].id` at enqueue time so historical rows survive endpoint renames/URL changes.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n channel: schemaShape.channel.enumSpec({\n meaning: 'Which M2M channel the originating operation fired (must be compatible with the resource’s primary scope in the dispatcher).',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreM2MNotificationChannel',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION]: { meaning: 'Org-scoped outbound webhook (requires an org id in the execution context).' },\n [CoreM2MNotificationChannel.WEBHOOK_APPLICATION]: { meaning: 'App-scoped outbound webhook (resolves the app id from `appConfigService`).' },\n },\n }),\n resourceIdentifier: schemaShape.resourceIdentifier.stringSpec({\n meaning: 'Originating `CoreResourceType` string (or app resource key) that produced the M2M payload.',\n semanticRole: 'code',\n }),\n operationIdentifier: schemaShape.operationIdentifier.stringSpec({\n meaning: 'Operation or custom-op identifier that the serializer used when building the POST body (used for support correlation).',\n semanticRole: 'code',\n }),\n variantKey: schemaShape.variantKey.stringSpec({\n meaning: 'Optional default vs named operation variant, when the originating op exposed multiple API variants.',\n }),\n httpUrl: schemaShape.httpUrl.stringSpec({\n meaning: 'Snapshot of the destination URL that was used for this attempt (duplicated from the config so URL edits do not rewrite history).',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'uri',\n }),\n payloadHash: schemaShape.payloadHash.stringSpec({\n meaning: 'SHA-256 of the JSON body, mirrored into the signed JWT and used to detect replays or tampering.',\n semanticRole: 'code',\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Current queue/delivery state for the worker and admin filters.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'M2MWebhookDeliveryLogStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.CONST_OBJECT,\n },\n values: {\n [M2MWebhookDeliveryLogStatus.PENDING]: { meaning: 'Row is either waiting in the queue or has been re-queued for another attempt after a transient failure.' },\n [M2MWebhookDeliveryLogStatus.IN_FLIGHT]: { meaning: 'A worker currently holds a lease and is trying to send the HTTP request.' },\n [M2MWebhookDeliveryLogStatus.DELIVERED]: { meaning: 'HTTP success path with signature validated at the consumer; terminal success.' },\n [M2MWebhookDeliveryLogStatus.FAILED]: { meaning: 'Terminal failure: exhausted attempt budget or a non-retryable 4xx class error.' },\n },\n }),\n attemptCount: schemaShape.attemptCount.numberSpec({\n meaning: 'Number of send attempts (including successes that still increment the counter, per worker policy).',\n unit: 'count',\n }),\n lastAttemptAt: schemaShape.lastAttemptAt.dateSpec({\n meaning: 'When the most recent send attempt started or finished, depending on writer semantics.',\n temporalRole: 'occurred',\n }),\n nextAttemptAt: schemaShape.nextAttemptAt.dateSpec({\n meaning: 'When the next retry is eligible; indexed for the worker’s polling query on `(status, nextAttemptAt)`.',\n temporalRole: 'scheduled',\n }),\n responseStatus: schemaShape.responseStatus.numberSpec({\n meaning: 'Last observed HTTP status code (present even for successes for observability).',\n }),\n responseBodyTruncated: schemaShape.responseBodyTruncated.stringSpec({\n meaning: 'First 4 KB of the HTTP response (when captured) to help debug remote listener failures.',\n }),\n failureReason: schemaShape.failureReason.stringSpec({\n meaning: 'Human-readable last error string when `status=failed` (worker-set).',\n }),\n signatureJti: schemaShape.signatureJti.stringSpec({\n meaning: 'Matches the JWT `jti` and `X-Webhook-Signature` header so the consumer can look up the exact signing key material.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n deliveredAt: schemaShape.deliveredAt.dateSpec({\n meaning: 'Timestamp when a terminal `DELIVERED` state was recorded.',\n temporalRole: 'occurred',\n }),\n failedAt: schemaShape.failedAt.dateSpec({\n meaning: 'Timestamp when a terminal `FAILED` state was recorded.',\n temporalRole: 'occurred',\n }),\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the row was enqueued (immutable upper bound for retention policies).',\n temporalRole: 'creation',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When status / attempt counters / timestamps last changed for this id.',\n temporalRole: 'modified',\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Inspect a single log row in admin or support UIs using the fields documented above (status, URL snapshot, hashes, HTTP evidence, correlation ids). The Mongo `payload` column is `z.unknown()` at rest and is not expanded in `fields.*` — when the runtime returns it, treat it as sensitive; see `businessConstraints`.',\n outcome: 'Operators can see whether a business event was delivered and, if not, the precise failure class.',\n whenToUse: 'Use when triaging a customer ticket referencing a `deliveryLogId` or `signatureJti`.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The delivery log row for the supplied id was found and its status, URL snapshot, HTTP evidence, and signing metadata are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id in this scope (never enqueued, or already removed by `PURGE_OLD`).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role; because `payload` may embed serialized customer data, reads are gated to roles that already see that data (see `businessConstraints`).' },\n ],\n idempotent: true,\n examples: [{\n title: 'Inspect a failed order webhook delivery',\n response: failedDeliveryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: { examples: [] },\n summary: { examples: [] },\n },\n },\n [Op.LIST]: {\n purpose: 'Browse recent delivery attempts in chronological order, filtered by the repository’s search defaults.',\n outcome: 'Admins can scan for spikes in `FAILED` rows or revalidation after URL rotation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) chronological page of delivery log rows in this scope.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to browse the delivery log (rows may carry serialized customer payloads).' },\n ],\n idempotent: true,\n examples: [{\n title: 'Browse recent delivery attempts',\n request: { page: 1, limit: 20, sort: 'createdAt:desc' },\n response: deliveryPageExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: { examples: [] },\n summary: { examples: [] },\n },\n },\n [Op.SEARCH]: {\n purpose: 'Filter log rows on status, `endpointId`, channel, date windows, and operation identifiers to isolate incidents.',\n outcome: 'Security and ops can produce CSV-grade subsets without an external data warehouse in small deployments.',\n whenToUse: 'Use in admin dashboards; heavy analytics may still go to a warehouse — this is the operational “small query” path.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of delivery log rows matching the status / endpoint / channel / date-window / operation filters.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to search the delivery log.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Find failures for one endpoint',\n request: {\n q: 'orders',\n status: M2MWebhookDeliveryLogStatus.FAILED,\n channel,\n endpointId: 'orders-primary',\n page: 1,\n limit: 20,\n sort: 'createdAt:desc',\n },\n response: deliveryPageExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.CREATE]: {\n purpose: 'Enqueue a new delivery row when a resource operation with an M2M channel fires.',\n outcome: 'The worker pool can find ready rows via the `(status, nextAttemptAt)` index.',\n whenToUse: 'Repository-only: invoked by the dispatcher, never by a human HTTP client.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A `PENDING` delivery row was enqueued and is now discoverable by the worker pool. Internal/service write path — the dispatcher fires this, never a human HTTP client.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The enqueue payload fails schema validation (e.g. missing `endpointId`, `httpUrl`, or `channel`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-dispatcher caller attempts to enqueue a delivery row directly.' },\n ],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Drive the delivery lifecycle status transitions (PENDING → IN_FLIGHT → DELIVERED/FAILED) with `attemptCount` / `nextAttemptAt` / terminal-timestamp writes.',\n outcome: 'The worker can advance a row through its lifecycle so the `(status, nextAttemptAt)` index stays accurate for polling and back-off.',\n whenToUse: 'Repository-only: invoked by the dispatcher/worker (`markInFlight` / `markDelivered` / `markFailedAttempt` / `markFinallyFailed`), never by a human HTTP client — admins act via the `RETRY` custom operation.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The delivery row’s status / attempt counters / timestamps were updated. Internal/service write path — the worker fires this, never a human HTTP client.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to update.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-dispatcher caller attempts to mutate a delivery row directly; UI flows must use the `RETRY` custom operation.' },\n ],\n idempotent: false,\n },\n [Op.DELETE]: {\n purpose: 'Reserved for `PURGE_OLD` and internal cleanup — no public single-row delete to keep the audit trail honest.',\n outcome: 'Old rows are removed in bulk, not opportunistically per UI click, matching the high-risk gating in the config.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'An internal/maintenance single-row delete completed; no body is returned. Intentionally not a public per-click operation — routine cleanup goes through `PURGE_OLD`.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to delete.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an operator authorized for exceptional single-row maintenance deletes; UI flows must use `PURGE_OLD` instead.' },\n ],\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'Bulk twin of `DELETE` — the actual `PURGE_OLD` write path: one repository round trip drops every terminal `DELIVERED`/`FAILED` row older than the requested retention window.',\n outcome: 'Retention purges scale with one bulk delete instead of N per-row deletes; non-terminal rows are never touched (the drain owns them).',\n whenToUse: 'Repository-only — never a public HTTP surface. Admins purge via the `PURGE_OLD` custom operation, which owns request validation and the purge summary response.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The matched terminal rows were bulk-deleted; the `PURGE_OLD` wrapper reports the count in its own summary response.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-system caller attempts the repository-only bulk delete directly; UI/API flows must use `PURGE_OLD`.' },\n ],\n idempotent: true,\n },\n [M2MWebhookDeliveryLog_Operations.RETRY]: {\n operationId: M2MWebhookDeliveryLog_Operations.RETRY,\n purpose: 'Re-queue a `FAILED` row (reset to pending / zero attempts per worker contract) for manual replay.',\n outcome: 'Operators can attempt redelivery after fixing the downstream listener without re-sending the originating business event.',\n whenToUse: 'Use after a partner confirms their endpoint or certificate is healthy again.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The `FAILED` row was reset to `PENDING` with attempt counters cleared, and the worker pool will re-attempt delivery; the re-queued row is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No delivery log row exists for the supplied id to retry.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to trigger a manual redelivery.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The row is not in a retryable terminal `FAILED` state (e.g. it is still `PENDING`/`IN_FLIGHT`, or already `DELIVERED`), so a manual re-queue is illegal.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Retry after the receiver recovers',\n request: {},\n response: retriedDeliveryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [M2MWebhookDeliveryLog_Operations.PURGE_OLD]: {\n operationId: M2MWebhookDeliveryLog_Operations.PURGE_OLD,\n purpose: 'Bulk-delete rows older than `N` days (delivered or failed) to bound storage in busy tenants.',\n outcome: 'Tenants can comply with data-retention policy without manual Mongo shell intervention.',\n whenToUse: 'Use in scheduled admin jobs (or manual compliance runs) with explicit `olderThanDays` guardrails.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'Rows older than the supplied `olderThanDays` window were bulk-deleted and a count of purged rows is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The `olderThanDays` guardrail is missing, non-numeric, or below the configured minimum retention floor.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to run a bulk retention purge.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Purge terminal delivery history older than 30 days',\n request: { olderThanDays: 30 },\n response: {\n purgedCount: 47,\n message: 'Purged 47 delivered/failed webhook deliveries older than 30 day(s).',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n businessConstraints: [\n 'The `payload` field stores `z.unknown()` JSON at rest (full operation serialization per plan). It is intentionally not expanded into `fields.*` here because the shape is the arbitrary API response; treat any READ that surfaces `payload` as PII/secret handling.',\n 'Do not use `Op.DELETE` for routine UI — prefer `PURGE_OLD` to maintain structured audit logs; single-row delete is for exceptional maintenance.',\n 'Because payloads may embed serialized API responses, treat READ/LIST as sensitive: scope RBAC to org-admin or app-super-admin roles that already see customer data.',\n ],\n }),\n { resourcePrimaryScope: m2mDeliveryLogResourcePrimaryScope[resourceType] },\n );\n}\n\nexport const organizationM2mWebhookDeliveryLogResourceSpecification = buildM2mWebhookDeliveryLogSpecification(\n CoreResourceType.ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG,\n 'ORGANIZATION_M2M_WEBHOOK_DELIVERY_LOG',\n);\n\nexport const applicationM2mWebhookDeliveryLogResourceSpecification = buildM2mWebhookDeliveryLogSpecification(\n CoreResourceType.APPLICATION_M2M_WEBHOOK_DELIVERY_LOG,\n 'APPLICATION_M2M_WEBHOOK_DELIVERY_LOG',\n);\n"]}
|
package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @see `.cursor/plans/notification-badges-polymorphism-refactor.md`
|
|
18
18
|
*/
|
|
19
19
|
import { CoreResourceOperation as Op, ResourcePrimaryScope } from '@wildo-ai/saas-models';
|
|
20
|
-
export declare const userNotificationBadgesResourceSpecification: import("../../../_core").ResourceSpecificationConfig<undefined, Op.READ | Op.UPDATE | Op.DELETE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
|
|
20
|
+
export declare const userNotificationBadgesResourceSpecification: import("../../../_core").ResourceSpecificationConfig<undefined, Op.READ | Op.UPDATE | Op.UPDATE_MANY | Op.DELETE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
|
|
21
21
|
identifier: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
|
|
22
22
|
_id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
|
|
23
23
|
count: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodNumber>;
|
package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-badges.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/notification-badges.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAQH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAI3B,oBAAoB,EAErB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"notification-badges.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/notification-badges.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAQH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAI3B,oBAAoB,EAErB,MAAM,uBAAuB,CAAC;AA4M/B,eAAO,MAAM,2CAA2C;;;;;;;;iCAkGvD,CAAC;AAEF,eAAO,MAAM,mDAAmD;;;;;;;;iCA+F/D,CAAC"}
|
package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js
CHANGED
|
@@ -20,6 +20,7 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
|
20
20
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
|
|
21
21
|
import { CoreResourceOperation as Op, NotificationBadgeOrganizationSchema, NotificationBadgeUserSelfSchema, organizationNotificationBadgesResourceConfiguration_InitializationFactory, ResourcePrimaryScope, userNotificationBadgesResourceConfiguration_InitializationFactory, } from '@wildo-ai/saas-models';
|
|
22
22
|
import { HttpResponseStatusCode, resourceSpecification } from '../../../_core/index.js';
|
|
23
|
+
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
23
24
|
const BADGE_LIST_REQUEST_EXAMPLE = {
|
|
24
25
|
page: 1,
|
|
25
26
|
limit: 20,
|
|
@@ -192,6 +193,7 @@ export const userNotificationBadgesResourceSpecification = resourceSpecification
|
|
|
192
193
|
businessRole: 'Lets a client restore per-user navigation and inbox counts without calculating each count locally.',
|
|
193
194
|
lifecycleRole: 'A badge row appears after its identifier first produces a count, changes as the underlying event or query changes, and normally resets to zero instead of being deleted.',
|
|
194
195
|
audience: LabelAudience.END_USER,
|
|
196
|
+
subDomain: EngineResourceSubDomain.NOTIFICATIONS,
|
|
195
197
|
codeHandling: {
|
|
196
198
|
mainSchema: {
|
|
197
199
|
packageName: '@wildo-ai/saas-models',
|
|
@@ -278,6 +280,7 @@ export const organizationNotificationBadgesResourceSpecification = resourceSpeci
|
|
|
278
280
|
businessRole: 'Lets every authorized organization member see the same outstanding-work indicators in shared navigation and dashboards.',
|
|
279
281
|
lifecycleRole: 'A badge row appears after its identifier first produces a count, changes as the shared condition changes, and normally resets to zero instead of being deleted.',
|
|
280
282
|
audience: LabelAudience.END_USER,
|
|
283
|
+
subDomain: EngineResourceSubDomain.NOTIFICATIONS,
|
|
281
284
|
codeHandling: {
|
|
282
285
|
mainSchema: {
|
|
283
286
|
packageName: '@wildo-ai/saas-models',
|
package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-badges.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/notification-badges.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,mCAAmC,EACnC,+BAA+B,EAC/B,yEAAyE,EACzE,oBAAoB,EACpB,iEAAiE,GAClE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAuB5F,MAAM,0BAA0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;YACD,YAAY,EAAE,0BAA0B;YACxC,cAAc,EAAE,kCAAkC;SACnD,CAAC;QACF,GAAG,yBAAyB,CAAC,uBAAuB,CAAC;KACtD;IAED,mBAAmB,EAAE;QACnB,mOAAmO;QACnO,sNAAsN;QACtN,+GAA+G;QAC/G,mJAAmJ;KACpJ;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resources: `userNotificationBadges` + `organizationNotificationBadges` — Wildo SaaS engine specification (backend-only).\n *\n * Polymorphic pair implemented as **two side-by-side factories** (lifecycle-state precedent), not\n * `createPolymorphicResourceConfigurations`, because USER and ORG variants differ in Zod shape, role\n * surfaces, and parent scope anchors.\n *\n * Inputs:\n * - Schemas: engine/saas-models/src/notifications/notification-badges.schemas.ts\n * → `NotificationBadgeUserSelfSchema`, `NotificationBadgeOrganizationSchema`\n * - Factories: engine/saas-models/src/notifications/notification-badges.shared.resources-config.schemas.ts\n * → `userNotificationBadgesResourceConfiguration_InitializationFactory`,\n * → `organizationNotificationBadgesResourceConfiguration_InitializationFactory`\n * - Custom operations: none\n * - UI presets: none\n *\n * @see `.cursor/plans/notification-badges-polymorphism-refactor.md`\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 CoreResourceOperation as Op,\n NotificationBadgeOrganizationSchema,\n NotificationBadgeUserSelfSchema,\n organizationNotificationBadgesResourceConfiguration_InitializationFactory,\n ResourcePrimaryScope,\n userNotificationBadgesResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\n\n/**\n * One authored auth-failure scenario for the READ/LIST surface, parameterized\n * per polymorphic variant. The USER_SELF variant fails closed with `401`\n * (an unauthenticated caller has no signed-in identity whose private counts\n * to read), while the ORG variant fails with `403` (an authenticated member\n * of the wrong org/role). Badge rows are lazily materialized, so the read\n * surface intentionally does NOT author a `404`: a never-yet-incremented\n * counter resolves to a zero/default count rather than a missing-resource\n * error.\n */\ntype BadgeReadAuthScenario = {\n code: HttpResponseStatusCode.UNAUTHORIZED_401 | HttpResponseStatusCode.FORBIDDEN_403;\n when: string;\n};\n\ntype BadgeReadListDocumentation = {\n readonly readAuthError: BadgeReadAuthScenario;\n readonly badgeExample: Readonly<Record<string, unknown>>;\n readonly summaryExample: Readonly<Record<string, unknown>>;\n};\n\nconst BADGE_LIST_REQUEST_EXAMPLE = {\n page: 1,\n limit: 20,\n sort: 'updatedAt:desc',\n} as const;\n\nfunction badgePage(row: Readonly<Record<string, unknown>>) {\n return {\n data: [row],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n } as const;\n}\n\n/**\n * Build the shared READ/LIST operation prose for one badge variant, layering\n * the variant-specific auth-failure scenario on top of the common\n * success-path semantics. Returns freshly-constructed objects (mutable\n * `responseStatuses` / `errorScenarios` arrays) so the result splices cleanly\n * into each variant's `operations` map.\n */\nconst buildBadgeReadListOps = ({\n readAuthError,\n badgeExample,\n summaryExample,\n}: BadgeReadListDocumentation) => ({\n [Op.READ]: {\n purpose: 'Read one materialized notification-badge counter in the caller’s user or organization scope.',\n outcome: 'The caller receives the application-defined badge identifier, its current non-negative count, and the time it last changed.',\n whenToUse: 'Use when a client needs to refresh one known badge row by its API id. Use LIST to discover all materialized badge identifiers in the scope.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The materialized badge row is visible in the caller’s scope and its identifier, count, and timestamps are returned.' },\n ],\n errorScenarios: [\n readAuthError,\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No materialized badge row with the supplied API id exists in the caller’s scope. An identifier that has never produced a row is absent rather than synthesized by this endpoint.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Read one current notification badge',\n response: badgeExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Read one notification badge with available relationship context',\n response: badgeExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Read the compact badge count',\n response: summaryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List the notification-badge rows that have been materialized in the caller’s user or organization scope.',\n outcome: 'The caller receives a paginated inventory of application-defined badge identifiers and their current counts.',\n whenToUse: 'Use when synchronizing badge state after reconnecting a session or switching organization context.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) collection of materialized badge rows in the caller’s scope.' },\n ],\n errorScenarios: [readAuthError],\n idempotent: true,\n examples: [{\n title: 'List current notification badges',\n request: BADGE_LIST_REQUEST_EXAMPLE,\n response: badgePage(badgeExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'List notification badges with available relationship context',\n request: BADGE_LIST_REQUEST_EXAMPLE,\n response: badgePage(badgeExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'List compact badge counts',\n request: BADGE_LIST_REQUEST_EXAMPLE,\n response: badgePage(summaryExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n});\n\n/**\n * Build the shared CREATE/UPDATE operation prose for one badge variant. Both\n * writes are `REPOSITORY_ONLY` (dispatcher-driven), so a `403` is authored for\n * any non-dispatcher caller across both variants; the message names the\n * variant's role token. Returns freshly-constructed objects so the mutable\n * arrays splice into each variant's `operations` map.\n */\nconst buildBadgeCreateUpdateOps = (writeRoleLabel: string) => ({\n [Op.CREATE]: {\n purpose: 'Insert a new badge row when the dispatcher first materializes a badge identifier for this scope.',\n outcome: 'The platform can persist `count` and timestamps for a badge that did not yet exist in MongoDB.',\n whenToUse: 'Not a public app call — repository-only writers (`REPOSITORY_ONLY`) drive this from `NotificationBadgeBackendService`.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A badge row was materialized with its initial `count` and timestamps. Internal/service write path — `NotificationBadgeBackendService` drives this, not a public app call.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The badge row fails schema validation (e.g. a negative `count` or an unrecognized identifier).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: `A caller without the ${writeRoleLabel} repository role attempts to create a badge row — materialization is dispatcher-only.` },\n ],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Adjust the counter (increment, decrement, set) or reset semantics for an existing badge row.',\n outcome: 'The UI layer receives updated counts through the normal resource read path and WebSocket bridge after the write.',\n whenToUse: 'Not a public app call — internal notification dispatchers own these writes.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The counter was adjusted (increment / decrement / set / reset-to-zero) and the updated badge row is returned. Internal/service write path owned by the notification dispatchers.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No badge row exists for the (scope, identifier) pair to adjust — the dispatcher must CREATE it before incrementing.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The counter mutation fails schema validation (e.g. a non-numeric delta).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: `A caller without the ${writeRoleLabel} repository role attempts to mutate a counter — only internal dispatchers own badge writes.` },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the badge row when its owning scope entity (user or organization) is deleted (composition `onParentDelete` cascade).',\n outcome: 'The badge row is physically removed together with its owning user/organization — normal badge lifecycle resets `count` to 0, but a deleted parent takes its badges with it rather than orphaning them.',\n whenToUse: 'Not a public app call — invoked only by the composition delete cascade when the owning user/org is deleted.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The badge row was deleted as part of the owning scope entity’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (super-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});\n\nconst USER_BADGE_EXAMPLE = {\n _id: 'user_badge_01JEXAMPLE',\n identifier: 'incomplete_items',\n scope: ResourcePrimaryScope.USER_SELF,\n userId: 'user_01JEXAMPLE',\n count: 4,\n createdAt: '2026-08-18T08:00:00.000Z',\n updatedAt: '2026-08-20T14:35:00.000Z',\n} as const;\n\nconst USER_BADGE_SUMMARY_EXAMPLE = {\n _id: USER_BADGE_EXAMPLE._id,\n identifier: USER_BADGE_EXAMPLE.identifier,\n count: USER_BADGE_EXAMPLE.count,\n updatedAt: USER_BADGE_EXAMPLE.updatedAt,\n} as const;\n\nconst ORGANIZATION_BADGE_EXAMPLE = {\n _id: 'organization_badge_01JEXAMPLE',\n identifier: 'pending_approvals',\n scope: ResourcePrimaryScope.ORGANIZATIONS,\n organizationId: 'org_01JEXAMPLE',\n count: 7,\n createdAt: '2026-08-17T09:00:00.000Z',\n updatedAt: '2026-08-20T15:10:00.000Z',\n} as const;\n\nconst ORGANIZATION_BADGE_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_BADGE_EXAMPLE._id,\n identifier: ORGANIZATION_BADGE_EXAMPLE.identifier,\n count: ORGANIZATION_BADGE_EXAMPLE.count,\n updatedAt: ORGANIZATION_BADGE_EXAMPLE.updatedAt,\n} as const;\n\nexport const userNotificationBadgesResourceSpecification = resourceSpecification(\n userNotificationBadgesResourceConfiguration_InitializationFactory,\n NotificationBadgeUserSelfSchema,\n ({ schemaShape }) => ({\n purpose: 'Expose the current notification-badge counters belonging to the signed-in user, keyed by application-defined badge identifiers.',\n businessRole: 'Lets a client restore per-user navigation and inbox counts without calculating each count locally.',\n lifecycleRole: 'A badge row appears after its identifier first produces a count, changes as the underlying event or query changes, and normally resets to zero instead of being deleted.',\n audience: LabelAudience.END_USER,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'NotificationBadgeUserSelfSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'userNotificationBadgesResourceConfiguration_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: 'USER_NOTIFICATION_BADGES',\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 },\n notes: [\n 'USER variant: READ/LIST → `APP_USER` via `API_CALL`; CREATE/UPDATE → `APP_ADMIN_SUPER_ADMIN` via `REPOSITORY_ONLY` (dispatcher-only writes).',\n 'APPLICATION-scoped badges were removed in the polymorphism refactor — `NotificationScopeSchema` is `USER_SELF | ORGANIZATIONS` only.',\n 'Runtime `userNotifications[]` / `m2mNotifications[]` are absent on this resource — WebSocket/badge fan-out is handled in `NotificationBadgeBackendService`, not here.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'MongoDB document id for this user-scoped badge row.',\n whyItMatters: 'Stable anchor for updates and list projections per user + identifier.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n userId: schemaShape.userId.foreignKeySpec({\n meaning: 'The Wildo `users` row this badge count belongs to.',\n whyItMatters: 'Filters LIST/READ through the user-self access strategy so a user can never read another user’s counts.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n count: schemaShape.count.numberSpec({\n meaning: 'Non-negative badge counter displayed in UI — reset paths write 0 instead of deleting the row.',\n whyItMatters: 'Drives the numeric bubble next to the icon the user actually sees after notification fan-out.',\n importance: FieldSemanticImportance.PRIMARY,\n unit: 'count',\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When this badge document was first materialized for the (user, identifier) pair.',\n temporalRole: 'creation',\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the counter or metadata last changed.',\n temporalRole: 'modified',\n }),\n },\n\n operations: {\n ...buildBadgeReadListOps({\n readAuthError: {\n code: HttpResponseStatusCode.UNAUTHORIZED_401,\n when: 'The request carries no authenticated user whose private badge counters can be read.',\n },\n badgeExample: USER_BADGE_EXAMPLE,\n summaryExample: USER_BADGE_SUMMARY_EXAMPLE,\n }),\n ...buildBadgeCreateUpdateOps('APP_ADMIN_SUPER_ADMIN'),\n },\n\n businessConstraints: [\n 'The `scope` field is a `z.literal(ResourcePrimaryScope.USER_SELF)` discriminant on this schema — it is intentionally not expanded in `fields` because Zod literals do not expose the `*Spec` decorator helpers the specification layer expects on every entry.',\n 'The `identifier` field uses `NotificationBadgeIdentifierSchema` (`z.string().min(1)`). No canonical (core) identifiers ship today — the aspirational placeholders were removed with the launcher-badge retract; a `CoreNotificationBadgeIdentifiers` enum is unioned back in when the surfacing is reintroduced with a real producer. Document badge keys in prose here.',\n 'There is no PUBLIC/API delete; badge counts reset to 0 in normal use. A REPOSITORY_ONLY DELETE was added solely for the composition `onParentDelete` cascade (physical teardown when the owning user is deleted). Other compliance “forget me” paths still clear counts or drop rows via repository tooling that understands badge semantics.',\n 'Writes are not intended for public arbitrary callers — only internal dispatchers and admin automation should touch CREATE/UPDATE despite the `APP_ADMIN_SUPER_ADMIN` role token on the repository variant.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.USER_SELF },\n);\n\nexport const organizationNotificationBadgesResourceSpecification = resourceSpecification(\n organizationNotificationBadgesResourceConfiguration_InitializationFactory,\n NotificationBadgeOrganizationSchema,\n ({ schemaShape }) => ({\n purpose: 'Expose shared notification-badge counters for one organization, keyed by application-defined badge identifiers.',\n businessRole: 'Lets every authorized organization member see the same outstanding-work indicators in shared navigation and dashboards.',\n lifecycleRole: 'A badge row appears after its identifier first produces a count, changes as the shared condition changes, and normally resets to zero instead of being deleted.',\n audience: LabelAudience.END_USER,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'NotificationBadgeOrganizationSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationNotificationBadgesResourceConfiguration_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_NOTIFICATION_BADGES',\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 },\n notes: [\n 'ORG variant: READ/LIST → `ORG_MEMBER` via `API_CALL`; CREATE/UPDATE → `APP_ADMIN_SUPER_ADMIN` via `REPOSITORY_ONLY`.',\n 'Pairs with a separate `USER_NOTIFICATION_BADGES` resource type and Mongo collection (true polymorphic split, not a shared polymorphic factory map).',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Document id for the organization-level badge instance.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization whose aggregate count this badge represents.',\n whyItMatters: 'Used by the access layer so org members read shared counts while other tenants never see the row.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n count: schemaShape.count.numberSpec({\n meaning: 'Non-negative org aggregate for the given identifier.',\n importance: FieldSemanticImportance.PRIMARY,\n unit: 'count',\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the org-level badge was first materialized for this org + identifier pair.',\n temporalRole: 'creation',\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the aggregate counter or metadata was last written.',\n temporalRole: 'modified',\n }),\n },\n\n operations: {\n ...buildBadgeReadListOps({\n readAuthError: {\n code: HttpResponseStatusCode.FORBIDDEN_403,\n when: 'The caller is not an organization member allowed to read the organization’s shared badge counters.',\n },\n badgeExample: ORGANIZATION_BADGE_EXAMPLE,\n summaryExample: ORGANIZATION_BADGE_SUMMARY_EXAMPLE,\n }),\n ...buildBadgeCreateUpdateOps('APP_ADMIN_SUPER_ADMIN'),\n },\n\n businessConstraints: [\n 'The `scope` field is a `z.literal(ResourcePrimaryScope.ORGANIZATIONS)` discriminant — omitted from `fields` for the same Zod-literal + `*Spec` decorator reason as the USER variant (see the USER variant `businessConstraints`).',\n 'The `identifier` field matches the USER variant (`NotificationBadgeIdentifierSchema`) — see the USER variant `businessConstraints` bullet that explains the enum ∪ string union and why it is omitted from `fields`.',\n 'Any org member with LIST rights sees the same aggregate count — it is not a per-seat personalization surface.',\n 'Because writes are `REPOSITORY_ONLY`, product teams must not expose raw repository endpoints for badge tuning without a dedicated admin workflow.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"notification-badges.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/notification-badges.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB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,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC;YACxC,OAAO,EAAE,iFAAiF;YAC1F,YAAY,EAAE,UAAU;SACzB,CAAC;QAEF,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC;YACxC,OAAO,EAAE,0DAA0D;YACnE,YAAY,EAAE,UAAU;SACzB,CAAC;KACH;IAED,UAAU,EAAE;QACV,GAAG,qBAAqB,CAAC;YACvB,aAAa,EAAE;gBACb,IAAI,EAAE,sBAAsB,CAAC,aAAa;gBAC1C,IAAI,EAAE,oGAAoG;aAC3G;YACD,YAAY,EAAE,0BAA0B;YACxC,cAAc,EAAE,kCAAkC;SACnD,CAAC;QACF,GAAG,yBAAyB,CAAC,uBAAuB,CAAC;KACtD;IAED,mBAAmB,EAAE;QACnB,mOAAmO;QACnO,sNAAsN;QACtN,+GAA+G;QAC/G,mJAAmJ;KACpJ;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resources: `userNotificationBadges` + `organizationNotificationBadges` — Wildo SaaS engine specification (backend-only).\n *\n * Polymorphic pair implemented as **two side-by-side factories** (lifecycle-state precedent), not\n * `createPolymorphicResourceConfigurations`, because USER and ORG variants differ in Zod shape, role\n * surfaces, and parent scope anchors.\n *\n * Inputs:\n * - Schemas: engine/saas-models/src/notifications/notification-badges.schemas.ts\n * → `NotificationBadgeUserSelfSchema`, `NotificationBadgeOrganizationSchema`\n * - Factories: engine/saas-models/src/notifications/notification-badges.shared.resources-config.schemas.ts\n * → `userNotificationBadgesResourceConfiguration_InitializationFactory`,\n * → `organizationNotificationBadgesResourceConfiguration_InitializationFactory`\n * - Custom operations: none\n * - UI presets: none\n *\n * @see `.cursor/plans/notification-badges-polymorphism-refactor.md`\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 CoreResourceOperation as Op,\n NotificationBadgeOrganizationSchema,\n NotificationBadgeUserSelfSchema,\n organizationNotificationBadgesResourceConfiguration_InitializationFactory,\n ResourcePrimaryScope,\n userNotificationBadgesResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * One authored auth-failure scenario for the READ/LIST surface, parameterized\n * per polymorphic variant. The USER_SELF variant fails closed with `401`\n * (an unauthenticated caller has no signed-in identity whose private counts\n * to read), while the ORG variant fails with `403` (an authenticated member\n * of the wrong org/role). Badge rows are lazily materialized, so the read\n * surface intentionally does NOT author a `404`: a never-yet-incremented\n * counter resolves to a zero/default count rather than a missing-resource\n * error.\n */\ntype BadgeReadAuthScenario = {\n code: HttpResponseStatusCode.UNAUTHORIZED_401 | HttpResponseStatusCode.FORBIDDEN_403;\n when: string;\n};\n\ntype BadgeReadListDocumentation = {\n readonly readAuthError: BadgeReadAuthScenario;\n readonly badgeExample: Readonly<Record<string, unknown>>;\n readonly summaryExample: Readonly<Record<string, unknown>>;\n};\n\nconst BADGE_LIST_REQUEST_EXAMPLE = {\n page: 1,\n limit: 20,\n sort: 'updatedAt:desc',\n} as const;\n\nfunction badgePage(row: Readonly<Record<string, unknown>>) {\n return {\n data: [row],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n } as const;\n}\n\n/**\n * Build the shared READ/LIST operation prose for one badge variant, layering\n * the variant-specific auth-failure scenario on top of the common\n * success-path semantics. Returns freshly-constructed objects (mutable\n * `responseStatuses` / `errorScenarios` arrays) so the result splices cleanly\n * into each variant's `operations` map.\n */\nconst buildBadgeReadListOps = ({\n readAuthError,\n badgeExample,\n summaryExample,\n}: BadgeReadListDocumentation) => ({\n [Op.READ]: {\n purpose: 'Read one materialized notification-badge counter in the caller’s user or organization scope.',\n outcome: 'The caller receives the application-defined badge identifier, its current non-negative count, and the time it last changed.',\n whenToUse: 'Use when a client needs to refresh one known badge row by its API id. Use LIST to discover all materialized badge identifiers in the scope.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The materialized badge row is visible in the caller’s scope and its identifier, count, and timestamps are returned.' },\n ],\n errorScenarios: [\n readAuthError,\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No materialized badge row with the supplied API id exists in the caller’s scope. An identifier that has never produced a row is absent rather than synthesized by this endpoint.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Read one current notification badge',\n response: badgeExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'Read one notification badge with available relationship context',\n response: badgeExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'Read the compact badge count',\n response: summaryExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List the notification-badge rows that have been materialized in the caller’s user or organization scope.',\n outcome: 'The caller receives a paginated inventory of application-defined badge identifiers and their current counts.',\n whenToUse: 'Use when synchronizing badge state after reconnecting a session or switching organization context.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) collection of materialized badge rows in the caller’s scope.' },\n ],\n errorScenarios: [readAuthError],\n idempotent: true,\n examples: [{\n title: 'List current notification badges',\n request: BADGE_LIST_REQUEST_EXAMPLE,\n response: badgePage(badgeExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: 'List notification badges with available relationship context',\n request: BADGE_LIST_REQUEST_EXAMPLE,\n response: badgePage(badgeExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: 'List compact badge counts',\n request: BADGE_LIST_REQUEST_EXAMPLE,\n response: badgePage(summaryExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n});\n\n/**\n * Build the shared CREATE/UPDATE operation prose for one badge variant. Both\n * writes are `REPOSITORY_ONLY` (dispatcher-driven), so a `403` is authored for\n * any non-dispatcher caller across both variants; the message names the\n * variant's role token. Returns freshly-constructed objects so the mutable\n * arrays splice into each variant's `operations` map.\n */\nconst buildBadgeCreateUpdateOps = (writeRoleLabel: string) => ({\n [Op.CREATE]: {\n purpose: 'Insert a new badge row when the dispatcher first materializes a badge identifier for this scope.',\n outcome: 'The platform can persist `count` and timestamps for a badge that did not yet exist in MongoDB.',\n whenToUse: 'Not a public app call — repository-only writers (`REPOSITORY_ONLY`) drive this from `NotificationBadgeBackendService`.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A badge row was materialized with its initial `count` and timestamps. Internal/service write path — `NotificationBadgeBackendService` drives this, not a public app call.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The badge row fails schema validation (e.g. a negative `count` or an unrecognized identifier).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: `A caller without the ${writeRoleLabel} repository role attempts to create a badge row — materialization is dispatcher-only.` },\n ],\n idempotent: false,\n },\n [Op.UPDATE]: {\n purpose: 'Adjust the counter (increment, decrement, set) or reset semantics for an existing badge row.',\n outcome: 'The UI layer receives updated counts through the normal resource read path and WebSocket bridge after the write.',\n whenToUse: 'Not a public app call — internal notification dispatchers own these writes.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The counter was adjusted (increment / decrement / set / reset-to-zero) and the updated badge row is returned. Internal/service write path owned by the notification dispatchers.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No badge row exists for the (scope, identifier) pair to adjust — the dispatcher must CREATE it before incrementing.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The counter mutation fails schema validation (e.g. a non-numeric delta).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: `A caller without the ${writeRoleLabel} repository role attempts to mutate a counter — only internal dispatchers own badge writes.` },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the badge row when its owning scope entity (user or organization) is deleted (composition `onParentDelete` cascade).',\n outcome: 'The badge row is physically removed together with its owning user/organization — normal badge lifecycle resets `count` to 0, but a deleted parent takes its badges with it rather than orphaning them.',\n whenToUse: 'Not a public app call — invoked only by the composition delete cascade when the owning user/org is deleted.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The badge row was deleted as part of the owning scope entity’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (super-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});\n\nconst USER_BADGE_EXAMPLE = {\n _id: 'user_badge_01JEXAMPLE',\n identifier: 'incomplete_items',\n scope: ResourcePrimaryScope.USER_SELF,\n userId: 'user_01JEXAMPLE',\n count: 4,\n createdAt: '2026-08-18T08:00:00.000Z',\n updatedAt: '2026-08-20T14:35:00.000Z',\n} as const;\n\nconst USER_BADGE_SUMMARY_EXAMPLE = {\n _id: USER_BADGE_EXAMPLE._id,\n identifier: USER_BADGE_EXAMPLE.identifier,\n count: USER_BADGE_EXAMPLE.count,\n updatedAt: USER_BADGE_EXAMPLE.updatedAt,\n} as const;\n\nconst ORGANIZATION_BADGE_EXAMPLE = {\n _id: 'organization_badge_01JEXAMPLE',\n identifier: 'pending_approvals',\n scope: ResourcePrimaryScope.ORGANIZATIONS,\n organizationId: 'org_01JEXAMPLE',\n count: 7,\n createdAt: '2026-08-17T09:00:00.000Z',\n updatedAt: '2026-08-20T15:10:00.000Z',\n} as const;\n\nconst ORGANIZATION_BADGE_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_BADGE_EXAMPLE._id,\n identifier: ORGANIZATION_BADGE_EXAMPLE.identifier,\n count: ORGANIZATION_BADGE_EXAMPLE.count,\n updatedAt: ORGANIZATION_BADGE_EXAMPLE.updatedAt,\n} as const;\n\nexport const userNotificationBadgesResourceSpecification = resourceSpecification(\n userNotificationBadgesResourceConfiguration_InitializationFactory,\n NotificationBadgeUserSelfSchema,\n ({ schemaShape }) => ({\n purpose: 'Expose the current notification-badge counters belonging to the signed-in user, keyed by application-defined badge identifiers.',\n businessRole: 'Lets a client restore per-user navigation and inbox counts without calculating each count locally.',\n lifecycleRole: 'A badge row appears after its identifier first produces a count, changes as the underlying event or query changes, and normally resets to zero instead of being deleted.',\n audience: LabelAudience.END_USER,\n subDomain: EngineResourceSubDomain.NOTIFICATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'NotificationBadgeUserSelfSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'userNotificationBadgesResourceConfiguration_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: 'USER_NOTIFICATION_BADGES',\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 },\n notes: [\n 'USER variant: READ/LIST → `APP_USER` via `API_CALL`; CREATE/UPDATE → `APP_ADMIN_SUPER_ADMIN` via `REPOSITORY_ONLY` (dispatcher-only writes).',\n 'APPLICATION-scoped badges were removed in the polymorphism refactor — `NotificationScopeSchema` is `USER_SELF | ORGANIZATIONS` only.',\n 'Runtime `userNotifications[]` / `m2mNotifications[]` are absent on this resource — WebSocket/badge fan-out is handled in `NotificationBadgeBackendService`, not here.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'MongoDB document id for this user-scoped badge row.',\n whyItMatters: 'Stable anchor for updates and list projections per user + identifier.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n userId: schemaShape.userId.foreignKeySpec({\n meaning: 'The Wildo `users` row this badge count belongs to.',\n whyItMatters: 'Filters LIST/READ through the user-self access strategy so a user can never read another user’s counts.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n count: schemaShape.count.numberSpec({\n meaning: 'Non-negative badge counter displayed in UI — reset paths write 0 instead of deleting the row.',\n whyItMatters: 'Drives the numeric bubble next to the icon the user actually sees after notification fan-out.',\n importance: FieldSemanticImportance.PRIMARY,\n unit: 'count',\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When this badge document was first materialized for the (user, identifier) pair.',\n temporalRole: 'creation',\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the counter or metadata last changed.',\n temporalRole: 'modified',\n }),\n },\n\n operations: {\n ...buildBadgeReadListOps({\n readAuthError: {\n code: HttpResponseStatusCode.UNAUTHORIZED_401,\n when: 'The request carries no authenticated user whose private badge counters can be read.',\n },\n badgeExample: USER_BADGE_EXAMPLE,\n summaryExample: USER_BADGE_SUMMARY_EXAMPLE,\n }),\n ...buildBadgeCreateUpdateOps('APP_ADMIN_SUPER_ADMIN'),\n },\n\n businessConstraints: [\n 'The `scope` field is a `z.literal(ResourcePrimaryScope.USER_SELF)` discriminant on this schema — it is intentionally not expanded in `fields` because Zod literals do not expose the `*Spec` decorator helpers the specification layer expects on every entry.',\n 'The `identifier` field uses `NotificationBadgeIdentifierSchema` (`z.string().min(1)`). No canonical (core) identifiers ship today — the aspirational placeholders were removed with the launcher-badge retract; a `CoreNotificationBadgeIdentifiers` enum is unioned back in when the surfacing is reintroduced with a real producer. Document badge keys in prose here.',\n 'There is no PUBLIC/API delete; badge counts reset to 0 in normal use. A REPOSITORY_ONLY DELETE was added solely for the composition `onParentDelete` cascade (physical teardown when the owning user is deleted). Other compliance “forget me” paths still clear counts or drop rows via repository tooling that understands badge semantics.',\n 'Writes are not intended for public arbitrary callers — only internal dispatchers and admin automation should touch CREATE/UPDATE despite the `APP_ADMIN_SUPER_ADMIN` role token on the repository variant.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.USER_SELF },\n);\n\nexport const organizationNotificationBadgesResourceSpecification = resourceSpecification(\n organizationNotificationBadgesResourceConfiguration_InitializationFactory,\n NotificationBadgeOrganizationSchema,\n ({ schemaShape }) => ({\n purpose: 'Expose shared notification-badge counters for one organization, keyed by application-defined badge identifiers.',\n businessRole: 'Lets every authorized organization member see the same outstanding-work indicators in shared navigation and dashboards.',\n lifecycleRole: 'A badge row appears after its identifier first produces a count, changes as the shared condition changes, and normally resets to zero instead of being deleted.',\n audience: LabelAudience.END_USER,\n subDomain: EngineResourceSubDomain.NOTIFICATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'NotificationBadgeOrganizationSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationNotificationBadgesResourceConfiguration_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_NOTIFICATION_BADGES',\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 },\n notes: [\n 'ORG variant: READ/LIST → `ORG_MEMBER` via `API_CALL`; CREATE/UPDATE → `APP_ADMIN_SUPER_ADMIN` via `REPOSITORY_ONLY`.',\n 'Pairs with a separate `USER_NOTIFICATION_BADGES` resource type and Mongo collection (true polymorphic split, not a shared polymorphic factory map).',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Document id for the organization-level badge instance.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization whose aggregate count this badge represents.',\n whyItMatters: 'Used by the access layer so org members read shared counts while other tenants never see the row.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n count: schemaShape.count.numberSpec({\n meaning: 'Non-negative org aggregate for the given identifier.',\n importance: FieldSemanticImportance.PRIMARY,\n unit: 'count',\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the org-level badge was first materialized for this org + identifier pair.',\n temporalRole: 'creation',\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the aggregate counter or metadata was last written.',\n temporalRole: 'modified',\n }),\n },\n\n operations: {\n ...buildBadgeReadListOps({\n readAuthError: {\n code: HttpResponseStatusCode.FORBIDDEN_403,\n when: 'The caller is not an organization member allowed to read the organization’s shared badge counters.',\n },\n badgeExample: ORGANIZATION_BADGE_EXAMPLE,\n summaryExample: ORGANIZATION_BADGE_SUMMARY_EXAMPLE,\n }),\n ...buildBadgeCreateUpdateOps('APP_ADMIN_SUPER_ADMIN'),\n },\n\n businessConstraints: [\n 'The `scope` field is a `z.literal(ResourcePrimaryScope.ORGANIZATIONS)` discriminant — omitted from `fields` for the same Zod-literal + `*Spec` decorator reason as the USER variant (see the USER variant `businessConstraints`).',\n 'The `identifier` field matches the USER variant (`NotificationBadgeIdentifierSchema`) — see the USER variant `businessConstraints` bullet that explains the enum ∪ string union and why it is omitted from `fields`.',\n 'Any org member with LIST rights sees the same aggregate count — it is not a per-seat personalization surface.',\n 'Because writes are `REPOSITORY_ONLY`, product teams must not expose raw repository endpoints for badge tuning without a dedicated admin workflow.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-config.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/webhook-config.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAG3B,wBAAwB,EAIzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAML,KAAK,2BAA2B,EACjC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"webhook-config.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/webhook-config.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAG3B,wBAAwB,EAIzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAML,KAAK,2BAA2B,EACjC,MAAM,6BAA6B,CAAC;AA2XrC,eAAO,MAAM,8CAA8C;;;;;;;;;;;;;;iCAG1D,CAAC;AAEF,eAAO,MAAM,6CAA6C;;;;;;;;;;;;;;iCAGzD,CAAC"}
|
|
@@ -22,6 +22,7 @@ import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@
|
|
|
22
22
|
import { CoreResourceOperation as Op, CoreResourceType, ResourcePrimaryScope, WebhookConfig_Operations, WebhookConfigBaseSchema, WebhookEndpointProbeOutcome, webhookConfigPolymorphicFactories, } from '@wildo-ai/saas-models';
|
|
23
23
|
import { webhooksAdminPresets, webhooksMainPresets } from '@wildo-ai/presets-components';
|
|
24
24
|
import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
|
|
25
|
+
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
25
26
|
const webhookConfigResourcePrimaryScope = {
|
|
26
27
|
[CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG]: ResourcePrimaryScope.ORGANIZATIONS,
|
|
27
28
|
[CoreResourceType.APPLICATION_WEBHOOK_CONFIG]: ResourcePrimaryScope.APPLICATION,
|
|
@@ -66,6 +67,7 @@ function buildWebhookConfigBaseSpecification(resourceType, memberName) {
|
|
|
66
67
|
businessRole: 'Singleton-per-scope config row that the dispatcher and admin UI use to know where to POST JSON payloads and which endpoints are still enabled.',
|
|
67
68
|
lifecycleRole: 'Seeded as a REPOSITORY-only create per org/app, then maintained by admins (UPDATE) and read for diagnostics; test deliveries exercise connectivity without writing delivery log rows.',
|
|
68
69
|
audience: LabelAudience.DEVELOPER,
|
|
70
|
+
subDomain: EngineResourceSubDomain.NOTIFICATIONS,
|
|
69
71
|
codeHandling: {
|
|
70
72
|
mainSchema: {
|
|
71
73
|
packageName: '@wildo-ai/saas-models',
|
package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-config.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/webhook-config.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBA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AED,MAAM,CAAC,MAAM,8CAA8C,GAAG,+BAA+B,CAC3F,gBAAgB,CAAC,2BAA2B,EAC5C,6BAA6B,CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,6CAA6C,GAAG,+BAA+B,CAC1F,gBAAgB,CAAC,0BAA0B,EAC3C,4BAA4B,CAC7B,CAAC","sourcesContent":["/**\n * Resources: `organizationWebhookConfig` + `applicationWebhookConfig` — Wildo SaaS engine specification (backend-only).\n *\n * Polymorphic ORG + APP pair sharing `WebhookConfigBaseSchema` and `webhookConfigPolymorphicFactories` (one spec export per\n * `CoreResourceType`, single authoring file, SSO-style split exports).\n *\n * Inputs:\n * - Base schema: engine/saas-models/src/notifications/m2m/webhook-config.shared.schemas.ts → `WebhookConfigBaseSchema`\n * - Polymorphic map: `webhookConfigPolymorphicFactories` (same file family as\n * `webhook-config.shared.resources-config.schemas.ts`)\n * - Custom operations: `WebhookConfig_Operations` (`testEndpoint` synthetic delivery)\n * - UI presets: `webhooksMainPresets` / `webhooksAdminPresets`\n * (engine/presets-components/src/config/resources/webhooks.resource-presets.tsx) —\n * sectioned READ layout (`status` / `endpoints` / `verification`), surfaced in the\n * org Settings Hub `webhooks` section. The spec is frontend-configured (mirrors the\n * SIEM config): the `frontend.layout.sections` documented below MUST equal the\n * preset's `layout.refs.sections` — `validateStructuralSlotDescriptions` enforces\n * the match bidirectionally at companion load. Edit both sides together.\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 CoreResourceOperation as Op,\n CoreResourceType,\n ResourcePrimaryScope,\n WebhookConfig_Operations,\n WebhookConfigBaseSchema,\n WebhookEndpointProbeOutcome,\n webhookConfigPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport { webhooksAdminPresets, webhooksMainPresets } from '@wildo-ai/presets-components';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n type ResourceSpecificationConfig,\n} from '~wildo-specifications/_core';\n\ntype WebhookConfigResourceType =\n | CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG\n | CoreResourceType.APPLICATION_WEBHOOK_CONFIG;\n\ntype WebhookConfigResourceTypeMember = 'ORGANIZATION_WEBHOOK_CONFIG' | 'APPLICATION_WEBHOOK_CONFIG';\n\nconst webhookConfigResourcePrimaryScope: Record<WebhookConfigResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_WEBHOOK_CONFIG]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype WebhookCfg = ReturnType<\n (typeof webhookConfigPolymorphicFactories)[CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG]\n>;\ntype WebhookConfigCustomOp = NonNullable<WebhookCfg['customOperation']>;\n// Derive from the factory's coreOperations so the spec tracks config changes\n// (e.g. the REPOSITORY_ONLY DELETE for the onParentDelete cascade) automatically,\n// rather than a hand-maintained union that silently drifts out of sync.\ntype WebhookConfigCoreOp = WebhookCfg['coreOperations'][number];\ntype WebhookConfigMain = typeof WebhookConfigBaseSchema;\n\ntype WebhookFrontend = ResourceUIBehaviorConfig<WebhookConfigCustomOp, WebhookConfigCoreOp, WebhookConfigMain>;\n\n/**\n * Extract the merged ui-behavior for one webhook-config variant from a presets\n * bundle. The presets declare both scope variants (ORG addressable, APP demoted),\n * so this resolves either; a missing entry is an authoring error, surfaced loudly.\n */\nfunction resolveWebhookConfigUI(\n source: Partial<Record<string, unknown>>,\n resourceType: WebhookConfigResourceType,\n sourceName: string,\n): WebhookFrontend {\n const ui = source[resourceType] as WebhookFrontend | undefined;\n if (!ui) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return ui;\n}\n\nfunction buildWebhookConfigBaseSpecification(\n resourceType: WebhookConfigResourceType,\n memberName: WebhookConfigResourceTypeMember,\n): ResourceSpecificationConfig<WebhookConfigCustomOp, WebhookConfigCoreOp, WebhookConfigMain> {\n const isOrganizationScope = resourceType === CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG;\n const scopeLabel = isOrganizationScope ? 'organization' : 'application';\n const scopeId = isOrganizationScope ? 'org_acme' : 'app_wonder_todos';\n const scopeFieldName = isOrganizationScope ? 'organizationId' : 'applicationId';\n const readExample = {\n _id: 'whc_01HX2EXAMPLE',\n enabled: true,\n endpoints: [\n {\n id: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n description: 'Primary partner listener',\n enabled: true,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n applicationPublicKeyPem: '-----BEGIN PUBLIC KEY-----\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AEXAMPLE\\n-----END PUBLIC KEY-----',\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n [scopeFieldName]: scopeId,\n };\n\n return resourceSpecification<WebhookConfigCustomOp, WebhookConfigCoreOp, WebhookConfigMain>(\n webhookConfigPolymorphicFactories[resourceType],\n WebhookConfigBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Store tenant-level M2M webhook configuration (endpoints, master enable flag, and derived verification material) for outbound `WEBHOOK_ORGANIZATION` or `WEBHOOK_APPLICATION` delivery.',\n businessRole: 'Singleton-per-scope config row that the dispatcher and admin UI use to know where to POST JSON payloads and which endpoints are still enabled.',\n lifecycleRole: 'Seeded as a REPOSITORY-only create per org/app, then maintained by admins (UPDATE) and read for diagnostics; test deliveries exercise connectivity without writing delivery log rows.',\n audience: LabelAudience.DEVELOPER,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'WebhookConfigBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'webhookConfigPolymorphicFactories',\n symbolKind: CodeSymbolKind.FACTORY,\n },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\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,\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: 'WebhookConfig_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Factory entry is selected by `webhookConfigPolymorphicFactories[CoreResourceType.*]`; `identifierField: \"collectionKey\"` follows the engine polymorphic map convention (see SSO + billing polymorphic specs).',\n 'The runtime injects the scope FK (`organizationId` or `applicationId`) — never list those columns on the base Zod object.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Singleton document id for the webhook config row in this scope’s MongoDB collection.',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'identifier',\n }),\n enabled: schemaShape.enabled.booleanSpec({\n meaning: 'Global kill-switch: when `false`, the dispatcher does not attempt deliveries regardless of per-endpoint flags.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n endpoints: schemaShape.endpoints.arraySpec({\n meaning: 'Admin-configured destination URLs, each with its own `enabled` bit and `endpointId` for delivery-log provenance.',\n whyItMatters: 'M2M events fan out to every enabled row; disabled endpoints are skipped per dispatch.',\n elementMeaning: 'One `WebhookEndpointSchema` (id, url, description, flags, created/updated timestamps).',\n elementType: {\n notes: [\n 'Element schema: `WebhookEndpointSchema` in `engine/saas-models/src/notifications/m2m/webhook-config.shared.schemas.ts`.',\n ],\n },\n }),\n applicationPublicKeyPem: schemaShape.applicationPublicKeyPem.stringSpec({\n meaning: 'PEM public half of `JwtPrivateKeys.APPLICATION_WEBHOOK`, surfaced on READ so customers verify JWT `X-Webhook-Signature` bodies.',\n whyItMatters: 'Downstream verifiers need the public key without out-of-band secret sharing; key rotation re-reads from app config on every READ per postfix hook.',\n }),\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the singleton config row was first inserted.',\n temporalRole: 'creation',\n }),\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the row last changed (endpoint list edits, `enabled` toggles, or hook refreshes).',\n temporalRole: 'modified',\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Return the org- or app-scoped config including endpoints and the derived public key material.',\n outcome: 'Admins and automated smoke tests can verify the runtime wiring before shipping traffic.',\n whenToUse: 'Use from admin UIs, CLI diagnostics, and health checks; requires org-admin or app-super-admin roles per variant.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The singleton webhook config for this scope is returned, including the endpoint list and the derived `applicationPublicKeyPem` for signature verification.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No webhook config has been seeded for this org/app scope yet (the singleton row does not exist).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin (ORG variant) or app-super-admin (APP variant) role required to read webhook configuration.' },\n ],\n idempotent: true,\n examples: [\n {\n title: `Read the active ${scopeLabel} webhook configuration`,\n response: readExample,\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n [Op.CREATE]: {\n purpose: 'Seed the singleton config document when a new org/app is provisioned and the collection is empty.',\n outcome: 'A baseline disabled config exists so the dispatcher can load structured rows without null-check sprawl.',\n whenToUse: 'Repository-only path — not an HTTP public create; used by system seeds or platform bootstrap runs.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The baseline (disabled) singleton config row was seeded for this scope and returned. Internal/service write path — system seeds or platform bootstrap run this, not a public HTTP create.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The seed payload fails schema validation (e.g. a non-HTTPS endpoint URL or a malformed endpoint entry).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-system/non-admin caller attempts to seed the config row.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A webhook config already exists for this scope — the resource is a singleton-per-scope, so a second seed collides with the existing row.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Seed a disabled webhook config with one endpoint',\n request: {\n enabled: false,\n endpoints: [\n { url: 'https://hooks.example.com/wildo', description: 'Primary partner listener', enabled: true },\n ],\n },\n response: {\n _id: 'whc_01HX2…',\n enabled: false,\n endpoints: [\n { id: 'whe_01HX2…', url: 'https://hooks.example.com/wildo', enabled: true },\n ],\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Persist endpoint URL edits, enable toggles, and metadata updates for the current scope’s singleton.',\n outcome: 'The next M2M notification fire sees the new routing truth immediately after commit.',\n whenToUse: 'Use in admin “save endpoints” flows or through trusted automation, still via repository or dedicated controller surfaces rather than a generic public PUT API.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The endpoint list / `enabled` toggles / metadata were persisted and the updated singleton config is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited endpoints or flags fail schema validation (e.g. a non-HTTPS URL or a duplicate endpoint id).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to change webhook configuration.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No webhook config has been seeded for this scope to update.' },\n ],\n idempotent: true,\n rateLimitNote: 'Endpoint edits can rotate the signing key material read on every READ; throttle rapid save cycles so downstream verifiers are not churned by repeated key changes.',\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the webhook config row when its owning org/app is deleted (composition `onParentDelete` cascade).',\n outcome: 'The one-per-scope config row is removed together with its parent — the composition part does not outlive its whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The webhook config row was deleted as part of the deletion cascade of its owning scope.' },\n ],\n // REPOSITORY_ONLY variant (org/app 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 [WebhookConfig_Operations.TEST_ENDPOINT]: {\n operationId: WebhookConfig_Operations.TEST_ENDPOINT,\n purpose: 'Send a single synthetic request to a chosen `endpointId` to prove reachability and signature verification (does not create `M2MWebhookDeliveryLog` rows). Borrows UPDATE (a `PUT` on the custom-op sub-path) rather than READ: no row is written, but a live signed request leaves the platform, and a `GET` for that was a contradiction the generated contract had to spell out as `x-idempotent: false`.',\n outcome: 'Admins can validate connectivity in isolation before real notification traffic is enabled. The response is a diagnostic — `outcome` (`accepted` / `rejected` / `unreachable` / `not_sent`), plus response status, truncated response body, failure reason, duration, and the probe’s `signatureJti` for correlation against the consumer’s own logs — NOT the configuration row.',\n whenToUse: 'Run after any URL/secret/rotation event that could break downstream listeners.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The synthetic request was attempted and a diagnostic result (reachability, response status, signature-verification outcome) is returned — a transport-level failure at the customer endpoint is still a 200 carrying the diagnostic, not an API error. `not_sent` likewise answers 200: the payload could not be signed, which is a platform-side key fault reported distinctly so it is never misread as a broken customer endpoint.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No webhook config exists for this scope, or the supplied `endpointId` is not present in the config’s endpoint list.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to fire a test delivery.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'No `endpointId` was supplied, or the stored endpoint is incomplete (e.g. missing URL), so no meaningful test can be sent.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.TOO_MANY_REQUESTS_429, when: 'The per-endpoint probe budget for the current window is exhausted. Also returned when the rate-limit store is unreachable: this operation fails CLOSED, because running an egress primitive unmetered is worse than refusing it.' },\n ],\n idempotent: false,\n rateLimitNote: 'ENFORCED, not advisory: at most 5 probes per endpoint per 60s, keyed on scope + `endpointId` (the resource being protected is the customer’s listener, which does not care which admin is iterating). Exceeding it returns 429 with `retryAfterSeconds`.',\n examples: [\n {\n title: 'Endpoint accepts the signed probe',\n request: { endpointId: 'whe_primary_partner' },\n response: {\n endpointId: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n outcome: WebhookEndpointProbeOutcome.ACCEPTED,\n responseStatus: 202,\n responseBodyTruncated: 'queued',\n durationMs: 84,\n signatureJti: 'probe_01HX2ACCEPTED',\n attemptedAt: '2026-06-14T12:05:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n {\n title: 'Endpoint rejects the signed probe',\n request: { endpointId: 'whe_primary_partner' },\n response: {\n endpointId: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n outcome: WebhookEndpointProbeOutcome.REJECTED,\n responseStatus: 401,\n responseBodyTruncated: 'invalid signature',\n durationMs: 61,\n signatureJti: 'probe_01HX2REJECTED',\n attemptedAt: '2026-06-14T12:06:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n {\n title: 'Endpoint cannot be reached',\n request: { endpointId: 'whe_primary_partner' },\n response: {\n endpointId: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n outcome: WebhookEndpointProbeOutcome.UNREACHABLE,\n failureReason: 'fetch failed: connect ECONNREFUSED',\n durationMs: 10003,\n signatureJti: 'probe_01HX2UNREACHABLE',\n attemptedAt: '2026-06-14T12:07:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n {\n title: 'Probe is not sent because signing fails',\n request: { endpointId: 'whe_primary_partner' },\n response: {\n endpointId: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n outcome: WebhookEndpointProbeOutcome.NOT_SENT,\n failureReason: 'JWT signing failed: application webhook key unavailable',\n durationMs: 0,\n signatureJti: 'probe_01HX2NOTSENT',\n attemptedAt: '2026-06-14T12:08:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n businessConstraints: [\n 'Each scope owns at most one config row: treat this as a singleton resource, not a list resource with arbitrary many configs.',\n 'Because deliveries are multi-endpoint, keep endpoint ids stable: deleting an endpoint that still has log rows will break referential explainability in the delivery log view.',\n '`testEndpoint` probes travel the SAME signed transport as real deliveries (same key, same claim shape, same `X-Webhook-Signature` header). That is the point: a probe reaching the endpoint by a separate code path would attest to that path rather than to the delivery path. Do not give the probe its own HTTP client.',\n 'Probe traffic is marked synthetic on BOTH the body (`synthetic: true` plus explanatory text) and the signed claims, so a consumer can hard-refuse it on the verified envelope rather than on body text. Wildo is POSTing to a customer’s production listener; a probe indistinguishable from a real event invites consumers to act on a fake one.',\n 'A DISABLED endpoint is still probed. \"Validate before enabling\" is the primary workflow this operation exists for, and refusing would force an admin to enable an unverified URL in order to verify it.',\n 'Every attempt — successful or not — is recorded as a `WEBHOOK_ENDPOINT_TEST_DISPATCHED` audit event carrying the actor, scope, endpoint, outcome and destination HOST (never the full URL: customer endpoint paths routinely embed per-tenant tokens, and audit rows replicate to the org SIEM and the immutable store).',\n ],\n }),\n { resourcePrimaryScope: webhookConfigResourcePrimaryScope[resourceType] },\n );\n}\n\n/**\n * Compose the backend-semantics base with the frontend ui-behavior so the spec\n * can DOCUMENT the sectioned READ layout the preset declares. The section refs\n * (`status` / `endpoints` / `verification`) MUST equal the preset's\n * `layout.refs.sections` for this resource — `validateStructuralSlotDescriptions`\n * enforces the match bidirectionally at companion load (mirrors the SIEM config).\n */\nfunction buildWebhookConfigSpecification(\n resourceType: WebhookConfigResourceType,\n memberName: WebhookConfigResourceTypeMember,\n) {\n const base = buildWebhookConfigBaseSpecification(resourceType, memberName);\n const main = resolveWebhookConfigUI(webhooksMainPresets as Partial<Record<string, unknown>>, resourceType, 'webhooksMainPresets');\n const admin = resolveWebhookConfigUI(webhooksAdminPresets as Partial<Record<string, unknown>>, resourceType, 'webhooksAdminPresets');\n return resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)),\n base,\n () => ({\n layout: {\n purpose: 'The webhook config READ groups the singleton into `status`, `endpoints`, and `verification` sections so an admin reasons about the integration top-down: is it on, where does it deliver, how do receivers verify signatures.',\n displayPurpose: 'Read template renders the same three sections in that order; timestamps and the surrogate id are intentionally omitted from the curated admin read.',\n sections: {\n status: {\n purpose: 'The master `enabled` kill-switch for outbound delivery in this scope.',\n whenToUse: 'First decision: pause or resume all deliveries without editing endpoints.',\n textSlots: {\n title: { purpose: 'Name the “deliveries on / paused” card.' },\n description: { purpose: 'Clarify that disabling stops new deliveries but keeps the endpoint configuration intact.' },\n },\n },\n endpoints: {\n purpose: 'The admin-configured destination URLs, each with its own enable bit and stable `endpointId`.',\n whenToUse: 'Adding, disabling, or auditing where M2M events fan out.',\n textSlots: {\n title: { purpose: 'Label the destinations / endpoints block.' },\n description: { purpose: 'Note that each enabled endpoint receives every dispatched event; disabled endpoints are skipped per delivery.' },\n },\n },\n verification: {\n purpose: 'The derived `applicationPublicKeyPem` receivers use to verify the JWT `X-Webhook-Signature`.',\n whenToUse: 'When a receiver sets up or rotates signature verification.',\n textSlots: {\n title: { purpose: 'Label the signature-verification key block.' },\n description: { purpose: 'Read-only; the public half of the app webhook signing key, refreshed on read after rotation.' },\n },\n },\n },\n },\n }),\n );\n}\n\nexport const organizationWebhookConfigResourceSpecification = buildWebhookConfigSpecification(\n CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG,\n 'ORGANIZATION_WEBHOOK_CONFIG',\n);\n\nexport const applicationWebhookConfigResourceSpecification = buildWebhookConfigSpecification(\n CoreResourceType.APPLICATION_WEBHOOK_CONFIG,\n 'APPLICATION_WEBHOOK_CONFIG',\n);\n"]}
|
|
1
|
+
{"version":3,"file":"webhook-config.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/notifications/resources/webhook-config.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAE/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAQ3E,MAAM,iCAAiC,GAA4D;IACjG,CAAC,gBAAgB,CAAC,2BAA2B,CAAC,EAAE,oBAAoB,CAAC,aAAa;IAClF,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,EAAE,oBAAoB,CAAC,WAAW;CAChF,CAAC;AAcF;;;;GAIG;AACH,SAAS,sBAAsB,CAC7B,MAAwC,EACxC,YAAuC,EACvC,UAAkB;IAElB,MAAM,EAAE,GAAG,MAAM,CAAC,YAAY,CAAgC,CAAC;IAC/D,IAAI,CAAC,EAAE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oBAChF,SAAS,EAAE,2EAA2E;oBACtF,SAAS,EAAE;wBACT,KAAK,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE;wBAC7D,WAAW,EAAE,EAAE,OAAO,EAAE,0FAA0F,EAAE;qBACrH;iBACF;gBACD,SAAS,EAAE;oBACT,OAAO,EAAE,8FAA8F;oBACvG,SAAS,EAAE,0DAA0D;oBACrE,SAAS,EAAE;wBACT,KAAK,EAAE,EAAE,OAAO,EAAE,2CAA2C,EAAE;wBAC/D,WAAW,EAAE,EAAE,OAAO,EAAE,+GAA+G,EAAE;qBAC1I;iBACF;gBACD,YAAY,EAAE;oBACZ,OAAO,EAAE,8FAA8F;oBACvG,SAAS,EAAE,4DAA4D;oBACvE,SAAS,EAAE;wBACT,KAAK,EAAE,EAAE,OAAO,EAAE,6CAA6C,EAAE;wBACjE,WAAW,EAAE,EAAE,OAAO,EAAE,8FAA8F,EAAE;qBACzH;iBACF;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,8CAA8C,GAAG,+BAA+B,CAC3F,gBAAgB,CAAC,2BAA2B,EAC5C,6BAA6B,CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,6CAA6C,GAAG,+BAA+B,CAC1F,gBAAgB,CAAC,0BAA0B,EAC3C,4BAA4B,CAC7B,CAAC","sourcesContent":["/**\n * Resources: `organizationWebhookConfig` + `applicationWebhookConfig` — Wildo SaaS engine specification (backend-only).\n *\n * Polymorphic ORG + APP pair sharing `WebhookConfigBaseSchema` and `webhookConfigPolymorphicFactories` (one spec export per\n * `CoreResourceType`, single authoring file, SSO-style split exports).\n *\n * Inputs:\n * - Base schema: engine/saas-models/src/notifications/m2m/webhook-config.shared.schemas.ts → `WebhookConfigBaseSchema`\n * - Polymorphic map: `webhookConfigPolymorphicFactories` (same file family as\n * `webhook-config.shared.resources-config.schemas.ts`)\n * - Custom operations: `WebhookConfig_Operations` (`testEndpoint` synthetic delivery)\n * - UI presets: `webhooksMainPresets` / `webhooksAdminPresets`\n * (engine/presets-components/src/config/resources/webhooks.resource-presets.tsx) —\n * sectioned READ layout (`status` / `endpoints` / `verification`), surfaced in the\n * org Settings Hub `webhooks` section. The spec is frontend-configured (mirrors the\n * SIEM config): the `frontend.layout.sections` documented below MUST equal the\n * preset's `layout.refs.sections` — `validateStructuralSlotDescriptions` enforces\n * the match bidirectionally at companion load. Edit both sides together.\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 CoreResourceOperation as Op,\n CoreResourceType,\n ResourcePrimaryScope,\n WebhookConfig_Operations,\n WebhookConfigBaseSchema,\n WebhookEndpointProbeOutcome,\n webhookConfigPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport { webhooksAdminPresets, webhooksMainPresets } from '@wildo-ai/presets-components';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n type ResourceSpecificationConfig,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype WebhookConfigResourceType =\n | CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG\n | CoreResourceType.APPLICATION_WEBHOOK_CONFIG;\n\ntype WebhookConfigResourceTypeMember = 'ORGANIZATION_WEBHOOK_CONFIG' | 'APPLICATION_WEBHOOK_CONFIG';\n\nconst webhookConfigResourcePrimaryScope: Record<WebhookConfigResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_WEBHOOK_CONFIG]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype WebhookCfg = ReturnType<\n (typeof webhookConfigPolymorphicFactories)[CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG]\n>;\ntype WebhookConfigCustomOp = NonNullable<WebhookCfg['customOperation']>;\n// Derive from the factory's coreOperations so the spec tracks config changes\n// (e.g. the REPOSITORY_ONLY DELETE for the onParentDelete cascade) automatically,\n// rather than a hand-maintained union that silently drifts out of sync.\ntype WebhookConfigCoreOp = WebhookCfg['coreOperations'][number];\ntype WebhookConfigMain = typeof WebhookConfigBaseSchema;\n\ntype WebhookFrontend = ResourceUIBehaviorConfig<WebhookConfigCustomOp, WebhookConfigCoreOp, WebhookConfigMain>;\n\n/**\n * Extract the merged ui-behavior for one webhook-config variant from a presets\n * bundle. The presets declare both scope variants (ORG addressable, APP demoted),\n * so this resolves either; a missing entry is an authoring error, surfaced loudly.\n */\nfunction resolveWebhookConfigUI(\n source: Partial<Record<string, unknown>>,\n resourceType: WebhookConfigResourceType,\n sourceName: string,\n): WebhookFrontend {\n const ui = source[resourceType] as WebhookFrontend | undefined;\n if (!ui) {\n throw new Error(`Missing \"${resourceType}\" UI behavior in ${sourceName}.`);\n }\n return ui;\n}\n\nfunction buildWebhookConfigBaseSpecification(\n resourceType: WebhookConfigResourceType,\n memberName: WebhookConfigResourceTypeMember,\n): ResourceSpecificationConfig<WebhookConfigCustomOp, WebhookConfigCoreOp, WebhookConfigMain> {\n const isOrganizationScope = resourceType === CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG;\n const scopeLabel = isOrganizationScope ? 'organization' : 'application';\n const scopeId = isOrganizationScope ? 'org_acme' : 'app_wonder_todos';\n const scopeFieldName = isOrganizationScope ? 'organizationId' : 'applicationId';\n const readExample = {\n _id: 'whc_01HX2EXAMPLE',\n enabled: true,\n endpoints: [\n {\n id: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n description: 'Primary partner listener',\n enabled: true,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n applicationPublicKeyPem: '-----BEGIN PUBLIC KEY-----\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AEXAMPLE\\n-----END PUBLIC KEY-----',\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n [scopeFieldName]: scopeId,\n };\n\n return resourceSpecification<WebhookConfigCustomOp, WebhookConfigCoreOp, WebhookConfigMain>(\n webhookConfigPolymorphicFactories[resourceType],\n WebhookConfigBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Store tenant-level M2M webhook configuration (endpoints, master enable flag, and derived verification material) for outbound `WEBHOOK_ORGANIZATION` or `WEBHOOK_APPLICATION` delivery.',\n businessRole: 'Singleton-per-scope config row that the dispatcher and admin UI use to know where to POST JSON payloads and which endpoints are still enabled.',\n lifecycleRole: 'Seeded as a REPOSITORY-only create per org/app, then maintained by admins (UPDATE) and read for diagnostics; test deliveries exercise connectivity without writing delivery log rows.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.NOTIFICATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'WebhookConfigBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'webhookConfigPolymorphicFactories',\n symbolKind: CodeSymbolKind.FACTORY,\n },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\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,\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: 'WebhookConfig_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Factory entry is selected by `webhookConfigPolymorphicFactories[CoreResourceType.*]`; `identifierField: \"collectionKey\"` follows the engine polymorphic map convention (see SSO + billing polymorphic specs).',\n 'The runtime injects the scope FK (`organizationId` or `applicationId`) — never list those columns on the base Zod object.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Singleton document id for the webhook config row in this scope’s MongoDB collection.',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'identifier',\n }),\n enabled: schemaShape.enabled.booleanSpec({\n meaning: 'Global kill-switch: when `false`, the dispatcher does not attempt deliveries regardless of per-endpoint flags.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n endpoints: schemaShape.endpoints.arraySpec({\n meaning: 'Admin-configured destination URLs, each with its own `enabled` bit and `endpointId` for delivery-log provenance.',\n whyItMatters: 'M2M events fan out to every enabled row; disabled endpoints are skipped per dispatch.',\n elementMeaning: 'One `WebhookEndpointSchema` (id, url, description, flags, created/updated timestamps).',\n elementType: {\n notes: [\n 'Element schema: `WebhookEndpointSchema` in `engine/saas-models/src/notifications/m2m/webhook-config.shared.schemas.ts`.',\n ],\n },\n }),\n applicationPublicKeyPem: schemaShape.applicationPublicKeyPem.stringSpec({\n meaning: 'PEM public half of `JwtPrivateKeys.APPLICATION_WEBHOOK`, surfaced on READ so customers verify JWT `X-Webhook-Signature` bodies.',\n whyItMatters: 'Downstream verifiers need the public key without out-of-band secret sharing; key rotation re-reads from app config on every READ per postfix hook.',\n }),\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the singleton config row was first inserted.',\n temporalRole: 'creation',\n }),\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the row last changed (endpoint list edits, `enabled` toggles, or hook refreshes).',\n temporalRole: 'modified',\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Return the org- or app-scoped config including endpoints and the derived public key material.',\n outcome: 'Admins and automated smoke tests can verify the runtime wiring before shipping traffic.',\n whenToUse: 'Use from admin UIs, CLI diagnostics, and health checks; requires org-admin or app-super-admin roles per variant.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The singleton webhook config for this scope is returned, including the endpoint list and the derived `applicationPublicKeyPem` for signature verification.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No webhook config has been seeded for this org/app scope yet (the singleton row does not exist).' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin (ORG variant) or app-super-admin (APP variant) role required to read webhook configuration.' },\n ],\n idempotent: true,\n examples: [\n {\n title: `Read the active ${scopeLabel} webhook configuration`,\n response: readExample,\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n [Op.CREATE]: {\n purpose: 'Seed the singleton config document when a new org/app is provisioned and the collection is empty.',\n outcome: 'A baseline disabled config exists so the dispatcher can load structured rows without null-check sprawl.',\n whenToUse: 'Repository-only path — not an HTTP public create; used by system seeds or platform bootstrap runs.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The baseline (disabled) singleton config row was seeded for this scope and returned. Internal/service write path — system seeds or platform bootstrap run this, not a public HTTP create.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The seed payload fails schema validation (e.g. a non-HTTPS endpoint URL or a malformed endpoint entry).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-system/non-admin caller attempts to seed the config row.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A webhook config already exists for this scope — the resource is a singleton-per-scope, so a second seed collides with the existing row.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Seed a disabled webhook config with one endpoint',\n request: {\n enabled: false,\n endpoints: [\n { url: 'https://hooks.example.com/wildo', description: 'Primary partner listener', enabled: true },\n ],\n },\n response: {\n _id: 'whc_01HX2…',\n enabled: false,\n endpoints: [\n { id: 'whe_01HX2…', url: 'https://hooks.example.com/wildo', enabled: true },\n ],\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Persist endpoint URL edits, enable toggles, and metadata updates for the current scope’s singleton.',\n outcome: 'The next M2M notification fire sees the new routing truth immediately after commit.',\n whenToUse: 'Use in admin “save endpoints” flows or through trusted automation, still via repository or dedicated controller surfaces rather than a generic public PUT API.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The endpoint list / `enabled` toggles / metadata were persisted and the updated singleton config is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited endpoints or flags fail schema validation (e.g. a non-HTTPS URL or a duplicate endpoint id).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to change webhook configuration.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No webhook config has been seeded for this scope to update.' },\n ],\n idempotent: true,\n rateLimitNote: 'Endpoint edits can rotate the signing key material read on every READ; throttle rapid save cycles so downstream verifiers are not churned by repeated key changes.',\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the webhook config row when its owning org/app is deleted (composition `onParentDelete` cascade).',\n outcome: 'The one-per-scope config row is removed together with its parent — the composition part does not outlive its whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The webhook config row was deleted as part of the deletion cascade of its owning scope.' },\n ],\n // REPOSITORY_ONLY variant (org/app 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 [WebhookConfig_Operations.TEST_ENDPOINT]: {\n operationId: WebhookConfig_Operations.TEST_ENDPOINT,\n purpose: 'Send a single synthetic request to a chosen `endpointId` to prove reachability and signature verification (does not create `M2MWebhookDeliveryLog` rows). Borrows UPDATE (a `PUT` on the custom-op sub-path) rather than READ: no row is written, but a live signed request leaves the platform, and a `GET` for that was a contradiction the generated contract had to spell out as `x-idempotent: false`.',\n outcome: 'Admins can validate connectivity in isolation before real notification traffic is enabled. The response is a diagnostic — `outcome` (`accepted` / `rejected` / `unreachable` / `not_sent`), plus response status, truncated response body, failure reason, duration, and the probe’s `signatureJti` for correlation against the consumer’s own logs — NOT the configuration row.',\n whenToUse: 'Run after any URL/secret/rotation event that could break downstream listeners.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The synthetic request was attempted and a diagnostic result (reachability, response status, signature-verification outcome) is returned — a transport-level failure at the customer endpoint is still a 200 carrying the diagnostic, not an API error. `not_sent` likewise answers 200: the payload could not be signed, which is a platform-side key fault reported distinctly so it is never misread as a broken customer endpoint.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No webhook config exists for this scope, or the supplied `endpointId` is not present in the config’s endpoint list.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to fire a test delivery.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'No `endpointId` was supplied, or the stored endpoint is incomplete (e.g. missing URL), so no meaningful test can be sent.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.TOO_MANY_REQUESTS_429, when: 'The per-endpoint probe budget for the current window is exhausted. Also returned when the rate-limit store is unreachable: this operation fails CLOSED, because running an egress primitive unmetered is worse than refusing it.' },\n ],\n idempotent: false,\n rateLimitNote: 'ENFORCED, not advisory: at most 5 probes per endpoint per 60s, keyed on scope + `endpointId` (the resource being protected is the customer’s listener, which does not care which admin is iterating). Exceeding it returns 429 with `retryAfterSeconds`.',\n examples: [\n {\n title: 'Endpoint accepts the signed probe',\n request: { endpointId: 'whe_primary_partner' },\n response: {\n endpointId: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n outcome: WebhookEndpointProbeOutcome.ACCEPTED,\n responseStatus: 202,\n responseBodyTruncated: 'queued',\n durationMs: 84,\n signatureJti: 'probe_01HX2ACCEPTED',\n attemptedAt: '2026-06-14T12:05:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n {\n title: 'Endpoint rejects the signed probe',\n request: { endpointId: 'whe_primary_partner' },\n response: {\n endpointId: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n outcome: WebhookEndpointProbeOutcome.REJECTED,\n responseStatus: 401,\n responseBodyTruncated: 'invalid signature',\n durationMs: 61,\n signatureJti: 'probe_01HX2REJECTED',\n attemptedAt: '2026-06-14T12:06:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n {\n title: 'Endpoint cannot be reached',\n request: { endpointId: 'whe_primary_partner' },\n response: {\n endpointId: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n outcome: WebhookEndpointProbeOutcome.UNREACHABLE,\n failureReason: 'fetch failed: connect ECONNREFUSED',\n durationMs: 10003,\n signatureJti: 'probe_01HX2UNREACHABLE',\n attemptedAt: '2026-06-14T12:07:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n {\n title: 'Probe is not sent because signing fails',\n request: { endpointId: 'whe_primary_partner' },\n response: {\n endpointId: 'whe_primary_partner',\n url: 'https://hooks.example.com/wildo',\n outcome: WebhookEndpointProbeOutcome.NOT_SENT,\n failureReason: 'JWT signing failed: application webhook key unavailable',\n durationMs: 0,\n signatureJti: 'probe_01HX2NOTSENT',\n attemptedAt: '2026-06-14T12:08:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n businessConstraints: [\n 'Each scope owns at most one config row: treat this as a singleton resource, not a list resource with arbitrary many configs.',\n 'Because deliveries are multi-endpoint, keep endpoint ids stable: deleting an endpoint that still has log rows will break referential explainability in the delivery log view.',\n '`testEndpoint` probes travel the SAME signed transport as real deliveries (same key, same claim shape, same `X-Webhook-Signature` header). That is the point: a probe reaching the endpoint by a separate code path would attest to that path rather than to the delivery path. Do not give the probe its own HTTP client.',\n 'Probe traffic is marked synthetic on BOTH the body (`synthetic: true` plus explanatory text) and the signed claims, so a consumer can hard-refuse it on the verified envelope rather than on body text. Wildo is POSTing to a customer’s production listener; a probe indistinguishable from a real event invites consumers to act on a fake one.',\n 'A DISABLED endpoint is still probed. \"Validate before enabling\" is the primary workflow this operation exists for, and refusing would force an admin to enable an unverified URL in order to verify it.',\n 'Every attempt — successful or not — is recorded as a `WEBHOOK_ENDPOINT_TEST_DISPATCHED` audit event carrying the actor, scope, endpoint, outcome and destination HOST (never the full URL: customer endpoint paths routinely embed per-tenant tokens, and audit rows replicate to the org SIEM and the immutable store).',\n ],\n }),\n { resourcePrimaryScope: webhookConfigResourcePrimaryScope[resourceType] },\n );\n}\n\n/**\n * Compose the backend-semantics base with the frontend ui-behavior so the spec\n * can DOCUMENT the sectioned READ layout the preset declares. The section refs\n * (`status` / `endpoints` / `verification`) MUST equal the preset's\n * `layout.refs.sections` for this resource — `validateStructuralSlotDescriptions`\n * enforces the match bidirectionally at companion load (mirrors the SIEM config).\n */\nfunction buildWebhookConfigSpecification(\n resourceType: WebhookConfigResourceType,\n memberName: WebhookConfigResourceTypeMember,\n) {\n const base = buildWebhookConfigBaseSpecification(resourceType, memberName);\n const main = resolveWebhookConfigUI(webhooksMainPresets as Partial<Record<string, unknown>>, resourceType, 'webhooksMainPresets');\n const admin = resolveWebhookConfigUI(webhooksAdminPresets as Partial<Record<string, unknown>>, resourceType, 'webhooksAdminPresets');\n return resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)),\n base,\n () => ({\n layout: {\n purpose: 'The webhook config READ groups the singleton into `status`, `endpoints`, and `verification` sections so an admin reasons about the integration top-down: is it on, where does it deliver, how do receivers verify signatures.',\n displayPurpose: 'Read template renders the same three sections in that order; timestamps and the surrogate id are intentionally omitted from the curated admin read.',\n sections: {\n status: {\n purpose: 'The master `enabled` kill-switch for outbound delivery in this scope.',\n whenToUse: 'First decision: pause or resume all deliveries without editing endpoints.',\n textSlots: {\n title: { purpose: 'Name the “deliveries on / paused” card.' },\n description: { purpose: 'Clarify that disabling stops new deliveries but keeps the endpoint configuration intact.' },\n },\n },\n endpoints: {\n purpose: 'The admin-configured destination URLs, each with its own enable bit and stable `endpointId`.',\n whenToUse: 'Adding, disabling, or auditing where M2M events fan out.',\n textSlots: {\n title: { purpose: 'Label the destinations / endpoints block.' },\n description: { purpose: 'Note that each enabled endpoint receives every dispatched event; disabled endpoints are skipped per delivery.' },\n },\n },\n verification: {\n purpose: 'The derived `applicationPublicKeyPem` receivers use to verify the JWT `X-Webhook-Signature`.',\n whenToUse: 'When a receiver sets up or rotates signature verification.',\n textSlots: {\n title: { purpose: 'Label the signature-verification key block.' },\n description: { purpose: 'Read-only; the public half of the app webhook signing key, refreshed on read after rotation.' },\n },\n },\n },\n },\n }),\n );\n}\n\nexport const organizationWebhookConfigResourceSpecification = buildWebhookConfigSpecification(\n CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG,\n 'ORGANIZATION_WEBHOOK_CONFIG',\n);\n\nexport const applicationWebhookConfigResourceSpecification = buildWebhookConfigSpecification(\n CoreResourceType.APPLICATION_WEBHOOK_CONFIG,\n 'APPLICATION_WEBHOOK_CONFIG',\n);\n"]}
|
package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CORE_ORG_ROLES, CoreResourceOperation as Op, OrganizationMemberStatus, OrganizationMembers_Operations } from '@wildo-ai/saas-models';
|
|
2
|
-
export declare const organizationMembersResourceSpecification: import("../../../_core").ResourceSpecificationConfig<typeof OrganizationMembers_Operations, Op.READ | Op.UPDATE | Op.DELETE | Op.CREATE | Op.LIST | Op.SEARCH | Op.COUNT, import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodObject<{
|
|
2
|
+
export declare const organizationMembersResourceSpecification: import("../../../_core").ResourceSpecificationConfig<typeof OrganizationMembers_Operations, Op.READ | Op.UPDATE | Op.UPDATE_MANY | Op.DELETE | Op.CREATE | Op.LIST | Op.SEARCH | Op.COUNT, import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodObject<{
|
|
3
3
|
_id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
|
|
4
4
|
userId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>>>;
|
|
5
5
|
userEmail: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodEmail>>>>>>;
|
package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-members.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-members.resource.specification.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,cAAc,EACd,qBAAqB,IAAI,EAAE,EAI3B,wBAAwB,EACxB,8BAA8B,EAG/B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"organization-members.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-members.resource.specification.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,cAAc,EACd,qBAAqB,IAAI,EAAE,EAI3B,wBAAwB,EACxB,8BAA8B,EAG/B,MAAM,uBAAuB,CAAC;AAyD/B,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;kCAgcpD,CAAC"}
|