ibm-cloud-sdk-core 5.1.4 → 5.2.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/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/lib/axios-types.d.ts +16 -0
- package/es/lib/axios-types.js +16 -0
- package/es/lib/request-wrapper.js +3 -10
- package/ibm-cloud-sdk-core.d.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/lib/axios-types.d.ts +16 -0
- package/lib/axios-types.js +17 -0
- package/lib/request-wrapper.js +3 -12
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (C) Copyright IBM Corp. 2025.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { GenericAbortSignal as AbortSignal } from 'axios';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (C) Copyright IBM Corp. 2025.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -192,7 +192,7 @@ export class RequestWrapper {
|
|
|
192
192
|
sendRequest(parameters) {
|
|
193
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
194
|
const options = extend(true, {}, parameters.defaultOptions, parameters.options);
|
|
195
|
-
const { path, body, form, formData, qs, method, serviceUrl } = options;
|
|
195
|
+
const { path, body, form, formData, qs, method, serviceUrl, axiosOptions } = options;
|
|
196
196
|
let { headers, url } = options;
|
|
197
197
|
const multipartForm = new FormData();
|
|
198
198
|
// Form params
|
|
@@ -252,16 +252,9 @@ export class RequestWrapper {
|
|
|
252
252
|
if (this.compressRequestData) {
|
|
253
253
|
data = yield this.gzipRequestBody(data, headers);
|
|
254
254
|
}
|
|
255
|
-
const requestParams = {
|
|
256
|
-
url,
|
|
255
|
+
const requestParams = Object.assign({ url,
|
|
257
256
|
method,
|
|
258
|
-
headers,
|
|
259
|
-
params: qs,
|
|
260
|
-
data,
|
|
261
|
-
raxConfig: this.raxConfig,
|
|
262
|
-
responseType: options.responseType || 'json',
|
|
263
|
-
paramsSerializer: { serialize: (params) => stringify(params) },
|
|
264
|
-
};
|
|
257
|
+
headers, params: qs, data, raxConfig: this.raxConfig, responseType: options.responseType || 'json', paramsSerializer: { serialize: (params) => stringify(params) } }, axiosOptions);
|
|
265
258
|
return this.axiosInstance(requestParams).then((res) => {
|
|
266
259
|
// sometimes error responses will still trigger the `then` block - escape that behavior here
|
|
267
260
|
if (!res) {
|
package/ibm-cloud-sdk-core.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
|
+
import { GenericAbortSignal as AbortSignal_2 } from 'axios';
|
|
3
4
|
import { AxiosInstance } from 'axios';
|
|
4
5
|
import type { CookieJar } from 'tough-cookie';
|
|
5
6
|
import { Debugger } from 'debug';
|
|
6
7
|
import { OutgoingHttpHeaders } from 'http';
|
|
7
8
|
import { Stream } from 'stream';
|
|
8
9
|
|
|
10
|
+
export { AbortSignal_2 as AbortSignal }
|
|
11
|
+
|
|
9
12
|
/**
|
|
10
13
|
* Checks for at least one of the given elements being defined.
|
|
11
14
|
*
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -36,6 +36,7 @@ exports.getNewLogger = exports.contentType = exports.qs = exports.BaseService =
|
|
|
36
36
|
/**
|
|
37
37
|
* @module ibm-cloud-sdk-core
|
|
38
38
|
*/
|
|
39
|
+
__exportStar(require("./lib/axios-types"), exports);
|
|
39
40
|
var base_service_1 = require("./lib/base-service");
|
|
40
41
|
Object.defineProperty(exports, "BaseService", { enumerable: true, get: function () { return base_service_1.BaseService; } });
|
|
41
42
|
__exportStar(require("./auth"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (C) Copyright IBM Corp. 2025.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { GenericAbortSignal as AbortSignal } from 'axios';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* (C) Copyright IBM Corp. 2025.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/request-wrapper.js
CHANGED
|
@@ -259,13 +259,13 @@ var RequestWrapper = /** @class */ (function () {
|
|
|
259
259
|
*/
|
|
260
260
|
RequestWrapper.prototype.sendRequest = function (parameters) {
|
|
261
261
|
return __awaiter(this, void 0, void 0, function () {
|
|
262
|
-
var options, path, body, form, formData, qs, method, serviceUrl, headers, url, multipartForm, _i, _a, key, values, _b, values_1, value, fileObj, data, requestParams;
|
|
262
|
+
var options, path, body, form, formData, qs, method, serviceUrl, axiosOptions, headers, url, multipartForm, _i, _a, key, values, _b, values_1, value, fileObj, data, requestParams;
|
|
263
263
|
var _this = this;
|
|
264
264
|
return __generator(this, function (_c) {
|
|
265
265
|
switch (_c.label) {
|
|
266
266
|
case 0:
|
|
267
267
|
options = (0, extend_1.default)(true, {}, parameters.defaultOptions, parameters.options);
|
|
268
|
-
path = options.path, body = options.body, form = options.form, formData = options.formData, qs = options.qs, method = options.method, serviceUrl = options.serviceUrl;
|
|
268
|
+
path = options.path, body = options.body, form = options.form, formData = options.formData, qs = options.qs, method = options.method, serviceUrl = options.serviceUrl, axiosOptions = options.axiosOptions;
|
|
269
269
|
headers = options.headers, url = options.url;
|
|
270
270
|
multipartForm = new form_data_1.default();
|
|
271
271
|
if (!formData) return [3 /*break*/, 7];
|
|
@@ -338,16 +338,7 @@ var RequestWrapper = /** @class */ (function () {
|
|
|
338
338
|
data = _c.sent();
|
|
339
339
|
_c.label = 9;
|
|
340
340
|
case 9:
|
|
341
|
-
requestParams = {
|
|
342
|
-
url: url,
|
|
343
|
-
method: method,
|
|
344
|
-
headers: headers,
|
|
345
|
-
params: qs,
|
|
346
|
-
data: data,
|
|
347
|
-
raxConfig: this.raxConfig,
|
|
348
|
-
responseType: options.responseType || 'json',
|
|
349
|
-
paramsSerializer: { serialize: function (params) { return (0, querystring_1.stringify)(params); } },
|
|
350
|
-
};
|
|
341
|
+
requestParams = __assign({ url: url, method: method, headers: headers, params: qs, data: data, raxConfig: this.raxConfig, responseType: options.responseType || 'json', paramsSerializer: { serialize: function (params) { return (0, querystring_1.stringify)(params); } } }, axiosOptions);
|
|
351
342
|
return [2 /*return*/, this.axiosInstance(requestParams).then(function (res) {
|
|
352
343
|
// sometimes error responses will still trigger the `then` block - escape that behavior here
|
|
353
344
|
if (!res) {
|