From 7b5fe10206f3221c03af675f1567e075500d9c23 Mon Sep 17 00:00:00 2001 From: Damilare Anjorin Date: Thu, 1 Jun 2023 19:41:32 +0100 Subject: [PATCH] feat: check for secret key and base url in env first & additional improvements --- .DS_Store | Bin 6148 -> 6148 bytes .gitignore | 3 +- .prettierignore | 3 + .prettierrc.cjs | 24 ++++ client.ts | 63 --------- dist/client.js | 51 ------- dist/lib/bills.js | 51 ------- dist/lib/collections.js | 29 ---- dist/lib/counterparty.js | 53 ------- dist/lib/customers.js | 155 --------------------- dist/lib/fx.js | 53 ------- dist/lib/identity.js | 31 ----- dist/lib/institution.js | 42 ------ dist/lib/issuing.js | 134 ------------------ dist/lib/misc.js | 50 ------- dist/lib/transactions.js | 53 ------- dist/lib/transfer.js | 77 ----------- dist/lib/wallets.js | 53 ------- dist/utils.js | 2 - lib/.DS_Store | Bin 6148 -> 0 bytes lib/bills.ts | 49 ------- lib/collections.ts | 44 ------ lib/counterparty.ts | 48 ------- lib/customers.ts | 224 ------------------------------ lib/fx.ts | 51 ------- lib/identity.ts | 22 --- lib/institution.ts | 47 ------- lib/issuing.ts | 148 -------------------- lib/misc.ts | 44 ------ lib/transactions.ts | 46 ------- lib/transfer.ts | 103 -------------- lib/wallets.ts | 49 ------- package.json | 76 ++++++---- src/client.ts | 100 ++++++++++++++ src/lib/bills.ts | 42 ++++++ src/lib/collections.ts | 37 +++++ src/lib/counterparty.ts | 38 +++++ src/lib/customers.ts | 192 ++++++++++++++++++++++++++ src/lib/fx.ts | 40 ++++++ src/lib/identity.ts | 15 ++ src/lib/institution.ts | 39 ++++++ src/lib/issuing.ts | 121 ++++++++++++++++ src/lib/misc.ts | 37 +++++ src/lib/transactions.ts | 37 +++++ src/lib/transfer.ts | 98 +++++++++++++ src/lib/wallets.ts | 39 ++++++ src/utils.ts | 14 ++ tsconfig.json | 116 +++------------- utils.ts | 20 --- yarn.lock | 291 ++++++++++++++++++++++++++++++++++++--- 50 files changed, 1210 insertions(+), 1944 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.cjs delete mode 100644 client.ts delete mode 100644 dist/client.js delete mode 100644 dist/lib/bills.js delete mode 100644 dist/lib/collections.js delete mode 100644 dist/lib/counterparty.js delete mode 100644 dist/lib/customers.js delete mode 100644 dist/lib/fx.js delete mode 100644 dist/lib/identity.js delete mode 100644 dist/lib/institution.js delete mode 100644 dist/lib/issuing.js delete mode 100644 dist/lib/misc.js delete mode 100644 dist/lib/transactions.js delete mode 100644 dist/lib/transfer.js delete mode 100644 dist/lib/wallets.js delete mode 100644 dist/utils.js delete mode 100644 lib/.DS_Store delete mode 100644 lib/bills.ts delete mode 100644 lib/collections.ts delete mode 100644 lib/counterparty.ts delete mode 100644 lib/customers.ts delete mode 100644 lib/fx.ts delete mode 100644 lib/identity.ts delete mode 100644 lib/institution.ts delete mode 100644 lib/issuing.ts delete mode 100644 lib/misc.ts delete mode 100644 lib/transactions.ts delete mode 100644 lib/transfer.ts delete mode 100644 lib/wallets.ts create mode 100644 src/client.ts create mode 100644 src/lib/bills.ts create mode 100644 src/lib/collections.ts create mode 100644 src/lib/counterparty.ts create mode 100644 src/lib/customers.ts create mode 100644 src/lib/fx.ts create mode 100644 src/lib/identity.ts create mode 100644 src/lib/institution.ts create mode 100644 src/lib/issuing.ts create mode 100644 src/lib/misc.ts create mode 100644 src/lib/transactions.ts create mode 100644 src/lib/transfer.ts create mode 100644 src/lib/wallets.ts create mode 100644 src/utils.ts delete mode 100644 utils.ts diff --git a/.DS_Store b/.DS_Store index 4d10cc64d8255863fe25b507fd2016d2ec0c7739..87792f3c452c997a2d8b360732e46e3554a587bd 100644 GIT binary patch delta 35 rcmZoMXfc@J&&ahgU^g=(*JK_R)5-lT?3)W%rZZ1$(Adn*@s}R}!BGn8 delta 54 zcmZoMXfc@J&&a(oU^g=(_hcRxQ%M$v6oyQOVuljWoc!dZoctsP1_l8J21eP { - console.log("Starting Request", JSON.stringify(request, null, 2)); - return request; - }); - - this.Issuing = new Issuing(axios); - this.Identity = new Identity(axios); - this.Transfers = new Transfers(axios); - this.Bills = new Bills(axios); - this.Fx = new Fx(axios); - this.Misc = new Misc(axios); - this.Collections = new Collections(axios); - this.Customers = new Customers(axios); - this.Institution = new Institution(axios); - this.Counterparty = new Counterparty(axios); - this.Wallets = new Wallets(axios); - this.Transactions = new Transactions(axios); - } -} diff --git a/dist/client.js b/dist/client.js deleted file mode 100644 index b5e0b2f..0000000 --- a/dist/client.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const axios_1 = __importDefault(require("axios")); -const issuing_1 = __importDefault(require("./lib/issuing")); -const identity_1 = __importDefault(require("./lib/identity")); -const transfer_1 = __importDefault(require("./lib/transfer")); -const bills_1 = __importDefault(require("./lib/bills")); -const fx_1 = __importDefault(require("./lib/fx")); -const misc_1 = __importDefault(require("./lib/misc")); -const collections_1 = __importDefault(require("./lib/collections")); -const customers_1 = __importDefault(require("./lib/customers")); -const institution_1 = __importDefault(require("./lib/institution")); -const counterparty_1 = __importDefault(require("./lib/counterparty")); -const wallets_1 = __importDefault(require("./lib/wallets")); -const transactions_1 = __importDefault(require("./lib/transactions")); -class Maplerad { - // key can be gotten from your Maplerad dashboard. - // environment can only be "live" or "sandbox". - constructor(key, environment) { - this.secretKey = key; - const live = "https://api.maplerad.com/v1"; - const sandbox = "https://sandbox.api.maplerad.com/v1"; - const axios = axios_1.default.create({ - baseURL: environment.toLowerCase() === "live" ? live : sandbox, - headers: { - Authorization: `Bearer ${this.secretKey}`, - "Content-Type": "application/json", - }, - }); - axios.interceptors.request.use((request) => { - console.log("Starting Request", JSON.stringify(request, null, 2)); - return request; - }); - this.Issuing = new issuing_1.default(axios); - this.Identity = new identity_1.default(axios); - this.Transfers = new transfer_1.default(axios); - this.Bills = new bills_1.default(axios); - this.Fx = new fx_1.default(axios); - this.Misc = new misc_1.default(axios); - this.Collections = new collections_1.default(axios); - this.Customers = new customers_1.default(axios); - this.Institution = new institution_1.default(axios); - this.Counterparty = new counterparty_1.default(axios); - this.Wallets = new wallets_1.default(axios); - this.Transactions = new transactions_1.default(axios); - } -} -exports.default = Maplerad; diff --git a/dist/lib/bills.js b/dist/lib/bills.js deleted file mode 100644 index 010b90e..0000000 --- a/dist/lib/bills.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/bills/airtime"; -class Bills { - constructor(axios) { - this.axios = axios; - } - BuyAirtime(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(path, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetAirtimeBillers(country) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/billers/${country}`); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetAirtimeHistory() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(path); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Bills; diff --git a/dist/lib/collections.js b/dist/lib/collections.js deleted file mode 100644 index 920ce89..0000000 --- a/dist/lib/collections.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/collections"; -class Collections { - constructor(axios) { - this.axios = axios; - } - CreateVirtualAccount(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(path + "/virtual-account", payload); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Collections; diff --git a/dist/lib/counterparty.js b/dist/lib/counterparty.js deleted file mode 100644 index fc90ee9..0000000 --- a/dist/lib/counterparty.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/counterparties"; -class Counterparty { - constructor(axios) { - this.axios = axios; - } - Blacklist(counterpartyID, status) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}/blacklist/${counterpartyID}`, { - blacklist: status, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetCounterparty(counterpartyID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${counterpartyID}`); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetAllCounterparties() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(path); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Counterparty; diff --git a/dist/lib/customers.js b/dist/lib/customers.js deleted file mode 100644 index ecb1514..0000000 --- a/dist/lib/customers.js +++ /dev/null @@ -1,155 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/customers"; -class Customers { - constructor(axios) { - this.axios = axios; - } - FullEnrollCustomer(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}/enroll`, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - CreateCustomer(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}`, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - UpgradeCustomerTier1(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.patch(`${path}/upgrade/tier1`, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - UpgradeCustomerTier2(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.patch(`${path}/upgrade/tier2`, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetCustomer(customerID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${customerID}`); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetAllCustomers() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}`); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetCustomerCards(customerID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${customerID}/cards`); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetCustomerTransactions(customerID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${customerID}/transactions`); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetCustomerVirtualAccounts(customerID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${customerID}/virtual-account`); - return response.data; - } - catch (error) { - return error; - } - }); - } - CustomerCardEnrollment(customerID, brand) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.patch(`${path}/card-enroll`, { - customer_id: customerID, - brand, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } - UpdateCustomer(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.patch(`${path}/update`, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - SetCustomerBlacklistActive(customerID, status) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}/${customerID}/active`, { - blacklist: status, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Customers; diff --git a/dist/lib/fx.js b/dist/lib/fx.js deleted file mode 100644 index e5146c6..0000000 --- a/dist/lib/fx.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/fx"; -class Fx { - constructor(axios) { - this.axios = axios; - } - GenerateQuote(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}/quote`, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - ExchangeCurrency(quote_reference) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(path, { - quote_reference, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetFXHistory() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(path); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Fx; diff --git a/dist/lib/identity.js b/dist/lib/identity.js deleted file mode 100644 index 55121b7..0000000 --- a/dist/lib/identity.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/identity"; -class Identity { - constructor(axios) { - this.axios = axios; - } - VerifyIdentity(bvn) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}`, { - bvn, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Identity; diff --git a/dist/lib/institution.js b/dist/lib/institution.js deleted file mode 100644 index d5adc2e..0000000 --- a/dist/lib/institution.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/institutions"; -class Institution { - constructor(axios) { - this.axios = axios; - } - GetAllInstitutions(params) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(path, { params: params }); - return response.data; - } - catch (error) { - return error; - } - }); - } - ResolveInstitution(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}/resolve`, { - payload, - }); - return response.data; - } - catch (error) { - return error.data; - } - }); - } -} -exports.default = Institution; diff --git a/dist/lib/issuing.js b/dist/lib/issuing.js deleted file mode 100644 index 8e06ada..0000000 --- a/dist/lib/issuing.js +++ /dev/null @@ -1,134 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/issuing"; -class Issuing { - constructor(axios) { - this.axios = axios; - } - CreateCard(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}`, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - CreateBusinessCard(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}/business`, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - SetCardPin(cardID, pin) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.patch(`${path}/${cardID}/set-pin`, { - card_pin: pin, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetCard(cardID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${cardID}`); - return response.data; - } - catch (error) { - return; - } - }); - } - GetAllCards() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}`); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetCardTransactions(cardID, params) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${cardID}/transactions`, { params: params }); - return response.data; - } - catch (error) { - return error; - } - }); - } - FundCard(cardID, amount) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}/${cardID}/fund`, { - amount, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } - WithdrawFromCard(cardID, amount) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(`${path}/${cardID}/withdraw`, { - amount, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } - FreezeCard(cardID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.patch(`${path}/${cardID}/freeze`); - return response.data; - } - catch (error) { - return error; - } - }); - } - UnFreezeCard(cardID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.patch(`${path}/${cardID}/unfreeze`); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Issuing; diff --git a/dist/lib/misc.js b/dist/lib/misc.js deleted file mode 100644 index 96f68d4..0000000 --- a/dist/lib/misc.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -class Misc { - constructor(axios) { - this.axios = axios; - } - GetCurrencies() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get("/currencies"); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetCountries() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get("/countries"); - return response.data; - } - catch (error) { - return error; - } - }); - } - CreditTestWallet(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get("/test/wallet/credit"); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Misc; diff --git a/dist/lib/transactions.js b/dist/lib/transactions.js deleted file mode 100644 index 1fdf309..0000000 --- a/dist/lib/transactions.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/transactions"; -class Transactions { - constructor(axios) { - this.axios = axios; - } - GetAllTransactions() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(path); - return response.data; - } - catch (error) { - return error; - } - }); - } - // The transaction ID or Reference is the parameter for this method - GetTransaction(transactionId) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${transactionId}`); - return response.data; - } - catch (error) { - return error; - } - }); - } - // The transaction ID or Reference is the parameter for this method - VerifyCollectionTransaction(transactionId) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/verify/${transactionId}`); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Transactions; diff --git a/dist/lib/transfer.js b/dist/lib/transfer.js deleted file mode 100644 index 0a978a8..0000000 --- a/dist/lib/transfer.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/transfers"; -class Transfers { - constructor(axios) { - this.axios = axios; - } - NairaTransfer(payload) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.post(path, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - DOMTransfer(payload) { - return __awaiter(this, void 0, void 0, function* () { - if (payload.meta.scheme !== "DOM") - return "Invalid Scheme type for this method"; - try { - const response = yield this.axios.post(path, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - CashPickupTransfer(payload) { - return __awaiter(this, void 0, void 0, function* () { - if (payload.meta.scheme !== "CASHPICKUP") - return "Invalid Scheme type for this method"; - try { - const response = yield this.axios.post(path, payload); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetTransfer(transferID) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${transferID}`); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetAllTransfers() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(path); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Transfers; diff --git a/dist/lib/wallets.js b/dist/lib/wallets.js deleted file mode 100644 index 6e35445..0000000 --- a/dist/lib/wallets.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -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()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = "/wallets"; -class Wallets { - constructor(axios) { - this.axios = axios; - } - GetWallets() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(path); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetWalletsHistory(params) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/history`, { - params, - }); - return response.data; - } - catch (error) { - return error; - } - }); - } - GetWalletsHistoryByCurrency(currencyCode, params) { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield this.axios.get(`${path}/${currencyCode}/history`, { params }); - return response.data; - } - catch (error) { - return error; - } - }); - } -} -exports.default = Wallets; diff --git a/dist/utils.js b/dist/utils.js deleted file mode 100644 index c8ad2e5..0000000 --- a/dist/utils.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/lib/.DS_Store b/lib/.DS_Store deleted file mode 100644 index e78f53d80ed1dcdacd7dbc500c8c738bb7c1f90b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!A=4(5Pe0A1PpNWVzOUA;vcL851#!20fCsHYha0bF?;tP`~|5^@5DW3pF_lr!R;@^{bpEt>Hmrg*B1AoGho+ssCCk*spY`p)iW zT`SEl<~GS$@>=OLW>xV-OV^HOcEmh{HLmg&^)|daoX>)a$qa|TYX4edw<7jb)vL&= zHY>53cw{VjJ0|2;>-|p7OOzEwHQRdyxMzzsWDPJg1xx``AXY%uhlE8i4On>8rGu3o z0f=>WtFbM=48lnQrU46&9HBW+C3>n0M-1ob>`#JU8nE!_>2Trj;X-5=PAE>J^ZALo z!=)arHU&(9O$848ZCCdHi{0n{O_JT20;a&fQoz**SA#xN3VZ8Ta { - try { - const response = await this.axios.post(path, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async GetAirtimeBillers( - country: CountryType - ): Promise { - try { - const response = await this.axios.get(`${path}/billers/${country}`); - return response.data; - } catch (error) { - return error; - } - } - - public async GetAirtimeHistory(): Promise { - try { - const response = await this.axios.get(path); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/collections.ts b/lib/collections.ts deleted file mode 100644 index fb45642..0000000 --- a/lib/collections.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; -import { CurrencyType, IdentityType } from "../utils"; - -const path = "/collections"; - -interface VirtualAccountPayload { - customer_id: string; - currency: CurrencyType; - preferred_bank: string; - deposit_account_id: string; - // meta is for USD Accounts - meta?: { - occupation: string; - utility_bill: string | File; - bank_statement: string | File; - identity_type: IdentityType; - identity_image: string | File; - identity_number: string; - identity_issued_date: string; - identity_expiration: string; - }; -} - -export default class Collections { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async CreateVirtualAccount( - payload: VirtualAccountPayload - ): Promise { - try { - const response = await this.axios.post( - path + "/virtual-account", - payload - ); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/counterparty.ts b/lib/counterparty.ts deleted file mode 100644 index eb7f9a5..0000000 --- a/lib/counterparty.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; - -const path = "/counterparties"; - -export default class Counterparty { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async Blacklist( - counterpartyID: string, - status: boolean - ): Promise { - try { - const response = await this.axios.post( - `${path}/blacklist/${counterpartyID}`, - { - blacklist: status, - } - ); - return response.data; - } catch (error) { - return error; - } - } - - public async GetCounterparty( - counterpartyID: string - ): Promise { - try { - const response = await this.axios.get(`${path}/${counterpartyID}`); - return response.data; - } catch (error) { - return error; - } - } - - public async GetAllCounterparties(): Promise { - try { - const response = await this.axios.get(path); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/customers.ts b/lib/customers.ts deleted file mode 100644 index 311bde6..0000000 --- a/lib/customers.ts +++ /dev/null @@ -1,224 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; -import { CountryType, CardBrand } from "../utils"; - -const path = "/customers"; - -interface IAddress { - city: string; - country: string; - postal_code: string; - state: string; - street: string; - street2: string; -} - -interface _Identity { - country: string; - image?: string; - number: string; - type: string; -} - -interface CreateCustomerPayload { - email: string; - first_name: string; - last_name: string; - country: CountryType; -} - -interface TierOnePayload { - customer_id: string; - phone: { - phone_number: string; - phone_short_code: string; - }; - address: IAddress; - dob: string; - identification_number: string; -} - -interface TierTwoPayload { - customer_id: string; - identity: _Identity; -} - -interface IFullEnrollCustomer { - first_name: string; - last_name: string; - email: string; - phone: { - phone_number: string; - phone_country_code: string; - }; - dob: string; - identification_number: string; - identity: _Identity; - address: IAddress; -} -interface IUpdateCustomer { - customer_id: string; - photo: string; - phone: { - phone_number: string; - phone_country_code: string; - }; - middle_name: string; - identity: _Identity; -} - -export default class Customers { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async FullEnrollCustomer( - payload: IFullEnrollCustomer - ): Promise { - try { - const response = await this.axios.post(`${path}/enroll`, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async CreateCustomer( - payload: CreateCustomerPayload - ): Promise { - try { - const response = await this.axios.post(`${path}`, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async UpgradeCustomerTier1( - payload: TierOnePayload - ): Promise { - try { - const response = await this.axios.patch( - `${path}/upgrade/tier1`, - payload - ); - return response.data; - } catch (error) { - return error; - } - } - - public async UpgradeCustomerTier2( - payload: TierTwoPayload - ): Promise { - try { - const response = await this.axios.patch( - `${path}/upgrade/tier2`, - payload - ); - return response.data; - } catch (error) { - return error; - } - } - - public async GetCustomer(customerID: string): Promise { - try { - const response = await this.axios.get(`${path}/${customerID}`); - return response.data; - } catch (error) { - return error; - } - } - - public async GetAllCustomers(): Promise { - try { - const response = await this.axios.get(`${path}`); - return response.data; - } catch (error) { - return error; - } - } - - public async GetCustomerCards( - customerID: string - ): Promise { - try { - const response = await this.axios.get( - `${path}/${customerID}/cards` - ); - return response.data; - } catch (error) { - return error; - } - } - - public async GetCustomerTransactions( - customerID: string - ): Promise { - try { - const response = await this.axios.get( - `${path}/${customerID}/transactions` - ); - return response.data; - } catch (error) { - return error; - } - } - - public async GetCustomerVirtualAccounts( - customerID: string - ): Promise { - try { - const response = await this.axios.get( - `${path}/${customerID}/virtual-account` - ); - return response.data; - } catch (error) { - return error; - } - } - public async CustomerCardEnrollment( - customerID: string, - brand: CardBrand - ): Promise { - try { - const response = await this.axios.patch(`${path}/card-enroll`, { - customer_id: customerID, - brand, - }); - return response.data; - } catch (error) { - return error; - } - } - - public async UpdateCustomer( - payload: IUpdateCustomer - ): Promise { - try { - const response = await this.axios.patch(`${path}/update`, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async SetCustomerBlacklistActive( - customerID: string, - status: boolean - ): Promise { - try { - const response = await this.axios.post( - `${path}/${customerID}/active`, - { - blacklist: status, - } - ); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/fx.ts b/lib/fx.ts deleted file mode 100644 index 711ce2c..0000000 --- a/lib/fx.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; -import { CurrencyType } from "../utils"; - -const path = "/fx"; - -interface QuotePayload { - source_currency: CurrencyType; - target_currency: CurrencyType; - amount: number; -} - -export default class Fx { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async GenerateQuote( - payload: QuotePayload - ): Promise { - try { - const response = await this.axios.post(`${path}/quote`, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async ExchangeCurrency( - quote_reference: string - ): Promise { - try { - const response = await this.axios.post(path, { - quote_reference, - }); - return response.data; - } catch (error) { - return error; - } - } - - public async GetFXHistory(): Promise { - try { - const response = await this.axios.get(path); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/identity.ts b/lib/identity.ts deleted file mode 100644 index 92849e5..0000000 --- a/lib/identity.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; - -const path = "/identity"; - -export default class Identity { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async VerifyIdentity(bvn: string): Promise { - try { - const response = await this.axios.post(`${path}`, { - bvn, - }); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/institution.ts b/lib/institution.ts deleted file mode 100644 index 2f59837..0000000 --- a/lib/institution.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; - -const path = "/institutions"; - -interface InstitutionsParams { - page?: string; - pageSize?: string; - type?: string; - country?: string; -} - -interface ResolveInstitutionPayload { - account_number: string; - bank_code: string; -} - -export default class Institution { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async GetAllInstitutions( - params: InstitutionsParams - ): Promise { - try { - const response = await this.axios.get(path, { params: params }); - return response.data; - } catch (error) { - return error; - } - } - - public async ResolveInstitution( - payload: ResolveInstitutionPayload - ): Promise { - try { - const response = await this.axios.post(`${path}/resolve`, { - payload, - }); - return response.data; - } catch (error: any) { - return error.data; - } - } -} diff --git a/lib/issuing.ts b/lib/issuing.ts deleted file mode 100644 index e598486..0000000 --- a/lib/issuing.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; -import { CurrencyType, QueryParams, CardBrand } from "../utils"; - -const path = "/issuing"; - -type CardType = "PHYSICAL" | "VIRTUAL"; - -interface CardPayload { - customer_id: string; - type: CardType; - currency: CurrencyType; - auto_approve: boolean; - brand?: CardBrand; - amount?: number; - card_pin?: number; -} - -interface BusinessCardPayload extends CardPayload { - name: string; -} - -export default class Issuing { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async CreateCard( - payload: CardPayload - ): Promise { - try { - const response = await this.axios.post(`${path}`, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async CreateBusinessCard( - payload: BusinessCardPayload - ): Promise { - try { - const response = await this.axios.post(`${path}/business`, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async SetCardPin( - cardID: string, - pin: string - ): Promise { - try { - const response = await this.axios.patch( - `${path}/${cardID}/set-pin`, - { - card_pin: pin, - } - ); - return response.data; - } catch (error) { - return error; - } - } - - public async GetCard(cardID: string): Promise { - try { - const response = await this.axios.get(`${path}/${cardID}`); - return response.data; - } catch (error) { - return; - } - } - - public async GetAllCards(): Promise { - try { - const response = await this.axios.get(`${path}`); - return response.data; - } catch (error) { - return error; - } - } - - public async GetCardTransactions(cardID: string, params?: QueryParams) { - try { - const response = await this.axios.get( - `${path}/${cardID}/transactions`, - { params: params } - ); - return response.data; - } catch (error) { - return error; - } - } - - public async FundCard( - cardID: string, - amount: number - ): Promise { - try { - const response = await this.axios.post(`${path}/${cardID}/fund`, { - amount, - }); - return response.data; - } catch (error) { - return error; - } - } - - public async WithdrawFromCard( - cardID: string, - amount: number - ): Promise { - try { - const response = await this.axios.post( - `${path}/${cardID}/withdraw`, - { - amount, - } - ); - return response.data; - } catch (error) { - return error; - } - } - - public async FreezeCard(cardID: string): Promise { - try { - const response = await this.axios.patch(`${path}/${cardID}/freeze`); - return response.data; - } catch (error) { - return error; - } - } - - public async UnFreezeCard(cardID: string): Promise { - try { - const response = await this.axios.patch( - `${path}/${cardID}/unfreeze` - ); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/misc.ts b/lib/misc.ts deleted file mode 100644 index 4744a3c..0000000 --- a/lib/misc.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; -import { CurrencyType } from "../utils"; - -interface TestWalletPayload { - amount: string; - currency: CurrencyType; -} - -export default class Misc { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async GetCurrencies(): Promise { - try { - const response = await this.axios.get("/currencies"); - return response.data; - } catch (error) { - return error; - } - } - - public async GetCountries(): Promise { - try { - const response = await this.axios.get("/countries"); - return response.data; - } catch (error) { - return error; - } - } - - public async CreditTestWallet( - payload: TestWalletPayload - ): Promise { - try { - const response = await this.axios.get("/test/wallet/credit"); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/transactions.ts b/lib/transactions.ts deleted file mode 100644 index 3312d55..0000000 --- a/lib/transactions.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; - -const path = "/transactions"; - -export default class Transactions { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async GetAllTransactions(): Promise { - try { - const response = await this.axios.get(path); - return response.data; - } catch (error) { - return error; - } - } - - // The transaction ID or Reference is the parameter for this method - public async GetTransaction( - transactionId: string - ): Promise { - try { - const response = await this.axios.get(`${path}/${transactionId}`); - return response.data; - } catch (error) { - return error; - } - } - - // The transaction ID or Reference is the parameter for this method - public async VerifyCollectionTransaction( - transactionId: string - ): Promise { - try { - const response = await this.axios.get( - `${path}/verify/${transactionId}` - ); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/transfer.ts b/lib/transfer.ts deleted file mode 100644 index 9e7e751..0000000 --- a/lib/transfer.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { CurrencyType } from "../utils"; -import { AxiosInstance, AxiosResponse } from "axios"; - -const path = "/transfers"; - -interface IMeta { - scheme: "DOM" | "CASHPICKUP"; - sender: { - first_name: string; - last_name: string; - phone_number: string; - address: string; - country: string; - }; - counterparty: { - first_name: string; - last_name: string; - phone_number: string; - address: string; - country: string; - identity: string; - }; -} - -interface NairaTransferPayload { - account_number: string; - amount: number; - bank_code: string; - currency: "NGN"; -} - -interface TransferPayload { - account_number: string; - amount: number; - bank_code: string; - currency: CurrencyType; - meta: IMeta; - reason: string; - reference: string; -} - -export default class Transfers { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async NairaTransfer( - payload: NairaTransferPayload - ): Promise { - try { - const response = await this.axios.post(path, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async DOMTransfer( - payload: TransferPayload - ): Promise { - if (payload.meta.scheme !== "DOM") - return "Invalid Scheme type for this method"; - try { - const response = await this.axios.post(path, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async CashPickupTransfer( - payload: TransferPayload - ): Promise { - if (payload.meta.scheme !== "CASHPICKUP") - return "Invalid Scheme type for this method"; - try { - const response = await this.axios.post(path, payload); - return response.data; - } catch (error) { - return error; - } - } - - public async GetTransfer(transferID: string): Promise { - try { - const response = await this.axios.get(`${path}/${transferID}`); - return response.data; - } catch (error) { - return error; - } - } - - public async GetAllTransfers(): Promise { - try { - const response = await this.axios.get(path); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/lib/wallets.ts b/lib/wallets.ts deleted file mode 100644 index 1f17eae..0000000 --- a/lib/wallets.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { AxiosInstance, AxiosResponse } from "axios"; -import { CurrencyType, QueryParams } from "../utils"; - -const path = "/wallets"; - -export default class Wallets { - private axios: AxiosInstance; - - constructor(axios: AxiosInstance) { - this.axios = axios; - } - - public async GetWallets(): Promise { - try { - const response = await this.axios.get(path); - return response.data; - } catch (error) { - return error; - } - } - - public async GetWalletsHistory( - params?: QueryParams - ): Promise { - try { - const response = await this.axios.get(`${path}/history`, { - params, - }); - return response.data; - } catch (error) { - return error; - } - } - - public async GetWalletsHistoryByCurrency( - currencyCode: CurrencyType, - params?: QueryParams - ): Promise { - try { - const response = await this.axios.get( - `${path}/${currencyCode}/history`, - { params } - ); - return response.data; - } catch (error) { - return error; - } - } -} diff --git a/package.json b/package.json index 4904b37..7e0fddc 100644 --- a/package.json +++ b/package.json @@ -1,32 +1,50 @@ { - "name": "maplerad-node", - "version": "1.1.0", - "description": "Official Nodejs library for the Maplerad API", - "prepublish": "tsc", - "main": "client.ts", - "scripts": { - "build": "npx tsc", - "dev": "ts-node client.ts" + "name": "maplerad-node", + "version": "1.1.0", + "description": "Official Nodejs library for the Maplerad API", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/client.d.ts", + "import": "./dist/client.js" }, - "repository": { - "type": "git", - "url": "https://github.com/wirepay/maplerad-node.git" - }, - "homepage": "https://github.com/wirepay/maplerad-node", - "keywords": [ - "sdk", - "banking", - "payments", - "fintech" - ], - "author": "Christian Ndu", - "license": "ISC", - "dependencies": { - "axios": "^0.27.2" - }, - "devDependencies": { - "@types/node": "^17.0.38", - "ts-node": "^10.8.2", - "typescript": "^4.7.2" - } + "./*": "./*" + }, + "main": "./dist/client.js", + "module": "./dist/client.js", + "types": "./dist/client.d.ts", + "files": [ + "dist", + "package.json" + ], + "scripts": { + "build": "rimraf dist && tsc -p .", + "dev": "ts-node ./src/client.ts", + "format": "prettier --write --cache \"**/*.{ts,js,json}\"", + "format:check": "prettier --check --cache \"**/*.{ts,js,json}\"", + "prepublishOnly": "yarn build" + }, + "repository": { + "type": "git", + "url": "https://github.com/wirepay/maplerad-node.git" + }, + "homepage": "https://github.com/wirepay/maplerad-node", + "keywords": [ + "sdk", + "banking", + "payments", + "fintech" + ], + "author": "Christian Ndu", + "license": "ISC", + "dependencies": { + "axios": "^1.4.0" + }, + "devDependencies": { + "@types/node": "^20.2.5", + "prettier": "^2.8.8", + "rimraf": "^5.0.1", + "ts-node": "^10.9.1", + "typescript": "^5.1.3" + } } diff --git a/src/client.ts b/src/client.ts new file mode 100644 index 0000000..6edb7fc --- /dev/null +++ b/src/client.ts @@ -0,0 +1,100 @@ +import Axios from 'axios' +import Issuing from './lib/issuing' +import Identity from './lib/identity' +import Transfers from './lib/transfer' +import Bills from './lib/bills' +import Fx from './lib/fx' +import Misc from './lib/misc' +import Collections from './lib/collections' +import Customers from './lib/customers' +import Institution from './lib/institution' +import Counterparty from './lib/counterparty' +import Wallets from './lib/wallets' +import Transactions from './lib/transactions' + +type Env = 'live' | 'sandbox' + +export default class Maplerad { + readonly baseUrl: string + + public readonly Issuing: Issuing + public readonly Identity: Identity + public readonly Transfers: Transfers + public readonly Bills: Bills + public readonly Fx: Fx + public readonly Misc: Misc + public readonly Collections: Collections + public readonly Customers: Customers + public readonly Institution: Institution + public readonly Counterparty: Counterparty + public readonly Wallets: Wallets + public readonly Transactions: Transactions + + // key can be gotten from your Maplerad dashboard. + // environment can only be "live" or "sandbox". + constructor(readonly key?: string, readonly environment: Env = 'live') { + if (!key) { + this.key = process.env.MAPLERAD_SECRET_KEY + + if (!this.key) { + throw new Error( + 'Missing API key. Pass it to the constructor `new Maplerad("re_123")`', + ) + } + } + + const live = 'https://api.maplerad.com/v1' + const sandbox = 'https://sandbox.api.maplerad.com/v1' + + this.baseUrl = + process.env.MAPLERAD_BASE_URL || + (environment.toLowerCase() === 'live' ? live : sandbox) + + const axios = Axios.create({ + baseURL: this.baseUrl, + headers: { + Authorization: `Bearer ${this.key}`, + 'Content-Type': 'application/json', + }, + }) + + axios.interceptors.request.use((request) => { + console.log('Starting Request', JSON.stringify(request, null, 2)) + return request + }) + + axios.interceptors.response.use( + (response) => { + if (response.data) { + return response.data + } + + return response + }, + (error) => { + if (error?.response?.data?.error) { + return Promise.reject(error.response.data.error) + } + + if (error?.response?.data) { + return Promise.reject(error.response.data) + } + + return Promise.reject(error) + }, + ) + + this.Issuing = new Issuing(axios) + this.Identity = new Identity(axios) + this.Transfers = new Transfers(axios) + this.Bills = new Bills(axios) + this.Fx = new Fx(axios) + this.Misc = new Misc(axios) + this.Collections = new Collections(axios) + this.Customers = new Customers(axios) + this.Institution = new Institution(axios) + this.Counterparty = new Counterparty(axios) + this.Wallets = new Wallets(axios) + this.Transactions = new Transactions(axios) + } +} diff --git a/src/lib/bills.ts b/src/lib/bills.ts new file mode 100644 index 0000000..7112e33 --- /dev/null +++ b/src/lib/bills.ts @@ -0,0 +1,42 @@ +import { AxiosInstance, AxiosResponse } from 'axios' +import { CountryType } from '../utils' + +const path = '/bills/airtime' + +interface BuyAirtimePayload { + phone_number: string + identifier?: string + amount: number +} + +export default class Bills { + constructor(private readonly axios: AxiosInstance) {} + + public async BuyAirtime( + payload: BuyAirtimePayload, + ): Promise { + try { + return await this.axios.post(path, payload) + } catch (error) { + return error + } + } + + public async GetAirtimeBillers( + country: CountryType, + ): Promise { + try { + return await this.axios.get(`${path}/billers/${country}`) + } catch (error) { + return error + } + } + + public async GetAirtimeHistory(): Promise { + try { + return await this.axios.get(path) + } catch (error) { + return error + } + } +} diff --git a/src/lib/collections.ts b/src/lib/collections.ts new file mode 100644 index 0000000..88ef1b6 --- /dev/null +++ b/src/lib/collections.ts @@ -0,0 +1,37 @@ +import { AxiosInstance, AxiosResponse } from 'axios' +import { CurrencyType, IdentityType } from '../utils' + +const path = '/collections' + +interface VirtualAccountPayload { + customer_id: string + currency: CurrencyType + preferred_bank: string + deposit_account_id: string + // meta is for USD Accounts + meta?: { + occupation: string + utility_bill: string | File + bank_statement: string | File + identity_type: IdentityType + identity_image: string | File + identity_number: string + identity_issued_date: string + identity_expiration: string + } +} + +export default class Collections { + constructor(private readonly axios: AxiosInstance) {} + + public async CreateVirtualAccount( + payload: VirtualAccountPayload, + ): Promise { + try { + const response = await this.axios.post(path + '/virtual-account', payload) + return response.data + } catch (error) { + return error + } + } +} diff --git a/src/lib/counterparty.ts b/src/lib/counterparty.ts new file mode 100644 index 0000000..41efa5a --- /dev/null +++ b/src/lib/counterparty.ts @@ -0,0 +1,38 @@ +import { AxiosInstance, AxiosResponse } from 'axios' + +const path = '/counterparties' + +export default class Counterparty { + constructor(private readonly axios: AxiosInstance) {} + + public async Blacklist( + counterpartyID: string, + status: boolean, + ): Promise { + try { + return await this.axios.post(`${path}/blacklist/${counterpartyID}`, { + blacklist: status, + }) + } catch (error) { + return error + } + } + + public async GetCounterparty( + counterpartyID: string, + ): Promise { + try { + return await this.axios.get(`${path}/${counterpartyID}`) + } catch (error) { + return error + } + } + + public async GetAllCounterparties(): Promise { + try { + return await this.axios.get(path) + } catch (error) { + return error + } + } +} diff --git a/src/lib/customers.ts b/src/lib/customers.ts new file mode 100644 index 0000000..84b8b9f --- /dev/null +++ b/src/lib/customers.ts @@ -0,0 +1,192 @@ +import { AxiosInstance, AxiosResponse } from 'axios' +import { CountryType, CardBrand } from '../utils' + +const path = '/customers' + +interface IAddress { + city: string + country: string + postal_code: string + state: string + street: string + street2: string +} + +interface _Identity { + country: string + image?: string + number: string + type: string +} + +interface CreateCustomerPayload { + email: string + first_name: string + last_name: string + country: CountryType +} + +interface TierOnePayload { + customer_id: string + phone: { + phone_number: string + phone_short_code: string + } + address: IAddress + dob: string + identification_number: string +} + +interface TierTwoPayload { + customer_id: string + identity: _Identity +} + +interface IFullEnrollCustomer { + first_name: string + last_name: string + email: string + phone: { + phone_number: string + phone_country_code: string + } + dob: string + identification_number: string + identity: _Identity + address: IAddress +} + +interface IUpdateCustomer { + customer_id: string + photo: string + phone: { + phone_number: string + phone_country_code: string + } + middle_name: string + identity: _Identity +} + +export default class Customers { + constructor(private readonly axios: AxiosInstance) {} + + public async FullEnrollCustomer( + payload: IFullEnrollCustomer, + ): Promise { + try { + return await this.axios.post(`${path}/enroll`, payload) + } catch (error) { + return error + } + } + + public async CreateCustomer( + payload: CreateCustomerPayload, + ): Promise { + try { + return await this.axios.post(`${path}`, payload) + } catch (error) { + return error + } + } + + public async UpgradeCustomerTier1( + payload: TierOnePayload, + ): Promise { + try { + return await this.axios.patch(`${path}/upgrade/tier1`, payload) + } catch (error) { + return error + } + } + + public async UpgradeCustomerTier2( + payload: TierTwoPayload, + ): Promise { + try { + return await this.axios.patch(`${path}/upgrade/tier2`, payload) + } catch (error) { + return error + } + } + + public async GetCustomer(customerID: string): Promise { + try { + return await this.axios.get(`${path}/${customerID}`) + } catch (error) { + return error + } + } + + public async GetAllCustomers(): Promise { + try { + return await this.axios.get(`${path}`) + } catch (error) { + return error + } + } + + public async GetCustomerCards(customerID: string): Promise { + try { + return await this.axios.get(`${path}/${customerID}/cards`) + } catch (error) { + return error + } + } + + public async GetCustomerTransactions( + customerID: string, + ): Promise { + try { + return await this.axios.get(`${path}/${customerID}/transactions`) + } catch (error) { + return error + } + } + + public async GetCustomerVirtualAccounts( + customerID: string, + ): Promise { + try { + return await this.axios.get(`${path}/${customerID}/virtual-account`) + } catch (error) { + return error + } + } + public async CustomerCardEnrollment( + customerID: string, + brand: CardBrand, + ): Promise { + try { + return await this.axios.patch(`${path}/card-enroll`, { + customer_id: customerID, + brand, + }) + } catch (error) { + return error + } + } + + public async UpdateCustomer( + payload: IUpdateCustomer, + ): Promise { + try { + return await this.axios.patch(`${path}/update`, payload) + } catch (error) { + return error + } + } + + public async SetCustomerBlacklistActive( + customerID: string, + status: boolean, + ): Promise { + try { + return await this.axios.post(`${path}/${customerID}/active`, { + blacklist: status, + }) + } catch (error) { + return error + } + } +} diff --git a/src/lib/fx.ts b/src/lib/fx.ts new file mode 100644 index 0000000..3e68ba8 --- /dev/null +++ b/src/lib/fx.ts @@ -0,0 +1,40 @@ +import { AxiosInstance, AxiosResponse } from 'axios' +import { CurrencyType } from '../utils' + +const path = '/fx' + +interface QuotePayload { + source_currency: CurrencyType + target_currency: CurrencyType + amount: number +} + +export default class Fx { + constructor(private readonly axios: AxiosInstance) {} + + public async GenerateQuote(payload: QuotePayload): Promise { + try { + return await this.axios.post(`${path}/quote`, payload) + } catch (error) { + return error + } + } + + public async ExchangeCurrency( + quote_reference: string, + ): Promise { + try { + return await this.axios.post(path, { quote_reference }) + } catch (error) { + return error + } + } + + public async GetFXHistory(): Promise { + try { + return await this.axios.get(path) + } catch (error) { + return error + } + } +} diff --git a/src/lib/identity.ts b/src/lib/identity.ts new file mode 100644 index 0000000..e8256ce --- /dev/null +++ b/src/lib/identity.ts @@ -0,0 +1,15 @@ +import { AxiosInstance, AxiosResponse } from 'axios' + +const path = '/identity' + +export default class Identity { + constructor(private readonly axios: AxiosInstance) {} + + public async VerifyIdentity(bvn: string): Promise { + try { + return await this.axios.post(`${path}`, { bvn }) + } catch (error) { + return error + } + } +} diff --git a/src/lib/institution.ts b/src/lib/institution.ts new file mode 100644 index 0000000..2fe456e --- /dev/null +++ b/src/lib/institution.ts @@ -0,0 +1,39 @@ +import { AxiosInstance, AxiosResponse } from 'axios' + +const path = '/institutions' + +interface InstitutionsParams { + page?: string + pageSize?: string + type?: string + country?: string +} + +interface ResolveInstitutionPayload { + account_number: string + bank_code: string +} + +export default class Institution { + constructor(private readonly axios: AxiosInstance) {} + + public async GetAllInstitutions( + params: InstitutionsParams, + ): Promise { + try { + return await this.axios.get(path, { params: params }) + } catch (error) { + return error + } + } + + public async ResolveInstitution( + payload: ResolveInstitutionPayload, + ): Promise { + try { + return await this.axios.post(`${path}/resolve`, { payload }) + } catch (error: any) { + return error.data + } + } +} diff --git a/src/lib/issuing.ts b/src/lib/issuing.ts new file mode 100644 index 0000000..01f6dcb --- /dev/null +++ b/src/lib/issuing.ts @@ -0,0 +1,121 @@ +import { AxiosInstance, AxiosResponse } from 'axios' +import { CurrencyType, QueryParams, CardBrand } from '../utils' + +const path = '/issuing' + +type CardType = 'PHYSICAL' | 'VIRTUAL' + +interface CardPayload { + customer_id: string + type: CardType + currency: CurrencyType + auto_approve: boolean + brand?: CardBrand + amount?: number + card_pin?: number +} + +interface BusinessCardPayload extends CardPayload { + name: string +} + +export default class Issuing { + constructor(private readonly axios: AxiosInstance) {} + + public async CreateCard(payload: CardPayload): Promise { + try { + return await this.axios.post(`${path}`, payload) + } catch (error) { + return error + } + } + + public async CreateBusinessCard( + payload: BusinessCardPayload, + ): Promise { + try { + return await this.axios.post(`${path}/business`, payload) + } catch (error) { + return error + } + } + + public async SetCardPin( + cardID: string, + pin: string, + ): Promise { + try { + return await this.axios.patch(`${path}/${cardID}/set-pin`, { card_pin: pin }) + } catch (error) { + return error + } + } + + public async GetCard(cardID: string): Promise { + try { + return await this.axios.get(`${path}/${cardID}`) + } catch (error) { + return + } + } + + public async GetAllCards(): Promise { + try { + return await this.axios.get(`${path}`) + } catch (error) { + return error + } + } + + public async GetCardTransactions(cardID: string, params?: QueryParams) { + try { + return await this.axios.get(`${path}/${cardID}/transactions`, { + params: params, + }) + } catch (error) { + return error + } + } + + public async FundCard( + cardID: string, + amount: number, + ): Promise { + try { + return await this.axios.post(`${path}/${cardID}/fund`, { + amount, + }) + } catch (error) { + return error + } + } + + public async WithdrawFromCard( + cardID: string, + amount: number, + ): Promise { + try { + return await this.axios.post(`${path}/${cardID}/withdraw`, { + amount, + }) + } catch (error) { + return error + } + } + + public async FreezeCard(cardID: string): Promise { + try { + return await this.axios.patch(`${path}/${cardID}/freeze`) + } catch (error) { + return error + } + } + + public async UnFreezeCard(cardID: string): Promise { + try { + return await this.axios.patch(`${path}/${cardID}/unfreeze`) + } catch (error) { + return error + } + } +} diff --git a/src/lib/misc.ts b/src/lib/misc.ts new file mode 100644 index 0000000..f4fca1d --- /dev/null +++ b/src/lib/misc.ts @@ -0,0 +1,37 @@ +import { AxiosInstance, AxiosResponse } from 'axios' +import { CurrencyType } from '../utils' + +interface TestWalletPayload { + amount: string + currency: CurrencyType +} + +export default class Misc { + constructor(private readonly axios: AxiosInstance) {} + + public async GetCurrencies(): Promise { + try { + return await this.axios.get('/currencies') + } catch (error) { + return error + } + } + + public async GetCountries(): Promise { + try { + return await this.axios.get('/countries') + } catch (error) { + return error + } + } + + public async CreditTestWallet( + _payload: TestWalletPayload, + ): Promise { + try { + return await this.axios.get('/test/wallet/credit') + } catch (error) { + return error + } + } +} diff --git a/src/lib/transactions.ts b/src/lib/transactions.ts new file mode 100644 index 0000000..afbce35 --- /dev/null +++ b/src/lib/transactions.ts @@ -0,0 +1,37 @@ +import { AxiosInstance, AxiosResponse } from 'axios' + +const path = '/transactions' + +export default class Transactions { + constructor(private readonly axios: AxiosInstance) {} + + public async GetAllTransactions(): Promise { + try { + return await this.axios.get(path) + } catch (error) { + return error + } + } + + // The transaction ID or Reference is the parameter for this method + public async GetTransaction( + transactionId: string, + ): Promise { + try { + return await this.axios.get(`${path}/${transactionId}`) + } catch (error) { + return error + } + } + + // The transaction ID or Reference is the parameter for this method + public async VerifyCollectionTransaction( + transactionId: string, + ): Promise { + try { + return await this.axios.get(`${path}/verify/${transactionId}`) + } catch (error) { + return error + } + } +} diff --git a/src/lib/transfer.ts b/src/lib/transfer.ts new file mode 100644 index 0000000..7ee861f --- /dev/null +++ b/src/lib/transfer.ts @@ -0,0 +1,98 @@ +import { CurrencyType } from '../utils' +import { AxiosInstance, AxiosResponse } from 'axios' + +const path = '/transfers' + +interface IMeta { + scheme: 'DOM' | 'CASHPICKUP' + sender: { + first_name: string + last_name: string + phone_number: string + address: string + country: string + } + counterparty: { + first_name: string + last_name: string + phone_number: string + address: string + country: string + identity: string + } +} + +interface NairaTransferPayload { + account_number: string + amount: number + bank_code: string + currency: 'NGN' +} + +interface TransferPayload { + account_number: string + amount: number + bank_code: string + currency: CurrencyType + meta: IMeta + reason: string + reference: string +} + +export default class Transfers { + constructor(private readonly axios: AxiosInstance) {} + + public async NairaTransfer( + payload: NairaTransferPayload, + ): Promise { + try { + return await this.axios.post(path, payload) + } catch (error) { + return error + } + } + + public async DOMTransfer( + payload: TransferPayload, + ): Promise { + if (payload.meta.scheme !== 'DOM') { + throw new Error('Invalid Scheme type for this method') + } + + try { + return await this.axios.post(path, payload) + } catch (error) { + return error + } + } + + public async CashPickupTransfer( + payload: TransferPayload, + ): Promise { + if (payload.meta.scheme !== 'CASHPICKUP') { + throw new Error('Invalid Scheme type for this method') + } + + try { + return await this.axios.post(path, payload) + } catch (error) { + return error + } + } + + public async GetTransfer(transferID: string): Promise { + try { + return await this.axios.get(`${path}/${transferID}`) + } catch (error) { + return error + } + } + + public async GetAllTransfers(): Promise { + try { + return await this.axios.get(path) + } catch (error) { + return error + } + } +} diff --git a/src/lib/wallets.ts b/src/lib/wallets.ts new file mode 100644 index 0000000..b89c7a1 --- /dev/null +++ b/src/lib/wallets.ts @@ -0,0 +1,39 @@ +import { AxiosInstance, AxiosResponse } from 'axios' +import { CurrencyType, QueryParams } from '../utils' + +const path = '/wallets' + +export default class Wallets { + constructor(private readonly axios: AxiosInstance) {} + + public async GetWallets(): Promise { + try { + return await this.axios.get(path) + } catch (error) { + return error + } + } + + public async GetWalletsHistory( + params?: QueryParams, + ): Promise { + try { + return await this.axios.get(`${path}/history`, { params }) + } catch (error) { + return error + } + } + + public async GetWalletsHistoryByCurrency( + currencyCode: CurrencyType, + params?: QueryParams, + ): Promise { + try { + return await this.axios.get(`${path}/${currencyCode}/history`, { + params, + }) + } catch (error) { + return error + } + } +} diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..b86dd32 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,14 @@ +type CurrencyType = 'NGN' | 'USD' +type CountryType = 'NG' +type CardBrand = 'VISA' | 'MASTERCARD' +type IdentityType = 'PASSPORT' | 'VOTERS_CARD' | 'DRIVERS_LICENSE' + +interface QueryParams { + // YYYY-MM-DD + start_date?: string + end_date?: string + page_size?: number + page?: number +} + +export { CardBrand, CountryType, CurrencyType, IdentityType, QueryParams } diff --git a/tsconfig.json b/tsconfig.json index 6eacec7..e450fdf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,103 +1,19 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } + "allowSyntheticDefaultImports": true, + "alwaysStrict": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "target": "es6", + "module": "commonjs", + "declaration": true, + "outDir": "dist", + "strict": true + }, + "include": ["src"] } diff --git a/utils.ts b/utils.ts deleted file mode 100644 index f6e3337..0000000 --- a/utils.ts +++ /dev/null @@ -1,20 +0,0 @@ -type CurrencyType = "NGN" | "USD" -type CountryType = "NG" -type CardBrand = "VISA" | "MASTERCARD" -type IdentityType = "PASSPORT" | "VOTERS_CARD" | "DRIVERS_LICENSE" - -interface QueryParams { - // YYYY-MM-DD - start_date?: string - end_date?: string - page_size?: number - page?: number -} - -export { - CardBrand, - CountryType, - CurrencyType, - IdentityType, - QueryParams -} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index c696c22..ea3dbee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,6 +9,18 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" @@ -27,6 +39,11 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -47,10 +64,10 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== -"@types/node@^17.0.38": - version "17.0.38" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.38.tgz#f8bb07c371ccb1903f3752872c89f44006132947" - integrity sha512-5jY9RhV7c0Z4Jy09G+NIDTsCZ5G0L5n+Z+p+Y7t5VJHM30bgwzSjVtlcBxqAj+6L/swIlvtOSzr8rBk/aNyV2g== +"@types/node@^20.2.5": + version "20.2.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.2.5.tgz#26d295f3570323b2837d322180dfbf1ba156fefb" + integrity sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ== acorn-walk@^8.1.1: version "8.2.0" @@ -62,6 +79,28 @@ acorn@^8.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + arg@^4.1.0: version "4.1.3" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" @@ -72,13 +111,38 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -axios@^0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== +axios@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f" + integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA== dependencies: - follow-redirects "^1.14.9" + follow-redirects "^1.15.0" form-data "^4.0.0" + proxy-from-env "^1.1.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== combined-stream@^1.0.8: version "1.0.8" @@ -92,6 +156,15 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -102,10 +175,33 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -follow-redirects@^1.14.9: - version "1.15.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" - integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" form-data@^4.0.0: version "4.0.0" @@ -116,6 +212,41 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +glob@^10.2.5: + version "10.2.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.2.6.tgz#1e27edbb3bbac055cb97113e27a066c100a4e5e1" + integrity sha512-U/rnDpXJGF414QQQZv5uVsabTVxMSwzS5CH0p3DRCIV6ownl4f7PzGnkGmvlum2wB+9RlJWJZ6ACU1INnBqiPA== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.0.3" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2" + path-scurry "^1.7.0" + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +jackspeak@^2.0.3: + version "2.2.1" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.2.1.tgz#655e8cf025d872c9c03d3eb63e8f0c024fef16a6" + integrity sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + +lru-cache@^9.1.1: + version "9.1.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.2.tgz#255fdbc14b75589d6d0e73644ca167a8db506835" + integrity sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ== + make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -133,10 +264,103 @@ mime-types@^2.1.12: dependencies: mime-db "1.52.0" -ts-node@^10.8.2: - version "10.8.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.8.2.tgz#3185b75228cef116bf82ffe8762594f54b2a23f2" - integrity sha512-LYdGnoGddf1D6v8REPtIH+5iq/gTDuZqv2/UJUU7tKjuEU8xVZorBM+buCGNjj+pGEud+sOoM4CX3/YzINpENA== +minimatch@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.1.tgz#8a555f541cf976c622daf078bb28f29fb927c253" + integrity sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w== + dependencies: + brace-expansion "^2.0.1" + +"minipass@^5.0.0 || ^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-6.0.2.tgz#542844b6c4ce95b202c0995b0a471f1229de4c81" + integrity sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-scurry@^1.7.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.9.2.tgz#90f9d296ac5e37e608028e28a447b11d385b3f63" + integrity sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg== + dependencies: + lru-cache "^9.1.1" + minipass "^5.0.0 || ^6.0.2" + +prettier@^2.8.8: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + +rimraf@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.1.tgz#0881323ab94ad45fec7c0221f27ea1a142f3f0d0" + integrity sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg== + dependencies: + glob "^10.2.5" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" + integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== + +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: + name string-width-cjs + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: + name strip-ansi-cjs + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== dependencies: "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" @@ -152,16 +376,41 @@ ts-node@^10.8.2: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -typescript@^4.7.2: - version "4.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4" - integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A== +typescript@^5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826" + integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw== v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"