@wildo-ai/framework-knowledge 1.1.9 → 1.1.10
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/claude-marketplace/.claude-plugin/marketplace.json +1 -1
- package/dist/claude-marketplace/plugins/wildo/.claude-plugin/plugin.json +1 -1
- package/dist/claude-marketplace/plugins/wildo/references/acceptance.md +11 -0
- package/dist/claude-marketplace/plugins/wildo/references/expert-personas-and-deliberations.md +26 -7
- package/dist/claude-marketplace/plugins/wildo/references/runs-judges-and-questions.md +4 -2
- package/dist/claude-marketplace/plugins/wildo/skills/accept/SKILL.md +4 -2
- package/dist/claude-marketplace/plugins/wildo/skills/why/SKILL.md +9 -3
- package/dist/esm/framework-knowledge.definitions.d.ts +1 -1
- package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -1
- package/dist/esm/framework-knowledge.definitions.js +84 -4
- package/dist/esm/framework-knowledge.definitions.js.map +1 -1
- package/dist/esm/framework-knowledge.loader.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.d.ts +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.js +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.build/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts +39 -1
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js +132 -20
- package/dist/esm/playbooks/bottom_up.build-decompose/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.build-dispatch/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.conception/playbook.definition.d.ts +8 -4
- package/dist/esm/playbooks/bottom_up.conception/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.conception/playbook.definition.js +13 -6
- package/dist/esm/playbooks/bottom_up.conception/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts +2 -1
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js +85 -8
- package/dist/esm/playbooks/bottom_up.domain-plan/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.d.ts +4 -3
- package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.js +4 -3
- package/dist/esm/playbooks/bottom_up.experience-plan/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts +12 -3
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js +8 -4
- package/dist/esm/playbooks/bottom_up.placement-plan/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.d.ts +4 -1
- package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.js +2 -1
- package/dist/esm/playbooks/bottom_up.website-plan/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/cross_cutting.application-creation/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/cross_cutting.compliance/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/cross_cutting.feature-development/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/cross_cutting.refinement/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/refinement.compliance-document-candidate/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts +1 -1
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js +13 -1
- package/dist/esm/playbooks/refinement.document-facts/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/refinement.feature-contribution/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/refinement.governance-document-candidate/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts +2 -2
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js +10 -4
- package/dist/esm/playbooks/top_down.brand-identity/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.d.ts +2 -1
- package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.js +5 -3
- package/dist/esm/playbooks/top_down.brand-name-research/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.d.ts +2 -1
- package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.js +11 -9
- package/dist/esm/playbooks/top_down.brand-name-screening-produce/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.d.ts +17 -3
- package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.js +19 -2
- package/dist/esm/playbooks/top_down.brand-naming/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.business-model/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.capability-map/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-analysis/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-conception/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-evidence-adequacy/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-posture/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.compliance-research/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.definition/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.d.ts +27 -6
- package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.js +32 -12
- package/dist/esm/playbooks/top_down.expert-personas/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.feature-drafts/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-analysis/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-evidence-adequacy/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-research/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts +2 -1
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js +13 -5
- package/dist/esm/playbooks/top_down.market-snapshot-produce/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js +38 -3
- package/dist/esm/playbooks/top_down.phase-gate/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts +2 -1
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js +23 -8
- package/dist/esm/playbooks/top_down.requirements-definition/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/top_down.risk-register/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.scope-roadmap/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.value-proposition/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.d.ts.map +1 -1
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js +11 -0
- package/dist/esm/playbooks/top_down.vision-elicitation/playbook.definition.js.map +1 -1
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/external-framework-mapping.json +1 -1
- package/dist/knowledge/manifest.json +7 -7
- package/dist/knowledge/playbooks/bottom_up.assemble-verify/playbook.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.build-decompose/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.build-decompose/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.build-decompose/method.md +149 -11
- package/dist/knowledge/playbooks/bottom_up.build-decompose/playbook.json +40 -2
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/method.md +55 -0
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/playbook.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.conception/playbook.json +10 -2
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.domain-plan/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.domain-plan/method.md +107 -11
- package/dist/knowledge/playbooks/bottom_up.domain-plan/playbook.json +4 -2
- package/dist/knowledge/playbooks/bottom_up.experience-plan/method.md +28 -6
- package/dist/knowledge/playbooks/bottom_up.experience-plan/playbook.json +5 -4
- package/dist/knowledge/playbooks/bottom_up.placement-plan/method.md +50 -0
- package/dist/knowledge/playbooks/bottom_up.placement-plan/playbook.json +16 -4
- package/dist/knowledge/playbooks/bottom_up.website-plan/method.md +19 -0
- package/dist/knowledge/playbooks/bottom_up.website-plan/playbook.json +5 -2
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +2 -1
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +1 -1
- package/dist/knowledge/playbooks/refinement.document-facts/method.md +8 -0
- package/dist/knowledge/playbooks/refinement.document-facts/playbook.json +3 -2
- package/dist/knowledge/playbooks/refinement.feature-contribution/method.md +5 -2
- package/dist/knowledge/playbooks/refinement.feature-contribution/playbook.json +1 -1
- package/dist/knowledge/playbooks/top_down.brand-identity/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.brand-identity/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.brand-identity/method.md +7 -3
- package/dist/knowledge/playbooks/top_down.brand-identity/playbook.json +3 -3
- package/dist/knowledge/playbooks/top_down.brand-name-research/method.md +56 -16
- package/dist/knowledge/playbooks/top_down.brand-name-research/playbook.json +6 -4
- package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/method.md +30 -9
- package/dist/knowledge/playbooks/top_down.brand-name-screening-produce/playbook.json +5 -3
- package/dist/knowledge/playbooks/top_down.brand-naming/playbook.json +12 -1
- package/dist/knowledge/playbooks/top_down.capability-map/method.md +10 -9
- package/dist/knowledge/playbooks/top_down.capability-map/playbook.json +1 -1
- package/dist/knowledge/playbooks/top_down.expert-personas/playbook.json +16 -2
- package/dist/knowledge/playbooks/top_down.feature-drafts/method.md +5 -2
- package/dist/knowledge/playbooks/top_down.feature-drafts/playbook.json +1 -1
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/method.md +26 -0
- package/dist/knowledge/playbooks/top_down.market-snapshot-produce/playbook.json +4 -2
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.phase-gate/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.phase-gate/playbook.json +1 -1
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-protocol.json +1 -1
- package/dist/knowledge/playbooks/top_down.requirements-definition/evaluation-treatment.json +1 -1
- package/dist/knowledge/playbooks/top_down.requirements-definition/method.md +84 -9
- package/dist/knowledge/playbooks/top_down.requirements-definition/playbook.json +6 -3
- package/dist/knowledge/playbooks/top_down.vision-elicitation/method.md +19 -0
- package/dist/knowledge/playbooks/top_down.vision-elicitation/playbook.json +19 -1
- package/dist/knowledge/references/brand.name-choice.config.md +20 -3
- package/dist/knowledge/references/brand.name-screening.config.md +58 -3
- package/dist/knowledge/references/build-plan.task-graph.config.md +55 -0
- package/dist/knowledge/references/companion.market.prompt-renderer.md +11 -6
- package/dist/knowledge/references/example.authorization.application-roles.office-and-field.md +44 -0
- package/dist/knowledge/references/example.backend.custom-operation.audit-event.md +81 -0
- package/dist/knowledge/references/example.backend.custom-operation.child-line-total.md +258 -0
- package/dist/knowledge/references/example.backend.custom-operation.computed-total.md +153 -0
- package/dist/knowledge/references/example.backend.custom-operation.create-related-resource.md +107 -0
- package/dist/knowledge/references/example.data-seeding.minimal.md +10 -9
- package/dist/knowledge/references/example.data-seeding.row-reference.md +80 -0
- package/dist/knowledge/references/example.email.template.minimal.md +1 -1
- package/dist/knowledge/references/example.resource.config-wiring.retention-policy-operations.md +74 -0
- package/dist/knowledge/references/example.resource.personal-data.free-text-field.md +19 -0
- package/dist/knowledge/references/example.resource.personal-data.person-without-account.md +27 -0
- package/dist/knowledge/references/example.resource.status-lifecycle.quote.md +152 -0
- package/dist/knowledge/references/example.resource.ui-behavior.filter-presets.md +15 -0
- package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +8 -0
- package/dist/knowledge/references/example.views.app-level.home-definition.md +13 -0
- package/dist/knowledge/references/example.views.chart-definition.shared.md +83 -0
- package/dist/knowledge/references/experience-plan.config.md +60 -7
- package/dist/knowledge/references/market.context-block.builder.md +1 -1
- package/dist/knowledge/references/placement-plan.config.md +43 -0
- package/dist/knowledge/references/requirements.functional-requirement.config.md +8 -2
- package/dist/knowledge/references/requirements.non-functional-requirement.config.md +2 -0
- package/dist/knowledge/references/requirements.references.conventions.md +1 -1
- package/dist/knowledge/references/requirements.snapshot.config.md +57 -1
- package/dist/knowledge/references/requirements.snapshot.validation.md +35 -1
- package/dist/knowledge/references/saas.backend.audit-logs.log-event.md +63 -0
- package/dist/knowledge/references/saas.backend.document-sequence.issue-in-operation.md +60 -0
- package/dist/knowledge/references/saas.backend.document-sequence.raise-floor.md +156 -0
- package/dist/knowledge/references/saas.backend.email.send.md +77 -0
- package/dist/knowledge/references/saas.backend.notifications.operation-email-template-ref.md +60 -0
- package/dist/knowledge/references/saas.data-seeding.computed-entry.md +43 -0
- package/dist/knowledge/references/saas.data-seeding.definition-input.md +8 -2
- package/dist/knowledge/references/saas.data-seeding.row-reference.md +93 -0
- package/dist/knowledge/references/saas.frontend.collection-filter-presets.md +124 -0
- package/dist/knowledge/references/saas.frontend.launcher.item-refs.md +316 -0
- package/dist/knowledge/references/saas.frontend.launcher.merge-rules.md +106 -0
- package/dist/knowledge/references/saas.frontend.launcher.runtime-availability.md +60 -0
- package/dist/knowledge/references/saas.frontend.resource-label-params.md +52 -0
- package/dist/knowledge/references/saas.frontend.resource-operation-frontend-config.md +47 -18
- package/dist/knowledge/references/saas.frontend.resource-ui-behavior-config.md +4 -1
- package/dist/knowledge/references/saas.frontend.settings-hub.engine-destination-roles.md +25 -0
- package/dist/knowledge/references/saas.frontend.settings-hub.placement.md +2 -2
- package/dist/knowledge/references/saas.models.audit.trail-config.md +45 -0
- package/dist/knowledge/references/saas.models.notifications.user-notification-definition.md +5 -3
- package/dist/knowledge/references/saas.models.resource-config.builder-parameters.md +26 -0
- package/dist/knowledge/references/saas.models.roles.definition.md +61 -0
- package/dist/knowledge/references/saas.models.roles.organization-defaults.md +97 -0
- package/dist/knowledge/references/saas.public-runtime.contract.md +26 -0
- package/dist/knowledge/references/saas.website.astro.bridge.md +10 -0
- package/dist/knowledge/references/saas.website.astro.label-loader.md +3 -0
- package/dist/knowledge/references/saas.website.astro.llms-txt-server.md +14 -1
- package/dist/knowledge/references/saas.website.astro.site-context.md +13 -0
- package/dist/knowledge/references/saas.website.blog.bridge.md +4 -0
- package/dist/knowledge/references/saas.website.config.site-context-loader.md +3 -0
- package/dist/knowledge/references/saas.website.legal.public-document-links.md +76 -0
- package/dist/knowledge/references/saas.website.root-config.seo.md +2 -1
- package/dist/knowledge/references/saas.website.runtime.context.md +7 -0
- package/dist/knowledge/references/saas.website.seo.llms-txt-config.md +2 -0
- package/dist/knowledge/references/website-plan.config.md +26 -0
- package/dist/knowledge/references/zod.decorators.chainable-runtime.md +13 -0
- package/dist/knowledge/references/zod.decorators.decorator-vocabulary.md +7 -0
- package/dist/knowledge/references/zod.decorators.document-sequence.md +65 -0
- package/dist/knowledge/references/zod.decorators.schema-metadata.md +1 -0
- package/dist/knowledge/references/zod.decorators.shared-structural-methods.md +21 -0
- package/dist/knowledge/references/zod.factories.bigdecimal.md +1 -0
- package/dist/knowledge/references/zod.factories.code.md +1 -0
- package/dist/knowledge/references/zod.factories.duration.md +1 -0
- package/dist/knowledge/references/zod.factories.money.md +1 -0
- package/dist/knowledge/registries/assurance-authority-bases.json +1 -1
- package/dist/knowledge/registries/framework-topics.json +337 -1
- package/dist/knowledge/registries/playbooks.json +18 -18
- package/dist/knowledge/registries/source-tags.json +1435 -873
- package/dist/knowledge/rules/live-context-door.md +1 -1
- package/dist/knowledge/skills/INDEX.md +3 -1
- package/dist/knowledge/skills/application-consumer-documentation-authoring/SKILL.md +16 -3
- package/dist/knowledge/skills/application-database-migrations/SKILL.md +14 -3
- package/dist/knowledge/skills/application-roles-authoring/SKILL.md +158 -0
- package/dist/knowledge/skills/application-roles-authoring/references/framework-application-roles-api.md +169 -0
- package/dist/knowledge/skills/application-roles-authoring/references/office-and-field-worked-example.md +63 -0
- package/dist/knowledge/skills/authorization-unit-narrowing/SKILL.md +6 -1
- package/dist/knowledge/skills/backend-custom-operation/SKILL.md +256 -9
- package/dist/knowledge/skills/backend-custom-operation/references/after-the-operation.md +42 -0
- package/dist/knowledge/skills/backend-custom-operation/references/framework-audit-log-event-api.md +220 -0
- package/dist/knowledge/skills/brand-logo-authoring/SKILL.md +5 -0
- package/dist/knowledge/skills/brand-name-screening/SKILL.md +33 -9
- package/dist/knowledge/skills/brand-name-screening/references/framework-brand-name-screening-api.md +78 -6
- package/dist/knowledge/skills/brand-name-screening/references/screening-procedure.md +30 -8
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +2 -1
- package/dist/knowledge/skills/config-app-shell/SKILL.md +58 -5
- package/dist/knowledge/skills/config-app-shell/references/framework-launcher-items-api.md +461 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-launcher-visibility-api.md +80 -0
- package/dist/knowledge/skills/config-design-system/SKILL.md +28 -6
- package/dist/knowledge/skills/config-navigation/SKILL.md +14 -3
- package/dist/knowledge/skills/config-saas/SKILL.md +25 -11
- package/dist/knowledge/skills/config-saas/references/compliance-declarations.md +51 -1
- package/dist/knowledge/skills/config-saas/references/framework-audit-trail-config-api.md +62 -2
- package/dist/knowledge/skills/config-saas-backend/SKILL.md +6 -1
- package/dist/knowledge/skills/configure-billing/SKILL.md +18 -4
- package/dist/knowledge/skills/email-add-template/SKILL.md +27 -5
- package/dist/knowledge/skills/email-add-template/references/email-artifact-paths.md +1 -1
- package/dist/knowledge/skills/email-add-template/references/framework-email-send-api.md +128 -0
- package/dist/knowledge/skills/email-add-template/references/framework-operation-email-template-ref-api.md +99 -0
- package/dist/knowledge/skills/engine-component-registration/SKILL.md +6 -1
- package/dist/knowledge/skills/engine-product-definitions/SKILL.md +21 -8
- package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +10 -2
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/SKILL.md +18 -4
- package/dist/knowledge/skills/frontend-component-catalog/SKILL.md +11 -3
- package/dist/knowledge/skills/frontend-component-catalog/references/framework-component-catalog.md +2 -1
- package/dist/knowledge/skills/frontend-component-catalog/references/framework-component-usage.md +8 -0
- package/dist/knowledge/skills/i18n-rerun-pipeline/SKILL.md +18 -4
- package/dist/knowledge/skills/i18n-translation-rerun/SKILL.md +10 -2
- package/dist/knowledge/skills/infra-environment-config/SKILL.md +6 -1
- package/dist/knowledge/skills/local-environment-bootstrap/SKILL.md +6 -1
- package/dist/knowledge/skills/market-add-feature-benefit/SKILL.md +10 -2
- package/dist/knowledge/skills/market-alternatives/SKILL.md +10 -2
- package/dist/knowledge/skills/market-authoring-overview/SKILL.md +10 -2
- package/dist/knowledge/skills/market-category/SKILL.md +21 -7
- package/dist/knowledge/skills/market-channels/SKILL.md +6 -1
- package/dist/knowledge/skills/market-companion-prompt-enrichment/SKILL.md +11 -3
- package/dist/knowledge/skills/market-companion-prompt-enrichment/references/framework-companion-behavior-api.md +1 -1
- package/dist/knowledge/skills/market-generation-cli/SKILL.md +21 -11
- package/dist/knowledge/skills/market-generation-cli/references/framework-market-generation-cli.md +11 -6
- package/dist/knowledge/skills/market-icp/SKILL.md +10 -2
- package/dist/knowledge/skills/market-jobs-pains-gains/SKILL.md +6 -1
- package/dist/knowledge/skills/market-message-templates-authoring/SKILL.md +6 -1
- package/dist/knowledge/skills/market-persona/SKILL.md +14 -3
- package/dist/knowledge/skills/market-positioning-authoring/SKILL.md +6 -1
- package/dist/knowledge/skills/market-proof-and-objection/SKILL.md +10 -2
- package/dist/knowledge/skills/market-scoring-interpretation/SKILL.md +6 -1
- package/dist/knowledge/skills/market-snapshot-validation/SKILL.md +14 -3
- package/dist/knowledge/skills/market-tone-of-voice/SKILL.md +6 -1
- package/dist/knowledge/skills/model-cost-attribution/references/framework-work-unit-api.md +26 -0
- package/dist/knowledge/skills/module-companion-exports/SKILL.md +7 -1
- package/dist/knowledge/skills/module-relationships/SKILL.md +31 -4
- package/dist/knowledge/skills/pdf-template-authoring/SKILL.md +4 -2
- package/dist/knowledge/skills/provider-address-lookup/SKILL.md +14 -3
- package/dist/knowledge/skills/provider-frontend-file-picker/SKILL.md +6 -1
- package/dist/knowledge/skills/provider-operation-calls/SKILL.md +14 -3
- package/dist/knowledge/skills/rate-limit-authoring/SKILL.md +10 -2
- package/dist/knowledge/skills/resource-add-field/SKILL.md +10 -2
- package/dist/knowledge/skills/resource-add-field/references/framework-field-cross-layer-api.md +46 -17
- package/dist/knowledge/skills/resource-add-resource/SKILL.md +14 -2
- package/dist/knowledge/skills/resource-add-resource/references/framework-new-resource-core-config-api.md +26 -0
- package/dist/knowledge/skills/resource-config-wiring/SKILL.md +29 -3
- package/dist/knowledge/skills/resource-config-wiring/references/framework-collection-operation-declarations.md +19 -4
- package/dist/knowledge/skills/resource-config-wiring/references/framework-operation-audit-api.md +5 -2
- package/dist/knowledge/skills/resource-config-wiring/references/framework-personal-data-declaration-api.md +103 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-retention-policy-operations.md +135 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-saas-models-resource-config-api.md +26 -0
- package/dist/knowledge/skills/resource-config-wiring/references/framework-user-notifications-api.md +26 -7
- package/dist/knowledge/skills/resource-custom-view/SKILL.md +10 -2
- package/dist/knowledge/skills/resource-custom-view/references/custom-view-contracts.md +46 -17
- package/dist/knowledge/skills/resource-external-data/references/erasure-suppression.md +2 -2
- package/dist/knowledge/skills/resource-retention-binding/SKILL.md +5 -1
- package/dist/knowledge/skills/resource-schema-authoring/SKILL.md +15 -1
- package/dist/knowledge/skills/resource-schema-authoring/references/computed-totals.md +569 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/document-numbers.md +358 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-decorator-vocabulary-api.md +8 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-shared-decorator-methods-api.md +21 -0
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-special-factories-api.md +7 -2
- package/dist/knowledge/skills/resource-schema-authoring/references/framework-zod-lifecycle-and-chainable-api.md +13 -0
- package/dist/knowledge/skills/resource-status-lifecycle/SKILL.md +153 -0
- package/dist/knowledge/skills/resource-status-lifecycle/references/commercial-documents.md +46 -0
- package/dist/knowledge/skills/resource-status-lifecycle/references/quote-lifecycle-worked-example.md +198 -0
- package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +30 -4
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-collection-filter-presets-api.md +157 -0
- package/dist/knowledge/skills/resource-ui-behavior/references/framework-frontend-resource-ui-contracts-api.md +101 -19
- package/dist/knowledge/skills/seeding-authoring/SKILL.md +155 -40
- package/dist/knowledge/skills/seeding-authoring/references/cross-seed-row-references.md +67 -0
- package/dist/knowledge/skills/seeding-authoring/references/framework-data-seeding-api.md +148 -4
- package/dist/knowledge/skills/seeding-authoring/references/seed-row-overlay.md +22 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-destinations-catalog.md +43 -0
- package/dist/knowledge/skills/settings-placement-authoring/references/framework-settings-placement-api.md +2 -2
- package/dist/knowledge/skills/spec-companion-exports/SKILL.md +6 -1
- package/dist/knowledge/skills/spec-component-update/SKILL.md +10 -2
- package/dist/knowledge/skills/spec-composite-view-update/SKILL.md +2 -2
- package/dist/knowledge/skills/spec-family-update/SKILL.md +71 -66
- package/dist/knowledge/skills/spec-family-update/references/family-spec-routing.md +1 -1
- package/dist/knowledge/skills/spec-resource-update/SKILL.md +30 -10
- package/dist/knowledge/skills/spec-resource-update/references/resource-spec-field-routing.md +28 -0
- package/dist/knowledge/skills/spec-update-after-change/SKILL.md +22 -5
- package/dist/knowledge/skills/views-add-composite-view/SKILL.md +6 -1
- package/dist/knowledge/skills/views-add-custom-view/SKILL.md +10 -2
- package/dist/knowledge/skills/views-app-level/SKILL.md +13 -3
- package/dist/knowledge/skills/views-app-level/references/application-home.md +56 -0
- package/dist/knowledge/skills/views-chart-authoring/SKILL.md +221 -37
- package/dist/knowledge/skills/views-composite-authoring/SKILL.md +22 -5
- package/dist/knowledge/skills/views-execution-authoring/SKILL.md +1 -1
- package/dist/knowledge/skills/website-anonymous-session/SKILL.md +32 -2
- package/dist/knowledge/skills/website-blog-authoring/SKILL.md +16 -3
- package/dist/knowledge/skills/website-blog-authoring/references/blog-adapter-api.md +4 -0
- package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +7 -1
- package/dist/knowledge/skills/website-consent-gate-overrides/SKILL.md +13 -1
- package/dist/knowledge/skills/website-factory-advanced/SKILL.md +10 -2
- package/dist/knowledge/skills/website-inbound-contact-forms/SKILL.md +13 -1
- package/dist/knowledge/skills/website-layout-overrides/SKILL.md +6 -1
- package/dist/knowledge/skills/website-marketing-metadata-extension/SKILL.md +19 -1
- package/dist/knowledge/skills/website-navigation-authoring/SKILL.md +55 -18
- package/dist/knowledge/skills/website-navigation-authoring/references/framework-public-document-links-api.md +98 -0
- package/dist/knowledge/skills/website-navigation-authoring/references/worked-examples-header-footer.md +8 -11
- package/dist/knowledge/skills/website-page-authoring/SKILL.md +16 -5
- package/dist/knowledge/skills/website-page-authoring/references/framework-site-context-loader-api.md +3 -0
- package/dist/knowledge/skills/website-primitive-overrides/SKILL.md +6 -1
- package/dist/knowledge/skills/website-section-faq/SKILL.md +6 -1
- package/dist/knowledge/skills/website-section-feature-benefit-summary/SKILL.md +6 -1
- package/dist/knowledge/skills/website-section-feature-detail/SKILL.md +10 -2
- package/dist/knowledge/skills/website-section-hero/SKILL.md +6 -1
- package/dist/knowledge/skills/website-section-pricing/SKILL.md +6 -1
- package/dist/knowledge/skills/website-section-social-proof/SKILL.md +12 -2
- package/dist/knowledge/skills/website-seo-aeo-geo/SKILL.md +15 -3
- package/dist/knowledge/skills/website-seo-aeo-geo/references/geo-api.md +16 -1
- package/dist/knowledge/skills/website-seo-aeo-geo/references/seo-api.md +2 -1
- package/dist/knowledge/topic-index.json +1441 -269
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# example.backend.custom-operation.create-related-resource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
/**
|
|
8
|
+
* `quick-add` — capture a todo from anywhere, into the organization's inbox unless a list is named.
|
|
9
|
+
*
|
|
10
|
+
* ## What PREFIX decides
|
|
11
|
+
*
|
|
12
|
+
* The one thing the caller did not: which list the todo belongs to. A request that names a list keeps
|
|
13
|
+
* it, and the core CREATE's own write-integrity guard checks that list exists in this organization,
|
|
14
|
+
* exactly as it does for the ordinary CREATE. A request that names none is given the inbox — the list
|
|
15
|
+
* whose `slug` is {@link TODOS_QUICK_ADD_INBOX_LIST_SLUG} — which is created the first time an
|
|
16
|
+
* organization captures into it.
|
|
17
|
+
*
|
|
18
|
+
* ## The inbox is found by slug whatever its status
|
|
19
|
+
*
|
|
20
|
+
* An ARCHIVED inbox is still the inbox: `slug` is unique per organization regardless of status, so
|
|
21
|
+
* creating a second one beside it would be refused by the same unique index that guarantees there is
|
|
22
|
+
* only one. The capture therefore lands there and the organization, which archived it, restores it
|
|
23
|
+
* when it wants its backlog back. The todo itself is created, reachable and counted either way.
|
|
24
|
+
*
|
|
25
|
+
* ## Atomicity and the first-capture race
|
|
26
|
+
*
|
|
27
|
+
* `transactionalCore` makes the inbox creation and the todo one boundary: a capture that fails leaves
|
|
28
|
+
* no empty inbox behind. Two first captures in the same organization at the same instant both see no
|
|
29
|
+
* inbox and both create one; the unique `slug` index refuses the loser, and the conflict resolver
|
|
30
|
+
* spends the framework's single bounded retry — on which the loser finds the winner's inbox and
|
|
31
|
+
* files its todo there. A second conflict is not retried again: the resolver is only asked once.
|
|
32
|
+
*/
|
|
33
|
+
const todosQuickAddCustomImpl: ResourceCustomServiceImplementationFactory = (
|
|
34
|
+
resourcesRegistryService: ResourcesRegistryBackendService,
|
|
35
|
+
) => {
|
|
36
|
+
const operationPath = {
|
|
37
|
+
resourceIdentifier: TasksManager_ResourceType.TODOS,
|
|
38
|
+
operationIdentifier: Todos_Operations.QUICK_ADD,
|
|
39
|
+
variantType: ResourceOperationVariantType.API_CALL,
|
|
40
|
+
isOperationDefault: true,
|
|
41
|
+
};
|
|
42
|
+
const requestDtoSchema = resourcesRegistryService.getRequestDtoFromPath(operationPath);
|
|
43
|
+
const responseDtoSchema = resourcesRegistryService.getResponseDtoFromPath(operationPath);
|
|
44
|
+
|
|
45
|
+
return createResourceCustomServiceImplementation<typeof requestDtoSchema, typeof responseDtoSchema>({
|
|
46
|
+
operationPath,
|
|
47
|
+
requestDtoSchema,
|
|
48
|
+
responseDtoSchema,
|
|
49
|
+
transactionalCore: true,
|
|
50
|
+
// `todos` is included automatically as the operation's own resource; the inbox lookup and its
|
|
51
|
+
// first-use creation are the one additional resource these phases touch.
|
|
52
|
+
transactionParticipants: {
|
|
53
|
+
inboxList: TasksManager_ResourceType.TODO_LISTS,
|
|
54
|
+
},
|
|
55
|
+
// The only unique constraint this boundary can trip is the inbox's per-organization `slug`, and
|
|
56
|
+
// the retry is what resolves it (see the class comment). A todo has no unique field of its own.
|
|
57
|
+
transactionalCoreConflictResolver: async () => ({
|
|
58
|
+
action: ResourceCustomServiceImplementationTransactionalCoreConflictAction.RETRY_TRANSACTION,
|
|
59
|
+
}),
|
|
60
|
+
handlers: {
|
|
61
|
+
prefixCoreOperations: async (_id, input, executionContext, _operationPath, utils) => {
|
|
62
|
+
const capture = input as Todos_QuickAddRequest;
|
|
63
|
+
if (capture.todoListId) {
|
|
64
|
+
return input;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Scoped to the caller's organization by the sub-call context, so this can only ever find
|
|
68
|
+
// THIS organization's inbox. Every nested call forwards the operation's options, or it would
|
|
69
|
+
// read and write outside the transaction it belongs to.
|
|
70
|
+
const listed = await utils.servicesRegistry.list<TodoLists>(
|
|
71
|
+
TasksManager_ResourceType.TODO_LISTS,
|
|
72
|
+
await utils.executionContextCreator.createForSubCall(
|
|
73
|
+
executionContext,
|
|
74
|
+
TasksManager_ResourceType.TODO_LISTS,
|
|
75
|
+
CoreResourceOperation.LIST,
|
|
76
|
+
utils.serviceOptions,
|
|
77
|
+
),
|
|
78
|
+
{ slug: TODOS_QUICK_ADD_INBOX_LIST_SLUG },
|
|
79
|
+
undefined,
|
|
80
|
+
utils.serviceOptions,
|
|
81
|
+
);
|
|
82
|
+
const existingInbox = (Array.isArray(listed) ? listed : (listed?.data ?? []))[0];
|
|
83
|
+
|
|
84
|
+
const inbox = existingInbox ?? await utils.servicesRegistry.create<TodoLists>(
|
|
85
|
+
TasksManager_ResourceType.TODO_LISTS,
|
|
86
|
+
await utils.executionContextCreator.createForSubCall(
|
|
87
|
+
executionContext,
|
|
88
|
+
TasksManager_ResourceType.TODO_LISTS,
|
|
89
|
+
CoreResourceOperation.CREATE,
|
|
90
|
+
utils.serviceOptions,
|
|
91
|
+
),
|
|
92
|
+
{ name: TODOS_QUICK_ADD_INBOX_LIST_NAME, slug: TODOS_QUICK_ADD_INBOX_LIST_SLUG },
|
|
93
|
+
utils.serviceOptions,
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
if (!existingInbox) {
|
|
97
|
+
utils.logger.info('Created the organization inbox list for a quick-add capture', { todoListId: inbox._id });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return { ...capture, todoListId: inbox._id };
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default todosQuickAddCustomImpl;
|
|
107
|
+
```
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
DataSeedResourceLifecyclePhase,
|
|
13
13
|
DataSeedScopeKind,
|
|
14
14
|
DataSeedTriggerKind,
|
|
15
|
-
} from '
|
|
15
|
+
} from '@wildo-ai/saas-backend-lib/data-seeding-models';
|
|
16
16
|
|
|
17
17
|
// ─────────────────────────────────────────────────────────────────────
|
|
18
18
|
// Level-A example — UPGRADE on app version upgrade.
|
|
@@ -70,7 +70,11 @@ const systemEmailTemplatesSeed = createDataSeedDefinition({
|
|
|
70
70
|
// Level-B example — ADDITIVE on Organization afterCreate.
|
|
71
71
|
// "When an Organization is created, spawn its default Workspace once."
|
|
72
72
|
// Computed `entry` lets the seed read the triggering row's `_id` and
|
|
73
|
-
// the audit `triggeredByUserId` for attribution.
|
|
73
|
+
// the audit `triggeredByUserId` for attribution. The organization's id
|
|
74
|
+
// goes in the BUSINESS KEY: every organization has its own default
|
|
75
|
+
// workspace, so the organization is part of that row's identity (a key
|
|
76
|
+
// of `workspaceKey` alone would make every organization share one row).
|
|
77
|
+
// ADDITIVE is safe to
|
|
74
78
|
// re-run: the dispatcher inspects `DataSeedRun` keyed on
|
|
75
79
|
// `(seedKey, scopeKind, relatedId)` and skips on COMPLETED.
|
|
76
80
|
//
|
|
@@ -82,15 +86,12 @@ const systemEmailTemplatesSeed = createDataSeedDefinition({
|
|
|
82
86
|
// ─────────────────────────────────────────────────────────────────────
|
|
83
87
|
const organizationDefaultWorkspaceSeed = createDataSeedDefinition({
|
|
84
88
|
seedKey: 'tasks-manager:org-default-workspace',
|
|
85
|
-
scope: {
|
|
86
|
-
kind: DataSeedScopeKind.CUSTOM,
|
|
87
|
-
relatedResourceType: 'organization',
|
|
88
|
-
},
|
|
89
|
+
scope: { kind: DataSeedScopeKind.ORGANIZATION },
|
|
89
90
|
resourceType: 'workspace',
|
|
90
91
|
triggers: [
|
|
91
92
|
{
|
|
92
93
|
triggerKind: DataSeedTriggerKind.RESOURCE_LIFECYCLE,
|
|
93
|
-
resourceType: '
|
|
94
|
+
resourceType: 'organizations',
|
|
94
95
|
phase: DataSeedResourceLifecyclePhase.AFTER_CREATE,
|
|
95
96
|
},
|
|
96
97
|
],
|
|
@@ -103,9 +104,9 @@ const organizationDefaultWorkspaceSeed = createDataSeedDefinition({
|
|
|
103
104
|
// DOES project through it, and rejects an empty list) or `SYNC`. See
|
|
104
105
|
// the `DataSeedMode` JSDoc for the full mode-by-mode contract.
|
|
105
106
|
entry: ({ triggeringRow, executionContext }) => ({
|
|
106
|
-
|
|
107
|
+
// The workspace resource declares `businessKeySet(['organizationId', 'workspaceKey'])`.
|
|
108
|
+
businessKey: { organizationId: triggeringRow?._id, workspaceKey: 'default' },
|
|
107
109
|
data: {
|
|
108
|
-
organizationId: triggeringRow?._id,
|
|
109
110
|
name: 'My Workspace',
|
|
110
111
|
ownerId: executionContext.triggeredByUserId,
|
|
111
112
|
},
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# example.data-seeding.row-reference
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
import { RuntimeEnvironment } from '@wildo-ai/saas-models';
|
|
8
|
+
import {
|
|
9
|
+
createDataSeedDefinition,
|
|
10
|
+
DataSeedExistingRowTreatment,
|
|
11
|
+
DataSeedMode,
|
|
12
|
+
DataSeedResourceLifecyclePhase,
|
|
13
|
+
DataSeedScopeKind,
|
|
14
|
+
DataSeedTriggerKind,
|
|
15
|
+
referenceDataSeedRow,
|
|
16
|
+
type DataSeedTrigger,
|
|
17
|
+
} from '@wildo-ai/saas-backend-lib/data-seeding-models';
|
|
18
|
+
|
|
19
|
+
// Every new organization gets its own sample rows; production never gets any.
|
|
20
|
+
const ON_ORGANIZATION_CREATED: DataSeedTrigger[] = [{
|
|
21
|
+
triggerKind: DataSeedTriggerKind.RESOURCE_LIFECYCLE,
|
|
22
|
+
resourceType: 'organizations',
|
|
23
|
+
phase: DataSeedResourceLifecyclePhase.AFTER_CREATE,
|
|
24
|
+
}];
|
|
25
|
+
const DEMONSTRATION_ONLY = [RuntimeEnvironment.DEVELOPMENT, RuntimeEnvironment.STAGING];
|
|
26
|
+
|
|
27
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
28
|
+
// The referenced seed. Its resource's business key is
|
|
29
|
+
// `businessKeySet(['organizationId', 'email'])`; the entries name only
|
|
30
|
+
// `email`, and `anchorEntriesToScopeForeignKey` adds the organization.
|
|
31
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
32
|
+
const demoCustomersSeed = createDataSeedDefinition({
|
|
33
|
+
seedKey: 'crm:demo-customers',
|
|
34
|
+
scope: { kind: DataSeedScopeKind.ORGANIZATION },
|
|
35
|
+
resourceType: 'customers',
|
|
36
|
+
triggers: ON_ORGANIZATION_CREATED,
|
|
37
|
+
mode: DataSeedMode.ADDITIVE,
|
|
38
|
+
version: 1,
|
|
39
|
+
existingRowTreatment: DataSeedExistingRowTreatment.FILL_MISSING_DEFAULTS,
|
|
40
|
+
allowedApplicationEnvironments: DEMONSTRATION_ONLY,
|
|
41
|
+
anchorEntriesToScopeForeignKey: true,
|
|
42
|
+
entries: [
|
|
43
|
+
{ businessKey: { email: 'ana.martin@example.com' }, data: { name: 'Ana Martin' } },
|
|
44
|
+
{ businessKey: { email: 'office@becker.example.com' }, data: { name: 'Becker Hausverwaltung GmbH' } },
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
49
|
+
// The referring seed. `customerId` is a REFERENCE, not a value: the
|
|
50
|
+
// engine replaces it with the customer row's `_id` before writing. The
|
|
51
|
+
// reference omits `organizationId` — both seeds are ORGANIZATION-scoped,
|
|
52
|
+
// so the engine fills in the organization being seeded. A contact whose
|
|
53
|
+
// customer row does not exist is reported on the run and not written.
|
|
54
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
55
|
+
const demoContactsSeed = createDataSeedDefinition({
|
|
56
|
+
seedKey: 'crm:demo-contacts',
|
|
57
|
+
scope: { kind: DataSeedScopeKind.ORGANIZATION },
|
|
58
|
+
resourceType: 'contacts',
|
|
59
|
+
triggers: ON_ORGANIZATION_CREATED,
|
|
60
|
+
mode: DataSeedMode.ADDITIVE,
|
|
61
|
+
version: 1,
|
|
62
|
+
existingRowTreatment: DataSeedExistingRowTreatment.FILL_MISSING_DEFAULTS,
|
|
63
|
+
allowedApplicationEnvironments: DEMONSTRATION_ONLY,
|
|
64
|
+
anchorEntriesToScopeForeignKey: true,
|
|
65
|
+
// Required for every seed an entry references: it is what runs the customers first.
|
|
66
|
+
dependsOn: [{ seedKey: demoCustomersSeed.seedKey }],
|
|
67
|
+
entries: [
|
|
68
|
+
{
|
|
69
|
+
businessKey: { email: 'ana@martin.example.com' },
|
|
70
|
+
data: { firstName: 'Ana', customerId: referenceDataSeedRow(demoCustomersSeed, { email: 'ana.martin@example.com' }) },
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
businessKey: { email: 'jonas.becker@becker.example.com' },
|
|
74
|
+
data: { firstName: 'Jonas', customerId: referenceDataSeedRow(demoCustomersSeed, { email: 'office@becker.example.com' }) },
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export { demoContactsSeed, demoCustomersSeed };
|
|
80
|
+
```
|
|
@@ -10,7 +10,7 @@ import { EmailTemplateType } from '@wildo-ai/saas-models';
|
|
|
10
10
|
import type {
|
|
11
11
|
EmailTemplateDefinition,
|
|
12
12
|
EmailTemplateProps,
|
|
13
|
-
} from '
|
|
13
|
+
} from '@wildo-ai/saas-backend-lib';
|
|
14
14
|
|
|
15
15
|
export interface MinimalExampleLabels {
|
|
16
16
|
subject: string;
|
package/dist/knowledge/references/example.resource.config-wiring.retention-policy-operations.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# example.resource.config-wiring.retention-policy-operations
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
type OrganizationEscalationPolicies_CoreOperations =
|
|
8
|
+
| CoreResourceOperation.READ
|
|
9
|
+
| CoreResourceOperation.LIST
|
|
10
|
+
| CoreResourceOperation.CREATE
|
|
11
|
+
| CoreResourceOperation.UPDATE
|
|
12
|
+
| CoreResourceOperation.UPDATE_MANY
|
|
13
|
+
| CoreResourceOperation.DELETE;
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
/**
|
|
20
|
+
* RETAIN_ONLY, and the contrast with the sibling rota is the point.
|
|
21
|
+
*
|
|
22
|
+
* `organizationEscalationContacts` holds a contact number, so it holds personal data of its own and
|
|
23
|
+
* declares RETAIN_AND_IMPERSONALIZE. A policy holds none: its `targetUserId` is a foreign key that
|
|
24
|
+
* NAMES a person without being data about them (the never-scrub floor treats scope and actor keys
|
|
25
|
+
* exactly this way), and `webhookUrl` addresses a system rather than a human. So there is nothing
|
|
26
|
+
* here an erasure could scrub, and claiming otherwise would be a declaration the factory refuses —
|
|
27
|
+
* RETAIN_AND_IMPERSONALIZE requires at least one genuinely scrubbable field.
|
|
28
|
+
*/
|
|
29
|
+
retentionPolicy: { mode: ErasureRetentionMode.RETAIN_ONLY },
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Erasing a policy revokes no session. It is a configuration record, not a person: `targetUserId`
|
|
33
|
+
* names an escalation ACTOR, which is the exact case the enum's own documentation gives for
|
|
34
|
+
* NO_PRINCIPAL, and revoking their session because a policy was deleted would log out someone who
|
|
35
|
+
* merely appeared in it.
|
|
36
|
+
*/
|
|
37
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
|
|
38
|
+
|
|
39
|
+
coreOperations: [
|
|
40
|
+
CoreResourceOperation.READ,
|
|
41
|
+
CoreResourceOperation.LIST,
|
|
42
|
+
CoreResourceOperation.CREATE,
|
|
43
|
+
CoreResourceOperation.UPDATE,
|
|
44
|
+
/*
|
|
45
|
+
* Declared for the RETENTION POLICY, not as an authoring affordance — and required even under
|
|
46
|
+
* RETAIN_ONLY, which is worth knowing before assuming it is only the scrub's concern. Retaining a
|
|
47
|
+
* row still WRITES to it: the erasure marks `retentionStatus`, in place, through
|
|
48
|
+
* `updateManyAsSystem`. So a resource that declares how it behaves under erasure must grant the
|
|
49
|
+
* writer that carries it out, whether or not any field is scrubbed.
|
|
50
|
+
*
|
|
51
|
+
* Its variant is INTERNAL_CALL, so it registers no route and no affordance. Nobody bulk-edits
|
|
52
|
+
* escalation policies; the erasure writer does.
|
|
53
|
+
*/
|
|
54
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
55
|
+
CoreResourceOperation.DELETE,
|
|
56
|
+
],
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Usage Example
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
[CoreResourceOperation.UPDATE_MANY]: {
|
|
63
|
+
variants: [{
|
|
64
|
+
// INTERNAL_CALL, because this operation exists only for the erasure writer (see
|
|
65
|
+
// `coreOperations` above). As API_CALL it registered a `PUT` collection route that failed
|
|
66
|
+
// validation on every request and was published in the API reference; declaring no view
|
|
67
|
+
// for it does not withhold the route.
|
|
68
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
69
|
+
isDefault: true,
|
|
70
|
+
roles: [CORE_ORG_ROLES.ORG_ADMIN],
|
|
71
|
+
riskLevel: ResourceOperationRiskLevel.HIGH,
|
|
72
|
+
}]
|
|
73
|
+
},
|
|
74
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# example.resource.personal-data.free-text-field
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
/*
|
|
8
|
+
* Free prose about a person — routinely holds far more personal data than the name does.
|
|
9
|
+
*
|
|
10
|
+
* Declared `USER_CONTENT` rather than a narrower category, and the honesty of that is worth
|
|
11
|
+
* stating: the declaration says what the field is FOR, never what it will contain. A CRM note is
|
|
12
|
+
* the classic surface where a special category (a health remark, a religious observance) arrives
|
|
13
|
+
* unannounced, and no schema can certify otherwise. If this field is ever used for one
|
|
14
|
+
* FORESEEABLY, declare that member alongside — the decorator takes an array for exactly this.
|
|
15
|
+
*/
|
|
16
|
+
description: z.string().max(1000).optional()
|
|
17
|
+
.impersonalizeWith(RedactionType.REMOVE)
|
|
18
|
+
.dataCategories(PersonalDataCategory.USER_CONTENT),
|
|
19
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# example.resource.personal-data.person-without-account
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
systemAccessPolicy: {
|
|
8
|
+
// Art. 15 and Art. 20 both reach a contact: it is the personal data a customer stores about a
|
|
9
|
+
// third party, and it is the data most likely to be the SUBJECT of a request rather than
|
|
10
|
+
// incidental to one.
|
|
11
|
+
exportSubject: ResourceSystemAccessMode.ALLOWED,
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A contact IS a person, and the person has no account here. The two declarations below say so on two
|
|
16
|
+
* independent axes:
|
|
17
|
+
*
|
|
18
|
+
* - `RETAIN_AND_IMPERSONALIZE` — this row holds personal data of its own, and the fields carrying
|
|
19
|
+
* `.impersonalizeWith()` are what an erasure destroys. The row itself is kept and frozen, because
|
|
20
|
+
* a deal referencing a contact that vanished is a broken record rather than an erased one.
|
|
21
|
+
* - `NO_PRINCIPAL` — erasing it revokes no session, because a contact never had one. Nothing about
|
|
22
|
+
* the person's rights follows from that: `eraseSubjectAsSystem(CONTACT, ids)` takes a resource
|
|
23
|
+
* type and row ids and needs no login.
|
|
24
|
+
*/
|
|
25
|
+
retentionPolicy: { mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE },
|
|
26
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
|
|
27
|
+
```
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# example.resource.status-lifecycle.quote
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
*
|
|
8
|
+
* A quote moves DRAFT → SENT → ACCEPTED or DECLINED. `z_money`, `CurrencySchema`, `CurrencyAllowed` and
|
|
9
|
+
* `DocumentSequenceScope` import from `@wildo-ai/zod-decorators`; everything else below from
|
|
10
|
+
* `@wildo-ai/saas-models` (and `zod`). The schema lives in `<resource>.schemas.ts`, the rest in
|
|
11
|
+
* `<resource>.resources-config.ts`.
|
|
12
|
+
*
|
|
13
|
+
* Four things make it a lifecycle rather than a field anyone edits:
|
|
14
|
+
* 1. `status` is `.excludeFromUpdate()`, so the generic UPDATE cannot move it at all.
|
|
15
|
+
* 2. Each transition is its own operation, `resourceOperationLike: UPDATE` with an empty
|
|
16
|
+
* `requestDto`: the target state is the server's decision, never the caller's.
|
|
17
|
+
* 3. `enabledCondition` says which state the transition starts from. The engine enforces it on the
|
|
18
|
+
* backend (and the UI hides the action), so SEND on an accepted quote is refused.
|
|
19
|
+
* 4. `basicPrefixOperation` returns ONLY the new state and its timestamp (spreading the current row
|
|
20
|
+
* would write every field back, overwriting a concurrent edit), and `authoritativeFields` names
|
|
21
|
+
* them. A key the prefix introduces is kept on the ordinary HTTP path anyway; the declaration is
|
|
22
|
+
* what keeps it when a caller reaches the service with that key already in its payload (an MCP
|
|
23
|
+
* tool, another service), where the strict re-parse would otherwise strip it.
|
|
24
|
+
* And UPDATE itself is enabled only while the quote is a DRAFT: SENT is LOCKED (no edits, yet ACCEPT and
|
|
25
|
+
* DECLINE still move it on) and ACCEPTED and DECLINED are FINAL (nothing moves them again).
|
|
26
|
+
*
|
|
27
|
+
* It is also a COMMERCIAL DOCUMENT, and these fields make it one:
|
|
28
|
+
* - `number` is allocated by the server at create, consecutive per organization and year (`Q-2026-00042`); a client
|
|
29
|
+
* never sends it, and the decorator makes it unique and server-only;
|
|
30
|
+
* - `currency` is the quote's one currency; every amount on it is a fiat `z_money()` in that currency;
|
|
31
|
+
* - `lines` are an array on the quote, so they freeze with it: the UPDATE that edits them is refused once it is SENT;
|
|
32
|
+
* - `total` is the server's: excluded from create and update, computed by a prefix on CREATE and UPDATE with
|
|
33
|
+
* `authoritativeFields: ['total']` from the lines and `discountPercent` (see the computed-total recipe), never typed
|
|
34
|
+
* by a person.
|
|
35
|
+
*
|
|
36
|
+
* Concurrency: the starting-state check runs before the write and is not a compare-and-swap. Two
|
|
37
|
+
* transitions from the same state arriving at the same moment (ACCEPT and DECLINE on one SENT quote)
|
|
38
|
+
* can both pass it, and the last write wins. Sequential calls are refused correctly. Closing the
|
|
39
|
+
* concurrent case is the engine's work (a transition whose write is conditional on its starting state),
|
|
40
|
+
* not something an application can declare today.
|
|
41
|
+
*/
|
|
42
|
+
export enum Quote_Status {
|
|
43
|
+
DRAFT = 'DRAFT',
|
|
44
|
+
SENT = 'SENT',
|
|
45
|
+
ACCEPTED = 'ACCEPTED',
|
|
46
|
+
DECLINED = 'DECLINED',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const Quote_Schema = z.object({
|
|
50
|
+
_id: z.string().min(1).isPrimaryKey(),
|
|
51
|
+
organizationId: z.string().min(1).isDBIndexed().isForeignKey().excludeFromUpdate(),
|
|
52
|
+
number: z.string().documentSequence({ format: 'Q-{YYYY}-{n:5}', scope: DocumentSequenceScope.ORGANIZATION }).isSummaryField(),
|
|
53
|
+
title: z.string().trim().min(1).max(200).isSummaryField(),
|
|
54
|
+
currency: CurrencySchema,
|
|
55
|
+
lines: z.array(z.object({
|
|
56
|
+
description: z.string().trim().min(1).max(500),
|
|
57
|
+
quantity: z.number().int().min(1),
|
|
58
|
+
unitPrice: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] }),
|
|
59
|
+
})).default([]),
|
|
60
|
+
discountPercent: z.number().min(0).max(100).default(0),
|
|
61
|
+
total: z_money({ currenciesAllowed: [CurrencyAllowed.FIAT] }).optional().isSummaryField().excludeFromCreate().excludeFromUpdate(),
|
|
62
|
+
status: z.enum(Quote_Status).default(Quote_Status.DRAFT).isSummaryField().excludeFromCreate().excludeFromUpdate(),
|
|
63
|
+
sentAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),
|
|
64
|
+
decidedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/** In `<module>.relationships.ts`: the organization the quote belongs to (its primary scope). */
|
|
68
|
+
export const quote_ResourceRelationships: ResourceRelationship[] = [
|
|
69
|
+
createResourcesRelationship(
|
|
70
|
+
CoreResourceType.ORGANIZATIONS, 'quotes',
|
|
71
|
+
ResourceRelationshipCardinality.ONE, ResourceRelationshipCardinality.MANY,
|
|
72
|
+
{ nature: RelationshipNature.COMPOSITION, isPrimaryScope: true, foreignKeyField: 'organizationId' },
|
|
73
|
+
),
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
export enum Quote_Operations {
|
|
77
|
+
SEND = 'send',
|
|
78
|
+
ACCEPT = 'accept',
|
|
79
|
+
DECLINE = 'decline',
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type Quote_CoreOperations = CoreResourceOperation.READ | CoreResourceOperation.LIST | CoreResourceOperation.CREATE | CoreResourceOperation.UPDATE;
|
|
83
|
+
|
|
84
|
+
export const quote_ResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) =>
|
|
85
|
+
createResourceConfiguration_Initialization<typeof Quote_Operations, Quote_CoreOperations, typeof Quote_Schema>({
|
|
86
|
+
mainSchema: Quote_Schema,
|
|
87
|
+
resourceIdentifier: 'quotes',
|
|
88
|
+
resourceFieldIdentifier: 'quoteId',
|
|
89
|
+
resourceRelationships: resourcesRelationships,
|
|
90
|
+
isSystemResource: false,
|
|
91
|
+
coreOperations: [CoreResourceOperation.READ, CoreResourceOperation.LIST, CoreResourceOperation.CREATE, CoreResourceOperation.UPDATE],
|
|
92
|
+
customOperation: Quote_Operations,
|
|
93
|
+
operationsConfiguration: {
|
|
94
|
+
[CoreResourceOperation.READ]: { variants: [{ variantType: ResourceOperationVariantType.API_CALL, isDefault: true, roles: [CORE_ORG_ROLES.ORG_MEMBER], riskLevel: ResourceOperationRiskLevel.LOW }] },
|
|
95
|
+
[CoreResourceOperation.LIST]: { variants: [{ variantType: ResourceOperationVariantType.API_CALL, isDefault: true, roles: [CORE_ORG_ROLES.ORG_MEMBER], riskLevel: ResourceOperationRiskLevel.LOW }] },
|
|
96
|
+
[CoreResourceOperation.CREATE]: { variants: [{ variantType: ResourceOperationVariantType.API_CALL, isDefault: true, roles: [CORE_ORG_ROLES.ORG_MEMBER], riskLevel: ResourceOperationRiskLevel.MEDIUM }] },
|
|
97
|
+
[CoreResourceOperation.UPDATE]: {
|
|
98
|
+
variants: [{
|
|
99
|
+
variantType: ResourceOperationVariantType.API_CALL,
|
|
100
|
+
isDefault: true,
|
|
101
|
+
roles: [CORE_ORG_ROLES.ORG_MEMBER],
|
|
102
|
+
riskLevel: ResourceOperationRiskLevel.MEDIUM,
|
|
103
|
+
// Frozen once sent: the content a customer received does not change under them.
|
|
104
|
+
enabledCondition: ({ currentObject }) => currentObject.status === Quote_Status.DRAFT,
|
|
105
|
+
}],
|
|
106
|
+
},
|
|
107
|
+
[Quote_Operations.SEND]: {
|
|
108
|
+
variants: [{
|
|
109
|
+
variantType: ResourceOperationVariantType.API_CALL,
|
|
110
|
+
isDefault: true,
|
|
111
|
+
roles: [CORE_ORG_ROLES.ORG_MEMBER],
|
|
112
|
+
// A decision a customer relies on: HIGH puts every transition in the audit trail.
|
|
113
|
+
riskLevel: ResourceOperationRiskLevel.HIGH,
|
|
114
|
+
resourceOperationLike: CoreResourceOperation.UPDATE,
|
|
115
|
+
requestDto: z.object({}),
|
|
116
|
+
enabledCondition: ({ currentObject }) => currentObject.status === Quote_Status.DRAFT,
|
|
117
|
+
basicPrefixOperation: () => ({ status: Quote_Status.SENT, sentAt: new Date() }),
|
|
118
|
+
authoritativeFields: ['status', 'sentAt'],
|
|
119
|
+
}],
|
|
120
|
+
},
|
|
121
|
+
[Quote_Operations.ACCEPT]: {
|
|
122
|
+
variants: [{
|
|
123
|
+
variantType: ResourceOperationVariantType.API_CALL,
|
|
124
|
+
isDefault: true,
|
|
125
|
+
roles: [CORE_ORG_ROLES.ORG_MEMBER],
|
|
126
|
+
// Only a sent quote can be accepted; accepting a draft is refused.
|
|
127
|
+
riskLevel: ResourceOperationRiskLevel.HIGH,
|
|
128
|
+
resourceOperationLike: CoreResourceOperation.UPDATE,
|
|
129
|
+
requestDto: z.object({}),
|
|
130
|
+
enabledCondition: ({ currentObject }) => currentObject.status === Quote_Status.SENT,
|
|
131
|
+
basicPrefixOperation: () => ({ status: Quote_Status.ACCEPTED, decidedAt: new Date() }),
|
|
132
|
+
authoritativeFields: ['status', 'decidedAt'],
|
|
133
|
+
}],
|
|
134
|
+
},
|
|
135
|
+
[Quote_Operations.DECLINE]: {
|
|
136
|
+
variants: [{
|
|
137
|
+
variantType: ResourceOperationVariantType.API_CALL,
|
|
138
|
+
isDefault: true,
|
|
139
|
+
roles: [CORE_ORG_ROLES.ORG_MEMBER],
|
|
140
|
+
// Starts from SENT like ACCEPT, so after either has run the other is refused. Two calls arriving at the
|
|
141
|
+
// same moment are not serialized: see the concurrency note above.
|
|
142
|
+
riskLevel: ResourceOperationRiskLevel.HIGH,
|
|
143
|
+
resourceOperationLike: CoreResourceOperation.UPDATE,
|
|
144
|
+
requestDto: z.object({}),
|
|
145
|
+
enabledCondition: ({ currentObject }) => currentObject.status === Quote_Status.SENT,
|
|
146
|
+
basicPrefixOperation: () => ({ status: Quote_Status.DECLINED, decidedAt: new Date() }),
|
|
147
|
+
authoritativeFields: ['status', 'decidedAt'],
|
|
148
|
+
}],
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# example.resource.ui-behavior.filter-presets
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```tsx
|
|
7
|
+
presetFilters: [
|
|
8
|
+
{ ref: 'urgent', filters: { priority: Todos_Priority.URGENT } },
|
|
9
|
+
{ ref: 'overdue', filters: { dueDate: { relativeRange: CollectionFilterPresetRelativeRange.BEFORE_TODAY } } },
|
|
10
|
+
{ ref: 'due-this-week', filters: { dueDate: { relativeRange: CollectionFilterPresetRelativeRange.NEXT_7_DAYS } } },
|
|
11
|
+
{ ref: 'mine', filters: { assignedToUserId: { contextValue: CollectionFilterPresetContextValue.CURRENT_USER } } },
|
|
12
|
+
{ ref: 'created-today', filters: { createdAt: { relativeRange: CollectionFilterPresetRelativeRange.TODAY } } },
|
|
13
|
+
{ ref: 'touched-this-week', filters: { updatedAt: { relativeRange: CollectionFilterPresetRelativeRange.LAST_7_DAYS } } },
|
|
14
|
+
],
|
|
15
|
+
```
|
|
@@ -74,8 +74,16 @@
|
|
|
74
74
|
* tomorrow. It resolves against the viewer's own clock at the moment the pill is
|
|
75
75
|
* pressed, and goes off by itself when the day rolls over.
|
|
76
76
|
*/
|
|
77
|
+
/*
|
|
78
|
+
* `overdue` and `due-this-week` are windows on the due date (#2511), and they combine with the status tabs:
|
|
79
|
+
* "Pending" plus "Overdue" is the list a person opens first. `mine` names the VIEWER, resolved from the session
|
|
80
|
+
* when the pill is clicked, so each person's "Mine" is their own todos; it is disabled for a viewer with no user.
|
|
81
|
+
*/
|
|
77
82
|
presetFilters: [
|
|
78
83
|
{ ref: 'urgent', filters: { priority: Todos_Priority.URGENT } },
|
|
84
|
+
{ ref: 'overdue', filters: { dueDate: { relativeRange: CollectionFilterPresetRelativeRange.BEFORE_TODAY } } },
|
|
85
|
+
{ ref: 'due-this-week', filters: { dueDate: { relativeRange: CollectionFilterPresetRelativeRange.NEXT_7_DAYS } } },
|
|
86
|
+
{ ref: 'mine', filters: { assignedToUserId: { contextValue: CollectionFilterPresetContextValue.CURRENT_USER } } },
|
|
79
87
|
{ ref: 'created-today', filters: { createdAt: { relativeRange: CollectionFilterPresetRelativeRange.TODAY } } },
|
|
80
88
|
{ ref: 'touched-this-week', filters: { updatedAt: { relativeRange: CollectionFilterPresetRelativeRange.LAST_7_DAYS } } },
|
|
81
89
|
],
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# example.views.app-level.home-definition
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
export const homeDefinitionFactory: FrontendConfigFactory_HomeDefinition = () => ({
|
|
8
|
+
// Application root ("/") renders the home dashboard, an application-level composite view, IN PLACE: the URL stays
|
|
9
|
+
// "/", and the composite remains addressable at its own `/composite/<ref>` route. Named by its ref constant, never
|
|
10
|
+
// a string literal, so a renamed view fails to compile here instead of opening on "view not found".
|
|
11
|
+
compositeViewReference: HOME_DASHBOARD_VIEW_REF,
|
|
12
|
+
});
|
|
13
|
+
```
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# example.views.chart-definition.shared
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Usage Example
|
|
5
|
+
|
|
6
|
+
```typescript
|
|
7
|
+
import type { ChartDefinition, ContextFilter } from '@wildo-ai/saas-models';
|
|
8
|
+
import {
|
|
9
|
+
AggregateFunction,
|
|
10
|
+
ChartType,
|
|
11
|
+
ComparisonOperator,
|
|
12
|
+
ContextFilterSource,
|
|
13
|
+
TimeGranularity,
|
|
14
|
+
} from '@wildo-ai/saas-models';
|
|
15
|
+
|
|
16
|
+
import { TasksManager_ResourceFieldIdentifier, TasksManager_ResourceType } from '../tasks-manager.resources-types';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Scopes every task chart to its MANDATORY parent todo.
|
|
20
|
+
*
|
|
21
|
+
* The chart embed posts `contextResourceIdentifiers` (resourceType-keyed) with
|
|
22
|
+
* the data request; the backend verifies READ access on the referenced parent
|
|
23
|
+
* and resolves this filter from that trusted map
|
|
24
|
+
* (`parentResource['todos']` → `tasks.todoId`, ObjectId-coerced). Without this
|
|
25
|
+
* filter the "parent todo's tasks" charts silently aggregate EVERY task the
|
|
26
|
+
* caller can see — the query executes fine, so the drift is invisible until
|
|
27
|
+
* someone compares numbers. The backend fails closed when the parent id is
|
|
28
|
+
* missing from the request, and the frontend only surfaces these charts on
|
|
29
|
+
* hosts whose context satisfies the declared MANDATORY parent requirement.
|
|
30
|
+
*/
|
|
31
|
+
const parentTodoScopeFilter: ContextFilter = {
|
|
32
|
+
field: TasksManager_ResourceFieldIdentifier[TasksManager_ResourceType.TODOS],
|
|
33
|
+
operator: ComparisonOperator.EQ,
|
|
34
|
+
source: ContextFilterSource.PARENT_RESOURCE,
|
|
35
|
+
sourceField: TasksManager_ResourceType.TODOS,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* `todo-task-status` chart — single source of truth.
|
|
40
|
+
*
|
|
41
|
+
* A resource-owned chart needs its `ChartDefinition` in TWO places:
|
|
42
|
+
* - the FRONTEND `chartViews[].chartDefinition` on the owning resource's
|
|
43
|
+
* ui-behavior (rendering / routing), and
|
|
44
|
+
* - the BACKEND chart registry (so `POST /charts/:chartRef/data` can execute
|
|
45
|
+
* the aggregation query) — fed via the backend module's `chartDefinitions`.
|
|
46
|
+
*
|
|
47
|
+
* `chartViews` is a frontend-only authoring surface the backend cannot import,
|
|
48
|
+
* so the shared `ChartDefinition` data contract is declared HERE in shared-lib
|
|
49
|
+
* and consumed by both layers. Declaring it twice would let the rendered chart
|
|
50
|
+
* and the executed query drift apart.
|
|
51
|
+
*
|
|
52
|
+
* Donut of the current parent todo's tasks, split by execution `status`.
|
|
53
|
+
*/
|
|
54
|
+
export const todoTaskStatusChartDefinition: ChartDefinition = {
|
|
55
|
+
ref: 'todo-task-status',
|
|
56
|
+
chartType: ChartType.DONUT,
|
|
57
|
+
dataQuery: {
|
|
58
|
+
mainResourceType: TasksManager_ResourceType.TASKS,
|
|
59
|
+
contextFilters: [parentTodoScopeFilter],
|
|
60
|
+
dimensions: [
|
|
61
|
+
{
|
|
62
|
+
ref: 'status',
|
|
63
|
+
field: 'status',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
measures: [
|
|
67
|
+
{
|
|
68
|
+
ref: 'count',
|
|
69
|
+
field: '*',
|
|
70
|
+
aggregate: AggregateFunction.COUNT,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
series: [
|
|
75
|
+
{
|
|
76
|
+
ref: 'tasks-by-status',
|
|
77
|
+
name: 'Tasks by status',
|
|
78
|
+
measureRef: 'count',
|
|
79
|
+
splitByDimension: 'status',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
```
|