@veloceapps/sdk 3.1.6 → 3.1.8

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.
Files changed (54) hide show
  1. package/bundles/veloce-sdk-cms.umd.js +2 -1
  2. package/bundles/veloce-sdk-cms.umd.js.map +1 -1
  3. package/bundles/veloce-sdk-core.umd.js +41 -16
  4. package/bundles/veloce-sdk-core.umd.js.map +1 -1
  5. package/bundles/veloce-sdk-runtime.umd.js +3 -13
  6. package/bundles/veloce-sdk-runtime.umd.js.map +1 -1
  7. package/bundles/veloce-sdk.umd.js +145 -120
  8. package/bundles/veloce-sdk.umd.js.map +1 -1
  9. package/cms/vendor-map.d.ts +4 -2
  10. package/core/modules/configuration/services/configuration.service.d.ts +2 -2
  11. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +2 -2
  12. package/core/services/context.service.d.ts +4 -4
  13. package/core/services/quote-draft.service.d.ts +3 -0
  14. package/esm2015/cms/vendor-map.js +5 -3
  15. package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +2 -5
  16. package/esm2015/core/modules/configuration/services/configuration.service.js +2 -2
  17. package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +1 -1
  18. package/esm2015/core/services/context.service.js +13 -10
  19. package/esm2015/core/services/quote-draft.service.js +26 -5
  20. package/esm2015/runtime/components/ui-runtime/runtime.component.js +1 -4
  21. package/esm2015/runtime/execution/directives/vl-ramp.directive.js +1 -4
  22. package/esm2015/runtime/services/cart.service.js +1 -1
  23. package/esm2015/runtime/services/configuration.service.js +3 -3
  24. package/esm2015/runtime/services/runtime-context.service.js +2 -3
  25. package/esm2015/runtime/services/runtime.service.js +1 -4
  26. package/esm2015/src/components/header/header.component.js +36 -19
  27. package/esm2015/src/flow.component.js +6 -6
  28. package/esm2015/src/flow.module.js +2 -2
  29. package/esm2015/src/guards/product-unload.guard.js +7 -6
  30. package/esm2015/src/pages/catalog/catalog.component.js +3 -3
  31. package/esm2015/src/pages/legacy-product/legacy-product.component.js +1 -1
  32. package/esm2015/src/pages/product/product.component.js +2 -3
  33. package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +3 -3
  34. package/esm2015/src/resolvers/context.resolver.js +7 -5
  35. package/esm2015/src/resolvers/quote.resolver.js +2 -2
  36. package/esm2015/src/services/flow-dialog.service.js +80 -0
  37. package/esm2015/src/services/flow.service.js +2 -2
  38. package/esm2015/src/utils/flow.utils.js +1 -11
  39. package/fesm2015/veloce-sdk-cms.js +4 -2
  40. package/fesm2015/veloce-sdk-cms.js.map +1 -1
  41. package/fesm2015/veloce-sdk-core.js +38 -18
  42. package/fesm2015/veloce-sdk-core.js.map +1 -1
  43. package/fesm2015/veloce-sdk-runtime.js +3 -13
  44. package/fesm2015/veloce-sdk-runtime.js.map +1 -1
  45. package/fesm2015/veloce-sdk.js +117 -92
  46. package/fesm2015/veloce-sdk.js.map +1 -1
  47. package/package.json +1 -1
  48. package/runtime/services/cart.service.d.ts +1 -1
  49. package/src/components/header/header.component.d.ts +7 -4
  50. package/src/flow.component.d.ts +3 -3
  51. package/src/guards/product-unload.guard.d.ts +4 -3
  52. package/src/services/{fow-dialog.service.d.ts → flow-dialog.service.d.ts} +2 -0
  53. package/src/utils/flow.utils.d.ts +0 -2
  54. package/esm2015/src/services/fow-dialog.service.js +0 -66
@@ -1 +1 @@
1
- {"version":3,"file":"veloce-sdk-core.js","sources":["../../../../libs/sdk/core/modules/configuration/helpers.ts","../../../../libs/sdk/core/types/runtime.types.ts","../../../../libs/sdk/core/services/context.service.ts","../../../../libs/sdk/core/services/quote-draft.service.ts","../../../../libs/sdk/core/modules/configuration/services/runtime-context.service.ts","../../../../libs/sdk/core/modules/configuration/services/configuration-runtime.service.ts","../../../../libs/sdk/core/utils/line-item.utils.ts","../../../../libs/sdk/core/utils/line-item.worker.ts","../../../../libs/sdk/core/modules/configuration/services/configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-update.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/flow-configuration.module.ts","../../../../libs/sdk/core/modules/configuration/configuration.module.ts","../../../../libs/sdk/core/core.module.ts","../../../../libs/sdk/core/veloce-sdk-core.ts"],"sourcesContent":["import { LineItem, UUID } from '@veloce/core';\nimport { RuntimeContext, UIDefinitionProps } from '../../types';\n\nexport const getDefaultLineItem = (context: RuntimeContext, uiDefinitionProperties: UIDefinitionProps): LineItem => {\n const id = UUID.UUID();\n\n const lineItem: LineItem = {\n id,\n type: uiDefinitionProperties.rootType ?? '',\n cfgStatus: 'Default',\n actionCode: 'ADD',\n qty: 1,\n productName: context.properties?.displayName || context.productName,\n productId: context.productId ?? '',\n ...(context.offeringId\n ? { offeringId: context.offeringId, offeringInstanceId: context.offeringInstanceId || id }\n : {}),\n } as LineItem;\n\n return lineItem;\n};\n","import { ContextProperties, RuntimeModel } from '@veloce/core';\nimport { UIDefinition } from './ui-definition.types';\n\nexport enum RuntimeMode {\n TEST,\n PROD,\n}\n\nexport enum RuntimeOperation {\n INIT = 'INIT',\n UPDATE = 'UPDATE',\n}\n\nexport enum RuntimeStep {\n START = 'START',\n UPDATE = 'UPDATE',\n}\n\nexport interface InvocationContext {\n runtimeOperation?: RuntimeOperation;\n runtimeStep?: RuntimeStep;\n}\n\nexport interface RuntimeContext {\n modelId: string;\n runtimeMode: RuntimeMode;\n runtimeModel: RuntimeModel;\n uiDefinition?: UIDefinition;\n productId?: string;\n productName?: string;\n productType?: string;\n properties?: ContextProperties;\n offeringId?: string;\n offeringInstanceId?: string;\n invocationContext?: InvocationContext;\n}\n","import { Injectable } from '@angular/core';\nimport { ContextApiService } from '@veloce/api';\nimport { ConfigurationContext, ConfigurationContextMode } from '@veloce/core';\nimport { merge } from 'lodash';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { map, tap } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ContextService {\n private context = new BehaviorSubject<ConfigurationContext | null>(null);\n\n constructor(private contextApiService: ContextApiService) {}\n\n resolve = (): ConfigurationContext | null => this.context.value && { ...this.context.value };\n resolve$ = (): Observable<ConfigurationContext | null> => this.context;\n\n get isStandalone() {\n return this.resolve()?.properties.standalone === 'true';\n }\n\n create(headerId: string, mode: ConfigurationContextMode): Observable<ConfigurationContext> {\n return this.contextApiService.getContext(headerId, mode).pipe(\n tap(context => this.context.next(merge(new ConfigurationContext(headerId, mode), context))),\n map(() => this.resolve() as ConfigurationContext),\n );\n }\n\n update(partialContext: Partial<ConfigurationContext>): ConfigurationContext | null {\n const originalContext = this.resolve();\n\n if (!originalContext) {\n throw 'Context not initialized yet';\n }\n\n const updatedContext: ConfigurationContext = {\n ...originalContext,\n ...(partialContext as ConfigurationContext),\n properties: {\n ...originalContext.properties,\n ...partialContext.properties,\n },\n };\n\n this.context.next(updatedContext);\n\n return updatedContext;\n }\n\n delete(): void {\n this.context.next(null);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService, QuoteApiService } from '@veloce/api';\nimport { ConfigurationContext, LineItem, PriceList, PriceSummary, QuoteDraft } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { BehaviorSubject, Observable, zip } from 'rxjs';\nimport { filter, map, take, tap } from 'rxjs/operators';\nimport { ContextService } from './context.service';\n\n@Injectable({ providedIn: 'root' })\nexport class QuoteDraftService {\n private quoteSubj$ = new BehaviorSubject<QuoteDraft | null>(null);\n private resetSubj$ = new BehaviorSubject(true);\n\n public priceLists: PriceList[] = [];\n public quotePriceList?: PriceList;\n public isInitialized = false;\n public hasUnsavedChanges = false;\n public reset$ = this.resetSubj$.asObservable();\n\n constructor(\n private context: ContextService,\n private quoteApiService: QuoteApiService,\n private priceApiService: PriceApiService,\n ) {}\n\n public reset() {\n this.resetSubj$.next(true);\n this.quoteSubj$.next(null);\n }\n\n public init(quoteId: string, params: Dictionary<string>): Observable<void> {\n return zip(\n this.quoteApiService.getQuoteDraft(quoteId, params),\n this.priceApiService.getPriceLists(),\n this.context.resolve$().pipe(filter((context): context is ConfigurationContext => Boolean(context))),\n ).pipe(\n tap(([quote, priceLists, context]) => {\n this.quoteSubj$.next(quote);\n this.priceLists = priceLists;\n this.quotePriceList = priceLists.find(p => p.id === context.properties.PriceListId);\n\n this.context.update({\n ...context,\n ...quote.context,\n properties: {\n ...context.properties,\n ...quote.context.properties,\n },\n });\n }),\n map(() => {\n this.isInitialized = true;\n }),\n take(1),\n );\n }\n\n public setCurrentLineItemState(lineItems: LineItem[]): void {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quote,\n currentState: lineItems,\n });\n\n this.markAsUpdated();\n }\n\n public updateByPriceSummary(priceSummary: PriceSummary): void {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quote,\n currentState: priceSummary.lineItems,\n totalPrices: priceSummary.totalPrices,\n approvalItems: priceSummary.approvalItems,\n });\n\n this.markAsUpdated();\n }\n\n get quote$(): Observable<QuoteDraft> {\n return this.quoteSubj$.pipe(\n filter((quote): quote is QuoteDraft => Boolean(quote)),\n map(quote => quote),\n );\n }\n\n get quoteSnapshot(): QuoteDraft | null {\n return this.quoteSubj$.value;\n }\n\n private markAsUpdated(): void {\n if (this.isInitialized && !this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { RuntimeData, RuntimeModel, UIDefinition as LegacyUiDefinition } from '@veloce/core';\nimport { MessageService } from 'primeng/api';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { RuntimeContext, RuntimeMode, UIDefinition } from '../../../types';\n\n@Injectable()\nexport class RuntimeContextService {\n constructor(private configurationApiService: ConfigurationApiService, private messageService: MessageService) {}\n\n getRuntimeContext(productId: string, offeringId?: string): Observable<RuntimeContext> {\n return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(\n map(runtimeData => {\n const uiDefinition = this.getUIDefinition(runtimeData);\n const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);\n const { productName, properties } =\n Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};\n\n return {\n modelId: runtimeData.modelId,\n uiDefinition: uiDefinition,\n runtimeModel: runtimeModel,\n runtimeMode: RuntimeMode.PROD,\n productId: productId,\n productType: properties?.displayName || productName,\n offeringId: offeringId,\n properties: {\n PricingEnabled: uiDefinition?.properties?.pricingEnabled ? 'true' : 'false',\n PriceListId: uiDefinition?.properties?.priceList,\n },\n };\n }),\n );\n }\n\n private getUIDefinition(runtimeData: RuntimeData): UIDefinition | undefined {\n let rawUiDefinitions: Array<UIDefinition | LegacyUiDefinition>;\n try {\n rawUiDefinitions = JSON.parse(runtimeData.uiDefinitionsSource);\n } catch (e) {\n return;\n }\n\n const uiDefinitions = rawUiDefinitions.filter(uiDef => (uiDef as UIDefinition).version) as UIDefinition[];\n const uiDefinition = uiDefinitions.find(uiDef => uiDef.primary) ?? uiDefinitions[0];\n\n if (!uiDefinition) {\n const errMsg = `Unable to find Default UI`;\n\n this.messageService.add({\n severity: 'error',\n summary: 'ERROR',\n });\n throw new Error(errMsg);\n }\n\n return uiDefinition;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, RuntimeModel, SalesforceIdUtils } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { combineLatest, Observable, of } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\nimport { ContextService } from '../../../services';\nimport { RuntimeContext, RuntimeMode, UIDefinition, UIDefinitionProps } from '../../../types';\nimport { RuntimeInitializationProps } from '../types/configuration-runtime.types';\nimport { RuntimeContextService } from './runtime-context.service';\n\n@Injectable()\nexport class ConfigurationRuntimeService {\n private _runtimeContext?: RuntimeContext;\n private _assets?: LineItem[];\n private _isInitialized = false;\n\n public uiDefinitionProperties: UIDefinitionProps = {};\n\n constructor(\n private apiService: ConfigurationApiService,\n private contextService: ContextService,\n private runtimeContextService: RuntimeContextService,\n ) {}\n\n public reset() {\n this._isInitialized = false;\n this._runtimeContext = undefined;\n this._assets = undefined;\n this.uiDefinitionProperties = {};\n }\n\n public initTestMode(modelId: string, uiDefinition: UIDefinition) {\n this.uiDefinitionProperties = uiDefinition.properties ?? {};\n const uiDefinitionExternals = uiDefinition.externals ?? {};\n\n return combineLatest([\n this.apiService.getRuntimeDataByModelId(modelId),\n this.contextService.create('TestId', ConfigurationContextMode.TEST),\n ]).pipe(\n first(),\n tap(([runtimeData, context]) => {\n this._runtimeContext = {\n modelId: modelId,\n runtimeModel: RuntimeModel.create(runtimeData.types, runtimeData.products),\n runtimeMode: RuntimeMode.TEST,\n };\n\n this.contextService.update({\n properties: {\n ...this.runtimeContext?.properties,\n ...context.properties,\n ModelId: modelId,\n RuntimeMode: ConfigurationContextMode.TEST,\n PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false',\n StartDate: new Date().toISOString().substring(0, 10),\n PriceListId: this.uiDefinitionProperties.priceList,\n standalone: 'true',\n ...uiDefinitionExternals,\n },\n });\n\n this._isInitialized = true;\n }),\n );\n }\n\n public init(props: RuntimeInitializationProps): Observable<RuntimeContext | undefined> {\n this._assets = props.assets;\n const context = this.contextService.resolve();\n\n if (!context) {\n return of();\n }\n\n return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(\n tap(runtimeContext => {\n this.uiDefinitionProperties = runtimeContext.uiDefinition?.properties ?? {};\n const { PriceListId } = context.properties ?? {};\n\n const mergeContext: RuntimeContext = {\n ...runtimeContext,\n properties: {\n ...runtimeContext.properties,\n ...context.properties,\n PricingEnabled: PriceListId ? 'true' : 'false',\n },\n };\n\n this.id15to18('AccountId', mergeContext.properties);\n this._runtimeContext = mergeContext;\n\n if (context.properties && this._runtimeContext.properties?.StartDate) {\n this.contextService.update({\n properties: {\n ...this._runtimeContext.properties,\n ...context.properties,\n },\n });\n }\n\n this._isInitialized = true;\n }),\n );\n }\n\n private id15to18(propertyName: string, source?: Dictionary<any>) {\n if (!source) {\n return;\n }\n\n const value = source[propertyName];\n\n if (typeof value === 'string' && value.length === 15) {\n source[propertyName] = SalesforceIdUtils.generateId18FromId15(value);\n }\n }\n\n public getAsset(lineItem: LineItem): LineItem | undefined {\n return this._assets && this._assets.find(a => a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId);\n }\n\n public get isInitialized() {\n return this._isInitialized;\n }\n\n public get runtimeModel() {\n return this.runtimeContext?.runtimeModel;\n }\n\n public get runtimeContext() {\n return this._runtimeContext;\n }\n}\n","import { Attribute, CfgStatus, LineItem, PortDomain } from '@veloce/core';\nimport { Dictionary, flatten, sortBy } from 'lodash';\n\nexport const findLineItem = (id: string, lineItems: LineItem[]): LineItem | undefined => {\n return findLineItemWithComparator(lineItems, (li: LineItem) => li.id === id);\n};\n\nexport const findLineItemWithComparator = (\n lineItems: LineItem[],\n comparator: (li: LineItem) => boolean,\n): LineItem | undefined => {\n let currentLevel = lineItems;\n\n while (currentLevel.length) {\n const found = currentLevel.find(comparator);\n\n if (found) {\n return found;\n }\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n\n return;\n};\n\nexport const insertLineItem = (lineItem: LineItem, parentId: string, toInsert: LineItem): LineItem => {\n const insertData = lineItem.id === parentId ? [toInsert] : [];\n return {\n ...lineItem,\n lineItems: [\n ...insertData,\n ...lineItem.lineItems.map(li => {\n return insertLineItem(li, parentId, toInsert);\n }),\n ],\n };\n};\n\nexport const removeLineItem = (lineItem: LineItem, idToRemove: string): LineItem => {\n return {\n ...lineItem,\n lineItems: lineItem.lineItems\n .map(li => {\n if (li.id === idToRemove) {\n return;\n } else if (li.lineItems.length) {\n return removeLineItem(li, idToRemove);\n }\n return li;\n })\n .filter(r => !!r) as LineItem[],\n };\n};\n\nexport const replaceLineItem = (lineItem: LineItem, replaceTo: LineItem): LineItem => {\n if (lineItem.id === replaceTo.id) {\n return { ...replaceTo };\n }\n\n return {\n ...lineItem,\n lineItems: lineItem.lineItems.map(li => {\n if (li.id === replaceTo.id) {\n return replaceTo;\n } else if (li.lineItems.length) {\n return replaceLineItem(li, replaceTo);\n }\n return li;\n }),\n };\n};\n\nexport const mapAttributes = (attributes: Attribute[]): Dictionary<any> => {\n return attributes.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});\n};\n\nexport const getAttributes = (attributes: Attribute[], names: string[] = []) => {\n const filtered = attributes.filter(({ name }) => names.includes(name));\n return sortBy(filtered, [({ name }) => names.indexOf(name)]);\n};\n\nexport const upsertAttributes = (\n originalAttributes: Attribute[],\n attributesToUpsert: { name: string; value: any }[],\n) => {\n return attributesToUpsert.reduce((acc, { name, value }) => {\n const [origAttr] = getAttributes(acc, [name]);\n return [\n ...acc.filter(attr => attr.name !== name),\n { ...(origAttr ?? { name }), cfgStatus: 'User' as CfgStatus, value },\n ];\n }, originalAttributes);\n};\n\nexport const patchAttributes = (rootLineItem: LineItem, id: string, attrs: { name: string; value: any }[]) => {\n const lineItem = findLineItem(id, [rootLineItem]);\n\n if (!lineItem) {\n return rootLineItem;\n }\n\n const attributes = upsertAttributes(lineItem.attributes, attrs);\n return replaceLineItem(rootLineItem, { ...lineItem, attributes });\n};\n\nexport const getAttributeValue = (attributes: Attribute[], name: string): any =>\n attributes.find(attr => attr.name === name)?.value;\n\nexport const generateLineItem = (\n port: string,\n type: string,\n parentId: string,\n attributes: { name: string; value: any }[] = [],\n lineItems: LineItem[] = [],\n): LineItem => {\n return {\n port,\n type,\n actionCode: 'ADD',\n cfgStatus: 'New',\n attributes: attributes.map(({ name, value }) => ({ cfgStatus: 'User', name, value })),\n lineItems,\n parentId,\n qty: 1,\n } as LineItem;\n};\n\nexport const getRecommendedPrices = (portDomain: PortDomain, type: string): { net: number; list: number } => {\n const domainType = portDomain.domainTypes.find(({ name }) => name === type);\n\n const [net, list] = domainType?.recommendedPrices\n ?.filter(({ chargeMethod }) => chargeMethod === 'ONE_TIME')\n .reduce(\n (acc, rp) => {\n const [netPrice, listPrice] = acc;\n return [netPrice + rp.netPrice, listPrice + rp.listPrice];\n },\n [0, 0],\n ) ?? [0, 0];\n\n return { net, list };\n};\n","import { LineItem } from '@veloce/core';\nimport { insertLineItem, patchAttributes, removeLineItem, replaceLineItem } from './line-item.utils';\n\nexport class LineItemWorker {\n public li: LineItem;\n\n constructor(src: LineItem) {\n this.li = { ...src };\n }\n\n public insert(parentId: string, toInsert: LineItem): LineItemWorker {\n return new LineItemWorker(insertLineItem(this.li, parentId, toInsert));\n }\n\n public remove(id: string): LineItemWorker {\n return new LineItemWorker(removeLineItem(this.li, id));\n }\n\n public replace(toReplace: LineItem): LineItemWorker {\n return new LineItemWorker(replaceLineItem(this.li, toReplace));\n }\n\n public patchAttribute(attrs: { name: string; value: any }[], id?: string): LineItemWorker {\n return new LineItemWorker(patchAttributes(this.li, id ?? this.li.id, attrs));\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfirmationComponent } from '@veloce/components';\nimport {\n ConfigurationContext,\n ConfigurationMode,\n ConfigurationRequest,\n LineItem,\n PricePlanCharge,\n RuntimeModel,\n VlWindow,\n} from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport { DialogService } from 'primeng/dynamicdialog';\nimport { BehaviorSubject, Observable, shareReplay, throwError } from 'rxjs';\nimport { catchError, map, tap } from 'rxjs/operators';\nimport { ContextService } from '../../../services';\nimport { QuoteStates, RuntimeContext, RuntimeStep } from '../../../types';\nimport { LineItemWorker } from '../../../utils';\nimport { getDefaultLineItem } from '../helpers';\nimport { ConfigurationRuntimeService } from './configuration-runtime.service';\n\ndeclare const window: VlWindow;\n\n@Injectable()\nexport class ConfigurationService {\n private mode = ConfigurationMode.SEARCH;\n private states: QuoteStates = {};\n\n private lineItem = new BehaviorSubject<LineItem | undefined>(undefined);\n private charges = new BehaviorSubject<Dictionary<PricePlanCharge>>({});\n\n public hasUnsavedChanges = false;\n\n constructor(\n private runtimeService: ConfigurationRuntimeService,\n private contextService: ContextService,\n private configurationApiService: ConfigurationApiService,\n private messageService: MessageService,\n private dialogService: DialogService,\n ) {}\n\n public reset() {\n this.hasUnsavedChanges = false;\n this.runtimeService.reset();\n\n this.states = {};\n this.lineItem.next(undefined);\n this.charges.next({});\n }\n\n public patch$(lineItem: LineItem): Observable<LineItem> {\n if (!this.lineItem.value) {\n return throwError(() => new Error(`Source LineItem not found`));\n }\n\n this.states.configurableRamp = new LineItemWorker(this.lineItem.value).replace(lineItem).li;\n this.states.asset = this.states.configurableRamp\n ? this.runtimeService.getAsset(this.states.configurableRamp)\n : undefined;\n\n return this.configure().pipe(\n catchError(error => {\n console.error(error);\n\n if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {\n this.messageService.add({ severity: 'error', summary: error });\n }\n\n // bounce back if configuration call has failed\n this.lineItem.next(this.lineItem.value ? { ...this.lineItem.value } : undefined);\n\n return throwError(() => error);\n }),\n tap(() => {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }),\n );\n }\n\n public patch(lineItem: LineItem): void {\n this.patch$(lineItem).subscribe();\n }\n\n public updateCurrentStates(update: Partial<QuoteStates>) {\n this.states = {\n ...this.states,\n ...update,\n };\n }\n\n public get(): Observable<LineItem | undefined> {\n return this.lineItem.asObservable().pipe(shareReplay());\n }\n\n public getSnapshot(): LineItem | undefined {\n return this.lineItem.value ? { ...this.lineItem.value } : undefined;\n }\n\n public getRuntimeModel(): RuntimeModel | undefined {\n return this.runtimeService.runtimeModel;\n }\n\n public getRuntimeContext(): RuntimeContext | undefined {\n return this.runtimeService.runtimeContext;\n }\n\n public get contextSnapshot(): ConfigurationContext | null {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext | null> {\n return this.contextService.resolve$();\n }\n\n public get charges$(): Observable<Dictionary<PricePlanCharge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<PricePlanCharge> {\n return this.charges.value;\n }\n\n public configure(): Observable<LineItem> {\n const runtimeContext = this.getRuntimeContext();\n const runtimeModel = this.getRuntimeModel();\n if (!runtimeContext || !runtimeModel) {\n return throwError(() => new Error('Runtime context/model not initialized'));\n }\n\n const uiDefinitionProperties = {\n ...(runtimeContext.uiDefinition?.properties ?? {}),\n ...(this.runtimeService.uiDefinitionProperties ?? {}),\n };\n const lineItem = this.states.configurableRamp ?? getDefaultLineItem(runtimeContext, uiDefinitionProperties);\n const configurationRequest = this.createRequest(lineItem);\n configurationRequest.lineItems = this.states.currentState || [];\n configurationRequest.asset = this.states.asset;\n const mainPricingEnabled = runtimeContext.properties?.PricingEnabled;\n const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;\n return this.configurationApiService\n .configureLineItem({ configurationRequest, runtimeModel, pricingEnabled })\n .pipe(\n map(({ lineItem, context, charges, deletedLineItems }) => {\n this.contextService.update(context ?? {});\n this.charges.next(charges ?? {});\n if (deletedLineItems?.length) {\n this.showInactiveProductsConfirmation();\n }\n return lineItem;\n }),\n )\n .pipe(\n tap(lineItem => lineItem && this.lineItem.next(lineItem)),\n catchError(error =>\n throwError(() => new Error(error.error?.message || error.message || JSON.stringify(error))),\n ),\n );\n }\n\n private createRequest(lineItem: LineItem): ConfigurationRequest {\n return {\n lineItem,\n mode: this.mode,\n step: !this.lineItem.value ? RuntimeStep.START : RuntimeStep.UPDATE,\n attributeDomainMode: 'ALL',\n context: this.contextService.resolve() as ConfigurationContext,\n };\n }\n\n private showInactiveProductsConfirmation() {\n this.dialogService\n .open(ConfirmationComponent, {\n dismissableMask: false,\n closeOnEscape: false,\n closable: false,\n showHeader: true,\n header: `Inactive Products in Quote`,\n width: '440px',\n data: {\n confirmationConfig: {\n title: ' ',\n description: 'This quote contains inactive products. Do you want to remove them?',\n submitBtn: 'Remove products',\n cancelBtn: 'Back to Quote',\n },\n },\n })\n .onClose.subscribe(result => {\n if (!result) {\n const context = this.contextService.resolve();\n window['VELO_BACK_FN'].apply(null, [context?.headerId || '']);\n }\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { LineItem } from '@veloce/core';\nimport { flatten } from 'lodash';\nimport moment from 'moment';\nimport { LineItemWorker } from '../../../utils';\nimport { FlowUpdateParams } from '../types/update.types';\n\n@Injectable()\nexport class FlowUpdateService {\n public update(rootLineItems: LineItem[], updates: FlowUpdateParams[]) {\n let remainingUpdates = [...updates];\n let currentLevel = rootLineItems;\n\n while (currentLevel.length && remainingUpdates.length) {\n currentLevel.forEach(li => {\n const unhandledUpdates: FlowUpdateParams[] = [];\n\n remainingUpdates.forEach(update => {\n let updated = false;\n\n switch (update.dataType) {\n case 'LINEITEM':\n updated = this.applyLineItemUpdate(li, update);\n break;\n case 'CHARGE':\n updated = this.applyChargeUpdate(li, update);\n break;\n case 'GROUP_CHARGE':\n updated = this.applyChargeGroupUpdate(li, update);\n break;\n default:\n // Unknown dataType. Do not try to handle it anymore\n updated = true;\n }\n\n if (!updated) {\n unhandledUpdates.push(update);\n }\n });\n\n remainingUpdates = unhandledUpdates;\n });\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n }\n\n public delete(lineItems: LineItem[], id: string): LineItem[] {\n const idsToRemove: string[] = [id];\n const topLevelLineItem = lineItems.find(li => li.id === id);\n\n if (topLevelLineItem) {\n // find term-related line items (which are only top level)\n // expired term line items won't be deleted\n let foundTermLineItem: LineItem | undefined = topLevelLineItem;\n\n while (foundTermLineItem) {\n foundTermLineItem = lineItems.find(li => foundTermLineItem && li.rampInstanceId === foundTermLineItem.id);\n if (foundTermLineItem) {\n idsToRemove.push(foundTermLineItem.id);\n }\n }\n }\n\n const filtered = lineItems.filter(lineItem => !idsToRemove.includes(lineItem.id));\n return filtered.map(lineItem => new LineItemWorker(lineItem).remove(id).li);\n }\n\n private applyLineItemUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n if (lineItem.id !== update.id) {\n return false;\n }\n\n switch (update.attributeType) {\n case 'QTY':\n lineItem.qty = update.newValue;\n break;\n case 'EFFECTIVE_START_DATE':\n lineItem.properties.StartDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'END_DATE':\n lineItem.properties.EndDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'PRICE_ADJUSTMENT':\n {\n const [charge] = lineItem.chargeItems;\n if (charge) {\n charge.priceAdjustment = update.newValue;\n }\n }\n break;\n default:\n throw new Error(`Not suppored AttributeType for LineItem update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundCharge = lineItem.chargeItems.find(({ id }) => id === update.id);\n if (!foundCharge) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundCharge.priceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeGroupUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundChargeGroup = lineItem.chargeGroupItems.find(({ id }) => id === update.id);\n if (!foundChargeGroup) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundChargeGroup.priceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Group Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { ConfigurationContext, LineItem, PricePlanCharge, PriceSummary } from '@veloce/core';\nimport { cloneDeep, Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport {\n BehaviorSubject,\n catchError,\n combineLatest,\n map,\n noop,\n Observable,\n of,\n shareReplay,\n Subscription,\n switchMap,\n tap,\n throwError,\n} from 'rxjs';\nimport { ContextService, QuoteDraftService } from '../../../services';\nimport { FlowUpdateParams } from '../types/update.types';\nimport { FlowUpdateService } from './flow-update.service';\n\n@Injectable()\nexport class FlowConfigurationService {\n private charges = new BehaviorSubject<Dictionary<PricePlanCharge>>({});\n private bounceBackUpdate$ = new BehaviorSubject(true);\n\n private resetSubscription?: Subscription;\n\n constructor(\n private priceApiService: PriceApiService,\n private contextService: ContextService,\n private quoteDraftService: QuoteDraftService,\n private messageService: MessageService,\n private updateService: FlowUpdateService,\n ) {}\n\n private reset() {\n this.charges.next({});\n }\n\n initialize$(): Observable<void> {\n this.resetSubscription?.unsubscribe();\n this.resetSubscription = this.quoteDraftService.reset$.subscribe(() => this.reset());\n\n return this.calculate$(this.getSnapshot()).pipe(map(noop));\n }\n\n calculate$(currentState: LineItem[]): Observable<PriceSummary> {\n const context = this.contextService.resolve();\n\n return this.priceApiService.calculate({ context, currentState }).pipe(\n tap((result: PriceSummary) => {\n this.quoteDraftService.updateByPriceSummary(result);\n\n this.charges.next(result.charges);\n\n if (context) {\n this.contextService.update({ properties: context.properties });\n }\n }),\n this.handleError(),\n );\n }\n\n calculate(currentState: LineItem[]): void {\n this.calculate$(currentState).subscribe();\n }\n\n update$(updates: FlowUpdateParams[]): Observable<PriceSummary> {\n const lineItems = cloneDeep(this.getSnapshot());\n\n return of([]).pipe(\n tap(() => this.updateService.update(lineItems, updates)),\n this.handleError(),\n switchMap(() => this.calculate$(lineItems)),\n );\n }\n\n update(updates: FlowUpdateParams[]): void {\n this.update$(updates).subscribe();\n }\n\n delete$(ids: string[]): Observable<PriceSummary> {\n return of([]).pipe(\n map(() => ids.reduce((result, id) => this.updateService.delete(result, id), this.getSnapshot())),\n this.handleError(),\n switchMap(currentState => this.calculate$(currentState)),\n );\n }\n\n delete(ids: string[]): void {\n this.delete$(ids).subscribe();\n }\n\n public get(): Observable<LineItem[]> {\n return combineLatest([this.quoteDraftService.quote$, this.bounceBackUpdate$]).pipe(\n map(([quoteDraft]) => quoteDraft.currentState),\n shareReplay(),\n );\n }\n\n public getSnapshot(): LineItem[] {\n return this.quoteDraftService.quoteSnapshot?.currentState.slice() ?? [];\n }\n\n public get charges$(): Observable<Dictionary<PricePlanCharge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<PricePlanCharge> {\n return this.charges.value;\n }\n\n public get contextSnapshot(): ConfigurationContext | null {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext | null> {\n return this.contextService.resolve$();\n }\n\n private handleError() {\n return <T>(source$: Observable<T>): Observable<T> => {\n return source$.pipe(\n catchError(error => {\n console.error(error);\n this.messageService.add({ severity: 'error', summary: error });\n\n // bounce back if configuration call has failed\n this.bounceBackUpdate$.next(true);\n\n return throwError(() => error);\n }),\n );\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { FlowConfigurationService } from './services/flow-configuration.service';\nimport { FlowUpdateService } from './services/flow-update.service';\n\n@NgModule({\n imports: [],\n providers: [FlowConfigurationService, FlowUpdateService, PriceApiService],\n})\nexport class FlowConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { ConfigurationApiService, ContextApiService, ProductModelApiService } from '@veloce/api';\nimport { ConfirmationDialogModule } from '@veloce/components';\nimport { ConfigurationRuntimeService } from './services/configuration-runtime.service';\nimport { ConfigurationService } from './services/configuration.service';\nimport { RuntimeContextService } from './services/runtime-context.service';\n\n@NgModule({\n imports: [ConfirmationDialogModule],\n providers: [\n ContextApiService,\n ProductModelApiService,\n ConfigurationApiService,\n ConfigurationRuntimeService,\n RuntimeContextService,\n ConfigurationService,\n ],\n})\nexport class ConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { FlowConfigurationModule } from './modules';\nimport { ConfigurationModule } from './modules/configuration/configuration.module';\nimport { ContextService, QuoteDraftService } from './services';\n\n@NgModule({\n imports: [ConfigurationModule, FlowConfigurationModule],\n providers: [ContextService, QuoteDraftService],\n})\nexport class SdkCoreModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map","tap","catchError"],"mappings":";;;;;;;;;;;;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QAAQ;mBAAC;oBACR,OAAO,EAAE,EAAE;oBACX,SAAS,EAAE,CAAC,wBAAwB,EAAE,iBAAiB,EAAE,eAAe,CAAC;iBAC1E;;;MCUY,mBAAmB;;iHAAnB,mBAAmB;kHAAnB,mBAAmB,YAVpB,wBAAwB;kHAUvB,mBAAmB,aATnB;QACT,iBAAiB;QACjB,sBAAsB;QACtB,uBAAuB;QACvB,2BAA2B;QAC3B,qBAAqB;QACrB,oBAAoB;KACrB,YARQ,CAAC,wBAAwB,CAAC;4FAUxB,mBAAmB;kBAX/B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,SAAS,EAAE;wBACT,iBAAiB;wBACjB,sBAAsB;wBACtB,uBAAuB;wBACvB,2BAA2B;wBAC3B,qBAAqB;wBACrB,oBAAoB;qBACrB;iBACF;;;MCRY,aAAa;;2GAAb,aAAa;4GAAb,aAAa,YAHd,mBAAmB,EAAE,uBAAuB;4GAG3C,aAAa,aAFb,CAAC,cAAc,EAAE,iBAAiB,CAAC,YADrC,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;4FAG5C,aAAa;kBAJzB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;oBACvD,SAAS,EAAE,CAAC,cAAc,EAAE,iBAAiB,CAAC;iBAC/C;;;ACRD;;;;;;"}
1
+ {"version":3,"file":"veloce-sdk-core.js","sources":["../../../../libs/sdk/core/modules/configuration/helpers.ts","../../../../libs/sdk/core/types/runtime.types.ts","../../../../libs/sdk/core/services/context.service.ts","../../../../libs/sdk/core/services/quote-draft.service.ts","../../../../libs/sdk/core/modules/configuration/services/runtime-context.service.ts","../../../../libs/sdk/core/modules/configuration/services/configuration-runtime.service.ts","../../../../libs/sdk/core/utils/line-item.utils.ts","../../../../libs/sdk/core/utils/line-item.worker.ts","../../../../libs/sdk/core/modules/configuration/services/configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-update.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/flow-configuration.module.ts","../../../../libs/sdk/core/modules/configuration/configuration.module.ts","../../../../libs/sdk/core/core.module.ts","../../../../libs/sdk/core/veloce-sdk-core.ts"],"sourcesContent":["import { LineItem, UUID } from '@veloce/core';\nimport { RuntimeContext, UIDefinitionProps } from '../../types';\n\nexport const getDefaultLineItem = (context: RuntimeContext, uiDefinitionProperties: UIDefinitionProps): LineItem => {\n const id = UUID.UUID();\n\n const lineItem: LineItem = {\n id,\n type: uiDefinitionProperties.rootType ?? '',\n cfgStatus: 'Default',\n actionCode: 'ADD',\n qty: 1,\n productName: context.properties?.displayName || context.productName,\n productId: context.productId ?? '',\n ...(context.offeringId\n ? { offeringId: context.offeringId, offeringInstanceId: context.offeringInstanceId || id }\n : {}),\n } as LineItem;\n\n return lineItem;\n};\n","import { ContextProperties, RuntimeModel } from '@veloce/core';\nimport { UIDefinition } from './ui-definition.types';\n\nexport enum RuntimeMode {\n TEST,\n PROD,\n}\n\nexport enum RuntimeOperation {\n INIT = 'INIT',\n UPDATE = 'UPDATE',\n}\n\nexport enum RuntimeStep {\n START = 'START',\n UPDATE = 'UPDATE',\n}\n\nexport interface InvocationContext {\n runtimeOperation?: RuntimeOperation;\n runtimeStep?: RuntimeStep;\n}\n\nexport interface RuntimeContext {\n modelId: string;\n runtimeMode: RuntimeMode;\n runtimeModel: RuntimeModel;\n uiDefinition?: UIDefinition;\n productId?: string;\n productName?: string;\n productType?: string;\n properties?: ContextProperties;\n offeringId?: string;\n offeringInstanceId?: string;\n invocationContext?: InvocationContext;\n}\n","import { Injectable } from '@angular/core';\nimport { ContextApiService } from '@veloce/api';\nimport { ConfigurationContext, ConfigurationContextMode } from '@veloce/core';\nimport { merge } from 'lodash';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { filter, map, tap } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ContextService {\n private context = new BehaviorSubject<ConfigurationContext | null>(null);\n\n constructor(private contextApiService: ContextApiService) {}\n\n get isInitialized(): boolean {\n return Boolean(this.context.value);\n }\n\n resolve(): ConfigurationContext {\n if (!this.context.value) {\n throw new Error('Context is not initialized yet!');\n }\n\n return { ...this.context.value };\n }\n\n resolve$(): Observable<ConfigurationContext> {\n return this.context.pipe(filter((ctx): ctx is ConfigurationContext => Boolean(ctx)));\n }\n\n create(headerId: string, mode: ConfigurationContextMode): Observable<ConfigurationContext> {\n return this.contextApiService.getContext(headerId, mode).pipe(\n tap(context => this.context.next(merge(new ConfigurationContext(headerId, mode), context))),\n map(() => this.resolve() as ConfigurationContext),\n );\n }\n\n public update(partialContext: Partial<ConfigurationContext>): ConfigurationContext {\n const originalContext = this.resolve();\n\n const updatedContext: ConfigurationContext = {\n ...originalContext,\n ...(partialContext as ConfigurationContext),\n properties: {\n ...originalContext.properties,\n ...partialContext.properties,\n },\n };\n\n this.context.next(updatedContext);\n\n return updatedContext;\n }\n\n public delete(): void {\n this.context.next(null);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService, QuoteApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, PriceList, PriceSummary, QuoteDraft } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { BehaviorSubject, combineLatest, Observable, zip } from 'rxjs';\nimport { filter, map, take, tap } from 'rxjs/operators';\nimport { ContextService } from './context.service';\n\n@Injectable({ providedIn: 'root' })\nexport class QuoteDraftService {\n private quoteSubj$ = new BehaviorSubject<QuoteDraft | null>(null);\n private resetSubj$ = new BehaviorSubject(true);\n\n public priceLists: PriceList[] = [];\n public quotePriceList?: PriceList;\n public isInitialized = false;\n public hasUnsavedChanges = false;\n public reset$ = this.resetSubj$.asObservable();\n\n constructor(\n private context: ContextService,\n private quoteApiService: QuoteApiService,\n private priceApiService: PriceApiService,\n ) {}\n\n public reset() {\n this.resetSubj$.next(true);\n this.quoteSubj$.next(null);\n }\n\n public init(quoteId: string, params: Dictionary<string>): Observable<void> {\n return zip(\n this.quoteApiService.getQuoteDraft(quoteId, params),\n this.priceApiService.getPriceLists(),\n this.context.resolve$(),\n ).pipe(\n tap(([quote, priceLists, context]) => {\n this.quoteSubj$.next(quote);\n this.priceLists = priceLists;\n this.quotePriceList = priceLists.find(p => p.id === context.properties.PriceListId);\n\n this.context.update({\n ...context,\n ...quote.context,\n properties: {\n ...context.properties,\n ...quote.context.properties,\n },\n });\n }),\n map(() => {\n this.isInitialized = true;\n }),\n take(1),\n );\n }\n\n public setCurrentLineItemState(lineItems: LineItem[]): void {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quote,\n currentState: lineItems,\n });\n\n this.markAsUpdated();\n }\n\n public updateByPriceSummary(priceSummary: PriceSummary): void {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quote,\n currentState: priceSummary.lineItems,\n totalPrices: priceSummary.totalPrices,\n approvalItems: priceSummary.approvalItems,\n });\n\n this.markAsUpdated();\n }\n\n get quote$(): Observable<QuoteDraft> {\n return combineLatest([this.quoteSubj$, this.context.resolve$()]).pipe(\n map(() => this.quoteSnapshot),\n filter((quote): quote is QuoteDraft => Boolean(quote)),\n );\n }\n\n get quoteSnapshot(): QuoteDraft | null {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return null;\n }\n\n return {\n ...quote,\n context: this.context.resolve(),\n };\n }\n\n get isStandalone() {\n return this.context.resolve().properties.standalone === 'true';\n }\n\n public isEditMode$(): Observable<boolean> {\n return this.context.resolve$().pipe(map(() => this.isEditMode()));\n }\n\n public isEditMode(): boolean {\n const context = this.context.resolve();\n\n if (context.mode === ConfigurationContextMode.ACCOUNT) {\n return true;\n }\n\n if (context.mode === ConfigurationContextMode.QUOTE) {\n return context.properties.Status === 'Draft';\n }\n\n return false;\n }\n\n private markAsUpdated(): void {\n if (this.isInitialized && !this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { RuntimeData, RuntimeModel, UIDefinition as LegacyUiDefinition } from '@veloce/core';\nimport { MessageService } from 'primeng/api';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { RuntimeContext, RuntimeMode, UIDefinition } from '../../../types';\n\n@Injectable()\nexport class RuntimeContextService {\n constructor(private configurationApiService: ConfigurationApiService, private messageService: MessageService) {}\n\n getRuntimeContext(productId: string, offeringId?: string): Observable<RuntimeContext> {\n return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(\n map(runtimeData => {\n const uiDefinition = this.getUIDefinition(runtimeData);\n const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);\n const { productName, properties } =\n Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};\n\n return {\n modelId: runtimeData.modelId,\n uiDefinition: uiDefinition,\n runtimeModel: runtimeModel,\n runtimeMode: RuntimeMode.PROD,\n productId: productId,\n productType: properties?.displayName || productName,\n offeringId: offeringId,\n properties: {\n PricingEnabled: uiDefinition?.properties?.pricingEnabled ? 'true' : 'false',\n PriceListId: uiDefinition?.properties?.priceList,\n },\n };\n }),\n );\n }\n\n private getUIDefinition(runtimeData: RuntimeData): UIDefinition | undefined {\n let rawUiDefinitions: Array<UIDefinition | LegacyUiDefinition>;\n try {\n rawUiDefinitions = JSON.parse(runtimeData.uiDefinitionsSource);\n } catch (e) {\n return;\n }\n\n const uiDefinitions = rawUiDefinitions.filter(uiDef => (uiDef as UIDefinition).version) as UIDefinition[];\n const uiDefinition = uiDefinitions.find(uiDef => uiDef.primary) ?? uiDefinitions[0];\n\n if (!uiDefinition) {\n const errMsg = `Unable to find Default UI`;\n\n this.messageService.add({\n severity: 'error',\n summary: 'ERROR',\n });\n throw new Error(errMsg);\n }\n\n return uiDefinition;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, RuntimeModel, SalesforceIdUtils } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { combineLatest, Observable } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\nimport { ContextService } from '../../../services';\nimport { RuntimeContext, RuntimeMode, UIDefinition, UIDefinitionProps } from '../../../types';\nimport { RuntimeInitializationProps } from '../types/configuration-runtime.types';\nimport { RuntimeContextService } from './runtime-context.service';\n\n@Injectable()\nexport class ConfigurationRuntimeService {\n private _runtimeContext?: RuntimeContext;\n private _assets?: LineItem[];\n private _isInitialized = false;\n\n public uiDefinitionProperties: UIDefinitionProps = {};\n\n constructor(\n private apiService: ConfigurationApiService,\n private contextService: ContextService,\n private runtimeContextService: RuntimeContextService,\n ) {}\n\n public reset() {\n this._isInitialized = false;\n this._runtimeContext = undefined;\n this._assets = undefined;\n this.uiDefinitionProperties = {};\n }\n\n public initTestMode(modelId: string, uiDefinition: UIDefinition) {\n this.uiDefinitionProperties = uiDefinition.properties ?? {};\n const uiDefinitionExternals = uiDefinition.externals ?? {};\n\n return combineLatest([\n this.apiService.getRuntimeDataByModelId(modelId),\n this.contextService.create('TestId', ConfigurationContextMode.TEST),\n ]).pipe(\n first(),\n tap(([runtimeData, context]) => {\n this._runtimeContext = {\n modelId: modelId,\n runtimeModel: RuntimeModel.create(runtimeData.types, runtimeData.products),\n runtimeMode: RuntimeMode.TEST,\n };\n\n this.contextService.update({\n properties: {\n ...this.runtimeContext?.properties,\n ...context.properties,\n ModelId: modelId,\n RuntimeMode: ConfigurationContextMode.TEST,\n PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false',\n StartDate: new Date().toISOString().substring(0, 10),\n PriceListId: this.uiDefinitionProperties.priceList,\n standalone: 'true',\n ...uiDefinitionExternals,\n },\n });\n\n this._isInitialized = true;\n }),\n );\n }\n\n public init(props: RuntimeInitializationProps): Observable<RuntimeContext | undefined> {\n this._assets = props.assets;\n const context = this.contextService.resolve();\n\n return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(\n tap(runtimeContext => {\n this.uiDefinitionProperties = runtimeContext.uiDefinition?.properties ?? {};\n const { PriceListId } = context.properties ?? {};\n\n const mergeContext: RuntimeContext = {\n ...runtimeContext,\n properties: {\n ...runtimeContext.properties,\n ...context.properties,\n PricingEnabled: PriceListId ? 'true' : 'false',\n },\n };\n\n this.id15to18('AccountId', mergeContext.properties);\n this._runtimeContext = mergeContext;\n\n if (context.properties && this._runtimeContext.properties?.StartDate) {\n this.contextService.update({\n properties: {\n ...this._runtimeContext.properties,\n ...context.properties,\n },\n });\n }\n\n this._isInitialized = true;\n }),\n );\n }\n\n private id15to18(propertyName: string, source?: Dictionary<any>) {\n if (!source) {\n return;\n }\n\n const value = source[propertyName];\n\n if (typeof value === 'string' && value.length === 15) {\n source[propertyName] = SalesforceIdUtils.generateId18FromId15(value);\n }\n }\n\n public getAsset(lineItem: LineItem): LineItem | undefined {\n return this._assets && this._assets.find(a => a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId);\n }\n\n public get isInitialized() {\n return this._isInitialized;\n }\n\n public get runtimeModel() {\n return this.runtimeContext?.runtimeModel;\n }\n\n public get runtimeContext() {\n return this._runtimeContext;\n }\n}\n","import { Attribute, CfgStatus, LineItem, PortDomain } from '@veloce/core';\nimport { Dictionary, flatten, sortBy } from 'lodash';\n\nexport const findLineItem = (id: string, lineItems: LineItem[]): LineItem | undefined => {\n return findLineItemWithComparator(lineItems, (li: LineItem) => li.id === id);\n};\n\nexport const findLineItemWithComparator = (\n lineItems: LineItem[],\n comparator: (li: LineItem) => boolean,\n): LineItem | undefined => {\n let currentLevel = lineItems;\n\n while (currentLevel.length) {\n const found = currentLevel.find(comparator);\n\n if (found) {\n return found;\n }\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n\n return;\n};\n\nexport const insertLineItem = (lineItem: LineItem, parentId: string, toInsert: LineItem): LineItem => {\n const insertData = lineItem.id === parentId ? [toInsert] : [];\n return {\n ...lineItem,\n lineItems: [\n ...insertData,\n ...lineItem.lineItems.map(li => {\n return insertLineItem(li, parentId, toInsert);\n }),\n ],\n };\n};\n\nexport const removeLineItem = (lineItem: LineItem, idToRemove: string): LineItem => {\n return {\n ...lineItem,\n lineItems: lineItem.lineItems\n .map(li => {\n if (li.id === idToRemove) {\n return;\n } else if (li.lineItems.length) {\n return removeLineItem(li, idToRemove);\n }\n return li;\n })\n .filter(r => !!r) as LineItem[],\n };\n};\n\nexport const replaceLineItem = (lineItem: LineItem, replaceTo: LineItem): LineItem => {\n if (lineItem.id === replaceTo.id) {\n return { ...replaceTo };\n }\n\n return {\n ...lineItem,\n lineItems: lineItem.lineItems.map(li => {\n if (li.id === replaceTo.id) {\n return replaceTo;\n } else if (li.lineItems.length) {\n return replaceLineItem(li, replaceTo);\n }\n return li;\n }),\n };\n};\n\nexport const mapAttributes = (attributes: Attribute[]): Dictionary<any> => {\n return attributes.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});\n};\n\nexport const getAttributes = (attributes: Attribute[], names: string[] = []) => {\n const filtered = attributes.filter(({ name }) => names.includes(name));\n return sortBy(filtered, [({ name }) => names.indexOf(name)]);\n};\n\nexport const upsertAttributes = (\n originalAttributes: Attribute[],\n attributesToUpsert: { name: string; value: any }[],\n) => {\n return attributesToUpsert.reduce((acc, { name, value }) => {\n const [origAttr] = getAttributes(acc, [name]);\n return [\n ...acc.filter(attr => attr.name !== name),\n { ...(origAttr ?? { name }), cfgStatus: 'User' as CfgStatus, value },\n ];\n }, originalAttributes);\n};\n\nexport const patchAttributes = (rootLineItem: LineItem, id: string, attrs: { name: string; value: any }[]) => {\n const lineItem = findLineItem(id, [rootLineItem]);\n\n if (!lineItem) {\n return rootLineItem;\n }\n\n const attributes = upsertAttributes(lineItem.attributes, attrs);\n return replaceLineItem(rootLineItem, { ...lineItem, attributes });\n};\n\nexport const getAttributeValue = (attributes: Attribute[], name: string): any =>\n attributes.find(attr => attr.name === name)?.value;\n\nexport const generateLineItem = (\n port: string,\n type: string,\n parentId: string,\n attributes: { name: string; value: any }[] = [],\n lineItems: LineItem[] = [],\n): LineItem => {\n return {\n port,\n type,\n actionCode: 'ADD',\n cfgStatus: 'New',\n attributes: attributes.map(({ name, value }) => ({ cfgStatus: 'User', name, value })),\n lineItems,\n parentId,\n qty: 1,\n } as LineItem;\n};\n\nexport const getRecommendedPrices = (portDomain: PortDomain, type: string): { net: number; list: number } => {\n const domainType = portDomain.domainTypes.find(({ name }) => name === type);\n\n const [net, list] = domainType?.recommendedPrices\n ?.filter(({ chargeMethod }) => chargeMethod === 'ONE_TIME')\n .reduce(\n (acc, rp) => {\n const [netPrice, listPrice] = acc;\n return [netPrice + rp.netPrice, listPrice + rp.listPrice];\n },\n [0, 0],\n ) ?? [0, 0];\n\n return { net, list };\n};\n","import { LineItem } from '@veloce/core';\nimport { insertLineItem, patchAttributes, removeLineItem, replaceLineItem } from './line-item.utils';\n\nexport class LineItemWorker {\n public li: LineItem;\n\n constructor(src: LineItem) {\n this.li = { ...src };\n }\n\n public insert(parentId: string, toInsert: LineItem): LineItemWorker {\n return new LineItemWorker(insertLineItem(this.li, parentId, toInsert));\n }\n\n public remove(id: string): LineItemWorker {\n return new LineItemWorker(removeLineItem(this.li, id));\n }\n\n public replace(toReplace: LineItem): LineItemWorker {\n return new LineItemWorker(replaceLineItem(this.li, toReplace));\n }\n\n public patchAttribute(attrs: { name: string; value: any }[], id?: string): LineItemWorker {\n return new LineItemWorker(patchAttributes(this.li, id ?? this.li.id, attrs));\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfirmationComponent } from '@veloce/components';\nimport {\n ConfigurationContext,\n ConfigurationMode,\n ConfigurationRequest,\n LineItem,\n PricePlanCharge,\n RuntimeModel,\n VlWindow,\n} from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport { DialogService } from 'primeng/dynamicdialog';\nimport { BehaviorSubject, Observable, shareReplay, throwError } from 'rxjs';\nimport { catchError, map, tap } from 'rxjs/operators';\nimport { ContextService } from '../../../services';\nimport { QuoteStates, RuntimeContext, RuntimeStep } from '../../../types';\nimport { LineItemWorker } from '../../../utils';\nimport { getDefaultLineItem } from '../helpers';\nimport { ConfigurationRuntimeService } from './configuration-runtime.service';\n\ndeclare const window: VlWindow;\n\n@Injectable()\nexport class ConfigurationService {\n private mode = ConfigurationMode.SEARCH;\n private states: QuoteStates = {};\n\n private lineItem = new BehaviorSubject<LineItem | undefined>(undefined);\n private charges = new BehaviorSubject<Dictionary<PricePlanCharge>>({});\n\n public hasUnsavedChanges = false;\n\n constructor(\n private runtimeService: ConfigurationRuntimeService,\n private contextService: ContextService,\n private configurationApiService: ConfigurationApiService,\n private messageService: MessageService,\n private dialogService: DialogService,\n ) {}\n\n public reset() {\n this.hasUnsavedChanges = false;\n this.runtimeService.reset();\n\n this.states = {};\n this.lineItem.next(undefined);\n this.charges.next({});\n }\n\n public patch$(lineItem: LineItem): Observable<LineItem> {\n if (!this.lineItem.value) {\n return throwError(() => new Error(`Source LineItem not found`));\n }\n\n this.states.configurableRamp = new LineItemWorker(this.lineItem.value).replace(lineItem).li;\n this.states.asset = this.states.configurableRamp\n ? this.runtimeService.getAsset(this.states.configurableRamp)\n : undefined;\n\n return this.configure().pipe(\n catchError(error => {\n console.error(error);\n\n if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {\n this.messageService.add({ severity: 'error', summary: error });\n }\n\n // bounce back if configuration call has failed\n this.lineItem.next(this.lineItem.value ? { ...this.lineItem.value } : undefined);\n\n return throwError(() => error);\n }),\n tap(() => {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }),\n );\n }\n\n public patch(lineItem: LineItem): void {\n this.patch$(lineItem).subscribe();\n }\n\n public updateCurrentStates(update: Partial<QuoteStates>) {\n this.states = {\n ...this.states,\n ...update,\n };\n }\n\n public get(): Observable<LineItem | undefined> {\n return this.lineItem.asObservable().pipe(shareReplay());\n }\n\n public getSnapshot(): LineItem | undefined {\n return this.lineItem.value ? { ...this.lineItem.value } : undefined;\n }\n\n public getRuntimeModel(): RuntimeModel | undefined {\n return this.runtimeService.runtimeModel;\n }\n\n public getRuntimeContext(): RuntimeContext | undefined {\n return this.runtimeService.runtimeContext;\n }\n\n public get contextSnapshot(): ConfigurationContext {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext> {\n return this.contextService.resolve$();\n }\n\n public get charges$(): Observable<Dictionary<PricePlanCharge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<PricePlanCharge> {\n return this.charges.value;\n }\n\n public configure(): Observable<LineItem> {\n const runtimeContext = this.getRuntimeContext();\n const runtimeModel = this.getRuntimeModel();\n if (!runtimeContext || !runtimeModel) {\n return throwError(() => new Error('Runtime context/model not initialized'));\n }\n\n const uiDefinitionProperties = {\n ...(runtimeContext.uiDefinition?.properties ?? {}),\n ...(this.runtimeService.uiDefinitionProperties ?? {}),\n };\n const lineItem = this.states.configurableRamp ?? getDefaultLineItem(runtimeContext, uiDefinitionProperties);\n const configurationRequest = this.createRequest(lineItem);\n configurationRequest.lineItems = this.states.currentState || [];\n configurationRequest.asset = this.states.asset;\n const mainPricingEnabled = runtimeContext.properties?.PricingEnabled;\n const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;\n return this.configurationApiService\n .configureLineItem({ configurationRequest, runtimeModel, pricingEnabled })\n .pipe(\n map(({ lineItem, context, charges, deletedLineItems }) => {\n this.contextService.update(context ?? {});\n this.charges.next(charges ?? {});\n if (deletedLineItems?.length) {\n this.showInactiveProductsConfirmation();\n }\n return lineItem;\n }),\n )\n .pipe(\n tap(lineItem => lineItem && this.lineItem.next(lineItem)),\n catchError(error =>\n throwError(() => new Error(error.error?.message || error.message || JSON.stringify(error))),\n ),\n );\n }\n\n private createRequest(lineItem: LineItem): ConfigurationRequest {\n return {\n lineItem,\n mode: this.mode,\n step: !this.lineItem.value ? RuntimeStep.START : RuntimeStep.UPDATE,\n attributeDomainMode: 'ALL',\n context: this.contextService.resolve(),\n };\n }\n\n private showInactiveProductsConfirmation() {\n this.dialogService\n .open(ConfirmationComponent, {\n dismissableMask: false,\n closeOnEscape: false,\n closable: false,\n showHeader: true,\n header: `Inactive Products in Quote`,\n width: '440px',\n data: {\n confirmationConfig: {\n title: ' ',\n description: 'This quote contains inactive products. Do you want to remove them?',\n submitBtn: 'Remove products',\n cancelBtn: 'Back to Quote',\n },\n },\n })\n .onClose.subscribe(result => {\n if (!result) {\n const context = this.contextService.resolve();\n window['VELO_BACK_FN'].apply(null, [context.headerId]);\n }\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { LineItem } from '@veloce/core';\nimport { flatten } from 'lodash';\nimport moment from 'moment';\nimport { LineItemWorker } from '../../../utils';\nimport { FlowUpdateParams } from '../types/update.types';\n\n@Injectable()\nexport class FlowUpdateService {\n public update(rootLineItems: LineItem[], updates: FlowUpdateParams[]) {\n let remainingUpdates = [...updates];\n let currentLevel = rootLineItems;\n\n while (currentLevel.length && remainingUpdates.length) {\n currentLevel.forEach(li => {\n const unhandledUpdates: FlowUpdateParams[] = [];\n\n remainingUpdates.forEach(update => {\n let updated = false;\n\n switch (update.dataType) {\n case 'LINEITEM':\n updated = this.applyLineItemUpdate(li, update);\n break;\n case 'CHARGE':\n updated = this.applyChargeUpdate(li, update);\n break;\n case 'GROUP_CHARGE':\n updated = this.applyChargeGroupUpdate(li, update);\n break;\n default:\n // Unknown dataType. Do not try to handle it anymore\n updated = true;\n }\n\n if (!updated) {\n unhandledUpdates.push(update);\n }\n });\n\n remainingUpdates = unhandledUpdates;\n });\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n }\n\n public delete(lineItems: LineItem[], id: string): LineItem[] {\n const idsToRemove: string[] = [id];\n const topLevelLineItem = lineItems.find(li => li.id === id);\n\n if (topLevelLineItem) {\n // find term-related line items (which are only top level)\n // expired term line items won't be deleted\n let foundTermLineItem: LineItem | undefined = topLevelLineItem;\n\n while (foundTermLineItem) {\n foundTermLineItem = lineItems.find(li => foundTermLineItem && li.rampInstanceId === foundTermLineItem.id);\n if (foundTermLineItem) {\n idsToRemove.push(foundTermLineItem.id);\n }\n }\n }\n\n const filtered = lineItems.filter(lineItem => !idsToRemove.includes(lineItem.id));\n return filtered.map(lineItem => new LineItemWorker(lineItem).remove(id).li);\n }\n\n private applyLineItemUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n if (lineItem.id !== update.id) {\n return false;\n }\n\n switch (update.attributeType) {\n case 'QTY':\n lineItem.qty = update.newValue;\n break;\n case 'EFFECTIVE_START_DATE':\n lineItem.properties.StartDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'END_DATE':\n lineItem.properties.EndDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'PRICE_ADJUSTMENT':\n {\n const [charge] = lineItem.chargeItems;\n if (charge) {\n charge.priceAdjustment = update.newValue;\n }\n }\n break;\n default:\n throw new Error(`Not suppored AttributeType for LineItem update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundCharge = lineItem.chargeItems.find(({ id }) => id === update.id);\n if (!foundCharge) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundCharge.priceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeGroupUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundChargeGroup = lineItem.chargeGroupItems.find(({ id }) => id === update.id);\n if (!foundChargeGroup) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundChargeGroup.priceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Group Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { ConfigurationContext, LineItem, PricePlanCharge, PriceSummary } from '@veloce/core';\nimport { cloneDeep, Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport {\n BehaviorSubject,\n catchError,\n combineLatest,\n map,\n noop,\n Observable,\n of,\n shareReplay,\n Subscription,\n switchMap,\n tap,\n throwError,\n} from 'rxjs';\nimport { ContextService, QuoteDraftService } from '../../../services';\nimport { FlowUpdateParams } from '../types/update.types';\nimport { FlowUpdateService } from './flow-update.service';\n\n@Injectable()\nexport class FlowConfigurationService {\n private charges = new BehaviorSubject<Dictionary<PricePlanCharge>>({});\n private bounceBackUpdate$ = new BehaviorSubject(true);\n\n private resetSubscription?: Subscription;\n\n constructor(\n private priceApiService: PriceApiService,\n private contextService: ContextService,\n private quoteDraftService: QuoteDraftService,\n private messageService: MessageService,\n private updateService: FlowUpdateService,\n ) {}\n\n private reset() {\n this.charges.next({});\n }\n\n initialize$(): Observable<void> {\n this.resetSubscription?.unsubscribe();\n this.resetSubscription = this.quoteDraftService.reset$.subscribe(() => this.reset());\n\n return this.calculate$(this.getSnapshot()).pipe(map(noop));\n }\n\n calculate$(currentState: LineItem[]): Observable<PriceSummary> {\n const context = this.contextService.resolve();\n\n return this.priceApiService.calculate({ context, currentState }).pipe(\n tap((result: PriceSummary) => {\n this.quoteDraftService.updateByPriceSummary(result);\n\n this.charges.next(result.charges);\n\n if (context) {\n this.contextService.update({ properties: context.properties });\n }\n }),\n this.handleError(),\n );\n }\n\n calculate(currentState: LineItem[]): void {\n this.calculate$(currentState).subscribe();\n }\n\n update$(updates: FlowUpdateParams[]): Observable<PriceSummary> {\n const lineItems = cloneDeep(this.getSnapshot());\n\n return of([]).pipe(\n tap(() => this.updateService.update(lineItems, updates)),\n this.handleError(),\n switchMap(() => this.calculate$(lineItems)),\n );\n }\n\n update(updates: FlowUpdateParams[]): void {\n this.update$(updates).subscribe();\n }\n\n delete$(ids: string[]): Observable<PriceSummary> {\n return of([]).pipe(\n map(() => ids.reduce((result, id) => this.updateService.delete(result, id), this.getSnapshot())),\n this.handleError(),\n switchMap(currentState => this.calculate$(currentState)),\n );\n }\n\n delete(ids: string[]): void {\n this.delete$(ids).subscribe();\n }\n\n public get(): Observable<LineItem[]> {\n return combineLatest([this.quoteDraftService.quote$, this.bounceBackUpdate$]).pipe(\n map(([quoteDraft]) => quoteDraft.currentState),\n shareReplay(),\n );\n }\n\n public getSnapshot(): LineItem[] {\n return this.quoteDraftService.quoteSnapshot?.currentState.slice() ?? [];\n }\n\n public get charges$(): Observable<Dictionary<PricePlanCharge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<PricePlanCharge> {\n return this.charges.value;\n }\n\n public get contextSnapshot(): ConfigurationContext {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext> {\n return this.contextService.resolve$();\n }\n\n private handleError() {\n return <T>(source$: Observable<T>): Observable<T> => {\n return source$.pipe(\n catchError(error => {\n console.error(error);\n this.messageService.add({ severity: 'error', summary: error });\n\n // bounce back if configuration call has failed\n this.bounceBackUpdate$.next(true);\n\n return throwError(() => error);\n }),\n );\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { FlowConfigurationService } from './services/flow-configuration.service';\nimport { FlowUpdateService } from './services/flow-update.service';\n\n@NgModule({\n imports: [],\n providers: [FlowConfigurationService, FlowUpdateService, PriceApiService],\n})\nexport class FlowConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { ConfigurationApiService, ContextApiService, ProductModelApiService } from '@veloce/api';\nimport { ConfirmationDialogModule } from '@veloce/components';\nimport { ConfigurationRuntimeService } from './services/configuration-runtime.service';\nimport { ConfigurationService } from './services/configuration.service';\nimport { RuntimeContextService } from './services/runtime-context.service';\n\n@NgModule({\n imports: [ConfirmationDialogModule],\n providers: [\n ContextApiService,\n ProductModelApiService,\n ConfigurationApiService,\n ConfigurationRuntimeService,\n RuntimeContextService,\n ConfigurationService,\n ],\n})\nexport class ConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { FlowConfigurationModule } from './modules';\nimport { ConfigurationModule } from './modules/configuration/configuration.module';\nimport { ContextService, QuoteDraftService } from './services';\n\n@NgModule({\n imports: [ConfigurationModule, FlowConfigurationModule],\n providers: [ContextService, QuoteDraftService],\n})\nexport class SdkCoreModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map","tap","catchError"],"mappings":";;;;;;;;;;;;;MAGa,kBAAkB,GAAG,CAAC,OAAuB,EAAE,sBAAyC;;IACnG,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAEvB,MAAM,QAAQ,GAAa,gBACzB,EAAE,EACF,IAAI,EAAE,MAAA,sBAAsB,CAAC,QAAQ,mCAAI,EAAE,EAC3C,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,KAAK,EACjB,GAAG,EAAE,CAAC,EACN,WAAW,EAAE,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,WAAW,KAAI,OAAO,CAAC,WAAW,EACnE,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,EAAE,KAC9B,OAAO,CAAC,UAAU;UAClB,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,IAAI,EAAE,EAAE;UACxF,EAAE,EACK,CAAC;IAEd,OAAO,QAAQ,CAAC;AAClB;;ICjBY;AAAZ,WAAY,WAAW;IACrB,6CAAI,CAAA;IACJ,6CAAI,CAAA;AACN,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;IAEW;AAAZ,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,qCAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;IAEW;AAAZ,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,gCAAiB,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ATnB;QACT,iBAAiB;QACjB,sBAAsB;QACtB,uBAAuB;QACvB,2BAA2B;QAC3B,qBAAqB;QACrB,oBAAoB;KACrB,YARQ,CAAC,wBAAwB,CAAC;4FAUxB,mBAAmB;kBAX/B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,SAAS,EAAE;wBACT,iBAAiB;wBACjB,sBAAsB;wBACtB,uBAAuB;wBACvB,2BAA2B;wBAC3B,qBAAqB;wBACrB,oBAAoB;qBACrB;iBACF;;;MCRY,aAAa;;2GAAb,aAAa;4GAAb,aAAa,YAHd,mBAAmB,EAAE,uBAAuB;4GAG3C,aAAa,aAFb,CAAC,cAAc,EAAE,iBAAiB,CAAC,YADrC,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;4FAG5C,aAAa;kBAJzB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;oBACvD,SAAS,EAAE,CAAC,cAAc,EAAE,iBAAiB,CAAC;iBAC/C;;;ACRD;;;;;;"}
@@ -776,7 +776,7 @@ class ConfigurationService {
776
776
  }
777
777
  else {
778
778
  const context = this.contextService.resolve();
779
- if ((context === null || context === void 0 ? void 0 : context.properties) && ((_e = runtimeContext.properties) === null || _e === void 0 ? void 0 : _e.StartDate)) {
779
+ if (context.properties && ((_e = runtimeContext.properties) === null || _e === void 0 ? void 0 : _e.StartDate)) {
780
780
  this.contextService.update({
781
781
  properties: Object.assign(Object.assign({}, context.properties), runtimeContext.properties),
782
782
  });
@@ -819,7 +819,7 @@ class ConfigurationService {
819
819
  .onClose.subscribe(result => {
820
820
  if (!result) {
821
821
  const context = this.contextService.resolve();
822
- window['VELO_BACK_FN'].apply(null, [(context === null || context === void 0 ? void 0 : context.headerId) || '']);
822
+ window['VELO_BACK_FN'].apply(null, [context.headerId]);
823
823
  }
824
824
  });
825
825
  }
@@ -882,9 +882,6 @@ class RuntimeService {
882
882
  .pipe(take(1))
883
883
  .subscribe(lineItem => {
884
884
  const context = this.contextService.resolve();
885
- if (!context) {
886
- return;
887
- }
888
885
  this.updateRuntimeContext(context.properties);
889
886
  this.solutionUpdatedSubject.next(lineItem);
890
887
  }, error => {
@@ -1024,8 +1021,7 @@ class RuntimeContextService {
1024
1021
  }));
1025
1022
  }
1026
1023
  getUIDefinition(uiDefinitions = []) {
1027
- var _a;
1028
- const { uiDefinitionId } = (_a = this.contextService.resolve()) !== null && _a !== void 0 ? _a : {};
1024
+ const { uiDefinitionId } = this.contextService.resolve();
1029
1025
  const findByFn = (uiDef) => (uiDefinitionId ? uiDefinitionId === uiDef.id : uiDef.primary);
1030
1026
  const uiDefinition = uiDefinitions.find(findByFn) || (uiDefinitions.length === 1 && Object.assign({}, uiDefinitions[0]));
1031
1027
  if (!uiDefinition) {
@@ -2619,9 +2615,6 @@ class VlRampDirective {
2619
2615
  }
2620
2616
  createRamp(sourceItems, currentRamps, term) {
2621
2617
  const context = this.contextService.resolve();
2622
- if (!context) {
2623
- throw new Error('Context is not provided');
2624
- }
2625
2618
  return this.rampApiService
2626
2619
  .next({
2627
2620
  context,
@@ -3569,9 +3562,6 @@ class RuntimeComponent {
3569
3562
  var _a;
3570
3563
  const context = this.runtimeService.getRuntimeContext();
3571
3564
  const configurationContext = this.contextService.resolve();
3572
- if (!configurationContext) {
3573
- return;
3574
- }
3575
3565
  const mergeContext = Object.assign(Object.assign({}, context), { properties: Object.assign(Object.assign({}, context.properties), configurationContext.properties) });
3576
3566
  const accountId = (_a = mergeContext.properties) === null || _a === void 0 ? void 0 : _a.AccountId;
3577
3567
  if (accountId && accountId.length === 15) {