@commercelayer/sdk 5.0.0-beta.1 → 5.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/client.js +0 -1
- package/lib/cjs/common.js +0 -2
- package/lib/cjs/debug.js +0 -3
- package/lib/cjs/error.js +0 -1
- package/lib/cjs/query.d.ts +2 -1
- package/lib/cjs/query.js +2 -1
- package/lib/cjs/resource.d.ts +1 -1
- package/lib/cjs/resource.js +1 -1
- package/lib/cjs/resources/addresses.d.ts +10 -10
- package/lib/cjs/resources/adjustments.d.ts +8 -8
- package/lib/cjs/resources/adyen_gateways.d.ts +4 -4
- package/lib/cjs/resources/adyen_payments.d.ts +1 -1
- package/lib/cjs/resources/attachments.d.ts +2 -2
- package/lib/cjs/resources/authorizations.d.ts +6 -6
- package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
- package/lib/cjs/resources/axerve_gateways.d.ts +4 -4
- package/lib/cjs/resources/axerve_payments.d.ts +3 -3
- package/lib/cjs/resources/bing_geocoders.d.ts +2 -2
- package/lib/cjs/resources/braintree_gateways.d.ts +2 -2
- package/lib/cjs/resources/braintree_payments.d.ts +1 -1
- package/lib/cjs/resources/bundles.d.ts +12 -12
- package/lib/cjs/resources/captures.d.ts +6 -6
- package/lib/cjs/resources/checkout_com_gateways.d.ts +2 -2
- package/lib/cjs/resources/checkout_com_payments.d.ts +4 -4
- package/lib/cjs/resources/cleanups.d.ts +1 -1
- package/lib/cjs/resources/coupon_recipients.d.ts +2 -2
- package/lib/cjs/resources/coupons.d.ts +4 -4
- package/lib/cjs/resources/customer_groups.d.ts +2 -2
- package/lib/cjs/resources/customer_password_resets.d.ts +1 -1
- package/lib/cjs/resources/customer_subscriptions.d.ts +1 -1
- package/lib/cjs/resources/customers.d.ts +2 -2
- package/lib/cjs/resources/delivery_lead_times.d.ts +4 -4
- package/lib/cjs/resources/event_callbacks.d.ts +1 -1
- package/lib/cjs/resources/events.d.ts +1 -1
- package/lib/cjs/resources/exports.d.ts +1 -1
- package/lib/cjs/resources/external_gateways.d.ts +3 -3
- package/lib/cjs/resources/external_payments.d.ts +1 -1
- package/lib/cjs/resources/external_promotions.d.ts +11 -11
- package/lib/cjs/resources/external_tax_calculators.d.ts +5 -5
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +10 -10
- package/lib/cjs/resources/fixed_price_promotions.d.ts +10 -10
- package/lib/cjs/resources/free_gift_promotions.d.ts +8 -8
- package/lib/cjs/resources/free_shipping_promotions.d.ts +8 -8
- package/lib/cjs/resources/geocoders.d.ts +1 -1
- package/lib/cjs/resources/gift_card_recipients.d.ts +2 -2
- package/lib/cjs/resources/gift_cards.d.ts +8 -8
- package/lib/cjs/resources/google_geocoders.d.ts +2 -2
- package/lib/cjs/resources/imports.d.ts +2 -2
- package/lib/cjs/resources/inventory_models.d.ts +2 -2
- package/lib/cjs/resources/inventory_return_locations.d.ts +2 -2
- package/lib/cjs/resources/inventory_stock_locations.d.ts +2 -2
- package/lib/cjs/resources/klarna_gateways.d.ts +2 -2
- package/lib/cjs/resources/klarna_payments.d.ts +2 -2
- package/lib/cjs/resources/line_item_options.d.ts +5 -5
- package/lib/cjs/resources/line_items.d.ts +4 -4
- package/lib/cjs/resources/manual_gateways.d.ts +2 -2
- package/lib/cjs/resources/manual_tax_calculators.d.ts +2 -2
- package/lib/cjs/resources/markets.d.ts +3 -3
- package/lib/cjs/resources/merchants.d.ts +2 -2
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -1
- package/lib/cjs/resources/packages.d.ts +10 -10
- package/lib/cjs/resources/parcel_line_items.d.ts +2 -2
- package/lib/cjs/resources/parcels.d.ts +4 -4
- package/lib/cjs/resources/payment_gateways.d.ts +1 -1
- package/lib/cjs/resources/payment_methods.d.ts +4 -4
- package/lib/cjs/resources/paypal_gateways.d.ts +2 -2
- package/lib/cjs/resources/paypal_payments.d.ts +3 -3
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +10 -10
- package/lib/cjs/resources/price_lists.d.ts +4 -4
- package/lib/cjs/resources/price_tiers.d.ts +2 -2
- package/lib/cjs/resources/price_volume_tiers.d.ts +4 -4
- package/lib/cjs/resources/prices.d.ts +8 -8
- package/lib/cjs/resources/promotions.d.ts +4 -4
- package/lib/cjs/resources/refunds.d.ts +6 -6
- package/lib/cjs/resources/return_line_items.d.ts +2 -2
- package/lib/cjs/resources/satispay_gateways.d.ts +2 -2
- package/lib/cjs/resources/satispay_payments.d.ts +1 -1
- package/lib/cjs/resources/shipping_categories.d.ts +2 -2
- package/lib/cjs/resources/shipping_method_tiers.d.ts +2 -2
- package/lib/cjs/resources/shipping_methods.d.ts +4 -4
- package/lib/cjs/resources/shipping_weight_tiers.d.ts +4 -4
- package/lib/cjs/resources/shipping_zones.d.ts +2 -2
- package/lib/cjs/resources/sku_lists.d.ts +3 -3
- package/lib/cjs/resources/sku_options.d.ts +2 -2
- package/lib/cjs/resources/skus.d.ts +4 -4
- package/lib/cjs/resources/stock_items.d.ts +2 -2
- package/lib/cjs/resources/stock_line_items.d.ts +1 -1
- package/lib/cjs/resources/stock_locations.d.ts +2 -2
- package/lib/cjs/resources/stock_transfers.d.ts +1 -1
- package/lib/cjs/resources/stripe_gateways.d.ts +2 -2
- package/lib/cjs/resources/stripe_payments.d.ts +2 -2
- package/lib/cjs/resources/tax_calculators.d.ts +1 -1
- package/lib/cjs/resources/tax_categories.d.ts +2 -2
- package/lib/cjs/resources/tax_rules.d.ts +2 -2
- package/lib/cjs/resources/taxjar_accounts.d.ts +2 -2
- package/lib/cjs/resources/transactions.d.ts +6 -6
- package/lib/cjs/resources/voids.d.ts +6 -6
- package/lib/cjs/resources/webhooks.d.ts +5 -5
- package/lib/esm/client.js +0 -1
- package/lib/esm/common.js +0 -2
- package/lib/esm/debug.js +0 -3
- package/lib/esm/error.js +0 -1
- package/lib/esm/query.d.ts +2 -1
- package/lib/esm/query.js +1 -1
- package/lib/esm/resource.d.ts +1 -1
- package/lib/esm/resource.js +2 -2
- package/lib/esm/resources/addresses.d.ts +10 -10
- package/lib/esm/resources/adjustments.d.ts +8 -8
- package/lib/esm/resources/adyen_gateways.d.ts +4 -4
- package/lib/esm/resources/adyen_payments.d.ts +1 -1
- package/lib/esm/resources/attachments.d.ts +2 -2
- package/lib/esm/resources/authorizations.d.ts +6 -6
- package/lib/esm/resources/avalara_accounts.d.ts +6 -6
- package/lib/esm/resources/axerve_gateways.d.ts +4 -4
- package/lib/esm/resources/axerve_payments.d.ts +3 -3
- package/lib/esm/resources/bing_geocoders.d.ts +2 -2
- package/lib/esm/resources/braintree_gateways.d.ts +2 -2
- package/lib/esm/resources/braintree_payments.d.ts +1 -1
- package/lib/esm/resources/bundles.d.ts +12 -12
- package/lib/esm/resources/captures.d.ts +6 -6
- package/lib/esm/resources/checkout_com_gateways.d.ts +2 -2
- package/lib/esm/resources/checkout_com_payments.d.ts +4 -4
- package/lib/esm/resources/cleanups.d.ts +1 -1
- package/lib/esm/resources/coupon_recipients.d.ts +2 -2
- package/lib/esm/resources/coupons.d.ts +4 -4
- package/lib/esm/resources/customer_groups.d.ts +2 -2
- package/lib/esm/resources/customer_password_resets.d.ts +1 -1
- package/lib/esm/resources/customer_subscriptions.d.ts +1 -1
- package/lib/esm/resources/customers.d.ts +2 -2
- package/lib/esm/resources/delivery_lead_times.d.ts +4 -4
- package/lib/esm/resources/event_callbacks.d.ts +1 -1
- package/lib/esm/resources/events.d.ts +1 -1
- package/lib/esm/resources/exports.d.ts +1 -1
- package/lib/esm/resources/external_gateways.d.ts +3 -3
- package/lib/esm/resources/external_payments.d.ts +1 -1
- package/lib/esm/resources/external_promotions.d.ts +11 -11
- package/lib/esm/resources/external_tax_calculators.d.ts +5 -5
- package/lib/esm/resources/fixed_amount_promotions.d.ts +10 -10
- package/lib/esm/resources/fixed_price_promotions.d.ts +10 -10
- package/lib/esm/resources/free_gift_promotions.d.ts +8 -8
- package/lib/esm/resources/free_shipping_promotions.d.ts +8 -8
- package/lib/esm/resources/geocoders.d.ts +1 -1
- package/lib/esm/resources/gift_card_recipients.d.ts +2 -2
- package/lib/esm/resources/gift_cards.d.ts +8 -8
- package/lib/esm/resources/google_geocoders.d.ts +2 -2
- package/lib/esm/resources/imports.d.ts +2 -2
- package/lib/esm/resources/inventory_models.d.ts +2 -2
- package/lib/esm/resources/inventory_return_locations.d.ts +2 -2
- package/lib/esm/resources/inventory_stock_locations.d.ts +2 -2
- package/lib/esm/resources/klarna_gateways.d.ts +2 -2
- package/lib/esm/resources/klarna_payments.d.ts +2 -2
- package/lib/esm/resources/line_item_options.d.ts +5 -5
- package/lib/esm/resources/line_items.d.ts +4 -4
- package/lib/esm/resources/manual_gateways.d.ts +2 -2
- package/lib/esm/resources/manual_tax_calculators.d.ts +2 -2
- package/lib/esm/resources/markets.d.ts +3 -3
- package/lib/esm/resources/merchants.d.ts +2 -2
- package/lib/esm/resources/order_subscriptions.d.ts +1 -1
- package/lib/esm/resources/packages.d.ts +10 -10
- package/lib/esm/resources/parcel_line_items.d.ts +2 -2
- package/lib/esm/resources/parcels.d.ts +4 -4
- package/lib/esm/resources/payment_gateways.d.ts +1 -1
- package/lib/esm/resources/payment_methods.d.ts +4 -4
- package/lib/esm/resources/paypal_gateways.d.ts +2 -2
- package/lib/esm/resources/paypal_payments.d.ts +3 -3
- package/lib/esm/resources/percentage_discount_promotions.d.ts +10 -10
- package/lib/esm/resources/price_lists.d.ts +4 -4
- package/lib/esm/resources/price_tiers.d.ts +2 -2
- package/lib/esm/resources/price_volume_tiers.d.ts +4 -4
- package/lib/esm/resources/prices.d.ts +8 -8
- package/lib/esm/resources/promotions.d.ts +4 -4
- package/lib/esm/resources/refunds.d.ts +6 -6
- package/lib/esm/resources/return_line_items.d.ts +2 -2
- package/lib/esm/resources/satispay_gateways.d.ts +2 -2
- package/lib/esm/resources/satispay_payments.d.ts +1 -1
- package/lib/esm/resources/shipping_categories.d.ts +2 -2
- package/lib/esm/resources/shipping_method_tiers.d.ts +2 -2
- package/lib/esm/resources/shipping_methods.d.ts +4 -4
- package/lib/esm/resources/shipping_weight_tiers.d.ts +4 -4
- package/lib/esm/resources/shipping_zones.d.ts +2 -2
- package/lib/esm/resources/sku_lists.d.ts +3 -3
- package/lib/esm/resources/sku_options.d.ts +2 -2
- package/lib/esm/resources/skus.d.ts +4 -4
- package/lib/esm/resources/stock_items.d.ts +2 -2
- package/lib/esm/resources/stock_line_items.d.ts +1 -1
- package/lib/esm/resources/stock_locations.d.ts +2 -2
- package/lib/esm/resources/stock_transfers.d.ts +1 -1
- package/lib/esm/resources/stripe_gateways.d.ts +2 -2
- package/lib/esm/resources/stripe_payments.d.ts +2 -2
- package/lib/esm/resources/tax_calculators.d.ts +1 -1
- package/lib/esm/resources/tax_categories.d.ts +2 -2
- package/lib/esm/resources/tax_rules.d.ts +2 -2
- package/lib/esm/resources/taxjar_accounts.d.ts +2 -2
- package/lib/esm/resources/transactions.d.ts +6 -6
- package/lib/esm/resources/voids.d.ts +6 -6
- package/lib/esm/resources/webhooks.d.ts +5 -5
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/lib/cjs/client.js
CHANGED
@@ -15,7 +15,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
15
|
};
|
16
16
|
var _ApiClient_accessToken, _ApiClient_client;
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
19
18
|
const axios_1 = __importDefault(require("axios"));
|
20
19
|
const error_1 = require("./error");
|
21
20
|
const config_1 = __importDefault(require("./config"));
|
package/lib/cjs/common.js
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
3
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
4
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5
3
|
exports.isResourceType = exports.isResourceId = void 0;
|
6
4
|
const api_1 = require("./api");
|
package/lib/cjs/debug.js
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
3
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
4
|
-
// import Debug from 'debug'
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
3
|
/* Nope debugger */
|
7
4
|
const debuggerFunction = (_pattern, ..._args) => {
|
package/lib/cjs/error.js
CHANGED
package/lib/cjs/query.d.ts
CHANGED
@@ -18,7 +18,8 @@ interface QueryParamsList extends QueryParamsRetrieve {
|
|
18
18
|
}
|
19
19
|
type QueryParams = QueryParamsRetrieve | QueryParamsList;
|
20
20
|
export { QueryParamsRetrieve, QueryParamsList, QueryParams, QueryFilter };
|
21
|
+
declare const isParamsList: (params: any) => params is QueryParamsList;
|
21
22
|
declare const generateQueryStringParams: (params: QueryParamsRetrieve | QueryParamsList | undefined, res: string | ResourceType) => {
|
22
23
|
[key: string]: string;
|
23
24
|
};
|
24
|
-
export { generateQueryStringParams };
|
25
|
+
export { generateQueryStringParams, isParamsList };
|
package/lib/cjs/query.js
CHANGED
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.generateQueryStringParams = void 0;
|
6
|
+
exports.isParamsList = exports.generateQueryStringParams = void 0;
|
7
7
|
const debug_1 = __importDefault(require("./debug"));
|
8
8
|
const debug = (0, debug_1.default)('query');
|
9
9
|
const isParamsList = (params) => {
|
10
10
|
return (params.filters || params.pageNumber || params.pageSize || params.sort);
|
11
11
|
};
|
12
|
+
exports.isParamsList = isParamsList;
|
12
13
|
const generateQueryStringParams = (params, res) => {
|
13
14
|
debug('generate query string params: %O, %O', params, res);
|
14
15
|
const qp = {};
|
package/lib/cjs/resource.d.ts
CHANGED
@@ -78,7 +78,7 @@ declare abstract class ApiResourceBase<R extends Resource> {
|
|
78
78
|
abstract relationship(id: string | ResourceId | null): ResourceRel;
|
79
79
|
abstract type(): ResourceTypeLock;
|
80
80
|
update(resource: ResourceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
81
|
-
count(filter?: QueryFilter, options?: ResourcesConfig): Promise<number>;
|
81
|
+
count(filter?: QueryFilter | QueryParamsList, options?: ResourcesConfig): Promise<number>;
|
82
82
|
}
|
83
83
|
declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
|
84
84
|
retrieve(id: string | ResourceId, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
package/lib/cjs/resource.js
CHANGED
@@ -147,7 +147,7 @@ class ApiResourceBase {
|
|
147
147
|
return this.resources.update(Object.assign(Object.assign({}, resource), { type: this.type() }), params, options);
|
148
148
|
}
|
149
149
|
async count(filter, options) {
|
150
|
-
const params = { filters: filter, pageNumber: 1, pageSize: 1 };
|
150
|
+
const params = { filters: (0, query_1.isParamsList)(filter) ? filter.filters : filter, pageNumber: 1, pageSize: 1 };
|
151
151
|
const response = await this.resources.list({ type: this.type() }, params, options);
|
152
152
|
return Promise.resolve(response.meta.recordCount);
|
153
153
|
}
|
@@ -15,13 +15,13 @@ interface Address extends Resource {
|
|
15
15
|
last_name?: string;
|
16
16
|
company?: string;
|
17
17
|
full_name?: string;
|
18
|
-
line_1
|
18
|
+
line_1: string;
|
19
19
|
line_2?: string;
|
20
|
-
city
|
20
|
+
city: string;
|
21
21
|
zip_code?: string;
|
22
|
-
state_code
|
23
|
-
country_code
|
24
|
-
phone
|
22
|
+
state_code: string;
|
23
|
+
country_code: string;
|
24
|
+
phone: string;
|
25
25
|
full_address?: string;
|
26
26
|
name?: string;
|
27
27
|
email?: string;
|
@@ -60,13 +60,13 @@ interface AddressUpdate extends ResourceUpdate {
|
|
60
60
|
first_name?: string;
|
61
61
|
last_name?: string;
|
62
62
|
company?: string;
|
63
|
-
line_1
|
63
|
+
line_1: string;
|
64
64
|
line_2?: string;
|
65
|
-
city
|
65
|
+
city: string;
|
66
66
|
zip_code?: string;
|
67
|
-
state_code
|
68
|
-
country_code
|
69
|
-
phone
|
67
|
+
state_code: string;
|
68
|
+
country_code: string;
|
69
|
+
phone: string;
|
70
70
|
email?: string;
|
71
71
|
notes?: string;
|
72
72
|
lat?: number;
|
@@ -6,11 +6,11 @@ type AdjustmentRel = ResourceRel & {
|
|
6
6
|
};
|
7
7
|
interface Adjustment extends Resource {
|
8
8
|
readonly type: AdjustmentType;
|
9
|
-
name
|
10
|
-
currency_code
|
11
|
-
amount_cents
|
12
|
-
amount_float
|
13
|
-
formatted_amount
|
9
|
+
name: string;
|
10
|
+
currency_code: string;
|
11
|
+
amount_cents: number;
|
12
|
+
amount_float: number;
|
13
|
+
formatted_amount: string;
|
14
14
|
}
|
15
15
|
interface AdjustmentCreate extends ResourceCreate {
|
16
16
|
name: string;
|
@@ -18,9 +18,9 @@ interface AdjustmentCreate extends ResourceCreate {
|
|
18
18
|
amount_cents: number;
|
19
19
|
}
|
20
20
|
interface AdjustmentUpdate extends ResourceUpdate {
|
21
|
-
name
|
22
|
-
currency_code
|
23
|
-
amount_cents
|
21
|
+
name: string;
|
22
|
+
currency_code: string;
|
23
|
+
amount_cents: number;
|
24
24
|
}
|
25
25
|
declare class Adjustments extends ApiResource<Adjustment> {
|
26
26
|
static readonly TYPE: AdjustmentType;
|
@@ -11,8 +11,8 @@ type AdyenPaymentRel = ResourceRel & {
|
|
11
11
|
};
|
12
12
|
interface AdyenGateway extends Resource {
|
13
13
|
readonly type: AdyenGatewayType;
|
14
|
-
name
|
15
|
-
live_url_prefix
|
14
|
+
name: string;
|
15
|
+
live_url_prefix: string;
|
16
16
|
async_api?: boolean;
|
17
17
|
webhook_endpoint_secret?: string;
|
18
18
|
webhook_endpoint_url?: string;
|
@@ -31,11 +31,11 @@ interface AdyenGatewayCreate extends ResourceCreate {
|
|
31
31
|
adyen_payments?: AdyenPaymentRel[];
|
32
32
|
}
|
33
33
|
interface AdyenGatewayUpdate extends ResourceUpdate {
|
34
|
-
name
|
34
|
+
name: string;
|
35
35
|
merchant_account?: string;
|
36
36
|
api_key?: string;
|
37
37
|
public_key?: string;
|
38
|
-
live_url_prefix
|
38
|
+
live_url_prefix: string;
|
39
39
|
api_version?: string;
|
40
40
|
async_api?: boolean;
|
41
41
|
webhook_endpoint_secret?: string;
|
@@ -12,7 +12,7 @@ type OrderRel = ResourceRel & {
|
|
12
12
|
interface AdyenPayment extends Resource {
|
13
13
|
readonly type: AdyenPaymentType;
|
14
14
|
public_key?: string;
|
15
|
-
payment_methods
|
15
|
+
payment_methods: object;
|
16
16
|
payment_request_data?: object;
|
17
17
|
payment_request_details?: object;
|
18
18
|
payment_response?: object;
|
@@ -126,7 +126,7 @@ type TaxCategoryRel = ResourceRel & {
|
|
126
126
|
};
|
127
127
|
interface Attachment extends Resource {
|
128
128
|
readonly type: AttachmentType;
|
129
|
-
name
|
129
|
+
name: string;
|
130
130
|
description?: string;
|
131
131
|
url?: string;
|
132
132
|
attachable?: Bundle | CarrierAccount | CustomerGroup | Customer | DeliveryLeadTime | Geocoder | GiftCardRecipient | GiftCard | InventoryModel | Market | Merchant | BillingInfoValidationRule | Order | Package | Parcel | PaymentMethod | PriceList | Price | Promotion | Return | Shipment | ShippingCategory | ShippingMethod | ShippingZone | SkuOption | Sku | StockItem | StockLocation | TaxCalculator | TaxCategory;
|
@@ -138,7 +138,7 @@ interface AttachmentCreate extends ResourceCreate {
|
|
138
138
|
attachable: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel;
|
139
139
|
}
|
140
140
|
interface AttachmentUpdate extends ResourceUpdate {
|
141
|
-
name
|
141
|
+
name: string;
|
142
142
|
description?: string;
|
143
143
|
url?: string;
|
144
144
|
attachable?: BundleRel | CarrierAccountRel | CustomerGroupRel | CustomerRel | DeliveryLeadTimeRel | GeocoderRel | GiftCardRecipientRel | GiftCardRel | InventoryModelRel | MarketRel | MerchantRel | BillingInfoValidationRuleRel | OrderRel | PackageRel | ParcelRel | PaymentMethodRel | PriceListRel | PriceRel | PromotionRel | ReturnRel | ShipmentRel | ShippingCategoryRel | ShippingMethodRel | ShippingZoneRel | SkuOptionRel | SkuRel | StockItemRel | StockLocationRel | TaxCalculatorRel | TaxCategoryRel;
|
@@ -10,12 +10,12 @@ type AuthorizationRel = ResourceRel & {
|
|
10
10
|
};
|
11
11
|
interface Authorization extends Resource {
|
12
12
|
readonly type: AuthorizationType;
|
13
|
-
number
|
14
|
-
currency_code
|
15
|
-
amount_cents
|
16
|
-
amount_float
|
17
|
-
formatted_amount
|
18
|
-
succeeded
|
13
|
+
number: string;
|
14
|
+
currency_code: string;
|
15
|
+
amount_cents: number;
|
16
|
+
amount_float: number;
|
17
|
+
formatted_amount: string;
|
18
|
+
succeeded: boolean;
|
19
19
|
message?: string;
|
20
20
|
error_code?: string;
|
21
21
|
error_detail?: string;
|
@@ -12,9 +12,9 @@ type TaxCategoryRel = ResourceRel & {
|
|
12
12
|
};
|
13
13
|
interface AvalaraAccount extends Resource {
|
14
14
|
readonly type: AvalaraAccountType;
|
15
|
-
name
|
16
|
-
username
|
17
|
-
company_code
|
15
|
+
name: string;
|
16
|
+
username: string;
|
17
|
+
company_code: string;
|
18
18
|
commit_invoice?: string;
|
19
19
|
ddp?: string;
|
20
20
|
markets?: Market[];
|
@@ -31,10 +31,10 @@ interface AvalaraAccountCreate extends ResourceCreate {
|
|
31
31
|
tax_categories?: TaxCategoryRel[];
|
32
32
|
}
|
33
33
|
interface AvalaraAccountUpdate extends ResourceUpdate {
|
34
|
-
name
|
35
|
-
username
|
34
|
+
name: string;
|
35
|
+
username: string;
|
36
36
|
password?: string;
|
37
|
-
company_code
|
37
|
+
company_code: string;
|
38
38
|
commit_invoice?: string;
|
39
39
|
ddp?: string;
|
40
40
|
tax_categories?: TaxCategoryRel[];
|
@@ -11,8 +11,8 @@ type AxervePaymentRel = ResourceRel & {
|
|
11
11
|
};
|
12
12
|
interface AxerveGateway extends Resource {
|
13
13
|
readonly type: AxerveGatewayType;
|
14
|
-
name
|
15
|
-
login
|
14
|
+
name: string;
|
15
|
+
login: string;
|
16
16
|
payment_methods?: PaymentMethod[];
|
17
17
|
axerve_payments?: AxervePayment[];
|
18
18
|
}
|
@@ -23,8 +23,8 @@ interface AxerveGatewayCreate extends ResourceCreate {
|
|
23
23
|
axerve_payments?: AxervePaymentRel[];
|
24
24
|
}
|
25
25
|
interface AxerveGatewayUpdate extends ResourceUpdate {
|
26
|
-
name
|
27
|
-
login
|
26
|
+
name: string;
|
27
|
+
login: string;
|
28
28
|
api_key?: string;
|
29
29
|
axerve_payments?: AxervePaymentRel[];
|
30
30
|
}
|
@@ -11,11 +11,11 @@ type OrderRel = ResourceRel & {
|
|
11
11
|
};
|
12
12
|
interface AxervePayment extends Resource {
|
13
13
|
readonly type: AxervePaymentType;
|
14
|
-
login
|
15
|
-
return_url
|
14
|
+
login: string;
|
15
|
+
return_url: string;
|
16
16
|
payment_request_data?: object;
|
17
17
|
mismatched_amounts?: boolean;
|
18
|
-
intent_amount_cents
|
18
|
+
intent_amount_cents: number;
|
19
19
|
intent_amount_float?: number;
|
20
20
|
formatted_intent_amount?: string;
|
21
21
|
payment_instrument?: object;
|
@@ -8,7 +8,7 @@ type BingGeocoderRel = ResourceRel & {
|
|
8
8
|
};
|
9
9
|
interface BingGeocoder extends Resource {
|
10
10
|
readonly type: BingGeocoderType;
|
11
|
-
name
|
11
|
+
name: string;
|
12
12
|
addresses?: Address[];
|
13
13
|
attachments?: Attachment[];
|
14
14
|
}
|
@@ -17,7 +17,7 @@ interface BingGeocoderCreate extends ResourceCreate {
|
|
17
17
|
key: string;
|
18
18
|
}
|
19
19
|
interface BingGeocoderUpdate extends ResourceUpdate {
|
20
|
-
name
|
20
|
+
name: string;
|
21
21
|
key?: string;
|
22
22
|
}
|
23
23
|
declare class BingGeocoders extends ApiResource<BingGeocoder> {
|
@@ -11,7 +11,7 @@ type BraintreePaymentRel = ResourceRel & {
|
|
11
11
|
};
|
12
12
|
interface BraintreeGateway extends Resource {
|
13
13
|
readonly type: BraintreeGatewayType;
|
14
|
-
name
|
14
|
+
name: string;
|
15
15
|
descriptor_name?: string;
|
16
16
|
descriptor_phone?: string;
|
17
17
|
descriptor_url?: string;
|
@@ -31,7 +31,7 @@ interface BraintreeGatewayCreate extends ResourceCreate {
|
|
31
31
|
braintree_payments?: BraintreePaymentRel[];
|
32
32
|
}
|
33
33
|
interface BraintreeGatewayUpdate extends ResourceUpdate {
|
34
|
-
name
|
34
|
+
name: string;
|
35
35
|
merchant_account_id?: string;
|
36
36
|
merchant_id?: string;
|
37
37
|
public_key?: string;
|
@@ -16,19 +16,19 @@ type SkuListRel = ResourceRel & {
|
|
16
16
|
};
|
17
17
|
interface Bundle extends Resource {
|
18
18
|
readonly type: BundleType;
|
19
|
-
code
|
20
|
-
name
|
19
|
+
code: string;
|
20
|
+
name: string;
|
21
21
|
currency_code?: string;
|
22
22
|
description?: string;
|
23
23
|
image_url?: string;
|
24
24
|
do_not_ship?: boolean;
|
25
25
|
do_not_track?: boolean;
|
26
|
-
price_amount_cents
|
27
|
-
price_amount_float
|
28
|
-
formatted_price_amount
|
29
|
-
compare_at_amount_cents
|
30
|
-
compare_at_amount_float
|
31
|
-
formatted_compare_at_amount
|
26
|
+
price_amount_cents: number;
|
27
|
+
price_amount_float: number;
|
28
|
+
formatted_price_amount: string;
|
29
|
+
compare_at_amount_cents: number;
|
30
|
+
compare_at_amount_float: number;
|
31
|
+
formatted_compare_at_amount: string;
|
32
32
|
skus_count?: number;
|
33
33
|
market?: Market;
|
34
34
|
sku_list?: SkuList;
|
@@ -49,13 +49,13 @@ interface BundleCreate extends ResourceCreate {
|
|
49
49
|
sku_list: SkuListRel;
|
50
50
|
}
|
51
51
|
interface BundleUpdate extends ResourceUpdate {
|
52
|
-
code
|
53
|
-
name
|
52
|
+
code: string;
|
53
|
+
name: string;
|
54
54
|
currency_code?: string;
|
55
55
|
description?: string;
|
56
56
|
image_url?: string;
|
57
|
-
price_amount_cents
|
58
|
-
compare_at_amount_cents
|
57
|
+
price_amount_cents: number;
|
58
|
+
compare_at_amount_cents: number;
|
59
59
|
_compute_price_amount?: boolean;
|
60
60
|
_compute_compare_at_amount?: boolean;
|
61
61
|
}
|
@@ -10,12 +10,12 @@ type CaptureRel = ResourceRel & {
|
|
10
10
|
};
|
11
11
|
interface Capture extends Resource {
|
12
12
|
readonly type: CaptureType;
|
13
|
-
number
|
14
|
-
currency_code
|
15
|
-
amount_cents
|
16
|
-
amount_float
|
17
|
-
formatted_amount
|
18
|
-
succeeded
|
13
|
+
number: string;
|
14
|
+
currency_code: string;
|
15
|
+
amount_cents: number;
|
16
|
+
amount_float: number;
|
17
|
+
formatted_amount: string;
|
18
|
+
succeeded: boolean;
|
19
19
|
message?: string;
|
20
20
|
error_code?: string;
|
21
21
|
error_detail?: string;
|
@@ -11,7 +11,7 @@ type CheckoutComPaymentRel = ResourceRel & {
|
|
11
11
|
};
|
12
12
|
interface CheckoutComGateway extends Resource {
|
13
13
|
readonly type: CheckoutComGatewayType;
|
14
|
-
name
|
14
|
+
name: string;
|
15
15
|
webhook_endpoint_id?: string;
|
16
16
|
webhook_endpoint_secret?: string;
|
17
17
|
webhook_endpoint_url?: string;
|
@@ -25,7 +25,7 @@ interface CheckoutComGatewayCreate extends ResourceCreate {
|
|
25
25
|
checkout_com_payments?: CheckoutComPaymentRel[];
|
26
26
|
}
|
27
27
|
interface CheckoutComGatewayUpdate extends ResourceUpdate {
|
28
|
-
name
|
28
|
+
name: string;
|
29
29
|
secret_key?: string;
|
30
30
|
public_key?: string;
|
31
31
|
checkout_com_payments?: CheckoutComPaymentRel[];
|
@@ -12,8 +12,8 @@ type OrderRel = ResourceRel & {
|
|
12
12
|
interface CheckoutComPayment extends Resource {
|
13
13
|
readonly type: CheckoutComPaymentType;
|
14
14
|
public_key?: string;
|
15
|
-
payment_type
|
16
|
-
token
|
15
|
+
payment_type: string;
|
16
|
+
token: string;
|
17
17
|
session_id?: string;
|
18
18
|
success_url?: string;
|
19
19
|
failure_url?: string;
|
@@ -35,8 +35,8 @@ interface CheckoutComPaymentCreate extends ResourceCreate {
|
|
35
35
|
order: OrderRel;
|
36
36
|
}
|
37
37
|
interface CheckoutComPaymentUpdate extends ResourceUpdate {
|
38
|
-
payment_type
|
39
|
-
token
|
38
|
+
payment_type: string;
|
39
|
+
token: string;
|
40
40
|
session_id?: string;
|
41
41
|
success_url?: string;
|
42
42
|
failure_url?: string;
|
@@ -7,7 +7,7 @@ type CleanupRel = ResourceRel & {
|
|
7
7
|
};
|
8
8
|
interface Cleanup extends Resource {
|
9
9
|
readonly type: CleanupType;
|
10
|
-
resource_type
|
10
|
+
resource_type: string;
|
11
11
|
status?: 'pending' | 'in_progress' | 'interrupted' | 'completed';
|
12
12
|
started_at?: string;
|
13
13
|
completed_at?: string;
|
@@ -11,7 +11,7 @@ type CustomerRel = ResourceRel & {
|
|
11
11
|
};
|
12
12
|
interface CouponRecipient extends Resource {
|
13
13
|
readonly type: CouponRecipientType;
|
14
|
-
email
|
14
|
+
email: string;
|
15
15
|
first_name?: string;
|
16
16
|
last_name?: string;
|
17
17
|
customer?: Customer;
|
@@ -24,7 +24,7 @@ interface CouponRecipientCreate extends ResourceCreate {
|
|
24
24
|
customer?: CustomerRel;
|
25
25
|
}
|
26
26
|
interface CouponRecipientUpdate extends ResourceUpdate {
|
27
|
-
email
|
27
|
+
email: string;
|
28
28
|
first_name?: string;
|
29
29
|
last_name?: string;
|
30
30
|
customer?: CustomerRel;
|
@@ -10,9 +10,9 @@ type CouponCodesPromotionRuleRel = ResourceRel & {
|
|
10
10
|
};
|
11
11
|
interface Coupon extends Resource {
|
12
12
|
readonly type: CouponType;
|
13
|
-
code
|
13
|
+
code: string;
|
14
14
|
customer_single_use?: boolean;
|
15
|
-
usage_limit
|
15
|
+
usage_limit: number;
|
16
16
|
usage_count?: number;
|
17
17
|
recipient_email?: string;
|
18
18
|
promotion_rule?: CouponCodesPromotionRule;
|
@@ -25,9 +25,9 @@ interface CouponCreate extends ResourceCreate {
|
|
25
25
|
promotion_rule: CouponCodesPromotionRuleRel;
|
26
26
|
}
|
27
27
|
interface CouponUpdate extends ResourceUpdate {
|
28
|
-
code
|
28
|
+
code: string;
|
29
29
|
customer_single_use?: boolean;
|
30
|
-
usage_limit
|
30
|
+
usage_limit: number;
|
31
31
|
recipient_email?: string;
|
32
32
|
promotion_rule?: CouponCodesPromotionRuleRel;
|
33
33
|
}
|
@@ -9,7 +9,7 @@ type CustomerGroupRel = ResourceRel & {
|
|
9
9
|
};
|
10
10
|
interface CustomerGroup extends Resource {
|
11
11
|
readonly type: CustomerGroupType;
|
12
|
-
name
|
12
|
+
name: string;
|
13
13
|
customers?: Customer[];
|
14
14
|
markets?: Market[];
|
15
15
|
attachments?: Attachment[];
|
@@ -18,7 +18,7 @@ interface CustomerGroupCreate extends ResourceCreate {
|
|
18
18
|
name: string;
|
19
19
|
}
|
20
20
|
interface CustomerGroupUpdate extends ResourceUpdate {
|
21
|
-
name
|
21
|
+
name: string;
|
22
22
|
}
|
23
23
|
declare class CustomerGroups extends ApiResource<CustomerGroup> {
|
24
24
|
static readonly TYPE: CustomerGroupType;
|
@@ -8,7 +8,7 @@ type CustomerPasswordResetRel = ResourceRel & {
|
|
8
8
|
};
|
9
9
|
interface CustomerPasswordReset extends Resource {
|
10
10
|
readonly type: CustomerPasswordResetType;
|
11
|
-
customer_email
|
11
|
+
customer_email: string;
|
12
12
|
reset_password_token?: string;
|
13
13
|
reset_password_at?: string;
|
14
14
|
customer?: Customer;
|
@@ -19,7 +19,7 @@ type CustomerGroupRel = ResourceRel & {
|
|
19
19
|
};
|
20
20
|
interface Customer extends Resource {
|
21
21
|
readonly type: CustomerType;
|
22
|
-
email
|
22
|
+
email: string;
|
23
23
|
status?: 'prospect' | 'acquired' | 'repeat';
|
24
24
|
has_password?: boolean;
|
25
25
|
customer_group?: CustomerGroup;
|
@@ -39,7 +39,7 @@ interface CustomerCreate extends ResourceCreate {
|
|
39
39
|
customer_group?: CustomerGroupRel;
|
40
40
|
}
|
41
41
|
interface CustomerUpdate extends ResourceUpdate {
|
42
|
-
email
|
42
|
+
email: string;
|
43
43
|
password?: string;
|
44
44
|
customer_group?: CustomerGroupRel;
|
45
45
|
}
|
@@ -15,8 +15,8 @@ type ShippingMethodRel = ResourceRel & {
|
|
15
15
|
};
|
16
16
|
interface DeliveryLeadTime extends Resource {
|
17
17
|
readonly type: DeliveryLeadTimeType;
|
18
|
-
min_hours
|
19
|
-
max_hours
|
18
|
+
min_hours: number;
|
19
|
+
max_hours: number;
|
20
20
|
min_days?: number;
|
21
21
|
max_days?: number;
|
22
22
|
stock_location?: StockLocation;
|
@@ -30,8 +30,8 @@ interface DeliveryLeadTimeCreate extends ResourceCreate {
|
|
30
30
|
shipping_method: ShippingMethodRel;
|
31
31
|
}
|
32
32
|
interface DeliveryLeadTimeUpdate extends ResourceUpdate {
|
33
|
-
min_hours
|
34
|
-
max_hours
|
33
|
+
min_hours: number;
|
34
|
+
max_hours: number;
|
35
35
|
stock_location?: StockLocationRel;
|
36
36
|
shipping_method?: ShippingMethodRel;
|
37
37
|
}
|
@@ -8,8 +8,8 @@ type ExternalGatewayRel = ResourceRel & {
|
|
8
8
|
};
|
9
9
|
interface ExternalGateway extends Resource {
|
10
10
|
readonly type: ExternalGatewayType;
|
11
|
-
name
|
12
|
-
shared_secret
|
11
|
+
name: string;
|
12
|
+
shared_secret: string;
|
13
13
|
authorize_url?: string;
|
14
14
|
capture_url?: string;
|
15
15
|
void_url?: string;
|
@@ -27,7 +27,7 @@ interface ExternalGatewayCreate extends ResourceCreate {
|
|
27
27
|
token_url?: string;
|
28
28
|
}
|
29
29
|
interface ExternalGatewayUpdate extends ResourceUpdate {
|
30
|
-
name
|
30
|
+
name: string;
|
31
31
|
authorize_url?: string;
|
32
32
|
capture_url?: string;
|
33
33
|
void_url?: string;
|
@@ -12,7 +12,7 @@ type OrderRel = ResourceRel & {
|
|
12
12
|
};
|
13
13
|
interface ExternalPayment extends Resource {
|
14
14
|
readonly type: ExternalPaymentType;
|
15
|
-
payment_source_token
|
15
|
+
payment_source_token: string;
|
16
16
|
options?: object;
|
17
17
|
payment_instrument?: object;
|
18
18
|
order?: Order;
|