ibm-cloud-sdk-core 2.17.8 → 2.17.11
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/CHANGELOG.md +22 -0
- package/README.md +1 -3
- package/build/docs/ibm-cloud-sdk-core.useroptions.jar.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.useroptions.md +1 -1
- package/docs/ibm-cloud-sdk-core.api.json +7 -2
- package/es/lib/base-service.d.ts +2 -1
- package/es/lib/request-wrapper.js +7 -15
- package/etc/ibm-cloud-sdk-core.api.md +464 -463
- package/ibm-cloud-sdk-core.d.ts +2 -1
- package/lib/base-service.d.ts +2 -1
- package/lib/request-wrapper.js +8 -15
- package/package.json +3 -2
- package/temp/ibm-cloud-sdk-core.api.json +7 -2
- package/temp/ibm-cloud-sdk-core.api.md +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [2.17.11](https://github.com/IBM/node-sdk-core/compare/v2.17.10...v2.17.11) (2022-03-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update axios to remove vulnerability ([90e0417](https://github.com/IBM/node-sdk-core/commit/90e04179a14409ae209e80e4341779b61e45c772))
|
|
7
|
+
* use correct type for cookie jar option ([59a440a](https://github.com/IBM/node-sdk-core/commit/59a440a66f96279b5842d1e6d2b1d48b0b0c2fe8))
|
|
8
|
+
|
|
9
|
+
## [2.17.10](https://github.com/IBM/node-sdk-core/compare/v2.17.9...v2.17.10) (2022-02-10)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* bump follow-redirects to avoid vuln ([#191](https://github.com/IBM/node-sdk-core/issues/191)) ([8a69d8e](https://github.com/IBM/node-sdk-core/commit/8a69d8e3e525c39cf1b9dcd17dc911df769702a1))
|
|
15
|
+
|
|
16
|
+
## [2.17.9](https://github.com/IBM/node-sdk-core/compare/v2.17.8...v2.17.9) (2022-01-19)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* bump version of follow-redirects to avoid vulnerability ([#189](https://github.com/IBM/node-sdk-core/issues/189)) ([b88c67a](https://github.com/IBM/node-sdk-core/commit/b88c67a52cd5129cc12228266c2499cbd1fefeec))
|
|
22
|
+
|
|
1
23
|
## [2.17.8](https://github.com/IBM/node-sdk-core/compare/v2.17.7...v2.17.8) (2022-01-18)
|
|
2
24
|
|
|
3
25
|
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ The debug logger can be configured to be used for more than one library. In exam
|
|
|
80
80
|
``DEBUG=ibm-cloud-sdk-core:debug,other-lib:debug``
|
|
81
81
|
|
|
82
82
|
## Cookie Jar Support
|
|
83
|
-
By default, cookies are not supported in the SDK requests. If your SDK would benefit from this functionality, simply edit your code to instantiate a cookie jar (or instruct your users to do so) and pass it in the object containing configuration options to the `BaseService` class, as shown below.
|
|
83
|
+
By default, cookies are not supported in the SDK requests. If your SDK would benefit from this functionality, simply edit your code to instantiate a cookie jar (or instruct your users to do so) and pass it in the object containing configuration options to the `BaseService` class, as shown below. If the Boolean value `true` is given for the `jar` field, the SDK core will create a default instance of a [Tough Cookie](https://www.npmjs.com/package/tough-cookie).
|
|
84
84
|
|
|
85
85
|
```ts
|
|
86
86
|
import tough = require('tough-cookie');
|
|
@@ -95,8 +95,6 @@ class MyClass extends BaseService {
|
|
|
95
95
|
}
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
The example above uses [Tough Cookie](https://www.npmjs.com/package/tough-cookie) to provide these capabilities, but other cookie jar libraries can be used.
|
|
99
|
-
|
|
100
98
|
## Issues
|
|
101
99
|
If you encounter an issue with this project, you are welcome to submit a [bug report](https://github.com/IBM/node-sdk-core/issues).
|
|
102
100
|
Before opening a new issue, please search for similar issues. It's possible that someone has already reported it.
|
|
@@ -19,7 +19,7 @@ export interface UserOptions
|
|
|
19
19
|
| [authenticator?](./ibm-cloud-sdk-core.useroptions.authenticator.md) | [AuthenticatorInterface](./ibm-cloud-sdk-core.authenticatorinterface.md) | <i>(Optional)</i> The Authenticator object used to authenticate requests to the service |
|
|
20
20
|
| [disableSslVerification?](./ibm-cloud-sdk-core.useroptions.disablesslverification.md) | boolean | <i>(Optional)</i> Set to <code>true</code> to allow unauthorized requests - not recommended for production use. |
|
|
21
21
|
| [headers?](./ibm-cloud-sdk-core.useroptions.headers.md) | OutgoingHttpHeaders | <i>(Optional)</i> Default headers that shall be included with every request to the service. |
|
|
22
|
-
| [jar?](./ibm-cloud-sdk-core.useroptions.jar.md) |
|
|
22
|
+
| [jar?](./ibm-cloud-sdk-core.useroptions.jar.md) | CookieJar \| boolean | <i>(Optional)</i> Set your own cookie jar object |
|
|
23
23
|
| [serviceUrl?](./ibm-cloud-sdk-core.useroptions.serviceurl.md) | string | <i>(Optional)</i> The base url to use when contacting the service. The base url may differ between IBM Cloud regions. |
|
|
24
24
|
| [url?](./ibm-cloud-sdk-core.useroptions.url.md) | string | <i>(Optional)</i> Deprecated. Use <code>serviceUrl</code> instead. |
|
|
25
25
|
| [version?](./ibm-cloud-sdk-core.useroptions.version.md) | string | <i>(Optional)</i> The API version date to use with the service, in "YYYY-MM-DD" format. |
|
|
@@ -6606,9 +6606,14 @@
|
|
|
6606
6606
|
"kind": "Content",
|
|
6607
6607
|
"text": "jar?: "
|
|
6608
6608
|
},
|
|
6609
|
+
{
|
|
6610
|
+
"kind": "Reference",
|
|
6611
|
+
"text": "CookieJar",
|
|
6612
|
+
"canonicalReference": "@types/tough-cookie!CookieJar:class"
|
|
6613
|
+
},
|
|
6609
6614
|
{
|
|
6610
6615
|
"kind": "Content",
|
|
6611
|
-
"text": "
|
|
6616
|
+
"text": " | boolean"
|
|
6612
6617
|
},
|
|
6613
6618
|
{
|
|
6614
6619
|
"kind": "Content",
|
|
@@ -6620,7 +6625,7 @@
|
|
|
6620
6625
|
"name": "jar",
|
|
6621
6626
|
"propertyTypeTokenRange": {
|
|
6622
6627
|
"startIndex": 1,
|
|
6623
|
-
"endIndex":
|
|
6628
|
+
"endIndex": 3
|
|
6624
6629
|
}
|
|
6625
6630
|
},
|
|
6626
6631
|
{
|
package/es/lib/base-service.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
/// <reference types="node" />
|
|
17
|
+
import type { CookieJar } from 'tough-cookie';
|
|
17
18
|
import { OutgoingHttpHeaders } from 'http';
|
|
18
19
|
import { AuthenticatorInterface } from '../auth';
|
|
19
20
|
import { RetryOptions } from './request-wrapper';
|
|
@@ -32,7 +33,7 @@ export interface UserOptions {
|
|
|
32
33
|
/** Set to `true` to allow unauthorized requests - not recommended for production use. */
|
|
33
34
|
disableSslVerification?: boolean;
|
|
34
35
|
/** Set your own cookie jar object */
|
|
35
|
-
jar?:
|
|
36
|
+
jar?: CookieJar | boolean;
|
|
36
37
|
/** Deprecated. Use `serviceUrl` instead. */
|
|
37
38
|
url?: string;
|
|
38
39
|
/** Allow additional request config parameters */
|
|
@@ -39,24 +39,10 @@ export class RequestWrapper {
|
|
|
39
39
|
constructor(axiosOptions) {
|
|
40
40
|
axiosOptions = axiosOptions || {};
|
|
41
41
|
this.compressRequestData = Boolean(axiosOptions.enableGzipCompression);
|
|
42
|
-
// override
|
|
43
|
-
// axios sets the default Content-Type for `post`, `put`, and `patch` operations
|
|
44
|
-
// to 'application/x-www-form-urlencoded'. This causes problems, so overriding the
|
|
45
|
-
// defaults here
|
|
42
|
+
// override a couple axios defaults
|
|
46
43
|
const axiosConfig = {
|
|
47
44
|
maxContentLength: -1,
|
|
48
45
|
maxBodyLength: Infinity,
|
|
49
|
-
headers: {
|
|
50
|
-
post: {
|
|
51
|
-
'Content-Type': 'application/json',
|
|
52
|
-
},
|
|
53
|
-
put: {
|
|
54
|
-
'Content-Type': 'application/json',
|
|
55
|
-
},
|
|
56
|
-
patch: {
|
|
57
|
-
'Content-Type': 'application/json',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
46
|
};
|
|
61
47
|
// merge axios config into default
|
|
62
48
|
extend(true, axiosConfig, axiosOptions);
|
|
@@ -78,6 +64,12 @@ export class RequestWrapper {
|
|
|
78
64
|
}
|
|
79
65
|
}
|
|
80
66
|
this.axiosInstance = axios.create(axiosConfig);
|
|
67
|
+
// axios sets the default Content-Type for `post`, `put`, and `patch` operations
|
|
68
|
+
// to 'application/x-www-form-urlencoded'. This causes problems, so overriding the
|
|
69
|
+
// defaults here
|
|
70
|
+
['post', 'put', 'patch'].forEach((op) => {
|
|
71
|
+
this.axiosInstance.defaults.headers[op]['Content-Type'] = 'application/json';
|
|
72
|
+
});
|
|
81
73
|
// if a cookie jar is provided, wrap the axios instance and update defaults
|
|
82
74
|
if (axiosOptions.jar) {
|
|
83
75
|
axiosCookieJarSupport(this.axiosInstance);
|
|
@@ -1,463 +1,464 @@
|
|
|
1
|
-
## API Report File for "ibm-cloud-sdk-core"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
/// <reference types="node" />
|
|
8
|
-
|
|
9
|
-
import { AxiosInstance } from 'axios';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
protected
|
|
56
|
-
protected
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
protected
|
|
271
|
-
protected
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
protected
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
protected
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
protected
|
|
369
|
-
|
|
370
|
-
//
|
|
371
|
-
//
|
|
372
|
-
|
|
373
|
-
protected
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
1
|
+
## API Report File for "ibm-cloud-sdk-core"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
/// <reference types="node" />
|
|
8
|
+
|
|
9
|
+
import { AxiosInstance } from 'axios';
|
|
10
|
+
import type { CookieJar } from 'tough-cookie';
|
|
11
|
+
import { OutgoingHttpHeaders } from 'http';
|
|
12
|
+
import { Stream } from 'stream';
|
|
13
|
+
|
|
14
|
+
// @public
|
|
15
|
+
export function atLeastOne(a: any, b: any): boolean;
|
|
16
|
+
|
|
17
|
+
// @public
|
|
18
|
+
export function atMostOne(a: any, b: any): boolean;
|
|
19
|
+
|
|
20
|
+
// @public
|
|
21
|
+
export class Authenticator implements AuthenticatorInterface {
|
|
22
|
+
constructor();
|
|
23
|
+
// Warning: (ae-forgotten-export) The symbol "AuthenticateOptions" needs to be exported by the entry point index.d.ts
|
|
24
|
+
authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
|
|
25
|
+
authenticationType(): string;
|
|
26
|
+
static AUTHTYPE_BASIC: string;
|
|
27
|
+
// (undocumented)
|
|
28
|
+
static AUTHTYPE_BEARERTOKEN: string;
|
|
29
|
+
// (undocumented)
|
|
30
|
+
static AUTHTYPE_CONTAINER: string;
|
|
31
|
+
// (undocumented)
|
|
32
|
+
static AUTHTYPE_CP4D: string;
|
|
33
|
+
// (undocumented)
|
|
34
|
+
static AUTHTYPE_IAM: string;
|
|
35
|
+
// (undocumented)
|
|
36
|
+
static AUTHTYPE_NOAUTH: string;
|
|
37
|
+
// (undocumented)
|
|
38
|
+
static AUTHTYPE_UNKNOWN: string;
|
|
39
|
+
// (undocumented)
|
|
40
|
+
static AUTHTYPE_VPC: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// @public
|
|
44
|
+
export interface AuthenticatorInterface {
|
|
45
|
+
authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
|
|
46
|
+
authenticationType(): string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// @public
|
|
50
|
+
export class BaseService {
|
|
51
|
+
constructor(userOptions: UserOptions);
|
|
52
|
+
// Warning: (ae-forgotten-export) The symbol "BaseServiceOptions" needs to be exported by the entry point index.d.ts
|
|
53
|
+
//
|
|
54
|
+
// (undocumented)
|
|
55
|
+
protected baseOptions: BaseServiceOptions;
|
|
56
|
+
protected configureService(serviceName: string): void;
|
|
57
|
+
protected createRequest(parameters: any): Promise<any>;
|
|
58
|
+
// (undocumented)
|
|
59
|
+
static DEFAULT_SERVICE_NAME: string;
|
|
60
|
+
// (undocumented)
|
|
61
|
+
static DEFAULT_SERVICE_URL: string;
|
|
62
|
+
disableRetries(): void;
|
|
63
|
+
// Warning: (ae-forgotten-export) The symbol "RetryOptions" needs to be exported by the entry point index.d.ts
|
|
64
|
+
enableRetries(retryOptions?: RetryOptions): void;
|
|
65
|
+
getAuthenticator(): any;
|
|
66
|
+
getHttpClient(): AxiosInstance;
|
|
67
|
+
setEnableGzipCompression(setting: boolean): void;
|
|
68
|
+
setServiceUrl(url: string): void;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// @public
|
|
72
|
+
export class BasicAuthenticator extends Authenticator {
|
|
73
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
74
|
+
constructor(options: Options);
|
|
75
|
+
authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
|
|
76
|
+
authenticationType(): string;
|
|
77
|
+
// (undocumented)
|
|
78
|
+
protected authHeader: {
|
|
79
|
+
Authorization: string;
|
|
80
|
+
};
|
|
81
|
+
// (undocumented)
|
|
82
|
+
protected requiredOptions: string[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// @public
|
|
86
|
+
export class BearerTokenAuthenticator extends Authenticator {
|
|
87
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
88
|
+
constructor(options: Options_2);
|
|
89
|
+
authenticate(requestOptions: AuthenticateOptions): Promise<void>;
|
|
90
|
+
authenticationType(): string;
|
|
91
|
+
// (undocumented)
|
|
92
|
+
protected requiredOptions: string[];
|
|
93
|
+
setBearerToken(bearerToken: string): void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// @public
|
|
97
|
+
export function buildRequestFileObject(fileParam: FileWithMetadata): FileObject;
|
|
98
|
+
|
|
99
|
+
// @public
|
|
100
|
+
export function checkCredentials(obj: any, credsToCheck: string[]): Error | null;
|
|
101
|
+
|
|
102
|
+
// @public
|
|
103
|
+
function checkForSuccessfulExecution(createRequestMock: any): void;
|
|
104
|
+
|
|
105
|
+
// @public
|
|
106
|
+
function checkMediaHeaders(createRequestMock: any, accept: string, contentType: string): void;
|
|
107
|
+
|
|
108
|
+
// @public
|
|
109
|
+
function checkUrlAndMethod(options: any, url: string, method: any): void;
|
|
110
|
+
|
|
111
|
+
// @public
|
|
112
|
+
function checkUserHeader(createRequestMock: any, userHeaderName: string, userHeaderValue: string): void;
|
|
113
|
+
|
|
114
|
+
// @public
|
|
115
|
+
export class CloudPakForDataAuthenticator extends TokenRequestBasedAuthenticator {
|
|
116
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
117
|
+
constructor(options: Options_4);
|
|
118
|
+
authenticationType(): string;
|
|
119
|
+
// (undocumented)
|
|
120
|
+
protected requiredOptions: string[];
|
|
121
|
+
// (undocumented)
|
|
122
|
+
protected tokenManager: Cp4dTokenManager;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// @public
|
|
126
|
+
export function computeBasicAuthHeader(username: string, password: string): string;
|
|
127
|
+
|
|
128
|
+
// @public (undocumented)
|
|
129
|
+
export function constructFilepath(filepath: string): string;
|
|
130
|
+
|
|
131
|
+
// @public
|
|
132
|
+
export function constructServiceUrl(parameterizedUrl: string, defaultUrlVariables: Map<string, string>, providedUrlVariables: Map<string, string> | null): string;
|
|
133
|
+
|
|
134
|
+
// @public
|
|
135
|
+
export class ContainerAuthenticator extends IamRequestBasedAuthenticator {
|
|
136
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
137
|
+
constructor(options: Options_8);
|
|
138
|
+
authenticationType(): string;
|
|
139
|
+
setCrTokenFilename(crTokenFilename: string): void;
|
|
140
|
+
setIamProfileId(iamProfileId: string): void;
|
|
141
|
+
setIamProfileName(iamProfileName: string): void;
|
|
142
|
+
// (undocumented)
|
|
143
|
+
protected tokenManager: ContainerTokenManager;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// @public
|
|
147
|
+
export class ContainerTokenManager extends IamRequestBasedTokenManager {
|
|
148
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
149
|
+
constructor(options: Options_7);
|
|
150
|
+
protected requestToken(): Promise<any>;
|
|
151
|
+
setCrTokenFilename(crTokenFilename: string): void;
|
|
152
|
+
setIamProfileId(iamProfileId: string): void;
|
|
153
|
+
setIamProfileName(iamProfileName: string): void;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// @public (undocumented)
|
|
157
|
+
export const contentType: {
|
|
158
|
+
fromFilename: (file: String | File | Buffer | NodeJS.ReadableStream | FileObject) => string;
|
|
159
|
+
fromHeader: (buffer: Buffer) => string;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// @public
|
|
163
|
+
export class Cp4dTokenManager extends JwtTokenManager {
|
|
164
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
165
|
+
constructor(options: Options_3);
|
|
166
|
+
// (undocumented)
|
|
167
|
+
protected requestToken(): Promise<any>;
|
|
168
|
+
// (undocumented)
|
|
169
|
+
protected requiredOptions: string[];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// @public
|
|
173
|
+
function expectToBePromise(sdkPromise: any): void;
|
|
174
|
+
|
|
175
|
+
// @public (undocumented)
|
|
176
|
+
export function fileExistsAtPath(filepath: string): boolean;
|
|
177
|
+
|
|
178
|
+
// @public
|
|
179
|
+
export interface FileObject {
|
|
180
|
+
// (undocumented)
|
|
181
|
+
options?: FileOptions;
|
|
182
|
+
// (undocumented)
|
|
183
|
+
value: NodeJS.ReadableStream | Buffer | string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// @public (undocumented)
|
|
187
|
+
export interface FileOptions {
|
|
188
|
+
// (undocumented)
|
|
189
|
+
contentType?: string;
|
|
190
|
+
// (undocumented)
|
|
191
|
+
filename?: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// @public (undocumented)
|
|
195
|
+
export interface FileStream extends NodeJS.ReadableStream {
|
|
196
|
+
// (undocumented)
|
|
197
|
+
path: string | Buffer;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// @public (undocumented)
|
|
201
|
+
export interface FileWithMetadata {
|
|
202
|
+
// (undocumented)
|
|
203
|
+
contentType: string;
|
|
204
|
+
// (undocumented)
|
|
205
|
+
data: NodeJS.ReadableStream | Buffer;
|
|
206
|
+
// (undocumented)
|
|
207
|
+
filename: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// @public
|
|
211
|
+
export function getAuthenticatorFromEnvironment(serviceName: string): Authenticator;
|
|
212
|
+
|
|
213
|
+
// @public
|
|
214
|
+
export function getContentType(inputData: NodeJS.ReadableStream | Buffer): string;
|
|
215
|
+
|
|
216
|
+
// @public
|
|
217
|
+
export function getCurrentTime(): number;
|
|
218
|
+
|
|
219
|
+
// @public
|
|
220
|
+
export function getFormat(params: {
|
|
221
|
+
[key: string]: any;
|
|
222
|
+
}, formats: string[]): string;
|
|
223
|
+
|
|
224
|
+
// @public
|
|
225
|
+
export function getMissingParams(params: {
|
|
226
|
+
[key: string]: any;
|
|
227
|
+
}, requires: string[]): null | Error;
|
|
228
|
+
|
|
229
|
+
// @public
|
|
230
|
+
function getOptions(createRequestMock: any): any;
|
|
231
|
+
|
|
232
|
+
// @public
|
|
233
|
+
export function getQueryParam(urlStr: string, param: string): string;
|
|
234
|
+
|
|
235
|
+
// @public
|
|
236
|
+
export class IamAuthenticator extends IamRequestBasedAuthenticator {
|
|
237
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
238
|
+
constructor(options: Options_6);
|
|
239
|
+
authenticationType(): string;
|
|
240
|
+
// (undocumented)
|
|
241
|
+
protected requiredOptions: string[];
|
|
242
|
+
// (undocumented)
|
|
243
|
+
protected tokenManager: IamTokenManager;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// @public
|
|
247
|
+
export class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator {
|
|
248
|
+
// Warning: (ae-forgotten-export) The symbol "IamRequestOptions" needs to be exported by the entry point index.d.ts
|
|
249
|
+
constructor(options: IamRequestOptions_2);
|
|
250
|
+
// (undocumented)
|
|
251
|
+
protected clientId: string;
|
|
252
|
+
// (undocumented)
|
|
253
|
+
protected clientSecret: string;
|
|
254
|
+
getRefreshToken(): string;
|
|
255
|
+
// (undocumented)
|
|
256
|
+
protected scope: string;
|
|
257
|
+
setClientIdAndSecret(clientId: string, clientSecret: string): void;
|
|
258
|
+
setScope(scope: string): void;
|
|
259
|
+
// (undocumented)
|
|
260
|
+
protected tokenManager: IamRequestBasedTokenManager;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// @public
|
|
264
|
+
export class IamRequestBasedTokenManager extends JwtTokenManager {
|
|
265
|
+
constructor(options: IamRequestOptions);
|
|
266
|
+
// (undocumented)
|
|
267
|
+
protected formData: any;
|
|
268
|
+
getRefreshToken(): string;
|
|
269
|
+
// (undocumented)
|
|
270
|
+
protected refreshToken: string;
|
|
271
|
+
protected requestToken(): Promise<any>;
|
|
272
|
+
protected saveTokenInfo(tokenResponse: any): void;
|
|
273
|
+
setClientIdAndSecret(clientId: string, clientSecret: string): void;
|
|
274
|
+
setScope(scope: string): void;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// @public
|
|
278
|
+
export interface IamRequestOptions extends JwtTokenManagerOptions {
|
|
279
|
+
// (undocumented)
|
|
280
|
+
clientId?: string;
|
|
281
|
+
// (undocumented)
|
|
282
|
+
clientSecret?: string;
|
|
283
|
+
// (undocumented)
|
|
284
|
+
scope?: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// @public
|
|
288
|
+
export class IamTokenManager extends IamRequestBasedTokenManager {
|
|
289
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
290
|
+
constructor(options: Options_5);
|
|
291
|
+
// (undocumented)
|
|
292
|
+
protected requiredOptions: string[];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// @public (undocumented)
|
|
296
|
+
export function isEmptyObject(obj: any): boolean;
|
|
297
|
+
|
|
298
|
+
// @public (undocumented)
|
|
299
|
+
export function isFileData(obj: any): obj is NodeJS.ReadableStream | Buffer;
|
|
300
|
+
|
|
301
|
+
// @public (undocumented)
|
|
302
|
+
export function isFileWithMetadata(obj: any): obj is FileWithMetadata;
|
|
303
|
+
|
|
304
|
+
// @public
|
|
305
|
+
export function isHTML(text: string): boolean;
|
|
306
|
+
|
|
307
|
+
// @public
|
|
308
|
+
export class JwtTokenManager extends TokenManager {
|
|
309
|
+
constructor(options: JwtTokenManagerOptions);
|
|
310
|
+
protected requestToken(): Promise<any>;
|
|
311
|
+
protected saveTokenInfo(tokenResponse: any): void;
|
|
312
|
+
// (undocumented)
|
|
313
|
+
protected tokenInfo: any;
|
|
314
|
+
// (undocumented)
|
|
315
|
+
protected tokenName: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// @public
|
|
319
|
+
export type JwtTokenManagerOptions = TokenManagerOptions;
|
|
320
|
+
|
|
321
|
+
// @public
|
|
322
|
+
export class NoAuthAuthenticator extends Authenticator {
|
|
323
|
+
// (undocumented)
|
|
324
|
+
authenticate(requestOptions: AuthenticateOptions): Promise<void>;
|
|
325
|
+
authenticationType(): string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// @public
|
|
329
|
+
export function onlyOne(a: any, b: any): boolean;
|
|
330
|
+
|
|
331
|
+
// @public
|
|
332
|
+
export const qs: {
|
|
333
|
+
stringify: (queryParams: Object) => string;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
// @public
|
|
337
|
+
export function readCredentialsFile(): any;
|
|
338
|
+
|
|
339
|
+
// @public (undocumented)
|
|
340
|
+
export function readCrTokenFile(filepath: string): string;
|
|
341
|
+
|
|
342
|
+
// @public
|
|
343
|
+
export function readExternalSources(serviceName: string): any;
|
|
344
|
+
|
|
345
|
+
// @public
|
|
346
|
+
export function removeSuffix(str: string, suffix: string): string;
|
|
347
|
+
|
|
348
|
+
// @public
|
|
349
|
+
export function streamToPromise(stream: Stream): Promise<any>;
|
|
350
|
+
|
|
351
|
+
// @public (undocumented)
|
|
352
|
+
export function stripTrailingSlash(url: string): string;
|
|
353
|
+
|
|
354
|
+
// @public
|
|
355
|
+
export class TokenManager {
|
|
356
|
+
constructor(options: TokenManagerOptions);
|
|
357
|
+
// (undocumented)
|
|
358
|
+
protected accessToken: string;
|
|
359
|
+
// (undocumented)
|
|
360
|
+
protected disableSslVerification: boolean;
|
|
361
|
+
// (undocumented)
|
|
362
|
+
protected expireTime: number;
|
|
363
|
+
getToken(): Promise<any>;
|
|
364
|
+
// (undocumented)
|
|
365
|
+
protected headers: OutgoingHttpHeaders;
|
|
366
|
+
protected pacedRequestToken(): Promise<any>;
|
|
367
|
+
// (undocumented)
|
|
368
|
+
protected refreshTime: number;
|
|
369
|
+
protected requestToken(): Promise<any>;
|
|
370
|
+
// Warning: (ae-forgotten-export) The symbol "RequestWrapper" needs to be exported by the entry point index.d.ts
|
|
371
|
+
//
|
|
372
|
+
// (undocumented)
|
|
373
|
+
protected requestWrapperInstance: RequestWrapper;
|
|
374
|
+
protected saveTokenInfo(tokenResponse: any): void;
|
|
375
|
+
setDisableSslVerification(value: boolean): void;
|
|
376
|
+
setHeaders(headers: OutgoingHttpHeaders): void;
|
|
377
|
+
// (undocumented)
|
|
378
|
+
protected url: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// @public
|
|
382
|
+
export type TokenManagerOptions = {
|
|
383
|
+
url?: string;
|
|
384
|
+
headers?: OutgoingHttpHeaders;
|
|
385
|
+
disableSslVerification?: boolean;
|
|
386
|
+
[propName: string]: any;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
// @public
|
|
390
|
+
export class TokenRequestBasedAuthenticator extends Authenticator {
|
|
391
|
+
// Warning: (ae-forgotten-export) The symbol "BaseOptions" needs to be exported by the entry point index.d.ts
|
|
392
|
+
constructor(options: BaseOptions);
|
|
393
|
+
authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
|
|
394
|
+
// (undocumented)
|
|
395
|
+
protected disableSslVerification: boolean;
|
|
396
|
+
// (undocumented)
|
|
397
|
+
protected headers: OutgoingHttpHeaders;
|
|
398
|
+
setDisableSslVerification(value: boolean): void;
|
|
399
|
+
setHeaders(headers: OutgoingHttpHeaders): void;
|
|
400
|
+
// (undocumented)
|
|
401
|
+
protected tokenManager: JwtTokenManager;
|
|
402
|
+
// (undocumented)
|
|
403
|
+
protected url: string;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// @public
|
|
407
|
+
export function toLowerKeys(obj: Object): Object;
|
|
408
|
+
|
|
409
|
+
declare namespace unitTestUtils {
|
|
410
|
+
export {
|
|
411
|
+
checkUrlAndMethod,
|
|
412
|
+
checkMediaHeaders,
|
|
413
|
+
checkUserHeader,
|
|
414
|
+
checkForSuccessfulExecution,
|
|
415
|
+
getOptions,
|
|
416
|
+
expectToBePromise
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
export { unitTestUtils }
|
|
420
|
+
|
|
421
|
+
// @public
|
|
422
|
+
export interface UserOptions {
|
|
423
|
+
[propName: string]: any;
|
|
424
|
+
authenticator?: AuthenticatorInterface;
|
|
425
|
+
disableSslVerification?: boolean;
|
|
426
|
+
headers?: OutgoingHttpHeaders;
|
|
427
|
+
jar?: CookieJar | boolean;
|
|
428
|
+
serviceUrl?: string;
|
|
429
|
+
url?: string;
|
|
430
|
+
version?: string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// @public (undocumented)
|
|
434
|
+
export function validateInput(options: any, requiredOptions: string[]): void;
|
|
435
|
+
|
|
436
|
+
// @public
|
|
437
|
+
export function validateParams(params: {
|
|
438
|
+
[key: string]: any;
|
|
439
|
+
}, requiredParams: string[], allParams: string[]): null | Error;
|
|
440
|
+
|
|
441
|
+
// @public
|
|
442
|
+
export class VpcInstanceAuthenticator extends TokenRequestBasedAuthenticator {
|
|
443
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
444
|
+
constructor(options: Options_10);
|
|
445
|
+
authenticationType(): string;
|
|
446
|
+
setIamProfileCrn(iamProfileCrn: string): void;
|
|
447
|
+
setIamProfileId(iamProfileId: string): void;
|
|
448
|
+
// (undocumented)
|
|
449
|
+
protected tokenManager: VpcInstanceTokenManager;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// @public
|
|
453
|
+
export class VpcInstanceTokenManager extends JwtTokenManager {
|
|
454
|
+
// Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts
|
|
455
|
+
constructor(options: Options_9);
|
|
456
|
+
// (undocumented)
|
|
457
|
+
protected requestToken(): Promise<any>;
|
|
458
|
+
setIamProfileCrn(iamProfileCrn: string): void;
|
|
459
|
+
setIamProfileId(iamProfileId: string): void;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// (No @packageDocumentation comment for this package)
|
|
463
|
+
|
|
464
|
+
```
|
package/ibm-cloud-sdk-core.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
3
|
import { AxiosInstance } from 'axios';
|
|
4
|
+
import type { CookieJar } from 'tough-cookie';
|
|
4
5
|
import { OutgoingHttpHeaders } from 'http';
|
|
5
6
|
import { Stream } from 'stream';
|
|
6
7
|
|
|
@@ -1448,7 +1449,7 @@ export declare class BaseService {
|
|
|
1448
1449
|
/** Set to `true` to allow unauthorized requests - not recommended for production use. */
|
|
1449
1450
|
disableSslVerification?: boolean;
|
|
1450
1451
|
/** Set your own cookie jar object */
|
|
1451
|
-
jar?:
|
|
1452
|
+
jar?: CookieJar | boolean;
|
|
1452
1453
|
/** Deprecated. Use `serviceUrl` instead. */
|
|
1453
1454
|
url?: string;
|
|
1454
1455
|
/** Allow additional request config parameters */
|
package/lib/base-service.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
/// <reference types="node" />
|
|
17
|
+
import type { CookieJar } from 'tough-cookie';
|
|
17
18
|
import { OutgoingHttpHeaders } from 'http';
|
|
18
19
|
import { AuthenticatorInterface } from '../auth';
|
|
19
20
|
import { RetryOptions } from './request-wrapper';
|
|
@@ -32,7 +33,7 @@ export interface UserOptions {
|
|
|
32
33
|
/** Set to `true` to allow unauthorized requests - not recommended for production use. */
|
|
33
34
|
disableSslVerification?: boolean;
|
|
34
35
|
/** Set your own cookie jar object */
|
|
35
|
-
jar?:
|
|
36
|
+
jar?: CookieJar | boolean;
|
|
36
37
|
/** Deprecated. Use `serviceUrl` instead. */
|
|
37
38
|
url?: string;
|
|
38
39
|
/** Allow additional request config parameters */
|
package/lib/request-wrapper.js
CHANGED
|
@@ -87,26 +87,13 @@ var logger_1 = __importDefault(require("./logger"));
|
|
|
87
87
|
var stream_to_promise_1 = require("./stream-to-promise");
|
|
88
88
|
var RequestWrapper = /** @class */ (function () {
|
|
89
89
|
function RequestWrapper(axiosOptions) {
|
|
90
|
+
var _this = this;
|
|
90
91
|
axiosOptions = axiosOptions || {};
|
|
91
92
|
this.compressRequestData = Boolean(axiosOptions.enableGzipCompression);
|
|
92
|
-
// override
|
|
93
|
-
// axios sets the default Content-Type for `post`, `put`, and `patch` operations
|
|
94
|
-
// to 'application/x-www-form-urlencoded'. This causes problems, so overriding the
|
|
95
|
-
// defaults here
|
|
93
|
+
// override a couple axios defaults
|
|
96
94
|
var axiosConfig = {
|
|
97
95
|
maxContentLength: -1,
|
|
98
96
|
maxBodyLength: Infinity,
|
|
99
|
-
headers: {
|
|
100
|
-
post: {
|
|
101
|
-
'Content-Type': 'application/json',
|
|
102
|
-
},
|
|
103
|
-
put: {
|
|
104
|
-
'Content-Type': 'application/json',
|
|
105
|
-
},
|
|
106
|
-
patch: {
|
|
107
|
-
'Content-Type': 'application/json',
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
97
|
};
|
|
111
98
|
// merge axios config into default
|
|
112
99
|
extend_1.default(true, axiosConfig, axiosOptions);
|
|
@@ -128,6 +115,12 @@ var RequestWrapper = /** @class */ (function () {
|
|
|
128
115
|
}
|
|
129
116
|
}
|
|
130
117
|
this.axiosInstance = axios_1.default.create(axiosConfig);
|
|
118
|
+
// axios sets the default Content-Type for `post`, `put`, and `patch` operations
|
|
119
|
+
// to 'application/x-www-form-urlencoded'. This causes problems, so overriding the
|
|
120
|
+
// defaults here
|
|
121
|
+
['post', 'put', 'patch'].forEach(function (op) {
|
|
122
|
+
_this.axiosInstance.defaults.headers[op]['Content-Type'] = 'application/json';
|
|
123
|
+
});
|
|
131
124
|
// if a cookie jar is provided, wrap the axios instance and update defaults
|
|
132
125
|
if (axiosOptions.jar) {
|
|
133
126
|
axios_cookiejar_support_1.default(this.axiosInstance);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ibm-cloud-sdk-core",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.11",
|
|
4
4
|
"description": "Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "./es/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/isstream": "^0.1.0",
|
|
43
43
|
"@types/node": "~10.14.19",
|
|
44
44
|
"@types/tough-cookie": "^4.0.0",
|
|
45
|
-
"axios": "^0.
|
|
45
|
+
"axios": "^0.26.1",
|
|
46
46
|
"axios-cookiejar-support": "^1.0.0",
|
|
47
47
|
"camelcase": "^5.3.1",
|
|
48
48
|
"debug": "^4.1.1",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"node": ">=10"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
|
+
"clean": "rm -fr node_modules",
|
|
72
73
|
"commitmsg": "commitlint -E GIT_PARAMS",
|
|
73
74
|
"eslint:config": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
|
|
74
75
|
"eslint:fix": "eslint . --fix",
|
|
@@ -6606,9 +6606,14 @@
|
|
|
6606
6606
|
"kind": "Content",
|
|
6607
6607
|
"text": "jar?: "
|
|
6608
6608
|
},
|
|
6609
|
+
{
|
|
6610
|
+
"kind": "Reference",
|
|
6611
|
+
"text": "CookieJar",
|
|
6612
|
+
"canonicalReference": "@types/tough-cookie!CookieJar:class"
|
|
6613
|
+
},
|
|
6609
6614
|
{
|
|
6610
6615
|
"kind": "Content",
|
|
6611
|
-
"text": "
|
|
6616
|
+
"text": " | boolean"
|
|
6612
6617
|
},
|
|
6613
6618
|
{
|
|
6614
6619
|
"kind": "Content",
|
|
@@ -6620,7 +6625,7 @@
|
|
|
6620
6625
|
"name": "jar",
|
|
6621
6626
|
"propertyTypeTokenRange": {
|
|
6622
6627
|
"startIndex": 1,
|
|
6623
|
-
"endIndex":
|
|
6628
|
+
"endIndex": 3
|
|
6624
6629
|
}
|
|
6625
6630
|
},
|
|
6626
6631
|
{
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
/// <reference types="node" />
|
|
8
8
|
|
|
9
9
|
import { AxiosInstance } from 'axios';
|
|
10
|
+
import type { CookieJar } from 'tough-cookie';
|
|
10
11
|
import { OutgoingHttpHeaders } from 'http';
|
|
11
12
|
import { Stream } from 'stream';
|
|
12
13
|
|
|
@@ -423,7 +424,7 @@ export interface UserOptions {
|
|
|
423
424
|
authenticator?: AuthenticatorInterface;
|
|
424
425
|
disableSslVerification?: boolean;
|
|
425
426
|
headers?: OutgoingHttpHeaders;
|
|
426
|
-
jar?:
|
|
427
|
+
jar?: CookieJar | boolean;
|
|
427
428
|
serviceUrl?: string;
|
|
428
429
|
url?: string;
|
|
429
430
|
version?: string;
|