@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.
Files changed (410) hide show
  1. package/dist/{AmplitudeOperations-zFjk1Mkm.js → AmplitudeOperations-C3i2q2Bn.js} +2 -2
  2. package/dist/{AmplitudeOperations-CDe6oRn4.cjs → AmplitudeOperations-DcuLn1Zk.cjs} +2 -2
  3. package/dist/{NewOrgConfig-ChNJ3ZtC.js → NewOrgConfig-BtvujFC8.js} +2 -2
  4. package/dist/{NewOrgConfig-KHz61ikr.cjs → NewOrgConfig-CHt7Xg4t.cjs} +2 -2
  5. package/dist/{TrackComponentVisibleEvent-f8ahqV1g.js → TrackComponentVisibleEvent-Be7wfXXY.js} +3 -3
  6. package/dist/{TrackComponentVisibleEvent-uEzgBXb9.cjs → TrackComponentVisibleEvent-KUihr_y4.cjs} +3 -3
  7. package/dist/{api-1-73JxnF.js → api-D4HaU2Gf.js} +3 -3
  8. package/dist/{api-ZNG6wObS.cjs → api-D4Xoibs9.cjs} +3 -3
  9. package/dist/application/models/graphql/index.cjs +1 -1
  10. package/dist/application/models/graphql/index.js +1 -1
  11. package/dist/application/models/guards/api/index.cjs +3 -3
  12. package/dist/application/models/guards/api/index.js +3 -3
  13. package/dist/application/models/guards/utils.cjs +1 -1
  14. package/dist/application/models/guards/utils.js +1 -1
  15. package/dist/application/models/index.cjs +6 -6
  16. package/dist/application/models/index.js +6 -6
  17. package/dist/application/utils/index.cjs +17 -17
  18. package/dist/application/utils/index.d.cts +1 -1
  19. package/dist/application/utils/index.d.ts +2 -2
  20. package/dist/application/utils/index.js +17 -17
  21. package/dist/{atomStore-DAQvNPkh.js → atomStore-BuopbV9k.js} +1 -1
  22. package/dist/{atomStore-DD9g7Zw2.cjs → atomStore-CZKe3itM.cjs} +1 -1
  23. package/dist/atoms/app/index.cjs +17 -17
  24. package/dist/atoms/app/index.d.cts +7 -7
  25. package/dist/atoms/app/index.d.ts +6 -6
  26. package/dist/atoms/app/index.js +17 -17
  27. package/dist/atoms/atomStore/index.cjs +1 -1
  28. package/dist/atoms/atomStore/index.js +1 -1
  29. package/dist/atoms/chat/index.cjs +19 -19
  30. package/dist/atoms/chat/index.d.cts +32 -32
  31. package/dist/atoms/chat/index.d.ts +32 -32
  32. package/dist/atoms/chat/index.js +19 -19
  33. package/dist/atoms/globalSearch/index.cjs +1 -1
  34. package/dist/atoms/globalSearch/index.d.cts +6 -6
  35. package/dist/atoms/globalSearch/index.d.ts +6 -6
  36. package/dist/atoms/globalSearch/index.js +1 -1
  37. package/dist/atoms/org/index.cjs +2 -2
  38. package/dist/atoms/org/index.d.cts +16 -16
  39. package/dist/atoms/org/index.d.ts +16 -16
  40. package/dist/atoms/org/index.js +2 -2
  41. package/dist/atoms/search/index.cjs +6 -6
  42. package/dist/atoms/search/index.d.cts +15 -15
  43. package/dist/atoms/search/index.d.ts +14 -14
  44. package/dist/atoms/search/index.js +6 -6
  45. package/dist/atoms/search/utils.cjs +1 -1
  46. package/dist/atoms/search/utils.js +1 -1
  47. package/dist/{cdnContext-DT6J5nCw.js → cdnContext-B2-NiEiW.js} +2 -2
  48. package/dist/{cdnContext-BLNiW2HT.cjs → cdnContext-CdhppNeT.cjs} +2 -2
  49. package/dist/{chat-C0cgfkL8.js → chat-C9KdnT5V.js} +7 -7
  50. package/dist/{chat-DULmjtx1.cjs → chat-bImNRcnQ.cjs} +7 -7
  51. package/dist/{chatState-BrSfXIV4.cjs → chatState-DqWSgmjC.cjs} +3 -3
  52. package/dist/{chatState-Cn8JGAlH.js → chatState-DxG0t4fK.js} +3 -3
  53. package/dist/contexts/amplitudeContext/index.cjs +17 -17
  54. package/dist/contexts/amplitudeContext/index.js +17 -17
  55. package/dist/contexts/cdnContext/index.cjs +4 -4
  56. package/dist/contexts/cdnContext/index.d.cts +1 -1
  57. package/dist/contexts/cdnContext/index.js +4 -4
  58. package/dist/contexts/enviveConfigContext/index.cjs +4 -4
  59. package/dist/contexts/enviveConfigContext/index.d.cts +1 -1
  60. package/dist/contexts/enviveConfigContext/index.js +4 -4
  61. package/dist/contexts/enviveCssContext/index.cjs +14 -14
  62. package/dist/contexts/enviveCssContext/index.js +14 -14
  63. package/dist/contexts/featureFlagContext/index.cjs +5 -5
  64. package/dist/contexts/featureFlagContext/index.js +5 -5
  65. package/dist/contexts/featureFlagServiceContext/index.cjs +4 -4
  66. package/dist/contexts/featureFlagServiceContext/index.js +4 -4
  67. package/dist/contexts/graphqlContext/index.cjs +8 -8
  68. package/dist/contexts/graphqlContext/index.js +8 -8
  69. package/dist/contexts/localStorageContext/index.cjs +3 -3
  70. package/dist/contexts/localStorageContext/index.js +3 -3
  71. package/dist/contexts/newOrgConfigContext/index.cjs +13 -13
  72. package/dist/contexts/newOrgConfigContext/index.d.cts +1 -1
  73. package/dist/contexts/newOrgConfigContext/index.js +13 -13
  74. package/dist/contexts/searchContext/index.cjs +22 -22
  75. package/dist/contexts/searchContext/index.js +22 -22
  76. package/dist/contexts/sessionStorageContext/index.cjs +2 -2
  77. package/dist/contexts/sessionStorageContext/index.js +2 -2
  78. package/dist/contexts/systemSettingsContext/index.cjs +4 -4
  79. package/dist/contexts/systemSettingsContext/index.js +4 -4
  80. package/dist/contexts/userIdentityContext/index.cjs +17 -17
  81. package/dist/contexts/userIdentityContext/index.js +17 -17
  82. package/dist/{dist-BZX_Mgfn.cjs → dist-B7BErEyV.cjs} +1 -1
  83. package/dist/{dist-CIM4YRqp.js → dist-CtkINi1R.js} +1 -1
  84. package/dist/{domObserver-DKcas6tl.js → domObserver-B19-69gW.js} +1 -1
  85. package/dist/{domObserver-Do6RAJdf.cjs → domObserver-CwieVNgj.cjs} +1 -1
  86. package/dist/{enviveConfig-DrvYlCYG.js → enviveConfig-Be2kZE7j.js} +3 -3
  87. package/dist/{enviveConfig-DaotBKMS.cjs → enviveConfig-u50Rpz-G.cjs} +3 -3
  88. package/dist/{enviveConfigContext-BCnzgk4M.js → enviveConfigContext-1oiQuocd.js} +3 -3
  89. package/dist/{enviveConfigContext--89ejDs5.cjs → enviveConfigContext-kQfHEGdJ.cjs} +3 -3
  90. package/dist/exceptions/index.cjs +1 -1
  91. package/dist/exceptions/index.js +1 -1
  92. package/dist/{exceptions-BiSWJEl2.cjs → exceptions-BjDgLzGi.cjs} +1 -1
  93. package/dist/{exceptions-DSv0ZaH0.js → exceptions-CUGY31Ua.js} +1 -1
  94. package/dist/{featureFlagServiceContext-DpdlcjNb.js → featureFlagServiceContext-CPsygiHO.js} +3 -3
  95. package/dist/{featureFlagServiceContext-BztKnBPk.cjs → featureFlagServiceContext-pPneufeB.cjs} +3 -3
  96. package/dist/{globalSearch-nmrfGLOn.js → globalSearch-B_v9qfCT.js} +1 -1
  97. package/dist/{globalSearch-Cpc8egsM.cjs → globalSearch-OiF96VLG.cjs} +1 -1
  98. package/dist/{graphql-CWNkUHFV.js → graphql-CvAHWmel.js} +1 -1
  99. package/dist/{graphql-DT-H-lta.cjs → graphql-JaGqsToc.cjs} +1 -1
  100. package/dist/{graphqlContext-CWulFxxC.js → graphqlContext-BuXJ5DiW.js} +5 -5
  101. package/dist/{graphqlContext-B181y-sa.cjs → graphqlContext-CU7NIJo7.cjs} +5 -5
  102. package/dist/hooks/AmplitudeOperations/index.cjs +18 -18
  103. package/dist/hooks/AmplitudeOperations/index.d.cts +1 -1
  104. package/dist/hooks/AmplitudeOperations/index.js +18 -18
  105. package/dist/hooks/AppDetails/index.cjs +20 -20
  106. package/dist/hooks/AppDetails/index.d.cts +1 -1
  107. package/dist/hooks/AppDetails/index.js +20 -20
  108. package/dist/hooks/CdnOperations/index.cjs +4 -4
  109. package/dist/hooks/CdnOperations/index.d.cts +1 -1
  110. package/dist/hooks/CdnOperations/index.js +4 -4
  111. package/dist/hooks/ChatToggle/index.cjs +19 -19
  112. package/dist/hooks/ChatToggle/index.js +19 -19
  113. package/dist/hooks/ChatToggleAnalytics/index.cjs +19 -19
  114. package/dist/hooks/ChatToggleAnalytics/index.js +19 -19
  115. package/dist/hooks/CustomerSupportHandoff/index.cjs +1 -1
  116. package/dist/hooks/CustomerSupportHandoff/index.js +1 -1
  117. package/dist/hooks/ElementObserver/index.cjs +1 -1
  118. package/dist/hooks/ElementObserver/index.js +1 -1
  119. package/dist/hooks/GraphQLConfig/index.cjs +9 -9
  120. package/dist/hooks/GraphQLConfig/index.js +9 -9
  121. package/dist/hooks/IdentifyUser/index.cjs +17 -17
  122. package/dist/hooks/IdentifyUser/index.js +17 -17
  123. package/dist/hooks/ImageResolver/index.cjs +3 -3
  124. package/dist/hooks/ImageResolver/index.js +3 -3
  125. package/dist/hooks/LocalStorageOperations/index.cjs +3 -3
  126. package/dist/hooks/LocalStorageOperations/index.js +3 -3
  127. package/dist/hooks/MessageFilter/index.cjs +1 -1
  128. package/dist/hooks/MessageFilter/index.js +1 -1
  129. package/dist/hooks/NewOrgConfig/index.cjs +14 -14
  130. package/dist/hooks/NewOrgConfig/index.d.cts +2 -2
  131. package/dist/hooks/NewOrgConfig/index.d.ts +2 -2
  132. package/dist/hooks/NewOrgConfig/index.js +14 -14
  133. package/dist/hooks/Search/index.cjs +31 -31
  134. package/dist/hooks/Search/index.js +31 -31
  135. package/dist/hooks/SearchOperations/index.cjs +22 -22
  136. package/dist/hooks/SearchOperations/index.js +22 -22
  137. package/dist/hooks/SessionStorageOperations/index.cjs +2 -2
  138. package/dist/hooks/SessionStorageOperations/index.js +2 -2
  139. package/dist/hooks/ShopifyUrlOperations/index.d.cts +2 -2
  140. package/dist/hooks/ShopifyUrlOperations/index.d.ts +2 -2
  141. package/dist/hooks/SystemSettingsContext/index.cjs +4 -4
  142. package/dist/hooks/SystemSettingsContext/index.d.cts +3 -3
  143. package/dist/hooks/SystemSettingsContext/index.d.ts +4 -4
  144. package/dist/hooks/SystemSettingsContext/index.js +4 -4
  145. package/dist/hooks/TrackComponentVisibleEvent/index.cjs +18 -18
  146. package/dist/hooks/TrackComponentVisibleEvent/index.js +18 -18
  147. package/dist/hooks/UpdateAnalyticsProps/index.cjs +17 -17
  148. package/dist/hooks/UpdateAnalyticsProps/index.js +17 -17
  149. package/dist/index-B4cSHxVN.d.ts +1 -1
  150. package/dist/index-Dzv6WwSZ.d.ts +1 -1
  151. package/dist/interceptors/index.cjs +1 -1
  152. package/dist/interceptors/index.js +1 -1
  153. package/dist/{localStorageContext-DbWl7Row.cjs → localStorageContext-Bb2b_3ue.cjs} +3 -3
  154. package/dist/{localStorageContext-DSpmlfyr.js → localStorageContext-D2uXKahw.js} +3 -3
  155. package/dist/{logger-DCs3_11o.js → logger-BMVdhQOV.js} +1 -1
  156. package/dist/{logger-BF6iGSVd.cjs → logger-BqHq67zN.cjs} +1 -1
  157. package/dist/{models-DEJUuKYQ.js → models-DmsMlaHT.js} +5 -5
  158. package/dist/{models-158fyHt9.cjs → models-wh2gh_Qz.cjs} +5 -5
  159. package/dist/{newOrgConfigAtom-BuQE_zPK.js → newOrgConfigAtom-Dsk0fJNR.js} +1 -1
  160. package/dist/{newOrgConfigAtom-rrYHmp1b.cjs → newOrgConfigAtom-hs5A1pbZ.cjs} +1 -1
  161. package/dist/{newOrgConfigContext-C0LzIRJ7.js → newOrgConfigContext-DPUxIF2G.js} +5 -5
  162. package/dist/{newOrgConfigContext-BVrzYatq.cjs → newOrgConfigContext-lw85mMS-.cjs} +5 -5
  163. package/dist/nodeSelector-Cj-Xl1LP.d.cts +1 -1
  164. package/dist/{org-CVjyv-gv.cjs → org-C2kLSSe9.cjs} +1 -1
  165. package/dist/{org-Ct9Vjv1J.js → org-CIczyLRP.js} +1 -1
  166. package/dist/{search-DLHzcbfP.js → search-BzXoTgRx.js} +5 -5
  167. package/dist/{search-C0TAcTeY.cjs → search-D1cU29CV.cjs} +5 -5
  168. package/dist/{searchContext-Dmtue5QO.js → searchContext-C8DpjnqD.js} +7 -7
  169. package/dist/{searchContext-l_23fiuP.cjs → searchContext-R_XuFzYe.cjs} +7 -7
  170. package/dist/{searchServiceAdapter-B0h7psvh.js → searchServiceAdapter-CKc7UXKi.js} +1 -1
  171. package/dist/{searchServiceAdapter-BclWy4fE.cjs → searchServiceAdapter-pROGm3Rf.cjs} +1 -1
  172. package/dist/{sessionStorageContext-BOyr7mIM.cjs → sessionStorageContext-ByaTsDUC.cjs} +2 -2
  173. package/dist/{sessionStorageContext-ClXN9eX4.js → sessionStorageContext-DKE97oMv.js} +2 -2
  174. package/dist/{systemSettingsContext-CksCdpiU.js → systemSettingsContext-B-FZ8UAg.js} +2 -2
  175. package/dist/{systemSettingsContext-Cb5kczBD.cjs → systemSettingsContext-J1sny8W8.cjs} +2 -2
  176. package/dist/types/index.cjs +1 -1
  177. package/dist/types/index.js +1 -1
  178. package/dist/{types-18QXD2rd.cjs → types-1iJ_FnQQ.cjs} +1 -1
  179. package/dist/{types-DQC1pHqD.js → types-D5du68Vp.js} +1 -1
  180. package/dist/{useAppDetails-BJFRSYbI.js → useAppDetails-BtK9ZZJs.js} +4 -4
  181. package/dist/{useAppDetails-Czn-5FzP.cjs → useAppDetails-Bw2jJ39H.cjs} +4 -4
  182. package/dist/{useGraphQLConfig-BEtX5pDM.cjs → useGraphQLConfig-Dc8h2yyN.cjs} +2 -2
  183. package/dist/{useGraphQLConfig-Dkcrz1YL.js → useGraphQLConfig-DuLB3tdv.js} +2 -2
  184. package/dist/{utils-CEKzBcN2.js → utils-B1LVzQYK.js} +1 -1
  185. package/dist/{utils-CqVRbvfN.cjs → utils-BivlGkeU.cjs} +1 -1
  186. package/dist/{utils-DQhbbAnt.js → utils-CExht7Uj.js} +1 -1
  187. package/dist/{utils-CsMbZmRw.cjs → utils-CiJLDPjY.cjs} +1 -1
  188. package/dist/{utils-CPvqOk0g.cjs → utils-DqNhRm2b.cjs} +14 -14
  189. package/dist/{utils-N47VsL9W.js → utils-IogJwDB9.js} +13 -13
  190. package/package.json +1 -1
  191. package/src/hooks/Search/useSearch.tsx +11 -11
  192. package/src/hooks/Search/useSearchInput.ts +19 -9
  193. package/dist/src/application/commerce-api.js +0 -406
  194. package/dist/src/application/logging/logger.js +0 -16
  195. package/dist/src/application/models/graphql/index.js +0 -3
  196. package/dist/src/application/models/graphql/queries/getMerchantColorsQuery.js +0 -13
  197. package/dist/src/application/models/graphql/queries/getMerchantFrontendConfigQuery.js +0 -13
  198. package/dist/src/application/models/graphql/queries/getMerchantOrgIdQuery.js +0 -10
  199. package/dist/src/application/models/guards/api/index.js +0 -12
  200. package/dist/src/application/models/guards/api/isApiFormResponse.js +0 -59
  201. package/dist/src/application/models/guards/api/isApiFormSubmittedResponseAttributes.js +0 -22
  202. package/dist/src/application/models/guards/api/isApiOrderResponseAttributes.js +0 -91
  203. package/dist/src/application/models/guards/api/isApiOrgConfigResults.js +0 -188
  204. package/dist/src/application/models/guards/api/isApiOrganizationConfig.js +0 -115
  205. package/dist/src/application/models/guards/api/isApiPDPEventAttributes.js +0 -16
  206. package/dist/src/application/models/guards/api/isApiPLPEventAttributes.js +0 -26
  207. package/dist/src/application/models/guards/api/isApiPageResponseAttributes.js +0 -15
  208. package/dist/src/application/models/guards/api/isApiProductResponseAttributes.js +0 -65
  209. package/dist/src/application/models/guards/api/isApiProductSearchAttributes.js +0 -15
  210. package/dist/src/application/models/guards/api/isApiProductSearchFilterAttributes.js +0 -10
  211. package/dist/src/application/models/guards/api/isApiQueryTypedEventAttributes.js +0 -4
  212. package/dist/src/application/models/guards/api/isApiResponse.js +0 -33
  213. package/dist/src/application/models/guards/api/isApiReviewResponseAttributes.js +0 -22
  214. package/dist/src/application/models/guards/api/isApiReviewRichInformation.js +0 -23
  215. package/dist/src/application/models/guards/api/isApiSearchEventAttributes.js +0 -20
  216. package/dist/src/application/models/guards/api/isApiSuggestion.js +0 -24
  217. package/dist/src/application/models/guards/api/isApiSuggestionClickedEventAttributes.js +0 -4
  218. package/dist/src/application/models/guards/api/isApiTextResponseAttributes.js +0 -4
  219. package/dist/src/application/models/guards/api/isApiUserEvent.js +0 -18
  220. package/dist/src/application/models/guards/graphQL/isGraphQLColorsConfig.js +0 -41
  221. package/dist/src/application/models/guards/isBaseEcommerceEvent.js +0 -14
  222. package/dist/src/application/models/guards/isGA4EcommerceEvent.js +0 -14
  223. package/dist/src/application/models/guards/isLegacyUAEcommerceEvent.js +0 -14
  224. package/dist/src/application/models/guards/isMobilePLPChatPlacementParameter.js +0 -4
  225. package/dist/src/application/models/guards/isSpanxTakeAQuizCtaParameter.js +0 -1
  226. package/dist/src/application/models/guards/isVariantInfo.js +0 -28
  227. package/dist/src/application/models/guards/utils.js +0 -34
  228. package/dist/src/application/models/index.js +0 -34
  229. package/dist/src/application/models/utils/snakeToCamelTransformer.js +0 -71
  230. package/dist/src/application/models/utils/stringToFulfillmentDisplayStatusEnumValue.js +0 -65
  231. package/dist/src/application/models/validators/validateGraphQLColorsConfig.js +0 -9
  232. package/dist/src/application/models/validators/validateGraphQLFrontendConfig.js +0 -420
  233. package/dist/src/application/models/validators/validateGraphQLOrgId.js +0 -6
  234. package/dist/src/application/models/validators/validateMobilePLPChatPlacementParameter.js +0 -9
  235. package/dist/src/application/models/validators/validateOrgConfigResults.js +0 -44
  236. package/dist/src/application/models/validators/validateOrganizationConfig.js +0 -34
  237. package/dist/src/application/models/validators/validateResponse.js +0 -173
  238. package/dist/src/application/models/validators/validateSuggestion.js +0 -13
  239. package/dist/src/application/models/validators/validateUserEvent.js +0 -91
  240. package/dist/src/application/utils/analyticsUtils.js +0 -94
  241. package/dist/src/application/utils/coreContextToApiContext.js +0 -8
  242. package/dist/src/application/utils/coreUserEventToApiUserEvent.js +0 -90
  243. package/dist/src/application/utils/divideArray.js +0 -7
  244. package/dist/src/application/utils/domObserver.js +0 -85
  245. package/dist/src/application/utils/elementObserver.js +0 -186
  246. package/dist/src/application/utils/imageFilter.js +0 -11
  247. package/dist/src/application/utils/index.js +0 -21
  248. package/dist/src/application/utils/merchantUtils.js +0 -15
  249. package/dist/src/application/utils/messageFromFormSubmittedEvent.js +0 -19
  250. package/dist/src/application/utils/messageFromQueryEvent.js +0 -35
  251. package/dist/src/application/utils/messageFromResponse.js +0 -123
  252. package/dist/src/application/utils/messageFromSuggestionEvent.js +0 -27
  253. package/dist/src/application/utils/mouseEventTypes.js +0 -1
  254. package/dist/src/application/utils/mutationHelper.js +0 -33
  255. package/dist/src/application/utils/nextMessageRequestToApiRequest.js +0 -29
  256. package/dist/src/application/utils/nodeSelector.js +0 -101
  257. package/dist/src/application/utils/overrides.js +0 -144
  258. package/dist/src/application/utils/stringUtils.js +0 -47
  259. package/dist/src/application/utils/supportedEventRequestToApiRequest.js +0 -7
  260. package/dist/src/application/utils/urlsParser.js +0 -33
  261. package/dist/src/application/utils/validation.js +0 -5
  262. package/dist/src/atoms/amplitude/amplitudeTrackEventAtom.js +0 -4
  263. package/dist/src/atoms/app/index.js +0 -23
  264. package/dist/src/atoms/app/variant.js +0 -102
  265. package/dist/src/atoms/atomStore/atomStore.js +0 -28
  266. package/dist/src/atoms/atomStore/index.js +0 -1
  267. package/dist/src/atoms/chat/chatState.js +0 -33
  268. package/dist/src/atoms/chat/form.js +0 -16
  269. package/dist/src/atoms/chat/index.js +0 -23
  270. package/dist/src/atoms/chat/lastMessage.js +0 -10
  271. package/dist/src/atoms/chat/messageQueue.js +0 -68
  272. package/dist/src/atoms/chat/performanceMetrics.js +0 -70
  273. package/dist/src/atoms/chat/renderedWidgetRefs.js +0 -24
  274. package/dist/src/atoms/chat/replies.js +0 -43
  275. package/dist/src/atoms/chat/suggestions.js +0 -29
  276. package/dist/src/atoms/envive/enviveConfig.js +0 -67
  277. package/dist/src/atoms/globalSearch/globalSearch.js +0 -8
  278. package/dist/src/atoms/globalSearch/index.js +0 -1
  279. package/dist/src/atoms/org/customerService.js +0 -6
  280. package/dist/src/atoms/org/graphqlConfig.js +0 -8
  281. package/dist/src/atoms/org/index.js +0 -4
  282. package/dist/src/atoms/org/newOrgConfigAtom.js +0 -2
  283. package/dist/src/atoms/org/orgAnalyticsConfig.js +0 -8
  284. package/dist/src/atoms/search/index.js +0 -1
  285. package/dist/src/atoms/search/productFilters.js +0 -163
  286. package/dist/src/atoms/search/productRetrievalAPI.js +0 -50
  287. package/dist/src/atoms/search/productRetrievalAdapter.js +0 -14
  288. package/dist/src/atoms/search/productSorter.js +0 -13
  289. package/dist/src/atoms/search/searchAPI.js +0 -140
  290. package/dist/src/atoms/search/searchServiceAdapter.js +0 -14
  291. package/dist/src/atoms/search/utils.js +0 -15
  292. package/dist/src/config/index.js +0 -1
  293. package/dist/src/config/locators/components/chat/entrypoints.js +0 -10
  294. package/dist/src/config/locators/components/chat/index.js +0 -21
  295. package/dist/src/config/locators/components/chat/preview.js +0 -11
  296. package/dist/src/config/locators/components/chat/variants/index.js +0 -12
  297. package/dist/src/config/locators/components/common/buttons.js +0 -6
  298. package/dist/src/config/locators/components/common/cards.js +0 -17
  299. package/dist/src/config/locators/components/common/index.js +0 -4
  300. package/dist/src/config/locators/components/common/links.js +0 -1
  301. package/dist/src/config/locators/components/common/tables.js +0 -1
  302. package/dist/src/config/locators/components/floating-button.js +0 -2
  303. package/dist/src/config/locators/components/index.js +0 -3
  304. package/dist/src/config/locators/components/report-issue.js +0 -13
  305. package/dist/src/config/locators/components/search/index.js +0 -5
  306. package/dist/src/config/locators/components/shadow-dom.js +0 -1
  307. package/dist/src/config/locators/embedded.js +0 -20
  308. package/dist/src/config/locators/index.js +0 -4
  309. package/dist/src/contexts/amplitudeContext/amplitudeContext.js +0 -292
  310. package/dist/src/contexts/amplitudeContext/index.js +0 -1
  311. package/dist/src/contexts/cdnContext/cdnContext.js +0 -28
  312. package/dist/src/contexts/cdnContext/index.js +0 -1
  313. package/dist/src/contexts/enviveConfigContext/enviveConfigContext.js +0 -37
  314. package/dist/src/contexts/enviveConfigContext/index.js +0 -1
  315. package/dist/src/contexts/enviveCssContext/enviveCssContext.js +0 -31
  316. package/dist/src/contexts/enviveCssContext/index.js +0 -1
  317. package/dist/src/contexts/featureFlagContext/featureFlagContext.js +0 -109
  318. package/dist/src/contexts/featureFlagContext/index.js +0 -1
  319. package/dist/src/contexts/featureFlagServiceContext/featureFlagServiceContext.js +0 -47
  320. package/dist/src/contexts/featureFlagServiceContext/index.js +0 -1
  321. package/dist/src/contexts/graphqlContext/graphqlContext.js +0 -87
  322. package/dist/src/contexts/graphqlContext/index.js +0 -1
  323. package/dist/src/contexts/localStorageContext/index.js +0 -1
  324. package/dist/src/contexts/localStorageContext/localStorageContext.js +0 -95
  325. package/dist/src/contexts/newOrgConfigContext/index.js +0 -1
  326. package/dist/src/contexts/newOrgConfigContext/newOrgConfigContext.js +0 -33
  327. package/dist/src/contexts/searchContext/index.js +0 -1
  328. package/dist/src/contexts/searchContext/searchContext.js +0 -131
  329. package/dist/src/contexts/sessionStorageContext/index.js +0 -1
  330. package/dist/src/contexts/sessionStorageContext/sessionStorageContext.js +0 -43
  331. package/dist/src/contexts/shopifyUrlContext/index.js +0 -1
  332. package/dist/src/contexts/shopifyUrlContext/shopifyUrlContext.js +0 -62
  333. package/dist/src/contexts/systemSettingsContext/index.js +0 -1
  334. package/dist/src/contexts/systemSettingsContext/systemSettingsContext.js +0 -29
  335. package/dist/src/contexts/userIdentityContext/index.js +0 -1
  336. package/dist/src/contexts/userIdentityContext/userIdentityContext.js +0 -118
  337. package/dist/src/events/index.js +0 -51
  338. package/dist/src/events/registerAnalyticsListeners.js +0 -32
  339. package/dist/src/exceptions/index.js +0 -2
  340. package/dist/src/exceptions/sessionExceptions.js +0 -6
  341. package/dist/src/exceptions/unsupportedProductExceptions.js +0 -6
  342. package/dist/src/hooks/AmplitudeOperations/index.js +0 -1
  343. package/dist/src/hooks/AmplitudeOperations/useAmplitudeOperations.js +0 -24
  344. package/dist/src/hooks/AppDetails/index.js +0 -1
  345. package/dist/src/hooks/AppDetails/useAppDetails.js +0 -26
  346. package/dist/src/hooks/BlockBackButton/index.js +0 -1
  347. package/dist/src/hooks/BlockBackButton/useBlockBackButton.js +0 -23
  348. package/dist/src/hooks/CdnOperations/index.js +0 -1
  349. package/dist/src/hooks/CdnOperations/useCdnOperations.js +0 -13
  350. package/dist/src/hooks/ChatToggle/index.js +0 -1
  351. package/dist/src/hooks/ChatToggle/useChatToggle.js +0 -50
  352. package/dist/src/hooks/ChatToggleAnalytics/index.js +0 -1
  353. package/dist/src/hooks/ChatToggleAnalytics/useChatToggleAnalytics.js +0 -11
  354. package/dist/src/hooks/CustomerSupportHandoff/index.js +0 -1
  355. package/dist/src/hooks/CustomerSupportHandoff/useCustomerSupportHandoff.js +0 -32
  356. package/dist/src/hooks/Debounce/index.js +0 -1
  357. package/dist/src/hooks/Debounce/useDebounce.js +0 -13
  358. package/dist/src/hooks/ElementObserver/index.js +0 -1
  359. package/dist/src/hooks/ElementObserver/useElementObserver.js +0 -208
  360. package/dist/src/hooks/GrabAndScroll/index.js +0 -1
  361. package/dist/src/hooks/GrabAndScroll/useGrabAndScroll.js +0 -105
  362. package/dist/src/hooks/GraphQLConfig/index.js +0 -1
  363. package/dist/src/hooks/GraphQLConfig/useGraphQLConfig.js +0 -54
  364. package/dist/src/hooks/IdentifyUser/index.js +0 -1
  365. package/dist/src/hooks/IdentifyUser/useIdentifyUser.js +0 -28
  366. package/dist/src/hooks/ImageResolver/index.js +0 -1
  367. package/dist/src/hooks/ImageResolver/useImageResolver.js +0 -45
  368. package/dist/src/hooks/Intersection/index.js +0 -1
  369. package/dist/src/hooks/Intersection/useIntersection.js +0 -20
  370. package/dist/src/hooks/IsSmallScreen/index.js +0 -1
  371. package/dist/src/hooks/IsSmallScreen/useIsSmallScreen.js +0 -16
  372. package/dist/src/hooks/LocalStorageOperations/index.js +0 -1
  373. package/dist/src/hooks/LocalStorageOperations/useLocalStorageOperations.js +0 -64
  374. package/dist/src/hooks/MessageFilter/index.js +0 -1
  375. package/dist/src/hooks/MessageFilter/useMessageFilter.js +0 -37
  376. package/dist/src/hooks/MessageScrollObserver/index.js +0 -1
  377. package/dist/src/hooks/MessageScrollObserver/useMessageScrollObserver.js +0 -35
  378. package/dist/src/hooks/NewOrgConfig/index.js +0 -1
  379. package/dist/src/hooks/NewOrgConfig/useNewOrgConfig.js +0 -5
  380. package/dist/src/hooks/Search/index.js +0 -1
  381. package/dist/src/hooks/Search/useRecommendedProducts.js +0 -35
  382. package/dist/src/hooks/Search/useSearch.js +0 -224
  383. package/dist/src/hooks/Search/useSearchInput.js +0 -183
  384. package/dist/src/hooks/SearchOperations/index.js +0 -1
  385. package/dist/src/hooks/SearchOperations/useSearchOperations.js +0 -78
  386. package/dist/src/hooks/SessionStorageOperations/index.js +0 -1
  387. package/dist/src/hooks/SessionStorageOperations/useSessionStorageOperations.js +0 -20
  388. package/dist/src/hooks/ShopifyUrlOperations/index.js +0 -1
  389. package/dist/src/hooks/ShopifyUrlOperations/useShopifyUrlOperations.js +0 -34
  390. package/dist/src/hooks/SnapCalculator/index.js +0 -1
  391. package/dist/src/hooks/SnapCalculator/useSnapCalculator.js +0 -22
  392. package/dist/src/hooks/SystemSettingsContext/index.js +0 -1
  393. package/dist/src/hooks/SystemSettingsContext/useSystemSettingsContext.js +0 -9
  394. package/dist/src/hooks/TrackComponentVisibleEvent/index.js +0 -1
  395. package/dist/src/hooks/TrackComponentVisibleEvent/useTrackComponentVisibleEvent.js +0 -45
  396. package/dist/src/hooks/UpdateAnalyticsProps/index.js +0 -1
  397. package/dist/src/hooks/UpdateAnalyticsProps/useUpdateAnalyticsProps.js +0 -43
  398. package/dist/src/hooks/utils.js +0 -116
  399. package/dist/src/interceptors/index.js +0 -1
  400. package/dist/src/interceptors/useMessageInterceptor.js +0 -24
  401. package/dist/src/types/ApiResponse.js +0 -1
  402. package/dist/src/types/FilterAttribute.js +0 -3
  403. package/dist/src/types/Message.js +0 -24
  404. package/dist/src/types/Suggestion.js +0 -3
  405. package/dist/src/types/index.js +0 -4
  406. package/dist/src/util/colorVar.js +0 -3
  407. package/dist/src/util/configVersion.js +0 -4
  408. package/dist/src/util/domInsertion.js +0 -16
  409. /package/dist/{featureFlagServiceContext-bI7ZLz4r.js → featureFlagServiceContext-CbUOAw5l.js} +0 -0
  410. /package/dist/{featureFlagServiceContext-B4ash4vz.cjs → featureFlagServiceContext-DSo2brno.cjs} +0 -0
@@ -1,59 +0,0 @@
1
- import { FormType } from '@spiffy-ai/commerce-api-client';
2
- import Logger from 'src/application/logging/logger';
3
- import { hasPropertyOfType } from '../utils';
4
- /**
5
- * Type guard to check if the provided data has the all of the properties (with the correct types) of
6
- * a FormResponseAttribute
7
- *
8
- * @param data - The data to check
9
- *
10
- * @returns true if the data has the correct properties, false otherwise
11
- */
12
- export const isApiFormResponseAttributes = (data) => {
13
- if (data == null || typeof data !== 'object') {
14
- Logger.logError('isApiFormResponseAttributes: data is null or not an object', undefined, {
15
- data,
16
- });
17
- return false;
18
- }
19
- if ('form_category' in data && typeof data.form_category !== 'object') {
20
- Logger.logError('isApiFormResponseAttributes: form_category is not an object', undefined, {
21
- data,
22
- });
23
- return false;
24
- }
25
- if ('form_category' in data && typeof data.form_category === 'object') {
26
- if (!hasPropertyOfType(data.form_category, 'form_type', 'string') ||
27
- !Object.values(FormType).includes(data.form_category.form_type)) {
28
- Logger.logError('isApiFormResponseAttributes: form_type is missing or not a valid form type', undefined, {
29
- data,
30
- });
31
- return false;
32
- }
33
- }
34
- if (!hasPropertyOfType(data, 'schema', 'object')) {
35
- Logger.logError('isApiFormResponseAttributes: schema is missing or not an object', undefined, {
36
- data,
37
- });
38
- return false;
39
- }
40
- // TODO: also wanna validate the fields of data.schema.properties but might wanna change the schema
41
- // to not have the property name as a key in the object
42
- if (!hasPropertyOfType(data.schema, 'properties', 'object')) {
43
- Logger.logError('isApiFormResponseAttributes: schema.properties is missing or not an object', undefined, {
44
- data,
45
- });
46
- return false;
47
- }
48
- if (!hasPropertyOfType(data.schema, 'required', 'array')) {
49
- Logger.logError('isApiFormResponseAttributes: schema.required is missing or not an array', undefined, { data });
50
- return false;
51
- }
52
- if (!data.schema.required.every((key) => typeof key === 'string' && key in data.schema.properties)) {
53
- Logger.logError('isApiFormResponseAttributes: schema.required contains invalid property keys', undefined, {
54
- data,
55
- });
56
- return false;
57
- }
58
- return true;
59
- };
@@ -1,22 +0,0 @@
1
- import { FormType } from '@spiffy-ai/commerce-api-client';
2
- import Logger from 'src/application/logging/logger';
3
- import { hasPropertyOfType } from '../utils';
4
- export const isApiFormSubmittedResponseAttributes = (data) => {
5
- if (data == null || typeof data !== 'object') {
6
- Logger.logError('isApiFormSubmittedResponseAttributes', 'data is null or not an object', data);
7
- return false;
8
- }
9
- if (!hasPropertyOfType(data, 'filled_schema', 'object')) {
10
- Logger.logError('isApiFormSubmittedResponseAttributes', 'filled_schema is not an object', data);
11
- return false;
12
- }
13
- if (!hasPropertyOfType(data, 'form_response_id', 'string')) {
14
- Logger.logError('isApiFormSubmittedResponseAttributes', 'form_response_id is not a string', data);
15
- return false;
16
- }
17
- if (!('form_type' in data) || !Object.values(FormType).includes(data.form_type)) {
18
- Logger.logError('isApiFormSubmittedResponseAttributes', 'form_type is not a valid form type enum', data);
19
- return false;
20
- }
21
- return true;
22
- };
@@ -1,91 +0,0 @@
1
- import Logger from 'src/application/logging/logger';
2
- import { hasPropertyOfType } from '../utils';
3
- const isApiOrderItemInfo = (data) => {
4
- if (data == null || typeof data !== 'object') {
5
- Logger.logError('OrderItemInfo must be an object', undefined, { data });
6
- return false;
7
- }
8
- if (!hasPropertyOfType(data, 'order_item_id', 'string')) {
9
- Logger.logError('OrderItemInfo must have an order_item_id property', undefined, { data });
10
- return false;
11
- }
12
- if (!hasPropertyOfType(data, 'item_title', 'string')) {
13
- Logger.logError('OrderItemInfo must have an item_title property', undefined, { data });
14
- return false;
15
- }
16
- if (!hasPropertyOfType(data, 'item_price', 'number')) {
17
- Logger.logError('OrderItemInfo must have an item_price property', undefined, { data });
18
- return false;
19
- }
20
- if (!hasPropertyOfType(data, 'item_quantity', 'number')) {
21
- Logger.logError('OrderItemInfo must have an item_quantity property', undefined, { data });
22
- return false;
23
- }
24
- if (!hasPropertyOfType(data, 'image', 'string', true)) {
25
- Logger.logError('OrderItemInfo.image must be a string or null', undefined, { data });
26
- return false;
27
- }
28
- if (!hasPropertyOfType(data, 'fulfillment_display_status', 'string', true)) {
29
- Logger.logError('OrderItemInfo.fulfillment_display_status must be a string or null', undefined, {
30
- data,
31
- });
32
- return false;
33
- }
34
- if (!hasPropertyOfType(data, 'tracking_url', 'string', true)) {
35
- Logger.logError('OrderItemInfo.tracking_url must be a string or null', undefined, { data });
36
- return false;
37
- }
38
- if (!hasPropertyOfType(data, 'delivered_at', 'string', true)) {
39
- Logger.logError('OrderItemInfo.delivered_at must be a string or null', undefined, { data });
40
- return false;
41
- }
42
- if (!hasPropertyOfType(data, 'estimated_delivery_at', 'string', true)) {
43
- Logger.logError('OrderItemInfo.estimated_delivery_at must be a string or null', undefined, {
44
- data,
45
- });
46
- return false;
47
- }
48
- if (!hasPropertyOfType(data, 'in_transit_at', 'string', true)) {
49
- Logger.logError('OrderItemInfo.in_transit_at must be a string or null', undefined, { data });
50
- return false;
51
- }
52
- return true;
53
- };
54
- export const isApiOrderResponseAttributes = (data) => {
55
- if (data == null || typeof data !== 'object') {
56
- Logger.logError('Order response attributes must be an object', undefined, { data });
57
- return false;
58
- }
59
- if (!hasPropertyOfType(data, 'created_at', 'string')) {
60
- Logger.logError('Order response attributes must have a created_at property and have type string', undefined, {
61
- data,
62
- });
63
- return false;
64
- }
65
- if (!hasPropertyOfType(data, 'latest_event_date', 'string')) {
66
- Logger.logError('Order response attributes must have a latest_event_date property and have type string', undefined, {
67
- data,
68
- });
69
- return false;
70
- }
71
- if (!hasPropertyOfType(data, 'line_items', 'array') ||
72
- !data.line_items.every((item) => isApiOrderItemInfo(item))) {
73
- Logger.logError('Order response attributes must have a line_items property with at least one order item', undefined, {
74
- data,
75
- });
76
- return false;
77
- }
78
- if (!hasPropertyOfType(data, 'order_id', 'string')) {
79
- Logger.logError('Order response attributes must have an order_id property and have type string', undefined, {
80
- data,
81
- });
82
- return false;
83
- }
84
- if (!hasPropertyOfType(data, 'order_number', 'string')) {
85
- Logger.logError('Order response attributes must have an order_number property and have type string', undefined, {
86
- data,
87
- });
88
- return false;
89
- }
90
- return true;
91
- };
@@ -1,188 +0,0 @@
1
- import { OrganizationStatusEnum, } from '@spiffy-ai/commerce-api-client';
2
- import { isApiOrganizationConfig } from './isApiOrganizationConfig';
3
- import Logger from 'src/application/logging/logger';
4
- const isApiOrgConfigExperiment = (data) => {
5
- if (data == null || typeof data !== 'object') {
6
- Logger.logDebug('[spiffy-ai] isApiOrgConfigExperiment: data is not an object', undefined, {
7
- data,
8
- });
9
- return false;
10
- }
11
- if ('group' in data && typeof data.group !== 'string' && data.group !== undefined) {
12
- Logger.logDebug('[spiffy-ai] isApiOrgConfigExperiment: group is not a string or undefined', undefined, {
13
- data,
14
- });
15
- return false;
16
- }
17
- if ('group_name' in data &&
18
- typeof data.group_name !== 'string' &&
19
- data.group_name !== undefined) {
20
- Logger.logDebug('[spiffy-ai] isApiOrgConfigExperiment: group_name is not a string', undefined, {
21
- data,
22
- });
23
- return false;
24
- }
25
- if ('name' in data && typeof data.name !== 'string' && data.name !== undefined) {
26
- Logger.logDebug('[spiffy-ai] isApiOrgConfigExperiment: name is not a string', undefined, {
27
- data,
28
- });
29
- return false;
30
- }
31
- if ('rule_id' in data && typeof data.rule_id !== 'string' && data.rule_id !== undefined) {
32
- Logger.logDebug('[spiffy-ai] isApiOrgConfigExperiment: rule_id is not a string', undefined, {
33
- data,
34
- });
35
- return false;
36
- }
37
- if ('value' in data && typeof data.value !== 'object' && data.value !== undefined) {
38
- Logger.logDebug('[spiffy-ai] isApiOrgConfigExperiment: value is not an object', undefined, {
39
- data,
40
- });
41
- return false;
42
- }
43
- return true;
44
- };
45
- const isApiOrgConfigFeatureGate = (data) => {
46
- if (data == null || typeof data !== 'object') {
47
- Logger.logDebug('[spiffy-ai] isApiOrgConfigFeatureGate: data is not an object', undefined, {
48
- data,
49
- });
50
- return false;
51
- }
52
- if ('name' in data && typeof data.name !== 'string' && data.name !== undefined) {
53
- Logger.logDebug('[spiffy-ai] isApiOrgConfigFeatureGate: name is not a string', undefined, {
54
- data,
55
- });
56
- return false;
57
- }
58
- if ('rule_id' in data && typeof data.rule_id !== 'string' && data.rule_id !== undefined) {
59
- Logger.logDebug('[spiffy-ai] isApiOrgConfigFeatureGate: rule_id is not a string', undefined, {
60
- data,
61
- });
62
- return false;
63
- }
64
- if ('value' in data && typeof data.value !== 'boolean' && data.value !== undefined) {
65
- Logger.logDebug('[spiffy-ai] isApiOrgConfigFeatureGate: value is not a boolean', undefined, {
66
- data,
67
- });
68
- return false;
69
- }
70
- return true;
71
- };
72
- const isApiOrganization = (data) => {
73
- if (data == null || typeof data !== 'object') {
74
- Logger.logDebug('[spiffy-ai] isApiOrganization: data is not an object', undefined, {
75
- data,
76
- });
77
- return false;
78
- }
79
- if (!('id' in data) || typeof data.id !== 'string') {
80
- Logger.logDebug('[spiffy-ai] isApiOrganization: id is not a string', undefined, {
81
- data,
82
- });
83
- return false;
84
- }
85
- if (!('display_name' in data) || typeof data.display_name !== 'string') {
86
- Logger.logDebug('[spiffy-ai] isApiOrganization: display_name is not a string', undefined, {
87
- data,
88
- });
89
- return false;
90
- }
91
- if (!('domain' in data) || typeof data.domain !== 'string') {
92
- Logger.logDebug('[spiffy-ai] isApiOrganization: domain is not a string', undefined, {
93
- data,
94
- });
95
- return false;
96
- }
97
- if (!('short_name' in data) || typeof data.short_name !== 'string') {
98
- Logger.logDebug('[spiffy-ai] isApiOrganization: short_name is not a string', undefined, {
99
- data,
100
- });
101
- return false;
102
- }
103
- if (!('status' in data) ||
104
- !Object.values(OrganizationStatusEnum).includes(data.status)) {
105
- Logger.logDebug('[spiffy-ai] isApiOrganization: status is not a valid OrganizationStatusEnum value', undefined, {
106
- data,
107
- });
108
- return false;
109
- }
110
- if ('created_at' in data &&
111
- !(data.created_at instanceof Date) &&
112
- typeof data.created_at !== 'string' &&
113
- data.created_at !== undefined) {
114
- Logger.logDebug('[spiffy-ai] isApiOrganization: created_at is not a Date', undefined, {
115
- data,
116
- });
117
- return false;
118
- }
119
- if ('updated_at' in data &&
120
- !(data.updated_at instanceof Date) &&
121
- typeof data.updated_at !== 'string' &&
122
- data.updated_at !== undefined) {
123
- Logger.logDebug('[spiffy-ai] isApiOrganization: updated_at is not a Date', undefined, {
124
- data,
125
- });
126
- return false;
127
- }
128
- return true;
129
- };
130
- const isApiOrgConfigOrganizationSettings = (data) => {
131
- if (data == null || typeof data !== 'object') {
132
- Logger.logDebug('[spiffy-ai] isApiOrgConfigOrganizationSettings: data is not an object', undefined, {
133
- data,
134
- });
135
- return false;
136
- }
137
- if (!('org' in data) || !isApiOrganization(data.org)) {
138
- Logger.logDebug('[spiffy-ai] isApiOrgConfigOrganizationSettings: org is not an object', undefined, {
139
- data,
140
- });
141
- return false;
142
- }
143
- // skip validation for 'settings' for now
144
- return true;
145
- };
146
- /**
147
- *
148
- * @param data
149
- * @returns
150
- */
151
- export const isApiOrgConfigResults = (data) => {
152
- if (data == null || typeof data !== 'object') {
153
- Logger.logDebug('[spiffy-ai] isApiOrgConfigResults: data is not an object', undefined, {
154
- data,
155
- });
156
- return false;
157
- }
158
- if (!('configs' in data) ||
159
- !Array.isArray(data.configs) ||
160
- !data.configs.every((config) => isApiOrganizationConfig(config))) {
161
- Logger.logDebug('[spiffy-ai] isApiOrgConfigResults: configs is not an array', undefined, {
162
- data,
163
- });
164
- return false;
165
- }
166
- if ('experiments' in data &&
167
- data.experiments !== undefined &&
168
- (!Array.isArray(data.experiments) ||
169
- !data.experiments.every((exp) => isApiOrgConfigExperiment(exp)))) {
170
- Logger.logDebug('[spiffy-ai] isApiOrgConfigResults: experiments is not an array or contains invalid items', undefined, {
171
- data,
172
- });
173
- return false;
174
- }
175
- if (!('gates' in data) ||
176
- !Array.isArray(data.gates) ||
177
- !data.gates.every((gate) => isApiOrgConfigFeatureGate(gate))) {
178
- Logger.logDebug('[spiffy-ai] isApiOrgConfigResults: gates is not an array or contains invalid items', undefined, {
179
- data,
180
- });
181
- return false;
182
- }
183
- if (!('org' in data) || !isApiOrgConfigOrganizationSettings(data.org)) {
184
- Logger.logDebug('[spiffy-ai] isApiOrgConfigResults: org is not an object or has invalid fields', undefined, { data });
185
- return false;
186
- }
187
- return true;
188
- };
@@ -1,115 +0,0 @@
1
- import Logger from 'src/application/logging/logger';
2
- const isApiOrgAnalyticsConfigAmplitude = (data) => {
3
- if (data == null || typeof data !== 'object') {
4
- Logger.logDebug('[spiffy-ai] isApiOrgAnalyticsConfigAmplitude: data is not an object', data);
5
- return false;
6
- }
7
- if (!('session_replay_enabled' in data) || typeof data.session_replay_enabled !== 'boolean') {
8
- Logger.logDebug('[spiffy-ai] isApiOrgAnalyticsConfigAmplitude: session_replay_enabled is not a boolean', data);
9
- return false;
10
- }
11
- if (!('session_replay_sample_rate' in data) ||
12
- typeof data.session_replay_sample_rate !== 'number') {
13
- Logger.logDebug('[spiffy-ai] isApiOrgAnalyticsConfigAmplitude: session_replay_sample_rate is not a number', data);
14
- return false;
15
- }
16
- if (!('tracking_enabled' in data) || typeof data.tracking_enabled !== 'boolean') {
17
- Logger.logDebug('[spiffy-ai] isApiOrgAnalyticsConfigAmplitude: tracking_enabled is not a boolean', data);
18
- return false;
19
- }
20
- return true;
21
- };
22
- const isApiOrgAnalyticsConfigCustomerService = (data) => {
23
- if (data == null || typeof data !== 'object') {
24
- Logger.logDebug('[spiffy-ai] isApiOrgAnalyticsConfigCustomerService: data is not an object', data);
25
- return false;
26
- }
27
- if (!('provider' in data) || typeof data.provider !== 'string') {
28
- Logger.logDebug('[spiffy-ai] isApiOrgAnalyticsConfigCustomerService: provider is not a string', data);
29
- return false;
30
- }
31
- return true;
32
- };
33
- const isApiOrgAnalyticsConfigGoogleAnalytics = (data) => {
34
- if (data == null || typeof data !== 'object') {
35
- Logger.logDebug('[spiffy-ai] isApiOrgAnalyticsConfigGoogleAnalytics: data is not an object', data);
36
- return false;
37
- }
38
- if (!('measurement_id' in data) || typeof data.measurement_id !== 'string') {
39
- Logger.logDebug('[spiffy-ai] isApiOrgAnalyticsConfigGoogleAnalytics: measurement_id is not a string', data);
40
- return false;
41
- }
42
- return true;
43
- };
44
- /**
45
- *
46
- * @param data
47
- * @returns
48
- */
49
- const isApiOrgAnalyticsConfig = (data) => {
50
- if (data == null || typeof data !== 'object') {
51
- Logger.logDebug('[spiffy-ai] isOrgAnalyticsConfig: data is not an object', data);
52
- return false;
53
- }
54
- if ('amplitude' in data && !isApiOrgAnalyticsConfigAmplitude(data.amplitude)) {
55
- Logger.logDebug('[spiffy-ai] isOrgAnalyticsConfig: amplitude is not an object', data);
56
- return false;
57
- }
58
- if ('customer_service' in data &&
59
- !isApiOrgAnalyticsConfigCustomerService(data.customer_service)) {
60
- Logger.logDebug('[spiffy-ai] isOrgAnalyticsConfig: customer_service is not an object', data);
61
- return false;
62
- }
63
- if ('google_analytics' in data &&
64
- !isApiOrgAnalyticsConfigGoogleAnalytics(data.google_analytics)) {
65
- Logger.logDebug('[spiffy-ai] isOrgAnalyticsConfig: google_analytics is not an object', data);
66
- return false;
67
- }
68
- return true;
69
- };
70
- /**
71
- *
72
- * @param data
73
- * @returns
74
- */
75
- export const isApiOrganizationConfig = (data) => {
76
- if (data == null || typeof data !== 'object') {
77
- Logger.logDebug('[spiffy-ai] isOrgConfig: data is not an object', data);
78
- return false;
79
- }
80
- if (!('created_at' in data)) {
81
- Logger.logDebug('[spiffy-ai] isOrgConfig: created_at is not defined', data);
82
- return false;
83
- }
84
- if (!('namespace' in data) || typeof data.namespace !== 'string') {
85
- Logger.logDebug('[spiffy-ai] isOrgConfig: namespace is not a string', data);
86
- return false;
87
- }
88
- if (!('is_latest' in data) || typeof data.is_latest !== 'boolean') {
89
- Logger.logDebug('[spiffy-ai] isOrgConfig: is_latest is not a boolean', data);
90
- return false;
91
- }
92
- if (!('version' in data) || typeof data.version !== 'string') {
93
- Logger.logDebug('[spiffy-ai] isOrgConfig: version is not a string', data);
94
- return false;
95
- }
96
- if (!('updated_at' in data)) {
97
- Logger.logDebug('[spiffy-ai] isOrgConfig: updated_at is not defined', data);
98
- return false;
99
- }
100
- if (!('config' in data) ||
101
- typeof data.config !== 'object' ||
102
- !isApiOrgAnalyticsConfig(data.config)) {
103
- Logger.logDebug('[spiffy-ai] isOrgConfig: config is not an object', data);
104
- return false;
105
- }
106
- if ('organization_id' in data && typeof data.organization_id !== 'string') {
107
- Logger.logDebug('[spiffy-ai] isOrgConfig: organization_id is not a string', data);
108
- return false;
109
- }
110
- if ('id' in data && typeof data.id !== 'string') {
111
- Logger.logDebug('[spiffy-ai] isOrgConfig: id is not a string', data);
112
- return false;
113
- }
114
- return true;
115
- };
@@ -1,16 +0,0 @@
1
- export const isApiPDPAttributes = (data) => {
2
- if (data == null || typeof data !== "object") {
3
- return false;
4
- }
5
- if (!("product_id" in data) || typeof data.product_id !== "string") {
6
- return false;
7
- }
8
- if ("parent_product_id" in data &&
9
- typeof data.parent_product_id !== "string") {
10
- return false;
11
- }
12
- if ("url" in data && data.url != null && typeof data.url !== "string") {
13
- return false;
14
- }
15
- return true;
16
- };
@@ -1,26 +0,0 @@
1
- import { PLPAttributeCategory, } from "@spiffy-ai/commerce-api-client";
2
- export const isApiPLPIdAttribute = (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
- return true;
10
- };
11
- export const isApiPLPEventAttributes = (data) => {
12
- if (data == null || typeof data !== "object") {
13
- return false;
14
- }
15
- if (!("category" in data) ||
16
- typeof data.category !== "string" ||
17
- !Object.values(PLPAttributeCategory).includes(data.category)) {
18
- return false;
19
- }
20
- if (!("attributes" in data) ||
21
- typeof data.attributes !== "object" ||
22
- !isApiPLPIdAttribute(data.attributes)) {
23
- return false;
24
- }
25
- return true;
26
- };
@@ -1,15 +0,0 @@
1
- export const isApiPageResponseAttributes = (obj) => {
2
- if (obj == null || typeof obj !== 'object') {
3
- return false;
4
- }
5
- if ('title' in obj && obj.title != null && typeof obj.title !== 'string') {
6
- return false;
7
- }
8
- if ('description' in obj && typeof obj.description !== 'string') {
9
- return false;
10
- }
11
- if ('url' in obj && typeof obj.url !== 'string') {
12
- return false;
13
- }
14
- return true;
15
- };
@@ -1,65 +0,0 @@
1
- import { hasPropertyOfType } from '../utils';
2
- import Logger from 'src/application/logging/logger';
3
- export const isApiProductResponseAttributes = (attributes) => {
4
- if (attributes == null || typeof attributes !== 'object') {
5
- Logger.logError('isApiProductResponseAttributes: attributes is null or not an object', undefined, {
6
- attributes,
7
- });
8
- return false;
9
- }
10
- if (!hasPropertyOfType(attributes, 'description', 'string', true)) {
11
- Logger.logError('isApiProductResponseAttributes: description is not a string', undefined, {
12
- attributes,
13
- });
14
- return false;
15
- }
16
- if (!hasPropertyOfType(attributes, 'image_url', 'string', true)) {
17
- Logger.logError('isApiProductResponseAttributes: image_url is not a string', undefined, {
18
- attributes,
19
- });
20
- return false;
21
- }
22
- if (!hasPropertyOfType(attributes, 'title', 'string')) {
23
- Logger.logError('isApiProductResponseAttributes: title is not a string', undefined, {
24
- attributes,
25
- });
26
- return false;
27
- }
28
- if (!hasPropertyOfType(attributes, 'url', 'string')) {
29
- Logger.logError('isApiProductResponseAttributes: url is not a string', undefined, {
30
- attributes,
31
- });
32
- return false;
33
- }
34
- if (!hasPropertyOfType(attributes, 'original_price', 'number', true)) {
35
- Logger.logError('isApiProductResponseAttributes: original_price is not a number', undefined, {
36
- attributes,
37
- });
38
- return false;
39
- }
40
- if (!hasPropertyOfType(attributes, 'sale_price', 'number', true)) {
41
- Logger.logError('isApiProductResponseAttributes: sale_price is not a number', undefined, {
42
- attributes,
43
- });
44
- return false;
45
- }
46
- if (!hasPropertyOfType(attributes, 'average_rating', 'number', true)) {
47
- Logger.logError('isApiProductResponseAttributes: average_rating is not a number', undefined, {
48
- attributes,
49
- });
50
- return false;
51
- }
52
- if (!hasPropertyOfType(attributes, 'number_reviews', 'number', true)) {
53
- Logger.logError('isApiProductResponseAttributes: number_reviews is not a number', undefined, {
54
- attributes,
55
- });
56
- return false;
57
- }
58
- if (!hasPropertyOfType(attributes, 'metadata', 'array', true)) {
59
- Logger.logError('isApiProductResponseAttributes: metadata is not an array', undefined, {
60
- attributes,
61
- });
62
- return false;
63
- }
64
- return true;
65
- };
@@ -1,15 +0,0 @@
1
- export const isApiProductSearchResponseAttributes = (attributes) => {
2
- if (attributes == null || typeof attributes !== "object") {
3
- return false;
4
- }
5
- if ("generated_query" in attributes &&
6
- typeof attributes.generated_query !== "string") {
7
- return false;
8
- }
9
- if ("product_count" in attributes &&
10
- attributes.product_count != null &&
11
- typeof attributes.product_count !== "number") {
12
- return false;
13
- }
14
- return true;
15
- };
@@ -1,10 +0,0 @@
1
- export const isApiProductSearchFilterResponseAttributes = (attributes) => {
2
- if (attributes == null || typeof attributes !== "object") {
3
- return false;
4
- }
5
- if ("filter_name" in attributes &&
6
- typeof attributes.filter_name !== "string") {
7
- return false;
8
- }
9
- return true;
10
- };
@@ -1,4 +0,0 @@
1
- export const isApiQueryTypedAttributes = (data) => data != null &&
2
- typeof data === "object" &&
3
- "query" in data &&
4
- typeof data.query === "string";
@@ -1,33 +0,0 @@
1
- import { ResponseCategory } from "@spiffy-ai/commerce-api-client";
2
- import Logger from "src/application/logging/logger";
3
- import { hasPropertyOfType } from "../utils";
4
- export const isApiResponse = (data) => {
5
- if (data == null || typeof data !== "object") {
6
- Logger.logError("isApiResponse: data is null or not an object", undefined, {
7
- data,
8
- });
9
- return false;
10
- }
11
- if (!hasPropertyOfType(data, "id", "string")) {
12
- Logger.logError("isApiResponse: id is not a string", undefined, { data });
13
- return false;
14
- }
15
- if (!hasPropertyOfType(data, "category", "string") ||
16
- !Object.values(ResponseCategory).includes(data.category)) {
17
- Logger.logError("isApiResponse: category is not a string or not a valid response category", undefined, { data });
18
- return false;
19
- }
20
- if (!hasPropertyOfType(data, "created_at", "string")) {
21
- Logger.logError("isApiResponse: created_at is not a string", undefined, {
22
- data,
23
- });
24
- return false;
25
- }
26
- if (!hasPropertyOfType(data, "attributes", "object", true)) {
27
- Logger.logError("isApiResponse: attributes is not an object", undefined, {
28
- data,
29
- });
30
- return false;
31
- }
32
- return true;
33
- };