import * as i4 from '@veloceapps/sdk/core'; import { IntegrationState, ConfigurationService, ConfigurationStateService, GuidedSellingService, filterSuccessfulExecute, FlowInfoService, FlowConfigurationService, FlowStateService, FlowStateConfigurationService, TransactionItemWorker, ProductImagesService, RuntimeSettingsService, ActionCodePipe, DatePipe, NumberPipe, PricePipe, SalesTransactionService, PCMUtils } from '@veloceapps/sdk/core'; export { IntegrationAction, IntegrationState, IntegrationStateModel } from '@veloceapps/sdk/core'; import * as i0 from '@angular/core'; import { Injector, OnChanges, OnInit, DoCheck, AfterContentInit, AfterContentChecked, AfterViewInit, AfterViewChecked, OnDestroy, SimpleChanges, NgModuleRef, NgModule, Type, ComponentRef, ViewContainerRef, ChangeDetectorRef, InjectionToken, TemplateRef } from '@angular/core'; import * as rxjs from 'rxjs'; import { BehaviorSubject, Observable, Subject, ReplaySubject } from 'rxjs'; import * as i2$1 from '@veloceapps/components'; import { ToastService, ToastType } from '@veloceapps/components'; import * as _veloceapps_core from '@veloceapps/core'; import { UIDefinition, UIDefinitionMetadata, UIElement, Operator, Predicate, parseJsonSafely, parseJwt, TokenInfoService, UITemplateType } from '@veloceapps/core'; import lodash, { Dictionary } from 'lodash'; import { Patch } from 'rfc6902'; import * as i1 from '@angular/common'; import * as i2 from 'ngx-drag-drop'; import { DndDropEvent } from 'ngx-drag-drop'; import * as i3 from '@veloceapps/api'; import { ContractedPriceApiService } from '@veloceapps/api'; import * as _veloceapps_sdk_cms from '@veloceapps/sdk/cms'; import { DataSource } from '@angular/cdk/collections'; import * as angularForms from '@angular/forms'; import { CatalogApiService, ConfigurationSettingsApiService, DocumentAttachmentApiService, GuidedSellingApiService, SalesforceApiService, SalesTransactionApiService, ShoppingCartSettingsApiService } from '@veloceapps/api/v2'; import * as rxjsOperators from 'rxjs/operators'; declare namespace FlowAction { const FLOW_CONFIGURE_PRODUCT = "[FLOW]_CONFIGURE_PRODUCT"; const FLOW_NAVIGATE_BACK = "[FLOW]_NAVIGATE_BACK"; const FLOW_NAVIGATE_TO = "[FLOW]_NAVIGATE_TO"; const FLOW_NAVIGATE_TO_CATALOG = "[FLOW]_NAVIGATE_TO_CATALOG"; const FLOW_NAVIGATE_TO_SHOPPING_CART = "[FLOW]_NAVIGATE_TO_SHOPPING_CART"; const FLOW_APPLY_PRODUCT_CONFIGURATION = "[FLOW]_APPLY_PRODUCT_CONFIGURATION"; const FLOW_OPEN_DOC_GEN = "[FLOW]_OPEN_DOC_GEN"; const FLOW_CLOSE_DOC_GEN = "[FLOW]_CLOSE_DOC_GEN"; const FLOW_SWITCH_OBJECT = "[FLOW]_SWITCH_OBJECT"; const REMOTE_APPLY = "[FLOW]_REMOTE_APPLY"; const REMOTE_CANCEL = "[FLOW]_REMOTE_CANCEL"; const OPEN_GUIDED_SELLING = "[FLOW]_OPEN_GUIDED_SELLING"; const SUBMIT_GUIDED_SELLING = "[FLOW]_SUBMIT_GUIDED_SELLING"; const CLOSE_GUIDED_SELLING = "[FLOW]_CLOSE_GUIDED_SELLING"; const OPEN_DIALOG = "[FLOW]_OPEN_DIALOG"; const ConfigureProductAction: ({ transactionItemId, productId, qty, }: { transactionItemId?: string; productId?: string; qty?: number; }) => { type: string; payload: { transactionItemId: string | undefined; productId: string | undefined; qty: number | undefined; }; }; const NavigateBackAction: () => { type: string; }; const NavigateToAction: (path: string, productId?: string, transactionItemId?: string) => { type: string; payload: { path: string; productId: string | undefined; transactionItemId: string | undefined; }; }; const NavigateToCatalogAction: () => { type: string; }; const NavigateToShoppingCartAction: () => { type: string; }; const ApplyProductConfigurationAction: () => { type: string; }; const RemoteApplyAction: () => { type: string; }; const RemoteCancelAction: () => { type: string; }; const SwitchObjectAction: (payload: { id: string; }) => { type: string; payload: { id: string; }; }; const OpenGuidedSelling: (payload: { guidedSellingId: string; }) => { type: string; payload: { guidedSellingId: string; }; }; const CloseGuidedSelling: (payload?: { keepState?: boolean; }) => { type: string; payload: { keepState?: boolean; } | undefined; }; const SubmitGuidedSelling: (payload: { result: Record; }) => { type: string; payload: { result: Record; }; }; const OpenDialog: (dialog: string) => { type: string; payload: { dialog: string; }; }; } declare namespace CmsAction { const GO_TO_PAGE = "[CMS]_GO_TO_PAGE"; const UPDATE_CUSTOMIZATION = "[CMS]_UPDATE_CUSTOMIZATION"; const SHOW_OVERLAY = "[CMS]_SHOW_OVERLAY"; const HIDE_OVERLAY = "[CMS]_HIDE_OVERLAY"; const HIDE_ALL_OVERLAYS = "[CMS]_HIDE_ALL_OVERLAYS"; /** * Navigate UI definition to a specific page * * @param pageName name of the page */ const GoToPage: (pageName: string) => { type: string; payload: { pageName: string; }; }; /** * Update UI definition customization state * * @param pageName name of the page */ const UpdateCustomization: (value: any) => { type: string; payload: { value: any; }; }; /** * Show an Overlay on the selected page * * @param name - name of the overlay * @returns void */ const ShowOverlay: (name: string) => { type: string; payload: { name: string; }; }; /** * Hide an Overlay on the selected page * * @param name - name of the overlay * @returns void */ const HideOverlay: (name: string) => { type: string; payload: { name: string; }; }; /** * Hide all Overlays on the selected page * * @returns void */ const HideAllOverlays: () => { type: string; }; } /** * List of available layouts for Full Page Type: * LAYOUT_1 +-------------------------+ | 1. HEADER | |-------------------------| | | | 2. CONTAINER | | | |-------------------------| | 3. FOOTER | +-------------------------+ LAYOUT_2 +-------------------------+ | 1. HEADER | |------------+------------| | | | | 2. LEFT | 3. RIGHT | | | | |------------+------------| | 4. FOOTER | +-------------------------+ LAYOUT_3 +-------------------------+ | | | | | 1. CONTAINER | | | | | |-------------------------| | 2. FOOTER | +-------------------------+ LAYOUT_4 +-------------------------+ | | | | | | | 1. LEFT | 2. RIGHT | | | | | | | |------------+------------| | 3. FOOTER | +-------------------------+ LAYOUT_5 +-------------------------+ | 1. HEADER | |-------------------------| | | | | | 2. CONTAINER | | | | | +-------------------------+ LAYOUT_6 +-------------------------+ | | | | | | | 1. CONTAINER | | | | | | | +-------------------------+ */ /** * List of available layouts for Sidepanel Page Type: * LAYOUT_7 +-------------------------+ | | | | | | | LEFT | DISABLED | | SIDE | PAGE | | PANEL | | | | | | | | +-------------------------+ LAYOUT_8 +-------------------------+ | | | | | | | DISABLED | RIGHT | | PAGE | SIDE | | | PANEL | | | | | | | +-------------------------+ */ type FullPageLayout = 'LAYOUT_1' | 'LAYOUT_2' | 'LAYOUT_3' | 'LAYOUT_4' | 'LAYOUT_5' | 'LAYOUT_6'; type SidepanelPageLayout = 'LAYOUT_7' | 'LAYOUT_8'; type PageLayout = FullPageLayout | SidepanelPageLayout; interface PageLayoutConfig { hasHeader: boolean; hasFooter: boolean; styles?: string; } declare const LAYOUT: { [key in PageLayout]: PageLayoutConfig; }; declare class Plugin { readonly host: Entity; constructor(host: Entity); } declare class Entity { injector: Injector; protected readonly plugins: Plugin[]; private config; private defaultPlugins; constructor(injector: Injector); initPlugins(): void; registerPlugin(plugin: Plugin): void; } type AngularHooks = OnChanges & OnInit & DoCheck & AfterContentInit & AfterContentChecked & AfterViewInit & AfterViewChecked & OnDestroy; interface IPluginComponent extends Partial { host: ElementComponent; } declare class ElementComponent extends Entity implements OnChanges, OnInit, DoCheck, AfterContentInit, AfterViewInit, AfterViewChecked, OnDestroy { injector: Injector; readonly model$: BehaviorSubject; readonly plugins: IPluginComponent[]; constructor(injector: Injector); ngOnChanges(changes: SimpleChanges): void; ngOnInit(): void; ngDoCheck(): void; ngAfterContentInit(): void; ngAfterViewInit(): void; ngAfterViewChecked(): void; ngOnDestroy(): void; } interface CMSPreviewConfig { /** * When `true`, IntegrationState will be cleared on component init */ clearStateOnInit?: boolean; /** * When `true`, preview adds additional components/plugins needed for UIBuilder * (like element hover/selection or Drag&Drop zones) */ uiBuilderMode?: boolean; /** * When `true`, preview renders settings page (element with `type: CUSTOMIZATION_PAGE`) */ customizationMode?: boolean; /** * Custom initialization function which will be executed before starting a preview */ init$?: () => Observable; } type PageType = 'FULL_PAGE' | 'SIDEPANEL'; type ELEMENT_TYPE = 'CUSTOMIZATION_PAGE' | 'CUSTOM' | 'CONTAINER' | 'SERVICE' | 'REFERENCE' | 'PAGE' | 'REGION'; type ElementStyleDeclaration = Partial; interface ElementConfig { component: typeof Entity; plugins?: (typeof Plugin)[]; defaultTemplate?: string; suppressTemplate?: boolean; suppressStyles?: boolean; builder?: { suppressRemovable?: boolean; }; } interface ElementModel { /** * Defines a path for an element model. * It's combined with a path to a target element and an output property name. * * If target value is an Array, then the element will be repeated `n` times and each instance will get it's own value. * * Examples: * - `/Root/Services/DataService/:products` * - `../../Services/DataService/:products` * - `@Services/DataService/:products` */ path?: string; /** * @deprecated * To be removed!!! * Used only when `UIDefinitionType = CONFIGURATION`. */ lineItem?: string; } interface ElementDefaultMetadata { name: string; type: ELEMENT_TYPE; /** * Make component shared * * Used only when `type !== REFERENCE` */ isShared?: boolean; /** * Element module name. Module is used for quick access from other elements. * * For example we have a `DataService` element, and we say it's declared in `Services` module. Then it can be accessed in other elements `model`, `inputs` or `outputs` properties this way: `@Services/DataService` * */ module?: string; /** * Defines inputs of the element. An object where `key` is the name of the input and `value` is target path * * If `value == null`, then the element acts like a target - we expect other element to connect to it. * * Examples: * * 1. `products: '/Root/Services/DataService'` * The element will have `products` input which will get the data from `products` output in dataservice element * * 2. `productsList: '/Root/Services/DataService/:products'` * The element will have `productsList` input which will get the data from `products` output in dataservice element * * 3. `productsList: '@Services/DataService/:products'` * The element will have `productsList` input which will get the data from `products` output in dataservice element which is declared in `Services` module * * 4. `onProductSelect: null` * The element will have `onProductSelect` input, and the script could have a logic which will listen on the events * * Relative paths allowed: * * - `..` * - `../:products` * - `../../DataService/:products` * * Input which name starts with '@' is being added to the element as Angular input (suppressing '@' symbol) */ inputs?: Dictionary; /** * Defines outputs of the element. An object where `key` is the name of the output and `value` is target path * * If `value == null`, then the element acts like a target - we expect other element to connect to it. * * Examples: * * 1. `onProductSelect: '/Root/Services/DataService/:handleProductSelect'` * The element will have `onProductSelect` output, which will emit events to the `dataservice` element `handleProductSelect` input * * 2. `onProductSelect: '@Services/DataService/:handleProductSelect'` * Same output but accessing dataservice by the Service module * * * Output which name starts with '@' is being added to the element as Angular output (suppressing '@' symbol) */ outputs?: Dictionary; model?: ElementModel; /** * Defines a shared component name to use as a reference * * Used only when `type === REFERENCE` */ reference?: string; children?: string[]; /** * Contains styles configurable from UI builder */ configuredStyles?: ElementStyleDeclaration; /** * Page layout * * Used only when `type === PAGE` */ layout?: PageLayout; /** * Page Type * * Used only when `type === PAGE` */ pageType?: PageType; } interface ElementMetadata extends Omit { path: string; children: ElementMetadata[]; template?: string; styles?: string; script?: string; metadata?: string; } interface CompilationResult { elements: ElementMetadata[]; moduleRef: NgModuleRef; componentTypes: Record>; } type ScriptHost> = Pick & T; interface ElementPath { isAbsolute: boolean; segments: string[]; module?: string; variable?: string; } interface PathBlock { type: string; property?: string; name?: string; } declare class RuntimeService { private injector; private integrationState; moduleRefs: NgModuleRef[]; componentRefs: Dictionary | undefined>; componentTypes: Record>; applicationTree: ElementMetadata[]; config?: CMSPreviewConfig; isInitialized$: BehaviorSubject; updated$: Subject; selectedPageName$: BehaviorSubject; selectedOverlayNames$: BehaviorSubject; private compilationService; constructor(injector: Injector, integrationState: IntegrationState); initialize$(uiDefinition?: UIDefinition, config?: CMSPreviewConfig): Observable; applyPatch$(patch: Patch): Observable; getCompiledElement$(path: string): Observable; clear(): void; private addElement$; private deleteElement; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface State { loading: boolean; failure: boolean; } declare class PreviewComponent implements OnInit, OnDestroy { private runtimeService; private toastService; private integrationState; uiDefinition?: UIDefinition; config?: CMSPreviewConfig; state$: BehaviorSubject; elements$: BehaviorSubject; private destroy$; constructor(runtimeService: RuntimeService, toastService: ToastService, integrationState: IntegrationState); ngOnInit(): void; ngOnDestroy(): void; trackBy(_: number, el: ElementMetadata): ElementMetadata; private startPreview; private getElements$; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ElementContextService { metadata?: ElementMetadata; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class IOProviderService { private runtimeService; private inputs; constructor(runtimeService: RuntimeService); connect(el: ElementMetadata, name: string, target?: string | null): Observable | undefined; provide(el: ElementMetadata, name: string, target?: string | null): BehaviorSubject | undefined; private resolveTarget; private createSubjectSafe; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ElementRendererComponent implements OnInit, OnDestroy { private runtimeService; private elementContext; private ioProviderService; private cdr; el?: ViewContainerRef; meta: ElementMetadata; private type?; private refs; private destroy$; constructor(runtimeService: RuntimeService, elementContext: ElementContextService, ioProviderService: IOProviderService, cdr: ChangeDetectorRef); ngOnInit(): void; ngOnDestroy(): void; private createComponents; private createFromPath; private processChildren; private createComponent; private updateComponent; private destroyComponent; private destroyComponents; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ElementRendererModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } interface RuntimeElementDropEvent { element: ElementMetadata; path: string; index: number; } interface RuntimeElementDeleteEvent { path: string; } interface RuntimeShowSettingsEvent { path: string; } declare class RuntimeEditorService { private runtimeService; private editorModeSubj$; onElementDropped$: ReplaySubject; onElementDeleted$: ReplaySubject; onElementSettingsToggled$: ReplaySubject; editorMode$: Observable; dragMode$: BehaviorSubject; selectedElementPath$: BehaviorSubject; constructor(runtimeService: RuntimeService); applyPatch$(patch: Patch): Observable; toggleEditorMode(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ElementDropHandleComponent { private runtimeService; index: number; parentPath: string; constructor(runtimeService: RuntimeEditorService); handleDrop(e: DndDropEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ElementDropHandleModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class ElementChildrenComponent implements OnDestroy { private elementContext; private runtimeService; private runtimeEditorService; private cdr; filter?: (elements: ElementMetadata[]) => ElementMetadata[]; metadata$: Observable; dragMode$: Observable; private destroyed$; constructor(elementContext: ElementContextService, runtimeService: RuntimeService, runtimeEditorService: RuntimeEditorService, cdr: ChangeDetectorRef); ngOnDestroy(): void; getFilteredChildren(elements: ElementMetadata[]): ElementMetadata[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ElementChildrenModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class ElementToolsPanelComponent { private readonly metadata; private readonly config; private readonly elementRef; runtimeEditorService?: RuntimeEditorService; showDeleteButton: boolean; constructor(); deleteHandler(): void; showSettingsHandler(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class PreviewModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare function ElementDefinition(definition: ElementDefaultMetadata): (constructor: any) => any; declare const DEFAULT_ELEMENT: Partial; declare const STARTING_PAGE_NAME = "Starting Page"; declare const STARTING_PAGE_TYPE: PageType; declare const STARTING_PAGE_LAYOUT: FullPageLayout; declare const STARTING_PAGE_STYLES: ElementStyleDeclaration; declare const DEFAULT_PLUGINS_TOKEN: InjectionToken<(typeof Plugin)[]>; declare const UI_DEFINITION_METADATA: InjectionToken; declare const ELEMENT_METADATA: InjectionToken; declare const SHARED_ELEMENT_METADATA: InjectionToken; declare const ELEMENT_CONFIG: InjectionToken; declare class RuntimeModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class LauncherModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } type FederatedModuleOptions = { /** * URL to the federated container * i.e. http://localhost:4200/remoteIntegrationModule.js */ remoteEntry?: string; /** * Name of exposed Angular module */ exposedModule?: string; /** * Suppress remote module loading process spinner */ suppressLoading?: boolean; /** * Loading label. Default: LOADING */ loadingLabel?: string; /** * Ready callback is called when remote module has been loaded */ onReady?: () => void; }; interface FederatedComponentInstance { data?: D; } declare class MigrationsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class MigrationsService { private toastService; constructor(toastService: ToastService); migrateUIDefinition(uiDef: UIDefinition): UIDefinition | undefined; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ResourcesService { private scripts; private loaded$; /** * ngx-monaco-editor adds amd-loader library for loading resources when first time initialized * Which breaks further loading of 3rd party libaries. * * To handle this issue, in case 'amd' is defined, we clear it, and then restore when the script is loaded */ private amd; loadScript(url: string): Observable; loadStyles(url: string): Observable; loadStyles(host: ScriptHost, url: string): Observable; private persistAMDLoader; private restoreAMDLoader; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type Template = TemplateRef | undefined; declare class TemplatesService { private templates; register(name: string, templateRef: TemplateRef): void; get(name: string): Template; get$(name: string): Observable