@commercelayer/sdk 5.0.0-beta.4 → 5.0.0-beta.6
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/lib/cjs/client.js +8 -3
- package/lib/cjs/commercelayer.d.ts +2 -2
- package/lib/cjs/commercelayer.js +1 -1
- package/lib/cjs/error.js +1 -1
- package/lib/cjs/jsonapi.js +5 -1
- package/lib/cjs/resource.js +7 -7
- package/lib/cjs/resources/addresses.js +2 -3
- package/lib/cjs/resources/adjustments.js +2 -3
- package/lib/cjs/resources/adyen_gateways.js +2 -3
- package/lib/cjs/resources/adyen_payments.js +2 -3
- package/lib/cjs/resources/application.js +0 -1
- package/lib/cjs/resources/attachments.js +2 -3
- package/lib/cjs/resources/authorizations.js +1 -2
- package/lib/cjs/resources/avalara_accounts.js +2 -3
- package/lib/cjs/resources/axerve_gateways.js +2 -3
- package/lib/cjs/resources/axerve_payments.js +2 -3
- package/lib/cjs/resources/billing_info_validation_rules.js +2 -3
- package/lib/cjs/resources/bing_geocoders.js +2 -3
- package/lib/cjs/resources/braintree_gateways.js +2 -3
- package/lib/cjs/resources/braintree_payments.js +2 -3
- package/lib/cjs/resources/bundles.js +2 -3
- package/lib/cjs/resources/captures.js +1 -2
- package/lib/cjs/resources/carrier_accounts.js +0 -1
- package/lib/cjs/resources/checkout_com_gateways.js +2 -3
- package/lib/cjs/resources/checkout_com_payments.js +2 -3
- package/lib/cjs/resources/cleanups.js +1 -2
- package/lib/cjs/resources/coupon_codes_promotion_rules.js +2 -3
- package/lib/cjs/resources/coupon_recipients.js +2 -3
- package/lib/cjs/resources/coupons.js +2 -3
- package/lib/cjs/resources/customer_addresses.js +2 -3
- package/lib/cjs/resources/customer_groups.js +2 -3
- package/lib/cjs/resources/customer_password_resets.js +2 -3
- package/lib/cjs/resources/customer_payment_sources.js +2 -3
- package/lib/cjs/resources/customer_subscriptions.js +2 -3
- package/lib/cjs/resources/customers.js +2 -3
- package/lib/cjs/resources/delivery_lead_times.js +2 -3
- package/lib/cjs/resources/event_callbacks.js +0 -1
- package/lib/cjs/resources/events.js +0 -1
- package/lib/cjs/resources/exports.js +1 -2
- package/lib/cjs/resources/external_gateways.js +2 -3
- package/lib/cjs/resources/external_payments.js +2 -3
- package/lib/cjs/resources/external_promotions.js +2 -3
- package/lib/cjs/resources/external_tax_calculators.js +2 -3
- package/lib/cjs/resources/fixed_amount_promotions.js +2 -3
- package/lib/cjs/resources/fixed_price_promotions.js +2 -3
- package/lib/cjs/resources/free_gift_promotions.js +2 -3
- package/lib/cjs/resources/free_shipping_promotions.js +2 -3
- package/lib/cjs/resources/geocoders.js +0 -1
- package/lib/cjs/resources/gift_card_recipients.js +2 -3
- package/lib/cjs/resources/gift_cards.js +2 -3
- package/lib/cjs/resources/google_geocoders.js +2 -3
- package/lib/cjs/resources/imports.js +1 -2
- package/lib/cjs/resources/in_stock_subscriptions.js +2 -3
- package/lib/cjs/resources/inventory_models.js +2 -3
- package/lib/cjs/resources/inventory_return_locations.js +2 -3
- package/lib/cjs/resources/inventory_stock_locations.js +2 -3
- package/lib/cjs/resources/klarna_gateways.js +2 -3
- package/lib/cjs/resources/klarna_payments.js +2 -3
- package/lib/cjs/resources/line_item_options.js +2 -3
- package/lib/cjs/resources/line_items.d.ts +2 -2
- package/lib/cjs/resources/line_items.js +2 -3
- package/lib/cjs/resources/manual_gateways.js +2 -3
- package/lib/cjs/resources/manual_tax_calculators.js +2 -3
- package/lib/cjs/resources/markets.js +2 -3
- package/lib/cjs/resources/merchants.js +2 -3
- package/lib/cjs/resources/order_amount_promotion_rules.js +2 -3
- package/lib/cjs/resources/order_copies.js +1 -2
- package/lib/cjs/resources/order_subscriptions.js +2 -3
- package/lib/cjs/resources/order_validation_rules.js +0 -1
- package/lib/cjs/resources/orders.d.ts +2 -2
- package/lib/cjs/resources/orders.js +2 -3
- package/lib/cjs/resources/organization.js +0 -1
- package/lib/cjs/resources/packages.js +2 -3
- package/lib/cjs/resources/parcel_line_items.js +2 -3
- package/lib/cjs/resources/parcels.js +2 -3
- package/lib/cjs/resources/payment_gateways.js +0 -1
- package/lib/cjs/resources/payment_methods.js +2 -3
- package/lib/cjs/resources/paypal_gateways.js +2 -3
- package/lib/cjs/resources/paypal_payments.js +2 -3
- package/lib/cjs/resources/percentage_discount_promotions.js +2 -3
- package/lib/cjs/resources/price_lists.js +2 -3
- package/lib/cjs/resources/price_tiers.js +0 -1
- package/lib/cjs/resources/price_volume_tiers.js +2 -3
- package/lib/cjs/resources/prices.js +2 -3
- package/lib/cjs/resources/promotion_rules.js +0 -1
- package/lib/cjs/resources/promotions.js +0 -1
- package/lib/cjs/resources/refunds.js +0 -1
- package/lib/cjs/resources/return_line_items.js +2 -3
- package/lib/cjs/resources/returns.js +2 -3
- package/lib/cjs/resources/satispay_gateways.js +2 -3
- package/lib/cjs/resources/satispay_payments.js +2 -3
- package/lib/cjs/resources/shipments.js +1 -2
- package/lib/cjs/resources/shipping_categories.js +2 -3
- package/lib/cjs/resources/shipping_method_tiers.js +0 -1
- package/lib/cjs/resources/shipping_methods.js +2 -3
- package/lib/cjs/resources/shipping_weight_tiers.js +2 -3
- package/lib/cjs/resources/shipping_zones.js +2 -3
- package/lib/cjs/resources/sku_list_items.js +2 -3
- package/lib/cjs/resources/sku_list_promotion_rules.js +2 -3
- package/lib/cjs/resources/sku_lists.js +2 -3
- package/lib/cjs/resources/sku_options.js +2 -3
- package/lib/cjs/resources/skus.js +2 -3
- package/lib/cjs/resources/stock_items.js +2 -3
- package/lib/cjs/resources/stock_line_items.js +0 -1
- package/lib/cjs/resources/stock_locations.js +2 -3
- package/lib/cjs/resources/stock_transfers.js +2 -3
- package/lib/cjs/resources/stripe_gateways.js +2 -3
- package/lib/cjs/resources/stripe_payments.js +2 -3
- package/lib/cjs/resources/tax_calculators.js +0 -1
- package/lib/cjs/resources/tax_categories.js +2 -3
- package/lib/cjs/resources/tax_rules.js +2 -3
- package/lib/cjs/resources/taxjar_accounts.js +2 -3
- package/lib/cjs/resources/transactions.js +0 -1
- package/lib/cjs/resources/voids.js +0 -1
- package/lib/cjs/resources/webhooks.js +2 -3
- package/lib/cjs/resources/wire_transfers.js +2 -3
- package/lib/esm/client.js +8 -3
- package/lib/esm/commercelayer.d.ts +2 -2
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/error.js +1 -1
- package/lib/esm/jsonapi.js +5 -1
- package/lib/esm/resource.js +7 -7
- package/lib/esm/resources/addresses.js +2 -3
- package/lib/esm/resources/adjustments.js +2 -3
- package/lib/esm/resources/adyen_gateways.js +2 -3
- package/lib/esm/resources/adyen_payments.js +2 -3
- package/lib/esm/resources/application.js +0 -1
- package/lib/esm/resources/attachments.js +2 -3
- package/lib/esm/resources/authorizations.js +1 -2
- package/lib/esm/resources/avalara_accounts.js +2 -3
- package/lib/esm/resources/axerve_gateways.js +2 -3
- package/lib/esm/resources/axerve_payments.js +2 -3
- package/lib/esm/resources/billing_info_validation_rules.js +2 -3
- package/lib/esm/resources/bing_geocoders.js +2 -3
- package/lib/esm/resources/braintree_gateways.js +2 -3
- package/lib/esm/resources/braintree_payments.js +2 -3
- package/lib/esm/resources/bundles.js +2 -3
- package/lib/esm/resources/captures.js +1 -2
- package/lib/esm/resources/carrier_accounts.js +0 -1
- package/lib/esm/resources/checkout_com_gateways.js +2 -3
- package/lib/esm/resources/checkout_com_payments.js +2 -3
- package/lib/esm/resources/cleanups.js +1 -2
- package/lib/esm/resources/coupon_codes_promotion_rules.js +2 -3
- package/lib/esm/resources/coupon_recipients.js +2 -3
- package/lib/esm/resources/coupons.js +2 -3
- package/lib/esm/resources/customer_addresses.js +2 -3
- package/lib/esm/resources/customer_groups.js +2 -3
- package/lib/esm/resources/customer_password_resets.js +2 -3
- package/lib/esm/resources/customer_payment_sources.js +2 -3
- package/lib/esm/resources/customer_subscriptions.js +2 -3
- package/lib/esm/resources/customers.js +2 -3
- package/lib/esm/resources/delivery_lead_times.js +2 -3
- package/lib/esm/resources/event_callbacks.js +0 -1
- package/lib/esm/resources/events.js +0 -1
- package/lib/esm/resources/exports.js +1 -2
- package/lib/esm/resources/external_gateways.js +2 -3
- package/lib/esm/resources/external_payments.js +2 -3
- package/lib/esm/resources/external_promotions.js +2 -3
- package/lib/esm/resources/external_tax_calculators.js +2 -3
- package/lib/esm/resources/fixed_amount_promotions.js +2 -3
- package/lib/esm/resources/fixed_price_promotions.js +2 -3
- package/lib/esm/resources/free_gift_promotions.js +2 -3
- package/lib/esm/resources/free_shipping_promotions.js +2 -3
- package/lib/esm/resources/geocoders.js +0 -1
- package/lib/esm/resources/gift_card_recipients.js +2 -3
- package/lib/esm/resources/gift_cards.js +2 -3
- package/lib/esm/resources/google_geocoders.js +2 -3
- package/lib/esm/resources/imports.js +1 -2
- package/lib/esm/resources/in_stock_subscriptions.js +2 -3
- package/lib/esm/resources/inventory_models.js +2 -3
- package/lib/esm/resources/inventory_return_locations.js +2 -3
- package/lib/esm/resources/inventory_stock_locations.js +2 -3
- package/lib/esm/resources/klarna_gateways.js +2 -3
- package/lib/esm/resources/klarna_payments.js +2 -3
- package/lib/esm/resources/line_item_options.js +2 -3
- package/lib/esm/resources/line_items.d.ts +2 -2
- package/lib/esm/resources/line_items.js +2 -3
- package/lib/esm/resources/manual_gateways.js +2 -3
- package/lib/esm/resources/manual_tax_calculators.js +2 -3
- package/lib/esm/resources/markets.js +2 -3
- package/lib/esm/resources/merchants.js +2 -3
- package/lib/esm/resources/order_amount_promotion_rules.js +2 -3
- package/lib/esm/resources/order_copies.js +1 -2
- package/lib/esm/resources/order_subscriptions.js +2 -3
- package/lib/esm/resources/order_validation_rules.js +0 -1
- package/lib/esm/resources/orders.d.ts +2 -2
- package/lib/esm/resources/orders.js +2 -3
- package/lib/esm/resources/organization.js +0 -1
- package/lib/esm/resources/packages.js +2 -3
- package/lib/esm/resources/parcel_line_items.js +2 -3
- package/lib/esm/resources/parcels.js +2 -3
- package/lib/esm/resources/payment_gateways.js +0 -1
- package/lib/esm/resources/payment_methods.js +2 -3
- package/lib/esm/resources/paypal_gateways.js +2 -3
- package/lib/esm/resources/paypal_payments.js +2 -3
- package/lib/esm/resources/percentage_discount_promotions.js +2 -3
- package/lib/esm/resources/price_lists.js +2 -3
- package/lib/esm/resources/price_tiers.js +0 -1
- package/lib/esm/resources/price_volume_tiers.js +2 -3
- package/lib/esm/resources/prices.js +2 -3
- package/lib/esm/resources/promotion_rules.js +0 -1
- package/lib/esm/resources/promotions.js +0 -1
- package/lib/esm/resources/refunds.js +0 -1
- package/lib/esm/resources/return_line_items.js +2 -3
- package/lib/esm/resources/returns.js +2 -3
- package/lib/esm/resources/satispay_gateways.js +2 -3
- package/lib/esm/resources/satispay_payments.js +2 -3
- package/lib/esm/resources/shipments.js +1 -2
- package/lib/esm/resources/shipping_categories.js +2 -3
- package/lib/esm/resources/shipping_method_tiers.js +0 -1
- package/lib/esm/resources/shipping_methods.js +2 -3
- package/lib/esm/resources/shipping_weight_tiers.js +2 -3
- package/lib/esm/resources/shipping_zones.js +2 -3
- package/lib/esm/resources/sku_list_items.js +2 -3
- package/lib/esm/resources/sku_list_promotion_rules.js +2 -3
- package/lib/esm/resources/sku_lists.js +2 -3
- package/lib/esm/resources/sku_options.js +2 -3
- package/lib/esm/resources/skus.js +2 -3
- package/lib/esm/resources/stock_items.js +2 -3
- package/lib/esm/resources/stock_line_items.js +0 -1
- package/lib/esm/resources/stock_locations.js +2 -3
- package/lib/esm/resources/stock_transfers.js +2 -3
- package/lib/esm/resources/stripe_gateways.js +2 -3
- package/lib/esm/resources/stripe_payments.js +2 -3
- package/lib/esm/resources/tax_calculators.js +0 -1
- package/lib/esm/resources/tax_categories.js +2 -3
- package/lib/esm/resources/tax_rules.js +2 -3
- package/lib/esm/resources/taxjar_accounts.js +2 -3
- package/lib/esm/resources/transactions.js +0 -1
- package/lib/esm/resources/voids.js +0 -1
- package/lib/esm/resources/webhooks.js +2 -3
- package/lib/esm/resources/wire_transfers.js +2 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/lib/cjs/client.js
CHANGED
@@ -71,11 +71,16 @@ class ApiClient {
|
|
71
71
|
httpAgent: options.httpAgent,
|
72
72
|
httpsAgent: options.httpsAgent,
|
73
73
|
};
|
74
|
-
const axiosOptions =
|
74
|
+
const axiosOptions = {
|
75
|
+
baseURL: this.baseUrl,
|
76
|
+
timeout: config_1.default.client.timeout,
|
77
|
+
headers: {
|
75
78
|
'Accept': 'application/vnd.api+json',
|
76
79
|
'Content-Type': 'application/vnd.api+json',
|
77
80
|
'Authorization': 'Bearer ' + __classPrivateFieldGet(this, _ApiClient_accessToken, "f"),
|
78
|
-
}
|
81
|
+
},
|
82
|
+
...axiosConfig
|
83
|
+
};
|
79
84
|
debug('axios options: %O', axiosOptions);
|
80
85
|
__classPrivateFieldSet(this, _ApiClient_client, axios_1.default.create(axiosOptions), "f");
|
81
86
|
this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
|
@@ -108,7 +113,7 @@ class ApiClient {
|
|
108
113
|
const baseUrl = (options === null || options === void 0 ? void 0 : options.organization) ? baseURL(options.organization, options.domain) : undefined;
|
109
114
|
const accessToken = (options === null || options === void 0 ? void 0 : options.accessToken) || __classPrivateFieldGet(this, _ApiClient_accessToken, "f");
|
110
115
|
const headers = accessToken ? { 'Authorization': 'Bearer ' + accessToken } : undefined;
|
111
|
-
const requestParams =
|
116
|
+
const requestParams = { method, baseURL: baseUrl, url, data, headers, ...options };
|
112
117
|
debug('request params: %O', requestParams);
|
113
118
|
// const start = Date.now()
|
114
119
|
return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
|
@@ -2,7 +2,7 @@ import * as api from './api';
|
|
2
2
|
import { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import { ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.0.
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.0.1";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
12
|
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "4.0.
|
13
|
+
readonly openApiSchemaVersion = "4.0.1";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
|
|
45
45
|
const debug_1 = __importDefault(require("./debug"));
|
46
46
|
const debug = (0, debug_1.default)('commercelayer');
|
47
47
|
// Autogenerated schema version number, do not remove this line
|
48
|
-
const OPEN_API_SCHEMA_VERSION = '4.0.
|
48
|
+
const OPEN_API_SCHEMA_VERSION = '4.0.1';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
package/lib/cjs/error.js
CHANGED
@@ -27,7 +27,7 @@ class ApiError extends SdkError {
|
|
27
27
|
return SdkError.isSdkError(error) && (error.name === ApiError.NAME) && (error.type === ErrorType.RESPONSE);
|
28
28
|
}
|
29
29
|
constructor(error) {
|
30
|
-
super(
|
30
|
+
super({ ...error, type: ErrorType.RESPONSE });
|
31
31
|
this.errors = [];
|
32
32
|
this.name = ApiError.NAME; // this.constructor.name
|
33
33
|
}
|
package/lib/cjs/jsonapi.js
CHANGED
@@ -35,7 +35,11 @@ const denormalizeResource = (res, included) => {
|
|
35
35
|
debug('denormalize resource: %O, %o', res, included || {});
|
36
36
|
if (!res)
|
37
37
|
return res;
|
38
|
-
const resource =
|
38
|
+
const resource = {
|
39
|
+
id: res.id,
|
40
|
+
type: res.type,
|
41
|
+
...res.attributes,
|
42
|
+
};
|
39
43
|
if (res.relationships)
|
40
44
|
Object.keys(res.relationships).forEach(key => {
|
41
45
|
const rel = res.relationships[key].data;
|
package/lib/cjs/resource.js
CHANGED
@@ -61,7 +61,7 @@ class ResourceAdapter {
|
|
61
61
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
62
62
|
if (options === null || options === void 0 ? void 0 : options.params)
|
63
63
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
64
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined,
|
64
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
|
65
65
|
const r = (0, jsonapi_1.denormalize)(res);
|
66
66
|
return r;
|
67
67
|
}
|
@@ -70,7 +70,7 @@ class ResourceAdapter {
|
|
70
70
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
71
71
|
if (options === null || options === void 0 ? void 0 : options.params)
|
72
72
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
73
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}/${resource.id}`, undefined,
|
73
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}/${resource.id}`, undefined, { ...options, params: queryParams });
|
74
74
|
const r = (0, jsonapi_1.denormalize)(res);
|
75
75
|
return r;
|
76
76
|
}
|
@@ -80,7 +80,7 @@ class ResourceAdapter {
|
|
80
80
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
81
81
|
if (options === null || options === void 0 ? void 0 : options.params)
|
82
82
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
83
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined,
|
83
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', `${resource.type}`, undefined, { ...options, params: queryParams });
|
84
84
|
const r = (0, jsonapi_1.denormalize)(res);
|
85
85
|
const meta = {
|
86
86
|
pageCount: Number((_a = res.meta) === null || _a === void 0 ? void 0 : _a.page_count),
|
@@ -96,7 +96,7 @@ class ResourceAdapter {
|
|
96
96
|
if (options === null || options === void 0 ? void 0 : options.params)
|
97
97
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
98
98
|
const data = (0, jsonapi_1.normalize)(resource);
|
99
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('post', resource.type, data,
|
99
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('post', resource.type, data, { ...options, params: queryParams });
|
100
100
|
const r = (0, jsonapi_1.denormalize)(res);
|
101
101
|
return r;
|
102
102
|
}
|
@@ -106,7 +106,7 @@ class ResourceAdapter {
|
|
106
106
|
if (options === null || options === void 0 ? void 0 : options.params)
|
107
107
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
108
108
|
const data = (0, jsonapi_1.normalize)(resource);
|
109
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('patch', `${resource.type}/${resource.id}`, data,
|
109
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('patch', `${resource.type}/${resource.id}`, data, { ...options, params: queryParams });
|
110
110
|
const r = (0, jsonapi_1.denormalize)(res);
|
111
111
|
return r;
|
112
112
|
}
|
@@ -120,7 +120,7 @@ class ResourceAdapter {
|
|
120
120
|
const queryParams = (0, query_1.generateQueryStringParams)(params, resource);
|
121
121
|
if (options === null || options === void 0 ? void 0 : options.params)
|
122
122
|
Object.assign(queryParams, options === null || options === void 0 ? void 0 : options.params);
|
123
|
-
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', path, undefined,
|
123
|
+
const res = await __classPrivateFieldGet(this, _ResourceAdapter_client, "f").request('get', path, undefined, { ...options, params: queryParams });
|
124
124
|
const r = (0, jsonapi_1.denormalize)(res);
|
125
125
|
if (Array.isArray(r)) {
|
126
126
|
const p = params;
|
@@ -144,7 +144,7 @@ class ApiResourceBase {
|
|
144
144
|
}
|
145
145
|
// reference, reference_origin and metadata attributes are always updatable
|
146
146
|
async update(resource, params, options) {
|
147
|
-
return this.resources.update(
|
147
|
+
return this.resources.update({ ...resource, type: this.type() }, params, options);
|
148
148
|
}
|
149
149
|
async count(filter, options) {
|
150
150
|
const params = { filters: (0, query_1.isParamsList)(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 };
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Addresses extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'addresses'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Addresses.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: Addresses.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: Addresses.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: Addresses.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Adjustments extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'adjustments'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Adjustments.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: Adjustments.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: Adjustments.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: Adjustments.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class AdyenGateways extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'adyen_gateways'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: AdyenGateways.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: AdyenGateways.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: AdyenGateways.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: AdyenGateways.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class AdyenPayments extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'adyen_payments'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: AdyenPayments.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: AdyenPayments.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: AdyenPayments.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: AdyenPayments.TYPE } : id, options);
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Applications extends resource_1.ApiSingleton {
|
5
|
-
// static readonly PATH = 'application'
|
6
5
|
isApplication(resource) {
|
7
6
|
return resource.type && (resource.type === Applications.TYPE);
|
8
7
|
}
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Attachments extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'attachments'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Attachments.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: Attachments.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: Attachments.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: Attachments.TYPE } : id, options);
|
@@ -2,12 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Authorizations extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'authorizations'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Authorizations.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async update(resource, params, options) {
|
10
|
-
return this.resources.update(
|
9
|
+
return this.resources.update({ ...resource, type: Authorizations.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async order(authorizationId, params, options) {
|
13
12
|
const _authorizationId = authorizationId.id || authorizationId;
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class AvalaraAccounts extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'avalara_accounts'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: AvalaraAccounts.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: AvalaraAccounts.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: AvalaraAccounts.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: AvalaraAccounts.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class AxerveGateways extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'axerve_gateways'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: AxerveGateways.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: AxerveGateways.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: AxerveGateways.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: AxerveGateways.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class AxervePayments extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'axerve_payments'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: AxervePayments.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: AxervePayments.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: AxervePayments.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: AxervePayments.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class BillingInfoValidationRules extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'billing_info_validation_rules'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: BillingInfoValidationRules.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: BillingInfoValidationRules.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: BillingInfoValidationRules.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: BillingInfoValidationRules.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class BingGeocoders extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'bing_geocoders'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: BingGeocoders.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: BingGeocoders.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: BingGeocoders.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: BingGeocoders.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class BraintreeGateways extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'braintree_gateways'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: BraintreeGateways.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: BraintreeGateways.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: BraintreeGateways.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: BraintreeGateways.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class BraintreePayments extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'braintree_payments'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: BraintreePayments.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: BraintreePayments.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: BraintreePayments.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: BraintreePayments.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Bundles extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'bundles'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Bundles.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: Bundles.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: Bundles.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: Bundles.TYPE } : id, options);
|
@@ -2,12 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Captures extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'captures'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Captures.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async update(resource, params, options) {
|
10
|
-
return this.resources.update(
|
9
|
+
return this.resources.update({ ...resource, type: Captures.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async order(captureId, params, options) {
|
13
12
|
const _captureId = captureId.id || captureId;
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class CarrierAccounts extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'carrier_accounts'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: CarrierAccounts.TYPE }, params, options);
|
8
7
|
}
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class CheckoutComGateways extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'checkout_com_gateways'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: CheckoutComGateways.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: CheckoutComGateways.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: CheckoutComGateways.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: CheckoutComGateways.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class CheckoutComPayments extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'checkout_com_payments'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: CheckoutComPayments.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: CheckoutComPayments.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: CheckoutComPayments.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: CheckoutComPayments.TYPE } : id, options);
|
@@ -2,12 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Cleanups extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'cleanups'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Cleanups.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: Cleanups.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async delete(id, options) {
|
13
12
|
await this.resources.delete((typeof id === 'string') ? { id, type: Cleanups.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class CouponCodesPromotionRules extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'coupon_codes_promotion_rules'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: CouponCodesPromotionRules.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: CouponCodesPromotionRules.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: CouponCodesPromotionRules.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: CouponCodesPromotionRules.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class CouponRecipients extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'coupon_recipients'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: CouponRecipients.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: CouponRecipients.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: CouponRecipients.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: CouponRecipients.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class Coupons extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'coupons'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: Coupons.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: Coupons.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: Coupons.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: Coupons.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class CustomerAddresses extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'customer_addresses'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: CustomerAddresses.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: CustomerAddresses.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: CustomerAddresses.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: CustomerAddresses.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class CustomerGroups extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'customer_groups'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: CustomerGroups.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: CustomerGroups.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: CustomerGroups.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: CustomerGroups.TYPE } : id, options);
|
@@ -2,15 +2,14 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class CustomerPasswordResets extends resource_1.ApiResource {
|
5
|
-
// static readonly PATH = 'customer_password_resets'
|
6
5
|
async list(params, options) {
|
7
6
|
return this.resources.list({ type: CustomerPasswordResets.TYPE }, params, options);
|
8
7
|
}
|
9
8
|
async create(resource, params, options) {
|
10
|
-
return this.resources.create(
|
9
|
+
return this.resources.create({ ...resource, type: CustomerPasswordResets.TYPE }, params, options);
|
11
10
|
}
|
12
11
|
async update(resource, params, options) {
|
13
|
-
return this.resources.update(
|
12
|
+
return this.resources.update({ ...resource, type: CustomerPasswordResets.TYPE }, params, options);
|
14
13
|
}
|
15
14
|
async delete(id, options) {
|
16
15
|
await this.resources.delete((typeof id === 'string') ? { id, type: CustomerPasswordResets.TYPE } : id, options);
|