@arrowsphere/api-client 3.30.0-rc-jpb.3 → 3.30.0-rc-jpb.4
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.
|
@@ -55,6 +55,10 @@ export declare abstract class AbstractHttpClient {
|
|
|
55
55
|
* Handlers can be developed in another projects as long as they respect the interface HttpExceptionHandler.
|
|
56
56
|
*/
|
|
57
57
|
registerHttpExceptionHandler(handler: HttpExceptionHandler): this;
|
|
58
|
+
/**
|
|
59
|
+
* Allow to set error handlers.
|
|
60
|
+
*/
|
|
61
|
+
setHttpExceptionHandlers(handlers: HttpExceptionHandler[]): this;
|
|
58
62
|
/**
|
|
59
63
|
* Will find appropriate ErrorHandlers and apply them to the error in order of registering.
|
|
60
64
|
*/
|
|
@@ -81,6 +81,13 @@ class AbstractHttpClient {
|
|
|
81
81
|
this.httpExceptionHandlers.push(handler);
|
|
82
82
|
return this;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Allow to set error handlers.
|
|
86
|
+
*/
|
|
87
|
+
setHttpExceptionHandlers(handlers) {
|
|
88
|
+
this.httpExceptionHandlers = handlers;
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
84
91
|
/**
|
|
85
92
|
* Will find appropriate ErrorHandlers and apply them to the error in order of registering.
|
|
86
93
|
*/
|
package/build/publicApiClient.js
CHANGED
|
@@ -31,7 +31,8 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
31
31
|
return new customers_1.CustomersClient()
|
|
32
32
|
.setUrl(this.url)
|
|
33
33
|
.setApiKey(this.apiKey)
|
|
34
|
-
.setHeaders(this.headers)
|
|
34
|
+
.setHeaders(this.headers)
|
|
35
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Creates a new {@link WhoAmIClient} instance and returns it
|
|
@@ -41,7 +42,8 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
41
42
|
return new general_1.WhoAmIClient()
|
|
42
43
|
.setUrl(this.url)
|
|
43
44
|
.setApiKey(this.apiKey)
|
|
44
|
-
.setHeaders(this.headers)
|
|
45
|
+
.setHeaders(this.headers)
|
|
46
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* Creates a new {@link LicensesClient} instance and returns it
|
|
@@ -51,7 +53,8 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
51
53
|
return new licenses_1.LicensesClient()
|
|
52
54
|
.setUrl(this.url)
|
|
53
55
|
.setApiKey(this.apiKey)
|
|
54
|
-
.setHeaders(this.headers)
|
|
56
|
+
.setHeaders(this.headers)
|
|
57
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
55
58
|
}
|
|
56
59
|
/**
|
|
57
60
|
* Creates a new {@link CheckDomainClient} instance and returns it
|
|
@@ -61,7 +64,8 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
61
64
|
return new general_1.CheckDomainClient()
|
|
62
65
|
.setUrl(this.url)
|
|
63
66
|
.setApiKey(this.apiKey)
|
|
64
|
-
.setHeaders(this.headers)
|
|
67
|
+
.setHeaders(this.headers)
|
|
68
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
65
69
|
}
|
|
66
70
|
/**
|
|
67
71
|
* Creates a new {@link SubscriptionsClient} instance and returns it
|
|
@@ -71,7 +75,8 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
71
75
|
return new subscriptions_1.SubscriptionsClient()
|
|
72
76
|
.setUrl(this.url)
|
|
73
77
|
.setApiKey(this.apiKey)
|
|
74
|
-
.setHeaders(this.headers)
|
|
78
|
+
.setHeaders(this.headers)
|
|
79
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
75
80
|
}
|
|
76
81
|
/**
|
|
77
82
|
* Creates a new {@link OrdersClient} instance and returns it
|
|
@@ -81,7 +86,8 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
81
86
|
return new orders_1.OrdersClient()
|
|
82
87
|
.setUrl(this.url)
|
|
83
88
|
.setApiKey(this.apiKey)
|
|
84
|
-
.setHeaders(this.headers)
|
|
89
|
+
.setHeaders(this.headers)
|
|
90
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
85
91
|
}
|
|
86
92
|
/**
|
|
87
93
|
* Creates a new {@link ContactClient} instance and returns it
|
|
@@ -91,7 +97,8 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
91
97
|
return new contact_1.ContactClient()
|
|
92
98
|
.setUrl(this.url)
|
|
93
99
|
.setApiKey(this.apiKey)
|
|
94
|
-
.setHeaders(this.headers)
|
|
100
|
+
.setHeaders(this.headers)
|
|
101
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
95
102
|
}
|
|
96
103
|
/**
|
|
97
104
|
* Creates a new {@link ContactClient} instance and returns it
|
|
@@ -101,49 +108,57 @@ class PublicApiClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
101
108
|
return new campaign_1.CampaignClient()
|
|
102
109
|
.setUrl(this.url)
|
|
103
110
|
.setApiKey(this.apiKey)
|
|
104
|
-
.setHeaders(this.headers)
|
|
111
|
+
.setHeaders(this.headers)
|
|
112
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
105
113
|
}
|
|
106
114
|
getConsumptionClient() {
|
|
107
115
|
return new consumption_1.ConsumptionClient()
|
|
108
116
|
.setUrl(this.url)
|
|
109
117
|
.setApiKey(this.apiKey)
|
|
110
|
-
.setHeaders(this.headers)
|
|
118
|
+
.setHeaders(this.headers)
|
|
119
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
111
120
|
}
|
|
112
121
|
getSecurityStandardsClient() {
|
|
113
122
|
return new standardsClient_1.StandardsClient()
|
|
114
123
|
.setUrl(this.url)
|
|
115
124
|
.setApiKey(this.apiKey)
|
|
116
|
-
.setHeaders(this.headers)
|
|
125
|
+
.setHeaders(this.headers)
|
|
126
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
117
127
|
}
|
|
118
128
|
getSecurityRegisterClient() {
|
|
119
129
|
return new security_1.RegisterClient()
|
|
120
130
|
.setUrl(this.url)
|
|
121
131
|
.setApiKey(this.apiKey)
|
|
122
|
-
.setHeaders(this.headers)
|
|
132
|
+
.setHeaders(this.headers)
|
|
133
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
123
134
|
}
|
|
124
135
|
getCartClient() {
|
|
125
136
|
return new cartClient_1.CartClient()
|
|
126
137
|
.setUrl(this.url)
|
|
127
138
|
.setApiKey(this.apiKey)
|
|
128
|
-
.setHeaders(this.headers)
|
|
139
|
+
.setHeaders(this.headers)
|
|
140
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
129
141
|
}
|
|
130
142
|
getSupportCenterClient() {
|
|
131
143
|
return new supportCenter_1.SupportCenterClient()
|
|
132
144
|
.setUrl(this.url)
|
|
133
145
|
.setApiKey(this.apiKey)
|
|
134
|
-
.setHeaders(this.headers)
|
|
146
|
+
.setHeaders(this.headers)
|
|
147
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
135
148
|
}
|
|
136
149
|
getCatalogClient() {
|
|
137
150
|
return new catalog_1.CatalogClient()
|
|
138
151
|
.setUrl(this.url)
|
|
139
152
|
.setApiKey(this.apiKey)
|
|
140
|
-
.setHeaders(this.headers)
|
|
153
|
+
.setHeaders(this.headers)
|
|
154
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
141
155
|
}
|
|
142
156
|
getUserClient() {
|
|
143
157
|
return new user_1.UserClient()
|
|
144
158
|
.setUrl(this.url)
|
|
145
159
|
.setApiKey(this.apiKey)
|
|
146
|
-
.setHeaders(this.headers)
|
|
160
|
+
.setHeaders(this.headers)
|
|
161
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
147
162
|
}
|
|
148
163
|
}
|
|
149
164
|
exports.PublicApiClient = PublicApiClient;
|
|
@@ -9,7 +9,8 @@ class PublicGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient
|
|
|
9
9
|
.setUrl(this.url)
|
|
10
10
|
.setToken(this.token)
|
|
11
11
|
.setHeaders(this.headers)
|
|
12
|
-
.setToken(this.token)
|
|
12
|
+
.setToken(this.token)
|
|
13
|
+
.setHttpExceptionHandlers(this.httpExceptionHandlers);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
exports.PublicGraphQLClient = PublicGraphQLClient;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/ArrowSphere/nodejs-api-client.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "3.30.0-rc-jpb.
|
|
7
|
+
"version": "3.30.0-rc-jpb.4",
|
|
8
8
|
"description": "Node.js client for ArrowSphere's public API",
|
|
9
9
|
"main": "build/index.js",
|
|
10
10
|
"types": "build/index.d.ts",
|