@salsita-ai/sdk 0.50.0-develop.ae52227c7e → 0.50.0-develop.ae9a830ef0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application-spec/core/components/component-filter.d.ts +53 -0
- package/dist/application-spec/core/components/component-filter.js +1 -0
- package/dist/application-spec/core/components/index.d.ts +2 -0
- package/dist/application-spec/core/components/index.js +1 -0
- package/dist/application-spec/core/components/sdk-code-ref.d.ts +9 -0
- package/dist/application-spec/core/components/sdk-code-ref.js +1 -0
- package/dist/application-spec/core/enhanced-json-value.d.ts +0 -68
- package/dist/application-spec/core/enhanced-json-value.js +1 -1
- package/dist/application-spec/core/expressions/index.d.ts +2 -0
- package/dist/application-spec/core/expressions/index.js +1 -0
- package/dist/application-spec/core/expressions/relation-expression-params.d.ts +11 -0
- package/dist/application-spec/core/expressions/sdk-expression-implementation.d.ts +24 -0
- package/dist/application-spec/core/expressions/sdk-expression-implementation.js +1 -0
- package/dist/application-spec/core/index.d.ts +2 -0
- package/dist/application-spec/core/index.js +1 -1
- package/dist/application-spec/core/json-value.d.ts +1 -1
- package/dist/application-spec/{core → enhanced-json}/eval-to-constant.d.ts +1 -1
- package/dist/application-spec/enhanced-json/index.d.ts +4 -0
- package/dist/application-spec/enhanced-json/index.js +1 -0
- package/dist/application-spec/enhanced-json/is-enhanced-json-array.d.ts +2 -0
- package/dist/application-spec/enhanced-json/is-enhanced-json-array.js +1 -0
- package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.d.ts +18 -0
- package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.js +1 -0
- package/dist/application-spec/enhanced-json/schema-from-value.d.ts +24 -0
- package/dist/application-spec/enhanced-json/schema-from-value.js +1 -0
- package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.d.ts +14 -0
- package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.js +1 -0
- package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.d.ts +12 -0
- package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.js +1 -0
- package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.d.ts +13 -0
- package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.js +1 -0
- package/dist/application-spec/errors/diagnostic-codes.d.ts +8 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +11 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +4 -4
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.d.ts +4 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +43 -45
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-relation-expressions.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.d.ts +6 -8
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +11 -11
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +12 -12
- package/dist/application-spec/generate-application/code/templates/globals.js +5 -4
- package/dist/application-spec/generate-application/code/templates/index.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +8 -2
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +5 -3
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
- package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +1 -3
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +1 -3
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +2 -4
- package/dist/application-spec/index.d.ts +1 -0
- package/dist/application-spec/index.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +1 -1
- package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +16 -3
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/component-entry.d.ts +1 -9
- package/dist/application-spec/parse-application-files/spec/components/component-entry.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +1 -54
- package/dist/application-spec/parse-application-files/spec/components/component-filter.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -1
- package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expression.d.ts +1 -28
- package/dist/application-spec/parse-application-files/spec/expressions/expression.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
- package/dist/application-spec/parse-application-files/spec/expressions/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +3 -3
- package/dist/application-spec/parse-application-files/spec/model/defaults.js +1 -1
- package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.d.ts +25 -0
- package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.d.ts +46 -0
- package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/relations.d.ts +4 -3
- package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/infra.d.ts +2 -0
- package/dist/application-spec/parse-application-files/spec/sections/infra.js +1 -1
- package/dist/client/phoenix-api.d.ts +96 -0
- package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +3 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +3 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/drag-and-drop-system/drag-and-drop-system.d.ts +3 -3
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +14 -4
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.d.ts +11 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -2
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +11 -1
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/common/frontend-analytics.d.ts +2 -0
- package/dist/configurator/common/frontend-analytics.js +1 -1
- package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +1 -1
- package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragHandle.d.ts +1 -1
- package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragSceneHandle.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicator.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicatorInternal.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/drag-and-drop/shared.d.ts +2 -2
- package/dist/configurator/scene/scene-entity/drag-and-drop/use-drag-object.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
- package/dist/configurator/scene/scene-entity/objects/SceneEntityObjectTextDecal.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +13 -0
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-selection.d.ts +22 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-selection.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +27 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-state.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-target.d.ts +5 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-target.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/index.d.ts +3 -0
- package/dist/configurator/ui/assistant/entity-link/index.js +1 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/index.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/index.js +1 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.d.ts +11 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.d.ts +101 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +16 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.d.ts +4 -4
- package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.d.ts +3 -6
- package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/slots.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/slots/slots.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.d.ts +0 -74
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -20
- package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.d.ts +2 -2
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -2
- package/dist/docs/dimensions/3d-scene-integration/dimension-indicators.mdx +2 -2
- package/dist/docs/dimensions/3d-scene-integration/editable-angle-indicator.mdx +1 -1
- package/dist/docs/dimensions/3d-scene-integration/editable-distance-dimension-indicator.mdx +1 -1
- package/dist/docs/dimensions/3d-scene-integration/list-selector-dimension-indicator.mdx +1 -1
- package/dist/docs/drag-and-drop/drag-handle.mdx +1 -1
- package/dist/docs/drag-and-drop/hotspot-handle.mdx +1 -1
- package/dist/docs/drag-and-drop/planes.mdx +1 -1
- package/dist/docs/drag-and-drop/rotatable.mdx +2 -2
- package/dist/docs/index.json +42 -1
- package/dist/docs/layouts/custom-layout.mdx +1164 -0
- package/dist/docs/layouts/header/fixed.mdx +2 -2
- package/dist/docs/layouts/header/floating.mdx +2 -2
- package/dist/docs/layouts/sidebar/in-a-custom-layout.mdx +380 -0
- package/dist/docs/layouts/sidebar-footer/basic.mdx +32 -77
- package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
- package/dist/docs/other-features/transformers.mdx +4 -0
- package/dist/docs/phoenix/application-states.mdx +9 -7
- package/dist/docs/phoenix/configurator-interface.mdx +87 -18
- package/dist/docs/phoenix/domain-model.mdx +4 -0
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/layout-slots.mdx +114 -0
- package/dist/docs/phoenix/phoenix-cli.mdx +5 -1
- package/dist/docs/phoenix/project-structure.mdx +6 -3
- package/dist/docs/phoenix/testing.mdx +140 -0
- package/dist/docs/phoenix/webhook-membership.mdx +10 -9
- package/dist/docs/phoenix/webhooks.mdx +1 -1
- package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +26 -11
- package/dist/domain/admin-domain/implementation/common-admin-publish.d.ts +1 -2
- package/dist/domain/admin-domain/index.js +1 -1
- package/dist/domain/application/GetApplicationWrapperHandler.d.ts +1 -1
- package/dist/domain/application/application-config.d.ts +4 -2
- package/dist/domain/application/assistant/assistant-fields.d.ts +12 -0
- package/dist/domain/application/assistant/assistant-fields.js +1 -0
- package/dist/domain/application/assistant/assistant-manifest.d.ts +9 -1
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +38 -2
- package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
- package/dist/domain/application/assistant/build-assistant-lenses.d.ts +14 -0
- package/dist/domain/application/assistant/build-assistant-lenses.js +5 -0
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/create-assistant-execution-schema.d.ts +32 -0
- package/dist/domain/application/assistant/create-assistant-execution-schema.js +1 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +6 -1
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.d.ts +20 -0
- package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.js +1 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.d.ts +10 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +48 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -0
- package/dist/domain/application/assistant/session-setup/create-session-assistant.d.ts +15 -0
- package/dist/domain/application/assistant/session-setup/create-session-assistant.js +1 -0
- package/dist/domain/application/assistant/session-setup/index.d.ts +4 -0
- package/dist/domain/application/assistant/session-setup/index.js +1 -0
- package/dist/domain/application/configurator-builder.d.ts +1 -1
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/create-initial-published-data.d.ts +5 -5
- package/dist/domain/application/index.d.ts +0 -1
- package/dist/domain/application/index.js +1 -1
- 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 +7 -3
- package/dist/domain/core/component/domain-component-optic.d.ts +1 -2
- package/dist/domain/core/component/domain-component-optic.js +2 -2
- package/dist/domain/core/component/system-component-filter.d.ts +15 -2
- package/dist/domain/core/expression/constant-expressions.d.ts +16 -8
- package/dist/domain/core/expression/custom-expression.d.ts +16 -3
- package/dist/domain/core/invariant/violation.d.ts +50 -2
- package/dist/domain/core/invariant/violation.js +1 -1
- package/dist/domain/core/model/model.d.ts +1 -1
- package/dist/domain/core/recipe/recipes.d.ts +18 -50
- package/dist/domain/core/recipe/recipes.js +1 -1
- package/dist/domain/core/relation/all-of-type-relation.d.ts +8 -21
- package/dist/domain/core/relation/all-of-type-relation.js +1 -1
- package/dist/domain/core/relation/direct-relation.d.ts +13 -24
- package/dist/domain/core/relation/index.d.ts +0 -1
- package/dist/domain/core/relation/indirect-relation.d.ts +12 -67
- package/dist/domain/core/relation/indirect-relation.js +1 -1
- package/dist/domain/core/relation/relation-factory.d.ts +19 -15
- package/dist/domain/core/relation/relation-factory.js +1 -1
- package/dist/domain/core/state/state.d.ts +1 -1
- package/dist/domain/domain-runtime/access/selectors.d.ts +9 -0
- package/dist/domain/domain-runtime/access/selectors.js +1 -1
- package/dist/domain/domain-runtime/access/types.d.ts +2 -0
- package/dist/domain/domain-runtime/access/types.js +1 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +14 -13
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-context/types.d.ts +4 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +32 -16
- package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +19 -0
- package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -0
- package/dist/domain/domain-runtime/errors/implementation-error.d.ts +46 -0
- package/dist/domain/domain-runtime/errors/implementation-error.js +1 -0
- package/dist/domain/domain-runtime/errors/implementation-errors.d.ts +13 -0
- package/dist/domain/domain-runtime/errors/implementation-errors.js +1 -0
- package/dist/domain/domain-runtime/errors/index.d.ts +4 -0
- package/dist/domain/domain-runtime/errors/index.js +1 -0
- package/dist/domain/domain-runtime/errors/to-implementation-errors.d.ts +10 -0
- package/dist/domain/domain-runtime/errors/to-implementation-errors.js +1 -0
- package/dist/domain/domain-runtime/index.d.ts +1 -0
- package/dist/domain/domain-runtime/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.d.ts +11 -0
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/project-modules.d.ts +8 -1
- package/dist/domain/domain-runtime/spec/module-checks/project-modules.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.d.ts +7 -7
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.js +1 -1
- package/dist/domain/extensions/attribute-switch.d.ts +1 -1
- package/dist/domain/extensions/attribute-switch.js +1 -1
- package/dist/domain/extensions/canvas-config.d.ts +1 -1
- package/dist/domain/extensions/client-side-image.d.ts +2 -2
- package/dist/domain/extensions/client-side-image.js +1 -1
- package/dist/domain/extensions/common/angle-indicator-schema.d.ts +2 -2
- package/dist/domain/extensions/common/dimension-indicator-schema.d.ts +2 -2
- package/dist/domain/extensions/editable-angle-indicator.d.ts +1 -1
- package/dist/domain/extensions/editable-distance-dimension-indicator.d.ts +1 -1
- package/dist/domain/extensions/editable-offset-indicator.d.ts +1 -1
- package/dist/domain/extensions/editable-offset-indicator.js +1 -1
- package/dist/domain/extensions/fit-selection-orthographic-camera-component.js +1 -1
- package/dist/domain/extensions/fit-selection-perspective-camera-component.js +1 -1
- package/dist/domain/extensions/horizontal-tabs.d.ts +2 -2
- package/dist/domain/extensions/list-selector-dimension-indicator.d.ts +1 -1
- package/dist/domain/extensions/navigation-steps.d.ts +2 -2
- package/dist/domain/extensions/offset-indicator.js +1 -1
- package/dist/domain/extensions/rotation-handle.d.ts +2 -2
- package/dist/domain/extensions/save-template-thumbnail.d.ts +2 -2
- package/dist/domain/extensions/save-template-thumbnail.js +1 -1
- package/dist/domain/extensions/scene-entity-animation.js +1 -1
- package/dist/domain/mocks/create-mock-domain-context.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +18 -9
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/mocks/create-mock-domain.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain.js +1 -1
- package/dist/domain/mocks/create-mock-state.d.ts +2 -2
- package/dist/domain/mocks/create-test-application-config.d.ts +59 -0
- package/dist/domain/mocks/create-test-application-config.js +1 -0
- package/dist/domain/mocks/index.d.ts +1 -0
- package/dist/domain/mocks/index.js +1 -1
- package/dist/domain/projections/blender-projections/camera.d.ts +1 -1
- package/dist/domain/system-components/application-config.d.ts +2 -2
- package/dist/domain/system-components/child-entity-selection.js +1 -1
- package/dist/domain/system-components/collision-box-geometry.d.ts +4 -2
- package/dist/domain/system-components/collision-geometry.d.ts +4 -2
- package/dist/domain/system-components/collision-point-geometry.d.ts +4 -2
- package/dist/domain/system-components/common/material-override-schema.d.ts +2 -2
- package/dist/domain/system-components/common/recipes.d.ts +21 -3
- package/dist/domain/system-components/common/recipes.js +1 -1
- package/dist/domain/system-components/constraint.d.ts +10 -23
- 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/hotspot-drag-handle.d.ts +1 -1
- package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
- package/dist/domain/system-components/material-swatch.js +1 -1
- package/dist/domain/system-components/scene-entity-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-text-decal.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.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.js +1 -1
- package/dist/domain/utils/eval-cache.d.ts +1 -1
- package/dist/domain/utils/map-nested-object.d.ts +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +1 -2
- package/dist/editor/mocks/EditorMockContext.js +1 -1
- package/dist/legacy/domain-cli/gen/configurator-builder.js +13 -12
- package/dist/legacy/domain-cli/gen/constant-expressions.js +1 -1
- package/dist/legacy/domain-cli/gen/defaults.js +1 -7
- package/dist/legacy/domain-cli/gen/relations.js +1 -1
- package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
- package/dist/legacy/domain-cli/utils/cache.js +1 -1
- package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +81 -68
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +2 -1
- package/dist/phoenix/commands/deploy.js +1 -1
- package/dist/phoenix/services/source-archive.d.ts +1 -0
- package/dist/phoenix/services/source-archive.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +2 -0
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/routing/access-service.d.ts +1 -0
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +33 -16
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +30 -0
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -0
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +4 -4
- package/dist/react-sdk/domain-context/index.d.ts +2 -1
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +6 -0
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
- package/dist/react-sdk/domain-controls/hooks/use-angle-dimension.d.ts +1 -1
- package/dist/ui-sdk/theme/types.d.ts +1 -1
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +3 -3
- package/schema/domain-spec.json +1115 -209
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.js +0 -6
- package/dist/domain/application/resource-builder.d.ts +0 -13
- package/dist/domain/application/resource-builder.js +0 -1
- package/dist/domain/core/relation/relation-implementation.d.ts +0 -7
- /package/dist/{domain/core/relation/relation-implementation.js → application-spec/core/expressions/relation-expression-params.js} +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.d.ts +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.js +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-to-constant.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./assistant-setup-manifest.js";export*from"./AssistantSetupHandler.js";export{applyAssistantSetup,AssistantSetupError}from"./apply-assistant-setup.js";export{createSessionAssistant}from"./create-session-assistant.js";
|
|
@@ -5,7 +5,7 @@ import type { FinalizeTaskResource } from '@salsita-ai/contracts/webhook';
|
|
|
5
5
|
import { type $DomainEntity, type DomainEntity, type DomainFactory, type EnumLike, type ProductPreset, type SchemaOfObject } from '../core/index.js';
|
|
6
6
|
import { type ProjectModule } from '../domain-runtime/index.js';
|
|
7
7
|
import type { AclConfig, ApplicationConfig, DataSpec, DefaultEnvs, ResourcesConfig, SpecTransformer, TransformersConfig, UserInterfaceConfig } from './application-config.js';
|
|
8
|
-
import type
|
|
8
|
+
import { type AssistantResolvedManifest } from './assistant/index.js';
|
|
9
9
|
interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = never, ALLOWED_ROOT_ENTITIES extends ENTITIES = never, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = never, NAVIGATION_STATES extends string = never, VIEW_STATES extends string = never, TOOL_STATES extends string = never, EXPORT_STATES extends string = never, PUBLISHED_DATA extends Record<string, unknown> = never, SESSION_DATA extends Record<string, unknown> = never, FRONTEND_DATA extends Record<string, unknown> = never, ADMIN_ENTITIES extends DomainEntity<string> = never, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES = never, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>> = never, ADMIN_NAVIGATION_STATES extends string = never, ADMIN_VIEW_STATES extends string = never, FINALIZE_DATA extends Record<string, unknown> = never, PREFETCHED_FINALIZE_DATA extends Record<string, unknown> = never, FINALIZE_RESULT extends Record<string, unknown> = never, CALLBACK_DATA extends Record<string, unknown> = never, RESOURCE extends string = never> {
|
|
10
10
|
version?: string;
|
|
11
11
|
textLanguages?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{
|
|
1
|
+
import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{isAssistantSetupHandler as s}from"./assistant/index.js";import{createInitialPublishedData as l}from"./create-initial-published-data.js";import{isDataRowValidatorHandler as h}from"./published-data/DataRowValidatorHandler.js";import{isFilterPublishedChunksHandler as u}from"./published-data/FilterPublishedChunksHandler.js";import{isMapPublishedChunkedDataHandler as d}from"./published-data/MapPublishedChunkedDataHandler.js";import{isMapPublishedRevisionDataHandler as c}from"./published-data/MapPublishedRevisionDataHandler.js";import{isSheetValidatorHandler as f}from"./published-data/SheetValidatorHandler.js";export class ConfiguratorBuilder{_context;constructor(t){this._context=t}withDefaultEnvs(t){return new ConfiguratorBuilder({...this._context,defaultEnvs:t})}withVersion(t){return new ConfiguratorBuilder({...this._context,version:t})}withTextLanguages(t){return new ConfiguratorBuilder({...this._context,textLanguages:t})}withAcl(t){return new ConfiguratorBuilder({...this._context,acl:t})}withAdminRelease(t){return new ConfiguratorBuilder({...this._context,enableAdminRelease:t})}withUi(t){return new ConfiguratorBuilder({...this._context,ui:t})}withResourcesConfig(t){return new ConfiguratorBuilder({...this._context,resourcesConfig:t})}withChunks(t){return new ConfiguratorBuilder({...this._context,chunks:t})}withPublishedDataHash(t){return new ConfiguratorBuilder({...this._context,publishedDataHash:t})}withAssistant(t){return new ConfiguratorBuilder({...this._context,assistant:t})}withTheme(t){return new ConfiguratorBuilder({...this._context,theme:t})}withDomainFactory(t){return new ConfiguratorBuilder({...this._context,domainFactory:t})}withAdminDomainFactory(t){return new ConfiguratorBuilder({...this._context,adminDomainFactory:t})}withI18n=t=>new ConfiguratorBuilder({...this._context,i18n:t});withPrefetchedFinalizeData(t){return new ConfiguratorBuilder({...this._context,prefetchedFinalizeData:t})}withFinalizeData(t){return new ConfiguratorBuilder({...this._context,finalizeData:t})}withFinalizeResult(t){return new ConfiguratorBuilder({...this._context,finalizeResult:t})}withCallbackData(t){return new ConfiguratorBuilder({...this._context,callbackData:t})}withNavigationState(t){return new ConfiguratorBuilder({...this._context,navigationState:t})}withViewState(t){return new ConfiguratorBuilder({...this._context,viewState:t})}withToolState(t){return new ConfiguratorBuilder({...this._context,toolState:t})}withExportState(t){return new ConfiguratorBuilder({...this._context,exportState:t})}withAdminNavigationState(t){return new ConfiguratorBuilder({...this._context,adminNavigationState:t})}withAdminViewState(t){return new ConfiguratorBuilder({...this._context,adminViewState:t})}withPresets(t){return new ConfiguratorBuilder({...this._context,presets:t})}withAdminPresets(t){return new ConfiguratorBuilder({...this._context,adminPresets:t})}withComponentOptics(t){return new ConfiguratorBuilder({...this._context,componentOptics:[...this._context.componentOptics,...t]})}withAdminComponentOptics(t){return new ConfiguratorBuilder({...this._context,adminComponentOptics:[...this._context.adminComponentOptics??[],...t]})}withHandlers(t){return new ConfiguratorBuilder({...this._context,handlers:t})}withElements(t){return new ConfiguratorBuilder({...this._context,elements:t})}withResources(t){return new ConfiguratorBuilder({...this._context,resources:t})}withWebComponentTag(t){return new ConfiguratorBuilder({...this._context,tagName:t})}withTransformers(t,e){return new ConfiguratorBuilder({...this._context,transformers:{importedTransformers:t,specTransformers:e}})}withInterface(t){return this}withDataSpec=t=>new ConfiguratorBuilder({...this._context,dataSpec:t});_computeInitialPublishedData(t,e,i){if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");return l({adminDomainFactory:this._context.adminDomainFactory,domainRuntime:e,adminPresets:this._context.adminPresets??[],handlers:i,dataSpec:this._context.dataSpec,chunks:this._context.chunks,logger:t})}buildConfig(){return this._buildConfigWithHandlers().config}_buildConfigWithHandlers(){if(!this._context.domainFactory)throw Error("Can not create application config, domainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.presets)throw Error("Can not create application config, presets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminDomainFactory)throw Error("Can not create application config, adminDomainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminPresets)throw Error("Can not create application config, adminPresets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.version)throw Error("Can not create application config, version is required!");let i=this._context.tagName??"salsita-configurator",l={defaultEnvs:this._context.defaultEnvs,services:{i18n:this._context.i18n},version:this._context.version,initialPublishedData:{},domain:{textLanguages:this._context.textLanguages,componentOptics:this._context.componentOptics,presets:this._context.presets,domainFactory:this._context.domainFactory},navigation:{navigationStates:this._context.navigationState?.values(),viewStates:this._context.viewState?.values(),toolStates:this._context.toolState?.values(),exportStates:this._context.exportState?.values()},adminNavigation:{navigationStates:this._context.adminNavigationState?.values(),viewStates:this._context.adminViewState?.values()},adminDomain:{textLanguages:this._context.textLanguages,componentOptics:this._context.adminComponentOptics??[],presets:this._context.adminPresets,domainFactory:this._context.adminDomainFactory},mount:{tag:i,options:{}},handlers:this._context.handlers??[],elements:this._context.elements??[],transformers:this._context.transformers,features:{acl:this._context.acl,enableAdminRelease:this._context.enableAdminRelease},ui:{preview:this._context.ui?.preview,alwaysExpand:this._context.ui?.alwaysExpand,theme:this._context.theme},resources:this._context.resourcesConfig,chunks:this._context.chunks,publishedDataHash:this._context.publishedDataHash,assistant:this._context.assistant,dataSpec:this._context.dataSpec},d=t(),c=n({config:l,services:{analyticsService:new r,i18n:e,logger:d}}),m=c.getState().spec.configurator.handlers;if(m.filter(s).length>1)throw Error("Multiple createAssistantSetupHandler handlers found. Only one handler is allowed.");if(m.filter(t=>u(t)).length>1)throw Error("Multiple createFilterPublishedChunksHandler handlers found. Only one handler is allowed.");if(m.filter(t=>h(t)).length>1)throw Error("Multiple createDataRowValidatorHandler handlers found. Only one handler is allowed.");if(m.filter(t=>f(t)).length>1)throw Error("Multiple createSheetValidatorHandler handlers found. Only one handler is allowed.");let w=m.find(o)?.handler().handler,x=m.find(a)?.handler().handler(void 0),p=this._computeInitialPublishedData(d,c,m);return{config:{...l,mount:{tag:i,options:x??{},Application:w},initialPublishedData:p},handlers:m}}buildWebhookContext(){if(!this._context.domainFactory)throw Error("domainFactory is required!");if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");if(!this._context.adminPresets)throw Error("adminPresets are required!");let{config:t,handlers:e}=this._buildConfigWithHandlers(),r=t=>{if(null==this._context.finalizeData)return{};let e=i.compile(this._context.finalizeData);if(!e(t))throw console.error("Finalize data validation errors:",e.errors),Error("Invalid finalize data!");return t},n=t=>{if(null==this._context.finalizeResult)return{};let e=i.compile(this._context.finalizeResult);if(!e(t))throw console.error("Finalize result validation errors:",e.errors),Error("Invalid finalize result!");return t},o=t=>{if(null==this._context.callbackData)return{};let e=i.compile(this._context.callbackData);if(!e(t))throw console.error("Callback data validation errors:",e.errors),Error("Invalid callback data!");return t},a=e.find(c)?.handler().handler,s=e.find(d)?.handler().handler,l=e.find(h)?.handler().handler,u=e.find(f)?.handler().handler;return{config:t,parseFinalizeData:r,parseFinalizeResult:n,resources:this._context.resources??[],parseCallbackData:o,mapPublishedRevisionData:a,mapPublishedChunkedData:s,dataRowValidator:l,sheetValidator:u}}}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Logger } from '@salsita-ai/common/utils';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DomainEntity, DomainFactory, ProductPreset } from '../core/index.js';
|
|
3
3
|
import type { DomainRuntime, HandlerRegistration } from '../domain-runtime/index.js';
|
|
4
4
|
import type { ChunksSpec, DataSpec } from './application-config.js';
|
|
5
|
-
export interface CreateInitialPublishedDataProps<
|
|
6
|
-
readonly adminDomainFactory: DomainFactory<
|
|
5
|
+
export interface CreateInitialPublishedDataProps<PUBLISHED_DATA extends Record<string, unknown>> {
|
|
6
|
+
readonly adminDomainFactory: DomainFactory<any, any, any, PUBLISHED_DATA, any, any>;
|
|
7
7
|
readonly domainRuntime: DomainRuntime;
|
|
8
|
-
readonly adminPresets: ReadonlyArray<ProductPreset<
|
|
8
|
+
readonly adminPresets: ReadonlyArray<ProductPreset<DomainEntity<string>, DomainEntity<string>>>;
|
|
9
9
|
readonly handlers?: ReadonlyArray<HandlerRegistration<any, any>>;
|
|
10
10
|
readonly dataSpec?: DataSpec;
|
|
11
11
|
readonly chunks?: ChunksSpec;
|
|
12
12
|
readonly logger: Logger;
|
|
13
13
|
}
|
|
14
|
-
export declare const createInitialPublishedData: <
|
|
14
|
+
export declare const createInitialPublishedData: <PUBLISHED_DATA extends Record<string, unknown>>(props: CreateInitialPublishedDataProps<PUBLISHED_DATA>) => PUBLISHED_DATA;
|
|
@@ -9,7 +9,6 @@ export { webComponentAttributeParsers, createWebComponentPropertyDescriptor, typ
|
|
|
9
9
|
export { createWebComponentEventDescriptor, type WebComponentEventDescriptor } from './web-component-event.js';
|
|
10
10
|
export { standardWebComponentProperties, type StandardConfiguratorElement } from './standard-properties.js';
|
|
11
11
|
export { standardWebComponentEvents } from './standard-events.js';
|
|
12
|
-
export { ResourceBuilder } from './resource-builder.js';
|
|
13
12
|
export { createGetApplicationWrapperHandler, isGetApplicationWrapperHandler, type CreateGetApplicationWrapperHandler, } from './GetApplicationWrapperHandler.js';
|
|
14
13
|
export { createGetThemeHandler, GetThemeHandlerName, isGetThemeHandler, type CreateGetThemeHandler, } from './GetThemeHandler.js';
|
|
15
14
|
export { createGetWebComponentOptionsHandler, isGetWebComponentOptionsHandler, type CreateGetWebComponentOptionsHandler, } from './GetWebComponentOptions.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{findAssistantRecipeGroups,prepareAssistantRecipeUpdates,readAssistantRecipeGroup}from"./assistant-recipe-groups.js";export{ConfiguratorBuilder}from"./configurator-builder.js";export*from"./admin-page-factories.js";export{createInitialPublishedData}from"./create-initial-published-data.js";export{webComponentAttributeParsers,createWebComponentPropertyDescriptor}from"./web-component-property.js";export{createWebComponentEventDescriptor}from"./web-component-event.js";export{standardWebComponentProperties}from"./standard-properties.js";export{standardWebComponentEvents}from"./standard-events.js";export{
|
|
1
|
+
export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{findAssistantRecipeGroups,prepareAssistantRecipeUpdates,readAssistantRecipeGroup}from"./assistant-recipe-groups.js";export{ConfiguratorBuilder}from"./configurator-builder.js";export*from"./admin-page-factories.js";export{createInitialPublishedData}from"./create-initial-published-data.js";export{webComponentAttributeParsers,createWebComponentPropertyDescriptor}from"./web-component-property.js";export{createWebComponentEventDescriptor}from"./web-component-event.js";export{standardWebComponentProperties}from"./standard-properties.js";export{standardWebComponentEvents}from"./standard-events.js";export{createGetApplicationWrapperHandler,isGetApplicationWrapperHandler}from"./GetApplicationWrapperHandler.js";export{createGetThemeHandler,GetThemeHandlerName,isGetThemeHandler}from"./GetThemeHandler.js";export{createGetWebComponentOptionsHandler,isGetWebComponentOptionsHandler}from"./GetWebComponentOptions.js";export{createFinalizeAdminDomain}from"./published-data/create-finalize-admin-domain.js";export{FilterPublishedChunksHandlerName,isFilterPublishedChunksHandler}from"./published-data/FilterPublishedChunksHandler.js";export{mapPublishedData}from"./published-data/map-published-data.js";export{flattenTabData,mapDefaultValuesToRecords,mapPublishedChunkedData,SYSTEM_CHUNK_KEY,SYSTEM_CHUNK_SCOPE,SWATCH_DEFINITION}from"./published-data/map-published-chunked-data.js";export{buildLegendRows}from"./published-data/build-legend-data.js";export{formatFieldType,getFieldDescription}from"./published-data/format-field-type.js";export{mapDataToSheet}from"./published-data/map-data-to-sheet.js";export{validateRows}from"./published-data/validate-sheet-data.js";export{createDataRowValidatorHandler,DataRowValidatorHandlerName,isDataRowValidatorHandler}from"./published-data/DataRowValidatorHandler.js";export{createSheetValidatorHandler,SheetValidatorHandlerName,isSheetValidatorHandler}from"./published-data/SheetValidatorHandler.js";export{createMapPublishedRevisionDataHandler,createMapPublishedRevisionDataHandlerFactory,isMapPublishedRevisionDataHandler}from"./published-data/MapPublishedRevisionDataHandler.js";export{createMapPublishedChunkedDataHandler,createMapPublishedChunkedDataHandlerFactory,isMapPublishedChunkedDataHandler}from"./published-data/MapPublishedChunkedDataHandler.js";export*from"./assistant/index.js";
|
|
@@ -16,4 +16,4 @@ export interface DataRowValidatorHandlers {
|
|
|
16
16
|
readonly rowValidator?: DataRowValidator;
|
|
17
17
|
readonly sheetValidator?: SheetDataValidator;
|
|
18
18
|
}
|
|
19
|
-
export declare const mapPublishedChunkedData: <
|
|
19
|
+
export declare const mapPublishedChunkedData: (adminEntities: ReadonlyArray<DomainEntity<string>>, dataSpec: DataSpec, chunksSpec: ChunksSpec, connectedSheetData?: Record<string, readonly SheetTabData[]>, customChunkedData?: ChunkedPublishedData, validators?: DataRowValidatorHandlers) => ChunkedPublishedData;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnyDomainFactory, DomainEntity } from '../../core/index.js';
|
|
2
2
|
import type { DomainRuntime } from '../../domain-runtime/index.js';
|
|
3
|
-
import type { MapPublishedRevisionDataHandlerProps
|
|
4
|
-
|
|
3
|
+
import type { MapPublishedRevisionDataHandlerProps } from './MapPublishedRevisionDataHandler.js';
|
|
4
|
+
/**
|
|
5
|
+
* Finalizes the admin domain and maps its state to the published data of one revision: what the project's
|
|
6
|
+
* handler returns, with the common admin data on top.
|
|
7
|
+
*/
|
|
8
|
+
export declare const mapPublishedData: (adminDomainFactory: AnyDomainFactory, domainRuntime: DomainRuntime, mapPublishedDataHandler: (props: MapPublishedRevisionDataHandlerProps<any, any, any>) => Record<string, unknown>, rootEntityType: string, entities: ReadonlyArray<DomainEntity<string>>) => Record<string, unknown>;
|
|
@@ -11,8 +11,7 @@ import type { ComponentSystemFilterProps, GradualComponentSystemFilter } from '.
|
|
|
11
11
|
type FilterCriterion<KEY extends keyof ComponentSystemFilterProps> = [
|
|
12
12
|
Required<ComponentSystemFilterProps>[KEY]
|
|
13
13
|
] extends [ReadonlyArray<infer ITEM>] ? readonly ITEM[] : Required<ComponentSystemFilterProps>[KEY];
|
|
14
|
-
type
|
|
15
|
-
type CustomOpticAttach<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, $ENTITY extends $DomainEntity<ENTITIES>, COMPONENT_TYPE extends SystemComponentTypeConstraint, CONTEXT_EXTENSION> = (read: CustomOpticRead<ENTITIES, $ENTITY, StateOfComponent<COMPONENT_TYPE>, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, CONTEXT_EXTENSION>, write?: DomainComponentSimpleOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITY, COMPONENT_TYPE, CONTEXT_EXTENSION>['write']) => DomainComponentSimpleOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITY, COMPONENT_TYPE, CONTEXT_EXTENSION>;
|
|
14
|
+
type CustomOpticAttach<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, $ENTITY extends $DomainEntity<ENTITIES>, COMPONENT_TYPE extends SystemComponentTypeConstraint, CONTEXT_EXTENSION> = (read: CustomExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, $ENTITY, StateOfComponent<COMPONENT_TYPE>, CONTEXT_EXTENSION>, write?: DomainComponentSimpleOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITY, COMPONENT_TYPE, CONTEXT_EXTENSION>['write']) => DomainComponentSimpleOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITY, COMPONENT_TYPE, CONTEXT_EXTENSION>;
|
|
16
15
|
export interface DomainComponentSimpleOptic<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, COMPONENT_TYPE extends SystemComponentTypeConstraint, CONTEXT_EXTENSION = unknown> {
|
|
17
16
|
readonly kind: 'simple';
|
|
18
17
|
readonly instanceName: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{withProfilerLabel as i}from"../../utils/profiler-label.js";import{createCustomExpression as n}from"../expression/index.js";let s={navigationStates:void 0,selectedEntityIds:void 0,hoveredEntityIds:void 0,draggedEntityIds:void 0,viewStates:void 0,toolStates:void 0,modes:void 0,roles:void 0,active:void 0,fullscreen:void 0,debug:void 0,viewports:void 0,exportedEntityIds:void 0,exportStates:void 0};export class DomainComponentOpticBuilder{aliasMap;entityTypes;componentType;instanceName;navigationFilters;generated;entityTypeOrAliasNames;constructor(t,e,i,n,s=[],a=!1,o=[]){this.aliasMap=t,this.entityTypes=e,this.componentType=i,this.instanceName=n,this.navigationFilters=s,this.generated=a,this.entityTypeOrAliasNames=o}static from(t){return new DomainComponentOpticBuilder(t,[])}withEntity(t){return new DomainComponentOpticBuilder(this.aliasMap,[...this.entityTypes,t],this.componentType,this.instanceName,this.navigationFilters,this.generated,[...this.entityTypeOrAliasNames,t])}withAlias(t){return new DomainComponentOpticBuilder(this.aliasMap,[...this.entityTypes,...this.aliasMap[t]],this.componentType,this.instanceName,this.navigationFilters,this.generated,[...this.entityTypeOrAliasNames,String(t)])}withComponent(t,e,i=!1){return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,t,e,this.navigationFilters,i,this.entityTypeOrAliasNames)}withFilter(i){if(console.warn(`Component ${this.componentType?.name}#${this.instanceName} on entity ${this.entityTypes.join(", ")} uses a legacy filter with full filter evaluation. This is a suboptimal variant and is deprecated in favor of per-criterion evaluation.
|
|
1
|
+
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{withProfilerLabel as i}from"../../utils/profiler-label.js";import{createCustomExpression as n}from"../expression/index.js";let s={navigationStates:void 0,selectedEntityIds:void 0,hoveredEntityIds:void 0,draggedEntityIds:void 0,viewStates:void 0,toolStates:void 0,modes:void 0,roles:void 0,active:void 0,fullscreen:void 0,debug:void 0,viewports:void 0,exportedEntityIds:void 0,exportStates:void 0},a=(n,s)=>{let a=t(),o=i(s,n.read);return{...n,read:(t,i,n)=>{let s=e(i,a),r=s.get(t);if(r)return r;let l=o(t,i,n);return s.put(t,l),l}}};export class DomainComponentOpticBuilder{aliasMap;entityTypes;componentType;instanceName;navigationFilters;generated;entityTypeOrAliasNames;constructor(t,e,i,n,s=[],a=!1,o=[]){this.aliasMap=t,this.entityTypes=e,this.componentType=i,this.instanceName=n,this.navigationFilters=s,this.generated=a,this.entityTypeOrAliasNames=o}static from(t){return new DomainComponentOpticBuilder(t,[])}withEntity(t){return new DomainComponentOpticBuilder(this.aliasMap,[...this.entityTypes,t],this.componentType,this.instanceName,this.navigationFilters,this.generated,[...this.entityTypeOrAliasNames,t])}withAlias(t){return new DomainComponentOpticBuilder(this.aliasMap,[...this.entityTypes,...this.aliasMap[t]],this.componentType,this.instanceName,this.navigationFilters,this.generated,[...this.entityTypeOrAliasNames,String(t)])}withComponent(t,e,i=!1){return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,t,e,this.navigationFilters,i,this.entityTypeOrAliasNames)}withFilter(i){if(console.warn(`Component ${this.componentType?.name}#${this.instanceName} on entity ${this.entityTypes.join(", ")} uses a legacy filter with full filter evaluation. This is a suboptimal variant and is deprecated in favor of per-criterion evaluation.
|
|
2
2
|
|
|
3
3
|
In your TS files, replace
|
|
4
4
|
withFilter()
|
|
@@ -13,4 +13,4 @@ import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";
|
|
|
13
13
|
active:
|
|
14
14
|
$read: $trueOrFalseExpression
|
|
15
15
|
# ... other eventual criteria
|
|
16
|
-
`),"function"==typeof i){let n=t(),a=t=>({evaluate:(s,a,o)=>{let r=e(a,n),l=r.get(s);if(!l){if(void 0===(l=i(o.domain.get$Entity(s,a),a)))throw Error(`Dynamic filter on component ${this.componentType?.name}.${this.instanceName} on entity ${s} returned 'undefined'. This is likely a bug in the component definition, check whether you are referencing a correct expression or field!`);r.put(s,l)}return"boolean"==typeof l?"active"===t?l:void 0:l[t]},meta:{}});return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{...s,navigationStates:a("navigationStates"),selectedEntityIds:a("selectedEntityIds"),hoveredEntityIds:a("hoveredEntityIds"),draggedEntityIds:a("draggedEntityIds"),viewStates:a("viewStates"),toolStates:a("toolStates"),modes:a("modes"),roles:a("roles"),active:a("active"),fullscreen:a("fullscreen"),debug:a("debug"),viewports:a("viewports")}],this.generated,this.entityTypeOrAliasNames)}return"boolean"==typeof i?new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{...s,active:i}],this.generated,this.entityTypeOrAliasNames):new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{...s,...i}],this.generated,this.entityTypeOrAliasNames)}withGradualFilter(t){let e=t=>"function"==typeof t?n(t,{}):t,i={navigationStates:e(t.navigationStates),selectedEntityIds:e(t.selectedEntityIds),hoveredEntityIds:e(t.hoveredEntityIds),draggedEntityIds:e(t.draggedEntityIds),exportedEntityIds:e(t.exportedEntityIds),viewStates:e(t.viewStates),toolStates:e(t.toolStates),exportStates:e(t.exportStates),modes:e(t.modes),roles:e(t.roles),active:e(t.active),fullscreen:e(t.fullscreen),debug:e(t.debug),viewports:e(t.viewports)};return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,i],this.generated,this.entityTypeOrAliasNames)}validate(){if(!this.componentType||!this.instanceName)throw Error("Use withComponent before attaching");if(!this.entityTypes.length)throw Error("Use withEntity and/or withAlias before attaching")}_getProfilerLabel(){return[...this.entityTypeOrAliasNames,this.componentType.name,this.instanceName].join("_")}attach=(
|
|
16
|
+
`),"function"==typeof i){let n=t(),a=t=>({evaluate:(s,a,o)=>{let r=e(a,n),l=r.get(s);if(!l){if(void 0===(l=i(o.domain.get$Entity(s,a),a)))throw Error(`Dynamic filter on component ${this.componentType?.name}.${this.instanceName} on entity ${s} returned 'undefined'. This is likely a bug in the component definition, check whether you are referencing a correct expression or field!`);r.put(s,l)}return"boolean"==typeof l?"active"===t?l:void 0:l[t]},meta:{}});return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{...s,navigationStates:a("navigationStates"),selectedEntityIds:a("selectedEntityIds"),hoveredEntityIds:a("hoveredEntityIds"),draggedEntityIds:a("draggedEntityIds"),viewStates:a("viewStates"),toolStates:a("toolStates"),modes:a("modes"),roles:a("roles"),active:a("active"),fullscreen:a("fullscreen"),debug:a("debug"),viewports:a("viewports")}],this.generated,this.entityTypeOrAliasNames)}return"boolean"==typeof i?new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{...s,active:i}],this.generated,this.entityTypeOrAliasNames):new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{...s,...i}],this.generated,this.entityTypeOrAliasNames)}withGradualFilter(t){let e=t=>"function"==typeof t?n(t,{}):t,i={navigationStates:e(t.navigationStates),selectedEntityIds:e(t.selectedEntityIds),hoveredEntityIds:e(t.hoveredEntityIds),draggedEntityIds:e(t.draggedEntityIds),exportedEntityIds:e(t.exportedEntityIds),viewStates:e(t.viewStates),toolStates:e(t.toolStates),exportStates:e(t.exportStates),modes:e(t.modes),roles:e(t.roles),active:e(t.active),fullscreen:e(t.fullscreen),debug:e(t.debug),viewports:e(t.viewports)};return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,i],this.generated,this.entityTypeOrAliasNames)}validate(){if(!this.componentType||!this.instanceName)throw Error("Use withComponent before attaching");if(!this.entityTypes.length)throw Error("Use withEntity and/or withAlias before attaching")}_getProfilerLabel(){return[...this.entityTypeOrAliasNames,this.componentType.name,this.instanceName].join("_")}attach=(t,e)=>(this.validate(),a({kind:"simple",entityTypes:new Set(this.entityTypes),componentType:this.componentType,instanceName:this.instanceName,navigationFilters:this.navigationFilters,read:(e,i,n)=>t(n.domain.get$Entity(e,i),i,n),write:e??(()=>({})),generated:this.generated},this._getProfilerLabel()));attachMany=t=>(this.validate(),a({kind:"dynamic",entityTypes:new Set(this.entityTypes),componentType:this.componentType,instanceName:this.instanceName,navigationFilters:this.navigationFilters,read:(e,i,n)=>t(n.domain.get$Entity(e,i),i,n)},this._getProfilerLabel()))}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
-
import type { AnonymousExpression
|
|
2
|
+
import type { AnonymousExpression } from '../expression/index.js';
|
|
3
3
|
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
4
4
|
import type { DomainState } from '../state/index.js';
|
|
5
5
|
import { type Viewport } from './viewport-state-component.js';
|
|
@@ -75,7 +75,20 @@ export interface FilterMismatchReason {
|
|
|
75
75
|
readonly draggedEntityIds?: readonly IdOrWithId[] | IdOrWithId;
|
|
76
76
|
readonly active?: boolean;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
/**
|
|
79
|
+
* A filter as `isComponentActive` reads it: every criterion unset, a value, or an expression that
|
|
80
|
+
* is evaluated with the given id, state and context. A `GradualComponentSystemFilter` is one for
|
|
81
|
+
* the ids, the state and the expression context of its project.
|
|
82
|
+
*/
|
|
83
|
+
type EvaluableComponentSystemFilter<ID, STATE, CONTEXT> = {
|
|
84
|
+
readonly [KEY in keyof Required<ComponentSystemFilterProps>]: undefined | FilterCriterion<KEY> | {
|
|
85
|
+
readonly evaluate: (id: ID, domainState: STATE, context: CONTEXT) => FilterCriterion<KEY> | undefined;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export declare const isComponentActive: <ID, STATE, CONTEXT extends {
|
|
89
|
+
readonly mode: 'owner' | 'read' | 'finalize';
|
|
90
|
+
readonly role: SessionRole;
|
|
91
|
+
}>(filterState: ComponentSystemFilterState, filters: ReadonlyArray<EvaluableComponentSystemFilter<ID, STATE, CONTEXT>>, id: ID, domainState: STATE, context: CONTEXT, reportReason?: boolean) => boolean | readonly FilterMismatchReason[];
|
|
79
92
|
export declare const ComponentSystemFilterPropsSchema: {
|
|
80
93
|
readonly tsType: 'ComponentSystemFilterProps';
|
|
81
94
|
readonly import: [{
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { ExpressionMeta } from './expression.js';
|
|
2
|
+
/**
|
|
3
|
+
* The constant expressions of a domain, keyed by entity type or alias and then by the name of the
|
|
4
|
+
* constant. A constant expression takes no argument: it reads neither the entity nor the state, so
|
|
5
|
+
* the domain of any project accepts it.
|
|
6
|
+
*/
|
|
7
|
+
export type ConstantExpressions = Readonly<Record<string, Readonly<Record<string, {
|
|
8
|
+
evaluate(): unknown;
|
|
9
|
+
readonly meta: ExpressionMeta;
|
|
10
|
+
}>>>>;
|
|
11
|
+
/**
|
|
12
|
+
* Makes the function that turns the constants of a spec into expressions: every constant becomes an
|
|
13
|
+
* expression that returns its value. The type a project reads from a constant is the one its
|
|
14
|
+
* generated model declares for the property, not the type of the expression.
|
|
15
|
+
*/
|
|
16
|
+
export declare const createConstantExpressionFactory: () => (constants: Readonly<Record<string, Readonly<Record<string, unknown>>>>) => ConstantExpressions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { $DomainEntity, DomainEntity,
|
|
1
|
+
import type { $DomainEntity, DomainEntity, DomainEntityId, TypeOrAlias } from '../model/index.js';
|
|
2
2
|
import type { DomainState } from '../state/index.js';
|
|
3
3
|
import type { AliasedExpressions } from './aliased-expressions.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ExpressionMeta, OpenExpressionContext } from './expression.js';
|
|
5
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
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> = {
|
|
7
7
|
[TYPE_OR_ALIAS in keyof $MAP]?: {
|
|
@@ -9,4 +9,17 @@ export type PotentialCustomExpressions<ENTITIES extends DomainEntity<string>, AL
|
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
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>() => (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
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Wraps the function a project writes for an expression or for a filter criterion into an
|
|
14
|
+
* expression: the function receives the entity view of `selfId` instead of the id. It takes the
|
|
15
|
+
* types of the function as they are, so the expression it returns has the state and the context of
|
|
16
|
+
* the function, and it asks of the context only the entity view it reads itself.
|
|
17
|
+
*/
|
|
18
|
+
export declare const createCustomExpression: <SELF, STATE, CONTEXT extends {
|
|
19
|
+
readonly domain: {
|
|
20
|
+
get$Entity(id: DomainEntityId<string>, state: STATE): unknown;
|
|
21
|
+
};
|
|
22
|
+
}, T>(evaluate: (self: SELF, state: STATE, ctx: CONTEXT) => T, meta: ExpressionMeta) => {
|
|
23
|
+
evaluate(selfId: DomainEntityId<string>, state: STATE, ctx: CONTEXT): T;
|
|
24
|
+
readonly meta: ExpressionMeta;
|
|
25
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { I18n } from '@lingui/core';
|
|
2
|
-
import type
|
|
2
|
+
import { type Localizable } from '@salsita-ai/common/utils';
|
|
3
3
|
import type { StateEmission } from '../emission/index.js';
|
|
4
4
|
import type { $DomainEntity, DomainEntity, EntityId } from '../model/index.js';
|
|
5
5
|
/**
|
|
@@ -66,7 +66,55 @@ export declare const ViolationSchema: {
|
|
|
66
66
|
readonly enum: ("fatal" | "fixable" | "notice" | "warning")[];
|
|
67
67
|
};
|
|
68
68
|
readonly message: {
|
|
69
|
-
readonly
|
|
69
|
+
readonly anyOf: [{
|
|
70
|
+
readonly type: 'string';
|
|
71
|
+
}, {
|
|
72
|
+
readonly type: 'object';
|
|
73
|
+
readonly properties: {
|
|
74
|
+
readonly id: {
|
|
75
|
+
readonly type: 'string';
|
|
76
|
+
};
|
|
77
|
+
readonly comment: {
|
|
78
|
+
readonly type: 'string';
|
|
79
|
+
};
|
|
80
|
+
readonly message: {
|
|
81
|
+
readonly type: 'string';
|
|
82
|
+
};
|
|
83
|
+
readonly values: {
|
|
84
|
+
readonly type: 'object';
|
|
85
|
+
readonly additionalProperties: true;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
readonly required: ["id"];
|
|
89
|
+
readonly additionalProperties: false;
|
|
90
|
+
readonly import: [{
|
|
91
|
+
readonly module: '@lingui/core';
|
|
92
|
+
readonly member: 'MessageDescriptor';
|
|
93
|
+
}];
|
|
94
|
+
readonly tsType: 'MessageDescriptor';
|
|
95
|
+
}, {
|
|
96
|
+
readonly import: [{
|
|
97
|
+
readonly module: '@salsita-ai/sdk/common/utils';
|
|
98
|
+
readonly member: 'MultilingualString';
|
|
99
|
+
}];
|
|
100
|
+
readonly tsType: 'MultilingualString';
|
|
101
|
+
readonly type: 'object';
|
|
102
|
+
readonly properties: {
|
|
103
|
+
readonly $lang: {
|
|
104
|
+
readonly type: 'object';
|
|
105
|
+
readonly additionalProperties: {
|
|
106
|
+
readonly type: 'string';
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly required: ["$lang"];
|
|
111
|
+
readonly additionalProperties: false;
|
|
112
|
+
}];
|
|
113
|
+
readonly tsType: 'Localizable';
|
|
114
|
+
readonly import: [{
|
|
115
|
+
readonly module: '@salsita-ai/sdk/common/utils';
|
|
116
|
+
readonly member: 'Localizable';
|
|
117
|
+
}];
|
|
70
118
|
};
|
|
71
119
|
readonly controlViolationPriority: {
|
|
72
120
|
readonly type: 'number';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let
|
|
1
|
+
import{MessageDescriptorSchema as e,MultilingualStringSchema as t}from"@salsita-ai/common/utils";let i=["fatal","fixable","warning","notice"];export const compareSeverity=(e,t)=>i.indexOf(e)-i.indexOf(t);export const ViolationSchema={type:"object",properties:{type:{type:"string"},severity:{enum:i.slice()},message:{anyOf:[{type:"string"},e,t],tsType:"Localizable",import:[{module:"@salsita-ai/sdk/common/utils",member:"Localizable"}]},controlViolationPriority:{type:"number"}},required:["type","severity"],additionalProperties:!1};
|
|
@@ -25,7 +25,7 @@ export declare const VirtualEntityIdSchema: {
|
|
|
25
25
|
};
|
|
26
26
|
export declare const createVirtualEntityId: (name: string) => VirtualEntityId;
|
|
27
27
|
export declare const isVirtualEntityId: (value: EntityId<any>) => value is VirtualEntityId;
|
|
28
|
-
export type DomainEntityId<TYPE extends string> = `${TYPE}-${number}` & {
|
|
28
|
+
export type DomainEntityId<TYPE extends string = string> = `${TYPE}-${number}` & {
|
|
29
29
|
__brand: TYPE;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
@@ -1,55 +1,23 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
export type EntityDefaults<ENTITY extends DomainEntity<string>> = {
|
|
4
|
-
[K in Exclude<keyof ENTITY, 'id' | 'type'>]: ENTITY[K] extends DomainEntityId<any> ? null : ENTITY[K];
|
|
5
|
-
};
|
|
1
|
+
import { type AnyAliasMap, type DomainEntity, type DomainEntityReflection, type EntityByType } from '../model/index.js';
|
|
2
|
+
/** The entity a recipe yields: a whole entity, which the recipe system gives a new id when it cooks the recipe. */
|
|
6
3
|
export type EntityRecipe<ENTITY extends DomainEntity<string>> = ENTITY;
|
|
4
|
+
/** What a project passes to its recipe factory: the entity type, and the properties that differ from the defaults. */
|
|
7
5
|
export type EntityOverrides<ENTITIES extends DomainEntity<string>, TYPE extends ENTITIES['type']> = Partial<Omit<EntityByType<ENTITIES, TYPE>, 'type'>> & {
|
|
8
6
|
type: TYPE;
|
|
9
7
|
};
|
|
10
|
-
|
|
11
|
-
[K in ENTITIES['type']]: EntityDefaults<EntityByType<ENTITIES, K>>;
|
|
12
|
-
};
|
|
13
|
-
type ExpandDefaults<ENTITIES extends DomainEntity<string>, ALIASES extends Readonly<Record<string, ENTITIES>>, ALIASED_DEFAULTS extends Partial<Record<TypeOrAlias<ENTITIES, ALIASES>, Record<string, unknown>>>> = {
|
|
14
|
-
[K in ENTITIES['type']]: ExtractFromAliasedRecord<ENTITIES, ALIASES, ALIASED_DEFAULTS, EventualAlias<ENTITIES, ALIASES, K> | K> extends infer DEFAULTS_FROM_ALIAS ? [
|
|
15
|
-
DEFAULTS_FROM_ALIAS
|
|
16
|
-
] extends [never] ? Record<never, never> : unknown extends UnionToIntersection<DEFAULTS_FROM_ALIAS> ? never : UnionToIntersection<DEFAULTS_FROM_ALIAS> : never;
|
|
17
|
-
};
|
|
18
|
-
export type AliasedEntitiesDefaults<ENTITIES extends DomainEntity<string>, ALIASES extends Readonly<Record<string, ENTITIES>>> = {
|
|
19
|
-
[K in TypeOrAlias<ENTITIES, ALIASES>]?: Partial<EntityDefaults<ExpandAlias<ENTITIES, ALIASES, K>>>;
|
|
20
|
-
};
|
|
8
|
+
/** The function a project creates recipes with, `phx.domain.createRecipe`. */
|
|
21
9
|
export type RecipeFactory<ENTITIES extends DomainEntity<string>> = <TYPE extends ENTITIES['type']>(overrides: EntityOverrides<ENTITIES, TYPE>) => EntityRecipe<EntityByType<ENTITIES, TYPE>>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* ```
|
|
37
|
-
* TS2349: This expression is not callable.
|
|
38
|
-
* Type never has no call signatures.
|
|
39
|
-
* ```
|
|
40
|
-
* simply
|
|
41
|
-
* ```ts
|
|
42
|
-
* .withDefaults({...})
|
|
43
|
-
* ._conflicts.Oven. // <- trigger code-completion here
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
_conflicts: ConflictingDefaults<PROVIDED, EXPECTED>;
|
|
47
|
-
};
|
|
48
|
-
export declare const RecipeFactoryBuilder: {
|
|
49
|
-
forAliases: <ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>>(aliasMap: AliasMap<ALIASES>) => {
|
|
50
|
-
forEntities: (entityReflections: ReadonlyArray<ENTITIES extends any ? DomainEntityReflection<ENTITIES> : never>) => {
|
|
51
|
-
withDefaults: <ALIASED_DEFAULTS extends AliasedEntitiesDefaults<ENTITIES, ALIASES>>(entitiesDefaults: ALIASED_DEFAULTS) => Build<ENTITIES, ExpandDefaults<ENTITIES, ALIASES, ALIASED_DEFAULTS>, DeclaredEntitiesDefaults<ENTITIES>>;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export {};
|
|
10
|
+
/**
|
|
11
|
+
* Creates the recipe factory of a domain from the `defaults` of its spec.
|
|
12
|
+
*
|
|
13
|
+
* Defaults declared for an alias apply to every entity type of the alias, and a later key overrides
|
|
14
|
+
* an earlier one. The defaults of an entity type must be a whole entity of that type: they are
|
|
15
|
+
* validated here against the entity's schema, so a domain with invalid defaults fails when its
|
|
16
|
+
* module loads. An entity type without defaults is not checked.
|
|
17
|
+
*
|
|
18
|
+
* `ENTITIES` is the only type the result depends on, and no argument determines it, so the caller
|
|
19
|
+
* states it.
|
|
20
|
+
*
|
|
21
|
+
* @param defaults Property values by entity type or alias.
|
|
22
|
+
*/
|
|
23
|
+
export declare const createRecipeFactory: <ENTITIES extends DomainEntity<string>>(aliasMap: AnyAliasMap, entityReflections: ReadonlyArray<ENTITIES extends unknown ? DomainEntityReflection<ENTITIES> : never>, defaults: Readonly<Record<string, Readonly<Record<string, unknown>>>>) => RecipeFactory<ENTITIES>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_unsafeBuildDomainEntityId as e,expandAlias as r}from"../model/index.js";export const
|
|
1
|
+
import{_unsafeBuildDomainEntityId as e,expandAlias as r}from"../model/index.js";export const createRecipeFactory=(t,o,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.`)}),r=>({id:e(r.type,1),...a[r.type],...r})};
|
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
import type { ExpressionMeta } from '../expression/index.js';
|
|
2
|
-
import { type
|
|
2
|
+
import { type AnyAliasMap, type DomainEntity, type DomainEntityId } from '../model/index.js';
|
|
3
3
|
import type { DomainState } from '../state/index.js';
|
|
4
|
-
|
|
4
|
+
/** A relation whose related entities are all entities of the target type or alias. */
|
|
5
|
+
export interface AllOfTypeRelation {
|
|
5
6
|
kind: 'allOfType';
|
|
6
|
-
target:
|
|
7
|
-
cardinality: '0-1';
|
|
7
|
+
target: string;
|
|
8
|
+
cardinality: '0-1' | '1-1' | '0-N' | '1-N';
|
|
8
9
|
meta?: ExpressionMeta;
|
|
9
10
|
}
|
|
10
|
-
interface AllOfType1Relation<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, TARGET extends TypeOrAlias<ENTITIES, ALIASES>> {
|
|
11
|
-
kind: 'allOfType';
|
|
12
|
-
target: TARGET;
|
|
13
|
-
cardinality: '1-1';
|
|
14
|
-
meta?: ExpressionMeta;
|
|
15
|
-
}
|
|
16
|
-
interface AllOfTypeNRelation<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, TARGET extends TypeOrAlias<ENTITIES, ALIASES>> {
|
|
17
|
-
kind: 'allOfType';
|
|
18
|
-
target: TARGET;
|
|
19
|
-
cardinality: '0-N' | '1-N';
|
|
20
|
-
meta?: ExpressionMeta;
|
|
21
|
-
}
|
|
22
|
-
export type AllOfTypeRelation<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, TARGET extends TypeOrAlias<ENTITIES, ALIASES>> = AllOfType0Relation<ENTITIES, ALIASES, TARGET> | AllOfType1Relation<ENTITIES, ALIASES, TARGET> | AllOfTypeNRelation<ENTITIES, ALIASES, TARGET>;
|
|
23
11
|
/**
|
|
24
12
|
* Resolves `allOfType` relations from a per-state index. Relations targeting the same set of types
|
|
25
13
|
* share one bucket; the first resolution on a state walks the entities once to fill every bucket,
|
|
26
14
|
* and every later resolution on that state is a lookup. Registration closes once the first state
|
|
27
15
|
* has been indexed, so a bucket can never be missing from an index that was already built.
|
|
28
16
|
*/
|
|
29
|
-
export declare const createAllOfTypeRelation:
|
|
30
|
-
readonly target:
|
|
31
|
-
}) => (_selfId: DomainEntityId<string>, state: DomainState<
|
|
32
|
-
export {};
|
|
17
|
+
export declare const createAllOfTypeRelation: (aliasMap: AnyAliasMap) => (relation: {
|
|
18
|
+
readonly target: string;
|
|
19
|
+
}) => (_selfId: DomainEntityId<string>, state: DomainState<DomainEntity<string>>) => DomainEntityId<string>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expandAlias as e}from"../model/index.js";export const createAllOfTypeRelation=t=>{let r=new Map,a=new WeakMap,n=!1;return o=>{if(n)throw Error(`Cannot register all-of-type relation targeting ${
|
|
1
|
+
import{expandAlias as e}from"../model/index.js";export const createAllOfTypeRelation=t=>{let r=new Map,a=new WeakMap,n=!1;return o=>{if(n)throw Error(`Cannot register all-of-type relation targeting ${o.target} after evaluation started. Create all relation expressions before evaluating the domain state.`);let l=new Set(e(t,o.target)),i=[...l].sort().join("|");return r.set(i,l),(e,t)=>(e=>{let t=a.get(e);if(t)return t;n=!0;let o=new Map([...r.keys()].map(e=>[e,[]]));for(let t of e.entities)for(let[e,a]of r)a.has(t.type)&&o.get(e).push(t.id);return a.set(e,o),o})(t).get(i)}};
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
+
import type { AnyDomain } from '../domain.js';
|
|
1
2
|
import type { ExpressionMeta } from '../expression/index.js';
|
|
2
|
-
import type { DomainEntity,
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
4
|
+
import type { DomainState } from '../state/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* A relation whose related entities are the ones a field of the entity itself references. The
|
|
7
|
+
* application-spec parser checks that `field` is a reference field of the entity that fits the
|
|
8
|
+
* target and the cardinality.
|
|
9
|
+
*/
|
|
10
|
+
export interface DirectRelation {
|
|
6
11
|
kind: 'direct';
|
|
7
|
-
target:
|
|
8
|
-
field:
|
|
9
|
-
cardinality: '0-N' | '1-N';
|
|
12
|
+
target: string;
|
|
13
|
+
field: string;
|
|
14
|
+
cardinality: '0-1' | '1-1' | '0-N' | '1-N';
|
|
10
15
|
meta?: ExpressionMeta;
|
|
11
16
|
}
|
|
12
|
-
|
|
13
|
-
kind: 'direct';
|
|
14
|
-
target: TARGET;
|
|
15
|
-
field: SingleReferenceField<ExpandAlias<ENTITIES, ALIASES, SELF>, ExpandAlias<ENTITIES, ALIASES, TARGET>, never>;
|
|
16
|
-
cardinality: '1-1';
|
|
17
|
-
meta?: ExpressionMeta;
|
|
18
|
-
}
|
|
19
|
-
interface DirectSingle0Relation<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, SELF extends TypeOrAlias<ENTITIES, ALIASES>, TARGET extends TypeOrAlias<ENTITIES, ALIASES>> {
|
|
20
|
-
kind: 'direct';
|
|
21
|
-
target: TARGET;
|
|
22
|
-
field: SingleReferenceField<ExpandAlias<ENTITIES, ALIASES, SELF>, ExpandAlias<ENTITIES, ALIASES, TARGET>, null>;
|
|
23
|
-
cardinality: '0-1';
|
|
24
|
-
meta?: ExpressionMeta;
|
|
25
|
-
}
|
|
26
|
-
export type DirectRelation<ENTITIES extends DomainEntity<string>, ALIASES extends Record<string, ENTITIES>, SELF extends TypeOrAlias<ENTITIES, ALIASES>, TARGET extends TypeOrAlias<ENTITIES, ALIASES>> = DirectArrayRelation<ENTITIES, ALIASES, SELF, TARGET> | DirectSingle1Relation<ENTITIES, ALIASES, SELF, TARGET> | DirectSingle0Relation<ENTITIES, ALIASES, SELF, TARGET>;
|
|
27
|
-
export declare const directRelation: RelationImplementation<'direct'>;
|
|
28
|
-
export {};
|
|
17
|
+
export declare const directRelation: (relation: DirectRelation) => (selfId: DomainEntityId<string>, state: DomainState<DomainEntity<string>>, domain: AnyDomain) => Array<DomainEntityId<string>>;
|