@commercelayer/sdk 5.2.3 → 5.4.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 +3 -2
- package/lib/cjs/api.js +4 -1
- package/lib/cjs/commercelayer.d.ts +3 -2
- package/lib/cjs/commercelayer.js +2 -1
- package/lib/cjs/error.js +1 -2
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/resources/coupons.d.ts +8 -0
- package/lib/cjs/resources/coupons.js +4 -0
- package/lib/cjs/resources/inventory_models.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +5 -0
- package/lib/cjs/resources/line_items.js +4 -0
- package/lib/cjs/resources/stock_items.d.ts +3 -0
- package/lib/cjs/resources/stock_items.js +4 -0
- package/lib/cjs/resources/stock_reservations.d.ts +27 -0
- package/lib/cjs/resources/stock_reservations.js +24 -0
- package/lib/esm/api.d.ts +3 -2
- package/lib/esm/api.js +2 -0
- package/lib/esm/commercelayer.d.ts +3 -2
- package/lib/esm/commercelayer.js +2 -1
- package/lib/esm/model.d.ts +1 -0
- package/lib/esm/resources/coupons.d.ts +8 -0
- package/lib/esm/resources/coupons.js +4 -0
- package/lib/esm/resources/inventory_models.d.ts +3 -0
- package/lib/esm/resources/line_items.d.ts +5 -0
- package/lib/esm/resources/line_items.js +4 -0
- package/lib/esm/resources/stock_items.d.ts +3 -0
- package/lib/esm/resources/stock_items.js +4 -0
- package/lib/esm/resources/stock_reservations.d.ts +27 -0
- package/lib/esm/resources/stock_reservations.js +22 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
package/lib/cjs/api.d.ts
CHANGED
@@ -102,6 +102,7 @@ export { default as Skus } from './resources/skus';
|
|
102
102
|
export { default as StockItems } from './resources/stock_items';
|
103
103
|
export { default as StockLineItems } from './resources/stock_line_items';
|
104
104
|
export { default as StockLocations } from './resources/stock_locations';
|
105
|
+
export { default as StockReservations } from './resources/stock_reservations';
|
105
106
|
export { default as StockTransfers } from './resources/stock_transfers';
|
106
107
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
107
108
|
export { default as StripePayments } from './resources/stripe_payments';
|
@@ -115,8 +116,8 @@ export { default as Transactions } from './resources/transactions';
|
|
115
116
|
export { default as Voids } from './resources/voids';
|
116
117
|
export { default as Webhooks } from './resources/webhooks';
|
117
118
|
export { default as WireTransfers } from './resources/wire_transfers';
|
118
|
-
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' | '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_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
119
|
-
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", "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_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
119
|
+
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' | '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' | 'voids' | 'webhooks' | 'wire_transfers';
|
120
|
+
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", "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", "voids", "webhooks", "wire_transfers"];
|
120
121
|
export type RetrievableResourceType = ResourceTypeLock;
|
121
122
|
export type RetrievableResource = {
|
122
123
|
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.InventoryStockLocations = exports.InventoryReturnLocations = 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.Coupons = exports.CouponRecipients = exports.CouponCodesPromotionRules = exports.Cleanups = exports.CheckoutComPayments = exports.CheckoutComGateways = exports.CarrierAccounts = exports.Captures = 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.StockLineItems = exports.StockItems = exports.Skus = exports.SkuOptions = 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.Refunds = exports.RecurringOrderCopies = exports.Promotions = exports.PromotionRules = exports.Prices = exports.PriceVolumeTiers = exports.PriceTiers = exports.PriceLists = exports.PriceFrequencyTiers = exports.PercentageDiscountPromotions = exports.PaypalPayments = exports.PaypalGateways = 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 = void 0;
|
8
|
-
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockLocations = void 0;
|
8
|
+
exports.resourceList = exports.WireTransfers = exports.Webhooks = exports.Voids = exports.Transactions = exports.TaxjarAccounts = exports.TaxRules = exports.TaxCategories = exports.TaxCalculators = exports.Tags = exports.SubscriptionModels = exports.StripePayments = exports.StripeGateways = exports.StockTransfers = exports.StockReservations = exports.StockLocations = void 0;
|
9
9
|
// ##__API_RESOURCES_START__##
|
10
10
|
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
11
11
|
/**
|
@@ -213,6 +213,8 @@ var stock_line_items_1 = require("./resources/stock_line_items");
|
|
213
213
|
Object.defineProperty(exports, "StockLineItems", { enumerable: true, get: function () { return __importDefault(stock_line_items_1).default; } });
|
214
214
|
var stock_locations_1 = require("./resources/stock_locations");
|
215
215
|
Object.defineProperty(exports, "StockLocations", { enumerable: true, get: function () { return __importDefault(stock_locations_1).default; } });
|
216
|
+
var stock_reservations_1 = require("./resources/stock_reservations");
|
217
|
+
Object.defineProperty(exports, "StockReservations", { enumerable: true, get: function () { return __importDefault(stock_reservations_1).default; } });
|
216
218
|
var stock_transfers_1 = require("./resources/stock_transfers");
|
217
219
|
Object.defineProperty(exports, "StockTransfers", { enumerable: true, get: function () { return __importDefault(stock_transfers_1).default; } });
|
218
220
|
var stripe_gateways_1 = require("./resources/stripe_gateways");
|
@@ -343,6 +345,7 @@ exports.resourceList = [
|
|
343
345
|
'stock_items',
|
344
346
|
'stock_line_items',
|
345
347
|
'stock_locations',
|
348
|
+
'stock_reservations',
|
346
349
|
'stock_transfers',
|
347
350
|
'stripe_gateways',
|
348
351
|
'stripe_payments',
|
@@ -2,7 +2,7 @@ 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.5.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = Record<string, unknown>;
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
12
|
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "4.
|
13
|
+
readonly openApiSchemaVersion = "4.5.0";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
@@ -112,6 +112,7 @@ declare class CommerceLayerClient {
|
|
112
112
|
stock_items: api.StockItems;
|
113
113
|
stock_line_items: api.StockLineItems;
|
114
114
|
stock_locations: api.StockLocations;
|
115
|
+
stock_reservations: api.StockReservations;
|
115
116
|
stock_transfers: api.StockTransfers;
|
116
117
|
stripe_gateways: api.StripeGateways;
|
117
118
|
stripe_payments: api.StripePayments;
|
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.5.0';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
@@ -160,6 +160,7 @@ class CommerceLayerClient {
|
|
160
160
|
this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
161
161
|
this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
162
162
|
this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
163
|
+
this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
163
164
|
this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
164
165
|
this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
165
166
|
this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
package/lib/cjs/error.js
CHANGED
@@ -8,8 +8,7 @@ var ErrorType;
|
|
8
8
|
ErrorType["RESPONSE"] = "response";
|
9
9
|
ErrorType["GENERIC"] = "generic";
|
10
10
|
ErrorType["CANCEL"] = "cancel";
|
11
|
-
})(ErrorType || (ErrorType = {}));
|
12
|
-
exports.ErrorType = ErrorType;
|
11
|
+
})(ErrorType || (exports.ErrorType = ErrorType = {}));
|
13
12
|
class SdkError extends Error {
|
14
13
|
static isSdkError(error) {
|
15
14
|
return error && [SdkError.NAME, ApiError.NAME].includes(error.name) && Object.values(ErrorType).includes(error.type);
|
package/lib/cjs/model.d.ts
CHANGED
@@ -102,6 +102,7 @@ export type { Sku, SkuCreate, SkuUpdate } from './resources/skus';
|
|
102
102
|
export type { StockItem, StockItemCreate, StockItemUpdate } from './resources/stock_items';
|
103
103
|
export type { StockLineItem } from './resources/stock_line_items';
|
104
104
|
export type { StockLocation, StockLocationCreate, StockLocationUpdate } from './resources/stock_locations';
|
105
|
+
export type { StockReservation } from './resources/stock_reservations';
|
105
106
|
export type { StockTransfer, StockTransferCreate, StockTransferUpdate } from './resources/stock_transfers';
|
106
107
|
export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate } from './resources/stripe_gateways';
|
107
108
|
export type { StripePayment, StripePaymentCreate, StripePaymentUpdate } from './resources/stripe_payments';
|
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
|
|
2
2
|
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
5
|
+
import type { CouponRecipient, CouponRecipientType } from './coupon_recipients';
|
5
6
|
import type { Event } from './events';
|
6
7
|
import type { Tag, TagType } from './tags';
|
7
8
|
type CouponType = 'coupons';
|
@@ -11,6 +12,9 @@ type CouponRel = ResourceRel & {
|
|
11
12
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
12
13
|
type: CouponCodesPromotionRuleType;
|
13
14
|
};
|
15
|
+
type CouponRecipientRel = ResourceRel & {
|
16
|
+
type: CouponRecipientType;
|
17
|
+
};
|
14
18
|
type TagRel = ResourceRel & {
|
15
19
|
type: TagType;
|
16
20
|
};
|
@@ -22,6 +26,7 @@ interface Coupon extends Resource {
|
|
22
26
|
usage_count?: number | null;
|
23
27
|
recipient_email?: string | null;
|
24
28
|
promotion_rule?: CouponCodesPromotionRule | null;
|
29
|
+
coupon_recipient?: CouponRecipient | null;
|
25
30
|
events?: Event[] | null;
|
26
31
|
tags?: Tag[] | null;
|
27
32
|
}
|
@@ -31,6 +36,7 @@ interface CouponCreate extends ResourceCreate {
|
|
31
36
|
usage_limit?: number | null;
|
32
37
|
recipient_email?: string | null;
|
33
38
|
promotion_rule: CouponCodesPromotionRuleRel;
|
39
|
+
coupon_recipient?: CouponRecipientRel | null;
|
34
40
|
tags?: TagRel[] | null;
|
35
41
|
}
|
36
42
|
interface CouponUpdate extends ResourceUpdate {
|
@@ -39,6 +45,7 @@ interface CouponUpdate extends ResourceUpdate {
|
|
39
45
|
usage_limit?: number | null;
|
40
46
|
recipient_email?: string | null;
|
41
47
|
promotion_rule?: CouponCodesPromotionRuleRel | null;
|
48
|
+
coupon_recipient?: CouponRecipientRel | null;
|
42
49
|
tags?: TagRel[] | null;
|
43
50
|
}
|
44
51
|
declare class Coupons extends ApiResource<Coupon> {
|
@@ -47,6 +54,7 @@ declare class Coupons extends ApiResource<Coupon> {
|
|
47
54
|
update(resource: CouponUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
48
55
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
49
56
|
promotion_rule(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
57
|
+
coupon_recipient(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
50
58
|
events(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
51
59
|
tags(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
52
60
|
isCoupon(resource: any): resource is Coupon;
|
@@ -15,6 +15,10 @@ class Coupons extends resource_1.ApiResource {
|
|
15
15
|
const _couponId = couponId.id || couponId;
|
16
16
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `coupons/${_couponId}/promotion_rule`, params, options);
|
17
17
|
}
|
18
|
+
async coupon_recipient(couponId, params, options) {
|
19
|
+
const _couponId = couponId.id || couponId;
|
20
|
+
return this.resources.fetch({ type: 'coupon_recipients' }, `coupons/${_couponId}/coupon_recipient`, params, options);
|
21
|
+
}
|
18
22
|
async events(couponId, params, options) {
|
19
23
|
const _couponId = couponId.id || couponId;
|
20
24
|
return this.resources.fetch({ type: 'events' }, `coupons/${_couponId}/events`, params, options);
|
@@ -13,6 +13,7 @@ interface InventoryModel extends Resource {
|
|
13
13
|
name: string;
|
14
14
|
strategy?: string | null;
|
15
15
|
stock_locations_cutoff?: number | null;
|
16
|
+
stock_reservation_cutoff?: number | null;
|
16
17
|
inventory_stock_locations?: InventoryStockLocation[] | null;
|
17
18
|
inventory_return_locations?: InventoryReturnLocation[] | null;
|
18
19
|
attachments?: Attachment[] | null;
|
@@ -21,11 +22,13 @@ interface InventoryModelCreate extends ResourceCreate {
|
|
21
22
|
name: string;
|
22
23
|
strategy?: string | null;
|
23
24
|
stock_locations_cutoff?: number | null;
|
25
|
+
stock_reservation_cutoff?: number | null;
|
24
26
|
}
|
25
27
|
interface InventoryModelUpdate extends ResourceUpdate {
|
26
28
|
name?: string | null;
|
27
29
|
strategy?: string | null;
|
28
30
|
stock_locations_cutoff?: number | null;
|
31
|
+
stock_reservation_cutoff?: number | null;
|
29
32
|
}
|
30
33
|
declare class InventoryModels extends ApiResource<InventoryModel> {
|
31
34
|
static readonly TYPE: InventoryModelType;
|
@@ -13,6 +13,7 @@ import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } fro
|
|
13
13
|
import type { Shipment, ShipmentType } from './shipments';
|
14
14
|
import type { Sku, SkuType } from './skus';
|
15
15
|
import type { LineItemOption } from './line_item_options';
|
16
|
+
import type { StockReservation } from './stock_reservations';
|
16
17
|
import type { StockLineItem } from './stock_line_items';
|
17
18
|
import type { StockTransfer } from './stock_transfers';
|
18
19
|
import type { Event } from './events';
|
@@ -92,6 +93,7 @@ interface LineItem extends Resource {
|
|
92
93
|
* @deprecated This field should not be used as it may be removed in the future without notice
|
93
94
|
*/
|
94
95
|
shipment_line_items?: object[];
|
96
|
+
stock_reservations?: StockReservation[] | null;
|
95
97
|
stock_line_items?: StockLineItem[] | null;
|
96
98
|
stock_transfers?: StockTransfer[] | null;
|
97
99
|
events?: Event[] | null;
|
@@ -103,6 +105,7 @@ interface LineItemCreate extends ResourceCreate {
|
|
103
105
|
quantity: number;
|
104
106
|
_external_price?: boolean | null;
|
105
107
|
_update_quantity?: boolean | null;
|
108
|
+
_reserve_stock?: boolean | null;
|
106
109
|
unit_amount_cents?: number | null;
|
107
110
|
name?: string | null;
|
108
111
|
image_url?: string | null;
|
@@ -117,6 +120,7 @@ interface LineItemUpdate extends ResourceUpdate {
|
|
117
120
|
bundle_code?: string | null;
|
118
121
|
quantity?: number | null;
|
119
122
|
_external_price?: boolean | null;
|
123
|
+
_reserve_stock?: boolean | null;
|
120
124
|
name?: string | null;
|
121
125
|
image_url?: string | null;
|
122
126
|
frequency?: string | null;
|
@@ -129,6 +133,7 @@ declare class LineItems extends ApiResource<LineItem> {
|
|
129
133
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
130
134
|
order(lineItemId: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
131
135
|
line_item_options(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
|
136
|
+
stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
132
137
|
stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
133
138
|
stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
134
139
|
events(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -19,6 +19,10 @@ class LineItems extends resource_1.ApiResource {
|
|
19
19
|
const _lineItemId = lineItemId.id || lineItemId;
|
20
20
|
return this.resources.fetch({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options);
|
21
21
|
}
|
22
|
+
async stock_reservations(lineItemId, params, options) {
|
23
|
+
const _lineItemId = lineItemId.id || lineItemId;
|
24
|
+
return this.resources.fetch({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options);
|
25
|
+
}
|
22
26
|
async stock_line_items(lineItemId, params, options) {
|
23
27
|
const _lineItemId = lineItemId.id || lineItemId;
|
24
28
|
return this.resources.fetch({ type: 'stock_line_items' }, `line_items/${_lineItemId}/stock_line_items`, params, options);
|
@@ -3,6 +3,7 @@ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesCon
|
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { StockLocation, StockLocationType } from './stock_locations';
|
5
5
|
import type { Sku, SkuType } from './skus';
|
6
|
+
import type { StockReservation } from './stock_reservations';
|
6
7
|
import type { Attachment } from './attachments';
|
7
8
|
type StockItemType = 'stock_items';
|
8
9
|
type StockItemRel = ResourceRel & {
|
@@ -20,6 +21,7 @@ interface StockItem extends Resource {
|
|
20
21
|
quantity: number;
|
21
22
|
stock_location?: StockLocation | null;
|
22
23
|
sku?: Sku | null;
|
24
|
+
stock_reservations?: StockReservation[] | null;
|
23
25
|
attachments?: Attachment[] | null;
|
24
26
|
}
|
25
27
|
interface StockItemCreate extends ResourceCreate {
|
@@ -41,6 +43,7 @@ declare class StockItems extends ApiResource<StockItem> {
|
|
41
43
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
42
44
|
stock_location(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
|
43
45
|
sku(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
|
46
|
+
stock_reservations(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
44
47
|
attachments(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
45
48
|
isStockItem(resource: any): resource is StockItem;
|
46
49
|
relationship(id: string | ResourceId | null): StockItemRel;
|
@@ -19,6 +19,10 @@ class StockItems extends resource_1.ApiResource {
|
|
19
19
|
const _stockItemId = stockItemId.id || stockItemId;
|
20
20
|
return this.resources.fetch({ type: 'skus' }, `stock_items/${_stockItemId}/sku`, params, options);
|
21
21
|
}
|
22
|
+
async stock_reservations(stockItemId, params, options) {
|
23
|
+
const _stockItemId = stockItemId.id || stockItemId;
|
24
|
+
return this.resources.fetch({ type: 'stock_reservations' }, `stock_items/${_stockItemId}/stock_reservations`, params, options);
|
25
|
+
}
|
22
26
|
async attachments(stockItemId, params, options) {
|
23
27
|
const _stockItemId = stockItemId.id || stockItemId;
|
24
28
|
return this.resources.fetch({ type: 'attachments' }, `stock_items/${_stockItemId}/attachments`, params, options);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
|
3
|
+
import type { QueryParamsRetrieve } from '../query';
|
4
|
+
import type { LineItem } from './line_items';
|
5
|
+
import type { StockItem } from './stock_items';
|
6
|
+
type StockReservationType = 'stock_reservations';
|
7
|
+
type StockReservationRel = ResourceRel & {
|
8
|
+
type: StockReservationType;
|
9
|
+
};
|
10
|
+
interface StockReservation extends Resource {
|
11
|
+
readonly type: StockReservationType;
|
12
|
+
status: 'draft' | 'pending';
|
13
|
+
quantity: number;
|
14
|
+
expires_at: string;
|
15
|
+
line_item?: LineItem | null;
|
16
|
+
stock_item?: StockItem | null;
|
17
|
+
}
|
18
|
+
declare class StockReservations extends ApiResource<StockReservation> {
|
19
|
+
static readonly TYPE: StockReservationType;
|
20
|
+
line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
|
21
|
+
stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
|
22
|
+
isStockReservation(resource: any): resource is StockReservation;
|
23
|
+
relationship(id: string | ResourceId | null): StockReservationRel;
|
24
|
+
type(): StockReservationType;
|
25
|
+
}
|
26
|
+
export default StockReservations;
|
27
|
+
export type { StockReservation, StockReservationType };
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class StockReservations extends resource_1.ApiResource {
|
5
|
+
async line_item(stockReservationId, params, options) {
|
6
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
7
|
+
return this.resources.fetch({ type: 'line_items' }, `stock_reservations/${_stockReservationId}/line_item`, params, options);
|
8
|
+
}
|
9
|
+
async stock_item(stockReservationId, params, options) {
|
10
|
+
const _stockReservationId = stockReservationId.id || stockReservationId;
|
11
|
+
return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
|
12
|
+
}
|
13
|
+
isStockReservation(resource) {
|
14
|
+
return resource.type && (resource.type === StockReservations.TYPE);
|
15
|
+
}
|
16
|
+
relationship(id) {
|
17
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: StockReservations.TYPE } : { id: id.id, type: StockReservations.TYPE };
|
18
|
+
}
|
19
|
+
type() {
|
20
|
+
return StockReservations.TYPE;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
StockReservations.TYPE = 'stock_reservations';
|
24
|
+
exports.default = StockReservations;
|
package/lib/esm/api.d.ts
CHANGED
@@ -102,6 +102,7 @@ export { default as Skus } from './resources/skus';
|
|
102
102
|
export { default as StockItems } from './resources/stock_items';
|
103
103
|
export { default as StockLineItems } from './resources/stock_line_items';
|
104
104
|
export { default as StockLocations } from './resources/stock_locations';
|
105
|
+
export { default as StockReservations } from './resources/stock_reservations';
|
105
106
|
export { default as StockTransfers } from './resources/stock_transfers';
|
106
107
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
107
108
|
export { default as StripePayments } from './resources/stripe_payments';
|
@@ -115,8 +116,8 @@ export { default as Transactions } from './resources/transactions';
|
|
115
116
|
export { default as Voids } from './resources/voids';
|
116
117
|
export { default as Webhooks } from './resources/webhooks';
|
117
118
|
export { default as WireTransfers } from './resources/wire_transfers';
|
118
|
-
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' | '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_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
|
119
|
-
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", "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_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
|
119
|
+
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' | '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' | 'voids' | 'webhooks' | 'wire_transfers';
|
120
|
+
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", "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", "voids", "webhooks", "wire_transfers"];
|
120
121
|
export type RetrievableResourceType = ResourceTypeLock;
|
121
122
|
export type RetrievableResource = {
|
122
123
|
type: RetrievableResourceType;
|
package/lib/esm/api.js
CHANGED
@@ -104,6 +104,7 @@ export { default as Skus } from './resources/skus';
|
|
104
104
|
export { default as StockItems } from './resources/stock_items';
|
105
105
|
export { default as StockLineItems } from './resources/stock_line_items';
|
106
106
|
export { default as StockLocations } from './resources/stock_locations';
|
107
|
+
export { default as StockReservations } from './resources/stock_reservations';
|
107
108
|
export { default as StockTransfers } from './resources/stock_transfers';
|
108
109
|
export { default as StripeGateways } from './resources/stripe_gateways';
|
109
110
|
export { default as StripePayments } from './resources/stripe_payments';
|
@@ -221,6 +222,7 @@ export const resourceList = [
|
|
221
222
|
'stock_items',
|
222
223
|
'stock_line_items',
|
223
224
|
'stock_locations',
|
225
|
+
'stock_reservations',
|
224
226
|
'stock_transfers',
|
225
227
|
'stripe_gateways',
|
226
228
|
'stripe_payments',
|
@@ -2,7 +2,7 @@ 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.5.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = Record<string, unknown>;
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
12
|
static get openApiSchemaVersion(): string;
|
13
|
-
readonly openApiSchemaVersion = "4.
|
13
|
+
readonly openApiSchemaVersion = "4.5.0";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
@@ -112,6 +112,7 @@ declare class CommerceLayerClient {
|
|
112
112
|
stock_items: api.StockItems;
|
113
113
|
stock_line_items: api.StockLineItems;
|
114
114
|
stock_locations: api.StockLocations;
|
115
|
+
stock_reservations: api.StockReservations;
|
115
116
|
stock_transfers: api.StockTransfers;
|
116
117
|
stripe_gateways: api.StripeGateways;
|
117
118
|
stripe_payments: api.StripePayments;
|
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.5.0';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
|
@@ -131,6 +131,7 @@ class CommerceLayerClient {
|
|
131
131
|
this.stock_items = new api.StockItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
132
132
|
this.stock_line_items = new api.StockLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
133
133
|
this.stock_locations = new api.StockLocations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
|
+
this.stock_reservations = new api.StockReservations(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
134
135
|
this.stock_transfers = new api.StockTransfers(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
135
136
|
this.stripe_gateways = new api.StripeGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
136
137
|
this.stripe_payments = new api.StripePayments(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
package/lib/esm/model.d.ts
CHANGED
@@ -102,6 +102,7 @@ export type { Sku, SkuCreate, SkuUpdate } from './resources/skus';
|
|
102
102
|
export type { StockItem, StockItemCreate, StockItemUpdate } from './resources/stock_items';
|
103
103
|
export type { StockLineItem } from './resources/stock_line_items';
|
104
104
|
export type { StockLocation, StockLocationCreate, StockLocationUpdate } from './resources/stock_locations';
|
105
|
+
export type { StockReservation } from './resources/stock_reservations';
|
105
106
|
export type { StockTransfer, StockTransferCreate, StockTransferUpdate } from './resources/stock_transfers';
|
106
107
|
export type { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate } from './resources/stripe_gateways';
|
107
108
|
export type { StripePayment, StripePaymentCreate, StripePaymentUpdate } from './resources/stripe_payments';
|
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
|
|
2
2
|
import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
|
3
3
|
import type { QueryParamsRetrieve, QueryParamsList } from '../query';
|
4
4
|
import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
|
5
|
+
import type { CouponRecipient, CouponRecipientType } from './coupon_recipients';
|
5
6
|
import type { Event } from './events';
|
6
7
|
import type { Tag, TagType } from './tags';
|
7
8
|
type CouponType = 'coupons';
|
@@ -11,6 +12,9 @@ type CouponRel = ResourceRel & {
|
|
11
12
|
type CouponCodesPromotionRuleRel = ResourceRel & {
|
12
13
|
type: CouponCodesPromotionRuleType;
|
13
14
|
};
|
15
|
+
type CouponRecipientRel = ResourceRel & {
|
16
|
+
type: CouponRecipientType;
|
17
|
+
};
|
14
18
|
type TagRel = ResourceRel & {
|
15
19
|
type: TagType;
|
16
20
|
};
|
@@ -22,6 +26,7 @@ interface Coupon extends Resource {
|
|
22
26
|
usage_count?: number | null;
|
23
27
|
recipient_email?: string | null;
|
24
28
|
promotion_rule?: CouponCodesPromotionRule | null;
|
29
|
+
coupon_recipient?: CouponRecipient | null;
|
25
30
|
events?: Event[] | null;
|
26
31
|
tags?: Tag[] | null;
|
27
32
|
}
|
@@ -31,6 +36,7 @@ interface CouponCreate extends ResourceCreate {
|
|
31
36
|
usage_limit?: number | null;
|
32
37
|
recipient_email?: string | null;
|
33
38
|
promotion_rule: CouponCodesPromotionRuleRel;
|
39
|
+
coupon_recipient?: CouponRecipientRel | null;
|
34
40
|
tags?: TagRel[] | null;
|
35
41
|
}
|
36
42
|
interface CouponUpdate extends ResourceUpdate {
|
@@ -39,6 +45,7 @@ interface CouponUpdate extends ResourceUpdate {
|
|
39
45
|
usage_limit?: number | null;
|
40
46
|
recipient_email?: string | null;
|
41
47
|
promotion_rule?: CouponCodesPromotionRuleRel | null;
|
48
|
+
coupon_recipient?: CouponRecipientRel | null;
|
42
49
|
tags?: TagRel[] | null;
|
43
50
|
}
|
44
51
|
declare class Coupons extends ApiResource<Coupon> {
|
@@ -47,6 +54,7 @@ declare class Coupons extends ApiResource<Coupon> {
|
|
47
54
|
update(resource: CouponUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Coupon>;
|
48
55
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
49
56
|
promotion_rule(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
57
|
+
coupon_recipient(couponId: string | Coupon, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponRecipient>;
|
50
58
|
events(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
51
59
|
tags(couponId: string | Coupon, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
52
60
|
isCoupon(resource: any): resource is Coupon;
|
@@ -13,6 +13,10 @@ class Coupons extends ApiResource {
|
|
13
13
|
const _couponId = couponId.id || couponId;
|
14
14
|
return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `coupons/${_couponId}/promotion_rule`, params, options);
|
15
15
|
}
|
16
|
+
async coupon_recipient(couponId, params, options) {
|
17
|
+
const _couponId = couponId.id || couponId;
|
18
|
+
return this.resources.fetch({ type: 'coupon_recipients' }, `coupons/${_couponId}/coupon_recipient`, params, options);
|
19
|
+
}
|
16
20
|
async events(couponId, params, options) {
|
17
21
|
const _couponId = couponId.id || couponId;
|
18
22
|
return this.resources.fetch({ type: 'events' }, `coupons/${_couponId}/events`, params, options);
|
@@ -13,6 +13,7 @@ interface InventoryModel extends Resource {
|
|
13
13
|
name: string;
|
14
14
|
strategy?: string | null;
|
15
15
|
stock_locations_cutoff?: number | null;
|
16
|
+
stock_reservation_cutoff?: number | null;
|
16
17
|
inventory_stock_locations?: InventoryStockLocation[] | null;
|
17
18
|
inventory_return_locations?: InventoryReturnLocation[] | null;
|
18
19
|
attachments?: Attachment[] | null;
|
@@ -21,11 +22,13 @@ interface InventoryModelCreate extends ResourceCreate {
|
|
21
22
|
name: string;
|
22
23
|
strategy?: string | null;
|
23
24
|
stock_locations_cutoff?: number | null;
|
25
|
+
stock_reservation_cutoff?: number | null;
|
24
26
|
}
|
25
27
|
interface InventoryModelUpdate extends ResourceUpdate {
|
26
28
|
name?: string | null;
|
27
29
|
strategy?: string | null;
|
28
30
|
stock_locations_cutoff?: number | null;
|
31
|
+
stock_reservation_cutoff?: number | null;
|
29
32
|
}
|
30
33
|
declare class InventoryModels extends ApiResource<InventoryModel> {
|
31
34
|
static readonly TYPE: InventoryModelType;
|
@@ -13,6 +13,7 @@ import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } fro
|
|
13
13
|
import type { Shipment, ShipmentType } from './shipments';
|
14
14
|
import type { Sku, SkuType } from './skus';
|
15
15
|
import type { LineItemOption } from './line_item_options';
|
16
|
+
import type { StockReservation } from './stock_reservations';
|
16
17
|
import type { StockLineItem } from './stock_line_items';
|
17
18
|
import type { StockTransfer } from './stock_transfers';
|
18
19
|
import type { Event } from './events';
|
@@ -92,6 +93,7 @@ interface LineItem extends Resource {
|
|
92
93
|
* @deprecated This field should not be used as it may be removed in the future without notice
|
93
94
|
*/
|
94
95
|
shipment_line_items?: object[];
|
96
|
+
stock_reservations?: StockReservation[] | null;
|
95
97
|
stock_line_items?: StockLineItem[] | null;
|
96
98
|
stock_transfers?: StockTransfer[] | null;
|
97
99
|
events?: Event[] | null;
|
@@ -103,6 +105,7 @@ interface LineItemCreate extends ResourceCreate {
|
|
103
105
|
quantity: number;
|
104
106
|
_external_price?: boolean | null;
|
105
107
|
_update_quantity?: boolean | null;
|
108
|
+
_reserve_stock?: boolean | null;
|
106
109
|
unit_amount_cents?: number | null;
|
107
110
|
name?: string | null;
|
108
111
|
image_url?: string | null;
|
@@ -117,6 +120,7 @@ interface LineItemUpdate extends ResourceUpdate {
|
|
117
120
|
bundle_code?: string | null;
|
118
121
|
quantity?: number | null;
|
119
122
|
_external_price?: boolean | null;
|
123
|
+
_reserve_stock?: boolean | null;
|
120
124
|
name?: string | null;
|
121
125
|
image_url?: string | null;
|
122
126
|
frequency?: string | null;
|
@@ -129,6 +133,7 @@ declare class LineItems extends ApiResource<LineItem> {
|
|
129
133
|
delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
|
130
134
|
order(lineItemId: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
131
135
|
line_item_options(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
|
136
|
+
stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
|
132
137
|
stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
133
138
|
stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
134
139
|
events(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
@@ -17,6 +17,10 @@ class LineItems extends ApiResource {
|
|
17
17
|
const _lineItemId = lineItemId.id || lineItemId;
|
18
18
|
return this.resources.fetch({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options);
|
19
19
|
}
|
20
|
+
async stock_reservations(lineItemId, params, options) {
|
21
|
+
const _lineItemId = lineItemId.id || lineItemId;
|
22
|
+
return this.resources.fetch({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options);
|
23
|
+
}
|
20
24
|
async stock_line_items(lineItemId, params, options) {
|
21
25
|
const _lineItemId = lineItemId.id || lineItemId;
|
22
26
|
return this.resources.fetch({ type: 'stock_line_items' }, `line_items/${_lineItemId}/stock_line_items`, params, options);
|