@picked/shopify 0.0.1-dev.1763596411740 → 0.0.1-dev.1764025609515

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 (64) hide show
  1. package/dist/cjs/ajax-api/index.js +1 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/json-api/index.js +1 -0
  4. package/dist/cjs/plugins/shopify/index.js +1 -0
  5. package/dist/cjs/storefront-api/index.js +1 -0
  6. package/dist/cjs/utils/index.js +1 -1
  7. package/dist/esm/{api/ajax → ajax-api}/index.js +1 -1
  8. package/dist/esm/index.js +1 -17
  9. package/dist/esm/{api/json → json-api}/index.js +1 -1
  10. package/dist/esm/plugins/shopify/index.js +84 -0
  11. package/dist/esm/storefront-api/index.js +25 -0
  12. package/dist/esm/utils/index.js +1 -1
  13. package/dist/global-obj-C3yno2dx.js +16 -0
  14. package/dist/global-obj-LxWWNYl5.cjs +1 -0
  15. package/dist/picked-config-C4RxhhZr.cjs +1 -0
  16. package/dist/picked-config-D5je38JL.js +62 -0
  17. package/dist/request-Bu7DcKQ6.js +28 -0
  18. package/dist/request-CLkKzNzd.cjs +1 -0
  19. package/dist/types/ajax-api/index.d.ts +22 -0
  20. package/dist/types/ajax-api/index.d.ts.map +1 -0
  21. package/dist/types/ajax-api/types.d.ts +254 -0
  22. package/dist/types/ajax-api/types.d.ts.map +1 -0
  23. package/dist/types/index.d.ts +0 -2
  24. package/dist/types/index.d.ts.map +1 -1
  25. package/dist/types/json-api/index.d.ts +8 -0
  26. package/dist/types/json-api/index.d.ts.map +1 -0
  27. package/dist/types/json-api/types.d.ts +66 -0
  28. package/dist/types/json-api/types.d.ts.map +1 -0
  29. package/dist/types/plugins/shopify/global-obj.d.ts +10 -0
  30. package/dist/types/plugins/shopify/global-obj.d.ts.map +1 -0
  31. package/dist/types/plugins/shopify/index.d.ts +5 -0
  32. package/dist/types/plugins/shopify/index.d.ts.map +1 -0
  33. package/dist/types/plugins/shopify/picked-config.d.ts +49 -0
  34. package/dist/types/plugins/shopify/picked-config.d.ts.map +1 -0
  35. package/dist/types/plugins/shopify/plugin.d.ts +3 -0
  36. package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
  37. package/dist/types/plugins/shopify/predicates.d.ts +42 -0
  38. package/dist/types/plugins/shopify/predicates.d.ts.map +1 -0
  39. package/dist/types/plugins/shopify/types.d.ts +106 -0
  40. package/dist/types/plugins/shopify/types.d.ts.map +1 -0
  41. package/dist/types/{storefront/storefront.d.ts → storefront-api/index.d.ts} +4 -4
  42. package/dist/types/storefront-api/index.d.ts.map +1 -0
  43. package/dist/types/storefront-api/types.d.ts +4 -0
  44. package/dist/types/storefront-api/types.d.ts.map +1 -0
  45. package/dist/types/types.d.ts +3 -316
  46. package/dist/types/types.d.ts.map +1 -1
  47. package/package.json +24 -18
  48. package/dist/cjs/api/ajax/index.js +0 -1
  49. package/dist/cjs/api/json/index.js +0 -1
  50. package/dist/cjs/storefront/index.js +0 -1
  51. package/dist/esm/storefront/index.js +0 -23
  52. package/dist/request-BDvw_lN_.cjs +0 -1
  53. package/dist/request-CH-MjU8N.js +0 -27
  54. package/dist/types/api/ajax/ajax.d.ts +0 -22
  55. package/dist/types/api/ajax/ajax.d.ts.map +0 -1
  56. package/dist/types/api/ajax/index.d.ts +0 -2
  57. package/dist/types/api/ajax/index.d.ts.map +0 -1
  58. package/dist/types/api/json/index.d.ts +0 -2
  59. package/dist/types/api/json/index.d.ts.map +0 -1
  60. package/dist/types/api/json/json.d.ts +0 -8
  61. package/dist/types/api/json/json.d.ts.map +0 -1
  62. package/dist/types/storefront/index.d.ts +0 -2
  63. package/dist/types/storefront/index.d.ts.map +0 -1
  64. package/dist/types/storefront/storefront.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../request-CLkKzNzd.cjs");function c(t){return r.get(`products/${t}.js`)}function o(t,e,n){return r.get(`recommendations/products.json?product_id=${t}&limit=${e}&intent=${n}`)}function s(t){return r.get(`search/suggest.json?q=${t}`)}function u(){return r.get("cart.js")}function i(t){const e=Array.isArray(t)?{items:t}:{items:[t]};return r.post("cart/add.js",e)}function d(t){return r.post("cart/update.js",{...t})}function g(t,e,n){return r.post("cart/change.js",{line:t,quantity:e,properties:n})}function p(){return r.post("cart/clear.js",{})}function h(t){const e=new URLSearchParams;return Object.entries(t).forEach(([n,a])=>{e.append(`shipping_address[${n}]`,a)}),r.get(`cart/shipping_rates.json?${e.toString()}`)}exports.addToCart=i;exports.changeCart=g;exports.clearCart=p;exports.getCart=u;exports.getPredictiveSearch=s;exports.getProduct=c;exports.getProductRecommendations=o;exports.getShippingRates=h;exports.updateCart=d;
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@picked/client/plugins/shopify"),n=require("@shopify/storefront-api-client");function i(t){const r=o.getShopify(),e=o.getPickedConfigStorefrontApiToken();if(!e)throw new Error("Shopify Storefront API token not found. Ensure the Picked Script is enabled on your Shopify storefront");return n.createStorefrontApiClient({storeDomain:r.shop,apiVersion:t.apiVersion,publicAccessToken:e})}exports.createStorefrontApiClient=i;
1
+ "use strict";
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../request-CLkKzNzd.cjs");async function n(t){const{collection:o}=await e.get(`collections/${t}.json`);return{collection:o}}async function l(t,o=20){const{products:c}=await e.get(`collections/${t}/products.json?limit=${o}`);return{products:c}}exports.getCollection=n;exports.getCollectionProducts=l;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@picked/client"),c=require("../../../picked-config-C4RxhhZr.cjs"),r=require("../../../global-obj-LxWWNYl5.cjs"),t={homepage:/^\/$/,page:/(?:^|\/)pages\/(?<pageHandle>[^/]+)\/?$/,blog:/(?:^|\/)blogs\/(?<blogHandle>[^/]+)\/?$/,article:/^\/blogs\/[^/]+\/(?<article>[^/]+)\/?$/,cart:/(?:^|\/)cart\/[^/]+$/,checkout:/^\/checkout\/.+/,appProxy:/^\/(?:a|apps|community|tools)\/(?<proxyTarget>[^/]+)/,accountWildcard:/^\/account\/.+/,accountLogin:/^\/account\/login(?:\/|$)/,accountRegister:/^\/account\/register(?:\/|$)/},i=(e,o)=>o?!!e.exec(o.pathname):!1,n=(e,o)=>{if(o){const a=e.exec(o.pathname);if(a)return a[1]}},g=e=>{var o,a;switch(e){case"product":return((o=c.getPickedConfigProduct())==null?void 0:o.handle)??!1;case"collection":return((a=c.getPickedConfigCollection())==null?void 0:a.handle)??!1;default:return!1}},p={"is-page":({location:e})=>i(t.page,e),"get-page-handle":({location:e})=>n(t.page,e),"is-product-page":()=>!!g("product"),"get-product-handle":()=>g("product"),"is-collection-page":()=>!!g("collection"),"get-collection-handle":()=>g("collection"),"is-blog-page":({location:e})=>i(t.blog,e),"get-blog-handle":({location:e})=>n(t.blog,e),"is-article-page":({location:e})=>i(t.article,e),"get-article-handle":({location:e})=>n(t.article,e),"is-app-proxy-page":({location:e})=>i(t.appProxy,e),"get-app-proxy-handle":({location:e})=>n(t.appProxy,e),"is-account-page":({location:e})=>i(t.accountWildcard,e),"is-login-page":({location:e})=>i(t.accountLogin,e),"is-register-page":({location:e})=>i(t.accountRegister,e),"is-cart-page":({location:e})=>i(t.cart,e),"is-checkout-page":({location:e})=>i(t.checkout,e),"is-homepage":({location:e})=>i(t.homepage,e)},l=()=>({name:"shopify",setup:e=>{Object.entries(p).forEach(([o,a])=>{e.registerPredicate(`shopify-${o}`,a)}),s.supportsWindow()&&e.eventBus.watch(o=>{r.supportsShopifyAnalytics()&&o.type==="session"&&window.Shopify.analytics.publish("picked:session",{id:o.id})})}});exports.getPickedConfig=c.getPickedConfig;exports.getPickedConfigCollection=c.getPickedConfigCollection;exports.getPickedConfigCustomer=c.getPickedConfigCustomer;exports.getPickedConfigExperiments=c.getPickedConfigExperiments;exports.getPickedConfigFeatureExperiments=c.getPickedConfigFeatureExperiments;exports.getPickedConfigProduct=c.getPickedConfigProduct;exports.getPickedConfigStorefrontApiToken=c.getPickedConfigStorefrontApiToken;exports.getShopify=r.getShopify;exports.shopifyPlugin=l;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@shopify/storefront-api-client");require("@picked/client");const n=require("../../picked-config-C4RxhhZr.cjs"),i=require("../../global-obj-LxWWNYl5.cjs");function f(t){const o=i.getShopify(),e=n.getPickedConfigStorefrontApiToken();if(!e)throw new Error("Shopify Storefront API token not found. Ensure the Picked Script is enabled on your Shopify storefront");return r.createStorefrontApiClient({storeDomain:o.shop,apiVersion:t.apiVersion,publicAccessToken:e})}const c=()=>{if(!client)throw new Error("Storefront API client not found");return client};exports.createStorefrontApiClient=f;exports.getStorefrontApiClient=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../request-BDvw_lN_.cjs");exports.getRequest=e.get;exports.postRequest=e.post;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../request-CLkKzNzd.cjs");exports.getRequest=e.get;exports.postRequest=e.post;
@@ -1,4 +1,4 @@
1
- import { g as e, p as a } from "../../../request-CH-MjU8N.js";
1
+ import { g as e, p as a } from "../../request-Bu7DcKQ6.js";
2
2
  function s(t) {
3
3
  return e(`products/${t}.js`);
4
4
  }
package/dist/esm/index.js CHANGED
@@ -1,17 +1 @@
1
- import { getShopify as r, getPickedConfigStorefrontApiToken as n } from "@picked/client/plugins/shopify";
2
- import { createStorefrontApiClient as i } from "@shopify/storefront-api-client";
3
- function s(e) {
4
- const t = r(), o = n();
5
- if (!o)
6
- throw new Error(
7
- "Shopify Storefront API token not found. Ensure the Picked Script is enabled on your Shopify storefront"
8
- );
9
- return i({
10
- storeDomain: t.shop,
11
- apiVersion: e.apiVersion,
12
- publicAccessToken: o
13
- });
14
- }
15
- export {
16
- s as createStorefrontApiClient
17
- };
1
+
@@ -1,4 +1,4 @@
1
- import { g as c } from "../../../request-CH-MjU8N.js";
1
+ import { g as c } from "../../request-Bu7DcKQ6.js";
2
2
  async function s(o) {
3
3
  const { collection: t } = await c(`collections/${o}.json`);
4
4
  return { collection: t };
@@ -0,0 +1,84 @@
1
+ import { supportsWindow as r } from "@picked/client";
2
+ import { a as s, b as p } from "../../../picked-config-D5je38JL.js";
3
+ import { c as P, d as k, e as x, f as b, g as C } from "../../../picked-config-D5je38JL.js";
4
+ import { s as g } from "../../../global-obj-C3yno2dx.js";
5
+ import { g as B } from "../../../global-obj-C3yno2dx.js";
6
+ const a = {
7
+ homepage: /^\/$/,
8
+ page: /(?:^|\/)pages\/(?<pageHandle>[^/]+)\/?$/,
9
+ blog: /(?:^|\/)blogs\/(?<blogHandle>[^/]+)\/?$/,
10
+ article: /^\/blogs\/[^/]+\/(?<article>[^/]+)\/?$/,
11
+ cart: /(?:^|\/)cart\/[^/]+$/,
12
+ checkout: /^\/checkout\/.+/,
13
+ appProxy: /^\/(?:a|apps|community|tools)\/(?<proxyTarget>[^/]+)/,
14
+ accountWildcard: /^\/account\/.+/,
15
+ accountLogin: /^\/account\/login(?:\/|$)/,
16
+ accountRegister: /^\/account\/register(?:\/|$)/
17
+ }, o = (e, t) => t ? !!e.exec(t.pathname) : !1, i = (e, t) => {
18
+ if (t) {
19
+ const c = e.exec(t.pathname);
20
+ if (c)
21
+ return c[1];
22
+ }
23
+ }, n = (e) => {
24
+ var t, c;
25
+ switch (e) {
26
+ case "product":
27
+ return ((t = p()) == null ? void 0 : t.handle) ?? !1;
28
+ case "collection":
29
+ return ((c = s()) == null ? void 0 : c.handle) ?? !1;
30
+ default:
31
+ return !1;
32
+ }
33
+ }, l = {
34
+ // Pages
35
+ "is-page": ({ location: e }) => o(a.page, e),
36
+ "get-page-handle": ({ location: e }) => i(a.page, e),
37
+ // Products
38
+ "is-product-page": () => !!n("product"),
39
+ "get-product-handle": () => n("product"),
40
+ // Collections
41
+ "is-collection-page": () => !!n("collection"),
42
+ "get-collection-handle": () => n("collection"),
43
+ // Blogs
44
+ "is-blog-page": ({ location: e }) => o(a.blog, e),
45
+ "get-blog-handle": ({ location: e }) => i(a.blog, e),
46
+ // Blog Articles
47
+ "is-article-page": ({ location: e }) => o(a.article, e),
48
+ "get-article-handle": ({ location: e }) => i(a.article, e),
49
+ // Apps
50
+ "is-app-proxy-page": ({ location: e }) => o(a.appProxy, e),
51
+ "get-app-proxy-handle": ({ location: e }) => i(a.appProxy, e),
52
+ // Account
53
+ "is-account-page": ({ location: e }) => o(a.accountWildcard, e),
54
+ "is-login-page": ({ location: e }) => o(a.accountLogin, e),
55
+ "is-register-page": ({ location: e }) => o(a.accountRegister, e),
56
+ // Cart
57
+ "is-cart-page": ({ location: e }) => o(a.cart, e),
58
+ // Checkout
59
+ "is-checkout-page": ({ location: e }) => o(a.checkout, e),
60
+ // Homepage
61
+ "is-homepage": ({ location: e }) => o(a.homepage, e)
62
+ }, h = () => ({
63
+ name: "shopify",
64
+ setup: (e) => {
65
+ Object.entries(l).forEach(([t, c]) => {
66
+ e.registerPredicate(`shopify-${t}`, c);
67
+ }), r() && e.eventBus.watch((t) => {
68
+ g() && t.type === "session" && window.Shopify.analytics.publish("picked:session", {
69
+ id: t.id
70
+ });
71
+ });
72
+ }
73
+ });
74
+ export {
75
+ P as getPickedConfig,
76
+ s as getPickedConfigCollection,
77
+ k as getPickedConfigCustomer,
78
+ x as getPickedConfigExperiments,
79
+ b as getPickedConfigFeatureExperiments,
80
+ p as getPickedConfigProduct,
81
+ C as getPickedConfigStorefrontApiToken,
82
+ B as getShopify,
83
+ h as shopifyPlugin
84
+ };
@@ -0,0 +1,25 @@
1
+ import { createStorefrontApiClient as e } from "@shopify/storefront-api-client";
2
+ import "@picked/client";
3
+ import { g as n } from "../../picked-config-D5je38JL.js";
4
+ import { g as i } from "../../global-obj-C3yno2dx.js";
5
+ function S(t) {
6
+ const r = i(), o = n();
7
+ if (!o)
8
+ throw new Error(
9
+ "Shopify Storefront API token not found. Ensure the Picked Script is enabled on your Shopify storefront"
10
+ );
11
+ return e({
12
+ storeDomain: r.shop,
13
+ apiVersion: t.apiVersion,
14
+ publicAccessToken: o
15
+ });
16
+ }
17
+ const a = () => {
18
+ if (!client)
19
+ throw new Error("Storefront API client not found");
20
+ return client;
21
+ };
22
+ export {
23
+ S as createStorefrontApiClient,
24
+ a as getStorefrontApiClient
25
+ };
@@ -1,4 +1,4 @@
1
- import { g as t, p as o } from "../../request-CH-MjU8N.js";
1
+ import { g as t, p as o } from "../../request-Bu7DcKQ6.js";
2
2
  export {
3
3
  t as getRequest,
4
4
  o as postRequest
@@ -0,0 +1,16 @@
1
+ import { supportsWindow as n } from "@picked/client";
2
+ function t() {
3
+ if (!n() || !window.Shopify)
4
+ throw new Error(
5
+ "Shopify global object not found. This plugin must be used on a Shopify storefront page."
6
+ );
7
+ return window.Shopify;
8
+ }
9
+ function f(p) {
10
+ var o, i;
11
+ return typeof ((i = (o = t()) == null ? void 0 : o.analytics) == null ? void 0 : i.publish) == "function";
12
+ }
13
+ export {
14
+ t as g,
15
+ f as s
16
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("@picked/client");function t(){if(!n.supportsWindow()||!window.Shopify)throw new Error("Shopify global object not found. This plugin must be used on a Shopify storefront page.");return window.Shopify}function p(s){var o,i;return typeof((i=(o=t())==null?void 0:o.analytics)==null?void 0:i.publish)=="function"}exports.getShopify=t;exports.supportsShopifyAnalytics=p;
@@ -0,0 +1 @@
1
+ "use strict";const i=require("@picked/client");function n(){if(i.supportsWindow())return window.pickedConfig}function d(){var e;if(i.supportsWindow())return(e=n())==null?void 0:e.customer}function f(){var e;if(i.supportsWindow())return(e=n())==null?void 0:e.product}function g(){var e;if(i.supportsWindow())return(e=n())==null?void 0:e.collection}function u(){var e;if(i.supportsWindow())return(e=n())==null?void 0:e.experiments}function s(){var e,o;if(i.supportsWindow())return(o=(e=n())==null?void 0:e.storefront_api)==null?void 0:o.token}function k(){const e=u();if(!e)return{};try{return e.reduce((o,t)=>{const r=o?{...o}:{};return t.enabled&&(r[t.id]={name:t.name,key:t.version.toString(),decide:()=>{const c=Math.random()*100;return t.weight>0&&t.weight>=c}}),r},{})}catch{return{}}}exports.getPickedConfig=n;exports.getPickedConfigCollection=g;exports.getPickedConfigCustomer=d;exports.getPickedConfigExperiments=u;exports.getPickedConfigFeatureExperiments=k;exports.getPickedConfigProduct=f;exports.getPickedConfigStorefrontApiToken=s;
@@ -0,0 +1,62 @@
1
+ import { supportsWindow as e } from "@picked/client";
2
+ function i() {
3
+ if (e())
4
+ return window.pickedConfig;
5
+ }
6
+ function d() {
7
+ var t;
8
+ if (e())
9
+ return (t = i()) == null ? void 0 : t.customer;
10
+ }
11
+ function s() {
12
+ var t;
13
+ if (e())
14
+ return (t = i()) == null ? void 0 : t.product;
15
+ }
16
+ function g() {
17
+ var t;
18
+ if (e())
19
+ return (t = i()) == null ? void 0 : t.collection;
20
+ }
21
+ function c() {
22
+ var t;
23
+ if (e())
24
+ return (t = i()) == null ? void 0 : t.experiments;
25
+ }
26
+ function a() {
27
+ var t, r;
28
+ if (e())
29
+ return (r = (t = i()) == null ? void 0 : t.storefront_api) == null ? void 0 : r.token;
30
+ }
31
+ function k() {
32
+ const t = c();
33
+ if (!t)
34
+ return {};
35
+ try {
36
+ return t.reduce(
37
+ (r, n) => {
38
+ const o = r ? { ...r } : {};
39
+ return n.enabled && (o[n.id] = {
40
+ name: n.name,
41
+ key: n.version.toString(),
42
+ decide: () => {
43
+ const u = Math.random() * 100;
44
+ return n.weight > 0 && n.weight >= u;
45
+ }
46
+ }), o;
47
+ },
48
+ {}
49
+ );
50
+ } catch {
51
+ return {};
52
+ }
53
+ }
54
+ export {
55
+ g as a,
56
+ s as b,
57
+ i as c,
58
+ d,
59
+ c as e,
60
+ k as f,
61
+ a as g
62
+ };
@@ -0,0 +1,28 @@
1
+ import "@picked/client";
2
+ import { g as e } from "./global-obj-C3yno2dx.js";
3
+ function r() {
4
+ const t = e();
5
+ return new URL(`https://${t.shop}${t.routes.root}`);
6
+ }
7
+ async function p(t) {
8
+ const n = new URL(t, r()), o = await fetch(n.toString());
9
+ if (!o.ok)
10
+ throw new Error(o.statusText);
11
+ return o.json();
12
+ }
13
+ async function c(t, n) {
14
+ const o = new URL(t, r()), s = await fetch(o.toString(), {
15
+ method: "POST",
16
+ headers: {
17
+ "Content-Type": "application/json"
18
+ },
19
+ body: JSON.stringify(n)
20
+ });
21
+ if (!s.ok)
22
+ throw new Error(s.statusText);
23
+ return s.json();
24
+ }
25
+ export {
26
+ p as g,
27
+ c as p
28
+ };
@@ -0,0 +1 @@
1
+ "use strict";require("@picked/client");const r=require("./global-obj-LxWWNYl5.cjs");function s(){const t=r.getShopify();return new URL(`https://${t.shop}${t.routes.root}`)}async function i(t){const n=new URL(t,s()),o=await fetch(n.toString());if(!o.ok)throw new Error(o.statusText);return o.json()}async function c(t,n){const o=new URL(t,s()),e=await fetch(o.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!e.ok)throw new Error(e.statusText);return e.json()}exports.get=i;exports.post=c;
@@ -0,0 +1,22 @@
1
+ import { ShopifyAjaxApiCart, ShopifyAjaxApiProduct, ShopifyAjaxApiShippingRate, ShopifyAjaxApiProductRecommendations, ShopifyAjaxApiPredictiveSearchResult } from './types';
2
+ export declare function getProduct<T = ShopifyAjaxApiProduct>(handle: string): Promise<T>;
3
+ export declare function getProductRecommendations(productId: string, limit: number, intent: 'related' | 'complementary'): Promise<ShopifyAjaxApiProductRecommendations>;
4
+ export declare function getPredictiveSearch(query: string): Promise<ShopifyAjaxApiPredictiveSearchResult>;
5
+ export declare function getCart(): Promise<ShopifyAjaxApiCart>;
6
+ export declare function addToCart<T>(items: T[]): Promise<ShopifyAjaxApiCart>;
7
+ export declare function updateCart(updates: {
8
+ updates?: Record<string, number | string>;
9
+ discount?: string;
10
+ note?: string;
11
+ attributes?: Record<string, string>;
12
+ }): Promise<ShopifyAjaxApiCart>;
13
+ export declare function changeCart(line: number, quantity: number, properties?: Record<string, string>): Promise<ShopifyAjaxApiCart>;
14
+ export declare function clearCart(): Promise<ShopifyAjaxApiCart>;
15
+ export declare function getShippingRates(shippingAddress: {
16
+ zip: string;
17
+ country: string;
18
+ province: string;
19
+ }): Promise<{
20
+ shipping_rates: Array<ShopifyAjaxApiShippingRate>;
21
+ }>;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ajax-api/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,oCAAoC,EACpC,oCAAoC,EACrC,MAAM,SAAS,CAAA;AAKhB,wBAAgB,UAAU,CAAC,CAAC,GAAG,qBAAqB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEhF;AAKD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,SAAS,GAAG,eAAe,GAClC,OAAO,CAAC,oCAAoC,CAAC,CAI/C;AAKD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAEhG;AAKD,wBAAgB,OAAO,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAErD;AAKD,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAGpE;AAKD,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACpC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE9B;AAKD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,OAAO,CAAC,kBAAkB,CAAC,CAE7B;AAKD,wBAAgB,SAAS,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAEvD;AAKD,wBAAgB,gBAAgB,CAAC,eAAe,EAAE;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,OAAO,CAAC;IACV,cAAc,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAA;CAClD,CAAC,CAQD"}
@@ -0,0 +1,254 @@
1
+ export interface ShopifyAjaxApiProduct {
2
+ id: number;
3
+ title: string;
4
+ handle: string;
5
+ description: string | null;
6
+ published_at: string;
7
+ created_at: string;
8
+ vendor: string;
9
+ type: string;
10
+ tags: string[];
11
+ price: number;
12
+ price_min: number;
13
+ price_max: number;
14
+ available: boolean;
15
+ price_varies: boolean;
16
+ compare_at_price: number | null;
17
+ compare_at_price_min: number;
18
+ compare_at_price_max: number;
19
+ compare_at_price_varies: boolean;
20
+ variants: ShopifyAjaxApiProductVariant[];
21
+ images: string[];
22
+ featured_image: string | null;
23
+ options: ShopifyAjaxApiProductOption[];
24
+ url: string;
25
+ media?: ShopifyAjaxApiProductMedia[];
26
+ requires_selling_plan: boolean;
27
+ selling_plan_groups: ShopifyAjaxApiSellingPlanGroup[];
28
+ }
29
+ export interface ShopifyAjaxApiProductMedia {
30
+ alt: string | null;
31
+ id: number;
32
+ position: number;
33
+ preview_image: {
34
+ aspect_ratio: number;
35
+ height: number;
36
+ width: number;
37
+ src: string;
38
+ };
39
+ sources?: Array<{
40
+ format: string;
41
+ height: number;
42
+ mime_type: string;
43
+ url: string;
44
+ width: number;
45
+ }>;
46
+ aspect_ratio: number;
47
+ height: number;
48
+ media_type: string;
49
+ src: string;
50
+ width: number;
51
+ }
52
+ export interface ShopifyAjaxApiProductVariant {
53
+ id: number;
54
+ title: string;
55
+ options: string[];
56
+ option1: string | null;
57
+ option2: string | null;
58
+ option3: string | null;
59
+ price: number;
60
+ weight: number;
61
+ compare_at_price: number | null;
62
+ inventory_management: string;
63
+ inventory_quantity: number;
64
+ available: boolean;
65
+ sku: string | null;
66
+ requires_shipping: boolean;
67
+ taxable: boolean;
68
+ barcode: string | null;
69
+ name: string;
70
+ public_title: string | null;
71
+ quantity_rule: ShopifyAjaxApiQuantityRule;
72
+ quantity_price_breaks?: ShopifyAjaxApiProductVariantQuantityPriceBreak[];
73
+ requires_selling_plan: boolean;
74
+ selling_plan_allocations: ShopifyAjaxApiSellingPlanAllocation[];
75
+ featured_image: string | null;
76
+ }
77
+ export interface ShopifyAjaxApiProductVariantQuantityPriceBreak {
78
+ quantity: number;
79
+ price: number;
80
+ }
81
+ export interface ShopifyAjaxApiSellingPlanAllocation {
82
+ price_adjustments: Array<{
83
+ position: number;
84
+ price: number;
85
+ }>;
86
+ price: number;
87
+ compare_at_price: number;
88
+ per_delivery_price: number;
89
+ selling_plan_id: number;
90
+ selling_plan_group_id: string;
91
+ }
92
+ export interface ShopifyAjaxApiProductOption {
93
+ name: string;
94
+ position: number;
95
+ values: string[];
96
+ }
97
+ export interface ShopifyAjaxApiSellingPlanGroup {
98
+ id: string;
99
+ name: string;
100
+ options: Array<{
101
+ name: string;
102
+ position: number;
103
+ values: string[];
104
+ }>;
105
+ selling_plans: ShopifyAjaxApiSellingPlan[];
106
+ app_id: string;
107
+ }
108
+ export interface ShopifyAjaxApiSellingPlan {
109
+ id: number;
110
+ name: string;
111
+ description: string | null;
112
+ options: Array<{
113
+ name: string;
114
+ position: number;
115
+ value: string;
116
+ }>;
117
+ recurring_deliveries: boolean;
118
+ price_adjustments: Array<{
119
+ order_count: number | null;
120
+ position: number;
121
+ value_type: string;
122
+ value: number;
123
+ }>;
124
+ }
125
+ export interface ShopifyAjaxApiQuantityRule {
126
+ min: number;
127
+ max: number | null;
128
+ increment: number;
129
+ }
130
+ export interface ShopifyAjaxApiShippingRate {
131
+ name: string;
132
+ price: string;
133
+ source: string;
134
+ delivery_range: string[];
135
+ delivery_days: number;
136
+ delivery_date: string | null;
137
+ currency: string;
138
+ }
139
+ export interface ShopifyAjaxApiCart {
140
+ token: string;
141
+ note: string | null;
142
+ attributes: Record<string, string>;
143
+ original_total_price: number;
144
+ total_price: number;
145
+ total_discount: number;
146
+ total_weight: number;
147
+ item_count: number;
148
+ items: ShopifyAjaxApiCartItem[];
149
+ requires_shipping: boolean;
150
+ currency: string;
151
+ items_subtotal_price: number;
152
+ cart_level_discount_applications: Array<ShopifyAjaxApiCartLevelDiscountApplication>;
153
+ }
154
+ export interface ShopifyAjaxApiCartLevelDiscountApplication {
155
+ type: string;
156
+ key?: string;
157
+ value: string;
158
+ value_type: string;
159
+ allocation_method?: string;
160
+ target_selection: string;
161
+ target_type: string;
162
+ title: string;
163
+ total_allocated_amount: number;
164
+ description?: string | null;
165
+ }
166
+ export interface ShopifyAjaxApiCartItem {
167
+ id: number;
168
+ quantity: number;
169
+ properties: Record<string, string> | null;
170
+ variant_id: number;
171
+ key: string;
172
+ title: string;
173
+ price: number;
174
+ original_price: number;
175
+ discounted_price: number;
176
+ line_price: number;
177
+ original_line_price: number;
178
+ total_discount: number;
179
+ discounts: Array<{
180
+ amount: number;
181
+ title: string;
182
+ }>;
183
+ sku: string | null;
184
+ grams: number;
185
+ vendor: string;
186
+ taxable: boolean;
187
+ product_id: number;
188
+ product_has_only_default_variant: boolean;
189
+ gift_card: boolean;
190
+ final_price: number;
191
+ final_line_price: number;
192
+ url: string;
193
+ featured_image: ShopifyAjaxApiImage | null;
194
+ image: string;
195
+ handle: string;
196
+ requires_shipping: boolean;
197
+ product_type: string;
198
+ product_title: string;
199
+ variant_title: string;
200
+ variant_options: string[];
201
+ options_with_values: Array<{
202
+ name: string;
203
+ value: string;
204
+ }>;
205
+ selling_plan_allocation?: Record<string, string>;
206
+ }
207
+ export interface ShopifyAjaxApiProductRecommendations {
208
+ intent: 'related' | 'complementary';
209
+ products: ShopifyAjaxApiProduct[];
210
+ }
211
+ export interface ShopifyAjaxApiPredictiveSearchResult {
212
+ resources: {
213
+ results: {
214
+ products: ShopifyAjaxApiPredictiveSearchProduct[];
215
+ };
216
+ };
217
+ }
218
+ export interface ShopifyAjaxApiPredictiveSearchProduct {
219
+ available: boolean;
220
+ body: string;
221
+ compare_at_price_max: number;
222
+ compare_at_price_min: number;
223
+ handle: string;
224
+ id: number;
225
+ image: string;
226
+ price: number;
227
+ price_max: number;
228
+ price_min: number;
229
+ tags: string[];
230
+ title: string;
231
+ type: string;
232
+ url: string;
233
+ variants: ShopifyAjaxApiPredictiveSearchVariant[];
234
+ vendor: string;
235
+ featured_image?: ShopifyAjaxApiImage | null;
236
+ }
237
+ export interface ShopifyAjaxApiPredictiveSearchVariant {
238
+ available: boolean;
239
+ compare_at_price: number | null;
240
+ id: number;
241
+ image: string;
242
+ price: number;
243
+ title: string;
244
+ url: string;
245
+ featured_image?: ShopifyAjaxApiImage | null;
246
+ }
247
+ export interface ShopifyAjaxApiImage {
248
+ alt: string;
249
+ aspect_ratio: number;
250
+ height: number;
251
+ url: string;
252
+ width: number;
253
+ }
254
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ajax-api/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,C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;CACd"}
@@ -1,4 +1,2 @@
1
- import { createStorefrontApiClient as _createStorefrontApiClient } from '@shopify/storefront-api-client';
2
- export declare function createStorefrontApiClient(options: Pick<Parameters<typeof _createStorefrontApiClient>[0], 'apiVersion'>): import('@shopify/storefront-api-client').StorefrontApiClient;
3
1
  export type * from './types';
4
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,IAAI,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAGxG,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,gEAiB9E;AAED,mBAAmB,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,SAAS,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { ShopifyJsonApiCollection, ShopifyJsonApiCollectionProduct } from './types';
2
+ export declare function getCollection(handle: string): Promise<{
3
+ collection: ShopifyJsonApiCollection;
4
+ }>;
5
+ export declare function getCollectionProducts(handle: string, limit?: number): Promise<{
6
+ products: ShopifyJsonApiCollectionProduct[];
7
+ }>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/json-api/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAA;AAExF,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,UAAU,EAAE,wBAAwB,CAAA;CAAE,CAAC,CAGnD;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAAW,GACjB,OAAO,CAAC;IACT,QAAQ,EAAE,+BAA+B,EAAE,CAAA;CAC5C,CAAC,CAGD"}