From 3d3d475add96799b9115a79866595eedbcb01bda Mon Sep 17 00:00:00 2001 From: Kyle Aranas <43162236+kebaranas@users.noreply.github.com> Date: Fri, 30 Aug 2019 01:51:54 +0800 Subject: [PATCH 1/6] Updated node-libcurl to the latest version Fixed some of misspellings and variable or constant mismatch. --- globeconnect/index.js | 2 +- globeconnect/lib/amax.js | 18 +- globeconnect/lib/location.js | 12 +- globeconnect/lib/oauth.js | 12 +- globeconnect/lib/payment.js | 28 +- globeconnect/lib/sms.js | 16 +- globeconnect/lib/ussd.js | 14 +- globeconnect/lib/voice.js | 152 +++--- globeconnect/package-lock.json | 893 +++++++++++++++++++++++++++++++++ globeconnect/package.json | 8 +- 10 files changed, 1027 insertions(+), 128 deletions(-) create mode 100644 globeconnect/package-lock.json diff --git a/globeconnect/index.js b/globeconnect/index.js index e231255..9a42b0b 100644 --- a/globeconnect/index.js +++ b/globeconnect/index.js @@ -7,4 +7,4 @@ module.exports = { Subscriber : require('./lib/subscriber.js'), Ussd : require('./lib/ussd.js'), Voice : require('./lib/voice.js') -} +}; diff --git a/globeconnect/lib/amax.js b/globeconnect/lib/amax.js index a5d140d..5b91ace 100644 --- a/globeconnect/lib/amax.js +++ b/globeconnect/lib/amax.js @@ -38,7 +38,7 @@ var Amax = function(key, secret) { // store token to this this.token = token; return this; - } + }; /* * promo setter @@ -50,7 +50,7 @@ var Amax = function(key, secret) { // store promo to this this.promo = promo; return this; - } + }; /* * send reward @@ -69,7 +69,7 @@ var Amax = function(key, secret) { "app_secret" : this.secret, "rewards_token" : this.token, "address" : this.address, - "promo" : this.promo } } + "promo" : this.promo } }; // initialize curl var curl = new Curl(); @@ -78,9 +78,9 @@ var Amax = function(key, secret) { // set request as post curl.setOpt(Curl.option.POST, true); // set json header request - curl.setOpt(Curl.option.HTTPHEADER, ['Content-type: application/json']) + curl.setOpt(Curl.option.HTTPHEADER, ['Content-type: application/json']); // set request payload - curl.setOpt(Curl.option.POSTFIELDS, JSON.stringify(payload)) + curl.setOpt(Curl.option.POSTFIELDS, JSON.stringify(payload)); // perform curl curl.perform(); @@ -91,14 +91,14 @@ var Amax = function(key, secret) { // call callback function callback(resCode, body); }); - } + }; // return Amax Object return this; -} +}; // module export module.exports = function(key, secret) { // return Amax Object - return new Amax(key, secret) -} + return new Amax(key, secret); +}; diff --git a/globeconnect/lib/location.js b/globeconnect/lib/location.js index 77ca75c..72e0bf6 100644 --- a/globeconnect/lib/location.js +++ b/globeconnect/lib/location.js @@ -1,6 +1,6 @@ var Curl = require('node-libcurl').Curl; -var LOC_URL = 'https://devapi.globelabs.com.ph/location/v1/queries/location?access_token=[token]&address=[address]&requestedAccuracy=[acc]' +var LOC_URL = 'https://devapi.globelabs.com.ph/location/v1/queries/location?access_token=[token]&address=[address]&requestedAccuracy=[acc]'; var Location = function(token) { this.token = token; @@ -12,15 +12,15 @@ var Location = function(token) { return this; }; - this.setRequestedAccuracy = function(acc) { - this.acc = acc; + this.setRequestedAccuracy = function(accuracy) { + this.acc = accuracy; return this; }; this.getLocation = function(callback) { url = LOC_URL.replace('[token]', this.token) .replace('[address]', this.address) - .replace('[acc]', this.acc) + .replace('[acc]', this.acc); var curl = new Curl(); curl.setOpt(Curl.option.URL, url); @@ -33,8 +33,8 @@ var Location = function(token) { }; return this; -} +}; module.exports = function(token) { return new Location(token); -} +}; diff --git a/globeconnect/lib/oauth.js b/globeconnect/lib/oauth.js index 45cfd7b..d69619c 100644 --- a/globeconnect/lib/oauth.js +++ b/globeconnect/lib/oauth.js @@ -11,7 +11,7 @@ var Oauth = function(key, secret) { this.key = key; // store secret to this this.secret = secret; - // intialize variables + // initialize variables this.code = null; /* @@ -20,7 +20,7 @@ var Oauth = function(key, secret) { * @return string url auth url */ this.getRedirectUrl = function() { - // reutrn url + // return url return SUBS_URL.replace('[key]', this.key); }; @@ -42,7 +42,7 @@ var Oauth = function(key, secret) { curl.setOpt(Curl.option.URL, url); // set request as post curl.setOpt(Curl.option.POST, true); - // dont verify ssl certificate + // don't verify ssl certificate curl.setOpt(Curl.option.SSL_VERIFYPEER, false); curl.setOpt(Curl.option.SSL_VERIFYHOST, false); // perform curl @@ -56,14 +56,14 @@ var Oauth = function(key, secret) { callback(resCode, body); }); - } + }; // return Oauth Object return this; -} +}; // module export module.exports = function(key, secret) { // return Oauth Object return new Oauth(key, secret); -} +}; diff --git a/globeconnect/lib/payment.js b/globeconnect/lib/payment.js index aa91c91..a435554 100644 --- a/globeconnect/lib/payment.js +++ b/globeconnect/lib/payment.js @@ -30,7 +30,7 @@ var Payment = function(token) { // store address to this this.address = address; return this; - } + }; /* * amount setter @@ -42,7 +42,7 @@ var Payment = function(token) { // store amount to this this.amount = amount; return this; - } + }; /* * description setter @@ -54,7 +54,7 @@ var Payment = function(token) { // store desc to this this.desc = desc; return this; - } + }; /* * reference code setter @@ -66,7 +66,7 @@ var Payment = function(token) { // store refCode to this this.refCode = refCode; return this; - } + }; /* * status setter @@ -78,7 +78,7 @@ var Payment = function(token) { // store status to this this.status = status; return this; - } + }; /* * app key setter @@ -90,7 +90,7 @@ var Payment = function(token) { // store appKey to this this.key = appKey; return this; - } + }; /* * app secret setter @@ -100,9 +100,9 @@ var Payment = function(token) { */ this.setAppSecret = function(secret) { // store secret to this - this.secret; + this.secret = secret; return this; - } + }; /* * get last reference code @@ -129,7 +129,7 @@ var Payment = function(token) { // call callback function callback(resCode, body); }); - } + }; /* * send payment request @@ -151,7 +151,7 @@ var Payment = function(token) { // http_build_query payload = qs.toString(payload); - // intialize curl + // initialize curl var curl = new Curl(); // set request url curl.setOpt(curl.option.URL, url); @@ -168,16 +168,16 @@ var Payment = function(token) { this.close(); // call callback function callback(resCode, body); - }) - } + }); + }; // return Object Payment return this; -} +}; // module exports module.exports = function(token) { // return Payment Object return new Payment(token); -} +}; diff --git a/globeconnect/lib/sms.js b/globeconnect/lib/sms.js index e235a22..3447183 100644 --- a/globeconnect/lib/sms.js +++ b/globeconnect/lib/sms.js @@ -70,7 +70,7 @@ var Sms = function(sender, token) { /* * encoding setter * - * @param string endcoding data encoding scheme + * @param string encoding data encoding scheme * @return object this */ this.setDataEncodingScheme = function(encoding) { @@ -104,9 +104,9 @@ var Sms = function(sender, token) { // set request as post curl.setOpt(Curl.option.POST, true); // set json request header - curl.setOpt(Curl.option.HTTPHEADER, ['Content-type: application/json']) + curl.setOpt(Curl.option.HTTPHEADER, ['Content-type: application/json']); // set payload - curl.setOpt(Curl.option.POSTFIELDS, JSON.stringify(payload)) + curl.setOpt(Curl.option.POSTFIELDS, JSON.stringify(payload)); // perform curl curl.perform(); @@ -149,9 +149,9 @@ var Sms = function(sender, token) { // set request as post curl.setOpt(Curl.option.POST, true); // set json request header - curl.setOpt(Curl.option.HTTPHEADER, ['Content-type: application/json']) + curl.setOpt(Curl.option.HTTPHEADER, ['Content-type: application/json']); // set request payload - curl.setOpt(Curl.option.POSTFIELDS, JSON.stringify(payload)) + curl.setOpt(Curl.option.POSTFIELDS, JSON.stringify(payload)); // perform curl curl.perform(); @@ -167,10 +167,10 @@ var Sms = function(sender, token) { // return Sms object return this; -} +}; // module export module.exports = function(sender, token) { // export Sms object - return new Sms(sender, token) -} + return new Sms(sender, token); +}; diff --git a/globeconnect/lib/ussd.js b/globeconnect/lib/ussd.js index e10f4b9..b3ef719 100644 --- a/globeconnect/lib/ussd.js +++ b/globeconnect/lib/ussd.js @@ -12,7 +12,7 @@ var Ussd = function(token, shortCode) { // store shortCode to this this.shortCode = shortCode; - // intialize variables + // initialize variables this.address = null; this.flash = false; this.msg = null; @@ -74,7 +74,7 @@ var Ussd = function(token, shortCode) { */ this.sendUssdRequest = function(callback) { // prepare request url - var url = SEND_USSD.replace('[shortcode]', this.shortCode) + var url = SEND_USSD.replace('[shortCode]', this.shortCode) .replace('[token]', this.token); // prepare request payload @@ -84,10 +84,10 @@ var Ussd = function(token, shortCode) { message : this.msg }, address : this.address, - senderAddress : this.shortcode, + senderAddress : this.shortCode, flash : this.flash }}; - // intialize curl + // initialize curl var curl = new Curl(); // set request url curl.setOpt(curl.option.URL, url); @@ -117,7 +117,7 @@ var Ussd = function(token, shortCode) { */ this.replyUssdRequest = function(callback) { // prepare request url - var url = REPLY_USSD.replace('[shortcode]', this.shortCode) + var url = REPLY_USSD.replace('[shortCode]', this.shortCode) .replace('[token]', this.token); // prepare request payload @@ -126,11 +126,11 @@ var Ussd = function(token, shortCode) { outboundUSSDMessage : { message : this.msg}, address : this.address, - senderAddress : this.shortcode, + senderAddress : this.shortCode, sessionID : this.session, flash : this.flash }}; - // intialize curl + // initialize curl var curl = new Curl(); // set request url curl.setOpt(curl.option.URL, url); diff --git a/globeconnect/lib/voice.js b/globeconnect/lib/voice.js index 4fcdf18..39aced8 100644 --- a/globeconnect/lib/voice.js +++ b/globeconnect/lib/voice.js @@ -1,151 +1,157 @@ -var Voice = function() { +var Voice = function () { this.obj = {}; - this.ask = require(__dirname + '/voice/ask.js'); - this.addAsk = function(obj) { + this.ask = require(path.join(__dirname, "/voice/ask.js")); + this.addAsk = function (obj) { addAbstract.call(this, 'ask', obj); return this; - } + }; - this.call = require(__dirname + '/voice/call.js'); - this.addCall = function(obj) { + this.call = require(path.join(__dirname, "/voice/call.js")); + this.addCall = function (obj) { addAbstract.call(this, 'call', obj); return this; - } + }; - this.choices = require(__dirname + '/voice/choices.js'); - this.addChoices = function(obj) { + this.choices = require(path.join(__dirname, "/voice/choices.js")); + this.addChoices = function (obj) { addAbstract.call(this, 'choices', obj); return this; - } + }; - this.conference = require(__dirname + '/voice/conference.js'); - this.addConference = function(obj) { + this.conference = require(path.join(__dirname, "/voice/conference.js")); + this.addConference = function (obj) { addAbstract.call(this, 'conference', obj); return this; - } + }; - this.joinPrompt = require(__dirname + '/voice/joinprompt.js'); - this.addJoinPrompt = function(obj) { + this.joinPrompt = require(path.join(__dirname, "/voice/joinprompt.js")); + this.addJoinPrompt = function (obj) { addAbstract.call(this, 'joinPrompt', obj); return this; - } + }; - this.leavePrompt = require(__dirname + '/voice/leaveprompt.js'); - this.addLeavePrompt = function(obj) { + this.leavePrompt = require(path.join(__dirname, "/voice/leaveprompt.js")); + this.addLeavePrompt = function (obj) { addAbstract.call(this, 'leavePrompt', obj); return this; - } + }; - this.machineDetection = require(__dirname + '/voice/machinedetection.js'); - this.addMachineDetection = function(obj) { + this.machineDetection = require( + path.join(__dirname, "/voice/machinedetection.js") + ); + this.addMachineDetection = function (obj) { addAbstract.call(this, 'machineDetection', obj); return this; - } + }; - this.message = require(__dirname + '/voice/message.js'); - this.addMessage = function(obj) { + this.message = require(path.join(__dirname, "/voice/message.js")); + this.addMessage = function (obj) { addAbstract.call(this, 'message', obj); return this; - } + }; - this.on = require(__dirname + '/voice/on.js'); - this.addOn = function(obj) { + this.on = require(path.join(__dirname, "/voice/on.js")); + this.addOn = function (obj) { addAbstract.call(this, 'on', obj); return this; - } + }; - this.record = require(__dirname + '/voice/record.js'); - this.addRecord = function(obj) { + this.record = require(path.join(__dirname, "/voice/record.js")); + this.addRecord = function (obj) { addAbstract.call(this, 'record', obj); return this; - } + }; - this.redirect = require(__dirname + '/voice/redirect.js'); - this.addRedirect = function(obj) { + this.redirect = require(path.join(__dirname, "/voice/redirect.js")); + this.addRedirect = function (obj) { addAbstract.call(this, 'redirect', obj); return this; - } + }; - this.result = require(__dirname + '/voice/result.js'); - this.addResult = function(obj) { + this.result = require(path.join(__dirname, "/voice/result.js")); + this.addResult = function (obj) { addAbstract.call(this, 'result', obj); return this; - } + }; - this.say = require(__dirname + '/voice/say.js'); - this.addSay = function(obj) { + this.say = require(path.join(__dirname, "/voice/say.js")); + this.addSay = function (obj) { addAbstract.call(this, 'say', obj); return this; - } + }; - this.session = require(__dirname + '/voice/session.js'); - this.addSession = function(obj) { + this.session = require(path.join(__dirname, "/voice/session.js")); + this.addSession = function (obj) { addAbstract.call(this, 'session', obj); return this; - } + }; - this.startRecording = require(__dirname + '/voice/startrecording.js'); - this.addStartRecording = function(obj) { + this.startRecording = require( + path.join(__dirname, "/voice/startrecording.js") + ); + this.addStartRecording = function (obj) { addAbstract.call(this, 'startRecording', obj); return this; - } + }; - this.transcription = require(__dirname + '/voice/tanscription.js'); - this.addTranscription = function(obj) { + this.transcription = require( + path.join(__dirname, "/voice/tanscription.js") + ); + this.addTranscription = function (obj) { addAbstract.call(this, 'transcription', obj); return this; - } + }; - this.transfer = require(__dirname + '/voice/transfer.js'); - this.addTransfer = function(obj) { + this.transfer = require(path.join(__dirname, "/voice/transfer.js")); + this.addTransfer = function (obj) { addAbstract.call(this, 'transfer', obj); return this; - } + }; - this.wait = require(__dirname + '/voice/wait.js'); - this.addWait = function(obj) { + this.wait = require(path.join(__dirname, "/voice/wait.js")); + this.addWait = function (obj) { addAbstract.call(this, 'wait', obj); return this; - } + }; - this.addHangup = function() { + this.addHangup = function () { addAbstract.call(this, 'hangup', {}); - } + }; - this.addReject = function() { + this.addReject = function () { addAbstract.call(this, 'reject', {}); - } + }; - addAbstract = function(key, obj) { - if(typeof obj == 'object' && typeof obj.getObject == 'function') { + addAbstract = function (key, obj) { + if (typeof obj === 'object' && typeof obj.getObject === 'function') { obj = obj.getObject(); } - + addToTropo.call(this, key, obj); - } + }; - initTropo = function() { - if(typeof this.obj.tropo == 'undefined') { + initTropo = function () { + if (typeof this.obj.tropo === 'undefined') { this.obj.tropo = []; } }; - addToTropo = function(key, obj) { + addToTropo = function (key, obj) { initTropo.call(this); var i = this.obj.tropo.length; this.obj.tropo[i] = {}; this.obj.tropo[i][key] = {}; this.obj.tropo[i][key] = obj; - } + }; - this.getObject = function() { + this.getObject = function () { return this.obj; - } - + }; + return this; -} +}; -module.exports = function() { +module.exports = function () { return new Voice(); -} +}; \ No newline at end of file diff --git a/globeconnect/package-lock.json b/globeconnect/package-lock.json new file mode 100644 index 0000000..51c304a --- /dev/null +++ b/globeconnect/package-lock.json @@ -0,0 +1,893 @@ +{ + "name": "globe-connect", + "version": "0.0.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chownr": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", + "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" + }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-minipass": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz", + "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==", + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==" + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "minipass": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.5.0.tgz", + "integrity": "sha512-9FwMVYhn6ERvMR8XFdOavRz4QK/VJV8elU1x50vYexf9lslDcWe/f4HBRxCPd185ekRSjU6CfYyJCECa/CQy7Q==", + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + }, + "needle": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz", + "integrity": "sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg==", + "requires": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-gyp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-4.0.0.tgz", + "integrity": "sha512-2XiryJ8sICNo6ej8d0idXDEMKfVfFK7kekGCtJAuelGsYHQxhj13KTf95swTCN2dZ/4lTfZ84Fu31jqJEEgjWA==", + "requires": { + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3 || 4", + "osenv": "0", + "request": "^2.87.0", + "rimraf": "2", + "semver": "~5.3.0", + "tar": "^4.4.8", + "which": "1" + } + }, + "node-libcurl": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-libcurl/-/node-libcurl-2.0.1.tgz", + "integrity": "sha512-HFEdU130GZVeezJKtvw3eLNBTENVC6EqMZu7gpBAfY9MYNSgtRObEP1E+iPOlBmJesljyWf27XVqcfzXtyMAGw==", + "requires": { + "fs-extra": "7.0.1", + "nan": "2.13.2", + "node-gyp": "4.0.0", + "node-pre-gyp": "0.13.0", + "npmlog": "4.1.2", + "osenv": "0.1.5", + "tslib": "^1.9.3" + } + }, + "node-pre-gyp": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.13.0.tgz", + "integrity": "sha512-Md1D3xnEne8b/HGVQkZZwV27WUi1ZRuZBij24TNaZwUPU3ZAFtvT6xxJGaUVillfmMKnn5oD1HoGsp2Ftik7SQ==", + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + }, + "dependencies": { + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + } + } + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "requires": { + "abbrev": "1" + } + }, + "npm-bundled": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" + }, + "npm-packlist": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.4.tgz", + "integrity": "sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw==", + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "psl": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", + "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "tar": { + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", + "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.5", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } + } + }, + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } + } +} diff --git a/globeconnect/package.json b/globeconnect/package.json index 8e79488..7cde4bc 100644 --- a/globeconnect/package.json +++ b/globeconnect/package.json @@ -15,11 +15,11 @@ "author": "clark galgo ", "license": "ISC", "dependencies": { - "node-libcurl": "1.0.0" + "node-libcurl": "^2.0.1" }, "homepage": "https://github.com/globelabs/globe-connect-nodejs", - "bugs" : { - "url" : "https://github.com/globelabs/globe-connect-nodejs/issues", - "email" : "globelabs@globe.com.ph" + "bugs": { + "url": "https://github.com/globelabs/globe-connect-nodejs/issues", + "email": "globelabs@globe.com.ph" } } From ea71d6a36f32b15d8dcadc7e2271cc0d88cf42d2 Mon Sep 17 00:00:00 2001 From: Kyle Aranas <43162236+kebaranas@users.noreply.github.com> Date: Fri, 30 Aug 2019 02:12:54 +0800 Subject: [PATCH 2/6] Updated node libcurl to the current latest version Fixed some of the misspellings and variable and constant mismatch. --- globeconnect/lib/voice/ask.js | 65 ++++++++++--------- globeconnect/lib/voice/call.js | 47 +++++++------- globeconnect/lib/voice/choices.js | 33 +++++----- globeconnect/lib/voice/conference.js | 43 +++++++------ globeconnect/lib/voice/joinprompt.js | 21 ++++--- globeconnect/lib/voice/leaveprompt.js | 21 ++++--- globeconnect/lib/voice/machinedetection.js | 23 ++++--- globeconnect/lib/voice/message.js | 39 ++++++------ globeconnect/lib/voice/on.js | 42 +++++++------ globeconnect/lib/voice/record.js | 66 ++++++++++---------- globeconnect/lib/voice/redirect.js | 25 ++++---- globeconnect/lib/voice/result.js | 12 ++-- globeconnect/lib/voice/say.js | 44 +++++++------ globeconnect/lib/voice/session.js | 22 +++---- globeconnect/lib/voice/startrecording.js | 39 ++++++------ globeconnect/lib/voice/transcription.js | 23 ++++--- globeconnect/lib/voice/transfer.js | 72 ++++++++++++---------- globeconnect/lib/voice/wait.js | 23 ++++--- 18 files changed, 358 insertions(+), 302 deletions(-) diff --git a/globeconnect/lib/voice/ask.js b/globeconnect/lib/voice/ask.js index 9d63aad..619f144 100644 --- a/globeconnect/lib/voice/ask.js +++ b/globeconnect/lib/voice/ask.js @@ -1,98 +1,103 @@ -var Ask = function(say) { +var Ask = function (say) { var obj = {}; this.say = say; - this.setChoices = function(choices) { + this.setChoices = function (choices) { this.choices = choices; return this; }; - this.setMaxAttempt = function(attempt) { + this.setMaxAttempt = function (attempt) { obj.attempt = attempt; return this; }; - this.setBargein = function(bargein) { - obj.bargein = bargein; + this.setBargain = function (bargain) { + obj.bargain = bargain; return this; - } + }; - this.setMinConfidence = function(confidence) { + this.setMinConfidence = function (confidence) { obj.confidence = confidence; return this; }; - this.setName = function(name) { + this.setName = function (name) { obj.name = name; return this; }; - this.setRecognizer = function(recognizer) { + this.setRecognizer = function (recognizer) { obj.recognizer = recognizer; return this; }; - this.setTimeout = function(timeout) { + this.setTimeout = function (timeout) { obj.timeout = timeout; return this; }; - this.setVoice = function(voice) { + this.setVoice = function (voice) { obj.voice = voice; return this; }; - this.setInterdigitTimeout = function(idTimeout) { - obj.interdigitTimeout = idTimeout; + this.setEnterDigitTimeout = function (idTimeout) { + obj.EnterDigitTimeout = idTimeout; return this; }; - this.setSensitivity = function(sensitivity) { + this.setSensitivity = function (sensitivity) { obj.sensitivity = sensitivity; return this; }; - this.setSpeechCompleteTimeout = function(scTimeout) { + this.setSpeechCompleteTimeout = function (scTimeout) { obj.speechCompleteTimeout = scTimeout; return this; }; - this.setSpeechIncompleteTimeout = function(siTimeout) { + this.setSpeechIncompleteTimeout = function (siTimeout) { obj.speechIncompleteTimeout = siTimeout; return this; }; - this.getObject = function() { - if(typeof this.choices === 'undefined') { + this.getObject = function () { + if (typeof this.choices === 'undefined') { throw new Error('Choices is required.'); } - if(typeof this.say === 'undefined') { + if (typeof this.say === 'undefined') { throw new Error('Say is required.'); } - obj.choices = this.say.event == null ? this.choices : JSON.stringify(this.choices, rmNull); - obj.say = this.say.event == null ? this.say : JSON.stringify(this.say, rmNull); - - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + obj.choices = this.say.event === null ? + this.choices : JSON.stringify(this.choices, rmNull); + obj.say = this.say.event === null ? + this.say : JSON.stringify(this.say, rmNull); + + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } return obj; }; - rmNull = function(key, value) { + rmNull = function (key, value) { if (value === null) { return undefined; } return value; }; - -} -module.exports = function(say) { +}; + +module.exports = function (say) { return new Ask(say); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/call.js b/globeconnect/lib/voice/call.js index 3e58444..d06fe7a 100644 --- a/globeconnect/lib/voice/call.js +++ b/globeconnect/lib/voice/call.js @@ -1,75 +1,78 @@ -var Call = function(to) { +var Call = function (to) { var obj = {}; this.to = to; - this.setName = function(name) { + this.setName = function (name) { obj.name = name; return this; - } + }; - this.setAnswerToMedia = function(ansMedia) { + this.setAnswerToMedia = function (ansMedia) { obj.answerToMedia = ansMedia; return this; }; - this.setChannel = function(channel) { + this.setChannel = function (channel) { obj.channel = channel; return this; }; - this.from = function(from) { - obj.from = from; + this.from = function (from) { + obj.from = from; return this; }; - this.setHeaders = function(headers) { - obj.headers = header; + this.setHeaders = function (headers) { + obj.headers = headers; return this; }; - this.setRecording = function(recodring) { + this.setRecording = function (recording) { obj.recording = recording; return this; }; - this.required = function(required) { + this.required = function (required) { obj.required = required; return this; }; - this.setTimeout = function(timeout) { + this.setTimeout = function (timeout) { obj.timeout = timeout; return this; }; - this.allSignals = function(signal) { + this.allSignals = function (signal) { obj.allowSignals = signal; return this; }; - this.setMachineDetection = function(mDetection) { + this.setMachineDetection = function (mDetection) { obj.machineDetection = mDetection; return this; }; - this.getObject = function() { - if(typeof this.to == 'undefined') { + this.getObject = function () { + if (typeof this.to === 'undefined') { throw new Error('to is required'); } obj.to = this.to; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } return obj; }; - rmNull = function(key, value) { + rmNull = function (key, value) { if (value === null) { return undefined; } @@ -80,6 +83,6 @@ var Call = function(to) { return this; }; -module.exports = function(to) { +module.exports = function (to) { return new Call(to); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/choices.js b/globeconnect/lib/voice/choices.js index 54c27d1..a96ff5e 100644 --- a/globeconnect/lib/voice/choices.js +++ b/globeconnect/lib/voice/choices.js @@ -1,41 +1,44 @@ -var Choices = function(value) { +var Choices = function (value) { var obj = {}; - if(typeof this.value != 'undefined') { + if (typeof this.value !== 'undefined') { this.value = value; } - this.setMode = function(mode) { + this.setMode = function (mode) { obj.mode = mode; return this; }; - this.setTerminator = function(terminator) { + this.setTerminator = function (terminator) { obj.terminator = terminator; return this; }; - this.getObject = function() { - if(typeof this.value == 'undefined') { + this.getObject = function () { + if (typeof this.value === 'undefined') { throw new Error('Choices value is required'); } - - if(typeof this.value != 'undefined') { + + if (typeof this.value !== 'undefined') { obj.value = this.value; } - - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } return obj; - } + }; return this; }; -module.exports = function(value) { +module.exports = function (value) { return new Choices(value); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/conference.js b/globeconnect/lib/voice/conference.js index d52578b..90c63f0 100644 --- a/globeconnect/lib/voice/conference.js +++ b/globeconnect/lib/voice/conference.js @@ -1,67 +1,70 @@ -var Conference = function(id) { +var Conference = function (id) { var obj = {}; this.id = id; - this.mute = function(mute) { + this.mute = function (mute) { obj.mute = mute; return this; }; - this.setName = function(name) { + this.setName = function (name) { this.name = name; return this; }; - this.setPlayTones = function(playTones) { + this.setPlayTones = function (playTones) { obj.playTones = playTones; return this; }; - this.required = function(required) { + this.required = function (required) { obj.required = required; return this; }; - this.setTerminator = function(terminator) { + this.setTerminator = function (terminator) { obj.terminator = terminator; return this; }; - this.allowSignals = function(allowSignals) { + this.allowSignals = function (allowSignals) { obj.allowSignals = allowSignals; return this; }; - this.setInterdigitTimeout = function(idTimeout) { - obj.interdigitTimeout = idTimeout; + this.setEnterDigitTimeout = function (idTimeout) { + obj.EnterDigitTimeout = idTimeout; return this; }; - this.setJoinPrompt = function(jPrompt) { - obj.jPrompt; + this.setJoinPrompt = function (jPrompt) { + obj.jPrompt = jPrompt; return this; }; - this.setLeavePrompt = function(lPrompt) { + this.setLeavePrompt = function (lPrompt) { obj.leavePrompt = lPrompt; return this; }; - this.getObject = function() { - if(typeof this.id == 'undefined') { + this.getObject = function () { + if (typeof this.id === 'undefined') { throw new Error('Conference id is required.'); } - if(typeof this.name == 'undefined') { + if (typeof this.name === 'undefined') { throw new Error('Conference name is required.'); } obj.id = this.id; obj.name = this.name; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } @@ -71,6 +74,6 @@ var Conference = function(id) { return this; }; -module.exports = function(id) { +module.exports = function (id) { return new Conference(id); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/joinprompt.js b/globeconnect/lib/voice/joinprompt.js index 2aa1262..a3d0794 100644 --- a/globeconnect/lib/voice/joinprompt.js +++ b/globeconnect/lib/voice/joinprompt.js @@ -1,22 +1,25 @@ -var JoinPrompt = function(value) { +var JoinPrompt = function (value) { var obj = {}; this.value = value; - this.setVoice = function(voice) { + this.setVoice = function (voice) { obj.voice = voice; return this; }; - this.getObject = function() { - if(typeof this.value == 'undefined') { + this.getObject = function () { + if (typeof this.value === 'undefined') { throw new Error('Join Prompt is required.'); } obj.value = this.value; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } @@ -26,6 +29,6 @@ var JoinPrompt = function(value) { return this; }; -module.exports = function(value) { +module.exports = function (value) { return new JoinPrompt(value); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/leaveprompt.js b/globeconnect/lib/voice/leaveprompt.js index 46b053c..a36ebd0 100644 --- a/globeconnect/lib/voice/leaveprompt.js +++ b/globeconnect/lib/voice/leaveprompt.js @@ -1,21 +1,24 @@ -var LeavePrompt = function(value) { +var LeavePrompt = function (value) { var obj = {}; this.value = value; - this.setVoice = function(voice) { + this.setVoice = function (voice) { obj.voice = voice; return this; }; - this.getObject = function() { - if(typeof this.value == 'undefined') { + this.getObject = function () { + if (typeof this.value === 'undefined') { throw new Error('Leave Prompt is required.'); } obj.value = this.value; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } @@ -25,6 +28,6 @@ var LeavePrompt = function(value) { return this; }; -module.exports = function(value) { +module.exports = function (value) { return new LeavePrompt(value); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/machinedetection.js b/globeconnect/lib/voice/machinedetection.js index f93646a..f6495d8 100644 --- a/globeconnect/lib/voice/machinedetection.js +++ b/globeconnect/lib/voice/machinedetection.js @@ -1,28 +1,31 @@ -var machineDetection = function() { +var machineDetection = function () { var obj = {}; - this.setIntroduction = function(introduction) { + this.setIntroduction = function (introduction) { obj.introduction = introduction; return this; }; - this.setVoice = function(voice) { + this.setVoice = function (voice) { obj.voice = voice; return this; }; - this.getObject = function() { - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + this.getObject = function () { + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } return obj; - } + }; return this; }; -module.exports = function() { +module.exports = function () { return new machineDetection(); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/message.js b/globeconnect/lib/voice/message.js index c6d5e81..16741fb 100644 --- a/globeconnect/lib/voice/message.js +++ b/globeconnect/lib/voice/message.js @@ -1,58 +1,58 @@ -var Message = function(say, to) { +var Message = function (say, to) { var obj = {}; this.say = say; this.to = to; - this.setName = function(name) { + this.setName = function (name) { this.name = name; return this; }; - this.answerOnMedia = function(ansMedia) { + this.answerOnMedia = function (ansMedia) { obj.answerOnMedia = ansMedia; return this; }; - this.setChannel = function(channel) { + this.setChannel = function (channel) { obj.channel = channel; return this; }; - this.from = function(from) { + this.from = function (from) { obj.from = from; return this; }; - this.setNetwork = function(network) { + this.setNetwork = function (network) { obj.network = network; return this; }; - this.required = function(required) { + this.required = function (required) { obj.required = required; return this; }; - this.setTimeout = function(timeout) { + this.setTimeout = function (timeout) { obj.timeout = timeout; return this; }; - this.setVoice = function(voice) { + this.setVoice = function (voice) { obj.voice = voice; return this; }; - this.getObject = function() { - if(typeof this.say == 'undefined') { + this.getObject = function () { + if (typeof this.say === 'undefined') { throw new Error('say is required'); } - if(typeof this.to == 'undefined') { + if (typeof this.to === 'undefined') { throw new Error('to is required'); } - if(typeof this.name == 'undefined') { + if (typeof this.name === 'undefined') { throw new Error('Name is required'); } @@ -60,9 +60,12 @@ var Message = function(say, to) { obj.to = this.to; obj.say = this.say; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } @@ -73,6 +76,6 @@ var Message = function(say, to) { }; -module.exports = function(say, to) { +module.exports = function (say, to) { return new Message(say, to); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/on.js b/globeconnect/lib/voice/on.js index e4b62cf..c6240b4 100644 --- a/globeconnect/lib/voice/on.js +++ b/globeconnect/lib/voice/on.js @@ -1,67 +1,71 @@ -var On = function(e) { +var On = function (e) { var obj = {}; this.event = e; - - this.setSay = function(say) { + + this.setSay = function (say) { this.say = say; return this; }; - this.setName = function(name) { + this.setName = function (name) { this.name = name; return this; }; - this.next = function(next) { + this.next = function (next) { obj.next = next; return this; }; - this.required = function(required) { + this.required = function (required) { obj.required = required; return this; }; - this.ask = function(ask) { + this.ask = function (ask) { obj.ask = ask; return this; }; - this.setMessage = function(message) { + this.setMessage = function (message) { obj.message = message; return this; }; - this.wait = function(wait) { + this.wait = function (wait) { obj.wait = wait; return this; }; - this.getObject = function() { - if(typeof this.event == 'undefined') { + this.getObject = function () { + if (typeof this.event === 'undefined') { throw new Error('Event is required'); } - if(typeof this.say == 'undefined') { + if (typeof this.say === 'undefined') { throw new Error('Say is required'); } obj.event = this.event; obj.name = this.name; - obj.say = typeof this.say == 'object' ? JSON.stringify(this.say) : this.say; + obj.say = typeof this.say === 'object' ? + JSON.stringify(this.say) : this.say; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } return obj; }; - + return this; }; -module.exports = function(e, say) { +module.exports = function (e, say) { return new On(e, say); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/record.js b/globeconnect/lib/voice/record.js index 27a98f3..f6d57fd 100644 --- a/globeconnect/lib/voice/record.js +++ b/globeconnect/lib/voice/record.js @@ -1,119 +1,121 @@ -var Record = function(name, url) { +var Record = function (name, url) { var obj = {}; this.name = name; this.url = url; - this.setAttempts = function(attempts) { + this.setAttempts = function (attempts) { obj.attempts = attempts; return this; }; - this.setBargein = function(bargein) { - obj.bargein = bargein; + this.setBargain = function (bargain) { + obj.bargain = bargain; return this; }; - this.setBeep = function(beep) { + this.setBeep = function (beep) { obj.beep = beep; return this; }; - this.setChoices = function(choices) { + this.setChoices = function (choices) { obj.choices = choices; return this; }; - this.setFormat = function(format) { + this.setFormat = function (format) { obj.format = format; return this; }; - this.setMaxSilence = function(silence) { + this.setMaxSilence = function (silence) { obj.maxSilence = silence; return this; }; - this.setMaxTime = function(maxTime) { + this.setMaxTime = function (maxTime) { obj.maxTime = maxTime; return this; }; - this.setMethod = function(method) { + this.setMethod = function (method) { obj.method = method; return this; }; - this.setMinConfidence = function(minConfidence) { + this.setMinConfidence = function (minConfidence) { obj.minConfidence = minConfidence; return this; }; - this.required = function(required) { + this.required = function (required) { obj.required = required; return this; }; - this.say = function(say) { + this.say = function (say) { obj.say = say; return this; }; - this.setTimeout = function(timeout) { + this.setTimeout = function (timeout) { obj.timeout = timeout; return this; }; - this.setTranscription = function(transcription) { + this.setTranscription = function (transcription) { this.transcription = transcription; return this; }; - this.setPassword = function(password) { + this.setPassword = function (password) { obj.password = password; return this; }; - this.setUsername = function(username) { + this.setUsername = function (username) { obj.username = username; return this; }; - this.setVoice = function(voice) { + this.setVoice = function (voice) { obj.voice = voice; return this; }; - this.allowSignals = function(allowSignals) { + this.allowSignals = function (allowSignals) { obj.allowSignals = allowSignals; return this; }; - this.setInterdigitTimeout = function(idTimeout) { - obj.interdigitTimeout = idTimeout; + this.setEnterDigitTimeout = function (idTimeout) { + obj.enterDigitTimeout = idTimeout; return this; }; - this.getObject = function() { - if(typeof this.name == 'undefined') { + this.getObject = function () { + if (typeof this.name === 'undefined') { throw new Error('Name is required.'); } - if(typeof this.url == 'undefined') { + if (typeof this.url === 'undefined') { throw new Error('Url is required.'); } - if(typeof this.transcription != 'undefined') { - obj.transcription = typeof this.transcription == 'object' ? JSON.stringify(this.transcription) : this.transcription; + if (typeof this.transcription !== 'undefined') { + obj.transcription = typeof this.transcription === 'object' ? + JSON.stringify(this.transcription) : this.transcription; } obj.name = this.name; obj.url = this.url; - - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + + for (var key in obj) { + if (typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function') { + obj[key] = obj[key].getObject(); } } @@ -124,6 +126,6 @@ var Record = function(name, url) { }; -module.exports = function(name, url) { +module.exports = function (name, url) { return new Record(name, url); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/redirect.js b/globeconnect/lib/voice/redirect.js index fcf6c73..e7ac3c3 100644 --- a/globeconnect/lib/voice/redirect.js +++ b/globeconnect/lib/voice/redirect.js @@ -1,32 +1,35 @@ -var Redirect = function(to) { +var Redirect = function (to) { var obj = {}; this.to = to; - this.setName = function(name) { + this.setName = function (name) { this.name = name; return this; }; - this.required = function(required) { + this.required = function (required) { obj.required = required; return this; }; - this.getObject = function() { - if(typeof this.to == 'undefined') { + this.getObject = function () { + if (typeof this.to === 'undefined') { throw new Error('To is required.'); } - if(typeof this.name == 'undefined') { + if (typeof this.name === 'undefined') { throw new Error('Name is required.'); } obj.to = this.to; obj.name = this.name; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } @@ -36,6 +39,6 @@ var Redirect = function(to) { return this; }; -module.exports = function(to) { +module.exports = function (to) { return new Redirect(to); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/result.js b/globeconnect/lib/voice/result.js index c158128..8939c36 100644 --- a/globeconnect/lib/voice/result.js +++ b/globeconnect/lib/voice/result.js @@ -1,13 +1,13 @@ -var Result = function(json) { +var Result = function (json) { var obj = {}; this.json = json; - this.getObject = function() { - if(typeof this.json.result == 'undefined') { + this.getObject = function () { + if (typeof this.json.result === 'undefined') { throw new Error('Invalid json data'); } - for(key in this.json.result) { + for (var key in this.json.result) { obj[key] = this.json.result[key]; } @@ -17,6 +17,6 @@ var Result = function(json) { return this; }; -module.exports = function(json) { +module.exports = function (json) { return new Result(json); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/say.js b/globeconnect/lib/voice/say.js index 1dbebb4..5a1d8dd 100644 --- a/globeconnect/lib/voice/say.js +++ b/globeconnect/lib/voice/say.js @@ -1,47 +1,50 @@ -var Say = function(value) { +var Say = function (value) { var obj = {}; this.value = value; - this.setAs = function(as) { + this.setAs = function (as) { obj.as = as; return this; }; - this.setEvent = function(e) { + this.setEvent = function (e) { obj.event = e; return this; }; - this.required = function(required) { + this.required = function (required) { obj.required = required; return this; }; - this.setVoice = function(voice) { + this.setVoice = function (voice) { obj.voice = voice; return this; }; - this.allowSignals = function(allow) { + this.allowSignals = function (allow) { obj.allowSignals = allow; return this; }; - this.setName = function(name) { + this.setName = function (name) { obj.name = name; return this; }; - this.getObject = function() { - if(typeof this.value == 'undefined') { + this.getObject = function () { + if (typeof this.value === 'undefined') { throw new Error('Value is required.'); } - if(typeof obj.event != 'array') { + if (!Array.isArray(obj.event)) { obj.value = this.value; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { obj[key] = obj[key].getObject(); } @@ -51,8 +54,11 @@ var Say = function(value) { } var say = []; - for(var i = 0; i < obj.event.length; i++) { - if(typeof obj.event[i] == 'object' && obj.event[i].getObject == 'function') { + for (var i = 0; i < obj.event.length; i++) { + if ( + typeof obj.event[i] === 'object' && + obj.event[i].getObject === 'function' + ) { say[i] = obj.event[i].getObject(); continue; } @@ -60,12 +66,14 @@ var Say = function(value) { say[i] = obj.event[i]; } - say[obj.event.length] = { value : this.value }; + say[obj.event.length] = { + value: this.value + }; return say; - } + }; }; -module.exports = function(value) { +module.exports = function (value) { return new Say(value); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/session.js b/globeconnect/lib/voice/session.js index fa9d554..10e2903 100644 --- a/globeconnect/lib/voice/session.js +++ b/globeconnect/lib/voice/session.js @@ -1,27 +1,27 @@ -var Session = function(json) { +var Session = function (json) { var obj = {}; this.json = json; - this.getObject = function() { - if(typeof this.json.session == 'undefined') { + this.getObject = function () { + if (typeof this.json.session === 'undefined') { throw new Error('Invalid json data'); } - for(key in this.json.session) { + for (var key in this.json.session) { obj[key] = this.json.session[key]; } - obj.to; - obj.from; - obj.headers; - obj.parameters; + obj.to = to; + obj.from = from; + obj.headers = headers; + obj.parameters = parameters; return obj; - } + }; }; -module.exports = function(json) { +module.exports = function (json) { return new Session(json); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/startrecording.js b/globeconnect/lib/voice/startrecording.js index ee6f432..e280d39 100644 --- a/globeconnect/lib/voice/startrecording.js +++ b/globeconnect/lib/voice/startrecording.js @@ -1,59 +1,62 @@ -var StartRecording = function(url) { +var StartRecording = function (url) { var obj = {}; this.url = url; - this.setFormat = function(format) { + this.setFormat = function (format) { obj.format = format; return this; }; - this.setMethod = function(method) { + this.setMethod = function (method) { obj.method = method; return this; }; - this.setUsername = function(username) { + this.setUsername = function (username) { obj.username = username; return this; }; - this.setPassword = function(password) { + this.setPassword = function (password) { obj.password = password; return this; }; - this.setTranscriptionId = function(transId) { + this.setTranscriptionId = function (transId) { obj.transcriptionID = transId; return this; }; - this.setTranscriptionEmailFormat = function(transFormat) { - obj.transriptionEmailFormat = transFormat; + this.setTranscriptionEmailFormat = function (transFormat) { + obj.transcriptionEmailFormat = transFormat; return this; }; - this.setTranscriptionOutUri = function(transUri) { + this.setTranscriptionOutUri = function (transUri) { obj.transcriptionOutURI = transUri; return this; }; - this.getObject = function() { - if(typeof this.url == 'undefined') { - throw new Error('Url is requried.'); + this.getObject = function () { + if (typeof this.url === 'undefined') { + throw new Error('Url is required.'); } obj.url = this.url; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } return obj; - } + }; }; -module.exports = function(url) { +module.exports = function (url) { return new StartRecording(url); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/transcription.js b/globeconnect/lib/voice/transcription.js index 3ad7be2..41f98ce 100644 --- a/globeconnect/lib/voice/transcription.js +++ b/globeconnect/lib/voice/transcription.js @@ -1,22 +1,25 @@ -var Transcription = function(id) { +var Transcription = function (id) { var obj = {}; this.id = id; - this.setUrl = function(url) { + this.setUrl = function (url) { obj.url = url; return this; }; - this.getObject = function() { - if(typeof this.url == 'undefined') { - throw new Error('Url is reqiored'); + this.getObject = function () { + if (typeof this.url === 'undefined') { + throw new Error('Url is required'); } obj.id = this.id; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } @@ -24,6 +27,6 @@ var Transcription = function(id) { }; }; -module.exports = function(id) { +module.exports = function (id) { return new Wait(id); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/transfer.js b/globeconnect/lib/voice/transfer.js index d9be249..278b861 100644 --- a/globeconnect/lib/voice/transfer.js +++ b/globeconnect/lib/voice/transfer.js @@ -1,106 +1,110 @@ -var Transfer = function(to) { +var Transfer = function (to) { var obj = {}; this.to = to; - this.setName = function(name) { + this.setName = function (name) { obj.name = name; return this; - } + }; - this.setAnswerOnMedia = function(ans) { + this.setAnswerOnMedia = function (ans) { obj.setAnswerOnMedia = ans; return this; }; - this.setChoices = function(choices) { + this.setChoices = function (choices) { this.choices = choices; return this; }; - this.setFrom = function(from) { + this.setFrom = function (from) { obj.from = from; return this; }; - this.setHeaders = function(headers) { + this.setHeaders = function (headers) { this.headers = headers; return this; }; - this.on = function(on) { + this.on = function (on) { obj.on = on; return this; }; - this.required = function(required) { + this.required = function (required) { obj.required = required; return this; }; - this.setTerminator = function(terminator) { + this.setTerminator = function (terminator) { obj.terminator = terminator; return this; }; - this.setTimeout = function(timeout) { + this.setTimeout = function (timeout) { obj.timeout = timeout; return this; }; - this.allowSignals = function(allow) { + this.allowSignals = function (allow) { obj.allowSignals = allow; return this; }; - this.setInterdigitTimeout = function(idtimeout) { - obj.interdigitTimeout = idtimeout; + this.setEnterDigitTimeout = function (idTimeout) { + obj.enterDigitTimeout = idTimeout; return this; }; - this.ringRepeat = function(ringrepeat) { - obj.ringRepeat = ringrepeat; + this.ringRepeat = function (ringRepeat) { + obj.ringRepeat = ringRepeat; return this; }; - this.setMachineDetection = function(mdetection) { - obj.machineDetection = mdetection; + this.setMachineDetection = function (mDetection) { + obj.machineDetection = mDetection; return this; }; - this.getObject = function() { - if(typeof this.to == 'undefined') { - throw new Error('To is requried'); + this.getObject = function () { + if (typeof this.to === 'undefined') { + throw new Error('To is required'); } - - if(typeof obj.choices != 'undefined') { + + if (typeof obj.choices !== 'undefined') { obj.choices = JSON.stringify(this.choices); } - if(typeof obj.headers != 'undefined') { + if (typeof obj.headers !== 'undefined') { obj.headers = JSON.stringify(this.headers); } - if(typeof obj.on == 'array') { + if (Array.isArray(obj.on)) { obj.on = obj.on.join(','); } else { - if(typeof obj.on != 'undefined') { - obj.on = typeof obj.on == 'object' ? JSON.stringify(obj.on) : obj.on; + if (typeof obj.on !== 'undefined') { + obj.on = typeof obj.on === 'object' ? + JSON.stringify(obj.on) : obj.on; } } obj.to = this.to; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } return obj; - } -} + }; +}; -module.exports = function(to, name) { +module.exports = function (to, name) { return new Transfer(to, name); -} +}; \ No newline at end of file diff --git a/globeconnect/lib/voice/wait.js b/globeconnect/lib/voice/wait.js index 015e563..e688289 100644 --- a/globeconnect/lib/voice/wait.js +++ b/globeconnect/lib/voice/wait.js @@ -1,22 +1,25 @@ -var Wait = function(milliseconds) { +var Wait = function (milliseconds) { var obj = {}; this.milliseconds = milliseconds; - this.allowSignals = function(allow) { + this.allowSignals = function (allow) { obj.allowSignals = allow; return this; }; - this.getObject = function() { - if(typeof this.milliseconds == 'undefined') { - throw new Error('Milliseconds is reqiored'); + this.getObject = function () { + if (typeof this.milliseconds === 'undefined') { + throw new Error('Milliseconds is required'); } obj.milliseconds = this.milliseconds; - for(var key in obj) { - if(typeof obj[key] == 'object' && typeof obj[key].getObject == 'function') { - obj[key] = obj[key].getObject() + for (var key in obj) { + if ( + typeof obj[key] === 'object' && + typeof obj[key].getObject === 'function' + ) { + obj[key] = obj[key].getObject(); } } @@ -24,6 +27,6 @@ var Wait = function(milliseconds) { }; }; -module.exports = function(milliseconds) { +module.exports = function (milliseconds) { return new Wait(milliseconds); -} +}; \ No newline at end of file From ae846f3064b7727816e6687a6c33417922013327 Mon Sep 17 00:00:00 2001 From: Kyle Aranas <43162236+kebaranas@users.noreply.github.com> Date: Fri, 30 Aug 2019 02:13:39 +0800 Subject: [PATCH 3/6] Add files via upload From 23014dda46d783593a937efca43ac77ef3a3b7ca Mon Sep 17 00:00:00 2001 From: Kyle Aranas <43162236+kebaranas@users.noreply.github.com> Date: Fri, 30 Aug 2019 02:14:30 +0800 Subject: [PATCH 4/6] Update subscriber.js From ffb946ff952bedb2de91b74506896f501a5e09a9 Mon Sep 17 00:00:00 2001 From: Kyle Aranas <43162236+kebaranas@users.noreply.github.com> Date: Fri, 30 Aug 2019 02:14:32 +0800 Subject: [PATCH 5/6] Update subscriber.js From d0cea299a63bf24865597d830e56994af4140113 Mon Sep 17 00:00:00 2001 From: Kyle Edric Aranas Date: Mon, 23 Sep 2019 14:41:24 +0800 Subject: [PATCH 6/6] Fixed some of the errors --- {globeconnect/certs => certs}/globe.crt | 0 globeconnect/README.md | 185 ------------------ globeconnect/tests/amax.js | 4 - globeconnect/tests/location.js | 10 - globeconnect/tests/oauth.js | 5 - globeconnect/tests/payment.js | 11 -- globeconnect/tests/sms.js | 22 --- globeconnect/tests/subscriber.js | 6 - globeconnect/tests/ussd.js | 0 globeconnect/tests/voice.js | 85 -------- globeconnect/voiceSamples/call.js | 12 -- globeconnect/index.js => index.js | 0 {globeconnect/lib => lib}/amax.js | 0 {globeconnect/lib => lib}/location.js | 0 {globeconnect/lib => lib}/oauth.js | 0 {globeconnect/lib => lib}/payment.js | 0 {globeconnect/lib => lib}/sms.js | 0 {globeconnect/lib => lib}/subscriber.js | 0 {globeconnect/lib => lib}/ussd.js | 0 {globeconnect/lib => lib}/voice.js | 0 {globeconnect/lib => lib}/voice/ask.js | 0 {globeconnect/lib => lib}/voice/call.js | 0 {globeconnect/lib => lib}/voice/choices.js | 0 {globeconnect/lib => lib}/voice/conference.js | 0 {globeconnect/lib => lib}/voice/hangup.js | 0 {globeconnect/lib => lib}/voice/joinprompt.js | 0 .../lib => lib}/voice/leaveprompt.js | 0 .../lib => lib}/voice/machinedetection.js | 0 {globeconnect/lib => lib}/voice/message.js | 0 {globeconnect/lib => lib}/voice/on.js | 0 {globeconnect/lib => lib}/voice/record.js | 0 {globeconnect/lib => lib}/voice/redirect.js | 0 {globeconnect/lib => lib}/voice/result.js | 0 {globeconnect/lib => lib}/voice/say.js | 0 {globeconnect/lib => lib}/voice/session.js | 0 .../lib => lib}/voice/startrecording.js | 0 .../lib => lib}/voice/transcription.js | 0 {globeconnect/lib => lib}/voice/transfer.js | 0 {globeconnect/lib => lib}/voice/wait.js | 0 .../package-lock.json => package-lock.json | 0 globeconnect/package.json => package.json | 0 41 files changed, 340 deletions(-) rename {globeconnect/certs => certs}/globe.crt (100%) delete mode 100644 globeconnect/README.md delete mode 100644 globeconnect/tests/amax.js delete mode 100644 globeconnect/tests/location.js delete mode 100644 globeconnect/tests/oauth.js delete mode 100644 globeconnect/tests/payment.js delete mode 100644 globeconnect/tests/sms.js delete mode 100644 globeconnect/tests/subscriber.js delete mode 100644 globeconnect/tests/ussd.js delete mode 100644 globeconnect/tests/voice.js delete mode 100644 globeconnect/voiceSamples/call.js rename globeconnect/index.js => index.js (100%) rename {globeconnect/lib => lib}/amax.js (100%) rename {globeconnect/lib => lib}/location.js (100%) rename {globeconnect/lib => lib}/oauth.js (100%) rename {globeconnect/lib => lib}/payment.js (100%) rename {globeconnect/lib => lib}/sms.js (100%) rename {globeconnect/lib => lib}/subscriber.js (100%) rename {globeconnect/lib => lib}/ussd.js (100%) rename {globeconnect/lib => lib}/voice.js (100%) rename {globeconnect/lib => lib}/voice/ask.js (100%) rename {globeconnect/lib => lib}/voice/call.js (100%) rename {globeconnect/lib => lib}/voice/choices.js (100%) rename {globeconnect/lib => lib}/voice/conference.js (100%) rename {globeconnect/lib => lib}/voice/hangup.js (100%) rename {globeconnect/lib => lib}/voice/joinprompt.js (100%) rename {globeconnect/lib => lib}/voice/leaveprompt.js (100%) rename {globeconnect/lib => lib}/voice/machinedetection.js (100%) rename {globeconnect/lib => lib}/voice/message.js (100%) rename {globeconnect/lib => lib}/voice/on.js (100%) rename {globeconnect/lib => lib}/voice/record.js (100%) rename {globeconnect/lib => lib}/voice/redirect.js (100%) rename {globeconnect/lib => lib}/voice/result.js (100%) rename {globeconnect/lib => lib}/voice/say.js (100%) rename {globeconnect/lib => lib}/voice/session.js (100%) rename {globeconnect/lib => lib}/voice/startrecording.js (100%) rename {globeconnect/lib => lib}/voice/transcription.js (100%) rename {globeconnect/lib => lib}/voice/transfer.js (100%) rename {globeconnect/lib => lib}/voice/wait.js (100%) rename globeconnect/package-lock.json => package-lock.json (100%) rename globeconnect/package.json => package.json (100%) diff --git a/globeconnect/certs/globe.crt b/certs/globe.crt similarity index 100% rename from globeconnect/certs/globe.crt rename to certs/globe.crt diff --git a/globeconnect/README.md b/globeconnect/README.md deleted file mode 100644 index 3984eea..0000000 --- a/globeconnect/README.md +++ /dev/null @@ -1,185 +0,0 @@ -# Globe Connect for Node.JS - -## Introduction -Globe Connect for Node.JS platform provides an implementation of Globe APIs e.g Authentication, Amax, -Sms etc. that is easy to use and can be integrated in your existing Node.JS application. Below shows -some samples on how to use the API depending on the functionality that you need to integrate in your -application. - -## Basic Usage - -###### Figure 1. Authentication - -```javascript -globe = require('globe-connect'); - -oauth = globe.Oauth('[app_key]', '[app_secret]'); - -// get redirect url -url = oauth.getRedirectUrl(); -console.log(url); - -// get access token -oauth.getAccessToken('[code]', function(resCode, body) { - // some code here - console.log(resCode); - console.log(body) -}); -``` - -###### Figure 2. Amax - - -```javascript -globe = require('globe-connect'); -amax = globe.Amax('[app_id]', '[app_secret]'); -amax.setToken('[token]'); -amax.setAddress('[address]'); -amax.setPromo('[promo]'); -amax.sendReward(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}); -``` - -###### Figure 3. Binary SMS - -```javascript -globe = require('globe-connect'); -var sms = globe.Sms('[shortcode]', '[token]'); - -sms.setUserDataHeader('06050423F423F4'); -sms.setDataEncodingScheme(1) -sms.setReceiverAddress('+639065272450') -sms.setMessage('samplebinarymessage') -sms.sendBinaryMessage(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}) -``` - -###### Figure 4. Location - -```javascript -globe = require('globe-connect'); -var amax = globe.Location('[token]'); -amax.setAddress('[address]'); -amax.setRequestedAccuracy('[accuracy]'); -amax.getLocation(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}); -``` - -###### Figure 5. Payment (Send Payment Request) - - -```javascript -globe = require('globe-connect'); -payment = globe.Payment('[token]'); -payment.setAmount('[amount]'); -payment.setDescription('[desciption]'); -payment.setEndUserId('[number]'); -payment.setReferenceCode('[referenceCode]'); -payment.setTransactionOperationStatus('[status]'); -payment.sendPaymentRequest(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}) -``` - -###### Figure 6. Payment (Get Last Reference ID) -```javascript - -globe = require('globe-connect'); -payment = globe.Payment('[token]'); -payment.setAppKey('[app_key]'); -payment.setAppSecret('[app_secret]'); -payment.getLastReferenceCode(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}) -``` - -###### Figure 7. Sms - -```javascript -globe = require('globe-connect'); -var sms = globe.Sms('[shortcode]', '[token]'); - -/* SEND MESSAGE */ -sms.setReceiverAddress('[address]'); -sms.setMessage('[message]') -sms.sendMessage(function(resCode, body){ - // some code here - console.log(resCode); - console.log(body); -}); -``` - - -###### Figure 8. Subscriber (Get Balance) - - -```javsacript -globe = require('globe-connect'); -subscriber = globe.Subscriber('[token]'); -subscriber.setAddres('[address]'); -subscriber.getSubscriberBalance(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}); -``` - -###### Figure 9. Subscriber (Get Reload Amount) - -```javascript -globe = require('globe-connect'); -subscriber = globe.Subscriber('[token]'); -subscriber.setAddres('[address]'); -subscriber.getReloadAmount(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}); - -``` - -###### Figure 10. USSD (Send) - -```javascript -globe = require('globe-connect'); -ussd = globe.Ussd('[token]', '[shortcode]'); - -ussd.setAddress('[address]'); -ussd.setUssdMessage('[message]'); -ussd.setFlash('[flash]'); -ussd.sendUssdRequest(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}); -``` - -###### Figure 11. USSD (Reply) - -```javascript -globe = require('globe-connect'); -ussd = globe.Ussd('[token]', '[shortcode]'); - -ussd.setAddress('[address]'); -ussd.setUssdMessage('[message]'); -ussd.setFlash('[flash]'); -ussd.setSessionId('[session_id]') -ussd.replyUssdRequest(function(resCode, body) { - // some code here - console.log(resCode); - console.log(body); -}); -``` diff --git a/globeconnect/tests/amax.js b/globeconnect/tests/amax.js deleted file mode 100644 index 0b53ba3..0000000 --- a/globeconnect/tests/amax.js +++ /dev/null @@ -1,4 +0,0 @@ -globe = require('../index.js'); -var amax = globe.Amax('5ozgSgeRyeHzacXo55TR65HnqoAESbAz', '3dbcd598f268268e13550c87134f8de0ec4ac1100cf0a68a2936d07fc9e2459e'); - - diff --git a/globeconnect/tests/location.js b/globeconnect/tests/location.js deleted file mode 100644 index f02e082..0000000 --- a/globeconnect/tests/location.js +++ /dev/null @@ -1,10 +0,0 @@ -globe = require('../index.js'); -var amax = globe.Location('Ppf01xq2CfCKsfu716QxoNOuiaDXaQF3n3vtLfFAfKs'); -amax.setAddress('9063389509'); -amax.setRequestedAccuracy(100); -amax.getLocation(function(resCode, body) { - console.log(resCode); - console.log(body); - console.log('DONE!'); -}); - diff --git a/globeconnect/tests/oauth.js b/globeconnect/tests/oauth.js deleted file mode 100644 index 751ea0b..0000000 --- a/globeconnect/tests/oauth.js +++ /dev/null @@ -1,5 +0,0 @@ -globe = require('../index.js'); -oauth = globe.Oauth('5ozgSgeRyeHzacXo55TR65HnqoAESbAz', '3dbcd598f268268e13550c87134f8de0ec4ac1100cf0a68a2936d07fc9e2459e'); -oauth.getAccessToken('bqsgejoAsgG7yLfEMMMksro57yCazb8oUq4AgkF7x9LdHyGp79IEydLMuAMbnGua4qBdhdnMqRsbRLbpCLXBxzC6KrA9sE4nonFzBBK6tkbkX4syBeM8tXnBEoC7kTRK77LTB8GCdXeELtAEkkMsj5Bpgtajn7oFAEr5gsyRBz7CRGLjGC6dMqLsGoqpKh5Eb5ruBRd69uLapLxIXy9KnHdpAaXFrLb5qUbj5orCzgMMBsLr7rAf6BjxRsBeLo5s', function(resCode, body) { - console.log(body); -}); diff --git a/globeconnect/tests/payment.js b/globeconnect/tests/payment.js deleted file mode 100644 index 190687e..0000000 --- a/globeconnect/tests/payment.js +++ /dev/null @@ -1,11 +0,0 @@ -globe = require('../index.js'); -payment = globe.Payment('Ppf01xq2CfCKsfu716QxoNOuiaDXaQF3n3vtLfFAfKs'); -payment.setAmount([amount]); -payment.setDescription([desciption]); -payment.setEndUserId([number]); -payment.setReferenceCode([referenceCOde]); -payment.setTransactionOperationStatus([status]); -payment.sendPaymentRequest(function(resCode, body) { - console.log(body); -}) - diff --git a/globeconnect/tests/sms.js b/globeconnect/tests/sms.js deleted file mode 100644 index 02c8790..0000000 --- a/globeconnect/tests/sms.js +++ /dev/null @@ -1,22 +0,0 @@ -globe = require('../index.js'); -var sms = globe.Sms('21584130', 'JO3SpcC-AFiC461wgOxUPDmsOTc5YiMayoK1GnQcduc'); - - -/* SEND MESSAGE */ -sms.setReceiverAddress('+639065272450'); -sms.setMessage('chawse') -sms.sendMessage(function(resCode, body){ - console.log(resCode); - console.log(body); -}); - -/* SEND BINARY MESSAGE */ -sms.setUserDataHeader('06050423F423F4'); -sms.setDataEncodingScheme(1) -sms.setReceiverAddress('+639065272450') -sms.setMessage('samplebinarymessage') -sms.sendBinaryMessage(function(resCode, body) { - console.log(resCode); - console.log(body); - console.log('DONE!'); -}) diff --git a/globeconnect/tests/subscriber.js b/globeconnect/tests/subscriber.js deleted file mode 100644 index d48df70..0000000 --- a/globeconnect/tests/subscriber.js +++ /dev/null @@ -1,6 +0,0 @@ -globe = require('../index.js'); -subscriber = globe.Subscriber('[token]'); -subscriber.setAddres('[address]'); -subscriber.getSubscriberBalance(function(resCode, body) { - console.log(body); -}); diff --git a/globeconnect/tests/ussd.js b/globeconnect/tests/ussd.js deleted file mode 100644 index e69de29..0000000 diff --git a/globeconnect/tests/voice.js b/globeconnect/tests/voice.js deleted file mode 100644 index 75ae47b..0000000 --- a/globeconnect/tests/voice.js +++ /dev/null @@ -1,85 +0,0 @@ -var globe = require(__dirname + '/../index.js'); - -// ask -var ask = globe.Voice().ask({'test' : 'test'}); -ask.setChoices({test : 'test'}); -console.log(ask.getObject()); - -// call -var call = globe.Voice().call('to'); -call.setName('name'); -console.log(call.getObject()); - -// choices -var choices = globe.Voice().choices('[5 DIGITS]'); -console.log(choices.getObject()); - -// conference -var conference = globe.Voice().conference('[id]'); -conference.setName('[name]'); -console.log(conference.getObject()); - -// join prompt -var joinPrompt = globe.Voice().joinPrompt('[value]'); -joinPrompt.setVoice('[voice]'); -console.log(joinPrompt.getObject()); - -// leave prompt -var leavePrompt = globe.Voice().leavePrompt('[value]'); -leavePrompt.setVoice('[voice]'); -console.log(leavePrompt.getObject()); - -// machine detection -var machineDetection = globe.Voice().machineDetection(); -machineDetection.setIntroduction('intro'); -machineDetection.setVoice('[voice]'); -console.log(machineDetection.getObject()); - -// message -var message = globe.Voice().message('say', 'to'); -message.setName('[name]'); -console.log(message.getObject()); - -// on -var on = globe.Voice().on('event', 'say'); -on.setName('on name') -console.log(on.getObject()); - -// record -var record = globe.Voice().record('[recordName]', '[recordUrl]'); -console.log(record.getObject()); - -// redirect -var redirect = globe.Voice().redirect('[redirect to]'); -redirect.setName('[redirect name]'); -console.log(redirect.getObject()); - - -// result -var result = globe.Voice().result({ result : {test : 'hest', foo : 'bar'}}); -console.log(result.getObject()); - -// say -var say = globe.Voice().say('[sayName]', '[sayValue]'); -say.setAs('[sayAs]'); -say.required(true); -say.setVoice('[sayVoice]'); -say.allowSignals(true); -console.log(say.getObject()); - -// session -var session = globe.Voice().session({ session : { id : '[sessionid]', etc : 'sessionetc'}}); -console.log(session.getObject()); - -// start recording -var startRecording = globe.Voice().startRecording('[recordingurl]'); -console.log(startRecording.getObject()); - -// transfer -var transfer = globe.Voice().transfer('[transferto]', '[transfername]'); -console.log(transfer.getObject()); - -// wait -var wait = globe.Voice().wait('[waitmilliseconds]'); -wait.allowSignals(true); -console.log(wait.getObject()); diff --git a/globeconnect/voiceSamples/call.js b/globeconnect/voiceSamples/call.js deleted file mode 100644 index 595226a..0000000 --- a/globeconnect/voiceSamples/call.js +++ /dev/null @@ -1,12 +0,0 @@ -var globe = require (__dirname + '/../index.js'); - -var voice = globe.Voice(); -var call = voice.call('sip:9065272450@tropo.net'); -call.from('9065272450'); - -var say = voice.say('Hellow chawse'); - -voice.addCall(call); -voice.addSay(say); -tropo = voice.getObject(); -console.log(JSON.stringify(tropo)); diff --git a/globeconnect/index.js b/index.js similarity index 100% rename from globeconnect/index.js rename to index.js diff --git a/globeconnect/lib/amax.js b/lib/amax.js similarity index 100% rename from globeconnect/lib/amax.js rename to lib/amax.js diff --git a/globeconnect/lib/location.js b/lib/location.js similarity index 100% rename from globeconnect/lib/location.js rename to lib/location.js diff --git a/globeconnect/lib/oauth.js b/lib/oauth.js similarity index 100% rename from globeconnect/lib/oauth.js rename to lib/oauth.js diff --git a/globeconnect/lib/payment.js b/lib/payment.js similarity index 100% rename from globeconnect/lib/payment.js rename to lib/payment.js diff --git a/globeconnect/lib/sms.js b/lib/sms.js similarity index 100% rename from globeconnect/lib/sms.js rename to lib/sms.js diff --git a/globeconnect/lib/subscriber.js b/lib/subscriber.js similarity index 100% rename from globeconnect/lib/subscriber.js rename to lib/subscriber.js diff --git a/globeconnect/lib/ussd.js b/lib/ussd.js similarity index 100% rename from globeconnect/lib/ussd.js rename to lib/ussd.js diff --git a/globeconnect/lib/voice.js b/lib/voice.js similarity index 100% rename from globeconnect/lib/voice.js rename to lib/voice.js diff --git a/globeconnect/lib/voice/ask.js b/lib/voice/ask.js similarity index 100% rename from globeconnect/lib/voice/ask.js rename to lib/voice/ask.js diff --git a/globeconnect/lib/voice/call.js b/lib/voice/call.js similarity index 100% rename from globeconnect/lib/voice/call.js rename to lib/voice/call.js diff --git a/globeconnect/lib/voice/choices.js b/lib/voice/choices.js similarity index 100% rename from globeconnect/lib/voice/choices.js rename to lib/voice/choices.js diff --git a/globeconnect/lib/voice/conference.js b/lib/voice/conference.js similarity index 100% rename from globeconnect/lib/voice/conference.js rename to lib/voice/conference.js diff --git a/globeconnect/lib/voice/hangup.js b/lib/voice/hangup.js similarity index 100% rename from globeconnect/lib/voice/hangup.js rename to lib/voice/hangup.js diff --git a/globeconnect/lib/voice/joinprompt.js b/lib/voice/joinprompt.js similarity index 100% rename from globeconnect/lib/voice/joinprompt.js rename to lib/voice/joinprompt.js diff --git a/globeconnect/lib/voice/leaveprompt.js b/lib/voice/leaveprompt.js similarity index 100% rename from globeconnect/lib/voice/leaveprompt.js rename to lib/voice/leaveprompt.js diff --git a/globeconnect/lib/voice/machinedetection.js b/lib/voice/machinedetection.js similarity index 100% rename from globeconnect/lib/voice/machinedetection.js rename to lib/voice/machinedetection.js diff --git a/globeconnect/lib/voice/message.js b/lib/voice/message.js similarity index 100% rename from globeconnect/lib/voice/message.js rename to lib/voice/message.js diff --git a/globeconnect/lib/voice/on.js b/lib/voice/on.js similarity index 100% rename from globeconnect/lib/voice/on.js rename to lib/voice/on.js diff --git a/globeconnect/lib/voice/record.js b/lib/voice/record.js similarity index 100% rename from globeconnect/lib/voice/record.js rename to lib/voice/record.js diff --git a/globeconnect/lib/voice/redirect.js b/lib/voice/redirect.js similarity index 100% rename from globeconnect/lib/voice/redirect.js rename to lib/voice/redirect.js diff --git a/globeconnect/lib/voice/result.js b/lib/voice/result.js similarity index 100% rename from globeconnect/lib/voice/result.js rename to lib/voice/result.js diff --git a/globeconnect/lib/voice/say.js b/lib/voice/say.js similarity index 100% rename from globeconnect/lib/voice/say.js rename to lib/voice/say.js diff --git a/globeconnect/lib/voice/session.js b/lib/voice/session.js similarity index 100% rename from globeconnect/lib/voice/session.js rename to lib/voice/session.js diff --git a/globeconnect/lib/voice/startrecording.js b/lib/voice/startrecording.js similarity index 100% rename from globeconnect/lib/voice/startrecording.js rename to lib/voice/startrecording.js diff --git a/globeconnect/lib/voice/transcription.js b/lib/voice/transcription.js similarity index 100% rename from globeconnect/lib/voice/transcription.js rename to lib/voice/transcription.js diff --git a/globeconnect/lib/voice/transfer.js b/lib/voice/transfer.js similarity index 100% rename from globeconnect/lib/voice/transfer.js rename to lib/voice/transfer.js diff --git a/globeconnect/lib/voice/wait.js b/lib/voice/wait.js similarity index 100% rename from globeconnect/lib/voice/wait.js rename to lib/voice/wait.js diff --git a/globeconnect/package-lock.json b/package-lock.json similarity index 100% rename from globeconnect/package-lock.json rename to package-lock.json diff --git a/globeconnect/package.json b/package.json similarity index 100% rename from globeconnect/package.json rename to package.json