@commercelayer/sdk 5.22.1 → 5.23.1
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/client.d.ts +2 -6
- package/lib/cjs/client.js +2 -0
- package/lib/cjs/commercelayer.d.ts +2 -2
- package/lib/cjs/commercelayer.js +1 -1
- package/lib/cjs/error.d.ts +5 -5
- package/lib/cjs/resources/line_items.d.ts +1 -0
- package/lib/cjs/resources/orders.d.ts +3 -1
- package/lib/cjs/resources/organization.d.ts +4 -4
- package/lib/cjs/resources/webhooks.d.ts +5 -0
- package/lib/cjs/resources/webhooks.js +6 -0
- package/lib/esm/client.d.ts +2 -6
- package/lib/esm/client.js +2 -0
- package/lib/esm/commercelayer.d.ts +2 -2
- package/lib/esm/commercelayer.js +1 -1
- package/lib/esm/error.d.ts +5 -5
- package/lib/esm/resources/line_items.d.ts +1 -0
- package/lib/esm/resources/orders.d.ts +3 -1
- package/lib/esm/resources/organization.d.ts +4 -4
- package/lib/esm/resources/webhooks.d.ts +5 -0
- package/lib/esm/resources/webhooks.js +6 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
package/lib/cjs/client.d.ts
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="node" />
|
3
1
|
import type { AxiosAdapter, AxiosProxyConfig, Method } from 'axios';
|
4
2
|
import type { InterceptorManager } from './interceptor';
|
5
|
-
import type { Agent as HttpAgent } from 'http';
|
6
|
-
import type { Agent as HttpsAgent } from 'https';
|
7
3
|
type ProxyConfig = AxiosProxyConfig | false;
|
8
4
|
type Adapter = AxiosAdapter;
|
9
5
|
type RequestParams = Record<string, string | number | boolean>;
|
@@ -11,8 +7,8 @@ type RequestHeaders = Record<string, string>;
|
|
11
7
|
type RequestConfig = {
|
12
8
|
timeout?: number;
|
13
9
|
params?: RequestParams;
|
14
|
-
httpAgent?:
|
15
|
-
httpsAgent?:
|
10
|
+
httpAgent?: any;
|
11
|
+
httpsAgent?: any;
|
16
12
|
proxy?: ProxyConfig;
|
17
13
|
headers?: RequestHeaders;
|
18
14
|
};
|
package/lib/cjs/client.js
CHANGED
@@ -18,6 +18,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const axios_1 = __importDefault(require("axios"));
|
19
19
|
const error_1 = require("./error");
|
20
20
|
const config_1 = __importDefault(require("./config"));
|
21
|
+
// import type { Agent as HttpAgent } from 'http'
|
22
|
+
// import type { Agent as HttpsAgent } from 'https'
|
21
23
|
// import { packageInfo } from './util'
|
22
24
|
const debug_1 = __importDefault(require("./debug"));
|
23
25
|
const debug = (0, debug_1.default)('client');
|
@@ -2,14 +2,14 @@ import * as api from './api';
|
|
2
2
|
import type { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import { type ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.21.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
|
-
readonly openApiSchemaVersion = "4.
|
12
|
+
readonly openApiSchemaVersion = "4.21.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
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 = '4.
|
48
|
+
const OPEN_API_SCHEMA_VERSION = '4.21.0';
|
49
49
|
exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
|
50
50
|
class CommerceLayerClient {
|
51
51
|
// ##__CL_RESOURCES_DEF_STOP__##
|
package/lib/cjs/error.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
declare enum ErrorType {
|
2
|
-
CLIENT = "client"
|
3
|
-
REQUEST = "request"
|
4
|
-
RESPONSE = "response"
|
5
|
-
CANCEL = "cancel"
|
6
|
-
PARSE = "parse"
|
2
|
+
CLIENT = "client",// Error instantiating the client
|
3
|
+
REQUEST = "request",// Error preparing API request
|
4
|
+
RESPONSE = "response",// Error response from API
|
5
|
+
CANCEL = "cancel",// Forced request abort using interceptor
|
6
|
+
PARSE = "parse",// Error parsing API resource
|
7
7
|
GENERIC = "generic"
|
8
8
|
}
|
9
9
|
declare class SdkError extends Error {
|
@@ -63,6 +63,7 @@ interface LineItem extends Resource {
|
|
63
63
|
sku_code?: string | null;
|
64
64
|
bundle_code?: string | null;
|
65
65
|
quantity: number;
|
66
|
+
_external_price?: boolean | null;
|
66
67
|
currency_code?: string | null;
|
67
68
|
unit_amount_cents?: number | null;
|
68
69
|
unit_amount_float?: number | null;
|
@@ -89,7 +89,7 @@ type TagRel = ResourceRel & {
|
|
89
89
|
};
|
90
90
|
interface Order extends Resource {
|
91
91
|
readonly type: OrderType;
|
92
|
-
number?:
|
92
|
+
number?: string | null;
|
93
93
|
autorefresh?: boolean | null;
|
94
94
|
status: 'draft' | 'pending' | 'placed' | 'editing' | 'approved' | 'cancelled';
|
95
95
|
payment_status: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free';
|
@@ -227,6 +227,7 @@ interface Order extends Resource {
|
|
227
227
|
versions?: Version[] | null;
|
228
228
|
}
|
229
229
|
interface OrderCreate extends ResourceCreate {
|
230
|
+
number?: string | null;
|
230
231
|
autorefresh?: boolean | null;
|
231
232
|
guest?: boolean | null;
|
232
233
|
customer_email?: string | null;
|
@@ -252,6 +253,7 @@ interface OrderCreate extends ResourceCreate {
|
|
252
253
|
tags?: TagRel[] | null;
|
253
254
|
}
|
254
255
|
interface OrderUpdate extends ResourceUpdate {
|
256
|
+
number?: string | null;
|
255
257
|
autorefresh?: boolean | null;
|
256
258
|
guest?: boolean | null;
|
257
259
|
customer_email?: string | null;
|
@@ -14,14 +14,14 @@ interface Organization extends Resource {
|
|
14
14
|
logo_url?: string | null;
|
15
15
|
favicon_url?: string | null;
|
16
16
|
primary_color?: string | null;
|
17
|
-
contrast_color?: string | null;
|
18
17
|
gtm_id?: string | null;
|
19
18
|
gtm_id_test?: string | null;
|
20
|
-
discount_disabled?: boolean | null;
|
21
|
-
account_disabled?: boolean | null;
|
22
|
-
acceptance_disabled?: boolean | null;
|
23
19
|
max_concurrent_promotions?: number | null;
|
24
20
|
max_concurrent_imports?: number | null;
|
21
|
+
max_concurrent_exports?: number | null;
|
22
|
+
max_concurrent_cleanups?: number | null;
|
23
|
+
order_number_editable_test?: boolean | null;
|
24
|
+
order_number_editable_live?: boolean | null;
|
25
25
|
}
|
26
26
|
declare class Organizations extends ApiSingleton<Organization> {
|
27
27
|
static readonly TYPE: OrganizationType;
|
@@ -16,6 +16,7 @@ interface Webhook extends Resource {
|
|
16
16
|
circuit_state?: string | null;
|
17
17
|
circuit_failure_count?: number | null;
|
18
18
|
shared_secret: string;
|
19
|
+
disabled_at?: string | null;
|
19
20
|
last_event_callbacks?: EventCallback[] | null;
|
20
21
|
versions?: Version[] | null;
|
21
22
|
}
|
@@ -31,6 +32,8 @@ interface WebhookUpdate extends ResourceUpdate {
|
|
31
32
|
callback_url?: string | null;
|
32
33
|
include_resources?: string[] | null;
|
33
34
|
_reset_circuit?: boolean | null;
|
35
|
+
_disable?: boolean | null;
|
36
|
+
_enable?: boolean | null;
|
34
37
|
}
|
35
38
|
declare class Webhooks extends ApiResource<Webhook> {
|
36
39
|
static readonly TYPE: WebhookType;
|
@@ -40,6 +43,8 @@ declare class Webhooks extends ApiResource<Webhook> {
|
|
40
43
|
last_event_callbacks(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
41
44
|
versions(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
42
45
|
_reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
46
|
+
_disable(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
47
|
+
_enable(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
43
48
|
isWebhook(resource: any): resource is Webhook;
|
44
49
|
relationship(id: string | ResourceId | null): WebhookRel;
|
45
50
|
type(): WebhookType;
|
@@ -22,6 +22,12 @@ class Webhooks extends resource_1.ApiResource {
|
|
22
22
|
async _reset_circuit(id, params, options) {
|
23
23
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _reset_circuit: true }, params, options);
|
24
24
|
}
|
25
|
+
async _disable(id, params, options) {
|
26
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _disable: true }, params, options);
|
27
|
+
}
|
28
|
+
async _enable(id, params, options) {
|
29
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _enable: true }, params, options);
|
30
|
+
}
|
25
31
|
isWebhook(resource) {
|
26
32
|
return resource.type && (resource.type === Webhooks.TYPE);
|
27
33
|
}
|
package/lib/esm/client.d.ts
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/// <reference types="node" />
|
3
1
|
import type { AxiosAdapter, AxiosProxyConfig, Method } from 'axios';
|
4
2
|
import type { InterceptorManager } from './interceptor';
|
5
|
-
import type { Agent as HttpAgent } from 'http';
|
6
|
-
import type { Agent as HttpsAgent } from 'https';
|
7
3
|
type ProxyConfig = AxiosProxyConfig | false;
|
8
4
|
type Adapter = AxiosAdapter;
|
9
5
|
type RequestParams = Record<string, string | number | boolean>;
|
@@ -11,8 +7,8 @@ type RequestHeaders = Record<string, string>;
|
|
11
7
|
type RequestConfig = {
|
12
8
|
timeout?: number;
|
13
9
|
params?: RequestParams;
|
14
|
-
httpAgent?:
|
15
|
-
httpsAgent?:
|
10
|
+
httpAgent?: any;
|
11
|
+
httpsAgent?: any;
|
16
12
|
proxy?: ProxyConfig;
|
17
13
|
headers?: RequestHeaders;
|
18
14
|
};
|
package/lib/esm/client.js
CHANGED
@@ -13,6 +13,8 @@ var _ApiClient_accessToken, _ApiClient_client;
|
|
13
13
|
import axios from 'axios';
|
14
14
|
import { SdkError, handleError } from './error';
|
15
15
|
import config from './config';
|
16
|
+
// import type { Agent as HttpAgent } from 'http'
|
17
|
+
// import type { Agent as HttpsAgent } from 'https'
|
16
18
|
// import { packageInfo } from './util'
|
17
19
|
import Debug from './debug';
|
18
20
|
const debug = Debug('client');
|
@@ -2,14 +2,14 @@ import * as api from './api';
|
|
2
2
|
import type { ApiError } from './error';
|
3
3
|
import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
|
4
4
|
import { type ResourcesInitConfig } from './resource';
|
5
|
-
declare const OPEN_API_SCHEMA_VERSION = "4.
|
5
|
+
declare const OPEN_API_SCHEMA_VERSION = "4.21.0";
|
6
6
|
export { OPEN_API_SCHEMA_VERSION };
|
7
7
|
type SdkConfig = {};
|
8
8
|
type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
|
9
9
|
type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
|
10
10
|
declare class CommerceLayerClient {
|
11
11
|
#private;
|
12
|
-
readonly openApiSchemaVersion = "4.
|
12
|
+
readonly openApiSchemaVersion = "4.21.0";
|
13
13
|
addresses: api.Addresses;
|
14
14
|
adjustments: api.Adjustments;
|
15
15
|
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 = '4.
|
19
|
+
const OPEN_API_SCHEMA_VERSION = '4.21.0';
|
20
20
|
export { OPEN_API_SCHEMA_VERSION };
|
21
21
|
class CommerceLayerClient {
|
22
22
|
// ##__CL_RESOURCES_DEF_STOP__##
|
package/lib/esm/error.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
declare enum ErrorType {
|
2
|
-
CLIENT = "client"
|
3
|
-
REQUEST = "request"
|
4
|
-
RESPONSE = "response"
|
5
|
-
CANCEL = "cancel"
|
6
|
-
PARSE = "parse"
|
2
|
+
CLIENT = "client",// Error instantiating the client
|
3
|
+
REQUEST = "request",// Error preparing API request
|
4
|
+
RESPONSE = "response",// Error response from API
|
5
|
+
CANCEL = "cancel",// Forced request abort using interceptor
|
6
|
+
PARSE = "parse",// Error parsing API resource
|
7
7
|
GENERIC = "generic"
|
8
8
|
}
|
9
9
|
declare class SdkError extends Error {
|
@@ -63,6 +63,7 @@ interface LineItem extends Resource {
|
|
63
63
|
sku_code?: string | null;
|
64
64
|
bundle_code?: string | null;
|
65
65
|
quantity: number;
|
66
|
+
_external_price?: boolean | null;
|
66
67
|
currency_code?: string | null;
|
67
68
|
unit_amount_cents?: number | null;
|
68
69
|
unit_amount_float?: number | null;
|
@@ -89,7 +89,7 @@ type TagRel = ResourceRel & {
|
|
89
89
|
};
|
90
90
|
interface Order extends Resource {
|
91
91
|
readonly type: OrderType;
|
92
|
-
number?:
|
92
|
+
number?: string | null;
|
93
93
|
autorefresh?: boolean | null;
|
94
94
|
status: 'draft' | 'pending' | 'placed' | 'editing' | 'approved' | 'cancelled';
|
95
95
|
payment_status: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free';
|
@@ -227,6 +227,7 @@ interface Order extends Resource {
|
|
227
227
|
versions?: Version[] | null;
|
228
228
|
}
|
229
229
|
interface OrderCreate extends ResourceCreate {
|
230
|
+
number?: string | null;
|
230
231
|
autorefresh?: boolean | null;
|
231
232
|
guest?: boolean | null;
|
232
233
|
customer_email?: string | null;
|
@@ -252,6 +253,7 @@ interface OrderCreate extends ResourceCreate {
|
|
252
253
|
tags?: TagRel[] | null;
|
253
254
|
}
|
254
255
|
interface OrderUpdate extends ResourceUpdate {
|
256
|
+
number?: string | null;
|
255
257
|
autorefresh?: boolean | null;
|
256
258
|
guest?: boolean | null;
|
257
259
|
customer_email?: string | null;
|
@@ -14,14 +14,14 @@ interface Organization extends Resource {
|
|
14
14
|
logo_url?: string | null;
|
15
15
|
favicon_url?: string | null;
|
16
16
|
primary_color?: string | null;
|
17
|
-
contrast_color?: string | null;
|
18
17
|
gtm_id?: string | null;
|
19
18
|
gtm_id_test?: string | null;
|
20
|
-
discount_disabled?: boolean | null;
|
21
|
-
account_disabled?: boolean | null;
|
22
|
-
acceptance_disabled?: boolean | null;
|
23
19
|
max_concurrent_promotions?: number | null;
|
24
20
|
max_concurrent_imports?: number | null;
|
21
|
+
max_concurrent_exports?: number | null;
|
22
|
+
max_concurrent_cleanups?: number | null;
|
23
|
+
order_number_editable_test?: boolean | null;
|
24
|
+
order_number_editable_live?: boolean | null;
|
25
25
|
}
|
26
26
|
declare class Organizations extends ApiSingleton<Organization> {
|
27
27
|
static readonly TYPE: OrganizationType;
|
@@ -16,6 +16,7 @@ interface Webhook extends Resource {
|
|
16
16
|
circuit_state?: string | null;
|
17
17
|
circuit_failure_count?: number | null;
|
18
18
|
shared_secret: string;
|
19
|
+
disabled_at?: string | null;
|
19
20
|
last_event_callbacks?: EventCallback[] | null;
|
20
21
|
versions?: Version[] | null;
|
21
22
|
}
|
@@ -31,6 +32,8 @@ interface WebhookUpdate extends ResourceUpdate {
|
|
31
32
|
callback_url?: string | null;
|
32
33
|
include_resources?: string[] | null;
|
33
34
|
_reset_circuit?: boolean | null;
|
35
|
+
_disable?: boolean | null;
|
36
|
+
_enable?: boolean | null;
|
34
37
|
}
|
35
38
|
declare class Webhooks extends ApiResource<Webhook> {
|
36
39
|
static readonly TYPE: WebhookType;
|
@@ -40,6 +43,8 @@ declare class Webhooks extends ApiResource<Webhook> {
|
|
40
43
|
last_event_callbacks(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
|
41
44
|
versions(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
42
45
|
_reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
46
|
+
_disable(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
47
|
+
_enable(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
|
43
48
|
isWebhook(resource: any): resource is Webhook;
|
44
49
|
relationship(id: string | ResourceId | null): WebhookRel;
|
45
50
|
type(): WebhookType;
|
@@ -20,6 +20,12 @@ class Webhooks extends ApiResource {
|
|
20
20
|
async _reset_circuit(id, params, options) {
|
21
21
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _reset_circuit: true }, params, options);
|
22
22
|
}
|
23
|
+
async _disable(id, params, options) {
|
24
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _disable: true }, params, options);
|
25
|
+
}
|
26
|
+
async _enable(id, params, options) {
|
27
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Webhooks.TYPE, _enable: true }, params, options);
|
28
|
+
}
|
23
29
|
isWebhook(resource) {
|
24
30
|
return resource.type && (resource.type === Webhooks.TYPE);
|
25
31
|
}
|