@rechargeapps/storefront-client 1.14.1 → 1.14.3
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/api/address.js +2 -20
- package/dist/cjs/api/address.js.map +1 -1
- package/dist/cjs/api/auth.js +8 -24
- package/dist/cjs/api/auth.js.map +1 -1
- package/dist/cjs/api/bundle.js +0 -2
- package/dist/cjs/api/bundle.js.map +1 -1
- package/dist/cjs/api/cdn.js +3 -6
- package/dist/cjs/api/cdn.js.map +1 -1
- package/dist/cjs/api/charge.js +1 -3
- package/dist/cjs/api/charge.js.map +1 -1
- package/dist/cjs/api/customer.js +5 -25
- package/dist/cjs/api/customer.js.map +1 -1
- package/dist/cjs/api/gift.js +0 -2
- package/dist/cjs/api/gift.js.map +1 -1
- package/dist/cjs/api/membership.js +0 -2
- package/dist/cjs/api/membership.js.map +1 -1
- package/dist/cjs/api/membershipProgram.js +1 -3
- package/dist/cjs/api/membershipProgram.js.map +1 -1
- package/dist/cjs/api/metafield.js +0 -2
- package/dist/cjs/api/metafield.js.map +1 -1
- package/dist/cjs/api/onetime.js +0 -2
- package/dist/cjs/api/onetime.js.map +1 -1
- package/dist/cjs/api/order.js +0 -2
- package/dist/cjs/api/order.js.map +1 -1
- package/dist/cjs/api/paymentMethod.js +2 -23
- package/dist/cjs/api/paymentMethod.js.map +1 -1
- package/dist/cjs/api/plan.js +0 -2
- package/dist/cjs/api/plan.js.map +1 -1
- package/dist/cjs/api/product.js +0 -2
- package/dist/cjs/api/product.js.map +1 -1
- package/dist/cjs/api/store.js +0 -2
- package/dist/cjs/api/store.js.map +1 -1
- package/dist/cjs/api/subscription.js +3 -9
- package/dist/cjs/api/subscription.js.map +1 -1
- package/dist/cjs/constants/api.js +0 -2
- package/dist/cjs/constants/api.js.map +1 -1
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mappers/cdn.js +8 -33
- package/dist/cjs/mappers/cdn.js.map +1 -1
- package/dist/cjs/mappers/subscription.js +23 -47
- package/dist/cjs/mappers/subscription.js.map +1 -1
- package/dist/cjs/mappers/utils.js +2 -23
- package/dist/cjs/mappers/utils.js.map +1 -1
- package/dist/cjs/utils/bundle.js +0 -2
- package/dist/cjs/utils/bundle.js.map +1 -1
- package/dist/cjs/utils/error.js +0 -2
- package/dist/cjs/utils/error.js.map +1 -1
- package/dist/cjs/utils/init.js +3 -6
- package/dist/cjs/utils/init.js.map +1 -1
- package/dist/cjs/utils/options.js +0 -2
- package/dist/cjs/utils/options.js.map +1 -1
- package/dist/cjs/utils/request.js +16 -37
- package/dist/cjs/utils/request.js.map +1 -1
- package/dist/esm/api/address.js +2 -18
- package/dist/esm/api/address.js.map +1 -1
- package/dist/esm/api/auth.js +8 -22
- package/dist/esm/api/auth.js.map +1 -1
- package/dist/esm/api/bundle.js.map +1 -1
- package/dist/esm/api/cdn.js +3 -4
- package/dist/esm/api/cdn.js.map +1 -1
- package/dist/esm/api/charge.js +1 -1
- package/dist/esm/api/charge.js.map +1 -1
- package/dist/esm/api/customer.js +5 -23
- package/dist/esm/api/customer.js.map +1 -1
- package/dist/esm/api/gift.js.map +1 -1
- package/dist/esm/api/membership.js.map +1 -1
- package/dist/esm/api/membershipProgram.js +1 -1
- package/dist/esm/api/membershipProgram.js.map +1 -1
- package/dist/esm/api/metafield.js.map +1 -1
- package/dist/esm/api/onetime.js.map +1 -1
- package/dist/esm/api/order.js.map +1 -1
- package/dist/esm/api/paymentMethod.js +2 -21
- package/dist/esm/api/paymentMethod.js.map +1 -1
- package/dist/esm/api/plan.js.map +1 -1
- package/dist/esm/api/product.js.map +1 -1
- package/dist/esm/api/store.js.map +1 -1
- package/dist/esm/api/subscription.js +2 -2
- package/dist/esm/api/subscription.js.map +1 -1
- package/dist/esm/constants/api.js.map +1 -1
- package/dist/esm/mappers/cdn.js +8 -27
- package/dist/esm/mappers/cdn.js.map +1 -1
- package/dist/esm/mappers/subscription.js +23 -41
- package/dist/esm/mappers/subscription.js.map +1 -1
- package/dist/esm/mappers/utils.js +2 -21
- package/dist/esm/mappers/utils.js.map +1 -1
- package/dist/esm/utils/bundle.js.map +1 -1
- package/dist/esm/utils/error.js.map +1 -1
- package/dist/esm/utils/init.js +3 -4
- package/dist/esm/utils/init.js.map +1 -1
- package/dist/esm/utils/options.js.map +1 -1
- package/dist/esm/utils/request.js +15 -30
- package/dist/esm/utils/request.js.map +1 -1
- package/dist/index.d.ts +14 -4
- package/dist/umd/recharge-client.min.js +9 -9
- package/package.json +23 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sources":["../../../src/utils/error.ts"],"sourcesContent":["export class RechargeRequestError implements Error {\n name = 'RechargeRequestError';\n message: string;\n status?: number;\n\n constructor(message: string, status?: number) {\n this.message = message;\n this.status = status;\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"error.js","sources":["../../../src/utils/error.ts"],"sourcesContent":["export class RechargeRequestError implements Error {\n name = 'RechargeRequestError';\n message: string;\n status?: number;\n\n constructor(message: string, status?: number) {\n this.message = message;\n this.status = status;\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,oBAAsC,CAAA;AAAA,EAKjD,WAAA,CAAY,SAAiB,MAAiB,EAAA;AAJ9C,IAAO,IAAA,CAAA,IAAA,GAAA,sBAAA,CAAA;AAKL,IAAA,IAAA,CAAK,OAAU,GAAA,OAAA,CAAA;AACf,IAAA,IAAA,CAAK,MAAS,GAAA,MAAA,CAAA;AAAA,GAChB;AACF;;;;"}
|
package/dist/esm/utils/init.js
CHANGED
|
@@ -17,16 +17,15 @@ const api = {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
function getStoreIdentifier(storeIdentifier) {
|
|
20
|
-
var _a, _b;
|
|
21
20
|
if (storeIdentifier) {
|
|
22
21
|
return storeIdentifier;
|
|
23
22
|
}
|
|
24
|
-
if (
|
|
23
|
+
if (window?.Shopify?.shop) {
|
|
25
24
|
return window.Shopify.shop;
|
|
26
25
|
}
|
|
27
|
-
let domain = window
|
|
26
|
+
let domain = window?.domain;
|
|
28
27
|
if (!domain) {
|
|
29
|
-
const subdomain =
|
|
28
|
+
const subdomain = location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i)?.[1].replace(/-sp$/, "");
|
|
30
29
|
if (subdomain) {
|
|
31
30
|
domain = `${subdomain}.myshopify.com`;
|
|
32
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sources":["../../../src/utils/init.ts"],"sourcesContent":["import { resetCDNCache } from '../api/cdn';\nimport { StorefrontOptions, CRUDRequestOptions, GetRequestOptions, InitOptions } from '../types';\nimport { setOptions } from './options';\nimport { request } from './request';\n\nexport const api = {\n get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T> {\n return request<T>('get', url, requestOptions);\n },\n post<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('post', url, requestOptions);\n },\n put<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('put', url, requestOptions);\n },\n delete<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('delete', url, requestOptions);\n },\n};\n\n/**\n * Uses passed in storeIdentifier, but if it's not passed in will try to infer it.\n * Currently it will only infer if we are in the context of a Shopify store. This will not infer headless or hosted yet.\n */\nfunction getStoreIdentifier(storeIdentifier?: string): string {\n if (storeIdentifier) {\n return storeIdentifier;\n }\n\n // Infer's when on Shopify store (non headless)\n if (window?.Shopify?.shop) {\n return window.Shopify.shop;\n }\n\n // Domain exists on hosted themes. If it doesn't for some reason, get the subdomain and create the identifier\n let domain = window?.domain;\n if (!domain) {\n const subdomain = location?.href\n .match(/(?:http[s]*:\\/\\/)*(.*?)\\.(?=admin\\.rechargeapps\\.com)/i)?.[1]\n .replace(/-sp$/, '');\n if (subdomain) {\n domain = `${subdomain}.myshopify.com`;\n }\n }\n\n // Infer's when on Recharge hosted\n if (domain) {\n return domain;\n }\n\n throw new Error(`No storeIdentifier was passed into init.`);\n}\n\nexport function initRecharge(opt: InitOptions = {}) {\n const hiddenOpts = opt as StorefrontOptions;\n const { storefrontAccessToken } = opt;\n if (storefrontAccessToken && !storefrontAccessToken.startsWith('strfnt')) {\n throw new Error(\n 'Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.'\n );\n }\n setOptions({\n storeIdentifier: getStoreIdentifier(opt.storeIdentifier),\n loginRetryFn: opt.loginRetryFn,\n storefrontAccessToken,\n environment: hiddenOpts.environment ? hiddenOpts.environment : 'prod',\n environmentUri: hiddenOpts.environmentUri,\n });\n\n // When init is called again, reset the cache to make sure we don't have the old cache around\n resetCDNCache();\n}\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"init.js","sources":["../../../src/utils/init.ts"],"sourcesContent":["import { resetCDNCache } from '../api/cdn';\nimport { StorefrontOptions, CRUDRequestOptions, GetRequestOptions, InitOptions } from '../types';\nimport { setOptions } from './options';\nimport { request } from './request';\n\nexport const api = {\n get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T> {\n return request<T>('get', url, requestOptions);\n },\n post<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('post', url, requestOptions);\n },\n put<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('put', url, requestOptions);\n },\n delete<T>(url: string, requestOptions?: CRUDRequestOptions): Promise<T> {\n return request<T>('delete', url, requestOptions);\n },\n};\n\n/**\n * Uses passed in storeIdentifier, but if it's not passed in will try to infer it.\n * Currently it will only infer if we are in the context of a Shopify store. This will not infer headless or hosted yet.\n */\nfunction getStoreIdentifier(storeIdentifier?: string): string {\n if (storeIdentifier) {\n return storeIdentifier;\n }\n\n // Infer's when on Shopify store (non headless)\n if (window?.Shopify?.shop) {\n return window.Shopify.shop;\n }\n\n // Domain exists on hosted themes. If it doesn't for some reason, get the subdomain and create the identifier\n let domain = window?.domain;\n if (!domain) {\n const subdomain = location?.href\n .match(/(?:http[s]*:\\/\\/)*(.*?)\\.(?=admin\\.rechargeapps\\.com)/i)?.[1]\n .replace(/-sp$/, '');\n if (subdomain) {\n domain = `${subdomain}.myshopify.com`;\n }\n }\n\n // Infer's when on Recharge hosted\n if (domain) {\n return domain;\n }\n\n throw new Error(`No storeIdentifier was passed into init.`);\n}\n\nexport function initRecharge(opt: InitOptions = {}) {\n const hiddenOpts = opt as StorefrontOptions;\n const { storefrontAccessToken } = opt;\n if (storefrontAccessToken && !storefrontAccessToken.startsWith('strfnt')) {\n throw new Error(\n 'Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.'\n );\n }\n setOptions({\n storeIdentifier: getStoreIdentifier(opt.storeIdentifier),\n loginRetryFn: opt.loginRetryFn,\n storefrontAccessToken,\n environment: hiddenOpts.environment ? hiddenOpts.environment : 'prod',\n environmentUri: hiddenOpts.environmentUri,\n });\n\n // When init is called again, reset the cache to make sure we don't have the old cache around\n resetCDNCache();\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,GAAM,GAAA;AAAA,EACjB,GAAA,CAAO,KAAa,cAAgD,EAAA;AAClE,IAAO,OAAA,OAAA,CAAW,KAAO,EAAA,GAAA,EAAK,cAAc,CAAA,CAAA;AAAA,GAC9C;AAAA,EACA,IAAA,CAAQ,KAAa,cAAiD,EAAA;AACpE,IAAO,OAAA,OAAA,CAAW,MAAQ,EAAA,GAAA,EAAK,cAAc,CAAA,CAAA;AAAA,GAC/C;AAAA,EACA,GAAA,CAAO,KAAa,cAAiD,EAAA;AACnE,IAAO,OAAA,OAAA,CAAW,KAAO,EAAA,GAAA,EAAK,cAAc,CAAA,CAAA;AAAA,GAC9C;AAAA,EACA,MAAA,CAAU,KAAa,cAAiD,EAAA;AACtE,IAAO,OAAA,OAAA,CAAW,QAAU,EAAA,GAAA,EAAK,cAAc,CAAA,CAAA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WAAc,GAAA,MAAA;AAAA,IAC/D,gBAAgB,UAAW,CAAA,cAAA;AAAA,GAC5B,CAAA,CAAA;AAGD,EAAc,aAAA,EAAA,CAAA;AAChB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sources":["../../../src/utils/options.ts"],"sourcesContent":["import { StorefrontOptions } from '../types';\n\nlet options: StorefrontOptions = {\n storeIdentifier: '',\n environment: 'prod',\n};\n\nexport function setOptions(opts: StorefrontOptions) {\n options = opts;\n}\n\nexport function getOptions() {\n return options;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.js","sources":["../../../src/utils/options.ts"],"sourcesContent":["import { StorefrontOptions } from '../types';\n\nlet options: StorefrontOptions = {\n storeIdentifier: '',\n environment: 'prod',\n};\n\nexport function setOptions(opts: StorefrontOptions) {\n options = opts;\n}\n\nexport function getOptions() {\n return options;\n}\n"],"names":[],"mappings":"AAEA,IAAI,OAA6B,GAAA;AAAA,EAC/B,eAAiB,EAAA,EAAA;AAAA,EACjB,WAAa,EAAA,MAAA;AACf,CAAA,CAAA;AAEO,SAAS,WAAW,IAAyB,EAAA;AAClD,EAAU,OAAA,GAAA,IAAA,CAAA;AACZ,CAAA;AAEO,SAAS,UAAa,GAAA;AAC3B,EAAO,OAAA,OAAA,CAAA;AACT;;;;"}
|
|
@@ -4,25 +4,6 @@ import { getOptions } from './options.js';
|
|
|
4
4
|
import { RECHARGE_CDN_URL, RECHARGE_API_URL, SHOPIFY_APP_PROXY_URL } from '../constants/api.js';
|
|
5
5
|
import { RechargeRequestError } from './error.js';
|
|
6
6
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __defProps = Object.defineProperties;
|
|
9
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
10
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
7
|
function stringifyQuery(str) {
|
|
27
8
|
return stringify(str, {
|
|
28
9
|
encode: false,
|
|
@@ -38,13 +19,15 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
|
|
|
38
19
|
const { environment, environmentUri, storeIdentifier, loginRetryFn } = getOptions();
|
|
39
20
|
const token = session.apiToken;
|
|
40
21
|
const rechargeBaseUrl = RECHARGE_API_URL(environment, environmentUri);
|
|
41
|
-
const reqHeaders =
|
|
22
|
+
const reqHeaders = {
|
|
42
23
|
"X-Recharge-Access-Token": token,
|
|
43
|
-
"X-Recharge-Version": "2021-11"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
24
|
+
"X-Recharge-Version": "2021-11",
|
|
25
|
+
...headers ? headers : {}
|
|
26
|
+
};
|
|
27
|
+
const localQuery = {
|
|
28
|
+
shop_url: storeIdentifier,
|
|
29
|
+
...query
|
|
30
|
+
};
|
|
48
31
|
try {
|
|
49
32
|
return await request(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });
|
|
50
33
|
} catch (error) {
|
|
@@ -55,9 +38,10 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
|
|
|
55
38
|
id,
|
|
56
39
|
query: localQuery,
|
|
57
40
|
data,
|
|
58
|
-
headers:
|
|
41
|
+
headers: {
|
|
42
|
+
...reqHeaders,
|
|
59
43
|
"X-Recharge-Access-Token": session2.apiToken
|
|
60
|
-
}
|
|
44
|
+
}
|
|
61
45
|
});
|
|
62
46
|
}
|
|
63
47
|
throw error;
|
|
@@ -84,11 +68,12 @@ async function request(method, url, { id, query, data, headers } = {}) {
|
|
|
84
68
|
if (data && method !== "get") {
|
|
85
69
|
reqBody = JSON.stringify(data);
|
|
86
70
|
}
|
|
87
|
-
const reqHeaders =
|
|
71
|
+
const reqHeaders = {
|
|
88
72
|
Accept: "application/json",
|
|
89
73
|
"Content-Type": "application/json",
|
|
90
|
-
"X-Recharge-App": "storefront-client"
|
|
91
|
-
|
|
74
|
+
"X-Recharge-App": "storefront-client",
|
|
75
|
+
...headers ? headers : {}
|
|
76
|
+
};
|
|
92
77
|
const response = await fetch(reqUrl, {
|
|
93
78
|
method,
|
|
94
79
|
headers: reqHeaders,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sources":["../../../src/utils/request.ts"],"sourcesContent":["import 'isomorphic-fetch';\n\nimport stringify from 'qs/lib/stringify';\n\nimport { Method, RequestHeaders, RequestOptions } from '../types';\nimport { getOptions } from './options';\nimport { RECHARGE_API_URL, RECHARGE_CDN_URL, SHOPIFY_APP_PROXY_URL } from '../constants/api';\nimport { Session } from '../types/session';\nimport { RechargeRequestError } from './error';\n\nfunction stringifyQuery(str: unknown): string {\n return stringify(str, {\n encode: false,\n indices: false,\n arrayFormat: 'comma',\n });\n}\n\nexport async function cdnRequest<T>(method: Method, url: string, requestOptions: RequestOptions = {}): Promise<T> {\n const opts = getOptions();\n return request(method, `${RECHARGE_CDN_URL(opts.environment)}/store/${opts.storeIdentifier}${url}`, requestOptions);\n}\n\nexport async function rechargeApiRequest<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {},\n session: Session\n): Promise<T> {\n const { environment, environmentUri, storeIdentifier, loginRetryFn } = getOptions();\n const token = session.apiToken;\n const rechargeBaseUrl = RECHARGE_API_URL(environment, environmentUri);\n const reqHeaders: RequestHeaders = {\n 'X-Recharge-Access-Token': token,\n 'X-Recharge-Version': '2021-11',\n ...(headers ? headers : {}),\n };\n\n const localQuery = {\n shop_url: storeIdentifier,\n ...(query as any),\n };\n\n try {\n // await to catch any errors\n return await request<T>(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });\n } catch (error: unknown) {\n if (loginRetryFn && error instanceof RechargeRequestError && error.status === 401) {\n // call loginRetryFn and retry request on 401\n return loginRetryFn().then(session => {\n if (session) {\n return request(method, `${rechargeBaseUrl}${url}`, {\n id,\n query: localQuery,\n data,\n headers: {\n ...reqHeaders,\n 'X-Recharge-Access-Token': session.apiToken,\n },\n });\n }\n throw error;\n });\n }\n throw error;\n }\n}\n\nexport async function shopifyAppProxyRequest<T>(\n method: Method,\n url: string,\n requestOptions: RequestOptions = {}\n): Promise<T> {\n return request(method, `${SHOPIFY_APP_PROXY_URL}${url}`, requestOptions);\n}\n\nexport async function request<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {}\n): Promise<T> {\n let reqUrl = url.trim();\n\n if (id) {\n reqUrl = [reqUrl, `${id}`.trim()].join('/');\n }\n\n if (query) {\n let exQuery;\n [reqUrl, exQuery] = reqUrl.split('?');\n const fullQuery = [exQuery, stringifyQuery(query)].join('&').replace(/^&/, '');\n reqUrl = `${reqUrl}${fullQuery ? `?${fullQuery}` : ''}`;\n }\n\n let reqBody;\n if (data && method !== 'get') {\n reqBody = JSON.stringify(data);\n }\n\n const reqHeaders: RequestHeaders = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-Recharge-App': 'storefront-client',\n ...(headers ? headers : {}),\n };\n\n const response = await fetch(reqUrl, {\n method,\n headers: reqHeaders,\n body: reqBody,\n });\n\n let result;\n try {\n result = await response.json();\n } catch (e) {\n // If we get here, it means we were a no content response.\n }\n\n if (!response.ok) {\n if (result && result.error) {\n throw new RechargeRequestError(result.error, response.status);\n } else if (result && result.errors) {\n throw new RechargeRequestError(JSON.stringify(result.errors), response.status);\n } else {\n throw new RechargeRequestError('A connection error occurred while making the request');\n }\n }\n\n return result as T;\n}\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"request.js","sources":["../../../src/utils/request.ts"],"sourcesContent":["import 'isomorphic-fetch';\n\nimport stringify from 'qs/lib/stringify';\n\nimport { Method, RequestHeaders, RequestOptions } from '../types';\nimport { getOptions } from './options';\nimport { RECHARGE_API_URL, RECHARGE_CDN_URL, SHOPIFY_APP_PROXY_URL } from '../constants/api';\nimport { Session } from '../types/session';\nimport { RechargeRequestError } from './error';\n\nfunction stringifyQuery(str: unknown): string {\n return stringify(str, {\n encode: false,\n indices: false,\n arrayFormat: 'comma',\n });\n}\n\nexport async function cdnRequest<T>(method: Method, url: string, requestOptions: RequestOptions = {}): Promise<T> {\n const opts = getOptions();\n return request(method, `${RECHARGE_CDN_URL(opts.environment)}/store/${opts.storeIdentifier}${url}`, requestOptions);\n}\n\nexport async function rechargeApiRequest<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {},\n session: Session\n): Promise<T> {\n const { environment, environmentUri, storeIdentifier, loginRetryFn } = getOptions();\n const token = session.apiToken;\n const rechargeBaseUrl = RECHARGE_API_URL(environment, environmentUri);\n const reqHeaders: RequestHeaders = {\n 'X-Recharge-Access-Token': token,\n 'X-Recharge-Version': '2021-11',\n ...(headers ? headers : {}),\n };\n\n const localQuery = {\n shop_url: storeIdentifier,\n ...(query as any),\n };\n\n try {\n // await to catch any errors\n return await request<T>(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });\n } catch (error: unknown) {\n if (loginRetryFn && error instanceof RechargeRequestError && error.status === 401) {\n // call loginRetryFn and retry request on 401\n return loginRetryFn().then(session => {\n if (session) {\n return request(method, `${rechargeBaseUrl}${url}`, {\n id,\n query: localQuery,\n data,\n headers: {\n ...reqHeaders,\n 'X-Recharge-Access-Token': session.apiToken,\n },\n });\n }\n throw error;\n });\n }\n throw error;\n }\n}\n\nexport async function shopifyAppProxyRequest<T>(\n method: Method,\n url: string,\n requestOptions: RequestOptions = {}\n): Promise<T> {\n return request(method, `${SHOPIFY_APP_PROXY_URL}${url}`, requestOptions);\n}\n\nexport async function request<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {}\n): Promise<T> {\n let reqUrl = url.trim();\n\n if (id) {\n reqUrl = [reqUrl, `${id}`.trim()].join('/');\n }\n\n if (query) {\n let exQuery;\n [reqUrl, exQuery] = reqUrl.split('?');\n const fullQuery = [exQuery, stringifyQuery(query)].join('&').replace(/^&/, '');\n reqUrl = `${reqUrl}${fullQuery ? `?${fullQuery}` : ''}`;\n }\n\n let reqBody;\n if (data && method !== 'get') {\n reqBody = JSON.stringify(data);\n }\n\n const reqHeaders: RequestHeaders = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-Recharge-App': 'storefront-client',\n ...(headers ? headers : {}),\n };\n\n const response = await fetch(reqUrl, {\n method,\n headers: reqHeaders,\n body: reqBody,\n });\n\n let result;\n try {\n result = await response.json();\n } catch (e) {\n // If we get here, it means we were a no content response.\n }\n\n if (!response.ok) {\n if (result && result.error) {\n throw new RechargeRequestError(result.error, response.status);\n } else if (result && result.errors) {\n throw new RechargeRequestError(JSON.stringify(result.errors), response.status);\n } else {\n throw new RechargeRequestError('A connection error occurred while making the request');\n }\n }\n\n return result as T;\n}\n"],"names":["session"],"mappings":";;;;;;AAUA,SAAS,eAAe,GAAsB,EAAA;AAC5C,EAAA,OAAO,UAAU,GAAK,EAAA;AAAA,IACpB,MAAQ,EAAA,KAAA;AAAA,IACR,OAAS,EAAA,KAAA;AAAA,IACT,WAAa,EAAA,OAAA;AAAA,GACd,CAAA,CAAA;AACH,CAAA;AAEA,eAAsB,UAAc,CAAA,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D,CAAA,CAAA;AAAA,KACvF;AAAA,GACF;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2101,7 +2101,10 @@ interface GiftPurchase {
|
|
|
2101
2101
|
external_gift_variant_id: ExternalId;
|
|
2102
2102
|
/** Order id in the store platform that purchased the gift. */
|
|
2103
2103
|
external_order_id: ExternalId;
|
|
2104
|
-
/**
|
|
2104
|
+
/**
|
|
2105
|
+
* List of platform product ids that that can be used when redeeming the gift.
|
|
2106
|
+
* This list will be empty if any product can be redeemed or a collection should be used for the redemption
|
|
2107
|
+
*/
|
|
2105
2108
|
external_redeemable_product_ids: ExternalId[];
|
|
2106
2109
|
/** The currency the gift is in. */
|
|
2107
2110
|
gift_currency: string;
|
|
@@ -2122,6 +2125,8 @@ interface GiftPurchase {
|
|
|
2122
2125
|
updated_at: IsoDateString;
|
|
2123
2126
|
/** ISO date for when the gift was created. */
|
|
2124
2127
|
created_at: IsoDateString;
|
|
2128
|
+
/** A Recharge collection id that specifies which products this gift can be redeemed for. */
|
|
2129
|
+
redeemable_collection_id?: number;
|
|
2125
2130
|
}
|
|
2126
2131
|
interface GiftPurchasesResponse {
|
|
2127
2132
|
next_cursor: null | string;
|
|
@@ -2343,11 +2348,16 @@ interface Onetime {
|
|
|
2343
2348
|
/** Presentment currency */
|
|
2344
2349
|
presentment_currency: string | null;
|
|
2345
2350
|
}
|
|
2346
|
-
type OnetimeRequiredCreateProps = 'address_id' | 'external_variant_id' | '
|
|
2347
|
-
type OnetimeOptionalCreateProps = 'external_product_id' | 'next_charge_scheduled_at' | 'properties' | 'sku';
|
|
2351
|
+
type OnetimeRequiredCreateProps = 'address_id' | 'external_variant_id' | 'product_title' | 'quantity';
|
|
2352
|
+
type OnetimeOptionalCreateProps = 'external_product_id' | 'price' | 'next_charge_scheduled_at' | 'properties' | 'sku';
|
|
2348
2353
|
interface CreateOnetimeRequest extends SubType<Onetime, OnetimeRequiredCreateProps, OnetimeOptionalCreateProps> {
|
|
2349
2354
|
/** Instructs to add the Onetime to the next charge scheduled under this Address. */
|
|
2350
2355
|
add_to_next_charge?: boolean;
|
|
2356
|
+
/**
|
|
2357
|
+
* When creating a onetime using a gift, pass the `credit_account_id` that is associated with that gift.
|
|
2358
|
+
* This will create the onetime using the credit account associated with the gift.
|
|
2359
|
+
*/
|
|
2360
|
+
gift_id?: number;
|
|
2351
2361
|
}
|
|
2352
2362
|
interface UpdateOnetimeRequest extends Partial<Pick<Onetime, 'next_charge_scheduled_at' | 'properties' | 'quantity' | 'external_variant_id' | 'sku'>> {
|
|
2353
2363
|
}
|
|
@@ -2626,4 +2636,4 @@ declare const api: {
|
|
|
2626
2636
|
};
|
|
2627
2637
|
declare function initRecharge(opt?: InitOptions): void;
|
|
2628
2638
|
|
|
2629
|
-
export { ActivateMembershipRequest, Address, AddressIncludes, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, AssociatedAddress, BasicSubscriptionParams, BooleanLike, BooleanNumbers, BooleanString, BooleanStringNumbers, BundleAppProxy, BundleProduct, BundlePurchaseItem, BundlePurchaseItemParams, BundleSelection, BundleSelectionAppProxy, BundleSelectionItem, BundleSelectionItemRequiredCreateProps, BundleSelectionListParams, BundleSelectionsResponse, BundleSelectionsSortBy, BundleTranslations, BundleVariant, BundleVariantOptionSource, CDNBaseWidgetSettings, CDNBundleSettings, CDNBundleVariant, CDNBundleVariantOptionSource, CDNPlan, CDNProduct, CDNProductAndSettings, CDNProductKeyObject, CDNProductQuery_2020_12, CDNProductQuery_2022_06, CDNProductRaw, CDNProductResource, CDNProductResponseType, CDNProductType, CDNProductVariant_2022_06, CDNProduct_2022_06, CDNProductsAndSettings, CDNProductsAndSettingsResource, CDNStoreSettings, CDNSubscriptionOption, CDNVariant, CDNVersion, CDNWidgetSettings, CDNWidgetSettingsRaw, CDNWidgetSettingsResource, CRUDRequestOptions, CancelMembershipRequest, CancelSubscriptionRequest, ChangeMembershipRequest, ChannelSettings, Charge, ChargeIncludes, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateBundleSelectionRequest, CreateMetafieldRequest, CreateOnetimeRequest, CreatePaymentMethodRequest, CreateRecipientAddress, CreateSubscriptionRequest, CreditAccount, CreditAccountType, CreditSummaryIncludes, Customer, CustomerCreditSummary, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerNotification, CustomerNotificationOptions, CustomerNotificationTemplate, CustomerNotificationType, CustomerPortalAccessResponse, Delivery, DeliveryLineItem, DeliveryOrder, DeliveryPaymentMethod, Discount, DiscountType, DynamicBundleItemAppProxy, DynamicBundlePropertiesAppProxy, ExternalAttributeSchema, ExternalId, ExternalTransactionId, FirstOption, GetAddressOptions, GetChargeOptions, GetCreditSummaryOptions, GetCustomerOptions, GetMembershipProgramOptions, GetPaymentMethodOptions, GetRequestOptions, GetSubscriptionOptions, GiftPurchase, GiftPurchasesParams, GiftPurchasesResponse, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipBenefit, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipProgram, MembershipProgramIncludes, MembershipProgramListParams, MembershipProgramListResponse, MembershipProgramResponse, MembershipProgramSortBy, MembershipProgramStatus, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Metafield, MetafieldOptionalCreateProps, MetafieldOwnerResource, MetafieldRequiredCreateProps, Method, Modifier, Onetime, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderIncludes, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PasswordlessCodeResponse, PasswordlessOptions, PasswordlessValidateResponse, PaymentDetails, PaymentMethod, PaymentMethodIncludes, PaymentMethodListParams, PaymentMethodOptionalCreateProps, PaymentMethodRequiredCreateProps, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, ProcessorName, ProductImage, ProductInclude, ProductOption, ProductSearchParams_2020_12, ProductSearchParams_2022_06, ProductSearchResponse_2020_12, ProductSearchResponse_2022_06, ProductSearchType, ProductSource, ProductValueOption, ProductVariant_2020_12, ProductVariant_2022_06, Product_2020_12, Product_2022_06, Property, PublishStatus, Request, RequestHeaders, RequestOptions, SellingPlan, SellingPlanGroup, Session, ShippingCountriesOptions, ShippingCountriesResponse, ShippingCountry, ShippingLine, ShippingProvince, ShopifyUpdatePaymentInfoOptions, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, SortBy, SortField, SortKeys, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionIncludes, SubscriptionListParams, SubscriptionOption, SubscriptionOptionalCreateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionStatus, Subscription_2021_01, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateBundlePurchaseItem, UpdateBundleSelectionRequest, UpdateCustomerRequest, UpdateMetafieldRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, UpdateSubscriptionsParams, UpdateSubscriptionsRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, changeMembership, createAddress, createBundleSelection, createMetafield, createOnetime, createPaymentMethod, createSubscription, createSubscriptions, deleteAddress, deleteBundleSelection, deleteMetafield, deleteOnetime, getActiveChurnLandingPageURL, getAddress, getBundleId, getBundleSelection, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCreditSummary, getCustomer, getCustomerPortalAccess, getDeliverySchedule, getDynamicBundleItems, getGiftPurchase, getMembership, getMembershipProgram, getOnetime, getOrder, getPaymentMethod, getPlan, getShippingCountries, getSubscription, initRecharge, intervalUnit, listAddresses, listBundleSelections, listCharges, listGiftPurchases, listMembershipPrograms, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginCustomerPortal, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, processCharge, productSearch, removeDiscountsFromAddress, removeDiscountsFromCharge, resetCDNCache, sendCustomerNotification, sendPasswordlessCode, sendPasswordlessCodeAppProxy, skipCharge, skipFutureCharge, skipGiftSubscriptionCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateBundle, updateBundleSelection, updateCustomer, updateMetafield, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, updateSubscriptions, validateBundle, validateDynamicBundle, validatePasswordlessCode, validatePasswordlessCodeAppProxy };
|
|
2639
|
+
export { type ActivateMembershipRequest, type Address, type AddressIncludes, type AddressListParams, type AddressListResponse, type AddressResponse, type AddressSortBy, type AnalyticsData, type AssociatedAddress, type BasicSubscriptionParams, type BooleanLike, type BooleanNumbers, type BooleanString, type BooleanStringNumbers, type BundleAppProxy, type BundleProduct, type BundlePurchaseItem, type BundlePurchaseItemParams, type BundleSelection, type BundleSelectionAppProxy, type BundleSelectionItem, type BundleSelectionItemRequiredCreateProps, type BundleSelectionListParams, type BundleSelectionsResponse, type BundleSelectionsSortBy, type BundleTranslations, type BundleVariant, type BundleVariantOptionSource, type CDNBaseWidgetSettings, type CDNBundleSettings, type CDNBundleVariant, type CDNBundleVariantOptionSource, type CDNPlan, type CDNProduct, type CDNProductAndSettings, type CDNProductKeyObject, type CDNProductQuery_2020_12, type CDNProductQuery_2022_06, type CDNProductRaw, type CDNProductResource, type CDNProductResponseType, type CDNProductType, type CDNProductVariant_2022_06, type CDNProduct_2022_06, type CDNProductsAndSettings, type CDNProductsAndSettingsResource, type CDNStoreSettings, type CDNSubscriptionOption, type CDNVariant, type CDNVersion, type CDNWidgetSettings, type CDNWidgetSettingsRaw, type CDNWidgetSettingsResource, type CRUDRequestOptions, type CancelMembershipRequest, type CancelSubscriptionRequest, type ChangeMembershipRequest, type ChannelSettings, type Charge, type ChargeIncludes, type ChargeListParams, type ChargeListResponse, type ChargeResponse, type ChargeSortBy, type ChargeStatus, type ColorString, type CreateAddressRequest, type CreateBundleSelectionRequest, type CreateMetafieldRequest, type CreateOnetimeRequest, type CreatePaymentMethodRequest, type CreateRecipientAddress, type CreateSubscriptionRequest, type CreditAccount, type CreditAccountType, type CreditSummaryIncludes, type Customer, type CustomerCreditSummary, type CustomerDeliveryScheduleParams, type CustomerDeliveryScheduleResponse, type CustomerIncludes, type CustomerNotification, type CustomerNotificationOptions, type CustomerNotificationTemplate, type CustomerNotificationType, type CustomerPortalAccessResponse, type Delivery, type DeliveryLineItem, type DeliveryOrder, type DeliveryPaymentMethod, type Discount, type DiscountType, type DynamicBundleItemAppProxy, type DynamicBundlePropertiesAppProxy, type ExternalAttributeSchema, type ExternalId, type ExternalTransactionId, type FirstOption, type GetAddressOptions, type GetChargeOptions, type GetCreditSummaryOptions, type GetCustomerOptions, type GetMembershipProgramOptions, type GetPaymentMethodOptions, type GetRequestOptions, type GetSubscriptionOptions, type GiftPurchase, type GiftPurchasesParams, type GiftPurchasesResponse, type HTMLString, type InitOptions, type IntervalUnit, type IsoDateString, type LineItem, type ListParams, type LoginResponse, type Membership, type MembershipBenefit, type MembershipIncludes, type MembershipListParams, type MembershipListResponse, type MembershipProgram, type MembershipProgramIncludes, type MembershipProgramListParams, type MembershipProgramListResponse, type MembershipProgramResponse, type MembershipProgramSortBy, type MembershipProgramStatus, type MembershipResponse, type MembershipStatus, type MembershipsSortBy, type MergeAddressesRequest, type Metafield, type MetafieldOptionalCreateProps, type MetafieldOwnerResource, type MetafieldRequiredCreateProps, type Method, type Modifier, type Onetime, type OnetimeListParams, type OnetimeOptionalCreateProps, type OnetimeRequiredCreateProps, type OnetimesResponse, type OnetimesSortBy, type Order, type OrderIncludes, type OrderListParams, type OrderSortBy, type OrderStatus, type OrderType, type OrdersResponse, type PasswordlessCodeResponse, type PasswordlessOptions, type PasswordlessValidateResponse, type PaymentDetails, type PaymentMethod, type PaymentMethodIncludes, type PaymentMethodListParams, type PaymentMethodOptionalCreateProps, type PaymentMethodRequiredCreateProps, type PaymentMethodSortBy, type PaymentMethodStatus, type PaymentMethodsResponse, type PaymentType, type Plan, type PlanListParams, type PlanSortBy, type PlanType, type PlansResponse, type ProcessorName, type ProductImage, type ProductInclude, type ProductOption, type ProductSearchParams_2020_12, type ProductSearchParams_2022_06, type ProductSearchResponse_2020_12, type ProductSearchResponse_2022_06, type ProductSearchType, type ProductSource, type ProductValueOption, type ProductVariant_2020_12, type ProductVariant_2022_06, type Product_2020_12, type Product_2022_06, type Property, type PublishStatus, type Request, type RequestHeaders, type RequestOptions, type SellingPlan, type SellingPlanGroup, type Session, type ShippingCountriesOptions, type ShippingCountriesResponse, type ShippingCountry, type ShippingLine, type ShippingProvince, type ShopifyUpdatePaymentInfoOptions, type SkipFutureChargeAddressRequest, type SkipFutureChargeAddressResponse, type SortBy, type SortField, type SortKeys, type StorefrontEnvironment, type StorefrontOptions, type StorefrontPurchaseOption, type SubType, type Subscription, type SubscriptionIncludes, type SubscriptionListParams, type SubscriptionOption, type SubscriptionOptionalCreateProps, type SubscriptionPreferences, type SubscriptionRequiredCreateProps, type SubscriptionSortBy, type SubscriptionStatus, type Subscription_2021_01, type SubscriptionsResponse, type TaxLine, type Translations, type UpdateAddressRequest, type UpdateBundlePurchaseItem, type UpdateBundleSelectionRequest, type UpdateCustomerRequest, type UpdateMetafieldRequest, type UpdateOnetimeRequest, type UpdatePaymentMethodRequest, type UpdateSubscriptionParams, type UpdateSubscriptionRequest, type UpdateSubscriptionsParams, type UpdateSubscriptionsRequest, type WidgetIconColor, type WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, changeMembership, createAddress, createBundleSelection, createMetafield, createOnetime, createPaymentMethod, createSubscription, createSubscriptions, deleteAddress, deleteBundleSelection, deleteMetafield, deleteOnetime, getActiveChurnLandingPageURL, getAddress, getBundleId, getBundleSelection, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCreditSummary, getCustomer, getCustomerPortalAccess, getDeliverySchedule, getDynamicBundleItems, getGiftPurchase, getMembership, getMembershipProgram, getOnetime, getOrder, getPaymentMethod, getPlan, getShippingCountries, getSubscription, initRecharge, type intervalUnit, listAddresses, listBundleSelections, listCharges, listGiftPurchases, listMembershipPrograms, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginCustomerPortal, loginShopifyApi, loginShopifyAppProxy, type membershipIncludes, mergeAddresses, processCharge, productSearch, removeDiscountsFromAddress, removeDiscountsFromCharge, resetCDNCache, sendCustomerNotification, sendPasswordlessCode, sendPasswordlessCodeAppProxy, skipCharge, skipFutureCharge, skipGiftSubscriptionCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateBundle, updateBundleSelection, updateCustomer, updateMetafield, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, updateSubscriptions, validateBundle, validateDynamicBundle, validatePasswordlessCode, validatePasswordlessCodeAppProxy };
|