@curless/shopify-adapter 0.7.0 → 0.8.0
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/checkout.d.ts +15 -1
- package/dist/checkout.d.ts.map +1 -1
- package/dist/checkout.js +8 -1
- package/dist/checkout.js.map +1 -1
- package/package.json +2 -2
package/dist/checkout.d.ts
CHANGED
|
@@ -4,7 +4,21 @@ export type CartLine = {
|
|
|
4
4
|
variantId: string;
|
|
5
5
|
quantity: number;
|
|
6
6
|
};
|
|
7
|
-
export declare const cartPermalink: (config: Pick<ShopifyConfig, "shopDomain"
|
|
7
|
+
export declare const cartPermalink: (config: Pick<ShopifyConfig, "shopDomain"> & {
|
|
8
|
+
/**
|
|
9
|
+
* The shop's OWN domain, when it has one — `shop.primaryDomain` rather than
|
|
10
|
+
* `<handle>.myshopify.com`. Preferred whenever it is known.
|
|
11
|
+
*
|
|
12
|
+
* Both work: Shopify 301s the myshopify host to the primary domain and the
|
|
13
|
+
* buyer ends up in the same checkout either way. But the link is a thing a
|
|
14
|
+
* BUYER reads, and often the only thing an assistant shows them before they
|
|
15
|
+
* click. `rqxbft-fw.myshopify.com` is an internal handle nobody recognises,
|
|
16
|
+
* arriving in a message that claims to be from a shop with a name — which
|
|
17
|
+
* is exactly the shape of a link people are told not to click. Using the
|
|
18
|
+
* shop's own domain also drops a redirect from the path to payment.
|
|
19
|
+
*/
|
|
20
|
+
storefrontDomain?: string;
|
|
21
|
+
}, lines: CartLine[], opts?: {
|
|
8
22
|
discountCode?: string;
|
|
9
23
|
note?: string;
|
|
10
24
|
/**
|
package/dist/checkout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,QAAQ,GAAG;IACrB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAQF,eAAO,MAAM,aAAa,GACxB,QAAQ,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,QAAQ,GAAG;IACrB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAQF,eAAO,MAAM,aAAa,GACxB,QAAQ,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG;IAC1C;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,EACD,OAAO,QAAQ,EAAE,EACjB,OAAM;IACJ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,KACL,MA2BF,CAAC"}
|
package/dist/checkout.js
CHANGED
|
@@ -24,6 +24,13 @@ export const cartPermalink = (config, lines, opts = {}) => {
|
|
|
24
24
|
qs.set(`attributes[${k}]`, v);
|
|
25
25
|
}
|
|
26
26
|
const query = qs.toString();
|
|
27
|
-
|
|
27
|
+
// A bare hostname either way: `primaryDomain` arrives from Shopify as a URL
|
|
28
|
+
// (`https://shop.example/`), and interpolating that whole would produce
|
|
29
|
+
// `https://https://shop.example//cart/…`.
|
|
30
|
+
const host = (config.storefrontDomain ?? '')
|
|
31
|
+
.trim()
|
|
32
|
+
.replace(/^https?:\/\//, '')
|
|
33
|
+
.replace(/\/+$/, '');
|
|
34
|
+
return `https://${host || config.shopDomain}/cart/${path}${query ? `?${query}` : ''}`;
|
|
28
35
|
};
|
|
29
36
|
//# sourceMappingURL=checkout.js.map
|
package/dist/checkout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAeA,0EAA0E;AAC1E,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,sDAAsD;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,
|
|
1
|
+
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAeA,0EAA0E;AAC1E,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,sDAAsD;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAcC,EACD,KAAiB,EACjB,OAaI,EAAE,EACE,EAAE;IACV,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClG,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,4EAA4E;IAC5E,yEAAyE;IACzE,MAAM,IAAI,GAAG,MAAM;SAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;SACvE,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,MAAM,EAAE,GAAG,IAAI,eAAe,EAAE,CAAC;IACjC,IAAI,IAAI,CAAC,YAAY;QAAE,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7D,IAAI,IAAI,CAAC,IAAI;QAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC;YAAE,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;IACD,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,wEAAwE;IACxE,0CAA0C;IAC1C,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC;SACzC,IAAI,EAAE;SACN,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;SAC3B,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvB,OAAO,WAAW,IAAI,IAAI,MAAM,CAAC,UAAU,SAAS,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACxF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curless/shopify-adapter",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Use a Shopify store as an agentbank catalog source, and record agent-settled sales back as paid Shopify orders. Maps Shopify Admin products
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Use a Shopify store as an agentbank catalog source, and record agent-settled sales back as paid Shopify orders. Maps Shopify Admin products → a generic CatalogItem your merchant backend prices from, writes an order back after an agent pays through agentbank, and records the reversal when that sale is refunded. Zero runtime dependencies (uses the platform fetch).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|