Skip to content

Commit

Permalink
feat: export UserOptions interface from the BaseService (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpopp07 committed Oct 3, 2019
1 parent 9034648 commit 4f0075a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @module ibm-cloud-sdk-core
*/

export { BaseService } from './lib/base_service';
export { BaseService, UserOptions } from './lib/base_service';
export * from './auth';
export * from './lib/helper';
export { default as qs } from './lib/querystring';
Expand Down
18 changes: 12 additions & 6 deletions lib/base_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


import extend = require('extend');
import { OutgoingHttpHeaders } from 'http';
import semver = require('semver');
Expand All @@ -23,12 +24,18 @@ import { stripTrailingSlash } from './helper';
import { RequestWrapper } from './requestwrapper';

export interface UserOptions {
url?: string; // deprecated
/** The Authenticator object used to authenticate requests to the service */
authenticator?: AuthenticatorInterface;
/** The base url to use when contacting the service. The base url may differ between IBM Cloud regions. */
serviceUrl?: string;
version?: string;
/** Default headers that shall be included with every request to the service. */
headers?: OutgoingHttpHeaders;
/** The API version date to use with the service, in "YYYY-MM-DD" format. */
version?: string;
/** Set to `true` to allow unauthorized requests - not recommended for production use. */
disableSslVerification?: boolean;
authenticator?: AuthenticatorInterface;
/** Deprecated. Use `serviceUrl` instead. */
url?: string;
/** Allow additional request config parameters */
[propName: string]: any;
}
Expand All @@ -48,8 +55,7 @@ export class BaseService {
/**
* Internal base class that other services inherit from
* @param {UserOptions} options
* @param {HeaderOptions} [options.headers]
* @param {boolean} [options.headers.X-Watson-Learning-Opt-Out=false] - opt-out of data collection
* @param {OutgoingHttpHeaders} [options.headers]
* @param {string} [options.url] - override default service base url
* @private
* @abstract
Expand Down Expand Up @@ -142,7 +148,7 @@ export class BaseService {
* - array: each element of the array is sent as a separate form part using any special processing as described above
* @param {Object} parameters.defaultOptions
* @param {string} parameters.defaultOptions.serviceUrl - the base URL of the service
* @param {HeaderOptions} parameters.defaultOptions.headers - additional headers to be passed on the request.
* @param {OutgoingHttpHeaders} parameters.defaultOptions.headers - additional headers to be passed on the request.
* @param {Function} callback - callback function to pass the response back to
* @returns {ReadableStream|undefined}
*/
Expand Down

0 comments on commit 4f0075a

Please sign in to comment.