@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.
- package/dist/cjs/ajax-api/index.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/json-api/index.js +1 -0
- package/dist/cjs/plugins/shopify/index.js +1 -0
- package/dist/cjs/storefront-api/index.js +1 -0
- package/dist/cjs/utils/index.js +1 -1
- package/dist/esm/{api/ajax → ajax-api}/index.js +1 -1
- package/dist/esm/index.js +1 -17
- package/dist/esm/{api/json → json-api}/index.js +1 -1
- package/dist/esm/plugins/shopify/index.js +84 -0
- package/dist/esm/storefront-api/index.js +25 -0
- package/dist/esm/utils/index.js +1 -1
- package/dist/global-obj-C3yno2dx.js +16 -0
- package/dist/global-obj-LxWWNYl5.cjs +1 -0
- package/dist/picked-config-C4RxhhZr.cjs +1 -0
- package/dist/picked-config-D5je38JL.js +62 -0
- package/dist/request-Bu7DcKQ6.js +28 -0
- package/dist/request-CLkKzNzd.cjs +1 -0
- package/dist/types/ajax-api/index.d.ts +22 -0
- package/dist/types/ajax-api/index.d.ts.map +1 -0
- package/dist/types/ajax-api/types.d.ts +254 -0
- package/dist/types/ajax-api/types.d.ts.map +1 -0
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/json-api/index.d.ts +8 -0
- package/dist/types/json-api/index.d.ts.map +1 -0
- package/dist/types/json-api/types.d.ts +66 -0
- package/dist/types/json-api/types.d.ts.map +1 -0
- package/dist/types/plugins/shopify/global-obj.d.ts +10 -0
- package/dist/types/plugins/shopify/global-obj.d.ts.map +1 -0
- package/dist/types/plugins/shopify/index.d.ts +5 -0
- package/dist/types/plugins/shopify/index.d.ts.map +1 -0
- package/dist/types/plugins/shopify/picked-config.d.ts +49 -0
- package/dist/types/plugins/shopify/picked-config.d.ts.map +1 -0
- package/dist/types/plugins/shopify/plugin.d.ts +3 -0
- package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/predicates.d.ts +42 -0
- package/dist/types/plugins/shopify/predicates.d.ts.map +1 -0
- package/dist/types/plugins/shopify/types.d.ts +106 -0
- package/dist/types/plugins/shopify/types.d.ts.map +1 -0
- package/dist/types/{storefront/storefront.d.ts → storefront-api/index.d.ts} +4 -4
- package/dist/types/storefront-api/index.d.ts.map +1 -0
- package/dist/types/storefront-api/types.d.ts +4 -0
- package/dist/types/storefront-api/types.d.ts.map +1 -0
- package/dist/types/types.d.ts +3 -316
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +24 -18
- package/dist/cjs/api/ajax/index.js +0 -1
- package/dist/cjs/api/json/index.js +0 -1
- package/dist/cjs/storefront/index.js +0 -1
- package/dist/esm/storefront/index.js +0 -23
- package/dist/request-BDvw_lN_.cjs +0 -1
- package/dist/request-CH-MjU8N.js +0 -27
- package/dist/types/api/ajax/ajax.d.ts +0 -22
- package/dist/types/api/ajax/ajax.d.ts.map +0 -1
- package/dist/types/api/ajax/index.d.ts +0 -2
- package/dist/types/api/ajax/index.d.ts.map +0 -1
- package/dist/types/api/json/index.d.ts +0 -2
- package/dist/types/api/json/index.d.ts.map +0 -1
- package/dist/types/api/json/json.d.ts +0 -8
- package/dist/types/api/json/json.d.ts.map +0 -1
- package/dist/types/storefront/index.d.ts +0 -2
- package/dist/types/storefront/index.d.ts.map +0 -1
- package/dist/types/storefront/storefront.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,wBAAwB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/shopify",
|
|
3
3
|
"description": "Shopify plugin for @picked/client",
|
|
4
|
-
"version": "0.0.1-dev.
|
|
4
|
+
"version": "0.0.1-dev.1764025609515",
|
|
5
5
|
"dependencies": {},
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@picked/client": "workspace:*",
|
|
@@ -26,29 +26,35 @@
|
|
|
26
26
|
"require": "./dist/cjs/index.js",
|
|
27
27
|
"default": "./dist/esm/index.js"
|
|
28
28
|
},
|
|
29
|
-
"./storefront": {
|
|
30
|
-
"types": "./dist/types/storefront/index.d.ts",
|
|
31
|
-
"import": "./dist/esm/storefront/index.js",
|
|
32
|
-
"require": "./dist/cjs/storefront/index.js",
|
|
33
|
-
"default": "./dist/esm/storefront/index.js"
|
|
34
|
-
},
|
|
35
29
|
"./utils": {
|
|
36
30
|
"types": "./dist/types/utils/index.d.ts",
|
|
37
31
|
"import": "./dist/esm/utils/index.js",
|
|
38
32
|
"require": "./dist/cjs/utils/index.js",
|
|
39
33
|
"default": "./dist/esm/utils/index.js"
|
|
40
34
|
},
|
|
41
|
-
"./api
|
|
42
|
-
"types": "./dist/types/api/
|
|
43
|
-
"import": "./dist/esm/api/
|
|
44
|
-
"require": "./dist/cjs/api/
|
|
45
|
-
"default": "./dist/esm/api/
|
|
35
|
+
"./ajax-api": {
|
|
36
|
+
"types": "./dist/types/ajax-api/index.d.ts",
|
|
37
|
+
"import": "./dist/esm/ajax-api/index.js",
|
|
38
|
+
"require": "./dist/cjs/ajax-api/index.js",
|
|
39
|
+
"default": "./dist/esm/ajax-api/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./json-api": {
|
|
42
|
+
"types": "./dist/types/json-api/index.d.ts",
|
|
43
|
+
"import": "./dist/esm/json-api/index.js",
|
|
44
|
+
"require": "./dist/cjs/json-api/index.js",
|
|
45
|
+
"default": "./dist/esm/json-api/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./storefront-api": {
|
|
48
|
+
"types": "./dist/types/storefront-api/index.d.ts",
|
|
49
|
+
"import": "./dist/esm/storefront-api/index.js",
|
|
50
|
+
"require": "./dist/cjs/storefront-api/index.js",
|
|
51
|
+
"default": "./dist/esm/storefront-api/index.js"
|
|
46
52
|
},
|
|
47
|
-
"./
|
|
48
|
-
"types": "./dist/types/
|
|
49
|
-
"import": "./dist/esm/
|
|
50
|
-
"require": "./dist/cjs/
|
|
51
|
-
"default": "./dist/esm/
|
|
53
|
+
"./plugins/shopify": {
|
|
54
|
+
"types": "./dist/types/plugins/shopify/index.d.ts",
|
|
55
|
+
"import": "./dist/esm/plugins/shopify/index.js",
|
|
56
|
+
"require": "./dist/cjs/plugins/shopify/index.js",
|
|
57
|
+
"default": "./dist/esm/plugins/shopify/index.js"
|
|
52
58
|
}
|
|
53
59
|
},
|
|
54
60
|
"files": [
|
|
@@ -57,7 +63,7 @@
|
|
|
57
63
|
"main": "./dist/cjs/index.js",
|
|
58
64
|
"module": "./dist/esm/index.js",
|
|
59
65
|
"peerDependencies": {
|
|
60
|
-
"@picked/client": "0.0.1-dev.
|
|
66
|
+
"@picked/client": "0.0.1-dev.1764025609515",
|
|
61
67
|
"@shopify/storefront-api-client": "^1.0.9",
|
|
62
68
|
"effector": "^23.3.0"
|
|
63
69
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../request-BDvw_lN_.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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../request-BDvw_lN_.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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@picked/client/plugins/shopify"),n=require("@shopify/storefront-api-client");function i(o){const r=e.getShopify(),t=e.getPickedConfigStorefrontApiToken();if(!t)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:o.apiVersion,publicAccessToken:t})}const f=()=>{if(!client)throw new Error("Storefront API client not found");return client};exports.createStorefrontApiClient=i;exports.getStorefrontApiClient=f;
|
|
@@ -1,23 +0,0 @@
|
|
|
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 c(t) {
|
|
4
|
-
const e = 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: e.shop,
|
|
11
|
-
apiVersion: t.apiVersion,
|
|
12
|
-
publicAccessToken: o
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const s = () => {
|
|
16
|
-
if (!client)
|
|
17
|
-
throw new Error("Storefront API client not found");
|
|
18
|
-
return client;
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
c as createStorefrontApiClient,
|
|
22
|
-
s as getStorefrontApiClient
|
|
23
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("@picked/client/plugins/shopify");function s(){const t=r.getShopify();return new URL(`${globalThis.window.location.origin}${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;
|
package/dist/request-CH-MjU8N.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getShopify as s } from "@picked/client/plugins/shopify";
|
|
2
|
-
function e() {
|
|
3
|
-
const t = s();
|
|
4
|
-
return new URL(`${globalThis.window.location.origin}${t.routes.root}`);
|
|
5
|
-
}
|
|
6
|
-
async function a(t) {
|
|
7
|
-
const n = new URL(t, e()), o = await fetch(n.toString());
|
|
8
|
-
if (!o.ok)
|
|
9
|
-
throw new Error(o.statusText);
|
|
10
|
-
return o.json();
|
|
11
|
-
}
|
|
12
|
-
async function c(t, n) {
|
|
13
|
-
const o = new URL(t, e()), r = await fetch(o.toString(), {
|
|
14
|
-
method: "POST",
|
|
15
|
-
headers: {
|
|
16
|
-
"Content-Type": "application/json"
|
|
17
|
-
},
|
|
18
|
-
body: JSON.stringify(n)
|
|
19
|
-
});
|
|
20
|
-
if (!r.ok)
|
|
21
|
-
throw new Error(r.statusText);
|
|
22
|
-
return r.json();
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
a as g,
|
|
26
|
-
c as p
|
|
27
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ShopifyCart, ShopifyProduct, ShopifyShippingRate, ShopifyProductRecommendations, ShopifyPredictiveSearchResult } from '../../types';
|
|
2
|
-
export declare function getProduct<T = ShopifyProduct>(handle: string): Promise<T>;
|
|
3
|
-
export declare function getProductRecommendations(productId: string, limit: number, intent: 'related' | 'complementary'): Promise<ShopifyProductRecommendations>;
|
|
4
|
-
export declare function getPredictiveSearch(query: string): Promise<ShopifyPredictiveSearchResult>;
|
|
5
|
-
export declare function getCart(): Promise<ShopifyCart>;
|
|
6
|
-
export declare function addToCart<T>(items: T[]): Promise<ShopifyCart>;
|
|
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<ShopifyCart>;
|
|
13
|
-
export declare function changeCart(line: number, quantity: number, properties?: Record<string, string>): Promise<ShopifyCart>;
|
|
14
|
-
export declare function clearCart(): Promise<ShopifyCart>;
|
|
15
|
-
export declare function getShippingRates(shippingAddress: {
|
|
16
|
-
zip: string;
|
|
17
|
-
country: string;
|
|
18
|
-
province: string;
|
|
19
|
-
}): Promise<{
|
|
20
|
-
shipping_rates: Array<ShopifyShippingRate>;
|
|
21
|
-
}>;
|
|
22
|
-
//# sourceMappingURL=ajax.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ajax.d.ts","sourceRoot":"","sources":["../../../../src/api/ajax/ajax.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,aAAa,CAAA;AAKpB,wBAAgB,UAAU,CAAC,CAAC,GAAG,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzE;AAKD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,SAAS,GAAG,eAAe,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U,EACV,SAAS,EACT,gBAAgB,GACjB,MAAM,QAAQ,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/json/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ShopifyCollection, ShopifyCollectionProduct } from '../../types';
|
|
2
|
-
export declare function getCollection(handle: string): Promise<{
|
|
3
|
-
collection: ShopifyCollection;
|
|
4
|
-
}>;
|
|
5
|
-
export declare function getCollectionProducts(handle: string, limit?: number): Promise<{
|
|
6
|
-
products: ShopifyCollectionProduct[];
|
|
7
|
-
}>;
|
|
8
|
-
//# sourceMappingURL=json.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/api/json/json.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAE9E,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,iBAAiB,CAAA;CAAE,CAAC,CAG9F;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAAW,GACjB,OAAO,CAAC;IACT,QAAQ,EAAE,wBAAwB,EAAE,CAAA;CACrC,CAAC,CAGD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storefront/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storefront.d.ts","sourceRoot":"","sources":["../../../src/storefront/storefront.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,IAAI,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AACxG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAA;CAC9C;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,gEAiB9E;AAED,eAAO,MAAM,sBAAsB,2BAMlC,CAAA"}
|