@rechargeapps/storefront-client 0.15.1 → 0.16.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/cjs/api/address.js +45 -0
- package/dist/cjs/api/address.js.map +1 -0
- package/dist/cjs/api/auth.js +36 -0
- package/dist/cjs/api/auth.js.map +1 -0
- package/dist/cjs/api/bundle.js +138 -0
- package/dist/cjs/api/bundle.js.map +1 -0
- package/dist/cjs/api/cdn.js +85 -0
- package/dist/cjs/api/cdn.js.map +1 -0
- package/dist/cjs/api/charge.js +44 -0
- package/dist/cjs/api/charge.js.map +1 -0
- package/dist/cjs/api/customer.js +38 -0
- package/dist/cjs/api/customer.js.map +1 -0
- package/dist/cjs/api/membership.js +31 -0
- package/dist/cjs/api/membership.js.map +1 -0
- package/dist/cjs/api/onetime.js +40 -0
- package/dist/cjs/api/onetime.js.map +1 -0
- package/dist/cjs/api/order.js +19 -0
- package/dist/cjs/api/order.js.map +1 -0
- package/dist/cjs/api/paymentMethod.js +27 -0
- package/dist/cjs/api/paymentMethod.js.map +1 -0
- package/dist/cjs/api/plan.js +19 -0
- package/dist/cjs/api/plan.js.map +1 -0
- package/dist/cjs/api/subscription.js +71 -0
- package/dist/cjs/api/subscription.js.map +1 -0
- package/dist/cjs/constants/api.js +14 -0
- package/dist/cjs/constants/api.js.map +1 -0
- package/dist/cjs/index.js +79 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/mappers/cdn.js +67 -0
- package/dist/cjs/mappers/cdn.js.map +1 -0
- package/dist/cjs/mappers/utils.js +38 -0
- package/dist/cjs/mappers/utils.js.map +1 -0
- package/dist/cjs/utils/init.js +55 -0
- package/dist/cjs/utils/init.js.map +1 -0
- package/dist/cjs/utils/options.js +18 -0
- package/dist/cjs/utils/options.js.map +1 -0
- package/dist/cjs/utils/request.js +98 -0
- package/dist/cjs/utils/request.js.map +1 -0
- package/dist/esm/api/address.js +35 -0
- package/dist/esm/api/address.js.map +1 -0
- package/dist/esm/api/auth.js +31 -0
- package/dist/esm/api/auth.js.map +1 -0
- package/dist/esm/api/bundle.js +131 -0
- package/dist/esm/api/bundle.js.map +1 -0
- package/dist/esm/api/cdn.js +74 -0
- package/dist/esm/api/cdn.js.map +1 -0
- package/dist/esm/api/charge.js +34 -0
- package/dist/esm/api/charge.js.map +1 -0
- package/dist/esm/api/customer.js +32 -0
- package/dist/esm/api/customer.js.map +1 -0
- package/dist/esm/api/membership.js +24 -0
- package/dist/esm/api/membership.js.map +1 -0
- package/dist/esm/api/onetime.js +32 -0
- package/dist/esm/api/onetime.js.map +1 -0
- package/dist/esm/api/order.js +14 -0
- package/dist/esm/api/order.js.map +1 -0
- package/dist/esm/api/paymentMethod.js +21 -0
- package/dist/esm/api/paymentMethod.js.map +1 -0
- package/dist/esm/api/plan.js +14 -0
- package/dist/esm/api/plan.js.map +1 -0
- package/dist/esm/api/subscription.js +59 -0
- package/dist/esm/api/subscription.js.map +1 -0
- package/dist/esm/constants/api.js +7 -0
- package/dist/esm/constants/api.js.map +1 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/mappers/cdn.js +57 -0
- package/dist/esm/mappers/cdn.js.map +1 -0
- package/dist/esm/mappers/utils.js +34 -0
- package/dist/esm/mappers/utils.js.map +1 -0
- package/dist/esm/utils/init.js +50 -0
- package/dist/esm/utils/init.js.map +1 -0
- package/dist/esm/utils/options.js +13 -0
- package/dist/esm/utils/options.js.map +1 -0
- package/dist/esm/utils/request.js +91 -0
- package/dist/esm/utils/request.js.map +1 -0
- package/dist/index.d.ts +1575 -0
- package/dist/umd/recharge-client.min.js +28 -0
- package/package.json +3 -2
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import omit from 'lodash/omit';
|
|
2
|
+
import { parseValues } from './utils.js';
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
function widgetSettingsMapper(widgetSettingsRaw) {
|
|
24
|
+
var _a;
|
|
25
|
+
const parsedSettings = parseValues(widgetSettingsRaw);
|
|
26
|
+
const auto_inject = parsedSettings.auto_inject === void 0 ? true : parsedSettings.auto_inject;
|
|
27
|
+
const valid_pages = (_a = parsedSettings.display_on) != null ? _a : [];
|
|
28
|
+
const is_subscription_first = parsedSettings.first_option === "autodeliver";
|
|
29
|
+
return __spreadProps(__spreadValues({}, omit(parsedSettings, ["display_on", "first_option"])), {
|
|
30
|
+
auto_inject,
|
|
31
|
+
valid_pages,
|
|
32
|
+
is_subscription_first,
|
|
33
|
+
autoInject: auto_inject,
|
|
34
|
+
validPages: valid_pages,
|
|
35
|
+
isSubscriptionFirst: is_subscription_first
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function productMapper(productRaw) {
|
|
39
|
+
var _a;
|
|
40
|
+
const is_subscription_only = ((_a = productRaw.subscription_options) == null ? void 0 : _a.storefront_purchase_options) === "subscription_only";
|
|
41
|
+
return __spreadProps(__spreadValues({}, productRaw), {
|
|
42
|
+
is_subscription_only,
|
|
43
|
+
isSubscriptionOnly: is_subscription_only
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function productArrayMapper(productsArray) {
|
|
47
|
+
return productsArray.map((productObjRaw) => {
|
|
48
|
+
const productObj = {};
|
|
49
|
+
Object.entries(productObjRaw).forEach(([key, value]) => {
|
|
50
|
+
productObj[key] = productMapper(value);
|
|
51
|
+
});
|
|
52
|
+
return productObj;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { productArrayMapper, productMapper, widgetSettingsMapper };
|
|
57
|
+
//# sourceMappingURL=cdn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdn.js","sources":["../../../src/mappers/cdn.ts"],"sourcesContent":["import omit from 'lodash/omit';\nimport {\n CDNBaseWidgetSettings,\n CDNProductRaw,\n CDNWidgetSettings,\n CDNWidgetSettingsRaw,\n CDNProduct,\n CDNProductKeyObject,\n} from '../types';\nimport { parseValues } from './utils';\n\nexport function widgetSettingsMapper(widgetSettingsRaw: CDNWidgetSettingsRaw): CDNWidgetSettings {\n const parsedSettings = parseValues<CDNBaseWidgetSettings>(widgetSettingsRaw);\n\n const auto_inject = parsedSettings.auto_inject === undefined ? true : parsedSettings.auto_inject;\n const valid_pages = parsedSettings.display_on ?? [];\n const is_subscription_first = parsedSettings.first_option === 'autodeliver';\n\n return {\n ...omit(parsedSettings, ['display_on', 'first_option']),\n auto_inject,\n valid_pages,\n is_subscription_first,\n autoInject: auto_inject,\n validPages: valid_pages,\n isSubscriptionFirst: is_subscription_first,\n };\n}\n\nexport function productMapper(productRaw: CDNProductRaw): CDNProduct {\n const is_subscription_only = productRaw.subscription_options?.storefront_purchase_options === 'subscription_only';\n return {\n ...productRaw,\n is_subscription_only,\n isSubscriptionOnly: is_subscription_only,\n };\n}\n\nexport function productArrayMapper(\n productsArray: {\n [key: string]: CDNProductRaw;\n }[]\n): CDNProductKeyObject[] {\n return productsArray.map(productObjRaw => {\n const productObj: CDNProductKeyObject = {};\n Object.entries(productObjRaw).forEach(([key, value]) => {\n productObj[key] = productMapper(value);\n });\n return productObj;\n });\n}\n"],"names":[],"mappings":";;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACp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a,CAAC,cAAc,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE;AACvD,IAAI,oBAAoB;AACxB,IAAI,kBAAkB,EAAE,oBAAoB;AAC5C,GAAG,CAAC,CAAC;AACL,CAAC;AACM,SAAS,kBAAkB,CAAC,aAAa,EAAE;AAClD,EAAE,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,aAAa,KAAK;AAC9C,IAAI,MAAM,UAAU,GAAG,EAAE,CAAC;AAC1B,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AAC5D,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAC7C,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,UAAU,CAAC;AACtB,GAAG,CAAC,CAAC;AACL;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
function parseValue(value) {
|
|
21
|
+
try {
|
|
22
|
+
return JSON.parse(value);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function parseValues(json) {
|
|
28
|
+
return Object.entries(json).reduce((memo, [key, value]) => {
|
|
29
|
+
return __spreadProps(__spreadValues({}, memo), { [key]: parseValue(value) });
|
|
30
|
+
}, {});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { parseValues };
|
|
34
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/mappers/utils.ts"],"sourcesContent":["/** Trys to parse passed in value. If it doesn't work returns the same passed in value */\nfunction parseValue(value: unknown): any {\n try {\n return JSON.parse(value as string);\n } catch {\n return value;\n }\n}\n\n/** Returns a new object that updates \"string\" values into their correct data type. */\nexport function parseValues<T = any>(json: Record<string, unknown>): T {\n return Object.entries(json).reduce((memo, [key, value]) => {\n return { ...memo, [key]: parseValue(value) };\n }, {}) as T;\n}\n"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,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AC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACjF,GAAG,EAAE,EAAE,CAAC,CAAC;AACT;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { resetCDNCache } from '../api/cdn.js';
|
|
2
|
+
import { setOptions } from './options.js';
|
|
3
|
+
import { request } from './request.js';
|
|
4
|
+
|
|
5
|
+
const api = {
|
|
6
|
+
get(url, requestOptions) {
|
|
7
|
+
return request("get", url, requestOptions);
|
|
8
|
+
},
|
|
9
|
+
post(url, requestOptions) {
|
|
10
|
+
return request("post", url, requestOptions);
|
|
11
|
+
},
|
|
12
|
+
put(url, requestOptions) {
|
|
13
|
+
return request("put", url, requestOptions);
|
|
14
|
+
},
|
|
15
|
+
delete(url, requestOptions) {
|
|
16
|
+
return request("delete", url, requestOptions);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function getStoreIdentifier(storeIdentifier) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
if (storeIdentifier) {
|
|
22
|
+
return storeIdentifier;
|
|
23
|
+
}
|
|
24
|
+
if ((_a = window == null ? void 0 : window.Shopify) == null ? void 0 : _a.shop) {
|
|
25
|
+
return window.Shopify.shop;
|
|
26
|
+
}
|
|
27
|
+
let domain = window == null ? void 0 : window.domain;
|
|
28
|
+
if (!domain) {
|
|
29
|
+
const subdomain = (_b = location == null ? void 0 : location.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i)) == null ? void 0 : _b[1].replace(/-sp$/, "");
|
|
30
|
+
if (subdomain) {
|
|
31
|
+
domain = `${subdomain}.myshopify.com`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (domain) {
|
|
35
|
+
return domain;
|
|
36
|
+
}
|
|
37
|
+
throw new Error(`No storeIdentifier was passed into init.`);
|
|
38
|
+
}
|
|
39
|
+
function initRecharge(opt = {}) {
|
|
40
|
+
const hiddenOpts = opt;
|
|
41
|
+
setOptions({
|
|
42
|
+
storeIdentifier: getStoreIdentifier(opt.storeIdentifier),
|
|
43
|
+
storefrontAccessToken: opt.storefrontAccessToken,
|
|
44
|
+
environment: hiddenOpts.environment ? hiddenOpts.environment : "prod"
|
|
45
|
+
});
|
|
46
|
+
resetCDNCache();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { api, initRecharge };
|
|
50
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +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 setOptions({\n storeIdentifier: getStoreIdentifier(opt.storeIdentifier),\n storefrontAccessToken: opt.storefrontAccessToken,\n environment: hiddenOpts.environment ? hiddenOpts.environment : 'prod',\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":";;;;AAGY,MAAC,GAAG,GAAG;AACnB,EAAE,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE;AAC3B,IAAI,OAAO,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAC/C,GAAG;AACH,EAAE,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE;AAC5B,IAAI,OAAO,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE;AAC3B,IAAI,OAAO,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAC/C,GAAG;AACH,EAAE,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE;AAC9B,IAAI,OAAO,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAClD,GAAG;AACH,EAAE;AACF,SAAS,kBAAkB,CAAC,eAAe,EAAE;AAC7C,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACb,EAAE,IAAI,eAAe,EAAE;AACvB,IAAI,OAAO,eAAe,CAAC;AAC3B,GAAG;AACH,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE;AAClF,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,MAAM,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;AACvD,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,QAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,wDAAwD,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACpL,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,MAAM,GAAG,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;AAC5C,KAAK;AACL,GAAG;AACH,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC;AAC9D,CAAC;AACM,SAAS,YAAY,CAAC,GAAG,GAAG,EAAE,EAAE;AACvC,EAAE,MAAM,UAAU,GAAG,GAAG,CAAC;AACzB,EAAE,UAAU,CAAC;AACb,IAAI,eAAe,EAAE,kBAAkB,CAAC,GAAG,CAAC,eAAe,CAAC;AAC5D,IAAI,qBAAqB,EAAE,GAAG,CAAC,qBAAqB;AACpD,IAAI,WAAW,EAAE,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,GAAG,MAAM;AACzE,GAAG,CAAC,CAAC;AACL,EAAE,aAAa,EAAE,CAAC;AAClB;;;;"}
|
|
@@ -0,0 +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":"AAAA,IAAI,OAAO,GAAG;AACd,EAAE,eAAe,EAAE,EAAE;AACrB,EAAE,WAAW,EAAE,MAAM;AACrB,CAAC,CAAC;AACK,SAAS,UAAU,CAAC,IAAI,EAAE;AACjC,EAAE,OAAO,GAAG,IAAI,CAAC;AACjB,CAAC;AACM,SAAS,UAAU,GAAG;AAC7B,EAAE,OAAO,OAAO,CAAC;AACjB;;;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import 'isomorphic-fetch';
|
|
2
|
+
import { stringify } from 'qs';
|
|
3
|
+
import { getOptions } from './options.js';
|
|
4
|
+
import { RECHARGE_CDN_URL, SHOPIFY_APP_PROXY_URL, RECHARGE_API_URL } from '../constants/api.js';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
function stringifyQuery(str) {
|
|
23
|
+
return stringify(str, {
|
|
24
|
+
encode: false,
|
|
25
|
+
indices: false,
|
|
26
|
+
arrayFormat: "comma"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async function cdnRequest(method, url, requestOptions = {}) {
|
|
30
|
+
const opts = getOptions();
|
|
31
|
+
return request(method, `${RECHARGE_CDN_URL(opts.environment)}/store/${opts.storeIdentifier}${url}`, requestOptions);
|
|
32
|
+
}
|
|
33
|
+
async function rechargeApiRequest(method, url, { id, query, data, headers } = {}, session) {
|
|
34
|
+
const { environment, storeIdentifier } = getOptions();
|
|
35
|
+
const token = session.apiToken;
|
|
36
|
+
const rechargeBaseUrl = RECHARGE_API_URL(environment);
|
|
37
|
+
const reqHeaders = __spreadValues({
|
|
38
|
+
"X-Recharge-Access-Token": token,
|
|
39
|
+
"X-Recharge-Version": "2021-11"
|
|
40
|
+
}, headers ? headers : {});
|
|
41
|
+
const localQuery = __spreadValues({
|
|
42
|
+
shop_url: storeIdentifier
|
|
43
|
+
}, query);
|
|
44
|
+
return request(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });
|
|
45
|
+
}
|
|
46
|
+
async function shopifyAppProxyRequest(method, url, requestOptions = {}) {
|
|
47
|
+
return request(method, `${SHOPIFY_APP_PROXY_URL}${url}`, requestOptions);
|
|
48
|
+
}
|
|
49
|
+
async function request(method, url, { id, query, data, headers } = {}) {
|
|
50
|
+
let reqUrl = url.trim();
|
|
51
|
+
if (id) {
|
|
52
|
+
reqUrl = [reqUrl, `${id}`.trim()].join("/");
|
|
53
|
+
}
|
|
54
|
+
if (query) {
|
|
55
|
+
let exQuery;
|
|
56
|
+
[reqUrl, exQuery] = reqUrl.split("?");
|
|
57
|
+
const fullQuery = [exQuery, stringifyQuery(query)].join("&").replace(/^&/, "");
|
|
58
|
+
reqUrl = `${reqUrl}${fullQuery ? `?${fullQuery}` : ""}`;
|
|
59
|
+
}
|
|
60
|
+
let reqBody;
|
|
61
|
+
if (data && method !== "get") {
|
|
62
|
+
reqBody = JSON.stringify(data);
|
|
63
|
+
}
|
|
64
|
+
const reqHeaders = __spreadValues({
|
|
65
|
+
Accept: "application/json",
|
|
66
|
+
"Content-Type": "application/json",
|
|
67
|
+
"X-Recharge-App": "storefront-client"
|
|
68
|
+
}, headers ? headers : {});
|
|
69
|
+
const response = await fetch(reqUrl, {
|
|
70
|
+
method,
|
|
71
|
+
headers: reqHeaders,
|
|
72
|
+
body: reqBody,
|
|
73
|
+
mode: "cors"
|
|
74
|
+
});
|
|
75
|
+
let result;
|
|
76
|
+
try {
|
|
77
|
+
result = await response.json();
|
|
78
|
+
} catch (e) {
|
|
79
|
+
}
|
|
80
|
+
if (!response.ok) {
|
|
81
|
+
if (result && result.error) {
|
|
82
|
+
throw new Error(`${response.status}: ${result.error}`);
|
|
83
|
+
} else {
|
|
84
|
+
throw new Error("A connection error occurred while making the request");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { cdnRequest, rechargeApiRequest, request, shopifyAppProxyRequest };
|
|
91
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sources":["../../../src/utils/request.ts"],"sourcesContent":["import 'isomorphic-fetch';\n\nimport { stringify } from 'qs';\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';\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, storeIdentifier } = getOptions();\n const token = session.apiToken;\n const rechargeBaseUrl = RECHARGE_API_URL(environment);\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 return request(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });\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 mode: 'cors',\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 Error(`${response.status}: ${result.error}`);\n } else {\n throw new Error('A connection error occurred while making the request');\n }\n }\n\n return result as T;\n}\n"],"names":[],"mappings":";;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAC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