Advanced tools
Comparing version 0.0.1-Alpha to 0.0.2-Alpha
"use strict"; | ||
/** | ||
@@ -9,4 +10,11 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const logger_1 = require("../logger"); | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const logger_1 = __importDefault(require("../logger")); | ||
const lib_name = 'BASE_API'; | ||
@@ -16,10 +24,9 @@ const log_local = false; | ||
class Base_API { | ||
constructor(config, HTTPS_Client) { | ||
if (HTTPS_Client) | ||
this._client = HTTPS_Client; | ||
this._config = config; | ||
logger.log(`Initialized with HTTPS_Client: ${HTTPS_Client ? 'true' : 'false'}`); | ||
} | ||
constructor(config, HTTPS_Client) { | ||
if (HTTPS_Client) this._client = HTTPS_Client; | ||
this._config = config; | ||
logger.log(`Initialized with HTTPS_Client: ${HTTPS_Client ? 'true' : 'false'}`); | ||
} | ||
} | ||
exports.default = Base_API; | ||
//# sourceMappingURL=base.js.map | ||
module.exports = exports.default; |
"use strict"; | ||
/** | ||
@@ -9,6 +10,40 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const base_1 = require("./base"); | ||
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { | ||
return value instanceof P ? value : new P(function (resolve) { | ||
resolve(value); | ||
}); | ||
} | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { | ||
try { | ||
step(generator.next(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
} | ||
function rejected(value) { | ||
try { | ||
step(generator["throw"](value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
} | ||
function step(result) { | ||
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); | ||
} | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const base_1 = __importDefault(require("./base")); | ||
const enums_1 = require("../types/enums"); | ||
const logger_1 = require("../logger"); | ||
const logger_1 = __importDefault(require("../logger")); | ||
const lib_name = 'MESSAGES_API'; | ||
@@ -18,60 +53,85 @@ const log_local = false; | ||
class Messages_API extends base_1.default { | ||
constructor() { | ||
super(...arguments); | ||
this._common_method = enums_1.HTTP_Methods_Enum.Post; | ||
this._common_endpoint = 'messages'; | ||
} | ||
_body_builder(type, payload, to_number, reply_message_id) { | ||
const body = { | ||
messaging_product: 'whatsapp', | ||
recipient_type: 'individual', | ||
to: to_number, | ||
type: type, | ||
[type]: payload, | ||
}; | ||
if (reply_message_id) | ||
body['context'] = { message_id: reply_message_id }; | ||
return body; | ||
} | ||
_send(body) { | ||
return this._client.send_CAPI_request(this._common_method, this._common_endpoint, this._config[enums_1.WA_Config_Enum.Request_Timeout], body); | ||
} | ||
async audio(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Audio, body, recipient.toString(), reply_message_id))); | ||
} | ||
async contacts(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Contacts, body, recipient.toString(), reply_message_id))); | ||
} | ||
async document(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Document, body, recipient.toString(), reply_message_id))); | ||
} | ||
async image(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Image, body, recipient.toString(), reply_message_id))); | ||
} | ||
async interactive(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Interactive, body, recipient.toString(), reply_message_id))); | ||
} | ||
async location(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Location, body, recipient.toString(), reply_message_id))); | ||
} | ||
async sticker(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Sticker, body, recipient.toString(), reply_message_id))); | ||
} | ||
async template(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Template, body, recipient.toString(), reply_message_id))); | ||
} | ||
async text(body, recipient, reply_message_id) { | ||
logger.log(body); | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Text, body, recipient.toString(), reply_message_id))); | ||
} | ||
async video(body, recipient, reply_message_id) { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Video, body, recipient.toString(), reply_message_id))); | ||
} | ||
async status(body) { | ||
const mp = { messaging_product: 'whatsapp' }; | ||
const send_body = Object.assign(mp, body); | ||
return this._send(JSON.stringify(send_body)); | ||
} | ||
constructor() { | ||
super(...arguments); | ||
this._common_method = enums_1.HTTP_Methods_Enum.Post; | ||
this._common_endpoint = 'messages'; | ||
} | ||
_body_builder(type, payload, to_number, reply_message_id) { | ||
const body = { | ||
messaging_product: 'whatsapp', | ||
recipient_type: 'individual', | ||
to: to_number, | ||
type: type, | ||
[type]: payload | ||
}; | ||
if (reply_message_id) body['context'] = { | ||
message_id: reply_message_id | ||
}; | ||
return body; | ||
} | ||
_send(body) { | ||
return this._client.send_CAPI_request(this._common_method, this._common_endpoint, this._config[enums_1.WA_Config_Enum.Request_Timeout], body); | ||
} | ||
audio(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Audio, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
contacts(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Contacts, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
document(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Document, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
image(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Image, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
interactive(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Interactive, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
location(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Location, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
sticker(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Sticker, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
template(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Template, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
text(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
logger.log(body); | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Text, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
video(body, recipient, reply_message_id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this._send(JSON.stringify(this._body_builder(enums_1.Message_Types_Enum.Video, body, recipient.toString(), reply_message_id))); | ||
}); | ||
} | ||
status(body) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const mp = { | ||
messaging_product: 'whatsapp' | ||
}; | ||
const send_body = Object.assign(mp, body); | ||
return this._send(JSON.stringify(send_body)); | ||
}); | ||
} | ||
} | ||
exports.default = Messages_API; | ||
//# sourceMappingURL=messages.js.map | ||
module.exports = exports.default; |
"use strict"; | ||
/** | ||
@@ -9,8 +10,15 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const enums_1 = require("../types/enums"); | ||
const utils_1 = require("../utils"); | ||
const https_server_1 = require("../https_server"); | ||
const base_1 = require("./base"); | ||
const logger_1 = require("../logger"); | ||
const https_server_1 = __importDefault(require("../https_server")); | ||
const base_1 = __importDefault(require("./base")); | ||
const logger_1 = __importDefault(require("../logger")); | ||
const lib_name = 'WEBHOOKS'; | ||
@@ -20,80 +28,71 @@ const log_local = true; | ||
class Webhooks_API extends base_1.default { | ||
constructor(config, user_agent) { | ||
super(config); | ||
this._user_agent = user_agent; | ||
} | ||
start(cb) { | ||
this._server = new https_server_1.default(this._config[enums_1.WA_Config_Enum.Listener_Port], (req, res) => { | ||
res.setHeader('User-Agent', this._user_agent); | ||
if (req.url) { | ||
const request_path = new URL(req.url, `https://${req.headers.host}`); | ||
logger.log(`received request (method: ${req.method}) for URL ${request_path}`); | ||
if (request_path.pathname == | ||
`/${this._config[enums_1.WA_Config_Enum.Webhook_Endpoint]}`) { | ||
if (req.method === 'GET') { | ||
if (request_path.searchParams.get('hub.mode') == 'subscribe' && | ||
request_path.searchParams.get('hub.verify_token') == | ||
this._config[enums_1.WA_Config_Enum.Webhook_Verification_Token]) { | ||
res.write(request_path.searchParams.get('hub.challenge')); | ||
res.end(); | ||
logger.log(`webhook subscription request from ${request_path.href} successfully verified`); | ||
} | ||
else { | ||
const error_message = `webhook subscription request from ${request_path.href} has either missing or non-matching verify token`; | ||
const response_status = 401; | ||
logger.log(error_message); | ||
res.writeHead(response_status); | ||
res.end(); | ||
cb(response_status, req.headers, undefined, undefined, new Error(error_message)); | ||
} | ||
} | ||
else if (req.method === 'POST' && | ||
req.headers['x-hub-signature-256']) { | ||
//Removing the prepended 'sha256=' string | ||
const xHubSignature = req.headers['x-hub-signature-256'] | ||
.toString() | ||
.replace('sha256=', ''); | ||
let body_buf = []; | ||
req.on('data', (chunk) => { | ||
body_buf = body_buf + chunk; // linter bug where push() and "+=" throws an error | ||
if (body_buf.length > 1e6) | ||
req.destroy(); // close connection if payload is larger than 1MB for some reason | ||
}); | ||
req.on('end', () => { | ||
const body = Buffer.concat(body_buf).toString(); | ||
const generated_signature = (0, utils_1.generate_x_hub_256_sig)(body, this._config[enums_1.WA_Config_Enum.App_Secret]); | ||
const cb_body = JSON.parse(body); | ||
if (generated_signature == xHubSignature) { | ||
const response_status = 200; | ||
logger.log('x-hub-signature-256 header matches generated signature'); | ||
cb(response_status, req.headers, cb_body, res, undefined); | ||
} | ||
else { | ||
const error_message = "error: x-hub signature doesn't match"; | ||
const response_status = 401; | ||
logger.log(error_message); | ||
res.writeHead(response_status); | ||
res.end(error_message); | ||
cb(response_status, req.headers, cb_body, undefined, new Error(error_message)); | ||
} | ||
}); | ||
req.on('error', (err) => { | ||
const response_status = 500; | ||
cb(response_status, req.headers, undefined, res, err); | ||
}); | ||
} | ||
} | ||
constructor(config, user_agent) { | ||
super(config); | ||
this._user_agent = user_agent; | ||
} | ||
start(cb) { | ||
this._server = new https_server_1.default(this._config[enums_1.WA_Config_Enum.Listener_Port], (req, res) => { | ||
res.setHeader('User-Agent', this._user_agent); | ||
if (req.url) { | ||
const request_path = new URL(req.url, `https://${req.headers.host}`); | ||
logger.log(`received request (method: ${req.method}) for URL ${request_path}`); | ||
if (request_path.pathname == `/${this._config[enums_1.WA_Config_Enum.Webhook_Endpoint]}`) { | ||
if (req.method === 'GET') { | ||
if (request_path.searchParams.get('hub.mode') == 'subscribe' && request_path.searchParams.get('hub.verify_token') == this._config[enums_1.WA_Config_Enum.Webhook_Verification_Token]) { | ||
res.write(request_path.searchParams.get('hub.challenge')); | ||
res.end(); | ||
logger.log(`webhook subscription request from ${request_path.href} successfully verified`); | ||
} else { | ||
const error_message = `webhook subscription request from ${request_path.href} has either missing or non-matching verify token`; | ||
const response_status = 401; | ||
logger.log(error_message); | ||
res.writeHead(response_status); | ||
res.end(); | ||
cb(response_status, req.headers, undefined, undefined, new Error(error_message)); | ||
} | ||
}); | ||
return this.is_started(); | ||
} | ||
is_started() { | ||
return this._server.is_listening(); | ||
} | ||
stop(cb) { | ||
this._server.close(cb); | ||
return this.is_started(); | ||
} | ||
} else if (req.method === 'POST' && req.headers['x-hub-signature-256']) { | ||
//Removing the prepended 'sha256=' string | ||
const xHubSignature = req.headers['x-hub-signature-256'].toString().replace('sha256=', ''); | ||
let body_buf = []; | ||
req.on('data', chunk => { | ||
body_buf = body_buf + chunk; // linter bug where push() and "+=" throws an error | ||
if (body_buf.length > 1e6) req.destroy(); // close connection if payload is larger than 1MB for some reason | ||
}); | ||
req.on('end', () => { | ||
const body = Buffer.concat(body_buf).toString(); | ||
const generated_signature = (0, utils_1.generate_x_hub_256_sig)(body, this._config[enums_1.WA_Config_Enum.App_Secret]); | ||
const cb_body = JSON.parse(body); | ||
if (generated_signature == xHubSignature) { | ||
const response_status = 200; | ||
logger.log('x-hub-signature-256 header matches generated signature'); | ||
cb(response_status, req.headers, cb_body, res, undefined); | ||
} else { | ||
const error_message = "error: x-hub signature doesn't match"; | ||
const response_status = 401; | ||
logger.log(error_message); | ||
res.writeHead(response_status); | ||
res.end(error_message); | ||
cb(response_status, req.headers, cb_body, undefined, new Error(error_message)); | ||
} | ||
}); | ||
req.on('error', err => { | ||
const response_status = 500; | ||
cb(response_status, req.headers, undefined, res, err); | ||
}); | ||
} | ||
} | ||
} | ||
}); | ||
return this.is_started(); | ||
} | ||
is_started() { | ||
return this._server.is_listening(); | ||
} | ||
stop(cb) { | ||
this._server.close(cb); | ||
return this.is_started(); | ||
} | ||
} | ||
exports.default = Webhooks_API; | ||
//# sourceMappingURL=webhooks.js.map | ||
module.exports = exports.default; |
"use strict"; | ||
/** | ||
@@ -9,6 +10,40 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { | ||
return value instanceof P ? value : new P(function (resolve) { | ||
resolve(value); | ||
}); | ||
} | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { | ||
try { | ||
step(generator.next(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
} | ||
function rejected(value) { | ||
try { | ||
step(generator["throw"](value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
} | ||
function step(result) { | ||
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); | ||
} | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.HTTPS_Client_Response = void 0; | ||
const https_1 = require("https"); | ||
const logger_1 = require("./logger"); | ||
const logger_1 = __importDefault(require("./logger")); | ||
const enums_1 = require("./types/enums"); | ||
@@ -19,93 +54,92 @@ const lib_name = 'HTTPS_CLIENT'; | ||
class HTTPS_Client { | ||
constructor() { | ||
this._agent = new https_1.Agent({ keepAlive: true }); | ||
} | ||
clear_sockets() { | ||
this._agent.destroy(); | ||
return true; | ||
} | ||
async send_request(hostname, port, path, method, headers, timeout, requestData) { | ||
const agent = this._agent; | ||
return new Promise((resolve, reject) => { | ||
const req = (0, https_1.request)({ | ||
hostname: hostname, | ||
port: port, | ||
path: path, | ||
method: method, | ||
agent: agent, | ||
headers: headers, | ||
constructor() { | ||
this._agent = new https_1.Agent({ | ||
keepAlive: true | ||
}); | ||
} | ||
clear_sockets() { | ||
this._agent.destroy(); | ||
return true; | ||
} | ||
send_request(hostname, port, path, method, headers, timeout, requestData) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const agent = this._agent; | ||
return new Promise((resolve, reject) => { | ||
const req = (0, https_1.request)({ | ||
hostname: hostname, | ||
port: port, | ||
path: path, | ||
method: method, | ||
agent: agent, | ||
headers: headers | ||
}); | ||
logger.log({ | ||
hostname: hostname, | ||
port: port, | ||
path, | ||
method, | ||
agent, | ||
headers | ||
}); | ||
req.setTimeout(timeout, () => { | ||
// TODO: Handle timeout error with error handler CB and custom error code | ||
req.destroy(); | ||
}); | ||
req.on('response', resp => { | ||
resolve(new HTTPS_Client_Response(resp)); | ||
}); | ||
req.on('error', error => { | ||
reject(error); | ||
}); | ||
req.once('socket', socket => { | ||
if (socket.connecting) { | ||
socket.once('secureConnect', () => { | ||
logger.log(requestData); | ||
if (method === enums_1.HTTP_Methods_Enum.Post || method == enums_1.HTTP_Methods_Enum.Put) req.write(requestData); | ||
req.end(); | ||
}); | ||
logger.log({ | ||
hostname: hostname, | ||
port: port, | ||
path, | ||
method, | ||
agent, | ||
headers, | ||
}); | ||
req.setTimeout(timeout, () => { | ||
// TODO: Handle timeout error with error handler CB and custom error code | ||
req.destroy(); | ||
}); | ||
req.on('response', (resp) => { | ||
resolve(new HTTPS_Client_Response(resp)); | ||
}); | ||
req.on('error', (error) => { | ||
reject(error); | ||
}); | ||
req.once('socket', (socket) => { | ||
if (socket.connecting) { | ||
socket.once('secureConnect', () => { | ||
logger.log(requestData); | ||
if (method === enums_1.HTTP_Methods_Enum.Post || | ||
method == enums_1.HTTP_Methods_Enum.Put) | ||
req.write(requestData); | ||
req.end(); | ||
}); | ||
} | ||
else { | ||
if (method === enums_1.HTTP_Methods_Enum.Post || | ||
method == enums_1.HTTP_Methods_Enum.Put) | ||
req.write(requestData); | ||
req.end(); | ||
} | ||
}); | ||
} else { | ||
if (method === enums_1.HTTP_Methods_Enum.Post || method == enums_1.HTTP_Methods_Enum.Put) req.write(requestData); | ||
req.end(); | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
} | ||
} | ||
exports.default = HTTPS_Client; | ||
class HTTPS_Client_Response { | ||
constructor(resp) { | ||
this._resp = resp; | ||
this._status_code = resp.statusCode || 400; | ||
this._headers = resp.headers || {}; | ||
} | ||
status_code() { | ||
return this._status_code; | ||
} | ||
headers() { | ||
return this._headers; | ||
} | ||
raw_response() { | ||
return this._resp; | ||
} | ||
async response_body_to_JSON() { | ||
return new Promise((resolve, reject) => { | ||
let response = ''; | ||
this._resp.setEncoding('utf8'); | ||
this._resp.on('data', (chunk) => { | ||
response += chunk.toString(); | ||
}); | ||
this._resp.once('end', () => { | ||
try { | ||
resolve(JSON.parse(response)); | ||
} | ||
catch (err) { | ||
reject(err); | ||
} | ||
}); | ||
constructor(resp) { | ||
this._resp = resp; | ||
this._status_code = resp.statusCode || 400; | ||
this._headers = resp.headers || {}; | ||
} | ||
status_code() { | ||
return this._status_code; | ||
} | ||
headers() { | ||
return this._headers; | ||
} | ||
raw_response() { | ||
return this._resp; | ||
} | ||
response_body_to_JSON() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return new Promise((resolve, reject) => { | ||
let response = ''; | ||
this._resp.setEncoding('utf8'); | ||
this._resp.on('data', chunk => { | ||
response += chunk.toString(); | ||
}); | ||
} | ||
this._resp.once('end', () => { | ||
try { | ||
resolve(JSON.parse(response)); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
exports.HTTPS_Client_Response = HTTPS_Client_Response; | ||
//# sourceMappingURL=HTTPS_Client.js.map | ||
exports.HTTPS_Client_Response = HTTPS_Client_Response; |
"use strict"; | ||
/** | ||
@@ -9,30 +10,32 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const http_1 = require("http"); | ||
class HTTP_Server { | ||
constructor(port, cb) { | ||
constructor(port, cb) { | ||
this._listening = false; | ||
this._sockets = new Set(); | ||
this._server = (0, http_1.createServer)(cb).listen(port); | ||
this._server.on('connection', socket => { | ||
this._sockets.add(socket); | ||
this._listening = true; | ||
this._server.once('close', () => { | ||
this._sockets.delete(socket); | ||
this._listening = false; | ||
this._sockets = new Set(); | ||
this._server = (0, http_1.createServer)(cb).listen(port); | ||
this._server.on('connection', (socket) => { | ||
this._sockets.add(socket); | ||
this._listening = true; | ||
this._server.once('close', () => { | ||
this._sockets.delete(socket); | ||
this._listening = false; | ||
}); | ||
}); | ||
}); | ||
}); | ||
} | ||
is_listening() { | ||
return this._listening; | ||
} | ||
close(cb) { | ||
for (const socket of this._sockets) { | ||
socket.destroy(); | ||
this._sockets.delete(socket); | ||
} | ||
is_listening() { | ||
return this._listening; | ||
} | ||
close(cb) { | ||
for (const socket of this._sockets) { | ||
socket.destroy(); | ||
this._sockets.delete(socket); | ||
} | ||
this._server.close(cb); | ||
} | ||
this._server.close(cb); | ||
} | ||
} | ||
exports.default = HTTP_Server; | ||
//# sourceMappingURL=https_server.js.map | ||
module.exports = exports.default; |
@@ -8,2 +8,3 @@ /** | ||
*/ | ||
export * from './WhatsApp'; | ||
import WhatsApp from './WhatsApp'; | ||
export default WhatsApp; |
"use strict"; | ||
/** | ||
@@ -9,18 +10,12 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./WhatsApp"), exports); | ||
//# sourceMappingURL=index.js.map | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const WhatsApp_1 = __importDefault(require("./WhatsApp")); | ||
exports.default = WhatsApp_1.default; | ||
module.exports = exports.default; |
"use strict"; | ||
/** | ||
@@ -9,19 +10,21 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
class Logger { | ||
constructor(name, debug) { | ||
this.name = name; | ||
this.debug = debug; | ||
constructor(name, debug) { | ||
this.name = name; | ||
this.debug = debug; | ||
} | ||
log(...data) { | ||
if (this.debug) { | ||
let prefix = `[ ${Date.now()} ]`; | ||
if (this.name) { | ||
prefix += ` - ${this.name}`; | ||
} | ||
console.log.apply(console, [prefix, ': ', ...data]); | ||
} | ||
log(...data) { | ||
if (this.debug) { | ||
let prefix = `[ ${Date.now()} ]`; | ||
if (this.name) { | ||
prefix += ` - ${this.name}`; | ||
} | ||
console.log.apply(console, [prefix, ': ', ...data]); | ||
} | ||
} | ||
} | ||
} | ||
exports.default = Logger; | ||
//# sourceMappingURL=logger.js.map | ||
module.exports = exports.default; |
"use strict"; | ||
/** | ||
@@ -9,5 +10,39 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const logger_1 = require("./logger"); | ||
const https_client_1 = require("./https_client"); | ||
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { | ||
return value instanceof P ? value : new P(function (resolve) { | ||
resolve(value); | ||
}); | ||
} | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { | ||
try { | ||
step(generator.next(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
} | ||
function rejected(value) { | ||
try { | ||
step(generator["throw"](value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
} | ||
function step(result) { | ||
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); | ||
} | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const logger_1 = __importDefault(require("./logger")); | ||
const https_client_1 = __importDefault(require("./https_client")); | ||
const lib_name = 'REQUESTER'; | ||
@@ -17,31 +52,33 @@ const log_local = false; | ||
class Requester { | ||
constructor(host, api_version, phone_number_id, access_token, business_acct_id, user_agent) { | ||
this._protocol = 'https:'; | ||
this._port = 443; | ||
this._client = new https_client_1.default(); | ||
this._host = host; | ||
this._api_version = api_version; | ||
this._phone_number_id = phone_number_id; | ||
this._access_token = access_token; | ||
this._business_acct_id = business_acct_id; | ||
this._user_agent = user_agent; | ||
} | ||
_build_header(content_type) { | ||
const headers = { | ||
'Content-Type': content_type, | ||
'Authorization': `Bearer ${this._access_token}`, | ||
'User-Agent': this._user_agent, | ||
}; | ||
return headers; | ||
} | ||
_build_CAPI_path(endpoint) { | ||
return `/${this._api_version}/${this._phone_number_id}/${endpoint}`; | ||
} | ||
async send_CAPI_request(method, endpoint, timeout, body) { | ||
const content_type = 'application/json'; | ||
logger.log(`${method} : ${this._protocol.toLowerCase()}//${this._host}:${this._port}/${this._build_CAPI_path(endpoint)}`); | ||
return await this._client.send_request(this._host, this._port, this._build_CAPI_path(endpoint), method, this._build_header(content_type), timeout, method == 'POST' || method == 'PUT' ? body : undefined); | ||
} | ||
constructor(host, api_version, phone_number_id, access_token, business_acct_id, user_agent) { | ||
this._protocol = 'https:'; | ||
this._port = 443; | ||
this._client = new https_client_1.default(); | ||
this._host = host; | ||
this._api_version = api_version; | ||
this._phone_number_id = phone_number_id; | ||
this._access_token = access_token; | ||
this._business_acct_id = business_acct_id; | ||
this._user_agent = user_agent; | ||
} | ||
_build_header(content_type) { | ||
const headers = { | ||
'Content-Type': content_type, | ||
'Authorization': `Bearer ${this._access_token}`, | ||
'User-Agent': this._user_agent | ||
}; | ||
return headers; | ||
} | ||
_build_CAPI_path(endpoint) { | ||
return `/${this._api_version}/${this._phone_number_id}/${endpoint}`; | ||
} | ||
send_CAPI_request(method, endpoint, timeout, body) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const content_type = 'application/json'; | ||
logger.log(`${method} : ${this._protocol.toLowerCase()}//${this._host}:${this._port}/${this._build_CAPI_path(endpoint)}`); | ||
return yield this._client.send_request(this._host, this._port, this._build_CAPI_path(endpoint), method, this._build_header(content_type), timeout, method == 'POST' || method == 'PUT' ? body : undefined); | ||
}); | ||
} | ||
} | ||
exports.default = Requester; | ||
//# sourceMappingURL=requester.js.map | ||
module.exports = exports.default; |
"use strict"; | ||
/** | ||
@@ -9,528 +10,529 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.Currency_Codes_Enum = exports.Languages_Enum = exports.Referral_Source_Types_Enum = exports.System_Change_Types_Enum = exports.Webhook_Types_Enum = exports.Audio_Media_Types_Enum = exports.Document_Media_Types_Enum = exports.Image_Media_Types_Enum = exports.Sticker_Media_Types_Enum = exports.Video_Media_Types_Enum = exports.Status_Enum = exports.Conversation_Types_Enum = exports.WA_Required_Config_Enum = exports.WA_Config_Enum = exports.Component_Types_Enum = exports.Button_Position_Enum = exports.Button_Types_Enum = exports.Interactive_Types_Enum = exports.Parameters_Types_Enum = exports.Message_Types_Enum = exports.HTTP_Methods_Enum = void 0; | ||
var HTTP_Methods_Enum; | ||
(function (HTTP_Methods_Enum) { | ||
HTTP_Methods_Enum["Get"] = "GET"; | ||
HTTP_Methods_Enum["Post"] = "POST"; | ||
HTTP_Methods_Enum["Put"] = "PUT"; | ||
HTTP_Methods_Enum["Delete"] = "DELETE"; | ||
HTTP_Methods_Enum["Get"] = "GET"; | ||
HTTP_Methods_Enum["Post"] = "POST"; | ||
HTTP_Methods_Enum["Put"] = "PUT"; | ||
HTTP_Methods_Enum["Delete"] = "DELETE"; | ||
})(HTTP_Methods_Enum = exports.HTTP_Methods_Enum || (exports.HTTP_Methods_Enum = {})); | ||
var Message_Types_Enum; | ||
(function (Message_Types_Enum) { | ||
Message_Types_Enum["Audio"] = "audio"; | ||
Message_Types_Enum["Contacts"] = "contacts"; | ||
Message_Types_Enum["Document"] = "document"; | ||
Message_Types_Enum["Image"] = "image"; | ||
Message_Types_Enum["Interactive"] = "interactive"; | ||
Message_Types_Enum["Location"] = "location"; | ||
Message_Types_Enum["Reaction"] = "sticker"; | ||
Message_Types_Enum["Sticker"] = "sticker"; | ||
Message_Types_Enum["Template"] = "template"; | ||
Message_Types_Enum["Text"] = "text"; | ||
Message_Types_Enum["Video"] = "video"; | ||
Message_Types_Enum["Audio"] = "audio"; | ||
Message_Types_Enum["Contacts"] = "contacts"; | ||
Message_Types_Enum["Document"] = "document"; | ||
Message_Types_Enum["Image"] = "image"; | ||
Message_Types_Enum["Interactive"] = "interactive"; | ||
Message_Types_Enum["Location"] = "location"; | ||
Message_Types_Enum["Reaction"] = "sticker"; | ||
Message_Types_Enum["Sticker"] = "sticker"; | ||
Message_Types_Enum["Template"] = "template"; | ||
Message_Types_Enum["Text"] = "text"; | ||
Message_Types_Enum["Video"] = "video"; | ||
})(Message_Types_Enum = exports.Message_Types_Enum || (exports.Message_Types_Enum = {})); | ||
var Parameters_Types_Enum; | ||
(function (Parameters_Types_Enum) { | ||
Parameters_Types_Enum["Currency"] = "currency"; | ||
Parameters_Types_Enum["Date_time"] = "date_time"; | ||
Parameters_Types_Enum["Document"] = "document"; | ||
Parameters_Types_Enum["Image"] = "image"; | ||
Parameters_Types_Enum["Text"] = "text"; | ||
Parameters_Types_Enum["Video"] = "video"; | ||
Parameters_Types_Enum["Payload"] = "payload"; | ||
Parameters_Types_Enum["Currency"] = "currency"; | ||
Parameters_Types_Enum["Date_time"] = "date_time"; | ||
Parameters_Types_Enum["Document"] = "document"; | ||
Parameters_Types_Enum["Image"] = "image"; | ||
Parameters_Types_Enum["Text"] = "text"; | ||
Parameters_Types_Enum["Video"] = "video"; | ||
Parameters_Types_Enum["Payload"] = "payload"; | ||
})(Parameters_Types_Enum = exports.Parameters_Types_Enum || (exports.Parameters_Types_Enum = {})); | ||
var Interactive_Types_Enum; | ||
(function (Interactive_Types_Enum) { | ||
Interactive_Types_Enum["Button"] = "button"; | ||
Interactive_Types_Enum["List"] = "list"; | ||
Interactive_Types_Enum["Product"] = "product"; | ||
Interactive_Types_Enum["Product_list"] = "product_list"; | ||
Interactive_Types_Enum["Button"] = "button"; | ||
Interactive_Types_Enum["List"] = "list"; | ||
Interactive_Types_Enum["Product"] = "product"; | ||
Interactive_Types_Enum["Product_list"] = "product_list"; | ||
})(Interactive_Types_Enum = exports.Interactive_Types_Enum || (exports.Interactive_Types_Enum = {})); | ||
var Button_Types_Enum; | ||
(function (Button_Types_Enum) { | ||
Button_Types_Enum["Quick_reply"] = "quick_reply"; | ||
Button_Types_Enum["URL"] = "url"; | ||
Button_Types_Enum["Quick_reply"] = "quick_reply"; | ||
Button_Types_Enum["URL"] = "url"; | ||
})(Button_Types_Enum = exports.Button_Types_Enum || (exports.Button_Types_Enum = {})); | ||
var Button_Position_Enum; | ||
(function (Button_Position_Enum) { | ||
Button_Position_Enum[Button_Position_Enum["First"] = 0] = "First"; | ||
Button_Position_Enum[Button_Position_Enum["Second"] = 1] = "Second"; | ||
Button_Position_Enum[Button_Position_Enum["Third"] = 2] = "Third"; | ||
Button_Position_Enum[Button_Position_Enum["First"] = 0] = "First"; | ||
Button_Position_Enum[Button_Position_Enum["Second"] = 1] = "Second"; | ||
Button_Position_Enum[Button_Position_Enum["Third"] = 2] = "Third"; | ||
})(Button_Position_Enum = exports.Button_Position_Enum || (exports.Button_Position_Enum = {})); | ||
var Component_Types_Enum; | ||
(function (Component_Types_Enum) { | ||
Component_Types_Enum["Header"] = "header"; | ||
Component_Types_Enum["Body"] = "body"; | ||
Component_Types_Enum["Button"] = "button"; | ||
Component_Types_Enum["Header"] = "header"; | ||
Component_Types_Enum["Body"] = "body"; | ||
Component_Types_Enum["Button"] = "button"; | ||
})(Component_Types_Enum = exports.Component_Types_Enum || (exports.Component_Types_Enum = {})); | ||
var WA_Config_Enum; | ||
(function (WA_Config_Enum) { | ||
WA_Config_Enum["Base_URL"] = "WA_BASE_URL"; | ||
WA_Config_Enum["App_Id"] = "M4D_APP_ID"; | ||
WA_Config_Enum["App_Secret"] = "M4D_APP_SECRET"; | ||
WA_Config_Enum["Phone_Number_Id"] = "WA_PHONE_NUMBER_ID"; | ||
WA_Config_Enum["Business_Acct_Id"] = "WA_BUSINESS_ACCOUNT_ID"; | ||
WA_Config_Enum["API_Version"] = "CLOUD_API_VERSION"; | ||
WA_Config_Enum["Access_Token"] = "CLOUD_API_ACCESS_TOKEN"; | ||
WA_Config_Enum["Webhook_Endpoint"] = "WEBHOOK_ENDPOINT"; | ||
WA_Config_Enum["Webhook_Verification_Token"] = "WEBHOOK_VERIFICATION_TOKEN"; | ||
WA_Config_Enum["Listener_Port"] = "LISTENER_PORT"; | ||
WA_Config_Enum["Max_Retries_After_Wait"] = "MAX_RETRIES_AFTER_WAIT"; | ||
WA_Config_Enum["Request_Timeout"] = "REQUEST_TIMEOUT"; | ||
WA_Config_Enum["Debug"] = "DEBUG"; | ||
WA_Config_Enum["Base_URL"] = "WA_BASE_URL"; | ||
WA_Config_Enum["App_Id"] = "M4D_APP_ID"; | ||
WA_Config_Enum["App_Secret"] = "M4D_APP_SECRET"; | ||
WA_Config_Enum["Phone_Number_Id"] = "WA_PHONE_NUMBER_ID"; | ||
WA_Config_Enum["Business_Acct_Id"] = "WA_BUSINESS_ACCOUNT_ID"; | ||
WA_Config_Enum["API_Version"] = "CLOUD_API_VERSION"; | ||
WA_Config_Enum["Access_Token"] = "CLOUD_API_ACCESS_TOKEN"; | ||
WA_Config_Enum["Webhook_Endpoint"] = "WEBHOOK_ENDPOINT"; | ||
WA_Config_Enum["Webhook_Verification_Token"] = "WEBHOOK_VERIFICATION_TOKEN"; | ||
WA_Config_Enum["Listener_Port"] = "LISTENER_PORT"; | ||
WA_Config_Enum["Max_Retries_After_Wait"] = "MAX_RETRIES_AFTER_WAIT"; | ||
WA_Config_Enum["Request_Timeout"] = "REQUEST_TIMEOUT"; | ||
WA_Config_Enum["Debug"] = "DEBUG"; | ||
})(WA_Config_Enum = exports.WA_Config_Enum || (exports.WA_Config_Enum = {})); | ||
var WA_Required_Config_Enum; | ||
(function (WA_Required_Config_Enum) { | ||
WA_Required_Config_Enum["API_Version"] = "CLOUD_API_VERSION"; | ||
WA_Required_Config_Enum["Access_Token"] = "CLOUD_API_ACCESS_TOKEN"; | ||
WA_Required_Config_Enum["API_Version"] = "CLOUD_API_VERSION"; | ||
WA_Required_Config_Enum["Access_Token"] = "CLOUD_API_ACCESS_TOKEN"; | ||
})(WA_Required_Config_Enum = exports.WA_Required_Config_Enum || (exports.WA_Required_Config_Enum = {})); | ||
var Conversation_Types_Enum; | ||
(function (Conversation_Types_Enum) { | ||
Conversation_Types_Enum["Business_initiated"] = "business_initiated"; | ||
Conversation_Types_Enum["Customer_initiated"] = "customer_initiated"; | ||
Conversation_Types_Enum["Referral_conversion"] = "referral_conversion"; | ||
Conversation_Types_Enum["Business_initiated"] = "business_initiated"; | ||
Conversation_Types_Enum["Customer_initiated"] = "customer_initiated"; | ||
Conversation_Types_Enum["Referral_conversion"] = "referral_conversion"; | ||
})(Conversation_Types_Enum = exports.Conversation_Types_Enum || (exports.Conversation_Types_Enum = {})); | ||
var Status_Enum; | ||
(function (Status_Enum) { | ||
Status_Enum["Delivered"] = "delivered"; | ||
Status_Enum["Read"] = "read"; | ||
Status_Enum["Sent"] = "sent"; | ||
Status_Enum["Delivered"] = "delivered"; | ||
Status_Enum["Read"] = "read"; | ||
Status_Enum["Sent"] = "sent"; | ||
})(Status_Enum = exports.Status_Enum || (exports.Status_Enum = {})); | ||
var Video_Media_Types_Enum; | ||
(function (Video_Media_Types_Enum) { | ||
Video_Media_Types_Enum["Mp4"] = "video/mp4"; | ||
Video_Media_Types_Enum["Threegp"] = "video/3gp"; | ||
Video_Media_Types_Enum["Mp4"] = "video/mp4"; | ||
Video_Media_Types_Enum["Threegp"] = "video/3gp"; | ||
})(Video_Media_Types_Enum = exports.Video_Media_Types_Enum || (exports.Video_Media_Types_Enum = {})); | ||
var Sticker_Media_Types_Enum; | ||
(function (Sticker_Media_Types_Enum) { | ||
Sticker_Media_Types_Enum["Webp"] = "image/webp"; | ||
Sticker_Media_Types_Enum["Webp"] = "image/webp"; | ||
})(Sticker_Media_Types_Enum = exports.Sticker_Media_Types_Enum || (exports.Sticker_Media_Types_Enum = {})); | ||
var Image_Media_Types_Enum; | ||
(function (Image_Media_Types_Enum) { | ||
Image_Media_Types_Enum["Jpeg"] = "image/jpeg"; | ||
Image_Media_Types_Enum["Png"] = "image/png"; | ||
Image_Media_Types_Enum["Jpeg"] = "image/jpeg"; | ||
Image_Media_Types_Enum["Png"] = "image/png"; | ||
})(Image_Media_Types_Enum = exports.Image_Media_Types_Enum || (exports.Image_Media_Types_Enum = {})); | ||
var Document_Media_Types_Enum; | ||
(function (Document_Media_Types_Enum) { | ||
Document_Media_Types_Enum["Text"] = "text/plain"; | ||
Document_Media_Types_Enum["Pdf"] = "application/pdf"; | ||
Document_Media_Types_Enum["Ppt"] = "application/vnd.ms-powerpoint"; | ||
Document_Media_Types_Enum["Word"] = "application/msword"; | ||
Document_Media_Types_Enum["Excel"] = "application/vnd.ms-excel"; | ||
Document_Media_Types_Enum["Open_Doc"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; | ||
Document_Media_Types_Enum["Open_Pres"] = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; | ||
Document_Media_Types_Enum["Open_Sheet"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; | ||
Document_Media_Types_Enum["Text"] = "text/plain"; | ||
Document_Media_Types_Enum["Pdf"] = "application/pdf"; | ||
Document_Media_Types_Enum["Ppt"] = "application/vnd.ms-powerpoint"; | ||
Document_Media_Types_Enum["Word"] = "application/msword"; | ||
Document_Media_Types_Enum["Excel"] = "application/vnd.ms-excel"; | ||
Document_Media_Types_Enum["Open_Doc"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; | ||
Document_Media_Types_Enum["Open_Pres"] = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; | ||
Document_Media_Types_Enum["Open_Sheet"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; | ||
})(Document_Media_Types_Enum = exports.Document_Media_Types_Enum || (exports.Document_Media_Types_Enum = {})); | ||
var Audio_Media_Types_Enum; | ||
(function (Audio_Media_Types_Enum) { | ||
Audio_Media_Types_Enum["Aac"] = "audio/aac"; | ||
Audio_Media_Types_Enum["Mp4"] = "audio/mp4"; | ||
Audio_Media_Types_Enum["Mpeg"] = "audio/mpeg"; | ||
Audio_Media_Types_Enum["Amr"] = "audio/amr"; | ||
Audio_Media_Types_Enum["Ogg"] = "audio/ogg"; | ||
Audio_Media_Types_Enum["Aac"] = "audio/aac"; | ||
Audio_Media_Types_Enum["Mp4"] = "audio/mp4"; | ||
Audio_Media_Types_Enum["Mpeg"] = "audio/mpeg"; | ||
Audio_Media_Types_Enum["Amr"] = "audio/amr"; | ||
Audio_Media_Types_Enum["Ogg"] = "audio/ogg"; | ||
})(Audio_Media_Types_Enum = exports.Audio_Media_Types_Enum || (exports.Audio_Media_Types_Enum = {})); | ||
var Webhook_Types_Enum; | ||
(function (Webhook_Types_Enum) { | ||
Webhook_Types_Enum["Audio"] = "audio"; | ||
Webhook_Types_Enum["Button"] = "button"; | ||
Webhook_Types_Enum["Document"] = "document"; | ||
Webhook_Types_Enum["Text"] = "text"; | ||
Webhook_Types_Enum["Image"] = "image"; | ||
Webhook_Types_Enum["Interactive"] = "interactive"; | ||
Webhook_Types_Enum["Order"] = "order"; | ||
Webhook_Types_Enum["Sticker"] = "sticker"; | ||
Webhook_Types_Enum["System"] = "system"; | ||
Webhook_Types_Enum["Unknown"] = "unknown"; | ||
Webhook_Types_Enum["Video"] = "video"; | ||
Webhook_Types_Enum["Audio"] = "audio"; | ||
Webhook_Types_Enum["Button"] = "button"; | ||
Webhook_Types_Enum["Document"] = "document"; | ||
Webhook_Types_Enum["Text"] = "text"; | ||
Webhook_Types_Enum["Image"] = "image"; | ||
Webhook_Types_Enum["Interactive"] = "interactive"; | ||
Webhook_Types_Enum["Order"] = "order"; | ||
Webhook_Types_Enum["Sticker"] = "sticker"; | ||
Webhook_Types_Enum["System"] = "system"; | ||
Webhook_Types_Enum["Unknown"] = "unknown"; | ||
Webhook_Types_Enum["Video"] = "video"; | ||
})(Webhook_Types_Enum = exports.Webhook_Types_Enum || (exports.Webhook_Types_Enum = {})); | ||
var System_Change_Types_Enum; | ||
(function (System_Change_Types_Enum) { | ||
System_Change_Types_Enum["Customer_changed_number"] = "customer_changed_number"; | ||
System_Change_Types_Enum["Customer_identity_changed"] = "customer_identity_changed"; | ||
System_Change_Types_Enum["Customer_changed_number"] = "customer_changed_number"; | ||
System_Change_Types_Enum["Customer_identity_changed"] = "customer_identity_changed"; | ||
})(System_Change_Types_Enum = exports.System_Change_Types_Enum || (exports.System_Change_Types_Enum = {})); | ||
var Referral_Source_Types_Enum; | ||
(function (Referral_Source_Types_Enum) { | ||
Referral_Source_Types_Enum["Ad"] = "ad"; | ||
Referral_Source_Types_Enum["Post"] = "post"; | ||
Referral_Source_Types_Enum["Ad"] = "ad"; | ||
Referral_Source_Types_Enum["Post"] = "post"; | ||
})(Referral_Source_Types_Enum = exports.Referral_Source_Types_Enum || (exports.Referral_Source_Types_Enum = {})); | ||
var Languages_Enum; | ||
(function (Languages_Enum) { | ||
Languages_Enum["Afrikaans"] = "af"; | ||
Languages_Enum["Albanian"] = "sq"; | ||
Languages_Enum["Arabic"] = "ar"; | ||
Languages_Enum["Azerbaijani"] = "az"; | ||
Languages_Enum["Bengali"] = "bn"; | ||
Languages_Enum["Bulgarian"] = "bg"; | ||
Languages_Enum["Catalan"] = "ca"; | ||
Languages_Enum["Chinese_CHN"] = "zh_CN"; | ||
Languages_Enum["Chinese_HKG"] = "zh_HK"; | ||
Languages_Enum["Chinese_TAI"] = "zh_TW"; | ||
Languages_Enum["Croatian"] = "hr"; | ||
Languages_Enum["Czech"] = "cs"; | ||
Languages_Enum["Danish"] = "da"; | ||
Languages_Enum["Dutch"] = "nl"; | ||
Languages_Enum["English"] = "en"; | ||
Languages_Enum["English_UK"] = "en_GB"; | ||
Languages_Enum["English_US"] = "en_US"; | ||
Languages_Enum["Estonian"] = "et"; | ||
Languages_Enum["Filipino"] = "fil"; | ||
Languages_Enum["Finnish"] = "fi"; | ||
Languages_Enum["French"] = "fr"; | ||
Languages_Enum["Georgian"] = "ka"; | ||
Languages_Enum["German"] = "de"; | ||
Languages_Enum["Greek"] = "el"; | ||
Languages_Enum["Gujarati"] = "gu"; | ||
Languages_Enum["Hausa"] = "ha"; | ||
Languages_Enum["Hebrew"] = "he"; | ||
Languages_Enum["Hindi"] = "hi"; | ||
Languages_Enum["Hungarian"] = "hu"; | ||
Languages_Enum["Indonesian"] = "id"; | ||
Languages_Enum["Irish"] = "ga"; | ||
Languages_Enum["Italian"] = "it"; | ||
Languages_Enum["Japanese"] = "ja"; | ||
Languages_Enum["Kannada"] = "kn"; | ||
Languages_Enum["Kazakh"] = "kk"; | ||
Languages_Enum["Kinyarwanda"] = "rw_RW"; | ||
Languages_Enum["Korean"] = "ko"; | ||
Languages_Enum["Kyrgyz_Kyrgyzstan"] = "ky_KG"; | ||
Languages_Enum["Lao"] = "lo"; | ||
Languages_Enum["Latvian"] = "lv"; | ||
Languages_Enum["Lithuanian"] = "lt"; | ||
Languages_Enum["Macedonian"] = "mk"; | ||
Languages_Enum["Malay"] = "ms"; | ||
Languages_Enum["Malayalam"] = "ml"; | ||
Languages_Enum["Marathi"] = "mr"; | ||
Languages_Enum["Norwegian"] = "nb"; | ||
Languages_Enum["Persian"] = "fa"; | ||
Languages_Enum["Polish"] = "pl"; | ||
Languages_Enum["Portuguese_BR"] = "pt_BR"; | ||
Languages_Enum["Portuguese_POR"] = "pt_PT"; | ||
Languages_Enum["Punjabi"] = "pa"; | ||
Languages_Enum["Romanian"] = "ro"; | ||
Languages_Enum["Russian"] = "ru"; | ||
Languages_Enum["Serbian"] = "sr"; | ||
Languages_Enum["Slovak"] = "sk"; | ||
Languages_Enum["Slovenian"] = "sl"; | ||
Languages_Enum["Spanish"] = "es"; | ||
Languages_Enum["Spanish_ARG"] = "es_AR"; | ||
Languages_Enum["Spanish_SPA"] = "es_ES"; | ||
Languages_Enum["Spanish_MEX"] = "es_MX"; | ||
Languages_Enum["Swahili"] = "sw"; | ||
Languages_Enum["Swedish"] = "sv"; | ||
Languages_Enum["Tamil"] = "ta"; | ||
Languages_Enum["Telugu"] = "te"; | ||
Languages_Enum["Thai"] = "th"; | ||
Languages_Enum["Turkish"] = "tr"; | ||
Languages_Enum["Ukrainian"] = "uk"; | ||
Languages_Enum["Urdu"] = "ur"; | ||
Languages_Enum["Uzbek"] = "uz"; | ||
Languages_Enum["Vietnamese"] = "vi"; | ||
Languages_Enum["Zulu"] = "zu"; | ||
Languages_Enum["Afrikaans"] = "af"; | ||
Languages_Enum["Albanian"] = "sq"; | ||
Languages_Enum["Arabic"] = "ar"; | ||
Languages_Enum["Azerbaijani"] = "az"; | ||
Languages_Enum["Bengali"] = "bn"; | ||
Languages_Enum["Bulgarian"] = "bg"; | ||
Languages_Enum["Catalan"] = "ca"; | ||
Languages_Enum["Chinese_CHN"] = "zh_CN"; | ||
Languages_Enum["Chinese_HKG"] = "zh_HK"; | ||
Languages_Enum["Chinese_TAI"] = "zh_TW"; | ||
Languages_Enum["Croatian"] = "hr"; | ||
Languages_Enum["Czech"] = "cs"; | ||
Languages_Enum["Danish"] = "da"; | ||
Languages_Enum["Dutch"] = "nl"; | ||
Languages_Enum["English"] = "en"; | ||
Languages_Enum["English_UK"] = "en_GB"; | ||
Languages_Enum["English_US"] = "en_US"; | ||
Languages_Enum["Estonian"] = "et"; | ||
Languages_Enum["Filipino"] = "fil"; | ||
Languages_Enum["Finnish"] = "fi"; | ||
Languages_Enum["French"] = "fr"; | ||
Languages_Enum["Georgian"] = "ka"; | ||
Languages_Enum["German"] = "de"; | ||
Languages_Enum["Greek"] = "el"; | ||
Languages_Enum["Gujarati"] = "gu"; | ||
Languages_Enum["Hausa"] = "ha"; | ||
Languages_Enum["Hebrew"] = "he"; | ||
Languages_Enum["Hindi"] = "hi"; | ||
Languages_Enum["Hungarian"] = "hu"; | ||
Languages_Enum["Indonesian"] = "id"; | ||
Languages_Enum["Irish"] = "ga"; | ||
Languages_Enum["Italian"] = "it"; | ||
Languages_Enum["Japanese"] = "ja"; | ||
Languages_Enum["Kannada"] = "kn"; | ||
Languages_Enum["Kazakh"] = "kk"; | ||
Languages_Enum["Kinyarwanda"] = "rw_RW"; | ||
Languages_Enum["Korean"] = "ko"; | ||
Languages_Enum["Kyrgyz_Kyrgyzstan"] = "ky_KG"; | ||
Languages_Enum["Lao"] = "lo"; | ||
Languages_Enum["Latvian"] = "lv"; | ||
Languages_Enum["Lithuanian"] = "lt"; | ||
Languages_Enum["Macedonian"] = "mk"; | ||
Languages_Enum["Malay"] = "ms"; | ||
Languages_Enum["Malayalam"] = "ml"; | ||
Languages_Enum["Marathi"] = "mr"; | ||
Languages_Enum["Norwegian"] = "nb"; | ||
Languages_Enum["Persian"] = "fa"; | ||
Languages_Enum["Polish"] = "pl"; | ||
Languages_Enum["Portuguese_BR"] = "pt_BR"; | ||
Languages_Enum["Portuguese_POR"] = "pt_PT"; | ||
Languages_Enum["Punjabi"] = "pa"; | ||
Languages_Enum["Romanian"] = "ro"; | ||
Languages_Enum["Russian"] = "ru"; | ||
Languages_Enum["Serbian"] = "sr"; | ||
Languages_Enum["Slovak"] = "sk"; | ||
Languages_Enum["Slovenian"] = "sl"; | ||
Languages_Enum["Spanish"] = "es"; | ||
Languages_Enum["Spanish_ARG"] = "es_AR"; | ||
Languages_Enum["Spanish_SPA"] = "es_ES"; | ||
Languages_Enum["Spanish_MEX"] = "es_MX"; | ||
Languages_Enum["Swahili"] = "sw"; | ||
Languages_Enum["Swedish"] = "sv"; | ||
Languages_Enum["Tamil"] = "ta"; | ||
Languages_Enum["Telugu"] = "te"; | ||
Languages_Enum["Thai"] = "th"; | ||
Languages_Enum["Turkish"] = "tr"; | ||
Languages_Enum["Ukrainian"] = "uk"; | ||
Languages_Enum["Urdu"] = "ur"; | ||
Languages_Enum["Uzbek"] = "uz"; | ||
Languages_Enum["Vietnamese"] = "vi"; | ||
Languages_Enum["Zulu"] = "zu"; | ||
})(Languages_Enum = exports.Languages_Enum || (exports.Languages_Enum = {})); | ||
var Currency_Codes_Enum; | ||
(function (Currency_Codes_Enum) { | ||
Currency_Codes_Enum["AFN"] = "AFN"; | ||
Currency_Codes_Enum["EUR"] = "EUR"; | ||
Currency_Codes_Enum["ALL"] = "ALL"; | ||
Currency_Codes_Enum["DZD"] = "DZD"; | ||
Currency_Codes_Enum["USD"] = "USD"; | ||
Currency_Codes_Enum["AOA"] = "AOA"; | ||
Currency_Codes_Enum["XCD"] = "XCD"; | ||
Currency_Codes_Enum["ARS"] = "ARS"; | ||
Currency_Codes_Enum["AMD"] = "AMD"; | ||
Currency_Codes_Enum["AWG"] = "AWG"; | ||
Currency_Codes_Enum["AUD"] = "AUD"; | ||
Currency_Codes_Enum["AZN"] = "AZN"; | ||
Currency_Codes_Enum["BSD"] = "BSD"; | ||
Currency_Codes_Enum["BHD"] = "BHD"; | ||
Currency_Codes_Enum["BDT"] = "BDT"; | ||
Currency_Codes_Enum["BBD"] = "BBD"; | ||
Currency_Codes_Enum["BYN"] = "BYN"; | ||
Currency_Codes_Enum["BZD"] = "BZD"; | ||
Currency_Codes_Enum["XOF"] = "XOF"; | ||
Currency_Codes_Enum["BMD"] = "BMD"; | ||
Currency_Codes_Enum["INR"] = "INR"; | ||
Currency_Codes_Enum["BTN"] = "BTN"; | ||
Currency_Codes_Enum["BOB"] = "BOB"; | ||
Currency_Codes_Enum["BOV"] = "BOV"; | ||
Currency_Codes_Enum["BAM"] = "BAM"; | ||
Currency_Codes_Enum["BWP"] = "BWP"; | ||
Currency_Codes_Enum["NOK"] = "NOK"; | ||
Currency_Codes_Enum["BRL"] = "BRL"; | ||
Currency_Codes_Enum["BND"] = "BND"; | ||
Currency_Codes_Enum["BGN"] = "BGN"; | ||
Currency_Codes_Enum["BIF"] = "BIF"; | ||
Currency_Codes_Enum["CVE"] = "CVE"; | ||
Currency_Codes_Enum["KHR"] = "KHR"; | ||
Currency_Codes_Enum["XAF"] = "XAF"; | ||
Currency_Codes_Enum["CAD"] = "CAD"; | ||
Currency_Codes_Enum["KYD"] = "KYD"; | ||
Currency_Codes_Enum["CLP"] = "CLP"; | ||
Currency_Codes_Enum["CLF"] = "CLF"; | ||
Currency_Codes_Enum["CNY"] = "CNY"; | ||
Currency_Codes_Enum["COP"] = "COP"; | ||
Currency_Codes_Enum["COU"] = "COU"; | ||
Currency_Codes_Enum["KMF"] = "KMF"; | ||
Currency_Codes_Enum["CDF"] = "CDF"; | ||
Currency_Codes_Enum["NZD"] = "NZD"; | ||
Currency_Codes_Enum["CRC"] = "CRC"; | ||
Currency_Codes_Enum["HRK"] = "HRK"; | ||
Currency_Codes_Enum["CUP"] = "CUP"; | ||
Currency_Codes_Enum["CUC"] = "CUC"; | ||
Currency_Codes_Enum["ANG"] = "ANG"; | ||
Currency_Codes_Enum["CZK"] = "CZK"; | ||
Currency_Codes_Enum["DKK"] = "DKK"; | ||
Currency_Codes_Enum["DJF"] = "DJF"; | ||
Currency_Codes_Enum["DOP"] = "DOP"; | ||
Currency_Codes_Enum["EGP"] = "EGP"; | ||
Currency_Codes_Enum["SVC"] = "SVC"; | ||
Currency_Codes_Enum["ERN"] = "ERN"; | ||
Currency_Codes_Enum["SZL"] = "SZL"; | ||
Currency_Codes_Enum["ETB"] = "ETB"; | ||
Currency_Codes_Enum["FKP"] = "FKP"; | ||
Currency_Codes_Enum["FJD"] = "FJD"; | ||
Currency_Codes_Enum["XPF"] = "XPF"; | ||
Currency_Codes_Enum["GMD"] = "GMD"; | ||
Currency_Codes_Enum["GEL"] = "GEL"; | ||
Currency_Codes_Enum["GHS"] = "GHS"; | ||
Currency_Codes_Enum["GIP"] = "GIP"; | ||
Currency_Codes_Enum["GTQ"] = "GTQ"; | ||
Currency_Codes_Enum["GBP"] = "GBP"; | ||
Currency_Codes_Enum["GNF"] = "GNF"; | ||
Currency_Codes_Enum["GYD"] = "GYD"; | ||
Currency_Codes_Enum["HTG"] = "HTG"; | ||
Currency_Codes_Enum["HNL"] = "HNL"; | ||
Currency_Codes_Enum["HKD"] = "HKD"; | ||
Currency_Codes_Enum["HUF"] = "HUF"; | ||
Currency_Codes_Enum["ISK"] = "ISK"; | ||
Currency_Codes_Enum["IDR"] = "IDR"; | ||
Currency_Codes_Enum["XDR"] = "XDR"; | ||
Currency_Codes_Enum["IRR"] = "IRR"; | ||
Currency_Codes_Enum["IQD"] = "IQD"; | ||
Currency_Codes_Enum["ILS"] = "ILS"; | ||
Currency_Codes_Enum["JMD"] = "JMD"; | ||
Currency_Codes_Enum["JPY"] = "JPY"; | ||
Currency_Codes_Enum["JOD"] = "JOD"; | ||
Currency_Codes_Enum["KZT"] = "KZT"; | ||
Currency_Codes_Enum["KES"] = "KES"; | ||
Currency_Codes_Enum["KPW"] = "KPW"; | ||
Currency_Codes_Enum["KRW"] = "KRW"; | ||
Currency_Codes_Enum["KWD"] = "KWD"; | ||
Currency_Codes_Enum["KGS"] = "KGS"; | ||
Currency_Codes_Enum["LAK"] = "LAK"; | ||
Currency_Codes_Enum["LBP"] = "LBP"; | ||
Currency_Codes_Enum["LSL"] = "LSL"; | ||
Currency_Codes_Enum["ZAR"] = "ZAR"; | ||
Currency_Codes_Enum["LRD"] = "LRD"; | ||
Currency_Codes_Enum["LYD"] = "LYD"; | ||
Currency_Codes_Enum["CHF"] = "CHF"; | ||
Currency_Codes_Enum["MOP"] = "MOP"; | ||
Currency_Codes_Enum["MKD"] = "MKD"; | ||
Currency_Codes_Enum["MGA"] = "MGA"; | ||
Currency_Codes_Enum["MWK"] = "MWK"; | ||
Currency_Codes_Enum["MYR"] = "MYR"; | ||
Currency_Codes_Enum["MVR"] = "MVR"; | ||
Currency_Codes_Enum["MRU"] = "MRU"; | ||
Currency_Codes_Enum["MUR"] = "MUR"; | ||
Currency_Codes_Enum["XUA"] = "XUA"; | ||
Currency_Codes_Enum["MXN"] = "MXN"; | ||
Currency_Codes_Enum["MXV"] = "MXV"; | ||
Currency_Codes_Enum["MDL"] = "MDL"; | ||
Currency_Codes_Enum["MNT"] = "MNT"; | ||
Currency_Codes_Enum["MAD"] = "MAD"; | ||
Currency_Codes_Enum["MZN"] = "MZN"; | ||
Currency_Codes_Enum["MMK"] = "MMK"; | ||
Currency_Codes_Enum["NAD"] = "NAD"; | ||
Currency_Codes_Enum["NPR"] = "NPR"; | ||
Currency_Codes_Enum["NIO"] = "NIO"; | ||
Currency_Codes_Enum["NGN"] = "NGN"; | ||
Currency_Codes_Enum["OMR"] = "OMR"; | ||
Currency_Codes_Enum["PKR"] = "PKR"; | ||
Currency_Codes_Enum["PAB"] = "PAB"; | ||
Currency_Codes_Enum["PGK"] = "PGK"; | ||
Currency_Codes_Enum["PYG"] = "PYG"; | ||
Currency_Codes_Enum["PEN"] = "PEN"; | ||
Currency_Codes_Enum["PHP"] = "PHP"; | ||
Currency_Codes_Enum["PLN"] = "PLN"; | ||
Currency_Codes_Enum["QAR"] = "QAR"; | ||
Currency_Codes_Enum["RON"] = "RON"; | ||
Currency_Codes_Enum["RUB"] = "RUB"; | ||
Currency_Codes_Enum["RWF"] = "RWF"; | ||
Currency_Codes_Enum["SHP"] = "SHP"; | ||
Currency_Codes_Enum["WST"] = "WST"; | ||
Currency_Codes_Enum["STN"] = "STN"; | ||
Currency_Codes_Enum["SAR"] = "SAR"; | ||
Currency_Codes_Enum["RSD"] = "RSD"; | ||
Currency_Codes_Enum["SCR"] = "SCR"; | ||
Currency_Codes_Enum["SLL"] = "SLL"; | ||
Currency_Codes_Enum["SGD"] = "SGD"; | ||
Currency_Codes_Enum["XSU"] = "XSU"; | ||
Currency_Codes_Enum["SBD"] = "SBD"; | ||
Currency_Codes_Enum["SOS"] = "SOS"; | ||
Currency_Codes_Enum["SSP"] = "SSP"; | ||
Currency_Codes_Enum["LKR"] = "LKR"; | ||
Currency_Codes_Enum["SDG"] = "SDG"; | ||
Currency_Codes_Enum["SRD"] = "SRD"; | ||
Currency_Codes_Enum["SEK"] = "SEK"; | ||
Currency_Codes_Enum["CHE"] = "CHE"; | ||
Currency_Codes_Enum["CHW"] = "CHW"; | ||
Currency_Codes_Enum["SYP"] = "SYP"; | ||
Currency_Codes_Enum["TWD"] = "TWD"; | ||
Currency_Codes_Enum["TJS"] = "TJS"; | ||
Currency_Codes_Enum["TZS"] = "TZS"; | ||
Currency_Codes_Enum["THB"] = "THB"; | ||
Currency_Codes_Enum["TOP"] = "TOP"; | ||
Currency_Codes_Enum["TTD"] = "TTD"; | ||
Currency_Codes_Enum["TND"] = "TND"; | ||
Currency_Codes_Enum["TRY"] = "TRY"; | ||
Currency_Codes_Enum["TMT"] = "TMT"; | ||
Currency_Codes_Enum["UGX"] = "UGX"; | ||
Currency_Codes_Enum["UAH"] = "UAH"; | ||
Currency_Codes_Enum["AED"] = "AED"; | ||
Currency_Codes_Enum["USN"] = "USN"; | ||
Currency_Codes_Enum["UYU"] = "UYU"; | ||
Currency_Codes_Enum["UYI"] = "UYI"; | ||
Currency_Codes_Enum["UYW"] = "UYW"; | ||
Currency_Codes_Enum["UZS"] = "UZS"; | ||
Currency_Codes_Enum["VUV"] = "VUV"; | ||
Currency_Codes_Enum["VES"] = "VES"; | ||
Currency_Codes_Enum["VND"] = "VND"; | ||
Currency_Codes_Enum["YER"] = "YER"; | ||
Currency_Codes_Enum["ZMW"] = "ZMW"; | ||
Currency_Codes_Enum["ZWL"] = "ZWL"; | ||
Currency_Codes_Enum["XBA"] = "XBA"; | ||
Currency_Codes_Enum["XBB"] = "XBB"; | ||
Currency_Codes_Enum["XBC"] = "XBC"; | ||
Currency_Codes_Enum["XBD"] = "XBD"; | ||
Currency_Codes_Enum["XTS"] = "XTS"; | ||
Currency_Codes_Enum["XXX"] = "XXX"; | ||
Currency_Codes_Enum["XAU"] = "XAU"; | ||
Currency_Codes_Enum["XPD"] = "XPD"; | ||
Currency_Codes_Enum["XPT"] = "XPT"; | ||
Currency_Codes_Enum["XAG"] = "XAG"; | ||
Currency_Codes_Enum["AFA"] = "AFA"; | ||
Currency_Codes_Enum["FIM"] = "FIM"; | ||
Currency_Codes_Enum["ALK"] = "ALK"; | ||
Currency_Codes_Enum["ADP"] = "ADP"; | ||
Currency_Codes_Enum["ESP"] = "ESP"; | ||
Currency_Codes_Enum["FRF"] = "FRF"; | ||
Currency_Codes_Enum["AOK"] = "AOK"; | ||
Currency_Codes_Enum["AON"] = "AON"; | ||
Currency_Codes_Enum["AOR"] = "AOR"; | ||
Currency_Codes_Enum["ARA"] = "ARA"; | ||
Currency_Codes_Enum["ARP"] = "ARP"; | ||
Currency_Codes_Enum["ARY"] = "ARY"; | ||
Currency_Codes_Enum["RUR"] = "RUR"; | ||
Currency_Codes_Enum["ATS"] = "ATS"; | ||
Currency_Codes_Enum["AYM"] = "AYM"; | ||
Currency_Codes_Enum["AZM"] = "AZM"; | ||
Currency_Codes_Enum["BYB"] = "BYB"; | ||
Currency_Codes_Enum["BYR"] = "BYR"; | ||
Currency_Codes_Enum["BEC"] = "BEC"; | ||
Currency_Codes_Enum["BEF"] = "BEF"; | ||
Currency_Codes_Enum["BEL"] = "BEL"; | ||
Currency_Codes_Enum["BOP"] = "BOP"; | ||
Currency_Codes_Enum["BAD"] = "BAD"; | ||
Currency_Codes_Enum["BRB"] = "BRB"; | ||
Currency_Codes_Enum["BRC"] = "BRC"; | ||
Currency_Codes_Enum["BRE"] = "BRE"; | ||
Currency_Codes_Enum["BRN"] = "BRN"; | ||
Currency_Codes_Enum["BRR"] = "BRR"; | ||
Currency_Codes_Enum["BGJ"] = "BGJ"; | ||
Currency_Codes_Enum["BGK"] = "BGK"; | ||
Currency_Codes_Enum["BGL"] = "BGL"; | ||
Currency_Codes_Enum["BUK"] = "BUK"; | ||
Currency_Codes_Enum["HRD"] = "HRD"; | ||
Currency_Codes_Enum["CYP"] = "CYP"; | ||
Currency_Codes_Enum["CSJ"] = "CSJ"; | ||
Currency_Codes_Enum["CSK"] = "CSK"; | ||
Currency_Codes_Enum["ECS"] = "ECS"; | ||
Currency_Codes_Enum["ECV"] = "ECV"; | ||
Currency_Codes_Enum["GQE"] = "GQE"; | ||
Currency_Codes_Enum["EEK"] = "EEK"; | ||
Currency_Codes_Enum["XEU"] = "XEU"; | ||
Currency_Codes_Enum["GEK"] = "GEK"; | ||
Currency_Codes_Enum["DDM"] = "DDM"; | ||
Currency_Codes_Enum["DEM"] = "DEM"; | ||
Currency_Codes_Enum["GHC"] = "GHC"; | ||
Currency_Codes_Enum["GHP"] = "GHP"; | ||
Currency_Codes_Enum["GRD"] = "GRD"; | ||
Currency_Codes_Enum["GNE"] = "GNE"; | ||
Currency_Codes_Enum["GNS"] = "GNS"; | ||
Currency_Codes_Enum["GWE"] = "GWE"; | ||
Currency_Codes_Enum["GWP"] = "GWP"; | ||
Currency_Codes_Enum["ITL"] = "ITL"; | ||
Currency_Codes_Enum["ISJ"] = "ISJ"; | ||
Currency_Codes_Enum["IEP"] = "IEP"; | ||
Currency_Codes_Enum["ILP"] = "ILP"; | ||
Currency_Codes_Enum["ILR"] = "ILR"; | ||
Currency_Codes_Enum["LAJ"] = "LAJ"; | ||
Currency_Codes_Enum["LVL"] = "LVL"; | ||
Currency_Codes_Enum["LVR"] = "LVR"; | ||
Currency_Codes_Enum["LSM"] = "LSM"; | ||
Currency_Codes_Enum["ZAL"] = "ZAL"; | ||
Currency_Codes_Enum["LTL"] = "LTL"; | ||
Currency_Codes_Enum["LTT"] = "LTT"; | ||
Currency_Codes_Enum["LUC"] = "LUC"; | ||
Currency_Codes_Enum["LUF"] = "LUF"; | ||
Currency_Codes_Enum["LUL"] = "LUL"; | ||
Currency_Codes_Enum["MGF"] = "MGF"; | ||
Currency_Codes_Enum["MVQ"] = "MVQ"; | ||
Currency_Codes_Enum["MLF"] = "MLF"; | ||
Currency_Codes_Enum["MTL"] = "MTL"; | ||
Currency_Codes_Enum["MTP"] = "MTP"; | ||
Currency_Codes_Enum["MRO"] = "MRO"; | ||
Currency_Codes_Enum["MXP"] = "MXP"; | ||
Currency_Codes_Enum["MZE"] = "MZE"; | ||
Currency_Codes_Enum["MZM"] = "MZM"; | ||
Currency_Codes_Enum["NLG"] = "NLG"; | ||
Currency_Codes_Enum["NIC"] = "NIC"; | ||
Currency_Codes_Enum["PEH"] = "PEH"; | ||
Currency_Codes_Enum["PEI"] = "PEI"; | ||
Currency_Codes_Enum["PES"] = "PES"; | ||
Currency_Codes_Enum["PLZ"] = "PLZ"; | ||
Currency_Codes_Enum["PTE"] = "PTE"; | ||
Currency_Codes_Enum["ROK"] = "ROK"; | ||
Currency_Codes_Enum["ROL"] = "ROL"; | ||
Currency_Codes_Enum["STD"] = "STD"; | ||
Currency_Codes_Enum["CSD"] = "CSD"; | ||
Currency_Codes_Enum["SKK"] = "SKK"; | ||
Currency_Codes_Enum["SIT"] = "SIT"; | ||
Currency_Codes_Enum["RHD"] = "RHD"; | ||
Currency_Codes_Enum["ESA"] = "ESA"; | ||
Currency_Codes_Enum["ESB"] = "ESB"; | ||
Currency_Codes_Enum["SDD"] = "SDD"; | ||
Currency_Codes_Enum["SDP"] = "SDP"; | ||
Currency_Codes_Enum["SRG"] = "SRG"; | ||
Currency_Codes_Enum["CHC"] = "CHC"; | ||
Currency_Codes_Enum["TJR"] = "TJR"; | ||
Currency_Codes_Enum["TPE"] = "TPE"; | ||
Currency_Codes_Enum["TRL"] = "TRL"; | ||
Currency_Codes_Enum["TMM"] = "TMM"; | ||
Currency_Codes_Enum["UGS"] = "UGS"; | ||
Currency_Codes_Enum["UGW"] = "UGW"; | ||
Currency_Codes_Enum["UAK"] = "UAK"; | ||
Currency_Codes_Enum["SUR"] = "SUR"; | ||
Currency_Codes_Enum["USS"] = "USS"; | ||
Currency_Codes_Enum["UYN"] = "UYN"; | ||
Currency_Codes_Enum["UYP"] = "UYP"; | ||
Currency_Codes_Enum["VEB"] = "VEB"; | ||
Currency_Codes_Enum["VEF"] = "VEF"; | ||
Currency_Codes_Enum["VNC"] = "VNC"; | ||
Currency_Codes_Enum["YDD"] = "YDD"; | ||
Currency_Codes_Enum["YUD"] = "YUD"; | ||
Currency_Codes_Enum["YUM"] = "YUM"; | ||
Currency_Codes_Enum["YUN"] = "YUN"; | ||
Currency_Codes_Enum["ZRN"] = "ZRN"; | ||
Currency_Codes_Enum["ZRZ"] = "ZRZ"; | ||
Currency_Codes_Enum["ZMK"] = "ZMK"; | ||
Currency_Codes_Enum["ZWC"] = "ZWC"; | ||
Currency_Codes_Enum["ZWD"] = "ZWD"; | ||
Currency_Codes_Enum["ZWN"] = "ZWN"; | ||
Currency_Codes_Enum["ZWR"] = "ZWR"; | ||
Currency_Codes_Enum["XFO"] = "XFO"; | ||
Currency_Codes_Enum["XRE"] = "XRE"; | ||
Currency_Codes_Enum["XFU"] = "XFU"; | ||
})(Currency_Codes_Enum = exports.Currency_Codes_Enum || (exports.Currency_Codes_Enum = {})); | ||
//# sourceMappingURL=enums.js.map | ||
Currency_Codes_Enum["AFN"] = "AFN"; | ||
Currency_Codes_Enum["EUR"] = "EUR"; | ||
Currency_Codes_Enum["ALL"] = "ALL"; | ||
Currency_Codes_Enum["DZD"] = "DZD"; | ||
Currency_Codes_Enum["USD"] = "USD"; | ||
Currency_Codes_Enum["AOA"] = "AOA"; | ||
Currency_Codes_Enum["XCD"] = "XCD"; | ||
Currency_Codes_Enum["ARS"] = "ARS"; | ||
Currency_Codes_Enum["AMD"] = "AMD"; | ||
Currency_Codes_Enum["AWG"] = "AWG"; | ||
Currency_Codes_Enum["AUD"] = "AUD"; | ||
Currency_Codes_Enum["AZN"] = "AZN"; | ||
Currency_Codes_Enum["BSD"] = "BSD"; | ||
Currency_Codes_Enum["BHD"] = "BHD"; | ||
Currency_Codes_Enum["BDT"] = "BDT"; | ||
Currency_Codes_Enum["BBD"] = "BBD"; | ||
Currency_Codes_Enum["BYN"] = "BYN"; | ||
Currency_Codes_Enum["BZD"] = "BZD"; | ||
Currency_Codes_Enum["XOF"] = "XOF"; | ||
Currency_Codes_Enum["BMD"] = "BMD"; | ||
Currency_Codes_Enum["INR"] = "INR"; | ||
Currency_Codes_Enum["BTN"] = "BTN"; | ||
Currency_Codes_Enum["BOB"] = "BOB"; | ||
Currency_Codes_Enum["BOV"] = "BOV"; | ||
Currency_Codes_Enum["BAM"] = "BAM"; | ||
Currency_Codes_Enum["BWP"] = "BWP"; | ||
Currency_Codes_Enum["NOK"] = "NOK"; | ||
Currency_Codes_Enum["BRL"] = "BRL"; | ||
Currency_Codes_Enum["BND"] = "BND"; | ||
Currency_Codes_Enum["BGN"] = "BGN"; | ||
Currency_Codes_Enum["BIF"] = "BIF"; | ||
Currency_Codes_Enum["CVE"] = "CVE"; | ||
Currency_Codes_Enum["KHR"] = "KHR"; | ||
Currency_Codes_Enum["XAF"] = "XAF"; | ||
Currency_Codes_Enum["CAD"] = "CAD"; | ||
Currency_Codes_Enum["KYD"] = "KYD"; | ||
Currency_Codes_Enum["CLP"] = "CLP"; | ||
Currency_Codes_Enum["CLF"] = "CLF"; | ||
Currency_Codes_Enum["CNY"] = "CNY"; | ||
Currency_Codes_Enum["COP"] = "COP"; | ||
Currency_Codes_Enum["COU"] = "COU"; | ||
Currency_Codes_Enum["KMF"] = "KMF"; | ||
Currency_Codes_Enum["CDF"] = "CDF"; | ||
Currency_Codes_Enum["NZD"] = "NZD"; | ||
Currency_Codes_Enum["CRC"] = "CRC"; | ||
Currency_Codes_Enum["HRK"] = "HRK"; | ||
Currency_Codes_Enum["CUP"] = "CUP"; | ||
Currency_Codes_Enum["CUC"] = "CUC"; | ||
Currency_Codes_Enum["ANG"] = "ANG"; | ||
Currency_Codes_Enum["CZK"] = "CZK"; | ||
Currency_Codes_Enum["DKK"] = "DKK"; | ||
Currency_Codes_Enum["DJF"] = "DJF"; | ||
Currency_Codes_Enum["DOP"] = "DOP"; | ||
Currency_Codes_Enum["EGP"] = "EGP"; | ||
Currency_Codes_Enum["SVC"] = "SVC"; | ||
Currency_Codes_Enum["ERN"] = "ERN"; | ||
Currency_Codes_Enum["SZL"] = "SZL"; | ||
Currency_Codes_Enum["ETB"] = "ETB"; | ||
Currency_Codes_Enum["FKP"] = "FKP"; | ||
Currency_Codes_Enum["FJD"] = "FJD"; | ||
Currency_Codes_Enum["XPF"] = "XPF"; | ||
Currency_Codes_Enum["GMD"] = "GMD"; | ||
Currency_Codes_Enum["GEL"] = "GEL"; | ||
Currency_Codes_Enum["GHS"] = "GHS"; | ||
Currency_Codes_Enum["GIP"] = "GIP"; | ||
Currency_Codes_Enum["GTQ"] = "GTQ"; | ||
Currency_Codes_Enum["GBP"] = "GBP"; | ||
Currency_Codes_Enum["GNF"] = "GNF"; | ||
Currency_Codes_Enum["GYD"] = "GYD"; | ||
Currency_Codes_Enum["HTG"] = "HTG"; | ||
Currency_Codes_Enum["HNL"] = "HNL"; | ||
Currency_Codes_Enum["HKD"] = "HKD"; | ||
Currency_Codes_Enum["HUF"] = "HUF"; | ||
Currency_Codes_Enum["ISK"] = "ISK"; | ||
Currency_Codes_Enum["IDR"] = "IDR"; | ||
Currency_Codes_Enum["XDR"] = "XDR"; | ||
Currency_Codes_Enum["IRR"] = "IRR"; | ||
Currency_Codes_Enum["IQD"] = "IQD"; | ||
Currency_Codes_Enum["ILS"] = "ILS"; | ||
Currency_Codes_Enum["JMD"] = "JMD"; | ||
Currency_Codes_Enum["JPY"] = "JPY"; | ||
Currency_Codes_Enum["JOD"] = "JOD"; | ||
Currency_Codes_Enum["KZT"] = "KZT"; | ||
Currency_Codes_Enum["KES"] = "KES"; | ||
Currency_Codes_Enum["KPW"] = "KPW"; | ||
Currency_Codes_Enum["KRW"] = "KRW"; | ||
Currency_Codes_Enum["KWD"] = "KWD"; | ||
Currency_Codes_Enum["KGS"] = "KGS"; | ||
Currency_Codes_Enum["LAK"] = "LAK"; | ||
Currency_Codes_Enum["LBP"] = "LBP"; | ||
Currency_Codes_Enum["LSL"] = "LSL"; | ||
Currency_Codes_Enum["ZAR"] = "ZAR"; | ||
Currency_Codes_Enum["LRD"] = "LRD"; | ||
Currency_Codes_Enum["LYD"] = "LYD"; | ||
Currency_Codes_Enum["CHF"] = "CHF"; | ||
Currency_Codes_Enum["MOP"] = "MOP"; | ||
Currency_Codes_Enum["MKD"] = "MKD"; | ||
Currency_Codes_Enum["MGA"] = "MGA"; | ||
Currency_Codes_Enum["MWK"] = "MWK"; | ||
Currency_Codes_Enum["MYR"] = "MYR"; | ||
Currency_Codes_Enum["MVR"] = "MVR"; | ||
Currency_Codes_Enum["MRU"] = "MRU"; | ||
Currency_Codes_Enum["MUR"] = "MUR"; | ||
Currency_Codes_Enum["XUA"] = "XUA"; | ||
Currency_Codes_Enum["MXN"] = "MXN"; | ||
Currency_Codes_Enum["MXV"] = "MXV"; | ||
Currency_Codes_Enum["MDL"] = "MDL"; | ||
Currency_Codes_Enum["MNT"] = "MNT"; | ||
Currency_Codes_Enum["MAD"] = "MAD"; | ||
Currency_Codes_Enum["MZN"] = "MZN"; | ||
Currency_Codes_Enum["MMK"] = "MMK"; | ||
Currency_Codes_Enum["NAD"] = "NAD"; | ||
Currency_Codes_Enum["NPR"] = "NPR"; | ||
Currency_Codes_Enum["NIO"] = "NIO"; | ||
Currency_Codes_Enum["NGN"] = "NGN"; | ||
Currency_Codes_Enum["OMR"] = "OMR"; | ||
Currency_Codes_Enum["PKR"] = "PKR"; | ||
Currency_Codes_Enum["PAB"] = "PAB"; | ||
Currency_Codes_Enum["PGK"] = "PGK"; | ||
Currency_Codes_Enum["PYG"] = "PYG"; | ||
Currency_Codes_Enum["PEN"] = "PEN"; | ||
Currency_Codes_Enum["PHP"] = "PHP"; | ||
Currency_Codes_Enum["PLN"] = "PLN"; | ||
Currency_Codes_Enum["QAR"] = "QAR"; | ||
Currency_Codes_Enum["RON"] = "RON"; | ||
Currency_Codes_Enum["RUB"] = "RUB"; | ||
Currency_Codes_Enum["RWF"] = "RWF"; | ||
Currency_Codes_Enum["SHP"] = "SHP"; | ||
Currency_Codes_Enum["WST"] = "WST"; | ||
Currency_Codes_Enum["STN"] = "STN"; | ||
Currency_Codes_Enum["SAR"] = "SAR"; | ||
Currency_Codes_Enum["RSD"] = "RSD"; | ||
Currency_Codes_Enum["SCR"] = "SCR"; | ||
Currency_Codes_Enum["SLL"] = "SLL"; | ||
Currency_Codes_Enum["SGD"] = "SGD"; | ||
Currency_Codes_Enum["XSU"] = "XSU"; | ||
Currency_Codes_Enum["SBD"] = "SBD"; | ||
Currency_Codes_Enum["SOS"] = "SOS"; | ||
Currency_Codes_Enum["SSP"] = "SSP"; | ||
Currency_Codes_Enum["LKR"] = "LKR"; | ||
Currency_Codes_Enum["SDG"] = "SDG"; | ||
Currency_Codes_Enum["SRD"] = "SRD"; | ||
Currency_Codes_Enum["SEK"] = "SEK"; | ||
Currency_Codes_Enum["CHE"] = "CHE"; | ||
Currency_Codes_Enum["CHW"] = "CHW"; | ||
Currency_Codes_Enum["SYP"] = "SYP"; | ||
Currency_Codes_Enum["TWD"] = "TWD"; | ||
Currency_Codes_Enum["TJS"] = "TJS"; | ||
Currency_Codes_Enum["TZS"] = "TZS"; | ||
Currency_Codes_Enum["THB"] = "THB"; | ||
Currency_Codes_Enum["TOP"] = "TOP"; | ||
Currency_Codes_Enum["TTD"] = "TTD"; | ||
Currency_Codes_Enum["TND"] = "TND"; | ||
Currency_Codes_Enum["TRY"] = "TRY"; | ||
Currency_Codes_Enum["TMT"] = "TMT"; | ||
Currency_Codes_Enum["UGX"] = "UGX"; | ||
Currency_Codes_Enum["UAH"] = "UAH"; | ||
Currency_Codes_Enum["AED"] = "AED"; | ||
Currency_Codes_Enum["USN"] = "USN"; | ||
Currency_Codes_Enum["UYU"] = "UYU"; | ||
Currency_Codes_Enum["UYI"] = "UYI"; | ||
Currency_Codes_Enum["UYW"] = "UYW"; | ||
Currency_Codes_Enum["UZS"] = "UZS"; | ||
Currency_Codes_Enum["VUV"] = "VUV"; | ||
Currency_Codes_Enum["VES"] = "VES"; | ||
Currency_Codes_Enum["VND"] = "VND"; | ||
Currency_Codes_Enum["YER"] = "YER"; | ||
Currency_Codes_Enum["ZMW"] = "ZMW"; | ||
Currency_Codes_Enum["ZWL"] = "ZWL"; | ||
Currency_Codes_Enum["XBA"] = "XBA"; | ||
Currency_Codes_Enum["XBB"] = "XBB"; | ||
Currency_Codes_Enum["XBC"] = "XBC"; | ||
Currency_Codes_Enum["XBD"] = "XBD"; | ||
Currency_Codes_Enum["XTS"] = "XTS"; | ||
Currency_Codes_Enum["XXX"] = "XXX"; | ||
Currency_Codes_Enum["XAU"] = "XAU"; | ||
Currency_Codes_Enum["XPD"] = "XPD"; | ||
Currency_Codes_Enum["XPT"] = "XPT"; | ||
Currency_Codes_Enum["XAG"] = "XAG"; | ||
Currency_Codes_Enum["AFA"] = "AFA"; | ||
Currency_Codes_Enum["FIM"] = "FIM"; | ||
Currency_Codes_Enum["ALK"] = "ALK"; | ||
Currency_Codes_Enum["ADP"] = "ADP"; | ||
Currency_Codes_Enum["ESP"] = "ESP"; | ||
Currency_Codes_Enum["FRF"] = "FRF"; | ||
Currency_Codes_Enum["AOK"] = "AOK"; | ||
Currency_Codes_Enum["AON"] = "AON"; | ||
Currency_Codes_Enum["AOR"] = "AOR"; | ||
Currency_Codes_Enum["ARA"] = "ARA"; | ||
Currency_Codes_Enum["ARP"] = "ARP"; | ||
Currency_Codes_Enum["ARY"] = "ARY"; | ||
Currency_Codes_Enum["RUR"] = "RUR"; | ||
Currency_Codes_Enum["ATS"] = "ATS"; | ||
Currency_Codes_Enum["AYM"] = "AYM"; | ||
Currency_Codes_Enum["AZM"] = "AZM"; | ||
Currency_Codes_Enum["BYB"] = "BYB"; | ||
Currency_Codes_Enum["BYR"] = "BYR"; | ||
Currency_Codes_Enum["BEC"] = "BEC"; | ||
Currency_Codes_Enum["BEF"] = "BEF"; | ||
Currency_Codes_Enum["BEL"] = "BEL"; | ||
Currency_Codes_Enum["BOP"] = "BOP"; | ||
Currency_Codes_Enum["BAD"] = "BAD"; | ||
Currency_Codes_Enum["BRB"] = "BRB"; | ||
Currency_Codes_Enum["BRC"] = "BRC"; | ||
Currency_Codes_Enum["BRE"] = "BRE"; | ||
Currency_Codes_Enum["BRN"] = "BRN"; | ||
Currency_Codes_Enum["BRR"] = "BRR"; | ||
Currency_Codes_Enum["BGJ"] = "BGJ"; | ||
Currency_Codes_Enum["BGK"] = "BGK"; | ||
Currency_Codes_Enum["BGL"] = "BGL"; | ||
Currency_Codes_Enum["BUK"] = "BUK"; | ||
Currency_Codes_Enum["HRD"] = "HRD"; | ||
Currency_Codes_Enum["CYP"] = "CYP"; | ||
Currency_Codes_Enum["CSJ"] = "CSJ"; | ||
Currency_Codes_Enum["CSK"] = "CSK"; | ||
Currency_Codes_Enum["ECS"] = "ECS"; | ||
Currency_Codes_Enum["ECV"] = "ECV"; | ||
Currency_Codes_Enum["GQE"] = "GQE"; | ||
Currency_Codes_Enum["EEK"] = "EEK"; | ||
Currency_Codes_Enum["XEU"] = "XEU"; | ||
Currency_Codes_Enum["GEK"] = "GEK"; | ||
Currency_Codes_Enum["DDM"] = "DDM"; | ||
Currency_Codes_Enum["DEM"] = "DEM"; | ||
Currency_Codes_Enum["GHC"] = "GHC"; | ||
Currency_Codes_Enum["GHP"] = "GHP"; | ||
Currency_Codes_Enum["GRD"] = "GRD"; | ||
Currency_Codes_Enum["GNE"] = "GNE"; | ||
Currency_Codes_Enum["GNS"] = "GNS"; | ||
Currency_Codes_Enum["GWE"] = "GWE"; | ||
Currency_Codes_Enum["GWP"] = "GWP"; | ||
Currency_Codes_Enum["ITL"] = "ITL"; | ||
Currency_Codes_Enum["ISJ"] = "ISJ"; | ||
Currency_Codes_Enum["IEP"] = "IEP"; | ||
Currency_Codes_Enum["ILP"] = "ILP"; | ||
Currency_Codes_Enum["ILR"] = "ILR"; | ||
Currency_Codes_Enum["LAJ"] = "LAJ"; | ||
Currency_Codes_Enum["LVL"] = "LVL"; | ||
Currency_Codes_Enum["LVR"] = "LVR"; | ||
Currency_Codes_Enum["LSM"] = "LSM"; | ||
Currency_Codes_Enum["ZAL"] = "ZAL"; | ||
Currency_Codes_Enum["LTL"] = "LTL"; | ||
Currency_Codes_Enum["LTT"] = "LTT"; | ||
Currency_Codes_Enum["LUC"] = "LUC"; | ||
Currency_Codes_Enum["LUF"] = "LUF"; | ||
Currency_Codes_Enum["LUL"] = "LUL"; | ||
Currency_Codes_Enum["MGF"] = "MGF"; | ||
Currency_Codes_Enum["MVQ"] = "MVQ"; | ||
Currency_Codes_Enum["MLF"] = "MLF"; | ||
Currency_Codes_Enum["MTL"] = "MTL"; | ||
Currency_Codes_Enum["MTP"] = "MTP"; | ||
Currency_Codes_Enum["MRO"] = "MRO"; | ||
Currency_Codes_Enum["MXP"] = "MXP"; | ||
Currency_Codes_Enum["MZE"] = "MZE"; | ||
Currency_Codes_Enum["MZM"] = "MZM"; | ||
Currency_Codes_Enum["NLG"] = "NLG"; | ||
Currency_Codes_Enum["NIC"] = "NIC"; | ||
Currency_Codes_Enum["PEH"] = "PEH"; | ||
Currency_Codes_Enum["PEI"] = "PEI"; | ||
Currency_Codes_Enum["PES"] = "PES"; | ||
Currency_Codes_Enum["PLZ"] = "PLZ"; | ||
Currency_Codes_Enum["PTE"] = "PTE"; | ||
Currency_Codes_Enum["ROK"] = "ROK"; | ||
Currency_Codes_Enum["ROL"] = "ROL"; | ||
Currency_Codes_Enum["STD"] = "STD"; | ||
Currency_Codes_Enum["CSD"] = "CSD"; | ||
Currency_Codes_Enum["SKK"] = "SKK"; | ||
Currency_Codes_Enum["SIT"] = "SIT"; | ||
Currency_Codes_Enum["RHD"] = "RHD"; | ||
Currency_Codes_Enum["ESA"] = "ESA"; | ||
Currency_Codes_Enum["ESB"] = "ESB"; | ||
Currency_Codes_Enum["SDD"] = "SDD"; | ||
Currency_Codes_Enum["SDP"] = "SDP"; | ||
Currency_Codes_Enum["SRG"] = "SRG"; | ||
Currency_Codes_Enum["CHC"] = "CHC"; | ||
Currency_Codes_Enum["TJR"] = "TJR"; | ||
Currency_Codes_Enum["TPE"] = "TPE"; | ||
Currency_Codes_Enum["TRL"] = "TRL"; | ||
Currency_Codes_Enum["TMM"] = "TMM"; | ||
Currency_Codes_Enum["UGS"] = "UGS"; | ||
Currency_Codes_Enum["UGW"] = "UGW"; | ||
Currency_Codes_Enum["UAK"] = "UAK"; | ||
Currency_Codes_Enum["SUR"] = "SUR"; | ||
Currency_Codes_Enum["USS"] = "USS"; | ||
Currency_Codes_Enum["UYN"] = "UYN"; | ||
Currency_Codes_Enum["UYP"] = "UYP"; | ||
Currency_Codes_Enum["VEB"] = "VEB"; | ||
Currency_Codes_Enum["VEF"] = "VEF"; | ||
Currency_Codes_Enum["VNC"] = "VNC"; | ||
Currency_Codes_Enum["YDD"] = "YDD"; | ||
Currency_Codes_Enum["YUD"] = "YUD"; | ||
Currency_Codes_Enum["YUM"] = "YUM"; | ||
Currency_Codes_Enum["YUN"] = "YUN"; | ||
Currency_Codes_Enum["ZRN"] = "ZRN"; | ||
Currency_Codes_Enum["ZRZ"] = "ZRZ"; | ||
Currency_Codes_Enum["ZMK"] = "ZMK"; | ||
Currency_Codes_Enum["ZWC"] = "ZWC"; | ||
Currency_Codes_Enum["ZWD"] = "ZWD"; | ||
Currency_Codes_Enum["ZWN"] = "ZWN"; | ||
Currency_Codes_Enum["ZWR"] = "ZWR"; | ||
Currency_Codes_Enum["XFO"] = "XFO"; | ||
Currency_Codes_Enum["XRE"] = "XRE"; | ||
Currency_Codes_Enum["XFU"] = "XFU"; | ||
})(Currency_Codes_Enum = exports.Currency_Codes_Enum || (exports.Currency_Codes_Enum = {})); |
"use strict"; | ||
/** | ||
@@ -9,7 +10,45 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
} : function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { | ||
Object.defineProperty(o, "default", { | ||
enumerable: true, | ||
value: v | ||
}); | ||
} : function (o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = this && this.__importStar || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.generate_x_hub_256_sig = exports.import_config = void 0; | ||
const crypto = require("crypto"); | ||
const crypto = __importStar(require("crypto")); | ||
const enums_1 = require("./types/enums"); | ||
const logger_1 = require("./logger"); | ||
const logger_1 = __importDefault(require("./logger")); | ||
const lib_name = 'UTILS'; | ||
@@ -22,47 +61,39 @@ const log_local = false; | ||
const default_request_timeout = 20000; | ||
const empty_config_checker = (sender_number_id) => { | ||
if ((process.env.WA_PHONE_NUMBER_ID === undefined || | ||
process.env.WA_PHONE_NUMBER_ID === '') && | ||
sender_number_id == undefined) { | ||
logger.log(`Environmental variable: WA_PHONE_NUMBER_ID and/or sender phone number id arguement is undefined.`); | ||
throw new Error('Missing WhatsApp sender phone number Id.'); | ||
const empty_config_checker = sender_number_id => { | ||
if ((process.env.WA_PHONE_NUMBER_ID === undefined || process.env.WA_PHONE_NUMBER_ID === '') && sender_number_id == undefined) { | ||
logger.log(`Environmental variable: WA_PHONE_NUMBER_ID and/or sender phone number id arguement is undefined.`); | ||
throw new Error('Missing WhatsApp sender phone number Id.'); | ||
} | ||
for (const value of Object.values(enums_1.WA_Required_Config_Enum)) { | ||
logger.log(value + ' ---- ' + process.env[`${value}`]); | ||
if (process.env[`${value}`] === undefined || process.env[`${value}`] === '') { | ||
logger.log(`Environmental variable: ${value} is undefined`); | ||
throw new Error('Invalid configuration.'); | ||
} | ||
for (const value of Object.values(enums_1.WA_Required_Config_Enum)) { | ||
logger.log(value + ' ---- ' + process.env[`${value}`]); | ||
if (process.env[`${value}`] === undefined || | ||
process.env[`${value}`] === '') { | ||
logger.log(`Environmental variable: ${value} is undefined`); | ||
throw new Error('Invalid configuration.'); | ||
} | ||
} | ||
} | ||
}; | ||
const import_config = (sender_number_id) => { | ||
empty_config_checker(sender_number_id); | ||
const config = { | ||
[enums_1.WA_Config_Enum.Base_URL]: process.env.WA_BASE_URL || default_base_url, | ||
[enums_1.WA_Config_Enum.App_Id]: process.env.M4D_APP_ID || '', | ||
[enums_1.WA_Config_Enum.App_Secret]: process.env.M4D_APP_SECRET || '', | ||
[enums_1.WA_Config_Enum.Phone_Number_Id]: sender_number_id || parseInt(process.env.WA_PHONE_NUMBER_ID || ''), | ||
[enums_1.WA_Config_Enum.Business_Acct_Id]: process.env.WA_BUSINESS_ACCOUNT_ID || '', | ||
[enums_1.WA_Config_Enum.API_Version]: process.env.CLOUD_API_VERSION || '', | ||
[enums_1.WA_Config_Enum.Access_Token]: process.env.CLOUD_API_ACCESS_TOKEN || '', | ||
[enums_1.WA_Config_Enum.Webhook_Endpoint]: process.env.WEBHOOK_ENDPOINT || '', | ||
[enums_1.WA_Config_Enum.Webhook_Verification_Token]: process.env.WEBHOOK_VERIFICATION_TOKEN || '', | ||
[enums_1.WA_Config_Enum.Listener_Port]: parseInt(process.env.LISTENER_PORT || '') || default_listener_port, | ||
[enums_1.WA_Config_Enum.Max_Retries_After_Wait]: parseInt(process.env.MAX_RETRIES_AFTER_WAIT || '') || | ||
default_max_retries_after_wait, | ||
[enums_1.WA_Config_Enum.Request_Timeout]: parseInt(process.env.REQUEST_TIMEOUT || '') || default_request_timeout, | ||
[enums_1.WA_Config_Enum.Debug]: process.env.DEBUG === 'true', | ||
}; | ||
logger.log(`Configuration loaded for App Id ${config[enums_1.WA_Config_Enum.App_Id]}`); | ||
return config; | ||
const import_config = sender_number_id => { | ||
empty_config_checker(sender_number_id); | ||
const config = { | ||
[enums_1.WA_Config_Enum.Base_URL]: process.env.WA_BASE_URL || default_base_url, | ||
[enums_1.WA_Config_Enum.App_Id]: process.env.M4D_APP_ID || '', | ||
[enums_1.WA_Config_Enum.App_Secret]: process.env.M4D_APP_SECRET || '', | ||
[enums_1.WA_Config_Enum.Phone_Number_Id]: sender_number_id || parseInt(process.env.WA_PHONE_NUMBER_ID || ''), | ||
[enums_1.WA_Config_Enum.Business_Acct_Id]: process.env.WA_BUSINESS_ACCOUNT_ID || '', | ||
[enums_1.WA_Config_Enum.API_Version]: process.env.CLOUD_API_VERSION || '', | ||
[enums_1.WA_Config_Enum.Access_Token]: process.env.CLOUD_API_ACCESS_TOKEN || '', | ||
[enums_1.WA_Config_Enum.Webhook_Endpoint]: process.env.WEBHOOK_ENDPOINT || '', | ||
[enums_1.WA_Config_Enum.Webhook_Verification_Token]: process.env.WEBHOOK_VERIFICATION_TOKEN || '', | ||
[enums_1.WA_Config_Enum.Listener_Port]: parseInt(process.env.LISTENER_PORT || '') || default_listener_port, | ||
[enums_1.WA_Config_Enum.Max_Retries_After_Wait]: parseInt(process.env.MAX_RETRIES_AFTER_WAIT || '') || default_max_retries_after_wait, | ||
[enums_1.WA_Config_Enum.Request_Timeout]: parseInt(process.env.REQUEST_TIMEOUT || '') || default_request_timeout, | ||
[enums_1.WA_Config_Enum.Debug]: process.env.DEBUG === 'true' | ||
}; | ||
logger.log(`Configuration loaded for App Id ${config[enums_1.WA_Config_Enum.App_Id]}`); | ||
return config; | ||
}; | ||
exports.import_config = import_config; | ||
const generate_x_hub_256_sig = (body, app_secret) => { | ||
return crypto | ||
.createHmac('sha256', app_secret) | ||
.update(body, 'utf-8') | ||
.digest('hex'); | ||
return crypto.createHmac('sha256', app_secret).update(body, 'utf-8').digest('hex'); | ||
}; | ||
exports.generate_x_hub_256_sig = generate_x_hub_256_sig; | ||
//# sourceMappingURL=utils.js.map | ||
exports.generate_x_hub_256_sig = generate_x_hub_256_sig; |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export declare const SDK_Version = '0.0.1-Alpha'; | ||
export declare const SDK_Version = '0.0.2-Alpha'; |
"use strict"; | ||
/** | ||
@@ -9,5 +10,6 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.SDK_Version = void 0; | ||
exports.SDK_Version = '0.0.1-Alpha'; | ||
//# sourceMappingURL=version.js.map | ||
exports.SDK_Version = '0.0.2-Alpha'; |
"use strict"; | ||
/** | ||
@@ -9,14 +10,51 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const dotenv = require("dotenv"); | ||
if (process.env.NODE_ENV !== 'production' || | ||
process.env.TS_NODE_DEV === 'true') { | ||
dotenv.config(); | ||
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
} : function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { | ||
Object.defineProperty(o, "default", { | ||
enumerable: true, | ||
value: v | ||
}); | ||
} : function (o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = this && this.__importStar || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = this && this.__importDefault || function (mod) { | ||
return mod && mod.__esModule ? mod : { | ||
"default": mod | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const dotenv = __importStar(require("dotenv")); | ||
if (process.env.NODE_ENV !== 'production' || process.env.TS_NODE_DEV === 'true') { | ||
dotenv.config(); | ||
} | ||
const utils_1 = require("./utils"); | ||
const version_1 = require("./version"); | ||
const logger_1 = require("./logger"); | ||
const requester_1 = require("./requester"); | ||
const messages_1 = require("./api/messages"); | ||
const webhooks_1 = require("./api/webhooks"); | ||
const logger_1 = __importDefault(require("./logger")); | ||
const requester_1 = __importDefault(require("./requester")); | ||
const messages_1 = __importDefault(require("./api/messages")); | ||
const webhooks_1 = __importDefault(require("./api/webhooks")); | ||
const enums_1 = require("./types/enums"); | ||
@@ -28,34 +66,34 @@ const lib_name = 'WHATSAPP'; | ||
class WhatsApp { | ||
constructor(sender_number_id) { | ||
this._version = version_1.SDK_Version; | ||
this._config = (0, utils_1.import_config)(sender_number_id); | ||
this._requester = new requester_1.default(this._config[enums_1.WA_Config_Enum.Base_URL], this._config[enums_1.WA_Config_Enum.API_Version], this._config[enums_1.WA_Config_Enum.Phone_Number_Id], this._config[enums_1.WA_Config_Enum.Access_Token], this._config[enums_1.WA_Config_Enum.Business_Acct_Id], this.user_agent()); | ||
this.messages = new messages_1.default(this._config, this._requester); | ||
this.webhooks = new webhooks_1.default(this._config, this.user_agent()); | ||
logger.log('WhatsApp Node.js SDK instantiated!'); | ||
} | ||
version() { | ||
return this._version; | ||
} | ||
user_agent() { | ||
const user_agent_string = `${header_prefix}/${this.version()} (Node.js ${process.version})`; | ||
return user_agent_string; | ||
} | ||
update_timeout(ms) { | ||
this._config[enums_1.WA_Config_Enum.Request_Timeout] = ms; | ||
logger.log(`Updated request timeout to ${ms}ms`); | ||
return true; | ||
} | ||
update_sender_number_id(phone_number_id) { | ||
this._config[enums_1.WA_Config_Enum.Phone_Number_Id] = phone_number_id; | ||
logger.log(`Updated sender phone number id to ${phone_number_id}`); | ||
return true; | ||
} | ||
update_access_token(access_token) { | ||
this._config[enums_1.WA_Config_Enum.Access_Token] = access_token; | ||
logger.log(`Updated access token`); | ||
return true; | ||
} | ||
constructor(sender_number_id) { | ||
this._version = version_1.SDK_Version; | ||
this._config = (0, utils_1.import_config)(sender_number_id); | ||
this._requester = new requester_1.default(this._config[enums_1.WA_Config_Enum.Base_URL], this._config[enums_1.WA_Config_Enum.API_Version], this._config[enums_1.WA_Config_Enum.Phone_Number_Id], this._config[enums_1.WA_Config_Enum.Access_Token], this._config[enums_1.WA_Config_Enum.Business_Acct_Id], this.user_agent()); | ||
this.messages = new messages_1.default(this._config, this._requester); | ||
this.webhooks = new webhooks_1.default(this._config, this.user_agent()); | ||
logger.log('WhatsApp Node.js SDK instantiated!'); | ||
} | ||
version() { | ||
return this._version; | ||
} | ||
user_agent() { | ||
const user_agent_string = `${header_prefix}/${this.version()} (Node.js ${process.version})`; | ||
return user_agent_string; | ||
} | ||
update_timeout(ms) { | ||
this._config[enums_1.WA_Config_Enum.Request_Timeout] = ms; | ||
logger.log(`Updated request timeout to ${ms}ms`); | ||
return true; | ||
} | ||
update_sender_number_id(phone_number_id) { | ||
this._config[enums_1.WA_Config_Enum.Phone_Number_Id] = phone_number_id; | ||
logger.log(`Updated sender phone number id to ${phone_number_id}`); | ||
return true; | ||
} | ||
update_access_token(access_token) { | ||
this._config[enums_1.WA_Config_Enum.Access_Token] = access_token; | ||
logger.log(`Updated access token`); | ||
return true; | ||
} | ||
} | ||
exports.default = WhatsApp; | ||
//# sourceMappingURL=WhatsApp.js.map | ||
module.exports = exports.default; |
{ | ||
"name": "whatsapp", | ||
"version": "0.0.1-Alpha", | ||
"version": "0.0.2-Alpha", | ||
"description": "SDK for interfacing with WhatsApp Business Platform in Typescript or Node.js using the Cloud API, hosted by Meta.", | ||
@@ -22,3 +22,3 @@ "main": "./build/index.js", | ||
"prebuild": "run-s create-version-file", | ||
"build": "rimraf ./lib && tsc -p tsconfig.json", | ||
"build": "rimraf ./build && tsc -p tsconfig.json && ./node_modules/.bin/babel build --out-dir build", | ||
"check-changelog": "node ./scripts/check_changelog.mjs", | ||
@@ -63,7 +63,10 @@ "check-copyright-headers": "node ./scripts/check_copyright_headers.mjs", | ||
"@types/node": "~18.11.18", | ||
"babel-plugin-add-module-exports": "^1.0.4", | ||
"dotenv": "~16.0.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "~7.21.0", | ||
"@babel/preset-env": "~7.20.2", | ||
"@babel/cli": "^7.21.0", | ||
"@babel/core": "^7.21.3", | ||
"@babel/plugin-transform-modules-commonjs": "^7.21.2", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-typescript": "~7.21.0", | ||
@@ -75,3 +78,3 @@ "@jest/globals": "~29.5.0", | ||
"@typescript-eslint/parser": "^5.55.0", | ||
"babel-jest": "~29.5.0", | ||
"babel-jest": "^29.5.0", | ||
"cspell": "^6.26.3", | ||
@@ -78,0 +81,0 @@ "eslint": "~8.34.0", |
@@ -25,3 +25,3 @@ <!-- Copyright (c) Meta Platforms, Inc. and affiliates. | ||
```shell | ||
yarn add https://github.com/WhatsApp/WhatsApp-Nodejs-SDK.git | ||
yarn add whatsapp | ||
``` | ||
@@ -32,3 +32,3 @@ | ||
```shell | ||
npm install https://github.com/WhatsApp/WhatsApp-Nodejs-SDK.git | ||
npm install whatsapp | ||
``` | ||
@@ -35,0 +35,0 @@ |
@@ -9,3 +9,3 @@ /** | ||
import * as nock from 'nock'; | ||
import nock from 'nock'; | ||
import { WA_Config_Type } from '@/config'; | ||
@@ -16,2 +16,3 @@ import { HTTP_Methods_Enum } from '../types/enums'; | ||
import HTTPS_Client from '../https_client'; | ||
import { NoParamCallback } from 'fs'; | ||
@@ -18,0 +19,0 @@ describe('HTTPS client tests', () => { |
@@ -9,3 +9,3 @@ /** | ||
import * as nock from 'nock'; | ||
import nock from 'nock'; | ||
import { WA_Config_Type } from '@/config'; | ||
@@ -12,0 +12,0 @@ import Messages_API from '../api/messages'; |
@@ -9,3 +9,3 @@ /** | ||
import * as nock from 'nock'; | ||
import nock from 'nock'; | ||
import { WA_Config_Type } from '@/config'; | ||
@@ -12,0 +12,0 @@ import { HTTP_Methods_Enum } from '../types/enums'; |
@@ -10,3 +10,3 @@ /** | ||
import { WA_Config_Type } from '../types/config'; | ||
import WhatsApp from '../WhatsApp'; | ||
import WhatsApp from '../index'; | ||
import { SDK_Version } from '../version'; | ||
@@ -13,0 +13,0 @@ |
@@ -9,2 +9,4 @@ /** | ||
export * from './WhatsApp'; | ||
import WhatsApp from './WhatsApp'; | ||
export default WhatsApp; |
@@ -9,2 +9,2 @@ /** | ||
export const SDK_Version = '0.0.1-Alpha'; | ||
export const SDK_Version = '0.0.2-Alpha'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2
192014
3
27
66
4530
+ Addedbabel-plugin-add-module-exports@1.0.4(transitive)