@envive-ai/react-hooks 0.2.6-alpha → 0.2.6-alpha-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AmplitudeOperations-zFjk1Mkm.js → AmplitudeOperations-C3i2q2Bn.js} +2 -2
- package/dist/{AmplitudeOperations-CDe6oRn4.cjs → AmplitudeOperations-DcuLn1Zk.cjs} +2 -2
- package/dist/{NewOrgConfig-ChNJ3ZtC.js → NewOrgConfig-BtvujFC8.js} +2 -2
- package/dist/{NewOrgConfig-KHz61ikr.cjs → NewOrgConfig-CHt7Xg4t.cjs} +2 -2
- package/dist/{TrackComponentVisibleEvent-f8ahqV1g.js → TrackComponentVisibleEvent-Be7wfXXY.js} +3 -3
- package/dist/{TrackComponentVisibleEvent-uEzgBXb9.cjs → TrackComponentVisibleEvent-KUihr_y4.cjs} +3 -3
- package/dist/{api-1-73JxnF.js → api-D4HaU2Gf.js} +3 -3
- package/dist/{api-ZNG6wObS.cjs → api-D4Xoibs9.cjs} +3 -3
- package/dist/application/models/graphql/index.cjs +1 -1
- package/dist/application/models/graphql/index.js +1 -1
- package/dist/application/models/guards/api/index.cjs +3 -3
- package/dist/application/models/guards/api/index.js +3 -3
- package/dist/application/models/guards/utils.cjs +1 -1
- package/dist/application/models/guards/utils.js +1 -1
- package/dist/application/models/index.cjs +6 -6
- package/dist/application/models/index.js +6 -6
- package/dist/application/utils/index.cjs +17 -17
- package/dist/application/utils/index.d.cts +1 -1
- package/dist/application/utils/index.d.ts +2 -2
- package/dist/application/utils/index.js +17 -17
- package/dist/{atomStore-DAQvNPkh.js → atomStore-BuopbV9k.js} +1 -1
- package/dist/{atomStore-DD9g7Zw2.cjs → atomStore-CZKe3itM.cjs} +1 -1
- package/dist/atoms/app/index.cjs +17 -17
- package/dist/atoms/app/index.d.cts +7 -7
- package/dist/atoms/app/index.d.ts +6 -6
- package/dist/atoms/app/index.js +17 -17
- package/dist/atoms/atomStore/index.cjs +1 -1
- package/dist/atoms/atomStore/index.js +1 -1
- package/dist/atoms/chat/index.cjs +19 -19
- package/dist/atoms/chat/index.d.cts +32 -32
- package/dist/atoms/chat/index.d.ts +32 -32
- package/dist/atoms/chat/index.js +19 -19
- package/dist/atoms/globalSearch/index.cjs +1 -1
- package/dist/atoms/globalSearch/index.d.cts +6 -6
- package/dist/atoms/globalSearch/index.d.ts +6 -6
- package/dist/atoms/globalSearch/index.js +1 -1
- package/dist/atoms/org/index.cjs +2 -2
- package/dist/atoms/org/index.d.cts +16 -16
- package/dist/atoms/org/index.d.ts +16 -16
- package/dist/atoms/org/index.js +2 -2
- package/dist/atoms/search/index.cjs +6 -6
- package/dist/atoms/search/index.d.cts +15 -15
- package/dist/atoms/search/index.d.ts +14 -14
- package/dist/atoms/search/index.js +6 -6
- package/dist/atoms/search/utils.cjs +1 -1
- package/dist/atoms/search/utils.js +1 -1
- package/dist/{cdnContext-DT6J5nCw.js → cdnContext-B2-NiEiW.js} +2 -2
- package/dist/{cdnContext-BLNiW2HT.cjs → cdnContext-CdhppNeT.cjs} +2 -2
- package/dist/{chat-C0cgfkL8.js → chat-C9KdnT5V.js} +7 -7
- package/dist/{chat-DULmjtx1.cjs → chat-bImNRcnQ.cjs} +7 -7
- package/dist/{chatState-BrSfXIV4.cjs → chatState-DqWSgmjC.cjs} +3 -3
- package/dist/{chatState-Cn8JGAlH.js → chatState-DxG0t4fK.js} +3 -3
- package/dist/contexts/amplitudeContext/index.cjs +17 -17
- package/dist/contexts/amplitudeContext/index.js +17 -17
- package/dist/contexts/cdnContext/index.cjs +4 -4
- package/dist/contexts/cdnContext/index.d.cts +1 -1
- package/dist/contexts/cdnContext/index.js +4 -4
- package/dist/contexts/enviveConfigContext/index.cjs +4 -4
- package/dist/contexts/enviveConfigContext/index.d.cts +1 -1
- package/dist/contexts/enviveConfigContext/index.js +4 -4
- package/dist/contexts/enviveCssContext/index.cjs +14 -14
- package/dist/contexts/enviveCssContext/index.js +14 -14
- package/dist/contexts/featureFlagContext/index.cjs +5 -5
- package/dist/contexts/featureFlagContext/index.js +5 -5
- package/dist/contexts/featureFlagServiceContext/index.cjs +4 -4
- package/dist/contexts/featureFlagServiceContext/index.js +4 -4
- package/dist/contexts/graphqlContext/index.cjs +8 -8
- package/dist/contexts/graphqlContext/index.js +8 -8
- package/dist/contexts/localStorageContext/index.cjs +3 -3
- package/dist/contexts/localStorageContext/index.js +3 -3
- package/dist/contexts/newOrgConfigContext/index.cjs +13 -13
- package/dist/contexts/newOrgConfigContext/index.d.cts +1 -1
- package/dist/contexts/newOrgConfigContext/index.js +13 -13
- package/dist/contexts/searchContext/index.cjs +22 -22
- package/dist/contexts/searchContext/index.js +22 -22
- package/dist/contexts/sessionStorageContext/index.cjs +2 -2
- package/dist/contexts/sessionStorageContext/index.js +2 -2
- package/dist/contexts/systemSettingsContext/index.cjs +4 -4
- package/dist/contexts/systemSettingsContext/index.js +4 -4
- package/dist/contexts/userIdentityContext/index.cjs +17 -17
- package/dist/contexts/userIdentityContext/index.js +17 -17
- package/dist/{dist-BZX_Mgfn.cjs → dist-B7BErEyV.cjs} +1 -1
- package/dist/{dist-CIM4YRqp.js → dist-CtkINi1R.js} +1 -1
- package/dist/{domObserver-DKcas6tl.js → domObserver-B19-69gW.js} +1 -1
- package/dist/{domObserver-Do6RAJdf.cjs → domObserver-CwieVNgj.cjs} +1 -1
- package/dist/{enviveConfig-DrvYlCYG.js → enviveConfig-Be2kZE7j.js} +3 -3
- package/dist/{enviveConfig-DaotBKMS.cjs → enviveConfig-u50Rpz-G.cjs} +3 -3
- package/dist/{enviveConfigContext-BCnzgk4M.js → enviveConfigContext-1oiQuocd.js} +3 -3
- package/dist/{enviveConfigContext--89ejDs5.cjs → enviveConfigContext-kQfHEGdJ.cjs} +3 -3
- package/dist/exceptions/index.cjs +1 -1
- package/dist/exceptions/index.js +1 -1
- package/dist/{exceptions-BiSWJEl2.cjs → exceptions-BjDgLzGi.cjs} +1 -1
- package/dist/{exceptions-DSv0ZaH0.js → exceptions-CUGY31Ua.js} +1 -1
- package/dist/{featureFlagServiceContext-DpdlcjNb.js → featureFlagServiceContext-CPsygiHO.js} +3 -3
- package/dist/{featureFlagServiceContext-BztKnBPk.cjs → featureFlagServiceContext-pPneufeB.cjs} +3 -3
- package/dist/{globalSearch-nmrfGLOn.js → globalSearch-B_v9qfCT.js} +1 -1
- package/dist/{globalSearch-Cpc8egsM.cjs → globalSearch-OiF96VLG.cjs} +1 -1
- package/dist/{graphql-CWNkUHFV.js → graphql-CvAHWmel.js} +1 -1
- package/dist/{graphql-DT-H-lta.cjs → graphql-JaGqsToc.cjs} +1 -1
- package/dist/{graphqlContext-CWulFxxC.js → graphqlContext-BuXJ5DiW.js} +5 -5
- package/dist/{graphqlContext-B181y-sa.cjs → graphqlContext-CU7NIJo7.cjs} +5 -5
- package/dist/hooks/AmplitudeOperations/index.cjs +18 -18
- package/dist/hooks/AmplitudeOperations/index.d.cts +1 -1
- package/dist/hooks/AmplitudeOperations/index.js +18 -18
- package/dist/hooks/AppDetails/index.cjs +20 -20
- package/dist/hooks/AppDetails/index.d.cts +1 -1
- package/dist/hooks/AppDetails/index.js +20 -20
- package/dist/hooks/CdnOperations/index.cjs +4 -4
- package/dist/hooks/CdnOperations/index.d.cts +1 -1
- package/dist/hooks/CdnOperations/index.js +4 -4
- package/dist/hooks/ChatToggle/index.cjs +19 -19
- package/dist/hooks/ChatToggle/index.js +19 -19
- package/dist/hooks/ChatToggleAnalytics/index.cjs +19 -19
- package/dist/hooks/ChatToggleAnalytics/index.js +19 -19
- package/dist/hooks/CustomerSupportHandoff/index.cjs +1 -1
- package/dist/hooks/CustomerSupportHandoff/index.js +1 -1
- package/dist/hooks/ElementObserver/index.cjs +1 -1
- package/dist/hooks/ElementObserver/index.js +1 -1
- package/dist/hooks/GraphQLConfig/index.cjs +9 -9
- package/dist/hooks/GraphQLConfig/index.js +9 -9
- package/dist/hooks/IdentifyUser/index.cjs +17 -17
- package/dist/hooks/IdentifyUser/index.js +17 -17
- package/dist/hooks/ImageResolver/index.cjs +3 -3
- package/dist/hooks/ImageResolver/index.js +3 -3
- package/dist/hooks/LocalStorageOperations/index.cjs +3 -3
- package/dist/hooks/LocalStorageOperations/index.js +3 -3
- package/dist/hooks/MessageFilter/index.cjs +1 -1
- package/dist/hooks/MessageFilter/index.js +1 -1
- package/dist/hooks/NewOrgConfig/index.cjs +14 -14
- package/dist/hooks/NewOrgConfig/index.d.cts +2 -2
- package/dist/hooks/NewOrgConfig/index.d.ts +2 -2
- package/dist/hooks/NewOrgConfig/index.js +14 -14
- package/dist/hooks/Search/index.cjs +31 -31
- package/dist/hooks/Search/index.js +31 -31
- package/dist/hooks/SearchOperations/index.cjs +22 -22
- package/dist/hooks/SearchOperations/index.js +22 -22
- package/dist/hooks/SessionStorageOperations/index.cjs +2 -2
- package/dist/hooks/SessionStorageOperations/index.js +2 -2
- package/dist/hooks/ShopifyUrlOperations/index.d.cts +2 -2
- package/dist/hooks/ShopifyUrlOperations/index.d.ts +2 -2
- package/dist/hooks/SystemSettingsContext/index.cjs +4 -4
- package/dist/hooks/SystemSettingsContext/index.d.cts +3 -3
- package/dist/hooks/SystemSettingsContext/index.d.ts +4 -4
- package/dist/hooks/SystemSettingsContext/index.js +4 -4
- package/dist/hooks/TrackComponentVisibleEvent/index.cjs +18 -18
- package/dist/hooks/TrackComponentVisibleEvent/index.js +18 -18
- package/dist/hooks/UpdateAnalyticsProps/index.cjs +17 -17
- package/dist/hooks/UpdateAnalyticsProps/index.js +17 -17
- package/dist/index-B4cSHxVN.d.ts +1 -1
- package/dist/index-Dzv6WwSZ.d.ts +1 -1
- package/dist/interceptors/index.cjs +1 -1
- package/dist/interceptors/index.js +1 -1
- package/dist/{localStorageContext-DbWl7Row.cjs → localStorageContext-Bb2b_3ue.cjs} +3 -3
- package/dist/{localStorageContext-DSpmlfyr.js → localStorageContext-D2uXKahw.js} +3 -3
- package/dist/{logger-DCs3_11o.js → logger-BMVdhQOV.js} +1 -1
- package/dist/{logger-BF6iGSVd.cjs → logger-BqHq67zN.cjs} +1 -1
- package/dist/{models-DEJUuKYQ.js → models-DmsMlaHT.js} +5 -5
- package/dist/{models-158fyHt9.cjs → models-wh2gh_Qz.cjs} +5 -5
- package/dist/{newOrgConfigAtom-BuQE_zPK.js → newOrgConfigAtom-Dsk0fJNR.js} +1 -1
- package/dist/{newOrgConfigAtom-rrYHmp1b.cjs → newOrgConfigAtom-hs5A1pbZ.cjs} +1 -1
- package/dist/{newOrgConfigContext-C0LzIRJ7.js → newOrgConfigContext-DPUxIF2G.js} +5 -5
- package/dist/{newOrgConfigContext-BVrzYatq.cjs → newOrgConfigContext-lw85mMS-.cjs} +5 -5
- package/dist/nodeSelector-Cj-Xl1LP.d.cts +1 -1
- package/dist/{org-CVjyv-gv.cjs → org-C2kLSSe9.cjs} +1 -1
- package/dist/{org-Ct9Vjv1J.js → org-CIczyLRP.js} +1 -1
- package/dist/{search-DLHzcbfP.js → search-BzXoTgRx.js} +5 -5
- package/dist/{search-C0TAcTeY.cjs → search-D1cU29CV.cjs} +5 -5
- package/dist/{searchContext-Dmtue5QO.js → searchContext-C8DpjnqD.js} +7 -7
- package/dist/{searchContext-l_23fiuP.cjs → searchContext-R_XuFzYe.cjs} +7 -7
- package/dist/{searchServiceAdapter-B0h7psvh.js → searchServiceAdapter-CKc7UXKi.js} +1 -1
- package/dist/{searchServiceAdapter-BclWy4fE.cjs → searchServiceAdapter-pROGm3Rf.cjs} +1 -1
- package/dist/{sessionStorageContext-BOyr7mIM.cjs → sessionStorageContext-ByaTsDUC.cjs} +2 -2
- package/dist/{sessionStorageContext-ClXN9eX4.js → sessionStorageContext-DKE97oMv.js} +2 -2
- package/dist/{systemSettingsContext-CksCdpiU.js → systemSettingsContext-B-FZ8UAg.js} +2 -2
- package/dist/{systemSettingsContext-Cb5kczBD.cjs → systemSettingsContext-J1sny8W8.cjs} +2 -2
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +1 -1
- package/dist/{types-18QXD2rd.cjs → types-1iJ_FnQQ.cjs} +1 -1
- package/dist/{types-DQC1pHqD.js → types-D5du68Vp.js} +1 -1
- package/dist/{useAppDetails-BJFRSYbI.js → useAppDetails-BtK9ZZJs.js} +4 -4
- package/dist/{useAppDetails-Czn-5FzP.cjs → useAppDetails-Bw2jJ39H.cjs} +4 -4
- package/dist/{useGraphQLConfig-BEtX5pDM.cjs → useGraphQLConfig-Dc8h2yyN.cjs} +2 -2
- package/dist/{useGraphQLConfig-Dkcrz1YL.js → useGraphQLConfig-DuLB3tdv.js} +2 -2
- package/dist/{utils-CEKzBcN2.js → utils-B1LVzQYK.js} +1 -1
- package/dist/{utils-CqVRbvfN.cjs → utils-BivlGkeU.cjs} +1 -1
- package/dist/{utils-DQhbbAnt.js → utils-CExht7Uj.js} +1 -1
- package/dist/{utils-CsMbZmRw.cjs → utils-CiJLDPjY.cjs} +1 -1
- package/dist/{utils-CPvqOk0g.cjs → utils-DqNhRm2b.cjs} +14 -14
- package/dist/{utils-N47VsL9W.js → utils-IogJwDB9.js} +13 -13
- package/package.json +1 -1
- package/src/hooks/Search/useSearch.tsx +11 -11
- package/src/hooks/Search/useSearchInput.ts +19 -9
- package/dist/src/application/commerce-api.js +0 -406
- package/dist/src/application/logging/logger.js +0 -16
- package/dist/src/application/models/graphql/index.js +0 -3
- package/dist/src/application/models/graphql/queries/getMerchantColorsQuery.js +0 -13
- package/dist/src/application/models/graphql/queries/getMerchantFrontendConfigQuery.js +0 -13
- package/dist/src/application/models/graphql/queries/getMerchantOrgIdQuery.js +0 -10
- package/dist/src/application/models/guards/api/index.js +0 -12
- package/dist/src/application/models/guards/api/isApiFormResponse.js +0 -59
- package/dist/src/application/models/guards/api/isApiFormSubmittedResponseAttributes.js +0 -22
- package/dist/src/application/models/guards/api/isApiOrderResponseAttributes.js +0 -91
- package/dist/src/application/models/guards/api/isApiOrgConfigResults.js +0 -188
- package/dist/src/application/models/guards/api/isApiOrganizationConfig.js +0 -115
- package/dist/src/application/models/guards/api/isApiPDPEventAttributes.js +0 -16
- package/dist/src/application/models/guards/api/isApiPLPEventAttributes.js +0 -26
- package/dist/src/application/models/guards/api/isApiPageResponseAttributes.js +0 -15
- package/dist/src/application/models/guards/api/isApiProductResponseAttributes.js +0 -65
- package/dist/src/application/models/guards/api/isApiProductSearchAttributes.js +0 -15
- package/dist/src/application/models/guards/api/isApiProductSearchFilterAttributes.js +0 -10
- package/dist/src/application/models/guards/api/isApiQueryTypedEventAttributes.js +0 -4
- package/dist/src/application/models/guards/api/isApiResponse.js +0 -33
- package/dist/src/application/models/guards/api/isApiReviewResponseAttributes.js +0 -22
- package/dist/src/application/models/guards/api/isApiReviewRichInformation.js +0 -23
- package/dist/src/application/models/guards/api/isApiSearchEventAttributes.js +0 -20
- package/dist/src/application/models/guards/api/isApiSuggestion.js +0 -24
- package/dist/src/application/models/guards/api/isApiSuggestionClickedEventAttributes.js +0 -4
- package/dist/src/application/models/guards/api/isApiTextResponseAttributes.js +0 -4
- package/dist/src/application/models/guards/api/isApiUserEvent.js +0 -18
- package/dist/src/application/models/guards/graphQL/isGraphQLColorsConfig.js +0 -41
- package/dist/src/application/models/guards/isBaseEcommerceEvent.js +0 -14
- package/dist/src/application/models/guards/isGA4EcommerceEvent.js +0 -14
- package/dist/src/application/models/guards/isLegacyUAEcommerceEvent.js +0 -14
- package/dist/src/application/models/guards/isMobilePLPChatPlacementParameter.js +0 -4
- package/dist/src/application/models/guards/isSpanxTakeAQuizCtaParameter.js +0 -1
- package/dist/src/application/models/guards/isVariantInfo.js +0 -28
- package/dist/src/application/models/guards/utils.js +0 -34
- package/dist/src/application/models/index.js +0 -34
- package/dist/src/application/models/utils/snakeToCamelTransformer.js +0 -71
- package/dist/src/application/models/utils/stringToFulfillmentDisplayStatusEnumValue.js +0 -65
- package/dist/src/application/models/validators/validateGraphQLColorsConfig.js +0 -9
- package/dist/src/application/models/validators/validateGraphQLFrontendConfig.js +0 -420
- package/dist/src/application/models/validators/validateGraphQLOrgId.js +0 -6
- package/dist/src/application/models/validators/validateMobilePLPChatPlacementParameter.js +0 -9
- package/dist/src/application/models/validators/validateOrgConfigResults.js +0 -44
- package/dist/src/application/models/validators/validateOrganizationConfig.js +0 -34
- package/dist/src/application/models/validators/validateResponse.js +0 -173
- package/dist/src/application/models/validators/validateSuggestion.js +0 -13
- package/dist/src/application/models/validators/validateUserEvent.js +0 -91
- package/dist/src/application/utils/analyticsUtils.js +0 -94
- package/dist/src/application/utils/coreContextToApiContext.js +0 -8
- package/dist/src/application/utils/coreUserEventToApiUserEvent.js +0 -90
- package/dist/src/application/utils/divideArray.js +0 -7
- package/dist/src/application/utils/domObserver.js +0 -85
- package/dist/src/application/utils/elementObserver.js +0 -186
- package/dist/src/application/utils/imageFilter.js +0 -11
- package/dist/src/application/utils/index.js +0 -21
- package/dist/src/application/utils/merchantUtils.js +0 -15
- package/dist/src/application/utils/messageFromFormSubmittedEvent.js +0 -19
- package/dist/src/application/utils/messageFromQueryEvent.js +0 -35
- package/dist/src/application/utils/messageFromResponse.js +0 -123
- package/dist/src/application/utils/messageFromSuggestionEvent.js +0 -27
- package/dist/src/application/utils/mouseEventTypes.js +0 -1
- package/dist/src/application/utils/mutationHelper.js +0 -33
- package/dist/src/application/utils/nextMessageRequestToApiRequest.js +0 -29
- package/dist/src/application/utils/nodeSelector.js +0 -101
- package/dist/src/application/utils/overrides.js +0 -144
- package/dist/src/application/utils/stringUtils.js +0 -47
- package/dist/src/application/utils/supportedEventRequestToApiRequest.js +0 -7
- package/dist/src/application/utils/urlsParser.js +0 -33
- package/dist/src/application/utils/validation.js +0 -5
- package/dist/src/atoms/amplitude/amplitudeTrackEventAtom.js +0 -4
- package/dist/src/atoms/app/index.js +0 -23
- package/dist/src/atoms/app/variant.js +0 -102
- package/dist/src/atoms/atomStore/atomStore.js +0 -28
- package/dist/src/atoms/atomStore/index.js +0 -1
- package/dist/src/atoms/chat/chatState.js +0 -33
- package/dist/src/atoms/chat/form.js +0 -16
- package/dist/src/atoms/chat/index.js +0 -23
- package/dist/src/atoms/chat/lastMessage.js +0 -10
- package/dist/src/atoms/chat/messageQueue.js +0 -68
- package/dist/src/atoms/chat/performanceMetrics.js +0 -70
- package/dist/src/atoms/chat/renderedWidgetRefs.js +0 -24
- package/dist/src/atoms/chat/replies.js +0 -43
- package/dist/src/atoms/chat/suggestions.js +0 -29
- package/dist/src/atoms/envive/enviveConfig.js +0 -67
- package/dist/src/atoms/globalSearch/globalSearch.js +0 -8
- package/dist/src/atoms/globalSearch/index.js +0 -1
- package/dist/src/atoms/org/customerService.js +0 -6
- package/dist/src/atoms/org/graphqlConfig.js +0 -8
- package/dist/src/atoms/org/index.js +0 -4
- package/dist/src/atoms/org/newOrgConfigAtom.js +0 -2
- package/dist/src/atoms/org/orgAnalyticsConfig.js +0 -8
- package/dist/src/atoms/search/index.js +0 -1
- package/dist/src/atoms/search/productFilters.js +0 -163
- package/dist/src/atoms/search/productRetrievalAPI.js +0 -50
- package/dist/src/atoms/search/productRetrievalAdapter.js +0 -14
- package/dist/src/atoms/search/productSorter.js +0 -13
- package/dist/src/atoms/search/searchAPI.js +0 -140
- package/dist/src/atoms/search/searchServiceAdapter.js +0 -14
- package/dist/src/atoms/search/utils.js +0 -15
- package/dist/src/config/index.js +0 -1
- package/dist/src/config/locators/components/chat/entrypoints.js +0 -10
- package/dist/src/config/locators/components/chat/index.js +0 -21
- package/dist/src/config/locators/components/chat/preview.js +0 -11
- package/dist/src/config/locators/components/chat/variants/index.js +0 -12
- package/dist/src/config/locators/components/common/buttons.js +0 -6
- package/dist/src/config/locators/components/common/cards.js +0 -17
- package/dist/src/config/locators/components/common/index.js +0 -4
- package/dist/src/config/locators/components/common/links.js +0 -1
- package/dist/src/config/locators/components/common/tables.js +0 -1
- package/dist/src/config/locators/components/floating-button.js +0 -2
- package/dist/src/config/locators/components/index.js +0 -3
- package/dist/src/config/locators/components/report-issue.js +0 -13
- package/dist/src/config/locators/components/search/index.js +0 -5
- package/dist/src/config/locators/components/shadow-dom.js +0 -1
- package/dist/src/config/locators/embedded.js +0 -20
- package/dist/src/config/locators/index.js +0 -4
- package/dist/src/contexts/amplitudeContext/amplitudeContext.js +0 -292
- package/dist/src/contexts/amplitudeContext/index.js +0 -1
- package/dist/src/contexts/cdnContext/cdnContext.js +0 -28
- package/dist/src/contexts/cdnContext/index.js +0 -1
- package/dist/src/contexts/enviveConfigContext/enviveConfigContext.js +0 -37
- package/dist/src/contexts/enviveConfigContext/index.js +0 -1
- package/dist/src/contexts/enviveCssContext/enviveCssContext.js +0 -31
- package/dist/src/contexts/enviveCssContext/index.js +0 -1
- package/dist/src/contexts/featureFlagContext/featureFlagContext.js +0 -109
- package/dist/src/contexts/featureFlagContext/index.js +0 -1
- package/dist/src/contexts/featureFlagServiceContext/featureFlagServiceContext.js +0 -47
- package/dist/src/contexts/featureFlagServiceContext/index.js +0 -1
- package/dist/src/contexts/graphqlContext/graphqlContext.js +0 -87
- package/dist/src/contexts/graphqlContext/index.js +0 -1
- package/dist/src/contexts/localStorageContext/index.js +0 -1
- package/dist/src/contexts/localStorageContext/localStorageContext.js +0 -95
- package/dist/src/contexts/newOrgConfigContext/index.js +0 -1
- package/dist/src/contexts/newOrgConfigContext/newOrgConfigContext.js +0 -33
- package/dist/src/contexts/searchContext/index.js +0 -1
- package/dist/src/contexts/searchContext/searchContext.js +0 -131
- package/dist/src/contexts/sessionStorageContext/index.js +0 -1
- package/dist/src/contexts/sessionStorageContext/sessionStorageContext.js +0 -43
- package/dist/src/contexts/shopifyUrlContext/index.js +0 -1
- package/dist/src/contexts/shopifyUrlContext/shopifyUrlContext.js +0 -62
- package/dist/src/contexts/systemSettingsContext/index.js +0 -1
- package/dist/src/contexts/systemSettingsContext/systemSettingsContext.js +0 -29
- package/dist/src/contexts/userIdentityContext/index.js +0 -1
- package/dist/src/contexts/userIdentityContext/userIdentityContext.js +0 -118
- package/dist/src/events/index.js +0 -51
- package/dist/src/events/registerAnalyticsListeners.js +0 -32
- package/dist/src/exceptions/index.js +0 -2
- package/dist/src/exceptions/sessionExceptions.js +0 -6
- package/dist/src/exceptions/unsupportedProductExceptions.js +0 -6
- package/dist/src/hooks/AmplitudeOperations/index.js +0 -1
- package/dist/src/hooks/AmplitudeOperations/useAmplitudeOperations.js +0 -24
- package/dist/src/hooks/AppDetails/index.js +0 -1
- package/dist/src/hooks/AppDetails/useAppDetails.js +0 -26
- package/dist/src/hooks/BlockBackButton/index.js +0 -1
- package/dist/src/hooks/BlockBackButton/useBlockBackButton.js +0 -23
- package/dist/src/hooks/CdnOperations/index.js +0 -1
- package/dist/src/hooks/CdnOperations/useCdnOperations.js +0 -13
- package/dist/src/hooks/ChatToggle/index.js +0 -1
- package/dist/src/hooks/ChatToggle/useChatToggle.js +0 -50
- package/dist/src/hooks/ChatToggleAnalytics/index.js +0 -1
- package/dist/src/hooks/ChatToggleAnalytics/useChatToggleAnalytics.js +0 -11
- package/dist/src/hooks/CustomerSupportHandoff/index.js +0 -1
- package/dist/src/hooks/CustomerSupportHandoff/useCustomerSupportHandoff.js +0 -32
- package/dist/src/hooks/Debounce/index.js +0 -1
- package/dist/src/hooks/Debounce/useDebounce.js +0 -13
- package/dist/src/hooks/ElementObserver/index.js +0 -1
- package/dist/src/hooks/ElementObserver/useElementObserver.js +0 -208
- package/dist/src/hooks/GrabAndScroll/index.js +0 -1
- package/dist/src/hooks/GrabAndScroll/useGrabAndScroll.js +0 -105
- package/dist/src/hooks/GraphQLConfig/index.js +0 -1
- package/dist/src/hooks/GraphQLConfig/useGraphQLConfig.js +0 -54
- package/dist/src/hooks/IdentifyUser/index.js +0 -1
- package/dist/src/hooks/IdentifyUser/useIdentifyUser.js +0 -28
- package/dist/src/hooks/ImageResolver/index.js +0 -1
- package/dist/src/hooks/ImageResolver/useImageResolver.js +0 -45
- package/dist/src/hooks/Intersection/index.js +0 -1
- package/dist/src/hooks/Intersection/useIntersection.js +0 -20
- package/dist/src/hooks/IsSmallScreen/index.js +0 -1
- package/dist/src/hooks/IsSmallScreen/useIsSmallScreen.js +0 -16
- package/dist/src/hooks/LocalStorageOperations/index.js +0 -1
- package/dist/src/hooks/LocalStorageOperations/useLocalStorageOperations.js +0 -64
- package/dist/src/hooks/MessageFilter/index.js +0 -1
- package/dist/src/hooks/MessageFilter/useMessageFilter.js +0 -37
- package/dist/src/hooks/MessageScrollObserver/index.js +0 -1
- package/dist/src/hooks/MessageScrollObserver/useMessageScrollObserver.js +0 -35
- package/dist/src/hooks/NewOrgConfig/index.js +0 -1
- package/dist/src/hooks/NewOrgConfig/useNewOrgConfig.js +0 -5
- package/dist/src/hooks/Search/index.js +0 -1
- package/dist/src/hooks/Search/useRecommendedProducts.js +0 -35
- package/dist/src/hooks/Search/useSearch.js +0 -224
- package/dist/src/hooks/Search/useSearchInput.js +0 -183
- package/dist/src/hooks/SearchOperations/index.js +0 -1
- package/dist/src/hooks/SearchOperations/useSearchOperations.js +0 -78
- package/dist/src/hooks/SessionStorageOperations/index.js +0 -1
- package/dist/src/hooks/SessionStorageOperations/useSessionStorageOperations.js +0 -20
- package/dist/src/hooks/ShopifyUrlOperations/index.js +0 -1
- package/dist/src/hooks/ShopifyUrlOperations/useShopifyUrlOperations.js +0 -34
- package/dist/src/hooks/SnapCalculator/index.js +0 -1
- package/dist/src/hooks/SnapCalculator/useSnapCalculator.js +0 -22
- package/dist/src/hooks/SystemSettingsContext/index.js +0 -1
- package/dist/src/hooks/SystemSettingsContext/useSystemSettingsContext.js +0 -9
- package/dist/src/hooks/TrackComponentVisibleEvent/index.js +0 -1
- package/dist/src/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.js +0 -45
- package/dist/src/hooks/UpdateAnalyticsProps/index.js +0 -1
- package/dist/src/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.js +0 -43
- package/dist/src/hooks/utils.js +0 -116
- package/dist/src/interceptors/index.js +0 -1
- package/dist/src/interceptors/useMessageInterceptor.js +0 -24
- package/dist/src/types/ApiResponse.js +0 -1
- package/dist/src/types/FilterAttribute.js +0 -3
- package/dist/src/types/Message.js +0 -24
- package/dist/src/types/Suggestion.js +0 -3
- package/dist/src/types/index.js +0 -4
- package/dist/src/util/colorVar.js +0 -3
- package/dist/src/util/configVersion.js +0 -4
- package/dist/src/util/domInsertion.js +0 -16
- /package/dist/{featureFlagServiceContext-bI7ZLz4r.js → featureFlagServiceContext-CbUOAw5l.js} +0 -0
- /package/dist/{featureFlagServiceContext-B4ash4vz.cjs → featureFlagServiceContext-DSo2brno.cjs} +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { isApiReviewRichInformation } from './isApiReviewRichInformation';
|
|
2
|
-
export const isApiReviewResponseAttributes = (obj) => {
|
|
3
|
-
if (obj == null || typeof obj !== 'object') {
|
|
4
|
-
return false;
|
|
5
|
-
}
|
|
6
|
-
if ('title' in obj && obj.title != null && typeof obj.title !== 'string') {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if ('review' in obj && typeof obj.review !== 'string') {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
if ('reviewer' in obj && typeof obj.reviewer !== 'string') {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
if ('stars' in obj && typeof obj.stars !== 'number') {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
if ('rich_information' in obj && !isApiReviewRichInformation(obj.rich_information)) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const isApiReviewRichInformation = (richInfo) => {
|
|
2
|
-
if (richInfo == null || typeof richInfo !== 'object') {
|
|
3
|
-
return false;
|
|
4
|
-
}
|
|
5
|
-
if ('cons' in richInfo &&
|
|
6
|
-
(!Array.isArray(richInfo.cons) || richInfo.cons.some((con) => typeof con !== 'string'))) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if ('pros' in richInfo &&
|
|
10
|
-
(!Array.isArray(richInfo.pros) || richInfo.pros.some((pro) => typeof pro !== 'string'))) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
if ('review_date' in richInfo && typeof richInfo.review_date !== 'string') {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
if ('reviewer_title' in richInfo && typeof richInfo.reviewer_title !== 'string') {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
if ('product_familiarity' in richInfo && typeof richInfo.product_familiarity !== 'string') {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const isApiSearchAttributes = (data) => {
|
|
2
|
-
if (data == null || typeof data !== 'object') {
|
|
3
|
-
return false;
|
|
4
|
-
}
|
|
5
|
-
if (!('search_term' in data) || typeof data.search_term !== 'string') {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
if ('selected_filters' in data && !Array.isArray(data.selected_filters)) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
if (!!data.search_term) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (!('search_results' in data) ||
|
|
15
|
-
!Array.isArray(data.search_results) ||
|
|
16
|
-
!data.search_results.every((v) => typeof v === 'string')) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
return true;
|
|
20
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SuggestionCategory, } from '@spiffy-ai/commerce-api-client';
|
|
2
|
-
export const isSuggestion = (data) => {
|
|
3
|
-
if (data == null || typeof data !== 'object') {
|
|
4
|
-
return false;
|
|
5
|
-
}
|
|
6
|
-
if (!('id' in data) || typeof data.id !== 'string') {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if (!('category' in data) ||
|
|
10
|
-
typeof data.category !== 'string' ||
|
|
11
|
-
!Object.values(SuggestionCategory).includes(data.category)) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
if (!('created_at' in data) || typeof data.created_at !== 'string') {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
if (!('content' in data) || typeof data.content !== 'string') {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
if ('is_answer' in data && data.is_answer != null && typeof data.is_answer !== 'boolean') {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return true;
|
|
24
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { UserEventCategory } from '@spiffy-ai/commerce-api-client';
|
|
2
|
-
export const isApiUserEvent = (data) => {
|
|
3
|
-
if (data == null || typeof data !== 'object') {
|
|
4
|
-
return false;
|
|
5
|
-
}
|
|
6
|
-
if (!('event_id' in data) || typeof data.event_id !== 'string') {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
if (!('created_at' in data) || typeof data.created_at !== 'string') {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
if (!('category' in data) ||
|
|
13
|
-
typeof data.category !== 'string' ||
|
|
14
|
-
!Object.values(UserEventCategory).includes(data.category)) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
18
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import Logger from 'src/application/logging/logger';
|
|
2
|
-
const REQUIRED_COLOR_FIELDS = [
|
|
3
|
-
'accent_primary',
|
|
4
|
-
'accent_secondary',
|
|
5
|
-
'background_dark',
|
|
6
|
-
'background_light',
|
|
7
|
-
'background_primary',
|
|
8
|
-
'background_saturated',
|
|
9
|
-
'background_secondary',
|
|
10
|
-
'background_secondary_dark',
|
|
11
|
-
'background_tertiary',
|
|
12
|
-
'border_dark',
|
|
13
|
-
'border_light',
|
|
14
|
-
'border_medium',
|
|
15
|
-
'border_outline',
|
|
16
|
-
'text_accent',
|
|
17
|
-
'text_light',
|
|
18
|
-
'text_link',
|
|
19
|
-
'text_primary',
|
|
20
|
-
'text_secondary',
|
|
21
|
-
];
|
|
22
|
-
export const isGraphQLColorsConfig = (data) => {
|
|
23
|
-
if (typeof data !== 'object' || data === null) {
|
|
24
|
-
Logger.logError('Invalid graphql response for colors config', undefined, { data });
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
// Check each required field
|
|
28
|
-
const missingFields = REQUIRED_COLOR_FIELDS.filter((field) => !(field in data) || typeof data[field] !== 'string');
|
|
29
|
-
if (missingFields.length === REQUIRED_COLOR_FIELDS.length) {
|
|
30
|
-
Logger.logError('All color fields are missing or null', undefined);
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
if (missingFields.length > 0) {
|
|
34
|
-
Logger.logError('Missing or invalid color fields', undefined, {
|
|
35
|
-
data,
|
|
36
|
-
missingFields,
|
|
37
|
-
});
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return true;
|
|
41
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if an event is a base Google Analytics ecommerce event.
|
|
3
|
-
*
|
|
4
|
-
* @param data The event to check.
|
|
5
|
-
*
|
|
6
|
-
* @returns True if the event is a base ecommerce event, false otherwise.
|
|
7
|
-
*/
|
|
8
|
-
export const isBaseEcommerceEvent = (data) => data != null &&
|
|
9
|
-
typeof data === 'object' &&
|
|
10
|
-
'ecommerce' in data &&
|
|
11
|
-
data.ecommerce != null &&
|
|
12
|
-
typeof data.ecommerce === 'object' &&
|
|
13
|
-
'event' in data &&
|
|
14
|
-
typeof data.event === 'string';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if an event is a Google Analytics 4 ecommerce event.
|
|
3
|
-
*
|
|
4
|
-
* @param data The event to check.
|
|
5
|
-
*
|
|
6
|
-
* @returns True if the event is a GA4 ecommerce event, false otherwise.
|
|
7
|
-
*/
|
|
8
|
-
export const isGA4EcommerceEvent = (data) => typeof data === 'object' &&
|
|
9
|
-
data != null &&
|
|
10
|
-
'ecommerce' in data &&
|
|
11
|
-
data.ecommerce != null &&
|
|
12
|
-
typeof data.ecommerce === 'object' &&
|
|
13
|
-
'items' in data.ecommerce &&
|
|
14
|
-
Array.isArray(data.ecommerce.items);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if an event is a legacy Universal Analytics ecommerce event.
|
|
3
|
-
*
|
|
4
|
-
* @param data The event to check.
|
|
5
|
-
*
|
|
6
|
-
* @returns True if the event is a legacy UA ecommerce event, false otherwise.
|
|
7
|
-
*/
|
|
8
|
-
export const isLegacyUAEcommerceEvent = (data) => data != null &&
|
|
9
|
-
typeof data === 'object' &&
|
|
10
|
-
'ecommerce' in data &&
|
|
11
|
-
data.ecommerce != null &&
|
|
12
|
-
typeof data.ecommerce === 'object' &&
|
|
13
|
-
'add' in data.ecommerce &&
|
|
14
|
-
typeof data.ecommerce.add === 'object';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const isSpanxTakeAQuizCtaParameter = (value) => value != null && typeof value === 'object' && 'text' in value && typeof value.text === 'string';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { PageVisitCategory } from '@spiffy-ai/commerce-api-client';
|
|
2
|
-
const isPDPVariantInfo = (variantInfo) => 'variant' in variantInfo &&
|
|
3
|
-
variantInfo.variant === 'pdp' &&
|
|
4
|
-
'productId' in variantInfo &&
|
|
5
|
-
typeof variantInfo.productId === 'string';
|
|
6
|
-
const isPLPVariantInfo = (variantInfo) => 'variant' in variantInfo &&
|
|
7
|
-
variantInfo.variant === 'plp' &&
|
|
8
|
-
'plpId' in variantInfo &&
|
|
9
|
-
typeof variantInfo.plpId === 'string';
|
|
10
|
-
const isPageVisitVariantInfo = (variantInfo) => 'variant' in variantInfo &&
|
|
11
|
-
variantInfo.variant === 'page_visit' &&
|
|
12
|
-
'url' in variantInfo &&
|
|
13
|
-
typeof variantInfo.url === 'string' &&
|
|
14
|
-
'pageVisitCategory' in variantInfo &&
|
|
15
|
-
Object.values(PageVisitCategory).includes(variantInfo.pageVisitCategory);
|
|
16
|
-
/**
|
|
17
|
-
* Type guard to check if an object is a valid VariantInfo.
|
|
18
|
-
*
|
|
19
|
-
* @param variantInfo - The unknown object to check.
|
|
20
|
-
*
|
|
21
|
-
* @returns True if the data is a valid VariantInfo object, false otherwise.
|
|
22
|
-
*/
|
|
23
|
-
export const isVariantInfo = (variantInfo) => variantInfo != null &&
|
|
24
|
-
typeof variantInfo === 'object' &&
|
|
25
|
-
'variantId' in variantInfo &&
|
|
26
|
-
(isPDPVariantInfo(variantInfo) ||
|
|
27
|
-
isPLPVariantInfo(variantInfo) ||
|
|
28
|
-
isPageVisitVariantInfo(variantInfo));
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if an object has a property of a specific type
|
|
3
|
-
*
|
|
4
|
-
* @param obj - The object to check
|
|
5
|
-
* @param prop - The property name to check
|
|
6
|
-
* @param type - The expected type of the property
|
|
7
|
-
* @param isOptional - Whether the property is optional (defaults to false)
|
|
8
|
-
*
|
|
9
|
-
* @returns boolean indicating if the object has the property of the specified type
|
|
10
|
-
*/
|
|
11
|
-
export const hasPropertyOfType = (obj, prop, type, isOptional = false) => {
|
|
12
|
-
try {
|
|
13
|
-
if (obj == null || typeof obj !== 'object') {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
// If property is not present, it's valid for an optional property
|
|
17
|
-
if (!(prop in obj)) {
|
|
18
|
-
return isOptional;
|
|
19
|
-
}
|
|
20
|
-
const value = obj[prop];
|
|
21
|
-
// For optional properties, null or undefined values are valid
|
|
22
|
-
if (isOptional && value == null) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
if (type === 'array') {
|
|
26
|
-
return Array.isArray(value);
|
|
27
|
-
}
|
|
28
|
-
return typeof value === type;
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
// swallow the error as it should be reported in more detail by the caller
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// graphql
|
|
2
|
-
export * from './graphql';
|
|
3
|
-
export * from './graphql/queries/getMerchantOrgIdQuery';
|
|
4
|
-
// type guards
|
|
5
|
-
export * from './guards/isBaseEcommerceEvent';
|
|
6
|
-
export * from './guards/isGA4EcommerceEvent';
|
|
7
|
-
export * from './guards/isLegacyUAEcommerceEvent';
|
|
8
|
-
export * from './guards/isMobilePLPChatPlacementParameter';
|
|
9
|
-
export * from './guards/isSpanxTakeAQuizCtaParameter';
|
|
10
|
-
export * from './guards/isVariantInfo';
|
|
11
|
-
export * from './guards/utils';
|
|
12
|
-
export * from './guards/api';
|
|
13
|
-
export * from './guards/api/isApiFormResponse';
|
|
14
|
-
export * from './guards/api/isApiFormSubmittedResponseAttributes';
|
|
15
|
-
export * from './guards/api/isApiOrderResponseAttributes';
|
|
16
|
-
export * from './guards/api/isApiOrganizationConfig';
|
|
17
|
-
export * from './guards/api/isApiOrgConfigResults';
|
|
18
|
-
export * from './guards/api/isApiPageResponseAttributes';
|
|
19
|
-
export * from './guards/api/isApiPLPEventAttributes';
|
|
20
|
-
export * from './guards/api/isApiProductSearchFilterAttributes';
|
|
21
|
-
export * from './guards/graphQL/isGraphQLColorsConfig';
|
|
22
|
-
// utils
|
|
23
|
-
export * from './utils/snakeToCamelTransformer';
|
|
24
|
-
export * from './utils/stringToFulfillmentDisplayStatusEnumValue';
|
|
25
|
-
// validators
|
|
26
|
-
export * from './validators/validateGraphQLColorsConfig';
|
|
27
|
-
export * from './validators/validateGraphQLFrontendConfig';
|
|
28
|
-
export * from './validators/validateGraphQLOrgId';
|
|
29
|
-
export * from './validators/validateMobilePLPChatPlacementParameter';
|
|
30
|
-
export * from './validators/validateOrganizationConfig';
|
|
31
|
-
export * from './validators/validateOrgConfigResults';
|
|
32
|
-
export * from './validators/validateResponse';
|
|
33
|
-
export * from './validators/validateSuggestion';
|
|
34
|
-
export * from './validators/validateUserEvent';
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic utility to transform snake_case object keys to camelCase at runtime.
|
|
3
|
-
* This is the runtime equivalent of the CamelCasedPropertiesDeep type utility.
|
|
4
|
-
*/
|
|
5
|
-
// List of acronyms that should be preserved as uppercase in camelCase and lowercase in snake_case
|
|
6
|
-
const PRESERVED_ACRONYMS = ['PLP', 'PDP', 'SVG'];
|
|
7
|
-
/**
|
|
8
|
-
* Converts a snake_case string to camelCase
|
|
9
|
-
* Handles specific acronyms like PLP and PDP correctly
|
|
10
|
-
*/
|
|
11
|
-
const toCamelCase = (str) => {
|
|
12
|
-
// Pre-process: convert all words that match the PRESERVED_ACRONYMS regex to uppercase
|
|
13
|
-
let processedStr = str;
|
|
14
|
-
for (const acronym of PRESERVED_ACRONYMS) {
|
|
15
|
-
const regex = new RegExp(`_${acronym}_?`, 'gi');
|
|
16
|
-
if (processedStr.match(regex)) {
|
|
17
|
-
processedStr = processedStr.replace(regex, (v) => v.endsWith('_') ? `${acronym}_` : `${acronym}`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return processedStr.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Converts a camelCase string to snake_case
|
|
24
|
-
* Handles consecutive capital letters correctly (e.g., "PDP" -> "pdp", not "p_d_p")
|
|
25
|
-
* Preserves specific acronyms like PLP and PDP as lowercase in snake_case
|
|
26
|
-
*/
|
|
27
|
-
const toSnakeCase = (str) => str
|
|
28
|
-
.replace(/([A-Z])(?=[a-z])/g, '_$1')
|
|
29
|
-
.replace(/([a-z])([A-Z])/g, '$1_$2')
|
|
30
|
-
.toLowerCase()
|
|
31
|
-
.replace(/^_/, '');
|
|
32
|
-
/**
|
|
33
|
-
* Recursively transforms all object keys from snake_case to camelCase
|
|
34
|
-
*/
|
|
35
|
-
export const transformSnakeToCamel = (obj) => {
|
|
36
|
-
if (obj === null || obj === undefined) {
|
|
37
|
-
return obj;
|
|
38
|
-
}
|
|
39
|
-
if (Array.isArray(obj)) {
|
|
40
|
-
return obj.map((val) => transformSnakeToCamel(val));
|
|
41
|
-
}
|
|
42
|
-
if (typeof obj === 'object') {
|
|
43
|
-
const result = {};
|
|
44
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
45
|
-
const camelKey = toCamelCase(key);
|
|
46
|
-
result[camelKey] = transformSnakeToCamel(value);
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
return obj;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Recursively transforms all object keys from camelCase to snake_case
|
|
54
|
-
*/
|
|
55
|
-
export const transformCamelToSnake = (obj) => {
|
|
56
|
-
if (obj === null || obj === undefined) {
|
|
57
|
-
return obj;
|
|
58
|
-
}
|
|
59
|
-
if (Array.isArray(obj)) {
|
|
60
|
-
return obj.map(transformCamelToSnake);
|
|
61
|
-
}
|
|
62
|
-
if (typeof obj === 'object') {
|
|
63
|
-
const result = {};
|
|
64
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
65
|
-
const snakeKey = toSnakeCase(key);
|
|
66
|
-
result[snakeKey] = transformCamelToSnake(value);
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
return obj;
|
|
71
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { FulfillmentDisplayStatus } from '@spiffy-ai/commerce-api-client';
|
|
2
|
-
/**
|
|
3
|
-
* Converts a string to a FulfillmentDisplayStatus enum value.
|
|
4
|
-
*
|
|
5
|
-
* @param status - The string to convert.
|
|
6
|
-
*
|
|
7
|
-
* @returns The FulfillmentDisplayStatus enum value or undefined if the string
|
|
8
|
-
* does not map to a valid enum
|
|
9
|
-
*/
|
|
10
|
-
export const stringToFulfillmentDisplayStatusEnumValue = (status) => {
|
|
11
|
-
switch (status) {
|
|
12
|
-
case 'ATTEMPTED_DELIVERY':
|
|
13
|
-
return FulfillmentDisplayStatus.ATTEMPTED_DELIVERY;
|
|
14
|
-
case 'CANCELED':
|
|
15
|
-
return FulfillmentDisplayStatus.CANCELED;
|
|
16
|
-
case 'CONFIRMED':
|
|
17
|
-
return FulfillmentDisplayStatus.CONFIRMED;
|
|
18
|
-
case 'DELIVERED':
|
|
19
|
-
return FulfillmentDisplayStatus.DELIVERED;
|
|
20
|
-
case 'FAILURE':
|
|
21
|
-
return FulfillmentDisplayStatus.FAILURE;
|
|
22
|
-
case 'FULFILLED':
|
|
23
|
-
return FulfillmentDisplayStatus.FULFILLED;
|
|
24
|
-
case 'IN_TRANSIT':
|
|
25
|
-
return FulfillmentDisplayStatus.IN_TRANSIT;
|
|
26
|
-
case 'LABEL_PRINTED':
|
|
27
|
-
return FulfillmentDisplayStatus.LABEL_PRINTED;
|
|
28
|
-
case 'LABEL_PURCHASED':
|
|
29
|
-
return FulfillmentDisplayStatus.LABEL_PURCHASED;
|
|
30
|
-
case 'LABEL_VOIDED':
|
|
31
|
-
return FulfillmentDisplayStatus.LABEL_VOIDED;
|
|
32
|
-
case 'MARKED_AS_FULFILLED':
|
|
33
|
-
return FulfillmentDisplayStatus.MARKED_AS_FULFILLED;
|
|
34
|
-
case 'NOT_DELIVERED':
|
|
35
|
-
return FulfillmentDisplayStatus.NOT_DELIVERED;
|
|
36
|
-
case 'OUT_FOR_DELIVERY':
|
|
37
|
-
return FulfillmentDisplayStatus.OUT_FOR_DELIVERY;
|
|
38
|
-
case 'PICKED_UP':
|
|
39
|
-
return FulfillmentDisplayStatus.PICKED_UP;
|
|
40
|
-
case 'READY_FOR_PICKUP':
|
|
41
|
-
return FulfillmentDisplayStatus.READY_FOR_PICKUP;
|
|
42
|
-
case 'SUBMITTED':
|
|
43
|
-
return FulfillmentDisplayStatus.SUBMITTED;
|
|
44
|
-
case 'IN_PROGRESS':
|
|
45
|
-
return FulfillmentDisplayStatus.IN_PROGRESS;
|
|
46
|
-
case 'ON_HOLD':
|
|
47
|
-
return FulfillmentDisplayStatus.ON_HOLD;
|
|
48
|
-
case 'OPEN':
|
|
49
|
-
return FulfillmentDisplayStatus.OPEN;
|
|
50
|
-
case 'PARTIALLY_FULFILLED':
|
|
51
|
-
return FulfillmentDisplayStatus.PARTIALLY_FULFILLED;
|
|
52
|
-
case 'PENDING_FULFILLMENT':
|
|
53
|
-
return FulfillmentDisplayStatus.PENDING_FULFILLMENT;
|
|
54
|
-
case 'REQUEST_DECLINED':
|
|
55
|
-
return FulfillmentDisplayStatus.REQUEST_DECLINED;
|
|
56
|
-
case 'RESTOCKED':
|
|
57
|
-
return FulfillmentDisplayStatus.RESTOCKED;
|
|
58
|
-
case 'SCHEDULED':
|
|
59
|
-
return FulfillmentDisplayStatus.SCHEDULED;
|
|
60
|
-
case 'UNFULFILLED':
|
|
61
|
-
return FulfillmentDisplayStatus.UNFULFILLED;
|
|
62
|
-
default:
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// import { ColorMapping, ColorNames } from '../../../../../types/src/colorsConfig';
|
|
2
|
-
// import { isGraphQLColorsConfig } from '../../application/models/guards/graphQL/isGraphQLColorsConfig';
|
|
3
|
-
import { isGraphQLColorsConfig } from "../guards/graphQL/isGraphQLColorsConfig";
|
|
4
|
-
export const validateGraphQLColorsConfig = (data) => {
|
|
5
|
-
if (!isGraphQLColorsConfig(data)) {
|
|
6
|
-
return undefined;
|
|
7
|
-
}
|
|
8
|
-
return undefined;
|
|
9
|
-
};
|