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BA,CAC/BpG,EACA5P,KAEA,MAAMkW,EAAiE,GAUvE,OARAtG,GACIA,EAASvL,SAASqD,IACVA,GAAWA,EAAQtC,WACnBsC,EAAQoE,iBAAkBqK,EAAAA,EAAAA,kBAAiBzO,EAAQoE,gBAAiB9L,GACpEkW,EAAsB1V,KAAKkH,OAIhCwO,GASGxB,EAAuBxI,IACjC,IAAIuI,EACJ,GAAIvI,GAAiCA,EAA8BkK,6CAA8C,CAE7G3B,EAAU,CACN4B,QAAS,CACL,CACIC,WAJW,QAAQpK,EAA8BkK,+CAKjDG,cAAc,KAK9B,OAAO9B,GAMH,IAAK1I,GAAZ,SAAYA,GAITA,EAAA,kBAKAA,EAAA,kBAKAA,EAAA,kBAdH,CAAYA,IAAAA,EAAoC","sources":["webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b","webpack://Msdyn365.Commerce.Online/./src/actions/product-eta-action.action.ts?1b4e","webpack://Msdyn365.Commerce.Online/./src/actions/getAlternateItemDetails.ts?6150","webpack://Msdyn365.Commerce.Online/./src/actions/getProductETADetails.ts?876d","webpack://Msdyn365.Commerce.Online/./src/actions/get-alternate-items-collection.action.ts?7762","webpack://Msdyn365.Commerce.Online/./src/actions/getProductWarehouseInfo.action.ts?bebd","webpack://Msdyn365.Commerce.Online/./src/actions/gc-get-attributeInfo.ts?d710","webpack://Msdyn365.Commerce.Online/./src/actions/genera-product-warehouse-details.action.ts?bf27","webpack://Msdyn365.Commerce.Online/./src/actions/get-product-alternate-item.action.ts?67e4","webpack://Msdyn365.Commerce.Online/./src/actions/GetListProductsETAInfo.ts?36e8","webpack://Msdyn365.Commerce.Online/./src/actions/product-collection-eta.action.ts?f8da","webpack://Msdyn365.Commerce.Online/./src/actions/getProductAdditionalDetails.ts?41e4","webpack://Msdyn365.Commerce.Online/./src/actions/get-custom-product-additional-details.action.ts?0d95","webpack://Msdyn365.Commerce.Online/./src/actions/getProductApplication.ts?c44f","webpack://Msdyn365.Commerce.Online/./src/actions/get-custom-product-application.action.ts?0ca7","webpack://Msdyn365.Commerce.Online/./src/actions/getProductSpecificationDetails.ts?0057","webpack://Msdyn365.Commerce.Online/./src/actions/get-custom-product-spec.action.ts?9abd","webpack://Msdyn365.Commerce.Online/./src/actions/getProductInterchangeDetails.ts?a22c","webpack://Msdyn365.Commerce.Online/./src/actions/get-custom-product-interchange.action.ts?80c6","webpack://Msdyn365.Commerce.Online/./src/actions/getRelatedProductDetails.ts?9e89","webpack://Msdyn365.Commerce.Online/./src/actions/get-related-product-details.action.ts?303c","webpack://Msdyn365.Commerce.Online/./src/hydrators/get-inventory-in-stock-refiner.action.ts?4980","webpack://Msdyn365.Commerce.Online/./lib/__local__/module-registration.js?8a42","webpack://Msdyn365.Commerce.Online/./src/actions/custom-get-sales-order-confirmation-with-hydrations.action.ts?25a8","webpack://Msdyn365.Commerce.Online/./src/actions/genera-product-list-warehouse-details.action.ts?6951","webpack://Msdyn365.Commerce.Online/./src/hydrators/products-by-category.action.ts?827f"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {getSelectedProductIdFromActionInput,getSimpleProductsAction,ProductInput } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { getProductETAInfoAsync } from './getProductETADetails';\n// import { ProductInput } from './inputs/product-input';\n/**\n * ProductEtaAction Input Action\n */\nexport class ProductEtaActionInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productId: number;\n\n public channelId: number;\n\n public config: any;\n\n constructor(productId: number, channelId: number, config: any) {\n this.channelId = channelId;\n this.productId = productId;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `${this.channelId}-${this.productId}`;\n public getCacheObjectType = () => 'TODO';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IProductEtaActionData {\n etaObj: any;\n}\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\nexport const createGetProductEtaInput = (inputData: ICreateActionContext>): Msdyn365.IActionInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n if(productId)\n {\n return new ProductEtaActionInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n }\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nexport async function getProductEtaAction(input: ProductEtaActionInput, ctx: Msdyn365.IActionContext): Promise {\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\n const prod:ProductInput[] = new Array();\n prod.push(new ProductInput(input.productId,ctx.requestContext.apiSettings));\n var prodDtl = await getSimpleProductsAction(prod,ctx);\n const prodEta = await getProductETAInfoAsync({callerContext: ctx, bypassCache: 'get'},ctx,prodDtl[0].ItemId!);\n return { etaObj: prodEta };\n}\n\nexport const getProductEtaActionDataAction = Msdyn365.createObservableDataAction({\n action: >getProductEtaAction,\n // TODO: Give your data action a unique id\n id: 'ProductEtaAction',\n input: createGetProductEtaInput\n // TODO: Uncomment the below line if this is a meant to be a batched data action\n // isBatched: true\n});\n\nexport default getProductEtaActionDataAction;","\r\n/*!\r\n* Copyright (c) Microsoft Corporation.\r\n* All rights reserved. See LICENSE in the project root for license information.\r\n* THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n* TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n*/\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { Buffer } from 'buffer';\r\n\r\nfunction getProductInfoQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n}\r\n\r\n\r\nexport function getProductInfoInput(\r\n apiConfiguration:\r\n DataServiceEntities.IAPIConfiguration,\r\n productIds:\r\n string\r\n): IDataServiceRequest {\r\n const query = getProductInfoQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductInfo',\r\n true,\r\n DataServiceEntities.ValueExtensionClass\r\n ,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductDetails' },\r\n {\r\n apiConfiguration: apiConfiguration,\r\n productIds: productIds\r\n }\r\n );\r\n}\r\n\r\nexport function getProductInfoAsync(\r\n context: IContext,ctx: Msdyn365.IActionContext, productIds:\r\n string\r\n): AsyncResult {\r\n const clientId=Buffer.from(ctx.requestContext.app.config.clientId,'utf8').toString('base64'); btoa(ctx.requestContext.app.config.clientId);\r\n const clientSecret=Buffer.from(ctx.requestContext.app.config.clientSecret,'utf8').toString('base64');\r\n const resource=Buffer.from(ctx.requestContext.app.config.baseUrl,'utf8').toString('base64');\r\n const altItemUrl=Buffer.from(ctx.requestContext.app.config.axAlternateItemUrl,'utf8').toString('base64');\r\n const loginUrl=Buffer.from(`https://login.microsoftonline.com/${ctx.requestContext.app.config.tenentId}/oauth2/token`,'utf8').toString('base64');\r\n const apiConfiguration:DataServiceEntities.IAPIConfiguration = { ClientId: clientId, ClientSecret: clientSecret, Resource: resource, GrantType:'client_credentials', APIUrl:altItemUrl, LoginUrl: loginUrl};\r\n const request = getProductInfoInput(apiConfiguration, productIds);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","\r\n/*!\r\n* Copyright (c) Microsoft Corporation.\r\n* All rights reserved. See LICENSE in the project root for license information.\r\n* THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n* TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n*/\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { Buffer } from 'buffer';\r\n\r\nfunction getProductETAInfoQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n}\r\n\r\nexport function getProductETAInfoInput(\r\n apiConfiguration:\r\n DataServiceEntities.IAPIConfiguration,\r\n productIds:\r\n string\r\n): IDataServiceRequest {\r\n const query = getProductETAInfoQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductETAInfo',\r\n true,\r\n DataServiceEntities.ProductETAInfo\r\n ,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductETAInfo' },\r\n {\r\n apiConfiguration: apiConfiguration,\r\n productIds: productIds\r\n }\r\n );\r\n}\r\n\r\nexport function getProductETAInfoAsync(\r\n context: IContext,ctx: Msdyn365.IActionContext, productIds:\r\n string\r\n): AsyncResult {\r\n const clientId=Buffer.from(ctx.requestContext.app.config.clientId,'utf8').toString('base64');\r\n const clientSecret=Buffer.from(ctx.requestContext.app.config.clientSecret,'utf8').toString('base64');\r\n const resource=Buffer.from(ctx.requestContext.app.config.baseUrl,'utf8').toString('base64');\r\n const altItemUrl=Buffer.from(ctx.requestContext.app.config.axUrl,'utf8').toString('base64');\r\n const loginUrl=Buffer.from(`https://login.microsoftonline.com/${ctx.requestContext.app.config.tenentId}/oauth2/token`,'utf8').toString('base64');\r\n const apiConfiguration:DataServiceEntities.IAPIConfiguration = { ClientId: clientId, ClientSecret: clientSecret, Resource: resource, GrantType:'client_credentials', APIUrl: altItemUrl, LoginUrl: loginUrl};\r\n const request = getProductETAInfoInput(apiConfiguration, productIds);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { ProductSearchCriteria,ProductLookupClause } from '@msdyn365-commerce/retail-proxy';\nimport {IAlternateProduct} from '../themes/adventureworks/views/common/buyboxInterface';\nimport { getByIdsAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { ProductAvailabilitiesForSelectedVariantInput, getProductAvailabilitiesForSelectedVariant,\n IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\n import {getProductEtaAction,ProductEtaActionInput} from './product-eta-action.action';\nimport { getProductInfoAsync } from './getAlternateItemDetails';\nimport { ValueExtensionClass } from './AlternateItemsEntity.g';\n// import { ProductDetailsExtensionClass } from './AlternateItemsEntity.g';\n/**\n * GetAlternateItemsCollection Input Action\n */\nexport class GetAlternateItemsCollectionInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productIds: string[];\n\n public config: any;\n constructor(prodIds: string[],config: any) {\n this.productIds = prodIds;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `TODO`;\n public getCacheObjectType = () => 'TODO';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\nexport interface IAlternateItems{\n dataAreaId: string;\n ItemId: string;\n AltItemId: string;\n UseAltItemId: string;\n}\n\nexport interface IAlternateProductData {\n ItemId:string;\n currentProd: IAlternateProduct | undefined;\n serviceResp: IAlternateItems[] | undefined;\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IGetAlternateItemsCollectionData {\n respObj: IAlternateProductData[] | undefined;\n}\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n// return new GetAlternateItemsCollectionInput();\n// };\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nexport async function getProductsAlternateItemsAction(input: GetAlternateItemsCollectionInput, ctx: Msdyn365.IActionContext): Promise {\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\n const alterItems:IAlternateProductData[] = new Array();\n try{\n if(input.productIds !== null && input.productIds.length > 0)\n {\n const alternateProdDetails: ValueExtensionClass[] = await getProductInfoAsync({ callerContext: ctx, bypassCache: 'get' }, ctx,input.productIds.toString());\n for(let i=0; i < input.productIds.length; i++)\n {\n const item:IAlternateProductData = {ItemId: input.productIds[`${i}`],currentProd:undefined,serviceResp:undefined};\n if(alternateProdDetails)\n {\n const alternateDtls = alternateProdDetails.find(data => data.ItemId === input.productIds[`${i}`]);\n if(alternateDtls)\n {\n const currentAltItems: IAlternateItems[] = [];\n currentAltItems.push({AltItemId: alternateDtls.AltItemId,dataAreaId: alternateDtls.dataAreaId,ItemId: alternateDtls.ItemId,UseAltItemId: alternateDtls.UseAltItemId});\n item.serviceResp = currentAltItems;\n }\n }\n alterItems.push(item);\n }\n if(alterItems && alterItems.length > 0)\n {\n\n const productLookup:ProductLookupClause[] = new Array();\n alterItems.forEach((val:IAlternateProductData)=>{\n if(productLookup.length === 0 || (typeof productLookup.find(x => val.serviceResp && x.ItemId === val.serviceResp[0].AltItemId) === 'undefined'))\n {\n const prodLookup:ProductLookupClause = {\n ItemId : val.serviceResp && val.serviceResp[0].AltItemId};\n productLookup.push(prodLookup);\n }\n });\n // const productLookup:ProductLookupClause[] = new Array();\n // const prodLookup:ProductLookupClause = {\n // ItemId : item.serviceResp?.AltItemId};\n // productLookup.push(prodLookup);\n const criteria:ProductSearchCriteria={\n Context:{CatalogId:ctx.requestContext.apiSettings.catalogId,ChannelId:ctx.requestContext.apiSettings.channelId},\n ItemIds:productLookup\n };\n var prodLists = await searchByCriteriaAsync({callerContext: ctx},criteria);\n if(prodLists && prodLists.length > 0)\n {\n var altSampleProducts = await getByIdsAsync({callerContext: ctx}, ctx.requestContext.apiSettings.channelId, prodLists.map(prod => prod.RecordId));\n alterItems.forEach((val:IAlternateProductData)=>{\n if(val.serviceResp && val.serviceResp !== undefined && val.serviceResp.length > 0)\n {\n const sampleProd = altSampleProducts.find(x => val.serviceResp && x.ItemId === val.serviceResp[0].AltItemId);\n if(sampleProd)\n {\n const alterProdDtl:IAlternateProduct = {productDtl: sampleProd,productAvailibility:null,etaDetails:undefined,inventoryLabel:undefined};\n val.currentProd = alterProdDtl;\n }\n }\n });\n\n for(var item=0; item('/get/example/id/1', 'get');\n return { respObj: alterItems};\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >getProductsAlternateItemsAction,\n // TODO: Give your data action a unique id\n id: 'GetAlternateItemsCollection'\n // input: createInput\n // TODO: Uncomment the below line if this is a meant to be a batched data action\n // isBatched: true\n});\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nfunction getProductWarehouseInfoQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\n export function getProductWarehouseInfoInput (\r\n queryResultSettings: IQueryResultSettings, apiConfiguration:\r\n DataServiceEntities.IAPIConfiguration,\r\n productIds:\r\n string[]\r\n ): IDataServiceRequest {\r\n const query = getProductWarehouseInfoQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductWarehouseInfo',\r\n true,\r\n DataServiceEntities.GCProductWiseWarehouseDetailsExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IGCProductWiseWarehouseDetails' },\r\n {\r\n apiConfiguration: apiConfiguration,\r\n productIds: productIds\r\n }\r\n );\r\n }\r\n\r\nexport function getProductWarehouseInfoAsync (\r\n context: IContext,\r\n ctx: Msdyn365.IActionContext,\r\n productIds:\r\n string[]\r\n ): AsyncResult {\r\n const clientId=Buffer.from(ctx.requestContext.app.config.clientId,'utf8').toString('base64');\r\n const clientSecret=Buffer.from(ctx.requestContext.app.config.clientSecret,'utf8').toString('base64');\r\n const resource=Buffer.from(ctx.requestContext.app.config.baseUrl,'utf8').toString('base64');\r\n const altItemUrl=Buffer.from(ctx.requestContext.app.config.axItemWarehouseUrl,'utf8').toString('base64');\r\n const loginUrl=Buffer.from(`https://login.microsoftonline.com/${ctx.requestContext.app.config.tenentId}/oauth2/token`,'utf8').toString('base64');\r\n const apiConfiguration:DataServiceEntities.IAPIConfiguration = { ClientId: clientId, ClientSecret: clientSecret, Resource: resource, GrantType:'client_credentials', APIUrl: altItemUrl, LoginUrl: loginUrl};\r\n const request = getProductWarehouseInfoInput(context.queryResultSettings || {},apiConfiguration, productIds);\r\n return callActionOrExecute(request, context.callerContext);\r\n }\r\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nfunction getAttributeInfoQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\n\r\nexport function getAtrributeInfoInput (\r\n attributeName:\r\n string\r\n): IDataServiceRequest {\r\nconst query = getAttributeInfoQuery();\r\nreturn query.createDataServiceRequestForOperation(\r\n 'GetAttributeInfo',\r\n true,\r\n DataServiceEntities.GCGetAttributeInfoResponseExtensionClass\r\n ,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IGCGetAttributeInfoResponse' },\r\n {\r\n attributeName: attributeName\r\n }\r\n);\r\n}\r\n\r\nexport function getAttributeInfoAsync (\r\n context: IContext, attributeName: string\r\n ): AsyncResult {\r\n const request = getAtrributeInfoInput(attributeName);\r\n return callActionOrExecute(request, context.callerContext);\r\n }\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\nimport {getSelectedProductIdFromActionInput, ProductInput, getSimpleProductsAction } from '@msdyn365-commerce-modules/retail-actions';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { ProductWarehouses } from './AlternateItemsEntity.g';\nimport { getProductWarehouseInfoAsync } from './getProductWarehouseInfo.action';\n\n/**\n * GeneraProductWarehouseDetails Input Action\n */\nexport class GeneraProductWarehouseDetailsInput implements Msdyn365.IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public config: any;\n\n constructor(productId: number, channelId: number, config: any) {\n this.channelId = channelId;\n this.productId = productId;\n this.config = config;\n }\n\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `GeneraProductWarehouseDetailsInput`;\n public getCacheObjectType = () => 'ProductWarehouses';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IGeneraProductWarehouseDetailsData {\n warehouseDetails: ProductWarehouses[];\n}\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n // return new GeneraProductWarehouseDetailsInput();\n const productId = getSelectedProductIdFromActionInput(inputData);\n if(productId)\n {\n return new GeneraProductWarehouseDetailsInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n }\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nexport async function getCurrentProductWarehouseDetailsAction(input: GeneraProductWarehouseDetailsInput, ctx: Msdyn365.IActionContext): Promise {\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\n // TODO: Uncomment the below line to get the value from a service\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\n let productWarehouseDtl:ProductWarehouses[] = [];\n const prod:ProductInput[] = new Array();\n prod.push(new ProductInput(input.productId,ctx.requestContext.apiSettings));\n var prodDtl = await getSimpleProductsAction(prod,ctx);\n const prodIds:string[] = [];\n prodIds.push(prodDtl[0].ItemId!);\n const prodWarehouseDetails = await getProductWarehouseInfoAsync({callerContext:ctx,bypassCache: 'get'},ctx,prodIds);\n if(prodWarehouseDetails && prodWarehouseDetails[0].warehouseDetails && prodWarehouseDetails[0].warehouseDetails?.value)\n {\n productWarehouseDtl = prodWarehouseDetails[0].warehouseDetails?.value;\n }\n return productWarehouseDtl;\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >getCurrentProductWarehouseDetailsAction,\n // TODO: Give your data action a unique id\n id: 'getCurrentProductWarehouseDetailsAction',\n input: createInput\n // TODO: Uncomment the below line if this is a meant to be a batched data action\n // isBatched: true\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {getSelectedProductIdFromActionInput,getSimpleProductsAction,ProductInput, DeliveryMode,\n ProductAvailabilitiesForSelectedVariantInput, getProductAvailabilitiesForSelectedVariant,\n IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\nimport { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { ProductSearchCriteria,ProductLookupClause,SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { IAlternateItems } from '../modules/buybox/components/buybox-components';\nimport {IAlternateProduct} from '../themes/adventureworks/views/common/buyboxInterface';\nimport {getProductEtaAction,ProductEtaActionInput} from './product-eta-action.action';\nimport { getProductInfoAsync } from './getAlternateItemDetails';\n/**\n * GetProductAlternateItem Input Action\n */\nexport class GetProductAlternateItemInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productId: number;\n\n public channelId: number;\n\n public config: any;\n\n constructor(productId: number, channelId: number, config: any) {\n this.channelId = channelId;\n this.productId = productId;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `TODO`;\n public getCacheObjectType = () => 'TODO';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IGetProductAlternateItemData {\n respObj: IGetAlternateItemWithServiceResponse;\n}\n\nexport interface IGetAlternateItemWithServiceResponse {\n product: IAlternateProduct | undefined;\n response: IAlternateItems | undefined;\n}\n\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\nconst createInput = (inputData: ICreateActionContext>): Msdyn365.IActionInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n if(productId)\n {\n return new GetProductAlternateItemInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n }\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nexport async function getProductAlternateItemAction(input: GetProductAlternateItemInput, ctx: Msdyn365.IActionContext): Promise {\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\n let proddtl:IGetAlternateItemWithServiceResponse = {product:undefined,response:undefined};\n try{\n const prod:ProductInput[] = new Array();\n prod.push(new ProductInput(input.productId,ctx.requestContext.apiSettings));\n var prodDtl = await getSimpleProductsAction(prod,ctx);\n const prodAlternates = await getProductInfoAsync({ callerContext: ctx, bypassCache: 'get' }, ctx,prodDtl[0].ItemId!);\n let altProduct:SimpleProduct|undefined;\n let alterProdAvailability: IProductInventoryInformation[] | null = null;\n let prodETA;\n if(prodAlternates && prodAlternates.length>0)\n {\n const productLookup:ProductLookupClause[] = new Array();\n const prodLookup:ProductLookupClause = {\n ItemId : prodAlternates[0].AltItemId};\n productLookup.push(prodLookup);\n const criteria:ProductSearchCriteria={\n Context:{CatalogId:ctx.requestContext.apiSettings.catalogId,ChannelId:ctx.requestContext.apiSettings.channelId},\n ItemIds:productLookup\n };\n var prodLists = await searchByCriteriaAsync({callerContext: ctx},criteria);\n if(prodLists && prodLists.length > 0)\n {\n var sampleProd = await getByIdAsync({callerContext: ctx}, prodLists[0].RecordId, ctx.requestContext.apiSettings.channelId);\n altProduct = sampleProd;\n const dt = new ProductAvailabilitiesForSelectedVariantInput(sampleProd.RecordId, ctx.requestContext.apiSettings.channelId);\n alterProdAvailability = await getProductAvailabilitiesForSelectedVariant(dt,ctx);\n const etaProdinpurt = new ProductEtaActionInput(sampleProd.RecordId,ctx.requestContext.apiSettings.channelId,undefined);\n const alterProdEta = await getProductEtaAction(etaProdinpurt,ctx);\n if(alterProdEta)\n {\n prodETA = alterProdEta.etaObj;\n }\n await getProductAvailabilitiesForSelectedVariant(new ProductAvailabilitiesForSelectedVariantInput(input.productId, ctx.requestContext.apiSettings.channelId),ctx);\n }\n\n }\n var altProdDtl:IAlternateProduct | undefined = altProduct? {\n productDtl : altProduct,\n productAvailibility: alterProdAvailability,\n inventoryLabel: alterProdAvailability ? _getInventoryLabel(alterProdAvailability) : undefined,\n etaDetails: prodETA\n }: undefined;\n proddtl = {\n product : altProdDtl,\n response : prodAlternates[0]\n };\n }\n catch(e){\n console.log(e);\n }\n // TODO: Uncomment the below line to get the value from a service\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\n return { respObj: proddtl };\n}\n\nconst _getInventoryLabel = (productQty : IProductInventoryInformation[]|undefined) => {\n if(productQty)\n {\n const newShippingQuantity = productQty.find(shipping => shipping.deliveryType === DeliveryMode.shipping);\n if(newShippingQuantity)\n {\n return newShippingQuantity.StockLevelLabel;\n }\n }\n return '';\n};\n\nexport default Msdyn365.createObservableDataAction({\n action: >getProductAlternateItemAction,\n // TODO: Give your data action a unique id\n id: 'GetProductAlternateItem',\n input: createInput\n // TODO: Uncomment the below line if this is a meant to be a batched data action\n // isBatched: true\n});\n","// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { Buffer } from 'buffer';\r\n\r\nfunction getListProductsETAInfoQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\n\r\nexport function getListProductsETAInfoInput (\r\n queryResultSettings: IQueryResultSettings, apiConfiguration:\r\n DataServiceEntities.IAPIConfiguration,\r\n productIds:\r\n string[]\r\n): IDataServiceRequest {\r\nconst query = getListProductsETAInfoQuery().resultSettings(queryResultSettings);\r\nreturn query.createDataServiceRequestForOperation(\r\n 'GetListProductsETAInfo',\r\n true,\r\n DataServiceEntities.ProductIdWiseETADetailsExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductIdWiseETADetails' },\r\n {\r\n apiConfiguration: apiConfiguration,\r\n productIds: productIds\r\n }\r\n);\r\n}\r\n\r\nexport function getListProductsETAInfoAsync (\r\n context: IContext,ctx: Msdyn365.IActionContext,\r\n productIds:\r\n string[]\r\n ): AsyncResult {\r\n const clientId=Buffer.from(ctx.requestContext.app.config.clientId,'utf8').toString('base64');\r\n const clientSecret=Buffer.from(ctx.requestContext.app.config.clientSecret,'utf8').toString('base64');\r\n const resource=Buffer.from(ctx.requestContext.app.config.baseUrl,'utf8').toString('base64');\r\n const altItemUrl=Buffer.from(ctx.requestContext.app.config.axUrl,'utf8').toString('base64');\r\n const loginUrl=Buffer.from(`https://login.microsoftonline.com/${ctx.requestContext.app.config.tenentId}/oauth2/token`,'utf8').toString('base64');\r\n const apiConfiguration:DataServiceEntities.IAPIConfiguration = { ClientId: clientId, ClientSecret: clientSecret, Resource: resource, GrantType:'client_credentials', APIUrl: altItemUrl, LoginUrl: loginUrl};\r\n const request = getListProductsETAInfoInput(\r\n context.queryResultSettings || {}, apiConfiguration, productIds);\r\n return callActionOrExecute(request, context.callerContext);\r\n }","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { getListProductsETAInfoAsync } from './GetListProductsETAInfo';\n\nexport interface productETADtl {\n ProductId?: string;\n EtaDate?: string;\n EtaMessage?: string;\n}\n/**\n * ProductCollectionEta Input Action\n */\nexport class ProductCollectionEtaInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productIds: string[];\n\n public config: any;\n constructor(prodIds: string[],config: any) {\n this.productIds = prodIds;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `TODO`;\n public getCacheObjectType = () => 'TODO';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IProductCollectionEtaData {\n result: productETADtl[];\n}\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n// return new ProductCollectionEtaInput();\n// };\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nexport async function getProductCollectionEtaAction(input: ProductCollectionEtaInput, ctx: Msdyn365.IActionContext): Promise {\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\n const etaDtl:productETADtl[] = new Array();\n if(input.productIds !== null && input.productIds.length > 0)\n {\n const productETAinfoList = await getListProductsETAInfoAsync({callerContext: ctx, bypassCache: 'get'},ctx,input.productIds);\n for(let i=0; i < input.productIds.length; i++)\n {\n if(productETAinfoList && productETAinfoList.length > 0)\n {\n const productETA = productETAinfoList.filter(x => x.ItemId === input.productIds[`${i}`])[0].etaInfo;\n if(productETA)\n {etaDtl.push({ProductId:input.productIds[`${i}`],EtaDate:productETA.ETADate,EtaMessage:productETA.ResultMessage});}\n }\n }\n }\n\n // TODO: Uncomment the below line to get the value from a service\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\n return { result: etaDtl };\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >getProductCollectionEtaAction,\n // TODO: Give your data action a unique id\n id: 'ProductCollectionEta'\n //input: createInput\n // TODO: Uncomment the below line if this is a meant to be a batched data action\n // isBatched: true\n});\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nexport function getProductAdditionalDetailsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\nfunction getProductAdditionalDetailsInput (\r\n queryResultSettings: IQueryResultSettings, productId:\r\n number\r\n): IDataServiceRequest {\r\n const query = getProductAdditionalDetailsQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductAdditionalDetails',\r\n true,\r\n DataServiceEntities.ProductAdditionalDetailsExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductAdditionalDetailsEntity' },\r\n {\r\n ProductId: productId\r\n }\r\n );\r\n}\r\n\r\nexport function getProductAdditionalDetailsAsync (\r\n context: IContext, productId:\r\n number\r\n ): AsyncResult {\r\n const request = getProductAdditionalDetailsInput(\r\n context.queryResultSettings || {}, productId);\r\n return callActionOrExecute(request, context.callerContext);\r\n }","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\n// import { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n// import {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getProductAdditionalDetailsAsync } from './getProductAdditionalDetails';\r\n\r\n/**\r\n * GetCustomProductSpec Input Action\r\n */\r\nexport class GetCustomProductSpecficiationInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public config: any;\r\n\r\n constructor(productId: number, channelId: number, config: any) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n this.config = config;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `GetCustomProductAdditionalDetails${this.productId}`;\r\n public getCacheObjectType = () => 'Spec';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n// export interface IGetCustomProductSpecData {\r\n// text: string;\r\n// }\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetCustomProductSpecficiationInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\r\n\r\n }\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetCustomProductSpecficiationInput, ctx: Msdyn365.IActionContext): Promise {\r\n const prodAttr: AttributeValue[] = new Array();\r\n const response = await getProductAdditionalDetailsAsync({ callerContext: ctx }, input.productId);\r\n if (response && response.length > 0) {\r\n // response = response.sort((x,y) => x.Interchange_Part_Number!.localeCompare(y.Interchange_Part_Number!));\r\n\r\n let attr: AttributeValue = {\r\n KeyName: 'Country Of Origin',\r\n Name: 'Country Of Origin',\r\n TextValue: response[0].CountryLongName === \"\" ? 'N/A' : response[0].CountryLongName\r\n , DataTypeValue: 5\r\n };\r\n prodAttr.push(attr);\r\n attr = {\r\n KeyName: 'Life Cycle Status',\r\n Name: 'Life Cycle Status',\r\n TextValue: response[0].ProductLifeCycleDescription === \"\" ? 'N/A' : response[0].ProductLifeCycleDescription\r\n , DataTypeValue: 5\r\n };\r\n prodAttr.push(attr);\r\n }\r\n else{\r\n let attr: AttributeValue = {\r\n KeyName: 'Country Of Origin',\r\n Name: 'Country Of Origin',\r\n TextValue: 'N/A'\r\n , DataTypeValue: 5\r\n };\r\n prodAttr.push(attr);\r\n attr = {\r\n KeyName: 'Life Cycle Status',\r\n Name: 'Life Cycle Status',\r\n TextValue: 'N/A'\r\n , DataTypeValue: 5\r\n };\r\n prodAttr.push(attr);\r\n }\r\n return prodAttr;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetCustomProductAdditionalDetails',\r\n input: createInput\r\n});\r\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nexport function getProductApplicationQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\nfunction getProductApplicationInput (\r\n queryResultSettings: IQueryResultSettings, productId:\r\n number\r\n): IDataServiceRequest {\r\n if(!queryResultSettings.Paging)\r\n {\r\n queryResultSettings.Paging = new EntityClasses.PagingInfoClass();\r\n queryResultSettings.Paging.Top = 1000;\r\n }\r\n const query = getProductApplicationQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductApplication',\r\n true,\r\n DataServiceEntities.ProductApplicationExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductApplicationEntity' },\r\n {\r\n ProductId: productId\r\n }\r\n );\r\n}\r\n\r\nexport function getProductApplicationInputAsync (\r\n context: IContext, productId:\r\n number\r\n ): AsyncResult {\r\n const request = getProductApplicationInput(\r\n context.queryResultSettings || {}, productId);\r\n return callActionOrExecute(request, context.callerContext);\r\n }","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\n// import { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\n\r\n// import {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getProductApplicationInputAsync } from './getProductApplication';\r\nimport { IProductApplicationEntity } from './AlternateItemsEntity.g';\r\n\r\n/**\r\n * GetCustomProductSpec Input Action\r\n */\r\nexport class GetCustomProductApplicationInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public config: any;\r\n\r\n constructor(productId: number, channelId: number, config: any) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n this.config = config;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `GetCustomProductApplication${this.productId}`;\r\n public getCacheObjectType = () => 'Spec';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n// export interface IGetCustomProductSpecData {\r\n// text: string;\r\n// }\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetCustomProductApplicationInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\r\n\r\n }\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetCustomProductApplicationInput, ctx: Msdyn365.IActionContext): Promise {\r\n const response = await getProductApplicationInputAsync({ callerContext: ctx }, input.productId);\r\n // if (response && response.length > 0) {\r\n // response = response.sort((x,y) => x.Interchange_Part_Number!.localeCompare(y.Interchange_Part_Number!));\r\n\r\n // let attr: AttributeValue = {\r\n // KeyName: 'Country Of Origin',\r\n // Name: 'Country Of Origin',\r\n // TextValue: response[0].CountryLongName\r\n // , DataTypeValue: 5\r\n // };\r\n // prodAttr.push(attr);\r\n // attr = {\r\n // KeyName: 'Life Cycle Status',\r\n // Name: 'Life Cycle Status',\r\n // TextValue: response[0].ProductLifeCycleDescription\r\n // , DataTypeValue: 5\r\n // };\r\n // prodAttr.push(attr);\r\n // }\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetCustomProductApplication',\r\n input: createInput\r\n});\r\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nexport function getProductSpecificationDetailsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\nfunction getProductSpecificationDetailsInput (\r\n queryResultSettings: IQueryResultSettings, productId:\r\n number\r\n): IDataServiceRequest {\r\n const query = getProductSpecificationDetailsQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductSpecificationDetails',\r\n true,\r\n DataServiceEntities.ProductSpecificationsEntityExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductSpecificationsEntity' },\r\n {\r\n ProductId: productId\r\n }\r\n );\r\n}\r\n\r\nexport function getProductSpecificationDetailsAsync (\r\n context: IContext, productId:\r\n number\r\n ): AsyncResult {\r\n const request = getProductSpecificationDetailsInput(\r\n context.queryResultSettings || {}, productId);\r\n return callActionOrExecute(request, context.callerContext);\r\n }","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\n// import { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\n// import {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n import {getProductSpecificationDetailsAsync} from './getProductSpecificationDetails';\n\n/**\n * GetCustomProductSpec Input Action\n */\nexport class GetCustomProductSpecficiationInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productId: number;\n\n public channelId: number;\n\n public config: any;\n\n constructor(productId: number, channelId: number, config: any) {\n this.channelId = channelId;\n this.productId = productId;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `GetCustomProductSpecification${this.productId}`;\n public getCacheObjectType = () => 'Spec';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\n// export interface IGetCustomProductSpecData {\n// text: string;\n// }\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n if(productId)\n {\n return new GetCustomProductSpecficiationInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n }\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nasync function action(input: GetCustomProductSpecficiationInput, ctx: Msdyn365.IActionContext): Promise {\n const prodAttr:AttributeValue[] = new Array();\n const response = await getProductSpecificationDetailsAsync({callerContext: ctx},input.productId);\n if(response && response.length > 0)\n {\n // response = response.sort((x,y) => x.Interchange_Part_Number!.localeCompare(y.Interchange_Part_Number!));\n response.forEach(element =>{\n const attr:AttributeValue={AttributeValueId:element.Specification_Id?+element.Specification_Id:0,\n KeyName:element.Public_Display_Name,\n Name:element.Public_Display_Name,\n TextValue:element.Product_Attirbute_Value\n ,DataTypeValue: 5 };\n prodAttr.push(attr);\n });\n }\n return prodAttr;\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >action,\n id: 'GetCustomProductSpecifications',\n input: createInput\n});\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nfunction getProductInterchangeDetailsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\n\r\nexport function getProductInterchangeDetailsInput (\r\n queryResultSettings: IQueryResultSettings, productId:\r\n number\r\n): IDataServiceRequest {\r\nconst query = getProductInterchangeDetailsQuery().resultSettings(queryResultSettings);\r\nreturn query.createDataServiceRequestForOperation(\r\n 'GetProductInterchangeDetails',\r\n true,\r\n DataServiceEntities.ProductInterchangesEntityExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductInterchangesEntity' },\r\n {\r\n ProductId: productId\r\n }\r\n);\r\n}\r\n\r\nexport function getProductInterchangeDetailsAsync (\r\n context: IContext, productId:\r\n number\r\n ): AsyncResult {\r\n const request = getProductInterchangeDetailsInput(\r\n context.queryResultSettings || {}, productId);\r\n return callActionOrExecute(request, context.callerContext);\r\n }\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\n// import { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\n// import {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n import {getProductInterchangeDetailsAsync} from './getProductInterchangeDetails';\n\n/**\n * GetCustomProductSpec Input Action\n */\nexport class GetCustomProductInterchangeInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productId: number;\n\n public channelId: number;\n\n public config: any;\n\n constructor(productId: number, channelId: number, config: any) {\n this.channelId = channelId;\n this.productId = productId;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `GetCustomProductInte${this.productId}`;\n public getCacheObjectType = () => 'Interchange';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\n// export interface IGetCustomProductSpecData {\n// text: string;\n// }\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n if(productId)\n {\n return new GetCustomProductInterchangeInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n }\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nasync function action(input: GetCustomProductInterchangeInput, ctx: Msdyn365.IActionContext): Promise {\n const prodAttr:AttributeValue[] = new Array();\n const response = await getProductInterchangeDetailsAsync({callerContext: ctx},input.productId);\n if(response && response.length > 0)\n {\n // response = response.sort((x,y) => x.Interchange_Part_Number!.localeCompare(y.Interchange_Part_Number!));\n response.forEach(element =>{\n const attr:AttributeValue={AttributeValueId:element.Interchange_Id?+element.Interchange_Id:0,\n KeyName:element.Public_Display_Name,\n Name:element.Public_Display_Name,\n TextValue:element.Interchange_Part_Number\n ,DataTypeValue: 5 };\n prodAttr.push(attr);\n });\n }\n return prodAttr;\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >action,\n id: 'GetCustomProductInterchange',\n input: createInput\n});\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nfunction getRelatedProductsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\n\r\nexport function getRelatedProductsInput (\r\nqueryResultSettings: IQueryResultSettings, productId:\r\n number\r\n): IDataServiceRequest {\r\n const query = getRelatedProductsQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetRelatedProducts',\r\n true,\r\n DataServiceEntities.ItemIdsExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IItemIds' },\r\n {\r\n ProductId: productId\r\n }\r\n );\r\n}\r\n\r\nexport function getRelatedProductsAsync (\r\ncontext: IContext, productId:\r\n number\r\n): AsyncResult {\r\nconst request = getRelatedProductsInput(\r\n context.queryResultSettings || {}, productId);\r\nreturn callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {getSelectedProductIdFromActionInput, generateProductImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { ProductSearchResult, ProductSearchCriteria, ProductLookupClause } from '@msdyn365-commerce/retail-proxy';\n// import {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n import {getRelatedProductsAsync} from './getRelatedProductDetails';\n import { searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n\n/**\n * GetCustomProductSpec Input Action\n */\nexport class GetCustomRelatedProductsInput implements Msdyn365.IActionInput {\n // TODO: Construct the input needed to run the action\n public productId: number;\n\n public channelId: number;\n\n public config: any;\n\n constructor(productId: number, channelId: number, config: any) {\n this.channelId = channelId;\n this.productId = productId;\n this.config = config;\n }\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `GetCustomRelatedProducts${this.productId}`;\n public getCacheObjectType = () => 'RelatedProducts';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IGetCustomRelatedProductsData {\n text: string;\n}\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n if(productId)\n {\n return new GetCustomRelatedProductsInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n }\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nasync function action(input: GetCustomRelatedProductsInput, ctx: Msdyn365.IActionContext): Promise {\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\n\n // TODO: Uncomment the below line to get the value from a service\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\n let prodAttr:ProductSearchResult[] = new Array();\n // const response = await getProductSpecificationDetailsAsync({callerContext: ctx},input.productId);\n // if(response && response.length > 0)\n // {\n // response.forEach(element =>{\n // let attr:AttributeValue={AttributeValueId:element.Specification_Id?+element.Specification_Id:0,\n // KeyName:element.Public_Display_Name,\n // Name:element.Public_Display_Name,\n // TextValue:element.Product_Attirbute_Value\n // ,DataTypeValue: 5 };\n // prodAttr.push(attr);\n // });\n // }\n const response = await getRelatedProductsAsync({callerContext: ctx},input.productId);\n if(response && response.length > 0)\n {\n const productLookup:ProductLookupClause[] = new Array();\n response.forEach(function(itemids,index){\n const prodLookup:ProductLookupClause = {\n ItemId : itemids.ItemId};\n productLookup.push(prodLookup);\n });\n const criteria:ProductSearchCriteria={\n Context:{CatalogId:ctx.requestContext.apiSettings.catalogId,ChannelId:ctx.requestContext.apiSettings.channelId},\n ItemIds:productLookup\n };\n var prodLists = await searchByCriteriaAsync({callerContext: ctx},criteria);\n\n\n if(prodLists.length > 0 )\n {\n const prodLst = prodLists.map(productSearchResult => {\n let newImageUrl = generateProductImageUrl(\n productSearchResult,\n ctx.requestContext.apiSettings\n );\n //const newImageUrl = productSearchResult.PrimaryImageUrl && productSearchResult.PrimaryImageUrl.search('&w=275&h=275&q=80&m=6&f=jpg') == -1 ? productSearchResult.PrimaryImageUrl + '&w=275&h=275&q=80&m=6&f=jpg' : productSearchResult.PrimaryImageUrl\n if (newImageUrl) {\n newImageUrl = decodeURI(newImageUrl);\n // console.log(newImageUrl);\n productSearchResult.PrimaryImageUrl = newImageUrl;\n }\n console.log(productSearchResult.PrimaryImageUrl);\n return (productSearchResult);\n });\n prodAttr = prodLst;\n }\n }\n return prodAttr;\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >action,\n // TODO: Give your data action a unique id\n id: 'GetRelatedProductDetails',\n input: createInput\n // TODO: Uncomment the below line if this is a meant to be a batched data action\n // isBatched: true\n});\n","import { createObservableDataAction, IAction, IActionContext, IActionInput, versionGte } from '@msdyn365-commerce/core';\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nexport enum ProductListInventoryFilteringOptions {\r\n HideOOS = \"hideOOS\",\r\n SortOOS = \"sortOOS\",\r\n Default = \"default\"\r\n}\r\nimport {getProductSearchRefinersAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\nexport class InventoryInStockRefinerValueInput implements IActionInput {\r\n public readonly actionContext: IActionContext;\r\n public readonly channelId: number;\r\n public readonly channelInventoryConfiguration: any;\r\n public readonly catalogId: number;\r\n\r\n constructor(actionContext: IActionContext, channelId: number, channelInventoryConfiguration: any, catalogId: number = 0) {\r\n this.actionContext = actionContext;\r\n this.channelId = channelId;\r\n this.channelInventoryConfiguration = channelInventoryConfiguration;\r\n this.catalogId = catalogId;\r\n }\r\n\r\n public getCacheKey = (): string => `${this.channelId}-${this.catalogId}-${this.channelInventoryConfiguration?.InventoryProductAttributeRecordId}`;\r\n public getCacheObjectType = (): string => 'RefinerList';\r\n}\r\n\r\nexport const inventoryInStockRefinerValueInput = (\r\n actionContext: IActionContext,\r\n channelId:number,\r\n channelInventoryConfiguration: any,\r\n catalogId?: number | undefined\r\n): InventoryInStockRefinerValueInput => {\r\n return new InventoryInStockRefinerValueInput(\r\n actionContext,\r\n channelId,\r\n channelInventoryConfiguration,\r\n catalogId\r\n );\r\n};\r\n\r\nasync function getProductRefinerHierarchy(searchCriteria: any, queryResultSettings: any, ctx: any): Promise {\r\n const rsVersion: string = !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\r\n ? '0.0'\r\n : process.env.MSDyn365Commerce_RSVERSION;\r\n const isHideAndSortByInventoryAvailabilitySupported: boolean = versionGte(rsVersion, '9.37');\r\n\r\n if (isHideAndSortByInventoryAvailabilitySupported) {\r\n // const productsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g');\r\n return getProductSearchRefinersAsync({ callerContext: ctx, queryResultSettings }, searchCriteria)\r\n .then((productRefiners: any) => {\r\n if (!productRefiners) {\r\n ctx.trace('[getRefinersByCriteriaAction] returned no refiners');\r\n return [];\r\n }\r\n const result: any[] = productRefiners;\r\n if (result.length === 0) {\r\n ctx.trace('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\r\n return [];\r\n }\r\n return result;\r\n });\r\n } else {\r\n return Promise.resolve([]);\r\n }\r\n}\r\n\r\nexport async function getInventoryInStockRefiner(input: InventoryInStockRefinerValueInput, context: any): Promise {\r\n const queryResultSettings = {\r\n count: true\r\n };\r\n const refiners = await getProductRefinerHierarchy({\r\n Context: {\r\n ChannelId: input.channelId,\r\n CatalogId: input.catalogId\r\n }\r\n }, queryResultSettings, context);\r\n\r\n const inventoryRefiner = input.channelInventoryConfiguration?.InventoryProductAttributeRecordId !== 0 &&\r\n refiners.find((refiner: any) => refiner.RecordId === input.channelInventoryConfiguration?.InventoryProductAttributeRecordId);\r\n\r\n let inStockRefiner: any;\r\n if (inventoryRefiner) {\r\n inStockRefiner = inventoryRefiner.Values.find((value: any) => value.LeftValueBoundString !== input.channelInventoryConfiguration.InventoryOutOfStockAttributeValueText &&\r\n value.RightValueBoundString !== input.channelInventoryConfiguration.InventoryOutOfStockAttributeValueText);\r\n }\r\n return inStockRefiner;\r\n}\r\n\r\nexport const getInventoryInStockRefinerAction = createObservableDataAction({\r\n id: '@msdyn365-commerce/get-inventory-in-stock-refiner',\r\n action:> getInventoryInStockRefiner,\r\n input: inventoryInStockRefinerValueInput\r\n});\r\n\r\nexport default getInventoryInStockRefinerAction;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n { \n const actionPath = 'actions/custom-get-sales-order-confirmation-with-hydrations.action';\n binding.dataActions[actionPath] = require('partner/actions/custom-get-sales-order-confirmation-with-hydrations.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/genera-product-list-warehouse-details.action';\n binding.dataActions[actionPath] = require('partner/actions/genera-product-list-warehouse-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/genera-product-warehouse-details.action';\n binding.dataActions[actionPath] = require('partner/actions/genera-product-warehouse-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-alternate-items-collection.action';\n binding.dataActions[actionPath] = require('partner/actions/get-alternate-items-collection.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-custom-product-additional-details.action';\n binding.dataActions[actionPath] = require('partner/actions/get-custom-product-additional-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-custom-product-application.action';\n binding.dataActions[actionPath] = require('partner/actions/get-custom-product-application.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-custom-product-interchange.action';\n binding.dataActions[actionPath] = require('partner/actions/get-custom-product-interchange.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-custom-product-spec.action';\n binding.dataActions[actionPath] = require('partner/actions/get-custom-product-spec.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-product-alternate-item.action';\n binding.dataActions[actionPath] = require('partner/actions/get-product-alternate-item.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-related-product-details.action';\n binding.dataActions[actionPath] = require('partner/actions/get-related-product-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/getProductWarehouseInfo.action';\n binding.dataActions[actionPath] = require('partner/actions/getProductWarehouseInfo.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/hs-get-simple-products.action';\n binding.dataActions[actionPath] = require('partner/actions/hs-get-simple-products.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/product-collection-eta.action';\n binding.dataActions[actionPath] = require('partner/actions/product-collection-eta.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/product-eta-action.action';\n binding.dataActions[actionPath] = require('partner/actions/product-eta-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'hydrators/get-inventory-in-stock-refiner.action';\n binding.dataActions[actionPath] = require('partner/hydrators/get-inventory-in-stock-refiner.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'hydrators/products-by-category.action';\n binding.dataActions[actionPath] = require('partner/hydrators/products-by-category.action');\n registerActionId(actionPath);\n }\n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.packageDataActions = {};\n window.__bindings__.packageDataActions['__local__'] = {\n ...binding.dataActions\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext\n} from '@msdyn365-commerce/core';\nimport { CommerceProperty, ProductDeliveryOptions, SalesOrder, SimpleProduct, TransactionType } from '@msdyn365-commerce/retail-proxy';\nimport { getAttributeValuesAsync, getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport {\n getSalesOrderDetailsBySalesIdAsync,\n getSalesOrderDetailsByTransactionIdAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/SalesOrdersDataActions.g';\nimport {\n ArrayExtensions,\n buildCacheKey,\n getSimpleProducts,\n ObjectExtensions,\n ProductInput,\n QueryResultSettingsProxy\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Sales order response interface.\n */\ninterface ISalesOrderWithHydrations {\n salesOrder: SalesOrder;\n products: SimpleProduct[];\n productDeliveryOptions?: ProductDeliveryOptions[];\n}\n\n/**\n * OrderTypes Types of orders.\n */\nexport enum orderTypes {\n salesOrder = 'salesOrder',\n transaction = 'transaction'\n}\n\n/**\n * Calls the Retail API and returns the sales order.\n * @param orderType - OrderType.\n * @param orderId - Unique OrderId for each order.\n * @returns Sales Order.\n */\nconst getSalesOrder = (orderType: string = '', orderId: string = '') => async (\n context: IActionContext\n): Promise => {\n // Local (1) searches the retail server database, and remote (2) searches\n // on the headquarters side. All (3) and none (0) are not supported.\n const localSearch = 1;\n return orderType === orderTypes.salesOrder\n ? getSalesOrderDetailsBySalesIdAsync({ callerContext: context }, orderId)\n : getSalesOrderDetailsByTransactionIdAsync({ callerContext: context }, orderId, localSearch);\n};\n\n/**\n * Calls the Retail API and returns the products.\n * @param productIds - The product ids of the product to retrieve.\n * @param channelId - The channel id for the products.\n * @returns Simple product data.\n */\nconst getProducts = (productIds: (string | number)[] = [], channelId?: number) => async (\n context: IActionContext\n): Promise => {\n const productInputs = productIds.map(\n productId => new ProductInput(productId, context.requestContext.apiSettings, channelId, undefined, context.requestContext)\n );\n return getSimpleProducts(productInputs, context);\n};\n\n/**\n * Action input.\n */\nexport class GetSalesOrderConfirmationWithHydrationsInput implements IActionInput {\n public orderType: string;\n\n public orderId: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(orderType: string, orderId: string, apiSettings: ICommerceApiSettings) {\n this.orderType = orderType;\n this.orderId = orderId;\n this.apiSettings = apiSettings;\n }\n\n /**\n * Get cache key.\n * @returns String.\n */\n public getCacheKey = () => buildCacheKey('SalesOrderConfirmationWithHydrations', this.apiSettings);\n\n /**\n * Get cache object.\n * @returns String.\n */\n public getCacheObjectType = () => `SalesOrderConfirmationWithHydrations-${this.orderType}-${this.orderId}`;\n\n /**\n * Get cache data type.\n * @returns String.\n */\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - Actioncontext data.\n * @returns Sales Order Input.\n */\nconst createSalesOrderConfrimationWithHydrationsInput = (inputData: ICreateActionContext) => {\n const { salesId = '', transactionId = '' } = inputData.requestContext.query || {};\n if (salesId) {\n return new GetSalesOrderConfirmationWithHydrationsInput(orderTypes.salesOrder, salesId, inputData.requestContext.apiSettings);\n } else if (transactionId) {\n return new GetSalesOrderConfirmationWithHydrationsInput(\n orderTypes.transaction,\n transactionId,\n inputData.requestContext.apiSettings\n );\n }\n throw new Error('createSalesOrderConfrimationWithHydrationsInput - No salesId or transactionId provided.');\n};\n\n/**\n * Get sales order with hydrations action.\n * @param input - Input for data action.\n * @param context - Action context.\n * @returns Sales order response.\n */\nexport async function getSalesOrderConfirmationWithHydrationsAction(\n input: GetSalesOrderConfirmationWithHydrationsInput,\n context: IActionContext\n): Promise {\n if (!context) {\n throw new Error('getSalesOrderConfirmationWithHydrationsAction - Action context cannot be null/undefined');\n }\n\n const { orderType, orderId } = input;\n\n if (!orderType || !orderId) {\n context.trace('[getSalesOrderConfirmationWithHydrationsAction] No orderType or orderId provided.');\n return {};\n }\n\n const salesOrder = await getSalesOrder(orderType, orderId)(context);\n\n if (!salesOrder) {\n context.trace('[getSalesOrderWithHydrationsAction] No salesOrder found.');\n return {};\n }\n\n // If it is salesInvoice, return salesOrder and empty products\n if (salesOrder.TransactionTypeValue === TransactionType.SalesInvoice) {\n return {\n salesOrder,\n products: []\n };\n }\n\n if (!ArrayExtensions.hasElements(salesOrder.SalesLines)) {\n context.trace('[getSalesOrderWithHydrationsAction] No salesLine found.');\n return {};\n }\n\n const productIds = salesOrder.SalesLines.map(salesLine => salesLine.ProductId ?? '');\n\n if (!ArrayExtensions.hasElements(productIds)) {\n context.trace('[getSalesOrderWithHydrationsAction] No products in saleLines found.');\n return {};\n }\n\n const products = await getProducts(productIds, salesOrder.ChannelId)(context);\n\n if (!ArrayExtensions.hasElements(products)) {\n context.trace('[getSalesOrderWithHydrationsAction] No simple products found.');\n return {};\n }\n if(products)\n {\n for(var i=0; i {\n if (specData.Name === 'Oversized') {\n const isOversized = specData.BooleanValue ? true : false;\n const existingExtensionProp = products[`${i}`].ExtensionProperties;\n const existingProp :CommerceProperty | undefined = existingExtensionProp && existingExtensionProp.length > 0 ? existingExtensionProp.find((ext: CommerceProperty) => ext.Key === 'IsOversized') : undefined;\n if(existingProp === undefined){\n const updatedExistingProp :CommerceProperty = {Key : 'IsOversized', Value:{BooleanValue: isOversized}};\n existingExtensionProp && existingExtensionProp.push(updatedExistingProp);\n products[`${i}`].ExtensionProperties = existingExtensionProp;\n }\n }\n });\n }\n }\n }\n const validProducts = products.filter(product => !ObjectExtensions.isNullOrUndefined(product.RecordId));\n const filterPickup = 4;\n const deliveryOptions = await getDeliveryOptionsAsync(\n { callerContext: context, queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context) },\n validProducts.map(product => product.RecordId),\n {},\n filterPickup\n )\n .then(result => {\n return result;\n })\n .catch((error: Error) => {\n context.trace(error.message);\n context.telemetry.exception(error);\n context.telemetry.debug('[getDeliveryOptionsForCartLineItems]Error executing action');\n throw new Error('[getDeliveryOptionsForCartLineItems]Error executing action');\n });\n\n return {\n salesOrder,\n products,\n deliveryOptions\n };\n}\n\n/**\n * Get sales order with hydrations action.\n * @param id - Unique Id for data action.\n * @param context - Action context.\n * @param input - Input for data action.\n * @returns Sales order response.\n */\nexport const getSalesOrderConfirmationWithHydrationsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/order-management/get-sales-order-confirmation-with-hydrations',\n action: >getSalesOrderConfirmationWithHydrationsAction,\n input: createSalesOrderConfrimationWithHydrationsInput\n});\n\nexport default getSalesOrderConfirmationWithHydrationsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n// import {getSelectedProductIdFromActionInput, ProductInput, getSimpleProductsAction } from '@msdyn365-commerce-modules/retail-actions';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport axios from 'axios';\nimport { ProductWarehouses } from './AlternateItemsEntity.g';\n\n/**\n * GeneraProductWarehouseDetails Input Action\n */\nexport class GeneraProductListWarehouseDetailsInput implements Msdyn365.IActionInput {\n public ItemIds: string[];\n\n public channelId: number;\n\n public config: any;\n\n constructor(ItemIds: string[], channelId: number, config: any) {\n this.channelId = channelId;\n this.ItemIds = ItemIds;\n this.config = config;\n }\n\n\n // TODO: Determine if the results of this get action should cache the results and if so provide\n // a cache object type and an appropriate cache key\n public getCacheKey = () => `GeneraProductListWarehouseDetailsInput`;\n public getCacheObjectType = () => 'ProductListWarehouses';\n public dataCacheType = (): Msdyn365.CacheType => 'none';\n}\n\n// TODO: Create a data model here or import one to capture the response of the action\nexport interface IGeneraProductListWarehouseDetailsData {\n warehouseDetails: ProductWarehouses[];\n}\n\n/**\n * TODO: Use this function to create the input required to make the action call\n */\n// const createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\n// // return new GeneraProductWarehouseDetailsInput();\n// const productId = getSelectedProductIdFromActionInput(inputData);\n// if(productId)\n// {\n// return new GeneraProductListWarehouseDetailsInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\n\n// }\n// throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\n// };\n\n/**\n * TODO: Use this function to call your action and process the results as needed\n */\nexport async function getCurrentProductListWarehouseDetailsAction(input: GeneraProductListWarehouseDetailsInput, ctx: Msdyn365.IActionContext): Promise {\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\n // TODO: Uncomment the below line to get the value from a service\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\n let productWarehouseDtl:ProductWarehouses[] = [];\n // const prod:ProductInput[] = new Array();\n // if(input.ItemIds)\n // input.ItemIds.forEach((itemid,idx)=>{\n // prod.push(new ProductInput(itemid,ctx.requestContext.apiSettings));\n // });\n // var prodDtl = await getSimpleProductsAction(prod,ctx);\n const itemIdsFilter:string[] = input.ItemIds.map((itemid,idx)=>{\n return `ItemNumber eq '${itemid}'`;\n });\n var formData = new URLSearchParams();\n formData.append('client_id',ctx.requestContext.app.config.clientId);\n formData.append('grant_type','client_credentials');\n formData.append('resource',ctx.requestContext.app.config.baseUrl);\n formData.append('client_secret',ctx.requestContext.app.config.clientSecret);\n\n var token = await (axios.post(`https://login.microsoftonline.com/${ctx.requestContext.app.config.tenentId}/oauth2/token`, formData).then((res) => { return res.data;}).catch((err)=> {return err;}));\n // const jsObj = `{'_request':{'ItemNumber' : '${ prodDtl[0].ItemId }'}}`;\n const header = { headers: { 'Authorization': `bearer ${token.access_token}` } };\n const prodWarehouseDetails = await (axios.get(`${ctx.requestContext.app.config.axItemWarehouseUrl}?$filter=(${itemIdsFilter.join(' or ')}) and DistributionCenter eq Microsoft.Dynamics.DataEntities.NoYes'Yes'`, header).then((res) => { return res.data;}).catch((err)=> {console.log(\"axios error: \",err); return err;}));\n if(prodWarehouseDetails && prodWarehouseDetails.value)\n {\n productWarehouseDtl = prodWarehouseDetails.value;\n }\n return productWarehouseDtl;\n}\n\nexport default Msdyn365.createObservableDataAction({\n action: >getCurrentProductListWarehouseDetailsAction,\n // TODO: Give your data action a unique id\n id: 'getCurrentProductWarehouseDetailsAction'\n // input: createInput\n // TODO: Uncomment the below line if this is a meant to be a batched data action\n // isBatched: true\n});\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext, ICommerceApiSettings, versionGte } from '@msdyn365-commerce/core-internal';\r\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getInventoryInStockRefinerAction, InventoryInStockRefinerValueInput } from './get-inventory-in-stock-refiner.action';\r\nimport { ProductRefinerValue, ProductSearchCriteria, ProductSearchResult, QueryResultSettings, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {ProductListInput} from '@msdyn365-commerce/runtime-internal/dist/types/hydrators/hydrator-action-inputs';\r\nimport { getAttributeInfoAsync } from '../actions/gc-get-attributeInfo';\r\nimport { IAttributeInfo } from '../modules/search-result-container/search-result-container';\r\nexport declare const CATEGORY_PAGE_NAME = \"category\";\r\n\r\nexport const getProductsByCategoryList = async (input: ProductListInput, context: IActionContext) => {\r\n let categoryId;\r\n const urlTokens = context.requestContext.urlTokens;\r\n // const currentPage = context.requestContext.url.requestUrl.href;\r\n // const originUrl = currentPage && currentPage.endsWith('/') ? `${context.requestContext.url.requestUrl.origin}/` : context.requestContext.url.requestUrl.origin;\r\n // If the category ID has been provided from the list metadata use it, otherwise grab the category ID from context\r\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\r\n categoryId = input.listMetadata.categoryIds[0];\r\n }\r\n else if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME && urlTokens.recordId) {\r\n categoryId = +urlTokens.recordId;\r\n }\r\n else if (urlTokens && urlTokens.categories && urlTokens.categories.length > 0) {\r\n categoryId = +urlTokens.categories[0];\r\n }\r\n else {\r\n // Unable to determine category from list meta data or context\r\n throw new Error('CategoryId Missing for ProductsByCategory List');\r\n }\r\n context.telemetry.debug(`Category Id input to ProductsByCategory action : ${categoryId}`);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Context: {\r\n ChannelId: +input.channelId,\r\n CatalogId: +input.catalogId\r\n },\r\n CategoryIds: [categoryId],\r\n SkipVariantExpansion: true,\r\n IncludeAttributes: true\r\n };\r\n const queryResultSettings: QueryResultSettings = {\r\n Paging: {\r\n Top: input.listMetadata.pageSize || 10\r\n }\r\n };\r\n const rsVersion = !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\r\n ? '0.0'\r\n : process.env.MSDyn365Commerce_RSVERSION;\r\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\r\n if (isHideAndSortByInventoryAvailabilitySupported) {\r\n let channelInventoryConfiguration = {};\r\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS ||\r\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\r\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\r\n const StoreOperationsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g');\r\n channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({ callerContext: context });\r\n }\r\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n const inventoryInStockRefinerValueInput = new InventoryInStockRefinerValueInput(context, +input.channelId, channelInventoryConfiguration, +input.catalogId);\r\n const inventoryInStockRefinerValue = await getInventoryInStockRefinerAction(inventoryInStockRefinerValueInput, context);\r\n if (inventoryInStockRefinerValue) {\r\n productSearchCriteria.Refinement = [inventoryInStockRefinerValue];\r\n }\r\n }\r\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\r\n const sorting = getInventorySorting(channelInventoryConfiguration);\r\n if (sorting) {\r\n queryResultSettings.Sorting = sorting;\r\n }\r\n }\r\n }\r\n\r\n if(context.requestContext.telemetryPageName && context.requestContext.telemetryPageName.toLowerCase() === 'homepage')\r\n {\r\n const result = await getAttributeInfoAsync({ callerContext: context }, 'Active');\r\n\r\n const attributeInfo: IAttributeInfo = {};\r\n attributeInfo.Name = result.gcAttributeInfo?.Name;\r\n attributeInfo.AttributeGroupId = result.gcAttributeInfo?.AttributeGroupId;\r\n attributeInfo.DataType = result.gcAttributeInfo?.DataType;\r\n attributeInfo.LowerBound = result.gcAttributeInfo?.LowerBound;\r\n attributeInfo.UpperBound = result.gcAttributeInfo?.UpperBound;\r\n attributeInfo.RecId = result.gcAttributeInfo?.RecId;\r\n const activeFilter: ProductRefinerValue = {\r\n DataTypeValue: attributeInfo.DataType,\r\n LeftValueBoundString: attributeInfo.UpperBound!.toString(),\r\n RefinerRecordId: attributeInfo.RecId,\r\n RightValueBoundString: attributeInfo.UpperBound!.toString(),\r\n ExtensionProperties: [],\r\n RefinerSourceValue: 1,\r\n RowNumber: 0,\r\n SwatchColorHexCode: '',\r\n SwatchImageUrl: '',\r\n UnitText: ''\r\n };\r\n productSearchCriteria.Refinement = [activeFilter];\r\n }\r\n\r\n return searchByCriteriaAsync({\r\n callerContext: context,\r\n queryResultSettings\r\n }, productSearchCriteria)\r\n .then((products) => {\r\n context.telemetry.debug('Products returned by ProductByCategory action', products);\r\n return getProductImageUrls(products, context.requestContext.apiSettings);\r\n })\r\n .catch(error => {\r\n context.telemetry.error(`Error running ProductByCategory action: ${error}`);\r\n throw new Error(error);\r\n });\r\n};\r\nexport const getProductsByCategoryListAction = createObservableDataAction({\r\n action: >getProductsByCategoryList,\r\n id: '@msdyn365-commerce/products-by-category'\r\n});\r\n//# sourceMappingURL=products-by-category.action.js.map\r\n\r\nexport const getProductImageUrls = (\r\n products: SimpleProduct[] | ProductSearchResult[],\r\n apiSettings: ICommerceApiSettings\r\n): SimpleProduct[] | ProductSearchResult[] => {\r\n const productsWithImageUrls: SimpleProduct[] | ProductSearchResult[] = [];\r\n\r\n products &&\r\n products.forEach((product: ProductSearchResult | SimpleProduct) => {\r\n if (product && product.RecordId) {\r\n product.PrimaryImageUrl = generateImageUrl(product.PrimaryImageUrl, apiSettings);\r\n productsWithImageUrls.push(product as SimpleProduct);\r\n }\r\n });\r\n\r\n return productsWithImageUrls;\r\n};\r\n\r\n/**\r\n * Get inventory sorting value based on channelInventoryConfiguration\r\n *\r\n * @param context The current action context\r\n * @param channelInventoryConfiguration The channelInventoryConfiguration\r\n */\r\n export const getInventorySorting = (channelInventoryConfiguration : any) => {\r\n let sorting;\r\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\r\n const sortColumnName = `Attr_${channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId}`;\r\n sorting = {\r\n Columns: [\r\n {\r\n ColumnName: sortColumnName,\r\n IsDescending: true\r\n }\r\n ]\r\n };\r\n }\r\n return sorting;\r\n};\r\n\r\n/**\r\n * This setting defines inventory filtering options.\r\n */\r\n export enum ProductListInventoryFilteringOptions {\r\n /**\r\n * Filter out all products out of stock.\r\n */\r\n HideOOS = 'hideOOS',\r\n\r\n /**\r\n * Sort products by availability, OOS goes last.\r\n */\r\n SortOOS = 'sortOOS',\r\n\r\n /**\r\n * No filtering selected.\r\n */\r\n Default = 'default'\r\n}"],"names":["module","exports","React","ReactDOM","ProductEtaActionInput","constructor","productId","channelId","config","getCacheKey","this","getCacheObjectType","dataCacheType","createGetProductEtaInput","inputData","getSelectedProductIdFromActionInput","requestContext","apiSettings","Error","async","getProductEtaAction","input","ctx","prod","Array","push","ProductInput","prodDtl","getSimpleProductsAction","etaObj","getProductETAInfoAsync","callerContext","bypassCache","ItemId","getProductEtaActionDataAction","Msdyn365","action","id","getProductInfoInput","apiConfiguration","productIds","DataServiceQuery","createDataServiceRequestForOperation","DataServiceEntities","returnEntity","getProductInfoAsync","context","clientId","Buffer","from","app","toString","btoa","request","ClientId","ClientSecret","clientSecret","Resource","baseUrl","GrantType","APIUrl","axAlternateItemUrl","LoginUrl","tenentId","callActionOrExecute","getProductETAInfoInput","axUrl","GetAlternateItemsCollectionInput","prodIds","getProductsAlternateItemsAction","alterItems","length","alternateProdDetails","i","item","currentProd","undefined","serviceResp","alternateDtls","find","data","currentAltItems","AltItemId","dataAreaId","UseAltItemId","productLookup","forEach","val","x","prodLookup","criteria","Context","CatalogId","catalogId","ChannelId","ItemIds","prodLists","searchByCriteriaAsync","altSampleProducts","getByIdsAsync","map","RecordId","sampleProd","alterProdDtl","productDtl","productAvailibility","etaDetails","inventoryLabel","_alterItems$currentPr","prodETA","alterProdAvailability","dt","ProductAvailabilitiesForSelectedVariantInput","getProductAvailabilitiesForSelectedVariant","etaProdinpurt","telemetryPageName","alterProdEta","error","telemetry","respObj","getProductWarehouseInfoInput","queryResultSettings","resultSettings","getProductWarehouseInfoAsync","axItemWarehouseUrl","getAtrributeInfoInput","attributeName","getAttributeInfoAsync","GeneraProductWarehouseDetailsInput","getCurrentProductWarehouseDetailsAction","_prodWarehouseDetails","productWarehouseDtl","prodWarehouseDetails","_prodWarehouseDetails2","warehouseDetails","value","GetProductAlternateItemInput","getProductAlternateItemAction","proddtl","product","response","prodAlternates","altProduct","getByIdAsync","_getInventoryLabel","e","console","log","productQty","newShippingQuantity","shipping","deliveryType","DeliveryMode","StockLevelLabel","getListProductsETAInfoInput","ProductCollectionEtaInput","getProductCollectionEtaAction","etaDtl","productETAinfoList","getListProductsETAInfoAsync","productETA","filter","etaInfo","ProductId","EtaDate","ETADate","EtaMessage","ResultMessage","result","getProductAdditionalDetailsInput","getProductAdditionalDetailsAsync","GetCustomProductSpecficiationInput","prodAttr","attr","KeyName","Name","TextValue","CountryLongName","DataTypeValue","ProductLifeCycleDescription","getProductApplicationInput","Paging","EntityClasses","Top","getProductApplicationInputAsync","GetCustomProductApplicationInput","getProductSpecificationDetailsInput","getProductSpecificationDetailsAsync","element","AttributeValueId","Specification_Id","Public_Display_Name","Product_Attirbute_Value","getProductInterchangeDetailsInput","GetCustomProductInterchangeInput","getProductInterchangeDetailsAsync","Interchange_Id","Interchange_Part_Number","getRelatedProductsInput","GetCustomRelatedProductsInput","getRelatedProductsAsync","itemids","index","productSearchResult","newImageUrl","generateProductImageUrl","decodeURI","PrimaryImageUrl","ProductListInventoryFilteringOptions","InventoryInStockRefinerValueInput","actionContext","channelInventoryConfiguration","arguments","_this$channelInventor","InventoryProductAttributeRecordId","inventoryInStockRefinerValueInput","getInventoryInStockRefiner","_input$channelInvento","refiners","searchCriteria","versionGte","process","getProductSearchRefinersAsync","then","productRefiners","trace","Promise","resolve","getProductRefinerHierarchy","count","inventoryRefiner","refiner","_input$channelInvento2","inStockRefiner","Values","LeftValueBoundString","InventoryOutOfStockAttributeValueText","RightValueBoundString","getInventoryInStockRefinerAction","createObservableDataAction","binding","modules","dataActions","registerActionId","actionPath","default","prototype","Object","keys","exportName","Action","require","window","__bindings__","_objectSpread","packageDataActions","orderTypes","GetSalesOrderConfirmationWithHydrationsInput","orderType","orderId","buildCacheKey","getSalesOrderConfirmationWithHydrationsAction","salesOrder","getSalesOrderDetailsBySalesIdAsync","getSalesOrderDetailsByTransactionIdAsync","getSalesOrder","TransactionTypeValue","TransactionType","SalesInvoice","products","ArrayExtensions","hasElements","SalesLines","salesLine","_salesLine$ProductId","productInputs","getSimpleProducts","getProducts","attributes","getAttributeValuesAsync","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","specData","idx","isOversized","BooleanValue","existingExtensionProp","ExtensionProperties","ext","Key","updatedExistingProp","Value","validProducts","ObjectExtensions","isNullOrUndefined","deliveryOptions","getDeliveryOptionsAsync","catch","message","exception","debug","getSalesOrderConfirmationWithHydrationsActionDataAction","salesId","transactionId","query","transaction","GeneraProductListWarehouseDetailsInput","getCurrentProductListWarehouseDetailsAction","itemIdsFilter","itemid","formData","URLSearchParams","append","header","headers","axios","res","err","access_token","join","getProductsByCategoryList","categoryId","urlTokens","listMetadata","categoryIds","pageType","toLowerCase","CATEGORY_PAGE_NAME","recordId","categories","productSearchCriteria","CategoryIds","SkipVariantExpansion","IncludeAttributes","pageSize","_context$requestConte","_context$requestConte2","_context$requestConte3","_context$requestConte4","productListInventoryDisplay","HideOOS","SortOOS","StoreOperationsDataActions","getInventoryConfigurationAsync","inventoryInStockRefinerValue","Refinement","sorting","getInventorySorting","Sorting","_result$gcAttributeIn","_result$gcAttributeIn2","_result$gcAttributeIn3","_result$gcAttributeIn4","_result$gcAttributeIn5","_result$gcAttributeIn6","attributeInfo","gcAttributeInfo","AttributeGroupId","DataType","LowerBound","UpperBound","RecId","activeFilter","RefinerRecordId","RefinerSourceValue","RowNumber","SwatchColorHexCode","SwatchImageUrl","UnitText","getProductImageUrls","getProductsByCategoryListAction","productsWithImageUrls","generateImageUrl","ProductAvailabilitySortableAttributeRecordId","Columns","ColumnName","IsDescending"],"sourceRoot":""}