Skip to content

Commit 009b74a

Browse files
authored
Merge pull request #11 from telstra/task/assertion-error-numbers-create-additional-attrs
Task/assertion error numbers create additional attrs
2 parents d05d7d1 + f9b6e32 commit 009b74a

19 files changed

+284
-180
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.21] - 2021-08-24
9+
10+
- Updated numbers, activeDays and notifyURL are optional attributes
11+
812
## [0.3.20] - 2021-08-23
913

1014
- Updated type Message, subject should be optional

examples/index.js

Lines changed: 0 additions & 106 deletions
This file was deleted.

examples/index.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/message-healthcheck.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var { Message } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const message = new Message(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const message = new Message();
9+
10+
const mobileNumber = process.env.MOBILE_NUMBER ? process.env.MOBILE_NUMBER : '+61123456789';
11+
12+
/**
13+
* Message
14+
*/
15+
16+
message
17+
.healthCheck()
18+
.then(result => console.log('SUCCESS:message:healthCheck:', result))
19+
.catch(error => console.error('ERROR:message:healthCheck:', error));

examples/message-retrieve-replies.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var { Message } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const message = new Message(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const message = new Message();
9+
10+
/**
11+
* Message
12+
*/
13+
14+
message.getNextUnreadReply()
15+
.then(result => console.log('SUCCESS:message:getNextUnreadReply:', result))
16+
.catch(error => console.error('ERROR:message:getNextUnreadReply:', error))

examples/message-send-mms.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var { Message } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const message = new Message(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const message = new Message();
9+
10+
const mobileNumber = process.env.MOBILE_NUMBER ? process.env.MOBILE_NUMBER : '+61123456789';
11+
12+
/**
13+
* Message
14+
*/
15+
16+
message
17+
.send({
18+
to: mobileNumber,
19+
subject: 'Hello from Messaging SDK!',
20+
MMSContent: [
21+
{
22+
type: 'image/gif',
23+
filename: 'bus.gif',
24+
payload:
25+
'R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImI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mdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==',
26+
},
27+
],
28+
})
29+
.then(result => console.log('SUCCESS:message:send:mms', result))
30+
.catch(error => console.error('ERROR:message:send:mms', error));

examples/message-send-sms.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
var { Message } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const message = new Message(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const message = new Message();
9+
10+
const mobileNumber = process.env.MOBILE_NUMBER ? process.env.MOBILE_NUMBER : '+61123456789';
11+
12+
/**
13+
* Message
14+
*/
15+
16+
message.send({
17+
to: mobileNumber,
18+
// to: ['<RECIPIENT_1>', '<RECIPIENT_2>', '<RECIPIENT_3>'],
19+
body: 'Hello from Messaging SDK!',
20+
notifyURL: 'https://enmt3j9tvwrh4v0.m.pipedream.net/'
21+
// type: 'sms',
22+
})
23+
.then(result => console.log('SUCCESS:message:send:', result))
24+
.catch(error => console.error('ERROR:message:send:', error))
25+
26+
// message.sendBulk({
27+
// smsMulti: [
28+
// {
29+
// to: '<RECIPIENT_1>',
30+
// body: 'Hello from Messaging SDK',
31+
// },
32+
// {
33+
// to: '<RECIPIENT_1>',
34+
// body: 'Yes it works',
35+
// },
36+
// {
37+
// to: '<RECIPIENT_2>',
38+
// body: 'Hello from Messaging SDK',
39+
// },
40+
// {
41+
// to: '<RECIPIENT_3>',
42+
// body: 'Hello from Messaging SDK',
43+
// }
44+
// ],
45+
// notifyURL: 'https://<WEBHOOK_ENDPOINT>/'
46+
// })
47+
// .then(result => console.log('SUCCESS:message:sendBulk:', result))
48+
// .catch(error => console.error('ERROR:message:sendBulk:', error))

examples/message-send.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Message } from '../dist/index.js'
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const message = new Message(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const message = new Message();
9+
10+
message.send({
11+
to: '+61123456789',
12+
body: 'Hello from Messaging SDK!'
13+
})
14+
.then(result => {
15+
console.log(result);
16+
})
17+
.catch(error => {
18+
console.error(error);
19+
});

examples/message-status.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var { Message } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const message = new Message(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const message = new Message();
9+
10+
const messageId = process.env.MESSAGE_ID ? process.env.MESSAGE_ID : 'XXXXX';
11+
12+
message.status(messageId)
13+
.then(result => console.log('SUCCESS:message:status:', result))
14+
.catch(error => console.error('ERROR:message:status:', error))

examples/numbers-create.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var { Numbers } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const number = new Numbers(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const number = new Numbers();
9+
10+
/**
11+
* Numbers (Subscription)
12+
*/
13+
14+
number.create({
15+
// activeDays: 1,
16+
// notifyURL: 'https://enmt3j9tvwrh4v0.m.pipedream.net/',
17+
})
18+
.then(result => console.log('SUCCESS:number:create:', result))
19+
.catch(error => console.error('ERROR:number:create:', error))

examples/numbers-delete.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var { Numbers } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const number = new Numbers(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const number = new Numbers();
9+
10+
/**
11+
* Numbers (Subscription)
12+
*/
13+
14+
number.delete({
15+
emptyArr: 0
16+
})
17+
.then(result => console.log('SUCCESS:number:delete:', result))
18+
.catch(error => console.error('ERROR:number:delete:', error))

examples/numbers-retrieve.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var { Numbers } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const number = new Numbers(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const number = new Numbers();
9+
10+
/**
11+
* Numbers (Subscription)
12+
*/
13+
14+
number.get()
15+
.then(result => console.log('SUCCESS:number:get:', result))
16+
.catch(error => console.error('ERROR:number:get:', error))

examples/trial-numbers-register.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var { TrialNumbers } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const trialNumber = new TrialNumbers(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const trialNumber = new TrialNumbers();
9+
10+
/**
11+
* Trial Numbers
12+
*/
13+
14+
trialNumber.register()
15+
.then(result => console.log('SUCCESS:trialNumber:register:', result))
16+
.catch(error => console.error('ERROR:trialNumber:register:', error))

examples/trial-numbers-retrieve.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var { TrialNumbers } = require('../dist/index.js');
2+
3+
// Auth using JSON file import
4+
// var AUTH_CONFIG = require('./credentials.json');
5+
// const trialNumber = new TrialNumbers(AUTH_CONFIG);
6+
7+
// Auth via ENV VARS or SHARED CREDENTIALS
8+
const trialNumber = new TrialNumbers();
9+
10+
/**
11+
* Trial Numbers
12+
*/
13+
14+
trialNumber.get()
15+
.then(result => console.log('SUCCESS:trialNumber:get:', result))
16+
.catch(error => console.error('ERROR:trialNumber:get:', error))

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.3.20",
2+
"version": "0.3.21",
33
"license": "Apache-2.0",
44
"main": "dist/index.js",
55
"typings": "dist/index.d.ts",

0 commit comments

Comments
 (0)