From 3a84a6bcbedd3dcf7671077ad9ac51e89993bd5b Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Mon, 9 Sep 2019 14:29:18 +0530 Subject: [PATCH 01/24] Add logic to handle all params in one object --- lib/resources/messages.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/resources/messages.js b/lib/resources/messages.js index 1b9665e..51e4f82 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -51,8 +51,8 @@ export class MessageInterface extends PlivoResourceInterface { * @promise {object} return {@link PlivoGenericMessage} object if success * @fail {Error} return Error */ - send(src, dst, text, optionalParams) { - return this.create(src, dst, text, optionalParams); + send(optionalParams) { + return this.create(optionalParams); } /** @@ -69,7 +69,13 @@ export class MessageInterface extends PlivoResourceInterface { * @promise {object} return {@link PlivoGenericMessage} object if success * @fail {Error} return Error */ - create(src, dst, text, optionalParams, powerpackUUID) { + create(optionalParams) { + + var src = optionalParams.src; + var dst = optionalParams.dst; + var text = optionalParams.text; + var powerpackUUID = optionalParams.powerpackUUID; + let errors = validate([ { field: 'dst', value: dst, validators: ['isRequired'] }, { field: 'text', value: text, validators: ['isRequired'] }, From f6fa9016bf207b68e29b617963c207538099fb07 Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Mon, 9 Sep 2019 14:51:56 +0530 Subject: [PATCH 02/24] Add logic to handle all params in one object --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7573d86..2b79d08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [4.1.4](https://github.com/plivo/plivo-node/releases/tag/v4.1.3)(2019-11-09) +- Add logic to handle all params in one object + + ## [4.1.3](https://github.com/plivo/plivo-node/releases/tag/v4.1.3)(2019-07-30) - Add proxy-support for Signature Validation - Add HTTP status codes in responses From ff242675b8f003a588d8ec57c447a0ddb2713eed Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Mon, 9 Sep 2019 16:50:50 +0530 Subject: [PATCH 03/24] Add logic to handle all params in one object --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b79d08..6559e48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [4.1.4](https://github.com/plivo/plivo-node/releases/tag/v4.1.3)(2019-11-09) +## [4.1.4](https://github.com/plivo/plivo-node/releases/tag/v4.1.4)(2019-11-09) - Add logic to handle all params in one object From e6ee2a862583ae413842b5994a85f561826c657a Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Fri, 13 Sep 2019 17:51:34 +0530 Subject: [PATCH 04/24] Add logic to handle params in one object + support for current version --- lib/resources/messages.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/resources/messages.js b/lib/resources/messages.js index 51e4f82..220c094 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -69,12 +69,16 @@ export class MessageInterface extends PlivoResourceInterface { * @promise {object} return {@link PlivoGenericMessage} object if success * @fail {Error} return Error */ - create(optionalParams) { + create(src, dst, text, powerpackUUID, optionalParams) { - var src = optionalParams.src; - var dst = optionalParams.dst; - var text = optionalParams.text; - var powerpackUUID = optionalParams.powerpackUUID; + var onearray = arguments.length; + + if(onearray == 1){ + var powerpackUUID = src.powerpackUUID; + var text = src.text; + var dst = src.dst; + var src = src.src; + } let errors = validate([ { field: 'dst', value: dst, validators: ['isRequired'] }, From 884b606be2d432b878bf7ec40b36e0c8b9d0cd58 Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Fri, 13 Sep 2019 17:55:05 +0530 Subject: [PATCH 05/24] Revert "Add logic to handle params in one object + support for current version" This reverts commit e6ee2a862583ae413842b5994a85f561826c657a. --- lib/resources/messages.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/resources/messages.js b/lib/resources/messages.js index 220c094..51e4f82 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -69,16 +69,12 @@ export class MessageInterface extends PlivoResourceInterface { * @promise {object} return {@link PlivoGenericMessage} object if success * @fail {Error} return Error */ - create(src, dst, text, powerpackUUID, optionalParams) { + create(optionalParams) { - var onearray = arguments.length; - - if(onearray == 1){ - var powerpackUUID = src.powerpackUUID; - var text = src.text; - var dst = src.dst; - var src = src.src; - } + var src = optionalParams.src; + var dst = optionalParams.dst; + var text = optionalParams.text; + var powerpackUUID = optionalParams.powerpackUUID; let errors = validate([ { field: 'dst', value: dst, validators: ['isRequired'] }, From 644d4d3db6a5ff7c9f52176d9e9f599ae5157dcc Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Fri, 13 Sep 2019 18:10:46 +0530 Subject: [PATCH 06/24] Add logic to handle params in one object + support for current version --- lib/resources/messages.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/resources/messages.js b/lib/resources/messages.js index 51e4f82..f8533f5 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -69,12 +69,16 @@ export class MessageInterface extends PlivoResourceInterface { * @promise {object} return {@link PlivoGenericMessage} object if success * @fail {Error} return Error */ - create(optionalParams) { + create(src, dst, text, optionalParams, powerpackUUID) { - var src = optionalParams.src; - var dst = optionalParams.dst; - var text = optionalParams.text; - var powerpackUUID = optionalParams.powerpackUUID; + var oneArray = arguments.length; + + if(oneArray == 1){ + var powerpackUUID = src.powerpackUUID; + var text = src.text; + var dst = src.dst; + var src = src.src; + } let errors = validate([ { field: 'dst', value: dst, validators: ['isRequired'] }, From 2823965e1be7f2ae8c6ee1cfd1b13901c05ea201 Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Fri, 13 Sep 2019 19:03:08 +0530 Subject: [PATCH 07/24] Fix test cases with new changes --- test/messages.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/messages.js b/test/messages.js index 121f38d..6d90d67 100644 --- a/test/messages.js +++ b/test/messages.js @@ -28,7 +28,7 @@ describe('message', function () { }); it('should send message via interface', function () { - return client.messages.send('src', 'dst', 'text') + return client.messages.send('src', 'dst', 'text',{}, null) .then(function(message){ assert.equal(message.message, 'message(s) queued') }) @@ -43,14 +43,14 @@ describe('message', function () { }); it('should throw error - src and powerpack both not present', function () { - return client.messages.send(null, 'dst', 'text', {}, null) + return client.messages.send({src:null,dst:'dst',text:'text',powerpackUUID:null}) .catch(function(err){ assert.equal(err.message, 'Neither of src or powerpack uuid present, either one is required') }) }); it('should throw error - src and powerpack both are present', function () { - return client.messages.send('91235456917375', 'dst', 'text', {}, '916386027476') + return client.messages.send({src:'91235456917375', dst:'dst', text:'text', powerpackUUID:'916386027476'}) .catch(function(err){ assert.equal(err.message, 'Either of src or powerpack uuid, both of them are present') }) From 1d9a9fd71b3f41540d6467d304ca295c8353db76 Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Fri, 13 Sep 2019 19:14:39 +0530 Subject: [PATCH 08/24] Fix test cases with new changes --- test/messages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/messages.js b/test/messages.js index 6d90d67..0877522 100644 --- a/test/messages.js +++ b/test/messages.js @@ -28,7 +28,7 @@ describe('message', function () { }); it('should send message via interface', function () { - return client.messages.send('src', 'dst', 'text',{}, null) + return client.messages.send({src:'src', dst:'dst', text:'text',powerpackUUID: null}) .then(function(message){ assert.equal(message.message, 'message(s) queued') }) From 4f4d8bb59e93acfd62a11aa835f2acca16d41d11 Mon Sep 17 00:00:00 2001 From: digvijay-plivo Date: Fri, 13 Sep 2019 19:39:21 +0530 Subject: [PATCH 09/24] Fix test cases with new changes --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6559e48..5541807 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [4.1.4](https://github.com/plivo/plivo-node/releases/tag/v4.1.4)(2019-11-09) - Add logic to handle all params in one object +- Add compatibility for previous version +- Fixed test case ## [4.1.3](https://github.com/plivo/plivo-node/releases/tag/v4.1.3)(2019-07-30) From ccad9aff8b32ac06527eeb9796699d59446a34b2 Mon Sep 17 00:00:00 2001 From: huzaif Date: Mon, 21 Dec 2020 12:01:56 +0530 Subject: [PATCH 10/24] Fix Message interface --- lib/resources/messages.js | 265 +++++++++++++++++++++++--------------- 1 file changed, 164 insertions(+), 101 deletions(-) diff --git a/lib/resources/messages.js b/lib/resources/messages.js index f8533f5..2a76e9b 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -1,8 +1,15 @@ - -import { extend, validate } from '../utils/common.js'; -import { PlivoResource, PlivoResourceInterface } from '../base'; import * as _ from "lodash"; +import { + PlivoResource, + PlivoResourceInterface +} from '../base'; +import { + extend, + validate +} from '../utils/common.js'; + +const clientKey = Symbol(); const action = 'Message/'; const idField = 'messageUuid'; @@ -13,15 +20,20 @@ const idField = 'messageUuid'; * @param {object} [data] - data of call */ export class Message extends PlivoResource { - constructor(client, data = {}) { - super(action, Message, idField, client); + constructor(client, data = {}) { + super(action, Message, idField, client); - if (idField in data) { - this.id = data[idField]; + if (idField in data) { + this.id = data[idField]; + }; + + extend(this, data); + } + + listMedia() { + return super.executeAction(this.id + '/Media/', 'Get', {}); } - extend(this, data); - } } /** * Represents a Message Interface @@ -32,105 +44,156 @@ export class Message extends PlivoResource { export class MessageInterface extends PlivoResourceInterface { - constructor(client, data = {}) { - super(action, Message, idField, client); - extend(this, data); - } - - /** - * Send Message - * @method - * @param {string} src - source number - * @param {string} dst - destination number - * @param {string} text - text to send - * @param {object} optionalParams - Optional Params to send message - * @param {string} [optionalParams.type] - The type of message. Should be `sms` for a text message. Defaults to `sms`. - * @param {string} [optionalParams.url] The URL to which with the status of the message is sent. - * @param {string} [optionalParams.method] The method used to call the url. Defaults to POST. - * @param {boolean} [optionalParams.log] If set to false, the content of this message will not be logged on the Plivo infrastructure and the dst value will be masked (e.g., 141XXXXX528). Default is set to true. - * @promise {object} return {@link PlivoGenericMessage} object if success - * @fail {Error} return Error - */ - send(optionalParams) { - return this.create(optionalParams); - } - - /** - * Send Message - * @method - * @param {string} src - source number - * @param {string} dst - destination number - * @param {string} text - text to send - * @param {object} optionalParams - Optional Params to send message - * @param {string} [optionalParams.type] - The type of message. Should be `sms` for a text message. Defaults to `sms`. - * @param {string} [optionalParams.url] The URL to which with the status of the message is sent. - * @param {string} [optionalParams.method] The method used to call the url. Defaults to POST. - * @param {boolean} [optionalParams.log] If set to false, the content of this message will not be logged on the Plivo infrastructure and the dst value will be masked (e.g., 141XXXXX528). Default is set to true. - * @promise {object} return {@link PlivoGenericMessage} object if success - * @fail {Error} return Error - */ - create(src, dst, text, optionalParams, powerpackUUID) { - - var oneArray = arguments.length; - - if(oneArray == 1){ - var powerpackUUID = src.powerpackUUID; - var text = src.text; - var dst = src.dst; - var src = src.src; - } - - let errors = validate([ - { field: 'dst', value: dst, validators: ['isRequired'] }, - { field: 'text', value: text, validators: ['isRequired'] }, - ]); - - if (errors) { - return errors; + constructor(client, data = {}) { + super(action, Message, idField, client); + extend(this, data); + this[clientKey] = client; } - if (!src && !powerpackUUID) { - let errorText = 'Neither of src or powerpack uuid present, either one is required' - return new Promise(function (resolve, reject) { - reject(new Error(errorText)); - }); + /** + * Send Message + * @method + * @param {string} src - source number + * @param {string} dst - destination number + * @param {string} text - text to send + * @param {object} optionalParams - Optional Params to send message + * @param {string} [optionalParams.type] - The type of message. Should be `sms` or `mms`. Defaults to `sms`. + * @param {string} [optionalParams.url] The URL to which with the status of the message is sent. + * @param {string} [optionalParams.method] The method used to call the url. Defaults to POST. + * @param {list} [optionalParams.media_urls] For sending mms, specify the media urls in list of string + * @param {boolean} [optionalParams.log] If set to false, the content of this message will not be logged on the Plivo infrastructure and the dst value will be masked (e.g., 141XXXXX528). Default is set to true. + * @promise {object} return {@link PlivoGenericMessage} object if success + * @fail {Error} return Error + */ + send(optionalParams) { + return this.create(optionalParams); } - if (src && powerpackUUID) { - let errorText = 'Either of src or powerpack uuid, both of them are present' - return new Promise(function (resolve, reject) { - reject(new Error(errorText)); - }) + /** + * Send Message + * @method + * @param {string} src - source number + * @param {string} dst - destination number + * @param {string} text - text to send + * @param {object} optionalParams - Optional Params to send message + * @param {string} [optionalParams.type] - The type of message. Should be `sms` or `mms`. Defaults to `sms`. + * @param {string} [optionalParams.url] The URL to which with the status of the message is sent. + * @param {string} [optionalParams.method] The method used to call the url. Defaults to POST. + * @param {boolean} [optionalParams.log] If set to false, the content of this message will not be logged on the Plivo infrastructure and the dst value will be masked (e.g., 141XXXXX528). Default is set to true. + * @param {Array} [optionalParams.media_urls] For sending mms, specify the media urls in list of string + * @promise {object} return {@link PlivoGenericMessage} object if success + * @fail {Error} return Error + */ + create(src, dst, text, optionalParams, powerpackUUID) { + var isObject = arguments.length; + if (isObject == 1) { + var powerpackUUID = src.powerpackUUID; + var text = src.text; + var dst = src.dst; + var url = src.url; + var method = src.method; + var type = src.type; + var media_urls = src.media_urls; + var media_ids = src.media_ids; + var media_ids = src.media_ids; + var log = src.log; + var trackable = src.trackable; + var src = src.src; + } + + let errors = validate([{ + field: 'dst', + value: dst, + validators: ['isRequired'] + }, + { + field: 'text', + value: text, + validators: ['isRequired'] + }, + ]); + + if (errors) { + return errors; + } + + if (!src && !powerpackUUID) { + let errorText = 'Neither of src or powerpack uuid present, either one is required' + return new Promise(function(resolve, reject) { + reject(new Error(errorText)); + }); + } + + if (src && powerpackUUID) { + let errorText = 'Either of src or powerpack uuid, both of them are present' + return new Promise(function(resolve, reject) { + reject(new Error(errorText)); + }) + } + + let params = optionalParams || {}; + + if (isObject == 1) { + if (url) { + params.url = url; + } + + if (method) { + params.method = method; + } + if (type) { + params.type = type; + } + if (media_urls) { + params.media_urls = media_urls; + } + if (media_ids) { + params.media_ids = media_ids; + } + if (log) { + params.log = log; + } + if (trackable) { + params.trackable = trackable; + } + } + + if (src) { + params.src = src; + } + params.dst = _.isArray(dst) ? _.join(dst, '<') : dst; + params.text = text; + if (powerpackUUID) { + params.powerpackUUID = powerpackUUID; + } + return super.create(params); } - let params = optionalParams || {}; - if (src) { - params.src = src; - } - params.dst = _.isArray(dst) ? _.join(dst, '<') : dst; - params.text = text; - if (powerpackUUID) { - params.powerpackUUID = powerpackUUID; - } - return super.create(params); - } + /** + * Get Message by given id + * @method + * @param {string} id - id of message + * @promise {object} return {@link Message} object if success + * @fail {Error} return Error + */ + get(id) { + let errors = validate([{ + field: 'id', + value: id, + validators: ['isRequired'] + }]); - /** - * Get Message by given id - * @method - * @param {string} id - id of message - * @promise {object} return {@link Message} object if success - * @fail {Error} return Error - */ - get(id) { - let errors = validate([ - { field: 'id', value: id, validators: ['isRequired'] } - ]); + if (errors) { + return errors; + } - if (errors) { - return errors; + return super.get(id); } - return super.get(id); - } -} + listMedia(messageUUID) { + return new Message(this[clientKey], { + id: messageUUID + }).listMedia(); + } + +} \ No newline at end of file From 68ec2055fc1eb49addc68edadd9e3716e2b6d109 Mon Sep 17 00:00:00 2001 From: huzaif Date: Sun, 25 Apr 2021 22:54:56 +0530 Subject: [PATCH 11/24] removed duplicate occurance of parameter within SMS --- lib/resources/messages.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/resources/messages.js b/lib/resources/messages.js index 98b91cc..92242e8 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -95,7 +95,6 @@ export class MessageInterface extends PlivoResourceInterface { var type = src.type; var media_urls = src.media_urls; var media_ids = src.media_ids; - var media_ids = src.media_ids; var log = src.log; var trackable = src.trackable; var src = src.src; @@ -137,7 +136,6 @@ export class MessageInterface extends PlivoResourceInterface { if (url) { params.url = url; } - if (method) { params.method = method; } From e70d7639e6a1b0b14157486a4bb41ba9f618f61b Mon Sep 17 00:00:00 2001 From: huzaif Date: Mon, 26 Apr 2021 11:36:09 +0530 Subject: [PATCH 12/24] remove blank space --- lib/resources/messages.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/resources/messages.js b/lib/resources/messages.js index b0225fe..ab5bc93 100644 --- a/lib/resources/messages.js +++ b/lib/resources/messages.js @@ -123,15 +123,14 @@ export class Message extends PlivoResource { } } + /** * Represents a Message Interface * @constructor * @param {function} client - make api call * @param {object} [data] - data of call */ - export class MessageInterface extends PlivoResourceInterface { - constructor(client, data = {}) { super(action, Message, idField, client); extend(this, data); @@ -139,7 +138,6 @@ export class MessageInterface extends PlivoResourceInterface { this[actionKey] = action; this[klassKey] = Message; this[idKey] = idField; - } /** From 4e9279554cf364db8a848d28c51cc0aa4f13bb37 Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Thu, 27 May 2021 17:31:33 +0530 Subject: [PATCH 13/24] Bump version 4.17.0 --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c82c33..b129861 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [4.17.0](https://github.com/plivo/plivo-node/releases/tag/v4.17.0)(2021-05-28) +- New Send Message interface along with existing interface support. + ## [4.16.0](https://github.com/plivo/plivo-node/releases/tag/v4.16.0)(2021-04-19) - Added SDK support for Voice MultiPartyCall APIs and XML diff --git a/package.json b/package.json index 7df55cd..edcfd38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.16.0", + "version": "4.17.0", "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [ From adcc37835f8fc927c2a3e3c09030ce96ffe1ef57 Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Thu, 27 May 2021 17:32:55 +0530 Subject: [PATCH 14/24] Bump version 4.18.0 --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b129861..96371d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [4.17.0](https://github.com/plivo/plivo-node/releases/tag/v4.17.0)(2021-05-28) +## [4.18.0](https://github.com/plivo/plivo-node/releases/tag/v4.17.0)(2021-05-28) - New Send Message interface along with existing interface support. ## [4.16.0](https://github.com/plivo/plivo-node/releases/tag/v4.16.0)(2021-04-19) diff --git a/package.json b/package.json index edcfd38..82137e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.17.0", + "version": "4.18.0", "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [ From ad64d6c25fc986ea098446dd02d73077db98fa5d Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Thu, 27 May 2021 21:58:10 +0530 Subject: [PATCH 15/24] update: changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67fac81..7386495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [4.18.0](https://github.com/plivo/plivo-node/releases/tag/v4.17.0)(2021-05-28) +## [4.18.0](https://github.com/plivo/plivo-node/releases/tag/v4.18.0)(2021-05-28) - New Send Message interface along with existing interface support. ## [4.17.1](https://github.com/plivo/plivo-node/releases/tag/v4.17.1)(2021-05-06) From 852add0dd5d1702ca002d3c0dffe535b6402f84f Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Tue, 20 Jul 2021 11:31:57 +0530 Subject: [PATCH 16/24] bump version 4.21.0 --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19c5b5d..4ef6033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [v4.21.0](https://github.com/plivo/plivo-node/tree/v4.21.0) (2021-07-20) +- This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. + ## [v4.20.0](https://github.com/plivo/plivo-node/tree/v4.20.0) (2021-07-13) - Power pack ID has been included to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message). - Support for filtering messages by Power pack ID has been added to the [list all messages API](https://www.plivo.com/docs/sms/api/message#list-all-messages). diff --git a/package.json b/package.json index d429fd9..a471bda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.20.0", + "version": "4.21.0", "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [ From cec2936edf1beb0a0d28be62cead64472937fda0 Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Wed, 25 Aug 2021 12:19:53 +0530 Subject: [PATCH 17/24] version bump --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf298a9..360c09b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-08-25) +- This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. + ## [v4.22.0](https://github.com/plivo/plivo-node/tree/v4.22.0) (2021-08-17) - Fix [add numbers to a powerpack](https://www.plivo.com/docs/sms/api/numberpool/#add-a-number) API by reverting retrievable object responses support for [Retrieve a Power pack API](https://www.plivo.com/docs/sms/api/powerpack#retrieve-a-powerpack). diff --git a/package.json b/package.json index e76ea7e..b01082e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.22.0", + "version": "4.23.0", "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [ From 73d761fd7cea1e9ab55c90ca63602d7e8608c619 Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Wed, 15 Sep 2021 15:12:26 +0530 Subject: [PATCH 18/24] updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 728f3b0..02fc344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-08-25) +## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-09-15) - This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. ## [v4.22.1](https://github.com/plivo/plivo-node/tree/v4.22.1) (2021-09-08) From 3827b1d28e5205d81cc0d9417228e210f65b475b Mon Sep 17 00:00:00 2001 From: Mohammed Huzaif Date: Wed, 15 Sep 2021 17:44:10 +0530 Subject: [PATCH 19/24] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02fc344..27f980f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-09-15) +## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-09-16) - This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. ## [v4.22.1](https://github.com/plivo/plivo-node/tree/v4.22.1) (2021-09-08) From 110a255e8818d5829c81332d7eb003c6541d3788 Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Wed, 15 Sep 2021 18:05:15 +0530 Subject: [PATCH 20/24] updated README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2c454a1..5574ae6 100644 --- a/README.md +++ b/README.md @@ -55,12 +55,12 @@ Also, using `client.resources.list()` would list the first 20 resources by defau let plivo = require('plivo'); let client = new plivo.Client(); -client.messages.create( - '+14156667778', - '+14156667777', - 'Hello, world!' -).then(function(response) { - console.log(response) +client.messages.create({ + src: '+14156667778', + dst: '14156667777', + text: 'Hello, this is a sample text from Plivo', +}).then(function(response) { + console.log(response) }); ``` From 5982d9db837027ab6e122efb6eb02c149abb8bcf Mon Sep 17 00:00:00 2001 From: huzaif-plivo Date: Tue, 21 Sep 2021 22:41:28 +0530 Subject: [PATCH 21/24] updated changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27f980f..470d58d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ # Change Log -## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-09-16) +## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-09-22) - This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. + Example for [send SMS](Example for [send SMS](https://github.com/plivo/plivo-node#send-a-message) + ## [v4.22.1](https://github.com/plivo/plivo-node/tree/v4.22.1) (2021-09-08) - Fix on voice `GET` request and exception handle. From ef422c291d48ba15b2b0a69e3fdb3b36291d7532 Mon Sep 17 00:00:00 2001 From: Mohammed Huzaif Date: Tue, 21 Sep 2021 22:52:22 +0530 Subject: [PATCH 22/24] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d75afd..7eb4b27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-09-22) - This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. - Example for [send SMS](Example for [send SMS](https://github.com/plivo/plivo-node#send-a-message) + Example for [send SMS](https://github.com/plivo/plivo-node#send-a-message) ## [v4.22.2](https://github.com/plivo/plivo-node/tree/v4.22.2) (2021-09-16) - Typescript import fix. From 5f7f4c2f4235144dc265a468f4df0bcafd491b67 Mon Sep 17 00:00:00 2001 From: Mohammed Huzaif Date: Tue, 21 Sep 2021 22:59:01 +0530 Subject: [PATCH 23/24] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eb4b27..e701164 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-09-22) +**Features - Messaging** - This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. Example for [send SMS](https://github.com/plivo/plivo-node#send-a-message) From 0dba72a4a6eee77fb7bc16f944739f884ed4500e Mon Sep 17 00:00:00 2001 From: Mohammed Huzaif Date: Mon, 11 Oct 2021 16:48:47 +0530 Subject: [PATCH 24/24] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ca8bd9..11b4683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-09-22) +## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-10-11) **Features - Messaging** - This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface.