@salsita-ai/sdk 0.50.0-develop.ca5894b56c → 0.50.0-develop.cba048b0d7
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/errors/diagnostic-codes.d.ts +7 -1
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +14 -1
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/implementations/phx-model.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +1 -2
- 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/build-user-bound-optic.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +96 -31
- package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-assistant.d.ts +13 -4
- package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-infra.d.ts +4 -11
- package/dist/application-spec/parse-application-files/merge/merged-transformers.d.ts +2 -4
- package/dist/application-spec/parse-application-files/raw-spec/raw-acl.d.ts +2 -2
- package/dist/application-spec/parse-application-files/raw-spec/raw-acl.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-admin-pages.d.ts +3 -24
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +25 -20
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-resources.d.ts +19 -64
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-pages.d.ts +3 -20
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/states.d.ts +3 -5
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/states.d.ts +3 -8
- package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
- package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
- package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
- package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
- package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
- package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
- package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
- package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
- package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
- package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
- 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.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/invariants/invariant.d.ts +5 -21
- package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +4 -14
- package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +6 -23
- package/dist/application-spec/parse-application-files/spec/sections/app-metadata.d.ts +3 -18
- package/dist/application-spec/parse-application-files/spec/sections/application-version.d.ts +3 -7
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/chunks.d.ts +6 -23
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/custom-data-spec.d.ts +1 -16
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-entry-key.d.ts +3 -9
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-spec.d.ts +1 -10
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/swatch-data-spec.d.ts +1 -14
- package/dist/application-spec/parse-application-files/spec/sections/state-value.d.ts +3 -7
- package/dist/application-spec/parse-application-files/spec/sections/theme.d.ts +3 -10
- package/dist/application-spec/parse-application-files/spec/sections/transformers.d.ts +4 -11
- package/dist/application-spec/parse-application-files/spec/sections/ui.d.ts +3 -12
- package/dist/configurator/ConfiguratorApp.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +19 -3
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +70 -56
- 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.d.ts +15 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
- package/dist/configurator/common/configurator-interface.d.ts +2 -2
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.js +1 -1
- package/dist/configurator/configurator-context/index.d.ts +0 -1
- package/dist/configurator/configurator-context/index.js +1 -1
- package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/tool-chip.d.ts +19 -9
- package/dist/configurator/ui/assistant/tool-chip.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/use-basic-sidebar-footer.js +1 -1
- package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
- package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
- package/dist/docs/drag-and-drop/room-planner.mdx +1 -1
- package/dist/docs/index.json +1 -1
- package/dist/docs/phoenix/configurator-interface.mdx +1 -1
- package/dist/docs/phoenix/layout-slots.mdx +21 -0
- package/dist/docs/phoenix/phoenix-cli.mdx +1 -0
- package/dist/domain/application/application-config.d.ts +6 -24
- package/dist/domain/application/assistant/assistant-manifest.d.ts +13 -3
- package/dist/domain/application/assistant/assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +5 -9
- package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
- package/dist/domain/application/assistant/build-assistant-lenses.js +1 -1
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +3 -3
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -4
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/available-system-components/available-system-components.d.ts +11 -0
- package/dist/domain/available-system-components/available-system-components.js +1 -0
- package/dist/domain/available-system-components/index.d.ts +1 -0
- package/dist/domain/available-system-components/index.js +1 -0
- package/dist/domain/{domain-builder.d.ts → domain-builder/domain-builder.d.ts} +2 -2
- package/dist/domain/domain-builder/domain-builder.js +1 -0
- package/dist/domain/domain-builder/index.d.ts +1 -0
- package/dist/domain/domain-builder/index.js +1 -0
- package/dist/domain/index.d.ts +2 -2
- package/dist/domain/index.js +1 -1
- package/dist/domain/spec/application/admin-pages-section.d.ts +29 -0
- package/dist/domain/spec/application/admin-pages.d.ts +26 -0
- package/dist/domain/spec/application/admin-states.d.ts +5 -0
- package/dist/domain/spec/application/admin-states.js +1 -0
- package/dist/domain/spec/application/configurator-states.d.ts +8 -0
- package/dist/domain/spec/application/configurator-states.js +1 -0
- package/dist/domain/spec/application/index.d.ts +4 -0
- package/dist/domain/spec/components/bindings/index.d.ts +2 -0
- package/dist/domain/spec/components/bindings/index.js +1 -0
- package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
- package/dist/domain/spec/components/bindings/read-binding.js +1 -0
- package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
- package/dist/domain/spec/components/bindings/write-binding.js +1 -0
- package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
- package/dist/domain/spec/components/component-entry.js +1 -0
- package/dist/domain/spec/components/component-filters.d.ts +10 -0
- package/dist/domain/spec/components/component-filters.js +1 -0
- package/dist/domain/spec/components/components.d.ts +4 -0
- package/dist/domain/spec/components/components.js +1 -0
- package/dist/domain/spec/components/index.d.ts +4 -0
- package/dist/domain/spec/{enhanced-json-value.d.ts → enhanced-json/enhanced-json-value.d.ts} +1 -1
- package/dist/domain/spec/enhanced-json/index.d.ts +1 -0
- package/dist/domain/spec/enhanced-json/index.js +1 -0
- package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
- package/dist/domain/spec/expressions/expression.js +1 -0
- package/dist/domain/spec/expressions/expressions.d.ts +27 -0
- package/dist/domain/spec/expressions/expressions.js +1 -0
- package/dist/domain/spec/expressions/index.d.ts +3 -0
- package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
- package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
- package/dist/domain/spec/index.d.ts +3 -1
- package/dist/domain/spec/index.js +1 -1
- package/dist/domain/spec/invariants/index.d.ts +2 -0
- package/dist/domain/spec/invariants/index.js +1 -0
- package/dist/domain/spec/invariants/invariant.d.ts +24 -0
- package/dist/domain/spec/invariants/invariant.js +1 -0
- package/dist/domain/spec/invariants/invariants.d.ts +14 -0
- package/dist/domain/spec/invariants/invariants.js +1 -0
- package/dist/domain/spec/markers/index.d.ts +1 -0
- package/dist/domain/spec/markers/index.js +1 -1
- package/dist/domain/spec/model/defaults.d.ts +1 -1
- package/dist/domain/spec/sections/actions.d.ts +23 -0
- package/dist/domain/spec/sections/actions.js +1 -0
- package/dist/domain/spec/sections/app-metadata.d.ts +18 -0
- package/dist/domain/spec/sections/app-metadata.js +1 -0
- package/dist/domain/spec/sections/application-version.d.ts +7 -0
- package/dist/domain/spec/sections/application-version.js +1 -0
- package/dist/domain/spec/sections/data-spec/chunks.d.ts +23 -0
- package/dist/domain/spec/sections/data-spec/chunks.js +1 -0
- package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.d.ts +16 -0
- package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.js +1 -0
- package/dist/domain/spec/sections/data-spec/data-entry-key.d.ts +9 -0
- package/dist/domain/spec/sections/data-spec/data-entry-key.js +1 -0
- package/dist/domain/spec/sections/data-spec/index.d.ts +5 -0
- package/dist/domain/spec/sections/data-spec/index.js +1 -0
- package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.d.ts +10 -0
- package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.js +1 -0
- package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.d.ts +14 -0
- package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.js +1 -0
- package/dist/domain/spec/sections/index.d.ts +9 -0
- package/dist/domain/spec/sections/index.js +1 -0
- package/dist/domain/spec/sections/infra/acl.d.ts +12 -0
- package/dist/domain/spec/sections/infra/acl.js +1 -0
- package/dist/domain/spec/sections/infra/index.d.ts +3 -0
- package/dist/domain/spec/sections/infra/index.js +1 -0
- package/dist/domain/spec/sections/infra/resource-entry.d.ts +46 -0
- package/dist/domain/spec/sections/infra/resource-entry.js +1 -0
- package/dist/domain/spec/sections/infra/resources-config.d.ts +10 -0
- package/dist/domain/spec/sections/infra/resources-config.js +1 -0
- package/dist/domain/spec/sections/state-value.d.ts +7 -0
- package/dist/domain/spec/sections/state-value.js +1 -0
- package/dist/domain/spec/sections/theme.d.ts +10 -0
- package/dist/domain/spec/sections/theme.js +1 -0
- package/dist/domain/spec/sections/transformers.d.ts +15 -0
- package/dist/domain/spec/sections/transformers.js +1 -0
- package/dist/domain/spec/sections/ui.d.ts +12 -0
- package/dist/domain/spec/sections/ui.js +1 -0
- package/dist/domain/system-definitions.js +1 -1
- package/dist/domain/utils/index.d.ts +2 -0
- package/dist/domain/utils/index.js +1 -0
- package/dist/editor/graphql/GraphQLPanel.js +1 -1
- package/dist/phoenix/services/application-spec-project-watcher.js +1 -1
- package/dist/react-sdk/domain-application-context/ConfigurationPersistSystemFailureHandler.js +1 -1
- package/dist/react-sdk/index.d.ts +2 -0
- package/dist/react-sdk/index.js +1 -1
- package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
- package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
- package/dist/react-sdk/lifecycle-providers/index.d.ts +1 -0
- package/dist/react-sdk/lifecycle-providers/index.js +1 -1
- package/dist/react-sdk/notifications/index.d.ts +1 -0
- package/dist/react-sdk/notifications/index.js +1 -0
- package/dist/react-sdk/notifications/snackbar-action-button.d.ts +30 -0
- package/dist/react-sdk/notifications/snackbar-action-button.js +1 -0
- package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -0
- package/dist/react-sdk/preset-selection/index.d.ts +1 -0
- package/dist/react-sdk/preset-selection/index.js +1 -0
- package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +24 -3
- package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
- package/dist/watch/glob-matcher.d.ts +4 -4
- package/dist/watch/glob-matcher.js +1 -1
- package/dist/watch/watch.d.ts +4 -4
- package/dist/watch/watch.js +1 -1
- package/package.json +3 -3
- package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
- package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
- package/dist/configurator/configurator-context/PresetSelectionProvider.js +0 -1
- package/dist/domain/available-system-components.d.ts +0 -11
- package/dist/domain/available-system-components.js +0 -1
- package/dist/domain/domain-builder.js +0 -1
- /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/application/admin-pages-section.js} +0 -0
- /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/application/admin-pages.js} +0 -0
- /package/dist/domain/spec/{enhanced-json-value.js → enhanced-json/enhanced-json-value.js} +0 -0
- /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
- /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
- /package/dist/{configurator/configurator-context → react-sdk/preset-selection}/PresetSelectionProvider.d.ts +0 -0
package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentReadBinding as ComponentReadBindingData } from '#package/domain';
|
|
2
2
|
import type { ParseContext } from '../../../../core/index.js';
|
|
3
3
|
import type { EntityOrAliasName, InstanceName, ResolvedShape } from '../../model/index.js';
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
* Used for memoEval dependency tracking — the target becomes `self.target` in generated code.
|
|
7
|
-
* Field targets are validated against the entity shape; expression targets ($-prefixed)
|
|
8
|
-
* are accepted without validation (they may be inferred during Phase C).
|
|
9
|
-
*/
|
|
10
|
-
export type ComponentReadBinding = Branded<'ComponentReadBinding', {
|
|
11
|
-
/** The raw target string from `$read` (e.g. "height" or "$price"). */
|
|
12
|
-
readonly target: string;
|
|
13
|
-
/** Whether the target is an expression (starts with `$`) or a shape field. */
|
|
14
|
-
readonly isExpression: boolean;
|
|
15
|
-
}>;
|
|
4
|
+
/** A validated `$read` dependency of a component; see {@link ComponentReadBindingData | ComponentReadBinding} in `domain`. */
|
|
5
|
+
export type ComponentReadBinding = ComponentReadBindingData;
|
|
16
6
|
export interface ComponentReadBindingContext {
|
|
17
7
|
readonly entityKey: EntityOrAliasName;
|
|
18
8
|
readonly componentName: string;
|
package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts
CHANGED
|
@@ -1,42 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AssertionKind, ComponentWriteBinding as ComponentWriteBindingData } from '#package/domain';
|
|
2
2
|
import { type EnhancedJsonSchemaType, type ParseContext } from '../../../../core/index.js';
|
|
3
3
|
import { type EntityOrAliasName, type InstanceName, type ResolvedShape } from '../../model/index.js';
|
|
4
|
-
|
|
5
|
-
* Runtime type assertion to emit in the write callback.
|
|
6
|
-
* Resolved from the target entity field's schema during parsing.
|
|
7
|
-
*/
|
|
8
|
-
export type AssertionKind = {
|
|
9
|
-
readonly kind: 'declaredType';
|
|
10
|
-
readonly typeName: string;
|
|
11
|
-
} | {
|
|
12
|
-
readonly kind: 'declaredTypeId';
|
|
13
|
-
readonly referencedType: string;
|
|
14
|
-
} | {
|
|
15
|
-
readonly kind: 'primitive';
|
|
16
|
-
readonly assertFn: 'assertString' | 'assertNumber' | 'assertBoolean';
|
|
17
|
-
} | {
|
|
18
|
-
readonly kind: 'literal';
|
|
19
|
-
readonly value: null;
|
|
20
|
-
} | {
|
|
21
|
-
readonly kind: 'anyOf';
|
|
22
|
-
readonly assertions: readonly AssertionKind[];
|
|
23
|
-
} | {
|
|
24
|
-
readonly kind: 'none';
|
|
25
|
-
};
|
|
4
|
+
export type { AssertionKind } from '#package/domain';
|
|
26
5
|
/**
|
|
27
6
|
* Resolves the assertion kind from a field's schema.
|
|
28
7
|
* Ported from domain-spec/spec/resolve-assertions.ts.
|
|
29
8
|
*/
|
|
30
9
|
export declare const resolveAssertionKind: (fieldSchema: EnhancedJsonSchemaType) => AssertionKind;
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
* Includes the resolved assertion kind for runtime type checking in the write callback.
|
|
34
|
-
*/
|
|
35
|
-
export type ComponentWriteBinding = Branded<'ComponentWriteBinding', {
|
|
36
|
-
readonly propKey: string;
|
|
37
|
-
readonly entityField: string;
|
|
38
|
-
readonly assertion: AssertionKind;
|
|
39
|
-
}>;
|
|
10
|
+
/** A validated `$write` or `$bind` mapping of a component; see {@link ComponentWriteBindingData | ComponentWriteBinding} in `domain`. */
|
|
11
|
+
export type ComponentWriteBinding = ComponentWriteBindingData;
|
|
40
12
|
export interface ComponentWriteBindingContext {
|
|
41
13
|
readonly entityKey: EntityOrAliasName;
|
|
42
14
|
readonly componentName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
1
|
+
import type { ComponentFilters as ComponentFiltersData } from '#package/domain';
|
|
2
|
+
import { type EnhancedJsonSchemaType, type EnhancedJsonValue } from '../../../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Schema types for each filter criterion, used for expression inference.
|
|
5
5
|
* When `$read: '$expr'` appears in a filter criterion, the expression is
|
|
@@ -7,14 +7,8 @@ import { type ComponentFilter, type EnhancedJsonSchemaType, type EnhancedJsonVal
|
|
|
7
7
|
* infers `$x` as `boolean`).
|
|
8
8
|
*/
|
|
9
9
|
export declare const FILTER_CRITERION_SCHEMAS: Readonly<Record<string, EnhancedJsonSchemaType>>;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
* `ComponentFilter` represents one alternative filter condition; multiple
|
|
13
|
-
* entries arise from `$or`. Empty `items` means no filter is applied.
|
|
14
|
-
*/
|
|
15
|
-
export type ComponentFilters = Branded<'ComponentFilters', {
|
|
16
|
-
readonly items: readonly ComponentFilter[];
|
|
17
|
-
}>;
|
|
10
|
+
/** The validated `$filter` entries of a component instance; see {@link ComponentFiltersData | ComponentFilters} in `domain`. */
|
|
11
|
+
export type ComponentFilters = ComponentFiltersData;
|
|
18
12
|
/**
|
|
19
13
|
* Parses a raw `$filter` value into a {@link ComponentFilters}. The shape is
|
|
20
14
|
* guaranteed by upstream AJV validation against `ComponentSystemFilter` — this
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentEntry, Components as ComponentsData } from '#package/domain';
|
|
2
2
|
import type { ParseContext } from '../../../core/index.js';
|
|
3
3
|
import type { Aliases } from '../model/index.js';
|
|
4
|
-
import type { ComponentEntry } from './component-entry.js';
|
|
5
4
|
import type { UserComponents } from './user-components.js';
|
|
6
|
-
/**
|
|
7
|
-
export type Components =
|
|
5
|
+
/** The merged components of a domain; see {@link ComponentsData | Components} in `domain`. */
|
|
6
|
+
export type Components = ComponentsData;
|
|
8
7
|
interface ComponentsProps {
|
|
9
8
|
readonly userComponents: UserComponents;
|
|
10
9
|
readonly generatedComponents: readonly ComponentEntry[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
export { type ComponentEntry, type ComponentImplementation, type ComponentPropTarget, type CompositeImplementation, type RootReadImplementation, type SdkFactory, type SdkFactoryParam, isComponentPropTarget, } from '#package/domain';
|
|
1
2
|
export * from './bindings/index.js';
|
|
2
|
-
export type * from './component-entry.js';
|
|
3
3
|
export * from './component-filter.js';
|
|
4
|
-
export * from './component-prop-target.js';
|
|
5
4
|
export * from './components.js';
|
|
6
5
|
export * from './sdk-component-entry.js';
|
|
7
6
|
export * from './user-component-entry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{isComponentPropTarget}from"#package/domain";export*from"./bindings/index.js";export*from"./component-filter.js";export*from"./components.js";export*from"./sdk-component-entry.js";export*from"./user-component-entry.js";export*from"./user-components.js";
|
package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ComponentEntry, SdkFactory } from '#package/domain';
|
|
1
2
|
import type { Aliases, EntityOrAliasName, InstanceName } from '../model/index.js';
|
|
2
|
-
import type { ComponentEntry, SdkFactory } from './component-entry.js';
|
|
3
3
|
import type { ComponentFilters } from './component-filter.js';
|
|
4
4
|
interface SdkComponentImplementation {
|
|
5
5
|
readonly kind: 'sdk';
|
package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import type { ComponentEntry, SpecExpression } from '#package/domain';
|
|
1
2
|
import { type EnhancedJsonObject, type ParseContext } from '../../../core/index.js';
|
|
2
3
|
import { type ValueTypeResolution } from '../common/index.js';
|
|
3
4
|
import type { ExpressionRead } from '../expressions/expression-read.js';
|
|
4
|
-
import type { Expression } from '../expressions/expression.js';
|
|
5
5
|
import type { EntityOrAliasName, InstanceName, ResolvedShape } from '../model/index.js';
|
|
6
|
-
import type { ComponentEntry } from './component-entry.js';
|
|
7
6
|
interface UserComponentProps {
|
|
8
7
|
readonly typeOrAlias: EntityOrAliasName;
|
|
9
8
|
readonly instanceName: InstanceName;
|
|
@@ -18,7 +17,7 @@ interface UserComponentContext {
|
|
|
18
17
|
}
|
|
19
18
|
export interface UserComponentResult {
|
|
20
19
|
readonly entry: ComponentEntry;
|
|
21
|
-
readonly inferredExpressions: readonly
|
|
20
|
+
readonly inferredExpressions: readonly SpecExpression[];
|
|
22
21
|
/** Every `$read` of an expression in the instance, with the type expected where it is read. */
|
|
23
22
|
readonly expressionReads: readonly ExpressionRead[];
|
|
24
23
|
}
|
package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Branded as e}from"@salsita-ai/common/utils";import{componentsByName as t}from"#package/domain";import{FILTER_CRITERION_KEYS as n,FILTER_KEY as r,FILTER_OR_KEY as i,READ_MARKER_KEY as o,isEnhancedJsonObject as a,isEvalMarker as
|
|
1
|
+
import{Branded as e}from"@salsita-ai/common/utils";import{componentsByName as t}from"#package/domain";import{FILTER_CRITERION_KEYS as n,FILTER_KEY as r,FILTER_OR_KEY as i,READ_MARKER_KEY as o,isEnhancedJsonObject as a,isEvalMarker as p,isImportRefShaped as m,isRawBindMarker as s,isRawDataRefMarker as d,isRawEvalWriteMarker as l,isRawReadMarker as c,isRawReadWriteMarker as f,navigateSchema as y}from"../../../core/index.js";import{DiagnosticCode as u,diagnosticMessages as g}from"../../../errors/index.js";import{ValueType as N,valueTypeAt as $}from"../common/index.js";import{MemoEvalPlan as O}from"../expressions/index.js";import{ComponentReadBinding as S,ComponentWriteBinding as A,checkReadBindingType as k,componentPath as R,formatComponentPropPath as T,isExpressionReadTarget as b}from"./bindings/index.js";import{ComponentFilters as h,FILTER_CRITERION_SCHEMAS as P}from"./component-filter.js";import{componentStateType as E}from"./component-state-type.js";import{FILTER_CRITERION_TYPE_SCHEMAS as j,ROOT_FILTER_TYPE_SCHEMA as x}from"./filter-criterion-types.js";import{checkStaticEntityId as _}from"./static-entity-id.js";let v=(e,t,n,r)=>{if(null==e||"object"!=typeof e)return void 0!==e&&n.checkStaticValue(e,t),e;if(c(e))return n.addReadBinding(e.$read,t,"$read"),{$target:e.$read};if(d(e))return void r.parsingContext.at(String(r.entityKey),r.componentName,String(r.instanceName),...t.map(String)).error(u.COMPONENT_DATA_REF_UNSUPPORTED,g.COMPONENT_DATA_REF_UNSUPPORTED(String(r.entityKey),r.componentName,String(r.instanceName),T(t),e.$read,e.$data));if(s(e))return n.addReadBinding(e.$bind,t,"$bind"),{$target:e.$bind};if(p(e))return e;if(m(e))return void r.parsingContext.at(String(r.entityKey),r.componentName,String(r.instanceName),...t.map(String)).error(u.COMPONENT_IMPORT_REF_UNSUPPORTED,g.COMPONENT_IMPORT_REF_UNSUPPORTED(String(r.entityKey),r.componentName,String(r.instanceName),T(t),e.$importRef.module,e.$importRef.member));if(Array.isArray(e))return e.map((e,i)=>v(e,[...t,i],n,r)).filter(e=>void 0!==e);let i={};for(let[o,a]of Object.entries(e)){let e=v(a,[...t,o],n,r);void 0!==e&&(i[o]=e)}return i},C=(t,n,r)=>{for(let i of t.items)if("gradual"===i.kind){for(let[t,o]of Object.entries(i))if("kind"!==t&&o?.kind==="dynamic"&&o.target&&b(o.target)){let i=P[t];i&&r.push(e({entityKey:n,name:o.target,schema:i,implementation:{kind:"user"}}))}}},U=(e,t,n,r)=>{if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||null===e)return void _(e,t,n,r);if("object"==typeof e)for(let[i,o]of Object.entries(e)){let a=Array.isArray(e)?Number(i):i;U(o,[...t,a],$(n,[a]),r)}};export const UserComponentEntry=(p,m)=>{let{implementation:d,inferredExpressions:c,expressionReads:T}=((p,m)=>{let d,c=t.get(p.componentName),T=c?.schema,P=new Set,w=[],D=[],I=[],K={entityKey:p.typeOrAlias,componentName:p.componentName,instanceName:p.instanceName,resolvedShape:m.resolvedShape,parsingContext:m.parsingContext},B={entityKey:p.typeOrAlias,componentName:p.componentName,instanceName:p.instanceName,resolvedShape:m.resolvedShape,parsingContext:m.parsingContext},F={...K,typeResolution:m.typeResolution},M=e=>T?$(d??=E(T,m.typeResolution),e):[{kind:"unknown"}],G=[],V=e=>{b(e.target)?G.push({entityKey:p.typeOrAlias,name:e.target,expected:e.expected,location:R(K,e.path)}):k(e,F)},L=(t,n,r)=>{if(V({marker:r,target:t,path:n,expected:M(n)}),!P.has(t)&&(P.add(t),w.push(S(t,K)),b(t)&&T)){let r=((t,n,r,i)=>{let{schema:o,lastDeclaredType:a,pathSinceDeclaredType:p}=y(r,n),m=n=>e({entityKey:i,name:t,schema:n,implementation:{kind:"user"}});if(void 0!==a){let e=p.map(e=>"number"==typeof e?"[number]":`['${e}']`).join("");return m({...o,tsType:`${a.tsType}${e}`,import:a.import})}if(Object.keys(o).length>0)return m(o)})(t,n,T,p.typeOrAlias);r&&I.push(r)}},W={addReadBinding:L,checkStaticValue:(e,t)=>_(e,t,M(t),K)},q=h(p.rawProps[r]);((e,t,o,p)=>{let m=e=>N(e,{...o.typeResolution,author:"sdk"}),s=void 0!==e&&a(e)&&Array.isArray(e[i]);for(let[e,a]of t.items.entries()){let t=s?[r,i,e]:[r];if("root"===a.kind){p({marker:"$read",target:a.target,path:t,expected:m(x)});continue}for(let e of n){let n=a[e],r=[...t,e],i=m(j[e]);n?.kind==="dynamic"?p({marker:"$read",target:n.target,path:r,expected:i}):n?.kind==="static"&&U(n.value,r,i,o)}}})(p.rawProps[r],q,F,V);let z=`${String(p.typeOrAlias)}.${String(p.instanceName)}`;if((e=>{if(!(o in e)||"string"!=typeof e[o])return!1;for(let t of Object.keys(e))if(t!==o&&t!==r)return!1;return!0})(p.rawProps)){let e=p.rawProps[o];return L(e,[],"$read"),C(q,p.typeOrAlias,I),{implementation:{kind:"userBound",filters:q,plan:O({$target:e},z),implementation:{kind:"rootRead",readBinding:w[0]}},inferredExpressions:I,expressionReads:G}}let H={};for(let[e,t]of Object.entries(p.rawProps)){if(e===r)continue;if(s(t)){D.push(A(e,t.$bind,B)),L(t.$bind,[e],"$bind"),H[e]={$target:t.$bind};continue}if(f(t)){L(t.$read,[e],"$read"),D.push(A(e,t.$write,B)),H[e]={$target:t.$read};continue}if(l(t)){D.push(A(e,t.$write,B)),H[e]={$eval:t.$eval};continue}let n=v(t,[e],W,K);void 0!==n&&(H[e]=n)}let J=new Map;for(let e of D){let t=J.get(e.entityField);t?m.parsingContext.error(u.WRITE_BINDING_DUPLICATE_TARGET,g.WRITE_BINDING_DUPLICATE_TARGET(String(p.typeOrAlias),p.componentName,String(p.instanceName),e.entityField,t,e.propKey)):J.set(e.entityField,e.propKey)}return C(q,p.typeOrAlias,I),{implementation:{kind:"userBound",filters:q,plan:O(H,z),implementation:{kind:"composite",resolvedProps:H,readBindings:w,writeBindings:D}},inferredExpressions:I,expressionReads:G}})(p,m);return{entry:e({typeOrAlias:p.typeOrAlias,instanceName:p.instanceName,isAlias:"alias"===m.resolvedShape.kind,componentName:p.componentName,implementation:d}),inferredExpressions:c,expressionReads:T}};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Branded } from '@salsita-ai/common/utils';
|
|
2
|
+
import type { ComponentEntry, SpecExpression } from '#package/domain';
|
|
2
3
|
import type { ParseContext, PhoenixDefinitions } from '../../../core/index.js';
|
|
3
4
|
import type { MergedComponents } from '../../merge/index.js';
|
|
4
5
|
import type { ExpressionRead } from '../expressions/expression-read.js';
|
|
5
|
-
import type { Expression } from '../expressions/expression.js';
|
|
6
6
|
import type { ModelVersion } from '../model/index.js';
|
|
7
|
-
import type { ComponentEntry } from './component-entry.js';
|
|
8
7
|
/** User-declared component entries, flattened from the nested merge map. */
|
|
9
8
|
export type UserComponents = Branded<'UserComponents', readonly ComponentEntry[]>;
|
|
10
9
|
interface UserComponentsContext {
|
|
@@ -14,7 +13,7 @@ interface UserComponentsContext {
|
|
|
14
13
|
}
|
|
15
14
|
interface UserComponentsResult {
|
|
16
15
|
readonly components: UserComponents;
|
|
17
|
-
readonly expressions: readonly
|
|
16
|
+
readonly expressions: readonly SpecExpression[];
|
|
18
17
|
/** Every `$read` of an expression in a component, with the type expected where it is read. */
|
|
19
18
|
readonly expressionReads: readonly ExpressionRead[];
|
|
20
19
|
}
|
package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import type { SpecExpression } from '#package/domain';
|
|
1
2
|
import type { ParseContext } from '../../../core/index.js';
|
|
2
3
|
import type { EntityOrAliasName, ExpressionName, ModelTypeResolution } from '../model/index.js';
|
|
3
4
|
import type { ExpressionRead } from './expression-read.js';
|
|
4
|
-
import type { Expression } from './expression.js';
|
|
5
5
|
/** Where an expression is declared: the spec section and the entity or alias under it. */
|
|
6
6
|
export interface ExpressionLocation {
|
|
7
7
|
readonly section: string;
|
|
8
8
|
readonly entityKey: EntityOrAliasName;
|
|
9
9
|
}
|
|
10
10
|
interface ExpressionReadTypesInput {
|
|
11
|
-
readonly userExpressions: readonly
|
|
11
|
+
readonly userExpressions: readonly SpecExpression[];
|
|
12
12
|
readonly expressionReads: readonly ExpressionRead[];
|
|
13
13
|
/** Finds where a read expression is declared, which is where a conflict is reported. */
|
|
14
14
|
readonly locateDeclaration: (entityKey: EntityOrAliasName, name: ExpressionName) => ExpressionLocation;
|
|
@@ -1,37 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Expressions as ExpressionsData, SpecExpression } from '#package/domain';
|
|
2
2
|
import { type EvalExpressionParser, type ParseContext, type PhoenixDefinitions } from '../../../core/index.js';
|
|
3
3
|
import type { MergedExpressions } from '../../merge/index.js';
|
|
4
|
-
import { type Aliases, type
|
|
4
|
+
import { type Aliases, type EntityTypeName, type ModelVersion } from '../model/index.js';
|
|
5
5
|
import type { ExpressionRead } from './expression-read.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Resolved expressions for a single entity type. Holds the ordered list of
|
|
11
|
-
* shape source keys (entity itself + aliases it belongs to) — codegen appends
|
|
12
|
-
* `"Expressions"` to each key to reference the typed expression group.
|
|
13
|
-
*/
|
|
14
|
-
export type EntityExpressions = Branded<'EntityExpressions', {
|
|
15
|
-
/** Entity/alias keys whose expressions this entity inherits. Codegen appends "Expressions" suffix. */
|
|
16
|
-
readonly shapeGroups: readonly EntityOrAliasName[];
|
|
17
|
-
}>;
|
|
18
|
-
/**
|
|
19
|
-
* Final merged expressions for a domain — user-declared + inferred.
|
|
20
|
-
* The internal `expressions` map groups by entity/alias for codegen/runtime lookups.
|
|
21
|
-
* `entityExpressions` provides per-entity alias expansion.
|
|
22
|
-
* `constants` projects the self-free `constants:` values, grouped like `expressions`;
|
|
23
|
-
* codegen passes them to the enhanced entity/alias reflections so they are readable at
|
|
24
|
-
* module level (`phx.domain.enhancedModel.$Wall.$maxWidth`). A constant whose plan uses
|
|
25
|
-
* `self` needs an instance, so it stays an ordinary value expression and is absent here.
|
|
26
|
-
*/
|
|
27
|
-
export type Expressions = Branded<'Expressions', {
|
|
28
|
-
readonly expressions: ReadonlyMap<EntityOrAliasName, ReadonlyMap<ExpressionName, Expression>>;
|
|
29
|
-
readonly entityExpressions: ReadonlyMap<EntityTypeName, EntityExpressions>;
|
|
30
|
-
readonly constants: ReadonlyMap<EntityOrAliasName, ReadonlyMap<ExpressionName, MemoEvalPlan>>;
|
|
31
|
-
}>;
|
|
6
|
+
export type { EntityExpressions } from '#package/domain';
|
|
7
|
+
export type { ExpressionImplementation, SpecExpression as Expression } from '#package/domain';
|
|
8
|
+
/** The merged expressions of a domain; see {@link ExpressionsData | Expressions} in `domain`. */
|
|
9
|
+
export type Expressions = ExpressionsData;
|
|
32
10
|
interface ExpressionsProps {
|
|
33
11
|
readonly rawExpressions: MergedExpressions;
|
|
34
|
-
readonly inferredExpressions: readonly
|
|
12
|
+
readonly inferredExpressions: readonly SpecExpression[];
|
|
35
13
|
/** The `$read`s of expressions in components, whose expected types the expressions must share. */
|
|
36
14
|
readonly expressionReads: readonly ExpressionRead[];
|
|
37
15
|
}
|
|
@@ -1,74 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
/**
|
|
6
|
-
* A single entry in the memoEval deps array.
|
|
7
|
-
*
|
|
8
|
-
* - `'eval'` — a `$eval` code fragment. At deps-build time the fragment is
|
|
9
|
-
* evaluated under `self` (`new Function('self', …)` at runtime, spliced
|
|
10
|
-
* verbatim under `self => [...]` in codegen). `label` annotates codegen
|
|
11
|
-
* output (e.g. `/* $eval: Entity.instance *\/`).
|
|
12
|
-
* - `'read'` — a read binding that resolves to `self[target]` at deps-build
|
|
13
|
-
* time.
|
|
14
|
-
*/
|
|
15
|
-
export type MemoEvalDep = Branded<'MemoEvalDep', {
|
|
16
|
-
readonly kind: 'eval';
|
|
17
|
-
readonly code: string;
|
|
18
|
-
readonly label: string;
|
|
19
|
-
} | {
|
|
20
|
-
readonly kind: 'read';
|
|
21
|
-
readonly target: string;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Tree of values with slots referencing entries in the plan's `deps` array.
|
|
25
|
-
* Generated by codegen as a JS literal with params spliced in, or by runtime
|
|
26
|
-
* by walking and substituting from the `deps`-materialised values array.
|
|
27
|
-
*/
|
|
28
|
-
export type MemoEvalTemplate = Branded<'MemoEvalTemplate', {
|
|
29
|
-
readonly kind: 'literal';
|
|
30
|
-
readonly value: MemoEvalLiteral;
|
|
31
|
-
} | {
|
|
32
|
-
readonly kind: 'msg';
|
|
33
|
-
readonly marker: MsgMarker;
|
|
34
|
-
} | {
|
|
35
|
-
readonly kind: 'slot';
|
|
36
|
-
readonly depIndex: number;
|
|
37
|
-
} | {
|
|
38
|
-
readonly kind: 'array';
|
|
39
|
-
readonly items: readonly MemoEvalTemplate[];
|
|
40
|
-
} | {
|
|
41
|
-
readonly kind: 'object';
|
|
42
|
-
readonly entries: ReadonlyArray<readonly [string, MemoEvalTemplate]>;
|
|
43
|
-
}>;
|
|
44
|
-
export type MemoEvalPlanInput = MemoEvalLiteral | EvalMarker | MsgMarker | ComponentPropTarget | MemoEvalPlanInputArray | MemoEvalPlanInputObject;
|
|
45
|
-
export interface MemoEvalPlanInputArray extends ReadonlyArray<MemoEvalPlanInput> {
|
|
46
|
-
}
|
|
47
|
-
export interface MemoEvalPlanInputObject {
|
|
48
|
-
readonly [key: string]: MemoEvalPlanInput;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Normalized plan for producing a memoized reader from a tree containing
|
|
52
|
-
* `$eval`, `$target`, `$msg`, and literal nodes. Built once during spec
|
|
53
|
-
* parsing; codegen + runtime both generate from the same plan so their outputs
|
|
54
|
-
* cannot drift.
|
|
55
|
-
*
|
|
56
|
-
* - `deps` — ordered evaluation slots in first-seen walk order. Each slot
|
|
57
|
-
* dedupes (`$eval` by trimmed code, `$target` by name) so a repeated marker
|
|
58
|
-
* shares one dep.
|
|
59
|
-
* - `template` — rebuilt value tree with `slot { depIndex }` nodes in place
|
|
60
|
-
* of the consumed markers.
|
|
61
|
-
* - `usesSelf` — true when deps collection must receive `self`, either
|
|
62
|
-
* because a read dep exists or because an eval dep references `self`.
|
|
63
|
-
*
|
|
64
|
-
* When `deps` is empty the tree is fully static — generators cache
|
|
65
|
-
* non-primitive templates and keep primitive literals as bare thunks.
|
|
66
|
-
*/
|
|
67
|
-
export type MemoEvalPlan = Branded<'MemoEvalPlan', {
|
|
68
|
-
readonly deps: readonly MemoEvalDep[];
|
|
69
|
-
readonly template: MemoEvalTemplate;
|
|
70
|
-
readonly usesSelf: boolean;
|
|
71
|
-
}>;
|
|
1
|
+
import { type MemoEvalPlan as MemoEvalPlanData, type MemoEvalPlanInput } from '#package/domain';
|
|
2
|
+
export type { MemoEvalLiteral, MemoEvalDep, MemoEvalTemplate, MemoEvalPlanInput, MemoEvalPlanInputArray, MemoEvalPlanInputObject, } from '#package/domain';
|
|
3
|
+
/** The plan a memoized reader is built from; see {@link MemoEvalPlanData | MemoEvalPlan} in `domain`. */
|
|
4
|
+
export type MemoEvalPlan = MemoEvalPlanData;
|
|
72
5
|
/**
|
|
73
6
|
* Builds a {@link MemoEvalPlan} from a value tree that may contain `$eval`,
|
|
74
7
|
* `$target`, and `$msg` markers. Called during spec parsing from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Branded as e}from"@salsita-ai/common/utils";import{isEvalMarker as
|
|
1
|
+
import{Branded as e}from"@salsita-ai/common/utils";import{isComponentPropTarget as r}from"#package/domain";import{isEvalMarker as t,isMsgMarker as n}from"../../../core/index.js";import{evalCodeUsesSelf as o}from"../../../enhanced-json/eval-code-uses-self.js";let l=(e,r)=>0===r.length?e:`${e}.${r.join(".")}`,i=(o,a,d,u)=>{if(void 0===o)throw Error(`MemoEvalPlan: found undefined at ${l(d,u)}, undefined cannot be generated, remove the property or use null.`);if(t(o)){let r=((r,t,n)=>{let o=t.trim();for(let e=0;e<r.length;e++){let t=r[e];if("eval"===t.kind&&t.code===o)return e}return r.push(e({kind:"eval",code:o,label:n})),r.length-1})(a,o.$eval,d);return e({kind:"slot",depIndex:r})}if(r(o)){let r=((r,t)=>{for(let e=0;e<r.length;e++){let n=r[e];if("read"===n.kind&&n.target===t)return e}return r.push(e({kind:"read",target:t})),r.length-1})(a,o.$target);return e({kind:"slot",depIndex:r})}if(n(o))return e({kind:"msg",marker:o});if(null===o||"object"!=typeof o)return e({kind:"literal",value:o});if(Array.isArray(o))return e({kind:"array",items:o.map((e,r)=>i(e,a,d,[...u,String(r)]))});if("object"!=typeof o||null===o)throw Error(`MemoEvalPlan: found unsupported value at ${l(d,u)}, remove it or use null.`);let f=[];for(let e in o){let r=o[e];f.push([e,i(r,a,d,[...u,e])])}return e({kind:"object",entries:f})};export const MemoEvalPlan=(r,t)=>{let n=[],l=i(r,n,t,[]),a=n.some(e=>"read"===e.kind||o(e.code));return e({deps:n,template:l,usesSelf:a})};
|
package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { SpecExpression } from '#package/domain';
|
|
1
2
|
import { type EvalExpressionParser, type ParseContext } from '../../../core/index.js';
|
|
2
3
|
import type { MergedExpressions } from '../../merge/index.js';
|
|
3
4
|
import type { ModelTypeResolution, ModelVersion } from '../model/index.js';
|
|
4
|
-
import type { Expression } from './expression.js';
|
|
5
5
|
/**
|
|
6
6
|
* Validates user-declared expressions from merged YAML.
|
|
7
7
|
*
|
|
@@ -19,5 +19,5 @@ interface UserExpressionsContext {
|
|
|
19
19
|
readonly typeResolution: ModelTypeResolution;
|
|
20
20
|
readonly parsingContext: ParseContext;
|
|
21
21
|
}
|
|
22
|
-
export declare const UserExpressions: (rawExpressions: MergedExpressions, context: UserExpressionsContext) => readonly
|
|
22
|
+
export declare const UserExpressions: (rawExpressions: MergedExpressions, context: UserExpressionsContext) => readonly SpecExpression[] | undefined;
|
|
23
23
|
export {};
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import type { SpecInvariant } from '#package/domain';
|
|
2
|
+
import type { ParseContext } from '../../../core/index.js';
|
|
3
3
|
import type { RawInvariantEntry } from '../../raw-spec/index.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type StaticInvariant = Branded<'StaticInvariant', {
|
|
8
|
-
readonly kind: 'static';
|
|
9
|
-
readonly name: InvariantName;
|
|
10
|
-
readonly violationType: ViolationTypeName;
|
|
11
|
-
readonly severity: InvariantSeverity;
|
|
12
|
-
readonly message: string | MsgMarker;
|
|
13
|
-
readonly controlViolationPriority?: number;
|
|
14
|
-
}>;
|
|
15
|
-
/** A YAML invariant whose implementation may return any of the declared violation types. */
|
|
16
|
-
export type DynamicInvariant = Branded<'DynamicInvariant', {
|
|
17
|
-
readonly kind: 'dynamic';
|
|
18
|
-
readonly name: InvariantName;
|
|
19
|
-
readonly violationTypes: readonly ViolationTypeName[];
|
|
20
|
-
}>;
|
|
21
|
-
/** A validated static or dynamic invariant declaration. */
|
|
22
|
-
export type Invariant = StaticInvariant | DynamicInvariant;
|
|
4
|
+
export type { InvariantSeverity, StaticInvariant, DynamicInvariant } from '#package/domain';
|
|
5
|
+
/** A validated static or dynamic invariant declaration; see {@link SpecInvariant} in `domain`. */
|
|
6
|
+
export type Invariant = SpecInvariant;
|
|
23
7
|
export declare const Invariant: (rawName: string, entry: RawInvariantEntry, ctx: ParseContext) => Invariant | undefined;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Invariants as InvariantsData } from '#package/domain';
|
|
2
2
|
import type { ParseContext, PhoenixDefinitions } from '../../../core/index.js';
|
|
3
3
|
import type { MergedComponents, MergedExpressions, MergedInvariants, MergedRelations } from '../../merge/index.js';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { Invariant } from './invariant.js';
|
|
8
|
-
/**
|
|
9
|
-
* Validated invariants and the expressions/components they contribute to the application spec.
|
|
10
|
-
* Entries retain their entity-or-alias declaration keys while artifacts expand to concrete entity types.
|
|
11
|
-
*/
|
|
12
|
-
export type Invariants = Branded<'Invariants', {
|
|
13
|
-
readonly entries: Readonly<Record<EntityOrAliasName, Readonly<Record<InvariantName, Invariant>>>>;
|
|
14
|
-
readonly expressions: readonly Expression[];
|
|
15
|
-
readonly components: readonly ComponentEntry[];
|
|
16
|
-
}>;
|
|
4
|
+
import type { ModelVersion } from '../model/index.js';
|
|
5
|
+
/** The validated invariants of a domain; see {@link InvariantsData | Invariants} in `domain`. */
|
|
6
|
+
export type Invariants = InvariantsData;
|
|
17
7
|
interface InvariantsProps {
|
|
18
8
|
readonly rawInvariants: MergedInvariants;
|
|
19
9
|
readonly rawExpressions: MergedExpressions;
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
1
|
+
import type { Actions as ActionsData } from '#package/domain';
|
|
2
|
+
import { type ParseContext, type PhoenixDefinitions } from '../../../core/index.js';
|
|
3
3
|
import type { MergedActions } from '../../merge/index.js';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly required: boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* One validated action declaration. `params` and `result` keep the enhanced schemas for codegen and
|
|
12
|
-
* for consumers that expose the action; `paramsSchema` is the AJV-ready object schema of the parameters, with the
|
|
13
|
-
* refs resolved into `$defs`, which the action system validates the arguments of a call against.
|
|
14
|
-
*/
|
|
15
|
-
export type Action = Branded<'Action', {
|
|
16
|
-
readonly name: ActionName;
|
|
17
|
-
readonly description?: string;
|
|
18
|
-
readonly params: Readonly<Record<string, ActionParam>>;
|
|
19
|
-
readonly result: Readonly<Record<string, EnhancedJsonSchemaType>>;
|
|
20
|
-
readonly paramsSchema: JsonSchema;
|
|
21
|
-
}>;
|
|
22
|
-
/** The validated `actions` section: every declared action by name, in declaration order; empty when the spec declares none. */
|
|
23
|
-
export type Actions = Branded<'Actions', ReadonlyMap<ActionName, Action>>;
|
|
4
|
+
import { type ModelVersion } from '../model/index.js';
|
|
5
|
+
export type { ActionParam, Action } from '#package/domain';
|
|
6
|
+
/** The validated `actions` section by action name; see {@link ActionsData | Actions} in `domain`. */
|
|
7
|
+
export type Actions = ActionsData;
|
|
24
8
|
interface ActionsContext {
|
|
25
9
|
readonly latestModel: ModelVersion;
|
|
26
10
|
readonly phxDefinitions: PhoenixDefinitions;
|
|
@@ -32,4 +16,3 @@ interface ActionsContext {
|
|
|
32
16
|
* invalid, so nothing downstream builds on a partial list.
|
|
33
17
|
*/
|
|
34
18
|
export declare const Actions: (merged: MergedActions, context: ActionsContext, ctx: ParseContext) => Actions | undefined;
|
|
35
|
-
export {};
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AppMetadata as AppMetadataData } from '#package/domain';
|
|
2
2
|
import type { ParseContext } from '../../../core/index.js';
|
|
3
3
|
import type { MergedAppMetadata } from '../../merge/index.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Validated application metadata — version, auth, infrastructure settings.
|
|
7
|
-
* Used by codegen for ApplicationVersion export and builder chain methods.
|
|
8
|
-
*/
|
|
9
|
-
export type AppMetadata = Branded<'AppMetadata', {
|
|
10
|
-
readonly applicationVersion: ApplicationVersion;
|
|
11
|
-
readonly workspace: boolean;
|
|
12
|
-
readonly webComponentTag: string | undefined;
|
|
13
|
-
readonly pageTitle: string | undefined;
|
|
14
|
-
readonly useAuthHook: boolean;
|
|
15
|
-
readonly useClerk: boolean;
|
|
16
|
-
readonly enableAdminRelease: boolean;
|
|
17
|
-
readonly jsonSchemaValidator: 'ajv' | 'csp-compatible';
|
|
18
|
-
readonly gltfDecoder: 'js' | 'wasm';
|
|
19
|
-
readonly collectFinalizeData: boolean;
|
|
20
|
-
}>;
|
|
4
|
+
/** The validated application metadata; see {@link AppMetadataData | AppMetadata} in `domain`. */
|
|
5
|
+
export type AppMetadata = AppMetadataData;
|
|
21
6
|
export declare const AppMetadata: (merged: MergedAppMetadata, ctx: ParseContext) => AppMetadata | undefined;
|
package/dist/application-spec/parse-application-files/spec/sections/application-version.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ApplicationVersion as ApplicationVersionData } from '#package/domain';
|
|
2
2
|
import type { ParseContext } from '../../../core/index.js';
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
* Exported by codegen as the `ApplicationVersion` constant and stored as
|
|
6
|
-
* `applicationVersion` on the deployment record.
|
|
7
|
-
*/
|
|
8
|
-
export type ApplicationVersion = Branded<'ApplicationVersion', string>;
|
|
3
|
+
/** The semantic version of the application; see {@link ApplicationVersionData | ApplicationVersion} in `domain`. */
|
|
4
|
+
export type ApplicationVersion = ApplicationVersionData;
|
|
9
5
|
export declare const ApplicationVersion: (version: string, ctx: ParseContext) => ApplicationVersion | undefined;
|