@player-ui/types 0.15.4--canary.881.37421 → 0.15.4--canary.885.37636
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/cjs/index.cjs.map +1 -1
- package/dist/xlr/Flow.json +0 -112
- package/dist/xlr/Navigation.json +0 -112
- package/dist/xlr/NavigationFlow.json +0 -112
- package/dist/xlr/NavigationFlowActionState.json +0 -14
- package/dist/xlr/NavigationFlowAsyncActionState.json +0 -14
- package/dist/xlr/NavigationFlowExternalState.json +0 -14
- package/dist/xlr/NavigationFlowFlowState.json +0 -14
- package/dist/xlr/NavigationFlowState.json +0 -70
- package/dist/xlr/NavigationFlowTransitionableState.json +0 -14
- package/dist/xlr/NavigationFlowViewState.json +0 -14
- package/package.json +1 -1
- package/src/index.ts +9 -32
- package/types/index.d.ts +1 -16
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/types/src/index.ts"],"sourcesContent":["/**\n * An asset is the smallest unit of user interaction in a player view\n */\nexport interface Asset<T extends string = string> {\n /** Each asset requires a unique id per view */\n id: string;\n\n /** The asset type determines the semantics of how a user interacts with a page */\n type: T;\n\n [key: string]: unknown;\n}\n/**\n * An asset that contains a Binding.\n */\nexport interface AssetBinding extends Asset {\n /** A binding that points to somewhere in the data model */\n binding: Binding;\n}\n\n/** A single case statement to use in a switch */\nexport interface SwitchCase<T extends Asset = Asset> {\n /** The Asset to use if this case is applicable */\n asset: T;\n\n /** An expression to execute to determine if this case applies */\n case: Expression | true;\n}\n\n/** A switch can replace an asset with the applicable case on first render */\nexport type Switch<T extends Asset = Asset> = SwitchCase<T>[];\n\n/** An object that contains an asset */\nexport type AssetWrapper<T extends Asset = Asset> = {\n /** An asset instance */\n asset: T;\n\n [key: string]: unknown;\n};\n\nexport type AssetWrapperOrSwitch<T extends Asset = Asset> =\n | (AssetWrapper<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n dynamicSwitch?: never;\n\n /** The staticSwitch property can't exist at the same time as 'asset' */\n staticSwitch?: never;\n })\n | (StaticSwitch<T> & {\n /** The staticSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The staticSwitch property can't exist at the same time as 'dynamicSwitch' */\n dynamicSwitch?: never;\n })\n | (DynamicSwitch<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The dynamicSwitch property can't exist at the same time as 'staticSwitch' */\n staticSwitch?: never;\n });\n\nexport type AssetSwitch<T extends Asset = Asset> =\n | StaticSwitch<T>\n | DynamicSwitch<T>;\n\nexport interface StaticSwitch<T extends Asset = Asset> {\n /** A static switch only evaluates the applicable base on first render of the view */\n staticSwitch: Switch<T>;\n}\n\nexport interface DynamicSwitch<T extends Asset = Asset> {\n /** A dynamic switch re-evaluates the applicable case as data changes */\n dynamicSwitch: Switch<T>;\n}\n\n/**\n * Expressions are a specialized way of executing code.\n * If the expression is a composite, the last expression executed is the return value\n */\nexport type Expression = string | string[];\nexport type ExpressionRef = `@[${string}]@`;\n\n/**\n * Bindings describe locations in the data model.\n */\nexport type Binding = string;\nexport type BindingRef = `{{${Binding}}}`;\n\n/**\n * The data-model is the location that all user data is stored\n */\nexport type DataModel = Record<any, unknown>;\n\n/** The navigation section of the flow describes a State Machine for the user. */\nexport type Navigation = {\n /** The name of the Flow to begin on */\n BEGIN: string;\n} & Record<string, string | NavigationFlow>;\n\n/** An object with an expression in it */\nexport interface ExpressionObject {\n /** The expression to run */\n exp?: Expression;\n}\n\n/** A state machine in the navigation */\nexport interface NavigationFlow {\n /** The first state to kick off the state machine */\n startState: string;\n\n /** An optional expression to run when this Flow starts */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run when this Flow ends */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * An optional flow-level transitions map (fallback when node-level is not defined).\n * Used as a fallback when the current state doesn't have a transition defined.\n */\n transitions?: NavigationFlowTransition;\n\n /**\n * Optional flow-level error transitions map.\n * Maps error types directly to state names (no indirection through transitions map).\n */\n errorTransitions?: Record<string, string>;\n\n [key: string]:\n | undefined\n | string\n | Expression\n | ExpressionObject\n | NavigationFlowState\n | NavigationFlowTransition;\n}\n\nexport type NavigationFlowTransition = Record<string, string>;\n\ninterface CommentBase {\n /** Add comments that will not be processing, but are useful for code explanation */\n _comment?: string;\n}\n\n/** The base representation of a state within a Flow */\nexport interface NavigationBaseState<T extends string> extends CommentBase {\n /** A property to determine the type of state this is */\n state_type: T;\n\n /** An optional expression to run when this view renders */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run before view transition */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * TS gets really confused with both the ActionState and the onStart state both declaring the `exp` property\n * So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'\n */\n exp?: T extends \"ACTION\" | \"ASYNC_ACTION\" ? Expression : never;\n}\n\n/** A generic state that can transition to another state */\nexport interface NavigationFlowTransitionableState<T extends string>\n extends NavigationBaseState<T> {\n /** A mapping of transition-name to FlowState name */\n transitions: NavigationFlowTransition;\n\n /**\n * Optional error transitions map.\n * Maps error types directly to state names (no indirection through transitions map).\n */\n errorTransitions?: Record<string, string>;\n}\n\n/** A state representing a view */\nexport interface NavigationFlowViewState\n extends NavigationFlowTransitionableState<\"VIEW\"> {\n /** An id corresponding to a view from the 'views' array */\n ref: string;\n\n /** View meta-properties */\n attributes?: {\n [key: string]: any;\n };\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/**\n * An END state of the flow.\n */\nexport interface NavigationFlowEndState extends NavigationBaseState<\"END\"> {\n /**\n * A description of _how_ the flow ended.\n * If this is a flow started from another flow, the outcome determines the flow transition\n */\n outcome: string;\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowActionState\n extends NavigationFlowTransitionableState<\"ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowAsyncActionState\n extends NavigationFlowTransitionableState<\"ASYNC_ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n\n /** Whether the expression(s) should be awaited before transitioning */\n await: boolean;\n}\n\n/**\n * External Flow states represent states in the FSM that can't be resolved internally in Player.\n * The flow will wait for the embedded application to manage moving to the next state via a transition\n */\nexport interface NavigationFlowExternalState\n extends NavigationFlowTransitionableState<\"EXTERNAL\"> {\n /** A reference for this external state */\n ref: string;\n /** Any additional properties are forwarded as options */\n [key: string]: unknown;\n}\n\nexport interface NavigationFlowFlowState\n extends NavigationFlowTransitionableState<\"FLOW\"> {\n /** A reference to a FLOW id state to run */\n ref: string;\n}\n\nexport type NavigationFlowState =\n | NavigationFlowViewState\n | NavigationFlowEndState\n | NavigationFlowFlowState\n | NavigationFlowActionState\n | NavigationFlowAsyncActionState\n | NavigationFlowExternalState;\n\n/** The data at the end of a flow */\nexport interface FlowResult {\n /** The outcome describes _how_ the flow ended (forwards, backwards, etc) */\n endState: NavigationFlowEndState;\n\n /** The serialized data-model */\n data?: any;\n}\n\n/** Any object that contains 1 or more templates */\nexport interface Templatable {\n /** A list of templates to process for this node */\n template?: Template[];\n}\n\n/** A template describes a mapping from a data array -> array of objects */\nexport interface Template<ValueType = unknown, Key extends string = string> {\n /** A pointer to the data-model containing an array of elements to map over */\n data: Binding;\n\n /**\n * The template to iterate over using each value in the supplied template data.\n * Any reference to _index_ is replaced with the current iteration index.\n */\n value: ValueType;\n\n /** should the template be recomputed when data changes */\n dynamic?: boolean;\n\n /**\n * A property on the parent object to store the new map under.\n * If it already exists, values are appended to the end.\n */\n output: Key;\n\n /** Specifies the template placement in relation to existing elements*/\n placement?: \"prepend\" | \"append\";\n}\n\n/**\n * The Schema organizes all content related to Data and it's types\n */\nexport declare namespace Schema {\n /** The authored schema object in the JSON payload */\n export interface Schema {\n /** The ROOT object is the top level object to use */\n ROOT: Node;\n\n /** Any additional keys are properties of the ROOT object */\n [key: string]: Node;\n }\n\n /** A Node describes a specific object in the tree */\n export interface Node {\n /** Each property describes a property of the object */\n [key: string]: DataTypes;\n }\n\n export type DataTypes = DataType | RecordType | ArrayType;\n\n /** Each prop in the object can have a specific DataType */\n export interface DataType<T = unknown> {\n /** The reference of the base type to use */\n type: string;\n\n /**\n * Any additional validations that are associated with this property\n * These will add to any base validations associated with the \"type\"\n */\n validation?: Validation.Reference[];\n\n /**\n * A reference to a specific data format to use.\n * If none is specified, will fallback to that of the base type\n */\n format?: Formatting.Reference;\n\n /**\n * A default value for this property.\n * Any reads for this property will result in this default value being written to the model.\n */\n default?: T;\n\n /** Any additional options */\n [key: string]: unknown;\n }\n /** Determines if the Datatype is a record object */\n export interface RecordType extends DataType {\n /** boolean to define if its a record */\n isRecord: boolean;\n\n /** This property is mutually exclusive with RecordType and can not be used with ArrayType */\n isArray?: never;\n }\n\n /** Determines if the DataType is an Array Object */\n export interface ArrayType extends DataType {\n /** boolean to define if its an array */\n isArray: boolean;\n\n /** This property is mutually exclusive with ArrayType and can not be used with RecordType */\n isRecord?: never;\n }\n}\n\n/** Namespace to wrap up core functionality to be used by the Language Service */\nexport declare namespace Language {\n /**\n * Helper to compliment `Schema.DataType` to provide a way to export a reference to a data type instead of the whole object\n */\n export interface DataTypeRef {\n /** Name of the type in Player Core */\n type: string;\n }\n}\n\n/** A spot for formatting */\nexport declare namespace Formatting {\n /** A reference to a specific formatter */\n export interface Reference {\n /** The name of the formatter (and de-formatter) to use */\n type: string;\n\n /** Any additional properties will be passed as options to the formatter function */\n [key: string]: unknown;\n }\n}\n\n/** A space for all thing validation */\nexport declare namespace Validation {\n /**\n * How serious are you about this error?\n * Warning validations are reserved for errors that could be ignored by the user without consequence\n * Errors must be fixed before proceeding\n */\n export type Severity = \"error\" | \"warning\";\n\n /**\n * When to _first_ start caring about a validation of a data-val.\n *\n * load - only check once the first time the binding appears on screen\n * change - check anytime the data changes\n * navigation - check once the user attempts to navigate away from a view\n */\n export type Trigger = \"navigation\" | \"change\" | \"load\";\n\n /**\n * Where the error/warning should be displayed.\n * - `field` is the default display target. This renders the error/warning directly underneath the field.\n * - `section` is used to display a message at a parent node that is designated as a \"section\"\n * - `page` a special section used to display a message at the top of the page.\n */\n export type DisplayTarget = \"page\" | \"section\" | \"field\";\n\n /** A reference to a validation object */\n export interface Reference {\n /**\n * The name of the referenced validation type\n * This will be used to lookup the proper handler\n */\n type: string;\n\n /** An optional means of overriding the default message if the validation is triggered */\n message?: string;\n\n /** An optional means of overriding the default severity of the validation if triggered */\n severity?: Severity;\n\n /** When to run this particular validation */\n trigger?: Trigger;\n\n /**\n * Each validation is passed the value of the data to run it's validation against.\n * By default, this is the value stored in the data-model (deformatted).\n * In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option\n */\n dataTarget?: \"formatted\" | \"deformatted\";\n\n /** Where the error should be displayed */\n displayTarget?: DisplayTarget;\n\n /**\n * If the validation blocks navigation\n * true/false - always/never block navigation\n * once - only block navigation if the validation has not been triggered before\n *\n * @default - true for errors, 'once' for warnings\n */\n blocking?: boolean | \"once\";\n\n /** Additional props to send down to a Validator */\n [key: string]: unknown;\n }\n\n export interface CrossfieldReference extends Reference {\n /** The binding to associate this validation with */\n ref?: Binding;\n\n /** Cross-field references and validation must run against the default (deformatted) value */\n dataTarget?: never;\n }\n}\n\nexport type View<T extends Asset = Asset> = unknown extends T[\"validation\"]\n ? T & {\n /** Each view can optionally supply a list of validations to run against a particular view */\n validation?: Array<Validation.CrossfieldReference>;\n }\n : T;\n\n/**\n * The JSON payload for running Player\n */\nexport interface Flow<T extends Asset = Asset> {\n /** A unique identifier for the flow */\n id: string;\n\n /** A list of views (each with an ID) that can be shown to a user */\n views?: Array<View<T>>;\n\n /**\n * The schema for the supplied (or referenced data).\n * This is used for validation, formatting, etc\n */\n schema?: Schema.Schema;\n\n /** Any initial data that the flow can use */\n data?: DataModel;\n\n /** A state machine to drive a user through the experience */\n navigation: Navigation;\n\n /** Other keys can be present. We just don't know what they are */\n [key: string]: unknown;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/types/src/index.ts"],"sourcesContent":["/**\n * An asset is the smallest unit of user interaction in a player view\n */\nexport interface Asset<T extends string = string> {\n /** Each asset requires a unique id per view */\n id: string;\n\n /** The asset type determines the semantics of how a user interacts with a page */\n type: T;\n\n [key: string]: unknown;\n}\n/**\n * An asset that contains a Binding.\n */\nexport interface AssetBinding extends Asset {\n /** A binding that points to somewhere in the data model */\n binding: Binding;\n}\n\n/** A single case statement to use in a switch */\nexport interface SwitchCase<T extends Asset = Asset> {\n /** The Asset to use if this case is applicable */\n asset: T;\n\n /** An expression to execute to determine if this case applies */\n case: Expression | true;\n}\n\n/** A switch can replace an asset with the applicable case on first render */\nexport type Switch<T extends Asset = Asset> = SwitchCase<T>[];\n\n/** An object that contains an asset */\nexport type AssetWrapper<T extends Asset = Asset> = {\n /** An asset instance */\n asset: T;\n\n [key: string]: unknown;\n};\n\nexport type AssetWrapperOrSwitch<T extends Asset = Asset> =\n | (AssetWrapper<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n dynamicSwitch?: never;\n\n /** The staticSwitch property can't exist at the same time as 'asset' */\n staticSwitch?: never;\n })\n | (StaticSwitch<T> & {\n /** The staticSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The staticSwitch property can't exist at the same time as 'dynamicSwitch' */\n dynamicSwitch?: never;\n })\n | (DynamicSwitch<T> & {\n /** The dynamicSwitch property can't exist at the same time as 'asset' */\n asset?: never;\n\n /** The dynamicSwitch property can't exist at the same time as 'staticSwitch' */\n staticSwitch?: never;\n });\n\nexport type AssetSwitch<T extends Asset = Asset> =\n | StaticSwitch<T>\n | DynamicSwitch<T>;\n\nexport interface StaticSwitch<T extends Asset = Asset> {\n /** A static switch only evaluates the applicable base on first render of the view */\n staticSwitch: Switch<T>;\n}\n\nexport interface DynamicSwitch<T extends Asset = Asset> {\n /** A dynamic switch re-evaluates the applicable case as data changes */\n dynamicSwitch: Switch<T>;\n}\n\n/**\n * Expressions are a specialized way of executing code.\n * If the expression is a composite, the last expression executed is the return value\n */\nexport type Expression = string | string[];\nexport type ExpressionRef = `@[${string}]@`;\n\n/**\n * Bindings describe locations in the data model.\n */\nexport type Binding = string;\nexport type BindingRef = `{{${Binding}}}`;\n\n/**\n * The data-model is the location that all user data is stored\n */\nexport type DataModel = Record<any, unknown>;\n\n/** The navigation section of the flow describes a State Machine for the user. */\nexport type Navigation = {\n /** The name of the Flow to begin on */\n BEGIN: string;\n} & Record<string, string | NavigationFlow>;\n\n/** An object with an expression in it */\nexport interface ExpressionObject {\n /** The expression to run */\n exp?: Expression;\n}\n\n/** A state machine in the navigation */\nexport interface NavigationFlow {\n /** The first state to kick off the state machine */\n startState: string;\n\n /** An optional expression to run when this Flow starts */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run when this Flow ends */\n onEnd?: Expression | ExpressionObject;\n\n [key: string]:\n | undefined\n | string\n | Expression\n | ExpressionObject\n | NavigationFlowState;\n}\n\nexport type NavigationFlowTransition = Record<string, string>;\n\ninterface CommentBase {\n /** Add comments that will not be processing, but are useful for code explanation */\n _comment?: string;\n}\n\n/** The base representation of a state within a Flow */\nexport interface NavigationBaseState<T extends string> extends CommentBase {\n /** A property to determine the type of state this is */\n state_type: T;\n\n /** An optional expression to run when this view renders */\n onStart?: Expression | ExpressionObject;\n\n /** An optional expression to run before view transition */\n onEnd?: Expression | ExpressionObject;\n\n /**\n * TS gets really confused with both the ActionState and the onStart state both declaring the `exp` property\n * So this explicity says there should never be an exp prop on a state node that's not of type 'ACTION'\n */\n exp?: T extends \"ACTION\" | \"ASYNC_ACTION\" ? Expression : never;\n}\n\n/** A generic state that can transition to another state */\nexport interface NavigationFlowTransitionableState<\n T extends string,\n> extends NavigationBaseState<T> {\n /** A mapping of transition-name to FlowState name */\n transitions: NavigationFlowTransition;\n}\n\n/** A state representing a view */\nexport interface NavigationFlowViewState extends NavigationFlowTransitionableState<\"VIEW\"> {\n /** An id corresponding to a view from the 'views' array */\n ref: string;\n\n /** View meta-properties */\n attributes?: {\n [key: string]: any;\n };\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/**\n * An END state of the flow.\n */\nexport interface NavigationFlowEndState extends NavigationBaseState<\"END\"> {\n /**\n * A description of _how_ the flow ended.\n * If this is a flow started from another flow, the outcome determines the flow transition\n */\n outcome: string;\n\n /** Any additional properties are forwarded as options, like param */\n [key: string]: unknown;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowActionState extends NavigationFlowTransitionableState<\"ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n}\n\n/** Action states execute an expression to determine the next state to transition to */\nexport interface NavigationFlowAsyncActionState extends NavigationFlowTransitionableState<\"ASYNC_ACTION\"> {\n /**\n * An expression to execute.\n * The return value determines the transition to take\n */\n exp: Expression;\n\n /** Whether the expression(s) should be awaited before transitioning */\n await: boolean;\n}\n\n/**\n * External Flow states represent states in the FSM that can't be resolved internally in Player.\n * The flow will wait for the embedded application to manage moving to the next state via a transition\n */\nexport interface NavigationFlowExternalState extends NavigationFlowTransitionableState<\"EXTERNAL\"> {\n /** A reference for this external state */\n ref: string;\n /** Any additional properties are forwarded as options */\n [key: string]: unknown;\n}\n\nexport interface NavigationFlowFlowState extends NavigationFlowTransitionableState<\"FLOW\"> {\n /** A reference to a FLOW id state to run */\n ref: string;\n}\n\nexport type NavigationFlowState =\n | NavigationFlowViewState\n | NavigationFlowEndState\n | NavigationFlowFlowState\n | NavigationFlowActionState\n | NavigationFlowAsyncActionState\n | NavigationFlowExternalState;\n\n/** The data at the end of a flow */\nexport interface FlowResult {\n /** The outcome describes _how_ the flow ended (forwards, backwards, etc) */\n endState: NavigationFlowEndState;\n\n /** The serialized data-model */\n data?: any;\n}\n\n/** Any object that contains 1 or more templates */\nexport interface Templatable {\n /** A list of templates to process for this node */\n template?: Template[];\n}\n\n/** A template describes a mapping from a data array -> array of objects */\nexport interface Template<ValueType = unknown, Key extends string = string> {\n /** A pointer to the data-model containing an array of elements to map over */\n data: Binding;\n\n /**\n * The template to iterate over using each value in the supplied template data.\n * Any reference to _index_ is replaced with the current iteration index.\n */\n value: ValueType;\n\n /** should the template be recomputed when data changes */\n dynamic?: boolean;\n\n /**\n * A property on the parent object to store the new map under.\n * If it already exists, values are appended to the end.\n */\n output: Key;\n\n /** Specifies the template placement in relation to existing elements*/\n placement?: \"prepend\" | \"append\";\n}\n\n/**\n * The Schema organizes all content related to Data and it's types\n */\nexport declare namespace Schema {\n /** The authored schema object in the JSON payload */\n export interface Schema {\n /** The ROOT object is the top level object to use */\n ROOT: Node;\n\n /** Any additional keys are properties of the ROOT object */\n [key: string]: Node;\n }\n\n /** A Node describes a specific object in the tree */\n export interface Node {\n /** Each property describes a property of the object */\n [key: string]: DataTypes;\n }\n\n export type DataTypes = DataType | RecordType | ArrayType;\n\n /** Each prop in the object can have a specific DataType */\n export interface DataType<T = unknown> {\n /** The reference of the base type to use */\n type: string;\n\n /**\n * Any additional validations that are associated with this property\n * These will add to any base validations associated with the \"type\"\n */\n validation?: Validation.Reference[];\n\n /**\n * A reference to a specific data format to use.\n * If none is specified, will fallback to that of the base type\n */\n format?: Formatting.Reference;\n\n /**\n * A default value for this property.\n * Any reads for this property will result in this default value being written to the model.\n */\n default?: T;\n\n /** Any additional options */\n [key: string]: unknown;\n }\n /** Determines if the Datatype is a record object */\n export interface RecordType extends DataType {\n /** boolean to define if its a record */\n isRecord: boolean;\n\n /** This property is mutually exclusive with RecordType and can not be used with ArrayType */\n isArray?: never;\n }\n\n /** Determines if the DataType is an Array Object */\n export interface ArrayType extends DataType {\n /** boolean to define if its an array */\n isArray: boolean;\n\n /** This property is mutually exclusive with ArrayType and can not be used with RecordType */\n isRecord?: never;\n }\n}\n\n/** Namespace to wrap up core functionality to be used by the Language Service */\nexport declare namespace Language {\n /**\n * Helper to compliment `Schema.DataType` to provide a way to export a reference to a data type instead of the whole object\n */\n export interface DataTypeRef {\n /** Name of the type in Player Core */\n type: string;\n }\n}\n\n/** A spot for formatting */\nexport declare namespace Formatting {\n /** A reference to a specific formatter */\n export interface Reference {\n /** The name of the formatter (and de-formatter) to use */\n type: string;\n\n /** Any additional properties will be passed as options to the formatter function */\n [key: string]: unknown;\n }\n}\n\n/** A space for all thing validation */\nexport declare namespace Validation {\n /**\n * How serious are you about this error?\n * Warning validations are reserved for errors that could be ignored by the user without consequence\n * Errors must be fixed before proceeding\n */\n export type Severity = \"error\" | \"warning\";\n\n /**\n * When to _first_ start caring about a validation of a data-val.\n *\n * load - only check once the first time the binding appears on screen\n * change - check anytime the data changes\n * navigation - check once the user attempts to navigate away from a view\n */\n export type Trigger = \"navigation\" | \"change\" | \"load\";\n\n /**\n * Where the error/warning should be displayed.\n * - `field` is the default display target. This renders the error/warning directly underneath the field.\n * - `section` is used to display a message at a parent node that is designated as a \"section\"\n * - `page` a special section used to display a message at the top of the page.\n */\n export type DisplayTarget = \"page\" | \"section\" | \"field\";\n\n /** A reference to a validation object */\n export interface Reference {\n /**\n * The name of the referenced validation type\n * This will be used to lookup the proper handler\n */\n type: string;\n\n /** An optional means of overriding the default message if the validation is triggered */\n message?: string;\n\n /** An optional means of overriding the default severity of the validation if triggered */\n severity?: Severity;\n\n /** When to run this particular validation */\n trigger?: Trigger;\n\n /**\n * Each validation is passed the value of the data to run it's validation against.\n * By default, this is the value stored in the data-model (deformatted).\n * In the off chance you'd like this validator to run against the formatted value (the one the user sees), set this option\n */\n dataTarget?: \"formatted\" | \"deformatted\";\n\n /** Where the error should be displayed */\n displayTarget?: DisplayTarget;\n\n /**\n * If the validation blocks navigation\n * true/false - always/never block navigation\n * once - only block navigation if the validation has not been triggered before\n *\n * @default - true for errors, 'once' for warnings\n */\n blocking?: boolean | \"once\";\n\n /** Additional props to send down to a Validator */\n [key: string]: unknown;\n }\n\n export interface CrossfieldReference extends Reference {\n /** The binding to associate this validation with */\n ref?: Binding;\n\n /** Cross-field references and validation must run against the default (deformatted) value */\n dataTarget?: never;\n }\n}\n\nexport type View<T extends Asset = Asset> = unknown extends T[\"validation\"]\n ? T & {\n /** Each view can optionally supply a list of validations to run against a particular view */\n validation?: Array<Validation.CrossfieldReference>;\n }\n : T;\n\n/**\n * The JSON payload for running Player\n */\nexport interface Flow<T extends Asset = Asset> {\n /** A unique identifier for the flow */\n id: string;\n\n /** A list of views (each with an ID) that can be shown to a user */\n views?: Array<View<T>>;\n\n /**\n * The schema for the supplied (or referenced data).\n * This is used for validation, formatting, etc\n */\n schema?: Schema.Schema;\n\n /** Any initial data that the flow can use */\n data?: DataModel;\n\n /** A state machine to drive a user through the experience */\n navigation: Navigation;\n\n /** Other keys can be present. We just don't know what they are */\n [key: string]: unknown;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/xlr/Flow.json
CHANGED
|
@@ -1582,36 +1582,6 @@
|
|
|
1582
1582
|
"title": "NavigationFlow.onEnd",
|
|
1583
1583
|
"description": "An optional expression to run when this Flow ends"
|
|
1584
1584
|
}
|
|
1585
|
-
},
|
|
1586
|
-
"transitions": {
|
|
1587
|
-
"required": false,
|
|
1588
|
-
"node": {
|
|
1589
|
-
"source": "core/types/src/index.ts",
|
|
1590
|
-
"name": "NavigationFlowTransition",
|
|
1591
|
-
"type": "record",
|
|
1592
|
-
"keyType": {
|
|
1593
|
-
"type": "string"
|
|
1594
|
-
},
|
|
1595
|
-
"valueType": {
|
|
1596
|
-
"type": "string"
|
|
1597
|
-
},
|
|
1598
|
-
"title": "NavigationFlow.transitions",
|
|
1599
|
-
"description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
|
|
1600
|
-
}
|
|
1601
|
-
},
|
|
1602
|
-
"errorTransitions": {
|
|
1603
|
-
"required": false,
|
|
1604
|
-
"node": {
|
|
1605
|
-
"type": "record",
|
|
1606
|
-
"keyType": {
|
|
1607
|
-
"type": "string"
|
|
1608
|
-
},
|
|
1609
|
-
"valueType": {
|
|
1610
|
-
"type": "string"
|
|
1611
|
-
},
|
|
1612
|
-
"title": "NavigationFlow.errorTransitions",
|
|
1613
|
-
"description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
1614
|
-
}
|
|
1615
1585
|
}
|
|
1616
1586
|
},
|
|
1617
1587
|
"additionalProperties": {
|
|
@@ -1764,20 +1734,6 @@
|
|
|
1764
1734
|
"description": "A mapping of transition-name to FlowState name"
|
|
1765
1735
|
}
|
|
1766
1736
|
},
|
|
1767
|
-
"errorTransitions": {
|
|
1768
|
-
"required": false,
|
|
1769
|
-
"node": {
|
|
1770
|
-
"type": "record",
|
|
1771
|
-
"keyType": {
|
|
1772
|
-
"type": "string"
|
|
1773
|
-
},
|
|
1774
|
-
"valueType": {
|
|
1775
|
-
"type": "string"
|
|
1776
|
-
},
|
|
1777
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
1778
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
1779
|
-
}
|
|
1780
|
-
},
|
|
1781
1737
|
"ref": {
|
|
1782
1738
|
"required": true,
|
|
1783
1739
|
"node": {
|
|
@@ -2030,20 +1986,6 @@
|
|
|
2030
1986
|
"description": "A mapping of transition-name to FlowState name"
|
|
2031
1987
|
}
|
|
2032
1988
|
},
|
|
2033
|
-
"errorTransitions": {
|
|
2034
|
-
"required": false,
|
|
2035
|
-
"node": {
|
|
2036
|
-
"type": "record",
|
|
2037
|
-
"keyType": {
|
|
2038
|
-
"type": "string"
|
|
2039
|
-
},
|
|
2040
|
-
"valueType": {
|
|
2041
|
-
"type": "string"
|
|
2042
|
-
},
|
|
2043
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
2044
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
2045
|
-
}
|
|
2046
|
-
},
|
|
2047
1989
|
"ref": {
|
|
2048
1990
|
"required": true,
|
|
2049
1991
|
"node": {
|
|
@@ -2170,20 +2112,6 @@
|
|
|
2170
2112
|
"title": "NavigationFlowTransitionableState.transitions",
|
|
2171
2113
|
"description": "A mapping of transition-name to FlowState name"
|
|
2172
2114
|
}
|
|
2173
|
-
},
|
|
2174
|
-
"errorTransitions": {
|
|
2175
|
-
"required": false,
|
|
2176
|
-
"node": {
|
|
2177
|
-
"type": "record",
|
|
2178
|
-
"keyType": {
|
|
2179
|
-
"type": "string"
|
|
2180
|
-
},
|
|
2181
|
-
"valueType": {
|
|
2182
|
-
"type": "string"
|
|
2183
|
-
},
|
|
2184
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
2185
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
2186
|
-
}
|
|
2187
2115
|
}
|
|
2188
2116
|
},
|
|
2189
2117
|
"additionalProperties": false,
|
|
@@ -2305,20 +2233,6 @@
|
|
|
2305
2233
|
"description": "A mapping of transition-name to FlowState name"
|
|
2306
2234
|
}
|
|
2307
2235
|
},
|
|
2308
|
-
"errorTransitions": {
|
|
2309
|
-
"required": false,
|
|
2310
|
-
"node": {
|
|
2311
|
-
"type": "record",
|
|
2312
|
-
"keyType": {
|
|
2313
|
-
"type": "string"
|
|
2314
|
-
},
|
|
2315
|
-
"valueType": {
|
|
2316
|
-
"type": "string"
|
|
2317
|
-
},
|
|
2318
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
2319
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
2320
|
-
}
|
|
2321
|
-
},
|
|
2322
2236
|
"await": {
|
|
2323
2237
|
"required": true,
|
|
2324
2238
|
"node": {
|
|
@@ -2445,20 +2359,6 @@
|
|
|
2445
2359
|
"description": "A mapping of transition-name to FlowState name"
|
|
2446
2360
|
}
|
|
2447
2361
|
},
|
|
2448
|
-
"errorTransitions": {
|
|
2449
|
-
"required": false,
|
|
2450
|
-
"node": {
|
|
2451
|
-
"type": "record",
|
|
2452
|
-
"keyType": {
|
|
2453
|
-
"type": "string"
|
|
2454
|
-
},
|
|
2455
|
-
"valueType": {
|
|
2456
|
-
"type": "string"
|
|
2457
|
-
},
|
|
2458
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
2459
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
2460
|
-
}
|
|
2461
|
-
},
|
|
2462
2362
|
"ref": {
|
|
2463
2363
|
"required": true,
|
|
2464
2364
|
"node": {
|
|
@@ -2476,18 +2376,6 @@
|
|
|
2476
2376
|
}
|
|
2477
2377
|
],
|
|
2478
2378
|
"title": "NavigationFlowState"
|
|
2479
|
-
},
|
|
2480
|
-
{
|
|
2481
|
-
"source": "core/types/src/index.ts",
|
|
2482
|
-
"name": "NavigationFlowTransition",
|
|
2483
|
-
"type": "record",
|
|
2484
|
-
"keyType": {
|
|
2485
|
-
"type": "string"
|
|
2486
|
-
},
|
|
2487
|
-
"valueType": {
|
|
2488
|
-
"type": "string"
|
|
2489
|
-
},
|
|
2490
|
-
"title": "NavigationFlowTransition"
|
|
2491
2379
|
}
|
|
2492
2380
|
]
|
|
2493
2381
|
},
|
package/dist/xlr/Navigation.json
CHANGED
|
@@ -108,36 +108,6 @@
|
|
|
108
108
|
"title": "NavigationFlow.onEnd",
|
|
109
109
|
"description": "An optional expression to run when this Flow ends"
|
|
110
110
|
}
|
|
111
|
-
},
|
|
112
|
-
"transitions": {
|
|
113
|
-
"required": false,
|
|
114
|
-
"node": {
|
|
115
|
-
"source": "core/types/src/index.ts",
|
|
116
|
-
"name": "NavigationFlowTransition",
|
|
117
|
-
"type": "record",
|
|
118
|
-
"keyType": {
|
|
119
|
-
"type": "string"
|
|
120
|
-
},
|
|
121
|
-
"valueType": {
|
|
122
|
-
"type": "string"
|
|
123
|
-
},
|
|
124
|
-
"title": "NavigationFlow.transitions",
|
|
125
|
-
"description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"errorTransitions": {
|
|
129
|
-
"required": false,
|
|
130
|
-
"node": {
|
|
131
|
-
"type": "record",
|
|
132
|
-
"keyType": {
|
|
133
|
-
"type": "string"
|
|
134
|
-
},
|
|
135
|
-
"valueType": {
|
|
136
|
-
"type": "string"
|
|
137
|
-
},
|
|
138
|
-
"title": "NavigationFlow.errorTransitions",
|
|
139
|
-
"description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
140
|
-
}
|
|
141
111
|
}
|
|
142
112
|
},
|
|
143
113
|
"additionalProperties": {
|
|
@@ -290,20 +260,6 @@
|
|
|
290
260
|
"description": "A mapping of transition-name to FlowState name"
|
|
291
261
|
}
|
|
292
262
|
},
|
|
293
|
-
"errorTransitions": {
|
|
294
|
-
"required": false,
|
|
295
|
-
"node": {
|
|
296
|
-
"type": "record",
|
|
297
|
-
"keyType": {
|
|
298
|
-
"type": "string"
|
|
299
|
-
},
|
|
300
|
-
"valueType": {
|
|
301
|
-
"type": "string"
|
|
302
|
-
},
|
|
303
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
304
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
263
|
"ref": {
|
|
308
264
|
"required": true,
|
|
309
265
|
"node": {
|
|
@@ -556,20 +512,6 @@
|
|
|
556
512
|
"description": "A mapping of transition-name to FlowState name"
|
|
557
513
|
}
|
|
558
514
|
},
|
|
559
|
-
"errorTransitions": {
|
|
560
|
-
"required": false,
|
|
561
|
-
"node": {
|
|
562
|
-
"type": "record",
|
|
563
|
-
"keyType": {
|
|
564
|
-
"type": "string"
|
|
565
|
-
},
|
|
566
|
-
"valueType": {
|
|
567
|
-
"type": "string"
|
|
568
|
-
},
|
|
569
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
570
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
571
|
-
}
|
|
572
|
-
},
|
|
573
515
|
"ref": {
|
|
574
516
|
"required": true,
|
|
575
517
|
"node": {
|
|
@@ -696,20 +638,6 @@
|
|
|
696
638
|
"title": "NavigationFlowTransitionableState.transitions",
|
|
697
639
|
"description": "A mapping of transition-name to FlowState name"
|
|
698
640
|
}
|
|
699
|
-
},
|
|
700
|
-
"errorTransitions": {
|
|
701
|
-
"required": false,
|
|
702
|
-
"node": {
|
|
703
|
-
"type": "record",
|
|
704
|
-
"keyType": {
|
|
705
|
-
"type": "string"
|
|
706
|
-
},
|
|
707
|
-
"valueType": {
|
|
708
|
-
"type": "string"
|
|
709
|
-
},
|
|
710
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
711
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
712
|
-
}
|
|
713
641
|
}
|
|
714
642
|
},
|
|
715
643
|
"additionalProperties": false,
|
|
@@ -831,20 +759,6 @@
|
|
|
831
759
|
"description": "A mapping of transition-name to FlowState name"
|
|
832
760
|
}
|
|
833
761
|
},
|
|
834
|
-
"errorTransitions": {
|
|
835
|
-
"required": false,
|
|
836
|
-
"node": {
|
|
837
|
-
"type": "record",
|
|
838
|
-
"keyType": {
|
|
839
|
-
"type": "string"
|
|
840
|
-
},
|
|
841
|
-
"valueType": {
|
|
842
|
-
"type": "string"
|
|
843
|
-
},
|
|
844
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
845
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
846
|
-
}
|
|
847
|
-
},
|
|
848
762
|
"await": {
|
|
849
763
|
"required": true,
|
|
850
764
|
"node": {
|
|
@@ -971,20 +885,6 @@
|
|
|
971
885
|
"description": "A mapping of transition-name to FlowState name"
|
|
972
886
|
}
|
|
973
887
|
},
|
|
974
|
-
"errorTransitions": {
|
|
975
|
-
"required": false,
|
|
976
|
-
"node": {
|
|
977
|
-
"type": "record",
|
|
978
|
-
"keyType": {
|
|
979
|
-
"type": "string"
|
|
980
|
-
},
|
|
981
|
-
"valueType": {
|
|
982
|
-
"type": "string"
|
|
983
|
-
},
|
|
984
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
985
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
986
|
-
}
|
|
987
|
-
},
|
|
988
888
|
"ref": {
|
|
989
889
|
"required": true,
|
|
990
890
|
"node": {
|
|
@@ -1002,18 +902,6 @@
|
|
|
1002
902
|
}
|
|
1003
903
|
],
|
|
1004
904
|
"title": "NavigationFlowState"
|
|
1005
|
-
},
|
|
1006
|
-
{
|
|
1007
|
-
"source": "core/types/src/index.ts",
|
|
1008
|
-
"name": "NavigationFlowTransition",
|
|
1009
|
-
"type": "record",
|
|
1010
|
-
"keyType": {
|
|
1011
|
-
"type": "string"
|
|
1012
|
-
},
|
|
1013
|
-
"valueType": {
|
|
1014
|
-
"type": "string"
|
|
1015
|
-
},
|
|
1016
|
-
"title": "NavigationFlowTransition"
|
|
1017
905
|
}
|
|
1018
906
|
]
|
|
1019
907
|
},
|
|
@@ -78,36 +78,6 @@
|
|
|
78
78
|
"title": "NavigationFlow.onEnd",
|
|
79
79
|
"description": "An optional expression to run when this Flow ends"
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
"transitions": {
|
|
83
|
-
"required": false,
|
|
84
|
-
"node": {
|
|
85
|
-
"source": "core/types/src/index.ts",
|
|
86
|
-
"name": "NavigationFlowTransition",
|
|
87
|
-
"type": "record",
|
|
88
|
-
"keyType": {
|
|
89
|
-
"type": "string"
|
|
90
|
-
},
|
|
91
|
-
"valueType": {
|
|
92
|
-
"type": "string"
|
|
93
|
-
},
|
|
94
|
-
"title": "NavigationFlow.transitions",
|
|
95
|
-
"description": "An optional flow-level transitions map (fallback when node-level is not defined).\nUsed as a fallback when the current state doesn't have a transition defined."
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"errorTransitions": {
|
|
99
|
-
"required": false,
|
|
100
|
-
"node": {
|
|
101
|
-
"type": "record",
|
|
102
|
-
"keyType": {
|
|
103
|
-
"type": "string"
|
|
104
|
-
},
|
|
105
|
-
"valueType": {
|
|
106
|
-
"type": "string"
|
|
107
|
-
},
|
|
108
|
-
"title": "NavigationFlow.errorTransitions",
|
|
109
|
-
"description": "Optional flow-level error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
110
|
-
}
|
|
111
81
|
}
|
|
112
82
|
},
|
|
113
83
|
"additionalProperties": {
|
|
@@ -260,20 +230,6 @@
|
|
|
260
230
|
"description": "A mapping of transition-name to FlowState name"
|
|
261
231
|
}
|
|
262
232
|
},
|
|
263
|
-
"errorTransitions": {
|
|
264
|
-
"required": false,
|
|
265
|
-
"node": {
|
|
266
|
-
"type": "record",
|
|
267
|
-
"keyType": {
|
|
268
|
-
"type": "string"
|
|
269
|
-
},
|
|
270
|
-
"valueType": {
|
|
271
|
-
"type": "string"
|
|
272
|
-
},
|
|
273
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
274
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
233
|
"ref": {
|
|
278
234
|
"required": true,
|
|
279
235
|
"node": {
|
|
@@ -526,20 +482,6 @@
|
|
|
526
482
|
"description": "A mapping of transition-name to FlowState name"
|
|
527
483
|
}
|
|
528
484
|
},
|
|
529
|
-
"errorTransitions": {
|
|
530
|
-
"required": false,
|
|
531
|
-
"node": {
|
|
532
|
-
"type": "record",
|
|
533
|
-
"keyType": {
|
|
534
|
-
"type": "string"
|
|
535
|
-
},
|
|
536
|
-
"valueType": {
|
|
537
|
-
"type": "string"
|
|
538
|
-
},
|
|
539
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
540
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
541
|
-
}
|
|
542
|
-
},
|
|
543
485
|
"ref": {
|
|
544
486
|
"required": true,
|
|
545
487
|
"node": {
|
|
@@ -666,20 +608,6 @@
|
|
|
666
608
|
"title": "NavigationFlowTransitionableState.transitions",
|
|
667
609
|
"description": "A mapping of transition-name to FlowState name"
|
|
668
610
|
}
|
|
669
|
-
},
|
|
670
|
-
"errorTransitions": {
|
|
671
|
-
"required": false,
|
|
672
|
-
"node": {
|
|
673
|
-
"type": "record",
|
|
674
|
-
"keyType": {
|
|
675
|
-
"type": "string"
|
|
676
|
-
},
|
|
677
|
-
"valueType": {
|
|
678
|
-
"type": "string"
|
|
679
|
-
},
|
|
680
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
681
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
682
|
-
}
|
|
683
611
|
}
|
|
684
612
|
},
|
|
685
613
|
"additionalProperties": false,
|
|
@@ -801,20 +729,6 @@
|
|
|
801
729
|
"description": "A mapping of transition-name to FlowState name"
|
|
802
730
|
}
|
|
803
731
|
},
|
|
804
|
-
"errorTransitions": {
|
|
805
|
-
"required": false,
|
|
806
|
-
"node": {
|
|
807
|
-
"type": "record",
|
|
808
|
-
"keyType": {
|
|
809
|
-
"type": "string"
|
|
810
|
-
},
|
|
811
|
-
"valueType": {
|
|
812
|
-
"type": "string"
|
|
813
|
-
},
|
|
814
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
815
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
816
|
-
}
|
|
817
|
-
},
|
|
818
732
|
"await": {
|
|
819
733
|
"required": true,
|
|
820
734
|
"node": {
|
|
@@ -941,20 +855,6 @@
|
|
|
941
855
|
"description": "A mapping of transition-name to FlowState name"
|
|
942
856
|
}
|
|
943
857
|
},
|
|
944
|
-
"errorTransitions": {
|
|
945
|
-
"required": false,
|
|
946
|
-
"node": {
|
|
947
|
-
"type": "record",
|
|
948
|
-
"keyType": {
|
|
949
|
-
"type": "string"
|
|
950
|
-
},
|
|
951
|
-
"valueType": {
|
|
952
|
-
"type": "string"
|
|
953
|
-
},
|
|
954
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
955
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
956
|
-
}
|
|
957
|
-
},
|
|
958
858
|
"ref": {
|
|
959
859
|
"required": true,
|
|
960
860
|
"node": {
|
|
@@ -972,18 +872,6 @@
|
|
|
972
872
|
}
|
|
973
873
|
],
|
|
974
874
|
"title": "NavigationFlowState"
|
|
975
|
-
},
|
|
976
|
-
{
|
|
977
|
-
"source": "core/types/src/index.ts",
|
|
978
|
-
"name": "NavigationFlowTransition",
|
|
979
|
-
"type": "record",
|
|
980
|
-
"keyType": {
|
|
981
|
-
"type": "string"
|
|
982
|
-
},
|
|
983
|
-
"valueType": {
|
|
984
|
-
"type": "string"
|
|
985
|
-
},
|
|
986
|
-
"title": "NavigationFlowTransition"
|
|
987
875
|
}
|
|
988
876
|
]
|
|
989
877
|
},
|
|
@@ -112,20 +112,6 @@
|
|
|
112
112
|
"title": "NavigationFlowTransitionableState.transitions",
|
|
113
113
|
"description": "A mapping of transition-name to FlowState name"
|
|
114
114
|
}
|
|
115
|
-
},
|
|
116
|
-
"errorTransitions": {
|
|
117
|
-
"required": false,
|
|
118
|
-
"node": {
|
|
119
|
-
"type": "record",
|
|
120
|
-
"keyType": {
|
|
121
|
-
"type": "string"
|
|
122
|
-
},
|
|
123
|
-
"valueType": {
|
|
124
|
-
"type": "string"
|
|
125
|
-
},
|
|
126
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
127
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
128
|
-
}
|
|
129
115
|
}
|
|
130
116
|
},
|
|
131
117
|
"additionalProperties": false,
|
|
@@ -113,20 +113,6 @@
|
|
|
113
113
|
"description": "A mapping of transition-name to FlowState name"
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
-
"errorTransitions": {
|
|
117
|
-
"required": false,
|
|
118
|
-
"node": {
|
|
119
|
-
"type": "record",
|
|
120
|
-
"keyType": {
|
|
121
|
-
"type": "string"
|
|
122
|
-
},
|
|
123
|
-
"valueType": {
|
|
124
|
-
"type": "string"
|
|
125
|
-
},
|
|
126
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
127
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
116
|
"await": {
|
|
131
117
|
"required": true,
|
|
132
118
|
"node": {
|
|
@@ -111,20 +111,6 @@
|
|
|
111
111
|
"description": "A mapping of transition-name to FlowState name"
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
"errorTransitions": {
|
|
115
|
-
"required": false,
|
|
116
|
-
"node": {
|
|
117
|
-
"type": "record",
|
|
118
|
-
"keyType": {
|
|
119
|
-
"type": "string"
|
|
120
|
-
},
|
|
121
|
-
"valueType": {
|
|
122
|
-
"type": "string"
|
|
123
|
-
},
|
|
124
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
125
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
114
|
"ref": {
|
|
129
115
|
"required": true,
|
|
130
116
|
"node": {
|
|
@@ -111,20 +111,6 @@
|
|
|
111
111
|
"description": "A mapping of transition-name to FlowState name"
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
"errorTransitions": {
|
|
115
|
-
"required": false,
|
|
116
|
-
"node": {
|
|
117
|
-
"type": "record",
|
|
118
|
-
"keyType": {
|
|
119
|
-
"type": "string"
|
|
120
|
-
},
|
|
121
|
-
"valueType": {
|
|
122
|
-
"type": "string"
|
|
123
|
-
},
|
|
124
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
125
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
114
|
"ref": {
|
|
129
115
|
"required": true,
|
|
130
116
|
"node": {
|
|
@@ -116,20 +116,6 @@
|
|
|
116
116
|
"description": "A mapping of transition-name to FlowState name"
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
-
"errorTransitions": {
|
|
120
|
-
"required": false,
|
|
121
|
-
"node": {
|
|
122
|
-
"type": "record",
|
|
123
|
-
"keyType": {
|
|
124
|
-
"type": "string"
|
|
125
|
-
},
|
|
126
|
-
"valueType": {
|
|
127
|
-
"type": "string"
|
|
128
|
-
},
|
|
129
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
130
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
119
|
"ref": {
|
|
134
120
|
"required": true,
|
|
135
121
|
"node": {
|
|
@@ -382,20 +368,6 @@
|
|
|
382
368
|
"description": "A mapping of transition-name to FlowState name"
|
|
383
369
|
}
|
|
384
370
|
},
|
|
385
|
-
"errorTransitions": {
|
|
386
|
-
"required": false,
|
|
387
|
-
"node": {
|
|
388
|
-
"type": "record",
|
|
389
|
-
"keyType": {
|
|
390
|
-
"type": "string"
|
|
391
|
-
},
|
|
392
|
-
"valueType": {
|
|
393
|
-
"type": "string"
|
|
394
|
-
},
|
|
395
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
396
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
371
|
"ref": {
|
|
400
372
|
"required": true,
|
|
401
373
|
"node": {
|
|
@@ -522,20 +494,6 @@
|
|
|
522
494
|
"title": "NavigationFlowTransitionableState.transitions",
|
|
523
495
|
"description": "A mapping of transition-name to FlowState name"
|
|
524
496
|
}
|
|
525
|
-
},
|
|
526
|
-
"errorTransitions": {
|
|
527
|
-
"required": false,
|
|
528
|
-
"node": {
|
|
529
|
-
"type": "record",
|
|
530
|
-
"keyType": {
|
|
531
|
-
"type": "string"
|
|
532
|
-
},
|
|
533
|
-
"valueType": {
|
|
534
|
-
"type": "string"
|
|
535
|
-
},
|
|
536
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
537
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
538
|
-
}
|
|
539
497
|
}
|
|
540
498
|
},
|
|
541
499
|
"additionalProperties": false,
|
|
@@ -657,20 +615,6 @@
|
|
|
657
615
|
"description": "A mapping of transition-name to FlowState name"
|
|
658
616
|
}
|
|
659
617
|
},
|
|
660
|
-
"errorTransitions": {
|
|
661
|
-
"required": false,
|
|
662
|
-
"node": {
|
|
663
|
-
"type": "record",
|
|
664
|
-
"keyType": {
|
|
665
|
-
"type": "string"
|
|
666
|
-
},
|
|
667
|
-
"valueType": {
|
|
668
|
-
"type": "string"
|
|
669
|
-
},
|
|
670
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
671
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
618
|
"await": {
|
|
675
619
|
"required": true,
|
|
676
620
|
"node": {
|
|
@@ -797,20 +741,6 @@
|
|
|
797
741
|
"description": "A mapping of transition-name to FlowState name"
|
|
798
742
|
}
|
|
799
743
|
},
|
|
800
|
-
"errorTransitions": {
|
|
801
|
-
"required": false,
|
|
802
|
-
"node": {
|
|
803
|
-
"type": "record",
|
|
804
|
-
"keyType": {
|
|
805
|
-
"type": "string"
|
|
806
|
-
},
|
|
807
|
-
"valueType": {
|
|
808
|
-
"type": "string"
|
|
809
|
-
},
|
|
810
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
811
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
812
|
-
}
|
|
813
|
-
},
|
|
814
744
|
"ref": {
|
|
815
745
|
"required": true,
|
|
816
746
|
"node": {
|
|
@@ -139,20 +139,6 @@
|
|
|
139
139
|
"title": "NavigationFlowTransitionableState.transitions",
|
|
140
140
|
"description": "A mapping of transition-name to FlowState name"
|
|
141
141
|
}
|
|
142
|
-
},
|
|
143
|
-
"errorTransitions": {
|
|
144
|
-
"required": false,
|
|
145
|
-
"node": {
|
|
146
|
-
"type": "record",
|
|
147
|
-
"keyType": {
|
|
148
|
-
"type": "string"
|
|
149
|
-
},
|
|
150
|
-
"valueType": {
|
|
151
|
-
"type": "string"
|
|
152
|
-
},
|
|
153
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
154
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
155
|
-
}
|
|
156
142
|
}
|
|
157
143
|
},
|
|
158
144
|
"additionalProperties": false,
|
|
@@ -111,20 +111,6 @@
|
|
|
111
111
|
"description": "A mapping of transition-name to FlowState name"
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
"errorTransitions": {
|
|
115
|
-
"required": false,
|
|
116
|
-
"node": {
|
|
117
|
-
"type": "record",
|
|
118
|
-
"keyType": {
|
|
119
|
-
"type": "string"
|
|
120
|
-
},
|
|
121
|
-
"valueType": {
|
|
122
|
-
"type": "string"
|
|
123
|
-
},
|
|
124
|
-
"title": "NavigationFlowTransitionableState.errorTransitions",
|
|
125
|
-
"description": "Optional error transitions map.\nMaps error types directly to state names (no indirection through transitions map)."
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
114
|
"ref": {
|
|
129
115
|
"required": true,
|
|
130
116
|
"node": {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -116,25 +116,12 @@ export interface NavigationFlow {
|
|
|
116
116
|
/** An optional expression to run when this Flow ends */
|
|
117
117
|
onEnd?: Expression | ExpressionObject;
|
|
118
118
|
|
|
119
|
-
/**
|
|
120
|
-
* An optional flow-level transitions map (fallback when node-level is not defined).
|
|
121
|
-
* Used as a fallback when the current state doesn't have a transition defined.
|
|
122
|
-
*/
|
|
123
|
-
transitions?: NavigationFlowTransition;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Optional flow-level error transitions map.
|
|
127
|
-
* Maps error types directly to state names (no indirection through transitions map).
|
|
128
|
-
*/
|
|
129
|
-
errorTransitions?: Record<string, string>;
|
|
130
|
-
|
|
131
119
|
[key: string]:
|
|
132
120
|
| undefined
|
|
133
121
|
| string
|
|
134
122
|
| Expression
|
|
135
123
|
| ExpressionObject
|
|
136
|
-
| NavigationFlowState
|
|
137
|
-
| NavigationFlowTransition;
|
|
124
|
+
| NavigationFlowState;
|
|
138
125
|
}
|
|
139
126
|
|
|
140
127
|
export type NavigationFlowTransition = Record<string, string>;
|
|
@@ -163,21 +150,15 @@ export interface NavigationBaseState<T extends string> extends CommentBase {
|
|
|
163
150
|
}
|
|
164
151
|
|
|
165
152
|
/** A generic state that can transition to another state */
|
|
166
|
-
export interface NavigationFlowTransitionableState<
|
|
167
|
-
extends
|
|
153
|
+
export interface NavigationFlowTransitionableState<
|
|
154
|
+
T extends string,
|
|
155
|
+
> extends NavigationBaseState<T> {
|
|
168
156
|
/** A mapping of transition-name to FlowState name */
|
|
169
157
|
transitions: NavigationFlowTransition;
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Optional error transitions map.
|
|
173
|
-
* Maps error types directly to state names (no indirection through transitions map).
|
|
174
|
-
*/
|
|
175
|
-
errorTransitions?: Record<string, string>;
|
|
176
158
|
}
|
|
177
159
|
|
|
178
160
|
/** A state representing a view */
|
|
179
|
-
export interface NavigationFlowViewState
|
|
180
|
-
extends NavigationFlowTransitionableState<"VIEW"> {
|
|
161
|
+
export interface NavigationFlowViewState extends NavigationFlowTransitionableState<"VIEW"> {
|
|
181
162
|
/** An id corresponding to a view from the 'views' array */
|
|
182
163
|
ref: string;
|
|
183
164
|
|
|
@@ -205,8 +186,7 @@ export interface NavigationFlowEndState extends NavigationBaseState<"END"> {
|
|
|
205
186
|
}
|
|
206
187
|
|
|
207
188
|
/** Action states execute an expression to determine the next state to transition to */
|
|
208
|
-
export interface NavigationFlowActionState
|
|
209
|
-
extends NavigationFlowTransitionableState<"ACTION"> {
|
|
189
|
+
export interface NavigationFlowActionState extends NavigationFlowTransitionableState<"ACTION"> {
|
|
210
190
|
/**
|
|
211
191
|
* An expression to execute.
|
|
212
192
|
* The return value determines the transition to take
|
|
@@ -215,8 +195,7 @@ export interface NavigationFlowActionState
|
|
|
215
195
|
}
|
|
216
196
|
|
|
217
197
|
/** Action states execute an expression to determine the next state to transition to */
|
|
218
|
-
export interface NavigationFlowAsyncActionState
|
|
219
|
-
extends NavigationFlowTransitionableState<"ASYNC_ACTION"> {
|
|
198
|
+
export interface NavigationFlowAsyncActionState extends NavigationFlowTransitionableState<"ASYNC_ACTION"> {
|
|
220
199
|
/**
|
|
221
200
|
* An expression to execute.
|
|
222
201
|
* The return value determines the transition to take
|
|
@@ -231,16 +210,14 @@ export interface NavigationFlowAsyncActionState
|
|
|
231
210
|
* External Flow states represent states in the FSM that can't be resolved internally in Player.
|
|
232
211
|
* The flow will wait for the embedded application to manage moving to the next state via a transition
|
|
233
212
|
*/
|
|
234
|
-
export interface NavigationFlowExternalState
|
|
235
|
-
extends NavigationFlowTransitionableState<"EXTERNAL"> {
|
|
213
|
+
export interface NavigationFlowExternalState extends NavigationFlowTransitionableState<"EXTERNAL"> {
|
|
236
214
|
/** A reference for this external state */
|
|
237
215
|
ref: string;
|
|
238
216
|
/** Any additional properties are forwarded as options */
|
|
239
217
|
[key: string]: unknown;
|
|
240
218
|
}
|
|
241
219
|
|
|
242
|
-
export interface NavigationFlowFlowState
|
|
243
|
-
extends NavigationFlowTransitionableState<"FLOW"> {
|
|
220
|
+
export interface NavigationFlowFlowState extends NavigationFlowTransitionableState<"FLOW"> {
|
|
244
221
|
/** A reference to a FLOW id state to run */
|
|
245
222
|
ref: string;
|
|
246
223
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -88,17 +88,7 @@ export interface NavigationFlow {
|
|
|
88
88
|
onStart?: Expression | ExpressionObject;
|
|
89
89
|
/** An optional expression to run when this Flow ends */
|
|
90
90
|
onEnd?: Expression | ExpressionObject;
|
|
91
|
-
|
|
92
|
-
* An optional flow-level transitions map (fallback when node-level is not defined).
|
|
93
|
-
* Used as a fallback when the current state doesn't have a transition defined.
|
|
94
|
-
*/
|
|
95
|
-
transitions?: NavigationFlowTransition;
|
|
96
|
-
/**
|
|
97
|
-
* Optional flow-level error transitions map.
|
|
98
|
-
* Maps error types directly to state names (no indirection through transitions map).
|
|
99
|
-
*/
|
|
100
|
-
errorTransitions?: Record<string, string>;
|
|
101
|
-
[key: string]: undefined | string | Expression | ExpressionObject | NavigationFlowState | NavigationFlowTransition;
|
|
91
|
+
[key: string]: undefined | string | Expression | ExpressionObject | NavigationFlowState;
|
|
102
92
|
}
|
|
103
93
|
export type NavigationFlowTransition = Record<string, string>;
|
|
104
94
|
interface CommentBase {
|
|
@@ -123,11 +113,6 @@ export interface NavigationBaseState<T extends string> extends CommentBase {
|
|
|
123
113
|
export interface NavigationFlowTransitionableState<T extends string> extends NavigationBaseState<T> {
|
|
124
114
|
/** A mapping of transition-name to FlowState name */
|
|
125
115
|
transitions: NavigationFlowTransition;
|
|
126
|
-
/**
|
|
127
|
-
* Optional error transitions map.
|
|
128
|
-
* Maps error types directly to state names (no indirection through transitions map).
|
|
129
|
-
*/
|
|
130
|
-
errorTransitions?: Record<string, string>;
|
|
131
116
|
}
|
|
132
117
|
/** A state representing a view */
|
|
133
118
|
export interface NavigationFlowViewState extends NavigationFlowTransitionableState<"VIEW"> {
|