Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/gen/js/service.js.template
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions src/gen/js/service.ts.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../types.ts"/>
// Auto-generated, edits will be overwritten
import spec from './spec';;
import specification from './spec';;

export class ServiceError extends Error implements api.ServiceError {
status: number;;
Expand All @@ -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<any> {
Expand Down