-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from Nexmo/v2.5.1
V2.5.1 - apps v2 & verify typings
- Loading branch information
Showing
25 changed files
with
1,386 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,7 @@ npm-debug.log | |
coverage | ||
.nyc_output | ||
.idea | ||
coverage.lcov | ||
.DS_Store | ||
.env | ||
.nexmo-app | ||
coverage.lcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, { | ||
debug: config.DEBUG | ||
}); | ||
|
||
const name = 'My nexmo-node Messages App'; | ||
const type = 'messages'; | ||
const answerUrl = 'https://example.com'; // webhook that points to NCCO | ||
const eventUrl = 'https://example.com'; | ||
|
||
let options = { | ||
inbound_url: 'https://example.com', | ||
status_url: 'https://example.com' | ||
}; | ||
|
||
nexmo.applications.create(name, type, answerUrl, eventUrl, options, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, { | ||
debug: config.DEBUG | ||
}); | ||
|
||
nexmo.applications.create({ | ||
name: 'My nexmo-node Example V2 App', | ||
capabilities: { | ||
voice: { | ||
webhooks: { | ||
answer_url: { | ||
address: "https://example.com", | ||
http_method: "GET" | ||
}, | ||
event_url: { | ||
address: "https://example.com", | ||
http_method: "POST" | ||
} | ||
} | ||
}, | ||
messages: { | ||
webhooks: { | ||
inbound_url: { | ||
address: "https://example.com", | ||
http_method: "POST" | ||
}, | ||
status_url: { | ||
address: "https://example.com", | ||
http_method: "POST" | ||
} | ||
} | ||
}, | ||
rtc: { | ||
webhooks: { | ||
event_url: { | ||
address: "https://example.com", | ||
http_method: "POST" | ||
} | ||
} | ||
} | ||
} | ||
}, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, | ||
{debug: config.DEBUG} | ||
); | ||
|
||
nexmo.applications.delete(config.APP_ID, callback); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, | ||
{debug: config.DEBUG} | ||
); | ||
|
||
nexmo.applications.get(config.APP_ID, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, | ||
{debug: config.DEBUG} | ||
); | ||
|
||
nexmo.applications.get({page_size: 5}, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, | ||
{debug: config.DEBUG} | ||
); | ||
|
||
nexmo.applications.get(config.APP_ID, callback, true); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, | ||
{debug: config.DEBUG} | ||
); | ||
|
||
nexmo.applications.get({page_size: 5}, callback, true); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, { | ||
debug: config.DEBUG | ||
}); | ||
|
||
const name = 'My updated nexmo-node Messages App'; | ||
const type = 'messages'; | ||
const answerUrl = 'https://example.com'; // webhook that points to NCCO | ||
const eventUrl = 'https://example.com'; | ||
|
||
let options = { | ||
inbound_url: 'https://example.com', | ||
status_url: 'https://example.com' | ||
}; | ||
|
||
nexmo.applications.update(config.APP_ID, name, type, answerUrl, eventUrl, options, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = function(callback, config) { | ||
|
||
var Nexmo = require('../lib/Nexmo'); | ||
|
||
var nexmo = new Nexmo({ | ||
apiKey: config.API_KEY, | ||
apiSecret: config.API_SECRET | ||
}, { | ||
debug: config.DEBUG | ||
}); | ||
|
||
nexmo.applications.update(config.APP_ID, { | ||
name: 'My updated nexmo-node Example V2 App', | ||
capabilities: { | ||
voice: { | ||
webhooks: { | ||
answer_url: { | ||
address: "https://example.com", | ||
http_method: "GET" | ||
}, | ||
event_url: { | ||
address: "https://example.com", | ||
http_method: "POST" | ||
} | ||
} | ||
}, | ||
messages: { | ||
webhooks: { | ||
inbound_url: { | ||
address: "https://example.com", | ||
http_method: "POST" | ||
}, | ||
status_url: { | ||
address: "https://example.com", | ||
http_method: "POST" | ||
} | ||
} | ||
}, | ||
rtc: { | ||
webhooks: { | ||
event_url: { | ||
address: "https://example.com", | ||
http_method: "POST" | ||
} | ||
} | ||
} | ||
} | ||
}, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.