-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add implementation of the webhook signature JWT. * Update the linter. * Fix all lint errors and some lint warnings. * Add GH Actions.
- Loading branch information
Showing
40 changed files
with
3,432 additions
and
371 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
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,36 @@ | ||
name: test | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
- '!master' | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
name: NodeJS ${{ matrix.node }} lint | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup nodejs | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
- run: npm install | ||
- run: npm run dtslint | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ '10','11', '12', '13', '14', '15', '16', '17', '18'] | ||
name: NodeJS ${{ matrix.node }} test | ||
env: | ||
MB_ACCESSKEY: test_iQpAp0KCs5GCsMpDhIx2leuNB | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup nodejs | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: npm install | ||
- run: npm run test |
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
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
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
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
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,16 @@ | ||
|
||
const messagebird = require('messagebird')('<YOUR_ACCESS_KEY>'); | ||
|
||
messagebird.messages.list(function (err, response) { | ||
if (err) { | ||
return console.log(err); | ||
} | ||
console.log(response); | ||
}); | ||
|
||
messagebird.messages.list({ status: 'scheduled' }, function (err, response) { | ||
if (err) { | ||
return console.log(err); | ||
} | ||
console.log(response); | ||
}); |
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 was deleted.
Oops, something went wrong.
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
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
29 changes: 17 additions & 12 deletions
29
examples/verify_create_email.js → examples/verify-create-email.js
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 |
---|---|---|
@@ -1,37 +1,42 @@ | ||
|
||
var messagebird = require('messagebird')('<YOUR_ACCESS_KEY>'); | ||
const messagebird = require('messagebird')('<YOUR_ACCESS_KEY>'); | ||
|
||
var from = "<FROM_EMAIL>";//email from which users will receive the verification token | ||
var to = "<TO_EMAIL>";//email to which the verification code will be sent to | ||
var additionalParams = { | ||
// email from which users will receive the verification token | ||
const from = '<FROM_EMAIL>'; | ||
|
||
// email to which the verification code will be sent to | ||
const to = '<TO_EMAIL>'; | ||
const additionalParams = { | ||
subject: 'Your verification code', | ||
template: 'Your security token: %token', | ||
timeout: 300 | ||
} | ||
}; | ||
|
||
//Creating a token with email | ||
// Creating a token with email | ||
messagebird.verify.createWithEmail(from, to, additionalParams, function (err, response) { | ||
if (err) { | ||
return console.log(err); | ||
} | ||
console.log(response); | ||
}); | ||
|
||
//Validating a token | ||
var verifyId = '<VERIFY_ID>'; | ||
var token = '<TOKEN>'; | ||
// Validating a token | ||
const verifyId = '<VERIFY_ID>'; | ||
const token = '<TOKEN>'; | ||
|
||
messagebird.verify.verify(verifyId, token, function (err, response) { | ||
if (err) { | ||
return console.log(err); | ||
} | ||
console.log(response); | ||
}); | ||
|
||
//Retrieving a email message | ||
var emailMessageId = '<MESSAGE_ID>'; | ||
// Retrieving a email message | ||
const emailMessageId = '<MESSAGE_ID>'; | ||
|
||
messagebird.verify.getVerifyEmailMessage(emailMessageId, function (err, response) { | ||
if (err) { | ||
return console.log(err); | ||
} | ||
console.log(response); | ||
}); | ||
}); |
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
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.