@afriex/sdk 1.1.1 → 1.2.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.js +24 -48
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,58 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
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 { WebhookVerifier } from '@afriex/webhooks';
|
|
8
|
+
export class AfriexSDK extends AfriexClient {
|
|
26
9
|
constructor(config) {
|
|
27
10
|
super(config);
|
|
28
11
|
const httpClient = this.getHttpClient();
|
|
29
|
-
this.customers = new
|
|
30
|
-
this.transactions = new
|
|
31
|
-
this.paymentMethods = new
|
|
32
|
-
this.balance = new
|
|
33
|
-
this.rates = new
|
|
12
|
+
this.customers = new CustomerService(httpClient);
|
|
13
|
+
this.transactions = new TransactionService(httpClient);
|
|
14
|
+
this.paymentMethods = new PaymentMethodService(httpClient);
|
|
15
|
+
this.balance = new BalanceService(httpClient);
|
|
16
|
+
this.rates = new RateService(httpClient);
|
|
34
17
|
if (config.webhookPublicKey) {
|
|
35
|
-
this.webhooks = new
|
|
18
|
+
this.webhooks = new WebhookVerifier(config.webhookPublicKey);
|
|
36
19
|
}
|
|
37
20
|
}
|
|
38
21
|
}
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
// Short alias
|
|
23
|
+
export { AfriexSDK as Afriex };
|
|
41
24
|
// Re-export core types
|
|
42
|
-
|
|
25
|
+
export * from '@afriex/core';
|
|
43
26
|
// Re-export service classes explicitly to avoid conflicts
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Object.defineProperty(exports, "BalanceService", { enumerable: true, get: function () { return balance_2.BalanceService; } });
|
|
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; } });
|
|
27
|
+
export { CustomerService } from '@afriex/customers';
|
|
28
|
+
export { TransactionService } from '@afriex/transactions';
|
|
29
|
+
export { PaymentMethodService } from '@afriex/payment-methods';
|
|
30
|
+
export { BalanceService } from '@afriex/balance';
|
|
31
|
+
export { RateService } from '@afriex/rates';
|
|
32
|
+
export { WebhookVerifier } from '@afriex/webhooks';
|
|
33
|
+
export { WEBHOOK_SIGNATURE_HEADER } from '@afriex/webhooks';
|
|
58
34
|
//# 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.2.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,19 @@
|
|
|
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/webhooks": "1.
|
|
23
|
+
"@afriex/core": "1.2.0",
|
|
24
|
+
"@afriex/customers": "1.2.0",
|
|
25
|
+
"@afriex/transactions": "1.2.0",
|
|
26
|
+
"@afriex/payment-methods": "1.2.0",
|
|
27
|
+
"@afriex/balance": "1.2.0",
|
|
28
|
+
"@afriex/rates": "1.2.0",
|
|
29
|
+
"@afriex/webhooks": "1.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"rimraf": "^5.0.5",
|