@commercelayer/sdk 4.47.0 → 4.48.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.
@@ -2,7 +2,7 @@ import * as api from './api';
2
2
  import { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "5.1.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "5.2.1";
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 = "5.1.0";
13
+ readonly openApiSchemaVersion = "5.2.1";
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 = '5.1.0';
48
+ const OPEN_API_SCHEMA_VERSION = '5.2.1';
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; }
@@ -17,9 +17,6 @@ interface AxervePayment extends Resource {
17
17
  buyer_details?: object;
18
18
  request_token?: boolean;
19
19
  mismatched_amounts?: boolean;
20
- intent_amount_cents?: number;
21
- intent_amount_float?: number;
22
- formatted_intent_amount?: string;
23
20
  payment_instrument?: object;
24
21
  order?: Order;
25
22
  payment_gateway?: PaymentGateway;
@@ -15,9 +15,6 @@ interface KlarnaPayment extends Resource {
15
15
  payment_methods?: object[];
16
16
  auth_token?: string;
17
17
  mismatched_amounts?: boolean;
18
- intent_amount_cents?: number;
19
- intent_amount_float?: number;
20
- formatted_intent_amount?: string;
21
18
  payment_instrument?: object;
22
19
  order?: Order;
23
20
  payment_gateway?: PaymentGateway;
@@ -21,6 +21,8 @@ type SkuRel = ResourceRel & {
21
21
  type: 'skus';
22
22
  };
23
23
  interface OrderSubscriptionItem extends Resource {
24
+ sku_code?: string;
25
+ bundle_code?: string;
24
26
  quantity?: number;
25
27
  unit_amount_cents?: number;
26
28
  unit_amount_float?: number;
@@ -32,6 +34,7 @@ interface OrderSubscriptionItem extends Resource {
32
34
  item?: Adjustment | Bundle | Sku;
33
35
  sku?: Sku;
34
36
  bundle?: Bundle;
37
+ adjustment?: Adjustment;
35
38
  source_line_item?: LineItem;
36
39
  }
37
40
  interface OrderSubscriptionItemCreate extends ResourceCreate {
@@ -43,6 +46,7 @@ interface OrderSubscriptionItemCreate extends ResourceCreate {
43
46
  item: AdjustmentRel | BundleRel | SkuRel;
44
47
  sku?: SkuRel;
45
48
  bundle?: BundleRel;
49
+ adjustment?: AdjustmentRel;
46
50
  }
47
51
  interface OrderSubscriptionItemUpdate extends ResourceUpdate {
48
52
  sku_code?: string;
@@ -27,6 +27,7 @@ interface OrderSubscription extends Resource {
27
27
  status?: string;
28
28
  frequency?: string;
29
29
  activate_by_source_order?: boolean;
30
+ place_target_order?: boolean;
30
31
  customer_email?: string;
31
32
  starts_at?: string;
32
33
  expires_at?: string;
@@ -35,7 +36,6 @@ interface OrderSubscription extends Resource {
35
36
  occurrencies?: number;
36
37
  errors_count?: number;
37
38
  succeeded_on_last_run?: boolean;
38
- options?: object;
39
39
  market?: Market;
40
40
  subscription_model?: SubscriptionModel;
41
41
  source_order?: Order;
@@ -51,14 +51,16 @@ interface OrderSubscription extends Resource {
51
51
  interface OrderSubscriptionCreate extends ResourceCreate {
52
52
  frequency: string;
53
53
  activate_by_source_order?: boolean;
54
+ place_target_order?: boolean;
54
55
  starts_at?: string;
55
56
  expires_at?: string;
56
- options?: object;
57
57
  market?: MarketRel;
58
58
  source_order: OrderRel;
59
59
  }
60
60
  interface OrderSubscriptionUpdate extends ResourceUpdate {
61
61
  frequency?: string;
62
+ activate_by_source_order?: boolean;
63
+ place_target_order?: boolean;
62
64
  expires_at?: string;
63
65
  next_run_at?: string;
64
66
  _activate?: boolean;
@@ -19,9 +19,6 @@ interface PaypalPayment extends Resource {
19
19
  status?: string;
20
20
  approval_url?: string;
21
21
  mismatched_amounts?: boolean;
22
- intent_amount_cents?: number;
23
- intent_amount_float?: number;
24
- formatted_intent_amount?: string;
25
22
  payment_instrument?: object;
26
23
  order?: Order;
27
24
  payment_gateway?: PaymentGateway;
@@ -7,6 +7,9 @@ import type { PriceVolumeTier } from './price_volume_tiers';
7
7
  import type { PriceFrequencyTier } from './price_frequency_tiers';
8
8
  import type { Attachment } from './attachments';
9
9
  import type { Version } from './versions';
10
+ import type { Customer } from './customers';
11
+ import type { Market } from './markets';
12
+ import type { StockLocation } from './stock_locations';
10
13
  type PriceRel = ResourceRel & {
11
14
  type: typeof Prices.TYPE;
12
15
  };
@@ -35,6 +38,9 @@ interface Price extends Resource {
35
38
  price_frequency_tiers?: PriceFrequencyTier[];
36
39
  attachments?: Attachment[];
37
40
  versions?: Version[];
41
+ jwt_customer?: Customer;
42
+ jwt_markets?: Market[];
43
+ jwt_stock_locations?: StockLocation[];
38
44
  }
39
45
  interface PriceCreate extends ResourceCreate {
40
46
  sku_code?: string;
@@ -66,6 +72,9 @@ declare class Prices extends ApiResource {
66
72
  price_frequency_tiers(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceFrequencyTier>>;
67
73
  attachments(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
68
74
  versions(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
75
+ jwt_customer(priceId: string | Price, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
76
+ jwt_markets(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
77
+ jwt_stock_locations(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLocation>>;
69
78
  isPrice(resource: any): resource is Price;
70
79
  relationship(id: string | ResourceId | null): PriceRel;
71
80
  type(): string;
@@ -46,6 +46,18 @@ class Prices extends resource_1.ApiResource {
46
46
  const _priceId = priceId.id || priceId;
47
47
  return this.resources.fetch({ type: 'versions' }, `prices/${_priceId}/versions`, params, options);
48
48
  }
49
+ async jwt_customer(priceId, params, options) {
50
+ const _priceId = priceId.id || priceId;
51
+ return this.resources.fetch({ type: 'customers' }, `prices/${_priceId}/jwt_customer`, params, options);
52
+ }
53
+ async jwt_markets(priceId, params, options) {
54
+ const _priceId = priceId.id || priceId;
55
+ return this.resources.fetch({ type: 'markets' }, `prices/${_priceId}/jwt_markets`, params, options);
56
+ }
57
+ async jwt_stock_locations(priceId, params, options) {
58
+ const _priceId = priceId.id || priceId;
59
+ return this.resources.fetch({ type: 'stock_locations' }, `prices/${_priceId}/jwt_stock_locations`, params, options);
60
+ }
49
61
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
50
62
  isPrice(resource) {
51
63
  return resource.type && (resource.type === Prices.TYPE);
@@ -15,9 +15,6 @@ interface SatispayPayment extends Resource {
15
15
  status?: string;
16
16
  redirect_url?: string;
17
17
  payment_url?: string;
18
- intent_amount_cents?: number;
19
- intent_amount_float?: number;
20
- formatted_intent_amount?: string;
21
18
  payment_response?: object;
22
19
  order?: Order;
23
20
  payment_gateway?: PaymentGateway;
@@ -34,6 +34,7 @@ interface StockItemCreate extends ResourceCreate {
34
34
  interface StockItemUpdate extends ResourceUpdate {
35
35
  sku_code?: string;
36
36
  quantity?: number;
37
+ _validate?: boolean;
37
38
  stock_location?: StockLocationRel;
38
39
  sku?: SkuRel;
39
40
  }
@@ -16,9 +16,6 @@ interface StripePayment extends Resource {
16
16
  options?: object;
17
17
  payment_method?: object;
18
18
  mismatched_amounts?: boolean;
19
- intent_amount_cents?: number;
20
- intent_amount_float?: number;
21
- formatted_intent_amount?: string;
22
19
  return_url?: string;
23
20
  receipt_email?: string;
24
21
  payment_instrument?: object;
@@ -2,7 +2,7 @@ import * as api from './api';
2
2
  import { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "5.1.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "5.2.1";
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 = "5.1.0";
13
+ readonly openApiSchemaVersion = "5.2.1";
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 = '5.1.0';
19
+ const OPEN_API_SCHEMA_VERSION = '5.2.1';
20
20
  export { OPEN_API_SCHEMA_VERSION };
21
21
  class CommerceLayerClient {
22
22
  static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
@@ -17,9 +17,6 @@ interface AxervePayment extends Resource {
17
17
  buyer_details?: object;
18
18
  request_token?: boolean;
19
19
  mismatched_amounts?: boolean;
20
- intent_amount_cents?: number;
21
- intent_amount_float?: number;
22
- formatted_intent_amount?: string;
23
20
  payment_instrument?: object;
24
21
  order?: Order;
25
22
  payment_gateway?: PaymentGateway;
@@ -15,9 +15,6 @@ interface KlarnaPayment extends Resource {
15
15
  payment_methods?: object[];
16
16
  auth_token?: string;
17
17
  mismatched_amounts?: boolean;
18
- intent_amount_cents?: number;
19
- intent_amount_float?: number;
20
- formatted_intent_amount?: string;
21
18
  payment_instrument?: object;
22
19
  order?: Order;
23
20
  payment_gateway?: PaymentGateway;
@@ -21,6 +21,8 @@ type SkuRel = ResourceRel & {
21
21
  type: 'skus';
22
22
  };
23
23
  interface OrderSubscriptionItem extends Resource {
24
+ sku_code?: string;
25
+ bundle_code?: string;
24
26
  quantity?: number;
25
27
  unit_amount_cents?: number;
26
28
  unit_amount_float?: number;
@@ -32,6 +34,7 @@ interface OrderSubscriptionItem extends Resource {
32
34
  item?: Adjustment | Bundle | Sku;
33
35
  sku?: Sku;
34
36
  bundle?: Bundle;
37
+ adjustment?: Adjustment;
35
38
  source_line_item?: LineItem;
36
39
  }
37
40
  interface OrderSubscriptionItemCreate extends ResourceCreate {
@@ -43,6 +46,7 @@ interface OrderSubscriptionItemCreate extends ResourceCreate {
43
46
  item: AdjustmentRel | BundleRel | SkuRel;
44
47
  sku?: SkuRel;
45
48
  bundle?: BundleRel;
49
+ adjustment?: AdjustmentRel;
46
50
  }
47
51
  interface OrderSubscriptionItemUpdate extends ResourceUpdate {
48
52
  sku_code?: string;
@@ -27,6 +27,7 @@ interface OrderSubscription extends Resource {
27
27
  status?: string;
28
28
  frequency?: string;
29
29
  activate_by_source_order?: boolean;
30
+ place_target_order?: boolean;
30
31
  customer_email?: string;
31
32
  starts_at?: string;
32
33
  expires_at?: string;
@@ -35,7 +36,6 @@ interface OrderSubscription extends Resource {
35
36
  occurrencies?: number;
36
37
  errors_count?: number;
37
38
  succeeded_on_last_run?: boolean;
38
- options?: object;
39
39
  market?: Market;
40
40
  subscription_model?: SubscriptionModel;
41
41
  source_order?: Order;
@@ -51,14 +51,16 @@ interface OrderSubscription extends Resource {
51
51
  interface OrderSubscriptionCreate extends ResourceCreate {
52
52
  frequency: string;
53
53
  activate_by_source_order?: boolean;
54
+ place_target_order?: boolean;
54
55
  starts_at?: string;
55
56
  expires_at?: string;
56
- options?: object;
57
57
  market?: MarketRel;
58
58
  source_order: OrderRel;
59
59
  }
60
60
  interface OrderSubscriptionUpdate extends ResourceUpdate {
61
61
  frequency?: string;
62
+ activate_by_source_order?: boolean;
63
+ place_target_order?: boolean;
62
64
  expires_at?: string;
63
65
  next_run_at?: string;
64
66
  _activate?: boolean;
@@ -19,9 +19,6 @@ interface PaypalPayment extends Resource {
19
19
  status?: string;
20
20
  approval_url?: string;
21
21
  mismatched_amounts?: boolean;
22
- intent_amount_cents?: number;
23
- intent_amount_float?: number;
24
- formatted_intent_amount?: string;
25
22
  payment_instrument?: object;
26
23
  order?: Order;
27
24
  payment_gateway?: PaymentGateway;
@@ -7,6 +7,9 @@ import type { PriceVolumeTier } from './price_volume_tiers';
7
7
  import type { PriceFrequencyTier } from './price_frequency_tiers';
8
8
  import type { Attachment } from './attachments';
9
9
  import type { Version } from './versions';
10
+ import type { Customer } from './customers';
11
+ import type { Market } from './markets';
12
+ import type { StockLocation } from './stock_locations';
10
13
  type PriceRel = ResourceRel & {
11
14
  type: typeof Prices.TYPE;
12
15
  };
@@ -35,6 +38,9 @@ interface Price extends Resource {
35
38
  price_frequency_tiers?: PriceFrequencyTier[];
36
39
  attachments?: Attachment[];
37
40
  versions?: Version[];
41
+ jwt_customer?: Customer;
42
+ jwt_markets?: Market[];
43
+ jwt_stock_locations?: StockLocation[];
38
44
  }
39
45
  interface PriceCreate extends ResourceCreate {
40
46
  sku_code?: string;
@@ -66,6 +72,9 @@ declare class Prices extends ApiResource {
66
72
  price_frequency_tiers(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PriceFrequencyTier>>;
67
73
  attachments(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
68
74
  versions(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
75
+ jwt_customer(priceId: string | Price, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
76
+ jwt_markets(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
77
+ jwt_stock_locations(priceId: string | Price, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLocation>>;
69
78
  isPrice(resource: any): resource is Price;
70
79
  relationship(id: string | ResourceId | null): PriceRel;
71
80
  type(): string;
@@ -44,6 +44,18 @@ class Prices extends ApiResource {
44
44
  const _priceId = priceId.id || priceId;
45
45
  return this.resources.fetch({ type: 'versions' }, `prices/${_priceId}/versions`, params, options);
46
46
  }
47
+ async jwt_customer(priceId, params, options) {
48
+ const _priceId = priceId.id || priceId;
49
+ return this.resources.fetch({ type: 'customers' }, `prices/${_priceId}/jwt_customer`, params, options);
50
+ }
51
+ async jwt_markets(priceId, params, options) {
52
+ const _priceId = priceId.id || priceId;
53
+ return this.resources.fetch({ type: 'markets' }, `prices/${_priceId}/jwt_markets`, params, options);
54
+ }
55
+ async jwt_stock_locations(priceId, params, options) {
56
+ const _priceId = priceId.id || priceId;
57
+ return this.resources.fetch({ type: 'stock_locations' }, `prices/${_priceId}/jwt_stock_locations`, params, options);
58
+ }
47
59
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
48
60
  isPrice(resource) {
49
61
  return resource.type && (resource.type === Prices.TYPE);
@@ -15,9 +15,6 @@ interface SatispayPayment extends Resource {
15
15
  status?: string;
16
16
  redirect_url?: string;
17
17
  payment_url?: string;
18
- intent_amount_cents?: number;
19
- intent_amount_float?: number;
20
- formatted_intent_amount?: string;
21
18
  payment_response?: object;
22
19
  order?: Order;
23
20
  payment_gateway?: PaymentGateway;
@@ -34,6 +34,7 @@ interface StockItemCreate extends ResourceCreate {
34
34
  interface StockItemUpdate extends ResourceUpdate {
35
35
  sku_code?: string;
36
36
  quantity?: number;
37
+ _validate?: boolean;
37
38
  stock_location?: StockLocationRel;
38
39
  sku?: SkuRel;
39
40
  }
@@ -16,9 +16,6 @@ interface StripePayment extends Resource {
16
16
  options?: object;
17
17
  payment_method?: object;
18
18
  mismatched_amounts?: boolean;
19
- intent_amount_cents?: number;
20
- intent_amount_float?: number;
21
- formatted_intent_amount?: string;
22
19
  return_url?: string;
23
20
  receipt_email?: string;
24
21
  payment_instrument?: object;