@salsita-ai/sdk 0.50.0-develop.b335a15889 → 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/common/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/common/index.js +1 -1
- package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
- package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -16
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
- 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/domain.js +3 -3
- package/dist/application-spec/generate-application/code/templates/env-example.js +4 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -2
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +6 -5
- 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/complex-use-cases/filtered-controls-with-fix-dialog.mdx +84 -98
- package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
- package/dist/docs/index.json +1 -1
- package/dist/docs/layouts/custom-price.mdx +14 -16
- package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
- package/dist/docs/other-features/domain-actions.mdx +1 -1
- package/dist/docs/other-features/side-effects.mdx +42 -34
- package/dist/docs/other-features/transformers.mdx +1 -1
- package/dist/docs/phoenix/admin.mdx +9 -24
- package/dist/docs/phoenix/deployments.mdx +1 -1
- package/dist/docs/phoenix/expression-context.mdx +11 -3
- package/dist/docs/phoenix/localization.mdx +3 -22
- package/dist/docs/phoenix/phoenix-cli.mdx +24 -21
- package/dist/docs/phoenix/project-structure.mdx +6 -0
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -6
- package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
- package/dist/docs/relations/hierarchy.mdx +13 -2
- package/dist/domain/admin-domain/__generated/enhanced-model.d.ts +1 -2
- package/dist/domain/admin-domain/__generated/model/versions/v1.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v2.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v3.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v4.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v5.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v6.d.ts +2 -2
- package/dist/domain/admin-domain/__generated/model/versions/v6.js +1 -1
- package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +10 -13
- package/dist/domain/admin-domain/implementation/common-admin-migrations.d.ts +1 -1
- package/dist/domain/admin-domain/index.d.ts +4 -5
- package/dist/domain/admin-domain/index.js +1 -1
- package/dist/domain/application/admin-page-factories.d.ts +1 -1
- package/dist/domain/application/application-config.d.ts +23 -13
- 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-field-options.d.ts +1 -2
- package/dist/domain/application/assistant-mutations.d.ts +1 -4
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +1 -5
- package/dist/domain/application/configurator-builder.d.ts +30 -16
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/element-registration.d.ts +5 -0
- package/dist/domain/application/element-registration.js +1 -1
- package/dist/domain/application/handler-registration.d.ts +5 -0
- package/dist/domain/application/handler-registration.js +1 -1
- package/dist/domain/application/index.d.ts +5 -5
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/published-data/create-finalize-admin-domain.d.ts +1 -2
- package/dist/domain/application/published-data/map-published-chunked-data.d.ts +1 -1
- package/dist/domain/application/published-data/map-published-data.d.ts +1 -2
- package/dist/domain/application/resolve-imported-transformers.d.ts +12 -2
- package/dist/domain/application/resolve-imported-transformers.js +1 -1
- package/dist/domain/available-system-components.js +1 -1
- package/dist/domain/{actions → core/action}/action-factory.d.ts +6 -5
- package/dist/domain/core/{action.d.ts → action/action.d.ts} +16 -16
- 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 -2
- 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 +39 -39
- 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 -2
- 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 -2
- 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 -2
- package/dist/domain/core/component/system-component-builder.js +1 -0
- package/dist/domain/{components → core/component}/system-component-filter.d.ts +19 -19
- 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 -2
- 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/decoder/create-decoder.d.ts +6 -0
- package/dist/domain/core/decoder/create-decoder.js +1 -0
- package/dist/domain/core/decoder/decoder.d.ts +6 -0
- package/dist/domain/core/decoder/index.d.ts +2 -0
- package/dist/domain/core/decoder/index.js +1 -0
- package/dist/domain/core/domain-factory.d.ts +4 -5
- package/dist/domain/core/domain-factory.js +1 -1
- package/dist/domain/core/domain.d.ts +4 -5
- package/dist/domain/core/domain.js +1 -1
- package/dist/domain/core/expression/aliased-expressions.d.ts +10 -0
- package/dist/domain/{expressions → core/expression}/constant-expressions.d.ts +2 -3
- package/dist/domain/core/expression/constant-expressions.js +1 -0
- package/dist/domain/{expressions → core/expression}/custom-expression.d.ts +9 -10
- package/dist/domain/core/expression/custom-expression.js +1 -0
- package/dist/domain/core/{expression.d.ts → expression/expression.d.ts} +17 -20
- 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 +11 -17
- package/dist/domain/core/index.js +1 -1
- package/dist/domain/{invariants → core/invariant}/builtin-invariant.d.ts +2 -2
- package/dist/domain/{invariants → core/invariant}/custom-invariants.d.ts +7 -8
- 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 +14 -6
- 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/{component.d.ts → model/component.d.ts} +1 -1
- package/dist/domain/core/model/index.d.ts +6 -0
- package/dist/domain/core/model/index.js +1 -0
- package/dist/domain/core/{reflection.d.ts → model/reflection.d.ts} +1 -1
- package/dist/domain/core/model/reflection.js +1 -0
- 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 -3
- package/dist/domain/core/recipe/recipes.js +1 -0
- package/dist/domain/{relations → core/relation}/all-of-type-relation.d.ts +3 -4
- package/dist/domain/core/relation/all-of-type-relation.js +1 -0
- package/dist/domain/{relations → core/relation}/component-factories.d.ts +1 -2
- 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 -3
- 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 -4
- package/dist/domain/core/relation/indirect-relation.js +1 -0
- package/dist/domain/{relations → core/relation}/reference-component.d.ts +4 -5
- 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 -3
- package/dist/domain/{relations → core/relation}/relation-implementation.d.ts +3 -4
- package/dist/domain/core/schema/enhanced-json-schema.js +1 -0
- package/dist/domain/core/schema/extended-schema-validator.js +1 -0
- package/dist/domain/core/schema/index.d.ts +3 -0
- package/dist/domain/core/schema/index.js +1 -0
- package/dist/domain/core/schema/schema-validator.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 -2
- package/dist/domain/core/{state.d.ts → state/state.d.ts} +1 -2
- package/dist/domain/domain-builder.d.ts +11 -11
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +3 -5
- package/dist/domain/domain-context/action-system/action-system.js +1 -1
- package/dist/domain/domain-context/create-transformer.d.ts +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/domain-context-systems.d.ts +1 -3
- 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 -5
- 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/navigation-system/selection-transformers.d.ts +1 -1
- package/dist/domain/domain-context/navigation-system/selection-transformers.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.d.ts +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 -3
- package/dist/domain/domain-context/store-system/apply-updates.js +1 -1
- package/dist/domain/domain-context/store-system/next-domain-entity-id.d.ts +1 -13
- package/dist/domain/domain-context/store-system/next-domain-entity-id.js +1 -1
- 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 -5
- package/dist/domain/domain-context/store-system/store-system.js +2 -2
- package/dist/domain/domain-context/store-system/system-state.d.ts +1 -3
- 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/actions-builder.js +1 -1
- package/dist/domain/domain-context/transformers/auto-snap-transformer.d.ts +1 -3
- package/dist/domain/domain-context/transformers/chain-builder.d.ts +2 -2
- package/dist/domain/domain-context/transformers/context.d.ts +1 -5
- package/dist/domain/domain-context/transformers/entity-builder.d.ts +1 -5
- package/dist/domain/domain-context/transformers/entity-builder.js +1 -1
- package/dist/domain/domain-context/transformers/then-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/then-builder.js +1 -1
- package/dist/domain/domain-context/transformers/when-builder.d.ts +1 -6
- package/dist/domain/domain-context/transformers/when-builder.js +1 -1
- package/dist/domain/domain-context/undo-system.d.ts +1 -1
- package/dist/domain/domain-runtime/domain-context/component-reader.d.ts +1 -4
- 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 -4
- 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 -2
- 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/{system-components → extensions}/angle-indicator.d.ts +1 -1
- 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/{system-components → extensions}/basic-sidebar-footer.d.ts +1 -1
- 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/{system-components → extensions}/canvas-config.d.ts +1 -1
- package/dist/domain/extensions/canvas-config.js +1 -0
- package/dist/domain/extensions/canvas-custom-environment.js +1 -0
- package/dist/domain/{system-components → extensions}/canvas-padding.d.ts +1 -1
- package/dist/domain/extensions/canvas-padding.js +1 -0
- package/dist/domain/{system-components → extensions}/canvas-preset-environment.d.ts +1 -1
- 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/{system-components → extensions}/common/dimension-indicator-schema.d.ts +1 -1
- package/dist/domain/extensions/common/dimension-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 +2 -2
- package/dist/domain/{system-components → extensions}/custom-header.js +1 -1
- package/dist/domain/extensions/custom-price-footer.js +1 -0
- package/dist/domain/{system-components → extensions}/custom-sidebar-footer.d.ts +2 -2
- package/dist/domain/{system-components → extensions}/custom-sidebar-footer.js +1 -1
- package/dist/domain/{system-components → extensions}/dimension-indicator.d.ts +1 -1
- package/dist/domain/extensions/dimension-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-angle-indicator.d.ts +3 -2
- package/dist/domain/extensions/editable-angle-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-distance-dimension-indicator.d.ts +3 -2
- package/dist/domain/extensions/editable-distance-dimension-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-offset-indicator.d.ts +3 -2
- package/dist/domain/extensions/editable-offset-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-size-indicator.d.ts +3 -2
- 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/{system-components → extensions}/exit-tool-mode-fab.d.ts +1 -1
- package/dist/domain/extensions/exit-tool-mode-fab.js +1 -0
- package/dist/domain/{system-components → extensions}/finalize-action.d.ts +1 -1
- 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/{system-components → extensions}/fixed-header.d.ts +1 -1
- package/dist/domain/extensions/fixed-header.js +1 -0
- package/dist/domain/{system-components → extensions}/floating-header.d.ts +1 -1
- package/dist/domain/extensions/floating-header.js +1 -0
- package/dist/domain/{system-components → extensions}/hidden-header.d.ts +1 -1
- package/dist/domain/extensions/hidden-header.js +1 -0
- package/dist/domain/{system-components → extensions}/hidden-sidebar-footer.d.ts +1 -1
- package/dist/domain/extensions/hidden-sidebar-footer.js +1 -0
- package/dist/domain/{system-components → extensions}/horizontal-tabs.d.ts +1 -1
- 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 +3 -2
- 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/{system-components → extensions}/offset-anchors.d.ts +1 -1
- package/dist/domain/extensions/offset-anchors.js +1 -0
- package/dist/domain/{system-components → extensions}/offset-indicator.d.ts +1 -2
- package/dist/domain/extensions/offset-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/offset.d.ts +1 -1
- package/dist/domain/extensions/offset.js +1 -0
- package/dist/domain/{system-components → extensions}/other-action.d.ts +1 -1
- package/dist/domain/extensions/other-action.js +1 -0
- package/dist/domain/{system-components → extensions}/property-page.d.ts +2 -2
- package/dist/domain/extensions/property-page.js +1 -0
- package/dist/domain/{system-components → extensions}/read-sidebar-footer.d.ts +1 -1
- 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/{system-components → extensions}/sidebar-tabs.d.ts +1 -1
- package/dist/domain/extensions/sidebar-tabs.js +1 -0
- package/dist/domain/extensions/simple-summary.js +1 -0
- package/dist/domain/{system-components → extensions}/size.d.ts +1 -1
- package/dist/domain/extensions/size.js +1 -0
- package/dist/domain/{system-components → extensions}/sketching-draw.d.ts +1 -1
- package/dist/domain/extensions/sketching-draw.js +1 -0
- package/dist/domain/{system-components → extensions}/sketching-edit.d.ts +2 -2
- 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 +2 -2
- package/dist/domain/extensions/tool-menu-fab.js +1 -0
- package/dist/domain/{system-components → extensions}/toolbar.d.ts +2 -2
- package/dist/domain/{system-components → extensions}/toolbar.js +1 -1
- package/dist/domain/{system-components → extensions}/universal-sidebar-footer.d.ts +1 -1
- 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 +3 -32
- package/dist/domain/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/project-modules/index.d.ts +1 -0
- package/dist/domain/project-modules/index.js +1 -0
- package/dist/domain/project-modules/project-modules.d.ts +41 -0
- package/dist/domain/project-modules/project-modules.js +1 -0
- 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/projected-entities-projections.d.ts +1 -2
- package/dist/domain/projections/snap-matching.d.ts +1 -2
- package/dist/domain/projections/snap-utils.d.ts +1 -2
- 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.d.ts +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.d.ts +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-geometries.d.ts +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/create-blueprint.d.ts +1 -1
- package/dist/domain/system-components/custom-scene-entity.d.ts +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.d.ts +1 -1
- package/dist/domain/system-components/distance-dimension-select.js +1 -1
- package/dist/domain/system-components/distance-dimension.d.ts +1 -1
- package/dist/domain/system-components/distance-dimension.js +1 -1
- package/dist/domain/system-components/drag-handle.d.ts +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.d.ts +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.d.ts +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.d.ts +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.d.ts +1 -1
- package/dist/domain/system-components/sketching-line.js +1 -1
- package/dist/domain/system-components/sketching-rectangle.d.ts +1 -1
- package/dist/domain/system-components/sketching-rectangle.js +1 -1
- package/dist/domain/system-components/sketching.d.ts +1 -1
- package/dist/domain/system-components/sketching.js +1 -1
- package/dist/domain/system-components/snap-axis.d.ts +1 -1
- package/dist/domain/system-components/snap-axis.js +1 -1
- package/dist/domain/system-components/snap-edge.d.ts +1 -1
- package/dist/domain/system-components/snap-edge.js +1 -1
- package/dist/domain/system-components/snap-plane.d.ts +1 -1
- package/dist/domain/system-components/snap-plane.js +1 -1
- package/dist/domain/system-components/snap-point.d.ts +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/eval-cache.d.ts +1 -2
- package/dist/domain/utils/memo-eval.d.ts +2 -4
- package/dist/editor/domain-editors/use-implementation-files.d.ts +7 -6
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- 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/configurator-builder.js +21 -8
- 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/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -19
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +15 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +22 -23
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +15 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
- package/dist/phoenix/scripts/build-admin.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.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/core/json-schema.js +0 -1
- package/dist/domain/core/reflection.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/common/dimension-indicator-schema.js +0 -1
- package/dist/domain/system-components/custom-price-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/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/{enhanced-json-schema.js → decoder/decoder.js} +0 -0
- /package/dist/domain/core/{expression.js → expression/aliased-expressions.js} +0 -0
- /package/dist/domain/core/{schema-validator.js → 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/core/{alias.d.ts → model/alias.d.ts} +0 -0
- /package/dist/domain/core/{alias.js → model/alias.js} +0 -0
- /package/dist/domain/core/{common-definitions.d.ts → model/common-definitions.d.ts} +0 -0
- /package/dist/domain/core/{common-definitions.js → model/common-definitions.js} +0 -0
- /package/dist/domain/core/{component.js → model/component.js} +0 -0
- /package/dist/domain/core/{model.d.ts → model/model.d.ts} +0 -0
- /package/dist/domain/core/{model.js → model/model.js} +0 -0
- /package/dist/domain/core/{preset.d.ts → model/preset.d.ts} +0 -0
- /package/dist/domain/core/{preset.js → model/preset.js} +0 -0
- /package/dist/domain/{relations → core/relation}/direct-relation.js +0 -0
- /package/dist/domain/{relations → core/relation}/reference-field.js +0 -0
- /package/dist/domain/{relations → core/relation}/relation-factory.js +0 -0
- /package/dist/domain/{relations → core/relation}/relation-implementation.js +0 -0
- /package/dist/domain/core/{schema-validator-ajv.d.ts → schema/create-ajv-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-ajv.js → schema/create-ajv-schema-validator.js} +0 -0
- /package/dist/domain/core/{schema-validator-csp.d.ts → schema/create-csp-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-csp.js → schema/create-csp-schema-validator.js} +0 -0
- /package/dist/domain/core/{enhanced-json-schema.d.ts → schema/enhanced-json-schema.d.ts} +0 -0
- /package/dist/domain/core/{json-schema.d.ts → schema/extended-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator.d.ts → schema/schema-validator.d.ts} +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}/attribute-switch.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-custom-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-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}/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}/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}/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}/simple-summary.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}/view-controls.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
-
import type { AnonymousExpression,
|
|
3
|
-
import type { DomainEntity, DomainEntityId } from '../
|
|
4
|
-
import type { DomainState } from '../
|
|
2
|
+
import type { AnonymousExpression, OpenExpressionContext } from '../expression/index.js';
|
|
3
|
+
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
4
|
+
import type { DomainState } from '../state/index.js';
|
|
5
5
|
import { type Viewport } from './viewport-state-component.js';
|
|
6
6
|
export interface ComponentSystemFilterState {
|
|
7
7
|
navigationState: string | undefined;
|
|
@@ -38,21 +38,21 @@ export type ComponentSystemFilterProps = {
|
|
|
38
38
|
debug?: boolean;
|
|
39
39
|
viewports?: readonly Viewport[];
|
|
40
40
|
};
|
|
41
|
-
export interface GradualComponentSystemFilter<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
|
|
42
|
-
navigationStates: undefined | readonly string[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly string[] | undefined>;
|
|
43
|
-
selectedEntityIds: undefined | readonly IdOrWithId[] | IdOrWithId | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly IdOrWithId[] | IdOrWithId | undefined>;
|
|
44
|
-
hoveredEntityIds: undefined | readonly IdOrWithId[] | IdOrWithId | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly IdOrWithId[] | IdOrWithId | undefined>;
|
|
45
|
-
draggedEntityIds: undefined | readonly IdOrWithId[] | IdOrWithId | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly IdOrWithId[] | IdOrWithId | undefined>;
|
|
46
|
-
exportedEntityIds: undefined | readonly IdOrWithId[] | IdOrWithId | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly IdOrWithId[] | IdOrWithId | undefined>;
|
|
47
|
-
viewStates: undefined | readonly string[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly string[] | undefined>;
|
|
48
|
-
toolStates: undefined | readonly string[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly string[] | undefined>;
|
|
49
|
-
exportStates: undefined | readonly string[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly string[] | undefined>;
|
|
50
|
-
modes: undefined | ReadonlyArray<'owner' | 'read' | 'finalize'> | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, ReadonlyArray<'owner' | 'read' | 'finalize'> | undefined>;
|
|
51
|
-
roles: undefined | readonly SessionRole[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly SessionRole[] | undefined>;
|
|
52
|
-
active: undefined | boolean | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, boolean | undefined>;
|
|
53
|
-
fullscreen: undefined | boolean | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, boolean | undefined>;
|
|
54
|
-
debug: undefined | boolean | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, boolean | undefined>;
|
|
55
|
-
viewports: undefined | readonly Viewport[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly Viewport[] | undefined>;
|
|
41
|
+
export interface GradualComponentSystemFilter<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> {
|
|
42
|
+
navigationStates: undefined | readonly string[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly string[] | undefined, CONTEXT_EXTENSION>;
|
|
43
|
+
selectedEntityIds: undefined | readonly IdOrWithId[] | IdOrWithId | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly IdOrWithId[] | IdOrWithId | undefined, CONTEXT_EXTENSION>;
|
|
44
|
+
hoveredEntityIds: undefined | readonly IdOrWithId[] | IdOrWithId | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly IdOrWithId[] | IdOrWithId | undefined, CONTEXT_EXTENSION>;
|
|
45
|
+
draggedEntityIds: undefined | readonly IdOrWithId[] | IdOrWithId | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly IdOrWithId[] | IdOrWithId | undefined, CONTEXT_EXTENSION>;
|
|
46
|
+
exportedEntityIds: undefined | readonly IdOrWithId[] | IdOrWithId | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly IdOrWithId[] | IdOrWithId | undefined, CONTEXT_EXTENSION>;
|
|
47
|
+
viewStates: undefined | readonly string[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly string[] | undefined, CONTEXT_EXTENSION>;
|
|
48
|
+
toolStates: undefined | readonly string[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly string[] | undefined, CONTEXT_EXTENSION>;
|
|
49
|
+
exportStates: undefined | readonly string[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly string[] | undefined, CONTEXT_EXTENSION>;
|
|
50
|
+
modes: undefined | ReadonlyArray<'owner' | 'read' | 'finalize'> | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, ReadonlyArray<'owner' | 'read' | 'finalize'> | undefined, CONTEXT_EXTENSION>;
|
|
51
|
+
roles: undefined | readonly SessionRole[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly SessionRole[] | undefined, CONTEXT_EXTENSION>;
|
|
52
|
+
active: undefined | boolean | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, boolean | undefined, CONTEXT_EXTENSION>;
|
|
53
|
+
fullscreen: undefined | boolean | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, boolean | undefined, CONTEXT_EXTENSION>;
|
|
54
|
+
debug: undefined | boolean | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, boolean | undefined, CONTEXT_EXTENSION>;
|
|
55
|
+
viewports: undefined | readonly Viewport[] | AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, readonly Viewport[] | undefined, CONTEXT_EXTENSION>;
|
|
56
56
|
}
|
|
57
57
|
export interface FilterMismatchReason {
|
|
58
58
|
readonly modes?: ReadonlyArray<'owner' | 'read' | 'finalize'>;
|
|
@@ -70,7 +70,7 @@ export interface FilterMismatchReason {
|
|
|
70
70
|
readonly draggedEntityIds?: readonly IdOrWithId[] | IdOrWithId;
|
|
71
71
|
readonly active?: boolean;
|
|
72
72
|
}
|
|
73
|
-
export declare const isComponentActive: <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>(filterState: ComponentSystemFilterState, filters: ReadonlyArray<GradualComponentSystemFilter<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>>, id: SELF['id'], domainState: DomainState<ENTITIES>, context:
|
|
73
|
+
export declare const isComponentActive: <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, CONTEXT_EXTENSION = unknown>(filterState: ComponentSystemFilterState, filters: ReadonlyArray<GradualComponentSystemFilter<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, CONTEXT_EXTENSION>>, id: SELF['id'], domainState: DomainState<ENTITIES>, context: OpenExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, CONTEXT_EXTENSION>, reportReason?: boolean) => boolean | readonly FilterMismatchReason[];
|
|
74
74
|
export declare const ComponentSystemFilterPropsSchema: {
|
|
75
75
|
readonly tsType: 'ComponentSystemFilterProps';
|
|
76
76
|
readonly import: [{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createVirtualEntityId as t}from"../model/index.js";export const systemVirtualEntityId=t("system");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isSnapshotInstance as t}from"../model/index.js";import{SystemComponentBuilder as o}from"./system-component-builder.js";import{systemVirtualEntityId as e}from"./system-virtual-entity.js";export const toolStateComponent=o.component("toolState").withState({type:"object",properties:{activeState:{type:"string"}},required:["activeState"],additionalProperties:!1}).withWritableKeys(["activeState"]).build();export const isToolStateComponentSnapshot=o=>t(o,"singleton",toolStateComponent);export const isSystemToolStateComponentSnapshot=t(e,"singleton",toolStateComponent);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Localizable } from '@salsita-ai/common/utils';
|
|
2
|
-
import type { ComponentInstance, StateOfComponent, SystemComponentType, SystemComponentTypeConstraint, WritableStateOfComponent } from '../
|
|
3
|
-
import type { DomainEntity, EntityByType, EntityId } from '../core/model.js';
|
|
2
|
+
import type { ComponentInstance, DomainEntity, EntityByType, EntityId, StateOfComponent, SystemComponentType, SystemComponentTypeConstraint, WritableStateOfComponent } from '../model/index.js';
|
|
4
3
|
import type { OneComponentFilter } from './component-reader-types.js';
|
|
5
4
|
export interface ComponentModification<COMPONENT_TYPE extends SystemComponentTypeConstraint> {
|
|
6
5
|
kind: 'modifyComponent';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isSnapshotInstance as t}from"../model/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const viewStateComponent=e.component("viewState").withState({type:"object",properties:{activeState:{type:"string"}},required:["activeState"],additionalProperties:!1}).withWritableKeys(["activeState"]).build();export const isViewComponentSnapshot=e=>t(e,"singleton",viewStateComponent);export const isSystemViewComponentSnapshot=t(o,"singleton",viewStateComponent);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EntityId } from '../model/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* A responsive class the configurator container currently satisfies. The values mirror the
|
|
4
4
|
* responsive flags computed by the UI layer from the theme breakpoints (`isPhone`, `isMobile`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isSnapshotInstance as t}from"../model/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const VIEWPORTS=["phone","mobile","tablet","desktop","landscape","portrait"];export const viewportStateComponent=e.component("viewportState").withState({type:"object",properties:{active:{oneOf:[{type:"array",items:{type:"string",enum:[...VIEWPORTS]}},{type:"null"}]}},required:["active"],additionalProperties:!1,tsType:"ViewportStateComponentState",import:[{module:"@salsita-ai/sdk/domain",member:"ViewportStateComponentState"}]}).withWritableKeys(["active"]).build();export const isViewportStateComponentSnapshot=e=>t(e,"singleton",viewportStateComponent);export const isSystemViewportStateComponentSnapshot=t(o,"singleton",viewportStateComponent);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Decoder } from './decoder.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the decoder of data that must match a JSON schema. `subject` is what the data is, as the
|
|
4
|
+
* error names it, for example `Session data`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createDecoder: <DATA>(schema: object, subject: string) => Decoder<DATA>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{extendedSchemaValidator as r}from"../schema/index.js";export const createDecoder=(e,o)=>t=>{let i=r.compile(e);if(!i(t))throw Error(`${o} is not valid: ${r.errorsText(i.errors)}`);return t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns data of unknown shape into data of a known type, and throws when the data does not match.
|
|
3
|
+
* Everything that enters a domain from outside goes through one: published, session, frontend and
|
|
4
|
+
* backend data.
|
|
5
|
+
*/
|
|
6
|
+
export type Decoder<DATA> = (data: unknown) => DATA;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{createDecoder}from"./create-decoder.js";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
|
-
import type { ActionDefinitions, AnyActionImplementations } from './action.js';
|
|
3
|
-
import type { Expression } from './expression.js';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type { $DomainEntityReflection, EntityReflections, SchemaOfObject } from './reflection.js';
|
|
2
|
+
import type { ActionDefinitions, AnyActionImplementations } from './action/index.js';
|
|
3
|
+
import type { Expression } from './expression/index.js';
|
|
4
|
+
import type { $DomainEntity, $DomainEntityReflection, DomainEntity, EntityByType, EntityReflections, SchemaOfObject } from './model/index.js';
|
|
5
|
+
import type { MigrateFunction } from './state/index.js';
|
|
7
6
|
type $EntityReflections<ENTITIES extends DomainEntity<string>> = {
|
|
8
7
|
[TYPE in ENTITIES['type']]: $DomainEntityReflection<$DomainEntity<EntityByType<ENTITIES, TYPE>>>;
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{migrateCommonAdminDomain as t}from"../admin-domain/implementation/common-admin-migrations.js";import{
|
|
1
|
+
import{migrateCommonAdminDomain as t}from"../admin-domain/implementation/common-admin-migrations.js";import{createDecoder as a}from"./decoder/index.js";export class DomainFactory{context;modelVersion;hasBackendData;constructor(t){this.context=t,this.modelVersion=t.modelVersion,this.hasBackendData=void 0!==t.backendData}parsePublishedData=t=>a(this.context.publishedData,"Admin data")(t);parseSessionData=t=>a(this.context.sessionData,"Session data")(t);parseFrontendData=t=>a(this.context.frontendData,"Frontend data")(t);parseBackendData=t=>{if(void 0===this.context.backendData)throw Error("Backend data is not supported for this domain");return a(this.context.backendData,"Backend data")(t)};validateAndMigrateState=(a,e)=>{let n=this.context.isAdminDomain?t(a):a;return this.context.migrate({state:n,version:e},{trimExtraProperties:!1})}}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { AnyExpressions,
|
|
2
|
-
import { type $DomainEntity, type DomainEntity, type DomainEntityId, type EntityByType } from './model.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DomainState } from './state.js';
|
|
1
|
+
import type { AnyExpressions, OpenExpressionContext } from './expression/index.js';
|
|
2
|
+
import { type $DomainEntity, type AnyEntityReflections, type DomainEntity, type DomainEntityId, type EntityByType } from './model/index.js';
|
|
3
|
+
import type { DomainState } from './state/index.js';
|
|
5
4
|
export type AllowedRootEntityTypes<ALLOWED_ROOT_ENTITIES extends DomainEntity<string>> = ReadonlyArray<ALLOWED_ROOT_ENTITIES['type']>;
|
|
6
5
|
export type AnyAllowedRootEntityTypes = AllowedRootEntityTypes<DomainEntity<string>>;
|
|
7
6
|
/**
|
|
@@ -13,7 +12,7 @@ export interface DomainSelectors {
|
|
|
13
12
|
readonly getDomainExpressions: () => AnyExpressions;
|
|
14
13
|
readonly getAllowedRootEntityTypes: () => ReadonlyArray<string>;
|
|
15
14
|
readonly getEntityReflections: () => AnyEntityReflections;
|
|
16
|
-
readonly getExpressionContext: () =>
|
|
15
|
+
readonly getExpressionContext: () => OpenExpressionContext<any, any, any, any, any>;
|
|
17
16
|
}
|
|
18
17
|
/** Effective mode used by domain expressions and systems. */
|
|
19
18
|
export type DomainMode = 'owner' | 'read' | 'finalize';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{domainEntityTypeFromId as i}from"./model.js";let r=t(),o=t();export class Domain{_context;constructor(t){this._context=t}getEntity=(t,i)=>{let r=e(i,o),n=r.get("entityMap");if(n)return n.get(t);let s=(t=>{let e=new Map;for(let i of t){if(e.has(i.id))throw Error(`Error while creating a UniqueEntityMap for caching of domain queries. Duplicate entity id ${i.id} encountered!`);e.set(i.id,i)}return e})(i.entities);return r.put("entityMap",s),s.get(t)};get$Entity=(t,i)=>{let o=e(i,r),n=o.get(t);if(n)return n;let s=this.getEntity(t,i);if(!s)throw Error(`Entity ${t} does not exist`);let a={...s},l=this._context.selectors.getDomainExpressions()[s.type];return l&&Object.entries(l).forEach(([t,e])=>{Object.defineProperty(a,t,{enumerable:!0,get:()=>e.evaluate(s.id,i,this._context.selectors.getExpressionContext())})}),Object.defineProperty(a,"_raw",{enumerable:!0,writable:!1,value:s}),Object.defineProperty(a,"_state",{enumerable:!0,writable:!1,value:i}),o.put(t,a),a};get$Entities=(t,e)=>t.map(t=>this.get$Entity(t,e));getRoot$Entity=t=>this.get$Entity(t.rootEntityId,t);validateExpressions=t=>{if(!this._context.selectors.getAllowedRootEntityTypes().includes(t.rootEntityType))throw Error(`Entity type ${t.rootEntityType} is not allowed as root entity`);if(!this.getEntity(t.rootEntityId,t))throw Error(`Root entity ${t.rootEntityId} was not found!`);t.entities.forEach(e=>{let i=this._context.selectors.getDomainExpressions()[e.type];void 0!==i&&Object.values(i).forEach(i=>{!0===i.meta.alwaysEvaluate&&i.evaluate(e.id,t,this._context.selectors.getExpressionContext())})})};validateEntity=t=>{let e=this._context.selectors.getEntityReflections()[t.type];if(!e)throw Error(`Unknown entity type ${t.type}`);return e._meta.validator(t)?{success:!0}:{success:!1,errors:e._meta.validator.errors?.map(t=>`${t.instancePath} ${t.message}`.trim())??[]}};getWritableEntityKeys=(t,e)=>{let r=i(t),o=this._context.selectors.getDomainExpressions()[r];return e.filter(t=>"id"!==t&&"type"!==t&&"_raw"!==t&&o?.[t]===void 0)}}
|
|
1
|
+
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{domainEntityTypeFromId as i}from"./model/index.js";let r=t(),o=t();export class Domain{_context;constructor(t){this._context=t}getEntity=(t,i)=>{let r=e(i,o),n=r.get("entityMap");if(n)return n.get(t);let s=(t=>{let e=new Map;for(let i of t){if(e.has(i.id))throw Error(`Error while creating a UniqueEntityMap for caching of domain queries. Duplicate entity id ${i.id} encountered!`);e.set(i.id,i)}return e})(i.entities);return r.put("entityMap",s),s.get(t)};get$Entity=(t,i)=>{let o=e(i,r),n=o.get(t);if(n)return n;let s=this.getEntity(t,i);if(!s)throw Error(`Entity ${t} does not exist`);let a={...s},l=this._context.selectors.getDomainExpressions()[s.type];return l&&Object.entries(l).forEach(([t,e])=>{Object.defineProperty(a,t,{enumerable:!0,get:()=>e.evaluate(s.id,i,this._context.selectors.getExpressionContext())})}),Object.defineProperty(a,"_raw",{enumerable:!0,writable:!1,value:s}),Object.defineProperty(a,"_state",{enumerable:!0,writable:!1,value:i}),o.put(t,a),a};get$Entities=(t,e)=>t.map(t=>this.get$Entity(t,e));getRoot$Entity=t=>this.get$Entity(t.rootEntityId,t);validateExpressions=t=>{if(!this._context.selectors.getAllowedRootEntityTypes().includes(t.rootEntityType))throw Error(`Entity type ${t.rootEntityType} is not allowed as root entity`);if(!this.getEntity(t.rootEntityId,t))throw Error(`Root entity ${t.rootEntityId} was not found!`);t.entities.forEach(e=>{let i=this._context.selectors.getDomainExpressions()[e.type];void 0!==i&&Object.values(i).forEach(i=>{!0===i.meta.alwaysEvaluate&&i.evaluate(e.id,t,this._context.selectors.getExpressionContext())})})};validateEntity=t=>{let e=this._context.selectors.getEntityReflections()[t.type];if(!e)throw Error(`Unknown entity type ${t.type}`);return e._meta.validator(t)?{success:!0}:{success:!1,errors:e._meta.validator.errors?.map(t=>`${t.instancePath} ${t.message}`.trim())??[]}};getWritableEntityKeys=(t,e)=>{let r=i(t),o=this._context.selectors.getDomainExpressions()[r];return e.filter(t=>"id"!==t&&"type"!==t&&"_raw"!==t&&o?.[t]===void 0)}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DomainEntity, ExpandAlias, TypeOrAlias } from '../model/index.js';
|
|
2
|
+
import type { AnonymousExpression } from './expression.js';
|
|
3
|
+
/**
|
|
4
|
+
* The expressions a project implements, keyed by entity type or alias and then by expression name.
|
|
5
|
+
* It is what `implementCustomExpressions` returns and what the domain is built from; an alias key
|
|
6
|
+
* stands for every entity type the alias expands to.
|
|
7
|
+
*/
|
|
8
|
+
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>, CONTEXT_EXTENSION = unknown> = {
|
|
9
|
+
[K in TypeOrAlias<ENTITIES, ALIASES>]?: Record<string, AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, K>, unknown, CONTEXT_EXTENSION>>;
|
|
10
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ExpandAlias, TypeOrAlias } from '../
|
|
2
|
-
import type { AnonymousExpression, ExpressionMetas } from '
|
|
3
|
-
import type { DomainEntity } from '../core/model.js';
|
|
1
|
+
import type { DomainEntity, ExpandAlias, TypeOrAlias } from '../model/index.js';
|
|
2
|
+
import type { AnonymousExpression, ExpressionMetas } from './expression.js';
|
|
4
3
|
export type ConstantExpressions<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>, CONSTANTS extends Partial<Record<TypeOrAlias<ENTITIES, ALIASES>, Record<string, unknown>>>> = {
|
|
5
4
|
readonly [TYPE_OR_ALIAS in keyof CONSTANTS & string]: {
|
|
6
5
|
readonly [NAME in keyof CONSTANTS[TYPE_OR_ALIAS]]: AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, TYPE_OR_ALIAS>, CONSTANTS[TYPE_OR_ALIAS][NAME]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mapNestedObject as t}from"../../utils/map-nested-object.js";export const createConstantExpressionFactory=e=>o=>t()(o,([t,o,a])=>[[t,o,{meta:e[t]?.[o]??{},evaluate:()=>a}]]);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { TypeOrAlias } from '../
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
export type
|
|
7
|
-
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>> = {
|
|
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> = {
|
|
8
7
|
[TYPE_OR_ALIAS in keyof $MAP]?: {
|
|
9
|
-
[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>;
|
|
10
9
|
};
|
|
11
10
|
};
|
|
12
|
-
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
|
|
13
|
-
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,13 +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
|
-
|
|
10
|
-
export interface ExpressionContext<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>> {
|
|
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>> {
|
|
11
10
|
readonly mode: 'owner' | 'read' | 'finalize';
|
|
12
11
|
readonly role: SessionRole;
|
|
13
12
|
readonly publishedData: PUBLISHED_DATA;
|
|
@@ -15,16 +14,14 @@ export interface ExpressionContext<ENTITIES extends DomainEntity<string>, ALLOWE
|
|
|
15
14
|
readonly backendData: Record<string, unknown> | undefined;
|
|
16
15
|
readonly sessionData: SESSION_DATA;
|
|
17
16
|
readonly domain: Domain<ENTITIES, ALLOWED_ROOT_ENTITIES, Record<ENTITIES['type'], $DomainEntity<ENTITIES>>>;
|
|
18
|
-
readonly componentReader: ComponentReader<ENTITIES>;
|
|
19
17
|
readonly migrate: MigrateFunction<ENTITIES>;
|
|
20
|
-
readonly positionProjections: PositionProjections<ENTITIES>;
|
|
21
|
-
readonly sketchingProjections: SketchingProjections<ENTITIES>;
|
|
22
|
-
readonly collisionProjections: CollisionProjections<ENTITIES>;
|
|
23
|
-
readonly constraintProjections: ConstraintProjections<ENTITIES>;
|
|
24
|
-
readonly snappingProjections: SnappingProjections<ENTITIES>;
|
|
25
|
-
readonly projectedEntitiesProjections: ProjectedEntitiesProjections<ENTITIES>;
|
|
26
18
|
}
|
|
27
|
-
|
|
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;
|
|
28
25
|
export interface ExpressionMeta {
|
|
29
26
|
/**
|
|
30
27
|
* By enabling this flag, expression will be run during validation. It is primarily used to check validity of relations.
|
|
@@ -39,11 +36,11 @@ export interface ExpressionOrigin {
|
|
|
39
36
|
readonly typeOrAlias: string;
|
|
40
37
|
readonly name: string;
|
|
41
38
|
}
|
|
42
|
-
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> {
|
|
43
|
-
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;
|
|
44
41
|
readonly meta: ExpressionMeta;
|
|
45
42
|
}
|
|
46
|
-
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> {
|
|
47
44
|
readonly origin: ExpressionOrigin;
|
|
48
45
|
}
|
|
49
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,18 +1,12 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export { _unsafeBuildDomainEntityId, domainEntityTypeFromId, createVirtualEntityId, isDomainEntityId, isVirtualEntityId, VirtualEntityIdSchema, isEqualEntityTypeAndId, parseDomainEntityId, DomainEntityIdSchema, DomainEntitySchema, $DomainEntitySchema, } from './model.js';
|
|
5
|
-
export type { $DomainEntity, DomainEntity, VirtualEntityId, DomainEntityId, EntityIdSchema, EntityByType, EntityId, } from './model.js';
|
|
6
|
-
export type { PartialSchemaOfObject, SchemaOfObject, EnumLike, EntityReflections } from './reflection.js';
|
|
7
|
-
export { type Migration, MigrateFunctionBuilder, type MigrateFunction, type VersionedState, type MigrateFunctionOptions, type AnyVersionedState, StateMigrationError, isStateMigrationError, } from './migrations.js';
|
|
8
|
-
export * from './reflection.js';
|
|
9
|
-
export type { ComponentInstance, StateOfComponent, WritableStateOfComponent, SystemComponentType, SystemComponentTypeConstraint, ComponentSnapshot, } from './component.js';
|
|
10
|
-
export { isEqualComponentInstance, areEqualComponentSnapshots, isEqualComponentSnapshot, isSnapshotOfComponentType, isInstanceOfComponentType, getComponentInstanceKey, getComponentSnapshotKey, } from './component.js';
|
|
11
|
-
export { type DomainState, type DomainStateFactory, createInitialDomainState } from './state.js';
|
|
12
|
-
export type * from './expression.js';
|
|
13
|
-
export * from './alias.js';
|
|
14
|
-
export * from './domain.js';
|
|
1
|
+
export * from './action/index.js';
|
|
2
|
+
export * from './component/index.js';
|
|
3
|
+
export * from './decoder/index.js';
|
|
15
4
|
export * from './domain-factory.js';
|
|
16
|
-
export * from './
|
|
17
|
-
export
|
|
18
|
-
export
|
|
5
|
+
export * from './domain.js';
|
|
6
|
+
export * from './expression/index.js';
|
|
7
|
+
export * from './invariant/index.js';
|
|
8
|
+
export * from './model/index.js';
|
|
9
|
+
export * from './recipe/index.js';
|
|
10
|
+
export * from './relation/index.js';
|
|
11
|
+
export * from './schema/index.js';
|
|
12
|
+
export * from './state/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import type { DomainEntity, DomainEntityId } from '../
|
|
2
|
-
import type { DomainState } from '../
|
|
1
|
+
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
2
|
+
import type { DomainState } from '../state/index.js';
|
|
3
3
|
import type { Invariant } from './invariants.js';
|
|
4
4
|
import type { Violation } from './violation.js';
|
|
5
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,12 +1,11 @@
|
|
|
1
1
|
import type { OmitEmpty, OmitNever } from '@salsita-ai/common/utils';
|
|
2
|
-
import type {
|
|
3
|
-
import type { $DomainEntity, DomainEntity } from '../
|
|
4
|
-
import type { CustomExpression } from '../expressions/custom-expression.js';
|
|
2
|
+
import type { CustomExpression } from '../expression/index.js';
|
|
3
|
+
import type { $DomainEntity, DomainEntity, ExpandAlias, TypeOrAlias } from '../model/index.js';
|
|
5
4
|
import type { Invariant } from './invariants.js';
|
|
6
5
|
import type { Violation } from './violation.js';
|
|
7
|
-
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> = {
|
|
8
7
|
[TYPE_OR_ALIAS in keyof BLUEPRINTS]: {
|
|
9
|
-
[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;
|
|
10
9
|
};
|
|
11
10
|
};
|
|
12
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<{
|
|
@@ -14,9 +13,9 @@ export type StaticallyDefinedViolations<ENTITIES extends DomainEntity<string>, A
|
|
|
14
13
|
[NAME in keyof BLUEPRINTS[TYPE_OR_ALIAS]]: BLUEPRINTS[TYPE_OR_ALIAS][NAME] extends boolean ? Violation<string> : never;
|
|
15
14
|
}>;
|
|
16
15
|
}>;
|
|
17
|
-
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> = {
|
|
18
17
|
readonly [TYPE_OR_ALIAS in keyof BLUEPRINTS & string & PICK]: ReadonlyArray<{
|
|
19
|
-
[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>;
|
|
20
19
|
}[keyof BLUEPRINTS[TYPE_OR_ALIAS]]>;
|
|
21
20
|
};
|
|
22
|
-
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,11 +1,11 @@
|
|
|
1
1
|
import type { OmitNever } from '@salsita-ai/common/utils';
|
|
2
|
-
import { type
|
|
3
|
-
import type { AnonymousExpression,
|
|
4
|
-
import type
|
|
5
|
-
import type { DomainState } from '../
|
|
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';
|
|
6
6
|
import { type Violation } from './violation.js';
|
|
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> {
|
|
8
|
-
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>>;
|
|
9
9
|
}
|
|
10
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> = {
|
|
11
11
|
[K in TypeOrAlias<ENTITIES, ALIASES>]?: ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, K>, VIOLATION_TYPES>>;
|
|
@@ -38,10 +38,18 @@ type ExpressionsFromInvariants<ENTITIES extends DomainEntity<string>, ALLOWED_RO
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
type BuildViolationExpressions<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>, INVARIANTS extends Partial<Record<ENTITIES['type'], ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, string>>>>> = Record<never, never> extends ConflictingInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, DeclaredInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>, INVARIANTS> ? () => ExpressionsFromInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, INVARIANTS> : never;
|
|
41
|
+
type AnyInvariant = Invariant<any, any, any, any, any, any, string>;
|
|
42
|
+
/** Validates the `src/invariants/` files and concatenates their invariants per entity type or alias. */
|
|
43
|
+
export declare const resolveInvariantModules: (modules: readonly ProjectModule[]) => Readonly<Record<string, readonly AnyInvariant[]>>;
|
|
41
44
|
export declare class InvariantBuilder<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>, INVARIANTS extends Partial<Record<ENTITIES['type'], ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, string>>>> = Record<never, never>> {
|
|
42
45
|
private readonly aliasMap;
|
|
43
46
|
private readonly invariants;
|
|
44
47
|
constructor(aliasMap: AliasMap<ALIASES>, invariants?: INVARIANTS);
|
|
48
|
+
/**
|
|
49
|
+
* Adds the invariants of the `src/invariants/` files, as the generated barrel lists them, after
|
|
50
|
+
* checking each file against the folder's contract.
|
|
51
|
+
*/
|
|
52
|
+
withInvariantModules(modules: readonly ProjectModule[]): InvariantBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ExpandAndMergeInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, INVARIANTS, AliasedInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, string>>>;
|
|
45
53
|
withInvariants<ALIASED_INVARIANTS extends AliasedInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, string>>(aliasedInvariants: ALIASED_INVARIANTS): InvariantBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ExpandAndMergeInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, INVARIANTS, ALIASED_INVARIANTS>>;
|
|
46
54
|
/**
|
|
47
55
|
* DO NOT USE in runtime!
|
|
@@ -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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
|
+
import type { PhxValidateFunction } from '../schema/index.js';
|
|
2
3
|
import type { EntityId } from './model.js';
|
|
3
|
-
import type { PhxValidateFunction } from './schema-validator.js';
|
|
4
4
|
/**
|
|
5
5
|
* Definition of how the component looks like, it's name, state and other properties. It is used to instantiate components.
|
|
6
6
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./alias.js";export*from"./common-definitions.js";export*from"./component.js";export*from"./model.js";export*from"./preset.js";export*from"./reflection.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
|
+
import { type PhxValidateFunction } from '../schema/index.js';
|
|
2
3
|
import { type $DomainEntity, type DomainEntity, type EntityByType, type EntityId } from './model.js';
|
|
3
|
-
import type { PhxValidateFunction } from './schema-validator.js';
|
|
4
4
|
type RequiredKeys<T> = {
|
|
5
5
|
[K in keyof T]: undefined extends T[K] ? never : K;
|
|
6
6
|
}[keyof T];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{extendedSchemaValidator as t}from"../schema/index.js";import{domainEntityTypeFromId as e,isDomainEntityId as s}from"./model.js";export class SchemaReflection{_meta;constructor(e,s){this._meta={name:e,schema:s,validator:t.compile(s)}}is=t=>this._meta.validator(t);assert(t){if(!this._meta.validator(t))throw Error(`Expected value to match schema of '${this._meta.name}' but got ${t}`)}}export class EnumReflection extends SchemaReflection{constructor(t,e){for(let s of(super(t,e),e.enum))Object.defineProperty(this,s,{value:s,writable:!1,enumerable:!0,configurable:!1})}values=()=>this._meta.schema.enum}let o=class BaseDomainEntityReflection{type;constructor(t){this.type=t}is=t=>t.type===this.type;assert(t){if(!this.is(t))throw Error(`Expected entity #${t.id} to be of type ${this.type} but got ${t.type}`)}isId=t=>s(t)&&e(t)===this.type;assertId(t){if(!this.isId(t))throw Error(`Expected entity id to be of type ${this.type} but got ${t}`)}assertIds(t){t.forEach(t=>{this.assertId(t)})}};export class DomainEntityReflection extends o{_meta;constructor(e,s){super(e);let o=s.reduce((t,e)=>{let s=e.$defs;return"object"==typeof s&&null!==s&&Object.assign(t,s),t},{}),r={type:"object",properties:{id:{type:"string",pattern:`^${e}-[0-9]+$`},type:{type:"string",const:e},...s.reduce((t,e)=>({...t,...e.properties}),{})},required:["id","type",...s.flatMap(t=>t.required??[])],additionalProperties:!1},i={...r,$defs:o};this._meta={name:e,schema:r,validator:t.compile(i)}}}let r=class $DomainEntityReflectionClass extends o{expressions;constructor(t,e,s){super(t),this.expressions=e,Object.assign(this,s)}};export const $DomainEntityReflection=r;let i=class BaseAliasReflection{name;types;typeSet;constructor(t,e){this.name=t,this.types=e,this.typeSet=new Set(e)}is=t=>this.typeSet.has(t.type);assert(t){if(!this.is(t))throw Error(`Expected entity #${t.id} to be a member of alias ${this.name} but got ${t.type}`)}isId=t=>s(t)&&this.typeSet.has(e(t));assertId(t){if(!this.isId(t))throw Error(`Expected entity id to be of a member of alias ${this.name} but got ${t}`)}assertIds(t){t.forEach(t=>{this.assertId(t)})}};export class RawAliasReflection extends i{reflections;constructor(t,e){super(t,e.map(t=>t.type)),this.reflections=e}}let a=class EnhancedAliasReflectionClass extends i{constructor(t,e,s){super(t,e),Object.assign(this,s)}};export const EnhancedAliasReflection=a;export function assertString(t){if("string"!=typeof t)throw Error(`Expected value to be a string but got ${t}`)}export function assertNumber(t){if("number"!=typeof t)throw Error(`Expected value to be a number but got ${t}`)}export function assertBoolean(t){if("boolean"!=typeof t)throw Error(`Expected value to be a boolean but got ${t}`)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './recipes.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./recipes.js";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { OmitEmpty, OmitNever, UnionToIntersection } from '@salsita-ai/common/utils';
|
|
2
|
-
import { type AliasMap, type EventualAlias, type ExpandAlias, type ExtractFromAliasedRecord, type TypeOrAlias } from '
|
|
3
|
-
import { type DomainEntity, type DomainEntityId, type EntityByType } from '../../core/model.js';
|
|
4
|
-
import type { DomainEntityReflection } from '../../core/reflection.js';
|
|
2
|
+
import { type AliasMap, type DomainEntity, type DomainEntityId, type DomainEntityReflection, type EntityByType, type EventualAlias, type ExpandAlias, type ExtractFromAliasedRecord, type TypeOrAlias } from '../model/index.js';
|
|
5
3
|
export type EntityDefaults<ENTITY extends DomainEntity<string>> = {
|
|
6
4
|
[K in Exclude<keyof ENTITY, 'id' | 'type'>]: ENTITY[K] extends DomainEntityId<any> ? null : ENTITY[K];
|
|
7
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})}}})})};
|