@commercelayer/sdk 4.46.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.
- package/lib/cjs/commercelayer.d.ts +2 -2
- package/lib/cjs/commercelayer.js +1 -1
- package/lib/cjs/resources/axerve_payments.d.ts +0 -3
- package/lib/cjs/resources/events.d.ts +3 -3
- package/lib/cjs/resources/events.js +4 -4
- package/lib/cjs/resources/klarna_payments.d.ts +0 -3
- package/lib/cjs/resources/order_subscription_items.d.ts +4 -0
- package/lib/cjs/resources/order_subscriptions.d.ts +4 -2
- package/lib/cjs/resources/organization.d.ts +1 -0
- package/lib/cjs/resources/paypal_payments.d.ts +0 -3
- package/lib/cjs/resources/prices.d.ts +9 -0
- package/lib/cjs/resources/prices.js +12 -0
- package/lib/cjs/resources/satispay_payments.d.ts +0 -3
- package/lib/cjs/resources/shipments.d.ts +3 -0
- package/lib/cjs/resources/shipments.js +4 -0
- package/lib/cjs/resources/stock_items.d.ts +1 -0
- package/lib/cjs/resources/stripe_payments.d.ts +0 -3
- package/lib/esm/commercelayer.d.ts +2 -2
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/resources/axerve_payments.d.ts +0 -3
- package/lib/esm/resources/events.d.ts +3 -3
- package/lib/esm/resources/events.js +4 -4
- package/lib/esm/resources/klarna_payments.d.ts +0 -3
- package/lib/esm/resources/order_subscription_items.d.ts +4 -0
- package/lib/esm/resources/order_subscriptions.d.ts +4 -2
- package/lib/esm/resources/organization.d.ts +1 -0
- package/lib/esm/resources/paypal_payments.d.ts +0 -3
- package/lib/esm/resources/prices.d.ts +9 -0
- package/lib/esm/resources/prices.js +12 -0
- package/lib/esm/resources/satispay_payments.d.ts +0 -3
- package/lib/esm/resources/shipments.d.ts +3 -0
- package/lib/esm/resources/shipments.js +4 -0
- package/lib/esm/resources/stock_items.d.ts +1 -0
- package/lib/esm/resources/stripe_payments.d.ts +0 -3
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
@@ -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.
|
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.
|
13
|
+
readonly openApiSchemaVersion = "5.2.1";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
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 = '5.
|
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;
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import type { EventCallback } from './event_callbacks';
|
4
3
|
import type { Webhook } from './webhooks';
|
4
|
+
import type { EventCallback } from './event_callbacks';
|
5
5
|
type EventRel = ResourceRel & {
|
6
6
|
type: typeof Events.TYPE;
|
7
7
|
};
|
8
8
|
interface Event extends Resource {
|
9
9
|
name?: string;
|
10
|
-
last_event_callbacks?: EventCallback[];
|
11
10
|
webhooks?: Webhook[];
|
11
|
+
last_event_callbacks?: EventCallback[];
|
12
12
|
}
|
13
13
|
declare class Events extends ApiResource {
|
14
14
|
static readonly TYPE: 'events';
|
15
15
|
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
16
16
|
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Event>;
|
17
|
-
last_event_callbacks(eventId: string | Event, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
18
17
|
webhooks(eventId: string | Event, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Webhook>>;
|
18
|
+
last_event_callbacks(eventId: string | Event, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
19
19
|
isEvent(resource: any): resource is Event;
|
20
20
|
relationship(id: string | ResourceId | null): EventRel;
|
21
21
|
type(): string;
|
@@ -9,14 +9,14 @@ class Events extends resource_1.ApiResource {
|
|
9
9
|
async retrieve(id, params, options) {
|
10
10
|
return this.resources.retrieve({ type: Events.TYPE, id }, params, options);
|
11
11
|
}
|
12
|
-
async last_event_callbacks(eventId, params, options) {
|
13
|
-
const _eventId = eventId.id || eventId;
|
14
|
-
return this.resources.fetch({ type: 'event_callbacks' }, `events/${_eventId}/last_event_callbacks`, params, options);
|
15
|
-
}
|
16
12
|
async webhooks(eventId, params, options) {
|
17
13
|
const _eventId = eventId.id || eventId;
|
18
14
|
return this.resources.fetch({ type: 'webhooks' }, `events/${_eventId}/webhooks`, params, options);
|
19
15
|
}
|
16
|
+
async last_event_callbacks(eventId, params, options) {
|
17
|
+
const _eventId = eventId.id || eventId;
|
18
|
+
return this.resources.fetch({ type: 'event_callbacks' }, `events/${_eventId}/last_event_callbacks`, params, options);
|
19
|
+
}
|
20
20
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
21
21
|
isEvent(resource) {
|
22
22
|
return resource.type && (resource.type === Events.TYPE);
|
@@ -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;
|
@@ -20,6 +20,7 @@ interface Organization extends Resource {
|
|
20
20
|
max_concurrent_cleanups?: number;
|
21
21
|
order_number_editable_test?: boolean;
|
22
22
|
order_number_editable_live?: boolean;
|
23
|
+
config?: object;
|
23
24
|
}
|
24
25
|
declare class Organizations extends ApiResource {
|
25
26
|
static readonly TYPE: 'organization';
|
@@ -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;
|
@@ -9,6 +9,7 @@ import type { ShippingMethod } from './shipping_methods';
|
|
9
9
|
import type { DeliveryLeadTime } from './delivery_lead_times';
|
10
10
|
import type { StockLineItem } from './stock_line_items';
|
11
11
|
import type { StockTransfer } from './stock_transfers';
|
12
|
+
import type { LineItem } from './line_items';
|
12
13
|
import type { CarrierAccount } from './carrier_accounts';
|
13
14
|
import type { Parcel } from './parcels';
|
14
15
|
import type { Attachment } from './attachments';
|
@@ -69,6 +70,7 @@ interface Shipment extends Resource {
|
|
69
70
|
delivery_lead_time?: DeliveryLeadTime;
|
70
71
|
stock_line_items?: StockLineItem[];
|
71
72
|
stock_transfers?: StockTransfer[];
|
73
|
+
line_items?: LineItem[];
|
72
74
|
available_shipping_methods?: ShippingMethod[];
|
73
75
|
carrier_accounts?: CarrierAccount[];
|
74
76
|
parcels?: Parcel[];
|
@@ -121,6 +123,7 @@ declare class Shipments extends ApiResource {
|
|
121
123
|
delivery_lead_time(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
122
124
|
stock_line_items(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
123
125
|
stock_transfers(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
126
|
+
line_items(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItem>>;
|
124
127
|
available_shipping_methods(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethod>>;
|
125
128
|
carrier_accounts(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CarrierAccount>>;
|
126
129
|
parcels(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
@@ -58,6 +58,10 @@ class Shipments extends resource_1.ApiResource {
|
|
58
58
|
const _shipmentId = shipmentId.id || shipmentId;
|
59
59
|
return this.resources.fetch({ type: 'stock_transfers' }, `shipments/${_shipmentId}/stock_transfers`, params, options);
|
60
60
|
}
|
61
|
+
async line_items(shipmentId, params, options) {
|
62
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
63
|
+
return this.resources.fetch({ type: 'line_items' }, `shipments/${_shipmentId}/line_items`, params, options);
|
64
|
+
}
|
61
65
|
async available_shipping_methods(shipmentId, params, options) {
|
62
66
|
const _shipmentId = shipmentId.id || shipmentId;
|
63
67
|
return this.resources.fetch({ type: 'shipping_methods' }, `shipments/${_shipmentId}/available_shipping_methods`, params, options);
|
@@ -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.
|
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.
|
13
|
+
readonly openApiSchemaVersion = "5.2.1";
|
14
14
|
addresses: api.Addresses;
|
15
15
|
adjustments: api.Adjustments;
|
16
16
|
adyen_gateways: api.AdyenGateways;
|
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 = '5.
|
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;
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
|
2
2
|
import type { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import type { EventCallback } from './event_callbacks';
|
4
3
|
import type { Webhook } from './webhooks';
|
4
|
+
import type { EventCallback } from './event_callbacks';
|
5
5
|
type EventRel = ResourceRel & {
|
6
6
|
type: typeof Events.TYPE;
|
7
7
|
};
|
8
8
|
interface Event extends Resource {
|
9
9
|
name?: string;
|
10
|
-
last_event_callbacks?: EventCallback[];
|
11
10
|
webhooks?: Webhook[];
|
11
|
+
last_event_callbacks?: EventCallback[];
|
12
12
|
}
|
13
13
|
declare class Events extends ApiResource {
|
14
14
|
static readonly TYPE: 'events';
|
15
15
|
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
16
16
|
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Event>;
|
17
|
-
last_event_callbacks(eventId: string | Event, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
18
17
|
webhooks(eventId: string | Event, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Webhook>>;
|
18
|
+
last_event_callbacks(eventId: string | Event, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
19
19
|
isEvent(resource: any): resource is Event;
|
20
20
|
relationship(id: string | ResourceId | null): EventRel;
|
21
21
|
type(): string;
|
@@ -7,14 +7,14 @@ class Events extends ApiResource {
|
|
7
7
|
async retrieve(id, params, options) {
|
8
8
|
return this.resources.retrieve({ type: Events.TYPE, id }, params, options);
|
9
9
|
}
|
10
|
-
async last_event_callbacks(eventId, params, options) {
|
11
|
-
const _eventId = eventId.id || eventId;
|
12
|
-
return this.resources.fetch({ type: 'event_callbacks' }, `events/${_eventId}/last_event_callbacks`, params, options);
|
13
|
-
}
|
14
10
|
async webhooks(eventId, params, options) {
|
15
11
|
const _eventId = eventId.id || eventId;
|
16
12
|
return this.resources.fetch({ type: 'webhooks' }, `events/${_eventId}/webhooks`, params, options);
|
17
13
|
}
|
14
|
+
async last_event_callbacks(eventId, params, options) {
|
15
|
+
const _eventId = eventId.id || eventId;
|
16
|
+
return this.resources.fetch({ type: 'event_callbacks' }, `events/${_eventId}/last_event_callbacks`, params, options);
|
17
|
+
}
|
18
18
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
19
19
|
isEvent(resource) {
|
20
20
|
return resource.type && (resource.type === Events.TYPE);
|
@@ -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;
|
@@ -20,6 +20,7 @@ interface Organization extends Resource {
|
|
20
20
|
max_concurrent_cleanups?: number;
|
21
21
|
order_number_editable_test?: boolean;
|
22
22
|
order_number_editable_live?: boolean;
|
23
|
+
config?: object;
|
23
24
|
}
|
24
25
|
declare class Organizations extends ApiResource {
|
25
26
|
static readonly TYPE: 'organization';
|
@@ -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;
|
@@ -9,6 +9,7 @@ import type { ShippingMethod } from './shipping_methods';
|
|
9
9
|
import type { DeliveryLeadTime } from './delivery_lead_times';
|
10
10
|
import type { StockLineItem } from './stock_line_items';
|
11
11
|
import type { StockTransfer } from './stock_transfers';
|
12
|
+
import type { LineItem } from './line_items';
|
12
13
|
import type { CarrierAccount } from './carrier_accounts';
|
13
14
|
import type { Parcel } from './parcels';
|
14
15
|
import type { Attachment } from './attachments';
|
@@ -69,6 +70,7 @@ interface Shipment extends Resource {
|
|
69
70
|
delivery_lead_time?: DeliveryLeadTime;
|
70
71
|
stock_line_items?: StockLineItem[];
|
71
72
|
stock_transfers?: StockTransfer[];
|
73
|
+
line_items?: LineItem[];
|
72
74
|
available_shipping_methods?: ShippingMethod[];
|
73
75
|
carrier_accounts?: CarrierAccount[];
|
74
76
|
parcels?: Parcel[];
|
@@ -121,6 +123,7 @@ declare class Shipments extends ApiResource {
|
|
121
123
|
delivery_lead_time(shipmentId: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<DeliveryLeadTime>;
|
122
124
|
stock_line_items(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
|
123
125
|
stock_transfers(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
|
126
|
+
line_items(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItem>>;
|
124
127
|
available_shipping_methods(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethod>>;
|
125
128
|
carrier_accounts(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<CarrierAccount>>;
|
126
129
|
parcels(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
|
@@ -56,6 +56,10 @@ class Shipments extends ApiResource {
|
|
56
56
|
const _shipmentId = shipmentId.id || shipmentId;
|
57
57
|
return this.resources.fetch({ type: 'stock_transfers' }, `shipments/${_shipmentId}/stock_transfers`, params, options);
|
58
58
|
}
|
59
|
+
async line_items(shipmentId, params, options) {
|
60
|
+
const _shipmentId = shipmentId.id || shipmentId;
|
61
|
+
return this.resources.fetch({ type: 'line_items' }, `shipments/${_shipmentId}/line_items`, params, options);
|
62
|
+
}
|
59
63
|
async available_shipping_methods(shipmentId, params, options) {
|
60
64
|
const _shipmentId = shipmentId.id || shipmentId;
|
61
65
|
return this.resources.fetch({ type: 'shipping_methods' }, `shipments/${_shipmentId}/available_shipping_methods`, params, options);
|
@@ -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;
|