Skip to content

Commit 4f0075a

Browse files
committed
feat: export UserOptions interface from the BaseService (#50)
1 parent 9034648 commit 4f0075a

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @module ibm-cloud-sdk-core
1919
*/
2020

21-
export { BaseService } from './lib/base_service';
21+
export { BaseService, UserOptions } from './lib/base_service';
2222
export * from './auth';
2323
export * from './lib/helper';
2424
export { default as qs } from './lib/querystring';

lib/base_service.ts

+12-6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
1718
import extend = require('extend');
1819
import { OutgoingHttpHeaders } from 'http';
1920
import semver = require('semver');
@@ -23,12 +24,18 @@ import { stripTrailingSlash } from './helper';
2324
import { RequestWrapper } from './requestwrapper';
2425

2526
export interface UserOptions {
26-
url?: string; // deprecated
27+
/** The Authenticator object used to authenticate requests to the service */
28+
authenticator?: AuthenticatorInterface;
29+
/** The base url to use when contacting the service. The base url may differ between IBM Cloud regions. */
2730
serviceUrl?: string;
28-
version?: string;
31+
/** Default headers that shall be included with every request to the service. */
2932
headers?: OutgoingHttpHeaders;
33+
/** The API version date to use with the service, in "YYYY-MM-DD" format. */
34+
version?: string;
35+
/** Set to `true` to allow unauthorized requests - not recommended for production use. */
3036
disableSslVerification?: boolean;
31-
authenticator?: AuthenticatorInterface;
37+
/** Deprecated. Use `serviceUrl` instead. */
38+
url?: string;
3239
/** Allow additional request config parameters */
3340
[propName: string]: any;
3441
}
@@ -48,8 +55,7 @@ export class BaseService {
4855
/**
4956
* Internal base class that other services inherit from
5057
* @param {UserOptions} options
51-
* @param {HeaderOptions} [options.headers]
52-
* @param {boolean} [options.headers.X-Watson-Learning-Opt-Out=false] - opt-out of data collection
58+
* @param {OutgoingHttpHeaders} [options.headers]
5359
* @param {string} [options.url] - override default service base url
5460
* @private
5561
* @abstract
@@ -142,7 +148,7 @@ export class BaseService {
142148
* - array: each element of the array is sent as a separate form part using any special processing as described above
143149
* @param {Object} parameters.defaultOptions
144150
* @param {string} parameters.defaultOptions.serviceUrl - the base URL of the service
145-
* @param {HeaderOptions} parameters.defaultOptions.headers - additional headers to be passed on the request.
151+
* @param {OutgoingHttpHeaders} parameters.defaultOptions.headers - additional headers to be passed on the request.
146152
* @param {Function} callback - callback function to pass the response back to
147153
* @returns {ReadableStream|undefined}
148154
*/

0 commit comments

Comments
 (0)