Skip to content

Commit

Permalink
feat(Client1_10): add Client class for a specific API version (#315)
Browse files Browse the repository at this point in the history
The next step is to add a TypeScript declaration file for this specific API
version.
  • Loading branch information
silasbw authored Aug 28, 2018
1 parent a8e399c commit 3a2886c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ module.exports.testUtils = {
//
// Current interface
//
module.exports.Client = require('./swagger-client');
module.exports.Client = require('./swagger-client').Client;
module.exports.Client1_10 = require('./swagger-client').Client1_10;
module.exports.config = require('./config');
12 changes: 11 additions & 1 deletion lib/swagger-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,14 @@ class Client {
}
}

module.exports = Client;
// eslint-disable-next-line camelcase
class Client1_10 extends Client {
constructor(options) {
super(Object.assign({}, options, { version: '1.10' }));
}
}

module.exports = {
Client,
Client1_10
};
2 changes: 1 addition & 1 deletion test/swagger-client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const assume = require('assume');
const nock = require('nock');

const common = require('./common');
const Client = require('../lib/swagger-client');
const Client = require('../lib/swagger-client').Client;

const beforeTesting = common.beforeTesting;

Expand Down

0 comments on commit 3a2886c

Please sign in to comment.