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GAAcI,EAAQ,MAC1CL,EAAiBC,GAGrB,CACI,MAAMA,EAAa,qEACnBJ,EAAQE,YAAYE,GAAcI,EAAQ,MAC1CL,EAAiBC,GAIzBzW,OAAO8W,aAAe9W,OAAO8W,cAAgB,GAC7C9W,OAAO8W,aAAaR,QAApB,OACOtW,OAAO8W,aAAaR,SAAW,IAC/BD,EAAQC,SAGXtW,OAAO8W,aAAaC,mBAAqB,GACzC/W,OAAO8W,aAAaC,mBAApB,eACOV,EAAQE,iCC/ZvBS,EAAOC,QAAUC,2BCAjBF,EAAOC,QAAUE","sources":["webpack://mattressfirm/./src/Utilities/plp-url-utils.ts?728b","webpack://mattressfirm/./src/actions/BonusItemDataServiceEntities.g.ts?cf80","webpack://mattressfirm/./src/actions/BonusItemDataActionExtension.g.ts?22ff","webpack://mattressfirm/./src/actions/bonus-coupon-details.action.ts?7fb2","webpack://mattressfirm/./src/actions/bonus-item-product.action.ts?0b53","webpack://mattressfirm/./src/actions/checkout-billing-validity.action.ts?484f","webpack://mattressfirm/./src/actions/fetch-choose-your-foundation-database.action.ts?867b","webpack://mattressfirm/./src/actions/get-delivery-fee-update.action.ts?8fde","webpack://mattressfirm/./src/actions/get-mattress-foundations-to-add.action.ts?7e5d","webpack://mattressfirm/./src/actions/get-mfrm-products-category-paths.action.ts?dc81","webpack://mattressfirm/./src/actions/get-recycle-fee-checkout.action.ts?9366","webpack://mattressfirm/./src/actions/get-sm-inventory-status.action.ts?cb72","webpack://mattressfirm/./src/Utilities/get-zipcode.ts?4f03","webpack://mattressfirm/./src/actions/get-soci-data.action.ts?ce73","webpack://mattressfirm/./src/actions/TryInStoreDataServiceEntities.g.ts?ea57","webpack://mattressfirm/./src/actions/TryInStoreDataActionExtension.g.ts?c8db","webpack://mattressfirm/./src/actions/get-try-in-store-info.action.ts?dff9","webpack://mattressfirm/./src/actions/get-unbxd-product-recommendations.action.ts?bae6","webpack://mattressfirm/./src/actions/select-your-foundation.action.ts?e743","webpack://mattressfirm/./src/actions/social-icons-state.action.ts?1e1b","webpack://mattressfirm/./src/actions/srp-breadcrumb-page.action.ts?4397","webpack://mattressfirm/./src/actions/trigger-special-synchrony-financing.action.ts?1948","webpack://mattressfirm/./src/actions/user-defined-promocode.action.ts?c234","webpack://mattressfirm/./src/actions/wmap-address-state.action.ts?f45e","webpack://mattressfirm/./src/actions/zip-code-state.action.ts?958a","webpack://mattressfirm/./src/actions/zip-code-validation.action.ts?0973","webpack://mattressfirm/./src/data-actions/bonuscoupons-action.action.ts?e535","webpack://mattressfirm/./src/data-actions/brightspot-content-action.action.ts?2792","webpack://mattressfirm/./src/data-actions/get-address-from-zipcode.action.ts?d9c9","webpack://mattressfirm/./src/data-actions/get-dimensions-for-selected-variant.override.action.ts?2573","webpack://mattressfirm/./src/data-actions/get-franchise-data.action.ts?7044","webpack://mattressfirm/./src/data-actions/get-product-benefit-enhanced-content.action.ts?85e9","webpack://mattressfirm/./src/data-actions/get-product-benefits-data.action.ts?1d43","webpack://mattressfirm/./src/data-actions/get-promocode-value.action.ts?e12d","webpack://mattressfirm/./src/data-actions/get-resons-to-buy-data.action.ts?34a7","webpack://mattressfirm/./src/data-actions/get-sales-order-details-action.action.ts?5a8b","webpack://mattressfirm/./src/data-actions/get-seo-data.action.ts?b8ff","webpack://mattressfirm/./src/data-actions/get-sleep-disruptor-icons.action.ts?0ec7","webpack://mattressfirm/./src/data-actions/get-store-location-information.override.action.ts?f6e2","webpack://mattressfirm/./src/data-actions/mfi-atp-inventory.action.ts?2cbf","webpack://mattressfirm/./src/data-actions/mfrm-mfi-bonusitem.action.ts?15d0","webpack://mattressfirm/./src/data-actions/mfrm-notification.action.ts?70c5","webpack://mattressfirm/./src/data-actions/payment-cc-card-types.action.ts?37d5","webpack://mattressfirm/./src/data-actions/products-by-category.override.action.ts?6afc","webpack://mattressfirm/./src/data-actions/products-by-recommendation.override.action.ts?9a45","webpack://mattressfirm/./src/data-actions/products-by-relationship-id.override.action.ts?f0f3","webpack://mattressfirm/./src/data-actions/products-get-by-id.action.ts?0a83","webpack://mattressfirm/./src/data-actions/progressive-leasing-modal-state.action.ts?5447","webpack://mattressfirm/./src/data-actions/promocode-applied-in-progress.action.ts?91e5","webpack://mattressfirm/./src/data-actions/redirect-to-wmap-submit-payment.action.ts?70c9","webpack://mattressfirm/./src/data-actions/search-org-unit-locations.action.ts?6dc5","webpack://mattressfirm/./src/data-actions/update-email-call.action.ts?bac8","webpack://mattressfirm/./src/data-actions/wmap-get-order-details.action.ts?108d","webpack://mattressfirm/./src/data-actions/wmap-submit-payment.action.ts?1746","webpack://mattressfirm/./src/modules/mfrm-category-page-summary/mfrm-category-page-summary.action.ts?d22e","webpack://mattressfirm/./lib/__local__/module-registration.js?8a42","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IVirtualRefinersConfig {\r\n order: number;\r\n refinerName: string;\r\n enableForMattresses: boolean;\r\n enableForOtherCategories: boolean;\r\n allowDuplicate: boolean;\r\n}\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const origin = requestUrl.origin;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `${origin}/${filteredPath}`;\r\n};\r\n\r\nexport const filteredURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `/${filteredPath}`;\r\n};\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURLWithoutBaseUrl = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('\\/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n return urlParts?.join('\\/');\r\n};\r\n\r\n/**\r\n * This will remove the Pipe sign value set from urlParts\r\n * @param urlParts\r\n * @returns\r\n */\r\nexport const removePipeSignValue = (urlParts: string[]) => {\r\n // urlParts.forEach((part, index) => {\r\n // const indexOfValue = urlParts.indexOf('%7c');\r\n // if (indexOfValue !== -1) {\r\n // urlParts.splice(indexOfValue, 1);\r\n // }\r\n // });\r\n\r\n if (urlParts !== undefined && urlParts.length > 0) {\r\n urlParts = urlParts.filter(urlPart => urlPart.indexOf('%7c') === -1);\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will remove the keywords from urlParts array which were received from\r\n * the app.settings.json/CMS Extensions\r\n * @param urlParts\r\n * @param requestContext\r\n * @returns urlParts array filtered\r\n */\r\nexport const removeKeywords = (urlParts: string[], requestContext: IRequestContext): string[] => {\r\n const removeKeywordFromUrl = requestContext.app.config.removeKeywordFromUrl;\r\n\r\n if (urlParts.length > 0 && removeKeywordFromUrl && removeKeywordFromUrl.length > 0) {\r\n const removeKeywordFromUrlArray: string[] = removeKeywordFromUrl?.trim().split(',');\r\n removeKeywordFromUrlArray?.length > 0 &&\r\n urlParts.forEach(_part => {\r\n removeKeywordFromUrlArray.forEach(removeKeyword => {\r\n const trimmedKeyword = removeKeyword.trim().toLowerCase();\r\n const indexOfValue = urlParts.indexOf(trimmedKeyword);\r\n if (trimmedKeyword.length > 0 && indexOfValue !== -1) {\r\n urlParts.splice(indexOfValue, 1);\r\n }\r\n });\r\n });\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will sort the Virtual refiner config based on order and return\r\n * only active virtual refiner configs based on isMattress category will\r\n * be returned\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getSortedVirtualRefinerConfig = (\r\n requestContext: IRequestContext,\r\n isMattressesCategory: boolean | undefined\r\n): IVirtualRefinersConfig[] | undefined => {\r\n let appConfigSorted = getVirtualRefinerConfig(requestContext);\r\n\r\n // sort the config by provided config\r\n if (appConfigSorted) {\r\n if (isMattressesCategory === true) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForMattresses;\r\n });\r\n } else if (isMattressesCategory === false) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForOtherCategories;\r\n });\r\n }\r\n appConfigSorted.sort((a: IVirtualRefinersConfig, b: IVirtualRefinersConfig) => {\r\n return a.order - b.order;\r\n });\r\n }\r\n\r\n return appConfigSorted;\r\n};\r\n\r\n/**\r\n * Virtual refiner names from the app.settings.json will be returned which can be used\r\n * to filter out refiners data based upon active virtual refiners\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns string[]\r\n */\r\nexport const getVirtualRefinerNames = (requestContext: IRequestContext, isMattressesCategory: boolean | undefined): string[] => {\r\n const sortedVirtualRefinerConfig = getSortedVirtualRefinerConfig(requestContext, isMattressesCategory);\r\n\r\n const appConfigRefinerNames: string[] = [];\r\n\r\n sortedVirtualRefinerConfig &&\r\n sortedVirtualRefinerConfig.forEach(sortedConfig => {\r\n appConfigRefinerNames.push(sortedConfig.refinerName.trim().toLowerCase());\r\n });\r\n\r\n return appConfigRefinerNames;\r\n};\r\n\r\n/**\r\n * This will return the value of virtual refiner configuration\r\n * @param requestContext\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getVirtualRefinerConfig = (requestContext: IRequestContext): IVirtualRefinersConfig[] => {\r\n return requestContext.app.config.urlModifications;\r\n};\r\n\r\nexport async function getVirtualRefinerValues(\r\n requestContext: IRequestContext,\r\n virtualRefiners: IProductRefinerHierarchy[]\r\n): Promise {\r\n const virtualRefinerValues: ProductRefinerValue[] = [];\r\n if (virtualRefiners.length === 0) {\r\n return virtualRefinerValues;\r\n }\r\n const requestUrl = requestContext.url.requestUrl;\r\n // const origin = requestUrl.origin;\r\n const path = requestUrl.pathname;\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n urlParts.splice(-1);\r\n }\r\n\r\n // run loop for each url part and get values from refiners for further usage\r\n const finalizedUrlParts: string[] = [];\r\n urlParts.forEach(plainUrlPart => {\r\n const urlPart = decodeURIComponent(plainUrlPart);\r\n if (urlPart.indexOf('|') !== -1) {\r\n const splitOnPipeSign = urlPart?.split('|');\r\n const filteredParts = splitOnPipeSign.filter(part => part.length > 0);\r\n filteredParts.forEach(filteredPart => {\r\n finalizedUrlParts.push(filteredPart.toLowerCase().trim());\r\n });\r\n }\r\n finalizedUrlParts.push(urlPart);\r\n });\r\n finalizedUrlParts.forEach((urlPart) => {\r\n virtualRefiners.forEach((mainRefiner) => {\r\n mainRefiner.Values.forEach((refinerValue) => {\r\n const refinerValueKeyName = refinerValue.LeftValueBoundString?.toLowerCase().trim().split(' ')?.join('-').replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-');\r\n if (refinerValueKeyName && refinerValueKeyName === urlPart) {\r\n virtualRefinerValues.push(refinerValue);\r\n }\r\n });\r\n });\r\n });\r\n\r\n return virtualRefinerValues;\r\n}\r\n\r\n/**\r\n * For navigation menu links, it will remove keywords configured in global configurations from the navigation link\r\n * and clp link and return url path string\r\n * @param link\r\n * @param requestContext\r\n * @returns string\r\n */\r\nexport const navLinkKeywordRemoval = (link: string, requestContext: IRequestContext): string => {\r\n // Using the rest operator in case there is a weirdly formatted URL with multiple question marks.\r\n const [linkBase, ...linkParams] = link?.split('?');\r\n\r\n // Only apply to category links, which end in .c. Check that a keyword is configured.\r\n if (!linkBase.endsWith('.c') || !requestContext.app.config) {\r\n return link;\r\n }\r\n\r\n // Separate out url parts split on forward /\r\n let urlParts = linkBase?.split('\\/');\r\n\r\n // Remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // Glue the URL params back together\r\n const linkParam = linkParams.map(param => `?${param}`)?.join('');\r\n\r\n // Rebuild URL by joining with forward slash and appending any URL parameters\r\n const filteredLink = `${urlParts?.join('/')}${linkParam}`;\r\n return `${filteredLink}`;\r\n};\r\nexport const regExSpecialChars = (includeConfigList: string): RegExp => {\r\n let includeConfig = '';\r\n if (includeConfigList !== undefined && includeConfigList !== '') {\r\n includeConfig = includeConfigList?.trim().split(',')?.join('\\\\\\\\');\r\n includeConfig = includeConfig && includeConfig !== '' ? `\\\\\\\\${includeConfig}` : '';\r\n const pattern = `[^\\\\w\\\\&\\\\|${includeConfig}]`;\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFIGetBonusItemsParameters entity interface.\r\n */\r\nexport interface IMFIGetBonusItemsParameters {\r\n CartId?: string;\r\n Coupons?: string[];\r\n // Id: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIBonusItemsDetailsEntity entity interface.\r\n */\r\nexport interface IMFIBonusItemsDetailsEntity {\r\n Coupon?: string;\r\n IsBonusCoupon?: string;\r\n CouponMessage?: string;\r\n Items?: IMFIQualifyingItemDetails[];\r\n Id: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIQualifyingItemDetails entity interface.\r\n */\r\nexport interface IMFIQualifyingItemDetails {\r\n QualifyingItemId?: string;\r\n QualifyingProductId?: string;\r\n BonusProductQty: number;\r\n BonusItems?: IMFIBonusItemDetails[];\r\n }\r\n\r\n /**\r\n * MFIBonusItemDetails entity interface.\r\n */\r\n export interface IMFIBonusItemDetails {\r\n QualifyingProductId?: string;\r\n QualifyingItemId?: string;\r\n BonusItemId?: string;\r\n BonusProductId?: string;\r\n Name?: string;\r\n AdditionToCart?: string;\r\n AdjustedPrice: number;\r\n BasePrice: number;\r\n CustomerContextualPrice: number;\r\n DiscountAmount: number;\r\n DiscountTypeValue: number;\r\n DiscountType?: string;\r\n PrimaryImageUrl: string;\r\n ProductTypeValue: number;\r\n DealPriceOrDiscountPercentage: number;\r\n BonusCalculatedDiscountPrice: number;\r\n Coupon?: string;\r\n }\r\n\r\n /**\r\n * MFIGetBonusCouponsDetailsResponse entity interface.\r\n */\r\n export interface IMFIGetBonusCouponsDetailsResponse {\r\n BonusCoupons?: IMFIBonusCouponsDetail[];\r\n}\r\n\r\n/**\r\n * MFIBonusItemsResponse entity interface.\r\n */\r\nexport interface IMFIBonusItemsResponse {\r\n BonusItemsDetails?: IMFIBonusItemsDetailsEntity[];\r\n Message?: string;\r\n}\r\n\r\n/**\r\n * MFIBonusCouponsDetail entity interface.\r\n */\r\nexport interface IMFIBonusCouponsDetail {\r\n BonusCoupon?: string;\r\n BonusCouponMessage?: string;\r\n ChildCoupons?: string[];\r\n}\r\n\r\n/**\r\n * MFIGetBonusItemsParameters entity class.\r\n */\r\nexport class MFIGetBonusItemsParametersExtensionClass implements IMFIGetBonusItemsParameters {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CartId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Coupons: string[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CartId = odataObject.CartId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons = undefined;\r\n if (odataObject.Coupons) {\r\n this.Coupons = [];\r\n for (let i = 0; i < odataObject.Coupons.length; i++) {\r\n if (odataObject.Coupons[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons[i] = odataObject.Coupons[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemsDetailsEntity entity class.\r\n */\r\nexport class MFIBonusItemsDetailsEntityExtensionClass implements IMFIBonusItemsDetailsEntity {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Coupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsBonusCoupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CouponMessage: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Items: IMFIQualifyingItemDetails[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupon = odataObject.Coupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsBonusCoupon = odataObject.IsBonusCoupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CouponMessage = odataObject.CouponMessage;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items = undefined;\r\n if (odataObject.Items) {\r\n this.Items = [];\r\n for (let i = 0; i < odataObject.Items.length; i++) {\r\n if (odataObject.Items[i]) {\r\n if (odataObject.Items[i]['@odata.type']) {\r\n let className: string = odataObject.Items[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.Items[i] = new EntityClasses[className](odataObject.Items[i]);\r\n }\r\n } else {\r\n this.Items[i] = new MFIQualifyingItemDetailsExtensionClass(odataObject.Items[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items[i] = undefined;\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIQualifyingItemDetails entity class.\r\n */\r\nexport class MFIQualifyingItemDetailsExtensionClass implements IMFIQualifyingItemDetails {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public QualifyingItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public QualifyingProductId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusProductQty: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItems: IMFIBonusItemDetails[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.QualifyingItemId = odataObject.QualifyingItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.QualifyingProductId = odataObject.QualifyingProductId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusProductQty = odataObject.BonusProductQty ? parseFloat(odataObject.BonusProductQty) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItems = undefined;\r\n if (odataObject.BonusItems) {\r\n this.BonusItems = [];\r\n for (let i = 0; i < odataObject.BonusItems.length; i++) {\r\n if (odataObject.BonusItems[i]) {\r\n if (odataObject.BonusItems[i]['@odata.type']) {\r\n let className: string = odataObject.BonusItems[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusItems[i] = new EntityClasses[className](odataObject.BonusItems[i]);\r\n }\r\n } else {\r\n this.BonusItems[i] = new MFIBonusItemDetailsExtensionClass(odataObject.BonusItems[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItems[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemDetails entity class.\r\n */\r\nexport class MFIBonusItemDetailsExtensionClass implements IMFIBonusItemDetails {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusProductId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Name: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public AdditionToCart: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public AdjustedPrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BasePrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerContextualPrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountAmount: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountTypeValue: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountType: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DealPriceOrDiscountPercentage: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCalculatedDiscountPrice: number;\r\n\r\n public PrimaryImageUrl: string;\r\n\r\n public ProductTypeValue: number;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemId = odataObject.BonusItemId;\r\n\r\n this.PrimaryImageUrl = odataObject.PrimaryImageUrl;\r\n\r\n this.ProductTypeValue = odataObject.ProductTypeValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusProductId = odataObject.BonusProductId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Name = odataObject.Name;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.AdditionToCart = odataObject.AdditionToCart;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.AdjustedPrice = odataObject.AdjustedPrice ? parseFloat(odataObject.AdjustedPrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BasePrice = odataObject.BasePrice ? parseFloat(odataObject.BasePrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerContextualPrice = odataObject.CustomerContextualPrice ? parseFloat(odataObject.CustomerContextualPrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountAmount = odataObject.DiscountAmount ? parseFloat(odataObject.DiscountAmount) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountTypeValue = odataObject.DiscountTypeValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountType = odataObject.DiscountType;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DealPriceOrDiscountPercentage = odataObject.DealPriceOrDiscountPercentage\r\n ? parseFloat(odataObject.DealPriceOrDiscountPercentage)\r\n : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCalculatedDiscountPrice = odataObject.BonusCalculatedDiscountPrice\r\n ? parseFloat(odataObject.BonusCalculatedDiscountPrice)\r\n : 0;\r\n }\r\n}\r\n\r\n/**\r\n * MFIGetBonusCouponsDetailsResponse entity class.\r\n */\r\nexport class MFIGetBonusCouponsDetailsResponseExtensionClass implements IMFIGetBonusCouponsDetailsResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCoupons: IMFIBonusCouponsDetail[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupons = undefined;\r\n if (odataObject.BonusCoupons) {\r\n this.BonusCoupons = [];\r\n for (let i = 0; i < odataObject.BonusCoupons.length; i++) {\r\n if (odataObject.BonusCoupons[i]) {\r\n if (odataObject.BonusCoupons[i]['@odata.type']) {\r\n let className: string = odataObject.BonusCoupons[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusCoupons[i] = new EntityClasses[className](odataObject.BonusCoupons[i]);\r\n }\r\n } else {\r\n this.BonusCoupons[i] = new MFIBonusCouponsDetailExtensionClass(odataObject.BonusCoupons[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupons[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemsResponse entity class.\r\n */\r\nexport class MFIBonusItemsResponseExtensionClass implements IMFIBonusItemsResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItemsDetails: IMFIBonusItemsDetailsEntity[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemsDetails = undefined;\r\n if (odataObject.BonusItemsDetails) {\r\n this.BonusItemsDetails = [];\r\n for (let i = 0; i < odataObject.BonusItemsDetails.length; i++) {\r\n if (odataObject.BonusItemsDetails[i]) {\r\n if (odataObject.BonusItemsDetails[i]['@odata.type']) {\r\n let className: string = odataObject.BonusItemsDetails[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusItemsDetails[i] = new EntityClasses[className](odataObject.BonusItemsDetails[i]);\r\n }\r\n } else {\r\n this.BonusItemsDetails[i] = new MFIBonusItemsDetailsEntityExtensionClass(odataObject.BonusItemsDetails[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemsDetails[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusCouponsDetail entity class.\r\n */\r\nexport class MFIBonusCouponsDetailExtensionClass implements IMFIBonusCouponsDetail {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCoupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCouponMessage: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ChildCoupons: string[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupon = odataObject.BonusCoupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCouponMessage = odataObject.BonusCouponMessage;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons = undefined;\r\n if (odataObject.ChildCoupons) {\r\n this.ChildCoupons = [];\r\n for (let i = 0; i < odataObject.ChildCoupons.length; i++) {\r\n if (odataObject.ChildCoupons[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons[i] = odataObject.ChildCoupons[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons[i] = undefined;\r\n }\r\n }\r\n }\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 '../actions/BonusItemDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction bonusItemsQuery(id?: number): DataServiceQuery {\r\n const key = id ? { Id: id } : null;\r\n return new DataServiceQuery(\r\n 'BonusItems',\r\n 'MFIGetBonusItemsParameters',\r\n DataServiceEntities.MFIGetBonusItemsParametersExtensionClass,\r\n key\r\n );\r\n}\r\n\r\nexport function createMFIGetBonusCouponsDetailsInput(bonusCoupons: string): IDataServiceRequest {\r\n const query = bonusItemsQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetBonusCouponsDetails',\r\n true,\r\n DataServiceEntities.MFIGetBonusCouponsDetailsResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIGetBonusCouponsDetailsResponse' },\r\n { bonusCoupons: bonusCoupons }\r\n );\r\n}\r\n\r\nexport function mFIGetBonusCouponsDetailsAsync(\r\n context: IContext,\r\n bonusCoupons: string\r\n): AsyncResult {\r\n const request = createMFIGetBonusCouponsDetailsInput(bonusCoupons);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n\r\nexport function createMFIGetBonusItemsDetailInput(bonusItemParams: DataServiceEntities.IMFIGetBonusItemsParameters): IDataServiceRequest {\r\n const query = bonusItemsQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetBonusItemsDetail',\r\n true,\r\n DataServiceEntities.MFIBonusItemsResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIBonusItemsResponse' },\r\n { bonusItemParams: bonusItemParams }\r\n );\r\n}\r\n\r\nexport function mFIGetBonusItemsDetailAsync(\r\n context: IContext,\r\n bonusItemParams: DataServiceEntities.IMFIGetBonusItemsParameters\r\n): AsyncResult {\r\n const request = createMFIGetBonusItemsDetailInput(bonusItemParams);\r\n return callActionOrExecute(request, context.callerContext);\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * BonusCouponDetails Input Action\r\n */\r\nexport class BonusCouponDetailsInput implements Msdyn365.IActionInput {\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 = () => `bonusCouponDetail`;\r\n public getCacheObjectType = () => 'bonusCouponDetail';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IBonusCouponDetailsData {\r\n bonusCouponDetail: 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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new BonusCouponDetailsInput();\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: BonusCouponDetailsInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { bonusCouponDetail: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'BonusCouponDetails',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * BonusItemProduct Input Action\r\n */\r\nexport class BonusItemProductInput implements Msdyn365.IActionInput {\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 = () => `TODO`;\r\n public getCacheObjectType = () => 'TODO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IBonusItemProductData {\r\n bonusItemProduct: 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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new BonusItemProductInput();\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: BonusItemProductInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { bonusItemProduct: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'BonusItemProduct',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// sample-state.ts\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IBillingState {\r\n isBillingFormValid: boolean;\r\n}\r\n\r\n/**\r\n * BillingState - action input\r\n */\r\nexport class BillingStateInput implements IActionInput {\r\n public getCacheKey = () => `BillingState`;\r\n public getCacheObjectType = () => 'BillingState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * BillingState - action\r\n */\r\nexport async function BillingStateAction(input: BillingStateInput, ctx: IActionContext): Promise {\r\n return { isBillingFormValid: false};\r\n}\r\n\r\n/**\r\n * BillingState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new BillingStateInput();\r\n};\r\n\r\n/**\r\n * BillingState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >BillingStateAction,\r\n input: createInput\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 { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchChooseYourFoundationDatabase Input Action\r\n */\r\nexport class FetchChooseYourFoundationDatabaseInput implements Msdyn365.IActionInput {\r\n public jsonSrc: string;\r\n // TODO: Construct the input needed to run the action\r\n constructor(jsonSrc: string) {\r\n this.jsonSrc = jsonSrc;\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 = () => `ChooseYourFoundationDatabase`;\r\n public getCacheObjectType = () => 'ChooseYourFoundationDatabase';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IFetchChooseYourFoundationDatabaseData {\r\n text: string;\r\n jsonSrc: string;\r\n}\r\n\r\nexport interface IDatabaseRow {\r\n mattressVariantReqId: string;\r\n baseVariantReqIdList: string[];\r\n recommendedBaseVariantReqId: string;\r\n}\r\n\r\nexport interface foo {\r\n database: AsyncResult;\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FetchChooseYourFoundationDatabaseInput(args?.config?.jsonSrc!);\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: FetchChooseYourFoundationDatabaseInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(input.jsonSrc, 'get');\r\n const database = res.data;\r\n return database;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'FetchChooseYourFoundationDatabase',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface IGetDeliveryFeeUpdateInput {\r\n deliveryAmount: number;\r\n}\r\n/**\r\n * GetDeliveryFeeUpdate Input Action\r\n */\r\nexport class GetDeliveryFeeUpdateInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\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 = () => `CheckoutUpdateDeliveryFee`;\r\n public getCacheObjectType = () => 'CheckoutUpdateDeliveryFee';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetDeliveryFeeUpdateData {\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetDeliveryFeeUpdateInput();\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: GetDeliveryFeeUpdateInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return {deliveryAmount: 0};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetDeliveryFeeUpdate',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetMattressFoundationsToAdd Input Action\r\n */\r\nexport class GetMattressFoundationsToAddInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\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 = () => `TODO`;\r\n public getCacheObjectType = () => 'TODO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetMattressFoundationsToAddData {\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetMattressFoundationsToAddInput();\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: GetMattressFoundationsToAddInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n console.log('input/context',{input, ctx});\r\n return { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetMattressFoundationsToAdd',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\n// import { ICategoryPath, ICategoryUrl } from '@msdyn365-commerce/core-internal/dist/types/interfaces/ICategoryPathInterfaces';\r\nimport { getCategoryPathsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { CategoryPathLookup, CategoryPathResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\n\r\n/**\r\n * Category path input\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n public CatalogId?: number;\r\n public productIds?: number[];\r\n // public readonly categoryPathLooksups: CategoryPathLookup[];\r\n public readonly apiSettings: ICommerceApiSettings;\r\n // @ts-ignore\r\n private constructedCacheKey: string | undefined;\r\n\r\n constructor(context: IRequestContext, catalogId?: number, productIds?: number[]) {\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = catalogId; // context.apiSettings.catalogId || 0;\r\n this.productIds = productIds;\r\n // this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.constructedCacheKey = '';\r\n // categoryPathLooksups.forEach(categoryPath=> {\r\n // this.constructedCacheKey+=`${categoryPath.ProductId && categoryPath.ProductId.toString()}|`;\r\n // });\r\n this.constructedCacheKey = this.productIds?.map(ids => ids).join('-').toString();\r\n this.constructedCacheKey += `${this.ChannelId?.toString()}|`;\r\n this.constructedCacheKey += `${this.CatalogId?.toString()}|`;\r\n }\r\n\r\n public getCacheKey = () => `MFRMProductCategoryPath-${this.constructedCacheKey}`;\r\n public getCacheObjectType = () => 'MFRMProductCategoryPath';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the getCategoryPath retail api call\r\n */\r\nexport const createGetCategoryPathsInput = (\r\n inputData: GetCategoryPathsInput,\r\n context: ICreateActionContext>\r\n): IActionInput => {\r\n const productId = inputData.productIds;\r\n if (productId) {\r\n return new GetCategoryPathsInput(context.requestContext, inputData.CatalogId, inputData.productIds);\r\n } else {\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/**\r\n * Calls the Retail API and returns the category path for a product\r\n */\r\nexport async function getProductsCategoryPathsAction(input: GetCategoryPathsInput, ctx: IActionContext): Promise {\r\n const catPaths: CategoryPathLookup[] = [];\r\n if (!hasArray(input.productIds)) {\r\n return [];\r\n }\r\n for (let productsIter = 0; productsIter < input.productIds!.length; productsIter++) {\r\n catPaths.push({ ProductId: input.productIds![productsIter] });\r\n }\r\n try {\r\n return await getCategoryPathsAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: input.productIds!.length }, Sorting: {} } }, input.ChannelId, input.CatalogId!, catPaths);\r\n } catch (err) {\r\n console.log(err);\r\n return [];\r\n }\r\n}\r\n\r\nexport const getCategoryPathsActionDataAction = createObservableDataAction({\r\n id: 'GetMFRMProductsCategoryPaths',\r\n action: >getProductsCategoryPathsAction,\r\n input: createGetCategoryPathsInput\r\n});\r\n\r\nexport default getCategoryPathsActionDataAction;\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\n\r\nexport interface ICheckoutRecycleFeeTaxUpdate {\r\n recycleFee: number | null;\r\n tax: number | null;\r\n}\r\n/**\r\n * GetRecycleFeeCheckout Input Action\r\n */\r\nexport class GetRecycleFeeCheckoutInput implements Msdyn365.IActionInput {\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 = () => `CheckoutUpdateRecycleFee`;\r\n public getCacheObjectType = () => 'CheckoutUpdateRecycleFee';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetRecycleFeeCheckoutInput();\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: GetRecycleFeeCheckoutInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n return {recycleFee: null , tax: null};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetRecycleFeeCheckout',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIATPInventoryStatusAsync } from './CoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryStatusResponse, IMFICLDeliveryScheduleParameters } from './CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * GetDeliveryMessage Input Action\r\n */\r\n\r\nexport class GetATPInventoryStatusInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public input: IMFICLDeliveryScheduleParameters;\r\n public isCached?: boolean;\r\n constructor(input: IMFICLDeliveryScheduleParameters, isCached: boolean = true) {\r\n this.input = input;\r\n this.isCached = isCached;\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 = () => {\r\n const key = Array.prototype.map.call(this.input.ItemLines, (item) => { return item.VariantRecordId; }).sort().join(\",\");\r\n return `Get-Inventory-Status${this.input.ZipCode}-${this.input.ItemLines![0].ItemId}-${key}-${\r\n this.input?.Weeks\r\n }-${this.input?.RequestedDate}`;\r\n };\r\n // public getCacheKey = () => 'do';\r\n public getCacheObjectType = () => 'GetATPInventoryStatusResult';\r\n public dataCacheType = (): Msdyn365.CacheType => (this.isCached ? 'request' : '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\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetDeliveryMessageInput();\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 getATPInventoryStatusAction(\r\n request: GetATPInventoryStatusInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIATPInventoryStatusAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getATPInventoryStatusAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetATPInventoryStatus'\r\n // input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\nconst getZipCode = (ctx: Msdyn365.IActionContext): string | undefined => {\r\n const cookie = new Cookies();\r\n const zipcode = cookie.get('zip_code') ? cookie.get('zip_code') : ctx?.requestContext?.geoLocation?.zipCode;\r\n return zipcode ?? undefined;\r\n};\r\nexport default getZipCode;","import { IGeneric, IAny } from '@msdyn365-commerce/core';\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 axios from 'axios';\r\nimport getZipCode from '../Utilities/get-zipcode';\r\n\r\n/**\r\n * GetSociData Input Action\r\n */\r\nexport class GetSociDataInput implements Msdyn365.IActionInput {\r\n public searchradius?: number | undefined;\r\n public searchLimit?: number | undefined;\r\n public zipCode?: string | undefined;\r\n constructor(searchradius?: number | undefined, searchLimit?: number | undefined, zipCode?: string | undefined) {\r\n this.searchradius = searchradius;\r\n this.searchLimit = searchLimit;\r\n this.zipCode = zipCode;\r\n }\r\n\r\n public getCacheKey = () => `SOCi-Data-${this.zipCode}`;\r\n public getCacheObjectType = () => 'SOCi-Data';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\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 = (args: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n return new GetSociDataInput(args?.config?.lookupRadius, args?.config?.maxNoOfFranchise ?? 4);\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 getSociData(input: GetSociDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n try {\r\n const zipCode = input?.zipCode ? input.zipCode : getZipCode(ctx);\r\n if (!zipCode) {\r\n return null;\r\n }\r\n\r\n const response = await axios.post(`https://api.slippymap.com/rest/locatorsearch`, {\r\n \"request\": {\r\n \"appkey\": \"F147ADC0-8099-11EC-AC1B-273DC403F339\",\r\n \"formdata\": {\r\n \"dataview\": \"store_default\",\r\n \"limit\": input.searchLimit ?? 4,\r\n \"geolocs\": {\r\n \"geoloc\": [\r\n {\r\n \"postalcode\": zipCode\r\n }\r\n\r\n ]\r\n },\r\n \"searchradius\": input.searchradius?.toString() ?? \"50\"\r\n }\r\n }\r\n }\r\n , {\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n if (response.data) {\r\n return response.data;\r\n }\r\n else { return null; }\r\n } catch (e) {\r\n // TODO: will be removed after unit test and deployment on lower environment\r\n console.log('error for soci api', e);\r\n return null;\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getSociData,\r\n id: 'GetSociData',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFITryInStore entity interface.\r\n */\r\nexport interface IMFITryInStore {\r\n ZipCode?: string;\r\n StoreId: string;\r\n Products?: string;\r\n Limit: number;\r\n Radius: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity interface.\r\n */\r\nexport interface IMFITryInStoreInfoResponse {\r\n Status?: string;\r\n Message?: string;\r\n StoreId?: string;\r\n Inventory?: string[];\r\n}\r\n\r\n/**\r\n * MFITryInStore entity class.\r\n */\r\nexport class MFITryInStoreExtensionClass implements IMFITryInStore {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ZipCode: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public StoreId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Products: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Limit: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Radius: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ZipCode = odataObject.ZipCode;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.StoreId = odataObject.StoreId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Products = odataObject.Products;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Limit = odataObject.Limit;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Radius = odataObject.Radius;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity class.\r\n */\r\nexport class MFITryInStoreInfoResponseExtensionClass implements IMFITryInStoreInfoResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Status: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public StoreId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Inventory: string[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Status = odataObject.Status;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.StoreId = odataObject.StoreId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory = undefined;\r\n if (odataObject.Inventory) {\r\n this.Inventory = [];\r\n for (let i = 0; i < odataObject.Inventory.length; i++) {\r\n if (odataObject.Inventory[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = odataObject.Inventory[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = undefined;\r\n }\r\n }\r\n }\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 './TryInStoreDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction tryInStoresQuery(storeId?: string): DataServiceQuery {\r\n const key = storeId ? { StoreId: storeId } : null;\r\n return new DataServiceQuery('TryInStores', 'MFITryInStore', DataServiceEntities.MFITryInStoreExtensionClass, key);\r\n}\r\n\r\nexport function createMFIGetTryInStoreInfoInput(tryInStoreProductIDs: DataServiceEntities.IMFITryInStore): IDataServiceRequest {\r\n const query = tryInStoresQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetTryInStoreInfo',\r\n true,\r\n DataServiceEntities.MFITryInStoreInfoResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFITryInStoreInfoResponse' },\r\n { tryInStoreProductIDs: tryInStoreProductIDs }\r\n );\r\n}\r\n\r\nexport function mFIGetTryInStoreInfoAsync(\r\n context: IContext,\r\n tryInStoreProductIDs: DataServiceEntities.IMFITryInStore\r\n): AsyncResult {\r\n const request = createMFIGetTryInStoreInfoInput(tryInStoreProductIDs);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIGetTryInStoreInfoAsync } from './TryInStoreDataActionExtension.g';\r\nimport { IMFITryInStore, IMFITryInStoreInfoResponse } from './TryInStoreDataServiceEntities.g';\r\n\r\n/**\r\n * GetTryInStoreInfo Input Action\r\n */\r\n\r\nexport class GetTryInStoreInfoInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public input: IMFITryInStore;\r\n constructor(input: IMFITryInStore) {\r\n this.input = input;\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 = () =>\r\n `Try-In-Store${this.input.StoreId}-${this.input.ZipCode}-${this.input.Radius}-${this.input.Limit}-${this.input.Products}`;\r\n public getCacheObjectType = () => 'GetTryInStoreInfo';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetTryInStoreInfoInput();\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 getTryInStoreAction(\r\n request: GetTryInStoreInfoInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIGetTryInStoreInfoAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return {};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getTryInStoreAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetTryInStoreInfo'\r\n // input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\n\r\nexport interface ICategoryLevelNamesData {\r\n categoryLevelName?: string;\r\n}\r\nexport class GetUnbxdRecommendationsDataInput implements Msdyn365.IActionInput {\r\n public pageType?: string | undefined;\r\n public widgetNumber?: string | undefined;\r\n public productID?: string | undefined;\r\n public catLevels?: ICategoryLevelNamesData[] | undefined;\r\n public cartItemIDs?: (string | undefined)[] | undefined;\r\n\r\n constructor(pageType?: string | undefined, widgetNumber?: string | undefined, productID?: string | undefined, catLevels?: ICategoryLevelNamesData[] | undefined, cartItemIDs?: (string | undefined)[] | undefined) {\r\n this.pageType = pageType;\r\n this.widgetNumber = widgetNumber;\r\n this.productID = productID;\r\n this.catLevels = catLevels;\r\n this.cartItemIDs = cartItemIDs;\r\n }\r\n\r\n public getCacheKey = () => `Unbxd-recommendation-data-${this.pageType}-${this.widgetNumber}`;\r\n public getCacheObjectType = () => 'Unbxd-recommendation-data';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\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 getUnbxdRecommendationData(input: GetUnbxdRecommendationsDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n const cookies = new Cookies();\r\n const unbxdUid = cookies.get('unbxd.userId');\r\n const pageType = input?.pageType ? input.pageType.toUpperCase() : \"\";\r\n const productID = input?.productID ? input.productID : \"\";\r\n const catLevels = input?.catLevels ? input.catLevels : [];\r\n const cartItemIDs = input?.cartItemIDs ? input.cartItemIDs : [];\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n\r\n if (!pageType) {\r\n return null;\r\n }\r\n try {\r\n let unbxdUrl = \"\";\r\n switch (pageType) {\r\n case \"HOME\":\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}&uid=${unbxdUid}`;\r\n break;\r\n case \"CATEGORY\":\r\n const catnames = catLevels.map((catName, index) => {\r\n return `&catlevel${index + 1}Name=${catName ? catName.categoryLevelName : ''}`;\r\n }).join('');\r\n\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}${catnames}&uid=${unbxdUid}`;\r\n break;\r\n case \"PRODUCT\":\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}&id=${productID}&uid=${unbxdUid}`;\r\n break;\r\n case \"CART\":\r\n const productitemIds = cartItemIDs.map((itemId) => {\r\n return `&id=${itemId}`;\r\n }).join('');\r\n\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}${productitemIds}&uid=${unbxdUid}`;\r\n break;\r\n default:\r\n unbxdUrl = '';\r\n }\r\n const response = await Msdyn365.sendRequest(unbxdUrl, 'get');\r\n if (response.data) {\r\n return response.data && response.data[input.widgetNumber!.toLowerCase()];\r\n }\r\n else { return null; }\r\n } catch (e) {\r\n return null;\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getUnbxdRecommendationData,\r\n id: 'getUnbxdRecommendationData'\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * SelectYourFoundation Input Action\r\n */\r\nexport class SelectYourFoundationInput implements Msdyn365.IActionInput {\r\n public foundation: SimpleProduct | undefined | null;\r\n // TODO: Construct the input needed to run the action\r\n constructor(foundation: SimpleProduct | undefined | null) {\r\n this.foundation = foundation;\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 = () => `SelectYourFoundation`;\r\n public getCacheObjectType = () => 'SelectYourFoundation';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ISelectYourFoundationData {\r\n foundation: SimpleProduct | undefined | null;\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new SelectYourFoundationInput(args?.config?.foundation);\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: SelectYourFoundationInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { foundation: input.foundation };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'SelectYourFoundation',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface ISocialIconState {\r\n copyLinkClick: boolean;\r\n}\r\n\r\n/**\r\n * SocialIconsState Input Action\r\n */\r\nexport class SocialIconsStateInput implements IActionInput {\r\n public getCacheKey = () => `SocialIconsState`;\r\n public getCacheObjectType = () => 'SocialIconsState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport async function socialIconStateAction(input: SocialIconsStateInput, ctx: IActionContext): Promise {\r\n return { copyLinkClick: false };\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: ICreateActionContext>): IActionInput => {\r\n return new SocialIconsStateInput();\r\n};\r\n\r\nexport default createObservableDataAction({\r\n action: >socialIconStateAction,\r\n // TODO: Give your data action a unique id\r\n id: 'SocialIconsState',\r\n input: createInput\r\n});\r\n","import * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface ISRPBreadcrumbState {\r\n breadcrumbCheck: boolean;\r\n}\r\n\r\n/**\r\n * SrpBreadcrumbPage Input Action\r\n */\r\nexport class SrpBreadcrumbPageInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\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 = () => `BreadcrumbSrp`;\r\n public getCacheObjectType = () => 'BreadcrumbSrp';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ISrpBreadcrumbPageData {\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new SrpBreadcrumbPageInput();\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: SrpBreadcrumbPageInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { breadcrumbCheck: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'SrpBreadcrumbPage',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * TriggerSpecialSynchronyFinancing Input Action\r\n */\r\nexport class TriggerSpecialSynchronyFinancingInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\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 = () => `TriggerSpecialSynchronyFinancing`;\r\n public getCacheObjectType = () => 'TriggerSpecialSynchronyFinancing';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ITriggerSpecialSynchronyFinancingData {\r\n triggerSpecialFinancing: boolean;\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new TriggerSpecialSynchronyFinancingInput();\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: TriggerSpecialSynchronyFinancingInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { triggerSpecialFinancing: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'TriggerSpecialSynchronyFinancing',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * UserDefinedPromocode Input Action\r\n */\r\nexport class UserDefinedPromocodeInput implements Msdyn365.IActionInput {\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 = () => `userDefinedPromoCodes`;\r\n public getCacheObjectType = () => 'userDefinedPromoCodes';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IUserDefinedPromocodeData {\r\n userDefinedPromos: 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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new UserDefinedPromocodeInput();\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: UserDefinedPromocodeInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { userDefinedPromos: [] };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'UserDefinedPromocode',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// WmapAddress-state.ts\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IWmapAddressState {\r\n preFilledAddress: any;\r\n isAddressUpdate: boolean;\r\n}\r\n\r\n/**\r\n * WmapAddressState - action input\r\n */\r\nexport class WmapAddressStateInput implements IActionInput {\r\n constructor() {}\r\n public getCacheKey = () => `WmapAddressState`;\r\n public getCacheObjectType = () => 'WmapAddressState';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * WmapAddressState - action\r\n */\r\nasync function action(input: WmapAddressStateInput, ctx: IActionContext): Promise {\r\n return { preFilledAddress: {}, isAddressUpdate: false };\r\n}\r\n\r\n/**\r\n * WmapAddressState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new WmapAddressStateInput();\r\n};\r\n\r\n/**\r\n * WmapAddressState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","// sample-state.ts\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nexport interface IZipCodeState {\r\n isStateValid: boolean;\r\n}\r\n\r\n/**\r\n * ZipCodeState - action input\r\n */\r\nexport class ZipCodeStateInput implements IActionInput {\r\n public getCacheKey = () => `ZipCodeState`;\r\n public getCacheObjectType = () => 'ZipCodeState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * ZipCodeState - action\r\n */\r\nexport async function ZipCodeStateAction(input: ZipCodeStateInput, ctx: IActionContext): Promise {\r\n return {isStateValid: false };\r\n}\r\n\r\n/**\r\n * ZipCodeState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new ZipCodeStateInput();\r\n};\r\n\r\n/**\r\n * ZipCodeState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >ZipCodeStateAction,\r\n input: createInput\r\n});\r\n","// sample-state.ts\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nexport interface IZipcodeValidation {\r\n isZipcodeValid: boolean;\r\n}\r\n\r\n/**\r\n * ZipCodeState - action input\r\n */\r\nexport class ZipCodeValidationInput implements IActionInput {\r\n public getCacheKey = () => `ZipCodeValidation`;\r\n public getCacheObjectType = () => 'ZipCodeValidation';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * ZipCodeState - action\r\n */\r\nexport async function ZipcodeValidationAction(input: ZipCodeValidationInput, ctx: IActionContext): Promise {\r\n return { isZipcodeValid: false };\r\n}\r\n\r\n/**\r\n * ZipCodeState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new ZipCodeValidationInput();\r\n};\r\n\r\n/**\r\n * ZipCodeState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >ZipcodeValidationAction,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { mFIGetBonusCouponsDetailsAsync } from '../actions/BonusItemDataActionExtension.g';\r\nimport { IMFIGetBonusCouponsDetailsResponse } from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BonusCouponsInfoInput implements IActionInput {\r\n public bonusCoupon: string;\r\n constructor(bonusCoupon: string) {\r\n this.bonusCoupon = bonusCoupon;\r\n }\r\n public getCacheKey = () => `MFRMBonusCouponsInfoInput-${this.bonusCoupon}`;\r\n public getCacheObjectType = () => 'MFRMBonusCouponsInfoInput';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport interface IMFRMBonusCouponsDetailData {\r\n couponsDetails: IMFIGetBonusCouponsDetailsResponse;\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new BonusCouponsInfoInput('');\r\n};\r\n\r\nexport async function getAllBonusCouponsDetails(\r\n input: BonusCouponsInfoInput,\r\n ctx: IActionContext\r\n): Promise {\r\n try {\r\n const result = await mFIGetBonusCouponsDetailsAsync({ callerContext: ctx }, input.bonusCoupon);\r\n if (result) {\r\n return {couponsDetails: result};\r\n }\r\n } catch (error) {\r\n ctx.telemetry.warning(JSON.stringify(error));\r\n ctx.telemetry.debug('Unable to get Bonus Coupons Details when get all coupons');\r\n }\r\n return {couponsDetails: {}};\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getAllBonusCouponsDetails,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n/**\r\n * GetAuthTokenInput Input Action\r\n */\r\nexport class BrightSpotContentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private brightspotUrl: string = '';\r\n constructor(brightspotUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'bspagecache', cacheKey: 'bspagecache' });\r\n this.brightspotUrl = brightspotUrl;\r\n }\r\n\r\n public getBrightspotUrl = () => this.brightspotUrl;\r\n public getCacheKey = () => `bspagecache`;\r\n public getCacheObjectType = () => 'bspagecache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.brightspotPageUrl) {\r\n return new BrightSpotContentInput(inputData.config.brightspotPageUrl);\r\n }\r\n return new BrightSpotContentInput('');\r\n};\r\n\r\nasync function action(input: BrightSpotContentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(\r\n input.getBrightspotUrl(),\r\n 'get',\r\n null,\r\n { headers: {'Accept-Encoding': 'gzip'} }\r\n );\r\n\r\n return res.data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType, ZipCodeInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { getAddressFromZipCodeAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\n\r\n/**\r\n * GetEyebrowMessage Input Action\r\n */\r\n\r\nexport class GetAddressByZipcodeInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public country: string;\r\n public zipcode: string;\r\n\r\n constructor(country: string, zipcode: string) {\r\n this.country = country;\r\n this.zipcode = zipcode;\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 = () => `Get-Address-By-Zipcode-${this.zipcode}`;\r\n public getCacheObjectType = () => 'GetAddressByZipCode';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\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 getAddressByZipcodeAction(input: GetAddressByZipcodeInput, ctx: IActionContext): Promise {\r\n return getAddressFromZipCodeAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } }, input.country, input.zipcode);\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getAddressByZipcodeAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetAddressByZipcode'\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IProductDimensionsWithAvailabilitiesFull, ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, {\r\n CacheType, createObservableDataAction, IAction, IActionContext, IActionInput,\r\n IAny, ICreateActionContext, IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n ProductDimension, ProductDimensionAvailabilitySearchCriteria,\r\n ProductDimensionValue, ProductDimensionValueInventoryAvailability, ProductsDataActions\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { createInventoryAvailabilitySearchCriteria, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getDimensionValuesFromQuery, getQueryParamsFromQueryByName } from './utilities/utils';\r\n\r\n/**\r\n * Defines the dimension value type for get dimensions for selected variant data action.\r\n * Includes old API format for backward compatibility and new API info for availabilities for new logic.\r\n */\r\nexport interface IDimensionValueForSelectedVariant extends ProductDimensionValueInventoryAvailability, ProductDimensionValue {}\r\n\r\n/**\r\n * Defines the returned type for get dimensions for selected variant data action.\r\n * Includes old API format for backward compatibility and new API info for availabilities for new logic.\r\n */\r\nexport interface IDimensionForSelectedVariant extends ProductDimensionFull, IProductDimensionsWithAvailabilitiesFull {}\r\n\r\n/**\r\n * Input class for the getDimensionsForSelectedVariant data action.\r\n */\r\nexport class GetDimensionsForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public matchingDimensionValues: ProductDimension[];\r\n\r\n public constructor(productId: number, channelId: number, matchingDimensionValues?: ProductDimension[]) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues || [];\r\n }\r\n\r\n /**\r\n * Cache key.\r\n * @returns String.\r\n */\r\n public getCacheKey: () => string = () => `DimensionsForSelectedVariantInput-${this.productId}-${this.channelId}`;\r\n\r\n /**\r\n * Cache object type.\r\n * @returns String.\r\n */\r\n public getCacheObjectType: () => string = () => 'DimensionsForSelectedVariantInput';\r\n\r\n /**\r\n * Cache type.\r\n * @returns String.\r\n */\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * Create input method for the getDimensionsForSelectedVariant data action.\r\n * @param inputData - The input data passed to the createInput method.\r\n * @returns - The input for the data action.\r\n */\r\nconst createDimensionsForSelectedVariantInput = (inputData: ICreateActionContext>): GetDimensionsForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetDimensionsForSelectedVariantInput(\r\n +productId,\r\n +inputData.requestContext.apiSettings.channelId,\r\n getDimensionValuesFromQuery(inputData.requestContext.url.requestUrl));\r\n }\r\n throw new Error('Unable to create DimensionsForSelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Converts new API type with availabilities to old API type to preserve backward compatibility.\r\n * @param dimensions - Dimensions to convert.\r\n * @returns Dimensions in old API format.\r\n */\r\nconst prepareDimensionsDataResult = (dimensions: IProductDimensionsWithAvailabilitiesFull[]): IDimensionForSelectedVariant[] => {\r\n return dimensions.map(newDimension => {\r\n const oldDimension: IDimensionForSelectedVariant = { ...newDimension };\r\n oldDimension.DimensionValues = ArrayExtensions.validValues(newDimension.dimensionValuesWithInventory?.map(value => value.DimensionValue));\r\n return oldDimension;\r\n });\r\n};\r\n\r\n/**\r\n * Action Method for the getDimensionsForSelectedVariant Data Action.\r\n * @param input - Input for the data action.\r\n * @param context - Action context.\r\n * @returns Product dimensions with availability.\r\n */\r\nexport async function getDimensionsForSelectedVariantAction(\r\n input: GetDimensionsForSelectedVariantInput,\r\n context: IActionContext\r\n): Promise {\r\n const variantId = context.requestContext.app.config.queryBasedVariantSelection ? getQueryParamsFromQueryByName(MsDyn365.isBrowser ? new URL(window.location.href.toString()) : context.requestContext.url.requestUrl, 'variantid') : undefined;\r\n let activeProduct = await ProductsDataActions.getByIdAsync({ callerContext: context }, variantId && !Number.isNaN(Number(variantId)) ? Number(variantId) : input.productId, input.channelId);\r\n if (!activeProduct && variantId) {\r\n activeProduct = await ProductsDataActions.getByIdAsync({ callerContext: context }, Number(input.productId), input.channelId);\r\n }\r\n if (!ArrayExtensions.hasElements(activeProduct.Dimensions)) {\r\n return [];\r\n }\r\n\r\n const promises = activeProduct.Dimensions.map(dimension => {\r\n const shippingInventoryConfiguration = createInventoryAvailabilitySearchCriteria(context, [], true, undefined, undefined);\r\n\r\n const searchCriteria: ProductDimensionAvailabilitySearchCriteria =\r\n {\r\n RequestedDimensionTypeValue: dimension.DimensionTypeValue,\r\n MatchingDimensionValues: input.matchingDimensionValues.filter(item => item.DimensionTypeValue !== dimension.DimensionTypeValue),\r\n DefaultWarehouseOnly: shippingInventoryConfiguration.DefaultWarehouseOnly,\r\n FilterByChannelFulfillmentGroup: shippingInventoryConfiguration.FilterByChannelFulfillmentGroup,\r\n DeliveryModeTypeFilterValue: shippingInventoryConfiguration.DeliveryModeTypeFilterValue\r\n };\r\n\r\n const dimensionValuesPromise = ProductsDataActions.getDimensionValuesWithEstimatedAvailabilitiesAsync(\r\n { callerContext: context, queryResultSettings: {} },\r\n activeProduct.MasterProductId ? activeProduct.MasterProductId : activeProduct.RecordId,\r\n searchCriteria\r\n );\r\n const fullDimensionPromise = dimensionValuesPromise.then(dimensionValues => {\r\n const fullDimension: IProductDimensionsWithAvailabilitiesFull = {\r\n ...dimension,\r\n dimensionValuesWithInventory: dimensionValues\r\n };\r\n return fullDimension;\r\n });\r\n\r\n return fullDimensionPromise;\r\n });\r\n\r\n const dimensionValuesResults = await Promise.all(promises);\r\n\r\n return prepareDimensionsDataResult(dimensionValuesResults);\r\n}\r\n\r\n/**\r\n * The GetDimensionsForSelectedVariantDataAction\r\n * Get the currently selected Variant via the getSelectedVariant data action, and the gets the\r\n * available product dimensions for the variant via the getDimensionValues RetailServer API.\r\n */\r\nexport const getDimensionsForSelectedVariantActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-dimensions/for-selected-variant',\r\n action: getDimensionsForSelectedVariantAction as IAction,\r\n input: createDimensionsForSelectedVariantInput\r\n});\r\n\r\nexport default getDimensionsForSelectedVariantActionDataAction;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetFranchiseData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public Latitude?: number;\r\n public Longitude?: number;\r\n public Radius?: number;\r\n\r\n constructor(_Latitude?: number, _Longitude?: number, _Radius?: number) {\r\n super({\r\n shouldCacheOutput: true,\r\n cacheObjectType: 'FranchiseDataCache',\r\n cacheKey: 'FranchiseDataCache'\r\n });\r\n this.Latitude = _Latitude;\r\n this.Longitude = _Longitude;\r\n this.Radius = _Radius;\r\n }\r\n public getCacheKey = () => `FranchiseDataCache`;\r\n public getCacheObjectType = () => 'FranchiseDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\nexport interface IFranchise {\r\n \"id\": string;\r\n \"name\": string;\r\n \"address_line_1\": string;\r\n \"address_line_2\": string;\r\n \"city\": string;\r\n \"state_province\": string;\r\n \"postal_code\": string;\r\n \"country\": string;\r\n \"lat\": string;\r\n \"long\": string;\r\n \"distance\": number;\r\n \"website_url\": string;\r\n \"miles\"?: number;\r\n}\r\n\r\nconst _calculateDistance = (latitude1: any, longitude1: any, latitude2: any, longitude2: any) => {\r\n\r\n // The math module contains a function\r\n // named toRadians which converts from\r\n // degrees to radians.\r\n const long1 = longitude1 * Math.PI / 180;\r\n const long2 = longitude2 * Math.PI / 180;\r\n const lat1 = latitude1 * Math.PI / 180;\r\n const lat2 = latitude2 * Math.PI / 180;\r\n\r\n // Haversine formula\r\n const dlon = long2 - long1;\r\n const dlat = lat2 - lat1;\r\n const a = Math.pow(Math.sin(dlat / 2), 2)\r\n + Math.cos(lat1) * Math.cos(lat2)\r\n * Math.pow(Math.sin(dlon / 2), 2);\r\n const c = 2 * Math.asin(Math.sqrt(a));\r\n\r\n // Radius of earth\r\n // for kilometers=6371\r\n // for miles = 3956\r\n const r = 3956;\r\n\r\n // calculate the result\r\n return (c * r);\r\n};\r\n\r\nexport const getFranchiseInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n return new GetFranchiseData();\r\n};\r\n\r\n\r\nexport async function getFranchise(input: GetFranchiseData, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrl = ctx.requestContext.app.config.sociFranchiseDataUrl || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MAcq1X!!';\r\n const franchiseDataJson = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const franchiseStores: IFranchise[] = [];\r\n franchiseDataJson.data.map((franchise: IFranchise) => {\r\n const miles = _calculateDistance(input.Latitude, input.Longitude, franchise.lat, franchise.long);\r\n if (miles <= (input.Radius || 50)) {\r\n franchise.miles = miles;\r\n franchiseStores.push(franchise);\r\n }\r\n });\r\n\r\n return franchiseStores;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getFranchise,\r\n input: getFranchiseInput\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport class GetProductBenefitsEnhancedContentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public masterProductID: string = '';\r\n constructor( masterProductID:string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'productBenefitsEnhancedContentCache', cacheKey: 'productBenefitsEnhancedContentCache' });\r\n this.masterProductID = masterProductID;\r\n }\r\n public getCacheKey = () => `productBenefitsEnhancedContentCache`;\r\n public getCacheObjectType = () => 'productBenefitsEnhancedContentCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n// tslint:disable: no-any\r\nasync function getEnhancedContentAction(input: GetProductBenefitsEnhancedContentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.productBenefitsEnhancedContentUrl;\r\n const masterProductid = input.masterProductID;\r\n const jsonUrl = jsonUrlFromGlobals || '';\r\n try {\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n if (res && masterProductid) {\r\n const productBenefitData = res.data && res.data[masterProductid];\r\n return productBenefitData;\r\n }\r\n }\r\n catch (error) {\r\n console.log('error', error);\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getEnhancedContentAction\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetProductBenefitsData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private productBenefitsDataUrl: string = '';\r\n constructor(productBenefitsDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'productBenefitsDataCache', cacheKey: 'productBenefitsDataCache' });\r\n this.productBenefitsDataUrl = productBenefitsDataUrl;\r\n }\r\n public getProductBenefitsDataUrl = () => this.productBenefitsDataUrl;\r\n public getCacheKey = () => `productBenefitsDataCache`;\r\n public getCacheObjectType = () => 'productBenefitsDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.productBenefitsDataUrl) {\r\n return new GetProductBenefitsData(inputData.config.productBenefitsDataUrl);\r\n }\r\n return new GetProductBenefitsData('');\r\n};\r\nasync function action(input: GetProductBenefitsData, ctx: Msdyn365.IActionContext): Promise {\r\n const productBenefitsDataJsonUrl = ctx.requestContext.app.config.productBenefitsDataUrl;\r\n const jsonUrl = productBenefitsDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const productBenefitsData = res.data && res.data;\r\n return productBenefitsData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetPromocodeValue Input Action\r\n */\r\n\r\nexport class GetPromocodeValueInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\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 = () => `getPromoCode`;\r\n public getCacheObjectType = () => 'getPromoCode';\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\nexport interface IGetPromocodeValueData {\r\n promocodeValue: [IPromoCode];\r\n}\r\nexport interface IPromoCode {\r\n promoCodeApplied: 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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetPromocodeValueInput();\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: GetPromocodeValueInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const promocodeValue: IPromoCode[] = [];\r\n return promocodeValue;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetPromocodeValue',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport class GetReasonsToBuyDataInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public categoryName:string ='';\r\n constructor( categoryName:string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'rtbDataCache', cacheKey: 'rtbDataCache' });\r\n this.categoryName = categoryName;\r\n }\r\n public getCacheKey = () => `rtbDataCache`;\r\n public getCacheObjectType = () => 'rtbDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n// tslint:disable: no-any\r\nasync function action(input: GetReasonsToBuyDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.reasonsToBuyJsonUrl;\r\n const categoryName =input.categoryName;\r\n const jsonUrl =jsonUrlFromGlobals || undefined;\r\n if(jsonUrl){\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const reasonsToBuyData = res.data && res.data[categoryName];\r\n return reasonsToBuyData;\r\n }\r\n return undefined;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action\r\n});\r\n","import { buildCacheKey, getSimpleProducts, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, ICommerceApiSettings, ICreateActionContext } from '@msdyn365-commerce/core';\r\nimport { ProductDeliveryOptions, SalesOrder, SimpleProduct, TransactionType } from '@msdyn365-commerce/retail-proxy';\r\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getSalesOrderDetailsBySalesIdAsync, getSalesOrderDetailsByTransactionIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/SalesOrdersDataActions.g';\r\n\r\ninterface ISalesOrderWithHydrations {\r\n salesOrder: SalesOrder;\r\n products: SimpleProduct[];\r\n productDeliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\n/**\r\n * orderTypes Types of orders\r\n */\r\nexport const enum orderTypes {\r\n salesOrder = 'salesOrder',\r\n transaction = 'transaction'\r\n}\r\n\r\n/**\r\n * Calls the Retail API and returns the sales order\r\n */\r\nconst getSalesOrder = (orderType: string = '', orderId: string = '') => async (ctx: IActionContext): Promise => {\r\n return orderType === orderTypes.salesOrder\r\n ? getSalesOrderDetailsBySalesIdAsync({ callerContext: ctx }, orderId)\r\n : // Local (1) searches the retail server database, and remote (2) searches\r\n // on the headquarters side. All (3) and none (0) are not supported.\r\n getSalesOrderDetailsByTransactionIdAsync({ callerContext: ctx }, orderId, 1);\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the products\r\n */\r\nconst getProducts = (productIds: number[] = [], channelId?: number) => async (ctx: IActionContext): Promise => {\r\n const productInputs = productIds.map(productId => new ProductInput(productId, ctx.requestContext.apiSettings, channelId));\r\n return getSimpleProducts(productInputs, ctx);\r\n};\r\n\r\n/**\r\n * Action input\r\n */\r\nexport class GetSalesOrderWithHydrationsInput implements IActionInput {\r\n public orderType: string;\r\n public orderId: string;\r\n private apiSettings: ICommerceApiSettings;\r\n\r\n constructor(orderType: string , orderId: string, apiSettings: ICommerceApiSettings) {\r\n this.orderType = orderType;\r\n this.orderId = orderId;\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(`SalesOrderWithHydrations`, this.apiSettings);\r\n public getCacheObjectType = () => `SalesOrderWithHydrations-${this.orderType}-${this.orderId}`;\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the retail api call\r\n */\r\nconst createSalesOrderWithHydrationsInput = (inputData: ICreateActionContext) => {\r\n const { salesId = '', transactionId = '' } = (inputData.requestContext.query && inputData.requestContext.query) || {};\r\n if (salesId) {\r\n return new GetSalesOrderWithHydrationsInput(orderTypes.salesOrder, salesId, inputData.requestContext.apiSettings);\r\n } else if (transactionId) {\r\n return new GetSalesOrderWithHydrationsInput(orderTypes.transaction, transactionId, inputData.requestContext.apiSettings);\r\n }\r\n throw new Error(`createSalesOrderWithHydrationsInput - No salesId or transactionId provided.`);\r\n};\r\n\r\n/**\r\n * Get sales order with hydrations action\r\n */\r\nexport async function getSalesOrderWithHydrationsAction(\r\n input: GetSalesOrderWithHydrationsInput,\r\n ctx: IActionContext\r\n): Promise {\r\n if (!ctx) {\r\n throw new Error(`getSalesOrderWithHydrationsAction - Action context cannot be null/undefined`);\r\n }\r\n\r\n const { orderType, orderId } = input;\r\n\r\n if (!orderType || !orderId) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No orderType or orderId provided.`);\r\n return {};\r\n }\r\n\r\n const salesOrder = await getSalesOrder(orderType, orderId)(ctx);\r\n\r\n if (!salesOrder) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No salesOrder found.`);\r\n return {};\r\n }\r\n\r\n // If it is salesInvoice, return salesOrder and empty products\r\n // tslint:disable-next-line:prefer-type-cast\r\n if (salesOrder.TransactionTypeValue === 15 as TransactionType.SalesInvoice) {\r\n return {\r\n salesOrder,\r\n products: []\r\n };\r\n }\r\n\r\n if (!salesOrder.SalesLines || !salesOrder.SalesLines.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No salesLine found.`);\r\n return {};\r\n }\r\n\r\n const productIds: number[] = salesOrder.SalesLines.map(salesLine => salesLine.ProductId || 0).filter(productId => productId);\r\n\r\n if (!productIds || !productIds.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No productId in saleLines found.`);\r\n return {};\r\n }\r\n\r\n const products = await getProducts(productIds, salesOrder.ChannelId)(ctx);\r\n\r\n if (!products || !products.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No product found.`);\r\n return {};\r\n }\r\n\r\n const deliveryOptions = await getDeliveryOptionsAsync({ callerContext: ctx, queryResultSettings: {} }, products.map(x => x.RecordId), {}, 4)\r\n .then(result => {\r\n return result;\r\n }).catch((error: Error) => {\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug(`[getDeliveryOptionsForCartLineItems]Error executing action`);\r\n throw new Error('[getDeliveryOptionsForCartLineItems]Error executing action');\r\n });\r\n\r\n return {\r\n salesOrder,\r\n products,\r\n deliveryOptions\r\n };\r\n}\r\n\r\nexport const getSalesOrderWithHydrationsActionDataAction = createObservableDataAction({\r\n id: 'mfrm-get-sales-order-with-hydrations',\r\n action: >getSalesOrderWithHydrationsAction,\r\n input: createSalesOrderWithHydrationsInput\r\n});\r\n\r\nexport default getSalesOrderWithHydrationsActionDataAction;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { filteredURL } from '../Utilities/plp-url-utils';\r\n\r\nexport class GetSeoDataInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n\r\n private seoDataUrl: string = '';\r\n constructor(seoDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'SeoDataCache', cacheKey: 'SeoDataCache' });\r\n this.seoDataUrl = seoDataUrl;\r\n }\r\n\r\n public getSeoDataUrl = () => this.seoDataUrl;\r\n public getCacheKey = () => `SeoDataCache`;\r\n public getCacheObjectType = () => 'SeoDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.seoDataUrl) {\r\n return new GetSeoDataInput(inputData.config.seoDataUrl);\r\n }\r\n return new GetSeoDataInput('');\r\n};\r\n\r\n// tslint:disable: no-any\r\nasync function action(input: GetSeoDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.seoDataUrl;\r\n // TODO: Just remove the fallback\r\n const jsonUrl = jsonUrlFromGlobals || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MA5cA7';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const filteredUrlPath = filteredURL(ctx.requestContext);\r\n const seoData = filteredUrlPath && res.data && res.data[filteredUrlPath];\r\n return seoData && seoData[0];\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetSleepDisruptorIcons extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private sleepDisuptorIconsDataUrl: string = '';\r\n constructor(sleepDisuptorIconsDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'sleepDisuptorIconsDataCache', cacheKey: 'sleepDisuptorIconsDataCache' });\r\n this.sleepDisuptorIconsDataUrl = sleepDisuptorIconsDataUrl;\r\n }\r\n public getSleepDisuptorIconsDataUrl = () => this.sleepDisuptorIconsDataUrl;\r\n public getCacheKey = () => `sleepDisuptorIconsDataCache`;\r\n public getCacheObjectType = () => 'sleepDisuptorIconsDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.sleepDisuptorIconsDataUrl) {\r\n return new GetSleepDisruptorIcons(inputData.config.sleepDisuptorIconsDataUrl);\r\n }\r\n return new GetSleepDisruptorIcons('');\r\n};\r\nasync function action(input: GetSleepDisruptorIcons, ctx: Msdyn365.IActionContext): Promise {\r\n const sleepDisuptorIconsDataJsonUrl = ctx.requestContext.app.config.sleepDisruptorIconDataUrl;\r\n const jsonUrl = sleepDisuptorIconsDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const sleepDisuptorIconsData = res.data && res.data;\r\n return sleepDisuptorIconsData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","import { IFullOrgUnitAvailability } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { ChannelDeliveryOption, OrgUnitAvailability, OrgUnitLocation, SearchArea, StoreHours } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n /*getChannelDeliveryOptionsAsync,*/ getOrgUnitLocationsByAreaAsync,\r\n getStoreHoursAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\r\n// import {FeatureStateInput, getFeatureStateAction} from './get-feature-state';\r\n\r\n/**\r\n * Get selected variant action input class\r\n */\r\nexport class GetOrgUnitLocationsByAreaInput implements IActionInput {\r\n public Latitude?: number;\r\n public Longitude?: number;\r\n public Radius?: number;\r\n public DistanceUnitValue?: number;\r\n public IgnoreLocation?: boolean;\r\n\r\n constructor(_Latitude?: number, _Longitude?: number, _Radius?: number, _DistanceUnitValue?: number, _IgnoreLocation?: boolean) {\r\n this.Latitude = _Latitude;\r\n this.Longitude = _Longitude;\r\n this.Radius = _Radius;\r\n this.DistanceUnitValue = _DistanceUnitValue;\r\n this.IgnoreLocation = _IgnoreLocation;\r\n }\r\n\r\n public getCacheKey = () => `GetOrgUnitLocationsByAreaInput`;\r\n public getCacheObjectType = () => 'GetOrgUnitLocationsByAreaInput';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action\r\n * @param inputData The input data passed to the createInput method\r\n */\r\nexport const createGetOrgUnitLocationsByAreaInput = (inputData: ICreateActionContext>): GetOrgUnitLocationsByAreaInput => {\r\n return new GetOrgUnitLocationsByAreaInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail Feature State API and returns a list of feature with isEnabled flag.\r\n */\r\n// export async function getFeatureState(context: IActionContext): Promise {\r\n// return getFeatureStateAction(new FeatureStateInput(), context);\r\n// }\r\n\r\n/**\r\n * Action method for the getSelectedVariant data action\r\n * @param input The action input class\r\n * @param ctx The action context\r\n */\r\nexport async function getOrgUnitLocationsByArea(\r\n input: GetOrgUnitLocationsByAreaInput,\r\n ctx: IActionContext\r\n): Promise {\r\n if ((input.Radius === undefined || !input.Latitude || !input.Longitude) && !input.IgnoreLocation) {\r\n // No valid location we want to return empty array so module can show no locations message\r\n return [];\r\n }\r\n\r\n const searchArea: SearchArea = {\r\n Latitude: input.Latitude,\r\n Longitude: input.Longitude,\r\n Radius: input.Radius,\r\n DistanceUnitValue: input.DistanceUnitValue || 0 // 0 is miles\r\n };\r\n\r\n // const featureState = await getFeatureState(ctx);\r\n // const retailMulitplePickupMFeatureState = featureState?.find(item => item.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature')?.IsEnabled;\r\n\r\n return getOrgUnitLocationsByAreaAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 4 } } }, searchArea)\r\n .then(async (stores: OrgUnitLocation[]) => {\r\n const locationDeliveryOptions: ChannelDeliveryOption[] | undefined = [];\r\n // if mulitple pickup mode is enable then call getchanneldeliveryoption\r\n // if(retailMulitplePickupMFeatureState) {\r\n // const orgUnitChannel = stores.map(store => store.ChannelId);\r\n // locationDeliveryOptions = await _getLocationPickUpDeliveryModes(orgUnitChannel, ctx);\r\n // }\r\n const locationPromiseList = stores.map(store => {\r\n const locationDeliveryOption = locationDeliveryOptions?.find(\r\n _channeldeliveryoption => _channeldeliveryoption.ChannelId === store.ChannelId\r\n );\r\n return _getLocationWithHours(store, locationDeliveryOption, ctx);\r\n });\r\n return Promise.all(locationPromiseList);\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace('[GetOrgUnitLocationsByArea] error getting Locations');\r\n ctx.trace(error.message);\r\n ctx.telemetry.error(error.message);\r\n ctx.telemetry.debug(`[GetOrgUnitLocationsByArea] error getting Locations`);\r\n return [];\r\n });\r\n}\r\n\r\n/**\r\n * Action method that obtains the store information\r\n * @param orgUnitLocation The org unit location\r\n * @param storeMap a map that contains store information group by the inventory location id\r\n * @param ctx The action context\r\n */\r\nasync function _getLocationWithHours(\r\n orgUnitLocation: OrgUnitLocation,\r\n channelDeleiveryOptions: ChannelDeliveryOption | undefined,\r\n ctx: IActionContext\r\n): Promise {\r\n if (!orgUnitLocation || !orgUnitLocation.OrgUnitNumber) {\r\n return { OrgUnitAvailability: undefined };\r\n }\r\n\r\n return getStoreHoursAsync({ callerContext: ctx }, orgUnitLocation.OrgUnitNumber)\r\n .then((hours: StoreHours) => {\r\n const availability: OrgUnitAvailability = {\r\n OrgUnitLocation: orgUnitLocation\r\n };\r\n\r\n if (hours && !(hours instanceof Error)) {\r\n return { OrgUnitAvailability: availability, StoreHours: hours, OrgUnitPickUpDeliveryModes: channelDeleiveryOptions };\r\n }\r\n\r\n return { OrgUnitAvailability: availability, OrgUnitPickUpDeliveryModes: channelDeleiveryOptions };\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace('[GetFullAvailableInventoryNearby] error getting availability with hours');\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug(`[GetFullAvailableInventoryNearby] error getting availability with hours`);\r\n return { OrgUnitAvailability: {} };\r\n });\r\n}\r\n\r\n/**\r\n * Action method that obtains the store information\r\n * @param channelCollection The org unit channel Id list\r\n * @param ctx The action context\r\n */\r\n// VSI Customization Start\r\n// Need to comment this function because we removed featuresState data-action import.\r\n// async function _getLocationPickUpDeliveryModes(\r\n// channelCollection: (number| undefined)[],\r\n// ctx: IActionContext): Promise {\r\n// if (channelCollection?.length === 0 || channelCollection === undefined) {\r\n// return undefined;\r\n// }\r\n\r\n// const channelIdList: number[] = [];\r\n// channelCollection?.map(id => {\r\n// if(id !== undefined) {\r\n// return channelIdList.push(id);\r\n// }\r\n// return null;\r\n// });\r\n\r\n// // to get all channel pickup delivery mode filterOption should be 4\r\n// return getChannelDeliveryOptionsAsync({ callerContext: ctx }, channelIdList, 4)\r\n// .then((channelDeliveryOptions: ChannelDeliveryOption[]) => {\r\n\r\n// if (channelDeliveryOptions && !(channelDeliveryOptions instanceof Error)) {\r\n// return channelDeliveryOptions;\r\n// }\r\n\r\n// return undefined;\r\n// })\r\n// .catch((error: Error) => {\r\n// ctx.trace('[GetFullAvailableInventoryNearby][getChannelDeliveryOptionsAsync] error getting availability with channel delivery options');\r\n// ctx.trace(error.message);\r\n// ctx.telemetry.exception(error);\r\n// ctx.telemetry.debug(`[GetFullAvailableInventoryNearby] [getChannelDeliveryOptionsAsync] error getting availability with channel delivery options`);\r\n// return [];\r\n// });\r\n// }\r\n\r\n/**\r\n * The complete getOrgUnitLocationsByArea data action\r\n */\r\nexport const getOrgUnitLocationsByAreaDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-store-location-information',\r\n action: >getOrgUnitLocationsByArea,\r\n input: createGetOrgUnitLocationsByAreaInput\r\n});\r\n\r\nexport default getOrgUnitLocationsByAreaDataAction;\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 { mFIATPInventoryDynamicAsync } from '../actions/CoreProductDataActionExtension.g';\r\nimport {\r\n IMFIATPInventoryDynamicResponse, IMFICartLine, IMFICLDeliveryScheduleParameters\r\n} from '../actions/CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * MfiAtpInventory Input Action\r\n */\r\nexport class MfiAtpInventoryInput implements Msdyn365.IActionInput {\r\n // MfiAtpInventory: Construct the input needed to run the action\r\n public inventoryType: string;\r\n public weeks: number;\r\n public storeId: string;\r\n public page: string;\r\n public requestedDate: string;\r\n public zipCode: string;\r\n public itemLines: IMFICartLine[];\r\n\r\n constructor(inventoryType: string, weeks: number, storeId: string, page: string, requestedDate: string, zipCode: string, itemLines: IMFICartLine[]) {\r\n this.inventoryType = inventoryType;\r\n this.weeks = weeks;\r\n this.storeId = storeId;\r\n this.page = page;\r\n this.requestedDate = requestedDate;\r\n this.zipCode = zipCode;\r\n this.itemLines = itemLines;\r\n }\r\n\r\n // MfiAtpInventory: 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 = () => `MfiAtpInventory`;\r\n public getCacheObjectType = () => 'MfiAtpInventory';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// MfiAtpInventory: Create a data model here or import one to capture the response of the action\r\nexport interface IMfiAtpInventoryData {\r\n text: string;\r\n}\r\n\r\n\r\n/**\r\n * MfiAtpInventory: Use this function to call your action and process the results as needed\r\n */\r\nexport async function mfiAtpInventoryAction(input: MfiAtpInventoryInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: input.inventoryType,\r\n Weeks: input.weeks,\r\n StoreId: input.storeId,\r\n Page: input.page,\r\n RequestedDate: input.requestedDate,\r\n ZipCode: input.zipCode,\r\n ItemLines: input.itemLines\r\n };\r\n\r\n const response = await mFIATPInventoryDynamicAsync({ callerContext: ctx }, requestBody);\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >mfiAtpInventoryAction,\r\n // MfiAtpInventory: Give your data action a unique id\r\n id: 'MfiAtpInventory'\r\n // input: createInput\r\n // MfiAtpInventory: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { IMFIBonusItemsDetailsEntity } from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n/**\r\n * MfrmNotification Input Action\r\n */\r\n\r\nexport class MFIbonusitemsInput implements Msdyn365.IActionInput {\r\n public getCacheKey = () => `mfibonusitems`;\r\n public getCacheObjectType = () => 'mfibonusitems';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nexport interface IMFIBonusItems {\r\n bonusItems: IMFIBonusItemsDetailsEntity[] | undefined;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new MFIbonusitemsInput();\r\n};\r\n\r\nasync function action(input: MFIbonusitemsInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const bonusItems: IMFIBonusItemsDetailsEntity[] | undefined = [];\r\n return bonusItems;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'MFIbonusitems',\r\n input: createInput\r\n});\r\n\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * MfrmNotification Input Action\r\n */\r\n\r\nexport class MfrmNotificationInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\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 = () => `promoCode`;\r\n public getCacheObjectType = () => 'promoCode';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IMfrmNotificationState {\r\n notifications: [INotification];\r\n}\r\n\r\nexport interface INotification {\r\n id?: number | string | undefined;\r\n type?: string;\r\n value?: string | undefined;\r\n status?: string | undefined;\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new MfrmNotificationInput();\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: MfrmNotificationInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const notifications: INotification[] = [];\r\n return notifications;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'MfrmNotification',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaymentCcCardTypes Input Action\r\n */\r\nexport class PaymentCcCardTypesInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\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 = () => `payment-cc-card-types`;\r\n public getCacheObjectType = () => 'payment-cc-card-types';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPaymentCcCardTypesData {\r\n cardType: 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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaymentCcCardTypesInput();\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: PaymentCcCardTypesInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { cardType: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'PaymentCcCardTypes',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { CATEGORY_PAGE_NAME } from '@msdyn365-commerce/runtime-internal/dist/lib/consts';\r\n// @ts-ignore\r\nimport { getProductImageUrls } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types/hydrators/hydrator-action-inputs';\r\n\r\nexport const getProductsByCategoryList = async (input: ProductListInput, context: IActionContext): Promise => {\r\n let categoryId: number;\r\n const urlTokens = context.requestContext.urlTokens;\r\n\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 } else if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME && urlTokens.recordId) {\r\n categoryId = +urlTokens.recordId;\r\n } else if (urlTokens && urlTokens.categories && urlTokens.categories.length > 0) {\r\n categoryId = +urlTokens.categories[0];\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 IncludeAttributes: true\r\n };\r\n\r\n return searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n )\r\n .then((products: ProductSearchResult[]) => {\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\n\r\nexport const getProductsByCategoryListAction = createObservableDataAction({\r\n action: >getProductsByCategoryList,\r\n id: '@msdyn365-commerce/products-by-category'\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 */\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport { IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport { getProductRatingsAsync, searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getElementsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/RecommendationsDataActions.g';\r\nimport {\r\n Cart,\r\n ProductSearchCriteria,\r\n ProductSearchResult,\r\n RecommendationCriteria,\r\n RecommendedElement\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { CATEGORY_PAGE_NAME, PDP_PAGE_NAME, PICKS_FOR_YOU_LIST } from '@msdyn365-commerce/runtime-internal/dist/lib/consts';\r\n// @ts-ignore\r\nimport * as getSimpleProducts from '@msdyn365-commerce/runtime-internal/dist/lib/hydrators/get-simple-products';\r\n// @ts-ignore\r\n// tslint:disable-next-line:no-duplicate-imports\r\nimport { ProductInput } from '@msdyn365-commerce/runtime-internal/dist/lib/hydrators/get-simple-products';\r\n// @ts-ignore\r\nimport { getProductImageUrls, orderProductSearchResults } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types/hydrators/hydrator-action-inputs';\r\nimport * as semver from 'semver';\r\n\r\nconst actionInputError = (missingType: string) => {\r\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRecommendationId action`);\r\n};\r\n\r\nconst enum CartTokenPrefix {\r\n Auth = 't',\r\n Anon = 'p'\r\n}\r\n\r\nconst MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS = '9.16.8';\r\n\r\n/**\r\n * Constructs the category context for a recommendation call. If page context is selected the category dervided from page context\r\n * (current page) will be used. If instead a spefic category is chosen as context that category will be used instead.\r\n *\r\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\r\n * @param input The ProductListInput provided to the action\r\n * @param context The current action context\r\n */\r\nconst getCategoryIdForReco = (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\r\n let categoryIds: number[] = [];\r\n\r\n if (input.listMetadata.includePageContext || !input.listMetadata.categoryIds || input.listMetadata.categoryIds.length === 0) {\r\n const urlTokens = context.requestContext.urlTokens;\r\n\r\n if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME) {\r\n if (urlTokens.recordId) {\r\n categoryIds = [+urlTokens.recordId];\r\n }\r\n }\r\n } else {\r\n // Use category from a specific context if provided\r\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\r\n categoryIds = input.listMetadata.categoryIds;\r\n }\r\n }\r\n\r\n recommendationCriteria.CategoryIds = categoryIds;\r\n};\r\n\r\n/**\r\n * Fetches the current active cart to be used when cart context\r\n * is selected for a reco list\r\n *\r\n * @param ctx The current action context\r\n */\r\nconst getCart = async (ctx: IActionContext): Promise => {\r\n let cart;\r\n if (ctx.requestContext && ctx.requestContext.cookies) {\r\n const cookies = ctx.requestContext && ctx.requestContext.cookies;\r\n const cartCookie = cookies.getCartCookie();\r\n const cartCookieParts = cartCookie.split(':');\r\n if (cartCookieParts && cartCookieParts.length === 2) {\r\n if (\r\n (ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\r\n (!ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\r\n ) {\r\n const readCart = await readAsync({ callerContext: ctx }, cartCookieParts[1]);\r\n if (readCart && readCart.Id) {\r\n cart = readCart;\r\n }\r\n }\r\n }\r\n }\r\n return cart;\r\n};\r\n\r\n/**\r\n * Constructs the product context for a recommendation call. If cart context is selected, products currently in the active cart will\r\n * be used as the product ids for the recommendation call. Otherwise, if page context is selected the product derived from page context will be used.\r\n * Finally, if specific context is selected, a product id will be given to us from the ProductListInput which will be used to seed the product id for the reco call.\r\n *\r\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\r\n * @param input The ProductListInput provided to the action\r\n * @param context The current action context\r\n */\r\nconst getProductIdForReco = async (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\r\n let productIds: number[] = [];\r\n // If include cart is set true, fetch the product ids in the cart to append to the product ID list for the recommendation call\r\n if (input.listMetadata.includeCart) {\r\n const cart = await getCart(context);\r\n if (cart && cart.CartLines) {\r\n const validCartLines = cart.CartLines.filter(element => element.ProductId !== undefined);\r\n const cartProductIds = validCartLines.map(product => product.ProductId);\r\n context.telemetry.debug(`Products in cart: ${cartProductIds}`);\r\n // If the cart isn't empty, assign the products in the cart to the productIds for seeding\r\n if (cartProductIds && cartProductIds.length > 0) {\r\n // @ts-ignore compiler alerts that cartProductIds is of type (number | undefined)[]\r\n // however, we filter on undefined product ids first before mapping on product ids so each element must be defined\r\n productIds = cartProductIds;\r\n }\r\n }\r\n } else if (input.listMetadata.includePageContext || !input.listMetadata.productIds || input.listMetadata.productIds.length === 0) {\r\n const urlTokens = context.requestContext.urlTokens;\r\n\r\n if (urlTokens && urlTokens.recordId && urlTokens.pageType && urlTokens.pageType.toLowerCase() === PDP_PAGE_NAME) {\r\n productIds = [+urlTokens.recordId];\r\n }\r\n } else {\r\n // Use the product from specfic context\r\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\r\n productIds = [input.listMetadata.productIds[0]];\r\n }\r\n }\r\n\r\n recommendationCriteria.ProductIds = productIds;\r\n};\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nexport const getProductsByRecommendationList = async (input: ProductListInput, context: IActionContext): Promise => {\r\n // If the recommendation list is picks for you and the user is not signed do not make the reco API call and return empty list of products\r\n const customerAccountNumber =\r\n context.requestContext && context.requestContext.user && context.requestContext.user.customerAccountNumber;\r\n if (input.listMetadata.recommendationListId === PICKS_FOR_YOU_LIST && !customerAccountNumber) {\r\n return [];\r\n }\r\n\r\n const recommendationCriteria: RecommendationCriteria = {};\r\n const proxyContext: IContext = { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } };\r\n recommendationCriteria.CatalogId = input.catalogId;\r\n\r\n let reccomendationListId = '';\r\n if (input.listMetadata.recommendationListId) {\r\n reccomendationListId = input.listMetadata.recommendationListId;\r\n } else {\r\n actionInputError(`recommendationListId (from listmetadata)`);\r\n }\r\n\r\n getCategoryIdForReco(recommendationCriteria, input, context);\r\n await getProductIdForReco(recommendationCriteria, input, context);\r\n\r\n if ((input.listMetadata.personalization || reccomendationListId === PICKS_FOR_YOU_LIST) && customerAccountNumber) {\r\n recommendationCriteria.CustomerAccountNumber = customerAccountNumber;\r\n proxyContext.bypassCache = 'get';\r\n }\r\n\r\n context.telemetry.debug(`Recommendation Criteria: ${JSON.stringify(recommendationCriteria)}`);\r\n\r\n // @ts-ignore\r\n return (\r\n getElementsAsync(proxyContext, reccomendationListId, recommendationCriteria)\r\n .then(async (recommendedElements: RecommendedElement[]) => {\r\n if (recommendedElements) {\r\n const productInputs: ProductInput[] = [];\r\n const productTypeId: string[] = [];\r\n // Grab all the elements that are products and store the product ids\r\n for (let i = 0; i < recommendedElements.length; i++) {\r\n const element = recommendedElements[i];\r\n // Element type value of 1 indicates product type\r\n if (element.ElementId && element.ElementTypeValue === 1) {\r\n productInputs[i] = new ProductInput(+element.ElementId, context.requestContext.apiSettings);\r\n productTypeId[i] = element.ElementId;\r\n }\r\n }\r\n context.telemetry.debug(`Running recommendation action for list ${input.listMetadata.recommendationListId}`);\r\n context.telemetry.debug(`Number of products returned: ${productTypeId.length}`);\r\n context.telemetry.debug('Product ids returned', productTypeId);\r\n\r\n if (productInputs.length) {\r\n // Check to see if retail proxy version is greater than min version required for new API\r\n if (\r\n semver.gte(\r\n semver.coerce(context.requestContext.apiSettings.retailServerProxyVersion) || '',\r\n MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS\r\n )\r\n ) {\r\n const itemIds: number[] = productInputs.map(value => value.productId);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: itemIds,\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n let productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\r\n productSearchResults = orderProductSearchResults(itemIds, productSearchResults);\r\n return productSearchResults;\r\n }\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n }\r\n }\r\n\r\n // Get Product Ratings Block (If needed)\r\n const productRatingsPromise = getProductRatingsAsync(\r\n { callerContext: context },\r\n productInputs.map(productInput => productInput.productId)\r\n );\r\n\r\n return getSimpleProducts(productInputs, context).then((products: ProductSearchResult[]) => {\r\n getProductImageUrls(products, context.requestContext.apiSettings);\r\n products = orderProductSearchResults(\r\n productInputs.map(value => value.productId),\r\n products\r\n );\r\n return productRatingsPromise.then(productRatings => {\r\n productRatings.forEach(productRating => {\r\n const unratedProduct: ProductSearchResult = (\r\n products.find(mappedProduct => mappedProduct.RecordId === productRating.ProductId)\r\n );\r\n if (unratedProduct) {\r\n unratedProduct.TotalRatings = productRating.TotalRatings;\r\n unratedProduct.AverageRating = productRating.AverageRating;\r\n }\r\n });\r\n\r\n return products;\r\n });\r\n });\r\n }\r\n }\r\n return [];\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((error: any) => {\r\n context.telemetry.error(`Error running productByRecommendation action: ${error}`);\r\n throw new Error(error);\r\n })\r\n );\r\n};\r\n\r\nexport const getProductsByRecommendationListAction = createObservableDataAction({\r\n action: >getProductsByRecommendationList,\r\n id: '@msdyn365-commerce/products-by-recommendation'\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 */\r\n\r\n// @ts-ignore\r\nimport * as semver from 'semver';\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n getByIdAsync,\r\n getRelatedProductsAsync,\r\n searchByCriteriaAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { getProductImageUrls, orderProductSearchResults } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types';\r\n\r\nconst MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS = '9.16.8';\r\n\r\nconst actionInputError = (missingType: string) => {\r\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRelationship action`);\r\n};\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nexport const getProductsByRelationshipIdList = async (input: ProductListInput, context: IActionContext): Promise => {\r\n let productId;\r\n let relationshipId;\r\n // Grab the product ID from the list meta data or context\r\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\r\n const productResponse: SimpleProduct | SimpleProduct[] = await getByIdAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n input.listMetadata.productIds[0],\r\n input.channelId\r\n );\r\n const baseProduct: SimpleProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n productId = input.listMetadata.productIds[0];\r\n if (baseProduct.hasOwnProperty('MasterProductId') && baseProduct.MasterProductId && baseProduct.MasterProductId > 0) {\r\n productId = baseProduct.MasterProductId;\r\n }\r\n } else if (context.requestContext.urlTokens && context.requestContext.urlTokens.itemId) {\r\n const productResponse = await getByIdAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n +context.requestContext.urlTokens.itemId,\r\n input.channelId\r\n );\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n productId = +context.requestContext.urlTokens.itemId;\r\n if (baseProduct.hasOwnProperty('MasterProductId') && baseProduct.MasterProductId > 0) {\r\n productId = baseProduct.MasterProductId;\r\n }\r\n } else {\r\n actionInputError('productId');\r\n }\r\n // The relationship ID must be provided with the list meta data\r\n if (input.listMetadata.relationshipId) {\r\n relationshipId = +input.listMetadata.relationshipId;\r\n } else {\r\n actionInputError('relationshipId');\r\n }\r\n context.telemetry.debug(`Product Id input to productByRelationship action: ${productId}`);\r\n context.telemetry.debug(`Relationship Id input to productByRelationship action: ${relationshipId}`);\r\n\r\n return getRelatedProductsAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n // @ts-ignore\r\n productId,\r\n input.channelId,\r\n input.catalogId,\r\n // @ts-ignore\r\n relationshipId\r\n ).then(\r\n /*VSI Customization - START\r\n This data-action is customized as per Microsoft's guidance to use searchByCriteriaAsync call to get\r\n product attributes for related to products product-collection list\r\n */\r\n async (products: ProductSearchResult[]) => {\r\n context.telemetry.debug('Products returned by getRelatedProducts action', products);\r\n if (products.length) {\r\n if (\r\n semver.gte(\r\n semver.coerce(context.requestContext.apiSettings.retailServerProxyVersion) || '',\r\n MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS\r\n )\r\n ) {\r\n const itemIds: number[] = products.map(value => value.RecordId);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: itemIds,\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n let productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\r\n productSearchResults = orderProductSearchResults(itemIds, productSearchResults);\r\n return productSearchResults;\r\n }\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n }\r\n }\r\n return getProductImageUrls(products, context.requestContext.apiSettings);\r\n }\r\n }\r\n )\r\n // @ts-ignore\r\n .catch(error => {\r\n context.telemetry.error(`Error running productByRecommendation action: ${error}`);\r\n throw new Error(error);\r\n });\r\n /*VSI Customization - END*/\r\n};\r\n\r\nexport const getProductsByRelationshipIdListAction = createObservableDataAction({\r\n action: >getProductsByRelationshipIdList,\r\n id: '@msdyn365-commerce/products-by-relationship-id'\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType, QueryResultSettings, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * GetProductById Input Action\r\n */\r\n\r\nexport class GetProductsByIdInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public productIdsArr: number[];\r\n\r\n public channelId: number;\r\n public queryResultSettings: QueryResultSettings;\r\n constructor(productIdsArr: number[], channelId: number, queryResultSettings: QueryResultSettings) {\r\n this.productIdsArr = productIdsArr;\r\n this.channelId = channelId;\r\n this.queryResultSettings = queryResultSettings;\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\r\n public getCacheKey = () =>\r\n `Get-Products-By-Id-${this.productIdsArr && this.productIdsArr.length >= 1 ? this.productIdsArr.join('-') : ''}`;\r\n public getCacheObjectType = () => 'GetProductsById';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\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 getProductsByIdAction(input: GetProductsByIdInput, ctx: IActionContext): Promise {\r\n if (input.productIdsArr && input.productIdsArr.length >= 1) {\r\n const ctxObject = { callerContext: ctx, queryResultSettings: input.queryResultSettings, bypass: 'none' };\r\n let result;\r\n try {\r\n result = await getByIdsAsync(ctxObject, input.channelId, input.productIdsArr);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('error', error);\r\n }\r\n }\r\n return null;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getProductsByIdAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetProductsById'\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * ProgressiveLeasingModalState Input Action\r\n */\r\nexport class ProgressiveLeasingModalStateInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() { }\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 = () => `ProgressiveLeasingModalState`;\r\n public getCacheObjectType = () => 'ProgressiveLeasingModalState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IProgressiveLeasingModalStateData {\r\n isOpen: boolean;\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ProgressiveLeasingModalStateInput();\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: ProgressiveLeasingModalStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isOpen: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'ProgressiveLeasingModalState',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IPromoCodeAppliedOnCartState {\r\n isInProcess?: boolean;\r\n}\r\n\r\n/**\r\n * SampleState - action input\r\n */\r\nexport class PromoCodeAppliedOnCartInput implements IActionInput {\r\n public getCacheKey = () => `PromoCodeAppliedOnCartInput`;\r\n public getCacheObjectType = () => 'PromoCodeAppliedOnCartInput';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * SampleState - action\r\n */\r\nexport async function updatePromoCodeAppliedOnCartProgressAction(input: PromoCodeAppliedOnCartInput, ctx: IActionContext): Promise {\r\n return { isInProcess: undefined };\r\n}\r\n\r\n/**\r\n * SampleState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new PromoCodeAppliedOnCartInput();\r\n};\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updatePromoCodeAppliedOnCartProgressAction,\r\n input: createInput\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\n\r\n/**\r\n * RedirectToWmapSubmitPayment Input Action\r\n */\r\nexport class RedirectToWmapSubmitPaymentInput implements Msdyn365.IActionInput {\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `RedirectToWmapSubmitPayment`;\r\n public getCacheObjectType = () => 'RedirectToWmapSubmitPayment';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nexport interface IRedirectToWmapSubmitPaymentData {\r\n redirectToWmapSubmitPayment: boolean;\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 = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new RedirectToWmapSubmitPaymentInput();\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: RedirectToWmapSubmitPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { redirectToWmapSubmitPayment: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'RedirectToWmapSubmitPayment',\r\n input: createInput\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { createObservableDataAction, IAction, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { IDataServiceRequest, retailAction } from '@msdyn365-commerce/retail-proxy/dist';\r\nimport { createSearchOrgUnitLocationsInput } from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\r\nimport { ProductSearchResult, QueryResultSettings } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n\r\nexport const buildQueryResultSettings = (inputData: ICreateActionContext, IGeneric>): QueryResultSettings => {\r\n try {\r\n // not using this data-action for now, so overriding Top value to 4.\r\n // incase original functionality is required please remove this file.\r\n return { Paging: { Top: 4, Skip: 0 } };\r\n } catch {\r\n return {};\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Search Org Unit Locations action createInput method.\r\n * @param inputData\r\n */\r\nexport function createSearchOrgUnitLocationsInputFunc(inputData: ICreateActionContext, IGeneric>): IDataServiceRequest {\r\n return createSearchOrgUnitLocationsInput(buildQueryResultSettings(inputData), {});\r\n}\r\n\r\nexport const retailActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/search-org-unit-locations',\r\n action: >retailAction,\r\n input: createSearchOrgUnitLocationsInputFunc\r\n});\r\n\r\nexport default retailActionDataAction;\r\n\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IUpdateEmailCart {\r\n checkEmail: boolean | null;\r\n}\r\n\r\n/**\r\n * SampleState - action input\r\n */\r\nexport class UpdateEmailCartInput implements IActionInput {\r\n public getCacheKey = () => `UpdateEmailCartInput`;\r\n public getCacheObjectType = () => 'UpdateEmailCartInput';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * SampleState - action\r\n */\r\nexport async function updateEmailCartAction(input: UpdateEmailCartInput, ctx: IActionContext): Promise {\r\n return { checkEmail: null };\r\n}\r\n\r\n/**\r\n * SampleState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new UpdateEmailCartInput();\r\n};\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updateEmailCartAction,\r\n input: createInput\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 axios from 'axios';\r\n/**\r\n * WmapGetOrderDetails Input Action\r\n */\r\nexport class WmapGetOrderDetailsInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n private orderDetailsAPIurl: string = '';\r\n private orderId: string = '';\r\n constructor(orderDetailsAPIurl: string, orderId: string) {\r\n super({ shouldCacheOutput: false, cacheObjectType: 'WmapGetOrderDetails', cacheKey: 'WmapGetOrderDetails' });\r\n this.orderDetailsAPIurl = orderDetailsAPIurl;\r\n this.orderId = orderId;\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 getOrderDetailsAPIurl = () => this.orderDetailsAPIurl;\r\n public getOrderId = () => this.orderId;\r\n public getCacheKey = () => `WmapGetOrderDetails`;\r\n public getCacheObjectType = () => 'WmapGetOrderDetails';\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\nexport interface IWmapGetOrderDetailsData {\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\r\n if (inputData.config && inputData.config.orderDetailsAPIurl) {\r\n if (inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.orderId) {\r\n // console.log(\"input data: \" + inputData.requestContext.query.orderId);\r\n return new WmapGetOrderDetailsInput(inputData.config.orderDetailsAPIurl, inputData.requestContext.query.orderId);\r\n } else {\r\n return new WmapGetOrderDetailsInput(inputData.config.orderDetailsAPIurl, '');\r\n }\r\n }\r\n return new WmapGetOrderDetailsInput('', '');\r\n};\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\n// tslint:disable: no-any\r\nasync function action(input: WmapGetOrderDetailsInput, ctx: Msdyn365.IActionContext): Promise {\r\n const apiResponseUrl = ctx.requestContext.apiSettings.baseUrl;\r\n const orderDetailsApiUrl = input.getOrderDetailsAPIurl();\r\n const salesOrderId = input.getOrderId();\r\n const orderIdOun = ctx.requestContext.apiSettings.oun;\r\n const makeaPaymentLink = ctx.requestContext.app.config.wmapPageUrlSuffix?.toLowerCase();\r\n const pathName = ctx.requestContext && ctx.requestContext.url.requestUrl.pathname?.toLowerCase().replace(`/`, '');\r\n try {\r\n if (makeaPaymentLink === pathName) {\r\n const response = await axios.post(`${apiResponseUrl}/${orderDetailsApiUrl}`, {\r\n SalesId: salesOrderId\r\n }, {\r\n headers: {\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n 'oun': orderIdOun,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n return response.data;\r\n } else {\r\n console.log('Make a Payment URL is not Configured or URL is not valid');\r\n }\r\n\r\n } catch (e) {\r\n // TODO: will be removed after unit test and deployment on lower environment\r\n console.log('error for getting Sales Order Balance', e);\r\n }\r\n}\r\n\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'WmapGetOrderDetails',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { CartTenderLine } from '@msdyn365-commerce/retail-proxy';\r\nimport axios from 'axios';\r\n/**\r\n * GetAuthTokenInput Input Action\r\n */\r\nexport interface ISubmitPaymentPayload {\r\n cartId: string,\r\n receiptEmail: string | undefined,\r\n cartTenderLines: CartTenderLine[] | undefined,\r\n cartVersion: number | undefined\r\n}\r\n\r\nexport class WmapSubmitPaymentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n\r\n public submitPaymentAPIurl: string | undefined;\r\n public submitPaymentPayload: ISubmitPaymentPayload | {};\r\n constructor(submitPaymentAPIurl: string | undefined, submitPaymentPayload: ISubmitPaymentPayload | {}) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'wmapauthorizepayment', cacheKey: 'wmapcapturepayment' });\r\n this.submitPaymentAPIurl = submitPaymentAPIurl;\r\n this.submitPaymentPayload = submitPaymentPayload;\r\n }\r\n\r\n public getCacheKey = () => `wmapcapturepayment`;\r\n public getCacheObjectType = () => 'wmapcapturepayment';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n\r\nconst createGetCardPaymentAcceptPointInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.submitPaymentAPIurl) {\r\n return new WmapSubmitPaymentInput(inputData.config.submitPaymentAPIurl, {});\r\n }\r\n return new WmapSubmitPaymentInput('', {});\r\n};\r\n\r\n// tslint:disable: no-any\r\nexport async function WmapSubmitPaymentAction(input: WmapSubmitPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const apiResponseUrl = ctx.requestContext.apiSettings.baseUrl;\r\n const orderIdOun = ctx.requestContext.apiSettings.oun;\r\n try {\r\n const response = await axios.post(`${apiResponseUrl}${input.submitPaymentAPIurl}`,\r\n input.submitPaymentPayload\r\n , {\r\n headers: {\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n 'oun': orderIdOun,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n return response.data;\r\n } catch (e) {\r\n // TODO: will be removed after unit test and deployment on lower environment\r\n console.log('Error for Submit Payment', e);\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >WmapSubmitPaymentAction,\r\n input: createGetCardPaymentAcceptPointInput\r\n});","/* tslint:disable: no-duplicate-imports */\r\nimport { IPageSummaryData } from '@msdyn365-commerce-modules/page-summary';\r\nimport { buildCacheKeyWithUrlTokens, CurrentCategoryInput, getCategoryUrl, getCurrentCategory } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CategoryHierarchy, IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getFriendlyName,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport flatten from 'lodash/flatten';\r\n// VSI customization: 7924 Start\r\nimport getHtmlParserValue from '../../Utilities/get-html-parser-value';\r\nimport { canonicalURL, getSortedVirtualRefinerConfig, getVirtualRefinerNames, regExSpecialChars, removeKeywords } from '../../Utilities/plp-url-utils';\r\nimport getSEOData, { GetSeoDataInput } from '../../data-actions/get-seo-data.action';\r\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductRefiner } from '@msdyn365-commerce/retail-proxy';\r\nimport { IMfrmCategoryPageSummaryConfig } from './mfrm-category-page-summary.props.autogenerated';\r\n// VSI customization: 7924 End\r\n\r\n/** Category Page Summary Input */\r\nexport class MFRMCategoryPageSummaryInput implements IActionInput {\r\n public requestContext: IRequestContext;\r\n public config: IMfrmCategoryPageSummaryConfig;\r\n constructor(config: IMfrmCategoryPageSummaryConfig, requestContext: IRequestContext) {\r\n this.config = config || {};\r\n this.requestContext = requestContext;\r\n }\r\n\r\n public getCacheObjectType = (): string => 'MFRMCategoryPageSummary';\r\n public getCacheKey = (): string => `${buildCacheKeyWithUrlTokens('MFRMCategoryPageSummary', this.requestContext)}-${this.requestContext?.url?.requestUrl?.pathname?.toLowerCase()}`;\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nconst createGetCurrentCategoryInput = (inputData: IActionContext): CurrentCategoryInput => {\r\n if (inputData && inputData.requestContext) {\r\n return new CurrentCategoryInput(inputData.requestContext);\r\n }\r\n\r\n throw new Error('Please specify categoryId query string in request.');\r\n};\r\n\r\nconst _getSEOMetaTagValue = (currentCategory: CategoryHierarchy, keyValue: string) => {\r\n return currentCategory?.ExtensionProperties?.find((attr) => attr.Key === keyValue)?.Value?.StringValue;\r\n};\r\n\r\nconst _getActiveRefiners = (refiners: IProductRefinerHierarchy[], requestContext: IRequestContext, CategoryHierarchy: any): string[] | undefined => {\r\n // get refiners from URL\r\n const configVirtualRefinerNames = getVirtualRefinerNames(requestContext, false);\r\n const filteredRefiners = refiners && refiners.filter((refiner) => {\r\n return refiner.KeyName && configVirtualRefinerNames.indexOf(refiner.KeyName.toLowerCase()) !== -1;\r\n });\r\n // get category slug\r\n let slug = (CategoryHierarchy && CategoryHierarchy.Slug) || '';\r\n let slugArray: string[];\r\n let pathArray: string[];\r\n const sortedConfigValues = getSortedVirtualRefinerConfig(requestContext, false);\r\n if (sortedConfigValues && slug) {\r\n slugArray = slug.split('/').splice(1);\r\n // remove keywords form slugArray\r\n slugArray = removeKeywords(slugArray, requestContext);\r\n // FIX reset slug to without keywords\r\n slug = slugArray.join('/');\r\n // path of URL\r\n let path = requestContext.url.requestUrl.pathname.toLowerCase();\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n path = path.replace(`/${categoryId}`, '');\r\n }\r\n // remove category slug\r\n pathArray = removeKeywords(path.split('\\/').splice(1), requestContext);\r\n path = pathArray.join('\\/');\r\n const removedCategorySlug = path.split(slug).splice(1)[0];\r\n let refinerParts: string[] = [];\r\n if (removedCategorySlug !== '') {\r\n refinerParts = decodeURIComponent(removedCategorySlug).split('/');\r\n }\r\n if (refinerParts && refinerParts.length > 0 && slugArray && slugArray.length > 0) {\r\n // remove duplicates if any from the first url part\r\n slugArray.forEach(_slug => {\r\n refinerParts.forEach(refinerPart => {\r\n const index = slugArray.indexOf(refinerPart);\r\n if (index !== -1) {\r\n slugArray.splice(index, 1);\r\n }\r\n });\r\n });\r\n }\r\n const finalRefinerParts: string[] = [];\r\n refinerParts.forEach(refinerPart => {\r\n refinerPart.split('|').map(item => finalRefinerParts.push(item.includes('-') ? item : item.split('-').join(' ')));\r\n });\r\n refinerParts = finalRefinerParts && flatten(finalRefinerParts);\r\n // setup object with refiner values\r\n const sortedValues: { [key: string]: string[] } = {};\r\n filteredRefiners?.forEach(refinerSet => {\r\n let refinerName = refinerSet.KeyName;\r\n if (refinerName) {\r\n refinerName = refinerName.toLowerCase();\r\n sortedValues[refinerName] = []; // size, brand, price\r\n }\r\n refinerSet.Values.forEach((refiner) => {\r\n refinerParts.forEach((refinerPart) => {\r\n if (refinerName && refiner.LeftValueBoundString &&\r\n (refiner.LeftValueBoundString.toLowerCase().replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-') === refinerPart.toLocaleLowerCase().split('-').join(' ')\r\n || refiner.LeftValueBoundString.toLowerCase().replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-') === refinerPart.toLocaleLowerCase())) {\r\n sortedValues[refinerName].push(refiner.LeftValueBoundString);\r\n } else if (refinerName && refiner.LeftValueBoundString &&\r\n refiner.LeftValueBoundString.toLowerCase() === refinerPart.toLowerCase().split('-').join(' ')) {\r\n sortedValues[refinerName].push(refinerPart);\r\n }\r\n });\r\n });\r\n });\r\n // alpha sort\r\n // @ts-ignore\r\n for (const sortedValue of Object.keys(sortedValues)) {\r\n sortedValues[sortedValue].length > 0 &&\r\n sortedValues[sortedValue].sort((a: string, b: string) => {\r\n if (a < b) {\r\n return -1;\r\n }\r\n if (a > b) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n }\r\n // @ts-ignore\r\n const finalRefiners: string[] = [];\r\n sortedConfigValues.forEach(sortedConfigValue => {\r\n const sortedRefinerName = sortedConfigValue.refinerName.toLowerCase();\r\n if (sortedValues[sortedRefinerName] !== undefined && sortedValues[sortedRefinerName].length > 0) {\r\n // @ts-ignore\r\n finalRefiners.push(sortedValues[sortedRefinerName].join(' '));\r\n }\r\n });\r\n return finalRefiners;\r\n }\r\n return undefined;\r\n};\r\n\r\nasync function getAllRefinersAction(ctx: IActionContext): Promise {\r\n const searchCriteria = {\r\n SearchCondition: '*',\r\n Context: {\r\n ChannelId: ctx.requestContext.apiSettings.channelId,\r\n CatalogId: ctx.requestContext.apiSettings.catalogId\r\n }\r\n };\r\n return getProductSearchRefinersAsync({ callerContext: ctx }, searchCriteria).then(\r\n (productRefiners: ProductRefiner[]) => {\r\n if (!productRefiners) {\r\n ctx.telemetry.error('[getRefinersByCriteriaAction] returned no refiners');\r\n return [];\r\n }\r\n\r\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\r\n\r\n if (result.length === 0) {\r\n ctx.telemetry.error('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\r\n return [];\r\n }\r\n\r\n return result;\r\n }\r\n ).catch((err) => {\r\n console.log('[getRefinersByCriteriaAction Category-page-summary] returned no IProductRefinerHierarchy objects', err);\r\n ctx.telemetry.error(`[getRefinersByCriteriaAction Category-page-summary] returned no IProductRefinerHierarchy objects ${err}`);\r\n return [];\r\n });\r\n}\r\n\r\nasync function getFallbackTitle(context: IActionContext, requestContext: IRequestContext, currentCategory: any): Promise {\r\n let activeRefinerList: string[] | undefined = [];\r\n return getAllRefinersAction(context).then(refiners => {\r\n activeRefinerList = _getActiveRefiners(refiners, requestContext, currentCategory);\r\n const concateTitle = `${activeRefinerList && activeRefinerList?.length > 0 ? activeRefinerList.length === 1 ? ` ${activeRefinerList[0]} ` : ` ${activeRefinerList?.join(' ')} ` : ''}`;\r\n const fallbackTitle = concateTitle && `Shop for${concateTitle}Products | Mattress Firm`;\r\n return fallbackTitle;\r\n }).catch((err) => {\r\n console.log('[getFallbackTitle Category-page-summary] has some errors', err);\r\n context.telemetry.error(`[getFallbackTitle Category-page-summary] has some errors- ${err}`);\r\n return \"\";\r\n });\r\n}\r\n\r\nconst action = async (input: MFRMCategoryPageSummaryInput, context: IActionContext): Promise => {\r\n const { config } = input;\r\n const seoInput = new GetSeoDataInput(context.requestContext.app.config.seoDataUrl || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MA5cA7');\r\n const seoData = await getSEOData(seoInput, context);\r\n const seoPageTitle = seoData && seoData['SEO State'] === 'Active' && seoData['Title Tag'];\r\n const seoPageMetaData = seoData && seoData['SEO State'] === 'Active' && seoData['Meta Description'];\r\n let currentCategory: any;\r\n try {\r\n currentCategory = await getCurrentCategory(createGetCurrentCategoryInput(context), context);\r\n } catch (e) {\r\n // Do nothing, if the action fails fallback to values defined in data\r\n }\r\n if (currentCategory) {\r\n let categoryUrl: string | undefined;\r\n let fallbackTitle;\r\n if (!seoPageTitle) {\r\n fallbackTitle = await getFallbackTitle(context, input.requestContext, currentCategory);\r\n }\r\n const pageTitle = seoPageTitle || fallbackTitle || _getSEOMetaTagValue(currentCategory, 'CategoryPageTitle');\r\n const pageTitleParser = getHtmlParserValue(pageTitle);\r\n\r\n const fallBackMeta = 'Find comfortable mattresses, high quality beds, and accessories from top brands all at great low prices at Mattress Firm';\r\n const categoryPageMetaData = seoPageMetaData || fallBackMeta || _getSEOMetaTagValue(currentCategory, 'CategoryPageMetaData');\r\n const categoryPageMetaDataParser = getHtmlParserValue(categoryPageMetaData);\r\n try {\r\n // reset category's name neutralizedName\r\n const localName = getFriendlyName(context.requestContext.locale, currentCategory.NameTranslations);\r\n const neutralizedName = currentCategory.NeutralizedName || currentCategory.Name;\r\n currentCategory.Name = localName;\r\n currentCategory.NeutralizedName = neutralizedName;\r\n categoryUrl = getCategoryUrl(currentCategory);\r\n // @ts-ignore - TODO: property exits in new version of SDK. Remove once released.\r\n const canonicalDomain = context.requestContext.canonicalDomain;\r\n if (categoryUrl && canonicalDomain) {\r\n categoryUrl = canonicalURL(context.requestContext).toLocaleLowerCase();\r\n } else {\r\n categoryUrl = undefined;\r\n }\r\n } catch (e) {\r\n categoryUrl = undefined;\r\n }\r\n return {\r\n title: pageTitleParser || currentCategory.Name,\r\n description: categoryPageMetaDataParser || '',\r\n sharingImageUrl: currentCategory.OfflineImage,\r\n canonicalUrl: categoryUrl,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n // If the action fails fallback to values defined from data\r\n } else if (config) {\r\n return {\r\n title: config.title,\r\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n } else {\r\n return {};\r\n }\r\n};\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/page-summary/category-page-summary',\r\n action: >action,\r\n input: (args: ICreateActionContext) => {\r\n return new MFRMCategoryPageSummaryInput(args.config, args.requestContext);\r\n }\r\n});\r\n","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/bonus-coupon-details.action';\n binding.dataActions[actionPath] = require('partner/actions/bonus-coupon-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/bonus-item-product.action';\n binding.dataActions[actionPath] = require('partner/actions/bonus-item-product.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/checkout-billing-validity.action';\n binding.dataActions[actionPath] = require('partner/actions/checkout-billing-validity.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/fetch-choose-your-foundation-database.action';\n binding.dataActions[actionPath] = require('partner/actions/fetch-choose-your-foundation-database.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-delivery-fee-update.action';\n binding.dataActions[actionPath] = require('partner/actions/get-delivery-fee-update.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-delivery-message.action';\n binding.dataActions[actionPath] = require('partner/actions/get-delivery-message.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-eyebrow-message.action';\n binding.dataActions[actionPath] = require('partner/actions/get-eyebrow-message.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-mattress-foundations-to-add.action';\n binding.dataActions[actionPath] = require('partner/actions/get-mattress-foundations-to-add.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-mfrm-products-category-paths.action';\n binding.dataActions[actionPath] = require('partner/actions/get-mfrm-products-category-paths.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-recycle-fee-checkout.action';\n binding.dataActions[actionPath] = require('partner/actions/get-recycle-fee-checkout.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-sm-inventory-status.action';\n binding.dataActions[actionPath] = require('partner/actions/get-sm-inventory-status.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-soci-data.action';\n binding.dataActions[actionPath] = require('partner/actions/get-soci-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-try-in-store-info.action';\n binding.dataActions[actionPath] = require('partner/actions/get-try-in-store-info.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-unbxd-product-recommendations.action';\n binding.dataActions[actionPath] = require('partner/actions/get-unbxd-product-recommendations.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/payment-redirect-to-order-confirmation.action';\n binding.dataActions[actionPath] = require('partner/actions/payment-redirect-to-order-confirmation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/paypalsuccesstrigger.action';\n binding.dataActions[actionPath] = require('partner/actions/paypalsuccesstrigger.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/select-your-foundation.action';\n binding.dataActions[actionPath] = require('partner/actions/select-your-foundation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/social-icons-state.action';\n binding.dataActions[actionPath] = require('partner/actions/social-icons-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/srp-breadcrumb-page.action';\n binding.dataActions[actionPath] = require('partner/actions/srp-breadcrumb-page.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/trigger-special-synchrony-financing.action';\n binding.dataActions[actionPath] = require('partner/actions/trigger-special-synchrony-financing.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/update-monthly-payment.action';\n binding.dataActions[actionPath] = require('partner/actions/update-monthly-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/user-defined-promocode.action';\n binding.dataActions[actionPath] = require('partner/actions/user-defined-promocode.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/wmap-address-state.action';\n binding.dataActions[actionPath] = require('partner/actions/wmap-address-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/zip-code-state.action';\n binding.dataActions[actionPath] = require('partner/actions/zip-code-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/zip-code-validation.action';\n binding.dataActions[actionPath] = require('partner/actions/zip-code-validation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/bonuscoupons-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/bonuscoupons-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/brightspot-content-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/brightspot-content-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/financing-offer-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/financing-offer-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-address-from-zipcode.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-address-from-zipcode.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-card-payment-accept-point.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-card-payment-accept-point.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-dimensions-for-selected-variant.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-dimensions-for-selected-variant.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-franchise-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-franchise-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-product-benefit-enhanced-content.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-product-benefit-enhanced-content.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-product-benefits-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-product-benefits-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-promocode-value.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-promocode-value.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-resons-to-buy-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-resons-to-buy-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-sales-order-details-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-sales-order-details-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-selected-variant.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-selected-variant.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-seo-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-seo-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-sleep-disruptor-icons.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-sleep-disruptor-icons.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-store-location-information.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-store-location-information.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfi-atp-inventory.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfi-atp-inventory.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfrm-mfi-bonusitem.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfrm-mfi-bonusitem.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfrm-notification.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfrm-notification.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/payment-cc-card-types.action';\n binding.dataActions[actionPath] = require('partner/data-actions/payment-cc-card-types.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/payment-error-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/payment-error-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-category.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-category.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-recommendation.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-recommendation.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-relationship-id.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-relationship-id.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-get-by-id.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-get-by-id.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/progressive-leasing-modal-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/progressive-leasing-modal-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/promocode-applied-in-progress.action';\n binding.dataActions[actionPath] = require('partner/data-actions/promocode-applied-in-progress.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/redirect-to-wmap-submit-payment.action';\n binding.dataActions[actionPath] = require('partner/data-actions/redirect-to-wmap-submit-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/search-org-unit-locations.action';\n binding.dataActions[actionPath] = require('partner/data-actions/search-org-unit-locations.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/toggle-submit-order-button.action';\n binding.dataActions[actionPath] = require('partner/data-actions/toggle-submit-order-button.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/update-email-call.action';\n binding.dataActions[actionPath] = require('partner/data-actions/update-email-call.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/wmap-get-order-details.action';\n binding.dataActions[actionPath] = require('partner/data-actions/wmap-get-order-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/wmap-submit-payment.action';\n binding.dataActions[actionPath] = require('partner/data-actions/wmap-submit-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-category-page-summary/mfrm-category-page-summary.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-category-page-summary/mfrm-category-page-summary.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-product-page-summary/get-product-recordId.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-product-page-summary/get-product-recordId.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-product-page-summary/mfrm-product-page-summary.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-product-page-summary/mfrm-product-page-summary.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 };","module.exports = React;","module.exports = ReactDOM;"],"names":["canonicalURL","requestContext","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","filteredPath","join","filteredURL","undefined","length","filter","urlPart","indexOf","removeKeywordFromUrl","app","config","removeKeywordFromUrlArray","trim","forEach","_part","removeKeyword","trimmedKeyword","indexOfValue","getSortedVirtualRefinerConfig","isMattressesCategory","appConfigSorted","getVirtualRefinerConfig","appConfig","enableForMattresses","enableForOtherCategories","sort","a","b","order","getVirtualRefinerNames","sortedVirtualRefinerConfig","appConfigRefinerNames","sortedConfig","push","refinerName","urlModifications","async","getVirtualRefinerValues","virtualRefiners","virtualRefinerValues","categoryIdToken","urlTokens","recordId","finalizedUrlParts","plainUrlPart","decodeURIComponent","part","filteredPart","mainRefiner","Values","refinerValue","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","link","linkBase","linkParams","endsWith","linkParam","map","param","filteredLink","includeConfigList","includeConfig","pattern","RegExp","MFIGetBonusItemsParametersExtensionClass","constructor","odataObject","this","CartId","Coupons","i","Id","ExtensionProperties","className","substr","lastIndexOf","concat","EntityClasses","MFIBonusItemsDetailsEntityExtensionClass","Coupon","IsBonusCoupon","CouponMessage","Items","MFIQualifyingItemDetailsExtensionClass","QualifyingItemId","QualifyingProductId","BonusProductQty","parseFloat","BonusItems","MFIBonusItemDetailsExtensionClass","BonusItemId","PrimaryImageUrl","ProductTypeValue","BonusProductId","Name","AdditionToCart","AdjustedPrice","BasePrice","CustomerContextualPrice","DiscountAmount","DiscountTypeValue","DiscountType","DealPriceOrDiscountPercentage","BonusCalculatedDiscountPrice","MFIGetBonusCouponsDetailsResponseExtensionClass","BonusCoupons","MFIBonusCouponsDetailExtensionClass","MFIBonusItemsResponseExtensionClass","BonusItemsDetails","Message","BonusCoupon","BonusCouponMessage","ChildCoupons","bonusItemsQuery","id","key","DataServiceQuery","DataServiceEntities","mFIGetBonusCouponsDetailsAsync","context","bonusCoupons","request","createDataServiceRequestForOperation","bypassCache","returnEntity","createMFIGetBonusCouponsDetailsInput","callActionOrExecute","callerContext","mFIGetBonusItemsDetailAsync","bonusItemParams","createMFIGetBonusItemsDetailInput","BonusCouponDetailsInput","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","input","ctx","bonusCouponDetail","args","BonusItemProductInput","bonusItemProduct","BillingStateInput","BillingStateAction","isBillingFormValid","createObservableDataAction","inputData","FetchChooseYourFoundationDatabaseInput","jsonSrc","data","GetDeliveryFeeUpdateInput","deliveryAmount","GetMattressFoundationsToAddInput","console","log","text","GetCategoryPathsInput","catalogId","productIds","constructedCacheKey","ChannelId","apiSettings","channelId","CatalogId","ids","toString","createGetCategoryPathsInput","Error","getProductsCategoryPathsAction","catPaths","hasArray","productsIter","ProductId","getCategoryPathsAsync","queryResultSettings","Paging","Top","Sorting","err","getCategoryPathsActionDataAction","GetRecycleFeeCheckoutInput","recycleFee","tax","GetATPInventoryStatusInput","isCached","Array","prototype","call","ItemLines","item","VariantRecordId","ZipCode","ItemId","Weeks","RequestedDate","result","mFIATPInventoryStatusAsync","error","cookie","Cookies","zipcode","get","geoLocation","zipCode","GetSociDataInput","searchradius","searchLimit","getZipCode","response","axios","headers","e","lookupRadius","maxNoOfFranchise","MFITryInStoreExtensionClass","StoreId","Products","Limit","Radius","MFITryInStoreInfoResponseExtensionClass","Status","Inventory","createMFIGetTryInStoreInfoInput","tryInStoreProductIDs","storeId","tryInStoresQuery","GetTryInStoreInfoInput","mFIGetTryInStoreInfoAsync","GetUnbxdRecommendationsDataInput","pageType","widgetNumber","productID","catLevels","cartItemIDs","unbxdUid","toUpperCase","unbxdApiKey","unbxdSiteKey","unbxdUrl","catnames","catName","index","categoryLevelName","productitemIds","itemId","SelectYourFoundationInput","foundation","SocialIconsStateInput","socialIconStateAction","copyLinkClick","SrpBreadcrumbPageInput","breadcrumbCheck","TriggerSpecialSynchronyFinancingInput","triggerSpecialFinancing","UserDefinedPromocodeInput","userDefinedPromos","WmapAddressStateInput","preFilledAddress","isAddressUpdate","ZipCodeStateInput","ZipCodeStateAction","isStateValid","ZipCodeValidationInput","ZipcodeValidationAction","isZipcodeValid","BonusCouponsInfoInput","bonusCoupon","getAllBonusCouponsDetails","couponsDetails","telemetry","warning","JSON","stringify","debug","BrightSpotContentInput","brightspotUrl","super","shouldCacheOutput","cacheObjectType","cacheKey","getBrightspotUrl","brightspotPageUrl","GetAddressByZipcodeInput","country","getAddressFromZipCodeAsync","GetDimensionsForSelectedVariantInput","productId","matchingDimensionValues","getDimensionsForSelectedVariantAction","variantId","queryBasedVariantSelection","getQueryParamsFromQueryByName","MsDyn365","URL","window","location","href","activeProduct","ProductsDataActions","Number","isNaN","ArrayExtensions","Dimensions","promises","dimension","shippingInventoryConfiguration","createInventoryAvailabilitySearchCriteria","searchCriteria","RequestedDimensionTypeValue","DimensionTypeValue","MatchingDimensionValues","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","MasterProductId","RecordId","then","dimensionValues","dimensionValuesWithInventory","dimensionValuesResults","Promise","all","newDimension","oldDimension","DimensionValues","value","DimensionValue","getDimensionsForSelectedVariantActionDataAction","getSelectedProductIdFromActionInput","getDimensionValuesFromQuery","GetFranchiseData","_Latitude","_Longitude","_Radius","Latitude","Longitude","getFranchiseInput","getFranchise","jsonUrl","sociFranchiseDataUrl","franchiseDataJson","franchiseStores","franchise","miles","latitude1","longitude1","latitude2","longitude2","long1","Math","PI","long2","lat1","lat2","dlon","dlat","pow","sin","cos","asin","sqrt","_calculateDistance","lat","long","GetProductBenefitsEnhancedContentInput","masterProductID","jsonUrlFromGlobals","productBenefitsEnhancedContentUrl","masterProductid","res","GetProductBenefitsData","productBenefitsDataUrl","getProductBenefitsDataUrl","GetPromocodeValueInput","GetReasonsToBuyDataInput","categoryName","reasonsToBuyJsonUrl","orderTypes","GetSalesOrderWithHydrationsInput","orderType","orderId","buildCacheKey","getSalesOrderWithHydrationsAction","trace","salesOrder","getSalesOrderDetailsBySalesIdAsync","getSalesOrderDetailsByTransactionIdAsync","getSalesOrder","TransactionTypeValue","products","SalesLines","salesLine","productInputs","ProductInput","getSimpleProducts","getProducts","deliveryOptions","getDeliveryOptionsAsync","x","catch","message","exception","getSalesOrderWithHydrationsActionDataAction","salesId","transactionId","query","transaction","GetSeoDataInput","seoDataUrl","getSeoDataUrl","filteredUrlPath","seoData","GetSleepDisruptorIcons","sleepDisuptorIconsDataUrl","getSleepDisuptorIconsDataUrl","sleepDisruptorIconDataUrl","GetOrgUnitLocationsByAreaInput","_DistanceUnitValue","_IgnoreLocation","DistanceUnitValue","IgnoreLocation","createGetOrgUnitLocationsByAreaInput","getOrgUnitLocationsByArea","searchArea","getOrgUnitLocationsByAreaAsync","locationDeliveryOptions","locationPromiseList","stores","store","locationDeliveryOption","find","_channeldeliveryoption","orgUnitLocation","channelDeleiveryOptions","OrgUnitNumber","OrgUnitAvailability","getStoreHoursAsync","hours","availability","OrgUnitLocation","OrgUnitPickUpDeliveryModes","StoreHours","_getLocationWithHours","getOrgUnitLocationsByAreaDataAction","MfiAtpInventoryInput","inventoryType","weeks","page","requestedDate","itemLines","mfiAtpInventoryAction","requestBody","InventoryType","Page","mFIATPInventoryDynamicAsync","MFIbonusitemsInput","MfrmNotificationInput","PaymentCcCardTypesInput","cardType","getProductsByCategoryList","categoryId","listMetadata","categoryIds","CATEGORY_PAGE_NAME","categories","productSearchCriteria","Context","CategoryIds","IncludeAttributes","searchByCriteriaAsync","pageSize","getProductImageUrls","getProductsByCategoryListAction","CartTokenPrefix","getProductIdForReco","recommendationCriteria","includeCart","cart","cookies","cartCookieParts","getCartCookie","user","isAuthenticated","Auth","Anon","readCart","readAsync","getCart","CartLines","cartProductIds","element","product","includePageContext","PDP_PAGE_NAME","ProductIds","getProductsByRecommendationList","customerAccountNumber","recommendationListId","PICKS_FOR_YOU_LIST","proxyContext","reccomendationListId","missingType","actionInputError","getCategoryIdForReco","personalization","CustomerAccountNumber","getElementsAsync","recommendedElements","productTypeId","ElementId","ElementTypeValue","semver","retailServerProxyVersion","itemIds","Ids","SearchCondition","productSearchResults","orderProductSearchResults","productRatingsPromise","getProductRatingsAsync","productInput","productRatings","productRating","unratedProduct","mappedProduct","TotalRatings","AverageRating","getProductsByRecommendationListAction","getProductsByRelationshipIdList","relationshipId","productResponse","getByIdAsync","baseProduct","isArray","hasOwnProperty","getRelatedProductsAsync","getProductsByRelationshipIdListAction","GetProductsByIdInput","productIdsArr","ctxObject","bypass","getByIdsAsync","ProgressiveLeasingModalStateInput","isOpen","PromoCodeAppliedOnCartInput","updatePromoCodeAppliedOnCartProgressAction","isInProcess","RedirectToWmapSubmitPaymentInput","redirectToWmapSubmitPayment","buildQueryResultSettings","Skip","createSearchOrgUnitLocationsInputFunc","createSearchOrgUnitLocationsInput","retailActionDataAction","retailAction","UpdateEmailCartInput","updateEmailCartAction","checkEmail","WmapGetOrderDetailsInput","orderDetailsAPIurl","getOrderDetailsAPIurl","getOrderId","apiResponseUrl","baseUrl","orderDetailsApiUrl","salesOrderId","orderIdOun","oun","makeaPaymentLink","wmapPageUrlSuffix","pathName","SalesId","WmapSubmitPaymentInput","submitPaymentAPIurl","submitPaymentPayload","WmapSubmitPaymentAction","MFRMCategoryPageSummaryInput","buildCacheKeyWithUrlTokens","_getSEOMetaTagValue","currentCategory","keyValue","attr","Key","Value","StringValue","getFallbackTitle","activeRefinerList","getProductSearchRefinersAsync","productRefiners","productRefiner","getAllRefinersAction","refiners","CategoryHierarchy","configVirtualRefinerNames","filteredRefiners","refiner","KeyName","slugArray","pathArray","slug","Slug","sortedConfigValues","removedCategorySlug","refinerParts","_slug","refinerPart","finalRefinerParts","includes","flatten","sortedValues","refinerSet","toLocaleLowerCase","sortedValue","Object","keys","finalRefiners","sortedConfigValue","sortedRefinerName","_getActiveRefiners","concateTitle","seoInput","getSEOData","seoPageTitle","seoPageMetaData","getCurrentCategory","CurrentCategoryInput","createGetCurrentCategoryInput","categoryUrl","fallbackTitle","pageTitle","pageTitleParser","getHtmlParserValue","fallBackMeta","categoryPageMetaData","categoryPageMetaDataParser","localName","getFriendlyName","locale","NameTranslations","neutralizedName","NeutralizedName","getCategoryUrl","canonicalDomain","title","description","sharingImageUrl","OfflineImage","canonicalUrl","faviconUrl","sharingImage","src","binding","modules","dataActions","registerActionId","actionPath","default","exportName","Action","require","__bindings__","packageDataActions","module","exports","React","ReactDOM"],"sourceRoot":""}