From 43b439cb2c3aeca64f8a64ec6eb79e749916c1ff Mon Sep 17 00:00:00 2001 From: Vincent Giersch Date: Fri, 5 Dec 2014 19:31:59 +0100 Subject: [PATCH] Add pre-configured endpoints aliases Signed-off-by: Vincent Giersch --- CHANGELOG.md | 4 ++++ README.md | 12 ++++++------ lib/endpoints.js | 12 ++++++++++++ package.json | 2 +- tests/01_REST_construct.js | 14 +++++++++++--- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84c486f..a12dfb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.1.2 + +* Add aliases soyoustart-eu, soyoustart-ca, kimsufi-eu, kimsufi-ca to sys-eu, sys-ca, ks-eu and ks-ca. + ## 1.1.1 * Add Kimsufi and SoYouStart APIs diff --git a/README.md b/README.md index b5f4801..a9176d3 100644 --- a/README.md +++ b/README.md @@ -67,10 +67,10 @@ Depending the API you want to use, you need to specify the below API endpoint: * OVH Europe: ```ovh-eu``` (default) * OVH North-America: ```ovh-ca``` * RunAbove: ```runabove-ca``` -* SoYouStart Europe: ```sys-eu``` -* SoYouStart North-America: ```sys-ca``` -* Kimsufi Europe: ```ks-eu``` -* Kimsufi North-America: ```ks-ca``` +* SoYouStart Europe: ```soyoustart-eu``` +* SoYouStart North-America: ```soyoustart-ca``` +* Kimsufi Europe: ```kimsufi-eu``` +* Kimsufi North-America: ```kimsufi-ca``` ```js var ovh = require('ovh')({ @@ -99,7 +99,7 @@ $ node credentials.js ``` This consumer key can be scoped with a **specific authorization**. -For example if your application will only send SMS: +For example if your application will only send SMS: ```javascript ovh.request('POST', '/auth/credential', { @@ -112,7 +112,7 @@ ovh.request('POST', '/auth/credential', { ``` Once the consumer key will be authorized on the specified URL, -you'll be able to play with the API calls allowed by this key. +you'll be able to play with the API calls allowed by this key. #### 3. Let's play! diff --git a/lib/endpoints.js b/lib/endpoints.js index 2df9d75..6db1442 100644 --- a/lib/endpoints.js +++ b/lib/endpoints.js @@ -51,10 +51,22 @@ module.exports = { 'sys-ca': { 'host': 'ca.api.soyoustart.com' }, + 'soyoustart-eu': { + 'host': 'eu.api.soyoustart.com' + }, + 'soyoustart-ca': { + 'host': 'ca.api.soyoustart.com' + }, 'ks-eu': { 'host': 'eu.api.kimsufi.com' }, 'ks-ca': { 'host': 'ca.api.kimsufi.com' }, + 'kimsufi-eu': { + 'host': 'eu.api.kimsufi.com' + }, + 'kimsufi-ca': { + 'host': 'ca.api.kimsufi.com' + }, }; diff --git a/package.json b/package.json index 0bd4f7f..34ba00a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ovh", - "version": "1.1.1", + "version": "1.1.2", "description": "Official Node.js wrapper for the OVH APIs", "homepage": "http://ovh.github.io/node-ovh", "author": "Vincent Giersch ", diff --git a/tests/01_REST_construct.js b/tests/01_REST_construct.js index 72949f9..ba0f049 100644 --- a/tests/01_REST_construct.js +++ b/tests/01_REST_construct.js @@ -85,10 +85,19 @@ exports.REST_construct = { var rest = ovh({ appKey: 'XXX', appSecret: 'XXX', - endpoint: 'runabove-ca' + endpoint: 'sys-ca' }); - assert.equal(rest.host, 'api.runabove.com'); + assert.equal(rest.host, 'ca.api.soyoustart.com'); + assert.equal(rest.port, 443); + assert.equal(rest.basePath, '/1.0'); + + rest = ovh({ + appKey: 'XXX', appSecret: 'XXX', + endpoint: 'soyoustart-ca' + }); + + assert.equal(rest.host, 'ca.api.soyoustart.com'); assert.equal(rest.port, 443); assert.equal(rest.basePath, '/1.0'); @@ -98,4 +107,3 @@ exports.REST_construct = { ); } }; -