@liquidcommerce/elements-sdk 2.6.0-beta.1 → 2.6.0-beta.100

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 (274) hide show
  1. package/README.md +99 -2517
  2. package/dist/index.checkout.esm.js +17794 -0
  3. package/dist/index.esm.js +26010 -20601
  4. package/dist/ssr-stub.checkout.esm.js +18 -0
  5. package/dist/ssr-stub.esm.js +270 -0
  6. package/dist/types/auto-initialize/checkout.d.ts +2 -0
  7. package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
  8. package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
  9. package/dist/types/clients/builder.d.ts +3 -0
  10. package/dist/types/clients/checkout.d.ts +6 -0
  11. package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
  12. package/dist/types/clients/main.d.ts +3 -0
  13. package/dist/types/constants/core.constant.d.ts +13 -6
  14. package/dist/types/core/a11y/announcer.service.d.ts +16 -0
  15. package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
  16. package/dist/types/core/a11y/focusable.d.ts +5 -0
  17. package/dist/types/core/a11y/glyph-button.d.ts +8 -0
  18. package/dist/types/core/a11y/index.d.ts +5 -0
  19. package/dist/types/core/a11y/single-select.d.ts +16 -0
  20. package/dist/types/core/api/api-client.service.d.ts +23 -22
  21. package/dist/types/core/api/api-result.d.ts +19 -0
  22. package/dist/types/core/api/auth-client.service.d.ts +39 -26
  23. package/dist/types/core/api/http-client.service.d.ts +0 -8
  24. package/dist/types/core/base-component.service.d.ts +4 -1
  25. package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
  26. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  27. package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
  28. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
  29. package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
  30. package/dist/types/core/client/client-action.service.d.ts +6 -67
  31. package/dist/types/core/client/client-config.service.d.ts +9 -5
  32. package/dist/types/core/command/base-command.service.d.ts +2 -2
  33. package/dist/types/core/command/common-command.service.d.ts +2 -1
  34. package/dist/types/core/google-tag-manager.service.d.ts +15 -11
  35. package/dist/types/core/logger/logger.service.d.ts +1 -1
  36. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +6 -12
  37. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
  38. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -50
  39. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
  40. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
  41. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  42. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  43. package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
  44. package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -55
  45. package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -108
  46. package/dist/types/core/store/interfaces/core.interface.d.ts +16 -5
  47. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  48. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  49. package/dist/types/core/store/interfaces/product.interface.d.ts +13 -66
  50. package/dist/types/core/store/store.constant.d.ts +6 -1
  51. package/dist/types/core/store/store.service.d.ts +1 -0
  52. package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
  53. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  54. package/dist/types/enums/core.enum.d.ts +40 -1
  55. package/dist/types/enums/index.d.ts +0 -1
  56. package/dist/types/index.checkout.d.ts +8 -0
  57. package/dist/types/index.checkout.umd.d.ts +4 -0
  58. package/dist/types/index.d.ts +8 -3
  59. package/dist/types/interfaces/api/address.interface.d.ts +28 -0
  60. package/dist/types/interfaces/api/cart.interface.d.ts +96 -0
  61. package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
  62. package/dist/types/interfaces/{cloud → api}/index.d.ts +1 -3
  63. package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
  64. package/dist/types/interfaces/api/product.interface.d.ts +112 -0
  65. package/dist/types/interfaces/client.interface.d.ts +72 -0
  66. package/dist/types/interfaces/component.interface.d.ts +7 -0
  67. package/dist/types/interfaces/config.interface.d.ts +40 -0
  68. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  69. package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
  70. package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
  71. package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
  72. package/dist/types/interfaces/configs/global.interface.d.ts +10 -3
  73. package/dist/types/interfaces/configs/index.d.ts +1 -0
  74. package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
  75. package/dist/types/interfaces/configs/product.interface.d.ts +4 -1
  76. package/dist/types/interfaces/injection.interface.d.ts +49 -0
  77. package/dist/types/modules/address/address-display.component.d.ts +3 -1
  78. package/dist/types/modules/address/address-input.component.d.ts +10 -1
  79. package/dist/types/modules/address/address.command.d.ts +4 -4
  80. package/dist/types/modules/address/address.interface.d.ts +0 -7
  81. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  82. package/dist/types/modules/cart/cart.commands.d.ts +4 -5
  83. package/dist/types/modules/cart/components/cart-body.component.d.ts +3 -1
  84. package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
  85. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
  86. package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
  87. package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
  88. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  89. package/dist/types/modules/checkout/checkout.commands.d.ts +27 -10
  90. package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
  91. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  92. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
  93. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  94. package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
  95. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  96. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
  97. package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
  98. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  99. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  100. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
  101. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  102. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  103. package/dist/types/modules/checkout/constant.d.ts +3 -0
  104. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  105. package/dist/types/modules/product/components/components.d.ts +7 -4
  106. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
  107. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  108. package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
  109. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
  110. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  111. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +4 -0
  112. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +10 -2
  113. package/dist/types/modules/product/product.commands.d.ts +7 -7
  114. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  115. package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
  116. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  117. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  118. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
  119. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
  120. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
  121. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  122. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  123. package/dist/types/modules/product-list/components/filter-components/product-list-checkbox-filter.d.ts +7 -0
  124. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  125. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  126. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
  127. package/dist/types/modules/product-list/components/filter-components/product-list-price-filter.d.ts +22 -0
  128. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  129. package/dist/types/modules/product-list/components/index.d.ts +6 -0
  130. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
  131. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -30
  132. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  133. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +56 -14
  134. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  135. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
  136. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
  137. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
  138. package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
  139. package/dist/types/modules/product-list/product-list.commands.d.ts +23 -7
  140. package/dist/types/modules/product-list/product-list.component.d.ts +17 -39
  141. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  142. package/dist/types/modules/product-list/product-list.interface.d.ts +65 -0
  143. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  144. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  145. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  146. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  147. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  148. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  149. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  150. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  151. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  152. package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
  153. package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
  154. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
  155. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
  156. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
  157. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  158. package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
  159. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  160. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  161. package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
  162. package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
  163. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  164. package/dist/types/ssr/stub.d.ts +10 -0
  165. package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
  166. package/dist/types/static/icon/bag.icon.d.ts +1 -1
  167. package/dist/types/static/icon/check.icon.d.ts +2 -0
  168. package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
  169. package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
  170. package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
  171. package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
  172. package/dist/types/static/icon/close.icon.d.ts +1 -1
  173. package/dist/types/static/icon/error-info.icon.d.ts +1 -1
  174. package/dist/types/static/icon/filter.icon.d.ts +2 -0
  175. package/dist/types/static/icon/icon.a11y.d.ts +1 -0
  176. package/dist/types/static/icon/icon.types.d.ts +1 -0
  177. package/dist/types/static/icon/index.d.ts +3 -0
  178. package/dist/types/static/icon/info.icon.d.ts +1 -1
  179. package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
  180. package/dist/types/static/icon/search.icon.d.ts +1 -1
  181. package/dist/types/static/icon/success.icon.d.ts +1 -1
  182. package/dist/types/static/icon/trash.icon.d.ts +1 -1
  183. package/dist/types/static/icon/warning.icon.d.ts +1 -1
  184. package/dist/types/utils/dom-compat.d.ts +2 -0
  185. package/dist/types/utils/format.d.ts +4 -14
  186. package/dist/types/utils/image-bg-removal.d.ts +3 -0
  187. package/dist/types/utils/product-selection.d.ts +16 -0
  188. package/dist/types/utils/product.d.ts +15 -0
  189. package/docs/v1/README.md +213 -0
  190. package/docs/v1/api/actions/address-actions.md +286 -0
  191. package/docs/v1/api/actions/cart-actions.md +364 -0
  192. package/docs/v1/api/actions/checkout-actions.md +527 -0
  193. package/docs/v1/api/actions/product-actions.md +204 -0
  194. package/docs/v1/api/client.md +596 -0
  195. package/docs/v1/api/configuration.md +555 -0
  196. package/docs/v1/api/injection-methods.md +292 -0
  197. package/docs/v1/api/typescript-types.md +423 -0
  198. package/docs/v1/api/ui-helpers.md +200 -0
  199. package/docs/v1/examples/advanced-patterns.md +199 -0
  200. package/docs/v1/examples/checkout-flow.md +90 -0
  201. package/docs/v1/examples/custom-theming.md +63 -0
  202. package/docs/v1/examples/multi-product-page.md +90 -0
  203. package/docs/v1/examples/simple-product-page.md +89 -0
  204. package/docs/v1/getting-started/concepts.md +521 -0
  205. package/docs/v1/getting-started/installation.md +349 -0
  206. package/docs/v1/getting-started/quick-start.md +410 -0
  207. package/docs/v1/guides/accessibility.md +173 -0
  208. package/docs/v1/guides/address-component.md +435 -0
  209. package/docs/v1/guides/best-practices.md +365 -0
  210. package/docs/v1/guides/cart-component.md +757 -0
  211. package/docs/v1/guides/checkout-component.md +670 -0
  212. package/docs/v1/guides/events.md +939 -0
  213. package/docs/v1/guides/product-component.md +735 -0
  214. package/docs/v1/guides/product-list-component.md +630 -0
  215. package/docs/v1/guides/theming.md +228 -0
  216. package/docs/v1/integration/angular.md +39 -0
  217. package/docs/v1/integration/laravel.md +41 -0
  218. package/docs/v1/integration/nextjs.md +69 -0
  219. package/docs/v1/integration/proxy-setup.md +106 -0
  220. package/docs/v1/integration/react.md +64 -0
  221. package/docs/v1/integration/vanilla-js.md +84 -0
  222. package/docs/v1/integration/vue.md +58 -0
  223. package/docs/v1/reference/analytics.md +108 -0
  224. package/docs/v1/reference/browser-support.md +47 -0
  225. package/docs/v1/reference/error-handling.md +83 -0
  226. package/docs/v1/reference/performance.md +52 -0
  227. package/docs/v1/reference/telemetry.md +85 -0
  228. package/docs/v1/reference/troubleshooting.md +135 -0
  229. package/package.json +69 -45
  230. package/dist/types/elements-builder-client.d.ts +0 -2
  231. package/dist/types/elements-client.d.ts +0 -2
  232. package/dist/types/enums/cloud.enum.d.ts +0 -77
  233. package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
  234. package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
  235. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
  236. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -214
  237. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  238. package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
  239. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  240. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  241. package/dist/types/interfaces/core.interface.d.ts +0 -111
  242. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
  243. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  244. package/dist/types/modules/product/utils/helpers.d.ts +0 -3
  245. package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
  246. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  247. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  248. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  249. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  250. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  251. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  252. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  253. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
  254. package/dist/types/utils/helper.d.ts +0 -27
  255. package/docs/ACTIONS.md +0 -1300
  256. package/docs/BROWSER_SUPPORT.md +0 -279
  257. package/docs/CONFIGURATION.md +0 -853
  258. package/docs/DOCUMENTATION_INDEX.md +0 -311
  259. package/docs/EVENTS.md +0 -798
  260. package/docs/PROXY.md +0 -228
  261. package/docs/THEMING.md +0 -589
  262. package/docs/TROUBLESHOOTING.md +0 -793
  263. package/umd/elements.js +0 -1
  264. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  265. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  266. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  267. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  268. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  269. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  270. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  271. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  272. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  273. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  274. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -1,4 +1,6 @@
1
+ import { type ApiResult } from '@/core/api/api-result';
1
2
  import type { ElementsEnv } from '@/enums';
3
+ import type { IAllConfigs } from '@/interfaces/configs/global.interface';
2
4
  export interface IAuthConfig {
3
5
  apiKey: string;
4
6
  env: ElementsEnv;
@@ -9,45 +11,56 @@ export interface IHttpRequestOptions {
9
11
  body?: any;
10
12
  }
11
13
  export interface IAuth {
12
- token: string;
13
- exp: number;
14
- type: 'ACCESS_TOKEN';
15
- }
16
- export interface IResponseMetadata {
17
- languages: string[];
18
- timestamp: number;
19
- timezone: string;
20
- requestId: string;
21
- path: string;
22
- version: string;
23
- }
24
- export interface IApiResponseBase {
14
+ accessToken: string;
15
+ expiration: number;
16
+ }
17
+ export interface IApiResponse<T> {
18
+ message: string;
19
+ data: T;
20
+ }
21
+ export interface IApiErrorDetail {
22
+ field?: string;
23
+ message: string;
24
+ code?: string;
25
+ }
26
+ export interface IApiError {
25
27
  statusCode: number;
26
28
  message: string;
27
- metadata: IResponseMetadata;
29
+ errors: IApiErrorDetail[];
30
+ }
31
+ export interface IAuthWithConfigs {
32
+ auth: IAuth;
33
+ configs: IAllConfigs;
28
34
  }
29
- export type IApiResponseWithData<T> = IApiResponseBase & {
30
- data: T;
31
- };
32
35
  export declare class AuthClientService {
36
+ private static readonly TOKEN_EXPIRATION_BUFFER_MS;
33
37
  private readonly apiKey;
34
38
  private readonly baseUrl;
35
39
  private readonly env;
36
- private accessToken;
37
- private tokenExpiration;
38
- private isAuthenticating;
39
40
  private readonly httpClient;
40
41
  private readonly logger;
41
42
  private readonly clientConfig;
43
+ private accessToken;
44
+ private tokenExpiration;
45
+ private refreshPromise;
42
46
  private constructor();
43
47
  static getInstance(config: IAuthConfig): AuthClientService;
44
- authenticate(): Promise<boolean>;
45
- isTokenExpired(): boolean;
48
+ authenticateAndGetConfigs(): Promise<{
49
+ success: boolean;
50
+ configs?: IAllConfigs;
51
+ }>;
52
+ refreshToken(): Promise<boolean>;
53
+ get<TData = unknown>(path: string, options?: IHttpRequestOptions): Promise<ApiResult<TData>>;
54
+ post<TData = unknown>(path: string, options?: IHttpRequestOptions): Promise<ApiResult<TData>>;
55
+ private performTokenRefresh;
46
56
  private request;
57
+ private handleSuccessResponse;
58
+ private handleAuthError;
59
+ private handleErrorResponse;
60
+ private isTokenExpired;
61
+ private clearToken;
47
62
  private buildUrl;
63
+ private buildHeaders;
48
64
  private getProxyHeaders;
49
- get<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
50
- post<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
51
- put<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
52
- delete<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
65
+ private isAccessTokenError;
53
66
  }
@@ -21,24 +21,16 @@ export interface IRequestOptions {
21
21
  export interface IHttpRequestConfig {
22
22
  url: string;
23
23
  options: IHttpClientOptions;
24
- retryConfig?: {
25
- maxRetries: number;
26
- retryDelay: number;
27
- shouldRetry?: (error: any, response?: ICustomResponse) => boolean;
28
- };
29
24
  }
30
25
  export declare class HttpClientService {
31
26
  private readonly fetchImpl;
32
27
  private readonly logger;
33
28
  constructor();
34
29
  request(config: IHttpRequestConfig): Promise<ICustomResponse>;
35
- private defaultShouldRetry;
36
30
  private logFailedResponse;
37
31
  private logNetworkError;
38
32
  private diagnosePossibleCauses;
39
33
  private enhanceError;
40
- private sanitizeHeaders;
41
- private delay;
42
34
  private getFetchImplementation;
43
35
  private fetchAdapter;
44
36
  private xhrFetch;
@@ -1,3 +1,4 @@
1
+ import { AnnouncerService } from '@/core/a11y';
1
2
  import { ClientConfigService } from '@/core/client/client-config.service';
2
3
  import { LoggerFactory } from '@/core/logger/logger-factory';
3
4
  import { PubSubService } from '@/core/pubsub/pubsub.service';
@@ -7,6 +8,7 @@ import { TelemetryService } from '@/core/telemetry/telemetry.service';
7
8
  import type { ComponentType } from '@/enums';
8
9
  import type { ConfigsKeyType, ConfigsType } from '@/interfaces/configs';
9
10
  import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
11
+ import { SafeHTMLElement } from '@/utils/dom-compat';
10
12
  import { CommandService } from './command/command.service';
11
13
  export interface IBaseComponentConfig {
12
14
  type: ComponentType;
@@ -25,7 +27,7 @@ export interface IOnStoreChanged {
25
27
  value: any;
26
28
  oldValue: any;
27
29
  }
28
- export declare abstract class BaseComponent<TParams = Record<string, any>, TConfig = ConfigsType> extends HTMLElement {
30
+ export declare abstract class BaseComponent<TParams = Record<string, any>, TConfig = ConfigsType> extends SafeHTMLElement {
29
31
  protected readonly store: StoreService;
30
32
  protected readonly commands: CommandService;
31
33
  protected readonly themeProvider: ThemeProviderService;
@@ -33,6 +35,7 @@ export declare abstract class BaseComponent<TParams = Record<string, any>, TConf
33
35
  protected readonly logger: ReturnType<typeof LoggerFactory.get>;
34
36
  protected readonly clientConfig: ClientConfigService;
35
37
  protected readonly telemetry: TelemetryService;
38
+ protected readonly announcer: AnnouncerService;
36
39
  private initialized;
37
40
  private isDestroyed;
38
41
  private renderScheduled;
@@ -0,0 +1,22 @@
1
+ import { ApiClientService } from '@/core/api/api-client.service';
2
+ import { LoggerFactory } from '@/core/logger/logger-factory';
3
+ import { PubSubService } from '@/core/pubsub/pubsub.service';
4
+ import { StoreService } from '@/core/store/store.service';
5
+ import type { ILocation } from '@/interfaces/api/address.interface';
6
+ import type { IProductSizeEngraving, IProductVariant } from '@/interfaces/api/product.interface';
7
+ import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
8
+ export declare abstract class BaseActionService {
9
+ protected readonly pubSub: PubSubService;
10
+ protected readonly store: StoreService;
11
+ protected readonly api: ApiClientService;
12
+ protected readonly themeProvider: ThemeProviderService;
13
+ protected readonly logger: ReturnType<typeof LoggerFactory.get>;
14
+ constructor(loggerName: string);
15
+ protected getLocation(): ILocation | undefined;
16
+ protected sanitizeEngravingInput(rawLines: string[] | undefined, identifier: string): string[] | undefined;
17
+ protected clampEngravingToSizeLimits(requestedLines: string[], sizeEngraving: IProductSizeEngraving | undefined, identifier: string): string[] | undefined;
18
+ protected findVariantForFulfillment(variants: (IProductVariant | undefined)[], wantsEngraving: boolean): {
19
+ variant: IProductVariant | null;
20
+ engravingDropped: boolean;
21
+ };
22
+ }
@@ -0,0 +1,18 @@
1
+ import type { IAddressAddress, IAddressCoordinates, IAddressData } from '@/interfaces/api/address.interface';
2
+ import { BaseActionService } from './base-action.service';
3
+ export interface IAddressActions {
4
+ setAddressByPlacesId: (placesId: string) => Promise<void>;
5
+ setAddressManually: (address: IAddressAddress, coordinates: IAddressCoordinates) => Promise<void>;
6
+ clear: () => Promise<void>;
7
+ getDetails: () => IAddressData | null;
8
+ }
9
+ export declare class ClientAddressActionService extends BaseActionService {
10
+ private readonly command;
11
+ constructor();
12
+ static getInstance(): ClientAddressActionService;
13
+ get actions(): IAddressActions;
14
+ private setAddressByPlacesId;
15
+ private setAddressManually;
16
+ private clear;
17
+ private getDetails;
18
+ }
@@ -0,0 +1,38 @@
1
+ import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
2
+ import { type FulfillmentType } from '@/enums';
3
+ import { BaseActionService } from './base-action.service';
4
+ export interface IAddProductParams {
5
+ identifier: string;
6
+ fulfillmentType: FulfillmentType;
7
+ quantity: number;
8
+ engravingLines?: string[];
9
+ }
10
+ export interface ICartActions {
11
+ openCart: () => void;
12
+ closeCart: () => void;
13
+ toggleCart: () => void;
14
+ addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
15
+ applyPromoCode: (promoCode: string) => Promise<void>;
16
+ removePromoCode: () => Promise<void>;
17
+ resetCart: () => Promise<void>;
18
+ getDetails: () => IBaseCartEventData;
19
+ }
20
+ export declare class ClientCartActionService extends BaseActionService {
21
+ private readonly command;
22
+ private pendingCartParams;
23
+ private pendingCartOpenFlag;
24
+ constructor();
25
+ static getInstance(): ClientCartActionService;
26
+ get actions(): ICartActions;
27
+ private setupAddressUpdateListener;
28
+ private retryPendingCartOperation;
29
+ private clearPendingCartOperation;
30
+ private openCart;
31
+ private closeCart;
32
+ private toggleCart;
33
+ private addProduct;
34
+ private applyPromoCode;
35
+ private removePromoCode;
36
+ private resetCart;
37
+ private getDetails;
38
+ }
@@ -0,0 +1,69 @@
1
+ import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
2
+ import type { IAnonymousCheckoutAddProductParams, IAnonymousCheckoutAddProductResponse } from '@/interfaces/api/checkout.interface';
3
+ import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
4
+ import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
5
+ import { BaseActionService } from './base-action.service';
6
+ import type { IAddProductParams } from './client-cart-action.service';
7
+ export interface ISavedPaymentMethodInput {
8
+ id: string;
9
+ card: {
10
+ brand: string;
11
+ last4: string;
12
+ expMonth?: string | number;
13
+ expYear?: string | number;
14
+ };
15
+ }
16
+ export interface ICheckoutActions {
17
+ openCheckout: () => void;
18
+ closeCheckout: () => void;
19
+ toggleCheckout: () => void;
20
+ exitCheckout: () => void;
21
+ setSavedPaymentMethod: (params: ISavedPaymentMethodInput) => void;
22
+ clearSavedPaymentMethod: () => void;
23
+ addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
24
+ applyPromoCode: (promoCode: string) => Promise<void>;
25
+ removePromoCode: () => Promise<void>;
26
+ applyGiftCard: (code: string) => Promise<void>;
27
+ removeGiftCard: (code: string) => Promise<void>;
28
+ toggleIsGift: (active?: boolean) => Promise<void>;
29
+ toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
30
+ toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
31
+ updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
32
+ updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
33
+ updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
34
+ getDetails: () => ICheckoutDetailsEventData;
35
+ getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
36
+ addAnonymousProduct: (params: IAnonymousCheckoutAddProductParams) => Promise<IAnonymousCheckoutAddProductResponse>;
37
+ }
38
+ export declare class ClientCheckoutActionService extends BaseActionService {
39
+ private readonly command;
40
+ private readonly allowedCustomerFields;
41
+ private readonly allowedBillingFields;
42
+ private readonly allowedGiftFields;
43
+ private cartActionsAddProduct;
44
+ constructor();
45
+ static getInstance(): ClientCheckoutActionService;
46
+ setCartActionsAddProduct(addProductFn: (params: IAddProductParams[]) => Promise<void>): void;
47
+ get actions(): ICheckoutActions;
48
+ private normalizeCheckoutFieldValue;
49
+ private openCheckout;
50
+ private closeCheckout;
51
+ private toggleCheckout;
52
+ private exitCheckout;
53
+ private setSavedPaymentMethod;
54
+ private clearSavedPaymentMethod;
55
+ private addProduct;
56
+ private applyPromoCode;
57
+ private removePromoCode;
58
+ private applyGiftCard;
59
+ private removeGiftCard;
60
+ private toggleIsGift;
61
+ private toggleBillingSameAsShipping;
62
+ private toggleMarketingPreferences;
63
+ private updateCustomerInfo;
64
+ private updateBillingInfo;
65
+ private updateGiftInfo;
66
+ private getDetails;
67
+ private addAnonymousProduct;
68
+ private getProductAvailabilityByState;
69
+ }
@@ -0,0 +1,15 @@
1
+ import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
2
+ import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
3
+ import { BaseActionService } from './base-action.service';
4
+ export interface IProductActions {
5
+ getDetails: (identifier: string) => IBaseProductEventData;
6
+ getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
7
+ }
8
+ export declare class ClientProductActionService extends BaseActionService {
9
+ private readonly command;
10
+ constructor();
11
+ static getInstance(): ClientProductActionService;
12
+ get actions(): IProductActions;
13
+ private getDetails;
14
+ private getProductAvailabilityByState;
15
+ }
@@ -1,71 +1,10 @@
1
- import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
2
- import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
3
- import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
4
- import { type FulfillmentType } from '@/enums';
5
- import type { IAddress, ICoords } from '@/interfaces/cloud';
6
- import type { IAddressData } from '@/modules/address/address.interface';
7
- export interface IProductActions {
8
- getDetails: (identifier: string) => IBaseProductEventData;
9
- }
10
- export interface IAddressActions {
11
- setAddressByPlacesId: (placesId: string) => Promise<void>;
12
- setAddressManually: (address: Omit<IAddress, 'id'>, coordinates: ICoords) => Promise<void>;
13
- clear: () => Promise<void>;
14
- getDetails: () => IAddressData | null;
15
- }
16
- export interface IAddProductParams {
17
- identifier: string;
18
- fulfillmentType: FulfillmentType;
19
- quantity: number;
20
- }
21
- export interface ICartActions {
22
- openCart: () => void;
23
- closeCart: () => void;
24
- toggleCart: () => void;
25
- addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
26
- applyPromoCode: (promoCode: string) => Promise<void>;
27
- removePromoCode: () => Promise<void>;
28
- resetCart: () => Promise<void>;
29
- getDetails: () => IBaseCartEventData;
30
- }
31
- export interface ICheckoutActions {
32
- openCheckout: () => void;
33
- closeCheckout: () => void;
34
- toggleCheckout: () => void;
35
- addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
36
- addPresaleProduct: (params: IAddProductParams) => Promise<void>;
37
- applyPromoCode: (promoCode: string) => Promise<void>;
38
- removePromoCode: () => Promise<void>;
39
- applyGiftCard: (code: string) => Promise<void>;
40
- removeGiftCard: (code: string) => Promise<void>;
41
- toggleIsGift: (active?: boolean) => Promise<void>;
42
- toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
43
- toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => void;
44
- getDetails: () => ICheckoutDetailsEventData;
45
- }
1
+ import type { ILiquidCommerceElementsActions } from '@/interfaces/client.interface';
46
2
  export declare class ClientActionService {
47
- private readonly pubSub;
48
- private readonly command;
49
- private readonly store;
50
- private readonly api;
51
- private readonly themeProvider;
52
- private readonly logger;
53
- private pendingCartParams;
54
- private pendingCartOpenFlag;
3
+ private readonly productActionService;
4
+ private readonly addressActionService;
5
+ private readonly cartActionService;
6
+ private readonly checkoutActionService;
55
7
  constructor();
56
8
  static getInstance(): ClientActionService;
57
- private setupAddressUpdateListener;
58
- private retryPendingCartOperation;
59
- private clearPendingCartOperation;
60
- private getLocation;
61
- private productActions;
62
- private addressActions;
63
- private cartActions;
64
- private checkoutActions;
65
- actions: {
66
- product: IProductActions;
67
- address: IAddressActions;
68
- cart: ICartActions;
69
- checkout: ICheckoutActions;
70
- };
9
+ get actions(): ILiquidCommerceElementsActions;
71
10
  }
@@ -1,6 +1,6 @@
1
1
  import { type DebugMode, type ElementsEnv } from '@/enums';
2
+ import type { IClientCustomThemeConfig, IElementsProxyConfig, ILiquidCommerceElementsCheckoutConfig } from '@/interfaces/config.interface';
2
3
  import type { IPromoTicker } from '@/interfaces/configs';
3
- import type { IClientCustomThemeConfig, IElementsProxyConfig } from '@/interfaces/core.interface';
4
4
  export type DeviceType = 'desktop' | 'tablet' | 'mobile';
5
5
  export interface IClientConfigs {
6
6
  apiKey: string;
@@ -19,8 +19,11 @@ export interface IClientConfigs {
19
19
  version?: string;
20
20
  clientPrepared: boolean;
21
21
  promoTicker: IPromoTicker[] | null;
22
- paymentMethodId?: string;
23
22
  openShadowDom?: boolean;
23
+ hasCustomApiUrl?: boolean;
24
+ mockMode: boolean;
25
+ checkout: ILiquidCommerceElementsCheckoutConfig | null;
26
+ isCheckoutOnly: boolean;
24
27
  }
25
28
  export interface IClientConfigInput {
26
29
  env?: ElementsEnv;
@@ -31,9 +34,11 @@ export interface IClientConfigInput {
31
34
  promoTicker?: IPromoTicker[];
32
35
  development?: {
33
36
  customApiUrl?: string;
34
- paymentMethodId?: string;
35
37
  openShadowDom?: boolean;
38
+ mockMode?: boolean;
36
39
  };
40
+ checkout?: ILiquidCommerceElementsCheckoutConfig;
41
+ isCheckoutOnly?: boolean;
37
42
  }
38
43
  export declare class ClientConfigService {
39
44
  private config;
@@ -42,16 +47,15 @@ export declare class ClientConfigService {
42
47
  getConfigs(): IClientConfigs;
43
48
  get<K extends keyof IClientConfigs>(key: K): IClientConfigs[K];
44
49
  set<K extends keyof IClientConfigs>(key: K, value: IClientConfigs[K]): void;
45
- isDevelopment(): boolean;
46
50
  isStaging(): boolean;
47
51
  isProduction(): boolean;
48
52
  isBuilder(): boolean;
53
+ isCheckoutOnly(): boolean;
49
54
  isDebuggingEnabled(): boolean;
50
55
  isDebugPanelEnabled(): boolean;
51
56
  debuggingDisabled(): boolean;
52
57
  hasCustomTheme(): boolean;
53
58
  isMobile(): boolean;
54
- isLocalStorageAvailable(): boolean;
55
59
  getProxyConfig(): IElementsProxyConfig | null;
56
60
  private validateInputs;
57
61
  private buildConfiguration;
@@ -4,7 +4,7 @@ import { GoogleTagManagerService } from '@/core/google-tag-manager.service';
4
4
  import { LoggerFactory } from '@/core/logger/logger-factory';
5
5
  import { PubSubService } from '@/core/pubsub/pubsub.service';
6
6
  import { StoreService } from '@/core/store/store.service';
7
- import type { ILoc } from '@/interfaces/cloud';
7
+ import type { ILocation } from '@/interfaces/api/address.interface';
8
8
  import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
9
9
  export declare abstract class BaseCommand {
10
10
  protected store: StoreService;
@@ -15,5 +15,5 @@ export declare abstract class BaseCommand {
15
15
  protected clientConfig: ClientConfigService;
16
16
  protected themeProvider: ThemeProviderService;
17
17
  constructor();
18
- protected getLocation(): ILoc | undefined;
18
+ protected getLocation(): ILocation | undefined;
19
19
  }
@@ -1,7 +1,8 @@
1
- import type { ICart } from '@/interfaces/cloud';
1
+ import type { ICart } from '@/interfaces/api/cart.interface';
2
2
  import { BaseCommand } from './base-command.service';
3
3
  export declare class CommonCommands extends BaseCommand {
4
4
  static getInstance(): CommonCommands;
5
5
  syncCartFromResponse(cartApi: ICart, publishEvent?: boolean): void;
6
+ private buildCartLoadedEventData;
6
7
  loadCart(): Promise<void>;
7
8
  }
@@ -6,10 +6,11 @@ declare global {
6
6
  }
7
7
  interface GTMConfig {
8
8
  partnerName: string;
9
- partnerGtmId?: string;
10
- partnerEnableGaTracking: boolean;
11
- liquidCommerceEnableGaTracking: boolean;
12
- liquidCommerceGtmId: string;
9
+ partnerCode: string;
10
+ partnerGTMId?: string;
11
+ enablePartnerGTM: boolean;
12
+ enableLiquidCommerceGTM: boolean;
13
+ liquidCommerceGTMId: string;
13
14
  }
14
15
  interface BaseItem {
15
16
  item_id?: string;
@@ -32,6 +33,7 @@ interface BaseItem {
32
33
  quantity?: number;
33
34
  item_type?: string;
34
35
  item_subtype?: string;
36
+ item_image?: string;
35
37
  upc?: string;
36
38
  grouping_id?: string;
37
39
  product_id?: string;
@@ -47,10 +49,11 @@ interface PurchaseData {
47
49
  }
48
50
  export declare class GoogleTagManagerService {
49
51
  private partnerName?;
50
- private partnerGtmId?;
51
- private liquidCommerceGtmId?;
52
- private partnerEnableGaTracking;
53
- private liquidCommerceEnableGaTracking;
52
+ private partnerCode?;
53
+ private partnerGTMId?;
54
+ private liquidCommerceGTMId?;
55
+ private enablePartnerGTM;
56
+ private enableLiquidCommerceGTM;
54
57
  private isInitialized;
55
58
  private isInitializing;
56
59
  private initializationPromise?;
@@ -60,6 +63,7 @@ export declare class GoogleTagManagerService {
60
63
  private readonly clientConfigService;
61
64
  constructor();
62
65
  static getInstance(): GoogleTagManagerService;
66
+ private isGTMEnabledEnvironment;
63
67
  private waitForDOMReady;
64
68
  private isGTMAlreadyLoaded;
65
69
  private isContainerLoaded;
@@ -91,7 +95,7 @@ export declare class GoogleTagManagerService {
91
95
  net_total?: number;
92
96
  }): void;
93
97
  promoCodeAttempt(code: string): void;
94
- promoCodeApplied(code: string, discountAmount?: number): void;
98
+ promoCodeApplied(code: string, discount?: number): void;
95
99
  promoCodeFailed(code: string, reason?: string): void;
96
100
  giftCardAttempt(code: string): void;
97
101
  giftCardApplied(code: string, appliedAmount?: number): void;
@@ -108,8 +112,8 @@ export declare class GoogleTagManagerService {
108
112
  country?: string;
109
113
  };
110
114
  coordinates?: {
111
- lat: number;
112
- long: number;
115
+ latitude: number;
116
+ longitude: number;
113
117
  };
114
118
  }): void;
115
119
  addressFailed(errorData: {
@@ -13,6 +13,6 @@ export declare class LoggerService {
13
13
  debug(message: string, data?: Record<string, any>): void;
14
14
  info(message: string, data?: Record<string, any>): void;
15
15
  warn(message: string, data?: Record<string, any>): void;
16
- error(message: string, error?: Error | Record<string, any>): void;
16
+ error(message: string, errorOrData?: Error | Record<string, any>): void;
17
17
  private sendToTelemetry;
18
18
  }
@@ -1,16 +1,10 @@
1
+ import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
1
2
  export interface IAddressActionEventData {
2
3
  googlePlacesId: string;
3
4
  formattedAddress: string;
4
- address: {
5
- one: string;
6
- two: string;
7
- city: string;
8
- state: string;
9
- zip: string;
10
- country: string;
11
- };
12
- coordinates: {
13
- lat: number;
14
- long: number;
15
- };
5
+ address: IAddressAddress;
6
+ coordinates: IAddressCoordinates;
7
+ }
8
+ export interface IAddressFailedEventData extends IAddressActionEventData {
9
+ error: string;
16
10
  }