diff --git a/src/gen/js/service.js.template b/src/gen/js/service.js.template index 2c2c797..c60e3f8 100644 --- a/src/gen/js/service.js.template +++ b/src/gen/js/service.js.template @@ -1,12 +1,14 @@ // Auto-generated, edits will be overwritten -import spec from './spec';; +import specification from './spec';; export class ServiceError extends Error {} let options = {};; +let spec = specification;; -export function init(serviceOptions) { +export function init(serviceOptions, apiSpec = spec) { options = serviceOptions;; + spec = apiSpec;; } export function request(op, parameters, attempt) { diff --git a/src/gen/js/service.ts.template b/src/gen/js/service.ts.template index cf8c8ec..fd23255 100644 --- a/src/gen/js/service.ts.template +++ b/src/gen/js/service.ts.template @@ -1,6 +1,6 @@ /// // Auto-generated, edits will be overwritten -import spec from './spec';; +import specification from './spec';; export class ServiceError extends Error implements api.ServiceError { status: number;; @@ -9,9 +9,11 @@ export class ServiceError extends Error implements api.ServiceError { } let options: api.ServiceOptions = {};; +let spec = specification;; -export function init(serviceOptions: api.ServiceOptions) { +export function init(serviceOptions: api.ServiceOptions, apiSpec = spec) { options = serviceOptions;; + spec = apiSpec;; } export function request(op: api.OperationInfo, parameters?: api.OperationParamGroups, attempt = 1): Promise {