UNPKG

@viamedici-spc/configurator-ts

Version:

TypeScript library to build configurator web applications based on the Viamedici Headless Configuration Engine (HCE).

1,108 lines (1,001 loc) 164 kB
import { Array as Array_2 } from '@morphic-ts/model-algebras/lib/types'; import { AType } from '@morphic-ts/summoners'; import { Eq } from '@viamedici-spc/fp-ts-extensions'; import { EqT } from '@viamedici-spc/fp-ts-extensions'; import { M } from '@morphic-ts/batteries/lib/summoner-ESBAST'; import { Refinement } from 'fp-ts/Refinement'; export declare type AllowedInExplain = { /** * Specifies whether all, none, or specific rules are allowed in the explanation result. */ rules?: AllowedRulesInExplain | null; }; declare interface AllowedInExplain_2 { rules?: AllowedRules | null; } declare type AllowedRules = (UtilRequiredKeys<AllowedRulesNone, "type"> | UtilRequiredKeys<AllowedRulesSpecific, "type"> | UtilRequiredKeys<AllowedRulesAll, "type">) & { type: string; }; declare interface AllowedRulesAll { type: "AllowedRulesAll"; } export declare type AllowedRulesInExplain = AllowedRulesInExplainNone | AllowedRulesInExplainAll | AllowedRulesInExplainSpecific; export declare type AllowedRulesInExplainAll = { type: AllowedRulesInExplainType.all; }; export declare type AllowedRulesInExplainNone = { type: AllowedRulesInExplainType.none; }; export declare type AllowedRulesInExplainSpecific = { type: AllowedRulesInExplainType.specific; rules: ReadonlyArray<GlobalConstraintId>; }; export declare enum AllowedRulesInExplainType { all = "all", none = "none", specific = "specific" } declare interface AllowedRulesNone { type: "AllowedRulesNone"; } declare interface AllowedRulesSpecific { type: "AllowedRulesSpecific"; rules: GlobalConstraintId_2[]; } declare interface AlwaysIncluded { type: "AlwaysIncluded"; } /** * @title Viamedici.Spc.Engine.ConfigurationEngine.RestApi.Service * @version v2 * @license © 2024 Viamedici - All rights reserved (https://viamedici.de) * @termsOfService None * @baseUrl https://spc.cloud.ceventis.de/hca/api/engine * @contact Viamedici Software GmbH <info@viamedici.de> (https://viamedici.de) */ declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> { consequence: { /** * @description The route provides a list of Consequences which is the result of an evaluation weather of a Configuration Model or of made Decisions in conjunction with a Configuration Model, especially with the underlying set of Rules. The overall Configuration Model-Satisfaction State (see Glossary) is also given. A Consequence specifies for a certain Attribute in every case the Value Satisfaction State (true or false). In the case of "false", at least one Decision must still be made regarding an Attribute Value. For a Choice Attribute several Decisions may be still necessary. In addition to the Value Satisfaction State, further information is provided depending on the type of Attribute (see the scheme). * * @tags Consequence * @name ConsequenceGet * @summary The route provides the Consequences for all Attributes in the Configuration Session determined by evaluating the Configuration Model and the made Decisions (if any). * @request GET:/v2/session/configuration/consequence * @secure */ consequenceGet: (params?: RequestParams) => Promise<HttpResponse<Consequences, Unspecified>>; }; decision: { /** * @description The route transmits an Explicit Decision and returns the Consequences and the Affected Decisions. An Affected Decision is a Decision which is in a relation to the executed Explicit Decisions. The object "AffectedDecisions" contains also the Explicit Decisions transmitted by the request. When the API consumer is making a Decision for a Single Select Choice Attribute, the selection is updated to the new Decision. Any previous Choice Value Decision within the Choice Attribute will be replaced. * * @tags Decision * @name DecisionPutDecision * @summary The route transmits an Explicit Decision and returns the resulting consequences. * @request PUT:/v2/session/configuration/decision * @secure */ decisionPutDecision: (data: ExplicitDecision_2, params?: RequestParams) => Promise<HttpResponse<PutDecisionResponse, Unspecified>>; /** * @description The route provides a list of Decisions which is the result of determinations by a consumer of the API, such as a Configurator, or by the Configuration Engine. A Decision regarding an Attribute consists of two information, the Decision State and the Decision Kind. ### Decision State In case of a Choice Attribute is specified for all Values whether they are included in finding a Solution by the Configuration Engine or not. In case of a Component Attribute is specified whether a referenced Component Configuration Model is included in finding a Solution by the Configuration Engine or not. Set Values of Numeric and Boolean Attributes are always automatically taken into account. ### Decision Kind It states weather a Decision has been made by a consumer of the API or by the Configuration Engine. * * @tags Decision * @name DecisionGetAllDecisions * @summary The route provides the Decisions for all Attributes in the Configuration Session determined by a consumer of the API or the Configuration Engine. * @request GET:/v2/session/configuration/decision * @secure */ decisionGetAllDecisions: (params?: RequestParams) => Promise<HttpResponse<Decisions, Unspecified>>; /** * @description The route transmits an multiple Explicit Decision and returns the Consequences, the Affected Decisions and the Rejected Decisions. An Affected Decision is a Decision which is in a relation to the executed Explicit Decisions. The object "AffectedDecisions" contains also the Explicit Decisions transmitted by the request. A Rejected Decision is an Explicit Decision which contradicts the Configuration Model and has been therefore rejected by the Configuration Engine. There are several modes that control how Decisions are being applied. * * @tags Decision * @name DecisionPutMany * @summary The route transmits multiple Explicit Decisions and returns the resulting consequences. * @request PUT:/v2/session/configuration/decision/many * @secure */ decisionPutMany: (data: ExplicitDecisions, params?: RequestParams) => Promise<HttpResponse<PutManyDecisionsResponse, Unspecified | PutManyDecisionsConflict>>; }; explain: { /** * No description * * @tags Explain * @name ExplainWhyNotSatisfied * @request POST:/v2/session/configuration/consequence/explain/why-not-satisfied * @secure */ explainWhyNotSatisfied: (data: WhyNotSatisfiedRequest, params?: RequestParams) => Promise<HttpResponse<ExplainResult, Unspecified>>; /** * No description * * @tags Explain * @name ExplainWhyNotSatisfiedDecisions * @request POST:/v2/session/configuration/consequence/explain/why-not-satisfied/answer/decisions * @secure */ explainWhyNotSatisfiedDecisions: (data: WhyNotSatisfiedRequest, params?: RequestParams) => Promise<HttpResponse<DecisionExplanation_2[], Unspecified>>; /** * No description * * @tags Explain * @name ExplainWhyNotSatisfiedRules * @request POST:/v2/session/configuration/consequence/explain/why-not-satisfied/answer/constraints * @secure */ explainWhyNotSatisfiedRules: (data: WhyNotSatisfiedRequest, params?: RequestParams) => Promise<HttpResponse<ConstraintExplanation_2[], Unspecified>>; /** * No description * * @tags Explain * @name ExplainWhyStateNotPossible * @request POST:/v2/session/configuration/consequence/explain/why-state-not-possible * @secure */ explainWhyStateNotPossible: (data: WhyStateNotPossibleRequest, params?: RequestParams) => Promise<HttpResponse<ExplainResult, Unspecified>>; /** * No description * * @tags Explain * @name ExplainWhyStateNotPossibleDecisions * @request POST:/v2/session/configuration/consequence/explain/why-state-not-possible/answer/decisions * @secure */ explainWhyStateNotPossibleDecisions: (data: WhyStateNotPossibleRequest, params?: RequestParams) => Promise<HttpResponse<DecisionExplanation_2[], Unspecified>>; /** * No description * * @tags Explain * @name ExplainWhyStateNotPossibleRules * @request POST:/v2/session/configuration/consequence/explain/why-state-not-possible/answer/constraints * @secure */ explainWhyStateNotPossibleRules: (data: WhyStateNotPossibleRequest, params?: RequestParams) => Promise<HttpResponse<ConstraintExplanation_2[], Unspecified>>; }; meta: { /** * No description * * @tags Meta * @name MetaGetConfigurationModel * @request GET:/v2/session/configuration/meta/configuration-model * @secure */ metaGetConfigurationModel: (params?: RequestParams) => Promise<HttpResponse<ConfigurationModelMeta[], Unspecified>>; /** * No description * * @tags Meta * @name MetaGet * @request GET:/v2/session/configuration/meta * @secure */ metaGet: (params?: RequestParams) => Promise<HttpResponse<CompleteMeta, Unspecified>>; }; session: { /** * @description This route creates a new Configuration Session. The Session-ID included in the response serves as authentication for all "/session/*" prefixed routes. Note: This route requires API-Credentials. * * @tags Session * @name SessionPost * @summary Creates a new Configuration Session. * @request POST:/v2/session * @secure */ sessionPost: (data: CreateSessionRequest, params?: RequestParams) => Promise<HttpResponse<CreateSessionSuccessResponse, Unspecified | ConfigurationModelNotFeasible_2>>; /** * @description An existing Configuration Session is terminated. Note: All state associated with the session will be discarded. * * @tags Session * @name SessionDelete * @summary Terminates an existing Configuration Session. * @request DELETE:/v2/session/{sessionId} * @secure */ sessionDelete: (sessionId: string, params?: RequestParams) => Promise<HttpResponse<void, Unspecified>>; /** * @description An existing Configuration Session is terminated. Note: All state associated with the session will be discarded. This POST request has the same effect as the DELETE request. It must be used when the closing of a browser tab must be responded to. See also the specification under: https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API. * * @tags Session * @name SessionClose * @summary Terminates an existing Configuration Session. * @request POST:/v2/session/close * @secure */ sessionClose: (data: CloseSessionRequest, params?: RequestParams) => Promise<HttpResponse<void, Unspecified>>; }; } declare interface ApiConfig<SecurityDataType = unknown> { baseUrl?: string; baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">; securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void; customFetch?: typeof fetch; } declare interface AssignedChannelNotFound { type: "AssignedChannelNotFound"; title: string; detail: string; globalChannelId: GlobalChannelId; } export declare type Attribute = BooleanAttribute | NumericAttribute | ChoiceAttribute | ComponentAttribute; declare type AttributeIdStage<TNext> = (attributeId: GlobalAttributeId) => TNext; declare namespace AttributeInterpreter { export { isMandatory, isChoiceAttributeMultiSelect, getAllowedChoiceValues, getBlockedChoiceValues, getIncludedChoiceValues } } export { AttributeInterpreter } export declare type AttributeNotFound = Omit<Engine.AttributeNotFound, "type" | "globalAttributeId"> & { readonly type: ConfiguratorErrorType.AttributeNotFound; readonly globalAttributeId: GlobalAttributeId; }; declare interface AttributeNotFound_2 { type: "AttributeNotFound"; title: string; detail: string; /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ globalAttributeId: GlobalAttributeId_2; } declare namespace AttributeRefinements { export { booleanAttributeRefinement, choiceAttributeRefinement, numericAttributeRefinement, componentAttributeRefinement } } export { AttributeRefinements } export declare type AttributeRelations = ReadonlyArray<DecisionsToRespect>; declare interface Attributes { choiceAttributes?: ChoiceAttribute_2[] | null; numericAttributes?: NumericAttribute_2[] | null; booleanAttributes?: BooleanAttribute_2[] | null; componentAttributes?: ComponentAttribute_2[] | null; } export declare enum AttributeType { Boolean = "Boolean", Numeric = "Numeric", Choice = "Choice", Component = "Component" } declare type AttributeUsageRule = UsageRule & { attributeId?: string; }; export declare type AuthenticationFailure = ReplaceType<Engine.AuthenticationFailure, ConfiguratorErrorType.AuthenticationFailure>; declare interface AuthenticationFailure_2 { type: "AuthenticationFailure"; title: string; detail: string; } export declare type AutomaticConflictResolution = { type: "Automatic"; }; declare interface AutomaticConflictResolution_2 { type: "Automatic"; } export declare type BaseAttribute = { readonly type: AttributeType; readonly id: GlobalAttributeId; readonly key: GlobalAttributeIdKey; /** * @remarks To enable the sourceId, set provideSourceId to true in SessionContext. Otherwise, it stays undefined. */ readonly sourceId?: SourceAttributeId; readonly isSatisfied: boolean; readonly canContributeToConfigurationSatisfaction: boolean; }; declare type BaseCausedByDecision = { readonly type: AttributeType; readonly attributeId: GlobalAttributeId; }; export declare type BaseCollectedDecision<T extends number | boolean | ChoiceValueDecisionState | ComponentDecisionState> = Decision<T> & { readonly attributeType: AttributeType; readonly attributeId: GlobalAttributeId; readonly attributeKey: GlobalAttributeIdKey; }; declare type BaseExplicitDecision = { readonly type: AttributeType; readonly attributeId: GlobalAttributeId; }; export declare type BooleanAttribute = BaseAttribute & { readonly type: AttributeType.Boolean; readonly decision: Decision<boolean> | null; readonly nonOptimisticDecision: Decision<boolean> | null; readonly possibleDecisionStates: ReadonlyArray<boolean>; readonly selection: Selection_2; }; declare interface BooleanAttribute_2 { attributeId: string; isDecisionRequired: boolean; } export declare type BooleanAttributeNotFound = Omit<Engine.BooleanAttributeNotFound, "type" | "globalAttributeId"> & { readonly type: ConfiguratorErrorType.BooleanAttributeNotFound; readonly globalAttributeId: GlobalAttributeId; }; declare interface BooleanAttributeNotFound_2 { type: "BooleanAttributeNotFound"; title: string; detail: string; /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ globalAttributeId: GlobalAttributeId_2; } declare const booleanAttributeRefinement: Refinement<Attribute, BooleanAttribute>; /** * A Boolean Consequence is the result of an evaluation weather of a Configuration Model or of made * Decisions in conjunction with a Configuration Model. * For a Boolean Attribute, represented by a Global Attribute ID, the following is specified: * (1) By a boolean is specified whether a Decision is still necessary (isSatisfied = false) or not * (isSatisfied = true). * (2) The meta attribute "selection" indicates if a Value assignment (the choice "true" or "false") is mandatory or not. * (3) Furthermore, the currently still possible boolean states are indicated. */ declare interface BooleanConsequence { /** * The ability to nest Configuration Models and reuse them in Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. Details can be found in the scheme "GlobalAttributeId". */ attributeId: GlobalAttributeId_2; /** * In this case, the meta attribute "isSatisfied" represents the "Value Satisfaction State". * The "Value" is one of the two Values of a Boolean Attribute. * It indicates for the Attribute under consideration whether Decisions still need to be made. */ isSatisfied: boolean; /** * A Configurator must be able to realize different use cases. The API must support this, of course. * Therefore, there are two possibilities regarding the value assignment of a Boolean Attribute: * "Mandatory" means that an assignment TRUE respectively FALSE must be done. * "Optional" means that an assignment TRUE respectively FALSE can be done - * especially also by the Configuration Engine. * The meta attribute represents the design decision of the modeler. It can be used, for example, * for the state display of a control. */ selection: Selection_3; /** * In case of a Boolean Attribute the two possible Decision States are "True" and "False". * The object "PossibleDecisionStates" encapsulates the currently still * possible boolean states. */ possibleDecisionStates: boolean[]; } declare interface BooleanDecision { /** * The ability to nest Configuration Models and reuse them in Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. Details can be found in the scheme "GlobalAttributeId". */ attributeId: GlobalAttributeId_2; /** * In the case of a Boolean Decision, the meta attribute "state" represents one of the two Values of the * considered Boolean Attribute. * The specified Value is always included when the Configuration Engine searches a solution. * The other Value is automatically excluded. */ state?: boolean | null; /** * The meta-attribute "kind" represents the so-called Value Decision Kind. * It indicates the responsibility for the selected Value Decision State. * * ### Implicit * "Implicit" means that the inclusion or exclusion of a Value has been made * by the Configuration Engine when there is no other decision left. * * ### Explicit * "Explicit" means that the inclusion or exclusion of a Value has been made * by the consumer of the API. */ kind: DecisionKind_2; } declare const BooleanDecision_: M< {}, Readonly<{ type: string; attributeId: Readonly<{ localId: string; componentPath: Array_2<string> | undefined; sharedConfigurationModelId: string | undefined; }>; state: boolean; }>, Readonly<{ type: "Boolean"; attributeId: Readonly<{ localId: string; componentPath: Array_2<string> | undefined; sharedConfigurationModelId: string | undefined; }>; state: boolean; }>>; declare type BooleanDecision_2 = AType<typeof BooleanDecision_>; declare type CancelToken = Symbol | string | number; export declare type Cardinality = { readonly lowerBound: number; readonly upperBound: number; }; /** Controls how many Values can respectively must be selected. */ declare interface Cardinality_2 { /** * Controls how many Values must be selected. * - 0 means that the selection of a Value is optional. * - N means that a least N Values must be selected. For example: 1 means that mandatory 1 Value must be selected. */ lowerBound: number; /** * Controls how many Values can be selected. * - 1 means that only one Value can be selected. * - N means that optional N Values can be selected. */ upperBound: number; } declare interface CardinalityConstraint { type: "Cardinality"; /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ attributeId: GlobalAttributeId_2; } export declare type CausedByBooleanDecision = BaseCausedByDecision & { readonly type: AttributeType.Boolean; readonly state: boolean; }; /** The object "CausedByBooleanDecision" encapsulates a Boolean Value with the associated current Decision State. */ declare interface CausedByBooleanDecision_2 { /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ attributeId: GlobalAttributeId_2; reason: Reason; type: "Boolean"; state?: boolean | null; } export declare type CausedByChoiceValueDecision = BaseCausedByDecision & { readonly type: AttributeType.Choice; readonly choiceValueId: ChoiceValueId; readonly state: ChoiceValueDecisionState; }; /** The object "CausedByChoiceDecision" encapsulates a list of Choice Values with the associated current Decision State. */ declare interface CausedByChoiceValueDecision_2 { /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ attributeId: GlobalAttributeId_2; reason: Reason; type: "Choice"; choiceValueId: string; /** * A Decision is a decision about an Attribute. For each Value, it is stated explicitly or implicitly * whether it should be included in the search for a Solution by the Configuration Engine. * Before a Decision is made, there are two possible "Decision States": "Included" and "Excluded". * In case of a Choice Attribute, these are "Value-Decision States", i. e. Decision States regarding a Choice Value. * In case of a Component Attribute, these are "Model-Decision States", i. e. Decision States regarding a * Component Configuration Model. * ### Included * "Included" means that a Value of a Choice Attribute or a referenced Component Configuration Model * can be taken into account when the Configuration Engine searches for a Solution. * ### Excluded * "Excluded" means that a considered Value of a Choice Attribute or a referenced Component Configuration Model * cannot be taken into account when the Configuration Engine searches for a Solution. */ state: PossibleDecisionState; } export declare type CausedByComponentDecision = BaseCausedByDecision & { readonly type: AttributeType.Component; readonly state: ComponentDecisionState; }; /** * The object "CausedByComponentDecision" specifies weather a referenced Component Configuration Model is taken into account * if the Configuration Engine searches a Solution. */ declare interface CausedByComponentDecision_2 { /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ attributeId: GlobalAttributeId_2; reason: Reason; type: "Component"; /** * A Decision is a decision about an Attribute. For each Value, it is stated explicitly or implicitly * whether it should be included in the search for a Solution by the Configuration Engine. * Before a Decision is made, there are two possible "Decision States": "Included" and "Excluded". * In case of a Choice Attribute, these are "Value-Decision States", i. e. Decision States regarding a Choice Value. * In case of a Component Attribute, these are "Model-Decision States", i. e. Decision States regarding a * Component Configuration Model. * ### Included * "Included" means that a Value of a Choice Attribute or a referenced Component Configuration Model * can be taken into account when the Configuration Engine searches for a Solution. * ### Excluded * "Excluded" means that a considered Value of a Choice Attribute or a referenced Component Configuration Model * cannot be taken into account when the Configuration Engine searches for a Solution. */ state: PossibleDecisionState; } export declare type CausedByDecision = BaseCausedByDecision & (CausedByChoiceValueDecision | CausedByNumericDecision | CausedByBooleanDecision | CausedByComponentDecision); declare type CausedByDecision_2 = (UtilRequiredKeys<CausedByChoiceValueDecision_2, "attributeId" | "reason" | "type"> | UtilRequiredKeys<CausedByNumericDecision_2, "attributeId" | "reason" | "type"> | UtilRequiredKeys<CausedByBooleanDecision_2, "attributeId" | "reason" | "type"> | UtilRequiredKeys<CausedByComponentDecision_2, "attributeId" | "reason" | "type">) & { /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ attributeId: GlobalAttributeId_2; reason: Reason; type: string; }; export declare type CausedByNumericDecision = BaseCausedByDecision & { readonly type: AttributeType.Numeric; readonly state: number; }; /** The object "CausedByNumericDecision" encapsulates a Numeric Value with the associated current Decision State. */ declare interface CausedByNumericDecision_2 { /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ attributeId: GlobalAttributeId_2; reason: Reason; type: "Numeric"; /** @format decimal */ state?: number | null; } export declare type ChannelId = string; export declare type ChoiceAttribute = BaseAttribute & { readonly type: AttributeType.Choice; readonly values: ReadonlyMap<ChoiceValueId, ChoiceValue>; readonly cardinality: Cardinality; }; declare interface ChoiceAttribute_2 { attributeId: string; lowerBound: number; upperBound: number; choiceValues: ChoiceValue_2[]; } export declare type ChoiceAttributeNotFound = Omit<Engine.ChoiceAttributeNotFound, "type" | "globalAttributeId"> & { readonly type: ConfiguratorErrorType.ChoiceAttributeNotFound; readonly globalAttributeId: GlobalAttributeId; }; declare interface ChoiceAttributeNotFound_2 { type: "ChoiceAttributeNotFound"; title: string; detail: string; /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ globalAttributeId: GlobalAttributeId_2; } declare const choiceAttributeRefinement: Refinement<Attribute, ChoiceAttribute>; /** * A Choice Consequence is the result of an evaluation weather of a Configuration Model or of made * Decisions in conjunction with a Configuration Model. * For a Choice Attribute, represented by a Global Attribute ID, the following is specified: * (1) By a boolean is specified whether a Decision is still necessary (isSatisfied = false) or not * (isSatisfied = true). * (2) In the object "Cardinality" is specified the assignment type of the Attribute Values that is * determined during modeling (mandatory, optional, multiple). * (3) Furthermore, the currently still possible decision states are indicated for every Value. * These are represented in the form of a list of objects of type "ChoiceValueConsequence". */ declare interface ChoiceConsequence { /** * The ability to nest Configuration Models in different ways requires an Attribute identifier * that is unique across all Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. Details can be found in the scheme "GlobalAttributeId". */ attributeId: GlobalAttributeId_2; /** * In this case, the meta attribute "isSatisfied" represents the "Value Satisfaction State". * The "Value" is the value of a Choice Attribute, which is always a string. * It indicates for the Attribute under consideration whether Decisions still need to be made. */ isSatisfied: boolean; /** * The value assignment for Attributes can be different: one or more mandatory Values respectively one or more optional Values. * The allowed possibilities are specified by giving an upper as well as a lower limit value. * Those limit values are contained in the object Cardinality. */ cardinality: Cardinality_2; /** "Values" represents a list of Choice Value Consequences. */ values: ChoiceValueConsequence[]; } declare type ChoiceDecision = AType<typeof ChoiceDecision_>; declare const ChoiceDecision_: M< {}, Readonly<{ type: string; attributeId: Readonly<{ localId: string; componentPath: Array_2<string> | undefined; sharedConfigurationModelId: string | undefined; }>; choiceValueId: string; state: string; }>, Readonly<{ type: "Choice"; attributeId: Readonly<{ localId: string; componentPath: Array_2<string> | undefined; sharedConfigurationModelId: string | undefined; }>; choiceValueId: string; state: "Included" | "Excluded"; }>>; export declare type ChoiceValue = { readonly id: ChoiceValueId; readonly decision: Decision<ChoiceValueDecisionState> | null; readonly nonOptimisticDecision: Decision<ChoiceValueDecisionState> | null; readonly possibleDecisionStates: ReadonlyArray<ChoiceValueDecisionState>; }; declare interface ChoiceValue_2 { choiceValueId: string; } /** * A Choice Value Consequence specifies the possible Decision States for a certain Value of a Choice Attribute. * It is represented by an object of the type "ChoiceValueConsequence". */ declare interface ChoiceValueConsequence { /** Every item in an enumeration of Values of a Choice Attribute is identified by a string. */ choiceValueId: string; /** * There are zwo possible Decision States for a Value of a Choice Attribute: "Included" and "Excluded". * The object "PossibleDecisionStates" specifies the currently still possible Decision States * for a Choice Value. */ possibleDecisionStates: PossibleDecisionState[]; } /** * A Choice Value Decision is a decision regarding a Value of a Choice Attribute. * Such a decision can be made explicitly by a user of the API, e.g. a Configurator or implicitly * by the Configuration Engine. * It concerns the question of whether a Value is included in finding a Solution * (Value-Decision State = “Included”) or not (Value-Decision State = “Excluded”). * It also specifies for the considered Value who is responsible for including or excluding: * the API consumer or the Configuration Engine. */ declare interface ChoiceValueDecision { /** * The ability to nest Configuration Models and reuse them in Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. Details can be found in the scheme "GlobalAttributeId". */ attributeId: GlobalAttributeId_2; /** A Choice Value is identified by a string. */ choiceValueId: string; /** * The meta-attribute "state" represents the so-called Value Decision State. * * ### state = “Included” * "Included" means that the considered Choice Value is taken into account * when the Configuration Engine searches for a Solution. * - This is analogous to selecting a Value. * * ### state = “Excluded” * "Excluded" means that the considered Choice Value is not taken into account * when the Configuration Engine searches for a Solution. * - An excluded Value can not become the subject of an Implicit Decision. * * ### state = "Undefined" * "Undefined" states that it is not yet decided if the considered Choice Value is * taken into account or not. * - This is analogous to not having selected a Value. * - An undefined Choice Value can still become the subject of an Implicit Decision. */ state: DecisionState; /** * The meta-attribute "kind" represents the so-called Value Decision Kind. * It indicates the responsibility for the selected Value Decision State. * * ### Implicit * "Implicit" means that the inclusion or exclusion of a Value has been made * by the Configuration Engine when there is no other decision left. * * ### Explicit * "Explicit" means that the inclusion or exclusion of a Value has been made * by the consumer of the API. */ kind: DecisionKind_2; } export declare enum ChoiceValueDecisionState { Included = "Included", Excluded = "Excluded" } export declare type ChoiceValueId = string; declare type ChoiceValueIdStage<TNext> = { choiceValue: (choiceValueId: ChoiceValueId) => TNext; }; declare namespace ChoiceValueInterpreter { export { isAllowed, isBlocked } } export { ChoiceValueInterpreter } export declare type ChoiceValueNotFound = Omit<Engine.ChoiceValueNotFound, "type" | "globalChoiceValueId"> & { readonly type: ConfiguratorErrorType.ChoiceValueNotFound; readonly globalAttributeId: GlobalAttributeId; readonly choiceValueId: ChoiceValueId; }; declare interface ChoiceValueNotFound_2 { type: "ChoiceValueNotFound"; title: string; detail: string; globalChoiceValueId: GlobalChoiceValueId; } declare type ChoiceValueUsageRule = UsageRule & { attributeId?: string; choiceValueId?: string; }; export declare type ClientSideSessionInitialisationOptions = { /** * The access token used for authenticating with the Headless Configuration Engine (HCE) API. */ readonly accessToken: string; }; declare interface CloseSessionRequest { sessionId: string; } export declare type CollectedBooleanDecision = BaseCollectedDecision<boolean> & { readonly attributeType: AttributeType.Boolean; }; declare const collectedBooleanDecisionRefinement: Refinement<CollectedDecision, CollectedBooleanDecision>; export declare type CollectedChoiceDecision = BaseCollectedDecision<ChoiceValueDecisionState> & { readonly attributeType: AttributeType.Choice; readonly choiceValueId: ChoiceValueId; }; declare const collectedChoiceDecisionRefinement: Refinement<CollectedDecision, CollectedChoiceDecision>; export declare type CollectedComponentDecision = BaseCollectedDecision<ComponentDecisionState> & { readonly attributeType: AttributeType.Component; }; declare const collectedComponentDecisionRefinement: Refinement<CollectedDecision, CollectedComponentDecision>; export declare type CollectedDecision = CollectedBooleanDecision | CollectedNumericDecision | CollectedComponentDecision | CollectedChoiceDecision; declare namespace CollectedDecisionRefinements { export { collectedBooleanDecisionRefinement, collectedNumericDecisionRefinement, collectedComponentDecisionRefinement, collectedChoiceDecisionRefinement, collectedExplicitDecisionRefinement, collectedImplicitDecisionRefinement } } export { CollectedDecisionRefinements } export declare type CollectedExplicitDecision = CollectedDecision & { kind: DecisionKind.Explicit; }; declare const collectedExplicitDecisionRefinement: Refinement<CollectedDecision, CollectedExplicitDecision>; export declare type CollectedImplicitDecision = CollectedDecision & { kind: DecisionKind.Implicit; }; declare const collectedImplicitDecisionRefinement: Refinement<CollectedDecision, CollectedImplicitDecision>; export declare type CollectedNumericDecision = BaseCollectedDecision<number> & { readonly attributeType: AttributeType.Numeric; }; declare const collectedNumericDecisionRefinement: Refinement<CollectedDecision, CollectedNumericDecision>; declare interface CompleteMeta { configurationModels: ConfigurationModelMeta[]; } export declare type ComponentAttribute = BaseAttribute & { readonly type: AttributeType.Component; readonly decision: Decision<ComponentDecisionState> | null; readonly nonOptimisticDecision: Decision<ComponentDecisionState> | null; readonly inclusion: Inclusion; readonly selection: Selection_2 | null; readonly possibleDecisionStates: ReadonlyArray<ComponentDecisionState>; }; declare interface ComponentAttribute_2 { attributeId: string; configurationModelId: string; inclusion: ComponentInclusionType; } export declare type ComponentAttributeNotFound = Omit<Engine.ComponentAttributeNotFound, "type" | "globalAttributeId"> & { readonly type: ConfiguratorErrorType.ComponentAttributeNotFound; readonly globalAttributeId: GlobalAttributeId; }; declare interface ComponentAttributeNotFound_2 { type: "ComponentAttributeNotFound"; title: string; detail: string; /** * The ability to nest Configuration Models and reuse them when modelling Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. * The GlobalAttributeId is practically a resource path, which can also be called an "Attribute Path" * because it is the path to an Attribute. * shared component path localId * Details can be found in the API product documentation. */ globalAttributeId: GlobalAttributeId_2; } declare const componentAttributeRefinement: Refinement<Attribute, ComponentAttribute>; /** * A Component Consequence is the result of an evaluation weather of a Configuration Model or of made * Decisions in conjunction with a Configuration Model. * For a Component Attribute, represented by a Global Attribute ID, the following is specified: * (1) By a boolean is specified whether a Decision is still necessary (isSatisfied = false) or not * (isSatisfied = true). * (2) The meta attribute "inclusion" specifies whether a referenced Component Configuration Model is always * considered in finding a Solution (inclusion = "Always") or only under certain conditions (inclusion = "Optional"). * (3) The meta attribute "selection" indicates if the referencing of a Component Configuration Model is mandatory or not. * (4) Furthermore, the currently still possible Decision States are indicated. * These are represented in the form of a list of objects of type "ChoiceValueConsequence". * Examples can be found in the product documentation. */ declare interface ComponentConsequence { /** * The ability to nest Configuration Models and reuse them in Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. Details can be found in the scheme "GlobalAttributeId". */ attributeId: GlobalAttributeId_2; /** * In this case, the meta attribute "isSatisfied" represents the "Value Satisfaction State". * The "Value" in this case is the name (identifier) of a Component Configuration Model. * It indicates for the Component Attribute under consideration whether Decisions still need to be made. * For details and examples see the product documentation. */ isSatisfied: boolean; /** * The meta attribute "inclusion" maps a design decision when modeling a real-world product. A certain component of a * product or system of the real world is either mandatory or it is not required in every case. * Accordingly, the reference to a Component Configuration Model is set fixed (inclusion = Always) or * it is optional and can be set when necessary (inclusion = Optional). * Examples can be found in the product documentation. */ inclusion: Inclusion_2; /** * The meta attribute "selection" is only relevant if the value assignment for a Component Attribute is optional, * i.e. a Component Configuration Model is referenced optionally (inclusion = Optional). * There are two possibilities regarding an optionally referenced Component Configuration Model: * "Mandatory" means that a decision whether or not to reference a Component Configuration Model is mandatory. * "Optional" means that a decision whether or not to reference a Component Configuration Model is optionally. * Such a reference can be also set by the Configuration Engine. * The meta attribute represents the design decision of the modeler. It can be used, for example, * for the state display of a control. */ selection?: Selection_3 | null; /** * There are two possible Decision States for a Value of a Component Attribute which is a reference to a * Component Configuration Model: "Included" and "Excluded". * A referenced Component Configuration Model may be part of finding a Solution (Decision State = "Included") * or it may be excluded from finding a Solution Decision State = "Excluded"). In other words, * the Attributes of the referenced Component Configuration Model and their Values are part of the * configuration result or not. Examples can be found in the product documentation. * The object "PossibleDecisionStates" encapsulates the currently still possible Decision States for the * referenced Component Configuration Model. */ possibleDecisionStates: PossibleDecisionState[]; } declare interface ComponentDecision { /** * The ability to nest Configuration Models and reuse them in Components requires an Attribute identifier * that is unique across the Models. Therefore, an object with the corresponding properties for mapping * the identifier components is used. Details can be found in the scheme "GlobalAttributeId". */ attributeId: GlobalAttributeId_2; /** * The meta-attribute "state" represents the so-called Value Decision State. In case of a * Component Attribute means "Value" the reference to a Component Configuration Model. * * ### state = “Included” * "Included" means that the referenced Component Configuration Model * is taken into account when the Configuration Engine searches for a Solution. * * ### state = “Excluded” * "Excluded" means that he referenced Component Configuration Model is not taken into account * when the Configuration Engine searches for a Solution. * * ### state = "Undefined" * "Undefined" states that it is not yet decided if the referenced * Component Configuration Model is taken into account or not. * - A referenced Component Configuration Model that has the Decision State "undefined" * can still become the subject of an Implicit Decision. */ state: DecisionState; /** * The meta-attribute "kind" represents the so-called Value Decision Kind. * It indicates the responsibility for the selected Value Decision State. * * ### Implicit * "Implicit" means that the inclusion or exclusion of a Value has been made * by the Configuration Engine when there is no other decision left. * * ### Explicit * "Explicit" means that the inclusion or exclusion of a Value has been made * by the consumer of the API. */ kind: DecisionKind_2; } declare const ComponentDecision_: M< {}, Readonly<{ type: string; attributeId: Readonly<{ localId: string; componentPath: Array_2<string> | undefined; sharedConfigurationModelId: string | undefined; }>; state: string; }>, Readonly<{ type: "Component"; attributeId: Readonly<{ localId: string; componentPath: Array_2<string> | undefined; sharedConfigurationModelId: string | undefined; }>; state: "Included" | "Excluded"; }>>; declare type ComponentDecision_2 = AType<typeof ComponentDecision_>; export declare enum ComponentDecisionState { Included = "Included", Excluded = "Excluded" } declare type ComponentInclusionType = (UtilRequiredKeys<OptionallyIncluded, "type"> | UtilRequiredKeys<AlwaysIncluded, "type">) & { type: string; }; export declare type Configuration = { readonly isSatisfied: boolean; readonly attributes: ReadonlyMap<GlobalAttributeIdKey, Attribute>; }; export declare type ConfigurationChanges = { readonly isSatisfied: boolean | null; readonly attributes: { readonly added: ReadonlyArray<Attribute>; readonly changed: ReadonlyArray<Attribute>; readonly removed: ReadonlyArray<GlobalAttributeId>; }; }; export declare type ConfigurationInitializationFailure