@wildo-ai/saas-specifications 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts +10 -8
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js +14 -13
- package/dist/esm/_catalogs/schema-org/_catalog-spec.shared.schemas.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts +3 -2
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js +4 -3
- package/dist/esm/_catalogs/schema-org/aggregate-offer.catalog-spec.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/index.d.ts +31 -15
- package/dist/esm/_catalogs/schema-org/index.d.ts.map +1 -1
- package/dist/esm/_catalogs/schema-org/index.js +34 -13
- package/dist/esm/_catalogs/schema-org/index.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.d.ts +2 -2
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.js +4 -4
- package/dist/esm/_catalogs/schema-org/product.catalog-spec.js.map +1 -1
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts +45 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.d.ts.map +1 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js +58 -0
- package/dist/esm/_catalogs/schema-org/software-application.catalog-spec.js.map +1 -0
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts +3 -2
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts.map +1 -1
- package/dist/esm/_core/application-specification-family-identity.schemas.js +3 -2
- package/dist/esm/_core/application-specification-family-identity.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts +18 -0
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +39 -13
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +43 -13
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +90 -2
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +70 -6
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +26 -4
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/business-semantics.specifications.schemas.d.ts +14 -0
- package/dist/esm/_core/business-semantics.specifications.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-semantics.specifications.schemas.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.js +1 -0
- package/dist/esm/_core/capability-composition/capability-composition-validation.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts +21 -2
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js +20 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +11 -32
- 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 +70 -3
- package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts +142 -17
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +285 -30
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +183 -18
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js +165 -18
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts +139 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js +172 -0
- package/dist/esm/_core/compliance-documents/recipient-disclosures.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts +306 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.js +502 -0
- package/dist/esm/_core/compliance-documents/recipient-population.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts +107 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js +118 -0
- package/dist/esm/_core/compliance-documents/retention-enforcement-facts.schemas.js.map +1 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts +56 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js +100 -0
- package/dist/esm/_core/compliance-documents/subject-data-recipients.schemas.js.map +1 -0
- package/dist/esm/_core/composite-view-specification.schemas.js +8 -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 -2
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +3 -2
- package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts +16 -3
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js +70 -5
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js.map +1 -1
- package/dist/esm/_core/family-aspects.schemas.d.ts +10 -0
- package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -1
- package/dist/esm/_core/family-aspects.schemas.js.map +1 -1
- package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +2 -2
- package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts +1 -0
- package/dist/esm/_core/feature-drafts/capability-map-output-set.schemas.d.ts.map +1 -1
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts +16 -0
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js +8 -0
- package/dist/esm/_core/feature-drafts/feature-specification-drafts.schemas.js.map +1 -1
- package/dist/esm/_core/index.d.ts +3 -0
- package/dist/esm/_core/index.d.ts.map +1 -1
- package/dist/esm/_core/index.js +3 -0
- package/dist/esm/_core/index.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +5 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +3 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +12 -2
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +30 -2
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js +32 -2
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/market/feature-benefit.schemas.js +2 -2
- package/dist/esm/_core/market/feature-benefit.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-alternative.schemas.js +2 -2
- package/dist/esm/_core/market/market-alternative.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-buying-journey.schemas.js +2 -2
- package/dist/esm/_core/market/market-buying-journey.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-category.schemas.js +2 -2
- package/dist/esm/_core/market/market-category.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-channel.schemas.js +2 -2
- package/dist/esm/_core/market/market-channel.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-gain.schemas.js +2 -2
- package/dist/esm/_core/market/market-gain.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-icp.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-icp.schemas.js +2 -2
- package/dist/esm/_core/market/market-icp.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-job.schemas.js +2 -2
- package/dist/esm/_core/market/market-job.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-message-template.schemas.js +2 -2
- package/dist/esm/_core/market/market-message-template.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-objection.schemas.js +2 -2
- package/dist/esm/_core/market/market-objection.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-pain.schemas.js +2 -2
- package/dist/esm/_core/market/market-pain.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-persona.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-persona.schemas.js +2 -2
- package/dist/esm/_core/market/market-persona.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-positioning.schemas.js +2 -2
- package/dist/esm/_core/market/market-positioning.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-proof.schemas.js +2 -2
- package/dist/esm/_core/market/market-proof.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-references.schemas.d.ts +6 -0
- package/dist/esm/_core/market/market-references.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-references.schemas.js +6 -0
- package/dist/esm/_core/market/market-references.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +4 -4
- package/dist/esm/_core/market/market-tone-of-voice.schemas.js +2 -2
- package/dist/esm/_core/market/market-tone-of-voice.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-trigger.schemas.js +2 -2
- package/dist/esm/_core/market/market-trigger.schemas.js.map +1 -1
- package/dist/esm/_core/market/market.family-aspects.js +1 -1
- package/dist/esm/_core/market/market.family-aspects.js.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.js +6 -1
- package/dist/esm/_core/placement-plan/placement-plan.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts +1 -0
- package/dist/esm/_core/requirements/functional-requirement.schemas.d.ts.map +1 -1
- package/dist/esm/_core/requirements/functional-requirement.schemas.js +8 -0
- package/dist/esm/_core/requirements/functional-requirement.schemas.js.map +1 -1
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts +1 -0
- package/dist/esm/_core/requirements/requirements-snapshot.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.d.ts +86 -28
- package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/resource-specification.schemas.js +110 -24
- package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
- package/dist/esm/_core/utils/retention-clock-field-specs.d.ts +13 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.d.ts.map +1 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.js +26 -0
- package/dist/esm/_core/utils/retention-clock-field-specs.js.map +1 -0
- package/dist/esm/_core/website-plan/website-plan.schemas.d.ts +31 -6
- package/dist/esm/_core/website-plan/website-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/website-plan/website-plan.schemas.js +35 -6
- package/dist/esm/_core/website-plan/website-plan.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts +142 -3
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js +148 -14
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +70 -10
- 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 +98 -11
- package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts +215 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.js +253 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts +39 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js +37 -0
- package/dist/esm/application-creation/application-specification-family-decisions.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/journey.application-creation.schemas.d.ts +5 -49
- package/dist/esm/application-creation/journey.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/journey.application-creation.schemas.js +25 -60
- package/dist/esm/application-creation/journey.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts +28 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.d.ts.map +1 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js +32 -0
- package/dist/esm/application-creation/playbook-instance.application-creation.schemas.js.map +1 -0
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +26 -6
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +28 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +7 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +7 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.d.ts +1 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js +1 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +24 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +75 -5
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +6 -0
- package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts +11 -0
- package/dist/esm/assurance/assurance-document-blueprint-selection.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-blueprint-selection.js +22 -3
- package/dist/esm/assurance/assurance-document-blueprint-selection.js.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 +39 -6
- package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts +11 -0
- package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-document-system.schemas.js +19 -0
- package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +295 -31
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-foundation.schemas.d.ts +7 -0
- package/dist/esm/assurance/assurance-foundation.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-foundation.schemas.js +7 -0
- package/dist/esm/assurance/assurance-foundation.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +17 -0
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +5 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program-generation.schemas.js +6 -3
- package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-program.family-aspects.js +1 -1
- package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.d.ts +232 -3
- package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-program.schemas.js +107 -14
- package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.js +77 -1
- package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +23 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/governed-document-release.d.ts +7 -0
- package/dist/esm/assurance/governed-document-release.d.ts.map +1 -1
- package/dist/esm/assurance/governed-document-release.js +11 -2
- package/dist/esm/assurance/governed-document-release.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +6 -5
- 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 +1 -0
- 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 +35 -33
- 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 +6 -2
- 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 +13 -12
- 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 +26 -2
- 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 +4 -4
- package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +11 -9
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +2 -2
- 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 +1 -0
- 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 +45 -32
- 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 +1 -23
- 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 +185 -31
- package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts +2 -1
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js +29 -7
- package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js.map +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 +7 -1
- 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 +9 -6
- 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 +1 -0
- 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 +11 -7
- 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 +18 -16
- 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 +9 -11
- 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 +238 -219
- 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 +0 -24
- 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 +76 -16
- package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts +2 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js +28 -6
- package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js.map +1 -1
- 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 +29 -11
- package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js +1 -1
- package/dist/esm/engine/billing/resources/billing-provider-event-settlements.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +2 -0
- 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 +13 -12
- package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +5 -5
- 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 +12 -9
- package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.d.ts +7 -4
- package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/products.resource.specification.js +36 -16
- 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 +13 -10
- package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts +13 -8
- package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js +54 -20
- package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +30 -4
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +85 -25
- package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +2 -2
- package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts +15 -2
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js +45 -10
- package/dist/esm/engine/compliance/resources/application-audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts +15 -2
- 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 +52 -12
- package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/index.d.ts +1 -0
- package/dist/esm/engine/compliance/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/index.js +1 -0
- package/dist/esm/engine/compliance/resources/index.js.map +1 -1
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts +39 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js +325 -0
- package/dist/esm/engine/compliance/resources/legal-holds.resource.specification.js.map +1 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts +23 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js +197 -0
- package/dist/esm/engine/compliance/resources/retention-enforcement-records.resource.specification.js.map +1 -0
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +59 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
- package/dist/esm/engine/errors/error-messages.specification.js +69 -0
- package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
- package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts +5 -5
- 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 +9 -10
- 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 +5 -5
- package/dist/esm/engine/features/resources/organization-features.resource.specification.js +11 -11
- 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 +5 -5
- package/dist/esm/engine/features/resources/user-features.resource.specification.js +3 -3
- 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 +7 -8
- 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.map +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +16 -4
- 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.js +1 -1
- package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts +11 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js +382 -0
- package/dist/esm/engine/flows-actors/resources/agent-work-decisions.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +139 -1
- 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 +150 -4
- 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.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +9 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js +162 -0
- package/dist/esm/engine/flows-actors/resources/model-call-attributions.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js +158 -0
- package/dist/esm/engine/flows-actors/resources/model-cost-period-aggregates.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts +2 -1
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js +16 -9
- package/dist/esm/engine/flows-actors/resources/provider-call-records.resource.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-queue.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/ai-elements/decision/ai-approval-request.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-work-override-rate-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-appearance-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js +3 -1
- package/dist/esm/engine/frontend-components/app/app-layout-billing-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js +5 -4
- package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/app/app-layout-invitations-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/auth/admin-config/app-page-security-settings.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/billing/billing-pricing-table.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-number.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/data-display/formatters/display-field-string.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-approval.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/flows-actors/low-level-ai-decision.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-address.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js +2 -2
- package/dist/esm/engine/frontend-components/form/fields/form-field-string.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/index.d.ts +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/index.js +3 -0
- package/dist/esm/engine/frontend-components/index.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resource-layout-empty-state.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-display.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js +1 -1
- package/dist/esm/engine/frontend-components/resources/resources-fields-resource-reference-edit.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js +9 -4
- package/dist/esm/engine/frontend-components/sections/stepper.frontend-component.specification.js.map +1 -1
- package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +4 -4
- 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.map +1 -1
- package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +34 -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.map +1 -1
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +26 -0
- package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js +122 -0
- package/dist/esm/engine/infrastructure/resources/external-data-erasure-suppressions.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js +152 -0
- package/dist/esm/engine/infrastructure/resources/external-data-outbound-changes.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts +10 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js +94 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pending-references.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts +10 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js +64 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership-keys.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts +4 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js +20 -16
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-membership.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js +200 -0
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-run-records.resource.specification.js.map +1 -0
- 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 +19 -6
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js +97 -0
- package/dist/esm/engine/infrastructure/resources/external-data-remote-versions.resource.specification.js.map +1 -0
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts +8 -0
- 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 -2
- 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 +2 -2
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +1 -1
- package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js +4 -4
- package/dist/esm/engine/infrastructure/resources/system-of-record-partition-assignments.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js +153 -0
- package/dist/esm/engine/infrastructure/resources/system-of-record-write-admissions.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts +81 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js +437 -0
- package/dist/esm/engine/notifications/resources/conversation-threads.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts +112 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js +287 -0
- package/dist/esm/engine/notifications/resources/inbound-deliveries.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts +131 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +594 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/index.d.ts +1 -0
- package/dist/esm/engine/notifications/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/index.js +1 -0
- package/dist/esm/engine/notifications/resources/index.js.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts +6 -3
- 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 +20 -5
- 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.map +1 -1
- package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +12 -2
- 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 +6 -6
- 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 +8 -11
- package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts +4 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js +62 -0
- package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js.map +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts +2 -1
- package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/index.js +4 -2
- package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/index.d.ts +2 -0
- package/dist/esm/engine/organizations/resources/index.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/index.js +2 -0
- package/dist/esm/engine/organizations/resources/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +3 -0
- 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 +40 -12
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +2 -2
- package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +2 -2
- 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 +0 -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 +4 -6
- 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 +7 -3
- 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 +15 -8
- 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 +3 -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 +36 -21
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts +38 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js +152 -0
- package/dist/esm/engine/organizations/resources/service-provider-activity-feed.resource.specification.js.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts +106 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js +417 -0
- package/dist/esm/engine/organizations/resources/service-provider-relationships.resource.specification.js.map +1 -0
- package/dist/esm/engine/providers/apple.provider.specification.js +1 -1
- package/dist/esm/engine/providers/apple.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/github.provider.specification.js +1 -1
- package/dist/esm/engine/providers/github.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/google-places.provider.specification.d.ts +6 -0
- package/dist/esm/engine/providers/google-places.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/google-places.provider.specification.js +44 -0
- package/dist/esm/engine/providers/google-places.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/google.provider.specification.js +1 -1
- package/dist/esm/engine/providers/google.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/index.d.ts +2 -0
- package/dist/esm/engine/providers/index.d.ts.map +1 -1
- package/dist/esm/engine/providers/index.js +5 -1
- package/dist/esm/engine/providers/index.js.map +1 -1
- package/dist/esm/engine/providers/microsoft.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/microsoft.provider.specification.js +10 -6
- package/dist/esm/engine/providers/microsoft.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts +6 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.js +38 -0
- package/dist/esm/engine/providers/recaptcha.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/resend.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/resend.provider.specification.js +3 -1
- package/dist/esm/engine/providers/resend.provider.specification.js.map +1 -1
- package/dist/esm/engine/providers/stripe.provider.specification.d.ts.map +1 -1
- package/dist/esm/engine/providers/stripe.provider.specification.js +3 -2
- package/dist/esm/engine/providers/stripe.provider.specification.js.map +1 -1
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js +21 -0
- package/dist/esm/engine/roles/app-billing-provider-events.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js +21 -0
- package/dist/esm/engine/roles/app-email-inbound-intake.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/index.d.ts +13 -5
- package/dist/esm/engine/roles/index.d.ts.map +1 -1
- package/dist/esm/engine/roles/index.js +19 -6
- package/dist/esm/engine/roles/index.js.map +1 -1
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js +21 -0
- package/dist/esm/engine/roles/org-billing-provider-events.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts +7 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js +72 -0
- package/dist/esm/engine/roles/org-delegated-capabilities.role.specification.js.map +1 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts +2 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.d.ts.map +1 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.js +22 -0
- package/dist/esm/engine/roles/org-service-provider.role.specification.js.map +1 -0
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +2 -2
- package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +3 -3
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts +1 -1
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js +3 -6
- package/dist/esm/engine/users/resources/self-service-user-notifications.shared.js.map +1 -1
- package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -2
- 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.js +2 -2
- package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +0 -4
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +0 -3
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +0 -3
- 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 +7 -7
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +5 -5
- 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 +0 -3
- 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 +11 -18
- 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.js +6 -6
- 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 +5 -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 +8 -5
- package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js +49 -16
- 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.map +1 -1
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +29 -10
- package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/dist/assurance/external-framework-mapping.json +0 -1228
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;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAuB3E,MAAM,0BAA0B,GAAG;IACjC,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,gBAAgB;CACd,CAAC;AAEX,SAAS,SAAS,CAAC,GAAsC;IACvD,OAAO;QACL,IAAI,EAAE,CAAC,GAAG,CAAC;QACX,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;KACnD,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAG,CAAC,EAC7B,aAAa,EACb,YAAY,EACZ,cAAc,GACa,EAAE,EAAE,CAAC,CAAC;IACjC,CAAC,EAAE,CA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JAAqJ;SACtJ;KACF;IAED,MAAM,EAAE;QACN,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC;YAC9B,OAAO,EAAE,wDAAwD;YACjE,YAAY,EAAE,YAAY;YAC1B,UAAU,EAAE,uBAAuB,CAAC,OAAO;SAC5C,CAAC;QAEF,cAAc,EAAE,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC;YACxD,OAAO,EAAE,+DAA+D;YACxE,YAAY,EAAE,mGAAmG;YACjH,UAAU,EAAE,uBAAuB,CAAC,OAAO;SAC5C,CAAC;QAEF,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC;YAClC,OAAO,EAAE,sDAAsD;YAC/D,UAAU,EAAE,uBAAuB,CAAC,OAAO;YAC3C,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,+PAA+P;QAC/P,+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 record 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 records 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 record 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 record 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 record 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 record.',\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` record 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 record.',\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)`, refusing the `:` key separator). 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 'The `identifier` is NOT the badge\\'s identity — a definition is `(scope, identifier)` and is NAMED by the KEY `<scope>:<identifier>`. The identifier alone is what a persisted row carries, because each scope owns its own collection so the scope is implicit in the table. Everything that REFERS to a badge — a launcher item\\'s `notificationBadgeRef`, an operation\\'s `notificationBadgeOperations[].badgeRef`, the browser count store — uses the key, and two definitions sharing one key are refused at startup. Do not reintroduce an identifier-only lookup: it made the second of two same-identifier definitions unreachable and gave it the first\\'s count.',\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` bullets that explain the identifier constraints and why the badge KEY, not the identifier, is what refers to a definition.',\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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sH;YAC/H,YAAY,EAAE,iIAAiI;YAC/I,UAAU,EAAE,uBAAuB,CAAC,OAAO;SAC5C,CAAC;QAEF,cAAc,EAAE,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC;YACxD,OAAO,EAAE,+DAA+D;YACxE,YAAY,EAAE,mGAAmG;YACjH,UAAU,EAAE,uBAAuB,CAAC,OAAO;SAC5C,CAAC;QAEF,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC;YAClC,OAAO,EAAE,sDAAsD;YAC/D,UAAU,EAAE,uBAAuB,CAAC,OAAO;YAC3C,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,+PAA+P;QAC/P,+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 record 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 records 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 record 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).' },\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 record 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).' },\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 record 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 record.',\n whyItMatters: 'Stable anchor for updates and list projections per user + identifier.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n identifier: schemaShape.identifier.stringSpec({\n meaning: 'The application-defined name of the badge this count belongs to, for example `unread-messages`. It never contains `:`.',\n whyItMatters: 'Tells the caller what the number counts; together with the scope it names the badge definition as `user_self:<identifier>`.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n userId: schemaShape.userId.foreignKeySpec({\n meaning: 'The Wildo `users` record 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 record.',\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)`, refusing the `:` key separator). 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 'The `identifier` is NOT the badge\\'s identity — a definition is `(scope, identifier)` and is NAMED by the KEY `<scope>:<identifier>`. The identifier alone is what a persisted row carries, because each scope owns its own collection so the scope is implicit in the table. Everything that REFERS to a badge — a launcher item\\'s `notificationBadgeRef`, an operation\\'s `notificationBadgeOperations[].badgeRef`, the browser count store — uses the key, and two definitions sharing one key are refused at startup. Do not reintroduce an identifier-only lookup: it made the second of two same-identifier definitions unreachable and gave it the first\\'s count.',\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 identifier: schemaShape.identifier.stringSpec({\n meaning: 'The application-defined name of the badge this count belongs to, for example `open-invoices`. It never contains `:`.',\n whyItMatters: 'Tells the caller what the number counts; together with the scope it names the badge definition as `organizations:<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` bullets that explain the identifier constraints and why the badge KEY, not the identifier, is what refers to a definition.',\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"]}
|
|
@@ -23,12 +23,12 @@ export declare const organizationWebhookConfigResourceSpecification: ResourceSpe
|
|
|
23
23
|
_id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
|
|
24
24
|
enabled: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
25
25
|
endpoints: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
|
|
26
|
-
id: import("zod").ZodString
|
|
26
|
+
id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
|
|
27
27
|
url: import("zod").ZodURL;
|
|
28
28
|
description: import("zod").ZodDefault<import("zod").ZodString>;
|
|
29
29
|
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
30
|
-
createdAt: import("zod").ZodDefault<import("zod").ZodDate
|
|
31
|
-
updatedAt: import("zod").ZodDefault<import("zod").ZodDate
|
|
30
|
+
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>;
|
|
31
|
+
updatedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>;
|
|
32
32
|
}, import("zod/v4/core").$strip>>>;
|
|
33
33
|
applicationPublicKeyPem: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>>;
|
|
34
34
|
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
|
|
@@ -38,12 +38,12 @@ export declare const applicationWebhookConfigResourceSpecification: ResourceSpec
|
|
|
38
38
|
_id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
|
|
39
39
|
enabled: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
40
40
|
endpoints: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
|
|
41
|
-
id: import("zod").ZodString
|
|
41
|
+
id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>;
|
|
42
42
|
url: import("zod").ZodURL;
|
|
43
43
|
description: import("zod").ZodDefault<import("zod").ZodString>;
|
|
44
44
|
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
45
|
-
createdAt: import("zod").ZodDefault<import("zod").ZodDate
|
|
46
|
-
updatedAt: import("zod").ZodDefault<import("zod").ZodDate
|
|
45
|
+
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>;
|
|
46
|
+
updatedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>;
|
|
47
47
|
}, import("zod/v4/core").$strip>>>;
|
|
48
48
|
applicationPublicKeyPem: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>>;
|
|
49
49
|
createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodDate>>>;
|
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;AA+YrC,eAAO,MAAM,8CAA8C;;;;;;;;;;;;;;iCAG1D,CAAC;AAEF,eAAO,MAAM,6CAA6C;;;;;;;;;;;;;;iCAGzD,CAAC"}
|
|
@@ -125,7 +125,7 @@ function buildWebhookConfigBaseSpecification(resourceType, memberName) {
|
|
|
125
125
|
endpoints: schemaShape.endpoints.arraySpec({
|
|
126
126
|
meaning: 'Admin-configured destination URLs, each with its own `enabled` bit and `endpointId` for delivery-log provenance.',
|
|
127
127
|
whyItMatters: 'M2M events fan out to every enabled row; disabled endpoints are skipped per dispatch.',
|
|
128
|
-
elementMeaning: 'One `WebhookEndpointSchema` (id, url, description,
|
|
128
|
+
elementMeaning: 'One `WebhookEndpointSchema` (id, url, description, enabled flag, created/updated timestamps). The id and both timestamps are set by the server on save: a new endpoint sent without an id is assigned one, `createdAt` is kept from the stored endpoint with the same id, and `updatedAt` moves only when that endpoint\u2019s url, description or switch changed.',
|
|
129
129
|
elementType: {
|
|
130
130
|
notes: [
|
|
131
131
|
'Element schema: `WebhookEndpointSchema` in `engine/saas-models/src/notifications/m2m/webhook-config.shared.schemas.ts`.',
|
|
@@ -175,7 +175,7 @@ function buildWebhookConfigBaseSpecification(resourceType, memberName) {
|
|
|
175
175
|
{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The baseline (disabled) singleton config record was seeded for this scope and returned. Internal/service write path — system seeds or platform bootstrap run this, not a public HTTP create.' },
|
|
176
176
|
],
|
|
177
177
|
errorScenarios: [
|
|
178
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The seed payload fails schema validation (e.g. a non-HTTPS endpoint URL or a malformed endpoint entry).'
|
|
178
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The seed payload fails schema validation (e.g. a non-HTTPS endpoint URL or a malformed endpoint entry).' },
|
|
179
179
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A non-system/non-admin caller attempts to seed the config row.' },
|
|
180
180
|
{ 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.' },
|
|
181
181
|
],
|
|
@@ -202,13 +202,13 @@ function buildWebhookConfigBaseSpecification(resourceType, memberName) {
|
|
|
202
202
|
},
|
|
203
203
|
[Op.UPDATE]: {
|
|
204
204
|
purpose: 'Persist endpoint URL edits, enable toggles, and metadata updates for the current scope’s singleton.',
|
|
205
|
-
outcome: 'The next M2M notification fire sees the new routing truth immediately after commit.',
|
|
205
|
+
outcome: 'The next M2M notification fire sees the new routing truth immediately after commit. The endpoint list is replaced whole, and before it is stored each endpoint is matched to the stored one with the same id: that endpoint keeps its `createdAt`, and its `updatedAt` advances only if its url, description or switch changed. A new endpoint is stamped with the save time, and assigned an id when it arrives without one. Timestamps a client sends are ignored. Saving a plaintext `http://` destination is allowed and logs a warning naming its host.',
|
|
206
206
|
whenToUse: 'Use in admin “save endpoints” flows or through trusted automation. This IS the generic PUT, and it is the only caller: the variant was REPOSITORY_ONLY — route-less — with no engine service reaching it either, so the pane that exists to edit these endpoints could not save. Gated on org-admin / app-super-admin.',
|
|
207
207
|
responseStatuses: [
|
|
208
208
|
{ code: HttpResponseStatusCode.OK_200, meaning: 'The endpoint list / `enabled` toggles / metadata were persisted and the updated singleton config is returned.' },
|
|
209
209
|
],
|
|
210
210
|
errorScenarios: [
|
|
211
|
-
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited endpoints or flags fail schema validation
|
|
211
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited endpoints or flags fail schema validation: an endpoint URL that is not a URL, a description over 500 characters, or two endpoints sharing an id. A plaintext `http://` URL is not refused.' },
|
|
212
212
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to change webhook configuration.' },
|
|
213
213
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No webhook config has been seeded for this scope to update.' },
|
|
214
214
|
],
|
|
@@ -236,7 +236,7 @@ function buildWebhookConfigBaseSpecification(resourceType, memberName) {
|
|
|
236
236
|
errorScenarios: [
|
|
237
237
|
{ 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.' },
|
|
238
238
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin / app-super-admin role required to fire a test delivery.' },
|
|
239
|
-
{ 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.'
|
|
239
|
+
{ 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.' },
|
|
240
240
|
{ 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.' },
|
|
241
241
|
],
|
|
242
242
|
idempotent: false,
|
|
@@ -350,22 +350,20 @@ function buildWebhookConfigSpecification(resourceType, memberName) {
|
|
|
350
350
|
return resourceSpecificationFromFrontendConfiguration(mergeResourceFrontendConfigurations(resourceFrontendConfiguration(main), resourceFrontendConfiguration(admin)), base, () => ({
|
|
351
351
|
layout: {
|
|
352
352
|
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.',
|
|
353
|
-
displayPurpose: 'Read template renders the same three sections in that order
|
|
353
|
+
displayPurpose: 'Read template renders the same three sections in that order, none with a description: the one-switch `status` card has no heading (the switch\'s label says it), the `endpoints` heading names the list so the list itself is unlabelled, and the public key sits under its label at full width. Timestamps and the surrogate id are intentionally omitted from the curated admin read.',
|
|
354
354
|
sections: {
|
|
355
355
|
status: {
|
|
356
356
|
purpose: 'The master `enabled` kill-switch for outbound delivery in this scope.',
|
|
357
357
|
whenToUse: 'First decision: pause or resume all deliveries without editing endpoints.',
|
|
358
358
|
textSlots: {
|
|
359
|
-
title: { purpose: 'Name the “deliveries on / paused” card.' },
|
|
360
|
-
description: { purpose: 'Clarify that disabling stops new deliveries but keeps the endpoint configuration intact.' },
|
|
359
|
+
title: { purpose: 'Name the “deliveries on / paused” card. Not rendered on the read page, where the switch\'s own label says it.' },
|
|
361
360
|
},
|
|
362
361
|
},
|
|
363
362
|
endpoints: {
|
|
364
363
|
purpose: 'The admin-configured destination URLs, each with its own enable bit and stable `endpointId`.',
|
|
365
364
|
whenToUse: 'Adding, disabling, or auditing where M2M events fan out.',
|
|
366
365
|
textSlots: {
|
|
367
|
-
title: { purpose: 'Label the destinations / endpoints block.' },
|
|
368
|
-
description: { purpose: 'Note that each enabled endpoint receives every dispatched event; disabled endpoints are skipped per delivery.' },
|
|
366
|
+
title: { purpose: 'Label the destinations / endpoints block; the list beneath it carries no label of its own.' },
|
|
369
367
|
},
|
|
370
368
|
},
|
|
371
369
|
verification: {
|
|
@@ -373,7 +371,6 @@ function buildWebhookConfigSpecification(resourceType, memberName) {
|
|
|
373
371
|
whenToUse: 'When a receiver sets up or rotates signature verification.',
|
|
374
372
|
textSlots: {
|
|
375
373
|
title: { purpose: 'Label the signature-verification key block.' },
|
|
376
|
-
description: { purpose: 'Read-only; the public half of the app webhook signing key, refreshed on read after rotation.' },
|
|
377
374
|
},
|
|
378
375
|
},
|
|
379
376
|
},
|
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,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,EAAE,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,YAAY,YAAY,oBAAoB,UAAU,GAAG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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 record 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-wildo-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 record was first inserted.',\n temporalRole: 'creation',\n }),\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the record 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 record 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. This IS the generic PUT, and it is the only caller: the variant was REPOSITORY_ONLY — route-less — with no engine service reaching it either, so the pane that exists to edit these endpoints could not save. Gated on org-admin / app-super-admin.',\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 record 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 check reachability and the receiver response (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, the probe’s `signatureJti` for correlation against the consumer’s own logs, and `transportIsPlaintext` — NOT the configuration row. `transportIsPlaintext` is independent of `outcome`: an endpoint on `http://` can answer `accepted` and still be sending the delivery signature in the clear, where it is readable and replayable until it expires. Plaintext endpoints are admitted deliberately (see `WebhookEndpointSchema.url`), so this probe is where that admission is surfaced to the admin who can act on it.',\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 and response status; signature verification is only established if the receiver performs it) 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 transportIsPlaintext: false,\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 transportIsPlaintext: false,\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 transportIsPlaintext: false,\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 transportIsPlaintext: false,\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 title: 'Endpoint accepts the probe, but over plaintext HTTP',\n request: { endpointId: 'whe_legacy_plaintext' },\n response: {\n endpointId: 'whe_legacy_plaintext',\n url: 'http://legacy.example.com/wildo',\n // The case this field exists for (#492). A working endpoint AND a credential on the\n // wire — `ACCEPTED` is the truthful outcome, and reporting the exposure as a failure\n // would be false, so the two are stated separately.\n transportIsPlaintext: true,\n outcome: WebhookEndpointProbeOutcome.ACCEPTED,\n responseStatus: 200,\n responseBodyTruncated: 'ok',\n durationMs: 77,\n signatureJti: 'probe_01HX2PLAINTEXT',\n attemptedAt: '2026-06-14T12:09: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-wildo-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-wildo-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;AA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,EAAE,2EAA2E;oBACtF,SAAS,EAAE;wBACT,KAAK,EAAE,EAAE,OAAO,EAAE,+GAA+G,EAAE;qBACpI;iBACF;gBACD,SAAS,EAAE;oBACT,OAAO,EAAE,8FAA8F;oBACvG,SAAS,EAAE,0DAA0D;oBACrE,SAAS,EAAE;wBACT,KAAK,EAAE,EAAE,OAAO,EAAE,4FAA4F,EAAE;qBACjH;iBACF;gBACD,YAAY,EAAE;oBACZ,OAAO,EAAE,oGAAoG;oBAC7G,SAAS,EAAE,4DAA4D;oBACvE,SAAS,EAAE;wBACT,KAAK,EAAE,EAAE,OAAO,EAAE,6CAA6C,EAAE;qBAClE;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 record 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, enabled flag, created/updated timestamps). The id and both timestamps are set by the server on save: a new endpoint sent without an id is assigned one, `createdAt` is kept from the stored endpoint with the same id, and `updatedAt` moves only when that endpoint\\u2019s url, description or switch changed.',\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-wildo-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 record was first inserted.',\n temporalRole: 'creation',\n }),\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the record 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 record 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).' },\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. The endpoint list is replaced whole, and before it is stored each endpoint is matched to the stored one with the same id: that endpoint keeps its `createdAt`, and its `updatedAt` advances only if its url, description or switch changed. A new endpoint is stamped with the save time, and assigned an id when it arrives without one. Timestamps a client sends are ignored. Saving a plaintext `http://` destination is allowed and logs a warning naming its host.',\n whenToUse: 'Use in admin “save endpoints” flows or through trusted automation. This IS the generic PUT, and it is the only caller: the variant was REPOSITORY_ONLY — route-less — with no engine service reaching it either, so the pane that exists to edit these endpoints could not save. Gated on org-admin / app-super-admin.',\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: an endpoint URL that is not a URL, a description over 500 characters, or two endpoints sharing an id. A plaintext `http://` URL is not refused.' },\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 record 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 check reachability and the receiver response (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, the probe’s `signatureJti` for correlation against the consumer’s own logs, and `transportIsPlaintext` — NOT the configuration row. `transportIsPlaintext` is independent of `outcome`: an endpoint on `http://` can answer `accepted` and still be sending the delivery signature in the clear, where it is readable and replayable until it expires. Plaintext endpoints are admitted deliberately (see `WebhookEndpointSchema.url`), so this probe is where that admission is surfaced to the admin who can act on it.',\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 and response status; signature verification is only established if the receiver performs it) 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.' },\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 transportIsPlaintext: false,\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 transportIsPlaintext: false,\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 transportIsPlaintext: false,\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 transportIsPlaintext: false,\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 title: 'Endpoint accepts the probe, but over plaintext HTTP',\n request: { endpointId: 'whe_legacy_plaintext' },\n response: {\n endpointId: 'whe_legacy_plaintext',\n url: 'http://legacy.example.com/wildo',\n // The case this field exists for (#492). A working endpoint AND a credential on the\n // wire — `ACCEPTED` is the truthful outcome, and reporting the exposure as a failure\n // would be false, so the two are stated separately.\n transportIsPlaintext: true,\n outcome: WebhookEndpointProbeOutcome.ACCEPTED,\n responseStatus: 200,\n responseBodyTruncated: 'ok',\n durationMs: 77,\n signatureJti: 'probe_01HX2PLAINTEXT',\n attemptedAt: '2026-06-14T12:09: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-wildo-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, none with a description: the one-switch `status` card has no heading (the switch\\'s label says it), the `endpoints` heading names the list so the list itself is unlabelled, and the public key sits under its label at full width. 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. Not rendered on the read page, where the switch\\'s own label says it.' },\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; the list beneath it carries no label of its own.' },\n },\n },\n verification: {\n purpose: 'The derived `applicationPublicKeyPem` receivers use to verify the JWT `x-wildo-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 },\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/notifications/system-emails/human-decision.system-emails.specification.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SystemEmailTemplateSpecificationConfig } from '../../../_core';
|
|
2
|
+
export declare const humanDecisionDeadlineSystemTemplateSpecification: SystemEmailTemplateSpecificationConfig;
|
|
3
|
+
export declare const humanDecisionSystemEmailTemplateSpecifications: SystemEmailTemplateSpecificationConfig[];
|
|
4
|
+
//# sourceMappingURL=human-decision.system-emails.specification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human-decision.system-emails.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notifications/system-emails/human-decision.system-emails.specification.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,KAAK,sCAAsC,EAC5C,MAAM,6BAA6B,CAAC;AAuBrC,eAAO,MAAM,gDAAgD,wCAuC5D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,sCAAsC,EAElG,CAAC"}
|
package/dist/esm/engine/notifications/system-emails/human-decision.system-emails.specification.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CodeDeclarationKind, CodeSymbolKind, } from '@wildo-ai/zod-decorators';
|
|
2
|
+
import { SystemEmailTemplateRef, SystemEmailTemplateRegistry, } from '@wildo-ai/saas-models';
|
|
3
|
+
import { systemEmailTemplateSpecificationFromRegistryEntry, SpecificationOwnerKind, } from '../../../_core/index.js';
|
|
4
|
+
/** Owner ref for engine-shipped system-email template specifications (see `security.system-emails.specification.ts`). */
|
|
5
|
+
const ENGINE_OWNER_REF = {
|
|
6
|
+
ownerId: 'engine',
|
|
7
|
+
ownerKind: SpecificationOwnerKind.ENGINE,
|
|
8
|
+
};
|
|
9
|
+
const TEMPLATE_REF_DECLARATION = {
|
|
10
|
+
packageName: '@wildo-ai/saas-models',
|
|
11
|
+
exportName: 'SystemEmailTemplateRef',
|
|
12
|
+
symbolKind: CodeSymbolKind.ENUM,
|
|
13
|
+
declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,
|
|
14
|
+
};
|
|
15
|
+
const EVENT_DATA_SCHEMA_SYMBOL = {
|
|
16
|
+
packageName: '@wildo-ai/saas-models',
|
|
17
|
+
exportName: 'SystemEmailTemplateRegistry',
|
|
18
|
+
symbolKind: CodeSymbolKind.CONFIG,
|
|
19
|
+
declarationKind: CodeDeclarationKind.CONST_OBJECT,
|
|
20
|
+
notes: ['Look up the entry by `SystemEmailTemplateRef.*` to reach the `eventDataSchema` for this template.'],
|
|
21
|
+
};
|
|
22
|
+
export const humanDecisionDeadlineSystemTemplateSpecification = systemEmailTemplateSpecificationFromRegistryEntry(SystemEmailTemplateRegistry[SystemEmailTemplateRef.HUMAN_DECISION_DEADLINE], () => ({
|
|
23
|
+
purpose: 'Remind the people who may answer a pending decision on an agent\'s action that it is waiting, before or after a service-target deadline, or tell the one person a deadline rule just moved it to.',
|
|
24
|
+
tone: 'Brief, factual and courteous — a reminder among colleagues, never an alarm and never a reproach.',
|
|
25
|
+
useWhen: 'Sent by the decision-deadline sweep (#1628) at a stage the gate arms: `claim_warning` and `decision_warning` before the CLAIM or DECISION deadline, `claim_missed` and `decision_missed` once it passed, and with `reassignedToYou` when the stage\'s REASSIGN rule moved the decision to the recipient.',
|
|
26
|
+
avoidWhen: 'Do not use to announce a newly raised decision (the inbox and the routed-decision socket event do that), nor to report how a decision ended.',
|
|
27
|
+
textSlots: {
|
|
28
|
+
subject: {
|
|
29
|
+
purpose: 'Say that a decision is waiting for the recipient, in the words the labels author for the stage.',
|
|
30
|
+
},
|
|
31
|
+
previewText: {
|
|
32
|
+
purpose: 'Short preview naming the stage in plain terms.',
|
|
33
|
+
},
|
|
34
|
+
body: {
|
|
35
|
+
purpose: 'One paragraph per stage: a WARNING says the deadline is near; a MISSED stage says it passed and that the decision can still be answered until it lapses; a reassignment says it was moved to the recipient because nobody answered in time.',
|
|
36
|
+
notes: ['Never state or imply that the decision was approved, rejected or cancelled: a deadline changes who is asked, never the outcome.'],
|
|
37
|
+
},
|
|
38
|
+
detailsLabel: {
|
|
39
|
+
purpose: 'Labels for the gated action (tool name), the deadline and the lapse instant.',
|
|
40
|
+
},
|
|
41
|
+
ctaLabel: {
|
|
42
|
+
purpose: 'Primary action label that opens the application at `eventData.appUrl`, where the decision waits in the recipient\'s inbox.',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
eventData: {
|
|
46
|
+
purpose: 'The stage, whether the decision was moved to the recipient, the decision id, the gated tool name, the deadline, the lapse instant and an optional inbox URL. Never the tool\'s arguments.',
|
|
47
|
+
notes: ['Treat `stage` as a translatable category identifier; the words come from the template labels keyed by `ReviewDeadlineStage`.'],
|
|
48
|
+
},
|
|
49
|
+
businessConstraints: [
|
|
50
|
+
'Never include the proposed tool arguments or anything from the conversation: the email reaches a mailbox, and the decision card behind the link is the only place the proposal is shown.',
|
|
51
|
+
'Sent only to the route\'s candidates at the moment the stage fires (and to the gate owner at a DECISION stage), never to an organization-wide list.',
|
|
52
|
+
],
|
|
53
|
+
codeHandling: {
|
|
54
|
+
definitionOwner: ENGINE_OWNER_REF,
|
|
55
|
+
templateRefDeclaration: TEMPLATE_REF_DECLARATION,
|
|
56
|
+
eventDataSchemaSymbol: EVENT_DATA_SCHEMA_SYMBOL,
|
|
57
|
+
},
|
|
58
|
+
}));
|
|
59
|
+
export const humanDecisionSystemEmailTemplateSpecifications = [
|
|
60
|
+
humanDecisionDeadlineSystemTemplateSpecification,
|
|
61
|
+
];
|
|
62
|
+
//# sourceMappingURL=human-decision.system-emails.specification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"human-decision.system-emails.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/notifications/system-emails/human-decision.system-emails.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iDAAiD,EACjD,sBAAsB,GAGvB,MAAM,6BAA6B,CAAC;AAErC,yHAAyH;AACzH,MAAM,gBAAgB,GAA0B;IAC9C,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,sBAAsB,CAAC,MAAM;CACzC,CAAC;AAEF,MAAM,wBAAwB,GAAkB;IAC9C,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE,wBAAwB;IACpC,UAAU,EAAE,cAAc,CAAC,IAAI;IAC/B,eAAe,EAAE,mBAAmB,CAAC,eAAe;CACrD,CAAC;AAEF,MAAM,wBAAwB,GAAkB;IAC9C,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE,6BAA6B;IACzC,UAAU,EAAE,cAAc,CAAC,MAAM;IACjC,eAAe,EAAE,mBAAmB,CAAC,YAAY;IACjD,KAAK,EAAE,CAAC,mGAAmG,CAAC;CAC7G,CAAC;AAEF,MAAM,CAAC,MAAM,gDAAgD,GAAG,iDAAiD,CAC/G,2BAA2B,CAAC,sBAAsB,CAAC,uBAAuB,CAAC,EAC3E,GAAG,EAAE,CAAC,CAAC;IACL,OAAO,EAAE,mMAAmM;IAC5M,IAAI,EAAE,kGAAkG;IACxG,OAAO,EAAE,0SAA0S;IACnT,SAAS,EAAE,8IAA8I;IACzJ,SAAS,EAAE;QACT,OAAO,EAAE;YACP,OAAO,EAAE,iGAAiG;SAC3G;QACD,WAAW,EAAE;YACX,OAAO,EAAE,gDAAgD;SAC1D;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,6OAA6O;YACtP,KAAK,EAAE,CAAC,iIAAiI,CAAC;SAC3I;QACD,YAAY,EAAE;YACZ,OAAO,EAAE,8EAA8E;SACxF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,4HAA4H;SACtI;KACF;IACD,SAAS,EAAE;QACT,OAAO,EAAE,2LAA2L;QACpM,KAAK,EAAE,CAAC,8HAA8H,CAAC;KACxI;IACD,mBAAmB,EAAE;QACnB,0LAA0L;QAC1L,qJAAqJ;KACtJ;IACD,YAAY,EAAE;QACZ,eAAe,EAAE,gBAAgB;QACjC,sBAAsB,EAAE,wBAAwB;QAChD,qBAAqB,EAAE,wBAAwB;KAChD;CACF,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,8CAA8C,GAA6C;IACtG,gDAAgD;CACjD,CAAC","sourcesContent":["import {\n CodeDeclarationKind,\n CodeSymbolKind,\n type CodeSymbolRef,\n} from '@wildo-ai/zod-decorators';\nimport {\n SystemEmailTemplateRef,\n SystemEmailTemplateRegistry,\n} from '@wildo-ai/saas-models';\nimport {\n systemEmailTemplateSpecificationFromRegistryEntry,\n SpecificationOwnerKind,\n type SpecificationOwnerRef,\n type SystemEmailTemplateSpecificationConfig,\n} from '~wildo-specifications/_core';\n\n/** Owner ref for engine-shipped system-email template specifications (see `security.system-emails.specification.ts`). */\nconst ENGINE_OWNER_REF: SpecificationOwnerRef = {\n ownerId: 'engine',\n ownerKind: SpecificationOwnerKind.ENGINE,\n};\n\nconst TEMPLATE_REF_DECLARATION: CodeSymbolRef = {\n packageName: '@wildo-ai/saas-models',\n exportName: 'SystemEmailTemplateRef',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n};\n\nconst EVENT_DATA_SCHEMA_SYMBOL: CodeSymbolRef = {\n packageName: '@wildo-ai/saas-models',\n exportName: 'SystemEmailTemplateRegistry',\n symbolKind: CodeSymbolKind.CONFIG,\n declarationKind: CodeDeclarationKind.CONST_OBJECT,\n notes: ['Look up the entry by `SystemEmailTemplateRef.*` to reach the `eventDataSchema` for this template.'],\n};\n\nexport const humanDecisionDeadlineSystemTemplateSpecification = systemEmailTemplateSpecificationFromRegistryEntry(\n SystemEmailTemplateRegistry[SystemEmailTemplateRef.HUMAN_DECISION_DEADLINE],\n () => ({\n purpose: 'Remind the people who may answer a pending decision on an agent\\'s action that it is waiting, before or after a service-target deadline, or tell the one person a deadline rule just moved it to.',\n tone: 'Brief, factual and courteous — a reminder among colleagues, never an alarm and never a reproach.',\n useWhen: 'Sent by the decision-deadline sweep (#1628) at a stage the gate arms: `claim_warning` and `decision_warning` before the CLAIM or DECISION deadline, `claim_missed` and `decision_missed` once it passed, and with `reassignedToYou` when the stage\\'s REASSIGN rule moved the decision to the recipient.',\n avoidWhen: 'Do not use to announce a newly raised decision (the inbox and the routed-decision socket event do that), nor to report how a decision ended.',\n textSlots: {\n subject: {\n purpose: 'Say that a decision is waiting for the recipient, in the words the labels author for the stage.',\n },\n previewText: {\n purpose: 'Short preview naming the stage in plain terms.',\n },\n body: {\n purpose: 'One paragraph per stage: a WARNING says the deadline is near; a MISSED stage says it passed and that the decision can still be answered until it lapses; a reassignment says it was moved to the recipient because nobody answered in time.',\n notes: ['Never state or imply that the decision was approved, rejected or cancelled: a deadline changes who is asked, never the outcome.'],\n },\n detailsLabel: {\n purpose: 'Labels for the gated action (tool name), the deadline and the lapse instant.',\n },\n ctaLabel: {\n purpose: 'Primary action label that opens the application at `eventData.appUrl`, where the decision waits in the recipient\\'s inbox.',\n },\n },\n eventData: {\n purpose: 'The stage, whether the decision was moved to the recipient, the decision id, the gated tool name, the deadline, the lapse instant and an optional inbox URL. Never the tool\\'s arguments.',\n notes: ['Treat `stage` as a translatable category identifier; the words come from the template labels keyed by `ReviewDeadlineStage`.'],\n },\n businessConstraints: [\n 'Never include the proposed tool arguments or anything from the conversation: the email reaches a mailbox, and the decision card behind the link is the only place the proposal is shown.',\n 'Sent only to the route\\'s candidates at the moment the stage fires (and to the gate owner at a DECISION stage), never to an organization-wide list.',\n ],\n codeHandling: {\n definitionOwner: ENGINE_OWNER_REF,\n templateRefDeclaration: TEMPLATE_REF_DECLARATION,\n eventDataSchemaSymbol: EVENT_DATA_SCHEMA_SYMBOL,\n },\n }),\n);\n\nexport const humanDecisionSystemEmailTemplateSpecifications: SystemEmailTemplateSpecificationConfig[] = [\n humanDecisionDeadlineSystemTemplateSpecification,\n];\n"]}
|
|
@@ -2,8 +2,9 @@ export * from './authentication.system-emails.specification';
|
|
|
2
2
|
export * from './organization.system-emails.specification';
|
|
3
3
|
export * from './security.system-emails.specification';
|
|
4
4
|
export * from './subscription.system-emails.specification';
|
|
5
|
+
export * from './human-decision.system-emails.specification';
|
|
5
6
|
/**
|
|
6
|
-
* Framework-owned keyed map of
|
|
7
|
+
* Framework-owned keyed map of every system email template specification, one per `SystemEmailTemplateRef`.
|
|
7
8
|
*
|
|
8
9
|
* Applications can merge their own additions into this map when extending the
|
|
9
10
|
* system email-template surface, but the engine already provides a complete
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notifications/system-emails/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/notifications/system-emails/index.ts"],"names":[],"mappings":"AAOA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,uCAAuC,wEAMnD,CAAC"}
|