@salsita-ai/sdk 0.50.0-develop.b9eb39baf0 → 0.50.0-develop.bc4bdb2ffc
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/README.md +1 -1
- package/dist/admin/create-admin-pages-from-spec.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +34 -34
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.js +1 -1
- package/dist/application-spec/generate-application/code/templates/env-example.js +4 -0
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +4 -3
- package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -2
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/client/authorized-client.d.ts +3 -1
- package/dist/client/authorized-client.js +1 -1
- package/dist/client/contract.d.ts +34 -0
- package/dist/client/contract.js +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/client/local-authorized-client.d.ts +3 -1
- package/dist/client/local-authorized-client.js +1 -1
- package/dist/client/memory-authorized-client.d.ts +3 -1
- package/dist/client/memory-authorized-client.js +1 -1
- package/dist/client/phoenix-api.d.ts +212 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +56 -2
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +2 -1
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -2
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/thread-items.d.ts +13 -2
- package/dist/configurator/ui/assistant/thread-items.js +1 -1
- package/dist/docs/index.json +1 -1
- package/dist/docs/phoenix/deployments.mdx +1 -1
- package/dist/docs/phoenix/expression-context.mdx +11 -3
- package/dist/docs/phoenix/phoenix-cli.mdx +24 -21
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -6
- package/dist/domain/admin-domain/__generated/enhanced-model.d.ts +1 -2
- package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +10 -11
- package/dist/domain/admin-domain/index.d.ts +4 -5
- package/dist/domain/admin-domain/index.js +1 -1
- package/dist/domain/application/assistant/assistant-manifest.d.ts +2 -0
- package/dist/domain/application/assistant/assistant-value-type.js +1 -1
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +1 -11
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant-mutations.d.ts +1 -2
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +1 -3
- package/dist/domain/application/index.d.ts +1 -1
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/available-system-components.js +1 -1
- package/dist/domain/{actions → core/action}/action-factory.d.ts +3 -2
- package/dist/domain/core/{action.d.ts → action/action.d.ts} +15 -15
- package/dist/domain/core/action/index.d.ts +2 -0
- package/dist/domain/core/action/index.js +1 -0
- package/dist/domain/{components → core/component}/component-reader-types.d.ts +1 -1
- package/dist/domain/{components → core/component}/debug-state-component.d.ts +1 -1
- package/dist/domain/core/component/debug-state-component.js +1 -0
- package/dist/domain/{components → core/component}/domain-component-optic.d.ts +37 -36
- package/dist/domain/core/component/domain-component-optic.js +16 -0
- package/dist/domain/{components → core/component}/drag-state-component.d.ts +1 -1
- package/dist/domain/core/component/drag-state-component.js +1 -0
- package/dist/domain/{components → core/component}/export-state-component.d.ts +1 -1
- package/dist/domain/core/component/export-state-component.js +1 -0
- package/dist/domain/{components → core/component}/fullscreen-state-component.d.ts +1 -1
- package/dist/domain/core/component/fullscreen-state-component.js +1 -0
- package/dist/domain/{components → core/component}/group-components-by-entity-id-and-name.d.ts +1 -1
- package/dist/domain/core/component/group-components-by-entity-id-and-name.js +1 -0
- package/dist/domain/{components → core/component}/hover-state-component.d.ts +1 -1
- package/dist/domain/core/component/hover-state-component.js +1 -0
- package/dist/domain/core/component/index.d.ts +18 -0
- package/dist/domain/core/component/index.js +1 -0
- package/dist/domain/{components → core/component}/legacy-filter.d.ts +2 -1
- package/dist/domain/{components → core/component}/navigation-state-component.d.ts +1 -1
- package/dist/domain/core/component/navigation-state-component.js +1 -0
- package/dist/domain/{components → core/component}/selection-state-component.d.ts +1 -1
- package/dist/domain/core/component/selection-state-component.js +1 -0
- package/dist/domain/{components → core/component}/system-component-builder.d.ts +1 -1
- package/dist/domain/core/component/system-component-builder.js +1 -0
- package/dist/domain/{components → core/component}/system-component-filter.d.ts +19 -17
- package/dist/domain/core/component/system-virtual-entity.js +1 -0
- package/dist/domain/{components → core/component}/tool-state-component.d.ts +1 -1
- package/dist/domain/core/component/tool-state-component.js +1 -0
- package/dist/domain/{components → core/component}/updates.d.ts +1 -1
- package/dist/domain/{components → core/component}/view-state-component.d.ts +1 -1
- package/dist/domain/core/component/view-state-component.js +1 -0
- package/dist/domain/{components → core/component}/viewport-state-component.d.ts +1 -1
- package/dist/domain/core/component/viewport-state-component.js +1 -0
- package/dist/domain/core/domain-factory.d.ts +3 -3
- package/dist/domain/core/domain.d.ts +3 -3
- package/dist/domain/core/expression/aliased-expressions.d.ts +10 -0
- package/dist/domain/{expressions → core/expression}/constant-expressions.d.ts +2 -1
- package/dist/domain/core/expression/constant-expressions.js +1 -0
- package/dist/domain/{expressions → core/expression}/custom-expression.d.ts +9 -7
- package/dist/domain/core/expression/custom-expression.js +1 -0
- package/dist/domain/core/{expression.d.ts → expression/expression.d.ts} +17 -19
- package/dist/domain/core/expression/index.d.ts +4 -0
- package/dist/domain/core/expression/index.js +1 -0
- package/dist/domain/core/index.d.ts +7 -4
- package/dist/domain/core/index.js +1 -1
- package/dist/domain/{invariants → core/invariant}/builtin-invariant.d.ts +2 -1
- package/dist/domain/{invariants → core/invariant}/custom-invariants.d.ts +7 -7
- package/dist/domain/core/invariant/custom-invariants.js +1 -0
- package/dist/domain/core/invariant/index.d.ts +5 -0
- package/dist/domain/core/invariant/index.js +1 -0
- package/dist/domain/{invariants → core/invariant}/invariants.d.ts +6 -4
- package/dist/domain/core/invariant/invariants.js +1 -0
- package/dist/domain/core/invariant/violation-component.js +1 -0
- package/dist/domain/{invariants → core/invariant}/violation.d.ts +2 -2
- package/dist/domain/core/recipe/index.d.ts +1 -0
- package/dist/domain/core/recipe/index.js +1 -0
- package/dist/domain/{domain-context/recipe-system → core/recipe}/recipes.d.ts +1 -1
- package/dist/domain/core/recipe/recipes.js +1 -0
- package/dist/domain/{relations → core/relation}/all-of-type-relation.d.ts +3 -1
- package/dist/domain/core/relation/all-of-type-relation.js +1 -0
- package/dist/domain/{relations → core/relation}/component-factories.d.ts +1 -1
- package/dist/domain/core/relation/component-factories.js +1 -0
- package/dist/domain/{relations → core/relation}/composed-of.d.ts +1 -1
- package/dist/domain/core/relation/composed-of.js +1 -0
- package/dist/domain/{relations → core/relation}/direct-relation.d.ts +2 -1
- package/dist/domain/core/relation/index.d.ts +9 -0
- package/dist/domain/core/relation/index.js +1 -0
- package/dist/domain/{relations → core/relation}/indirect-relation.d.ts +3 -1
- package/dist/domain/core/relation/indirect-relation.js +1 -0
- package/dist/domain/{relations → core/relation}/reference-component.d.ts +4 -4
- package/dist/domain/core/relation/reference-component.js +1 -0
- package/dist/domain/{relations → core/relation}/reference-field.d.ts +1 -1
- package/dist/domain/{relations → core/relation}/relation-factory.d.ts +2 -1
- package/dist/domain/{relations → core/relation}/relation-implementation.d.ts +3 -1
- package/dist/domain/core/relation/relation-implementation.js +1 -0
- package/dist/domain/core/state/id-sequence.d.ts +15 -0
- package/dist/domain/core/state/id-sequence.js +1 -0
- package/dist/domain/core/state/index.d.ts +3 -0
- package/dist/domain/core/state/index.js +1 -0
- package/dist/domain/core/{migrations.d.ts → state/migrations.d.ts} +1 -1
- package/dist/domain/core/{state.d.ts → state/state.d.ts} +1 -1
- package/dist/domain/domain-builder.d.ts +1 -4
- package/dist/domain/domain-context/action-system/action-system.d.ts +2 -2
- package/dist/domain/domain-context/action-system/action-system.js +1 -1
- package/dist/domain/domain-context/dimension-system/dimension-state.js +1 -1
- package/dist/domain/domain-context/dimension-system/dimension-system.d.ts +1 -2
- package/dist/domain/domain-context/index.d.ts +1 -2
- package/dist/domain/domain-context/index.js +1 -1
- package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +3 -4
- package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
- package/dist/domain/domain-context/navigation-system/navigation-updates.d.ts +1 -12
- package/dist/domain/domain-context/navigation-system/navigation-updates.js +1 -1
- package/dist/domain/domain-context/recipe-system/recipe-cooker-system.d.ts +1 -3
- package/dist/domain/domain-context/recipe-system/recipe-cooker-system.js +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-deletes.js +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.d.ts +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.js +1 -1
- package/dist/domain/domain-context/relation-transformers/create-entity-refs.d.ts +1 -1
- package/dist/domain/domain-context/relation-transformers/create-entity-refs.js +2 -2
- package/dist/domain/domain-context/relation-transformers/replace-refs.d.ts +1 -1
- package/dist/domain/domain-context/relation-transformers/replace-refs.js +1 -1
- package/dist/domain/domain-context/store-system/apply-updates.d.ts +1 -2
- package/dist/domain/domain-context/store-system/next-domain-entity-id.d.ts +1 -12
- package/dist/domain/domain-context/store-system/reconcile-projected-entities.d.ts +1 -2
- package/dist/domain/domain-context/store-system/reconcile-projected-entities.js +1 -1
- package/dist/domain/domain-context/store-system/store-system.d.ts +1 -3
- package/dist/domain/domain-context/store-system/store-system.js +2 -2
- package/dist/domain/domain-context/store-system/system-state.d.ts +1 -1
- package/dist/domain/domain-context/store-system/system-state.js +1 -1
- package/dist/domain/domain-context/transformers/actions-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/auto-snap-transformer.d.ts +1 -2
- package/dist/domain/domain-context/transformers/context.d.ts +1 -4
- package/dist/domain/domain-context/transformers/entity-builder.d.ts +1 -5
- package/dist/domain/domain-context/transformers/then-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/when-builder.d.ts +1 -5
- package/dist/domain/domain-runtime/domain-context/component-reader.d.ts +1 -2
- package/dist/domain/domain-runtime/domain-context/component-reader.js +1 -1
- package/dist/domain/domain-runtime/domain-context/expression-context.d.ts +8 -0
- package/dist/domain/domain-runtime/domain-context/expression-context.js +1 -0
- package/dist/domain/domain-runtime/domain-context/index.d.ts +2 -0
- package/dist/domain/domain-runtime/domain-context/runtime-expression-context.d.ts +18 -0
- package/dist/domain/domain-runtime/domain-context/runtime-expression-context.js +1 -0
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +3 -3
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +8 -8
- package/dist/domain/domain-runtime/spec/index.d.ts +3 -0
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/{expressions → domain-runtime/spec}/memoize-expression.d.ts +1 -1
- package/dist/domain/{actions → domain-runtime/spec}/prepare-action-implementations.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/prepare-action-implementations.js +5 -0
- package/dist/domain/{expressions → domain-runtime/spec}/prepare-domain-expressions.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +1 -2
- package/dist/domain/extensions/angle-indicator.js +1 -0
- package/dist/domain/extensions/attribute-switch.js +1 -0
- package/dist/domain/{system-components → extensions}/autorotate-camera-component.d.ts +1 -1
- package/dist/domain/extensions/autorotate-camera-component.js +1 -0
- package/dist/domain/extensions/basic-sidebar-footer.js +1 -0
- package/dist/domain/extensions/camera-based-hidden-entity-object.js +1 -0
- package/dist/domain/extensions/camera-based-hidden-entity.js +1 -0
- package/dist/domain/extensions/canvas-config.js +1 -0
- package/dist/domain/extensions/canvas-custom-environment.js +1 -0
- package/dist/domain/extensions/canvas-padding.js +1 -0
- package/dist/domain/extensions/canvas-preset-environment.js +1 -0
- package/dist/domain/{system-components → extensions}/child-entity-recipe-hierarchy.d.ts +2 -2
- package/dist/domain/extensions/child-entity-recipe-hierarchy.js +1 -0
- package/dist/domain/extensions/client-side-image.js +1 -0
- package/dist/domain/extensions/color-value.js +1 -0
- package/dist/domain/{system-components → extensions}/common/angle-indicator-schema.d.ts +1 -1
- package/dist/domain/extensions/common/angle-indicator-schema.js +1 -0
- package/dist/domain/extensions/common/index.d.ts +4 -0
- package/dist/domain/extensions/common/index.js +1 -0
- package/dist/domain/{system-components → extensions}/custom-header.d.ts +1 -1
- package/dist/domain/extensions/custom-header.js +1 -0
- package/dist/domain/extensions/custom-price-footer.js +1 -0
- package/dist/domain/{system-components → extensions}/custom-sidebar-footer.d.ts +1 -1
- package/dist/domain/extensions/custom-sidebar-footer.js +1 -0
- package/dist/domain/extensions/dimension-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-angle-indicator.d.ts +2 -1
- package/dist/domain/extensions/editable-angle-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-distance-dimension-indicator.d.ts +2 -1
- package/dist/domain/extensions/editable-distance-dimension-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-offset-indicator.d.ts +2 -1
- package/dist/domain/extensions/editable-offset-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-size-indicator.d.ts +2 -1
- package/dist/domain/extensions/editable-size-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/entity-header.d.ts +1 -1
- package/dist/domain/extensions/entity-header.js +1 -0
- package/dist/domain/extensions/exit-tool-mode-fab.js +1 -0
- package/dist/domain/extensions/finalize-action.js +1 -0
- package/dist/domain/extensions/finalize-component.js +1 -0
- package/dist/domain/extensions/fit-selection-orthographic-camera-component.js +1 -0
- package/dist/domain/extensions/fit-selection-perspective-camera-component.js +1 -0
- package/dist/domain/extensions/fixed-header.js +1 -0
- package/dist/domain/extensions/floating-header.js +1 -0
- package/dist/domain/extensions/hidden-header.js +1 -0
- package/dist/domain/extensions/hidden-sidebar-footer.js +1 -0
- package/dist/domain/extensions/horizontal-tabs.js +1 -0
- package/dist/domain/extensions/index.d.ts +69 -0
- package/dist/domain/extensions/index.js +1 -0
- package/dist/domain/{system-components → extensions}/list-selector-dimension-indicator.d.ts +2 -1
- package/dist/domain/extensions/list-selector-dimension-indicator.js +1 -0
- package/dist/domain/extensions/multilingual-text-value.js +1 -0
- package/dist/domain/extensions/navigation-steps.js +1 -0
- package/dist/domain/extensions/offset-anchors.js +1 -0
- package/dist/domain/extensions/offset-indicator.js +1 -0
- package/dist/domain/extensions/offset.js +1 -0
- package/dist/domain/extensions/other-action.js +1 -0
- package/dist/domain/{system-components → extensions}/property-page.d.ts +1 -1
- package/dist/domain/extensions/property-page.js +1 -0
- package/dist/domain/extensions/read-sidebar-footer.js +1 -0
- package/dist/domain/{system-components → extensions}/replace-entity-recipe-hierarchy.d.ts +2 -2
- package/dist/domain/extensions/replace-entity-recipe-hierarchy.js +1 -0
- package/dist/domain/extensions/rotatable.js +1 -0
- package/dist/domain/extensions/rotation-handle.js +1 -0
- package/dist/domain/extensions/save-template-thumbnail.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-add-fab.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-add-fab.js +1 -0
- package/dist/domain/extensions/scene-entity-animation.js +1 -0
- package/dist/domain/extensions/scene-entity-control.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-delete-fab.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-delete-fab.js +1 -0
- package/dist/domain/extensions/scene-entity-floor-object.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-html-hotspot.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-html-hotspot.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-navigation-hotspot.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-navigation-hotspot.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-object-html-hotspot.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-object-html-hotspot.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-select-hotspot.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-select-hotspot.js +1 -0
- package/dist/domain/extensions/scene-entity-wall-object.js +1 -0
- package/dist/domain/extensions/selectable-component.js +1 -0
- package/dist/domain/extensions/sidebar-tabs.js +1 -0
- package/dist/domain/extensions/simple-summary.js +1 -0
- package/dist/domain/extensions/size.js +1 -0
- package/dist/domain/extensions/sketching-draw.js +1 -0
- package/dist/domain/{system-components → extensions}/sketching-edit.d.ts +1 -1
- package/dist/domain/extensions/sketching-edit.js +1 -0
- package/dist/domain/extensions/summary-component.js +1 -0
- package/dist/domain/extensions/text-value.js +1 -0
- package/dist/domain/extensions/tool-controls.js +1 -0
- package/dist/domain/{system-components → extensions}/tool-menu-fab.d.ts +1 -1
- package/dist/domain/extensions/tool-menu-fab.js +1 -0
- package/dist/domain/{system-components → extensions}/toolbar.d.ts +1 -1
- package/dist/domain/extensions/toolbar.js +1 -0
- package/dist/domain/extensions/universal-sidebar-footer.js +1 -0
- package/dist/domain/extensions/view-controls.js +1 -0
- package/dist/domain/index.d.ts +2 -32
- package/dist/domain/index.js +1 -1
- package/dist/domain/projections/blender-projections/blender-projections.d.ts +1 -1
- package/dist/domain/projections/blender-projections/blender-projections.js +1 -1
- package/dist/domain/projections/composition-projections.js +1 -1
- package/dist/domain/projections/validation-projections.d.ts +1 -2
- package/dist/domain/projections/validation-projections.js +1 -1
- package/dist/domain/system-components/admin-sidebar.js +1 -1
- package/dist/domain/system-components/angle-dimension.js +1 -1
- package/dist/domain/system-components/application-config.js +1 -1
- package/dist/domain/system-components/attribute-selection.js +1 -1
- package/dist/domain/system-components/bounding-box-component.d.ts +1 -1
- package/dist/domain/system-components/bounding-box-component.js +1 -1
- package/dist/domain/system-components/bounding-sphere-component.d.ts +1 -1
- package/dist/domain/system-components/bounding-sphere-component.js +1 -1
- package/dist/domain/system-components/child-entity-recipes.d.ts +1 -1
- package/dist/domain/system-components/child-entity-recipes.js +1 -1
- package/dist/domain/system-components/child-entity-selection.d.ts +1 -2
- package/dist/domain/system-components/child-entity-selection.js +1 -1
- package/dist/domain/system-components/collision-box-geometry.d.ts +1 -1
- package/dist/domain/system-components/collision-box-geometry.js +1 -1
- package/dist/domain/system-components/collision-geometry.d.ts +1 -1
- package/dist/domain/system-components/collision-geometry.js +1 -1
- package/dist/domain/system-components/collision-point-geometry.d.ts +1 -1
- package/dist/domain/system-components/collision-point-geometry.js +1 -1
- package/dist/domain/system-components/common/index.d.ts +0 -4
- package/dist/domain/system-components/common/index.js +1 -1
- package/dist/domain/system-components/common/recipes.d.ts +1 -2
- package/dist/domain/system-components/constraint.d.ts +1 -1
- package/dist/domain/system-components/constraint.js +1 -1
- package/dist/domain/system-components/custom-scene-entity.js +1 -1
- package/dist/domain/system-components/detail.js +1 -1
- package/dist/domain/system-components/distance-dimension-select.js +1 -1
- package/dist/domain/system-components/distance-dimension.js +1 -1
- package/dist/domain/system-components/drag-handle.js +1 -1
- package/dist/domain/system-components/fit-entity-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/fit-entity-perspective-camera-component.js +1 -1
- package/dist/domain/system-components/fit-root-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/fit-root-perspective-camera-component.js +1 -1
- package/dist/domain/system-components/generic-dimension.js +1 -1
- package/dist/domain/system-components/hidden-entity.js +1 -1
- package/dist/domain/system-components/hotspot-drag-handle.d.ts +1 -2
- package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
- package/dist/domain/system-components/index.d.ts +0 -68
- package/dist/domain/system-components/index.js +1 -1
- package/dist/domain/system-components/material-override-property-transition.js +1 -1
- package/dist/domain/system-components/material-override-transformer.js +1 -1
- package/dist/domain/system-components/material-swatch.js +1 -1
- package/dist/domain/system-components/navigation-page.js +1 -1
- package/dist/domain/system-components/navigation-panel-list.js +1 -1
- package/dist/domain/system-components/pivot-point.js +1 -1
- package/dist/domain/system-components/price.js +1 -1
- package/dist/domain/system-components/projected-entities.js +1 -1
- package/dist/domain/system-components/replace-entity-recipes.d.ts +1 -1
- package/dist/domain/system-components/replace-entity-recipes.js +1 -1
- package/dist/domain/system-components/scene-entity-ambient-light.js +1 -1
- package/dist/domain/system-components/scene-entity-box-object.js +1 -1
- package/dist/domain/system-components/scene-entity-directional-light.js +1 -1
- package/dist/domain/system-components/scene-entity-local-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-clip.js +1 -1
- package/dist/domain/system-components/scene-entity-object-decal.js +1 -1
- package/dist/domain/system-components/scene-entity-object-group.js +1 -1
- package/dist/domain/system-components/scene-entity-object-local-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-properties.js +1 -1
- package/dist/domain/system-components/scene-entity-object-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-text-decal.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transformer.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object.js +1 -1
- package/dist/domain/system-components/scene-entity-point-light.js +1 -1
- package/dist/domain/system-components/scene-entity-properties.js +1 -1
- package/dist/domain/system-components/scene-entity-rect-area-light.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-object.js +1 -1
- package/dist/domain/system-components/scene-entity-spot-light.js +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/sketching-line.js +1 -1
- package/dist/domain/system-components/sketching-rectangle.js +1 -1
- package/dist/domain/system-components/sketching.js +1 -1
- package/dist/domain/system-components/snap-axis.js +1 -1
- package/dist/domain/system-components/snap-edge.js +1 -1
- package/dist/domain/system-components/snap-plane.js +1 -1
- package/dist/domain/system-components/snap-point.js +1 -1
- package/dist/domain/system-components/static-orthographic-camera-component.d.ts +1 -1
- package/dist/domain/system-components/static-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/static-perspective-camera-component.d.ts +1 -1
- package/dist/domain/system-components/static-perspective-camera-component.js +1 -1
- package/dist/domain/utils/memo-eval.d.ts +2 -2
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-cli/gen/implementation.js +5 -5
- package/dist/legacy/domain-cli/gen/invariants.js +5 -3
- package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
- package/dist/legacy/domain-cli/utils/cache.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/env-example.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/env-example.js +4 -0
- package/dist/phoenix/scripts/build-admin.js +1 -1
- package/dist/ui-sdk/theme/types.d.ts +1 -1
- package/dist/webhook/builders/common.d.ts +5 -0
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +3 -3
- package/dist/domain/actions/prepare-action-implementations.js +0 -5
- package/dist/domain/components/debug-state-component.js +0 -1
- package/dist/domain/components/domain-component-optic.js +0 -16
- package/dist/domain/components/drag-state-component.js +0 -1
- package/dist/domain/components/export-state-component.js +0 -1
- package/dist/domain/components/fullscreen-state-component.js +0 -1
- package/dist/domain/components/group-components-by-entity-id-and-name.js +0 -1
- package/dist/domain/components/hover-state-component.js +0 -1
- package/dist/domain/components/index.d.ts +0 -2
- package/dist/domain/components/index.js +0 -1
- package/dist/domain/components/navigation-state-component.js +0 -1
- package/dist/domain/components/selection-state-component.js +0 -1
- package/dist/domain/components/system-component-builder.js +0 -1
- package/dist/domain/components/system-virtual-entity.js +0 -1
- package/dist/domain/components/tool-state-component.js +0 -1
- package/dist/domain/components/view-state-component.js +0 -1
- package/dist/domain/components/viewport-state-component.js +0 -1
- package/dist/domain/domain-context/recipe-system/recipes.js +0 -1
- package/dist/domain/expressions/constant-expressions.js +0 -1
- package/dist/domain/expressions/custom-expression.js +0 -1
- package/dist/domain/expressions/index.d.ts +0 -1
- package/dist/domain/expressions/index.js +0 -1
- package/dist/domain/invariants/custom-invariants.js +0 -1
- package/dist/domain/invariants/invariants.js +0 -1
- package/dist/domain/invariants/violation-component.js +0 -1
- package/dist/domain/relations/all-of-type-relation.js +0 -1
- package/dist/domain/relations/component-factories.js +0 -1
- package/dist/domain/relations/composed-of.js +0 -1
- package/dist/domain/relations/indirect-relation.js +0 -1
- package/dist/domain/relations/reference-component.js +0 -1
- package/dist/domain/system-components/angle-indicator.js +0 -1
- package/dist/domain/system-components/attribute-switch.js +0 -1
- package/dist/domain/system-components/autorotate-camera-component.js +0 -1
- package/dist/domain/system-components/basic-sidebar-footer.js +0 -1
- package/dist/domain/system-components/camera-based-hidden-entity-object.js +0 -1
- package/dist/domain/system-components/camera-based-hidden-entity.js +0 -1
- package/dist/domain/system-components/canvas-config.js +0 -1
- package/dist/domain/system-components/canvas-custom-environment.js +0 -1
- package/dist/domain/system-components/canvas-padding.js +0 -1
- package/dist/domain/system-components/canvas-preset-environment.js +0 -1
- package/dist/domain/system-components/child-entity-recipe-hierarchy.js +0 -1
- package/dist/domain/system-components/client-side-image.js +0 -1
- package/dist/domain/system-components/color-value.js +0 -1
- package/dist/domain/system-components/common/angle-indicator-schema.js +0 -1
- package/dist/domain/system-components/custom-header.js +0 -1
- package/dist/domain/system-components/custom-price-footer.js +0 -1
- package/dist/domain/system-components/custom-sidebar-footer.js +0 -1
- package/dist/domain/system-components/dimension-indicator.js +0 -1
- package/dist/domain/system-components/editable-angle-indicator.js +0 -1
- package/dist/domain/system-components/editable-distance-dimension-indicator.js +0 -1
- package/dist/domain/system-components/editable-offset-indicator.js +0 -1
- package/dist/domain/system-components/editable-size-indicator.js +0 -1
- package/dist/domain/system-components/entity-header.js +0 -1
- package/dist/domain/system-components/exit-tool-mode-fab.js +0 -1
- package/dist/domain/system-components/finalize-action.js +0 -1
- package/dist/domain/system-components/finalize-component.js +0 -1
- package/dist/domain/system-components/fit-selection-orthographic-camera-component.js +0 -1
- package/dist/domain/system-components/fit-selection-perspective-camera-component.js +0 -1
- package/dist/domain/system-components/fixed-header.js +0 -1
- package/dist/domain/system-components/floating-header.js +0 -1
- package/dist/domain/system-components/hidden-header.js +0 -1
- package/dist/domain/system-components/hidden-sidebar-footer.js +0 -1
- package/dist/domain/system-components/horizontal-tabs.js +0 -1
- package/dist/domain/system-components/list-selector-dimension-indicator.js +0 -1
- package/dist/domain/system-components/multilingual-text-value.js +0 -1
- package/dist/domain/system-components/navigation-steps.js +0 -1
- package/dist/domain/system-components/offset-anchors.js +0 -1
- package/dist/domain/system-components/offset-indicator.js +0 -1
- package/dist/domain/system-components/offset.js +0 -1
- package/dist/domain/system-components/other-action.js +0 -1
- package/dist/domain/system-components/property-page.js +0 -1
- package/dist/domain/system-components/read-sidebar-footer.js +0 -1
- package/dist/domain/system-components/replace-entity-recipe-hierarchy.js +0 -1
- package/dist/domain/system-components/rotatable.js +0 -1
- package/dist/domain/system-components/rotation-handle.js +0 -1
- package/dist/domain/system-components/save-template-thumbnail.js +0 -1
- package/dist/domain/system-components/scene-entity-add-fab.js +0 -1
- package/dist/domain/system-components/scene-entity-animation.js +0 -1
- package/dist/domain/system-components/scene-entity-control.js +0 -1
- package/dist/domain/system-components/scene-entity-delete-fab.js +0 -1
- package/dist/domain/system-components/scene-entity-floor-object.js +0 -1
- package/dist/domain/system-components/scene-entity-html-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-navigation-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-object-html-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-select-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-wall-object.js +0 -1
- package/dist/domain/system-components/selectable-component.js +0 -1
- package/dist/domain/system-components/sidebar-tabs.js +0 -1
- package/dist/domain/system-components/simple-summary.js +0 -1
- package/dist/domain/system-components/size.js +0 -1
- package/dist/domain/system-components/sketching-draw.js +0 -1
- package/dist/domain/system-components/sketching-edit.js +0 -1
- package/dist/domain/system-components/summary-component.js +0 -1
- package/dist/domain/system-components/text-value.js +0 -1
- package/dist/domain/system-components/tool-controls.js +0 -1
- package/dist/domain/system-components/tool-menu-fab.js +0 -1
- package/dist/domain/system-components/toolbar.js +0 -1
- package/dist/domain/system-components/universal-sidebar-footer.js +0 -1
- package/dist/domain/system-components/view-controls.js +0 -1
- /package/dist/domain/{actions → core/action}/action-factory.js +0 -0
- /package/dist/domain/core/{action.js → action/action.js} +0 -0
- /package/dist/domain/{components → core/component}/component-reader-types.js +0 -0
- /package/dist/domain/{components → core/component}/legacy-filter.js +0 -0
- /package/dist/domain/{components → core/component}/system-component-filter.js +0 -0
- /package/dist/domain/{components → core/component}/system-virtual-entity.d.ts +0 -0
- /package/dist/domain/{components → core/component}/updates.js +0 -0
- /package/dist/domain/core/{expression.js → expression/aliased-expressions.js} +0 -0
- /package/dist/domain/{relations/reference-field.js → core/expression/expression.js} +0 -0
- /package/dist/domain/{invariants → core/invariant}/builtin-invariant.js +0 -0
- /package/dist/domain/{invariants → core/invariant}/violation-component.d.ts +0 -0
- /package/dist/domain/{invariants → core/invariant}/violation.js +0 -0
- /package/dist/domain/{relations → core/relation}/direct-relation.js +0 -0
- /package/dist/domain/{relations/relation-implementation.js → core/relation/reference-field.js} +0 -0
- /package/dist/domain/{relations → core/relation}/relation-factory.js +0 -0
- /package/dist/domain/core/{migrations.js → state/migrations.js} +0 -0
- /package/dist/domain/core/{state.js → state/state.js} +0 -0
- /package/dist/domain/{expressions → domain-runtime/spec}/memoize-expression.js +0 -0
- /package/dist/domain/{expressions → domain-runtime/spec}/prepare-domain-expressions.js +0 -0
- /package/dist/domain/{system-components → extensions}/angle-indicator.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/attribute-switch.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/basic-sidebar-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/camera-based-hidden-entity-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/camera-based-hidden-entity.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/canvas-config.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/canvas-custom-environment.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/canvas-padding.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/canvas-preset-environment.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/client-side-image.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/color-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicator-schema.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicator-schema.js +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicators.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicators.js +0 -0
- /package/dist/domain/{system-components → extensions}/common/editable-indicator-button-variant.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/editable-indicator-button-variant.js +0 -0
- /package/dist/domain/{system-components → extensions}/custom-price-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/dimension-indicator.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/exit-tool-mode-fab.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/finalize-action.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/finalize-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/fit-selection-orthographic-camera-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/fit-selection-perspective-camera-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/fixed-header.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/floating-header.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/hidden-header.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/hidden-sidebar-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/horizontal-tabs.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/multilingual-text-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/navigation-steps.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/offset-anchors.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/offset-indicator.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/offset.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/other-action.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/read-sidebar-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/rotatable.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/rotation-handle.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/save-template-thumbnail.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-animation.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-control.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-floor-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-wall-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/selectable-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/sidebar-tabs.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/simple-summary.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/size.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/sketching-draw.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/summary-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/text-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/tool-controls.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/universal-sidebar-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/view-controls.d.ts +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { $DomainEntity,
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { $DomainEntity, DomainEntity, EntityByType, TypeOrAlias } from '../model/index.js';
|
|
2
|
+
import type { DomainState } from '../state/index.js';
|
|
3
|
+
import type { AliasedExpressions } from './aliased-expressions.js';
|
|
4
|
+
import type { AnonymousExpression, ExpressionMeta, ExpressionMetas, OpenExpressionContext } from './expression.js';
|
|
5
|
+
export type CustomExpression<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, SELF extends $DomainEntity<ENTITIES>, T, CONTEXT_EXTENSION = unknown> = (self: SELF, state: DomainState<ENTITIES>, ctx: OpenExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, CONTEXT_EXTENSION>) => T;
|
|
6
|
+
export type PotentialCustomExpressions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, CONTEXT_EXTENSION = unknown> = {
|
|
5
7
|
[TYPE_OR_ALIAS in keyof $MAP]?: {
|
|
6
|
-
[NAME in Extract<keyof $MAP[TYPE_OR_ALIAS], `$${string}`>]?: CustomExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, $MAP[TYPE_OR_ALIAS], $MAP[TYPE_OR_ALIAS][NAME]>;
|
|
8
|
+
[NAME in Extract<keyof $MAP[TYPE_OR_ALIAS], `$${string}`>]?: CustomExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, $MAP[TYPE_OR_ALIAS], $MAP[TYPE_OR_ALIAS][NAME], CONTEXT_EXTENSION>;
|
|
7
9
|
};
|
|
8
10
|
};
|
|
9
|
-
export declare const createCustomExpressionFactory: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<TypeOrAlias<ENTITIES, ALIASES>, $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES
|
|
10
|
-
export declare const createCustomExpression: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, $SELF extends $DomainEntity<ENTITIES>, T>(evaluate: CustomExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, $SELF, T>, meta: ExpressionMeta) => AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, EntityByType<ENTITIES, $SELF['type']>, T>;
|
|
11
|
+
export declare const createCustomExpressionFactory: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<TypeOrAlias<ENTITIES, ALIASES>, $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, CONTEXT_EXTENSION = unknown>(metas: ExpressionMetas<ENTITIES, ALIASES>) => (implementations: PotentialCustomExpressions<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, CONTEXT_EXTENSION>) => AliasedExpressions<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, CONTEXT_EXTENSION>;
|
|
12
|
+
export declare const createCustomExpression: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, $SELF extends $DomainEntity<ENTITIES>, T, CONTEXT_EXTENSION = unknown>(evaluate: CustomExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, $SELF, T, CONTEXT_EXTENSION>, meta: ExpressionMeta) => AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, EntityByType<ENTITIES, $SELF['type']>, T, CONTEXT_EXTENSION>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mapNestedObject as e}from"../../utils/map-nested-object.js";export const createCustomExpressionFactory=t=>o=>e()(o,([e,o,r])=>{if(!r)throw Error(`Custom expression for ${e}.${o} is of type undefined`);return[[e,o,createCustomExpression(r,t[e]?.[o]??{})]]});export const createCustomExpression=(e,t)=>({evaluate:(t,o,r)=>e(r.domain.get$Entity(t,o),o,r),meta:t});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export interface
|
|
2
|
+
import type { Domain } from '../domain.js';
|
|
3
|
+
import type { $DomainEntity, DomainEntity, TypeOrAlias } from '../model/index.js';
|
|
4
|
+
import type { DomainState, MigrateFunction } from '../state/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* The part of the expression context that core declares: the mode and role of the session, the data
|
|
7
|
+
* of the application, the entity view and the migration of the model.
|
|
8
|
+
*/
|
|
9
|
+
export interface CoreExpressionContext<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>> {
|
|
10
10
|
readonly mode: 'owner' | 'read' | 'finalize';
|
|
11
11
|
readonly role: SessionRole;
|
|
12
12
|
readonly publishedData: PUBLISHED_DATA;
|
|
@@ -14,16 +14,14 @@ export interface ExpressionContext<ENTITIES extends DomainEntity<string>, ALLOWE
|
|
|
14
14
|
readonly backendData: Record<string, unknown> | undefined;
|
|
15
15
|
readonly sessionData: SESSION_DATA;
|
|
16
16
|
readonly domain: Domain<ENTITIES, ALLOWED_ROOT_ENTITIES, Record<ENTITIES['type'], $DomainEntity<ENTITIES>>>;
|
|
17
|
-
readonly componentReader: ComponentReader<ENTITIES>;
|
|
18
17
|
readonly migrate: MigrateFunction<ENTITIES>;
|
|
19
|
-
readonly positionProjections: PositionProjections<ENTITIES>;
|
|
20
|
-
readonly sketchingProjections: SketchingProjections<ENTITIES>;
|
|
21
|
-
readonly collisionProjections: CollisionProjections<ENTITIES>;
|
|
22
|
-
readonly constraintProjections: ConstraintProjections<ENTITIES>;
|
|
23
|
-
readonly snappingProjections: SnappingProjections<ENTITIES>;
|
|
24
|
-
readonly projectedEntitiesProjections: ProjectedEntitiesProjections<ENTITIES>;
|
|
25
18
|
}
|
|
26
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The context an expression is evaluated in. Core declares its own part; `CONTEXT_EXTENSION` is
|
|
21
|
+
* what whoever evaluates the expression adds to it, such as the component reader and the
|
|
22
|
+
* projections of the domain runtime. An expression that reads only core's part leaves it out.
|
|
23
|
+
*/
|
|
24
|
+
export type OpenExpressionContext<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, CONTEXT_EXTENSION = unknown> = CoreExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA> & CONTEXT_EXTENSION;
|
|
27
25
|
export interface ExpressionMeta {
|
|
28
26
|
/**
|
|
29
27
|
* By enabling this flag, expression will be run during validation. It is primarily used to check validity of relations.
|
|
@@ -38,11 +36,11 @@ export interface ExpressionOrigin {
|
|
|
38
36
|
readonly typeOrAlias: string;
|
|
39
37
|
readonly name: string;
|
|
40
38
|
}
|
|
41
|
-
export interface AnonymousExpression<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, SELF extends ENTITIES, T> {
|
|
42
|
-
evaluate(selfId: SELF['id'], state: DomainState<ENTITIES>, ctx:
|
|
39
|
+
export interface AnonymousExpression<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, SELF extends ENTITIES, T, CONTEXT_EXTENSION = unknown> {
|
|
40
|
+
evaluate(selfId: SELF['id'], state: DomainState<ENTITIES>, ctx: OpenExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, CONTEXT_EXTENSION>): T;
|
|
43
41
|
readonly meta: ExpressionMeta;
|
|
44
42
|
}
|
|
45
|
-
export interface Expression<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, SELF extends ENTITIES, T> extends AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, SELF, T> {
|
|
43
|
+
export interface Expression<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, SELF extends ENTITIES, T, CONTEXT_EXTENSION = unknown> extends AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, SELF, T, CONTEXT_EXTENSION> {
|
|
46
44
|
readonly origin: ExpressionOrigin;
|
|
47
45
|
}
|
|
48
46
|
export type AnyExpression = Expression<any, any, any, any, any, any, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./constant-expressions.js";export*from"./custom-expression.js";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './action/index.js';
|
|
2
|
+
export * from './component/index.js';
|
|
2
3
|
export * from './decoder/index.js';
|
|
3
4
|
export * from './domain-factory.js';
|
|
4
5
|
export * from './domain.js';
|
|
5
|
-
export
|
|
6
|
-
export * from './
|
|
6
|
+
export * from './expression/index.js';
|
|
7
|
+
export * from './invariant/index.js';
|
|
7
8
|
export * from './model/index.js';
|
|
9
|
+
export * from './recipe/index.js';
|
|
10
|
+
export * from './relation/index.js';
|
|
8
11
|
export * from './schema/index.js';
|
|
9
|
-
export * from './state.js';
|
|
12
|
+
export * from './state/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./decoder/index.js";export*from"./domain-factory.js";export*from"./domain.js";export*from"./
|
|
1
|
+
export*from"./action/index.js";export*from"./component/index.js";export*from"./decoder/index.js";export*from"./domain-factory.js";export*from"./domain.js";export*from"./expression/index.js";export*from"./invariant/index.js";export*from"./model/index.js";export*from"./recipe/index.js";export*from"./relation/index.js";export*from"./schema/index.js";export*from"./state/index.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DomainEntity, DomainEntityId
|
|
1
|
+
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
2
|
+
import type { DomainState } from '../state/index.js';
|
|
2
3
|
import type { Invariant } from './invariants.js';
|
|
3
4
|
import type { Violation } from './violation.js';
|
|
4
5
|
export declare const createInvariant: <VIOLATION_TYPE extends string>(evaluate: (selfId: DomainEntityId<string>, state: DomainState<DomainEntity<string>>) => ReadonlyArray<Violation<VIOLATION_TYPE>>) => Invariant<DomainEntity<string>, DomainEntity<string>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, DomainEntity<string>, VIOLATION_TYPE>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { OmitEmpty, OmitNever } from '@salsita-ai/common/utils';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { CustomExpression } from '../expression/index.js';
|
|
3
|
+
import type { $DomainEntity, DomainEntity, ExpandAlias, TypeOrAlias } from '../model/index.js';
|
|
4
4
|
import type { Invariant } from './invariants.js';
|
|
5
5
|
import type { Violation } from './violation.js';
|
|
6
|
-
export type CustomInvariantsFromBlueprints<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, BLUEPRINTS extends Partial<Record<keyof $MAP & string, Record<string, boolean | string
|
|
6
|
+
export type CustomInvariantsFromBlueprints<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, BLUEPRINTS extends Partial<Record<keyof $MAP & string, Record<string, boolean | string>>>, CONTEXT_EXTENSION = unknown> = {
|
|
7
7
|
[TYPE_OR_ALIAS in keyof BLUEPRINTS]: {
|
|
8
|
-
[NAME in keyof BLUEPRINTS[TYPE_OR_ALIAS]]: TYPE_OR_ALIAS extends keyof $MAP ? CustomExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, $MAP[TYPE_OR_ALIAS], BLUEPRINTS[TYPE_OR_ALIAS][NAME] extends string ? ReadonlyArray<Violation<BLUEPRINTS[TYPE_OR_ALIAS][NAME]>> : BLUEPRINTS[TYPE_OR_ALIAS][NAME]> : never;
|
|
8
|
+
[NAME in keyof BLUEPRINTS[TYPE_OR_ALIAS]]: TYPE_OR_ALIAS extends keyof $MAP ? CustomExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, $MAP[TYPE_OR_ALIAS], BLUEPRINTS[TYPE_OR_ALIAS][NAME] extends string ? ReadonlyArray<Violation<BLUEPRINTS[TYPE_OR_ALIAS][NAME]>> : BLUEPRINTS[TYPE_OR_ALIAS][NAME], CONTEXT_EXTENSION> : never;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export type StaticallyDefinedViolations<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, BLUEPRINTS extends Partial<Record<TypeOrAlias<ENTITIES, ALIASES>, Record<string, boolean | string>>>> = OmitEmpty<{
|
|
@@ -13,9 +13,9 @@ export type StaticallyDefinedViolations<ENTITIES extends DomainEntity<string>, A
|
|
|
13
13
|
[NAME in keyof BLUEPRINTS[TYPE_OR_ALIAS]]: BLUEPRINTS[TYPE_OR_ALIAS][NAME] extends boolean ? Violation<string> : never;
|
|
14
14
|
}>;
|
|
15
15
|
}>;
|
|
16
|
-
export type InvariantsFromBlueprints<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, BLUEPRINTS extends Partial<Record<TypeOrAlias<ENTITIES, ALIASES>, Record<string, boolean | string>>>, STATIC_VIOLATIONS extends StaticallyDefinedViolations<ENTITIES, ALIASES, BLUEPRINTS>, PICK extends keyof BLUEPRINTS = keyof BLUEPRINTS> = {
|
|
16
|
+
export type InvariantsFromBlueprints<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, BLUEPRINTS extends Partial<Record<TypeOrAlias<ENTITIES, ALIASES>, Record<string, boolean | string>>>, STATIC_VIOLATIONS extends StaticallyDefinedViolations<ENTITIES, ALIASES, BLUEPRINTS>, PICK extends keyof BLUEPRINTS = keyof BLUEPRINTS, CONTEXT_EXTENSION = unknown> = {
|
|
17
17
|
readonly [TYPE_OR_ALIAS in keyof BLUEPRINTS & string & PICK]: ReadonlyArray<{
|
|
18
|
-
[NAME in keyof BLUEPRINTS[TYPE_OR_ALIAS]]: Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, TYPE_OR_ALIAS>, BLUEPRINTS[TYPE_OR_ALIAS][NAME] extends boolean ? TYPE_OR_ALIAS extends keyof STATIC_VIOLATIONS ? NAME extends keyof STATIC_VIOLATIONS[TYPE_OR_ALIAS] ? STATIC_VIOLATIONS[TYPE_OR_ALIAS][NAME]['type'] : never : never : BLUEPRINTS[TYPE_OR_ALIAS][NAME] extends string ? BLUEPRINTS[TYPE_OR_ALIAS][NAME] : never>;
|
|
18
|
+
[NAME in keyof BLUEPRINTS[TYPE_OR_ALIAS]]: Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, TYPE_OR_ALIAS>, BLUEPRINTS[TYPE_OR_ALIAS][NAME] extends boolean ? TYPE_OR_ALIAS extends keyof STATIC_VIOLATIONS ? NAME extends keyof STATIC_VIOLATIONS[TYPE_OR_ALIAS] ? STATIC_VIOLATIONS[TYPE_OR_ALIAS][NAME]['type'] : never : never : BLUEPRINTS[TYPE_OR_ALIAS][NAME] extends string ? BLUEPRINTS[TYPE_OR_ALIAS][NAME] : never, CONTEXT_EXTENSION>;
|
|
19
19
|
}[keyof BLUEPRINTS[TYPE_OR_ALIAS]]>;
|
|
20
20
|
};
|
|
21
|
-
export declare const createCustomInvariantFactory: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<TypeOrAlias<ENTITIES, ALIASES>, $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, BLUEPRINTS extends Partial<Record<TypeOrAlias<ENTITIES, ALIASES>, Record<string, boolean | string
|
|
21
|
+
export declare const createCustomInvariantFactory: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<TypeOrAlias<ENTITIES, ALIASES>, $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, BLUEPRINTS extends Partial<Record<TypeOrAlias<ENTITIES, ALIASES>, Record<string, boolean | string>>>, CONTEXT_EXTENSION = unknown>() => <STATIC_VIOLATIONS extends StaticallyDefinedViolations<ENTITIES, ALIASES, BLUEPRINTS>>(staticViolations: STATIC_VIOLATIONS) => <TYPES_OR_ALIASES extends keyof BLUEPRINTS & string>(implementations: Pick<CustomInvariantsFromBlueprints<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, BLUEPRINTS, CONTEXT_EXTENSION>, TYPES_OR_ALIASES>) => InvariantsFromBlueprints<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, BLUEPRINTS, STATIC_VIOLATIONS, TYPES_OR_ALIASES, CONTEXT_EXTENSION>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withProfilerLabel as t}from"../../utils/profiler-label.js";export const createCustomInvariantFactory=()=>e=>r=>{let n={};return Object.entries(r).forEach(([r,o])=>{let a=Object.entries(o).map(([n,o])=>({evaluate:t(`${r}_invariant_${n}`,(t,a,i)=>{let l=o(i.domain.get$Entity(t,a),a,i);if("boolean"==typeof l){let t=e[r]?.[n];if(!t)throw Error(`Cannot find statically defined violation for ${r}.${n}`);return l?[]:[t]}return l})}));n[r]=a}),n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./builtin-invariant.js";export*from"./custom-invariants.js";export*from"./invariants.js";export*from"./violation-component.js";export*from"./violation.js";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { OmitNever } from '@salsita-ai/common/utils';
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
2
|
+
import { type ProjectModule } from '../../project-modules/index.js';
|
|
3
|
+
import type { AnonymousExpression, OpenExpressionContext } from '../expression/index.js';
|
|
4
|
+
import { type $DomainEntity, type AliasMap, type DomainEntity, type EntityByType, type EventualAlias, type ExpandAlias, type ExtractFromAliasedRecord, type TypeOrAlias } from '../model/index.js';
|
|
5
|
+
import type { DomainState } from '../state/index.js';
|
|
4
6
|
import { type Violation } from './violation.js';
|
|
5
|
-
export interface Invariant<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ENTITY extends ENTITIES, VIOLATION_TYPE extends string> {
|
|
6
|
-
evaluate(selfId: ENTITY['id'], state: DomainState<ENTITIES>, ctx:
|
|
7
|
+
export interface Invariant<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ENTITY extends ENTITIES, VIOLATION_TYPE extends string, CONTEXT_EXTENSION = unknown> {
|
|
8
|
+
evaluate(selfId: ENTITY['id'], state: DomainState<ENTITIES>, ctx: OpenExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, CONTEXT_EXTENSION>): ReadonlyArray<Violation<VIOLATION_TYPE>>;
|
|
7
9
|
}
|
|
8
10
|
export type AliasedInvariants<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, VIOLATION_TYPES extends string> = {
|
|
9
11
|
[K in TypeOrAlias<ENTITIES, ALIASES>]?: ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, K>, VIOLATION_TYPES>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SHARED_FOLDER_HINT as t,createContractError as e,isRecord as a}from"../../project-modules/index.js";import{expandAlias as i}from"../model/index.js";let r={expected:"an object of invariant lists keyed by entity type or alias",fix:`Create it with phx.domain.implementCustomInvariants({ ... }) (phx.domain.admin.implementCustomInvariants({ ... }) under src/admin/), ${t}.`},n=t=>a(t)&&"function"==typeof t.evaluate,s=t=>a(t)&&Object.values(t).every(t=>Array.isArray(t)&&t.every(n));export const resolveInvariantModules=t=>{let a={};for(let i of t){if(!s(i.exports))throw e(i.origin,r,i.exports);for(let[t,e]of Object.entries(i.exports))a[t]=[...a[t]??[],...e]}return a};export class InvariantBuilder{aliasMap;invariants;constructor(t,e={}){this.aliasMap=t,this.invariants=e}withInvariantModules(t){return this.withInvariants(resolveInvariantModules(t))}withInvariants(t){let e={...this.invariants};return Object.entries(t).forEach(([t,a])=>{i(this.aliasMap,t).forEach(t=>{e[t]=[...e[t]??[],...a]})}),new InvariantBuilder(this.aliasMap,e)}_conflicts={};buildViolationExpressions=()=>{let t={};return Object.entries(this.invariants).forEach(([e,a])=>{t[e]={$violations:{evaluate:(t,e,i)=>a.flatMap(a=>a.evaluate(t,e,i)),meta:{}}}}),t}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SystemComponentBuilder as o}from"../component/index.js";import{ViolationSchema as t}from"./violation.js";export const violationsComponent=o.component("violations").withState({tsType:"ViolationComponentState",type:"object",properties:{violations:{type:"array",items:t}},required:["violations"],additionalProperties:!1}).build();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { I18n } from '@lingui/core';
|
|
2
2
|
import type { Localizable } from '@salsita-ai/common/utils';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { StateEmission } from '../../domain-context/store-system/store-system.js';
|
|
4
|
+
import type { $DomainEntity, DomainEntity, EntityId } from '../model/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* An **ORDERED** list of violation severities.
|
|
7
7
|
* Do not change the order of the items in this list.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './recipes.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./recipes.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OmitEmpty, OmitNever, UnionToIntersection } from '@salsita-ai/common/utils';
|
|
2
|
-
import { type AliasMap, type DomainEntity, type DomainEntityId, type DomainEntityReflection, type EntityByType, type EventualAlias, type ExpandAlias, type ExtractFromAliasedRecord, type TypeOrAlias } from '
|
|
2
|
+
import { type AliasMap, type DomainEntity, type DomainEntityId, type DomainEntityReflection, type EntityByType, type EventualAlias, type ExpandAlias, type ExtractFromAliasedRecord, type TypeOrAlias } from '../model/index.js';
|
|
3
3
|
export type EntityDefaults<ENTITY extends DomainEntity<string>> = {
|
|
4
4
|
[K in Exclude<keyof ENTITY, 'id' | 'type'>]: ENTITY[K] extends DomainEntityId<any> ? null : ENTITY[K];
|
|
5
5
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_unsafeBuildDomainEntityId as e,expandAlias as r}from"../model/index.js";export const RecipeFactoryBuilder={forAliases:t=>({forEntities:o=>({withDefaults:i=>{let a={};Object.entries(i).forEach(([e,o])=>{r(t,e).forEach(e=>{a[e]={...a[e],...o}})});let n=new Map(o.map(e=>[e.type,e._meta.validator]));return Object.entries(a).forEach(([r,t])=>{let o=n.get(r);if(!o)throw Error(`Defaults provided for unknown entity ${r}`);if(!o({id:e(r,1),type:r,...t}))throw console.error(o.errors,t),Error(`Invalid defaults for ${r} entity.`)}),{build:()=>r=>({id:e(r.type,1),...a[r.type],...r})}}})})};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ExpressionMeta } from '../expression/index.js';
|
|
2
|
+
import { type AliasMap, type DomainEntity, type DomainEntityId, type TypeOrAlias } from '../model/index.js';
|
|
3
|
+
import type { DomainState } from '../state/index.js';
|
|
2
4
|
interface AllOfType0Relation<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, TARGET extends TypeOrAlias<ENTITIES, ALIASES>> {
|
|
3
5
|
kind: 'allOfType';
|
|
4
6
|
target: TARGET;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{expandAlias as e}from"../model/index.js";export const createAllOfTypeRelation=t=>{let r=new Map,a=new WeakMap,n=!1;return o=>{if(n)throw Error(`Cannot register all-of-type relation targeting ${String(o.target)} after evaluation started. Create all relation expressions before evaluating the domain state.`);let i=new Set(e(t,o.target)),l=[...i].sort().join("|");return r.set(l,i),(e,t)=>(e=>{let t=a.get(e);if(t)return t;n=!0;let o=new Map([...r.keys()].map(e=>[e,[]]));for(let t of e.entities)for(let[e,a]of r)a.has(t.type)&&o.get(e).push(t.id);return a.set(e,o),o})(t).get(l)}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DomainEntity, DomainEntityId, DomainEntityReflection, RawAliasReflection } from '../
|
|
1
|
+
import type { DomainEntity, DomainEntityId, DomainEntityReflection, RawAliasReflection } from '../model/index.js';
|
|
2
2
|
import type { ComposedOfComponentState } from './composed-of.js';
|
|
3
3
|
import type { ReferenceComponentState } from './reference-component.js';
|
|
4
4
|
export declare const createSingleReferenceRead: <TARGET extends DomainEntity<string>>(_targetReflection: DomainEntityReflection<TARGET> | RawAliasReflection<TARGET>, field: string) => (self: object, state: unknown, ctx: unknown) => ReferenceComponentState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{memoEval as e}from"../../utils/memo-eval.js";export const createSingleReferenceRead=(t,r)=>e(e=>[e[r]],e=>({referencedEntityIds:null===e?[]:[e]}));export const createSingleReferenceWrite=(e,t)=>r=>{let n=r.referencedEntityIds[0];return n&&e.assertId(n),{[t]:n??null}};export const createMultipleReferenceRead=(t,r)=>e(e=>[e[r]],e=>({referencedEntityIds:e}));export const createMultipleReferenceWrite=(e,t)=>r=>(e.assertIds(r.referencedEntityIds),{[t]:r.referencedEntityIds});export const createSingleCompositionRead=t=>e(e=>[e[t]?.id??null],e=>({childEntityIds:null===e?[]:[e]}));export const createMultipleCompositionRead=t=>e(e=>e[t].map(e=>e.id),(...e)=>({childEntityIds:e}));export const createEmptyWrite=()=>()=>({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SystemComponentBuilder as o}from"../component/index.js";import{EntityIdSchema as t}from"../model/index.js";export const composedOfComponent=o.component("composedOf").withState({type:"object",properties:{childEntityIds:{type:"array",items:t}},required:["childEntityIds"],additionalProperties:!1}).build();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExpressionMeta } from '../expression/index.js';
|
|
2
|
+
import type { DomainEntity, ExpandAlias, TypeOrAlias } from '../model/index.js';
|
|
2
3
|
import type { ArrayReferenceField, SingleReferenceField } from './reference-field.js';
|
|
3
4
|
import type { RelationImplementation } from './relation-implementation.js';
|
|
4
5
|
interface DirectArrayRelation<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, SELF extends TypeOrAlias<ENTITIES, ALIASES>, TARGET extends TypeOrAlias<ENTITIES, ALIASES>> {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './all-of-type-relation.js';
|
|
2
|
+
export * from './component-factories.js';
|
|
3
|
+
export * from './composed-of.js';
|
|
4
|
+
export * from './direct-relation.js';
|
|
5
|
+
export * from './indirect-relation.js';
|
|
6
|
+
export * from './reference-component.js';
|
|
7
|
+
export type * from './reference-field.js';
|
|
8
|
+
export * from './relation-factory.js';
|
|
9
|
+
export type * from './relation-implementation.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./all-of-type-relation.js";export*from"./component-factories.js";export*from"./composed-of.js";export*from"./direct-relation.js";export*from"./indirect-relation.js";export*from"./reference-component.js";export*from"./relation-factory.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ExpressionMeta } from '../expression/index.js';
|
|
2
|
+
import { type AliasMap, type DomainEntity, type DomainEntityId, type ExpandAlias, type TypeOrAlias } from '../model/index.js';
|
|
3
|
+
import type { DomainState } from '../state/index.js';
|
|
2
4
|
import type { ArrayReferenceField, SingleReferenceField } from './reference-field.js';
|
|
3
5
|
interface IndirectNullableSingle0Relation<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, SELF extends TypeOrAlias<ENTITIES, ALIASES>, TARGET extends TypeOrAlias<ENTITIES, ALIASES>> {
|
|
4
6
|
kind: 'indirect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isArray as e}from"@salsita-ai/common/utils";import{expandAlias as t}from"../model/index.js";let r=e=>"string"==typeof e;export const createIndirectRelation=i=>{let n=new Map,o=new WeakMap,a=!1;return l=>{if(a)throw Error(`Cannot register indirect relation ${String(l.target)}#${l.field} after evaluation started. Create all relation expressions before evaluating the domain state.`);let s=new Set(t(i,l.target)),f=`${l.field}|${[...s].sort().join("|")}`;return n.set(f,{field:l.field,targetTypes:s}),(t,i)=>(t=>{let i=o.get(t);if(i)return i;a=!0;let l=new Map([...n.keys()].map(e=>[e,new Map]));for(let i of t.entities)for(let[t,{field:o,targetTypes:a}]of n){if(!a.has(i.type))continue;let n=i[o],s=e(n)?new Set(n.filter(r)):r(n)?[n]:[],f=l.get(t);for(let e of s){let t=f.get(e);t||(t=[],f.set(e,t)),t.push(i.id)}}return o.set(t,l),l})(i).get(f).get(t)??[]}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type $DomainEntity, type DomainEntity, type DomainEntityId, type DomainEntityReflection, type RawAliasReflection } from '../
|
|
1
|
+
import { type DomainComponentOpticBuilder } from '../component/index.js';
|
|
2
|
+
import { type $DomainEntity, type DomainEntity, type DomainEntityId, type DomainEntityReflection, type RawAliasReflection } from '../model/index.js';
|
|
3
3
|
import type { ArrayReferenceField, SingleReferenceField } from './reference-field.js';
|
|
4
4
|
export type ReferenceComponentState = {
|
|
5
5
|
/**
|
|
@@ -13,5 +13,5 @@ export type ReferenceComponentState = {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const referenceComponent: import("../index.js").SystemComponentType<"reference", ReferenceComponentState, "referencedEntityIds">;
|
|
15
15
|
export type ReferenceComponent = typeof referenceComponent;
|
|
16
|
-
export declare const attachSingleReferenceComponent: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, ENTITY extends ENTITIES, $ENTITY extends $DomainEntity<ENTITY>, TARGET_ENTITY extends ENTITIES>(attachComponent: DomainComponentOpticBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ENTITY, $ENTITY, typeof referenceComponent>, targetReflection: DomainEntityReflection<TARGET_ENTITY> | RawAliasReflection<TARGET_ENTITY>, field: SingleReferenceField<ENTITY, TARGET_ENTITY, any>) => import("../
|
|
17
|
-
export declare const attachMultipleReferenceComponent: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, ENTITY extends ENTITIES, $ENTITY extends $DomainEntity<ENTITY>, TARGET_ENTITY extends ENTITIES>(attachComponent: DomainComponentOpticBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ENTITY, $ENTITY, typeof referenceComponent>, targetReflection: DomainEntityReflection<TARGET_ENTITY> | RawAliasReflection<TARGET_ENTITY>, field: ArrayReferenceField<ENTITY, TARGET_ENTITY>) => import("../
|
|
16
|
+
export declare const attachSingleReferenceComponent: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, ENTITY extends ENTITIES, $ENTITY extends $DomainEntity<ENTITY>, TARGET_ENTITY extends ENTITIES, CONTEXT_EXTENSION = unknown>(attachComponent: DomainComponentOpticBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ENTITY, $ENTITY, typeof referenceComponent, CONTEXT_EXTENSION>, targetReflection: DomainEntityReflection<TARGET_ENTITY> | RawAliasReflection<TARGET_ENTITY>, field: SingleReferenceField<ENTITY, TARGET_ENTITY, any>) => import("../index.js").DomainComponentSimpleOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITY, import("../index.js").SystemComponentType<"reference", ReferenceComponentState, "referencedEntityIds">, CONTEXT_EXTENSION>;
|
|
17
|
+
export declare const attachMultipleReferenceComponent: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, ENTITY extends ENTITIES, $ENTITY extends $DomainEntity<ENTITY>, TARGET_ENTITY extends ENTITIES, CONTEXT_EXTENSION = unknown>(attachComponent: DomainComponentOpticBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ENTITY, $ENTITY, typeof referenceComponent, CONTEXT_EXTENSION>, targetReflection: DomainEntityReflection<TARGET_ENTITY> | RawAliasReflection<TARGET_ENTITY>, field: ArrayReferenceField<ENTITY, TARGET_ENTITY>) => import("../index.js").DomainComponentSimpleOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITY, import("../index.js").SystemComponentType<"reference", ReferenceComponentState, "referencedEntityIds">, CONTEXT_EXTENSION>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{memoEval as e}from"../../utils/memo-eval.js";import{SystemComponentBuilder as t}from"../component/index.js";import{EntityIdSchema as r}from"../model/index.js";export const referenceComponent=t.component("reference").withState({type:"object",properties:{referencedEntityIds:{type:"array",items:r}},required:["referencedEntityIds"],additionalProperties:!1}).withWritableKeys(["referencedEntityIds"]).build();export const attachSingleReferenceComponent=(t,r,n)=>t.attach(e(e=>[e[n]],e=>({referencedEntityIds:null===e?[]:[e]})),e=>{let t=e.referencedEntityIds[0];return t&&r.assertId(t),{[n]:t??null}});export const attachMultipleReferenceComponent=(t,r,n)=>t.attach(e(e=>[e[n]],e=>({referencedEntityIds:e})),e=>(r.assertIds(e.referencedEntityIds),{[n]:e.referencedEntityIds}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DomainEntity } from '../
|
|
1
|
+
import type { DomainEntity } from '../model/index.js';
|
|
2
2
|
export type SingleReferenceField<FROM extends DomainEntity<string>, TO extends DomainEntity<string>, OPTIONALITY extends null | never> = {
|
|
3
3
|
[K in keyof FROM]: TO['id'] | OPTIONALITY extends FROM[K] ? FROM[K] extends TO['id'] | OPTIONALITY ? K & string : never : never;
|
|
4
4
|
}[keyof FROM];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnonymousExpression } from '../expression/index.js';
|
|
2
|
+
import type { $DomainEntity, AliasMap, DomainEntity, ExpandAlias, TypeOrAlias } from '../model/index.js';
|
|
2
3
|
import { type AllOfTypeRelation } from './all-of-type-relation.js';
|
|
3
4
|
import type { DirectRelation } from './direct-relation.js';
|
|
4
5
|
import { type IndirectRelation } from './indirect-relation.js';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Domain } from '../domain.js';
|
|
2
|
+
import type { AliasMap, DomainEntity, DomainEntityId } from '../model/index.js';
|
|
3
|
+
import type { DomainState } from '../state/index.js';
|
|
2
4
|
import type { Relation } from './relation-factory.js';
|
|
3
5
|
export type RelationImplementation<KIND extends Relation<any, any, any, any>['kind']> = (relation: Extract<Relation<any, any, any, any>, {
|
|
4
6
|
kind: KIND;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Hands out the ids of entities that are about to be created, one sequence per entity type. An
|
|
4
|
+
* action or a transformer asks it for an id instead of computing one from the state.
|
|
5
|
+
*/
|
|
6
|
+
export type IdSequence<ENTITIES extends DomainEntity<string>> = {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the next available entity ID for the given type.
|
|
9
|
+
* This automatically increments the sequence number for the given type, so that the next call will return a new ID.
|
|
10
|
+
*
|
|
11
|
+
* @param type the entity type
|
|
12
|
+
* @returns a new domain entity ID for the given type
|
|
13
|
+
*/
|
|
14
|
+
nextId: <TYPE extends ENTITIES['type']>(type: TYPE) => DomainEntityId<TYPE>;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./migrations.js";export*from"./state.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Logger } from '@salsita-ai/common/utils';
|
|
2
|
-
import type { DomainEntity, EntityReflections } from '
|
|
2
|
+
import type { DomainEntity, EntityReflections } from '../model/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Thrown when domain state cannot be validated/migrated to the latest model
|
|
5
5
|
* version: an entity is invalid against its schema, an entity type or model
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentSnapshot, DomainEntity, SystemComponentTypeConstraint } from '
|
|
1
|
+
import type { ComponentSnapshot, DomainEntity, SystemComponentTypeConstraint } from '../model/index.js';
|
|
2
2
|
export interface DomainState<ENTITIES extends DomainEntity<string>> {
|
|
3
3
|
readonly rootEntityId: ENTITIES['id'];
|
|
4
4
|
readonly rootEntityType: ENTITIES['type'];
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { type ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
|
-
import { type $DomainEntity, type $DomainEntityReflection, type ActionDefinition, type AliasMap, type
|
|
2
|
+
import { type $DomainEntity, type $DomainEntityReflection, type ActionDefinition, type AliasMap, type AliasedExpressions, type AnyActionImplementations, type DomainEntity, DomainFactory, type EntityByType, type EntityReflections, type MigrateFunction, type SchemaOfObject } from './core/index.js';
|
|
3
3
|
import { type ProjectModule } from './project-modules/index.js';
|
|
4
|
-
export type AliasedExpressions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>> = {
|
|
5
|
-
[K in TypeOrAlias<ENTITIES, ALIASES>]?: Record<string, AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, K>, unknown>>;
|
|
6
|
-
};
|
|
7
4
|
type $EntityReflections<ENTITIES extends DomainEntity<string>> = {
|
|
8
5
|
[TYPE in ENTITIES['type']]: $DomainEntityReflection<$DomainEntity<EntityByType<ENTITIES, TYPE>>>;
|
|
9
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type $DomainEntity, type ActionContext, type ActionTypes, type DomainEntity, type DomainState, type PreparedAction } from '../../core/index.js';
|
|
2
|
-
import type { DomainContextSelectors } from '../../domain-runtime/domain-context/index.js';
|
|
2
|
+
import type { DomainContextSelectors, RuntimeExpressionContext } from '../../domain-runtime/domain-context/index.js';
|
|
3
3
|
export interface ActionSystemContext {
|
|
4
4
|
/**
|
|
5
5
|
* The action system's window into the runtime registry: the declared actions and their
|
|
@@ -26,7 +26,7 @@ export declare class ActionSystem<ENTITIES extends DomainEntity<string>, ALLOWED
|
|
|
26
26
|
* The context an implementation runs with on `state`. Code that prepares updates outside an
|
|
27
27
|
* action can run on the same context, so it can do everything an action can, the same way.
|
|
28
28
|
*/
|
|
29
|
-
readonly createContext: (state: DomainState<ENTITIES>) => ActionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES
|
|
29
|
+
readonly createContext: (state: DomainState<ENTITIES>) => ActionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, RuntimeExpressionContext<ENTITIES>>;
|
|
30
30
|
/**
|
|
31
31
|
* Prepares the action `name` with `args` on `state`. The arguments are validated against the
|
|
32
32
|
* params schema the action declares, and the implementation is called with the validated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSelector as t}from"@salsita-ai/common/utils";import{createUpdateFactory as e
|
|
1
|
+
import{createSelector as t}from"@salsita-ai/common/utils";import{createUpdateFactory as e,extendedSchemaValidator as s}from"../../core/index.js";import{getIdSequence as n}from"../store-system/next-domain-entity-id.js";export class ActionSystem{_context;_selectValidators=t([t.leaf(t=>t)],t=>new Map(Object.values(t).map(t=>[t.name,s.compile(t.params)])));_updates=e();constructor(t){this._context=t}createContext=t=>({expressionContext:this._context.selectors.getExpressionContext(),systems:this._context.selectors.getDomainSystems(),getIdSequence:()=>n(t.entities,[]),updates:this._updates});prepareAction=(t,e,n)=>{let o=this._context.selectors.getActionDefinitions(),i=Object.values(o).find(e=>e.name===t);if(!i){let e=Object.values(o).map(t=>`"${t.name}"`);throw Error(`Unknown action "${t}". ${e.length>0?`The application declares these actions: ${e.join(", ")}.`:"The application declares no actions."} Declare it under "actions" in a spec file and implement it in src/actions/.`)}let a=this._selectValidators(o).get(i.name);if(a&&!a(e))throw Error(`The arguments of action "${t}" do not fit its params: ${s.errorsText(a.errors)}. Nothing was changed. Send arguments that fit the params the action declares.`);return(Object.entries(this._context.selectors.getActionImplementations()).find(([e])=>e===t)?.[1])(e,n,this.createContext(n))}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SystemComponentBuilder as t}from"../../
|
|
1
|
+
import{SystemComponentBuilder as t}from"../../core/index.js";import{DimensionUnitSchema as e}from"../../dimensions/index.js";export const dimensionStateComponent=t.component("dimensionStateComponent").withState({type:"object",properties:{unit:e},required:["unit"],additionalProperties:!1}).withWritableKeys(["unit"]).build();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { DomainEntity, DomainState } from '../../core/index.js';
|
|
1
|
+
import type { DomainEntity, DomainState, EntityViolation } from '../../core/index.js';
|
|
2
2
|
import { DimensionUnit, type UnitsConfig } from '../../dimensions/index.js';
|
|
3
3
|
import type { DomainContextSelectors } from '../../domain-runtime/domain-context/index.js';
|
|
4
|
-
import type { EntityViolation } from '../../invariants/violation.js';
|
|
5
4
|
import { SystemState } from '../store-system/system-state.js';
|
|
6
5
|
import { type DimensionStateComponent } from './dimension-state.js';
|
|
7
6
|
export type DistanceDimensionViolation = `${string}.distanceDimension.tooLarge` | `${string}.distanceDimension.tooSmall`;
|
|
@@ -4,7 +4,7 @@ export { NavigationUpdateTag, isInitialNavigationUpdate, isNavigationUpdate, isI
|
|
|
4
4
|
export { createAutoSelectionTransformer, NavigationSystem, type NavigationSystemContext, } from './navigation-system/navigation-system.js';
|
|
5
5
|
export { createResetSelectionOnNavigationTransformer, createNavigationOnSelectionTransformer, createNavigationOnDeselectTransformer, createSelectParentOnDeselectionTransformer, createNavigationOnSelectionChangeTransformer, } from './navigation-system/selection-transformers.js';
|
|
6
6
|
export { StoreSystem, type TransformerRegistration, type StateEmission, type UpdateTransformer, type TransformerLogFunction, type Transformers, type StateSliceName, type StateUpdateEmission, type StateEmissionKind, type CommitPreparedOutcome, } from './store-system/store-system.js';
|
|
7
|
-
export { nextDomainEntityId, getIdSequence
|
|
7
|
+
export { nextDomainEntityId, getIdSequence } from './store-system/next-domain-entity-id.js';
|
|
8
8
|
export { applyUpdates } from './store-system/apply-updates.js';
|
|
9
9
|
export { SystemState, SystemStateInitialUpdateTag, SystemStateUpdateTag, type SystemStateContext, } from './store-system/system-state.js';
|
|
10
10
|
export { createRefReplaceTransformer } from './relation-transformers/replace-refs.js';
|
|
@@ -14,7 +14,6 @@ export { createCreateEntityRefsTransformer } from './relation-transformers/creat
|
|
|
14
14
|
export { type CanBeUndonePredicate, type CanBeUndoneContext, type UndoCapabilities, UndoSystem, UNDO_REDO_RESET_TAG, isUndoRedoReset, } from './undo-system.js';
|
|
15
15
|
export { DimensionSystem, type AnyDimensionSystem, type DimensionSystemContext, type AngleDimensionViolation, type DistanceDimensionViolation, type GenericDimensionViolation, } from './dimension-system/dimension-system.js';
|
|
16
16
|
export { ActionSystem, type AnyActionSystem, type ActionSystemContext } from './action-system/action-system.js';
|
|
17
|
-
export { RecipeFactoryBuilder, type EntityRecipe } from './recipe-system/recipes.js';
|
|
18
17
|
export { RecipeCookerSystem, type AnyRecipeCookerSystem, type RecipeCookerSystemContext, ReplaceRecipeUpdateTag, isReplaceEntityUpdate, type IsReplaceRecipeUpdate, CreateRecipeUpdateTag, isCreateEntityUpdate, type IsCreateRecipeUpdate, } from './recipe-system/recipe-cooker-system.js';
|
|
19
18
|
export { type DomainContextSystems, type AnyDomainContextSystems } from './domain-context-systems.js';
|
|
20
19
|
export { createTransformer, type TransformerFactory } from './create-transformer.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{NoopAnalyticsSystem}from"./analytics-system/analytics-system.js";export{AnalyticsEventFactory,AnalyticsEventType}from"./analytics-system/analytics-contracts.js";export{NavigationUpdateTag,isInitialNavigationUpdate,isNavigationUpdate,isInitialViewUpdate,isViewUpdate,isInitialSelectionUpdate,isSelectUpdate,isDeselectUpdate,isInitialFullscreenUpdate,isToggleFullscreenUpdate,isInitialDebugUpdate,isInitialViewportUpdate,isSetViewportUpdate,isInitialDragUpdate,isDragStartUpdate,isDragEndUpdate,isInitialToolUpdate,isToolUpdate,isExportUpdate}from"./navigation-system/navigation-updates.js";export{createAutoSelectionTransformer,NavigationSystem}from"./navigation-system/navigation-system.js";export{createResetSelectionOnNavigationTransformer,createNavigationOnSelectionTransformer,createNavigationOnDeselectTransformer,createSelectParentOnDeselectionTransformer,createNavigationOnSelectionChangeTransformer}from"./navigation-system/selection-transformers.js";export{StoreSystem}from"./store-system/store-system.js";export{nextDomainEntityId,getIdSequence}from"./store-system/next-domain-entity-id.js";export{applyUpdates}from"./store-system/apply-updates.js";export{SystemState,SystemStateInitialUpdateTag,SystemStateUpdateTag}from"./store-system/system-state.js";export{createRefReplaceTransformer}from"./relation-transformers/replace-refs.js";export{createCascadeDeletesTransformer}from"./relation-transformers/cascade-deletes.js";export{createCascadeRefPruningTransformer}from"./relation-transformers/cascade-ref-pruning.js";export{createCreateEntityRefsTransformer}from"./relation-transformers/create-entity-refs.js";export{UndoSystem,UNDO_REDO_RESET_TAG,isUndoRedoReset}from"./undo-system.js";export{DimensionSystem}from"./dimension-system/dimension-system.js";export{ActionSystem}from"./action-system/action-system.js";export{
|
|
1
|
+
export{NoopAnalyticsSystem}from"./analytics-system/analytics-system.js";export{AnalyticsEventFactory,AnalyticsEventType}from"./analytics-system/analytics-contracts.js";export{NavigationUpdateTag,isInitialNavigationUpdate,isNavigationUpdate,isInitialViewUpdate,isViewUpdate,isInitialSelectionUpdate,isSelectUpdate,isDeselectUpdate,isInitialFullscreenUpdate,isToggleFullscreenUpdate,isInitialDebugUpdate,isInitialViewportUpdate,isSetViewportUpdate,isInitialDragUpdate,isDragStartUpdate,isDragEndUpdate,isInitialToolUpdate,isToolUpdate,isExportUpdate}from"./navigation-system/navigation-updates.js";export{createAutoSelectionTransformer,NavigationSystem}from"./navigation-system/navigation-system.js";export{createResetSelectionOnNavigationTransformer,createNavigationOnSelectionTransformer,createNavigationOnDeselectTransformer,createSelectParentOnDeselectionTransformer,createNavigationOnSelectionChangeTransformer}from"./navigation-system/selection-transformers.js";export{StoreSystem}from"./store-system/store-system.js";export{nextDomainEntityId,getIdSequence}from"./store-system/next-domain-entity-id.js";export{applyUpdates}from"./store-system/apply-updates.js";export{SystemState,SystemStateInitialUpdateTag,SystemStateUpdateTag}from"./store-system/system-state.js";export{createRefReplaceTransformer}from"./relation-transformers/replace-refs.js";export{createCascadeDeletesTransformer}from"./relation-transformers/cascade-deletes.js";export{createCascadeRefPruningTransformer}from"./relation-transformers/cascade-ref-pruning.js";export{createCreateEntityRefsTransformer}from"./relation-transformers/create-entity-refs.js";export{UndoSystem,UNDO_REDO_RESET_TAG,isUndoRedoReset}from"./undo-system.js";export{DimensionSystem}from"./dimension-system/dimension-system.js";export{ActionSystem}from"./action-system/action-system.js";export{RecipeCookerSystem,ReplaceRecipeUpdateTag,isReplaceEntityUpdate,CreateRecipeUpdateTag,isCreateEntityUpdate}from"./recipe-system/recipe-cooker-system.js";export{createTransformer}from"./create-transformer.js";export*from"./transformers/index.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type Viewport } from '../../
|
|
2
|
-
import type { DomainEntity, DomainState } from '../../core/index.js';
|
|
1
|
+
import { type DomainEntity, type DomainState, type Viewport } from '../../core/index.js';
|
|
3
2
|
import type { DomainContextSelectors } from '../../domain-runtime/domain-context/index.js';
|
|
4
3
|
import type { DomainServicesSelectors } from '../../domain-runtime/domain-services/index.js';
|
|
5
4
|
import type { UpdateTransformer } from '../store-system/store-system.js';
|
|
@@ -36,7 +35,7 @@ export declare class NavigationSystem<ENTITIES extends DomainEntity<string>, NAV
|
|
|
36
35
|
private get _initialExportState();
|
|
37
36
|
constructor(_context: NavigationSystemContext);
|
|
38
37
|
initialize: () => void;
|
|
39
|
-
getInitialUpdates: () => (import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"debugState", import("../../index.js").DebugStateComponentState, "enabled">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"dragState", import("../../index.js").DragStateComponentState, "draggedEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"exportState", import("../../
|
|
38
|
+
getInitialUpdates: () => (import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"debugState", import("../../index.js").DebugStateComponentState, "enabled">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"dragState", import("../../index.js").DragStateComponentState, "draggedEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"exportState", import("../../index.js").ExportStateComponentState, "activeState" | "exportedEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"fullscreenState", import("../../index.js").FullscreenStateComponentState, "enabled">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"hoverState", import("../../index.js").HoverStateComponentState, "hoveredEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"navigationState", import("../../index.js").NavigationStateComponentState, "activeState" | "historyStack">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"selectionState", import("../../index.js").SelectionStateComponentState, "selectedEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"toolState", import("../../index.js").ToolStateComponentState, "activeState">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"viewState", import("../../index.js").ViewStateComponentState, "activeState">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"viewportState", import("../../index.js").ViewportStateComponentState, "active">>)[];
|
|
40
39
|
/**
|
|
41
40
|
* Get the current navigation state from the provided system state. This method should be only used in transformers or other imperative contexts, for
|
|
42
41
|
* other use cases, use the observables provided by the NavigationSystem.
|
|
@@ -101,7 +100,7 @@ export declare class NavigationSystem<ENTITIES extends DomainEntity<string>, NAV
|
|
|
101
100
|
getPopNavigationUpdate: (state: DomainState<ENTITIES>) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"navigationState", import("../../index.js").NavigationStateComponentState, "activeState" | "historyStack">> | null;
|
|
102
101
|
getViewUpdate: (activeState: VIEW_STATES) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"viewState", import("../../index.js").ViewStateComponentState, "activeState">>;
|
|
103
102
|
getToolUpdate: (activeState: TOOL_STATES) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"toolState", import("../../index.js").ToolStateComponentState, "activeState">>;
|
|
104
|
-
getExportUpdate: (activeState: EXPORT_STATES, exportedEntityId: ENTITIES['id']) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"exportState", import("../../
|
|
103
|
+
getExportUpdate: (activeState: EXPORT_STATES, exportedEntityId: ENTITIES['id']) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"exportState", import("../../index.js").ExportStateComponentState, "activeState" | "exportedEntityId">>;
|
|
105
104
|
getSelectUpdate: (selectedEntityId: ENTITIES['id']) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"selectionState", import("../../index.js").SelectionStateComponentState, "selectedEntityId">>;
|
|
106
105
|
getDeselectUpdate: () => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"selectionState", import("../../index.js").SelectionStateComponentState, "selectedEntityId">>;
|
|
107
106
|
getHoverInUpdate: (hoveredEntityId: ENTITIES['id']) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"hoverState", import("../../index.js").HoverStateComponentState, "hoveredEntityId">>;
|