@beamimpact/web-sdk 1.43.0 → 1.44.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/_share-dialog-dependencies-6qxEKq8s.esm.js +2 -0
- package/dist/chunks/_share-dialog-dependencies-6qxEKq8s.esm.js.map +1 -0
- package/dist/chunks/_share-dialog-dependencies-a05NZJ6I.esm.js +2 -0
- package/dist/chunks/_share-dialog-dependencies-a05NZJ6I.esm.js.map +1 -0
- package/dist/chunks/{cart-contents-WB1BF6hG.esm.d.ts → cart-contents-HAPzwbeL.esm.d.ts} +1 -1
- package/dist/chunks/{events-MfRTtTVm.esm.d.ts → events-fqRWfo7p.esm.d.ts} +1 -1
- package/dist/chunks/index-2fgoYcug.esm.js +2 -0
- package/dist/chunks/index-2fgoYcug.esm.js.map +1 -0
- package/dist/chunks/index-4mQhPzhb.esm.js +2 -0
- package/dist/chunks/index-4mQhPzhb.esm.js.map +1 -0
- package/dist/chunks/{index-UggwPn9Q.esm.d.ts → index-7mukhxz_.esm.d.ts} +1 -1
- package/dist/chunks/index-BL75MsEt.esm.js +2 -0
- package/dist/chunks/index-BL75MsEt.esm.js.map +1 -0
- package/dist/chunks/{index-OaRsZJh7.esm.d.ts → index-JG4nmG9U.esm.d.ts} +1 -1
- package/dist/chunks/{index-0nQiFQrd.esm.js → index-Kz977KkP.esm.js} +2 -2
- package/dist/chunks/{index-0nQiFQrd.esm.js.map → index-Kz977KkP.esm.js.map} +1 -1
- package/dist/chunks/{index-B9w02q6y.esm.d.ts → index-MSoONvC5.esm.d.ts} +1 -1
- package/dist/chunks/index-MewTlHYO.esm.js +2 -0
- package/dist/chunks/index-MewTlHYO.esm.js.map +1 -0
- package/dist/chunks/{index-uqNCQVUx.esm.d.ts → index-SExnliMs.esm.d.ts} +1 -1
- package/dist/chunks/index-mbNUaby9.esm.js +2 -0
- package/dist/chunks/index-mbNUaby9.esm.js.map +1 -0
- package/dist/chunks/index-qt5iD9Ok.esm.d.ts +14 -0
- package/dist/chunks/{index-AaWfjJG7.esm.js → index-tV7ZK858.esm.js} +2 -2
- package/dist/chunks/{index-AaWfjJG7.esm.js.map → index-tV7ZK858.esm.js.map} +1 -1
- package/dist/chunks/{index-ozcDdIom.esm.d.ts → index-tdUx2WLc.esm.d.ts} +4 -4
- package/dist/chunks/index-vNBrw3_d.esm.js +2 -0
- package/dist/chunks/index-vNBrw3_d.esm.js.map +1 -0
- package/dist/chunks/{openapi-spec-GGEBbqAJ.esm.d.ts → openapi-spec-RlP2IT1i.esm.d.ts} +87 -33
- package/dist/chunks/{order-page-LvE0Otsn.esm.d.ts → order-page-FLhpaZg2.esm.d.ts} +4 -4
- package/dist/chunks/order-page-zPVHsu6v.esm.js +2 -0
- package/dist/chunks/order-page-zPVHsu6v.esm.js.map +1 -0
- package/dist/chunks/order-page-zYoubhg4.esm.js +2 -0
- package/dist/chunks/order-page-zYoubhg4.esm.js.map +1 -0
- package/dist/chunks/{promo-pill-label-3Xtr5ALT.esm.js → promo-pill-label-81dVN7VY.esm.js} +4 -3
- package/dist/chunks/promo-pill-label-81dVN7VY.esm.js.map +1 -0
- package/dist/chunks/{routes-2U31lJuH.esm.js → routes-4Mnz2XZX.esm.js} +2 -2
- package/dist/chunks/{routes-2U31lJuH.esm.js.map → routes-4Mnz2XZX.esm.js.map} +1 -1
- package/dist/chunks/{routes-wCCYf_uA.esm.d.ts → routes-NIuAzAOC.esm.d.ts} +3 -1
- package/dist/chunks/{routes-nWhY4Rgg.esm.js → routes-eIRRJ7c1.esm.js} +2 -2
- package/dist/chunks/{routes-nWhY4Rgg.esm.js.map → routes-eIRRJ7c1.esm.js.map} +1 -1
- package/dist/chunks/{share-button--FOuz6Ka.esm.js → share-button-9d9kTwmG.esm.js} +2 -2
- package/dist/chunks/{share-button--FOuz6Ka.esm.js.map → share-button-9d9kTwmG.esm.js.map} +1 -1
- package/dist/chunks/{share-button-t0XcS-C-.esm.js → share-button-PJlajTPi.esm.js} +2 -2
- package/dist/chunks/{share-button-t0XcS-C-.esm.js.map → share-button-PJlajTPi.esm.js.map} +1 -1
- package/dist/chunks/{shoelace-components-DDO9begn.esm.js → shoelace-components-A9MnfNMD.esm.js} +2 -2
- package/dist/chunks/{shoelace-components-DDO9begn.esm.js.map → shoelace-components-A9MnfNMD.esm.js.map} +1 -1
- package/dist/chunks/{shoelace-components-qmUjB2xP.esm.js → shoelace-components-c53kUkO2.esm.js} +2 -2
- package/dist/chunks/{shoelace-components-qmUjB2xP.esm.js.map → shoelace-components-c53kUkO2.esm.js.map} +1 -1
- package/dist/chunks/{update-cart-tjLR7pMx.esm.d.ts → update-cart-Hebtxhto.esm.d.ts} +1 -1
- package/dist/chunks/update-cart-SPqvT31b.esm.js +2 -0
- package/dist/chunks/update-cart-SPqvT31b.esm.js.map +1 -0
- package/dist/chunks/update-cart-ZuRyrnAL.esm.js +2 -0
- package/dist/chunks/update-cart-ZuRyrnAL.esm.js.map +1 -0
- package/dist/components/community-impact.d.ts +1 -0
- package/dist/components/community-impact.esm.js +13 -13
- package/dist/components/community-impact.esm.js.map +1 -1
- package/dist/components/community-impact.js +13 -13
- package/dist/components/community-impact.js.map +1 -1
- package/dist/components/cumulative-impact.d.ts +1 -0
- package/dist/components/cumulative-impact.esm.js +3 -3
- package/dist/components/cumulative-impact.esm.js.map +1 -1
- package/dist/components/cumulative-impact.js +3 -3
- package/dist/components/cumulative-impact.js.map +1 -1
- package/dist/components/impact-overview.d.ts +1 -0
- package/dist/components/impact-overview.esm.js +3 -3
- package/dist/components/impact-overview.esm.js.map +1 -1
- package/dist/components/impact-overview.js +3 -3
- package/dist/components/impact-overview.js.map +1 -1
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/post-purchase.d.ts +4 -3
- package/dist/components/post-purchase.esm.js +4 -2
- package/dist/components/post-purchase.esm.js.map +1 -1
- package/dist/components/post-purchase.js +4 -2
- package/dist/components/post-purchase.js.map +1 -1
- package/dist/components/product-details-page.d.ts +2 -1
- package/dist/components/product-details-page.esm.js +3 -3
- package/dist/components/product-details-page.esm.js.map +1 -1
- package/dist/components/product-details-page.js +3 -3
- package/dist/components/product-details-page.js.map +1 -1
- package/dist/components/redeem-transaction.d.ts +4 -3
- package/dist/components/redeem-transaction.esm.js +15 -15
- package/dist/components/redeem-transaction.esm.js.map +1 -1
- package/dist/components/redeem-transaction.js +15 -15
- package/dist/components/redeem-transaction.js.map +1 -1
- package/dist/components/select-nonprofit.d.ts +7 -5
- package/dist/components/select-nonprofit.esm.js +34 -22
- package/dist/components/select-nonprofit.esm.js.map +1 -1
- package/dist/components/select-nonprofit.js +34 -22
- package/dist/components/select-nonprofit.js.map +1 -1
- package/dist/components/select-subscription-nonprofit.d.ts +2 -1
- package/dist/components/select-subscription-nonprofit.esm.js +4 -4
- package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
- package/dist/components/select-subscription-nonprofit.js +4 -4
- package/dist/components/select-subscription-nonprofit.js.map +1 -1
- package/dist/components/shopify.d.ts +6 -6
- package/dist/components/shopify.esm.js +1 -1
- package/dist/components/shopify.esm.js.map +1 -1
- package/dist/components/shopify.js +1 -1
- package/dist/components/shopify.js.map +1 -1
- package/dist/components/social-share.esm.js +1 -1
- package/dist/components/social-share.esm.js.map +1 -1
- package/dist/components/social-share.js +1 -1
- package/dist/components/social-share.js.map +1 -1
- package/dist/components/subscription-impact.d.ts +2 -1
- package/dist/components/subscription-impact.esm.js +6 -6
- package/dist/components/subscription-impact.esm.js.map +1 -1
- package/dist/components/subscription-impact.js +6 -6
- package/dist/components/subscription-impact.js.map +1 -1
- package/dist/components/subscription-management.d.ts +5 -4
- package/dist/components/subscription-management.esm.js +4 -2
- package/dist/components/subscription-management.esm.js.map +1 -1
- package/dist/components/subscription-management.js +4 -2
- package/dist/components/subscription-management.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/beam.esm.js +1 -1
- package/dist/integrations/beam.js +1 -1
- package/dist/integrations/cart.d.ts +3 -3
- package/dist/integrations/cart.esm.js +1 -1
- package/dist/integrations/cart.js +1 -1
- package/dist/integrations/index.d.ts +10 -10
- package/dist/integrations/index.esm.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/logs.d.ts +2 -2
- package/dist/integrations/logs.esm.js +1 -1
- package/dist/integrations/logs.js +1 -1
- package/dist/integrations/shopify.d.ts +5 -5
- package/dist/integrations/shopify.esm.js +1 -1
- package/dist/integrations/shopify.js +1 -1
- package/dist/integrations/statsig.esm.js +14 -14
- package/dist/integrations/statsig.esm.js.map +1 -1
- package/dist/integrations/statsig.js +14 -14
- package/dist/integrations/statsig.js.map +1 -1
- package/dist/integrations/utils.d.ts +3 -3
- package/dist/react/community-impact.esm.js +1 -1
- package/dist/react/community-impact.js +1 -1
- package/dist/react/cumulative-impact.esm.js +1 -1
- package/dist/react/cumulative-impact.js +1 -1
- package/dist/react/impact-overview.esm.js +1 -1
- package/dist/react/impact-overview.js +1 -1
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.esm.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/post-purchase.d.ts +2 -2
- package/dist/react/post-purchase.esm.js +1 -1
- package/dist/react/post-purchase.js +1 -1
- package/dist/react/product-details-page.esm.js +1 -1
- package/dist/react/product-details-page.js +1 -1
- package/dist/react/redeem-transaction.d.ts +3 -3
- package/dist/react/redeem-transaction.esm.js +1 -1
- package/dist/react/redeem-transaction.js +1 -1
- package/dist/react/select-nonprofit.d.ts +4 -3
- package/dist/react/select-nonprofit.esm.js +1 -1
- package/dist/react/select-nonprofit.esm.js.map +1 -1
- package/dist/react/select-nonprofit.js +1 -1
- package/dist/react/select-nonprofit.js.map +1 -1
- package/dist/react/select-subscription-nonprofit.d.ts +3 -3
- package/dist/react/select-subscription-nonprofit.esm.js +1 -1
- package/dist/react/select-subscription-nonprofit.js +1 -1
- package/dist/react/social-share.esm.js +1 -1
- package/dist/react/social-share.js +1 -1
- package/dist/react/subscription-impact.esm.js +1 -1
- package/dist/react/subscription-impact.js +1 -1
- package/dist/react/subscription-management.d.ts +3 -3
- package/dist/react/subscription-management.esm.js +1 -1
- package/dist/react/subscription-management.js +1 -1
- package/dist/utils/cart.d.ts +18 -0
- package/dist/utils/cart.esm.js +2 -0
- package/dist/utils/cart.esm.js.map +1 -0
- package/dist/utils/cart.js +2 -0
- package/dist/utils/cart.js.map +1 -0
- package/dist/utils/events.d.ts +3 -3
- package/dist/utils/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/chunks/_share-dialog-dependencies-rnsPzR3i.esm.js +0 -2
- package/dist/chunks/_share-dialog-dependencies-rnsPzR3i.esm.js.map +0 -1
- package/dist/chunks/_share-dialog-dependencies-wDg8oxHJ.esm.js +0 -2
- package/dist/chunks/_share-dialog-dependencies-wDg8oxHJ.esm.js.map +0 -1
- package/dist/chunks/index-1Z7n574A.esm.js +0 -2
- package/dist/chunks/index-1Z7n574A.esm.js.map +0 -1
- package/dist/chunks/index-4HR3T_6I.esm.js +0 -2
- package/dist/chunks/index-4HR3T_6I.esm.js.map +0 -1
- package/dist/chunks/index-ZN8EcPhA.esm.js +0 -2
- package/dist/chunks/index-ZN8EcPhA.esm.js.map +0 -1
- package/dist/chunks/index-evgmVzj9.esm.js +0 -2
- package/dist/chunks/index-evgmVzj9.esm.js.map +0 -1
- package/dist/chunks/index-m0mhJhiY.esm.js +0 -2
- package/dist/chunks/index-m0mhJhiY.esm.js.map +0 -1
- package/dist/chunks/index-ndhJISxP.esm.js +0 -2
- package/dist/chunks/index-ndhJISxP.esm.js.map +0 -1
- package/dist/chunks/index-yeW2w5bb.esm.d.ts +0 -13
- package/dist/chunks/order-page-A2VpvPTA.esm.js +0 -2
- package/dist/chunks/order-page-A2VpvPTA.esm.js.map +0 -1
- package/dist/chunks/order-page-n_PrxspK.esm.js +0 -2
- package/dist/chunks/order-page-n_PrxspK.esm.js.map +0 -1
- package/dist/chunks/promo-pill-label-3Xtr5ALT.esm.js.map +0 -1
- package/dist/chunks/update-cart-4A6AXGhP.esm.js +0 -2
- package/dist/chunks/update-cart-4A6AXGhP.esm.js.map +0 -1
- package/dist/chunks/update-cart-oxNW7D6U.esm.js +0 -2
- package/dist/chunks/update-cart-oxNW7D6U.esm.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_share-dialog-dependencies-6qxEKq8s.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./vendor--f7lkyBk.esm.js";import"./shoelace-components-A9MnfNMD.esm.js";import"./lit-3QHn3fwl.esm.js";import"./routes-4Mnz2XZX.esm.js";import"./beam-errors-P-Lu07Ce.esm.js";import"../utils/logger.esm.js";
|
|
2
|
+
//# sourceMappingURL=_share-dialog-dependencies-a05NZJ6I.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_share-dialog-dependencies-a05NZJ6I.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as paths } from './openapi-spec-
|
|
1
|
+
import { p as paths } from './openapi-spec-RlP2IT1i.esm.js';
|
|
2
2
|
|
|
3
3
|
type TCartApi = paths["/chain/findEligibleNonprofitsForCart"]["post"]["requestBody"]["content"]["application/json"]["cart"];
|
|
4
4
|
type TCart = TCartApi & {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,w as r,J as t,s as a,q as o}from"./order-page-zYoubhg4.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
|
|
2
|
+
//# sourceMappingURL=index-2fgoYcug.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-2fgoYcug.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i}from"./index-z8c9I9IQ.esm.js";import{i as o}from"./index-2fgoYcug.esm.js";import{i as r}from"./index-mw70Caof.esm.js";import{i as e}from"./index-mbNUaby9.esm.js";import{i as m}from"./index-Kz977KkP.esm.js";var s=Object.freeze({__proto__:null,Cart:e,Logs:m,Session:r,Shopify:o,Utils:i});export{s as i};
|
|
2
|
+
//# sourceMappingURL=index-4mQhPzhb.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-4mQhPzhb.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BeamCartAPIConfig, a as BeamCartValues, u as updateCart } from './update-cart-
|
|
1
|
+
import { B as BeamCartAPIConfig, a as BeamCartValues, u as updateCart } from './update-cart-Hebtxhto.esm.js';
|
|
2
2
|
|
|
3
3
|
declare const index_BeamCartAPIConfig: typeof BeamCartAPIConfig;
|
|
4
4
|
declare const index_BeamCartValues: typeof BeamCartValues;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i}from"./index-x2kxA_Xo.esm.js";import{i as o}from"./index-vNBrw3_d.esm.js";import{i as r}from"./index-1nI7l5vj.esm.js";import{i as e}from"./index-MewTlHYO.esm.js";import{i as m}from"./index-tV7ZK858.esm.js";var s=Object.freeze({__proto__:null,Cart:e,Logs:m,Session:r,Shopify:o,Utils:i});export{s as i};
|
|
2
|
+
//# sourceMappingURL=index-BL75MsEt.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BL75MsEt.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,c as n}from"./routes-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{a as i,c as n}from"./routes-4Mnz2XZX.esm.js";import{logger as c}from"../utils/logger.esm.js";async function e(o,r){const{apiKey:a,baseUrl:s}=o;try{await n({baseUrl:s||i,headers:{authorization:`Api-Key ${a}`},requestBody:{...r}})}catch(t){c.error("Failed to send log",t)}}var d=Object.freeze({__proto__:null,sendLog:e});export{d as i,e as s};
|
|
2
|
+
//# sourceMappingURL=index-Kz977KkP.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-Kz977KkP.esm.js","sources":["../../src/integrations/logs/index.ts"],"sourcesContent":["import { postLogs } from \"../../api-sdk/v3/routes\";\nimport { paths } from \"../../api-sdk/v3/openapi-spec\";\nimport { logger } from \"../../utils/logger\";\nimport { DEFAULT_LOG_URL } from \"../../api-sdk/constants\";\n\ntype PostLogsReq = paths[\"/logs\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\ninterface SendLogConfig {\n apiKey: string;\n baseUrl?: string;\n}\n\nexport async function sendLog(config: SendLogConfig, payload: PostLogsReq): Promise<void> {\n const { apiKey, baseUrl } = config;\n try {\n await postLogs({\n baseUrl: baseUrl || DEFAULT_LOG_URL,\n headers: {\n authorization: `Api-Key ${apiKey}`,\n },\n requestBody: {\n ...payload,\n },\n });\n } catch (err) {\n logger.error(\"Failed to send log\", err);\n }\n}\n"],"names":["sendLog","config","payload","apiKey","baseUrl","postLogs","DEFAULT_LOG_URL","err","logger"],"mappings":"oGAYA,eAAsBA,EAAQC,EAAuBC,EAAqC,CACxF,KAAM,CAAE,OAAAC,EAAQ,QAAAC,CAAQ,EAAIH,EAC5B,GAAI,CACF,MAAMI,EAAS,CACb,QAASD,GAAWE,EACpB,QAAS,CACP,cAAe,WAAWH,CAAM,EAClC,EACA,YAAa,CACX,GAAGD,CACL,CACF,CAAC,CACH,OAASK,EAAK,CACZC,EAAO,MAAM,qBAAsBD,CAAG,CACxC,CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as beamErrors } from './beam-errors-fXDkG1zo.esm.js';
|
|
2
|
-
import { e as events } from './events-
|
|
2
|
+
import { e as events } from './events-fqRWfo7p.esm.js';
|
|
3
3
|
import { logger } from '../utils/logger.js';
|
|
4
4
|
import { fetchProxy, initNetworkListeners, xhrProxy } from '../utils/network-listeners.js';
|
|
5
5
|
import { createScopedLocalStorage } from '../utils/local-storage.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-MewTlHYO.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as beamErrors } from './beam-errors-fXDkG1zo.esm.js';
|
|
2
|
-
import { e as events } from './events-
|
|
2
|
+
import { e as events } from './events-fqRWfo7p.esm.js';
|
|
3
3
|
import { logger } from '../utils/logger.js';
|
|
4
4
|
import { fetchProxy, initNetworkListeners, xhrProxy } from '../utils/network-listeners.js';
|
|
5
5
|
import { createScopedLocalStorage } from '../utils/local-storage.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-mbNUaby9.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { B as BeamShopifyCartIntegrationConfig, T as TBeamOrderPageParams, a as addBeamAttributesToCart, g as getCurrentCart, r as registerCartIntegration, s as showBeamOrderPageWidgets, t as trackCart } from './order-page-FLhpaZg2.esm.js';
|
|
2
|
+
|
|
3
|
+
declare const index_BeamShopifyCartIntegrationConfig: typeof BeamShopifyCartIntegrationConfig;
|
|
4
|
+
declare const index_TBeamOrderPageParams: typeof TBeamOrderPageParams;
|
|
5
|
+
declare const index_addBeamAttributesToCart: typeof addBeamAttributesToCart;
|
|
6
|
+
declare const index_getCurrentCart: typeof getCurrentCart;
|
|
7
|
+
declare const index_registerCartIntegration: typeof registerCartIntegration;
|
|
8
|
+
declare const index_showBeamOrderPageWidgets: typeof showBeamOrderPageWidgets;
|
|
9
|
+
declare const index_trackCart: typeof trackCart;
|
|
10
|
+
declare namespace index {
|
|
11
|
+
export { index_BeamShopifyCartIntegrationConfig as BeamShopifyCartIntegrationConfig, index_TBeamOrderPageParams as TBeamOrderPageParams, index_addBeamAttributesToCart as addBeamAttributesToCart, index_getCurrentCart as getCurrentCart, index_registerCartIntegration as registerCartIntegration, index_showBeamOrderPageWidgets as showBeamOrderPageWidgets, index_trackCart as trackCart };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { index as i };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,c as n}from"./routes-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{a as i,c as n}from"./routes-eIRRJ7c1.esm.js";import{logger as c}from"../utils/logger.js";async function e(o,r){const{apiKey:a,baseUrl:s}=o;try{await n({baseUrl:s||i,headers:{authorization:`Api-Key ${a}`},requestBody:{...r}})}catch(t){c.error("Failed to send log",t)}}var d=Object.freeze({__proto__:null,sendLog:e});export{d as i,e as s};
|
|
2
|
+
//# sourceMappingURL=index-tV7ZK858.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-tV7ZK858.esm.js","sources":["../../src/integrations/logs/index.ts"],"sourcesContent":["import { postLogs } from \"../../api-sdk/v3/routes\";\nimport { paths } from \"../../api-sdk/v3/openapi-spec\";\nimport { logger } from \"../../utils/logger\";\nimport { DEFAULT_LOG_URL } from \"../../api-sdk/constants\";\n\ntype PostLogsReq = paths[\"/logs\"][\"post\"][\"requestBody\"][\"content\"][\"application/json\"];\n\ninterface SendLogConfig {\n apiKey: string;\n baseUrl?: string;\n}\n\nexport async function sendLog(config: SendLogConfig, payload: PostLogsReq): Promise<void> {\n const { apiKey, baseUrl } = config;\n try {\n await postLogs({\n baseUrl: baseUrl || DEFAULT_LOG_URL,\n headers: {\n authorization: `Api-Key ${apiKey}`,\n },\n requestBody: {\n ...payload,\n },\n });\n } catch (err) {\n logger.error(\"Failed to send log\", err);\n }\n}\n"],"names":["sendLog","config","payload","apiKey","baseUrl","postLogs","DEFAULT_LOG_URL","err","logger"],"mappings":"gGAYA,eAAsBA,EAAQC,EAAuBC,EAAqC,CACxF,KAAM,CAAE,OAAAC,EAAQ,QAAAC,CAAQ,EAAIH,EAC5B,GAAI,CACF,MAAMI,EAAS,CACb,QAASD,GAAWE,EACpB,QAAS,CACP,cAAe,WAAWH,CAAM,EAClC,EACA,YAAa,CACX,GAAGD,CACL,CACF,CAAC,CACH,OAASK,EAAK,CACZC,EAAO,MAAM,qBAAsBD,CAAG,CACxC,CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as index$5 } from './index-
|
|
2
|
-
import { i as index$4 } from './index-
|
|
1
|
+
import { i as index$5 } from './index-MSoONvC5.esm.js';
|
|
2
|
+
import { i as index$4 } from './index-qt5iD9Ok.esm.js';
|
|
3
3
|
import { i as index$3 } from './index-EGiUuWe-.esm.js';
|
|
4
|
-
import { i as index$1 } from './index-
|
|
5
|
-
import { i as index$2 } from './index-
|
|
4
|
+
import { i as index$1 } from './index-7mukhxz_.esm.js';
|
|
5
|
+
import { i as index$2 } from './index-JG4nmG9U.esm.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* This file is used to provide type definitions
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,w as r,J as t,s as a,q as o}from"./order-page-zPVHsu6v.esm.js";var s=Object.freeze({__proto__:null,addBeamAttributesToCart:e,getCurrentCart:r,registerCartIntegration:t,showBeamOrderPageWidgets:a,trackCart:o});export{s as i};
|
|
2
|
+
//# sourceMappingURL=index-vNBrw3_d.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-vNBrw3_d.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -69,7 +69,7 @@ interface paths {
|
|
|
69
69
|
promoDescriptionPrefix?: string;
|
|
70
70
|
/**
|
|
71
71
|
* @description The promo description for the widget for web
|
|
72
|
-
* @example
|
|
72
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
73
73
|
*/
|
|
74
74
|
promoDescription?: string;
|
|
75
75
|
/**
|
|
@@ -132,7 +132,7 @@ interface paths {
|
|
|
132
132
|
title: string;
|
|
133
133
|
/**
|
|
134
134
|
* @description Subtitle/description for the widget
|
|
135
|
-
* @example
|
|
135
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
136
136
|
*/
|
|
137
137
|
description: string;
|
|
138
138
|
/**
|
|
@@ -154,7 +154,7 @@ interface paths {
|
|
|
154
154
|
title: string;
|
|
155
155
|
/**
|
|
156
156
|
* @description Subtitle/description for the widget
|
|
157
|
-
* @example
|
|
157
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
158
158
|
*/
|
|
159
159
|
description: string;
|
|
160
160
|
/**
|
|
@@ -316,6 +316,8 @@ interface paths {
|
|
|
316
316
|
/** Language code. */
|
|
317
317
|
lang?: "en" | "fr" | "de" | "es" | "it" | "pl";
|
|
318
318
|
version: string;
|
|
319
|
+
/** When set to true, draft themes are returned */
|
|
320
|
+
draftConfig?: boolean;
|
|
319
321
|
};
|
|
320
322
|
};
|
|
321
323
|
responses: {
|
|
@@ -364,7 +366,7 @@ interface paths {
|
|
|
364
366
|
promoDescriptionPrefix?: string;
|
|
365
367
|
/**
|
|
366
368
|
* @description The promo description for the widget for web
|
|
367
|
-
* @example
|
|
369
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
368
370
|
*/
|
|
369
371
|
promoDescription?: string;
|
|
370
372
|
/**
|
|
@@ -427,7 +429,7 @@ interface paths {
|
|
|
427
429
|
title: string;
|
|
428
430
|
/**
|
|
429
431
|
* @description Subtitle/description for the widget
|
|
430
|
-
* @example
|
|
432
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
431
433
|
*/
|
|
432
434
|
description: string;
|
|
433
435
|
/**
|
|
@@ -449,7 +451,7 @@ interface paths {
|
|
|
449
451
|
title: string;
|
|
450
452
|
/**
|
|
451
453
|
* @description Subtitle/description for the widget
|
|
452
|
-
* @example
|
|
454
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
453
455
|
*/
|
|
454
456
|
description: string;
|
|
455
457
|
/**
|
|
@@ -601,7 +603,7 @@ interface paths {
|
|
|
601
603
|
promoDescriptionPrefix?: string;
|
|
602
604
|
/**
|
|
603
605
|
* @description The promo description for the widget for web
|
|
604
|
-
* @example
|
|
606
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
605
607
|
*/
|
|
606
608
|
promoDescription?: string;
|
|
607
609
|
/**
|
|
@@ -664,7 +666,7 @@ interface paths {
|
|
|
664
666
|
title: string;
|
|
665
667
|
/**
|
|
666
668
|
* @description Subtitle/description for the widget
|
|
667
|
-
* @example
|
|
669
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
668
670
|
*/
|
|
669
671
|
description: string;
|
|
670
672
|
/**
|
|
@@ -686,7 +688,7 @@ interface paths {
|
|
|
686
688
|
title: string;
|
|
687
689
|
/**
|
|
688
690
|
* @description Subtitle/description for the widget
|
|
689
|
-
* @example
|
|
691
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
690
692
|
*/
|
|
691
693
|
description: string;
|
|
692
694
|
/**
|
|
@@ -958,6 +960,7 @@ interface paths {
|
|
|
958
960
|
config?: {
|
|
959
961
|
/** @description Removes the themes object from the remote config object in the response. */
|
|
960
962
|
omitThemes?: boolean;
|
|
963
|
+
draftConfig?: boolean;
|
|
961
964
|
};
|
|
962
965
|
};
|
|
963
966
|
};
|
|
@@ -986,7 +989,9 @@ interface paths {
|
|
|
986
989
|
/** Language code. */
|
|
987
990
|
lang?: "en" | "fr" | "de" | "es" | "it" | "pl";
|
|
988
991
|
/** When set to true, themes are removed from widget config objects */
|
|
989
|
-
|
|
992
|
+
omitThemes?: boolean;
|
|
993
|
+
/** When set to true, draft themes are returned */
|
|
994
|
+
draftConfig?: boolean;
|
|
990
995
|
/** Discount codes applied to the order */
|
|
991
996
|
discountCodes?: string[];
|
|
992
997
|
/** The transactionId of the purchase */
|
|
@@ -1043,7 +1048,7 @@ interface paths {
|
|
|
1043
1048
|
promoDescriptionPrefix?: string;
|
|
1044
1049
|
/**
|
|
1045
1050
|
* @description The promo description for the widget for web
|
|
1046
|
-
* @example
|
|
1051
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
1047
1052
|
*/
|
|
1048
1053
|
promoDescription?: string;
|
|
1049
1054
|
/**
|
|
@@ -1106,7 +1111,7 @@ interface paths {
|
|
|
1106
1111
|
title: string;
|
|
1107
1112
|
/**
|
|
1108
1113
|
* @description Subtitle/description for the widget
|
|
1109
|
-
* @example
|
|
1114
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
1110
1115
|
*/
|
|
1111
1116
|
description: string;
|
|
1112
1117
|
/**
|
|
@@ -1128,7 +1133,7 @@ interface paths {
|
|
|
1128
1133
|
title: string;
|
|
1129
1134
|
/**
|
|
1130
1135
|
* @description Subtitle/description for the widget
|
|
1131
|
-
* @example
|
|
1136
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
1132
1137
|
*/
|
|
1133
1138
|
description: string;
|
|
1134
1139
|
/**
|
|
@@ -1418,7 +1423,7 @@ interface paths {
|
|
|
1418
1423
|
promoDescriptionPrefix?: string;
|
|
1419
1424
|
/**
|
|
1420
1425
|
* @description The promo description for the widget for web
|
|
1421
|
-
* @example
|
|
1426
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
1422
1427
|
*/
|
|
1423
1428
|
promoDescription?: string;
|
|
1424
1429
|
/**
|
|
@@ -1481,7 +1486,7 @@ interface paths {
|
|
|
1481
1486
|
title: string;
|
|
1482
1487
|
/**
|
|
1483
1488
|
* @description Subtitle/description for the widget
|
|
1484
|
-
* @example
|
|
1489
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
1485
1490
|
*/
|
|
1486
1491
|
description: string;
|
|
1487
1492
|
/**
|
|
@@ -1503,7 +1508,7 @@ interface paths {
|
|
|
1503
1508
|
title: string;
|
|
1504
1509
|
/**
|
|
1505
1510
|
* @description Subtitle/description for the widget
|
|
1506
|
-
* @example
|
|
1511
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
1507
1512
|
*/
|
|
1508
1513
|
description: string;
|
|
1509
1514
|
/**
|
|
@@ -2702,6 +2707,7 @@ interface paths {
|
|
|
2702
2707
|
config?: {
|
|
2703
2708
|
/** @description Removes the themes object from the remote config object in the response. */
|
|
2704
2709
|
omitThemes?: boolean;
|
|
2710
|
+
draftConfig?: boolean;
|
|
2705
2711
|
};
|
|
2706
2712
|
};
|
|
2707
2713
|
/** @enum {string} */
|
|
@@ -2851,7 +2857,7 @@ interface paths {
|
|
|
2851
2857
|
promoDescriptionPrefix?: string;
|
|
2852
2858
|
/**
|
|
2853
2859
|
* @description The promo description for the widget for web
|
|
2854
|
-
* @example
|
|
2860
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
2855
2861
|
*/
|
|
2856
2862
|
promoDescription?: string;
|
|
2857
2863
|
/**
|
|
@@ -2914,7 +2920,7 @@ interface paths {
|
|
|
2914
2920
|
title: string;
|
|
2915
2921
|
/**
|
|
2916
2922
|
* @description Subtitle/description for the widget
|
|
2917
|
-
* @example
|
|
2923
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
2918
2924
|
*/
|
|
2919
2925
|
description: string;
|
|
2920
2926
|
/**
|
|
@@ -2936,7 +2942,7 @@ interface paths {
|
|
|
2936
2942
|
title: string;
|
|
2937
2943
|
/**
|
|
2938
2944
|
* @description Subtitle/description for the widget
|
|
2939
|
-
* @example
|
|
2945
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
2940
2946
|
*/
|
|
2941
2947
|
description: string;
|
|
2942
2948
|
/**
|
|
@@ -3352,6 +3358,7 @@ interface paths {
|
|
|
3352
3358
|
config?: {
|
|
3353
3359
|
/** @description Removes the themes object from the remote config object in the response. */
|
|
3354
3360
|
omitThemes?: boolean;
|
|
3361
|
+
draftConfig?: boolean;
|
|
3355
3362
|
};
|
|
3356
3363
|
};
|
|
3357
3364
|
}>;
|
|
@@ -3658,7 +3665,7 @@ interface paths {
|
|
|
3658
3665
|
promoDescriptionPrefix?: string;
|
|
3659
3666
|
/**
|
|
3660
3667
|
* @description The promo description for the widget for web
|
|
3661
|
-
* @example
|
|
3668
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3662
3669
|
*/
|
|
3663
3670
|
promoDescription?: string;
|
|
3664
3671
|
/**
|
|
@@ -3721,7 +3728,7 @@ interface paths {
|
|
|
3721
3728
|
title: string;
|
|
3722
3729
|
/**
|
|
3723
3730
|
* @description Subtitle/description for the widget
|
|
3724
|
-
* @example
|
|
3731
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3725
3732
|
*/
|
|
3726
3733
|
description: string;
|
|
3727
3734
|
/**
|
|
@@ -3743,7 +3750,7 @@ interface paths {
|
|
|
3743
3750
|
title: string;
|
|
3744
3751
|
/**
|
|
3745
3752
|
* @description Subtitle/description for the widget
|
|
3746
|
-
* @example
|
|
3753
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3747
3754
|
*/
|
|
3748
3755
|
description: string;
|
|
3749
3756
|
/**
|
|
@@ -3779,7 +3786,7 @@ interface paths {
|
|
|
3779
3786
|
promoDescriptionPrefix?: string;
|
|
3780
3787
|
/**
|
|
3781
3788
|
* @description The promo description for the widget for web
|
|
3782
|
-
* @example
|
|
3789
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3783
3790
|
*/
|
|
3784
3791
|
promoDescription?: string;
|
|
3785
3792
|
/**
|
|
@@ -3842,7 +3849,7 @@ interface paths {
|
|
|
3842
3849
|
title: string;
|
|
3843
3850
|
/**
|
|
3844
3851
|
* @description Subtitle/description for the widget
|
|
3845
|
-
* @example
|
|
3852
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3846
3853
|
*/
|
|
3847
3854
|
description: string;
|
|
3848
3855
|
/**
|
|
@@ -3864,7 +3871,7 @@ interface paths {
|
|
|
3864
3871
|
title: string;
|
|
3865
3872
|
/**
|
|
3866
3873
|
* @description Subtitle/description for the widget
|
|
3867
|
-
* @example
|
|
3874
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3868
3875
|
*/
|
|
3869
3876
|
description: string;
|
|
3870
3877
|
/**
|
|
@@ -3912,7 +3919,7 @@ interface paths {
|
|
|
3912
3919
|
title: string;
|
|
3913
3920
|
/**
|
|
3914
3921
|
* @description Subtitle/description for the widget
|
|
3915
|
-
* @example
|
|
3922
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3916
3923
|
*/
|
|
3917
3924
|
description: string;
|
|
3918
3925
|
/**
|
|
@@ -3934,7 +3941,7 @@ interface paths {
|
|
|
3934
3941
|
title: string;
|
|
3935
3942
|
/**
|
|
3936
3943
|
* @description Subtitle/description for the widget
|
|
3937
|
-
* @example
|
|
3944
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3938
3945
|
*/
|
|
3939
3946
|
description: string;
|
|
3940
3947
|
/**
|
|
@@ -3956,7 +3963,7 @@ interface paths {
|
|
|
3956
3963
|
title: string;
|
|
3957
3964
|
/**
|
|
3958
3965
|
* @description Subtitle/description for the widget
|
|
3959
|
-
* @example
|
|
3966
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3960
3967
|
*/
|
|
3961
3968
|
description: string;
|
|
3962
3969
|
/**
|
|
@@ -3978,7 +3985,7 @@ interface paths {
|
|
|
3978
3985
|
title: string;
|
|
3979
3986
|
/**
|
|
3980
3987
|
* @description Subtitle/description for the widget
|
|
3981
|
-
* @example
|
|
3988
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
3982
3989
|
*/
|
|
3983
3990
|
description: string;
|
|
3984
3991
|
/**
|
|
@@ -4000,7 +4007,7 @@ interface paths {
|
|
|
4000
4007
|
title: string;
|
|
4001
4008
|
/**
|
|
4002
4009
|
* @description Subtitle/description for the widget
|
|
4003
|
-
* @example
|
|
4010
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
4004
4011
|
*/
|
|
4005
4012
|
description: string;
|
|
4006
4013
|
/**
|
|
@@ -6685,6 +6692,8 @@ interface paths {
|
|
|
6685
6692
|
/** The version of the config */
|
|
6686
6693
|
version: string;
|
|
6687
6694
|
storeId: number;
|
|
6695
|
+
/** When set to true, draft themes are returned */
|
|
6696
|
+
draftConfig?: boolean;
|
|
6688
6697
|
widgetName?: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact";
|
|
6689
6698
|
};
|
|
6690
6699
|
};
|
|
@@ -6710,7 +6719,7 @@ interface paths {
|
|
|
6710
6719
|
promoDescriptionPrefix?: string;
|
|
6711
6720
|
/**
|
|
6712
6721
|
* @description The promo description for the widget for web
|
|
6713
|
-
* @example
|
|
6722
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
6714
6723
|
*/
|
|
6715
6724
|
promoDescription?: string;
|
|
6716
6725
|
/**
|
|
@@ -6773,7 +6782,7 @@ interface paths {
|
|
|
6773
6782
|
title: string;
|
|
6774
6783
|
/**
|
|
6775
6784
|
* @description Subtitle/description for the widget
|
|
6776
|
-
* @example
|
|
6785
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
6777
6786
|
*/
|
|
6778
6787
|
description: string;
|
|
6779
6788
|
/**
|
|
@@ -6795,7 +6804,7 @@ interface paths {
|
|
|
6795
6804
|
title: string;
|
|
6796
6805
|
/**
|
|
6797
6806
|
* @description Subtitle/description for the widget
|
|
6798
|
-
* @example
|
|
6807
|
+
* @example At no extra cost, select a nonprofit and 1% of your purchase will be donated
|
|
6799
6808
|
*/
|
|
6800
6809
|
description: string;
|
|
6801
6810
|
/**
|
|
@@ -6964,6 +6973,51 @@ interface paths {
|
|
|
6964
6973
|
};
|
|
6965
6974
|
};
|
|
6966
6975
|
};
|
|
6976
|
+
"/webhooks/shopify/orderCreated": {
|
|
6977
|
+
post: {
|
|
6978
|
+
responses: {
|
|
6979
|
+
/** Webhook received and verified */
|
|
6980
|
+
200: {
|
|
6981
|
+
content: {
|
|
6982
|
+
"application/json": {
|
|
6983
|
+
[key: string]: unknown;
|
|
6984
|
+
};
|
|
6985
|
+
};
|
|
6986
|
+
};
|
|
6987
|
+
/** Standard error */
|
|
6988
|
+
default: {
|
|
6989
|
+
content: {
|
|
6990
|
+
"application/json": {
|
|
6991
|
+
/** @description Beam code for the error, meant to be used programmatically */
|
|
6992
|
+
code: string;
|
|
6993
|
+
/** @description A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization */
|
|
6994
|
+
title: string;
|
|
6995
|
+
/** @description A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized */
|
|
6996
|
+
detail: string;
|
|
6997
|
+
/** @description a JSON Pointer to the associated entity in the request document */
|
|
6998
|
+
field?: string;
|
|
6999
|
+
/** @description A meta object containing non-standard meta-information about the error */
|
|
7000
|
+
metadata?: {
|
|
7001
|
+
[key: string]: unknown;
|
|
7002
|
+
};
|
|
7003
|
+
/** @description Whether the API or user can resend the request */
|
|
7004
|
+
retryable?: boolean;
|
|
7005
|
+
} & {
|
|
7006
|
+
source: unknown;
|
|
7007
|
+
meta: unknown;
|
|
7008
|
+
};
|
|
7009
|
+
};
|
|
7010
|
+
};
|
|
7011
|
+
};
|
|
7012
|
+
requestBody: {
|
|
7013
|
+
content: {
|
|
7014
|
+
"application/json": {
|
|
7015
|
+
[key: string]: unknown;
|
|
7016
|
+
};
|
|
7017
|
+
};
|
|
7018
|
+
};
|
|
7019
|
+
};
|
|
7020
|
+
};
|
|
6967
7021
|
}
|
|
6968
7022
|
|
|
6969
7023
|
export type { paths as p };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as lodash from 'lodash';
|
|
2
|
-
import { B as BeamCartAPIConfig, a as BeamCartValues } from './update-cart-
|
|
3
|
-
import { T as TCart } from './cart-contents-
|
|
2
|
+
import { B as BeamCartAPIConfig, a as BeamCartValues } from './update-cart-Hebtxhto.esm.js';
|
|
3
|
+
import { T as TCart } from './cart-contents-HAPzwbeL.esm.js';
|
|
4
4
|
import '../components/post-purchase.js';
|
|
5
|
-
import { p as postTransaction } from './routes-
|
|
5
|
+
import { p as postTransaction } from './routes-NIuAzAOC.esm.js';
|
|
6
6
|
import { T as TUrl, L as LANGUAGES } from './types-aju0qrRe.esm.js';
|
|
7
7
|
|
|
8
8
|
type BeamShopifyCartIntegrationConfig = BeamCartAPIConfig & {
|
|
@@ -71,4 +71,4 @@ type TBeamOrderPageParams = Parameters<typeof postTransaction>[0]["requestBody"]
|
|
|
71
71
|
};
|
|
72
72
|
declare function showBeamOrderPageWidgets({ parentSelector, apiKey, baseUrl, storeId, postalCode, countryCode, orderId, email, cartTotal, cart, discountCodes, currencyCode, domain, lang, debug, }: TBeamOrderPageParams): Promise<void>;
|
|
73
73
|
|
|
74
|
-
export { type TBeamOrderPageParams as T, addBeamAttributesToCart as a, getCurrentCart as g, registerCartIntegration as r, showBeamOrderPageWidgets as s, trackCart as t };
|
|
74
|
+
export { type BeamShopifyCartIntegrationConfig as B, type TBeamOrderPageParams as T, addBeamAttributesToCart as a, getCurrentCart as g, registerCartIntegration as r, showBeamOrderPageWidgets as s, trackCart as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as U}from"./lodash-P8OIs-at.esm.js";import{b as J,d as O,c as j,g as k}from"./events-_4nImo3u.esm.js";import{logger as D}from"../utils/logger.js";import{initNetworkListeners as K}from"../utils/network-listeners.js";import{createScopedLocalStorage as S}from"../utils/local-storage.js";import{getCookieValue as N}from"../utils/cookies.js";import{memoizeLast as R}from"../utils/memoize-last.js";import{B as C}from"./cart-contents-h60geKWa.esm.js";import{K as y}from"./update-cart-SPqvT31b.esm.js";import{W as x,D as q}from"./routes-eIRRJ7c1.esm.js";import{getExternalCartId as B,getBeamCartId as b}from"../utils/cart.js";import"../components/post-purchase.js";import{waitForElement as M}from"../utils/wait-for-element.js";import{B as P}from"./beam-errors-P-Lu07Ce.esm.js";const L=window.Shopify?.routes?.root||"/";let T=!1;const E="cart";async function W(t){if(T)return!1;const l=await v(t),p=N(E);l.cart.cartId!==p&&await y(t,l.cart),await _({}),K(),window.addEventListener(J.eventName,async s=>{const r=s,n=/cart\/(add|change|update|clear)/,o=r.detail.type==="xhr"?r.detail.xhr.responseURL:r.detail.response.url,a=new URL(o);if(!n.test(a.pathname))return;const i=await v(t);if(!i.changed)return;const c={schema:i.cart.schema,content:{items:i.cart.content.items,discounts:i.cart.content.discounts}};window.dispatchEvent(new O(c)),await y(t,i.cart)});let d,m;return window.addEventListener(j.eventName,async s=>{const r=s,{source:n,selectedNonprofitId:o,selectionId:a}=r.detail;if(n===x.select_nonprofit){const i=B(E,t),c=b(C,t),{chainId:u,storeId:I}=t;if(d===o&&m===a)return;await _({selectedNonprofitId:o,selectionId:a,beamCartId:c||void 0,cartId:i||void 0,chainId:u,storeId:I}),m=a,d=o}}),window.addEventListener(k.eventName,async s=>{const r=s,{newNonprofitId:n,selectionId:o}=r.detail,a=B(E,t),i=b(C,t),{chainId:c,storeId:u}=t;d===n&&m===o||(await _({selectedNonprofitId:n,beamCartId:i||void 0,selectionId:o,cartId:a||void 0,chainId:c,storeId:u}),m=o,d=n)}),T=!0,!0}async function v(t){const{token:l,total_price:p,item_count:d,currency:m,items:s,cart_level_discount_applications:r}=await window.fetch(L+"cart.js",{method:"GET",headers:{"Content-Type":"application/json"}}).then(c=>c.json());let n=!1;const o=S(t).getItemJson("cart"),a=b(C,t),i={cartId:l,beamCartId:a,subtotal:p/100,itemCount:d,currencyCode:m,schema:{source:"generic"},content:{items:s.map(({sku:c,final_line_price:u,product_id:I,line_level_discount_allocations:g})=>{const f=c||String(I),w=u/100,e=g?.map(({discount_application:h})=>({code:h?.title,applicable:!0}));return{remoteProductIdentifier:f,localAmount:w,discounts:e}}),discounts:r.map(({title:c})=>({code:c,applicable:!0}))}};return U(i,{...o,beamCartId:o?.beamCartId})||(n=!0),{changed:n,cart:i}}const F=y,_=R(async function({selectedNonprofitId:t,selectionId:l,beamCartId:p,cartId:d,chainId:m,storeId:s}){let r,n;if(window.statsig){const a=window.statsig;r=a.getLayer("beam_trial_layer").get("show_beam",!1),n=a.getStableID()}const o={beam:JSON.stringify({nonprofit_id:t,selection_id:l,beam_cart_id:p,shopify_cart_id:d,chain_id:m,store_id:s,show_beam:r,remote_session_id:n})};try{await window.fetch(L+"cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:o})})}catch(a){D.error(a)}});async function G({parentSelector:t=".step__sections",apiKey:l,baseUrl:p=q,storeId:d,postalCode:m,countryCode:s,orderId:r,email:n,cartTotal:o,cart:a,discountCodes:i,currencyCode:c="USD",domain:u,lang:I="en",debug:g=!1}){const f=document.querySelector(t)||await M(t);if(!f)throw new P(`Timed out waiting for selector '${t}'. Could not render Beam post-purchase widget.`);const w=await N("cart");if(w){const h=S({apiKey:l}),A=h.getItemJson("cart")||{};h.setItemJson("cart",{...A,cartId:w})}const e=document.createElement("beam-post-purchase");e.apiKey=l,e.baseUrl=p,e.storeId=d,e.postalCode=m,e.countryCode=s,e.orderId=String(r),e.email=n,e.cartTotal=o,e.cart=a,e.discountCodes=i,e.currencyCode=c,e.domain=u,e.lang=I,e.debug=g,f.appendChild(e)}export{W as J,_ as p,F as q,G as s,v as w};
|
|
2
|
+
//# sourceMappingURL=order-page-zPVHsu6v.esm.js.map
|