@commercelayer/sdk 5.0.0-beta.12 → 5.0.0-beta.14

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 (45) hide show
  1. package/lib/cjs/commercelayer.d.ts +2 -2
  2. package/lib/cjs/commercelayer.js +1 -1
  3. package/lib/cjs/common.d.ts +3 -0
  4. package/lib/cjs/interceptor.d.ts +1 -1
  5. package/lib/cjs/resources/cleanups.d.ts +1 -1
  6. package/lib/cjs/resources/customers.d.ts +1 -1
  7. package/lib/cjs/resources/exports.d.ts +1 -1
  8. package/lib/cjs/resources/gift_cards.d.ts +1 -1
  9. package/lib/cjs/resources/imports.d.ts +1 -1
  10. package/lib/cjs/resources/in_stock_subscriptions.d.ts +1 -1
  11. package/lib/cjs/resources/line_items.d.ts +2 -2
  12. package/lib/cjs/resources/order_copies.d.ts +1 -1
  13. package/lib/cjs/resources/order_factories.d.ts +1 -1
  14. package/lib/cjs/resources/order_subscriptions.d.ts +1 -1
  15. package/lib/cjs/resources/orders.d.ts +3 -3
  16. package/lib/cjs/resources/paypal_payments.d.ts +1 -1
  17. package/lib/cjs/resources/recurring_order_copies.d.ts +1 -1
  18. package/lib/cjs/resources/returns.d.ts +1 -1
  19. package/lib/cjs/resources/shipments.d.ts +1 -1
  20. package/lib/cjs/resources/stock_transfers.d.ts +1 -1
  21. package/lib/cjs/util.d.ts +1 -3
  22. package/lib/esm/commercelayer.d.ts +2 -2
  23. package/lib/esm/commercelayer.js +1 -1
  24. package/lib/esm/common.d.ts +3 -0
  25. package/lib/esm/interceptor.d.ts +1 -1
  26. package/lib/esm/resources/cleanups.d.ts +1 -1
  27. package/lib/esm/resources/customers.d.ts +1 -1
  28. package/lib/esm/resources/exports.d.ts +1 -1
  29. package/lib/esm/resources/gift_cards.d.ts +1 -1
  30. package/lib/esm/resources/imports.d.ts +1 -1
  31. package/lib/esm/resources/in_stock_subscriptions.d.ts +1 -1
  32. package/lib/esm/resources/line_items.d.ts +2 -2
  33. package/lib/esm/resources/order_copies.d.ts +1 -1
  34. package/lib/esm/resources/order_factories.d.ts +1 -1
  35. package/lib/esm/resources/order_subscriptions.d.ts +1 -1
  36. package/lib/esm/resources/orders.d.ts +3 -3
  37. package/lib/esm/resources/paypal_payments.d.ts +1 -1
  38. package/lib/esm/resources/recurring_order_copies.d.ts +1 -1
  39. package/lib/esm/resources/returns.d.ts +1 -1
  40. package/lib/esm/resources/shipments.d.ts +1 -1
  41. package/lib/esm/resources/stock_transfers.d.ts +1 -1
  42. package/lib/esm/util.d.ts +1 -3
  43. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  44. package/lib/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +3 -3
@@ -2,7 +2,7 @@ import * as api from './api';
2
2
  import type { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import type { ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.1.1";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.1.3";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
12
  static get openApiSchemaVersion(): string;
13
- readonly openApiSchemaVersion = "4.1.1";
13
+ readonly openApiSchemaVersion = "4.1.3";
14
14
  addresses: api.Addresses;
15
15
  adjustments: api.Adjustments;
16
16
  adyen_gateways: api.AdyenGateways;
@@ -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.1.1';
48
+ const OPEN_API_SCHEMA_VERSION = '4.1.3';
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; }
@@ -2,3 +2,6 @@ import type { ResourceId, ResourceType } from './resource';
2
2
  declare const isResourceId: (resource: any) => resource is ResourceId;
3
3
  declare const isResourceType: (resource: any) => resource is ResourceType;
4
4
  export { isResourceId, isResourceType };
5
+ export type ObjectType = {
6
+ [key: string]: any;
7
+ };
@@ -1,4 +1,4 @@
1
- import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, RawAxiosResponseHeaders } from 'axios';
1
+ import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, RawAxiosResponseHeaders } from 'axios';
2
2
  type InterceptorManager = {
3
3
  request: AxiosInterceptorManager<AxiosRequestConfig>;
4
4
  response: AxiosInterceptorManager<any>;
@@ -8,7 +8,7 @@ type CleanupRel = ResourceRel & {
8
8
  interface Cleanup extends Resource {
9
9
  readonly type: CleanupType;
10
10
  resource_type: string;
11
- status?: 'pending' | 'in_progress' | 'interrupted' | 'completed' | null;
11
+ status: 'pending' | 'in_progress' | 'interrupted' | 'completed';
12
12
  started_at?: string | null;
13
13
  completed_at?: string | null;
14
14
  interrupted_at?: string | null;
@@ -20,7 +20,7 @@ type CustomerGroupRel = ResourceRel & {
20
20
  interface Customer extends Resource {
21
21
  readonly type: CustomerType;
22
22
  email: string;
23
- status?: 'prospect' | 'acquired' | 'repeat' | null;
23
+ status: 'prospect' | 'acquired' | 'repeat';
24
24
  has_password?: boolean | null;
25
25
  customer_group?: CustomerGroup | null;
26
26
  customer_addresses?: CustomerAddress[] | null;
@@ -9,7 +9,7 @@ interface Export extends Resource {
9
9
  readonly type: ExportType;
10
10
  resource_type: string;
11
11
  format?: string | null;
12
- status?: 'pending' | 'in_progress' | 'completed' | null;
12
+ status: 'pending' | 'in_progress' | 'completed';
13
13
  includes?: string[] | null;
14
14
  filters?: object | null;
15
15
  dry_data?: boolean | null;
@@ -16,7 +16,7 @@ type GiftCardRecipientRel = ResourceRel & {
16
16
  };
17
17
  interface GiftCard extends Resource {
18
18
  readonly type: GiftCardType;
19
- status?: 'draft' | 'inactive' | 'active' | 'redeemed' | null;
19
+ status: 'draft' | 'inactive' | 'active' | 'redeemed';
20
20
  code?: string | null;
21
21
  currency_code?: string | null;
22
22
  initial_balance_cents: number;
@@ -9,7 +9,7 @@ interface Import extends Resource {
9
9
  readonly type: ImportType;
10
10
  resource_type: string;
11
11
  parent_resource_id?: string | null;
12
- status?: 'pending' | 'in_progress' | 'interrupted' | 'completed' | null;
12
+ status: 'pending' | 'in_progress' | 'interrupted' | 'completed';
13
13
  started_at?: string | null;
14
14
  completed_at?: string | null;
15
15
  interrupted_at?: string | null;
@@ -19,7 +19,7 @@ type SkuRel = ResourceRel & {
19
19
  };
20
20
  interface InStockSubscription extends Resource {
21
21
  readonly type: InStockSubscriptionType;
22
- status?: 'active' | 'inactive' | 'notified' | null;
22
+ status: 'active' | 'inactive' | 'notified';
23
23
  customer_email?: string | null;
24
24
  sku_code?: string | null;
25
25
  stock_threshold?: number | null;
@@ -77,7 +77,7 @@ interface LineItem extends Resource {
77
77
  discount_breakdown?: object | null;
78
78
  tax_rate?: number | null;
79
79
  tax_breakdown?: object | null;
80
- item_type?: 'sku' | 'bundle' | 'shipment' | 'payment_method' | 'adjustment' | 'gift_card' | 'percentage_discount_promotion' | 'free_shipping_promotion' | 'free_gift_promotion' | 'fixed_price_promotion' | 'external_promotion' | 'fixed_amount_promotion' | null;
80
+ item_type?: 'skus' | 'bundles' | 'shipments' | 'payment_methods' | 'adjustments' | 'gift_cards' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | null;
81
81
  frequency?: string | null;
82
82
  order?: Order | null;
83
83
  item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku | null;
@@ -98,7 +98,7 @@ interface LineItemCreate extends ResourceCreate {
98
98
  unit_amount_cents?: number | null;
99
99
  name?: string | null;
100
100
  image_url?: string | null;
101
- item_type?: 'sku' | 'bundle' | 'shipment' | 'payment_method' | 'adjustment' | 'gift_card' | 'percentage_discount_promotion' | 'free_shipping_promotion' | 'free_gift_promotion' | 'fixed_price_promotion' | 'external_promotion' | 'fixed_amount_promotion' | null;
101
+ item_type?: 'skus' | 'bundles' | 'shipments' | 'payment_methods' | 'adjustments' | 'gift_cards' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | null;
102
102
  frequency?: string | null;
103
103
  order: OrderRel;
104
104
  item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel | null;
@@ -12,7 +12,7 @@ type OrderRel = ResourceRel & {
12
12
  };
13
13
  interface OrderCopy extends Resource {
14
14
  readonly type: OrderCopyType;
15
- status?: 'pending' | 'in_progress' | 'failed' | 'completed' | null;
15
+ status: 'pending' | 'in_progress' | 'failed' | 'completed';
16
16
  started_at?: string | null;
17
17
  completed_at?: string | null;
18
18
  failed_at?: string | null;
@@ -8,7 +8,7 @@ type OrderFactoryRel = ResourceRel & {
8
8
  };
9
9
  interface OrderFactory extends Resource {
10
10
  readonly type: OrderFactoryType;
11
- status?: string | null;
11
+ status: 'pending' | 'in_progress' | 'failed' | 'completed';
12
12
  started_at?: string | null;
13
13
  completed_at?: string | null;
14
14
  failed_at?: string | null;
@@ -25,7 +25,7 @@ type CustomerPaymentSourceRel = ResourceRel & {
25
25
  interface OrderSubscription extends Resource {
26
26
  readonly type: OrderSubscriptionType;
27
27
  number?: string | null;
28
- status?: 'draft' | 'inactive' | 'active' | 'cancelled' | null;
28
+ status: 'draft' | 'inactive' | 'active' | 'cancelled';
29
29
  frequency: string;
30
30
  activate_by_source_order?: boolean | null;
31
31
  customer_email?: string | null;
@@ -80,9 +80,9 @@ interface Order extends Resource {
80
80
  readonly type: OrderType;
81
81
  number?: number | null;
82
82
  autorefresh?: boolean | null;
83
- status?: 'draft' | 'pending' | 'placed' | 'approved' | 'cancelled' | null;
84
- payment_status?: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free' | null;
85
- fulfillment_status?: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required' | null;
83
+ status: 'draft' | 'pending' | 'placed' | 'approved' | 'cancelled';
84
+ payment_status: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free';
85
+ fulfillment_status: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required';
86
86
  guest?: boolean | null;
87
87
  editable?: boolean | null;
88
88
  customer_email?: string | null;
@@ -17,7 +17,7 @@ interface PaypalPayment extends Resource {
17
17
  paypal_payer_id?: string | null;
18
18
  name?: string | null;
19
19
  paypal_id?: string | null;
20
- status?: 'created' | 'approved' | null;
20
+ status: 'created' | 'approved';
21
21
  approval_url?: string | null;
22
22
  mismatched_amounts?: boolean | null;
23
23
  intent_amount_cents: number;
@@ -15,7 +15,7 @@ type OrderSubscriptionRel = ResourceRel & {
15
15
  };
16
16
  interface RecurringOrderCopy extends Resource {
17
17
  readonly type: RecurringOrderCopyType;
18
- status?: string | null;
18
+ status: 'pending' | 'in_progress' | 'failed' | 'completed';
19
19
  started_at?: string | null;
20
20
  completed_at?: string | null;
21
21
  failed_at?: string | null;
@@ -20,7 +20,7 @@ type StockLocationRel = ResourceRel & {
20
20
  interface Return extends Resource {
21
21
  readonly type: ReturnType;
22
22
  number?: string | null;
23
- status?: 'draft' | 'requested' | 'approved' | 'cancelled' | 'shipped' | 'rejected' | 'received' | null;
23
+ status: 'draft' | 'requested' | 'approved' | 'cancelled' | 'shipped' | 'rejected' | 'received';
24
24
  customer_email?: string | null;
25
25
  skus_count?: number | null;
26
26
  approved_at?: string | null;
@@ -22,7 +22,7 @@ type ShippingMethodRel = ResourceRel & {
22
22
  interface Shipment extends Resource {
23
23
  readonly type: ShipmentType;
24
24
  number?: string | null;
25
- status?: 'draft' | 'upcoming' | 'cancelled' | 'on_hold' | 'picking' | 'packing' | 'ready_to_ship' | 'shipped' | null;
25
+ status: 'draft' | 'upcoming' | 'cancelled' | 'on_hold' | 'picking' | 'packing' | 'ready_to_ship' | 'shipped';
26
26
  currency_code?: string | null;
27
27
  cost_amount_cents?: number | null;
28
28
  cost_amount_float?: number | null;
@@ -24,7 +24,7 @@ type LineItemRel = ResourceRel & {
24
24
  interface StockTransfer extends Resource {
25
25
  readonly type: StockTransferType;
26
26
  sku_code?: string | null;
27
- status?: 'draft' | 'upcoming' | 'picking' | 'in_transit' | 'completed' | 'cancelled' | null;
27
+ status: 'draft' | 'upcoming' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
28
28
  quantity: number;
29
29
  completed_at?: string | null;
30
30
  cancelled_at?: string | null;
package/lib/cjs/util.d.ts CHANGED
@@ -2,9 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
4
  /// <reference types="node" />
5
- type ObjectType = {
6
- [key: string]: any;
7
- };
5
+ import type { ObjectType } from "./common";
8
6
  declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
9
7
  declare const sortObjectFields: (obj: ObjectType) => ObjectType;
10
8
  export { sleep, sortObjectFields };
@@ -2,7 +2,7 @@ import * as api from './api';
2
2
  import type { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import type { ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.1.1";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.1.3";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
12
  static get openApiSchemaVersion(): string;
13
- readonly openApiSchemaVersion = "4.1.1";
13
+ readonly openApiSchemaVersion = "4.1.3";
14
14
  addresses: api.Addresses;
15
15
  adjustments: api.Adjustments;
16
16
  adyen_gateways: api.AdyenGateways;
@@ -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.1.1';
19
+ const OPEN_API_SCHEMA_VERSION = '4.1.3';
20
20
  export { OPEN_API_SCHEMA_VERSION };
21
21
  class CommerceLayerClient {
22
22
  static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
@@ -2,3 +2,6 @@ import type { ResourceId, ResourceType } from './resource';
2
2
  declare const isResourceId: (resource: any) => resource is ResourceId;
3
3
  declare const isResourceType: (resource: any) => resource is ResourceType;
4
4
  export { isResourceId, isResourceType };
5
+ export type ObjectType = {
6
+ [key: string]: any;
7
+ };
@@ -1,4 +1,4 @@
1
- import { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, RawAxiosResponseHeaders } from 'axios';
1
+ import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, RawAxiosResponseHeaders } from 'axios';
2
2
  type InterceptorManager = {
3
3
  request: AxiosInterceptorManager<AxiosRequestConfig>;
4
4
  response: AxiosInterceptorManager<any>;
@@ -8,7 +8,7 @@ type CleanupRel = ResourceRel & {
8
8
  interface Cleanup extends Resource {
9
9
  readonly type: CleanupType;
10
10
  resource_type: string;
11
- status?: 'pending' | 'in_progress' | 'interrupted' | 'completed' | null;
11
+ status: 'pending' | 'in_progress' | 'interrupted' | 'completed';
12
12
  started_at?: string | null;
13
13
  completed_at?: string | null;
14
14
  interrupted_at?: string | null;
@@ -20,7 +20,7 @@ type CustomerGroupRel = ResourceRel & {
20
20
  interface Customer extends Resource {
21
21
  readonly type: CustomerType;
22
22
  email: string;
23
- status?: 'prospect' | 'acquired' | 'repeat' | null;
23
+ status: 'prospect' | 'acquired' | 'repeat';
24
24
  has_password?: boolean | null;
25
25
  customer_group?: CustomerGroup | null;
26
26
  customer_addresses?: CustomerAddress[] | null;
@@ -9,7 +9,7 @@ interface Export extends Resource {
9
9
  readonly type: ExportType;
10
10
  resource_type: string;
11
11
  format?: string | null;
12
- status?: 'pending' | 'in_progress' | 'completed' | null;
12
+ status: 'pending' | 'in_progress' | 'completed';
13
13
  includes?: string[] | null;
14
14
  filters?: object | null;
15
15
  dry_data?: boolean | null;
@@ -16,7 +16,7 @@ type GiftCardRecipientRel = ResourceRel & {
16
16
  };
17
17
  interface GiftCard extends Resource {
18
18
  readonly type: GiftCardType;
19
- status?: 'draft' | 'inactive' | 'active' | 'redeemed' | null;
19
+ status: 'draft' | 'inactive' | 'active' | 'redeemed';
20
20
  code?: string | null;
21
21
  currency_code?: string | null;
22
22
  initial_balance_cents: number;
@@ -9,7 +9,7 @@ interface Import extends Resource {
9
9
  readonly type: ImportType;
10
10
  resource_type: string;
11
11
  parent_resource_id?: string | null;
12
- status?: 'pending' | 'in_progress' | 'interrupted' | 'completed' | null;
12
+ status: 'pending' | 'in_progress' | 'interrupted' | 'completed';
13
13
  started_at?: string | null;
14
14
  completed_at?: string | null;
15
15
  interrupted_at?: string | null;
@@ -19,7 +19,7 @@ type SkuRel = ResourceRel & {
19
19
  };
20
20
  interface InStockSubscription extends Resource {
21
21
  readonly type: InStockSubscriptionType;
22
- status?: 'active' | 'inactive' | 'notified' | null;
22
+ status: 'active' | 'inactive' | 'notified';
23
23
  customer_email?: string | null;
24
24
  sku_code?: string | null;
25
25
  stock_threshold?: number | null;
@@ -77,7 +77,7 @@ interface LineItem extends Resource {
77
77
  discount_breakdown?: object | null;
78
78
  tax_rate?: number | null;
79
79
  tax_breakdown?: object | null;
80
- item_type?: 'sku' | 'bundle' | 'shipment' | 'payment_method' | 'adjustment' | 'gift_card' | 'percentage_discount_promotion' | 'free_shipping_promotion' | 'free_gift_promotion' | 'fixed_price_promotion' | 'external_promotion' | 'fixed_amount_promotion' | null;
80
+ item_type?: 'skus' | 'bundles' | 'shipments' | 'payment_methods' | 'adjustments' | 'gift_cards' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | null;
81
81
  frequency?: string | null;
82
82
  order?: Order | null;
83
83
  item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku | null;
@@ -98,7 +98,7 @@ interface LineItemCreate extends ResourceCreate {
98
98
  unit_amount_cents?: number | null;
99
99
  name?: string | null;
100
100
  image_url?: string | null;
101
- item_type?: 'sku' | 'bundle' | 'shipment' | 'payment_method' | 'adjustment' | 'gift_card' | 'percentage_discount_promotion' | 'free_shipping_promotion' | 'free_gift_promotion' | 'fixed_price_promotion' | 'external_promotion' | 'fixed_amount_promotion' | null;
101
+ item_type?: 'skus' | 'bundles' | 'shipments' | 'payment_methods' | 'adjustments' | 'gift_cards' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | null;
102
102
  frequency?: string | null;
103
103
  order: OrderRel;
104
104
  item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel | null;
@@ -12,7 +12,7 @@ type OrderRel = ResourceRel & {
12
12
  };
13
13
  interface OrderCopy extends Resource {
14
14
  readonly type: OrderCopyType;
15
- status?: 'pending' | 'in_progress' | 'failed' | 'completed' | null;
15
+ status: 'pending' | 'in_progress' | 'failed' | 'completed';
16
16
  started_at?: string | null;
17
17
  completed_at?: string | null;
18
18
  failed_at?: string | null;
@@ -8,7 +8,7 @@ type OrderFactoryRel = ResourceRel & {
8
8
  };
9
9
  interface OrderFactory extends Resource {
10
10
  readonly type: OrderFactoryType;
11
- status?: string | null;
11
+ status: 'pending' | 'in_progress' | 'failed' | 'completed';
12
12
  started_at?: string | null;
13
13
  completed_at?: string | null;
14
14
  failed_at?: string | null;
@@ -25,7 +25,7 @@ type CustomerPaymentSourceRel = ResourceRel & {
25
25
  interface OrderSubscription extends Resource {
26
26
  readonly type: OrderSubscriptionType;
27
27
  number?: string | null;
28
- status?: 'draft' | 'inactive' | 'active' | 'cancelled' | null;
28
+ status: 'draft' | 'inactive' | 'active' | 'cancelled';
29
29
  frequency: string;
30
30
  activate_by_source_order?: boolean | null;
31
31
  customer_email?: string | null;
@@ -80,9 +80,9 @@ interface Order extends Resource {
80
80
  readonly type: OrderType;
81
81
  number?: number | null;
82
82
  autorefresh?: boolean | null;
83
- status?: 'draft' | 'pending' | 'placed' | 'approved' | 'cancelled' | null;
84
- payment_status?: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free' | null;
85
- fulfillment_status?: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required' | null;
83
+ status: 'draft' | 'pending' | 'placed' | 'approved' | 'cancelled';
84
+ payment_status: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free';
85
+ fulfillment_status: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required';
86
86
  guest?: boolean | null;
87
87
  editable?: boolean | null;
88
88
  customer_email?: string | null;
@@ -17,7 +17,7 @@ interface PaypalPayment extends Resource {
17
17
  paypal_payer_id?: string | null;
18
18
  name?: string | null;
19
19
  paypal_id?: string | null;
20
- status?: 'created' | 'approved' | null;
20
+ status: 'created' | 'approved';
21
21
  approval_url?: string | null;
22
22
  mismatched_amounts?: boolean | null;
23
23
  intent_amount_cents: number;
@@ -15,7 +15,7 @@ type OrderSubscriptionRel = ResourceRel & {
15
15
  };
16
16
  interface RecurringOrderCopy extends Resource {
17
17
  readonly type: RecurringOrderCopyType;
18
- status?: string | null;
18
+ status: 'pending' | 'in_progress' | 'failed' | 'completed';
19
19
  started_at?: string | null;
20
20
  completed_at?: string | null;
21
21
  failed_at?: string | null;
@@ -20,7 +20,7 @@ type StockLocationRel = ResourceRel & {
20
20
  interface Return extends Resource {
21
21
  readonly type: ReturnType;
22
22
  number?: string | null;
23
- status?: 'draft' | 'requested' | 'approved' | 'cancelled' | 'shipped' | 'rejected' | 'received' | null;
23
+ status: 'draft' | 'requested' | 'approved' | 'cancelled' | 'shipped' | 'rejected' | 'received';
24
24
  customer_email?: string | null;
25
25
  skus_count?: number | null;
26
26
  approved_at?: string | null;
@@ -22,7 +22,7 @@ type ShippingMethodRel = ResourceRel & {
22
22
  interface Shipment extends Resource {
23
23
  readonly type: ShipmentType;
24
24
  number?: string | null;
25
- status?: 'draft' | 'upcoming' | 'cancelled' | 'on_hold' | 'picking' | 'packing' | 'ready_to_ship' | 'shipped' | null;
25
+ status: 'draft' | 'upcoming' | 'cancelled' | 'on_hold' | 'picking' | 'packing' | 'ready_to_ship' | 'shipped';
26
26
  currency_code?: string | null;
27
27
  cost_amount_cents?: number | null;
28
28
  cost_amount_float?: number | null;
@@ -24,7 +24,7 @@ type LineItemRel = ResourceRel & {
24
24
  interface StockTransfer extends Resource {
25
25
  readonly type: StockTransferType;
26
26
  sku_code?: string | null;
27
- status?: 'draft' | 'upcoming' | 'picking' | 'in_transit' | 'completed' | 'cancelled' | null;
27
+ status: 'draft' | 'upcoming' | 'picking' | 'in_transit' | 'completed' | 'cancelled';
28
28
  quantity: number;
29
29
  completed_at?: string | null;
30
30
  cancelled_at?: string | null;
package/lib/esm/util.d.ts CHANGED
@@ -2,9 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
4
  /// <reference types="node" />
5
- type ObjectType = {
6
- [key: string]: any;
7
- };
5
+ import type { ObjectType } from "./common";
8
6
  declare const sleep: (ms: number) => Promise<NodeJS.Timeout>;
9
7
  declare const sortObjectFields: (obj: ObjectType) => ObjectType;
10
8
  export { sleep, sortObjectFields };