@commercelayer/sdk 5.24.0 → 5.26.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 +1 -0
- package/lib/cjs/api.js +7 -1
- package/lib/cjs/commercelayer.d.ts +4 -2
- package/lib/cjs/commercelayer.js +7 -1
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +4 -2
- package/lib/cjs/resources/external_promotions.d.ts +4 -2
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +4 -2
- package/lib/cjs/resources/fixed_price_promotions.d.ts +4 -2
- package/lib/cjs/resources/free_gift_promotions.d.ts +4 -2
- package/lib/cjs/resources/free_shipping_promotions.d.ts +4 -2
- package/lib/cjs/resources/markets.d.ts +2 -0
- package/lib/cjs/resources/payment_methods.d.ts +2 -0
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +4 -2
- package/lib/cjs/resources/promotions.d.ts +1 -1
- package/lib/cjs/resources/shipping_methods.d.ts +2 -0
- package/lib/cjs/resources/webhooks.d.ts +2 -0
- package/lib/cjs/static.d.ts +3 -0
- package/lib/cjs/static.js +6 -0
- package/lib/esm/api.d.ts +1 -0
- package/lib/esm/api.js +6 -0
- package/lib/esm/commercelayer.d.ts +4 -2
- package/lib/esm/commercelayer.js +7 -1
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +4 -2
- package/lib/esm/resources/external_promotions.d.ts +4 -2
- package/lib/esm/resources/fixed_amount_promotions.d.ts +4 -2
- package/lib/esm/resources/fixed_price_promotions.d.ts +4 -2
- package/lib/esm/resources/free_gift_promotions.d.ts +4 -2
- package/lib/esm/resources/free_shipping_promotions.d.ts +4 -2
- package/lib/esm/resources/markets.d.ts +2 -0
- package/lib/esm/resources/payment_methods.d.ts +2 -0
- package/lib/esm/resources/percentage_discount_promotions.d.ts +4 -2
- package/lib/esm/resources/promotions.d.ts +1 -1
- package/lib/esm/resources/shipping_methods.d.ts +2 -0
- package/lib/esm/resources/webhooks.d.ts +2 -0
- package/lib/esm/static.d.ts +3 -0
- package/lib/esm/static.js +6 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
package/lib/cjs/api.d.ts
CHANGED
@@ -126,6 +126,7 @@ export { default as Webhooks } from './resources/webhooks';
|
|
126
126
|
export { default as WireTransfers } from './resources/wire_transfers';
|
127
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
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"];
|
129
|
+
export declare const singletonList: readonly ["application", "organization"];
|
129
130
|
export type RetrievableResourceType = ResourceTypeLock;
|
130
131
|
export type RetrievableResource = Resource & {
|
131
132
|
type: RetrievableResourceType;
|
package/lib/cjs/api.js
CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.InventoryModels = exports.InStockSubscriptions = exports.Imports = exports.GoogleGeocoders = exports.GiftCards = exports.GiftCardRecipients = exports.Geocoders = exports.FreeShippingPromotions = exports.FreeGiftPromotions = exports.FixedPricePromotions = exports.FixedAmountPromotions = exports.ExternalTaxCalculators = exports.ExternalPromotions = exports.ExternalPayments = exports.ExternalGateways = exports.Exports = exports.Events = exports.EventCallbacks = exports.DeliveryLeadTimes = exports.Customers = exports.CustomerSubscriptions = exports.CustomerPaymentSources = exports.CustomerPasswordResets = exports.CustomerGroups = exports.CustomerAddresses = exports.CustomPromotionRules = exports.Coupons = exports.CouponRecipients = exports.CouponCodesPromotionRules = exports.Cleanups = exports.CheckoutComPayments = exports.CheckoutComGateways = exports.CarrierAccounts = exports.Captures = exports.BuyXPayYPromotions = exports.Bundles = exports.BraintreePayments = exports.BraintreeGateways = exports.BingGeocoders = exports.BillingInfoValidationRules = exports.AxervePayments = exports.AxerveGateways = exports.AvalaraAccounts = exports.Authorizations = exports.Attachments = exports.Applications = exports.AdyenPayments = exports.AdyenGateways = exports.Adjustments = exports.Addresses = void 0;
|
7
7
|
exports.SkuLists = exports.SkuListPromotionRules = exports.SkuListItems = exports.ShippingZones = exports.ShippingWeightTiers = exports.ShippingMethods = exports.ShippingMethodTiers = exports.ShippingCategories = exports.Shipments = exports.SatispayPayments = exports.SatispayGateways = exports.Returns = exports.ReturnLineItems = exports.ReservedStocks = exports.Refunds = exports.RecurringOrderCopies = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceVolumeTiers = exports.PriceTiers = exports.PriceLists = exports.PriceFrequencyTiers = exports.PercentageDiscountPromotions = exports.PaypalPayments = exports.PaypalGateways = exports.PaymentOptions = exports.PaymentMethods = exports.PaymentGateways = exports.Parcels = exports.ParcelLineItems = exports.Packages = exports.Organizations = exports.Orders = exports.OrderValidationRules = exports.OrderSubscriptions = exports.OrderSubscriptionItems = exports.OrderFactories = exports.OrderCopies = exports.OrderAmountPromotionRules = exports.Merchants = exports.Markets = exports.ManualTaxCalculators = exports.ManualGateways = exports.LineItems = exports.LineItemOptions = exports.KlarnaPayments = exports.KlarnaGateways = exports.InventoryStockLocations = exports.InventoryReturnLocations = void 0;
|
8
|
-
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = void 0;
|
8
|
+
exports.singletonList = exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Versions = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = exports.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = void 0;
|
9
9
|
// ##__API_RESOURCES_START__##
|
10
10
|
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
11
11
|
/**
|
@@ -376,3 +376,9 @@ exports.resourceList = [
|
|
376
376
|
'wire_transfers'
|
377
377
|
// ##__API_RESOURCE_LIST_STOP__##
|
378
378
|
];
|
379
|
+
exports.singletonList = [
|
380
|
+
// ##__API_RESOURCE_SINGLETON_START__##
|
381
|
+
'application',
|
382
|
+
'organization'
|
383
|
+
// ##__API_RESOURCE_SINGLETON_STOP__##
|
384
|
+
];
|
@@ -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.22.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.22.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
@@ -135,6 +135,8 @@ declare class CommerceLayerClient {
|
|
135
135
|
private localConfig;
|
136
136
|
config(config: CommerceLayerConfig): CommerceLayerClient;
|
137
137
|
resources(): readonly string[];
|
138
|
+
singletons(): readonly string[];
|
139
|
+
isSingleton(resource: api.ResourceTypeLock): boolean;
|
138
140
|
isApiError(error: any): error is ApiError;
|
139
141
|
addRequestInterceptor(onFulfilled?: RequestInterceptor, onRejected?: ErrorInterceptor): number;
|
140
142
|
addResponseInterceptor(onFulfilled?: ResponseInterceptor, onRejected?: ErrorInterceptor): number;
|
package/lib/cjs/commercelayer.js
CHANGED
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
|
|
45
45
|
const debug_1 = __importDefault(require("./debug"));
|
46
46
|
const debug = (0, debug_1.default)('commercelayer');
|
47
47
|
// Autogenerated schema version number, do not remove this line
|
48
|
-
const OPEN_API_SCHEMA_VERSION = '4.
|
48
|
+
const OPEN_API_SCHEMA_VERSION = '4.22.0';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -203,6 +203,12 @@ class CommerceLayerClient {
|
|
203
203
|
resources() {
|
204
204
|
return static_1.CommerceLayerStatic.resources();
|
205
205
|
}
|
206
|
+
singletons() {
|
207
|
+
return static_1.CommerceLayerStatic.singletons();
|
208
|
+
}
|
209
|
+
isSingleton(resource) {
|
210
|
+
return static_1.CommerceLayerStatic.isSingleton(resource);
|
211
|
+
}
|
206
212
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
207
213
|
isApiError(error) {
|
208
214
|
return static_1.CommerceLayerStatic.isApiError(error);
|
@@ -49,7 +49,7 @@ interface BuyXPayYPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -76,7 +76,9 @@ interface BuyXPayYPromotionCreate extends ResourceCreate {
|
|
76
76
|
priority?: number | null;
|
77
77
|
starts_at: string;
|
78
78
|
expires_at: string;
|
79
|
-
total_usage_limit
|
79
|
+
total_usage_limit?: number | null;
|
80
|
+
_disable?: boolean | null;
|
81
|
+
_enable?: boolean | null;
|
80
82
|
x: number;
|
81
83
|
y: number;
|
82
84
|
cheapest_free?: boolean | null;
|
@@ -49,7 +49,7 @@ interface ExternalPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -75,7 +75,9 @@ interface ExternalPromotionCreate extends ResourceCreate {
|
|
75
75
|
priority?: number | null;
|
76
76
|
starts_at: string;
|
77
77
|
expires_at: string;
|
78
|
-
total_usage_limit
|
78
|
+
total_usage_limit?: number | null;
|
79
|
+
_disable?: boolean | null;
|
80
|
+
_enable?: boolean | null;
|
79
81
|
promotion_url: string;
|
80
82
|
market?: MarketRel | null;
|
81
83
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -49,7 +49,7 @@ interface FixedAmountPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -76,7 +76,9 @@ interface FixedAmountPromotionCreate extends ResourceCreate {
|
|
76
76
|
priority?: number | null;
|
77
77
|
starts_at: string;
|
78
78
|
expires_at: string;
|
79
|
-
total_usage_limit
|
79
|
+
total_usage_limit?: number | null;
|
80
|
+
_disable?: boolean | null;
|
81
|
+
_enable?: boolean | null;
|
80
82
|
fixed_amount_cents: number;
|
81
83
|
market?: MarketRel | null;
|
82
84
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -49,7 +49,7 @@ interface FixedPricePromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -76,7 +76,9 @@ interface FixedPricePromotionCreate extends ResourceCreate {
|
|
76
76
|
priority?: number | null;
|
77
77
|
starts_at: string;
|
78
78
|
expires_at: string;
|
79
|
-
total_usage_limit
|
79
|
+
total_usage_limit?: number | null;
|
80
|
+
_disable?: boolean | null;
|
81
|
+
_enable?: boolean | null;
|
80
82
|
fixed_amount_cents: number;
|
81
83
|
market?: MarketRel | null;
|
82
84
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -49,7 +49,7 @@ interface FreeGiftPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -74,7 +74,9 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
|
|
74
74
|
priority?: number | null;
|
75
75
|
starts_at: string;
|
76
76
|
expires_at: string;
|
77
|
-
total_usage_limit
|
77
|
+
total_usage_limit?: number | null;
|
78
|
+
_disable?: boolean | null;
|
79
|
+
_enable?: boolean | null;
|
78
80
|
max_quantity?: number | null;
|
79
81
|
market?: MarketRel | null;
|
80
82
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -45,7 +45,7 @@ interface FreeShippingPromotion extends Resource {
|
|
45
45
|
priority?: number | null;
|
46
46
|
starts_at: string;
|
47
47
|
expires_at: string;
|
48
|
-
total_usage_limit
|
48
|
+
total_usage_limit?: number | null;
|
49
49
|
total_usage_count?: number | null;
|
50
50
|
active?: boolean | null;
|
51
51
|
disabled_at?: string | null;
|
@@ -68,7 +68,9 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
|
|
68
68
|
priority?: number | null;
|
69
69
|
starts_at: string;
|
70
70
|
expires_at: string;
|
71
|
-
total_usage_limit
|
71
|
+
total_usage_limit?: number | null;
|
72
|
+
_disable?: boolean | null;
|
73
|
+
_enable?: boolean | null;
|
72
74
|
market?: MarketRel | null;
|
73
75
|
promotion_rules?: PromotionRuleRel[] | null;
|
74
76
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
@@ -57,6 +57,8 @@ interface MarketCreate extends ResourceCreate {
|
|
57
57
|
checkout_url?: string | null;
|
58
58
|
external_prices_url?: string | null;
|
59
59
|
external_order_validation_url?: string | null;
|
60
|
+
_disable?: boolean | null;
|
61
|
+
_enable?: boolean | null;
|
60
62
|
merchant: MerchantRel;
|
61
63
|
price_list: PriceListRel;
|
62
64
|
inventory_model: InventoryModelRel;
|
@@ -41,6 +41,8 @@ interface PaymentMethodCreate extends ResourceCreate {
|
|
41
41
|
moto?: boolean | null;
|
42
42
|
require_capture?: boolean | null;
|
43
43
|
auto_capture?: boolean | null;
|
44
|
+
_disable?: boolean | null;
|
45
|
+
_enable?: boolean | null;
|
44
46
|
price_amount_cents: number;
|
45
47
|
auto_capture_max_amount_cents?: number | null;
|
46
48
|
market?: MarketRel | null;
|
@@ -49,7 +49,7 @@ interface PercentageDiscountPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -74,7 +74,9 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
|
74
74
|
priority?: number | null;
|
75
75
|
starts_at: string;
|
76
76
|
expires_at: string;
|
77
|
-
total_usage_limit
|
77
|
+
total_usage_limit?: number | null;
|
78
|
+
_disable?: boolean | null;
|
79
|
+
_enable?: boolean | null;
|
78
80
|
percentage: number;
|
79
81
|
market?: MarketRel | null;
|
80
82
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -24,7 +24,7 @@ interface Promotion extends Resource {
|
|
24
24
|
priority?: number | null;
|
25
25
|
starts_at: string;
|
26
26
|
expires_at: string;
|
27
|
-
total_usage_limit
|
27
|
+
total_usage_limit?: number | null;
|
28
28
|
total_usage_count?: number | null;
|
29
29
|
active?: boolean | null;
|
30
30
|
disabled_at?: string | null;
|
@@ -64,6 +64,8 @@ interface ShippingMethodCreate extends ResourceCreate {
|
|
64
64
|
scheme?: string | null;
|
65
65
|
currency_code?: string | null;
|
66
66
|
external_prices_url?: string | null;
|
67
|
+
_disable?: boolean | null;
|
68
|
+
_enable?: boolean | null;
|
67
69
|
price_amount_cents: number;
|
68
70
|
free_over_amount_cents?: number | null;
|
69
71
|
use_subtotal?: boolean | null;
|
@@ -25,6 +25,8 @@ interface WebhookCreate extends ResourceCreate {
|
|
25
25
|
topic: string;
|
26
26
|
callback_url: string;
|
27
27
|
include_resources?: string[] | null;
|
28
|
+
_disable?: boolean | null;
|
29
|
+
_enable?: boolean | null;
|
28
30
|
}
|
29
31
|
interface WebhookUpdate extends ResourceUpdate {
|
30
32
|
name?: string | null;
|
package/lib/cjs/static.d.ts
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
import * as api from './api';
|
1
2
|
import { SdkError, ApiError } from './error';
|
2
3
|
import type { CommerceLayerClient, CommerceLayerInitConfig } from './commercelayer';
|
3
4
|
export declare const CommerceLayerStatic: {
|
4
5
|
resources: (sort?: boolean) => readonly string[];
|
6
|
+
singletons: (sort?: boolean) => readonly string[];
|
7
|
+
isSingleton: (resource: api.ResourceTypeLock) => boolean;
|
5
8
|
isSdkError: (error: unknown) => error is SdkError;
|
6
9
|
isApiError: (error: unknown) => error is ApiError;
|
7
10
|
init: (config: CommerceLayerInitConfig) => CommerceLayerClient;
|
package/lib/cjs/static.js
CHANGED
@@ -32,6 +32,12 @@ exports.CommerceLayerStatic = {
|
|
32
32
|
resources: (sort) => {
|
33
33
|
return sort ? [...api.resourceList].sort() : api.resourceList;
|
34
34
|
},
|
35
|
+
singletons: (sort) => {
|
36
|
+
return sort ? [...api.singletonList].sort() : api.singletonList;
|
37
|
+
},
|
38
|
+
isSingleton: (resource) => {
|
39
|
+
return api.singletonList.includes(resource);
|
40
|
+
},
|
35
41
|
isSdkError: (error) => {
|
36
42
|
return error_1.SdkError.isSdkError(error);
|
37
43
|
},
|
package/lib/esm/api.d.ts
CHANGED
@@ -126,6 +126,7 @@ export { default as Webhooks } from './resources/webhooks';
|
|
126
126
|
export { default as WireTransfers } from './resources/wire_transfers';
|
127
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
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"];
|
129
|
+
export declare const singletonList: readonly ["application", "organization"];
|
129
130
|
export type RetrievableResourceType = ResourceTypeLock;
|
130
131
|
export type RetrievableResource = Resource & {
|
131
132
|
type: RetrievableResourceType;
|
package/lib/esm/api.js
CHANGED
@@ -248,3 +248,9 @@ export const resourceList = [
|
|
248
248
|
'wire_transfers'
|
249
249
|
// ##__API_RESOURCE_LIST_STOP__##
|
250
250
|
];
|
251
|
+
export const singletonList = [
|
252
|
+
// ##__API_RESOURCE_SINGLETON_START__##
|
253
|
+
'application',
|
254
|
+
'organization'
|
255
|
+
// ##__API_RESOURCE_SINGLETON_STOP__##
|
256
|
+
];
|
@@ -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.22.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.22.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
@@ -135,6 +135,8 @@ declare class CommerceLayerClient {
|
|
135
135
|
private localConfig;
|
136
136
|
config(config: CommerceLayerConfig): CommerceLayerClient;
|
137
137
|
resources(): readonly string[];
|
138
|
+
singletons(): readonly string[];
|
139
|
+
isSingleton(resource: api.ResourceTypeLock): boolean;
|
138
140
|
isApiError(error: any): error is ApiError;
|
139
141
|
addRequestInterceptor(onFulfilled?: RequestInterceptor, onRejected?: ErrorInterceptor): number;
|
140
142
|
addResponseInterceptor(onFulfilled?: ResponseInterceptor, onRejected?: ErrorInterceptor): number;
|
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.22.0';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -174,6 +174,12 @@ class CommerceLayerClient {
|
|
174
174
|
resources() {
|
175
175
|
return CommerceLayerStatic.resources();
|
176
176
|
}
|
177
|
+
singletons() {
|
178
|
+
return CommerceLayerStatic.singletons();
|
179
|
+
}
|
180
|
+
isSingleton(resource) {
|
181
|
+
return CommerceLayerStatic.isSingleton(resource);
|
182
|
+
}
|
177
183
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
178
184
|
isApiError(error) {
|
179
185
|
return CommerceLayerStatic.isApiError(error);
|
@@ -49,7 +49,7 @@ interface BuyXPayYPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -76,7 +76,9 @@ interface BuyXPayYPromotionCreate extends ResourceCreate {
|
|
76
76
|
priority?: number | null;
|
77
77
|
starts_at: string;
|
78
78
|
expires_at: string;
|
79
|
-
total_usage_limit
|
79
|
+
total_usage_limit?: number | null;
|
80
|
+
_disable?: boolean | null;
|
81
|
+
_enable?: boolean | null;
|
80
82
|
x: number;
|
81
83
|
y: number;
|
82
84
|
cheapest_free?: boolean | null;
|
@@ -49,7 +49,7 @@ interface ExternalPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -75,7 +75,9 @@ interface ExternalPromotionCreate extends ResourceCreate {
|
|
75
75
|
priority?: number | null;
|
76
76
|
starts_at: string;
|
77
77
|
expires_at: string;
|
78
|
-
total_usage_limit
|
78
|
+
total_usage_limit?: number | null;
|
79
|
+
_disable?: boolean | null;
|
80
|
+
_enable?: boolean | null;
|
79
81
|
promotion_url: string;
|
80
82
|
market?: MarketRel | null;
|
81
83
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -49,7 +49,7 @@ interface FixedAmountPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -76,7 +76,9 @@ interface FixedAmountPromotionCreate extends ResourceCreate {
|
|
76
76
|
priority?: number | null;
|
77
77
|
starts_at: string;
|
78
78
|
expires_at: string;
|
79
|
-
total_usage_limit
|
79
|
+
total_usage_limit?: number | null;
|
80
|
+
_disable?: boolean | null;
|
81
|
+
_enable?: boolean | null;
|
80
82
|
fixed_amount_cents: number;
|
81
83
|
market?: MarketRel | null;
|
82
84
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -49,7 +49,7 @@ interface FixedPricePromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -76,7 +76,9 @@ interface FixedPricePromotionCreate extends ResourceCreate {
|
|
76
76
|
priority?: number | null;
|
77
77
|
starts_at: string;
|
78
78
|
expires_at: string;
|
79
|
-
total_usage_limit
|
79
|
+
total_usage_limit?: number | null;
|
80
|
+
_disable?: boolean | null;
|
81
|
+
_enable?: boolean | null;
|
80
82
|
fixed_amount_cents: number;
|
81
83
|
market?: MarketRel | null;
|
82
84
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -49,7 +49,7 @@ interface FreeGiftPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -74,7 +74,9 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
|
|
74
74
|
priority?: number | null;
|
75
75
|
starts_at: string;
|
76
76
|
expires_at: string;
|
77
|
-
total_usage_limit
|
77
|
+
total_usage_limit?: number | null;
|
78
|
+
_disable?: boolean | null;
|
79
|
+
_enable?: boolean | null;
|
78
80
|
max_quantity?: number | null;
|
79
81
|
market?: MarketRel | null;
|
80
82
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -45,7 +45,7 @@ interface FreeShippingPromotion extends Resource {
|
|
45
45
|
priority?: number | null;
|
46
46
|
starts_at: string;
|
47
47
|
expires_at: string;
|
48
|
-
total_usage_limit
|
48
|
+
total_usage_limit?: number | null;
|
49
49
|
total_usage_count?: number | null;
|
50
50
|
active?: boolean | null;
|
51
51
|
disabled_at?: string | null;
|
@@ -68,7 +68,9 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
|
|
68
68
|
priority?: number | null;
|
69
69
|
starts_at: string;
|
70
70
|
expires_at: string;
|
71
|
-
total_usage_limit
|
71
|
+
total_usage_limit?: number | null;
|
72
|
+
_disable?: boolean | null;
|
73
|
+
_enable?: boolean | null;
|
72
74
|
market?: MarketRel | null;
|
73
75
|
promotion_rules?: PromotionRuleRel[] | null;
|
74
76
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
@@ -57,6 +57,8 @@ interface MarketCreate extends ResourceCreate {
|
|
57
57
|
checkout_url?: string | null;
|
58
58
|
external_prices_url?: string | null;
|
59
59
|
external_order_validation_url?: string | null;
|
60
|
+
_disable?: boolean | null;
|
61
|
+
_enable?: boolean | null;
|
60
62
|
merchant: MerchantRel;
|
61
63
|
price_list: PriceListRel;
|
62
64
|
inventory_model: InventoryModelRel;
|
@@ -41,6 +41,8 @@ interface PaymentMethodCreate extends ResourceCreate {
|
|
41
41
|
moto?: boolean | null;
|
42
42
|
require_capture?: boolean | null;
|
43
43
|
auto_capture?: boolean | null;
|
44
|
+
_disable?: boolean | null;
|
45
|
+
_enable?: boolean | null;
|
44
46
|
price_amount_cents: number;
|
45
47
|
auto_capture_max_amount_cents?: number | null;
|
46
48
|
market?: MarketRel | null;
|
@@ -49,7 +49,7 @@ interface PercentageDiscountPromotion extends Resource {
|
|
49
49
|
priority?: number | null;
|
50
50
|
starts_at: string;
|
51
51
|
expires_at: string;
|
52
|
-
total_usage_limit
|
52
|
+
total_usage_limit?: number | null;
|
53
53
|
total_usage_count?: number | null;
|
54
54
|
active?: boolean | null;
|
55
55
|
disabled_at?: string | null;
|
@@ -74,7 +74,9 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
|
74
74
|
priority?: number | null;
|
75
75
|
starts_at: string;
|
76
76
|
expires_at: string;
|
77
|
-
total_usage_limit
|
77
|
+
total_usage_limit?: number | null;
|
78
|
+
_disable?: boolean | null;
|
79
|
+
_enable?: boolean | null;
|
78
80
|
percentage: number;
|
79
81
|
market?: MarketRel | null;
|
80
82
|
promotion_rules?: PromotionRuleRel[] | null;
|
@@ -24,7 +24,7 @@ interface Promotion extends Resource {
|
|
24
24
|
priority?: number | null;
|
25
25
|
starts_at: string;
|
26
26
|
expires_at: string;
|
27
|
-
total_usage_limit
|
27
|
+
total_usage_limit?: number | null;
|
28
28
|
total_usage_count?: number | null;
|
29
29
|
active?: boolean | null;
|
30
30
|
disabled_at?: string | null;
|
@@ -64,6 +64,8 @@ interface ShippingMethodCreate extends ResourceCreate {
|
|
64
64
|
scheme?: string | null;
|
65
65
|
currency_code?: string | null;
|
66
66
|
external_prices_url?: string | null;
|
67
|
+
_disable?: boolean | null;
|
68
|
+
_enable?: boolean | null;
|
67
69
|
price_amount_cents: number;
|
68
70
|
free_over_amount_cents?: number | null;
|
69
71
|
use_subtotal?: boolean | null;
|
@@ -25,6 +25,8 @@ interface WebhookCreate extends ResourceCreate {
|
|
25
25
|
topic: string;
|
26
26
|
callback_url: string;
|
27
27
|
include_resources?: string[] | null;
|
28
|
+
_disable?: boolean | null;
|
29
|
+
_enable?: boolean | null;
|
28
30
|
}
|
29
31
|
interface WebhookUpdate extends ResourceUpdate {
|
30
32
|
name?: string | null;
|
package/lib/esm/static.d.ts
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
import * as api from './api';
|
1
2
|
import { SdkError, ApiError } from './error';
|
2
3
|
import type { CommerceLayerClient, CommerceLayerInitConfig } from './commercelayer';
|
3
4
|
export declare const CommerceLayerStatic: {
|
4
5
|
resources: (sort?: boolean) => readonly string[];
|
6
|
+
singletons: (sort?: boolean) => readonly string[];
|
7
|
+
isSingleton: (resource: api.ResourceTypeLock) => boolean;
|
5
8
|
isSdkError: (error: unknown) => error is SdkError;
|
6
9
|
isApiError: (error: unknown) => error is ApiError;
|
7
10
|
init: (config: CommerceLayerInitConfig) => CommerceLayerClient;
|
package/lib/esm/static.js
CHANGED
@@ -6,6 +6,12 @@ export const CommerceLayerStatic = {
|
|
6
6
|
resources: (sort) => {
|
7
7
|
return sort ? [...api.resourceList].sort() : api.resourceList;
|
8
8
|
},
|
9
|
+
singletons: (sort) => {
|
10
|
+
return sort ? [...api.singletonList].sort() : api.singletonList;
|
11
|
+
},
|
12
|
+
isSingleton: (resource) => {
|
13
|
+
return api.singletonList.includes(resource);
|
14
|
+
},
|
9
15
|
isSdkError: (error) => {
|
10
16
|
return SdkError.isSdkError(error);
|
11
17
|
},
|