@personizely/shopify-hydrogen 1.0.0 → 1.0.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/index.cjs +399 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +342 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +342 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +342 -10
- package/dist/index.mjs +277 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +14 -4
- package/dist/classes/Adapter.d.ts +0 -33
- package/dist/classes/Adapter.d.ts.map +0 -1
- package/dist/classes/Adapter.js +0 -126
- package/dist/classes/Adapter.js.map +0 -1
- package/dist/classes/Cart.d.ts +0 -29
- package/dist/classes/Cart.d.ts.map +0 -1
- package/dist/classes/Cart.js +0 -272
- package/dist/classes/Cart.js.map +0 -1
- package/dist/components/PersonizelyProvider.d.ts +0 -36
- package/dist/components/PersonizelyProvider.d.ts.map +0 -1
- package/dist/components/PersonizelyProvider.js +0 -118
- package/dist/components/PersonizelyProvider.js.map +0 -1
- package/dist/graphql/queries/cart.d.ts +0 -7
- package/dist/graphql/queries/cart.d.ts.map +0 -1
- package/dist/graphql/queries/cart.js +0 -142
- package/dist/graphql/queries/cart.js.map +0 -1
- package/dist/graphql/queries/customer.d.ts +0 -5
- package/dist/graphql/queries/customer.d.ts.map +0 -1
- package/dist/graphql/queries/customer.js +0 -72
- package/dist/graphql/queries/customer.js.map +0 -1
- package/dist/graphql/queries/product.d.ts +0 -5
- package/dist/graphql/queries/product.d.ts.map +0 -1
- package/dist/graphql/queries/product.js +0 -114
- package/dist/graphql/queries/product.js.map +0 -1
- package/dist/hooks/useCartAdd.d.ts +0 -3
- package/dist/hooks/useCartAdd.d.ts.map +0 -1
- package/dist/hooks/useCartAdd.js +0 -18
- package/dist/hooks/useCartAdd.js.map +0 -1
- package/dist/hooks/useCheckout.d.ts +0 -2
- package/dist/hooks/useCheckout.d.ts.map +0 -1
- package/dist/hooks/useCheckout.js +0 -12
- package/dist/hooks/useCheckout.js.map +0 -1
- package/dist/hooks/usePageContext.d.ts +0 -3
- package/dist/hooks/usePageContext.d.ts.map +0 -1
- package/dist/hooks/usePageContext.js +0 -6
- package/dist/hooks/usePageContext.js.map +0 -1
- package/dist/hooks/usePersonizely.d.ts +0 -3
- package/dist/hooks/usePersonizely.d.ts.map +0 -1
- package/dist/hooks/usePersonizely.js +0 -11
- package/dist/hooks/usePersonizely.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -170
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/interfaces.d.ts +0 -35
- package/dist/types/interfaces.d.ts.map +0 -1
- package/dist/types/interfaces.js +0 -2
- package/dist/types/interfaces.js.map +0 -1
- package/dist/utils/cookies.d.ts +0 -4
- package/dist/utils/cookies.d.ts.map +0 -1
- package/dist/utils/cookies.js +0 -33
- package/dist/utils/cookies.js.map +0 -1
- package/dist/utils/id.d.ts +0 -3
- package/dist/utils/id.d.ts.map +0 -1
- package/dist/utils/id.js +0 -7
- package/dist/utils/id.js.map +0 -1
- package/dist/utils/storefront-client.d.ts +0 -15
- package/dist/utils/storefront-client.d.ts.map +0 -1
- package/dist/utils/storefront-client.js +0 -39
- package/dist/utils/storefront-client.js.map +0 -1
package/dist/classes/Cart.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cart.js","sourceRoot":"","sources":["../../src/classes/Cart.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAG3D,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MA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AAC;QAGD,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAA;IACvC,CAAC;IAMO,UAAU,CAAE,IAAgB;QAClC,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,EAAE;YACd,UAAU,EAAE,IAAI,CAAC,aAAa,IAAI,CAAC;YACnC,KAAK,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC5C,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjB,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7C,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;gBACrC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG;gBAClD,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAC,CAAC;YACH,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,GAAG;YACvD,cAAc,EAAE,IAAI,CAAC,aAAa;YAClC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { PersonizelyConfigMethods, HydrogenConfig, CartAddProduct } from '../types';
|
|
3
|
-
import { Cart } from '../classes/Cart';
|
|
4
|
-
import { Adapter } from '../classes/Adapter';
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
__PLY_HYDROGEN_CONFIG__?: HydrogenConfig;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export type PersonizelyContextType = {
|
|
11
|
-
cart: Cart;
|
|
12
|
-
adapter: Adapter;
|
|
13
|
-
websiteApiKey: string;
|
|
14
|
-
triggerCartAdd: (product: CartAddProduct) => Promise<boolean>;
|
|
15
|
-
triggerCheckout: () => Promise<boolean>;
|
|
16
|
-
};
|
|
17
|
-
export declare const PersonizelyContext: React.Context<PersonizelyContextType | null>;
|
|
18
|
-
export type PersonizelyProviderProps = {
|
|
19
|
-
websiteApiKey: string;
|
|
20
|
-
storefrontAccessToken: string;
|
|
21
|
-
shopDomain: string;
|
|
22
|
-
apiVersion?: string;
|
|
23
|
-
scriptBaseUrl?: string;
|
|
24
|
-
locale?: string;
|
|
25
|
-
currency?: {
|
|
26
|
-
rate: number;
|
|
27
|
-
active: string;
|
|
28
|
-
base: string;
|
|
29
|
-
};
|
|
30
|
-
market?: string;
|
|
31
|
-
methods?: PersonizelyConfigMethods;
|
|
32
|
-
children: ReactNode;
|
|
33
|
-
customerAccessToken?: string | null;
|
|
34
|
-
};
|
|
35
|
-
export declare function PersonizelyProvider({ websiteApiKey, storefrontAccessToken, shopDomain, locale, currency, market, apiVersion, scriptBaseUrl, methods, children, customerAccessToken }: PersonizelyProviderProps): React.JSX.Element;
|
|
36
|
-
//# sourceMappingURL=PersonizelyProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PersonizelyProvider.d.ts","sourceRoot":"","sources":["../../src/components/PersonizelyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6C,SAAS,EAAE,MAAM,OAAO,CAAA;AAEnF,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,cAAc,EACf,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAG5C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,uBAAuB,CAAC,EAAE,cAAc,CAAA;KACzC;CACF;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7D,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACxC,CAAA;AAED,eAAO,MAAM,kBAAkB,8CAAqD,CAAA;AAEpF,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAA;IACrB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,wBAAwB,CAAA;IAClC,QAAQ,EAAE,SAAS,CAAA;IAInB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC,CAAA;AAED,wBAAgB,mBAAmB,CAAE,EACnC,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,MAAM,EACN,QAAQ,EACR,MAAM,EACN,UAAU,EACV,aAAa,EACb,OAAO,EACP,QAAQ,EACR,mBAAmB,EACpB,EAAE,wBAAwB,qBAiI1B"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useEffect, useMemo, useRef } from 'react';
|
|
2
|
-
import { useMatches, useRevalidator } from 'react-router';
|
|
3
|
-
import { Cart } from '../classes/Cart';
|
|
4
|
-
import { Adapter } from '../classes/Adapter';
|
|
5
|
-
import { StorefrontClient } from '../utils/storefront-client';
|
|
6
|
-
export const PersonizelyContext = createContext(null);
|
|
7
|
-
export function PersonizelyProvider({ websiteApiKey, storefrontAccessToken, shopDomain, locale, currency, market, apiVersion, scriptBaseUrl, methods, children, customerAccessToken }) {
|
|
8
|
-
const matches = useMatches();
|
|
9
|
-
const rootMatch = matches.find(m => m.id === 'root');
|
|
10
|
-
const localCart = rootMatch?.loaderData?.cart;
|
|
11
|
-
const revalidator = useRevalidator();
|
|
12
|
-
const storefrontClient = useMemo(() => {
|
|
13
|
-
return new StorefrontClient({
|
|
14
|
-
storefrontAccessToken,
|
|
15
|
-
shopDomain,
|
|
16
|
-
apiVersion
|
|
17
|
-
});
|
|
18
|
-
}, [storefrontAccessToken, shopDomain, apiVersion]);
|
|
19
|
-
const adapter = useMemo(() => {
|
|
20
|
-
const adapterInstance = new Adapter({
|
|
21
|
-
locale,
|
|
22
|
-
currency,
|
|
23
|
-
market,
|
|
24
|
-
methods
|
|
25
|
-
}, storefrontClient);
|
|
26
|
-
if (customerAccessToken) {
|
|
27
|
-
adapterInstance.setCustomerAccessToken(customerAccessToken);
|
|
28
|
-
}
|
|
29
|
-
return adapterInstance;
|
|
30
|
-
}, []);
|
|
31
|
-
const cart = useMemo(() => new Cart(localCart, storefrontClient, revalidator.revalidate), []);
|
|
32
|
-
const prevCartDataRef = useRef(null);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
localCart.then((data) => {
|
|
35
|
-
if (data && data !== prevCartDataRef.current) {
|
|
36
|
-
cart.updateCartData(data);
|
|
37
|
-
cart.notifyListeners();
|
|
38
|
-
prevCartDataRef.current = data;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}, [localCart, cart]);
|
|
42
|
-
const cartAddCallbacksRef = useRef([]);
|
|
43
|
-
const checkoutCallbacksRef = useRef([]);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (typeof window === 'undefined') {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
window.__PLY_HYDROGEN_CONFIG__ = {
|
|
49
|
-
cart,
|
|
50
|
-
adapter,
|
|
51
|
-
onCartAdd: (callback) => {
|
|
52
|
-
cartAddCallbacksRef.current.push(callback);
|
|
53
|
-
return () => {
|
|
54
|
-
const index = cartAddCallbacksRef.current.indexOf(callback);
|
|
55
|
-
if (index > -1) {
|
|
56
|
-
cartAddCallbacksRef.current.splice(index, 1);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
onCheckout: (callback) => {
|
|
61
|
-
checkoutCallbacksRef.current.push(callback);
|
|
62
|
-
return () => {
|
|
63
|
-
const index = checkoutCallbacksRef.current.indexOf(callback);
|
|
64
|
-
if (index > -1) {
|
|
65
|
-
checkoutCallbacksRef.current.splice(index, 1);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const script = document.createElement('script');
|
|
71
|
-
const baseUrl = scriptBaseUrl || 'https://static.personizely.net';
|
|
72
|
-
script.src = `${baseUrl}/${websiteApiKey}.js`;
|
|
73
|
-
document.head.appendChild(script);
|
|
74
|
-
return () => {
|
|
75
|
-
delete window.__PLY_HYDROGEN_CONFIG__;
|
|
76
|
-
if (script) {
|
|
77
|
-
script.remove();
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}, []);
|
|
81
|
-
const contextValue = useMemo(() => ({
|
|
82
|
-
cart,
|
|
83
|
-
adapter,
|
|
84
|
-
websiteApiKey,
|
|
85
|
-
triggerCartAdd: async (product) => {
|
|
86
|
-
let shown = false;
|
|
87
|
-
for (const callback of cartAddCallbacksRef.current) {
|
|
88
|
-
try {
|
|
89
|
-
const result = await callback(product);
|
|
90
|
-
if (result) {
|
|
91
|
-
shown = true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
console.error('Cart add callback error:', error);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return shown;
|
|
99
|
-
},
|
|
100
|
-
triggerCheckout: async () => {
|
|
101
|
-
let shown = false;
|
|
102
|
-
for (const callback of checkoutCallbacksRef.current) {
|
|
103
|
-
try {
|
|
104
|
-
const result = await callback();
|
|
105
|
-
if (result) {
|
|
106
|
-
shown = true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
console.error('Checkout callback error:', error);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return shown;
|
|
114
|
-
}
|
|
115
|
-
}), [cart, adapter, websiteApiKey]);
|
|
116
|
-
return (React.createElement(PersonizelyContext.Provider, { value: contextValue }, children));
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=PersonizelyProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PersonizelyProvider.js","sourceRoot":"","sources":["../../src/components/PersonizelyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAa,MAAM,OAAO,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAOzD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAgB7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAgC,IAAI,CAAC,CAAA;AAuBpF,MAAM,UAAU,mBAAmB,CAAE,EACnC,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,MAAM,EACN,QAAQ,EACR,MAAM,EACN,UAAU,EACV,aAAa,EACb,OAAO,EACP,QAAQ,EACR,mBAAmB,EACM;IACzB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAA;IAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CA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CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;KACF,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAA;IAEnC,OAAO,CACL,oBAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC7C,QAAQ,CACmB,CAC/B,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const CART_FRAGMENT = "\n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n nodes {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n amountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n title\n price {\n amount\n currencyCode\n }\n image {\n url\n altText\n }\n selectedOptions {\n name\n value\n }\n product {\n id\n handle\n title\n featuredImage {\n url\n altText\n }\n tags\n }\n }\n }\n attributes {\n key\n value\n }\n }\n }\n discountCodes {\n code\n applicable\n }\n attributes {\n key\n value\n }\n }\n";
|
|
2
|
-
export declare const GET_CART = "\n query getCart($cartId: ID!) {\n cart(id: $cartId) {\n ...CartFragment\n }\n }\n \n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n nodes {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n amountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n title\n price {\n amount\n currencyCode\n }\n image {\n url\n altText\n }\n selectedOptions {\n name\n value\n }\n product {\n id\n handle\n title\n featuredImage {\n url\n altText\n }\n tags\n }\n }\n }\n attributes {\n key\n value\n }\n }\n }\n discountCodes {\n code\n applicable\n }\n attributes {\n key\n value\n }\n }\n\n";
|
|
3
|
-
export declare const CART_LINES_ADD = "\n mutation cartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n nodes {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n amountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n title\n price {\n amount\n currencyCode\n }\n image {\n url\n altText\n }\n selectedOptions {\n name\n value\n }\n product {\n id\n handle\n title\n featuredImage {\n url\n altText\n }\n tags\n }\n }\n }\n attributes {\n key\n value\n }\n }\n }\n discountCodes {\n code\n applicable\n }\n attributes {\n key\n value\n }\n }\n\n";
|
|
4
|
-
export declare const CART_LINES_UPDATE = "\n mutation cartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n nodes {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n amountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n title\n price {\n amount\n currencyCode\n }\n image {\n url\n altText\n }\n selectedOptions {\n name\n value\n }\n product {\n id\n handle\n title\n featuredImage {\n url\n altText\n }\n tags\n }\n }\n }\n attributes {\n key\n value\n }\n }\n }\n discountCodes {\n code\n applicable\n }\n attributes {\n key\n value\n }\n }\n\n";
|
|
5
|
-
export declare const CART_LINES_REMOVE = "\n mutation cartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart {\n ...CartFragment\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n nodes {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n amountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n title\n price {\n amount\n currencyCode\n }\n image {\n url\n altText\n }\n selectedOptions {\n name\n value\n }\n product {\n id\n handle\n title\n featuredImage {\n url\n altText\n }\n tags\n }\n }\n }\n attributes {\n key\n value\n }\n }\n }\n discountCodes {\n code\n applicable\n }\n attributes {\n key\n value\n }\n }\n\n";
|
|
6
|
-
export declare const CART_DISCOUNT_CODES_UPDATE = "\n mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...CartFragment\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n }\n lines(first: 100) {\n nodes {\n id\n quantity\n cost {\n totalAmount {\n amount\n currencyCode\n }\n amountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n title\n price {\n amount\n currencyCode\n }\n image {\n url\n altText\n }\n selectedOptions {\n name\n value\n }\n product {\n id\n handle\n title\n featuredImage {\n url\n altText\n }\n tags\n }\n }\n }\n attributes {\n key\n value\n }\n }\n }\n discountCodes {\n code\n applicable\n }\n attributes {\n key\n value\n }\n }\n\n";
|
|
7
|
-
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/cart.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,g1CA4EzB,CAAA;AAED,eAAO,MAAM,QAAQ,m7CAOpB,CAAA;AAMD,eAAO,MAAM,cAAc,ukDAa1B,CAAA;AAED,eAAO,MAAM,iBAAiB,mlDAa7B,CAAA;AAED,eAAO,MAAM,iBAAiB,wkDAa7B,CAAA;AAED,eAAO,MAAM,0BAA0B,8mDAatC,CAAA"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
export const CART_FRAGMENT = `
|
|
2
|
-
fragment CartFragment on Cart {
|
|
3
|
-
id
|
|
4
|
-
checkoutUrl
|
|
5
|
-
totalQuantity
|
|
6
|
-
cost {
|
|
7
|
-
subtotalAmount {
|
|
8
|
-
amount
|
|
9
|
-
currencyCode
|
|
10
|
-
}
|
|
11
|
-
totalAmount {
|
|
12
|
-
amount
|
|
13
|
-
currencyCode
|
|
14
|
-
}
|
|
15
|
-
totalTaxAmount {
|
|
16
|
-
amount
|
|
17
|
-
currencyCode
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
lines(first: 100) {
|
|
21
|
-
nodes {
|
|
22
|
-
id
|
|
23
|
-
quantity
|
|
24
|
-
cost {
|
|
25
|
-
totalAmount {
|
|
26
|
-
amount
|
|
27
|
-
currencyCode
|
|
28
|
-
}
|
|
29
|
-
amountPerQuantity {
|
|
30
|
-
amount
|
|
31
|
-
currencyCode
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
merchandise {
|
|
35
|
-
... on ProductVariant {
|
|
36
|
-
id
|
|
37
|
-
title
|
|
38
|
-
price {
|
|
39
|
-
amount
|
|
40
|
-
currencyCode
|
|
41
|
-
}
|
|
42
|
-
image {
|
|
43
|
-
url
|
|
44
|
-
altText
|
|
45
|
-
}
|
|
46
|
-
selectedOptions {
|
|
47
|
-
name
|
|
48
|
-
value
|
|
49
|
-
}
|
|
50
|
-
product {
|
|
51
|
-
id
|
|
52
|
-
handle
|
|
53
|
-
title
|
|
54
|
-
featuredImage {
|
|
55
|
-
url
|
|
56
|
-
altText
|
|
57
|
-
}
|
|
58
|
-
tags
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
attributes {
|
|
63
|
-
key
|
|
64
|
-
value
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
discountCodes {
|
|
69
|
-
code
|
|
70
|
-
applicable
|
|
71
|
-
}
|
|
72
|
-
attributes {
|
|
73
|
-
key
|
|
74
|
-
value
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
78
|
-
export const GET_CART = `
|
|
79
|
-
query getCart($cartId: ID!) {
|
|
80
|
-
cart(id: $cartId) {
|
|
81
|
-
...CartFragment
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
${CART_FRAGMENT}
|
|
85
|
-
`;
|
|
86
|
-
export const CART_LINES_ADD = `
|
|
87
|
-
mutation cartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
|
|
88
|
-
cartLinesAdd(cartId: $cartId, lines: $lines) {
|
|
89
|
-
cart {
|
|
90
|
-
...CartFragment
|
|
91
|
-
}
|
|
92
|
-
userErrors {
|
|
93
|
-
field
|
|
94
|
-
message
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
${CART_FRAGMENT}
|
|
99
|
-
`;
|
|
100
|
-
export const CART_LINES_UPDATE = `
|
|
101
|
-
mutation cartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {
|
|
102
|
-
cartLinesUpdate(cartId: $cartId, lines: $lines) {
|
|
103
|
-
cart {
|
|
104
|
-
...CartFragment
|
|
105
|
-
}
|
|
106
|
-
userErrors {
|
|
107
|
-
field
|
|
108
|
-
message
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
${CART_FRAGMENT}
|
|
113
|
-
`;
|
|
114
|
-
export const CART_LINES_REMOVE = `
|
|
115
|
-
mutation cartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {
|
|
116
|
-
cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
|
|
117
|
-
cart {
|
|
118
|
-
...CartFragment
|
|
119
|
-
}
|
|
120
|
-
userErrors {
|
|
121
|
-
field
|
|
122
|
-
message
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
${CART_FRAGMENT}
|
|
127
|
-
`;
|
|
128
|
-
export const CART_DISCOUNT_CODES_UPDATE = `
|
|
129
|
-
mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {
|
|
130
|
-
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
|
|
131
|
-
cart {
|
|
132
|
-
...CartFragment
|
|
133
|
-
}
|
|
134
|
-
userErrors {
|
|
135
|
-
field
|
|
136
|
-
message
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
${CART_FRAGMENT}
|
|
141
|
-
`;
|
|
142
|
-
//# sourceMappingURL=cart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cart.js","sourceRoot":"","sources":["../../../src/graphql/queries/cart.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4E5B,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;IAMpB,aAAa;CAChB,CAAA;AAMD,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;IAY1B,aAAa;CAChB,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;IAY7B,aAAa;CAChB,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;IAY7B,aAAa;CAChB,CAAA;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG;;;;;;;;;;;;IAYtC,aAAa;CAChB,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const CUSTOMER_FRAGMENT = "\n fragment CustomerFragment on Customer {\n id\n email\n phone\n firstName\n lastName\n displayName\n defaultAddress {\n id\n address1\n address2\n city\n province\n country\n zip\n }\n }\n";
|
|
2
|
-
export declare const ORDER_FRAGMENT = "\n fragment OrderFragment on Order {\n id\n orderNumber\n processedAt\n financialStatus\n fulfillmentStatus\n totalPrice {\n amount\n currencyCode\n }\n lineItems(first: 100) {\n nodes {\n title\n quantity\n variant {\n id\n title\n price {\n amount\n currencyCode\n }\n image {\n url\n altText\n }\n }\n }\n }\n }\n";
|
|
3
|
-
export declare const GET_CUSTOMER = "\n query getCustomer($customerAccessToken: String!) {\n customer(customerAccessToken: $customerAccessToken) {\n ...CustomerFragment\n }\n }\n \n fragment CustomerFragment on Customer {\n id\n email\n phone\n firstName\n lastName\n displayName\n defaultAddress {\n id\n address1\n address2\n city\n province\n country\n zip\n }\n }\n\n";
|
|
4
|
-
export declare const GET_CUSTOMER_ORDERS = "\n query getCustomerOrders($customerAccessToken: String!, $first: Int = 20) {\n customer(customerAccessToken: $customerAccessToken) {\n id\n orders(first: $first, sortKey: PROCESSED_AT, reverse: true) {\n nodes {\n ...OrderFragment\n }\n }\n }\n }\n \n fragment OrderFragment on Order {\n id\n orderNumber\n processedAt\n financialStatus\n fulfillmentStatus\n totalPrice {\n amount\n currencyCode\n }\n lineItems(first: 100) {\n nodes {\n title\n quantity\n variant {\n id\n title\n price {\n amount\n currencyCode\n }\n image {\n url\n altText\n }\n }\n }\n }\n }\n\n";
|
|
5
|
-
//# sourceMappingURL=customer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/customer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,gQAkB7B,CAAA;AAED,eAAO,MAAM,cAAc,gfA8B1B,CAAA;AAED,eAAO,MAAM,YAAY,8ZAOxB,CAAA;AAED,eAAO,MAAM,mBAAmB,2xBAY/B,CAAA"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export const CUSTOMER_FRAGMENT = `
|
|
2
|
-
fragment CustomerFragment on Customer {
|
|
3
|
-
id
|
|
4
|
-
email
|
|
5
|
-
phone
|
|
6
|
-
firstName
|
|
7
|
-
lastName
|
|
8
|
-
displayName
|
|
9
|
-
defaultAddress {
|
|
10
|
-
id
|
|
11
|
-
address1
|
|
12
|
-
address2
|
|
13
|
-
city
|
|
14
|
-
province
|
|
15
|
-
country
|
|
16
|
-
zip
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
export const ORDER_FRAGMENT = `
|
|
21
|
-
fragment OrderFragment on Order {
|
|
22
|
-
id
|
|
23
|
-
orderNumber
|
|
24
|
-
processedAt
|
|
25
|
-
financialStatus
|
|
26
|
-
fulfillmentStatus
|
|
27
|
-
totalPrice {
|
|
28
|
-
amount
|
|
29
|
-
currencyCode
|
|
30
|
-
}
|
|
31
|
-
lineItems(first: 100) {
|
|
32
|
-
nodes {
|
|
33
|
-
title
|
|
34
|
-
quantity
|
|
35
|
-
variant {
|
|
36
|
-
id
|
|
37
|
-
title
|
|
38
|
-
price {
|
|
39
|
-
amount
|
|
40
|
-
currencyCode
|
|
41
|
-
}
|
|
42
|
-
image {
|
|
43
|
-
url
|
|
44
|
-
altText
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
export const GET_CUSTOMER = `
|
|
52
|
-
query getCustomer($customerAccessToken: String!) {
|
|
53
|
-
customer(customerAccessToken: $customerAccessToken) {
|
|
54
|
-
...CustomerFragment
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
${CUSTOMER_FRAGMENT}
|
|
58
|
-
`;
|
|
59
|
-
export const GET_CUSTOMER_ORDERS = `
|
|
60
|
-
query getCustomerOrders($customerAccessToken: String!, $first: Int = 20) {
|
|
61
|
-
customer(customerAccessToken: $customerAccessToken) {
|
|
62
|
-
id
|
|
63
|
-
orders(first: $first, sortKey: PROCESSED_AT, reverse: true) {
|
|
64
|
-
nodes {
|
|
65
|
-
...OrderFragment
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
${ORDER_FRAGMENT}
|
|
71
|
-
`;
|
|
72
|
-
//# sourceMappingURL=customer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customer.js","sourceRoot":"","sources":["../../../src/graphql/queries/customer.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;CAkBhC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B7B,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;IAMxB,iBAAiB;CACpB,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;IAW/B,cAAc;CACjB,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const PRODUCT_FRAGMENT = "\n fragment ProductFragment on Product {\n id\n handle\n title\n description\n descriptionHtml\n productType\n vendor\n tags\n availableForSale\n requiresSellingPlan\n priceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n maxVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n id\n url\n altText\n width\n height\n }\n images(first: 10) {\n nodes {\n id\n url\n altText\n width\n height\n }\n }\n variants(first: 100) {\n nodes {\n id\n title\n availableForSale\n quantityAvailable\n sellingPlanAllocations(first: 10) {\n edges {\n node {\n sellingPlan {\n id\n }\n }\n }\n }\n sku\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n image {\n id\n url\n altText\n width\n height\n }\n }\n }\n options {\n id\n name\n values\n }\n collections(first: 10) {\n nodes {\n id\n handle\n title\n }\n }\n }\n";
|
|
2
|
-
export declare const GET_PRODUCT_BY_HANDLE = "\n query getProductByHandle($handle: String!) {\n product(handle: $handle) {\n ...ProductFragment\n }\n }\n \n fragment ProductFragment on Product {\n id\n handle\n title\n description\n descriptionHtml\n productType\n vendor\n tags\n availableForSale\n requiresSellingPlan\n priceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n maxVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n id\n url\n altText\n width\n height\n }\n images(first: 10) {\n nodes {\n id\n url\n altText\n width\n height\n }\n }\n variants(first: 100) {\n nodes {\n id\n title\n availableForSale\n quantityAvailable\n sellingPlanAllocations(first: 10) {\n edges {\n node {\n sellingPlan {\n id\n }\n }\n }\n }\n sku\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n image {\n id\n url\n altText\n width\n height\n }\n }\n }\n options {\n id\n name\n values\n }\n collections(first: 10) {\n nodes {\n id\n handle\n title\n }\n }\n }\n\n";
|
|
3
|
-
export declare const GET_PRODUCT_BY_ID = "\n query getProductById($id: ID!) {\n product(id: $id) {\n ...ProductFragment\n }\n }\n \n fragment ProductFragment on Product {\n id\n handle\n title\n description\n descriptionHtml\n productType\n vendor\n tags\n availableForSale\n requiresSellingPlan\n priceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n maxVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n id\n url\n altText\n width\n height\n }\n images(first: 10) {\n nodes {\n id\n url\n altText\n width\n height\n }\n }\n variants(first: 100) {\n nodes {\n id\n title\n availableForSale\n quantityAvailable\n sellingPlanAllocations(first: 10) {\n edges {\n node {\n sellingPlan {\n id\n }\n }\n }\n }\n sku\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n image {\n id\n url\n altText\n width\n height\n }\n }\n }\n options {\n id\n name\n values\n }\n collections(first: 10) {\n nodes {\n id\n handle\n title\n }\n }\n }\n\n";
|
|
4
|
-
export declare const GET_PRODUCT_RECOMMENDATIONS = "\n query getProductRecommendations($productId: ID!) {\n productRecommendations(productId: $productId) {\n ...ProductFragment\n }\n }\n \n fragment ProductFragment on Product {\n id\n handle\n title\n description\n descriptionHtml\n productType\n vendor\n tags\n availableForSale\n requiresSellingPlan\n priceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n maxVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n id\n url\n altText\n width\n height\n }\n images(first: 10) {\n nodes {\n id\n url\n altText\n width\n height\n }\n }\n variants(first: 100) {\n nodes {\n id\n title\n availableForSale\n quantityAvailable\n sellingPlanAllocations(first: 10) {\n edges {\n node {\n sellingPlan {\n id\n }\n }\n }\n }\n sku\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n image {\n id\n url\n altText\n width\n height\n }\n }\n }\n options {\n id\n name\n values\n }\n collections(first: 10) {\n nodes {\n id\n handle\n title\n }\n }\n }\n\n";
|
|
5
|
-
//# sourceMappingURL=product.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/product.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,u5CAwF5B,CAAA;AAED,eAAO,MAAM,qBAAqB,mhDAOjC,CAAA;AAED,eAAO,MAAM,iBAAiB,+/CAO7B,CAAA;AAED,eAAO,MAAM,2BAA2B,8iDAOvC,CAAA"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
export const PRODUCT_FRAGMENT = `
|
|
2
|
-
fragment ProductFragment on Product {
|
|
3
|
-
id
|
|
4
|
-
handle
|
|
5
|
-
title
|
|
6
|
-
description
|
|
7
|
-
descriptionHtml
|
|
8
|
-
productType
|
|
9
|
-
vendor
|
|
10
|
-
tags
|
|
11
|
-
availableForSale
|
|
12
|
-
requiresSellingPlan
|
|
13
|
-
priceRange {
|
|
14
|
-
minVariantPrice {
|
|
15
|
-
amount
|
|
16
|
-
currencyCode
|
|
17
|
-
}
|
|
18
|
-
maxVariantPrice {
|
|
19
|
-
amount
|
|
20
|
-
currencyCode
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
featuredImage {
|
|
24
|
-
id
|
|
25
|
-
url
|
|
26
|
-
altText
|
|
27
|
-
width
|
|
28
|
-
height
|
|
29
|
-
}
|
|
30
|
-
images(first: 10) {
|
|
31
|
-
nodes {
|
|
32
|
-
id
|
|
33
|
-
url
|
|
34
|
-
altText
|
|
35
|
-
width
|
|
36
|
-
height
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
variants(first: 100) {
|
|
40
|
-
nodes {
|
|
41
|
-
id
|
|
42
|
-
title
|
|
43
|
-
availableForSale
|
|
44
|
-
quantityAvailable
|
|
45
|
-
sellingPlanAllocations(first: 10) {
|
|
46
|
-
edges {
|
|
47
|
-
node {
|
|
48
|
-
sellingPlan {
|
|
49
|
-
id
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
sku
|
|
55
|
-
price {
|
|
56
|
-
amount
|
|
57
|
-
currencyCode
|
|
58
|
-
}
|
|
59
|
-
compareAtPrice {
|
|
60
|
-
amount
|
|
61
|
-
currencyCode
|
|
62
|
-
}
|
|
63
|
-
selectedOptions {
|
|
64
|
-
name
|
|
65
|
-
value
|
|
66
|
-
}
|
|
67
|
-
image {
|
|
68
|
-
id
|
|
69
|
-
url
|
|
70
|
-
altText
|
|
71
|
-
width
|
|
72
|
-
height
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
options {
|
|
77
|
-
id
|
|
78
|
-
name
|
|
79
|
-
values
|
|
80
|
-
}
|
|
81
|
-
collections(first: 10) {
|
|
82
|
-
nodes {
|
|
83
|
-
id
|
|
84
|
-
handle
|
|
85
|
-
title
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
`;
|
|
90
|
-
export const GET_PRODUCT_BY_HANDLE = `
|
|
91
|
-
query getProductByHandle($handle: String!) {
|
|
92
|
-
product(handle: $handle) {
|
|
93
|
-
...ProductFragment
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
${PRODUCT_FRAGMENT}
|
|
97
|
-
`;
|
|
98
|
-
export const GET_PRODUCT_BY_ID = `
|
|
99
|
-
query getProductById($id: ID!) {
|
|
100
|
-
product(id: $id) {
|
|
101
|
-
...ProductFragment
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
${PRODUCT_FRAGMENT}
|
|
105
|
-
`;
|
|
106
|
-
export const GET_PRODUCT_RECOMMENDATIONS = `
|
|
107
|
-
query getProductRecommendations($productId: ID!) {
|
|
108
|
-
productRecommendations(productId: $productId) {
|
|
109
|
-
...ProductFragment
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
${PRODUCT_FRAGMENT}
|
|
113
|
-
`;
|
|
114
|
-
//# sourceMappingURL=product.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/graphql/queries/product.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwF/B,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;IAMjC,gBAAgB;CACnB,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;IAM7B,gBAAgB;CACnB,CAAA;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;IAMvC,gBAAgB;CACnB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCartAdd.d.ts","sourceRoot":"","sources":["../../src/hooks/useCartAdd.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAoC9C,wBAAgB,UAAU,cAGW,cAAc,KAAG,OAAO,CAAC,OAAO,CAAC,CAYrE"}
|
package/dist/hooks/useCartAdd.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { usePersonizely } from './usePersonizely';
|
|
3
|
-
import { toId } from '../utils/id';
|
|
4
|
-
export function useCartAdd() {
|
|
5
|
-
const personizely = usePersonizely();
|
|
6
|
-
return useCallback(async (product) => {
|
|
7
|
-
if (typeof window === 'undefined') {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
return await personizely.triggerCartAdd({
|
|
11
|
-
...product,
|
|
12
|
-
id: toId(String(product.id)),
|
|
13
|
-
variantId: toId(String(product.variantId)),
|
|
14
|
-
price: Number(product.price) * 100
|
|
15
|
-
});
|
|
16
|
-
}, [personizely]);
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=useCartAdd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCartAdd.js","sourceRoot":"","sources":["../../src/hooks/useCartAdd.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAkClC,MAAM,UAAU,UAAU;IACxB,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IAEpC,OAAO,WAAW,CAAC,KAAK,EAAE,OAAuB,EAAoB,EAAE;QACrE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,KAAK,CAAA;QACd,CAAC;QAED,OAAO,MAAM,WAAW,CAAC,cAAc,CAAC;YACtC,GAAG,OAAO;YACV,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC5B,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAC1C,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG;SACnC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;AACnB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckout.d.ts","sourceRoot":"","sources":["../../src/hooks/useCheckout.ts"],"names":[],"mappings":"AA8BA,wBAAgB,WAAW,UAGI,OAAO,CAAC,OAAO,CAAC,CAO9C"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { usePersonizely } from './usePersonizely';
|
|
3
|
-
export function useCheckout() {
|
|
4
|
-
const personizely = usePersonizely();
|
|
5
|
-
return useCallback(async () => {
|
|
6
|
-
if (typeof window === 'undefined') {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
return await personizely.triggerCheckout();
|
|
10
|
-
}, [personizely]);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=useCheckout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckout.js","sourceRoot":"","sources":["../../src/hooks/useCheckout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAyBjD,MAAM,UAAU,WAAW;IACzB,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IAEpC,OAAO,WAAW,CAAC,KAAK,IAAsB,EAAE;QAC9C,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,KAAK,CAAA;QACd,CAAC;QAED,OAAO,MAAM,WAAW,CAAC,eAAe,EAAE,CAAA;IAC5C,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;AACnB,CAAC"}
|