@rechargeapps/storefront-client 1.11.2 → 1.13.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/paymentMethod.js +31 -0
- package/dist/cjs/api/paymentMethod.js.map +1 -1
- package/dist/cjs/api/store.js +24 -0
- package/dist/cjs/api/store.js.map +1 -0
- package/dist/cjs/index.js +26 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/paymentMethod.js +31 -1
- package/dist/esm/api/paymentMethod.js.map +1 -1
- package/dist/esm/api/store.js +20 -0
- package/dist/esm/api/store.js.map +1 -0
- package/dist/esm/index.js +5 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +90 -32
- package/dist/umd/recharge-client.min.js +9 -9
- package/package.json +1 -1
|
@@ -4,6 +4,25 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var request = require('../utils/request.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));
|
|
7
26
|
async function getPaymentMethod(session, id, options) {
|
|
8
27
|
const { payment_method } = await request.rechargeApiRequest(
|
|
9
28
|
"get",
|
|
@@ -16,6 +35,17 @@ async function getPaymentMethod(session, id, options) {
|
|
|
16
35
|
);
|
|
17
36
|
return payment_method;
|
|
18
37
|
}
|
|
38
|
+
async function createPaymentMethod(session, createRequest) {
|
|
39
|
+
const { payment_method } = await request.rechargeApiRequest(
|
|
40
|
+
"post",
|
|
41
|
+
`/payment_methods`,
|
|
42
|
+
{
|
|
43
|
+
data: __spreadProps(__spreadValues({}, createRequest), { customer_id: session.customerId })
|
|
44
|
+
},
|
|
45
|
+
session
|
|
46
|
+
);
|
|
47
|
+
return payment_method;
|
|
48
|
+
}
|
|
19
49
|
async function updatePaymentMethod(session, id, updateRequest) {
|
|
20
50
|
const { payment_method } = await request.rechargeApiRequest(
|
|
21
51
|
"put",
|
|
@@ -32,6 +62,7 @@ function listPaymentMethods(session, query) {
|
|
|
32
62
|
return request.rechargeApiRequest("get", `/payment_methods`, { query }, session);
|
|
33
63
|
}
|
|
34
64
|
|
|
65
|
+
exports.createPaymentMethod = createPaymentMethod;
|
|
35
66
|
exports.getPaymentMethod = getPaymentMethod;
|
|
36
67
|
exports.listPaymentMethods = listPaymentMethods;
|
|
37
68
|
exports.updatePaymentMethod = updatePaymentMethod;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentMethod.js","sources":["../../../src/api/paymentMethod.ts"],"sourcesContent":["import {\n GetPaymentMethodOptions,\n PaymentMethod,\n PaymentMethodListParams,\n PaymentMethodsResponse,\n UpdatePaymentMethodRequest,\n} from '../types/paymentMethod';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\nexport async function getPaymentMethod(\n session: Session,\n id: string | number,\n options?: GetPaymentMethodOptions\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'get',\n `/payment_methods`,\n {\n id,\n query: { include: options?.include },\n },\n session\n );\n return payment_method;\n}\n\n/**\n * Modify an existing Payment Method\n *\n * Currently, `shopify_payments` is in read-only mode and can only be managed by Shopify.\n */\nexport async function updatePaymentMethod(\n session: Session,\n id: string | number,\n updateRequest: UpdatePaymentMethodRequest\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'put',\n `/payment_methods`,\n {\n id,\n data: updateRequest,\n },\n session\n );\n return payment_method;\n}\n\nexport function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse> {\n return rechargeApiRequest<PaymentMethodsResponse>('get', `/payment_methods`, { query }, session);\n}\n"],"names":["rechargeApiRequest"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"paymentMethod.js","sources":["../../../src/api/paymentMethod.ts"],"sourcesContent":["import {\n CreatePaymentMethodRequest,\n GetPaymentMethodOptions,\n PaymentMethod,\n PaymentMethodListParams,\n PaymentMethodsResponse,\n UpdatePaymentMethodRequest,\n} from '../types/paymentMethod';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\nexport async function getPaymentMethod(\n session: Session,\n id: string | number,\n options?: GetPaymentMethodOptions\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'get',\n `/payment_methods`,\n {\n id,\n query: { include: options?.include },\n },\n session\n );\n return payment_method;\n}\n\n/**\n * Create a Payment Method\n *\n * Currently, `shopify_payments` is in read-only mode and can only be managed by Shopify.\n */\nexport async function createPaymentMethod(\n session: Session,\n createRequest: CreatePaymentMethodRequest\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'post',\n `/payment_methods`,\n {\n data: { ...createRequest, customer_id: session.customerId },\n },\n session\n );\n return payment_method;\n}\n\n/**\n * Modify an existing Payment Method\n *\n * Currently, `shopify_payments` is in read-only mode and can only be managed by Shopify.\n */\nexport async function updatePaymentMethod(\n session: Session,\n id: string | number,\n updateRequest: UpdatePaymentMethodRequest\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'put',\n `/payment_methods`,\n {\n id,\n data: updateRequest,\n },\n session\n );\n return payment_method;\n}\n\nexport function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse> {\n return rechargeApiRequest<PaymentMethodsResponse>('get', `/payment_methods`, { query }, session);\n}\n"],"names":["rechargeApiRequest"],"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,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EAAE,OAAO,cAAc,CAAC;AACxB,CAAC;AACM,eAAe,mBAAmB,CAAC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE;AACtE,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,MAAMA,0BAAkB;AACrD,IAAI,KAAK;AACT,IAAI,CAAC,gBAAgB,CAAC;AACtB,IAAI;AACJ,MAAM,EAAE;AACR,MAAM,IAAI,EAAE,aAAa;AACzB,KAAK;AACL,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,OAAO,cAAc,CAAC;AACxB,CAAC;AACM,SAAS,kBAAkB,CAAC,OAAO,EAAE,KAAK,EAAE;AACnD,EAAE,OAAOA,0BAAkB,CAAC,KAAK,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;AAC3E;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var request = require('../utils/request.js');
|
|
6
|
+
|
|
7
|
+
async function getShippingCountries(session, options) {
|
|
8
|
+
const response = await request.rechargeApiRequest(
|
|
9
|
+
"get",
|
|
10
|
+
`/shop/shipping_countries`,
|
|
11
|
+
{
|
|
12
|
+
query: options,
|
|
13
|
+
headers: {
|
|
14
|
+
// Currently this is only available on the older api version.
|
|
15
|
+
"X-Recharge-Version": "2021-01"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
session
|
|
19
|
+
);
|
|
20
|
+
return response;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.getShippingCountries = getShippingCountries;
|
|
24
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sources":["../../../src/api/store.ts"],"sourcesContent":["import { Session } from '../types/session';\nimport { ShippingCountriesOptions, ShippingCountriesResponse, ShippingCountry } from '../types/store';\nimport { rechargeApiRequest } from '../utils/request';\n\n/**\n * Get a list of all shipping countries for the store.\n */\nexport async function getShippingCountries(\n session: Session,\n options?: ShippingCountriesOptions\n): Promise<ShippingCountriesResponse> {\n const response = await rechargeApiRequest<ShippingCountriesResponse>(\n 'get',\n `/shop/shipping_countries`,\n {\n query: options,\n headers: {\n // Currently this is only available on the older api version.\n 'X-Recharge-Version': '2021-01',\n },\n },\n session\n );\n return response;\n}\n"],"names":["rechargeApiRequest"],"mappings":";;;;;;AACO,eAAe,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE;AAC7D,EAAE,MAAM,QAAQ,GAAG,MAAMA,0BAAkB;AAC3C,IAAI,KAAK;AACT,IAAI,CAAC,wBAAwB,CAAC;AAC9B,IAAI;AACJ,MAAM,KAAK,EAAE,OAAO;AACpB,MAAM,OAAO,EAAE;AACf;AACA,QAAQ,oBAAoB,EAAE,SAAS;AACvC,OAAO;AACP,KAAK;AACL,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC;AAClB;;;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var address = require('./api/address.js');
|
|
6
6
|
var auth = require('./api/auth.js');
|
|
7
|
-
var charge = require('./api/charge.js');
|
|
8
|
-
var cdn = require('./api/cdn.js');
|
|
9
7
|
var bundle = require('./api/bundle.js');
|
|
8
|
+
var cdn = require('./api/cdn.js');
|
|
9
|
+
var charge = require('./api/charge.js');
|
|
10
|
+
var customer = require('./api/customer.js');
|
|
10
11
|
var gift = require('./api/gift.js');
|
|
11
12
|
var membership = require('./api/membership.js');
|
|
12
13
|
var membershipProgram = require('./api/membershipProgram.js');
|
|
@@ -16,8 +17,8 @@ var order = require('./api/order.js');
|
|
|
16
17
|
var paymentMethod = require('./api/paymentMethod.js');
|
|
17
18
|
var plan = require('./api/plan.js');
|
|
18
19
|
var product = require('./api/product.js');
|
|
20
|
+
var store = require('./api/store.js');
|
|
19
21
|
var subscription = require('./api/subscription.js');
|
|
20
|
-
var customer = require('./api/customer.js');
|
|
21
22
|
var init = require('./utils/init.js');
|
|
22
23
|
|
|
23
24
|
|
|
@@ -38,21 +39,6 @@ exports.sendPasswordlessCode = auth.sendPasswordlessCode;
|
|
|
38
39
|
exports.sendPasswordlessCodeAppProxy = auth.sendPasswordlessCodeAppProxy;
|
|
39
40
|
exports.validatePasswordlessCode = auth.validatePasswordlessCode;
|
|
40
41
|
exports.validatePasswordlessCodeAppProxy = auth.validatePasswordlessCodeAppProxy;
|
|
41
|
-
exports.applyDiscountToCharge = charge.applyDiscountToCharge;
|
|
42
|
-
exports.getCharge = charge.getCharge;
|
|
43
|
-
exports.listCharges = charge.listCharges;
|
|
44
|
-
exports.processCharge = charge.processCharge;
|
|
45
|
-
exports.removeDiscountsFromCharge = charge.removeDiscountsFromCharge;
|
|
46
|
-
exports.skipCharge = charge.skipCharge;
|
|
47
|
-
exports.unskipCharge = charge.unskipCharge;
|
|
48
|
-
exports.getCDNBundleSettings = cdn.getCDNBundleSettings;
|
|
49
|
-
exports.getCDNProduct = cdn.getCDNProduct;
|
|
50
|
-
exports.getCDNProductAndSettings = cdn.getCDNProductAndSettings;
|
|
51
|
-
exports.getCDNProducts = cdn.getCDNProducts;
|
|
52
|
-
exports.getCDNProductsAndSettings = cdn.getCDNProductsAndSettings;
|
|
53
|
-
exports.getCDNStoreSettings = cdn.getCDNStoreSettings;
|
|
54
|
-
exports.getCDNWidgetSettings = cdn.getCDNWidgetSettings;
|
|
55
|
-
exports.resetCDNCache = cdn.resetCDNCache;
|
|
56
42
|
exports.createBundleSelection = bundle.createBundleSelection;
|
|
57
43
|
exports.deleteBundleSelection = bundle.deleteBundleSelection;
|
|
58
44
|
exports.getBundleId = bundle.getBundleId;
|
|
@@ -63,6 +49,26 @@ exports.updateBundle = bundle.updateBundle;
|
|
|
63
49
|
exports.updateBundleSelection = bundle.updateBundleSelection;
|
|
64
50
|
exports.validateBundle = bundle.validateBundle;
|
|
65
51
|
exports.validateDynamicBundle = bundle.validateDynamicBundle;
|
|
52
|
+
exports.getCDNBundleSettings = cdn.getCDNBundleSettings;
|
|
53
|
+
exports.getCDNProduct = cdn.getCDNProduct;
|
|
54
|
+
exports.getCDNProductAndSettings = cdn.getCDNProductAndSettings;
|
|
55
|
+
exports.getCDNProducts = cdn.getCDNProducts;
|
|
56
|
+
exports.getCDNProductsAndSettings = cdn.getCDNProductsAndSettings;
|
|
57
|
+
exports.getCDNStoreSettings = cdn.getCDNStoreSettings;
|
|
58
|
+
exports.getCDNWidgetSettings = cdn.getCDNWidgetSettings;
|
|
59
|
+
exports.resetCDNCache = cdn.resetCDNCache;
|
|
60
|
+
exports.applyDiscountToCharge = charge.applyDiscountToCharge;
|
|
61
|
+
exports.getCharge = charge.getCharge;
|
|
62
|
+
exports.listCharges = charge.listCharges;
|
|
63
|
+
exports.processCharge = charge.processCharge;
|
|
64
|
+
exports.removeDiscountsFromCharge = charge.removeDiscountsFromCharge;
|
|
65
|
+
exports.skipCharge = charge.skipCharge;
|
|
66
|
+
exports.unskipCharge = charge.unskipCharge;
|
|
67
|
+
exports.getCustomer = customer.getCustomer;
|
|
68
|
+
exports.getCustomerPortalAccess = customer.getCustomerPortalAccess;
|
|
69
|
+
exports.getDeliverySchedule = customer.getDeliverySchedule;
|
|
70
|
+
exports.sendCustomerNotification = customer.sendCustomerNotification;
|
|
71
|
+
exports.updateCustomer = customer.updateCustomer;
|
|
66
72
|
exports.getGiftPurchase = gift.getGiftPurchase;
|
|
67
73
|
exports.listGiftPurchases = gift.listGiftPurchases;
|
|
68
74
|
exports.activateMembership = membership.activateMembership;
|
|
@@ -82,12 +88,14 @@ exports.listOnetimes = onetime.listOnetimes;
|
|
|
82
88
|
exports.updateOnetime = onetime.updateOnetime;
|
|
83
89
|
exports.getOrder = order.getOrder;
|
|
84
90
|
exports.listOrders = order.listOrders;
|
|
91
|
+
exports.createPaymentMethod = paymentMethod.createPaymentMethod;
|
|
85
92
|
exports.getPaymentMethod = paymentMethod.getPaymentMethod;
|
|
86
93
|
exports.listPaymentMethods = paymentMethod.listPaymentMethods;
|
|
87
94
|
exports.updatePaymentMethod = paymentMethod.updatePaymentMethod;
|
|
88
95
|
exports.getPlan = plan.getPlan;
|
|
89
96
|
exports.listPlans = plan.listPlans;
|
|
90
97
|
exports.productSearch = product.productSearch;
|
|
98
|
+
exports.getShippingCountries = store.getShippingCountries;
|
|
91
99
|
exports.activateSubscription = subscription.activateSubscription;
|
|
92
100
|
exports.cancelSubscription = subscription.cancelSubscription;
|
|
93
101
|
exports.createSubscription = subscription.createSubscription;
|
|
@@ -100,11 +108,6 @@ exports.updateSubscription = subscription.updateSubscription;
|
|
|
100
108
|
exports.updateSubscriptionAddress = subscription.updateSubscriptionAddress;
|
|
101
109
|
exports.updateSubscriptionChargeDate = subscription.updateSubscriptionChargeDate;
|
|
102
110
|
exports.updateSubscriptions = subscription.updateSubscriptions;
|
|
103
|
-
exports.getCustomer = customer.getCustomer;
|
|
104
|
-
exports.getCustomerPortalAccess = customer.getCustomerPortalAccess;
|
|
105
|
-
exports.getDeliverySchedule = customer.getDeliverySchedule;
|
|
106
|
-
exports.sendCustomerNotification = customer.sendCustomerNotification;
|
|
107
|
-
exports.updateCustomer = customer.updateCustomer;
|
|
108
111
|
exports.api = init.api;
|
|
109
112
|
exports.initRecharge = init.initRecharge;
|
|
110
113
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { rechargeApiRequest } from '../utils/request.js';
|
|
2
2
|
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
3
22
|
async function getPaymentMethod(session, id, options) {
|
|
4
23
|
const { payment_method } = await rechargeApiRequest(
|
|
5
24
|
"get",
|
|
@@ -12,6 +31,17 @@ async function getPaymentMethod(session, id, options) {
|
|
|
12
31
|
);
|
|
13
32
|
return payment_method;
|
|
14
33
|
}
|
|
34
|
+
async function createPaymentMethod(session, createRequest) {
|
|
35
|
+
const { payment_method } = await rechargeApiRequest(
|
|
36
|
+
"post",
|
|
37
|
+
`/payment_methods`,
|
|
38
|
+
{
|
|
39
|
+
data: __spreadProps(__spreadValues({}, createRequest), { customer_id: session.customerId })
|
|
40
|
+
},
|
|
41
|
+
session
|
|
42
|
+
);
|
|
43
|
+
return payment_method;
|
|
44
|
+
}
|
|
15
45
|
async function updatePaymentMethod(session, id, updateRequest) {
|
|
16
46
|
const { payment_method } = await rechargeApiRequest(
|
|
17
47
|
"put",
|
|
@@ -28,5 +58,5 @@ function listPaymentMethods(session, query) {
|
|
|
28
58
|
return rechargeApiRequest("get", `/payment_methods`, { query }, session);
|
|
29
59
|
}
|
|
30
60
|
|
|
31
|
-
export { getPaymentMethod, listPaymentMethods, updatePaymentMethod };
|
|
61
|
+
export { createPaymentMethod, getPaymentMethod, listPaymentMethods, updatePaymentMethod };
|
|
32
62
|
//# sourceMappingURL=paymentMethod.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentMethod.js","sources":["../../../src/api/paymentMethod.ts"],"sourcesContent":["import {\n GetPaymentMethodOptions,\n PaymentMethod,\n PaymentMethodListParams,\n PaymentMethodsResponse,\n UpdatePaymentMethodRequest,\n} from '../types/paymentMethod';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\nexport async function getPaymentMethod(\n session: Session,\n id: string | number,\n options?: GetPaymentMethodOptions\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'get',\n `/payment_methods`,\n {\n id,\n query: { include: options?.include },\n },\n session\n );\n return payment_method;\n}\n\n/**\n * Modify an existing Payment Method\n *\n * Currently, `shopify_payments` is in read-only mode and can only be managed by Shopify.\n */\nexport async function updatePaymentMethod(\n session: Session,\n id: string | number,\n updateRequest: UpdatePaymentMethodRequest\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'put',\n `/payment_methods`,\n {\n id,\n data: updateRequest,\n },\n session\n );\n return payment_method;\n}\n\nexport function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse> {\n return rechargeApiRequest<PaymentMethodsResponse>('get', `/payment_methods`, { query }, session);\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"paymentMethod.js","sources":["../../../src/api/paymentMethod.ts"],"sourcesContent":["import {\n CreatePaymentMethodRequest,\n GetPaymentMethodOptions,\n PaymentMethod,\n PaymentMethodListParams,\n PaymentMethodsResponse,\n UpdatePaymentMethodRequest,\n} from '../types/paymentMethod';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\nexport async function getPaymentMethod(\n session: Session,\n id: string | number,\n options?: GetPaymentMethodOptions\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'get',\n `/payment_methods`,\n {\n id,\n query: { include: options?.include },\n },\n session\n );\n return payment_method;\n}\n\n/**\n * Create a Payment Method\n *\n * Currently, `shopify_payments` is in read-only mode and can only be managed by Shopify.\n */\nexport async function createPaymentMethod(\n session: Session,\n createRequest: CreatePaymentMethodRequest\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'post',\n `/payment_methods`,\n {\n data: { ...createRequest, customer_id: session.customerId },\n },\n session\n );\n return payment_method;\n}\n\n/**\n * Modify an existing Payment Method\n *\n * Currently, `shopify_payments` is in read-only mode and can only be managed by Shopify.\n */\nexport async function updatePaymentMethod(\n session: Session,\n id: string | number,\n updateRequest: UpdatePaymentMethodRequest\n): Promise<PaymentMethod> {\n const { payment_method } = await rechargeApiRequest<{ payment_method: PaymentMethod }>(\n 'put',\n `/payment_methods`,\n {\n id,\n data: updateRequest,\n },\n session\n );\n return payment_method;\n}\n\nexport function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse> {\n return rechargeApiRequest<PaymentMethodsResponse>('get', `/payment_methods`, { query }, session);\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,mBAAm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|
|
2
|
+
|
|
3
|
+
async function getShippingCountries(session, options) {
|
|
4
|
+
const response = await rechargeApiRequest(
|
|
5
|
+
"get",
|
|
6
|
+
`/shop/shipping_countries`,
|
|
7
|
+
{
|
|
8
|
+
query: options,
|
|
9
|
+
headers: {
|
|
10
|
+
// Currently this is only available on the older api version.
|
|
11
|
+
"X-Recharge-Version": "2021-01"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
session
|
|
15
|
+
);
|
|
16
|
+
return response;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { getShippingCountries };
|
|
20
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sources":["../../../src/api/store.ts"],"sourcesContent":["import { Session } from '../types/session';\nimport { ShippingCountriesOptions, ShippingCountriesResponse, ShippingCountry } from '../types/store';\nimport { rechargeApiRequest } from '../utils/request';\n\n/**\n * Get a list of all shipping countries for the store.\n */\nexport async function getShippingCountries(\n session: Session,\n options?: ShippingCountriesOptions\n): Promise<ShippingCountriesResponse> {\n const response = await rechargeApiRequest<ShippingCountriesResponse>(\n 'get',\n `/shop/shipping_countries`,\n {\n query: options,\n headers: {\n // Currently this is only available on the older api version.\n 'X-Recharge-Version': '2021-01',\n },\n },\n session\n );\n return response;\n}\n"],"names":[],"mappings":";;AACO,eAAe,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE;AAC7D,EAAE,MAAM,QAAQ,GAAG,MAAM,kBAAkB;AAC3C,IAAI,KAAK;AACT,IAAI,CAAC,wBAAwB,CAAC;AAC9B,IAAI;AACJ,MAAM,KAAK,EAAE,OAAO;AACpB,MAAM,OAAO,EAAE;AACf;AACA,QAAQ,oBAAoB,EAAE,SAAS;AACvC,OAAO;AACP,KAAK;AACL,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC;AAClB;;;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export { applyDiscountToAddress, createAddress, deleteAddress, getAddress, listAddresses, mergeAddresses, removeDiscountsFromAddress, skipFutureCharge, updateAddress } from './api/address.js';
|
|
2
2
|
export { loginCustomerPortal, loginShopifyApi, loginShopifyAppProxy, sendPasswordlessCode, sendPasswordlessCodeAppProxy, validatePasswordlessCode, validatePasswordlessCodeAppProxy } from './api/auth.js';
|
|
3
|
-
export { applyDiscountToCharge, getCharge, listCharges, processCharge, removeDiscountsFromCharge, skipCharge, unskipCharge } from './api/charge.js';
|
|
4
|
-
export { getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, resetCDNCache } from './api/cdn.js';
|
|
5
3
|
export { createBundleSelection, deleteBundleSelection, getBundleId, getBundleSelection, getDynamicBundleItems, listBundleSelections, updateBundle, updateBundleSelection, validateBundle, validateDynamicBundle } from './api/bundle.js';
|
|
4
|
+
export { getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, resetCDNCache } from './api/cdn.js';
|
|
5
|
+
export { applyDiscountToCharge, getCharge, listCharges, processCharge, removeDiscountsFromCharge, skipCharge, unskipCharge } from './api/charge.js';
|
|
6
|
+
export { getCustomer, getCustomerPortalAccess, getDeliverySchedule, sendCustomerNotification, updateCustomer } from './api/customer.js';
|
|
6
7
|
export { getGiftPurchase, listGiftPurchases } from './api/gift.js';
|
|
7
8
|
export { activateMembership, cancelMembership, changeMembership, getMembership, listMemberships } from './api/membership.js';
|
|
8
9
|
export { getMembershipProgram, listMembershipPrograms } from './api/membershipProgram.js';
|
|
9
10
|
export { createMetafield, deleteMetafield, updateMetafield } from './api/metafield.js';
|
|
10
11
|
export { createOnetime, deleteOnetime, getOnetime, listOnetimes, updateOnetime } from './api/onetime.js';
|
|
11
12
|
export { getOrder, listOrders } from './api/order.js';
|
|
12
|
-
export { getPaymentMethod, listPaymentMethods, updatePaymentMethod } from './api/paymentMethod.js';
|
|
13
|
+
export { createPaymentMethod, getPaymentMethod, listPaymentMethods, updatePaymentMethod } from './api/paymentMethod.js';
|
|
13
14
|
export { getPlan, listPlans } from './api/plan.js';
|
|
14
15
|
export { productSearch } from './api/product.js';
|
|
16
|
+
export { getShippingCountries } from './api/store.js';
|
|
15
17
|
export { activateSubscription, cancelSubscription, createSubscription, createSubscriptions, getSubscription, listSubscriptions, skipGiftSubscriptionCharge, skipSubscriptionCharge, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, updateSubscriptions } from './api/subscription.js';
|
|
16
|
-
export { getCustomer, getCustomerPortalAccess, getDeliverySchedule, sendCustomerNotification, updateCustomer } from './api/customer.js';
|
|
17
18
|
export { api, initRecharge } from './utils/init.js';
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -310,6 +310,14 @@ interface PaymentMethodsResponse {
|
|
|
310
310
|
previous_cursor: null | string;
|
|
311
311
|
payment_methods: PaymentMethod[];
|
|
312
312
|
}
|
|
313
|
+
type PaymentMethodRequiredCreateProps = 'payment_type' | 'processor_customer_token' | 'processor_name' | 'processor_payment_method_token';
|
|
314
|
+
type PaymentMethodOptionalCreateProps = 'default' | 'billing_address';
|
|
315
|
+
interface CreatePaymentMethodRequest extends SubType<PaymentMethod, PaymentMethodRequiredCreateProps, PaymentMethodOptionalCreateProps> {
|
|
316
|
+
/** Array of address ids the new payment methods should be associated to */
|
|
317
|
+
address_ids?: number[];
|
|
318
|
+
/** like “mandate_1O7lt8FHTwP5c651R…” */
|
|
319
|
+
external_mandate_id?: string;
|
|
320
|
+
}
|
|
313
321
|
interface UpdatePaymentMethodRequest extends Partial<Pick<PaymentMethod, 'billing_address' | 'default'>> {
|
|
314
322
|
}
|
|
315
323
|
type PaymentMethodIncludes = 'addresses';
|
|
@@ -2362,6 +2370,71 @@ interface InitOptions {
|
|
|
2362
2370
|
loginRetryFn?: () => Promise<Session | undefined>;
|
|
2363
2371
|
}
|
|
2364
2372
|
|
|
2373
|
+
interface ShippingCountriesResponse {
|
|
2374
|
+
shipping_countries: ShippingCountry[];
|
|
2375
|
+
}
|
|
2376
|
+
interface ShippingCountriesOptions {
|
|
2377
|
+
/**
|
|
2378
|
+
* Show all available countries.
|
|
2379
|
+
* When this is `false` or `undefined` only the configured shipping countries will be returned.
|
|
2380
|
+
*/
|
|
2381
|
+
display_all?: boolean;
|
|
2382
|
+
/**
|
|
2383
|
+
* Limit the number of records returned.
|
|
2384
|
+
* @default 250
|
|
2385
|
+
*/
|
|
2386
|
+
limit?: number;
|
|
2387
|
+
}
|
|
2388
|
+
interface ShippingProvince {
|
|
2389
|
+
/** The province code. e.g. California is `CA` */
|
|
2390
|
+
code: string;
|
|
2391
|
+
/** Id for the shipping province record */
|
|
2392
|
+
id: number;
|
|
2393
|
+
/** The name of the province. e.g. `California` */
|
|
2394
|
+
name: string;
|
|
2395
|
+
}
|
|
2396
|
+
interface ShippingCountry {
|
|
2397
|
+
/** The country code. e.g. United States is `US` */
|
|
2398
|
+
code: string;
|
|
2399
|
+
/** The country id */
|
|
2400
|
+
country_id: number;
|
|
2401
|
+
/** Id for the country record */
|
|
2402
|
+
id: number;
|
|
2403
|
+
/** The full name of the country. e.g. `United States` */
|
|
2404
|
+
name: string;
|
|
2405
|
+
/**
|
|
2406
|
+
* List of provinces for the country.
|
|
2407
|
+
* Some countries have no defined provinces. This array will be empty in that case.
|
|
2408
|
+
*/
|
|
2409
|
+
provinces: ShippingProvince[];
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
declare function getBundleId(bundle: BundleAppProxy): Promise<string>;
|
|
2413
|
+
declare function getDynamicBundleItems(bundle: BundleAppProxy, shopifyProductHandle: string): DynamicBundleItemAppProxy[];
|
|
2414
|
+
declare function validateBundle(bundle: BundleAppProxy): Promise<true | string>;
|
|
2415
|
+
/**
|
|
2416
|
+
* Validates a dynamic bundle
|
|
2417
|
+
*
|
|
2418
|
+
* @param bundle Dynamic Bundle being validated
|
|
2419
|
+
* @returns true or error message
|
|
2420
|
+
*/
|
|
2421
|
+
declare function validateDynamicBundle(bundle: BundleAppProxy): true | string;
|
|
2422
|
+
declare function getBundleSelection(session: Session, id: string | number): Promise<BundleSelection>;
|
|
2423
|
+
declare function listBundleSelections(session: Session, query?: BundleSelectionListParams): Promise<BundleSelectionsResponse>;
|
|
2424
|
+
declare function createBundleSelection(session: Session, createRequest: CreateBundleSelectionRequest): Promise<BundleSelection>;
|
|
2425
|
+
declare function updateBundleSelection(session: Session, id: string | number, updateRequest: UpdateBundleSelectionRequest): Promise<BundleSelection>;
|
|
2426
|
+
declare function deleteBundleSelection(session: Session, id: string | number): Promise<void>;
|
|
2427
|
+
declare function updateBundle(session: Session, purchase_item_id: string | number, updateRequest: UpdateBundlePurchaseItem, query?: BundlePurchaseItemParams): Promise<BundlePurchaseItem>;
|
|
2428
|
+
|
|
2429
|
+
declare function getCDNProduct<T extends CDNProductQuery_2020_12 | CDNProductQuery_2022_06 = CDNProductQuery_2020_12>(externalProductId: string | number, query?: T): Promise<CDNProductType<T>>;
|
|
2430
|
+
declare function getCDNStoreSettings(): Promise<CDNStoreSettings>;
|
|
2431
|
+
declare function getCDNWidgetSettings(): Promise<CDNWidgetSettings>;
|
|
2432
|
+
declare function getCDNProductsAndSettings(): Promise<CDNProductsAndSettings>;
|
|
2433
|
+
declare function getCDNProducts(): Promise<CDNProductKeyObject[]>;
|
|
2434
|
+
declare function getCDNProductAndSettings(externalProductId: string | number): Promise<CDNProductAndSettings>;
|
|
2435
|
+
declare function getCDNBundleSettings(externalProductId: string | number): Promise<CDNBundleSettings | null | undefined>;
|
|
2436
|
+
declare function resetCDNCache(): Promise<void>;
|
|
2437
|
+
|
|
2365
2438
|
declare function getCharge(session: Session, id: number | string, options?: GetChargeOptions): Promise<Charge>;
|
|
2366
2439
|
/** Lists charges */
|
|
2367
2440
|
declare function listCharges(session: Session, query?: ChargeListParams): Promise<ChargeListResponse>;
|
|
@@ -2382,31 +2455,11 @@ declare function skipCharge(session: Session, id: number | string, purchaseItemI
|
|
|
2382
2455
|
declare function unskipCharge(session: Session, id: number | string, purchaseItemIds: (string | number)[]): Promise<Charge>;
|
|
2383
2456
|
declare function processCharge(session: Session, id: number | string): Promise<Charge>;
|
|
2384
2457
|
|
|
2385
|
-
declare function
|
|
2386
|
-
declare function
|
|
2387
|
-
declare function
|
|
2388
|
-
declare function
|
|
2389
|
-
declare function
|
|
2390
|
-
declare function getCDNProductAndSettings(externalProductId: string | number): Promise<CDNProductAndSettings>;
|
|
2391
|
-
declare function getCDNBundleSettings(externalProductId: string | number): Promise<CDNBundleSettings | null | undefined>;
|
|
2392
|
-
declare function resetCDNCache(): Promise<void>;
|
|
2393
|
-
|
|
2394
|
-
declare function getBundleId(bundle: BundleAppProxy): Promise<string>;
|
|
2395
|
-
declare function getDynamicBundleItems(bundle: BundleAppProxy, shopifyProductHandle: string): DynamicBundleItemAppProxy[];
|
|
2396
|
-
declare function validateBundle(bundle: BundleAppProxy): Promise<true | string>;
|
|
2397
|
-
/**
|
|
2398
|
-
* Validates a dynamic bundle
|
|
2399
|
-
*
|
|
2400
|
-
* @param bundle Dynamic Bundle being validated
|
|
2401
|
-
* @returns true or error message
|
|
2402
|
-
*/
|
|
2403
|
-
declare function validateDynamicBundle(bundle: BundleAppProxy): true | string;
|
|
2404
|
-
declare function getBundleSelection(session: Session, id: string | number): Promise<BundleSelection>;
|
|
2405
|
-
declare function listBundleSelections(session: Session, query?: BundleSelectionListParams): Promise<BundleSelectionsResponse>;
|
|
2406
|
-
declare function createBundleSelection(session: Session, createRequest: CreateBundleSelectionRequest): Promise<BundleSelection>;
|
|
2407
|
-
declare function updateBundleSelection(session: Session, id: string | number, updateRequest: UpdateBundleSelectionRequest): Promise<BundleSelection>;
|
|
2408
|
-
declare function deleteBundleSelection(session: Session, id: string | number): Promise<void>;
|
|
2409
|
-
declare function updateBundle(session: Session, purchase_item_id: string | number, updateRequest: UpdateBundlePurchaseItem, query?: BundlePurchaseItemParams): Promise<BundlePurchaseItem>;
|
|
2458
|
+
declare function getCustomer(session: Session, options?: GetCustomerOptions): Promise<Customer>;
|
|
2459
|
+
declare function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer>;
|
|
2460
|
+
declare function getDeliverySchedule(session: Session, query?: CustomerDeliveryScheduleParams): Promise<Delivery[]>;
|
|
2461
|
+
declare function getCustomerPortalAccess(session: Session): Promise<CustomerPortalAccessResponse>;
|
|
2462
|
+
declare function sendCustomerNotification<T extends CustomerNotification>(session: Session, notification: CustomerNotification, options?: CustomerNotificationOptions<T>): Promise<void>;
|
|
2410
2463
|
|
|
2411
2464
|
declare function listGiftPurchases(session: Session, options?: GiftPurchasesParams): Promise<GiftPurchasesResponse>;
|
|
2412
2465
|
declare function getGiftPurchase(session: Session, id: number): Promise<GiftPurchase>;
|
|
@@ -2441,6 +2494,12 @@ declare function getOrder(session: Session, id: string | number): Promise<Order>
|
|
|
2441
2494
|
declare function listOrders(session: Session, query?: OrderListParams): Promise<OrdersResponse>;
|
|
2442
2495
|
|
|
2443
2496
|
declare function getPaymentMethod(session: Session, id: string | number, options?: GetPaymentMethodOptions): Promise<PaymentMethod>;
|
|
2497
|
+
/**
|
|
2498
|
+
* Create a Payment Method
|
|
2499
|
+
*
|
|
2500
|
+
* Currently, `shopify_payments` is in read-only mode and can only be managed by Shopify.
|
|
2501
|
+
*/
|
|
2502
|
+
declare function createPaymentMethod(session: Session, createRequest: CreatePaymentMethodRequest): Promise<PaymentMethod>;
|
|
2444
2503
|
/**
|
|
2445
2504
|
* Modify an existing Payment Method
|
|
2446
2505
|
*
|
|
@@ -2455,6 +2514,11 @@ declare function listPlans(session: Session, query?: PlanListParams): Promise<Pl
|
|
|
2455
2514
|
type ProductSearchType<T extends ProductSearchParams_2020_12 | ProductSearchParams_2022_06> = T extends ProductSearchParams_2020_12 ? ProductSearchResponse_2020_12 : ProductSearchResponse_2022_06;
|
|
2456
2515
|
declare function productSearch<T extends ProductSearchParams_2020_12 | ProductSearchParams_2022_06>(session: Session, query: T): Promise<ProductSearchType<T>>;
|
|
2457
2516
|
|
|
2517
|
+
/**
|
|
2518
|
+
* Get a list of all shipping countries for the store.
|
|
2519
|
+
*/
|
|
2520
|
+
declare function getShippingCountries(session: Session, options?: ShippingCountriesOptions): Promise<ShippingCountriesResponse>;
|
|
2521
|
+
|
|
2458
2522
|
declare function getSubscription(session: Session, id: string | number, options?: GetSubscriptionOptions): Promise<Subscription>;
|
|
2459
2523
|
declare function listSubscriptions(session: Session, query?: SubscriptionListParams): Promise<SubscriptionsResponse>;
|
|
2460
2524
|
/**
|
|
@@ -2508,12 +2572,6 @@ declare function createSubscriptions(session: Session, createRequestBulk: Create
|
|
|
2508
2572
|
*/
|
|
2509
2573
|
declare function updateSubscriptions(session: Session, addressId: string | number, updateRequestBulk: UpdateSubscriptionsRequest[], query?: UpdateSubscriptionsParams): Promise<Subscription[]>;
|
|
2510
2574
|
|
|
2511
|
-
declare function getCustomer(session: Session, options?: GetCustomerOptions): Promise<Customer>;
|
|
2512
|
-
declare function updateCustomer(session: Session, updateRequest: UpdateCustomerRequest): Promise<Customer>;
|
|
2513
|
-
declare function getDeliverySchedule(session: Session, query?: CustomerDeliveryScheduleParams): Promise<Delivery[]>;
|
|
2514
|
-
declare function getCustomerPortalAccess(session: Session): Promise<CustomerPortalAccessResponse>;
|
|
2515
|
-
declare function sendCustomerNotification<T extends CustomerNotification>(session: Session, notification: CustomerNotification, options?: CustomerNotificationOptions<T>): Promise<void>;
|
|
2516
|
-
|
|
2517
2575
|
declare const api: {
|
|
2518
2576
|
get<T>(url: string, requestOptions?: GetRequestOptions): Promise<T>;
|
|
2519
2577
|
post<T_1>(url: string, requestOptions?: CRUDRequestOptions): Promise<T_1>;
|
|
@@ -2522,4 +2580,4 @@ declare const api: {
|
|
|
2522
2580
|
};
|
|
2523
2581
|
declare function initRecharge(opt?: InitOptions): void;
|
|
2524
2582
|
|
|
2525
|
-
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, CreateRecipientAddress, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerNotification, CustomerNotificationOptions, CustomerNotificationTemplate, CustomerNotificationType, CustomerPortalAccessResponse, Delivery, DeliveryLineItem, DeliveryOrder, DeliveryPaymentMethod, Discount, DiscountType, DynamicBundleItemAppProxy, DynamicBundlePropertiesAppProxy, ExternalAttributeSchema, ExternalId, ExternalTransactionId, FirstOption, GetAddressOptions, GetChargeOptions, 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, 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, ShippingLine, 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, createSubscription, createSubscriptions, deleteAddress, deleteBundleSelection, deleteMetafield, deleteOnetime, getAddress, getBundleId, getBundleSelection, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getCustomerPortalAccess, getDeliverySchedule, getDynamicBundleItems, getGiftPurchase, getMembership, getMembershipProgram, getOnetime, getOrder, getPaymentMethod, getPlan, 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 };
|
|
2583
|
+
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, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerNotification, CustomerNotificationOptions, CustomerNotificationTemplate, CustomerNotificationType, CustomerPortalAccessResponse, Delivery, DeliveryLineItem, DeliveryOrder, DeliveryPaymentMethod, Discount, DiscountType, DynamicBundleItemAppProxy, DynamicBundlePropertiesAppProxy, ExternalAttributeSchema, ExternalId, ExternalTransactionId, FirstOption, GetAddressOptions, GetChargeOptions, 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, getAddress, getBundleId, getBundleSelection, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, 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 };
|