@commercelayer/sdk 4.37.0 → 4.39.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/lib/cjs/api.d.ts +10 -7
- package/lib/cjs/api.js +12 -3
- package/lib/cjs/commercelayer.d.ts +5 -2
- package/lib/cjs/commercelayer.js +4 -1
- package/lib/cjs/error.d.ts +3 -2
- package/lib/cjs/error.js +2 -1
- package/lib/cjs/model.d.ts +6 -3
- package/lib/cjs/resource.d.ts +1 -0
- package/lib/cjs/resource.js +16 -0
- package/lib/cjs/resources/axerve_payments.d.ts +4 -0
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +137 -0
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +75 -0
- package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +7 -3
- package/lib/cjs/resources/coupons.d.ts +3 -0
- package/lib/cjs/resources/custom_promotion_rules.d.ts +62 -0
- package/lib/cjs/resources/custom_promotion_rules.js +29 -0
- package/lib/cjs/resources/external_promotions.d.ts +20 -1
- package/lib/cjs/resources/external_promotions.js +10 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +20 -1
- package/lib/cjs/resources/fixed_amount_promotions.js +10 -0
- package/lib/cjs/resources/fixed_price_promotions.d.ts +11 -0
- package/lib/cjs/resources/fixed_price_promotions.js +6 -0
- package/lib/cjs/resources/free_gift_promotions.d.ts +11 -0
- package/lib/cjs/resources/free_gift_promotions.js +6 -0
- package/lib/cjs/resources/free_shipping_promotions.d.ts +11 -0
- package/lib/cjs/resources/free_shipping_promotions.js +6 -0
- package/lib/cjs/resources/inventory_models.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +1 -0
- package/lib/cjs/resources/order_amount_promotion_rules.d.ts +7 -3
- package/lib/cjs/resources/orders.d.ts +24 -0
- package/lib/cjs/resources/orders.js +20 -0
- package/lib/cjs/resources/payment_methods.d.ts +3 -3
- package/lib/cjs/resources/payment_options.d.ts +44 -0
- package/lib/cjs/resources/payment_options.js +33 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +11 -0
- package/lib/cjs/resources/percentage_discount_promotions.js +6 -0
- package/lib/cjs/resources/promotion_rules.d.ts +2 -1
- package/lib/cjs/resources/promotions.d.ts +3 -0
- package/lib/cjs/resources/shipments.d.ts +38 -5
- package/lib/cjs/resources/shipments.js +19 -0
- package/lib/cjs/resources/sku_list_promotion_rules.d.ts +7 -3
- package/lib/cjs/resources/stock_line_items.d.ts +37 -7
- package/lib/cjs/resources/stock_line_items.js +9 -0
- package/lib/cjs/resources/stock_reservations.d.ts +19 -3
- package/lib/cjs/resources/stock_reservations.js +12 -0
- package/lib/cjs/resources/stock_transfers.d.ts +3 -1
- package/lib/cjs/resources/stock_transfers.js +3 -0
- package/lib/cjs/util.d.ts +0 -5
- package/lib/esm/api.d.ts +10 -7
- package/lib/esm/api.js +6 -0
- package/lib/esm/commercelayer.d.ts +5 -2
- package/lib/esm/commercelayer.js +4 -1
- package/lib/esm/error.d.ts +3 -2
- package/lib/esm/error.js +2 -1
- package/lib/esm/model.d.ts +6 -3
- package/lib/esm/resource.d.ts +1 -0
- package/lib/esm/resource.js +16 -0
- package/lib/esm/resources/axerve_payments.d.ts +4 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +137 -0
- package/lib/esm/resources/buy_x_pay_y_promotions.js +73 -0
- package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +7 -3
- package/lib/esm/resources/coupons.d.ts +3 -0
- package/lib/esm/resources/custom_promotion_rules.d.ts +62 -0
- package/lib/esm/resources/custom_promotion_rules.js +27 -0
- package/lib/esm/resources/external_promotions.d.ts +20 -1
- package/lib/esm/resources/external_promotions.js +10 -0
- package/lib/esm/resources/fixed_amount_promotions.d.ts +20 -1
- package/lib/esm/resources/fixed_amount_promotions.js +10 -0
- package/lib/esm/resources/fixed_price_promotions.d.ts +11 -0
- package/lib/esm/resources/fixed_price_promotions.js +6 -0
- package/lib/esm/resources/free_gift_promotions.d.ts +11 -0
- package/lib/esm/resources/free_gift_promotions.js +6 -0
- package/lib/esm/resources/free_shipping_promotions.d.ts +11 -0
- package/lib/esm/resources/free_shipping_promotions.js +6 -0
- package/lib/esm/resources/inventory_models.d.ts +3 -0
- package/lib/esm/resources/line_items.d.ts +1 -0
- package/lib/esm/resources/order_amount_promotion_rules.d.ts +7 -3
- package/lib/esm/resources/orders.d.ts +24 -0
- package/lib/esm/resources/orders.js +20 -0
- package/lib/esm/resources/payment_methods.d.ts +3 -3
- package/lib/esm/resources/payment_options.d.ts +44 -0
- package/lib/esm/resources/payment_options.js +31 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +11 -0
- package/lib/esm/resources/percentage_discount_promotions.js +6 -0
- package/lib/esm/resources/promotion_rules.d.ts +2 -1
- package/lib/esm/resources/promotions.d.ts +3 -0
- package/lib/esm/resources/shipments.d.ts +38 -5
- package/lib/esm/resources/shipments.js +19 -0
- package/lib/esm/resources/sku_list_promotion_rules.d.ts +7 -3
- package/lib/esm/resources/stock_line_items.d.ts +37 -7
- package/lib/esm/resources/stock_line_items.js +9 -0
- package/lib/esm/resources/stock_reservations.d.ts +19 -3
- package/lib/esm/resources/stock_reservations.js +12 -0
- package/lib/esm/resources/stock_transfers.d.ts +3 -1
- package/lib/esm/resources/stock_transfers.js +3 -0
- package/lib/esm/util.d.ts +0 -5
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -1,15 +1,18 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
|
-
import type { Resource, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
2
|
+
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
3
3
|
import type { QueryParamsRetrieve } from '../query';
|
4
4
|
import type { LineItem } from './line_items';
|
5
5
|
import type { Order } from './orders';
|
6
|
-
import type { StockItem } from './stock_items';
|
6
|
+
import type { StockItem, StockItemType } from './stock_items';
|
7
7
|
import type { ReservedStock } from './reserved_stocks';
|
8
8
|
import type { Sku } from './skus';
|
9
9
|
type StockReservationType = 'stock_reservations';
|
10
10
|
type StockReservationRel = ResourceRel & {
|
11
11
|
type: StockReservationType;
|
12
12
|
};
|
13
|
+
type StockItemRel = ResourceRel & {
|
14
|
+
type: StockItemType;
|
15
|
+
};
|
13
16
|
interface StockReservation extends Resource {
|
14
17
|
readonly type: StockReservationType;
|
15
18
|
status: 'draft' | 'pending';
|
@@ -21,16 +24,29 @@ interface StockReservation extends Resource {
|
|
21
24
|
reserved_stock?: ReservedStock | null;
|
22
25
|
sku?: Sku | null;
|
23
26
|
}
|
27
|
+
interface StockReservationCreate extends ResourceCreate {
|
28
|
+
quantity: number;
|
29
|
+
stock_item: StockItemRel;
|
30
|
+
}
|
31
|
+
interface StockReservationUpdate extends ResourceUpdate {
|
32
|
+
quantity?: number | null;
|
33
|
+
_pending?: boolean | null;
|
34
|
+
stock_item?: StockItemRel | null;
|
35
|
+
}
|
24
36
|
declare class StockReservations extends ApiResource<StockReservation> {
|
25
37
|
static readonly TYPE: StockReservationType;
|
38
|
+
create(resource: StockReservationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
39
|
+
update(resource: StockReservationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
40
|
+
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
26
41
|
line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
27
42
|
order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
28
43
|
stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
29
44
|
reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
|
30
45
|
sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
46
|
+
_pending(id: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockReservation>;
|
31
47
|
isStockReservation(resource: any): resource is StockReservation;
|
32
48
|
relationship(id: string | ResourceId | null): StockReservationRel;
|
33
49
|
type(): StockReservationType;
|
34
50
|
}
|
35
51
|
export default StockReservations;
|
36
|
-
export type { StockReservation, StockReservationType };
|
52
|
+
export type { StockReservation, StockReservationCreate, StockReservationUpdate, StockReservationType };
|
@@ -2,6 +2,15 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const resource_1 = require("../resource");
|
4
4
|
class StockReservations extends resource_1.ApiResource {
|
5
|
+
async create(resource, params, options) {
|
6
|
+
return this.resources.create({ ...resource, type: StockReservations.TYPE }, params, options);
|
7
|
+
}
|
8
|
+
async update(resource, params, options) {
|
9
|
+
return this.resources.update({ ...resource, type: StockReservations.TYPE }, params, options);
|
10
|
+
}
|
11
|
+
async delete(id, options) {
|
12
|
+
await this.resources.delete((typeof id === 'string') ? { id, type: StockReservations.TYPE } : id, options);
|
13
|
+
}
|
5
14
|
async line_item(stockReservationId, params, options) {
|
6
15
|
const _stockReservationId = stockReservationId.id || stockReservationId;
|
7
16
|
return this.resources.fetch({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options);
|
@@ -22,6 +31,9 @@ class StockReservations extends resource_1.ApiResource {
|
|
22
31
|
const _stockReservationId = stockReservationId.id || stockReservationId;
|
23
32
|
return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
|
24
33
|
}
|
34
|
+
async _pending(id, params, options) {
|
35
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockReservations.TYPE, _pending: true }, params, options);
|
36
|
+
}
|
25
37
|
isStockReservation(resource) {
|
26
38
|
return resource.type && (resource.type === StockReservations.TYPE);
|
27
39
|
}
|
@@ -26,7 +26,7 @@ type LineItemRel = ResourceRel & {
|
|
26
26
|
interface StockTransfer extends Resource {
|
27
27
|
readonly type: StockTransferType;
|
28
28
|
sku_code?: string | null;
|
29
|
-
status: 'draft' | 'upcoming' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
|
29
|
+
status: 'draft' | 'upcoming' | 'on_hold' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
|
30
30
|
quantity: number;
|
31
31
|
completed_at?: string | null;
|
32
32
|
cancelled_at?: string | null;
|
@@ -50,6 +50,7 @@ interface StockTransferCreate extends ResourceCreate {
|
|
50
50
|
interface StockTransferUpdate extends ResourceUpdate {
|
51
51
|
sku_code?: string | null;
|
52
52
|
_upcoming?: boolean | null;
|
53
|
+
_on_hold?: boolean | null;
|
53
54
|
_picking?: boolean | null;
|
54
55
|
_in_transit?: boolean | null;
|
55
56
|
_complete?: boolean | null;
|
@@ -71,6 +72,7 @@ declare class StockTransfers extends ApiResource<StockTransfer> {
|
|
71
72
|
events(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
72
73
|
versions(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
73
74
|
_upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
75
|
+
_on_hold(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
74
76
|
_picking(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
75
77
|
_in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
76
78
|
_complete(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
|
@@ -42,6 +42,9 @@ class StockTransfers extends resource_1.ApiResource {
|
|
42
42
|
async _upcoming(id, params, options) {
|
43
43
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _upcoming: true }, params, options);
|
44
44
|
}
|
45
|
+
async _on_hold(id, params, options) {
|
46
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _on_hold: true }, params, options);
|
47
|
+
}
|
45
48
|
async _picking(id, params, options) {
|
46
49
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _picking: true }, params, options);
|
47
50
|
}
|
package/lib/cjs/util.d.ts
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="node" />
|
3
|
-
/// <reference types="node" />
|
4
|
-
/// <reference types="node" />
|
5
|
-
/// <reference types="node" />
|
6
1
|
import type { ObjectType } from "../src/common";
|
7
2
|
declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
|
8
3
|
declare const sortObjectFields: (obj: ObjectType) => ObjectType;
|
package/lib/esm/api.d.ts
CHANGED
@@ -19,6 +19,7 @@ export { default as BingGeocoders } from './resources/bing_geocoders';
|
|
19
19
|
export { default as BraintreeGateways } from './resources/braintree_gateways';
|
20
20
|
export { default as BraintreePayments } from './resources/braintree_payments';
|
21
21
|
export { default as Bundles } from './resources/bundles';
|
22
|
+
export { default as BuyXPayYPromotions } from './resources/buy_x_pay_y_promotions';
|
22
23
|
export { default as Captures } from './resources/captures';
|
23
24
|
export { default as CarrierAccounts } from './resources/carrier_accounts';
|
24
25
|
export { default as CheckoutComGateways } from './resources/checkout_com_gateways';
|
@@ -27,6 +28,7 @@ export { default as Cleanups } from './resources/cleanups';
|
|
27
28
|
export { default as CouponCodesPromotionRules } from './resources/coupon_codes_promotion_rules';
|
28
29
|
export { default as CouponRecipients } from './resources/coupon_recipients';
|
29
30
|
export { default as Coupons } from './resources/coupons';
|
31
|
+
export { default as CustomPromotionRules } from './resources/custom_promotion_rules';
|
30
32
|
export { default as CustomerAddresses } from './resources/customer_addresses';
|
31
33
|
export { default as CustomerGroups } from './resources/customer_groups';
|
32
34
|
export { default as CustomerPasswordResets } from './resources/customer_password_resets';
|
@@ -75,6 +77,7 @@ export { default as ParcelLineItems } from './resources/parcel_line_items';
|
|
75
77
|
export { default as Parcels } from './resources/parcels';
|
76
78
|
export { default as PaymentGateways } from './resources/payment_gateways';
|
77
79
|
export { default as PaymentMethods } from './resources/payment_methods';
|
80
|
+
export { default as PaymentOptions } from './resources/payment_options';
|
78
81
|
export { default as PaypalGateways } from './resources/paypal_gateways';
|
79
82
|
export { default as PaypalPayments } from './resources/paypal_payments';
|
80
83
|
export { default as PercentageDiscountPromotions } from './resources/percentage_discount_promotions';
|
@@ -121,8 +124,8 @@ export { default as Versions } from './resources/versions';
|
|
121
124
|
export { default as Voids } from './resources/voids';
|
122
125
|
export { default as Webhooks } from './resources/webhooks';
|
123
126
|
export { default as WireTransfers } from './resources/wire_transfers';
|
124
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
125
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
127
|
+
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
128
|
+
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "payment_options", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
126
129
|
export type RetrievableResourceType = ResourceTypeLock;
|
127
130
|
export type RetrievableResource = Resource & {
|
128
131
|
type: RetrievableResourceType;
|
@@ -131,26 +134,26 @@ export type ListableResourceType = Exclude<ResourceTypeLock, 'application' | 'or
|
|
131
134
|
export type ListableResource = Resource & {
|
132
135
|
type: ListableResourceType;
|
133
136
|
};
|
134
|
-
export type CreatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
137
|
+
export type CreatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
135
138
|
export type CreatableResource = Resource & {
|
136
139
|
type: CreatableResourceType;
|
137
140
|
};
|
138
|
-
export type UpdatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
141
|
+
export type UpdatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
139
142
|
export type UpdatableResource = Resource & {
|
140
143
|
type: UpdatableResourceType;
|
141
144
|
};
|
142
|
-
export type DeletableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
145
|
+
export type DeletableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
|
143
146
|
export type DeletableResource = Resource & {
|
144
147
|
type: DeletableResourceType;
|
145
148
|
};
|
146
|
-
export type TaggableResourceType = 'addresses' | 'bundles' | 'coupons' | 'customers' | 'external_promotions' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_cards' | 'line_item_options' | 'line_items' | 'orders' | 'percentage_discount_promotions' | 'promotions' | 'returns' | 'sku_options' | 'skus';
|
149
|
+
export type TaggableResourceType = 'addresses' | 'bundles' | 'buy_x_pay_y_promotions' | 'coupons' | 'customers' | 'external_promotions' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_cards' | 'line_item_options' | 'line_items' | 'orders' | 'percentage_discount_promotions' | 'promotions' | 'returns' | 'sku_options' | 'skus';
|
147
150
|
export type TaggableResource = Resource & {
|
148
151
|
type: TaggableResourceType;
|
149
152
|
tags?: Array<ResourceRel & {
|
150
153
|
type: TagType;
|
151
154
|
}> | null;
|
152
155
|
};
|
153
|
-
export type VersionableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_payment_sources' | 'customer_subscriptions' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
156
|
+
export type VersionableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_payment_sources' | 'customer_subscriptions' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
154
157
|
export type VersionableResource = Resource & {
|
155
158
|
type: VersionableResourceType;
|
156
159
|
versions?: Array<ResourceRel & {
|
package/lib/esm/api.js
CHANGED
@@ -18,6 +18,7 @@ export { default as BingGeocoders } from './resources/bing_geocoders';
|
|
18
18
|
export { default as BraintreeGateways } from './resources/braintree_gateways';
|
19
19
|
export { default as BraintreePayments } from './resources/braintree_payments';
|
20
20
|
export { default as Bundles } from './resources/bundles';
|
21
|
+
export { default as BuyXPayYPromotions } from './resources/buy_x_pay_y_promotions';
|
21
22
|
export { default as Captures } from './resources/captures';
|
22
23
|
export { default as CarrierAccounts } from './resources/carrier_accounts';
|
23
24
|
export { default as CheckoutComGateways } from './resources/checkout_com_gateways';
|
@@ -26,6 +27,7 @@ export { default as Cleanups } from './resources/cleanups';
|
|
26
27
|
export { default as CouponCodesPromotionRules } from './resources/coupon_codes_promotion_rules';
|
27
28
|
export { default as CouponRecipients } from './resources/coupon_recipients';
|
28
29
|
export { default as Coupons } from './resources/coupons';
|
30
|
+
export { default as CustomPromotionRules } from './resources/custom_promotion_rules';
|
29
31
|
export { default as CustomerAddresses } from './resources/customer_addresses';
|
30
32
|
export { default as CustomerGroups } from './resources/customer_groups';
|
31
33
|
export { default as CustomerPasswordResets } from './resources/customer_password_resets';
|
@@ -74,6 +76,7 @@ export { default as ParcelLineItems } from './resources/parcel_line_items';
|
|
74
76
|
export { default as Parcels } from './resources/parcels';
|
75
77
|
export { default as PaymentGateways } from './resources/payment_gateways';
|
76
78
|
export { default as PaymentMethods } from './resources/payment_methods';
|
79
|
+
export { default as PaymentOptions } from './resources/payment_options';
|
77
80
|
export { default as PaypalGateways } from './resources/paypal_gateways';
|
78
81
|
export { default as PaypalPayments } from './resources/paypal_payments';
|
79
82
|
export { default as PercentageDiscountPromotions } from './resources/percentage_discount_promotions';
|
@@ -138,6 +141,7 @@ export const resourceList = [
|
|
138
141
|
'braintree_gateways',
|
139
142
|
'braintree_payments',
|
140
143
|
'bundles',
|
144
|
+
'buy_x_pay_y_promotions',
|
141
145
|
'captures',
|
142
146
|
'carrier_accounts',
|
143
147
|
'checkout_com_gateways',
|
@@ -146,6 +150,7 @@ export const resourceList = [
|
|
146
150
|
'coupon_codes_promotion_rules',
|
147
151
|
'coupon_recipients',
|
148
152
|
'coupons',
|
153
|
+
'custom_promotion_rules',
|
149
154
|
'customer_addresses',
|
150
155
|
'customer_groups',
|
151
156
|
'customer_password_resets',
|
@@ -194,6 +199,7 @@ export const resourceList = [
|
|
194
199
|
'parcels',
|
195
200
|
'payment_gateways',
|
196
201
|
'payment_methods',
|
202
|
+
'payment_options',
|
197
203
|
'paypal_gateways',
|
198
204
|
'paypal_payments',
|
199
205
|
'percentage_discount_promotions',
|
@@ -2,14 +2,14 @@ import * as api from './api';
|
|
2
2
|
import type { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import { type ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.16.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
|
-
readonly openApiSchemaVersion = "4.
|
12
|
+
readonly openApiSchemaVersion = "4.16.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
@@ -25,6 +25,7 @@ declare class CommerceLayerClient {
|
|
25
25
|
braintree_gateways: api.BraintreeGateways;
|
26
26
|
braintree_payments: api.BraintreePayments;
|
27
27
|
bundles: api.Bundles;
|
28
|
+
buy_x_pay_y_promotions: api.BuyXPayYPromotions;
|
28
29
|
captures: api.Captures;
|
29
30
|
carrier_accounts: api.CarrierAccounts;
|
30
31
|
checkout_com_gateways: api.CheckoutComGateways;
|
@@ -33,6 +34,7 @@ declare class CommerceLayerClient {
|
|
33
34
|
coupon_codes_promotion_rules: api.CouponCodesPromotionRules;
|
34
35
|
coupon_recipients: api.CouponRecipients;
|
35
36
|
coupons: api.Coupons;
|
37
|
+
custom_promotion_rules: api.CustomPromotionRules;
|
36
38
|
customer_addresses: api.CustomerAddresses;
|
37
39
|
customer_groups: api.CustomerGroups;
|
38
40
|
customer_password_resets: api.CustomerPasswordResets;
|
@@ -81,6 +83,7 @@ declare class CommerceLayerClient {
|
|
81
83
|
parcels: api.Parcels;
|
82
84
|
payment_gateways: api.PaymentGateways;
|
83
85
|
payment_methods: api.PaymentMethods;
|
86
|
+
payment_options: api.PaymentOptions;
|
84
87
|
paypal_gateways: api.PaypalGateways;
|
85
88
|
paypal_payments: api.PaypalPayments;
|
86
89
|
percentage_discount_promotions: api.PercentageDiscountPromotions;
|
package/lib/esm/commercelayer.js
CHANGED
@@ -16,7 +16,7 @@ import ResourceAdapter from './resource';
|
|
16
16
|
import Debug from './debug';
|
17
17
|
const debug = Debug('commercelayer');
|
18
18
|
// Autogenerated schema version number, do not remove this line
|
19
|
-
const OPEN_API_SCHEMA_VERSION = '4.
|
19
|
+
const OPEN_API_SCHEMA_VERSION = '4.16.0';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -46,6 +46,7 @@ class CommerceLayerClient {
|
|
46
46
|
this.braintree_gateways = new api.BraintreeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
47
47
|
this.braintree_payments = new api.BraintreePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
48
48
|
this.bundles = new api.Bundles(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
49
|
+
this.buy_x_pay_y_promotions = new api.BuyXPayYPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
49
50
|
this.captures = new api.Captures(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
50
51
|
this.carrier_accounts = new api.CarrierAccounts(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
51
52
|
this.checkout_com_gateways = new api.CheckoutComGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -54,6 +55,7 @@ class CommerceLayerClient {
|
|
54
55
|
this.coupon_codes_promotion_rules = new api.CouponCodesPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
55
56
|
this.coupon_recipients = new api.CouponRecipients(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
56
57
|
this.coupons = new api.Coupons(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
58
|
+
this.custom_promotion_rules = new api.CustomPromotionRules(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
57
59
|
this.customer_addresses = new api.CustomerAddresses(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
58
60
|
this.customer_groups = new api.CustomerGroups(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
59
61
|
this.customer_password_resets = new api.CustomerPasswordResets(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
@@ -102,6 +104,7 @@ class CommerceLayerClient {
|
|
102
104
|
this.parcels = new api.Parcels(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
103
105
|
this.payment_gateways = new api.PaymentGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
104
106
|
this.payment_methods = new api.PaymentMethods(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
107
|
+
this.payment_options = new api.PaymentOptions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
105
108
|
this.paypal_gateways = new api.PaypalGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
106
109
|
this.paypal_payments = new api.PaypalPayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
107
110
|
this.percentage_discount_promotions = new api.PercentageDiscountPromotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
package/lib/esm/error.d.ts
CHANGED
@@ -2,8 +2,9 @@ declare enum ErrorType {
|
|
2
2
|
CLIENT = "client",
|
3
3
|
REQUEST = "request",
|
4
4
|
RESPONSE = "response",
|
5
|
-
|
6
|
-
|
5
|
+
CANCEL = "cancel",
|
6
|
+
PARSE = "parse",
|
7
|
+
GENERIC = "generic"
|
7
8
|
}
|
8
9
|
declare class SdkError extends Error {
|
9
10
|
static NAME: string;
|
package/lib/esm/error.js
CHANGED
@@ -4,8 +4,9 @@ var ErrorType;
|
|
4
4
|
ErrorType["CLIENT"] = "client";
|
5
5
|
ErrorType["REQUEST"] = "request";
|
6
6
|
ErrorType["RESPONSE"] = "response";
|
7
|
-
ErrorType["GENERIC"] = "generic";
|
8
7
|
ErrorType["CANCEL"] = "cancel";
|
8
|
+
ErrorType["PARSE"] = "parse";
|
9
|
+
ErrorType["GENERIC"] = "generic";
|
9
10
|
})(ErrorType || (ErrorType = {}));
|
10
11
|
class SdkError extends Error {
|
11
12
|
static isSdkError(error) {
|
package/lib/esm/model.d.ts
CHANGED
@@ -16,6 +16,7 @@ export type { BingGeocoder, BingGeocoderCreate, BingGeocoderUpdate } from './res
|
|
16
16
|
export type { BraintreeGateway, BraintreeGatewayCreate, BraintreeGatewayUpdate } from './resources/braintree_gateways';
|
17
17
|
export type { BraintreePayment, BraintreePaymentCreate, BraintreePaymentUpdate } from './resources/braintree_payments';
|
18
18
|
export type { Bundle, BundleCreate, BundleUpdate } from './resources/bundles';
|
19
|
+
export type { BuyXPayYPromotion, BuyXPayYPromotionCreate, BuyXPayYPromotionUpdate } from './resources/buy_x_pay_y_promotions';
|
19
20
|
export type { Capture, CaptureUpdate } from './resources/captures';
|
20
21
|
export type { CarrierAccount } from './resources/carrier_accounts';
|
21
22
|
export type { CheckoutComGateway, CheckoutComGatewayCreate, CheckoutComGatewayUpdate } from './resources/checkout_com_gateways';
|
@@ -24,6 +25,7 @@ export type { Cleanup, CleanupCreate } from './resources/cleanups';
|
|
24
25
|
export type { CouponCodesPromotionRule, CouponCodesPromotionRuleCreate, CouponCodesPromotionRuleUpdate } from './resources/coupon_codes_promotion_rules';
|
25
26
|
export type { CouponRecipient, CouponRecipientCreate, CouponRecipientUpdate } from './resources/coupon_recipients';
|
26
27
|
export type { Coupon, CouponCreate, CouponUpdate } from './resources/coupons';
|
28
|
+
export type { CustomPromotionRule, CustomPromotionRuleCreate, CustomPromotionRuleUpdate } from './resources/custom_promotion_rules';
|
27
29
|
export type { CustomerAddress, CustomerAddressCreate, CustomerAddressUpdate } from './resources/customer_addresses';
|
28
30
|
export type { CustomerGroup, CustomerGroupCreate, CustomerGroupUpdate } from './resources/customer_groups';
|
29
31
|
export type { CustomerPasswordReset, CustomerPasswordResetCreate, CustomerPasswordResetUpdate } from './resources/customer_password_resets';
|
@@ -72,6 +74,7 @@ export type { ParcelLineItem, ParcelLineItemCreate, ParcelLineItemUpdate } from
|
|
72
74
|
export type { Parcel, ParcelCreate, ParcelUpdate } from './resources/parcels';
|
73
75
|
export type { PaymentGateway } from './resources/payment_gateways';
|
74
76
|
export type { PaymentMethod, PaymentMethodCreate, PaymentMethodUpdate } from './resources/payment_methods';
|
77
|
+
export type { PaymentOption, PaymentOptionCreate, PaymentOptionUpdate } from './resources/payment_options';
|
75
78
|
export type { PaypalGateway, PaypalGatewayCreate, PaypalGatewayUpdate } from './resources/paypal_gateways';
|
76
79
|
export type { PaypalPayment, PaypalPaymentCreate, PaypalPaymentUpdate } from './resources/paypal_payments';
|
77
80
|
export type { PercentageDiscountPromotion, PercentageDiscountPromotionCreate, PercentageDiscountPromotionUpdate } from './resources/percentage_discount_promotions';
|
@@ -89,7 +92,7 @@ export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from
|
|
89
92
|
export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
|
90
93
|
export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
|
91
94
|
export type { SatispayPayment, SatispayPaymentCreate, SatispayPaymentUpdate } from './resources/satispay_payments';
|
92
|
-
export type { Shipment, ShipmentUpdate } from './resources/shipments';
|
95
|
+
export type { Shipment, ShipmentCreate, ShipmentUpdate } from './resources/shipments';
|
93
96
|
export type { ShippingCategory, ShippingCategoryCreate, ShippingCategoryUpdate } from './resources/shipping_categories';
|
94
97
|
export type { ShippingMethodTier } from './resources/shipping_method_tiers';
|
95
98
|
export type { ShippingMethod, ShippingMethodCreate, ShippingMethodUpdate } from './resources/shipping_methods';
|
@@ -101,9 +104,9 @@ export type { SkuList, SkuListCreate, SkuListUpdate } from './resources/sku_list
|
|
101
104
|
export type { SkuOption, SkuOptionCreate, SkuOptionUpdate } from './resources/sku_options';
|
102
105
|
export type { Sku, SkuCreate, SkuUpdate } from './resources/skus';
|
103
106
|
export type { StockItem, StockItemCreate, StockItemUpdate } from './resources/stock_items';
|
104
|
-
export type { StockLineItem } from './resources/stock_line_items';
|
107
|
+
export type { StockLineItem, StockLineItemCreate, StockLineItemUpdate } from './resources/stock_line_items';
|
105
108
|
export type { StockLocation, StockLocationCreate, StockLocationUpdate } from './resources/stock_locations';
|
106
|
-
export type { StockReservation } from './resources/stock_reservations';
|
109
|
+
export type { StockReservation, StockReservationCreate, StockReservationUpdate } from './resources/stock_reservations';
|
107
110
|
export type { StockTransfer, StockTransferCreate, StockTransferUpdate } from './resources/stock_transfers';
|
108
111
|
export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate } from './resources/stripe_gateways';
|
109
112
|
export type { StripePayment, StripePaymentCreate, StripePaymentUpdate } from './resources/stripe_payments';
|
package/lib/esm/resource.d.ts
CHANGED
@@ -70,6 +70,7 @@ declare abstract class ApiResourceBase<R extends Resource> {
|
|
70
70
|
constructor(adapter: ResourceAdapter);
|
71
71
|
abstract relationship(id: string | ResourceId | null): ResourceRel;
|
72
72
|
abstract type(): ResourceTypeLock;
|
73
|
+
parse(resource: any): R | R[];
|
73
74
|
update(resource: ResourceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
|
74
75
|
}
|
75
76
|
declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
|
package/lib/esm/resource.js
CHANGED
@@ -15,6 +15,7 @@ import { denormalize, normalize } from './jsonapi';
|
|
15
15
|
import { generateQueryStringParams, isParamsList } from './query';
|
16
16
|
import config from './config';
|
17
17
|
import Debug from './debug';
|
18
|
+
import { ErrorType, SdkError } from './error';
|
18
19
|
const debug = Debug('resource');
|
19
20
|
class ListResponse extends Array {
|
20
21
|
constructor(meta, data) {
|
@@ -142,6 +143,21 @@ class ApiResourceBase {
|
|
142
143
|
debug('new resource instance: %s', this.type());
|
143
144
|
this.resources = adapter;
|
144
145
|
}
|
146
|
+
parse(resource) {
|
147
|
+
var _a, _b;
|
148
|
+
try {
|
149
|
+
const res = JSON.parse(resource);
|
150
|
+
if (((_a = res.data) === null || _a === void 0 ? void 0 : _a.type) !== this.type())
|
151
|
+
throw new SdkError({ message: `Invalid resource type [${(_b = res.data) === null || _b === void 0 ? void 0 : _b.type}]`, type: ErrorType.PARSE });
|
152
|
+
return denormalize(res);
|
153
|
+
}
|
154
|
+
catch (error) {
|
155
|
+
if (SdkError.isSdkError(error))
|
156
|
+
throw error;
|
157
|
+
else
|
158
|
+
throw new SdkError({ message: `Payload parse error [${error.message}]`, type: ErrorType.PARSE });
|
159
|
+
}
|
160
|
+
}
|
145
161
|
// reference, reference_origin and metadata attributes are always updatable
|
146
162
|
async update(resource, params, options) {
|
147
163
|
return this.resources.update({ ...resource, type: this.type() }, params, options);
|
@@ -16,6 +16,8 @@ interface AxervePayment extends Resource {
|
|
16
16
|
login: string;
|
17
17
|
return_url: string;
|
18
18
|
payment_request_data?: Record<string, any> | null;
|
19
|
+
client_ip?: string | null;
|
20
|
+
buyer_details?: Record<string, any> | null;
|
19
21
|
mismatched_amounts?: boolean | null;
|
20
22
|
intent_amount_cents: number;
|
21
23
|
intent_amount_float?: number | null;
|
@@ -27,6 +29,8 @@ interface AxervePayment extends Resource {
|
|
27
29
|
}
|
28
30
|
interface AxervePaymentCreate extends ResourceCreate {
|
29
31
|
return_url: string;
|
32
|
+
client_ip?: string | null;
|
33
|
+
buyer_details?: Record<string, any> | null;
|
30
34
|
order: OrderRel;
|
31
35
|
}
|
32
36
|
interface AxervePaymentUpdate extends ResourceUpdate {
|