@salsita-ai/sdk 0.50.0-develop.bfba230ad7 → 0.50.0-develop.d81d7591c5
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/generate-application/code/common/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/common/index.js +1 -1
- package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
- package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -16
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +4 -4
- package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -2
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +8 -4
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +4 -3
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -8
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +9 -43
- 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-server-settings.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -21
- package/dist/client/phoenix-api.d.ts +58 -30
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +15 -3
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/tool-chip.d.ts +8 -1
- package/dist/configurator/ui/assistant/tool-chip.js +1 -1
- package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +84 -98
- package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
- package/dist/docs/index.json +1 -1
- package/dist/docs/layouts/custom-price.mdx +14 -16
- package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
- package/dist/docs/other-features/domain-actions.mdx +1 -1
- package/dist/docs/other-features/side-effects.mdx +42 -34
- package/dist/docs/other-features/transformers.mdx +1 -1
- package/dist/docs/phoenix/admin.mdx +9 -24
- package/dist/docs/phoenix/localization.mdx +3 -22
- package/dist/docs/phoenix/project-structure.mdx +6 -0
- package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
- package/dist/docs/relations/hierarchy.mdx +13 -2
- package/dist/domain/actions/action-factory.d.ts +3 -2
- package/dist/domain/application/application-config.d.ts +25 -75
- package/dist/domain/application/assistant/assistant-manifest.d.ts +61 -0
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +95 -0
- package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
- package/dist/domain/application/assistant/assistant-value-type.js +1 -0
- package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
- package/dist/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.d.ts +3 -3
- package/dist/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +4 -0
- package/dist/domain/application/assistant/index.js +1 -0
- package/dist/domain/application/assistant-field-options.d.ts +1 -1
- package/dist/domain/application/assistant-mutations.d.ts +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +1 -1
- package/dist/domain/application/configurator-builder.d.ts +33 -18
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/element-registration.d.ts +5 -0
- package/dist/domain/application/element-registration.js +1 -1
- package/dist/domain/application/handler-registration.d.ts +5 -0
- package/dist/domain/application/handler-registration.js +1 -1
- package/dist/domain/application/index.d.ts +5 -4
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/resolve-imported-transformers.d.ts +11 -1
- package/dist/domain/application/resolve-imported-transformers.js +1 -1
- package/dist/domain/components/domain-component-optic.d.ts +3 -0
- package/dist/domain/components/domain-component-optic.js +2 -2
- package/dist/domain/components/system-component-builder.js +1 -1
- package/dist/domain/core/action.d.ts +1 -1
- package/dist/domain/core/component.d.ts +1 -1
- package/dist/domain/core/decoder/create-decoder.d.ts +6 -0
- package/dist/domain/core/decoder/create-decoder.js +1 -0
- package/dist/domain/core/decoder/decoder.d.ts +6 -0
- package/dist/domain/core/decoder/decoder.js +1 -0
- package/dist/domain/core/decoder/index.d.ts +2 -0
- package/dist/domain/core/decoder/index.js +1 -0
- package/dist/domain/core/domain-factory.js +1 -1
- package/dist/domain/core/index.d.ts +1 -3
- package/dist/domain/core/index.js +1 -1
- package/dist/domain/core/reflection.d.ts +1 -1
- package/dist/domain/core/reflection.js +1 -1
- package/dist/domain/core/schema/enhanced-json-schema.js +1 -0
- package/dist/domain/core/schema/extended-schema-validator.js +1 -0
- package/dist/domain/core/schema/index.d.ts +3 -0
- package/dist/domain/core/schema/index.js +1 -0
- package/dist/domain/core/schema/schema-validator.js +1 -0
- package/dist/domain/domain-builder.d.ts +10 -1
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.js +1 -1
- package/dist/domain/domain-context/transformers/chain-builder.d.ts +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +4 -4
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +3 -3
- package/dist/domain/index.d.ts +3 -2
- package/dist/domain/index.js +1 -1
- package/dist/domain/invariants/invariants.d.ts +9 -0
- package/dist/domain/invariants/invariants.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +3 -3
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/project-modules/index.d.ts +1 -0
- package/dist/domain/project-modules/index.js +1 -0
- package/dist/domain/project-modules/project-modules.d.ts +41 -0
- package/dist/domain/project-modules/project-modules.js +1 -0
- package/dist/domain/system-components/common/dimension-indicator-schema.d.ts +1 -1
- package/dist/domain/system-components/common/dimension-indicator-schema.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +7 -6
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-cli/gen/configurator-builder.js +21 -8
- package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
- package/dist/legacy/domain-cli/utils/cache.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -19
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +15 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +22 -23
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +15 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
- package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +4 -3
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
- package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
- package/dist/phoenix/services/prepare-development-environment.js +1 -1
- package/dist/phoenix/services/variant-file-session.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
- package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +4 -4
- package/dist/webhook/builders/common.d.ts +3 -0
- package/dist/webhook/builders/webhook-builder.d.ts +1 -1
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +3 -3
- package/dist/domain/core/json-schema.js +0 -1
- /package/dist/domain/{core/enhanced-json-schema.js → application/assistant/assistant-manifest.js} +0 -0
- /package/dist/domain/{core/schema-validator.js → application/assistant/assistant-resolved-manifest.js} +0 -0
- /package/dist/domain/core/{schema-validator-ajv.d.ts → schema/create-ajv-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-ajv.js → schema/create-ajv-schema-validator.js} +0 -0
- /package/dist/domain/core/{schema-validator-csp.d.ts → schema/create-csp-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-csp.js → schema/create-csp-schema-validator.js} +0 -0
- /package/dist/domain/core/{enhanced-json-schema.d.ts → schema/enhanced-json-schema.d.ts} +0 -0
- /package/dist/domain/core/{json-schema.d.ts → schema/extended-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator.d.ts → schema/schema-validator.d.ts} +0 -0
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { $DomainEntity, DomainEntity } from '../core/model.js';
|
|
2
2
|
import type { DomainContextSystems } from '../domain-context/domain-context-systems.js';
|
|
3
3
|
import type { Transformers } from '../domain-context/store-system/store-system.js';
|
|
4
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
4
5
|
import type { ImportedTransformer, SpecTransformer } from './application-config.js';
|
|
6
|
+
type AnyImportedTransformer = ImportedTransformer<any, any, any, any, any, any, any>;
|
|
7
|
+
/**
|
|
8
|
+
* The transformer of one `src/transformers/` file, named after the file. The spec's `transformers` section
|
|
9
|
+
* selects a plain-function export by that name; a transformer made with `build(name)` registers under its own.
|
|
10
|
+
*/
|
|
11
|
+
export declare const resolveTransformerModule: (module: ProjectModule) => AnyImportedTransformer;
|
|
12
|
+
/** Validates the `src/transformers/` files of an application config and names each after its file. */
|
|
13
|
+
export declare const resolveTransformerModules: (modules: readonly ProjectModule[]) => readonly AnyImportedTransformer[];
|
|
5
14
|
/**
|
|
6
15
|
* Resolves imported transformer modules against spec transformer declarations.
|
|
7
16
|
* Each imported transformer is registered/executed with the domain context,
|
|
8
17
|
* then matched by name against spec entries to apply priority ordering.
|
|
9
18
|
*
|
|
10
|
-
* Used both
|
|
19
|
+
* Used both when the runtime spec is initialized from the application config and at hot-reload time
|
|
11
20
|
* (via domain-context subscription to registry changes).
|
|
12
21
|
*/
|
|
13
22
|
export declare const resolveImportedTransformers: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string>(importedTransformers: ReadonlyArray<ImportedTransformer<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>>, specTransformers: readonly SpecTransformer[], ctx: DomainContextSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>) => Transformers<ENTITIES>;
|
|
23
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const resolveImportedTransformers=(r,e,t)=>{let o=r.flatMap(({name:r,transformer:e})=>{if(Array.isArray(e))return e.map((e,o)=>{if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:`${r}[${o}]`};throw Error(`Transformer '${r}[${o}]' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)});if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:r};throw Error(`Transformer '${r}' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)}),n=[];for(let r of e){let e=o.find(e=>e.name===r.name);if(!e){let e=o.map(r=>r.name).filter(Boolean).join(", ");throw Error(`Transformer '${r.name}' not found in imported transformer files. Available transformers: ${e||"none"}`)}n.push({priority:r.priority??1/0,transformer:e.transformer,name:r.name})}return n};
|
|
1
|
+
import{SHARED_FOLDER_HINT as r,createContractError as e,isRecord as t}from"../project-modules/index.js";let o={expected:"a transformer (a function of the domain context, or an object with a register method), or an array of them",fix:`Create it with phx.frontend.transformerBuilder, ${r}.`},n=r=>"function"==typeof r||t(r)&&"function"==typeof r.register;export const resolveTransformerModule=r=>{let t;if(!(Array.isArray(t=r.exports)?t.every(n):n(t)))throw e(r.origin,o,r.exports);return{name:r.origin.replace(/^.*\//,"").replace(/\.tsx?$/,""),transformer:r.exports}};export const resolveTransformerModules=r=>r.map(resolveTransformerModule);export const resolveImportedTransformers=(r,e,t)=>{let o=r.flatMap(({name:r,transformer:e})=>{if(Array.isArray(e))return e.map((e,o)=>{if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:`${r}[${o}]`};throw Error(`Transformer '${r}[${o}]' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)});if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:r};throw Error(`Transformer '${r}' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)}),n=[];for(let r of e){let e=o.find(e=>e.name===r.name);if(!e){let e=o.map(r=>r.name).filter(Boolean).join(", ");throw Error(`Transformer '${r.name}' not found in imported transformer files. Available transformers: ${e||"none"}`)}n.push({priority:r.priority??1/0,transformer:e.transformer,name:r.name})}return n};
|
|
@@ -5,6 +5,7 @@ import type { ExpressionContext } from '../core/expression.js';
|
|
|
5
5
|
import type { $DomainEntity, DomainEntity, EntityByType } from '../core/model.js';
|
|
6
6
|
import type { DomainState } from '../core/state.js';
|
|
7
7
|
import type { CustomExpression } from '../expressions/custom-expression.js';
|
|
8
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
8
9
|
import { type ComponentSystemFilter, type NavigationFilterOptic } from './legacy-filter.js';
|
|
9
10
|
import type { GradualComponentSystemFilter, IdOrWithId } from './system-component-filter.js';
|
|
10
11
|
import type { Viewport } from './viewport-state-component.js';
|
|
@@ -33,6 +34,8 @@ export interface DomainComponentDynamicOptic<ENTITIES extends DomainEntity<strin
|
|
|
33
34
|
}
|
|
34
35
|
export type DomainComponentOptic<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> = DomainComponentSimpleOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITY, COMPONENT_TYPE> | DomainComponentDynamicOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, COMPONENT_TYPE>;
|
|
35
36
|
export type AnyDomainComponentOptic = DomainComponentOptic<any, any, any, any, any, any, any>;
|
|
37
|
+
/** Validates the `src/components/` files, or the optics a generated file lists, and flattens them. */
|
|
38
|
+
export declare const resolveComponentOpticModules: (modules: readonly ProjectModule[]) => readonly AnyDomainComponentOptic[];
|
|
36
39
|
export declare class DomainComponentOpticBuilder<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, ENTITY extends ENTITIES, $ENTITY extends $DomainEntity<ENTITIES>, COMPONENT_TYPE extends SystemComponentTypeConstraint> {
|
|
37
40
|
private readonly aliasMap;
|
|
38
41
|
private readonly entityTypes;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{createCustomExpression as i}from"../expressions/custom-expression.js";import{
|
|
1
|
+
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{createCustomExpression as i}from"../expressions/custom-expression.js";import{SHARED_FOLDER_HINT as n,isRecord as s,resolveListModule as a}from"../project-modules/index.js";import{withProfilerLabel as o}from"../utils/profiler-label.js";let r={expected:"an attached component, or an array of them",fix:`Create it with phx.domain.attachComponent(...) (phx.domain.admin.attachComponent(...) under src/admin/), ${n}.`},d=t=>s(t)&&("simple"===t.kind||"dynamic"===t.kind)&&"string"==typeof t.instanceName&&"function"==typeof t.read;export const resolveComponentOpticModules=t=>t.flatMap(t=>a(t,r,d));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(),s=t=>({evaluate:(s,a,o)=>{let r=e(a,n),d=r.get(s);if(!d){if(void 0===(d=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,d)}return"boolean"==typeof d?"active"===t?d:void 0:d[t]},meta:{}});return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{navigationStates:s("navigationStates"),selectedEntityIds:s("selectedEntityIds"),hoveredEntityIds:s("hoveredEntityIds"),draggedEntityIds:s("draggedEntityIds"),viewStates:s("viewStates"),toolStates:s("toolStates"),modes:s("modes"),roles:s("roles"),active:s("active"),fullscreen:s("fullscreen"),debug:s("debug"),viewports:s("viewports"),exportedEntityIds:void 0,exportStates:void 0}],this.generated,this.entityTypeOrAliasNames)}return"boolean"==typeof i?new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{active:i,navigationStates:void 0,selectedEntityIds:void 0,hoveredEntityIds:void 0,draggedEntityIds:void 0,viewStates:void 0,toolStates:void 0,modes:void 0,roles:void 0,fullscreen:void 0,debug:void 0,viewports:void 0,exportedEntityIds:void 0,exportStates:void 0}],this.generated,this.entityTypeOrAliasNames):new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{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,...i}],this.generated,this.entityTypeOrAliasNames)}withGradualFilter(t){let e=t=>"function"==typeof t?i(t,{}):t,n={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,n],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=(i,
|
|
16
|
+
`),"function"==typeof i){let n=t(),s=t=>({evaluate:(s,a,o)=>{let r=e(a,n),d=r.get(s);if(!d){if(void 0===(d=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,d)}return"boolean"==typeof d?"active"===t?d:void 0:d[t]},meta:{}});return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{navigationStates:s("navigationStates"),selectedEntityIds:s("selectedEntityIds"),hoveredEntityIds:s("hoveredEntityIds"),draggedEntityIds:s("draggedEntityIds"),viewStates:s("viewStates"),toolStates:s("toolStates"),modes:s("modes"),roles:s("roles"),active:s("active"),fullscreen:s("fullscreen"),debug:s("debug"),viewports:s("viewports"),exportedEntityIds:void 0,exportStates:void 0}],this.generated,this.entityTypeOrAliasNames)}return"boolean"==typeof i?new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{active:i,navigationStates:void 0,selectedEntityIds:void 0,hoveredEntityIds:void 0,draggedEntityIds:void 0,viewStates:void 0,toolStates:void 0,modes:void 0,roles:void 0,fullscreen:void 0,debug:void 0,viewports:void 0,exportedEntityIds:void 0,exportStates:void 0}],this.generated,this.entityTypeOrAliasNames):new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{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,...i}],this.generated,this.entityTypeOrAliasNames)}withGradualFilter(t){let e=t=>"function"==typeof t?i(t,{}):t,n={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,n],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=(i,n)=>{var s,a;let r,d;return this.validate(),s={kind:"simple",entityTypes:new Set(this.entityTypes),componentType:this.componentType,instanceName:this.instanceName,navigationFilters:this.navigationFilters,read:(t,e,n)=>i(n.domain.get$Entity(t,e),e,n),write:n??(()=>({})),generated:this.generated},a=this._getProfilerLabel(),r=t(),d=o(a,s.read),{...s,read:(t,i,n)=>{let s=e(i,r),a=s.get(t);if(a)return a;let o=d(t,i,n);return s.put(t,o),o}}};attachMany=i=>{var n,s;let a,r;return this.validate(),n={kind:"dynamic",entityTypes:new Set(this.entityTypes),componentType:this.componentType,instanceName:this.instanceName,navigationFilters:this.navigationFilters,read:(t,e,n)=>i(n.domain.get$Entity(t,e),e,n)},s=this._getProfilerLabel(),a=t(),r=o(s,n.read),{...n,read:(t,i,n)=>{let s=e(i,a),o=s.get(t);if(o)return o;let d=r(t,i,n);return s.put(t,d),d}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"lodash-es/pick.js";import{getCommonPhxDefinitions as t}from"../core/index.js";import{extendedSchemaValidator as i}from"../core/
|
|
1
|
+
import e from"lodash-es/pick.js";import{getCommonPhxDefinitions as t}from"../core/index.js";import{extendedSchemaValidator as i}from"../core/schema/index.js";export class SystemComponentBuilder{name;writableKeys;jsonSchema;constructor(e,t,i){this.name=e,this.writableKeys=t,this.jsonSchema=i}static component(e){return new SystemComponentBuilder(e,[],{type:"object",properties:{},required:[],additionalProperties:!1})}withState(e){return new SystemComponentBuilder(this.name,[],e)}withWritableKeys(e){return new SystemComponentBuilder(this.name,e,this.jsonSchema)}build(){let s=t(),r={...this.jsonSchema,definitions:{...s,...this.jsonSchema.definitions}};return{name:this.name,writableKeys:this.writableKeys,schema:this.jsonSchema,validateState:i.compile(r),validateWritableState:i.compile({...r,properties:e(this.jsonSchema.properties,this.writableKeys),required:this.jsonSchema.required?.filter(e=>this.writableKeys.includes(e))})}}}
|
|
@@ -59,7 +59,7 @@ export type AnyActionContext = ActionContext<any, any, any, any, any, any, any,
|
|
|
59
59
|
*/
|
|
60
60
|
export type ActionImplementation<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>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, PARAMS, RESULT> = (params: PARAMS, state: DomainState<ENTITIES>, context: ActionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>) => PreparedAction<ENTITIES, RESULT>;
|
|
61
61
|
export type AnyActionImplementation = ActionImplementation<any, any, any, any, any, any, any, any, any, any, any, unknown>;
|
|
62
|
-
/** The implementations of every declared action by name, as
|
|
62
|
+
/** The implementations of every declared action by name, as `DomainBuilder.withActionModules` merges them from `src/actions/`. */
|
|
63
63
|
export type ActionImplementations<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>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, ACTION_TYPES extends ActionTypes> = {
|
|
64
64
|
readonly [NAME in keyof ACTION_TYPES]: ActionImplementation<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES[NAME]['params'], ACTION_TYPES[NAME]['result']>;
|
|
65
65
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
2
|
import type { EntityId } from './model.js';
|
|
3
|
-
import type { PhxValidateFunction } from './schema
|
|
3
|
+
import type { PhxValidateFunction } from './schema/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Definition of how the component looks like, it's name, state and other properties. It is used to instantiate components.
|
|
6
6
|
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Decoder } from './decoder.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the decoder of data that must match a JSON schema. `subject` is what the data is, as the
|
|
4
|
+
* error names it, for example `Session data`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createDecoder: <DATA>(schema: object, subject: string) => Decoder<DATA>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{extendedSchemaValidator as r}from"../schema/index.js";export const createDecoder=(e,o)=>t=>{let i=r.compile(e);if(!i(t))throw Error(`${o} is not valid: ${r.errorsText(i.errors)}`);return t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns data of unknown shape into data of a known type, and throws when the data does not match.
|
|
3
|
+
* Everything that enters a domain from outside goes through one: published, session, frontend and
|
|
4
|
+
* backend data.
|
|
5
|
+
*/
|
|
6
|
+
export type Decoder<DATA> = (data: unknown) => DATA;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{createDecoder}from"./create-decoder.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{migrateCommonAdminDomain as t}from"../admin-domain/implementation/common-admin-migrations.js";import{
|
|
1
|
+
import{migrateCommonAdminDomain as t}from"../admin-domain/implementation/common-admin-migrations.js";import{createDecoder as a}from"./decoder/index.js";export class DomainFactory{context;modelVersion;hasBackendData;constructor(t){this.context=t,this.modelVersion=t.modelVersion,this.hasBackendData=void 0!==t.backendData}parsePublishedData=t=>a(this.context.publishedData,"Admin data")(t);parseSessionData=t=>a(this.context.sessionData,"Session data")(t);parseFrontendData=t=>a(this.context.frontendData,"Frontend data")(t);parseBackendData=t=>{if(void 0===this.context.backendData)throw Error("Backend data is not supported for this domain");return a(this.context.backendData,"Backend data")(t)};validateAndMigrateState=(a,e)=>{let n=this.context.isAdminDomain?t(a):a;return this.context.migrate({state:n,version:e},{trimExtraProperties:!1})}}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './schema/index.js';
|
|
2
2
|
export type { ActionContext, ActionDefinition, ActionDefinitions, ActionImplementation, ActionImplementations, ActionStateChange, ActionTypes, AnyActionContext, AnyActionImplementation, AnyActionImplementations, PreparedAction, } from './action.js';
|
|
3
|
-
export { extendedSchemaValidator, getExtendedSchemaValidator } from './json-schema.js';
|
|
4
3
|
export { _unsafeBuildDomainEntityId, domainEntityTypeFromId, createVirtualEntityId, isDomainEntityId, isVirtualEntityId, VirtualEntityIdSchema, isEqualEntityTypeAndId, parseDomainEntityId, DomainEntityIdSchema, DomainEntitySchema, $DomainEntitySchema, } from './model.js';
|
|
5
4
|
export type { $DomainEntity, DomainEntity, VirtualEntityId, DomainEntityId, EntityIdSchema, EntityByType, EntityId, } from './model.js';
|
|
6
5
|
export type { PartialSchemaOfObject, SchemaOfObject, EnumLike, EntityReflections } from './reflection.js';
|
|
@@ -15,4 +14,3 @@ export * from './domain.js';
|
|
|
15
14
|
export * from './domain-factory.js';
|
|
16
15
|
export * from './preset.js';
|
|
17
16
|
export { getCommonPhxDefinitions, availableDefinitions } from './common-definitions.js';
|
|
18
|
-
export type { PhxValidateFunction, PhxValidationError, SchemaValidator } from './schema-validator.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export*from"./schema/index.js";export{_unsafeBuildDomainEntityId,domainEntityTypeFromId,createVirtualEntityId,isDomainEntityId,isVirtualEntityId,VirtualEntityIdSchema,isEqualEntityTypeAndId,parseDomainEntityId,DomainEntityIdSchema,DomainEntitySchema,$DomainEntitySchema}from"./model.js";export{MigrateFunctionBuilder,StateMigrationError,isStateMigrationError}from"./migrations.js";export*from"./reflection.js";export{isEqualComponentInstance,areEqualComponentSnapshots,isEqualComponentSnapshot,isSnapshotOfComponentType,isInstanceOfComponentType,getComponentInstanceKey,getComponentSnapshotKey}from"./component.js";export{createInitialDomainState}from"./state.js";export*from"./alias.js";export*from"./domain.js";export*from"./domain-factory.js";export*from"./preset.js";export{getCommonPhxDefinitions,availableDefinitions}from"./common-definitions.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
2
|
import { type $DomainEntity, type DomainEntity, type EntityByType, type EntityId } from './model.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type PhxValidateFunction } from './schema/index.js';
|
|
4
4
|
type RequiredKeys<T> = {
|
|
5
5
|
[K in keyof T]: undefined extends T[K] ? never : K;
|
|
6
6
|
}[keyof T];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{domainEntityTypeFromId as t,isDomainEntityId as e}from"./model.js";import{extendedSchemaValidator as s}from"./schema/index.js";export class SchemaReflection{_meta;constructor(t,e){this._meta={name:t,schema:e,validator:s.compile(e)}}is=t=>this._meta.validator(t);assert(t){if(!this._meta.validator(t))throw Error(`Expected value to match schema of '${this._meta.name}' but got ${t}`)}}export class EnumReflection extends SchemaReflection{constructor(t,e){for(let s of(super(t,e),e.enum))Object.defineProperty(this,s,{value:s,writable:!1,enumerable:!0,configurable:!1})}values=()=>this._meta.schema.enum}let o=class BaseDomainEntityReflection{type;constructor(t){this.type=t}is=t=>t.type===this.type;assert(t){if(!this.is(t))throw Error(`Expected entity #${t.id} to be of type ${this.type} but got ${t.type}`)}isId=s=>e(s)&&t(s)===this.type;assertId(t){if(!this.isId(t))throw Error(`Expected entity id to be of type ${this.type} but got ${t}`)}assertIds(t){t.forEach(t=>{this.assertId(t)})}};export class DomainEntityReflection extends o{_meta;constructor(t,e){super(t);let o=e.reduce((t,e)=>{let s=e.$defs;return"object"==typeof s&&null!==s&&Object.assign(t,s),t},{}),r={type:"object",properties:{id:{type:"string",pattern:`^${t}-[0-9]+$`},type:{type:"string",const:t},...e.reduce((t,e)=>({...t,...e.properties}),{})},required:["id","type",...e.flatMap(t=>t.required??[])],additionalProperties:!1},i={...r,$defs:o};this._meta={name:t,schema:r,validator:s.compile(i)}}}let r=class $DomainEntityReflectionClass extends o{expressions;constructor(t,e,s){super(t),this.expressions=e,Object.assign(this,s)}};export const $DomainEntityReflection=r;let i=class BaseAliasReflection{name;types;typeSet;constructor(t,e){this.name=t,this.types=e,this.typeSet=new Set(e)}is=t=>this.typeSet.has(t.type);assert(t){if(!this.is(t))throw Error(`Expected entity #${t.id} to be a member of alias ${this.name} but got ${t.type}`)}isId=s=>e(s)&&this.typeSet.has(t(s));assertId(t){if(!this.isId(t))throw Error(`Expected entity id to be of a member of alias ${this.name} but got ${t}`)}assertIds(t){t.forEach(t=>{this.assertId(t)})}};export class RawAliasReflection extends i{reflections;constructor(t,e){super(t,e.map(t=>t.type)),this.reflections=e}}let a=class EnhancedAliasReflectionClass extends i{constructor(t,e,s){super(t,e),Object.assign(this,s)}};export const EnhancedAliasReflection=a;export function assertString(t){if("string"!=typeof t)throw Error(`Expected value to be a string but got ${t}`)}export function assertNumber(t){if("number"!=typeof t)throw Error(`Expected value to be a number but got ${t}`)}export function assertBoolean(t){if("boolean"!=typeof t)throw Error(`Expected value to be a boolean but got ${t}`)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createAjvSchemaValidator as e}from"./create-ajv-schema-validator.js";import{createCspSchemaValidator as a}from"./create-csp-schema-validator.js";let t="csp-compatible"===globalThis.PHX_SCHEMA_VALIDATOR?a:e;export const getExtendedSchemaValidator=()=>{let e=t();return e.addKeyword("tsType"),e.addKeyword("import"),e.addKeyword("declared"),e};export const extendedSchemaValidator=getExtendedSchemaValidator();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { EnhancedJsonObjectSchemaType, EnhancedJsonSchemaType, JsonSchemaType, MemberImport, } from './enhanced-json-schema.js';
|
|
2
|
+
export { extendedSchemaValidator, getExtendedSchemaValidator } from './extended-schema-validator.js';
|
|
3
|
+
export type { PhxValidateFunction, PhxValidationError, SchemaValidator } from './schema-validator.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{extendedSchemaValidator,getExtendedSchemaValidator}from"./extended-schema-validator.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -6,6 +6,7 @@ import { DomainFactory } from './core/index.js';
|
|
|
6
6
|
import { type MigrateFunction } from './core/migrations.js';
|
|
7
7
|
import { type $DomainEntity, type DomainEntity, type EntityByType } from './core/model.js';
|
|
8
8
|
import type { $DomainEntityReflection, EntityReflections, SchemaOfObject } from './core/reflection.js';
|
|
9
|
+
import { type ProjectModule } from './project-modules/index.js';
|
|
9
10
|
export type AliasedExpressions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>> = {
|
|
10
11
|
[K in TypeOrAlias<ENTITIES, ALIASES>]?: Record<string, AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, K>, unknown>>;
|
|
11
12
|
};
|
|
@@ -31,9 +32,17 @@ export declare class DomainBuilder<ENTITIES extends DomainEntity<string>, ALLOWE
|
|
|
31
32
|
static from<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Readonly<Record<string, ENTITIES>>>(entities: EntityReflections<ENTITIES>, aliasMap: AliasMap<ALIASES>, $entityReflections: $EntityReflections<ENTITIES>, allowedRootEntityTypes: ReadonlyArray<ALLOWED_ROOT_ENTITIES['type']>, modelVersion: number, publishedData: SchemaOfObject<PUBLISHED_DATA>, sessionData: SchemaOfObject<SESSION_DATA>, frontendData: SchemaOfObject<FRONTEND_DATA>, backendData: ExtendedJsonSchema | undefined, isAdminDomain: boolean): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
32
33
|
withMigrate(migration: MigrateFunction<ENTITIES>): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
33
34
|
withExpressions(implementation: AliasedExpressions<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES>): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
35
|
+
/**
|
|
36
|
+
* Adds the expressions of the `src/expressions/` files, as the generated barrel lists them. Each file
|
|
37
|
+
* is checked against the folder's contract and added on its own, so an expression defined twice is
|
|
38
|
+
* reported with both files instead of being overwritten by file order.
|
|
39
|
+
*/
|
|
40
|
+
withExpressionModules(modules: readonly ProjectModule[]): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
34
41
|
/** Declares the actions of the domain, as the generated `domain-spec.ts` reads them from the spec's `actions` section. */
|
|
35
42
|
withActions(actions: readonly ActionDefinition[]): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
36
|
-
/** Adds the implementations of the
|
|
43
|
+
/** Adds the action implementations of the `src/actions/` files, as the generated barrel lists them, after checking each file against the folder's contract. */
|
|
44
|
+
withActionModules(modules: readonly ProjectModule[]): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
45
|
+
/** Adds the implementations of the declared actions, already merged by action name. */
|
|
37
46
|
withActionImplementations(implementations: AnyActionImplementations): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
38
47
|
build: () => DomainFactory<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
39
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expandAlias as t}from"./core/alias.js";import{DomainFactory as i}from"./core/index.js";import{MigrateFunctionBuilder as
|
|
1
|
+
import{expandAlias as t}from"./core/alias.js";import{DomainFactory as i}from"./core/index.js";import{MigrateFunctionBuilder as s}from"./core/migrations.js";import{resolveActionModules as e,resolveExpressionModules as n}from"./project-modules/index.js";import{withProfilerLabel as a}from"./utils/profiler-label.js";export class DomainBuilder{entities;aliasMap;$entityReflections;allowedRootEntityTypes;implemented;modelVersion;publishedData;sessionData;frontendData;backendData;migrate;isAdminDomain;actions;actionImplementations;constructor(t,i,s,e,n,a,o,h,l,r,m,d,p,c){this.entities=t,this.aliasMap=i,this.$entityReflections=s,this.allowedRootEntityTypes=e,this.implemented=n,this.modelVersion=a,this.publishedData=o,this.sessionData=h,this.frontendData=l,this.backendData=r,this.migrate=m,this.isAdminDomain=d,this.actions=p,this.actionImplementations=c}static from(t,i,e,n,a,o,h,l,r,m){let d=s.fromVersions({1:t}).to(1).using({}).build();return new DomainBuilder(t,i,e,n,{},a,o,h,l,r,d,m,{},{})}withMigrate(t){return new DomainBuilder(this.entities,this.aliasMap,this.$entityReflections,this.allowedRootEntityTypes,this.implemented,this.modelVersion,this.publishedData,this.sessionData,this.frontendData,this.backendData,t,this.isAdminDomain,this.actions,this.actionImplementations)}withExpressions(i){let s={...this.implemented};return Object.entries(i).forEach(([i,e])=>{t(this.aliasMap,i).forEach(t=>{let n={...s[t]};s[t]=n,Object.entries(e).forEach(([s,e])=>{let o=n[s];if(o)throw Error(`Duplicate expression ${t}.${s}: The expression is defined on both ${i} and ${o.origin.typeOrAlias}, which would lead to ambiguous usage. Please ensure that expressions are only defined once.`);n[s]={...e,evaluate:a(`${t}_${s}`,e.evaluate),origin:{name:s,typeOrAlias:i}}})})}),new DomainBuilder(this.entities,this.aliasMap,this.$entityReflections,this.allowedRootEntityTypes,s,this.modelVersion,this.publishedData,this.sessionData,this.frontendData,this.backendData,this.migrate,this.isAdminDomain,this.actions,this.actionImplementations)}withExpressionModules(t){return n(t,this.aliasMap).reduce((t,i)=>t.withExpressions(i.expressions),this)}withActions(t){return new DomainBuilder(this.entities,this.aliasMap,this.$entityReflections,this.allowedRootEntityTypes,this.implemented,this.modelVersion,this.publishedData,this.sessionData,this.frontendData,this.backendData,this.migrate,this.isAdminDomain,Object.fromEntries(t.map(t=>[t.name,t])),this.actionImplementations)}withActionModules(t){return this.withActionImplementations(e(t))}withActionImplementations(t){return new DomainBuilder(this.entities,this.aliasMap,this.$entityReflections,this.allowedRootEntityTypes,this.implemented,this.modelVersion,this.publishedData,this.sessionData,this.frontendData,this.backendData,this.migrate,this.isAdminDomain,this.actions,{...this.actionImplementations,...t})}build=()=>{let t=this.implemented,e=this.migrate??s.fromVersions({1:this.entities}).to(1).using({}).build();return new i({aliasMap:this.aliasMap,entityReflections:this.entities,$entityReflections:this.$entityReflections,expressions:t,allowedRootEntityTypes:this.allowedRootEntityTypes,modelVersion:this.modelVersion,migrate:e,publishedData:this.publishedData,sessionData:this.sessionData,frontendData:this.frontendData,backendData:this.backendData,isAdminDomain:this.isAdminDomain,actions:this.actions,actionImplementations:this.actionImplementations})}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSelector as t}from"@salsita-ai/common/utils";import{createUpdateFactory as e}from"../../components/updates.js";import{extendedSchemaValidator as s}from"../../core/
|
|
1
|
+
import{createSelector as t}from"@salsita-ai/common/utils";import{createUpdateFactory as e}from"../../components/updates.js";import{extendedSchemaValidator as s}from"../../core/schema/index.js";import{getIdSequence as n}from"../store-system/next-domain-entity-id.js";export class ActionSystem{_context;_selectValidators=t([t.leaf(t=>t)],t=>new Map(Object.values(t).map(t=>[t.name,s.compile(t.params)])));_updates=e();constructor(t){this._context=t}createContext=t=>({expressionContext:this._context.selectors.getExpressionContext(),systems:this._context.selectors.getDomainSystems(),getIdSequence:()=>n(t.entities,[]),updates:this._updates});prepareAction=(t,e,n)=>{let o=this._context.selectors.getActionDefinitions(),i=Object.values(o).find(e=>e.name===t);if(!i){let e=Object.values(o).map(t=>`"${t.name}"`);throw Error(`Unknown action "${t}". ${e.length>0?`The application declares these actions: ${e.join(", ")}.`:"The application declares no actions."} Declare it under "actions" in a spec file and implement it in src/actions/.`)}let a=this._selectValidators(o).get(i.name);if(a&&!a(e))throw Error(`The arguments of action "${t}" do not fit its params: ${s.errorsText(a.errors)}. Nothing was changed. Send arguments that fit the params the action declares.`);return(Object.entries(this._context.selectors.getActionImplementations()).find(([e])=>e===t)?.[1])(e,n,this.createContext(n))}}
|
|
@@ -4,7 +4,7 @@ import type { TransformerRegistration, UpdateTransformer } from '../store-system
|
|
|
4
4
|
export type RegisterFunction<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string> = (domainContext: DomainContextSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>, priority?: number) => TransformerRegistration<ENTITIES>;
|
|
5
5
|
export type RegistrableTransformer<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string> = {
|
|
6
6
|
/**
|
|
7
|
-
* Creates a registration object consumed
|
|
7
|
+
* Creates a registration object consumed by the runtime spec's `createTransformers` factory.
|
|
8
8
|
*/
|
|
9
9
|
register: RegisterFunction<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
|
|
10
10
|
};
|
|
@@ -61,7 +61,7 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
|
|
|
61
61
|
selectAdminPreset: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyProductPreset>;
|
|
62
62
|
selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, number>;
|
|
63
63
|
selectThemeOptions: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("@mui/material").ThemeOptions>;
|
|
64
|
-
selectAssistant: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AssistantManifest | null>;
|
|
64
|
+
selectAssistant: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, Required<import("../index.js").AssistantManifest> | null>;
|
|
65
65
|
selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
|
|
66
66
|
selectAdminFactory: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
|
|
67
67
|
selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, readonly import("../index.js").AnyDomainComponentOptic[]>;
|
|
@@ -104,7 +104,7 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
|
|
|
104
104
|
getAdminPreset: () => import("../index.js").AnyProductPreset;
|
|
105
105
|
getAdminModelVersion: () => number;
|
|
106
106
|
getThemeOptions: () => import("@mui/material").ThemeOptions;
|
|
107
|
-
getAssistant: () => import("../index.js").AssistantManifest | null;
|
|
107
|
+
getAssistant: () => Required<import("../index.js").AssistantManifest> | null;
|
|
108
108
|
getConfiguratorFactory: () => import("../index.js").AnyDomainFactory;
|
|
109
109
|
getAdminFactory: () => import("../index.js").AnyDomainFactory;
|
|
110
110
|
getConfiguratorComponentOptics: () => readonly import("../index.js").AnyDomainComponentOptic[];
|
|
@@ -651,7 +651,7 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
|
|
|
651
651
|
selectAdminPreset: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyProductPreset>;
|
|
652
652
|
selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, number>;
|
|
653
653
|
selectThemeOptions: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("@mui/material").ThemeOptions>;
|
|
654
|
-
selectAssistant: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AssistantManifest | null>;
|
|
654
|
+
selectAssistant: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, Required<import("../index.js").AssistantManifest> | null>;
|
|
655
655
|
selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
|
|
656
656
|
selectAdminFactory: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
|
|
657
657
|
selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<import("./index.js").SpecSelectorState, readonly import("../index.js").AnyDomainComponentOptic[]>;
|
|
@@ -694,7 +694,7 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
|
|
|
694
694
|
getAdminPreset: () => import("../index.js").AnyProductPreset;
|
|
695
695
|
getAdminModelVersion: () => number;
|
|
696
696
|
getThemeOptions: () => import("@mui/material").ThemeOptions;
|
|
697
|
-
getAssistant: () => import("../index.js").AssistantManifest | null;
|
|
697
|
+
getAssistant: () => Required<import("../index.js").AssistantManifest> | null;
|
|
698
698
|
getConfiguratorFactory: () => import("../index.js").AnyDomainFactory;
|
|
699
699
|
getAdminFactory: () => import("../index.js").AnyDomainFactory;
|
|
700
700
|
getConfiguratorComponentOptics: () => readonly import("../index.js").AnyDomainComponentOptic[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SessionRole as
|
|
1
|
+
import{SessionRole as t}from"@salsita-ai/contracts/api";import{resolveElementModules as e}from"../../application/element-registration.js";import{resolveHandlerModules as a}from"../../application/handler-registration.js";import{resolveImportedTransformers as n,resolveTransformerModules as o}from"../../application/resolve-imported-transformers.js";import{resolveComponentOpticModules as i}from"../../components/domain-component-optic.js";export const initializeSpec=s=>{let r=s.adminDomain.presets[0];if(!r)throw Error("Cannot register application spec because admin preset is required.");let m=a(s.handlers),c=e(s.elements),d=(t=>{let e={};for(let a of t)e[a.name]=(void 0)??a.name;return e})(m),l=(t=>{let e={},a=0;for(let n of t)if("entity"===n.type||"layout"===n.type)e[n.name]=(void 0)??n.name;else{let t=`icon:${a}`;e[t]=(void 0)??`${t}:${n.elements.length}`,a+=1}return e})(c),p=o(s.transformers?.importedTransformers??[]),y=s.transformers?.specTransformers??[];return{version:s.version,dataConfig:s.dataSpec??null,chunks:s.chunks,publishedDataHash:s.publishedDataHash,initialPublishedData:s.initialPublishedData,canCreate:s.features?.acl?.canCreate??Object.values(t),enableAdminRelease:s.features?.enableAdminRelease??!1,textLanguages:s.domain.textLanguages??s.adminDomain.textLanguages??["en"],baseResourcesUrl:s.resources?.baseResourcesUrl??s.defaultEnvs?.resourcesUrl??"",configurator:{factory:s.domain.domainFactory,presets:s.domain.presets,aliasMap:s.domain.domainFactory.context.aliasMap,entityReflections:s.domain.domainFactory.context.entityReflections,$entityReflections:s.domain.domainFactory.context.$entityReflections,expressions:s.domain.domainFactory.context.expressions,actions:s.domain.domainFactory.context.actions,actionImplementations:s.domain.domainFactory.context.actionImplementations,allowedRootEntityTypes:s.domain.domainFactory.context.allowedRootEntityTypes,migrate:s.domain.domainFactory.context.migrate,componentOptics:i(s.domain.componentOptics),createTransformers:t=>n(p,y,t),navigationStates:s.navigation?.navigationStates??[],viewStates:s.navigation?.viewStates??[],toolStates:s.navigation?.toolStates??[],exportStates:s.navigation?.exportStates??[],handlers:m,handlerHashes:d,elements:c,elementHashes:l,appLoader:s.ui?.appLoader??"universal",preview:s.ui?.preview??"auto",alwaysExpand:s.ui?.alwaysExpand??!1,theme:s.ui?.theme??{},assistant:s.assistant??null,deploymentQueryDisabled:s.resources?.deploymentQueryDisabled??!1,prefetchTextureUrls:s.resources?.prefetchTextureUrls??[],modelVersion:s.domain.domainFactory.modelVersion},admin:{factory:s.adminDomain.domainFactory,modelVersion:s.adminDomain.domainFactory.modelVersion,aliasMap:s.adminDomain.domainFactory.context.aliasMap,entityReflections:s.adminDomain.domainFactory.context.entityReflections,$entityReflections:s.adminDomain.domainFactory.context.$entityReflections,expressions:s.adminDomain.domainFactory.context.expressions,actions:s.adminDomain.domainFactory.context.actions,actionImplementations:s.adminDomain.domainFactory.context.actionImplementations,allowedRootEntityTypes:s.adminDomain.domainFactory.context.allowedRootEntityTypes,migrate:s.adminDomain.domainFactory.context.migrate,preset:r,componentOptics:i(s.adminDomain.componentOptics),navigationStates:s.adminNavigation?.navigationStates??[],viewStates:s.adminNavigation?.viewStates??[],handlers:m,handlerHashes:d,elements:c,elementHashes:l}}};
|
|
@@ -22,7 +22,7 @@ export declare const createSpecSelectors: (context: Context) => {
|
|
|
22
22
|
selectAdminPreset: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("../../index.js").AnyProductPreset>;
|
|
23
23
|
selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<SpecSelectorState, number>;
|
|
24
24
|
selectThemeOptions: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("@mui/material").ThemeOptions>;
|
|
25
|
-
selectAssistant: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("../../index.js").AssistantManifest | null>;
|
|
25
|
+
selectAssistant: import("@salsita-ai/common/utils").Selector<SpecSelectorState, Required<import("../../index.js").AssistantManifest> | null>;
|
|
26
26
|
selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("../../index.js").AnyDomainFactory>;
|
|
27
27
|
selectAdminFactory: import("@salsita-ai/common/utils").Selector<SpecSelectorState, import("../../index.js").AnyDomainFactory>;
|
|
28
28
|
selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<SpecSelectorState, readonly import("../../index.js").AnyDomainComponentOptic[]>;
|
|
@@ -65,7 +65,7 @@ export declare const createSpecSelectors: (context: Context) => {
|
|
|
65
65
|
getAdminPreset: () => import("../../index.js").AnyProductPreset;
|
|
66
66
|
getAdminModelVersion: () => number;
|
|
67
67
|
getThemeOptions: () => import("@mui/material").ThemeOptions;
|
|
68
|
-
getAssistant: () => import("../../index.js").AssistantManifest | null;
|
|
68
|
+
getAssistant: () => Required<import("../../index.js").AssistantManifest> | null;
|
|
69
69
|
getConfiguratorFactory: () => import("../../index.js").AnyDomainFactory;
|
|
70
70
|
getAdminFactory: () => import("../../index.js").AnyDomainFactory;
|
|
71
71
|
getConfiguratorComponentOptics: () => readonly import("../../index.js").AnyDomainComponentOptic[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSelector as e}from"@salsita-ai/common/utils";import{
|
|
1
|
+
import{createSelector as e}from"@salsita-ai/common/utils";import{buildAssistantManifest as t}from"../../application/assistant/index.js";import{systemElementRegistry as n}from"../../application/element-registration.js";export const createSpecSelectors=a=>{let{getState:s}=a,r=e.withTypes(),o=r([r.leaf(e=>e.spec)],e=>e),l=r([o],e=>e.version),i=r([o],e=>e.baseResourcesUrl),m=r([o],e=>e.configurator),g=r([o],e=>e.dataConfig),p=r([o],e=>e.chunks),d=r([o],e=>e.publishedDataHash),c=r([o],e=>e.initialPublishedData),u=r([o],e=>e.canCreate),y=r([o],e=>e.enableAdminRelease),h=r([o],e=>e.textLanguages),f=r([m],e=>e.modelVersion),C=r([o],e=>e.admin),A=r([C],e=>e.preset),E=r([C],e=>e.modelVersion),b=r([m],e=>e.theme),x=r([m],e=>e.assistant),H=r([x],e=>e?t(e):null),D=r([m],e=>e.factory),P=r([C],e=>e.factory),S=r([m],e=>e.componentOptics),w=r([C],e=>e.componentOptics),O=r([m],e=>e.appLoader),T=r([m],e=>e.preview),V=r([m],e=>e.alwaysExpand),L=r([m],e=>e.presets),R=r([m],e=>e.deploymentQueryDisabled),U=r([m],e=>e.prefetchTextureUrls),v=r([m],e=>e.handlerHashes),j=r([m],e=>e.handlers),k=r([j,v],(e,t)=>({...(e=>{let t={},n={},a={};for(let s of e)"phoenix"===s.type&&(t[s.name]=s.handler),"system"===s.type&&(n[s.name]=s.handler),"system-async"===s.type&&(a[s.name]=s.handler);return{handlers:t,systemHandlers:n,systemAsyncHandlers:a}})(e),hashes:t})),F=r([m],e=>e.elementHashes),M=r([m],e=>e.elements),Q=r([M,F],(e,t)=>({...(e=>{let t={},a={};for(let n of e)"layout"===n.type&&(t[n.name]=n.element),"entity"===n.type&&(a[n.name]=n.element);return{entityElements:{...n.entityElements,...a},layoutElements:{...n.layoutElements,...t}}})(e),hashes:t}));return{selectSpec:o,selectVersion:l,selectBaseResourcesUrl:i,selectConfiguratorSpec:m,selectConfiguratorModelVersion:f,selectAdminSpec:C,selectAdminPreset:A,selectAdminModelVersion:E,selectThemeOptions:b,selectAssistant:H,selectConfiguratorFactory:D,selectAdminFactory:P,selectConfiguratorComponentOptics:S,selectAdminComponentOptics:w,selectAppLoader:O,selectPreview:T,selectAlwaysExpand:V,selectPresetSeed:L,selectDeploymentQueryDisabled:R,selectPrefetchTextureUrls:U,selectTextLanguages:h,selectHandlerHashes:v,selectHandlers:j,selectHandlerSlots:k,selectElementHashes:F,selectElements:M,selectElementSlots:Q,selectDataConfig:g,selectChunks:p,selectPublishedDataHash:d,selectInitialPublishedData:c,selectCanCreate:u,selectEnableAdminRelease:y,getVersion:()=>l(s()),getBaseResourcesUrl:()=>i(s()),getConfiguratorSpec:()=>m(s()),getConfiguratorModelVersion:()=>f(s()),getAdminSpec:()=>C(s()),getAdminPreset:()=>A(s()),getAdminModelVersion:()=>E(s()),getThemeOptions:()=>b(s()),getAssistant:()=>H(s()),getConfiguratorFactory:()=>D(s()),getAdminFactory:()=>P(s()),getConfiguratorComponentOptics:()=>S(s()),getAdminComponentOptics:()=>w(s()),getAppLoader:()=>O(s()),getPreview:()=>T(s()),getAlwaysExpand:()=>V(s()),getPresetSeed:()=>L(s()),getDeploymentQueryDisabled:()=>R(s()),getPrefetchTextureUrls:()=>U(s()),getTextLanguages:()=>h(s()),getHandlerHashes:()=>v(s()),getHandlers:()=>j(s()),getHandlerSlots:()=>k(s()),getElementHashes:()=>F(s()),getElements:()=>M(s()),getElementSlots:()=>Q(s()),getDataConfig:()=>g(s()),getChunks:()=>p(s()),getPublishedDataHash:()=>d(s()),getInitialPublishedData:()=>c(s()),getCanCreate:()=>u(s()),getEnableAdminRelease:()=>y(s())}};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ThemeOptions } from '@mui/material';
|
|
2
2
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AssistantResolvedManifest, ChunksSpec, DataSpec, ElementRegistration, HandlerRegistration } from '../../application/index.js';
|
|
4
4
|
import type { AnyDomainComponentOptic } from '../../components/index.js';
|
|
5
5
|
import type { ActionDefinitions, Any$EntityReflections, AnyActionImplementations, AnyAliasMap, AnyAllowedRootEntityTypes, AnyDomainFactory, AnyEntityReflections, AnyExpressions, AnyProductPreset, DomainEntity, MigrateFunction } from '../../core/index.js';
|
|
6
6
|
import type { AnyCreateTransformersFactory } from '../../domain-context/store-system/store-system.js';
|
|
@@ -46,10 +46,10 @@ export interface ApplicationConfiguratorSpec {
|
|
|
46
46
|
readonly alwaysExpand: boolean;
|
|
47
47
|
readonly theme: ThemeOptions;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Resolved assistant manifest used to rebuild GraphQL SDL, or `null` when the application
|
|
50
50
|
* spec declares no `assistant` section. Replaced by editor hot reload when the section changes.
|
|
51
51
|
*/
|
|
52
|
-
readonly assistant:
|
|
52
|
+
readonly assistant: AssistantResolvedManifest | null;
|
|
53
53
|
/**
|
|
54
54
|
* When true, resource urls are not suffixed with the `?did=<deploymentId>` cache-busting
|
|
55
55
|
* query — useful for demos serving local blob urls.
|
package/dist/domain/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { type ActionImplementationConflicts, findActionImplementationConflicts,
|
|
|
4
4
|
export { createConstantExpressionFactory } from './expressions/constant-expressions.js';
|
|
5
5
|
export { createCustomExpressionFactory } from './expressions/custom-expression.js';
|
|
6
6
|
export { createCustomInvariantFactory, type StaticallyDefinedViolations } from './invariants/custom-invariants.js';
|
|
7
|
-
export { InvariantBuilder } from './invariants/invariants.js';
|
|
7
|
+
export { InvariantBuilder, resolveInvariantModules } from './invariants/invariants.js';
|
|
8
8
|
export type { AliasedInvariants, Invariant } from './invariants/invariants.js';
|
|
9
9
|
export type { Violation, ViolationSeverity, ViolationTypesOf$Entity, EntityViolation } from './invariants/violation.js';
|
|
10
10
|
export { compareSeverity } from './invariants/violation.js';
|
|
@@ -26,7 +26,7 @@ export { viewportStateComponent, isViewportStateComponentSnapshot, isSystemViewp
|
|
|
26
26
|
export { type ComponentSystemFilterState, type ComponentSystemFilterProps, ComponentSystemFilterPropsSchema, getComponentSystemFilterState, CombinedComponentFilterSchema, type GradualComponentSystemFilter, type FilterMismatchReason, type IdOrWithId, } from './components/system-component-filter.js';
|
|
27
27
|
export { ComponentSystemFilterSchema, type ComponentSystemFilter, type DeclarativeComponentSystemFilter, } from './components/legacy-filter.js';
|
|
28
28
|
export type { OneComponentFilter, ManyComponentFilter, ComponentFilter, FilteredOutComponentSnapshot, FilteredOutFilterContext, } from './components/component-reader-types.js';
|
|
29
|
-
export { DomainComponentOpticBuilder, type AnyDomainComponentOptic, type DomainComponentOptic, } from './components/domain-component-optic.js';
|
|
29
|
+
export { DomainComponentOpticBuilder, type AnyDomainComponentOptic, type DomainComponentOptic, resolveComponentOpticModules, } from './components/domain-component-optic.js';
|
|
30
30
|
export { groupComponentsByEntityIdAndName, isEqualGroupedComponentSnapshots, type GroupedComponentSnapshots, } from './components/group-components-by-entity-id-and-name.js';
|
|
31
31
|
export { SystemComponentBuilder } from './components/system-component-builder.js';
|
|
32
32
|
export { type DataUpdate, type StateUpdate, type ComponentModification, isComponentModificationOfType, type DomainEntityCreation, type EntityDeletion, type DomainEntityReplacement, type DomainEntityModification, type EphemeralRecordCreation, type EphemeralRecordDeletion, type EphemeralRecordModification, type DomainEntityStateDelta, systemUpdateFactory, type UpdateFactory, createUpdateFactory, } from './components/updates.js';
|
|
@@ -41,6 +41,7 @@ export * from './sketching/index.js';
|
|
|
41
41
|
export * from './projections/index.js';
|
|
42
42
|
export * from './admin-domain/index.js';
|
|
43
43
|
export * from './application/index.js';
|
|
44
|
+
export { type ProjectModule, resolveActionModules, resolveExpressionModules } from './project-modules/index.js';
|
|
44
45
|
export * from './scene/index.js';
|
|
45
46
|
export { getAllPhxDefinitions } from './system-definitions.js';
|
|
46
47
|
export { availableSystemComponents, componentsByName } from './available-system-components.js';
|
package/dist/domain/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./core/index.js";export{createActionFactory}from"./actions/action-factory.js";export{findActionImplementationConflicts}from"./actions/prepare-action-implementations.js";export{createConstantExpressionFactory}from"./expressions/constant-expressions.js";export{createCustomExpressionFactory}from"./expressions/custom-expression.js";export{createCustomInvariantFactory}from"./invariants/custom-invariants.js";export{InvariantBuilder}from"./invariants/invariants.js";export{compareSeverity}from"./invariants/violation.js";export{violationsComponent}from"./invariants/violation-component.js";export{createRelationFactory}from"./relations/relation-factory.js";export{attachMultipleReferenceComponent,attachSingleReferenceComponent,referenceComponent}from"./relations/reference-component.js";export{composedOfComponent}from"./relations/composed-of.js";export{createSingleReferenceRead,createSingleReferenceWrite,createMultipleReferenceRead,createMultipleReferenceWrite,createSingleCompositionRead,createMultipleCompositionRead,createEmptyWrite}from"./relations/component-factories.js";export{systemVirtualEntityId}from"./components/system-virtual-entity.js";export{navigationStateComponent,isNavigationComponentSnapshot,isSystemNavigationComponentSnapshot}from"./components/navigation-state-component.js";export{hoverStateComponent,isHoverStateComponentSnapshot,isSystemHoverStateComponentSnapshot}from"./components/hover-state-component.js";export{selectionStateComponent,isSelectionComponentSnapshot,isSystemSelectionComponentSnapshot}from"./components/selection-state-component.js";export{viewStateComponent,isViewComponentSnapshot,isSystemViewComponentSnapshot}from"./components/view-state-component.js";export{toolStateComponent,isToolStateComponentSnapshot,isSystemToolStateComponentSnapshot}from"./components/tool-state-component.js";export{debugStateComponent,isDebugStateComponentSnapshot,isSystemDebugStateComponentSnapshot}from"./components/debug-state-component.js";export{fullscreenStateComponent,isFullscreenStateComponentSnapshot,isSystemFullscreenStateComponentSnapshot}from"./components/fullscreen-state-component.js";export{dragStateComponent,isDragStateComponentSnapshot,isSystemDragStateComponentSnapshot}from"./components/drag-state-component.js";export{viewportStateComponent,isViewportStateComponentSnapshot,isSystemViewportStateComponentSnapshot,VIEWPORTS}from"./components/viewport-state-component.js";export{ComponentSystemFilterPropsSchema,getComponentSystemFilterState,CombinedComponentFilterSchema}from"./components/system-component-filter.js";export{ComponentSystemFilterSchema}from"./components/legacy-filter.js";export{DomainComponentOpticBuilder}from"./components/domain-component-optic.js";export{groupComponentsByEntityIdAndName,isEqualGroupedComponentSnapshots}from"./components/group-components-by-entity-id-and-name.js";export{SystemComponentBuilder}from"./components/system-component-builder.js";export{isComponentModificationOfType,systemUpdateFactory,createUpdateFactory}from"./components/updates.js";export{DomainBuilder}from"./domain-builder.js";export{memoEval,isMemoizedArray,isMemoizedObject}from"./utils/memo-eval.js";export{cloneEvalCache,getEvalCache,setEvalCache,createEvalCacheToken}from"./utils/eval-cache.js";export{areProfilerLabelsEnabled,setProfilerLabelsEnabled}from"./utils/profiler-label.js";export*from"./dimensions/index.js";export*from"./domain-context/index.js";export*from"./system-components/index.js";export*from"./sketching/index.js";export*from"./projections/index.js";export*from"./admin-domain/index.js";export*from"./application/index.js";export*from"./scene/index.js";export{getAllPhxDefinitions}from"./system-definitions.js";export{availableSystemComponents,componentsByName}from"./available-system-components.js";export*from"./mocks/index.js";export*from"./domain-runtime/index.js";
|
|
1
|
+
export*from"./core/index.js";export{createActionFactory}from"./actions/action-factory.js";export{findActionImplementationConflicts}from"./actions/prepare-action-implementations.js";export{createConstantExpressionFactory}from"./expressions/constant-expressions.js";export{createCustomExpressionFactory}from"./expressions/custom-expression.js";export{createCustomInvariantFactory}from"./invariants/custom-invariants.js";export{InvariantBuilder,resolveInvariantModules}from"./invariants/invariants.js";export{compareSeverity}from"./invariants/violation.js";export{violationsComponent}from"./invariants/violation-component.js";export{createRelationFactory}from"./relations/relation-factory.js";export{attachMultipleReferenceComponent,attachSingleReferenceComponent,referenceComponent}from"./relations/reference-component.js";export{composedOfComponent}from"./relations/composed-of.js";export{createSingleReferenceRead,createSingleReferenceWrite,createMultipleReferenceRead,createMultipleReferenceWrite,createSingleCompositionRead,createMultipleCompositionRead,createEmptyWrite}from"./relations/component-factories.js";export{systemVirtualEntityId}from"./components/system-virtual-entity.js";export{navigationStateComponent,isNavigationComponentSnapshot,isSystemNavigationComponentSnapshot}from"./components/navigation-state-component.js";export{hoverStateComponent,isHoverStateComponentSnapshot,isSystemHoverStateComponentSnapshot}from"./components/hover-state-component.js";export{selectionStateComponent,isSelectionComponentSnapshot,isSystemSelectionComponentSnapshot}from"./components/selection-state-component.js";export{viewStateComponent,isViewComponentSnapshot,isSystemViewComponentSnapshot}from"./components/view-state-component.js";export{toolStateComponent,isToolStateComponentSnapshot,isSystemToolStateComponentSnapshot}from"./components/tool-state-component.js";export{debugStateComponent,isDebugStateComponentSnapshot,isSystemDebugStateComponentSnapshot}from"./components/debug-state-component.js";export{fullscreenStateComponent,isFullscreenStateComponentSnapshot,isSystemFullscreenStateComponentSnapshot}from"./components/fullscreen-state-component.js";export{dragStateComponent,isDragStateComponentSnapshot,isSystemDragStateComponentSnapshot}from"./components/drag-state-component.js";export{viewportStateComponent,isViewportStateComponentSnapshot,isSystemViewportStateComponentSnapshot,VIEWPORTS}from"./components/viewport-state-component.js";export{ComponentSystemFilterPropsSchema,getComponentSystemFilterState,CombinedComponentFilterSchema}from"./components/system-component-filter.js";export{ComponentSystemFilterSchema}from"./components/legacy-filter.js";export{DomainComponentOpticBuilder,resolveComponentOpticModules}from"./components/domain-component-optic.js";export{groupComponentsByEntityIdAndName,isEqualGroupedComponentSnapshots}from"./components/group-components-by-entity-id-and-name.js";export{SystemComponentBuilder}from"./components/system-component-builder.js";export{isComponentModificationOfType,systemUpdateFactory,createUpdateFactory}from"./components/updates.js";export{DomainBuilder}from"./domain-builder.js";export{memoEval,isMemoizedArray,isMemoizedObject}from"./utils/memo-eval.js";export{cloneEvalCache,getEvalCache,setEvalCache,createEvalCacheToken}from"./utils/eval-cache.js";export{areProfilerLabelsEnabled,setProfilerLabelsEnabled}from"./utils/profiler-label.js";export*from"./dimensions/index.js";export*from"./domain-context/index.js";export*from"./system-components/index.js";export*from"./sketching/index.js";export*from"./projections/index.js";export*from"./admin-domain/index.js";export*from"./application/index.js";export{resolveActionModules,resolveExpressionModules}from"./project-modules/index.js";export*from"./scene/index.js";export{getAllPhxDefinitions}from"./system-definitions.js";export{availableSystemComponents,componentsByName}from"./available-system-components.js";export*from"./mocks/index.js";export*from"./domain-runtime/index.js";
|
|
@@ -3,6 +3,7 @@ import { type AliasMap, type EventualAlias, type ExpandAlias, type ExtractFromAl
|
|
|
3
3
|
import type { AnonymousExpression, ExpressionContext } from '../core/expression.js';
|
|
4
4
|
import type { $DomainEntity, DomainEntity, EntityByType } from '../core/model.js';
|
|
5
5
|
import type { DomainState } from '../core/state.js';
|
|
6
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
6
7
|
import { type Violation } from './violation.js';
|
|
7
8
|
export interface Invariant<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ENTITY extends ENTITIES, VIOLATION_TYPE extends string> {
|
|
8
9
|
evaluate(selfId: ENTITY['id'], state: DomainState<ENTITIES>, ctx: ExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>): ReadonlyArray<Violation<VIOLATION_TYPE>>;
|
|
@@ -38,10 +39,18 @@ type ExpressionsFromInvariants<ENTITIES extends DomainEntity<string>, ALLOWED_RO
|
|
|
38
39
|
};
|
|
39
40
|
};
|
|
40
41
|
type BuildViolationExpressions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, INVARIANTS extends Partial<Record<ENTITIES['type'], ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, string>>>>> = Record<never, never> extends ConflictingInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, DeclaredInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>, INVARIANTS> ? () => ExpressionsFromInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, INVARIANTS> : never;
|
|
42
|
+
type AnyInvariant = Invariant<any, any, any, any, any, any, string>;
|
|
43
|
+
/** Validates the `src/invariants/` files and concatenates their invariants per entity type or alias. */
|
|
44
|
+
export declare const resolveInvariantModules: (modules: readonly ProjectModule[]) => Readonly<Record<string, readonly AnyInvariant[]>>;
|
|
41
45
|
export declare class InvariantBuilder<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, INVARIANTS extends Partial<Record<ENTITIES['type'], ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, string>>>> = Record<never, never>> {
|
|
42
46
|
private readonly aliasMap;
|
|
43
47
|
private readonly invariants;
|
|
44
48
|
constructor(aliasMap: AliasMap<ALIASES>, invariants?: INVARIANTS);
|
|
49
|
+
/**
|
|
50
|
+
* Adds the invariants of the `src/invariants/` files, as the generated barrel lists them, after
|
|
51
|
+
* checking each file against the folder's contract.
|
|
52
|
+
*/
|
|
53
|
+
withInvariantModules(modules: readonly ProjectModule[]): InvariantBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ExpandAndMergeInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, INVARIANTS, AliasedInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, string>>>;
|
|
45
54
|
withInvariants<ALIASED_INVARIANTS extends AliasedInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, string>>(aliasedInvariants: ALIASED_INVARIANTS): InvariantBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ExpandAndMergeInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, INVARIANTS, ALIASED_INVARIANTS>>;
|
|
46
55
|
/**
|
|
47
56
|
* DO NOT USE in runtime!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expandAlias as
|
|
1
|
+
import{expandAlias as t}from"../core/alias.js";import{SHARED_FOLDER_HINT as a,createContractError as e,isRecord as i}from"../project-modules/index.js";let r={expected:"an object of invariant lists keyed by entity type or alias",fix:`Create it with phx.domain.implementCustomInvariants({ ... }) (phx.domain.admin.implementCustomInvariants({ ... }) under src/admin/), ${a}.`},n=t=>i(t)&&"function"==typeof t.evaluate,s=t=>i(t)&&Object.values(t).every(t=>Array.isArray(t)&&t.every(n));export const resolveInvariantModules=t=>{let a={};for(let i of t){if(!s(i.exports))throw e(i.origin,r,i.exports);for(let[t,e]of Object.entries(i.exports))a[t]=[...a[t]??[],...e]}return a};export class InvariantBuilder{aliasMap;invariants;constructor(t,a={}){this.aliasMap=t,this.invariants=a}withInvariantModules(t){return this.withInvariants(resolveInvariantModules(t))}withInvariants(a){let e={...this.invariants};return Object.entries(a).forEach(([a,i])=>{t(this.aliasMap,a).forEach(t=>{e[t]=[...e[t]??[],...i]})}),new InvariantBuilder(this.aliasMap,e)}_conflicts={};buildViolationExpressions=()=>{let t={};return Object.entries(this.invariants).forEach(([a,e])=>{t[a]={$violations:{evaluate:(t,a,i)=>e.flatMap(e=>e.evaluate(t,a,i)),meta:{}}}}),t}}
|
|
@@ -15,7 +15,7 @@ import type { RegistrableTransformer } from '../domain-context/index.js';
|
|
|
15
15
|
*
|
|
16
16
|
* Contributing no extension systems is the same shape webhook and finalize hosts run in.
|
|
17
17
|
*/
|
|
18
|
-
export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, CHAT_CONTEXT extends Record<string, unknown>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ADMIN_ENTITIES extends DomainEntity<string>, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>>, ADMIN_NAVIGATION_STATES extends string, ADMIN_VIEW_STATES extends string>(
|
|
18
|
+
export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, CHAT_CONTEXT extends Record<string, unknown>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ADMIN_ENTITIES extends DomainEntity<string>, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>>, ADMIN_NAVIGATION_STATES extends string, ADMIN_VIEW_STATES extends string>(config: ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>, mocks: {
|
|
19
19
|
frontendData: FRONTEND_DATA;
|
|
20
20
|
publishedData: PUBLISHED_DATA;
|
|
21
21
|
sessionData: SESSION_DATA;
|
|
@@ -57,7 +57,7 @@ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<str
|
|
|
57
57
|
selectAdminPreset: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("../index.js").AnyProductPreset>;
|
|
58
58
|
selectAdminModelVersion: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, number>;
|
|
59
59
|
selectThemeOptions: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("@mui/material").ThemeOptions>;
|
|
60
|
-
selectAssistant: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("../index.js").AssistantManifest | null>;
|
|
60
|
+
selectAssistant: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, Required<import("../index.js").AssistantManifest> | null>;
|
|
61
61
|
selectConfiguratorFactory: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
|
|
62
62
|
selectAdminFactory: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, import("../index.js").AnyDomainFactory>;
|
|
63
63
|
selectConfiguratorComponentOptics: import("@salsita-ai/common/utils").Selector<import("../index.js").SpecSelectorState, readonly import("../index.js").AnyDomainComponentOptic[]>;
|
|
@@ -100,7 +100,7 @@ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<str
|
|
|
100
100
|
getAdminPreset: () => import("../index.js").AnyProductPreset;
|
|
101
101
|
getAdminModelVersion: () => number;
|
|
102
102
|
getThemeOptions: () => import("@mui/material").ThemeOptions;
|
|
103
|
-
getAssistant: () => import("../index.js").AssistantManifest | null;
|
|
103
|
+
getAssistant: () => Required<import("../index.js").AssistantManifest> | null;
|
|
104
104
|
getConfiguratorFactory: () => import("../index.js").AnyDomainFactory;
|
|
105
105
|
getAdminFactory: () => import("../index.js").AnyDomainFactory;
|
|
106
106
|
getConfiguratorComponentOptics: () => readonly import("../index.js").AnyDomainComponentOptic[];
|