import * as i0 from '@angular/core'; import { InjectionToken, OnInit, OnDestroy, PipeTransform } from '@angular/core'; import { FlowContext, UIDefinitionContainer, UITemplate, TemplateComponentWithAttachments, ConfigurationProcessor, Prettify, VlDateSettings, PCMModel, UIDefinitionProps, RuntimeConfigurationSettings, ShoppingCartSetting, RuntimeCurrencySettings, Flow, UITemplateType, Product, TransactionContext, SalesTransactionItem, FlowStateExecutionRequest, FlowStateExecutionResult, FlowStateSelectorResponse, FlowStateExecutionRequestDTO, CatalogProducts, PCMProduct, UIDefinition, UIDefinitionMetadata } from '@veloceapps/core'; import { Dictionary } from 'lodash'; import * as i1 from '@veloceapps/components'; import { ToastService } from '@veloceapps/components'; import * as i2 from '@veloceapps/api'; import { FlowStateApiService } from '@veloceapps/api'; import { Calendar } from 'primeng/calendar'; import { PCMApiService, ConfigurationSettingsApiService, UITemplatesAdminApiService, OrchestrationsApiService, SalesTransactionApiService, ConfigurationProcessorsApiService, ProductsAdminApiService, SalesTransactionUpsertResponse, SalesforceApiService } from '@veloceapps/api/v2'; import * as rxjs from 'rxjs'; import { Observable, BehaviorSubject, Subject } from 'rxjs'; import { Params } from '@angular/router'; import { MessageService } from 'primeng/api'; declare const FLOW_CUSTOMIZATION: InjectionToken; interface FlowCustomization { getUiDefinition?(flowContext: FlowContext): Observable; getTemplates?(): Observable; getTemplateComponents?(templateName: string): Observable; getTemplateConfigurationProcessors?(templateName: string): Observable; } declare const FORMATTING_SETTINGS_TOKEN: InjectionToken<{ getFormattingSettings: (...args: unknown[]) => FormattingSettings; }>; type FormattingSettings = Prettify<{ currencySymbol: string; thousandsSeparator: string; decimalSeparator: string; decimalsCount: number; actionCodeLabels: Dictionary; } & VlDateSettings>; interface IntegrationAction { type: string; payload?: T; } type IntegrationStateModel = { guidedSelling?: Dictionary; flowPath: string; dialogResult?: boolean; } & Dictionary; type DateType = 'date' | 'datetime' | 'time'; declare const UI_DEFINITION_VERSION = 3; declare class ConfigurationModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class FlowConfigurationModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare const DEFAULT_FORMATTING_SETTINGS: FormattingSettings; declare class SdkCoreModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class CalendarDirective implements OnInit, OnDestroy { set vlCalendar(calendar: Calendar); private calendar; private ngControl; private formattingSettings; private destroy$; ngOnDestroy(): void; ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class SdkDirectivesModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } interface RuntimeInitializationProps { productId: string; } declare class ConfigurationRuntimeService { private pcmApiService; uiDefinitionContainer: UIDefinitionContainer | null; initializationProps?: RuntimeInitializationProps; pcmModelSubj$: BehaviorSubject; constructor(pcmApiService: PCMApiService); get uiDefinitionProps(): UIDefinitionProps; get pcmModel(): PCMModel | null; get pcmModel$(): Observable; reset(): void; init$(props: RuntimeInitializationProps): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class RuntimeSettingsService { private configurationSettingsApiService; private configurationSettings$; private currencySettings$; private formattingSettings; private shoppingCartSettings$; constructor(configurationSettingsApiService: ConfigurationSettingsApiService); create(): Observable; initCurrency(iso?: string): void; getFormattingSettings(): FormattingSettings; getConfigurationSettings(): RuntimeConfigurationSettings; getShoppingCartSettings(): ShoppingCartSetting[]; getCurrencySettings(): RuntimeCurrencySettings; private parseConfigurationSettings; private getCurrencySymbol; addShoppingCartSettings(settings: ShoppingCartSetting[]): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class FlowInfoService { private runtimeSettingsService; private templatesAdminApiService; private customizationService?; flow$: Observable; templates$: Observable<{ [key in UITemplateType]?: UITemplate; }>; private readonly defaultTemplates; private flowSubj$; private templatesSubj$; private contextSubj$; constructor(runtimeSettingsService: RuntimeSettingsService, templatesAdminApiService: UITemplatesAdminApiService, customizationService?: FlowCustomization | undefined); get flow(): Flow; get isFlowInitialized(): boolean; get context(): FlowContext; get context$(): Observable; get templates(): { SHOPPING_CART?: UITemplate | undefined; CONFIGURATION_UI?: UITemplate | undefined; CATALOG?: UITemplate | undefined; GUIDED_SELLING?: UITemplate | undefined; FLOW_ENGINE?: UITemplate | undefined; FLOW_HEADER?: UITemplate | undefined; }; get isFlowEngineInitialized$(): Observable; get isStateful(): boolean; reset(): void; init$(flowId: string, routeQueryParams: Params): Observable; updateContext(update: Partial): void; private initFlow$; private initFlowTemplates$; private remapTemplateName; private getFlowContextMode; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface GuidedSellingSubmitData { orchestrationName: string; attributesMap: Record; } interface ExternalConfigurationProps { productId: string; qty?: number; attributesMap?: Record; } interface NewConfigurationProps extends ExternalConfigurationProps { product: Product; } interface TestModeConfigurationOptions { customizationMode?: boolean; } interface QuantityChangeProps { id: string; qty: number; } declare class GuidedSellingService { private orchestrationsApiService; private guidedSellingResult$; constructor(orchestrationsApiService: OrchestrationsApiService); get guidedSellingResult(): Record; configureGuidedSelling$(data: GuidedSellingSubmitData): Observable>; clearGuidedSelling$(): void; private getTransactionContext; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ConfigurationService { private flowInfoService; private messageService; private configurationRuntimeService; private salesTransactionService; private orchestrationsApiService; private guidedSellingService; isLoading$: Observable; hasUnsavedChanges: boolean; private configurationStateSubj$; private previousConfigurationStateSubj$; private isLoadingSubj$; constructor(flowInfoService: FlowInfoService, messageService: MessageService, configurationRuntimeService: ConfigurationRuntimeService, salesTransactionService: SalesTransactionService, orchestrationsApiService: OrchestrationsApiService, guidedSellingService: GuidedSellingService); get state$(): Observable; get state(): TransactionContext | null; get previousState(): TransactionContext | null; get root$(): Observable; get root(): SalesTransactionItem | null; reset(): void; init$(): Observable; patchState$(context: TransactionContext): Observable; patchState(context: TransactionContext): void; patch$(transactionItem: SalesTransactionItem): Observable; patch(transactionItem: SalesTransactionItem): void; configure$(transactionContext: TransactionContext): Observable; justConfigureRequest$(transactionContext: TransactionContext): Observable; getPCMModel(): PCMModel; getPCMModel$(): Observable; swapProduct$(productId: string): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class SalesTransactionService { private salesTransactionApiService; private stateSubj$; private isInitializedSubj$; private hasUnsavedChangesSubj$; private initialState; hasUnsavedChanges$: Observable; state$: Observable; get isInitialized$(): Observable; get isInitialized(): boolean; set hasUnsavedChanges(value: boolean); get hasUnsavedChanges(): boolean; get state(): TransactionContext | null; get hasProducts(): boolean; constructor(salesTransactionApiService: SalesTransactionApiService); init(headerId: string, params: Record): Observable; finalizeInit(): void; reset(): void; getInitialState(): SalesTransactionItem[]; setState(state: TransactionContext): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class FlowConfigurationService { private orchestrationsApiService; private salesTransactionService; private flowInfoService; updated$: Observable; private updatedSubj$; constructor(orchestrationsApiService: OrchestrationsApiService, salesTransactionService: SalesTransactionService, flowInfoService: FlowInfoService); calculate$(state: TransactionContext): Observable; calculate(state: TransactionContext): void; revert$(transactionItemId: string): Observable; revert(transactionItemId: string): void; delete$(ids: string[]): Observable; delete(ids: string[]): void; private handleErrorAndBounceBack; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface FlowStateSubscriptionOptions { /** * When 'true', don't execute action to retrieve current value */ cold?: boolean; trackedChanges?: boolean; } declare class FlowStateService { private flowConfiguration; private flowInfoService; private flowStateApiService; private processorsApiService; private salesTransactionApiService; private salesTransactionService; private toastService; private customizationService?; private readonly NOT_INITIALIZED; private readonly EXECUTION_BUFFER_TIME; private executedFunctions; private stateId$; private initialStatefulData; private trackedStatefulChangesMap; private processors; private subscriptions; private flowStore; private executionInProgress$; private statefulRequestStream$; private statefulExecutionRequest$; private cleanup$; constructor(flowConfiguration: FlowConfigurationService, flowInfoService: FlowInfoService, flowStateApiService: FlowStateApiService, processorsApiService: ConfigurationProcessorsApiService, salesTransactionApiService: SalesTransactionApiService, salesTransactionService: SalesTransactionService, toastService: ToastService, customizationService?: FlowCustomization | undefined); init$(): Observable; reset(): void; get hasUnsavedChanges(): boolean; get stateId(): string | null; get isExecutionInProgress$(): Observable; isInitialized$(): Observable; isInitialized(): boolean; execute$(scope: UITemplateType, exec: FlowStateExecutionRequest): Observable; dispatch$(scope: UITemplateType, action: string, inputData?: unknown): Observable; select$(scope: UITemplateType, selectorName: string, inputData?: unknown): Observable>; subscribe$(scope: UITemplateType, selectorName: string, inputData?: unknown, options?: FlowStateSubscriptionOptions): Observable>; save$(): Observable<{ id: string; }>; getFlowStore(): Record; private getOwnerIdByScope; private getScopeByOwnerId; private execToRequest; executeRequest$(request: FlowStateExecutionRequestDTO, forceSubscriptions?: boolean): Observable; private handleSelectorsResponse; private initStateful$; private initBufferedRequest$; private executeStateful$; private initStateless$; private executeStateless$; private executeStatelessActions; private executeStatelessSelectors; private initProcessors$; private executeActionScript; private executeSelectorScript; private executeProcessorScript; private generateRequestId; private checkStatefulChanges; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class FlowStateConfigurationService { private flowInfoService; private flowStateService; private configurationService; private salesTransactionService; private flowConfigurationService; private pcmApiService; private pcmCache; constructor(flowInfoService: FlowInfoService, flowStateService: FlowStateService, configurationService: ConfigurationService, salesTransactionService: SalesTransactionService, flowConfigurationService: FlowConfigurationService, pcmApiService: PCMApiService); updateQuantity$(props: QuantityChangeProps): Observable; addToCart$(props: NewConfigurationProps): Observable; private configureExternal$; private getPCMProduct$; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class IntegrationState { private readonly stateSubj$; private readonly action$; get state$(): Observable; get state(): S; patchState(update: Partial): void; dispatch(action: IntegrationAction): void; listen$

(actionType: string): Observable

; listenAll$(): Observable; reset(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; } declare class ProductImagesService { private productsAdminApiService; private imagesMap$; constructor(productsAdminApiService: ProductsAdminApiService); getImageUrl$(productId: string): Observable; private fetchProductImage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class CatalogProductsService { private stateSubj$; state$: rxjs.Observable; get state(): CatalogProducts | null; reset(): void; setState(state: CatalogProducts): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ConfigurationStateService { private configurationRuntimeService; private configurationService; private flowStateService; private flowInfoService; private flowConfigurationService; private flowStateApiService; private salesTransactionService; private salesTransactionApiService; private toastService; private pcmApiService; isInitialized$: BehaviorSubject; canceledConfiguration$: Subject; private readonly NOT_INITIALIZED; private readonly EXECUTION_BUFFER_TIME; private executedFunctions; private stateId; private ownerId; private subscriptions; private configurationStore; private executionInProgress$; private statefulRequestStream$; private statefulExecutionRequest$; private statelessExecutionRequest$; constructor(configurationRuntimeService: ConfigurationRuntimeService, configurationService: ConfigurationService, flowStateService: FlowStateService, flowInfoService: FlowInfoService, flowConfigurationService: FlowConfigurationService, flowStateApiService: FlowStateApiService, salesTransactionService: SalesTransactionService, salesTransactionApiService: SalesTransactionApiService, toastService: ToastService, pcmApiService: PCMApiService); get isExecutionInProgress$(): Observable; init$(): Observable; cleanup(): void; execute$(exec: FlowStateExecutionRequest): Observable; dispatch$(actionName: string, inputData?: unknown): Observable; select$(selectorName: string, inputData?: unknown): Observable>; subscribe$(selectorName: string, inputData?: unknown, options?: FlowStateSubscriptionOptions): Observable>; saveConfiguration(): Observable; cancelConfiguration(): Observable; private get isStatefulConfiguration(); private initStateful$; private execToRequest; private handleSelectorsResponse; private executeRequest$; private executeStateless$; private initBufferedRequest$; private executeStateful$; private executeActionScript; private executeSelectorScript; private executeProcessorScript; private runStatelessSelectors; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class TestModeConfigurationService { private flowInfoService; private configurationService; private configurationRuntimeService; private salesTransactionService; private runtimeSettingsService; private sfApiService; private isInitialized; private pcmModel?; constructor(flowInfoService: FlowInfoService, configurationService: ConfigurationService, configurationRuntimeService: ConfigurationRuntimeService, salesTransactionService: SalesTransactionService, runtimeSettingsService: RuntimeSettingsService, sfApiService: SalesforceApiService); initTestMode$(uiDefinitionContainer: UIDefinitionContainer, options?: TestModeConfigurationOptions): Observable; private initConfiguration$; private getPriceBookId; private getTestTransactionContext; private checkInitialized; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare function filterSuccessfulExecute(): (source: Observable>) => Observable; declare class DatePipe implements PipeTransform, OnDestroy { private locale; private defaultOptions; private formattingSettings; private destroy$; ngOnDestroy(): void; transform(date: string | number | Date | undefined | null, type?: DateType): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class NumberPipe implements PipeTransform, OnDestroy { private formattingSettings; private destroy$; ngOnDestroy(): void; transform(price: string | number): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class PricePipe implements PipeTransform, OnDestroy { private formattingSettings; private destroy$; ngOnDestroy(): void; transform(price: string | number): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class ActionCodePipe implements PipeTransform { private formattingSettings; transform(actionCode: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class SdkPipesModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class PCMUtils { static mapByPrcId(pcm: PCMProduct): Dictionary; } declare const findTransactionItem: (id: string, items: SalesTransactionItem[]) => SalesTransactionItem | undefined; declare const findTransactionItemWithComparator: (items: SalesTransactionItem[], comparator: (ti: SalesTransactionItem) => boolean) => SalesTransactionItem | undefined; declare const insertTransactionItem: (item: SalesTransactionItem, parentId: string, toInsert: SalesTransactionItem) => SalesTransactionItem; declare const removeTransactionItem: (item: SalesTransactionItem, idToRemove: string) => SalesTransactionItem; declare const replaceTransactionItem: (item: SalesTransactionItem, replaceTo: SalesTransactionItem) => SalesTransactionItem; declare const generateTransactionItem: (option: PCMModel, salesTransactionId?: string, qty?: number, parentTi?: SalesTransactionItem) => SalesTransactionItem; declare const generateTransactionItemFromPCM: (option: PCMModel, salesTransactionId?: string, parentTi?: SalesTransactionItem) => SalesTransactionItem; declare const flattenTransactionItem: (ti: SalesTransactionItem) => SalesTransactionItem[]; declare const updateQuantity: (ti: SalesTransactionItem, qty: number, pcm: PCMProduct, parentQty?: number) => SalesTransactionItem; declare class TransactionItemWorker { ti: SalesTransactionItem; constructor(src: SalesTransactionItem); insert(parentId: string, toInsert: SalesTransactionItem): TransactionItemWorker; remove(id: string): TransactionItemWorker; replace(toReplace: SalesTransactionItem): TransactionItemWorker; } declare function extractMetadata(uiDefinition: UIDefinition): UIDefinitionMetadata; export { ActionCodePipe, CalendarDirective, CatalogProductsService, ConfigurationRuntimeService, ConfigurationService, ConfigurationStateService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FLOW_CUSTOMIZATION, FORMATTING_SETTINGS_TOKEN, FlowConfigurationService, FlowInfoService, FlowStateConfigurationService, FlowStateService, GuidedSellingService, IntegrationState, NumberPipe, PCMUtils, PricePipe, ProductImagesService, RuntimeSettingsService, SalesTransactionService, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, TestModeConfigurationService, TransactionItemWorker, UI_DEFINITION_VERSION, extractMetadata, filterSuccessfulExecute, findTransactionItem, findTransactionItemWithComparator, flattenTransactionItem, generateTransactionItem, generateTransactionItemFromPCM, insertTransactionItem, removeTransactionItem, replaceTransactionItem, updateQuantity }; export type { DateType, ExternalConfigurationProps, FlowCustomization, FormattingSettings, GuidedSellingSubmitData, IntegrationAction, IntegrationStateModel, NewConfigurationProps, QuantityChangeProps, RuntimeInitializationProps, TestModeConfigurationOptions };