@fiatden/openpay 0.0.0-stage → 0.0.2
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/README.md +309 -2
- package/dist/analytics.test.d.ts +2 -0
- package/dist/analytics.test.d.ts.map +1 -0
- package/dist/analytics.test.js +184 -0
- package/dist/apps.test.d.ts +2 -0
- package/dist/apps.test.d.ts.map +1 -0
- package/dist/apps.test.js +92 -0
- package/dist/http.d.ts +22 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +56 -0
- package/dist/http.test.d.ts +2 -0
- package/dist/http.test.d.ts.map +1 -0
- package/dist/http.test.js +47 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +207 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +55 -0
- package/dist/resources/analytics.d.ts +220 -0
- package/dist/resources/analytics.d.ts.map +1 -0
- package/dist/resources/analytics.js +70 -0
- package/dist/resources/apiKeys.d.ts +22 -0
- package/dist/resources/apiKeys.d.ts.map +1 -0
- package/dist/resources/apiKeys.js +40 -0
- package/dist/resources/apps.d.ts +142 -0
- package/dist/resources/apps.d.ts.map +1 -0
- package/dist/resources/apps.js +49 -0
- package/dist/resources/auth.d.ts +71 -0
- package/dist/resources/auth.d.ts.map +1 -0
- package/dist/resources/auth.js +71 -0
- package/dist/resources/billing.d.ts +148 -0
- package/dist/resources/billing.d.ts.map +1 -0
- package/dist/resources/billing.js +55 -0
- package/dist/resources/charges.d.ts +67 -0
- package/dist/resources/charges.d.ts.map +1 -0
- package/dist/resources/charges.js +103 -0
- package/dist/resources/checkout.d.ts +80 -0
- package/dist/resources/checkout.d.ts.map +1 -0
- package/dist/resources/checkout.js +36 -0
- package/dist/resources/coupons.d.ts +66 -0
- package/dist/resources/coupons.d.ts.map +1 -0
- package/dist/resources/coupons.js +39 -0
- package/dist/resources/currencies.d.ts +45 -0
- package/dist/resources/currencies.d.ts.map +1 -0
- package/dist/resources/currencies.js +48 -0
- package/dist/resources/currencyPortfolio.d.ts +62 -0
- package/dist/resources/currencyPortfolio.d.ts.map +1 -0
- package/dist/resources/currencyPortfolio.js +34 -0
- package/dist/resources/customers.d.ts +171 -0
- package/dist/resources/customers.d.ts.map +1 -0
- package/dist/resources/customers.js +72 -0
- package/dist/resources/disputes.d.ts +48 -0
- package/dist/resources/disputes.d.ts.map +1 -0
- package/dist/resources/disputes.js +47 -0
- package/dist/resources/emailTemplates.d.ts +55 -0
- package/dist/resources/emailTemplates.d.ts.map +1 -0
- package/dist/resources/emailTemplates.js +49 -0
- package/dist/resources/financialAccounts.d.ts +49 -0
- package/dist/resources/financialAccounts.d.ts.map +1 -0
- package/dist/resources/financialAccounts.js +22 -0
- package/dist/resources/fx.d.ts +34 -0
- package/dist/resources/fx.d.ts.map +1 -0
- package/dist/resources/fx.js +27 -0
- package/dist/resources/invoices.d.ts +32 -0
- package/dist/resources/invoices.d.ts.map +1 -0
- package/dist/resources/invoices.js +36 -0
- package/dist/resources/merchants.d.ts +95 -0
- package/dist/resources/merchants.d.ts.map +1 -0
- package/dist/resources/merchants.js +113 -0
- package/dist/resources/metering.d.ts +65 -0
- package/dist/resources/metering.d.ts.map +1 -0
- package/dist/resources/metering.js +36 -0
- package/dist/resources/paymentLinks.d.ts +45 -0
- package/dist/resources/paymentLinks.d.ts.map +1 -0
- package/dist/resources/paymentLinks.js +32 -0
- package/dist/resources/paymentMethods.d.ts +34 -0
- package/dist/resources/paymentMethods.d.ts.map +1 -0
- package/dist/resources/paymentMethods.js +17 -0
- package/dist/resources/payouts.d.ts +51 -0
- package/dist/resources/payouts.d.ts.map +1 -0
- package/dist/resources/payouts.js +62 -0
- package/dist/resources/platform.d.ts +72 -0
- package/dist/resources/platform.d.ts.map +1 -0
- package/dist/resources/platform.js +42 -0
- package/dist/resources/providers.d.ts +61 -0
- package/dist/resources/providers.d.ts.map +1 -0
- package/dist/resources/providers.js +42 -0
- package/dist/resources/reconciliation.d.ts +125 -0
- package/dist/resources/reconciliation.d.ts.map +1 -0
- package/dist/resources/reconciliation.js +55 -0
- package/dist/resources/referrals.d.ts +25 -0
- package/dist/resources/referrals.d.ts.map +1 -0
- package/dist/resources/referrals.js +16 -0
- package/dist/resources/riskReview.d.ts +96 -0
- package/dist/resources/riskReview.d.ts.map +1 -0
- package/dist/resources/riskReview.js +44 -0
- package/dist/resources/roles.d.ts +59 -0
- package/dist/resources/roles.d.ts.map +1 -0
- package/dist/resources/roles.js +42 -0
- package/dist/resources/status.d.ts +20 -0
- package/dist/resources/status.d.ts.map +1 -0
- package/dist/resources/status.js +14 -0
- package/dist/resources/subscriptions.d.ts +46 -0
- package/dist/resources/subscriptions.d.ts.map +1 -0
- package/dist/resources/subscriptions.js +69 -0
- package/dist/resources/totp.d.ts +36 -0
- package/dist/resources/totp.d.ts.map +1 -0
- package/dist/resources/totp.js +41 -0
- package/dist/resources/wallets.d.ts +128 -0
- package/dist/resources/wallets.d.ts.map +1 -0
- package/dist/resources/wallets.js +74 -0
- package/dist/resources/webhooks.d.ts +47 -0
- package/dist/resources/webhooks.d.ts.map +1 -0
- package/dist/resources/webhooks.js +41 -0
- package/dist/types.d.ts +484 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +15 -0
- package/package.json +46 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentLinksResource = void 0;
|
|
4
|
+
class PaymentLinksResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
/** Create a shareable payment link. Returns a payment_url customers can visit. */
|
|
10
|
+
async create(params) {
|
|
11
|
+
return this.client.request('/v1/payment-links', {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
body: params,
|
|
14
|
+
idempotencyKey: params.idempotency_key,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** List payment links (optionally filtered by active status). */
|
|
18
|
+
async list(params) {
|
|
19
|
+
return this.client.request('/v1/payment-links', { params });
|
|
20
|
+
}
|
|
21
|
+
/** Get a single payment link by code. */
|
|
22
|
+
async get(code) {
|
|
23
|
+
return this.client.request(`/v1/payment-links/${code}`);
|
|
24
|
+
}
|
|
25
|
+
/** Deactivate a payment link so it stops accepting payments. */
|
|
26
|
+
async deactivate(code) {
|
|
27
|
+
return this.client.request(`/v1/payment-links/${code}`, {
|
|
28
|
+
method: 'PATCH',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.PaymentLinksResource = PaymentLinksResource;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HttpClient } from '../http';
|
|
2
|
+
import { ListResponse } from '../types';
|
|
3
|
+
export interface SavedPaymentMethod {
|
|
4
|
+
id: string;
|
|
5
|
+
customer_id: string;
|
|
6
|
+
provider: 'paystack' | 'flutterwave' | 'korapay' | 'hyperswitch';
|
|
7
|
+
card_type: string | null;
|
|
8
|
+
last4: string | null;
|
|
9
|
+
exp_month: number | null;
|
|
10
|
+
exp_year: number | null;
|
|
11
|
+
bin: string | null;
|
|
12
|
+
bank_name: string | null;
|
|
13
|
+
brand: string | null;
|
|
14
|
+
reusable: boolean;
|
|
15
|
+
app_id: string | null;
|
|
16
|
+
created_at: string;
|
|
17
|
+
updated_at: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class PaymentMethodsResource {
|
|
20
|
+
private client;
|
|
21
|
+
constructor(client: HttpClient);
|
|
22
|
+
list(params?: {
|
|
23
|
+
customer_id?: string;
|
|
24
|
+
provider?: string;
|
|
25
|
+
limit?: number;
|
|
26
|
+
offset?: number;
|
|
27
|
+
}): Promise<ListResponse<SavedPaymentMethod>>;
|
|
28
|
+
/** Delete (deauthorize) a saved payment method. */
|
|
29
|
+
remove(id: string): Promise<{
|
|
30
|
+
id: string;
|
|
31
|
+
deleted: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=paymentMethods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paymentMethods.d.ts","sourceRoot":"","sources":["../../src/resources/paymentMethods.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,aAAa,CAAC;IACjE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,sBAAsB;IACrB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAI5I,mDAAmD;IAC7C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAGpE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentMethodsResource = void 0;
|
|
4
|
+
class PaymentMethodsResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
async list(params) {
|
|
10
|
+
return this.client.request('/v1/payment-methods', { params });
|
|
11
|
+
}
|
|
12
|
+
/** Delete (deauthorize) a saved payment method. */
|
|
13
|
+
async remove(id) {
|
|
14
|
+
return this.client.request(`/v1/payment-methods/${encodeURIComponent(id)}`, { method: 'DELETE' });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.PaymentMethodsResource = PaymentMethodsResource;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HttpClient } from '../http';
|
|
2
|
+
import { PayoutCreateParams, Payout, ListResponse } from '../types';
|
|
3
|
+
export interface BulkPayoutRow {
|
|
4
|
+
merchant_id: string;
|
|
5
|
+
amount: number;
|
|
6
|
+
narration?: string;
|
|
7
|
+
bank_code?: string;
|
|
8
|
+
account_number?: string;
|
|
9
|
+
account_name?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BulkPayoutResult {
|
|
12
|
+
summary: {
|
|
13
|
+
total: number;
|
|
14
|
+
created: number;
|
|
15
|
+
skipped: number;
|
|
16
|
+
};
|
|
17
|
+
results: Array<{
|
|
18
|
+
row: number;
|
|
19
|
+
status: string;
|
|
20
|
+
id?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export declare class PayoutsResource {
|
|
25
|
+
private client;
|
|
26
|
+
constructor(client: HttpClient);
|
|
27
|
+
/** Request a payout (withdrawal) from a merchant wallet. */
|
|
28
|
+
create(params: PayoutCreateParams): Promise<Payout>;
|
|
29
|
+
/** Retrieve a payout by ID. */
|
|
30
|
+
retrieve(id: string): Promise<Payout>;
|
|
31
|
+
/** List payouts, optionally filtered by merchant or status. */
|
|
32
|
+
list(params?: {
|
|
33
|
+
merchant_id?: string;
|
|
34
|
+
status?: string;
|
|
35
|
+
}): Promise<ListResponse<Payout>>;
|
|
36
|
+
/** List scheduled (future-dated) payouts that haven't been processed yet. */
|
|
37
|
+
listScheduled(params?: {
|
|
38
|
+
merchant_id?: string;
|
|
39
|
+
}): Promise<ListResponse<Payout>>;
|
|
40
|
+
/** Create multiple payouts in a single batch (max 100 rows). */
|
|
41
|
+
createBulk(rows: BulkPayoutRow[], idempotencyKey?: string): Promise<BulkPayoutResult>;
|
|
42
|
+
/** List payouts awaiting admin approval (admin only). */
|
|
43
|
+
listAwaitingApproval(): Promise<ListResponse<Payout>>;
|
|
44
|
+
/** Approve an awaiting_approval payout and queue it for processing (admin only). */
|
|
45
|
+
approve(id: string): Promise<Payout>;
|
|
46
|
+
/** Reject an awaiting_approval payout, returning locked funds (admin only). */
|
|
47
|
+
reject(id: string, reason?: string): Promise<Payout>;
|
|
48
|
+
/** Cancel a pending/scheduled payout and release the reserved funds. */
|
|
49
|
+
cancel(id: string, reason?: string): Promise<Payout>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=payouts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payouts.d.ts","sourceRoot":"","sources":["../../src/resources/payouts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CA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AAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM1C,+EAA+E;IACzE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO1D,wEAAwE;IAClE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAM3D"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PayoutsResource = void 0;
|
|
4
|
+
class PayoutsResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
/** Request a payout (withdrawal) from a merchant wallet. */
|
|
10
|
+
async create(params) {
|
|
11
|
+
return this.client.request('/v1/payouts', {
|
|
12
|
+
method: 'POST',
|
|
13
|
+
body: params,
|
|
14
|
+
idempotencyKey: params.idempotency_key,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** Retrieve a payout by ID. */
|
|
18
|
+
async retrieve(id) {
|
|
19
|
+
return this.client.request(`/v1/payouts/${id}`);
|
|
20
|
+
}
|
|
21
|
+
/** List payouts, optionally filtered by merchant or status. */
|
|
22
|
+
async list(params) {
|
|
23
|
+
return this.client.request('/v1/payouts', { params });
|
|
24
|
+
}
|
|
25
|
+
/** List scheduled (future-dated) payouts that haven't been processed yet. */
|
|
26
|
+
async listScheduled(params) {
|
|
27
|
+
return this.client.request('/v1/payouts/scheduled', { params });
|
|
28
|
+
}
|
|
29
|
+
/** Create multiple payouts in a single batch (max 100 rows). */
|
|
30
|
+
async createBulk(rows, idempotencyKey) {
|
|
31
|
+
return this.client.request('/v1/payouts/bulk', {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
body: { rows },
|
|
34
|
+
idempotencyKey,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** List payouts awaiting admin approval (admin only). */
|
|
38
|
+
async listAwaitingApproval() {
|
|
39
|
+
return this.client.request('/v1/payouts/awaiting-approval');
|
|
40
|
+
}
|
|
41
|
+
/** Approve an awaiting_approval payout and queue it for processing (admin only). */
|
|
42
|
+
async approve(id) {
|
|
43
|
+
return this.client.request(`/v1/payouts/${encodeURIComponent(id)}/approve`, {
|
|
44
|
+
method: 'POST',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Reject an awaiting_approval payout, returning locked funds (admin only). */
|
|
48
|
+
async reject(id, reason) {
|
|
49
|
+
return this.client.request(`/v1/payouts/${encodeURIComponent(id)}/reject`, {
|
|
50
|
+
method: 'POST',
|
|
51
|
+
body: reason ? { reason } : {},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** Cancel a pending/scheduled payout and release the reserved funds. */
|
|
55
|
+
async cancel(id, reason) {
|
|
56
|
+
return this.client.request(`/v1/payouts/${encodeURIComponent(id)}/cancel`, {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
body: reason ? { reason } : {},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.PayoutsResource = PayoutsResource;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { HttpClient } from '../http';
|
|
2
|
+
export interface PlatformSettings {
|
|
3
|
+
platform_name: string;
|
|
4
|
+
platform_tagline: string;
|
|
5
|
+
logo_url: string | null;
|
|
6
|
+
primary_color: string;
|
|
7
|
+
accent_color: string;
|
|
8
|
+
support_email: string;
|
|
9
|
+
website_url: string | null;
|
|
10
|
+
privacy_policy_url: string | null;
|
|
11
|
+
commission_rate: number;
|
|
12
|
+
commission_cap: number;
|
|
13
|
+
referral_commission_rate: number;
|
|
14
|
+
}
|
|
15
|
+
export interface PlatformSettingsResponse {
|
|
16
|
+
settings: PlatformSettings;
|
|
17
|
+
overrides: Partial<PlatformSettings>;
|
|
18
|
+
}
|
|
19
|
+
export type PlatformSettingField = keyof PlatformSettings;
|
|
20
|
+
export interface SmtpSettings {
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
host: string | null;
|
|
23
|
+
port: number;
|
|
24
|
+
secure: boolean;
|
|
25
|
+
username: string | null;
|
|
26
|
+
fromAddress: string | null;
|
|
27
|
+
fromName: string | null;
|
|
28
|
+
hasPassword: boolean;
|
|
29
|
+
source: 'database' | 'env' | 'none';
|
|
30
|
+
}
|
|
31
|
+
export interface SmtpUpdateParams {
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
host?: string | null;
|
|
34
|
+
port?: number;
|
|
35
|
+
secure?: boolean;
|
|
36
|
+
username?: string | null;
|
|
37
|
+
/** Plaintext; encrypted before storage. Pass null to clear. */
|
|
38
|
+
password?: string | null;
|
|
39
|
+
from_address?: string | null;
|
|
40
|
+
from_name?: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface PlatformStatusReport {
|
|
43
|
+
ready: boolean;
|
|
44
|
+
checks: Array<{
|
|
45
|
+
key: string;
|
|
46
|
+
label: string;
|
|
47
|
+
ok: boolean;
|
|
48
|
+
detail?: string;
|
|
49
|
+
action?: string;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export declare class PlatformResource {
|
|
53
|
+
private client;
|
|
54
|
+
constructor(client: HttpClient);
|
|
55
|
+
getSettings(): Promise<PlatformSettingsResponse>;
|
|
56
|
+
updateSettings(patch: Partial<PlatformSettings>): Promise<PlatformSettingsResponse>;
|
|
57
|
+
getSmtp(): Promise<SmtpSettings>;
|
|
58
|
+
updateSmtp(params: SmtpUpdateParams): Promise<SmtpSettings>;
|
|
59
|
+
/** Send a test email through the active transport (SMTP when enabled). */
|
|
60
|
+
testSmtp(to: string): Promise<{
|
|
61
|
+
sent: boolean;
|
|
62
|
+
transport: 'smtp' | 'resend';
|
|
63
|
+
error?: string;
|
|
64
|
+
}>;
|
|
65
|
+
getStatus(): Promise<PlatformStatusReport>;
|
|
66
|
+
exportData(): Promise<Record<string, unknown>>;
|
|
67
|
+
importData(snapshot: Record<string, unknown>, dryRun?: boolean): Promise<{
|
|
68
|
+
applied: string[];
|
|
69
|
+
dry_run: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/resources/platform.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,gBAAgB,CAAC;AAE1D,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;I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,CAAC;IAK9F,SAAS,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAK1C,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAI9C,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAMtH"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlatformResource = void 0;
|
|
4
|
+
class PlatformResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
// ── Platform settings ─────────────────────────────────────
|
|
10
|
+
async getSettings() {
|
|
11
|
+
return this.client.request('/v1/platform/settings');
|
|
12
|
+
}
|
|
13
|
+
async updateSettings(patch) {
|
|
14
|
+
return this.client.request('/v1/platform/settings', { method: 'PUT', body: patch });
|
|
15
|
+
}
|
|
16
|
+
// ── SMTP transport ────────────────────────────────────────
|
|
17
|
+
async getSmtp() {
|
|
18
|
+
return this.client.request('/v1/platform/smtp');
|
|
19
|
+
}
|
|
20
|
+
async updateSmtp(params) {
|
|
21
|
+
return this.client.request('/v1/platform/smtp', { method: 'PUT', body: params });
|
|
22
|
+
}
|
|
23
|
+
/** Send a test email through the active transport (SMTP when enabled). */
|
|
24
|
+
async testSmtp(to) {
|
|
25
|
+
return this.client.request('/v1/platform/smtp/test', { method: 'POST', body: { to } });
|
|
26
|
+
}
|
|
27
|
+
// ── Operator readiness ────────────────────────────────────
|
|
28
|
+
async getStatus() {
|
|
29
|
+
return this.client.request('/v1/platform/status');
|
|
30
|
+
}
|
|
31
|
+
// ── Configuration export / import ─────────────────────────
|
|
32
|
+
async exportData() {
|
|
33
|
+
return this.client.request('/v1/platform/data/export');
|
|
34
|
+
}
|
|
35
|
+
async importData(snapshot, dryRun = false) {
|
|
36
|
+
return this.client.request('/v1/platform/data/import', {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
body: { snapshot, dry_run: dryRun },
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.PlatformResource = PlatformResource;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { HttpClient } from '../http';
|
|
2
|
+
export interface ProviderConfig {
|
|
3
|
+
provider: string;
|
|
4
|
+
display_name: string | null;
|
|
5
|
+
is_active: boolean;
|
|
6
|
+
is_default: boolean;
|
|
7
|
+
created_at: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ProvidersResource {
|
|
10
|
+
private client;
|
|
11
|
+
constructor(client: HttpClient);
|
|
12
|
+
listConfigs(): Promise<{
|
|
13
|
+
data: ProviderConfig[];
|
|
14
|
+
}>;
|
|
15
|
+
upsertConfig(params: {
|
|
16
|
+
provider: 'paystack' | 'flutterwave' | 'korapay' | 'hyperswitch';
|
|
17
|
+
secret_key: string;
|
|
18
|
+
public_key: string;
|
|
19
|
+
webhook_secret?: string;
|
|
20
|
+
display_name?: string;
|
|
21
|
+
settings?: Record<string, unknown>;
|
|
22
|
+
}): Promise<ProviderConfig>;
|
|
23
|
+
deleteConfig(provider: string): Promise<{
|
|
24
|
+
success: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
getFees(): Promise<{
|
|
27
|
+
data: Record<string, {
|
|
28
|
+
percentage: number;
|
|
29
|
+
cap: number;
|
|
30
|
+
flatFee: number;
|
|
31
|
+
}>;
|
|
32
|
+
}>;
|
|
33
|
+
/** Live provider health (success rate, latency, circuit state). */
|
|
34
|
+
getHealth(): Promise<{
|
|
35
|
+
data: Array<{
|
|
36
|
+
provider: string;
|
|
37
|
+
status: string;
|
|
38
|
+
success_rate?: number;
|
|
39
|
+
avg_latency_ms?: number;
|
|
40
|
+
}>;
|
|
41
|
+
}>;
|
|
42
|
+
/** Get the weighted-routing weights for each provider (admin only). */
|
|
43
|
+
getRouterWeights(): Promise<{
|
|
44
|
+
data: Array<{
|
|
45
|
+
provider: string;
|
|
46
|
+
weight: number;
|
|
47
|
+
}>;
|
|
48
|
+
}>;
|
|
49
|
+
/** Update one or more weighted-routing weights (admin only). */
|
|
50
|
+
updateRouterWeights(params: {
|
|
51
|
+
weights?: Record<string, number>;
|
|
52
|
+
provider?: string;
|
|
53
|
+
weight?: number;
|
|
54
|
+
}): Promise<{
|
|
55
|
+
data: Array<{
|
|
56
|
+
provider: string;
|
|
57
|
+
weight: number;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/resources/providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,iBAAiB;IAChB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,WAAW,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;IAIlD,YAAY,CAAC,MAAM,EAAE;QACzB,QAAQ,EAAE,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,aAAa,CAAC;QACjE,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,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ersResource = void 0;
|
|
4
|
+
class ProvidersResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
async listConfigs() {
|
|
10
|
+
return this.client.request('/v1/providers/config');
|
|
11
|
+
}
|
|
12
|
+
async upsertConfig(params) {
|
|
13
|
+
return this.client.request('/v1/providers/config', {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
body: params,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async deleteConfig(provider) {
|
|
19
|
+
return this.client.request(`/v1/providers/config/${provider}`, {
|
|
20
|
+
method: 'DELETE',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async getFees() {
|
|
24
|
+
return this.client.request('/v1/providers/fees');
|
|
25
|
+
}
|
|
26
|
+
/** Live provider health (success rate, latency, circuit state). */
|
|
27
|
+
async getHealth() {
|
|
28
|
+
return this.client.request('/v1/providers/health');
|
|
29
|
+
}
|
|
30
|
+
/** Get the weighted-routing weights for each provider (admin only). */
|
|
31
|
+
async getRouterWeights() {
|
|
32
|
+
return this.client.request('/v1/providers/router-weights');
|
|
33
|
+
}
|
|
34
|
+
/** Update one or more weighted-routing weights (admin only). */
|
|
35
|
+
async updateRouterWeights(params) {
|
|
36
|
+
return this.client.request('/v1/providers/router-weights', {
|
|
37
|
+
method: 'PATCH',
|
|
38
|
+
body: params,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.ProvidersResource = ProvidersResource;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { HttpClient } from '../http';
|
|
2
|
+
export interface ReconciliationReport {
|
|
3
|
+
id: string;
|
|
4
|
+
provider: string;
|
|
5
|
+
report_date: string;
|
|
6
|
+
filename?: string;
|
|
7
|
+
total_transactions: number;
|
|
8
|
+
total_amount: number;
|
|
9
|
+
total_fees: number;
|
|
10
|
+
matched_count: number;
|
|
11
|
+
mismatched_count: number;
|
|
12
|
+
missing_count: number;
|
|
13
|
+
status: 'processing' | 'completed' | 'failed';
|
|
14
|
+
created_at: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SettlementRecord {
|
|
17
|
+
id: string;
|
|
18
|
+
provider_reference?: string;
|
|
19
|
+
our_reference?: string;
|
|
20
|
+
amount?: number;
|
|
21
|
+
fee?: number;
|
|
22
|
+
settlement_amount?: number;
|
|
23
|
+
match_status: string;
|
|
24
|
+
}
|
|
25
|
+
export interface UploadReportParams {
|
|
26
|
+
provider: 'paystack' | 'flutterwave' | 'korapay' | 'hyperswitch';
|
|
27
|
+
report_date: string;
|
|
28
|
+
filename?: string;
|
|
29
|
+
records: Array<{
|
|
30
|
+
provider_reference?: string;
|
|
31
|
+
amount?: number;
|
|
32
|
+
fee?: number;
|
|
33
|
+
settlement_amount?: number;
|
|
34
|
+
settlement_date?: string;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
export declare class ReconciliationResource {
|
|
38
|
+
private client;
|
|
39
|
+
constructor(client: HttpClient);
|
|
40
|
+
upload(params: UploadReportParams): Promise<{
|
|
41
|
+
report: ReconciliationReport;
|
|
42
|
+
message: string;
|
|
43
|
+
idempotent?: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
listReports(params?: {
|
|
46
|
+
provider?: string;
|
|
47
|
+
status?: string;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
data: ReconciliationReport[];
|
|
50
|
+
has_more: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
getReport(id: string): Promise<{
|
|
53
|
+
report: ReconciliationReport;
|
|
54
|
+
summary: Array<{
|
|
55
|
+
match_status: string;
|
|
56
|
+
count: number;
|
|
57
|
+
total_amount: number;
|
|
58
|
+
}>;
|
|
59
|
+
records: SettlementRecord[];
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* List the settlement records belonging to a report. There is no global
|
|
63
|
+
* records endpoint on the platform; records are always scoped to a report.
|
|
64
|
+
*/
|
|
65
|
+
listRecords(reportId: string): Promise<{
|
|
66
|
+
data: SettlementRecord[];
|
|
67
|
+
has_more: boolean;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Synchronously re-run the matching pass on a report. Safe to call
|
|
71
|
+
* even if the row is in progress because processReconciliationReport
|
|
72
|
+
* is idempotent (insertRecords uses ON CONFLICT DO NOTHING; runMatching
|
|
73
|
+
* only updates). Returns the post-reprocess match counts.
|
|
74
|
+
*/
|
|
75
|
+
reprocess(id: string): Promise<{
|
|
76
|
+
message: string;
|
|
77
|
+
matched: number;
|
|
78
|
+
mismatched: number;
|
|
79
|
+
missing: number;
|
|
80
|
+
}>;
|
|
81
|
+
/** Get the reconciliation health summary for a date range. */
|
|
82
|
+
summary(params?: {
|
|
83
|
+
start_date?: string;
|
|
84
|
+
end_date?: string;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
period: {
|
|
87
|
+
start: string;
|
|
88
|
+
end: string;
|
|
89
|
+
};
|
|
90
|
+
summary: {
|
|
91
|
+
total_transactions: number;
|
|
92
|
+
reconciled: number;
|
|
93
|
+
pending: number;
|
|
94
|
+
mismatched: number;
|
|
95
|
+
disputed: number;
|
|
96
|
+
reconciliation_rate: number;
|
|
97
|
+
};
|
|
98
|
+
provider_breakdown: Array<{
|
|
99
|
+
provider: string;
|
|
100
|
+
total: number;
|
|
101
|
+
reconciled: number;
|
|
102
|
+
pending: number;
|
|
103
|
+
flagged: number;
|
|
104
|
+
}>;
|
|
105
|
+
}>;
|
|
106
|
+
/** List successful transactions that are not reconciled yet. */
|
|
107
|
+
listUnreconciled(params?: {
|
|
108
|
+
provider?: string;
|
|
109
|
+
limit?: number;
|
|
110
|
+
}): Promise<{
|
|
111
|
+
data: Array<SettlementRecord & {
|
|
112
|
+
reference?: string;
|
|
113
|
+
status?: string;
|
|
114
|
+
reconciliation_status?: string;
|
|
115
|
+
created_at?: string;
|
|
116
|
+
}>;
|
|
117
|
+
has_more: boolean;
|
|
118
|
+
}>;
|
|
119
|
+
/** Release an operator hold so the recovery worker can retry the report. */
|
|
120
|
+
clearOperatorHold(id: string): Promise<{
|
|
121
|
+
report: Record<string, unknown>;
|
|
122
|
+
message: string;
|
|
123
|
+
}>;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=reconciliation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconciliation.d.ts","sourceRoot":"","sources":["../../src/resources/reconciliation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,aAAa,CAAC;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,KAAK,C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AAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAKnG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReconciliationResource = void 0;
|
|
4
|
+
class ReconciliationResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
async upload(params) {
|
|
10
|
+
return this.client.request('/v1/reconciliation/upload', {
|
|
11
|
+
method: 'POST',
|
|
12
|
+
body: params,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async listReports(params) {
|
|
16
|
+
return this.client.request('/v1/reconciliation/reports', { params });
|
|
17
|
+
}
|
|
18
|
+
async getReport(id) {
|
|
19
|
+
return this.client.request(`/v1/reconciliation/reports/${id}`);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* List the settlement records belonging to a report. There is no global
|
|
23
|
+
* records endpoint on the platform; records are always scoped to a report.
|
|
24
|
+
*/
|
|
25
|
+
async listRecords(reportId) {
|
|
26
|
+
const res = await this.client.request(`/v1/reconciliation/reports/${reportId}`);
|
|
27
|
+
return { data: res.records || [], has_more: false };
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Synchronously re-run the matching pass on a report. Safe to call
|
|
31
|
+
* even if the row is in progress because processReconciliationReport
|
|
32
|
+
* is idempotent (insertRecords uses ON CONFLICT DO NOTHING; runMatching
|
|
33
|
+
* only updates). Returns the post-reprocess match counts.
|
|
34
|
+
*/
|
|
35
|
+
async reprocess(id) {
|
|
36
|
+
return this.client.request(`/v1/reconciliation/reports/${id}/reprocess`, {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/** Get the reconciliation health summary for a date range. */
|
|
41
|
+
async summary(params) {
|
|
42
|
+
return this.client.request('/v1/reconciliation/summary', { params });
|
|
43
|
+
}
|
|
44
|
+
/** List successful transactions that are not reconciled yet. */
|
|
45
|
+
async listUnreconciled(params) {
|
|
46
|
+
return this.client.request('/v1/reconciliation/unreconciled', { params });
|
|
47
|
+
}
|
|
48
|
+
/** Release an operator hold so the recovery worker can retry the report. */
|
|
49
|
+
async clearOperatorHold(id) {
|
|
50
|
+
return this.client.request(`/v1/reconciliation/reports/${id}/clear-operator-hold`, {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.ReconciliationResource = ReconciliationResource;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HttpClient } from '../http';
|
|
2
|
+
export interface Referral {
|
|
3
|
+
id: string;
|
|
4
|
+
referral_code: string;
|
|
5
|
+
commission_rate: number;
|
|
6
|
+
total_earned: number;
|
|
7
|
+
total_conversions: number;
|
|
8
|
+
status: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ReferralCommission {
|
|
11
|
+
id: string;
|
|
12
|
+
amount: number;
|
|
13
|
+
commission_amount: number;
|
|
14
|
+
status: string;
|
|
15
|
+
created_at: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class ReferralsResource {
|
|
18
|
+
private client;
|
|
19
|
+
constructor(client: HttpClient);
|
|
20
|
+
myReferral(): Promise<Referral>;
|
|
21
|
+
commissions(): Promise<{
|
|
22
|
+
data: ReferralCommission[];
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=referrals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referrals.d.ts","sourceRoot":"","sources":["../../src/resources/referrals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,iBAAiB;IAChB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC;IAI/B,WAAW,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,EAAE,CAAA;KAAE,CAAC;CAG7D"}
|