@commercelayer/sdk 5.7.0 → 5.9.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.
Files changed (59) hide show
  1. package/lib/cjs/api.d.ts +3 -2
  2. package/lib/cjs/api.js +5 -2
  3. package/lib/cjs/client.d.ts +9 -4
  4. package/lib/cjs/client.js +10 -0
  5. package/lib/cjs/commercelayer.d.ts +4 -3
  6. package/lib/cjs/commercelayer.js +2 -1
  7. package/lib/cjs/model.d.ts +1 -0
  8. package/lib/cjs/resources/authorizations.d.ts +3 -0
  9. package/lib/cjs/resources/authorizations.js +4 -0
  10. package/lib/cjs/resources/captures.d.ts +3 -0
  11. package/lib/cjs/resources/captures.js +4 -0
  12. package/lib/cjs/resources/customer_addresses.d.ts +2 -0
  13. package/lib/cjs/resources/parcel_line_items.d.ts +1 -1
  14. package/lib/cjs/resources/refunds.d.ts +3 -0
  15. package/lib/cjs/resources/refunds.js +4 -0
  16. package/lib/cjs/resources/reserved_stocks.d.ts +28 -0
  17. package/lib/cjs/resources/reserved_stocks.js +28 -0
  18. package/lib/cjs/resources/return_line_items.d.ts +2 -1
  19. package/lib/cjs/resources/stock_items.d.ts +3 -0
  20. package/lib/cjs/resources/stock_items.js +4 -0
  21. package/lib/cjs/resources/stock_line_items.d.ts +3 -0
  22. package/lib/cjs/resources/stock_line_items.js +4 -0
  23. package/lib/cjs/resources/stock_reservations.d.ts +3 -0
  24. package/lib/cjs/resources/stock_reservations.js +4 -0
  25. package/lib/cjs/resources/transactions.d.ts +5 -2
  26. package/lib/cjs/resources/transactions.js +4 -0
  27. package/lib/cjs/resources/voids.d.ts +3 -0
  28. package/lib/cjs/resources/voids.js +4 -0
  29. package/lib/esm/api.d.ts +3 -2
  30. package/lib/esm/api.js +2 -0
  31. package/lib/esm/client.d.ts +9 -4
  32. package/lib/esm/client.js +10 -0
  33. package/lib/esm/commercelayer.d.ts +4 -3
  34. package/lib/esm/commercelayer.js +2 -1
  35. package/lib/esm/model.d.ts +1 -0
  36. package/lib/esm/resources/authorizations.d.ts +3 -0
  37. package/lib/esm/resources/authorizations.js +4 -0
  38. package/lib/esm/resources/captures.d.ts +3 -0
  39. package/lib/esm/resources/captures.js +4 -0
  40. package/lib/esm/resources/customer_addresses.d.ts +2 -0
  41. package/lib/esm/resources/parcel_line_items.d.ts +1 -1
  42. package/lib/esm/resources/refunds.d.ts +3 -0
  43. package/lib/esm/resources/refunds.js +4 -0
  44. package/lib/esm/resources/reserved_stocks.d.ts +28 -0
  45. package/lib/esm/resources/reserved_stocks.js +26 -0
  46. package/lib/esm/resources/return_line_items.d.ts +2 -1
  47. package/lib/esm/resources/stock_items.d.ts +3 -0
  48. package/lib/esm/resources/stock_items.js +4 -0
  49. package/lib/esm/resources/stock_line_items.d.ts +3 -0
  50. package/lib/esm/resources/stock_line_items.js +4 -0
  51. package/lib/esm/resources/stock_reservations.d.ts +3 -0
  52. package/lib/esm/resources/stock_reservations.js +4 -0
  53. package/lib/esm/resources/transactions.d.ts +5 -2
  54. package/lib/esm/resources/transactions.js +4 -0
  55. package/lib/esm/resources/voids.d.ts +3 -0
  56. package/lib/esm/resources/voids.js +4 -0
  57. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  58. package/lib/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +7 -7
package/lib/cjs/api.d.ts CHANGED
@@ -84,6 +84,7 @@ export { default as PromotionRules } from './resources/promotion_rules';
84
84
  export { default as Promotions } from './resources/promotions';
85
85
  export { default as RecurringOrderCopies } from './resources/recurring_order_copies';
86
86
  export { default as Refunds } from './resources/refunds';
87
+ export { default as ReservedStocks } from './resources/reserved_stocks';
87
88
  export { default as ReturnLineItems } from './resources/return_line_items';
88
89
  export { default as Returns } from './resources/returns';
89
90
  export { default as SatispayGateways } from './resources/satispay_gateways';
@@ -116,8 +117,8 @@ export { default as Transactions } from './resources/transactions';
116
117
  export { default as Voids } from './resources/voids';
117
118
  export { default as Webhooks } from './resources/webhooks';
118
119
  export { default as WireTransfers } from './resources/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
+ export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
121
+ export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
121
122
  export type RetrievableResourceType = ResourceTypeLock;
122
123
  export type RetrievableResource = {
123
124
  type: RetrievableResourceType;
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.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
- 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.StockReservations = exports.StockLocations = void 0;
7
+ 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.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.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.StockReservations = exports.StockLocations = exports.StockLineItems = void 0;
9
9
  // ##__API_RESOURCES_START__##
10
10
  // ##__API_RESOURCES_TEMPLATE:: export { default as ##__RESOURCE_CLASS__## } from './resources/##__RESOURCE_TYPE__##'
11
11
  /**
@@ -177,6 +177,8 @@ var recurring_order_copies_1 = require("./resources/recurring_order_copies");
177
177
  Object.defineProperty(exports, "RecurringOrderCopies", { enumerable: true, get: function () { return __importDefault(recurring_order_copies_1).default; } });
178
178
  var refunds_1 = require("./resources/refunds");
179
179
  Object.defineProperty(exports, "Refunds", { enumerable: true, get: function () { return __importDefault(refunds_1).default; } });
180
+ var reserved_stocks_1 = require("./resources/reserved_stocks");
181
+ Object.defineProperty(exports, "ReservedStocks", { enumerable: true, get: function () { return __importDefault(reserved_stocks_1).default; } });
180
182
  var return_line_items_1 = require("./resources/return_line_items");
181
183
  Object.defineProperty(exports, "ReturnLineItems", { enumerable: true, get: function () { return __importDefault(return_line_items_1).default; } });
182
184
  var returns_1 = require("./resources/returns");
@@ -327,6 +329,7 @@ exports.resourceList = [
327
329
  'promotions',
328
330
  'recurring_order_copies',
329
331
  'refunds',
332
+ 'reserved_stocks',
330
333
  'return_line_items',
331
334
  'returns',
332
335
  'satispay_gateways',
@@ -1,10 +1,11 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import { type AxiosProxyConfig, type Method } from 'axios';
3
+ import { AxiosAdapter, type AxiosProxyConfig, type Method } from 'axios';
4
4
  import type { InterceptorManager } from './interceptor';
5
5
  import type { Agent as HttpAgent } from 'http';
6
6
  import type { Agent as HttpsAgent } from 'https';
7
7
  type ProxyConfig = AxiosProxyConfig | false;
8
+ type Adapter = AxiosAdapter;
8
9
  type RequestParams = Record<string, string | number | boolean>;
9
10
  type RequestHeaders = Record<string, string>;
10
11
  type RequestConfig = {
@@ -15,11 +16,14 @@ type RequestConfig = {
15
16
  proxy?: ProxyConfig;
16
17
  headers?: RequestHeaders;
17
18
  };
18
- type ApiClientInitConfig = {
19
+ type ApiConfig = {
19
20
  organization: string;
20
21
  domain?: string;
21
22
  accessToken: string;
22
- } & RequestConfig;
23
+ };
24
+ type ApiClientInitConfig = ApiConfig & RequestConfig & {
25
+ adapter?: Adapter;
26
+ };
23
27
  type ApiClientConfig = Partial<ApiClientInitConfig>;
24
28
  declare class ApiClient {
25
29
  #private;
@@ -27,7 +31,8 @@ declare class ApiClient {
27
31
  baseUrl: string;
28
32
  interceptors: InterceptorManager;
29
33
  private constructor();
30
- config(config: ApiClientConfig): void;
34
+ config(config: ApiClientConfig): ApiClient;
35
+ adapter(adapter: Adapter): ApiClient;
31
36
  request(method: Method, path: string, body?: any, options?: ApiClientConfig): Promise<any>;
32
37
  private customHeaders;
33
38
  }
package/lib/cjs/client.js CHANGED
@@ -87,6 +87,8 @@ class ApiClient {
87
87
  },
88
88
  ...axiosConfig
89
89
  };
90
+ if (options.adapter)
91
+ axiosOptions.adapter = options.adapter;
90
92
  debug('axios options: %O', axiosOptions);
91
93
  __classPrivateFieldSet(this, _ApiClient_client, axios_1.default.create(axiosOptions), "f");
92
94
  this.interceptors = __classPrivateFieldGet(this, _ApiClient_client, "f").interceptors;
@@ -112,6 +114,14 @@ class ApiClient {
112
114
  }
113
115
  if (config.headers)
114
116
  def.headers.common = this.customHeaders(config.headers);
117
+ if (config.adapter)
118
+ this.adapter(config.adapter);
119
+ return this;
120
+ }
121
+ adapter(adapter) {
122
+ if (adapter)
123
+ __classPrivateFieldGet(this, _ApiClient_client, "f").defaults.adapter = adapter;
124
+ return this;
115
125
  }
116
126
  async request(method, path, body, options) {
117
127
  debug('request %s %s, %O, %O', method, path, body || {}, options || {});
@@ -2,15 +2,15 @@ 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.9.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.10.0";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
- type SdkConfig = Record<string, unknown>;
7
+ type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
9
9
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
12
  static get openApiSchemaVersion(): string;
13
- readonly openApiSchemaVersion = "4.9.0";
13
+ readonly openApiSchemaVersion = "4.10.0";
14
14
  addresses: api.Addresses;
15
15
  adjustments: api.Adjustments;
16
16
  adyen_gateways: api.AdyenGateways;
@@ -94,6 +94,7 @@ declare class CommerceLayerClient {
94
94
  promotions: api.Promotions;
95
95
  recurring_order_copies: api.RecurringOrderCopies;
96
96
  refunds: api.Refunds;
97
+ reserved_stocks: api.ReservedStocks;
97
98
  return_line_items: api.ReturnLineItems;
98
99
  returns: api.Returns;
99
100
  satispay_gateways: api.SatispayGateways;
@@ -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.9.0';
48
+ const OPEN_API_SCHEMA_VERSION = '4.10.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; }
@@ -142,6 +142,7 @@ class CommerceLayerClient {
142
142
  this.promotions = new api.Promotions(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
143
143
  this.recurring_order_copies = new api.RecurringOrderCopies(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
144
144
  this.refunds = new api.Refunds(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
145
+ this.reserved_stocks = new api.ReservedStocks(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
145
146
  this.return_line_items = new api.ReturnLineItems(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
146
147
  this.returns = new api.Returns(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
147
148
  this.satispay_gateways = new api.SatispayGateways(__classPrivateFieldGet(this, _CommerceLayerClient_adapter, "f"));
@@ -84,6 +84,7 @@ export type { PromotionRule } from './resources/promotion_rules';
84
84
  export type { Promotion } from './resources/promotions';
85
85
  export type { RecurringOrderCopy, RecurringOrderCopyCreate, RecurringOrderCopyUpdate } from './resources/recurring_order_copies';
86
86
  export type { Refund } from './resources/refunds';
87
+ export type { ReservedStock } from './resources/reserved_stocks';
87
88
  export type { ReturnLineItem, ReturnLineItemCreate, ReturnLineItemUpdate } from './resources/return_line_items';
88
89
  export type { Return, ReturnCreate, ReturnUpdate } from './resources/returns';
89
90
  export type { SatispayGateway, SatispayGatewayCreate, SatispayGatewayUpdate } from './resources/satispay_gateways';
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
+ import type { Attachment } from './attachments';
5
6
  import type { Capture } from './captures';
6
7
  import type { Void } from './voids';
7
8
  import type { Event } from './events';
@@ -37,6 +38,7 @@ interface Authorization extends Resource {
37
38
  void_balance_float?: number | null;
38
39
  formatted_void_balance?: string | null;
39
40
  order?: Order | null;
41
+ attachments?: Attachment[] | null;
40
42
  captures?: Capture[] | null;
41
43
  voids?: Void[] | null;
42
44
  events?: Event[] | null;
@@ -50,6 +52,7 @@ declare class Authorizations extends ApiResource<Authorization> {
50
52
  static readonly TYPE: AuthorizationType;
51
53
  update(resource: AuthorizationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
52
54
  order(authorizationId: string | Authorization, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
55
+ attachments(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
53
56
  captures(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
54
57
  voids(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
55
58
  events(authorizationId: string | Authorization, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -9,6 +9,10 @@ class Authorizations extends resource_1.ApiResource {
9
9
  const _authorizationId = authorizationId.id || authorizationId;
10
10
  return this.resources.fetch({ type: 'orders' }, `authorizations/${_authorizationId}/order`, params, options);
11
11
  }
12
+ async attachments(authorizationId, params, options) {
13
+ const _authorizationId = authorizationId.id || authorizationId;
14
+ return this.resources.fetch({ type: 'attachments' }, `authorizations/${_authorizationId}/attachments`, params, options);
15
+ }
12
16
  async captures(authorizationId, params, options) {
13
17
  const _authorizationId = authorizationId.id || authorizationId;
14
18
  return this.resources.fetch({ type: 'captures' }, `authorizations/${_authorizationId}/captures`, params, options);
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
+ import type { Attachment } from './attachments';
5
6
  import type { Authorization } from './authorizations';
6
7
  import type { Refund } from './refunds';
7
8
  import type { Event } from './events';
@@ -29,6 +30,7 @@ interface Capture extends Resource {
29
30
  refund_balance_float?: number | null;
30
31
  formatted_refund_balance?: string | null;
31
32
  order?: Order | null;
33
+ attachments?: Attachment[] | null;
32
34
  reference_authorization?: Authorization | null;
33
35
  refunds?: Refund[] | null;
34
36
  events?: Event[] | null;
@@ -41,6 +43,7 @@ declare class Captures extends ApiResource<Capture> {
41
43
  static readonly TYPE: CaptureType;
42
44
  update(resource: CaptureUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
43
45
  order(captureId: string | Capture, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
46
+ attachments(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
44
47
  reference_authorization(captureId: string | Capture, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
45
48
  refunds(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
46
49
  events(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -9,6 +9,10 @@ class Captures extends resource_1.ApiResource {
9
9
  const _captureId = captureId.id || captureId;
10
10
  return this.resources.fetch({ type: 'orders' }, `captures/${_captureId}/order`, params, options);
11
11
  }
12
+ async attachments(captureId, params, options) {
13
+ const _captureId = captureId.id || captureId;
14
+ return this.resources.fetch({ type: 'attachments' }, `captures/${_captureId}/attachments`, params, options);
15
+ }
12
16
  async reference_authorization(captureId, params, options) {
13
17
  const _captureId = captureId.id || captureId;
14
18
  return this.resources.fetch({ type: 'authorizations' }, `captures/${_captureId}/reference_authorization`, params, options);
@@ -17,11 +17,13 @@ type AddressRel = ResourceRel & {
17
17
  interface CustomerAddress extends Resource {
18
18
  readonly type: CustomerAddressType;
19
19
  name?: string | null;
20
+ customer_email: string;
20
21
  customer?: Customer | null;
21
22
  address?: Address | null;
22
23
  events?: Event[] | null;
23
24
  }
24
25
  interface CustomerAddressCreate extends ResourceCreate {
26
+ customer_email: string;
25
27
  customer: CustomerRel;
26
28
  address: AddressRel;
27
29
  }
@@ -16,6 +16,7 @@ type StockLineItemRel = ResourceRel & {
16
16
  interface ParcelLineItem extends Resource {
17
17
  readonly type: ParcelLineItemType;
18
18
  sku_code?: string | null;
19
+ bundle_code?: string | null;
19
20
  quantity: number;
20
21
  name: string;
21
22
  image_url?: string | null;
@@ -27,7 +28,6 @@ interface ParcelLineItem extends Resource {
27
28
  shipment_line_item?: object;
28
29
  }
29
30
  interface ParcelLineItemCreate extends ResourceCreate {
30
- sku_code?: string | null;
31
31
  quantity: number;
32
32
  parcel: ParcelRel;
33
33
  stock_line_item: StockLineItemRel;
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
+ import type { Attachment } from './attachments';
5
6
  import type { Capture } from './captures';
6
7
  import type { Event } from './events';
7
8
  type RefundType = 'refunds';
@@ -22,12 +23,14 @@ interface Refund extends Resource {
22
23
  token?: string | null;
23
24
  gateway_transaction_id?: string | null;
24
25
  order?: Order | null;
26
+ attachments?: Attachment[] | null;
25
27
  reference_capture?: Capture | null;
26
28
  events?: Event[] | null;
27
29
  }
28
30
  declare class Refunds extends ApiResource<Refund> {
29
31
  static readonly TYPE: RefundType;
30
32
  order(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
33
+ attachments(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
31
34
  reference_capture(refundId: string | Refund, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
32
35
  events(refundId: string | Refund, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
33
36
  isRefund(resource: any): resource is Refund;
@@ -6,6 +6,10 @@ class Refunds extends resource_1.ApiResource {
6
6
  const _refundId = refundId.id || refundId;
7
7
  return this.resources.fetch({ type: 'orders' }, `refunds/${_refundId}/order`, params, options);
8
8
  }
9
+ async attachments(refundId, params, options) {
10
+ const _refundId = refundId.id || refundId;
11
+ return this.resources.fetch({ type: 'attachments' }, `refunds/${_refundId}/attachments`, params, options);
12
+ }
9
13
  async reference_capture(refundId, params, options) {
10
14
  const _refundId = refundId.id || refundId;
11
15
  return this.resources.fetch({ type: 'captures' }, `refunds/${_refundId}/reference_capture`, params, options);
@@ -0,0 +1,28 @@
1
+ import { ApiResource } from '../resource';
2
+ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
+ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
+ import type { StockItem } from './stock_items';
5
+ import type { Sku } from './skus';
6
+ import type { StockReservation } from './stock_reservations';
7
+ type ReservedStockType = 'reserved_stocks';
8
+ type ReservedStockRel = ResourceRel & {
9
+ type: ReservedStockType;
10
+ };
11
+ interface ReservedStock extends Resource {
12
+ readonly type: ReservedStockType;
13
+ quantity: number;
14
+ stock_item?: StockItem | null;
15
+ sku?: Sku | null;
16
+ stock_reservations?: StockReservation[] | null;
17
+ }
18
+ declare class ReservedStocks extends ApiResource<ReservedStock> {
19
+ static readonly TYPE: ReservedStockType;
20
+ stock_item(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
21
+ sku(reservedStockId: string | ReservedStock, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
22
+ stock_reservations(reservedStockId: string | ReservedStock, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
23
+ isReservedStock(resource: any): resource is ReservedStock;
24
+ relationship(id: string | ResourceId | null): ReservedStockRel;
25
+ type(): ReservedStockType;
26
+ }
27
+ export default ReservedStocks;
28
+ export type { ReservedStock, ReservedStockType };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const resource_1 = require("../resource");
4
+ class ReservedStocks extends resource_1.ApiResource {
5
+ async stock_item(reservedStockId, params, options) {
6
+ const _reservedStockId = reservedStockId.id || reservedStockId;
7
+ return this.resources.fetch({ type: 'stock_items' }, `reserved_stocks/${_reservedStockId}/stock_item`, params, options);
8
+ }
9
+ async sku(reservedStockId, params, options) {
10
+ const _reservedStockId = reservedStockId.id || reservedStockId;
11
+ return this.resources.fetch({ type: 'skus' }, `reserved_stocks/${_reservedStockId}/sku`, params, options);
12
+ }
13
+ async stock_reservations(reservedStockId, params, options) {
14
+ const _reservedStockId = reservedStockId.id || reservedStockId;
15
+ return this.resources.fetch({ type: 'stock_reservations' }, `reserved_stocks/${_reservedStockId}/stock_reservations`, params, options);
16
+ }
17
+ isReservedStock(resource) {
18
+ return resource.type && (resource.type === ReservedStocks.TYPE);
19
+ }
20
+ relationship(id) {
21
+ return ((id === null) || (typeof id === 'string')) ? { id, type: ReservedStocks.TYPE } : { id: id.id, type: ReservedStocks.TYPE };
22
+ }
23
+ type() {
24
+ return ReservedStocks.TYPE;
25
+ }
26
+ }
27
+ ReservedStocks.TYPE = 'reserved_stocks';
28
+ exports.default = ReservedStocks;
@@ -17,8 +17,9 @@ interface ReturnLineItem extends Resource {
17
17
  readonly type: ReturnLineItemType;
18
18
  sku_code?: string | null;
19
19
  bundle_code?: string | null;
20
- name?: string | null;
21
20
  quantity: number;
21
+ name?: string | null;
22
+ image_url?: string | null;
22
23
  return_reason?: Record<string, any> | null;
23
24
  restocked_at?: string | null;
24
25
  return?: Return | null;
@@ -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 { ReservedStock } from './reserved_stocks';
6
7
  import type { StockReservation } from './stock_reservations';
7
8
  import type { Attachment } from './attachments';
8
9
  type StockItemType = 'stock_items';
@@ -21,6 +22,7 @@ interface StockItem extends Resource {
21
22
  quantity: number;
22
23
  stock_location?: StockLocation | null;
23
24
  sku?: Sku | null;
25
+ reserved_stock?: ReservedStock | null;
24
26
  stock_reservations?: StockReservation[] | null;
25
27
  attachments?: Attachment[] | null;
26
28
  }
@@ -43,6 +45,7 @@ declare class StockItems extends ApiResource<StockItem> {
43
45
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
44
46
  stock_location(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
45
47
  sku(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
48
+ reserved_stock(stockItemId: string | StockItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
46
49
  stock_reservations(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
47
50
  attachments(stockItemId: string | StockItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
48
51
  isStockItem(resource: any): resource is StockItem;
@@ -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 reserved_stock(stockItemId, params, options) {
23
+ const _stockItemId = stockItemId.id || stockItemId;
24
+ return this.resources.fetch({ type: 'reserved_stocks' }, `stock_items/${_stockItemId}/reserved_stock`, params, options);
25
+ }
22
26
  async stock_reservations(stockItemId, params, options) {
23
27
  const _stockItemId = stockItemId.id || stockItemId;
24
28
  return this.resources.fetch({ type: 'stock_reservations' }, `stock_items/${_stockItemId}/stock_reservations`, params, options);
@@ -4,6 +4,7 @@ import type { QueryParamsRetrieve } from '../query';
4
4
  import type { Shipment } from './shipments';
5
5
  import type { LineItem } from './line_items';
6
6
  import type { StockItem } from './stock_items';
7
+ import type { Sku } from './skus';
7
8
  type StockLineItemType = 'stock_line_items';
8
9
  type StockLineItemRel = ResourceRel & {
9
10
  type: StockLineItemType;
@@ -16,12 +17,14 @@ interface StockLineItem extends Resource {
16
17
  shipment?: Shipment | null;
17
18
  line_item?: LineItem | null;
18
19
  stock_item?: StockItem | null;
20
+ sku?: Sku | null;
19
21
  }
20
22
  declare class StockLineItems extends ApiResource<StockLineItem> {
21
23
  static readonly TYPE: StockLineItemType;
22
24
  shipment(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
23
25
  line_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
24
26
  stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
27
+ sku(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
25
28
  isStockLineItem(resource: any): resource is StockLineItem;
26
29
  relationship(id: string | ResourceId | null): StockLineItemRel;
27
30
  type(): StockLineItemType;
@@ -14,6 +14,10 @@ class StockLineItems extends resource_1.ApiResource {
14
14
  const _stockLineItemId = stockLineItemId.id || stockLineItemId;
15
15
  return this.resources.fetch({ type: 'stock_items' }, `stock_line_items/${_stockLineItemId}/stock_item`, params, options);
16
16
  }
17
+ async sku(stockLineItemId, params, options) {
18
+ const _stockLineItemId = stockLineItemId.id || stockLineItemId;
19
+ return this.resources.fetch({ type: 'skus' }, `stock_line_items/${_stockLineItemId}/sku`, params, options);
20
+ }
17
21
  isStockLineItem(resource) {
18
22
  return resource.type && (resource.type === StockLineItems.TYPE);
19
23
  }
@@ -4,6 +4,7 @@ import type { QueryParamsRetrieve } from '../query';
4
4
  import type { LineItem } from './line_items';
5
5
  import type { Order } from './orders';
6
6
  import type { StockItem } from './stock_items';
7
+ import type { ReservedStock } from './reserved_stocks';
7
8
  import type { Sku } from './skus';
8
9
  type StockReservationType = 'stock_reservations';
9
10
  type StockReservationRel = ResourceRel & {
@@ -17,6 +18,7 @@ interface StockReservation extends Resource {
17
18
  line_item?: LineItem | null;
18
19
  order?: Order | null;
19
20
  stock_item?: StockItem | null;
21
+ reserved_stock?: ReservedStock | null;
20
22
  sku?: Sku | null;
21
23
  }
22
24
  declare class StockReservations extends ApiResource<StockReservation> {
@@ -24,6 +26,7 @@ declare class StockReservations extends ApiResource<StockReservation> {
24
26
  line_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
25
27
  order(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
26
28
  stock_item(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
29
+ reserved_stock(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReservedStock>;
27
30
  sku(stockReservationId: string | StockReservation, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
28
31
  isStockReservation(resource: any): resource is StockReservation;
29
32
  relationship(id: string | ResourceId | null): StockReservationRel;
@@ -14,6 +14,10 @@ class StockReservations extends resource_1.ApiResource {
14
14
  const _stockReservationId = stockReservationId.id || stockReservationId;
15
15
  return this.resources.fetch({ type: 'stock_items' }, `stock_reservations/${_stockReservationId}/stock_item`, params, options);
16
16
  }
17
+ async reserved_stock(stockReservationId, params, options) {
18
+ const _stockReservationId = stockReservationId.id || stockReservationId;
19
+ return this.resources.fetch({ type: 'reserved_stocks' }, `stock_reservations/${_stockReservationId}/reserved_stock`, params, options);
20
+ }
17
21
  async sku(stockReservationId, params, options) {
18
22
  const _stockReservationId = stockReservationId.id || stockReservationId;
19
23
  return this.resources.fetch({ type: 'skus' }, `stock_reservations/${_stockReservationId}/sku`, params, options);
@@ -1,7 +1,8 @@
1
1
  import { ApiResource } from '../resource';
2
- import type { Resource, ResourceId, ResourcesConfig, ResourceRel } from '../resource';
3
- import type { QueryParamsRetrieve } from '../query';
2
+ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
+ import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
+ import type { Attachment } from './attachments';
5
6
  type TransactionType = 'transactions';
6
7
  type TransactionRel = ResourceRel & {
7
8
  type: TransactionType;
@@ -20,10 +21,12 @@ interface Transaction extends Resource {
20
21
  token?: string | null;
21
22
  gateway_transaction_id?: string | null;
22
23
  order?: Order | null;
24
+ attachments?: Attachment[] | null;
23
25
  }
24
26
  declare class Transactions extends ApiResource<Transaction> {
25
27
  static readonly TYPE: TransactionType;
26
28
  order(transactionId: string | Transaction, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
29
+ attachments(transactionId: string | Transaction, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
27
30
  isTransaction(resource: any): resource is Transaction;
28
31
  relationship(id: string | ResourceId | null): TransactionRel;
29
32
  type(): TransactionType;
@@ -6,6 +6,10 @@ class Transactions extends resource_1.ApiResource {
6
6
  const _transactionId = transactionId.id || transactionId;
7
7
  return this.resources.fetch({ type: 'orders' }, `transactions/${_transactionId}/order`, params, options);
8
8
  }
9
+ async attachments(transactionId, params, options) {
10
+ const _transactionId = transactionId.id || transactionId;
11
+ return this.resources.fetch({ type: 'attachments' }, `transactions/${_transactionId}/attachments`, params, options);
12
+ }
9
13
  isTransaction(resource) {
10
14
  return resource.type && (resource.type === Transactions.TYPE);
11
15
  }
@@ -2,6 +2,7 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Order } from './orders';
5
+ import type { Attachment } from './attachments';
5
6
  import type { Authorization } from './authorizations';
6
7
  import type { Event } from './events';
7
8
  type VoidType = 'voids';
@@ -22,12 +23,14 @@ interface Void extends Resource {
22
23
  token?: string | null;
23
24
  gateway_transaction_id?: string | null;
24
25
  order?: Order | null;
26
+ attachments?: Attachment[] | null;
25
27
  reference_authorization?: Authorization | null;
26
28
  events?: Event[] | null;
27
29
  }
28
30
  declare class Voids extends ApiResource<Void> {
29
31
  static readonly TYPE: VoidType;
30
32
  order(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
33
+ attachments(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
31
34
  reference_authorization(voidId: string | Void, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
32
35
  events(voidId: string | Void, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
33
36
  isVoid(resource: any): resource is Void;
@@ -6,6 +6,10 @@ class Voids extends resource_1.ApiResource {
6
6
  const _voidId = voidId.id || voidId;
7
7
  return this.resources.fetch({ type: 'orders' }, `voids/${_voidId}/order`, params, options);
8
8
  }
9
+ async attachments(voidId, params, options) {
10
+ const _voidId = voidId.id || voidId;
11
+ return this.resources.fetch({ type: 'attachments' }, `voids/${_voidId}/attachments`, params, options);
12
+ }
9
13
  async reference_authorization(voidId, params, options) {
10
14
  const _voidId = voidId.id || voidId;
11
15
  return this.resources.fetch({ type: 'authorizations' }, `voids/${_voidId}/reference_authorization`, params, options);