Skip to content

Commit

Permalink
Fixed API request headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhusudhan Reddy Vuppala committed Aug 4, 2023
1 parent a4cd443 commit 6be3f4d
Show file tree
Hide file tree
Showing 21 changed files with 211 additions and 244 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import { FreeTrialNumbers } from '../dist/index.js';
import { TFreeTrialNumbers } from '../dist/messaging/types/FreeTrialNumberTypes.js';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("../dist/index.js");
// Auth using JSON file import
// var AUTH_CONFIG = require('./credentials.json');
// const trialNumber = new TrialNumbers(AUTH_CONFIG);

// Auth via ENV VARS or SHARED CREDENTIALS
const freeTrialNumbers = new FreeTrialNumbers();

var freeTrialNumbers = new index_js_1.FreeTrialNumbers();
/**
* FreeTrial Numbers - Create
*/

const params: TFreeTrialNumbers = {
var params = {
freeTrialNumbers: [
"0412345678"
]
};

freeTrialNumbers.create(params)
.then(result => {
.then(function (result) {
console.log('SUCCESS:freeTrialNumbers:create:', result);
})
.catch(error => {
.catch(function (error) {
console.error('ERROR:freeTrialNumber:create:', error);
});
14 changes: 14 additions & 0 deletions examples/freeTrialNumbers-get-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("../dist/index.js");
// Auth using JSON file import
// var AUTH_CONFIG = require('./credentials.json');
// const trialNumber = new TrialNumbers(AUTH_CONFIG);
// Auth via ENV VARS or SHARED CREDENTIALS
var freeTrialNumbers = new index_js_1.FreeTrialNumbers();
/**
* FreeTrial Numbers - Fetch all numbers associated to the account
*/
freeTrialNumbers.getAll()
.then(function (result) { return console.log('SUCCESS:freeTrialNumbers:getAll:', result); })
.catch(function (error) { return console.error('ERROR:freeTrialNumber:getAll:', error); });
15 changes: 0 additions & 15 deletions examples/freeTrialNumbers-get-all.ts

This file was deleted.

13 changes: 6 additions & 7 deletions examples/healthcheck.ts → examples/healthcheck.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { HealthCheck } from '../dist/index.js'

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("../dist/index.js");
// Auth using JSON file import
// var AUTH_CONFIG = require('./credentials.json');
// const healthCheck = new HealthCheck(AUTH_CONFIG);

// Auth via ENV VARS or SHARED CREDENTIALS
const healthCheck = new HealthCheck();

var healthCheck = new index_js_1.HealthCheck();
healthCheck.get()
.then(result => {
.then(function (result) {
console.log('SUCCESS:healthCheck:', result);
})
.catch(error => {
.catch(function (error) {
console.error('ERROR:healthCheck:', error);
});
14 changes: 14 additions & 0 deletions examples/messages-fetch-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var dist_1 = require("../dist");
// Auth using JSON file import
// var AUTH_CONFIG = require('./credentials.json');
// const message = new Message(AUTH_CONFIG);
// Auth via ENV VARS or SHARED CREDENTIALS
var messages = new dist_1.Messages();
/**
* Messages - Fetch all
*/
messages.getAll()
.then(function (result) { return console.log('SUCCESS:messages:getAll:', result); })
.catch(function (error) { return console.error('ERROR:messages:getAll:', error); });
16 changes: 0 additions & 16 deletions examples/messages-fetch-all.ts

This file was deleted.

24 changes: 24 additions & 0 deletions examples/messages-send-fetch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("../dist/index.js");
// Auth using JSON file import
// var AUTH_CONFIG = require('./credentials.json');
// const message = new Message(AUTH_CONFIG);
// Auth via ENV VARS or SHARED CREDENTIALS
var message = new index_js_1.Messages();
message.send({
to: '+61123456789',
from: 'private',
messageContent: 'Hello from Messaging SDK!'
})
.then(function (result) {
console.log('SUCCESS:messages:send:sms:', result);
var messageId = Array.isArray(result.messageId) ? result.messageId[0] : result.messageId;
/** Get a Message */
message.get(messageId)
.then(function (getMsgResult) { return console.log('SUCCESS:messages:get:', getMsgResult); })
.catch(function (getMsgError) { return console.error('ERROR:messages:get:', getMsgError); });
})
.catch(function (error) {
console.error('ERROR:messages:send:sms:', error);
});
27 changes: 0 additions & 27 deletions examples/messages-send-fetch.ts

This file was deleted.

28 changes: 28 additions & 0 deletions examples/messages-send-mms.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 0 additions & 32 deletions examples/messages-send-mms.ts

This file was deleted.

23 changes: 23 additions & 0 deletions examples/reports-create-dailySummary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("../dist/index.js");
// Auth using JSON file import
// var AUTH_CONFIG = require('./credentials.json');
// const reports = new Reports(AUTH_CONFIG);
// Auth via ENV VARS or SHARED CREDENTIALS
var reports = new index_js_1.Reports();
var startDate = new Date();
var endDate = new Date(startDate);
endDate.setDate(startDate.getDate() - 10);
var startDateStr = "".concat(startDate.toLocaleDateString('fr-CA'));
var endDateStr = "".concat(endDate.toLocaleDateString('fr-CA'));
/**
* Reports - Create - Daily Summary Report
*/
var params = {
startDate: startDateStr,
endDate: endDateStr
};
reports.createDailySummary(params)
.then(function (result) { return console.log('SUCCESS:reports:create-daily:', result); })
.catch(function (error) { return console.error('ERROR:reports:create-daily:', error); });
27 changes: 0 additions & 27 deletions examples/reports-create-dailySummary.ts

This file was deleted.

23 changes: 23 additions & 0 deletions examples/reports-create.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("../dist/index.js");
// Auth using JSON file import
// var AUTH_CONFIG = require('./credentials.json');
// const reports = new Reports(AUTH_CONFIG);
// Auth via ENV VARS or SHARED CREDENTIALS
var reports = new index_js_1.Reports();
var startDate = new Date();
var endDate = new Date(startDate);
endDate.setDate(startDate.getDate() - 10);
var startDateStr = "".concat(startDate.toLocaleDateString('fr-CA'));
var endDateStr = "".concat(endDate.toLocaleDateString('fr-CA'));
/**
* Reports - Create - Messages Report
*/
var params = {
startDate: startDateStr,
endDate: endDateStr
};
reports.create(params)
.then(function (result) { return console.log('SUCCESS:reports:create:', result); })
.catch(function (error) { return console.error('ERROR:reports:create:', error); });
26 changes: 0 additions & 26 deletions examples/reports-create.ts

This file was deleted.

14 changes: 14 additions & 0 deletions examples/reports-get-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var dist_1 = require("../dist");
// Auth using JSON file import
// var AUTH_CONFIG = require('./credentials.json');
// const reports = new Reports(AUTH_CONFIG);
// Auth via ENV VARS or SHARED CREDENTIALS
var reports = new dist_1.Reports();
/**
* Reports - Fetch all reports
*/
reports.getAll()
.then(function (result) { return console.log('SUCCESS:reports:getAll:', result); })
.catch(function (error) { return console.error('ERROR:reports:getAll:', error); });
16 changes: 0 additions & 16 deletions examples/reports-get-all.ts

This file was deleted.

Loading

0 comments on commit 6be3f4d

Please sign in to comment.