@commercelayer/sdk 5.32.0 → 5.33.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 +5 -2
- package/lib/cjs/commercelayer.d.ts +3 -2
- package/lib/cjs/commercelayer.js +2 -1
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/resources/gift_cards.d.ts +3 -0
- package/lib/cjs/resources/orders.d.ts +10 -1
- package/lib/cjs/resources/orders.js +7 -0
- package/lib/cjs/resources/resource_errors.d.ts +22 -0
- package/lib/cjs/resources/resource_errors.js +16 -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/gift_cards.d.ts +3 -0
- package/lib/esm/resources/orders.d.ts +10 -1
- package/lib/esm/resources/orders.js +7 -0
- package/lib/esm/resources/resource_errors.d.ts +22 -0
- package/lib/esm/resources/resource_errors.js +14 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
package/lib/cjs/api.d.ts
CHANGED
@@ -91,6 +91,7 @@ export { default as Promotions } from './resources/promotions';
|
|
91
91
|
export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
|
92
92
|
export { default as Refunds } from './resources/refunds';
|
93
93
|
export { default as ReservedStocks } from './resources/reserved_stocks';
|
94
|
+
export { default as ResourceErrors } from './resources/resource_errors';
|
94
95
|
export { default as ReturnLineItems } from './resources/return_line_items';
|
95
96
|
export { default as Returns } from './resources/returns';
|
96
97
|
export { default as SatispayGateways } from './resources/satispay_gateways';
|
@@ -124,8 +125,8 @@ export { default as Versions } from './resources/versions';
|
|
124
125
|
export { default as Voids } from './resources/voids';
|
125
126
|
export { default as Webhooks } from './resources/webhooks';
|
126
127
|
export { default as WireTransfers } from './resources/wire_transfers';
|
127
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
128
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "payment_options", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
128
|
+
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' | 'resource_errors' | '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 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", "resource_errors", "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
130
|
export declare const singletonList: readonly ["application", "organization"];
|
130
131
|
export type RetrievableResourceType = ResourceTypeLock;
|
131
132
|
export type RetrievableResource = Resource & {
|
package/lib/cjs/api.js
CHANGED
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
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
|
-
exports.
|
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;
|
7
|
+
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.ResourceErrors = 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.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 = exports.SkuLists = void 0;
|
9
9
|
// ##__API_RESOURCES_START__##
|
10
10
|
// ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
|
11
11
|
/**
|
@@ -185,6 +185,8 @@ var refunds_1 = require("./resources/refunds");
|
|
185
185
|
Object.defineProperty(exports, "Refunds", { enumerable: true, get: function () { return __importDefault(refunds_1).default; } });
|
186
186
|
var reserved_stocks_1 = require("./resources/reserved_stocks");
|
187
187
|
Object.defineProperty(exports, "ReservedStocks", { enumerable: true, get: function () { return __importDefault(reserved_stocks_1).default; } });
|
188
|
+
var resource_errors_1 = require("./resources/resource_errors");
|
189
|
+
Object.defineProperty(exports, "ResourceErrors", { enumerable: true, get: function () { return __importDefault(resource_errors_1).default; } });
|
188
190
|
var return_line_items_1 = require("./resources/return_line_items");
|
189
191
|
Object.defineProperty(exports, "ReturnLineItems", { enumerable: true, get: function () { return __importDefault(return_line_items_1).default; } });
|
190
192
|
var returns_1 = require("./resources/returns");
|
@@ -341,6 +343,7 @@ exports.resourceList = [
|
|
341
343
|
'recurring_order_copies',
|
342
344
|
'refunds',
|
343
345
|
'reserved_stocks',
|
346
|
+
'resource_errors',
|
344
347
|
'return_line_items',
|
345
348
|
'returns',
|
346
349
|
'satispay_gateways',
|
@@ -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.27.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.27.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
@@ -97,6 +97,7 @@ declare class CommerceLayerClient {
|
|
97
97
|
recurring_order_copies: api.RecurringOrderCopies;
|
98
98
|
refunds: api.Refunds;
|
99
99
|
reserved_stocks: api.ReservedStocks;
|
100
|
+
resource_errors: api.ResourceErrors;
|
100
101
|
return_line_items: api.ReturnLineItems;
|
101
102
|
returns: api.Returns;
|
102
103
|
satispay_gateways: api.SatispayGateways;
|
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.27.0';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -147,6 +147,7 @@ class CommerceLayerClient {
|
|
147
147
|
this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
148
148
|
this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
149
149
|
this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
150
|
+
this.resource_errors = new api.ResourceErrors(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
150
151
|
this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
151
152
|
this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
152
153
|
this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
package/lib/cjs/model.d.ts
CHANGED
@@ -88,6 +88,7 @@ export type { Promotion } from './resources/promotions';
|
|
88
88
|
export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
|
89
89
|
export type { Refund } from './resources/refunds';
|
90
90
|
export type { ReservedStock } from './resources/reserved_stocks';
|
91
|
+
export type { ResourceError } from './resources/resource_errors';
|
91
92
|
export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
|
92
93
|
export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
|
93
94
|
export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
|
@@ -37,6 +37,7 @@ interface GiftCard extends Resource {
|
|
37
37
|
balance_log: Array<Record<string, any>>;
|
38
38
|
single_use?: boolean | null;
|
39
39
|
rechargeable?: boolean | null;
|
40
|
+
distribute_discount?: boolean | null;
|
40
41
|
image_url?: string | null;
|
41
42
|
expires_at?: string | null;
|
42
43
|
recipient_email?: string | null;
|
@@ -54,6 +55,7 @@ interface GiftCardCreate extends ResourceCreate {
|
|
54
55
|
balance_max_cents?: string | null;
|
55
56
|
single_use?: boolean | null;
|
56
57
|
rechargeable?: boolean | null;
|
58
|
+
distribute_discount?: boolean | null;
|
57
59
|
image_url?: string | null;
|
58
60
|
expires_at?: string | null;
|
59
61
|
recipient_email?: string | null;
|
@@ -67,6 +69,7 @@ interface GiftCardUpdate extends ResourceUpdate {
|
|
67
69
|
balance_max_cents?: string | null;
|
68
70
|
single_use?: boolean | null;
|
69
71
|
rechargeable?: boolean | null;
|
72
|
+
distribute_discount?: boolean | null;
|
70
73
|
image_url?: string | null;
|
71
74
|
expires_at?: string | null;
|
72
75
|
recipient_email?: string | null;
|
@@ -35,6 +35,7 @@ import type { OrderFactory } from './order_factories';
|
|
35
35
|
import type { OrderCopy } from './order_copies';
|
36
36
|
import type { RecurringOrderCopy } from './recurring_order_copies';
|
37
37
|
import type { Attachment } from './attachments';
|
38
|
+
import type { ResourceError } from './resource_errors';
|
38
39
|
import type { Event } from './events';
|
39
40
|
import type { Tag, TagType } from './tags';
|
40
41
|
import type { Version } from './versions';
|
@@ -91,7 +92,8 @@ interface Order extends Resource {
|
|
91
92
|
readonly type: OrderType;
|
92
93
|
number?: string | null;
|
93
94
|
autorefresh?: boolean | null;
|
94
|
-
|
95
|
+
place_async?: boolean | null;
|
96
|
+
status: 'draft' | 'pending' | 'placing' | 'placed' | 'editing' | 'approved' | 'cancelled';
|
95
97
|
payment_status: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free';
|
96
98
|
fulfillment_status: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required';
|
97
99
|
guest?: boolean | null;
|
@@ -178,6 +180,7 @@ interface Order extends Resource {
|
|
178
180
|
shipments_count?: number | null;
|
179
181
|
tax_calculations_count?: number | null;
|
180
182
|
validations_count?: number | null;
|
183
|
+
errors_count?: number | null;
|
181
184
|
payment_source_details?: Record<string, any> | null;
|
182
185
|
token?: string | null;
|
183
186
|
cart_url?: string | null;
|
@@ -223,6 +226,7 @@ interface Order extends Resource {
|
|
223
226
|
order_copies?: OrderCopy[] | null;
|
224
227
|
recurring_order_copies?: RecurringOrderCopy[] | null;
|
225
228
|
attachments?: Attachment[] | null;
|
229
|
+
resource_errors?: ResourceError[] | null;
|
226
230
|
events?: Event[] | null;
|
227
231
|
tags?: Tag[] | null;
|
228
232
|
versions?: Version[] | null;
|
@@ -230,6 +234,7 @@ interface Order extends Resource {
|
|
230
234
|
interface OrderCreate extends ResourceCreate {
|
231
235
|
number?: string | null;
|
232
236
|
autorefresh?: boolean | null;
|
237
|
+
place_async?: boolean | null;
|
233
238
|
guest?: boolean | null;
|
234
239
|
customer_email?: string | null;
|
235
240
|
customer_password?: string | null;
|
@@ -256,6 +261,7 @@ interface OrderCreate extends ResourceCreate {
|
|
256
261
|
interface OrderUpdate extends ResourceUpdate {
|
257
262
|
number?: string | null;
|
258
263
|
autorefresh?: boolean | null;
|
264
|
+
place_async?: boolean | null;
|
259
265
|
guest?: boolean | null;
|
260
266
|
customer_email?: string | null;
|
261
267
|
customer_password?: string | null;
|
@@ -273,6 +279,7 @@ interface OrderUpdate extends ResourceUpdate {
|
|
273
279
|
privacy_url?: string | null;
|
274
280
|
_archive?: boolean | null;
|
275
281
|
_unarchive?: boolean | null;
|
282
|
+
_pending?: boolean | null;
|
276
283
|
_place?: boolean | null;
|
277
284
|
_cancel?: boolean | null;
|
278
285
|
_approve?: boolean | null;
|
@@ -338,11 +345,13 @@ declare class Orders extends ApiResource<Order> {
|
|
338
345
|
order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
|
339
346
|
recurring_order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>>;
|
340
347
|
attachments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
348
|
+
resource_errors(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ResourceError>>;
|
341
349
|
events(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
342
350
|
tags(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
343
351
|
versions(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
344
352
|
_archive(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
345
353
|
_unarchive(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
354
|
+
_pending(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
346
355
|
_place(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
347
356
|
_cancel(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
348
357
|
_approve(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
@@ -119,6 +119,10 @@ class Orders extends resource_1.ApiResource {
|
|
119
119
|
const _orderId = orderId.id || orderId;
|
120
120
|
return this.resources.fetch({ type: 'attachments' }, `orders/${_orderId}/attachments`, params, options);
|
121
121
|
}
|
122
|
+
async resource_errors(orderId, params, options) {
|
123
|
+
const _orderId = orderId.id || orderId;
|
124
|
+
return this.resources.fetch({ type: 'resource_errors' }, `orders/${_orderId}/resource_errors`, params, options);
|
125
|
+
}
|
122
126
|
async events(orderId, params, options) {
|
123
127
|
const _orderId = orderId.id || orderId;
|
124
128
|
return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
|
@@ -137,6 +141,9 @@ class Orders extends resource_1.ApiResource {
|
|
137
141
|
async _unarchive(id, params, options) {
|
138
142
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _unarchive: true }, params, options);
|
139
143
|
}
|
144
|
+
async _pending(id, params, options) {
|
145
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _pending: true }, params, options);
|
146
|
+
}
|
140
147
|
async _place(id, params, options) {
|
141
148
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _place: true }, params, options);
|
142
149
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceId, ResourceRel } from '../resource';
|
3
|
+
import type { Order } from './orders';
|
4
|
+
type ResourceErrorType = 'resource_errors';
|
5
|
+
type ResourceErrorRel = ResourceRel & {
|
6
|
+
type: ResourceErrorType;
|
7
|
+
};
|
8
|
+
interface ResourceError extends Resource {
|
9
|
+
readonly type: ResourceErrorType;
|
10
|
+
name: string;
|
11
|
+
code: string;
|
12
|
+
message: string;
|
13
|
+
resource?: Order | null;
|
14
|
+
}
|
15
|
+
declare class ResourceErrors extends ApiResource<ResourceError> {
|
16
|
+
static readonly TYPE: ResourceErrorType;
|
17
|
+
isResourceError(resource: any): resource is ResourceError;
|
18
|
+
relationship(id: string | ResourceId | null): ResourceErrorRel;
|
19
|
+
type(): ResourceErrorType;
|
20
|
+
}
|
21
|
+
export default ResourceErrors;
|
22
|
+
export type { ResourceError, ResourceErrorType };
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const resource_1 = require("../resource");
|
4
|
+
class ResourceErrors extends resource_1.ApiResource {
|
5
|
+
isResourceError(resource) {
|
6
|
+
return resource.type && (resource.type === ResourceErrors.TYPE);
|
7
|
+
}
|
8
|
+
relationship(id) {
|
9
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ResourceErrors.TYPE } : { id: id.id, type: ResourceErrors.TYPE };
|
10
|
+
}
|
11
|
+
type() {
|
12
|
+
return ResourceErrors.TYPE;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
ResourceErrors.TYPE = 'resource_errors';
|
16
|
+
exports.default = ResourceErrors;
|
package/lib/esm/api.d.ts
CHANGED
@@ -91,6 +91,7 @@ export { default as Promotions } from './resources/promotions';
|
|
91
91
|
export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
|
92
92
|
export { default as Refunds } from './resources/refunds';
|
93
93
|
export { default as ReservedStocks } from './resources/reserved_stocks';
|
94
|
+
export { default as ResourceErrors } from './resources/resource_errors';
|
94
95
|
export { default as ReturnLineItems } from './resources/return_line_items';
|
95
96
|
export { default as Returns } from './resources/returns';
|
96
97
|
export { default as SatispayGateways } from './resources/satispay_gateways';
|
@@ -124,8 +125,8 @@ export { default as Versions } from './resources/versions';
|
|
124
125
|
export { default as Voids } from './resources/voids';
|
125
126
|
export { default as Webhooks } from './resources/webhooks';
|
126
127
|
export { default as WireTransfers } from './resources/wire_transfers';
|
127
|
-
export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'payment_options' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
|
128
|
-
export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "payment_options", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
|
128
|
+
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' | 'resource_errors' | '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 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", "resource_errors", "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
130
|
export declare const singletonList: readonly ["application", "organization"];
|
130
131
|
export type RetrievableResourceType = ResourceTypeLock;
|
131
132
|
export type RetrievableResource = Resource & {
|
package/lib/esm/api.js
CHANGED
@@ -90,6 +90,7 @@ export { default as Promotions } from './resources/promotions';
|
|
90
90
|
export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
|
91
91
|
export { default as Refunds } from './resources/refunds';
|
92
92
|
export { default as ReservedStocks } from './resources/reserved_stocks';
|
93
|
+
export { default as ResourceErrors } from './resources/resource_errors';
|
93
94
|
export { default as ReturnLineItems } from './resources/return_line_items';
|
94
95
|
export { default as Returns } from './resources/returns';
|
95
96
|
export { default as SatispayGateways } from './resources/satispay_gateways';
|
@@ -213,6 +214,7 @@ export const resourceList = [
|
|
213
214
|
'recurring_order_copies',
|
214
215
|
'refunds',
|
215
216
|
'reserved_stocks',
|
217
|
+
'resource_errors',
|
216
218
|
'return_line_items',
|
217
219
|
'returns',
|
218
220
|
'satispay_gateways',
|
@@ -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.27.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.27.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
adyen_gateways: api.AdyenGateways;
|
@@ -97,6 +97,7 @@ declare class CommerceLayerClient {
|
|
97
97
|
recurring_order_copies: api.RecurringOrderCopies;
|
98
98
|
refunds: api.Refunds;
|
99
99
|
reserved_stocks: api.ReservedStocks;
|
100
|
+
resource_errors: api.ResourceErrors;
|
100
101
|
return_line_items: api.ReturnLineItems;
|
101
102
|
returns: api.Returns;
|
102
103
|
satispay_gateways: api.SatispayGateways;
|
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.27.0';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
// ##__CL_RESOURCES_DEF_STOP__##
|
@@ -118,6 +118,7 @@ class CommerceLayerClient {
|
|
118
118
|
this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
119
119
|
this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
120
120
|
this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
121
|
+
this.resource_errors = new api.ResourceErrors(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
121
122
|
this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
122
123
|
this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
123
124
|
this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
|
package/lib/esm/model.d.ts
CHANGED
@@ -88,6 +88,7 @@ export type { Promotion } from './resources/promotions';
|
|
88
88
|
export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
|
89
89
|
export type { Refund } from './resources/refunds';
|
90
90
|
export type { ReservedStock } from './resources/reserved_stocks';
|
91
|
+
export type { ResourceError } from './resources/resource_errors';
|
91
92
|
export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
|
92
93
|
export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
|
93
94
|
export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
|
@@ -37,6 +37,7 @@ interface GiftCard extends Resource {
|
|
37
37
|
balance_log: Array<Record<string, any>>;
|
38
38
|
single_use?: boolean | null;
|
39
39
|
rechargeable?: boolean | null;
|
40
|
+
distribute_discount?: boolean | null;
|
40
41
|
image_url?: string | null;
|
41
42
|
expires_at?: string | null;
|
42
43
|
recipient_email?: string | null;
|
@@ -54,6 +55,7 @@ interface GiftCardCreate extends ResourceCreate {
|
|
54
55
|
balance_max_cents?: string | null;
|
55
56
|
single_use?: boolean | null;
|
56
57
|
rechargeable?: boolean | null;
|
58
|
+
distribute_discount?: boolean | null;
|
57
59
|
image_url?: string | null;
|
58
60
|
expires_at?: string | null;
|
59
61
|
recipient_email?: string | null;
|
@@ -67,6 +69,7 @@ interface GiftCardUpdate extends ResourceUpdate {
|
|
67
69
|
balance_max_cents?: string | null;
|
68
70
|
single_use?: boolean | null;
|
69
71
|
rechargeable?: boolean | null;
|
72
|
+
distribute_discount?: boolean | null;
|
70
73
|
image_url?: string | null;
|
71
74
|
expires_at?: string | null;
|
72
75
|
recipient_email?: string | null;
|
@@ -35,6 +35,7 @@ import type { OrderFactory } from './order_factories';
|
|
35
35
|
import type { OrderCopy } from './order_copies';
|
36
36
|
import type { RecurringOrderCopy } from './recurring_order_copies';
|
37
37
|
import type { Attachment } from './attachments';
|
38
|
+
import type { ResourceError } from './resource_errors';
|
38
39
|
import type { Event } from './events';
|
39
40
|
import type { Tag, TagType } from './tags';
|
40
41
|
import type { Version } from './versions';
|
@@ -91,7 +92,8 @@ interface Order extends Resource {
|
|
91
92
|
readonly type: OrderType;
|
92
93
|
number?: string | null;
|
93
94
|
autorefresh?: boolean | null;
|
94
|
-
|
95
|
+
place_async?: boolean | null;
|
96
|
+
status: 'draft' | 'pending' | 'placing' | 'placed' | 'editing' | 'approved' | 'cancelled';
|
95
97
|
payment_status: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free';
|
96
98
|
fulfillment_status: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required';
|
97
99
|
guest?: boolean | null;
|
@@ -178,6 +180,7 @@ interface Order extends Resource {
|
|
178
180
|
shipments_count?: number | null;
|
179
181
|
tax_calculations_count?: number | null;
|
180
182
|
validations_count?: number | null;
|
183
|
+
errors_count?: number | null;
|
181
184
|
payment_source_details?: Record<string, any> | null;
|
182
185
|
token?: string | null;
|
183
186
|
cart_url?: string | null;
|
@@ -223,6 +226,7 @@ interface Order extends Resource {
|
|
223
226
|
order_copies?: OrderCopy[] | null;
|
224
227
|
recurring_order_copies?: RecurringOrderCopy[] | null;
|
225
228
|
attachments?: Attachment[] | null;
|
229
|
+
resource_errors?: ResourceError[] | null;
|
226
230
|
events?: Event[] | null;
|
227
231
|
tags?: Tag[] | null;
|
228
232
|
versions?: Version[] | null;
|
@@ -230,6 +234,7 @@ interface Order extends Resource {
|
|
230
234
|
interface OrderCreate extends ResourceCreate {
|
231
235
|
number?: string | null;
|
232
236
|
autorefresh?: boolean | null;
|
237
|
+
place_async?: boolean | null;
|
233
238
|
guest?: boolean | null;
|
234
239
|
customer_email?: string | null;
|
235
240
|
customer_password?: string | null;
|
@@ -256,6 +261,7 @@ interface OrderCreate extends ResourceCreate {
|
|
256
261
|
interface OrderUpdate extends ResourceUpdate {
|
257
262
|
number?: string | null;
|
258
263
|
autorefresh?: boolean | null;
|
264
|
+
place_async?: boolean | null;
|
259
265
|
guest?: boolean | null;
|
260
266
|
customer_email?: string | null;
|
261
267
|
customer_password?: string | null;
|
@@ -273,6 +279,7 @@ interface OrderUpdate extends ResourceUpdate {
|
|
273
279
|
privacy_url?: string | null;
|
274
280
|
_archive?: boolean | null;
|
275
281
|
_unarchive?: boolean | null;
|
282
|
+
_pending?: boolean | null;
|
276
283
|
_place?: boolean | null;
|
277
284
|
_cancel?: boolean | null;
|
278
285
|
_approve?: boolean | null;
|
@@ -338,11 +345,13 @@ declare class Orders extends ApiResource<Order> {
|
|
338
345
|
order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
|
339
346
|
recurring_order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>>;
|
340
347
|
attachments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
348
|
+
resource_errors(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ResourceError>>;
|
341
349
|
events(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
342
350
|
tags(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
343
351
|
versions(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
344
352
|
_archive(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
345
353
|
_unarchive(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
354
|
+
_pending(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
346
355
|
_place(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
347
356
|
_cancel(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
348
357
|
_approve(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
@@ -117,6 +117,10 @@ class Orders extends ApiResource {
|
|
117
117
|
const _orderId = orderId.id || orderId;
|
118
118
|
return this.resources.fetch({ type: 'attachments' }, `orders/${_orderId}/attachments`, params, options);
|
119
119
|
}
|
120
|
+
async resource_errors(orderId, params, options) {
|
121
|
+
const _orderId = orderId.id || orderId;
|
122
|
+
return this.resources.fetch({ type: 'resource_errors' }, `orders/${_orderId}/resource_errors`, params, options);
|
123
|
+
}
|
120
124
|
async events(orderId, params, options) {
|
121
125
|
const _orderId = orderId.id || orderId;
|
122
126
|
return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
|
@@ -135,6 +139,9 @@ class Orders extends ApiResource {
|
|
135
139
|
async _unarchive(id, params, options) {
|
136
140
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _unarchive: true }, params, options);
|
137
141
|
}
|
142
|
+
async _pending(id, params, options) {
|
143
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _pending: true }, params, options);
|
144
|
+
}
|
138
145
|
async _place(id, params, options) {
|
139
146
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _place: true }, params, options);
|
140
147
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
import type { Resource, ResourceId, ResourceRel } from '../resource';
|
3
|
+
import type { Order } from './orders';
|
4
|
+
type ResourceErrorType = 'resource_errors';
|
5
|
+
type ResourceErrorRel = ResourceRel & {
|
6
|
+
type: ResourceErrorType;
|
7
|
+
};
|
8
|
+
interface ResourceError extends Resource {
|
9
|
+
readonly type: ResourceErrorType;
|
10
|
+
name: string;
|
11
|
+
code: string;
|
12
|
+
message: string;
|
13
|
+
resource?: Order | null;
|
14
|
+
}
|
15
|
+
declare class ResourceErrors extends ApiResource<ResourceError> {
|
16
|
+
static readonly TYPE: ResourceErrorType;
|
17
|
+
isResourceError(resource: any): resource is ResourceError;
|
18
|
+
relationship(id: string | ResourceId | null): ResourceErrorRel;
|
19
|
+
type(): ResourceErrorType;
|
20
|
+
}
|
21
|
+
export default ResourceErrors;
|
22
|
+
export type { ResourceError, ResourceErrorType };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ApiResource } from '../resource';
|
2
|
+
class ResourceErrors extends ApiResource {
|
3
|
+
isResourceError(resource) {
|
4
|
+
return resource.type && (resource.type === ResourceErrors.TYPE);
|
5
|
+
}
|
6
|
+
relationship(id) {
|
7
|
+
return ((id === null) || (typeof id === 'string')) ? { id, type: ResourceErrors.TYPE } : { id: id.id, type: ResourceErrors.TYPE };
|
8
|
+
}
|
9
|
+
type() {
|
10
|
+
return ResourceErrors.TYPE;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
ResourceErrors.TYPE = 'resource_errors';
|
14
|
+
export default ResourceErrors;
|