@afriex/sdk 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +27 -22
- package/dist/index.js +28 -48
- package/package.json +12 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AfriexClient, AfriexConfig } from
|
|
2
|
-
import { CustomerService } from
|
|
3
|
-
import { TransactionService } from
|
|
4
|
-
import { PaymentMethodService } from
|
|
5
|
-
import { BalanceService } from
|
|
6
|
-
import { RateService } from
|
|
7
|
-
import {
|
|
1
|
+
import { AfriexClient, AfriexConfig } from "@afriex/core";
|
|
2
|
+
import { CustomerService } from "@afriex/customers";
|
|
3
|
+
import { TransactionService } from "@afriex/transactions";
|
|
4
|
+
import { PaymentMethodService } from "@afriex/payment-methods";
|
|
5
|
+
import { BalanceService } from "@afriex/balance";
|
|
6
|
+
import { RateService } from "@afriex/rates";
|
|
7
|
+
import { CheckoutService } from "@afriex/checkout";
|
|
8
|
+
import { WebhookVerifier, WebhookService } from "@afriex/webhooks";
|
|
8
9
|
export interface AfriexSDKConfig extends AfriexConfig {
|
|
9
10
|
webhookPublicKey?: string;
|
|
10
11
|
}
|
|
@@ -14,22 +15,26 @@ export declare class AfriexSDK extends AfriexClient {
|
|
|
14
15
|
readonly paymentMethods: PaymentMethodService;
|
|
15
16
|
readonly balance: BalanceService;
|
|
16
17
|
readonly rates: RateService;
|
|
17
|
-
readonly
|
|
18
|
+
readonly checkout: CheckoutService;
|
|
19
|
+
readonly webhookVerifier?: WebhookVerifier;
|
|
20
|
+
readonly webhooks: WebhookService;
|
|
18
21
|
constructor(config: AfriexSDKConfig);
|
|
19
22
|
}
|
|
20
23
|
export { AfriexSDK as Afriex };
|
|
21
|
-
export * from
|
|
22
|
-
export { CustomerService } from
|
|
23
|
-
export { TransactionService } from
|
|
24
|
-
export { PaymentMethodService } from
|
|
25
|
-
export { BalanceService } from
|
|
26
|
-
export { RateService } from
|
|
27
|
-
export {
|
|
28
|
-
export
|
|
29
|
-
export type {
|
|
30
|
-
export type {
|
|
31
|
-
export type {
|
|
32
|
-
export type {
|
|
33
|
-
export type {
|
|
34
|
-
export {
|
|
24
|
+
export * from "@afriex/core";
|
|
25
|
+
export { CustomerService } from "@afriex/customers";
|
|
26
|
+
export { TransactionService } from "@afriex/transactions";
|
|
27
|
+
export { PaymentMethodService } from "@afriex/payment-methods";
|
|
28
|
+
export { BalanceService } from "@afriex/balance";
|
|
29
|
+
export { RateService } from "@afriex/rates";
|
|
30
|
+
export { CheckoutService } from "@afriex/checkout";
|
|
31
|
+
export { WebhookVerifier, WebhookService } from "@afriex/webhooks";
|
|
32
|
+
export type { Customer, CreateCustomerRequest, UpdateCustomerKycRequest, ListCustomersParams, CustomerListResponse, } from "@afriex/customers";
|
|
33
|
+
export type { Transaction, CreateTransactionRequest, ListTransactionsParams, TransactionListResponse, TransactionType, TransactionStatus, TransactionMeta, } from "@afriex/transactions";
|
|
34
|
+
export type { PaymentMethod, CreatePaymentMethodRequest, ListPaymentMethodsParams, PaymentMethodListResponse, PaymentChannel, Institution, ResolveAccountParams, ResolveAccountResponse, GetInstitutionsParams, CryptoWalletResponse, GetCryptoWalletParams, ListVirtualAccountsParams, CreateVirtualAccountParams, ListPoolAccountsParams, VirtualAccountListResponse, } from "@afriex/payment-methods";
|
|
35
|
+
export type { BalanceResponse, GetBalanceParams } from "@afriex/balance";
|
|
36
|
+
export type { RatesResponse, GetRatesParams } from "@afriex/rates";
|
|
37
|
+
export type { CheckoutSession, CreateCheckoutSessionRequest, CheckoutCustomer, CheckoutTransaction, } from "@afriex/checkout";
|
|
38
|
+
export type { WebhookPayload, CustomerWebhookPayload, CustomerEventType, CustomerWebhookData, PaymentMethodWebhookPayload, PaymentMethodEventType, PaymentMethodWebhookData, TransactionWebhookPayload, TransactionEventType, TransactionWebhookData, TransactionWebhookStatus, TriggerWebhookRequest, WebhookEventType, } from "@afriex/webhooks";
|
|
39
|
+
export { WEBHOOK_SIGNATURE_HEADER } from "@afriex/webhooks";
|
|
35
40
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,58 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WEBHOOK_SIGNATURE_HEADER = exports.WebhookVerifier = exports.RateService = exports.BalanceService = exports.PaymentMethodService = exports.TransactionService = exports.CustomerService = exports.Afriex = exports.AfriexSDK = void 0;
|
|
18
|
-
const core_1 = require("@afriex/core");
|
|
19
|
-
const customers_1 = require("@afriex/customers");
|
|
20
|
-
const transactions_1 = require("@afriex/transactions");
|
|
21
|
-
const payment_methods_1 = require("@afriex/payment-methods");
|
|
22
|
-
const balance_1 = require("@afriex/balance");
|
|
23
|
-
const rates_1 = require("@afriex/rates");
|
|
24
|
-
const webhooks_1 = require("@afriex/webhooks");
|
|
25
|
-
class AfriexSDK extends core_1.AfriexClient {
|
|
1
|
+
import { AfriexClient } from "@afriex/core";
|
|
2
|
+
import { CustomerService } from "@afriex/customers";
|
|
3
|
+
import { TransactionService } from "@afriex/transactions";
|
|
4
|
+
import { PaymentMethodService } from "@afriex/payment-methods";
|
|
5
|
+
import { BalanceService } from "@afriex/balance";
|
|
6
|
+
import { RateService } from "@afriex/rates";
|
|
7
|
+
import { CheckoutService } from "@afriex/checkout";
|
|
8
|
+
import { WebhookVerifier, WebhookService } from "@afriex/webhooks";
|
|
9
|
+
export class AfriexSDK extends AfriexClient {
|
|
26
10
|
constructor(config) {
|
|
27
11
|
super(config);
|
|
28
12
|
const httpClient = this.getHttpClient();
|
|
29
|
-
this.customers = new
|
|
30
|
-
this.transactions = new
|
|
31
|
-
this.paymentMethods = new
|
|
32
|
-
this.balance = new
|
|
33
|
-
this.rates = new
|
|
13
|
+
this.customers = new CustomerService(httpClient);
|
|
14
|
+
this.transactions = new TransactionService(httpClient);
|
|
15
|
+
this.paymentMethods = new PaymentMethodService(httpClient);
|
|
16
|
+
this.balance = new BalanceService(httpClient);
|
|
17
|
+
this.rates = new RateService(httpClient);
|
|
18
|
+
this.checkout = new CheckoutService(httpClient);
|
|
19
|
+
this.webhooks = new WebhookService(httpClient);
|
|
34
20
|
if (config.webhookPublicKey) {
|
|
35
|
-
this.
|
|
21
|
+
this.webhookVerifier = new WebhookVerifier(config.webhookPublicKey);
|
|
36
22
|
}
|
|
37
23
|
}
|
|
38
24
|
}
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
// Short alias
|
|
26
|
+
export { AfriexSDK as Afriex };
|
|
41
27
|
// Re-export core types
|
|
42
|
-
|
|
28
|
+
export * from "@afriex/core";
|
|
43
29
|
// Re-export service classes explicitly to avoid conflicts
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var rates_2 = require("@afriex/rates");
|
|
53
|
-
Object.defineProperty(exports, "RateService", { enumerable: true, get: function () { return rates_2.RateService; } });
|
|
54
|
-
var webhooks_2 = require("@afriex/webhooks");
|
|
55
|
-
Object.defineProperty(exports, "WebhookVerifier", { enumerable: true, get: function () { return webhooks_2.WebhookVerifier; } });
|
|
56
|
-
var webhooks_3 = require("@afriex/webhooks");
|
|
57
|
-
Object.defineProperty(exports, "WEBHOOK_SIGNATURE_HEADER", { enumerable: true, get: function () { return webhooks_3.WEBHOOK_SIGNATURE_HEADER; } });
|
|
30
|
+
export { CustomerService } from "@afriex/customers";
|
|
31
|
+
export { TransactionService } from "@afriex/transactions";
|
|
32
|
+
export { PaymentMethodService } from "@afriex/payment-methods";
|
|
33
|
+
export { BalanceService } from "@afriex/balance";
|
|
34
|
+
export { RateService } from "@afriex/rates";
|
|
35
|
+
export { CheckoutService } from "@afriex/checkout";
|
|
36
|
+
export { WebhookVerifier, WebhookService } from "@afriex/webhooks";
|
|
37
|
+
export { WEBHOOK_SIGNATURE_HEADER } from "@afriex/webhooks";
|
|
58
38
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@afriex/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Official TypeScript SDK for the Afriex Business API",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
7
8
|
"homepage": "https://afriex-sdk-docs.vercel.app",
|
|
@@ -13,20 +14,20 @@
|
|
|
13
14
|
"author": "Victory Lucky <luckyvictory54@gmail.com>",
|
|
14
15
|
"exports": {
|
|
15
16
|
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
16
18
|
"import": "./dist/index.js",
|
|
17
|
-
"
|
|
18
|
-
"default": "./dist/index.js",
|
|
19
|
-
"types": "./dist/index.d.ts"
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@afriex/core": "1.
|
|
24
|
-
"@afriex/
|
|
25
|
-
"@afriex/
|
|
26
|
-
"@afriex/payment-methods": "1.
|
|
27
|
-
"@afriex/balance": "1.
|
|
28
|
-
"@afriex/rates": "1.
|
|
29
|
-
"@afriex/
|
|
23
|
+
"@afriex/core": "1.3.0",
|
|
24
|
+
"@afriex/customers": "1.3.0",
|
|
25
|
+
"@afriex/transactions": "1.3.0",
|
|
26
|
+
"@afriex/payment-methods": "1.3.0",
|
|
27
|
+
"@afriex/balance": "1.3.0",
|
|
28
|
+
"@afriex/rates": "1.3.0",
|
|
29
|
+
"@afriex/checkout": "1.0.0",
|
|
30
|
+
"@afriex/webhooks": "1.3.0"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"rimraf": "^5.0.5",
|