@delopay/sdk 0.5.1 → 0.7.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/chunk-NKSNI5HS.js +2817 -0
- package/dist/chunk-NKSNI5HS.js.map +1 -0
- package/dist/index.cjs +6 -278
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -412
- package/dist/index.d.ts +12 -412
- package/dist/index.js +15 -3070
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +3102 -0
- package/dist/internal.cjs.map +1 -0
- package/dist/internal.d.cts +398 -0
- package/dist/internal.d.ts +398 -0
- package/dist/internal.js +269 -0
- package/dist/internal.js.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { ProjectResponse, ShopResponse, PaymentResponse, RequestFn, AuthResponse, SignUpWithMerchantIdRequest, MerchantAccountResponse, MerchantAccountUpdateRequest, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, Delopay } from './index.js';
|
|
2
|
+
export { Address, AddressDetails, AdminAdjustmentRequest, AdminAdjustmentResponse, AllocationListResponse, AllocationResponse, AllocationTransferRequest, AllocationTransferResponse, Analytics, AnalyticsDashboard, ApiKeyCreateRequest, ApiKeyCreateResponse, ApiKeyExpiration, ApiKeyResponse, ApiKeyRevokeResponse, ApiKeyUpdateRequest, ApplePayVerificationRequest, ApplePayVerificationResponse, ApplePayVerifiedDomainsResponse, AuthenticationCreateRequest, AuthenticationResponse, AuthenticationStatus, AuthenticationType, AutoRechargeConfig, AutoRechargeUpdateRequest, BillingCompleteSetupRequest, BillingProfileResponse, BillingSetupRequest, BillingSetupResponse, BlocklistAddRequest, BlocklistDataKind, BlocklistResponse, CaptureMethod, CardDetail, CardDetailFromLocker, Cards, ChangePasswordRequest, ConnectorCreateRequest, ConnectorListResponse, ConnectorResponse, ConnectorType, ConnectorUpdateRequest, Currency, CustomerCreateRequest, CustomerListParams, CustomerPaymentMethodsListParams, CustomerPaymentMethodsListResponse, CustomerResponse, CustomerUpdateRequest, DelopayAuthenticationError, DelopayError, DelopayLogger, DelopayOptions, DisputeEvidenceRequest, DisputeListParams, DisputeResponse, DisputeStage, DisputeStatus, EphemeralKeyCreateRequest, EphemeralKeyCreateResponse, EventClass, EventDeliveryAttemptResponse, EventDetailResponse, EventListParams, EventListResponse, EventResponse, EventType, Export, FeatureMatrix, FeeOwner, FeeType, Files, Forex, ForgotPasswordRequest, FromEmailRequest, GatewayConnectRequest, GatewayResponse, IntentStatus, InviteUsersRequest, InviteUsersResponse, LedgerEntry, LedgerListParams, LedgerResponse, MandateListParams, MandateResponse, MandateRevokedResponse, MandateStatus, MandateType, MerchantAccountCreateRequest, MerchantAccountType, MerchantOverviewResponse, MerchantOverviewStat, PaymentCancelRequest, PaymentCaptureRequest, PaymentConfirmRequest, PaymentCreateRequest, PaymentLinkListParams, PaymentLinkListResponse, PaymentLinkResponse, PaymentListParams, PaymentListResponse, PaymentMethod, PaymentMethodCreateRequest, PaymentMethodDeleteResponse, PaymentMethodListParams, PaymentMethodResponse, PaymentMethodType, PaymentMethodUpdateRequest, PaymentUpdateRequest, PayoutCreateRequest, PayoutListParams, PayoutListResponse, PayoutResponse, PayoutStatus, PayoutType, PayoutUpdateRequest, PhoneDetails, PhoneOtpRequest, PhoneOtpResponse, PhoneOtpVerifyRequest, PhoneOtpVerifyResponse, PollStatus, PollStatusResponse, ProfileAcquirerCreateRequest, ProfileAcquirerResponse, ProfileAcquirerUpdateRequest, ProfileCreateRequest, ProfileResponse, ProfileUpdateRequest, ProjectCreateRequest, ProjectStats, ProjectStatsResponse, ProjectUpdateRequest, RecoveryCodesResponse, RefundCreateRequest, RefundListParams, RefundListResponse, RefundResponse, RefundStatus, RefundType, RefundUpdateRequest, RegionCreateRequest, RegionResponse, RegionUpdateRequest, Regions, RelayRequest, RelayResponse, RelayStatus, RelayType, RequestOptions, ResetPasswordRequest, RoutingConfigCreateRequest, RoutingConfigResponse, ShopCreateRequest, ShopStats, ShopUpdateRequest, SignInRequest, SignUpRequest, SignUpWithMerchantRequest, StripeConnectAccountRequest, StripeConnectAccountResponse, StripeConnectLinkRequest, StripeConnectLinkResponse, SubscriptionCreateRequest, SubscriptionListParams, SubscriptionListResponse, SubscriptionResponse, SubscriptionUpdateRequest, Subscriptions, SwitchMerchantRequest, SwitchProfileRequest, Terminate2faQueryParams, ThreeDSDecision, ThreeDsRuleExecuteRequest, ThreeDsRuleResponse, TokenPurpose, TokenResponse, TopupRequest, TopupResponse, TotpResponse, TransactionType, UpdateUserDetailsRequest, UserResponse, VerifyOptions, VerifyTotpRequest, WebhookDeliveryAttempt, WebhookEvent, Webhooks } from './index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Internal-only type surface. Exposed via `'@delopay/sdk/internal'` only.
|
|
6
|
+
*
|
|
7
|
+
* Any type that describes an admin-plane operation (bootstrap admin
|
|
8
|
+
* signup, platform analytics, audit log read, card-issuer program mgmt,
|
|
9
|
+
* GSM routing rules, …) lives here rather than in the public types
|
|
10
|
+
* barrel — otherwise merchants importing from `'@delopay/sdk'` could
|
|
11
|
+
* autocomplete or destructure shapes that hint at the admin API.
|
|
12
|
+
*
|
|
13
|
+
* Types that are genuinely shared between merchant and admin resources
|
|
14
|
+
* (e.g. `FeeSchedule*`, `ProjectResponse`, `PaymentResponse`) stay in
|
|
15
|
+
* `src/types.ts` and are imported here where needed.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
interface AdminSignInRequest {
|
|
19
|
+
email: string;
|
|
20
|
+
password: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Response returned by admin signup/signin endpoints.
|
|
24
|
+
*
|
|
25
|
+
* The admin flow is passwordless-after-signup: the endpoint triggers an
|
|
26
|
+
* email (confirmation or sign-in link) and `is_email_sent` indicates whether
|
|
27
|
+
* delivery was attempted successfully.
|
|
28
|
+
*/
|
|
29
|
+
interface AuthorizeResponse {
|
|
30
|
+
is_email_sent: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Create a new internal DeloPay admin user. Requires the server admin API key. */
|
|
33
|
+
interface CreateInternalUserRequest {
|
|
34
|
+
name: string;
|
|
35
|
+
email: string;
|
|
36
|
+
password: string;
|
|
37
|
+
/** Predefined internal role id (e.g. `internal_view_only`). Cannot be `internal_admin`. */
|
|
38
|
+
role_id: string;
|
|
39
|
+
}
|
|
40
|
+
/** Create a new tenant-level admin user. Requires the server admin API key. */
|
|
41
|
+
interface CreateTenantUserRequest {
|
|
42
|
+
name: string;
|
|
43
|
+
email: string;
|
|
44
|
+
password: string;
|
|
45
|
+
}
|
|
46
|
+
/** Bootstrap a new merchant: creates user, merchant account, project, profile, and API keys in one call. */
|
|
47
|
+
interface OnboardMerchantRequest {
|
|
48
|
+
email: string;
|
|
49
|
+
name: string;
|
|
50
|
+
password: string;
|
|
51
|
+
company_name: string;
|
|
52
|
+
}
|
|
53
|
+
/** All identifiers and keys produced by the onboard flow. */
|
|
54
|
+
interface OnboardMerchantResponse {
|
|
55
|
+
merchant_id: string;
|
|
56
|
+
user_id: string;
|
|
57
|
+
user_email: string;
|
|
58
|
+
project_id: string;
|
|
59
|
+
profile_id: string;
|
|
60
|
+
/** Secret API key (sk_…). Show once; store securely. */
|
|
61
|
+
api_key: string;
|
|
62
|
+
/** Publishable key (pk_…) for client-side SDKs. */
|
|
63
|
+
publishable_key: string;
|
|
64
|
+
}
|
|
65
|
+
/** Toggle public signup on or off at runtime. */
|
|
66
|
+
interface SignupToggleRequest {
|
|
67
|
+
enabled: boolean;
|
|
68
|
+
}
|
|
69
|
+
/** Current public-signup status. */
|
|
70
|
+
interface SignupToggleResponse {
|
|
71
|
+
signup_enabled: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface AdminCustomerListParams {
|
|
74
|
+
search?: string | null;
|
|
75
|
+
is_active?: boolean | null;
|
|
76
|
+
offset?: number | null;
|
|
77
|
+
limit?: number | null;
|
|
78
|
+
}
|
|
79
|
+
interface CustomerSummary {
|
|
80
|
+
customer_id: string;
|
|
81
|
+
organization_id: string;
|
|
82
|
+
shop_count: number;
|
|
83
|
+
is_active: boolean;
|
|
84
|
+
created_at: string;
|
|
85
|
+
customer_name?: string | null;
|
|
86
|
+
email?: string | null;
|
|
87
|
+
}
|
|
88
|
+
interface AdminCustomerListResponse {
|
|
89
|
+
customers: CustomerSummary[];
|
|
90
|
+
total_count: number;
|
|
91
|
+
offset: number;
|
|
92
|
+
limit: number;
|
|
93
|
+
}
|
|
94
|
+
interface CustomerUser {
|
|
95
|
+
user_id: string;
|
|
96
|
+
email?: string | null;
|
|
97
|
+
name?: string | null;
|
|
98
|
+
role_id?: string | null;
|
|
99
|
+
is_active: boolean;
|
|
100
|
+
created_at: string;
|
|
101
|
+
}
|
|
102
|
+
interface AdminCustomerDetail {
|
|
103
|
+
customer_id: string;
|
|
104
|
+
organization_id: string;
|
|
105
|
+
employee_count: number;
|
|
106
|
+
total_transactions: number;
|
|
107
|
+
total_volume: number;
|
|
108
|
+
created_at: string;
|
|
109
|
+
customer_name?: string | null;
|
|
110
|
+
projects: ProjectResponse[];
|
|
111
|
+
shops: ShopResponse[];
|
|
112
|
+
users: CustomerUser[];
|
|
113
|
+
}
|
|
114
|
+
interface AdminTransactionListParams {
|
|
115
|
+
merchant_id?: string | null;
|
|
116
|
+
shop_id?: string | null;
|
|
117
|
+
status?: string | null;
|
|
118
|
+
start_date?: string | null;
|
|
119
|
+
end_date?: string | null;
|
|
120
|
+
offset?: number | null;
|
|
121
|
+
limit?: number | null;
|
|
122
|
+
}
|
|
123
|
+
interface AdminTransactionListResponse {
|
|
124
|
+
data: PaymentResponse[];
|
|
125
|
+
total_count?: number | null;
|
|
126
|
+
}
|
|
127
|
+
interface AdminAnalyticsRequest {
|
|
128
|
+
start_date?: string | null;
|
|
129
|
+
end_date?: string | null;
|
|
130
|
+
}
|
|
131
|
+
interface OverviewStat {
|
|
132
|
+
label: string;
|
|
133
|
+
value: number;
|
|
134
|
+
change_percent: number;
|
|
135
|
+
}
|
|
136
|
+
interface OverviewStatsResponse {
|
|
137
|
+
total_accounts: OverviewStat;
|
|
138
|
+
total_admins: OverviewStat;
|
|
139
|
+
audit_events: OverviewStat;
|
|
140
|
+
}
|
|
141
|
+
interface PlatformAnalyticsResponse {
|
|
142
|
+
total_customers: number;
|
|
143
|
+
total_shops: number;
|
|
144
|
+
total_transactions: number;
|
|
145
|
+
total_volume: number;
|
|
146
|
+
total_fees_collected: number;
|
|
147
|
+
period_start: string;
|
|
148
|
+
period_end: string;
|
|
149
|
+
}
|
|
150
|
+
interface PaymentAnalyticsRequest {
|
|
151
|
+
period?: number | null;
|
|
152
|
+
currency?: string | null;
|
|
153
|
+
}
|
|
154
|
+
interface PaymentStat {
|
|
155
|
+
label: string;
|
|
156
|
+
value: number;
|
|
157
|
+
change_percent: number;
|
|
158
|
+
}
|
|
159
|
+
interface PaymentAnalyticsResponse {
|
|
160
|
+
total_volume: PaymentStat;
|
|
161
|
+
success_rate: PaymentStat;
|
|
162
|
+
transactions: PaymentStat;
|
|
163
|
+
avg_transaction: PaymentStat;
|
|
164
|
+
currency: string;
|
|
165
|
+
period_days: number;
|
|
166
|
+
}
|
|
167
|
+
interface AuditLogListParams {
|
|
168
|
+
user_id?: string | null;
|
|
169
|
+
merchant_id?: string | null;
|
|
170
|
+
profile_id?: string | null;
|
|
171
|
+
action?: string | null;
|
|
172
|
+
entity_type?: string | null;
|
|
173
|
+
start_date?: string | null;
|
|
174
|
+
end_date?: string | null;
|
|
175
|
+
offset?: number | null;
|
|
176
|
+
limit?: number | null;
|
|
177
|
+
}
|
|
178
|
+
interface AuditLogResponse {
|
|
179
|
+
id: string;
|
|
180
|
+
user_id: string;
|
|
181
|
+
action: string;
|
|
182
|
+
entity_type: string;
|
|
183
|
+
created_at: string;
|
|
184
|
+
merchant_id?: string | null;
|
|
185
|
+
profile_id?: string | null;
|
|
186
|
+
entity_id?: string | null;
|
|
187
|
+
details?: unknown | null;
|
|
188
|
+
ip_address?: string | null;
|
|
189
|
+
}
|
|
190
|
+
interface AuditLogListResponse {
|
|
191
|
+
entries: AuditLogResponse[];
|
|
192
|
+
total_count: number;
|
|
193
|
+
offset: number;
|
|
194
|
+
limit: number;
|
|
195
|
+
}
|
|
196
|
+
interface CardIssuerCreateRequest {
|
|
197
|
+
issuer_name: string;
|
|
198
|
+
}
|
|
199
|
+
interface CardIssuerUpdateRequest {
|
|
200
|
+
issuer_name: string;
|
|
201
|
+
}
|
|
202
|
+
interface CardIssuerResponse {
|
|
203
|
+
id: string;
|
|
204
|
+
issuer_name: string;
|
|
205
|
+
}
|
|
206
|
+
interface CardIssuerListResponse {
|
|
207
|
+
issuers: CardIssuerResponse[];
|
|
208
|
+
}
|
|
209
|
+
type GsmDecision = 'retry' | 'do_default';
|
|
210
|
+
interface GsmRuleCreateRequest {
|
|
211
|
+
connector: string;
|
|
212
|
+
flow: string;
|
|
213
|
+
sub_flow: string;
|
|
214
|
+
code: string;
|
|
215
|
+
message: string;
|
|
216
|
+
status: string;
|
|
217
|
+
decision: GsmDecision;
|
|
218
|
+
step_up_possible: boolean;
|
|
219
|
+
clear_pan_possible: boolean;
|
|
220
|
+
router_error?: string | null;
|
|
221
|
+
unified_code?: string | null;
|
|
222
|
+
unified_message?: string | null;
|
|
223
|
+
}
|
|
224
|
+
interface GsmRuleUpdateRequest {
|
|
225
|
+
connector: string;
|
|
226
|
+
flow: string;
|
|
227
|
+
sub_flow: string;
|
|
228
|
+
code: string;
|
|
229
|
+
message: string;
|
|
230
|
+
status?: string | null;
|
|
231
|
+
router_error?: string | null;
|
|
232
|
+
decision?: GsmDecision | null;
|
|
233
|
+
step_up_possible?: boolean | null;
|
|
234
|
+
unified_code?: string | null;
|
|
235
|
+
unified_message?: string | null;
|
|
236
|
+
}
|
|
237
|
+
interface GsmRuleResponse {
|
|
238
|
+
connector: string;
|
|
239
|
+
flow: string;
|
|
240
|
+
sub_flow: string;
|
|
241
|
+
code: string;
|
|
242
|
+
message: string;
|
|
243
|
+
status: string;
|
|
244
|
+
decision: GsmDecision;
|
|
245
|
+
step_up_possible: boolean;
|
|
246
|
+
clear_pan_possible: boolean;
|
|
247
|
+
feature: string;
|
|
248
|
+
feature_data: unknown;
|
|
249
|
+
router_error?: string | null;
|
|
250
|
+
unified_code?: string | null;
|
|
251
|
+
unified_message?: string | null;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare class Admin {
|
|
255
|
+
private readonly request;
|
|
256
|
+
constructor(request: RequestFn);
|
|
257
|
+
signIn(params: AdminSignInRequest): Promise<AuthResponse>;
|
|
258
|
+
createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse>;
|
|
259
|
+
createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse>;
|
|
260
|
+
/**
|
|
261
|
+
* Create a new merchant admin user and merchant account atomically.
|
|
262
|
+
*
|
|
263
|
+
* This is the correct endpoint for bootstrapping the first admin user in a
|
|
264
|
+
* fresh deployment — `internal_signup`/`tenant_signup` both require
|
|
265
|
+
* pre-existing merchant records that don't exist on a clean database.
|
|
266
|
+
*
|
|
267
|
+
* `POST /admin/signup_with_merchant_id`
|
|
268
|
+
*/
|
|
269
|
+
signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse>;
|
|
270
|
+
/** Toggle public signup on/off. `POST /admin/settings/signup` */
|
|
271
|
+
setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse>;
|
|
272
|
+
/** Read current public-signup status. `GET /admin/settings/signup` */
|
|
273
|
+
getSignupSettings(): Promise<SignupToggleResponse>;
|
|
274
|
+
/** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */
|
|
275
|
+
onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse>;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
declare class AdminPortal {
|
|
279
|
+
private readonly request;
|
|
280
|
+
constructor(request: RequestFn);
|
|
281
|
+
listCustomers(params?: AdminCustomerListParams): Promise<AdminCustomerListResponse>;
|
|
282
|
+
getCustomer(customerId: string): Promise<AdminCustomerDetail>;
|
|
283
|
+
listTransactions(params?: AdminTransactionListParams): Promise<AdminTransactionListResponse>;
|
|
284
|
+
analytics(params: AdminAnalyticsRequest): Promise<PlatformAnalyticsResponse>;
|
|
285
|
+
overviewStats(): Promise<OverviewStatsResponse>;
|
|
286
|
+
paymentAnalytics(params: PaymentAnalyticsRequest): Promise<PaymentAnalyticsResponse>;
|
|
287
|
+
/**
|
|
288
|
+
* Retrieve a merchant account via the admin portal. Unlike
|
|
289
|
+
* `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API
|
|
290
|
+
* key) and does not require the JWT to be scoped to the target merchant.
|
|
291
|
+
*/
|
|
292
|
+
retrieveAccount(merchantId: string): Promise<MerchantAccountResponse>;
|
|
293
|
+
/**
|
|
294
|
+
* Update a merchant account via the admin portal. Authenticated via admin JWT
|
|
295
|
+
* or admin API key.
|
|
296
|
+
*/
|
|
297
|
+
updateAccount(merchantId: string, params: MerchantAccountUpdateRequest): Promise<MerchantAccountResponse>;
|
|
298
|
+
/**
|
|
299
|
+
* Delete a merchant account via the admin portal. Authenticated via admin JWT
|
|
300
|
+
* or admin API key.
|
|
301
|
+
*/
|
|
302
|
+
deleteAccount(merchantId: string): Promise<MerchantAccountResponse>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
declare class AuditLogs {
|
|
306
|
+
private readonly request;
|
|
307
|
+
constructor(request: RequestFn);
|
|
308
|
+
list(params?: AuditLogListParams): Promise<AuditLogListResponse>;
|
|
309
|
+
retrieve(logId: string): Promise<AuditLogResponse>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
declare class Cache {
|
|
313
|
+
private readonly request;
|
|
314
|
+
constructor(request: RequestFn);
|
|
315
|
+
/** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */
|
|
316
|
+
invalidate(key: string): Promise<Record<string, unknown>>;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
declare class CardIssuers {
|
|
320
|
+
private readonly request;
|
|
321
|
+
constructor(request: RequestFn);
|
|
322
|
+
create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse>;
|
|
323
|
+
update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse>;
|
|
324
|
+
list(): Promise<CardIssuerListResponse>;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
declare class Configs {
|
|
328
|
+
private readonly request;
|
|
329
|
+
constructor(request: RequestFn);
|
|
330
|
+
/** Create a config. `POST /configs` */
|
|
331
|
+
create(params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
332
|
+
/** Retrieve a config by key. `GET /configs/{key}` */
|
|
333
|
+
retrieve(key: string): Promise<Record<string, unknown>>;
|
|
334
|
+
/** Update a config. `PUT /configs/{key}` */
|
|
335
|
+
update(key: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
336
|
+
/** Delete a config. `DELETE /configs/{key}` */
|
|
337
|
+
delete(key: string): Promise<Record<string, unknown>>;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
declare class Gsm {
|
|
341
|
+
private readonly request;
|
|
342
|
+
constructor(request: RequestFn);
|
|
343
|
+
create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse>;
|
|
344
|
+
retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse>;
|
|
345
|
+
update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse>;
|
|
346
|
+
delete(params: Record<string, unknown>): Promise<GsmRuleResponse>;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Platform-wide fee schedule management. Admin-only routes under
|
|
351
|
+
* `/admin/fees/*`. Exposed only via `'@delopay/sdk/internal'`.
|
|
352
|
+
*/
|
|
353
|
+
declare class PlatformFees {
|
|
354
|
+
private readonly request;
|
|
355
|
+
constructor(request: RequestFn);
|
|
356
|
+
/** Create a platform fee schedule for a specific merchant. */
|
|
357
|
+
create(params: FeeScheduleCreateRequest, merchantId: string): Promise<FeeScheduleResponse>;
|
|
358
|
+
/** List every platform fee schedule assigned to a merchant. */
|
|
359
|
+
list(merchantId: string): Promise<FeeScheduleResponse[]>;
|
|
360
|
+
/** Retrieve a single platform fee schedule by ID. */
|
|
361
|
+
retrieve(feeId: string): Promise<FeeScheduleResponse>;
|
|
362
|
+
/** Update a platform fee schedule. */
|
|
363
|
+
update(feeId: string, params: FeeScheduleUpdateRequest): Promise<FeeScheduleResponse>;
|
|
364
|
+
/** Delete a platform fee schedule. */
|
|
365
|
+
delete(feeId: string): Promise<FeeScheduleResponse>;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Internal-only Delopay client for DeloPay staff tooling (the admin
|
|
370
|
+
* control-center, audit UIs, etc.). Extends the public `Delopay` surface
|
|
371
|
+
* with admin-plane resources that must **not** be discoverable from the
|
|
372
|
+
* merchant-facing package entry.
|
|
373
|
+
*
|
|
374
|
+
* Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.
|
|
375
|
+
* The merchant-facing `import { Delopay } from '@delopay/sdk'` never
|
|
376
|
+
* surfaces these.
|
|
377
|
+
*/
|
|
378
|
+
declare class DelopayInternal extends Delopay {
|
|
379
|
+
/** Bootstrap admin endpoints — signup, signin, onboarding. */
|
|
380
|
+
readonly admin: Admin;
|
|
381
|
+
/** Platform-wide customer, transaction, analytics, merchant-account ops. */
|
|
382
|
+
readonly adminPortal: AdminPortal;
|
|
383
|
+
/** Audit log reads. */
|
|
384
|
+
readonly auditLogs: AuditLogs;
|
|
385
|
+
/** Backend cache invalidation. */
|
|
386
|
+
readonly cache: Cache;
|
|
387
|
+
/** Platform card-issuer program management. */
|
|
388
|
+
readonly cardIssuers: CardIssuers;
|
|
389
|
+
/** Generic platform config store. */
|
|
390
|
+
readonly configs: Configs;
|
|
391
|
+
/** GSM (Gateway Status Mapping) routing rules. */
|
|
392
|
+
readonly gsm: Gsm;
|
|
393
|
+
/** Platform-wide fee schedules assigned to merchants. */
|
|
394
|
+
readonly platformFees: PlatformFees;
|
|
395
|
+
constructor(...args: ConstructorParameters<typeof Delopay>);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export { Admin, type AdminAnalyticsRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListResponse, AdminPortal, type AdminSignInRequest, type AdminTransactionListParams, type AdminTransactionListResponse, type AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, AuditLogs, AuthResponse, type AuthorizeResponse, Cache, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, CardIssuers, Configs, type CreateInternalUserRequest, type CreateTenantUserRequest, type CustomerSummary, type CustomerUser, Delopay, DelopayInternal, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, Gsm, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, MerchantAccountResponse, MerchantAccountUpdateRequest, type OnboardMerchantRequest, type OnboardMerchantResponse, type OverviewStat, type OverviewStatsResponse, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, PaymentResponse, type PaymentStat, type PlatformAnalyticsResponse, PlatformFees, ProjectResponse, RequestFn, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse };
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Analytics,
|
|
3
|
+
AnalyticsDashboard,
|
|
4
|
+
Cards,
|
|
5
|
+
Delopay,
|
|
6
|
+
DelopayAuthenticationError,
|
|
7
|
+
DelopayError,
|
|
8
|
+
Export,
|
|
9
|
+
FeatureMatrix,
|
|
10
|
+
Files,
|
|
11
|
+
Forex,
|
|
12
|
+
Regions,
|
|
13
|
+
Subscriptions,
|
|
14
|
+
Webhooks
|
|
15
|
+
} from "./chunk-NKSNI5HS.js";
|
|
16
|
+
|
|
17
|
+
// src/internal/resources/admin.ts
|
|
18
|
+
var Admin = class {
|
|
19
|
+
constructor(request) {
|
|
20
|
+
this.request = request;
|
|
21
|
+
}
|
|
22
|
+
async signIn(params) {
|
|
23
|
+
return this.request("POST", "/admin/signin", { body: params });
|
|
24
|
+
}
|
|
25
|
+
async createInternalUser(params) {
|
|
26
|
+
return this.request("POST", "/admin/internal_signup", { body: params });
|
|
27
|
+
}
|
|
28
|
+
async createTenant(params) {
|
|
29
|
+
return this.request("POST", "/admin/tenant_signup", { body: params });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create a new merchant admin user and merchant account atomically.
|
|
33
|
+
*
|
|
34
|
+
* This is the correct endpoint for bootstrapping the first admin user in a
|
|
35
|
+
* fresh deployment — `internal_signup`/`tenant_signup` both require
|
|
36
|
+
* pre-existing merchant records that don't exist on a clean database.
|
|
37
|
+
*
|
|
38
|
+
* `POST /admin/signup_with_merchant_id`
|
|
39
|
+
*/
|
|
40
|
+
async signupWithMerchantId(params) {
|
|
41
|
+
return this.request("POST", "/admin/signup_with_merchant_id", { body: params });
|
|
42
|
+
}
|
|
43
|
+
/** Toggle public signup on/off. `POST /admin/settings/signup` */
|
|
44
|
+
async setSignupSettings(params) {
|
|
45
|
+
return this.request("POST", "/admin/settings/signup", { body: params });
|
|
46
|
+
}
|
|
47
|
+
/** Read current public-signup status. `GET /admin/settings/signup` */
|
|
48
|
+
async getSignupSettings() {
|
|
49
|
+
return this.request("GET", "/admin/settings/signup");
|
|
50
|
+
}
|
|
51
|
+
/** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */
|
|
52
|
+
async onboardMerchant(params) {
|
|
53
|
+
return this.request("POST", "/admin/onboard_merchant", { body: params });
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/internal/resources/adminPortal.ts
|
|
58
|
+
var AdminPortal = class {
|
|
59
|
+
constructor(request) {
|
|
60
|
+
this.request = request;
|
|
61
|
+
}
|
|
62
|
+
async listCustomers(params) {
|
|
63
|
+
return this.request("GET", "/admin-portal/customers", {
|
|
64
|
+
query: params
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async getCustomer(customerId) {
|
|
68
|
+
return this.request("GET", `/admin-portal/customers/${encodeURIComponent(customerId)}`);
|
|
69
|
+
}
|
|
70
|
+
async listTransactions(params) {
|
|
71
|
+
return this.request("GET", "/admin-portal/transactions", {
|
|
72
|
+
query: params
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
async analytics(params) {
|
|
76
|
+
return this.request("GET", "/admin-portal/analytics", {
|
|
77
|
+
query: params
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async overviewStats() {
|
|
81
|
+
return this.request("GET", "/admin-portal/overview-stats");
|
|
82
|
+
}
|
|
83
|
+
async paymentAnalytics(params) {
|
|
84
|
+
return this.request("GET", "/admin-portal/payment-analytics", {
|
|
85
|
+
query: params
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve a merchant account via the admin portal. Unlike
|
|
90
|
+
* `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API
|
|
91
|
+
* key) and does not require the JWT to be scoped to the target merchant.
|
|
92
|
+
*/
|
|
93
|
+
async retrieveAccount(merchantId) {
|
|
94
|
+
return this.request("GET", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Update a merchant account via the admin portal. Authenticated via admin JWT
|
|
98
|
+
* or admin API key.
|
|
99
|
+
*/
|
|
100
|
+
async updateAccount(merchantId, params) {
|
|
101
|
+
return this.request("POST", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`, {
|
|
102
|
+
body: params
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Delete a merchant account via the admin portal. Authenticated via admin JWT
|
|
107
|
+
* or admin API key.
|
|
108
|
+
*/
|
|
109
|
+
async deleteAccount(merchantId) {
|
|
110
|
+
return this.request("DELETE", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/internal/resources/auditLogs.ts
|
|
115
|
+
var AuditLogs = class {
|
|
116
|
+
constructor(request) {
|
|
117
|
+
this.request = request;
|
|
118
|
+
}
|
|
119
|
+
async list(params) {
|
|
120
|
+
return this.request("GET", "/admin-portal/audit", {
|
|
121
|
+
query: params
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
async retrieve(logId) {
|
|
125
|
+
return this.request("GET", `/admin-portal/audit/${encodeURIComponent(logId)}`);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// src/internal/resources/cache.ts
|
|
130
|
+
var Cache = class {
|
|
131
|
+
constructor(request) {
|
|
132
|
+
this.request = request;
|
|
133
|
+
}
|
|
134
|
+
/** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */
|
|
135
|
+
async invalidate(key) {
|
|
136
|
+
return this.request("POST", `/cache/invalidate/${encodeURIComponent(key)}`);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// src/internal/resources/cardIssuers.ts
|
|
141
|
+
var CardIssuers = class {
|
|
142
|
+
constructor(request) {
|
|
143
|
+
this.request = request;
|
|
144
|
+
}
|
|
145
|
+
async create(params) {
|
|
146
|
+
return this.request("POST", "/card_issuers", { body: params });
|
|
147
|
+
}
|
|
148
|
+
async update(issuerId, params) {
|
|
149
|
+
return this.request("PUT", `/card_issuers/${encodeURIComponent(issuerId)}`, { body: params });
|
|
150
|
+
}
|
|
151
|
+
async list() {
|
|
152
|
+
return this.request("GET", "/card_issuers");
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// src/internal/resources/configs.ts
|
|
157
|
+
var Configs = class {
|
|
158
|
+
constructor(request) {
|
|
159
|
+
this.request = request;
|
|
160
|
+
}
|
|
161
|
+
/** Create a config. `POST /configs` */
|
|
162
|
+
async create(params) {
|
|
163
|
+
return this.request("POST", "/configs", { body: params });
|
|
164
|
+
}
|
|
165
|
+
/** Retrieve a config by key. `GET /configs/{key}` */
|
|
166
|
+
async retrieve(key) {
|
|
167
|
+
return this.request("GET", `/configs/${encodeURIComponent(key)}`);
|
|
168
|
+
}
|
|
169
|
+
/** Update a config. `PUT /configs/{key}` */
|
|
170
|
+
async update(key, params) {
|
|
171
|
+
return this.request("PUT", `/configs/${encodeURIComponent(key)}`, { body: params });
|
|
172
|
+
}
|
|
173
|
+
/** Delete a config. `DELETE /configs/{key}` */
|
|
174
|
+
async delete(key) {
|
|
175
|
+
return this.request("DELETE", `/configs/${encodeURIComponent(key)}`);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// src/internal/resources/gsm.ts
|
|
180
|
+
var Gsm = class {
|
|
181
|
+
constructor(request) {
|
|
182
|
+
this.request = request;
|
|
183
|
+
}
|
|
184
|
+
async create(params) {
|
|
185
|
+
return this.request("POST", "/gsm", { body: params });
|
|
186
|
+
}
|
|
187
|
+
async retrieve(params) {
|
|
188
|
+
return this.request("POST", "/gsm/get", { body: params });
|
|
189
|
+
}
|
|
190
|
+
async update(params) {
|
|
191
|
+
return this.request("POST", "/gsm/update", { body: params });
|
|
192
|
+
}
|
|
193
|
+
async delete(params) {
|
|
194
|
+
return this.request("POST", "/gsm/delete", { body: params });
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// src/internal/resources/platformFees.ts
|
|
199
|
+
var PlatformFees = class {
|
|
200
|
+
constructor(request) {
|
|
201
|
+
this.request = request;
|
|
202
|
+
}
|
|
203
|
+
/** Create a platform fee schedule for a specific merchant. */
|
|
204
|
+
async create(params, merchantId) {
|
|
205
|
+
return this.request("POST", "/admin/fees", {
|
|
206
|
+
body: params,
|
|
207
|
+
query: { merchant_id: merchantId }
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/** List every platform fee schedule assigned to a merchant. */
|
|
211
|
+
async list(merchantId) {
|
|
212
|
+
return this.request("GET", "/admin/fees/list", {
|
|
213
|
+
query: { merchant_id: merchantId }
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
/** Retrieve a single platform fee schedule by ID. */
|
|
217
|
+
async retrieve(feeId) {
|
|
218
|
+
return this.request("GET", `/admin/fees/${encodeURIComponent(feeId)}`);
|
|
219
|
+
}
|
|
220
|
+
/** Update a platform fee schedule. */
|
|
221
|
+
async update(feeId, params) {
|
|
222
|
+
return this.request("PUT", `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });
|
|
223
|
+
}
|
|
224
|
+
/** Delete a platform fee schedule. */
|
|
225
|
+
async delete(feeId) {
|
|
226
|
+
return this.request("DELETE", `/admin/fees/${encodeURIComponent(feeId)}`);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// src/internal/client.ts
|
|
231
|
+
var DelopayInternal = class extends Delopay {
|
|
232
|
+
constructor(...args) {
|
|
233
|
+
super(...args);
|
|
234
|
+
const request = this.request.bind(this);
|
|
235
|
+
this.admin = new Admin(request);
|
|
236
|
+
this.adminPortal = new AdminPortal(request);
|
|
237
|
+
this.auditLogs = new AuditLogs(request);
|
|
238
|
+
this.cache = new Cache(request);
|
|
239
|
+
this.cardIssuers = new CardIssuers(request);
|
|
240
|
+
this.configs = new Configs(request);
|
|
241
|
+
this.gsm = new Gsm(request);
|
|
242
|
+
this.platformFees = new PlatformFees(request);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
export {
|
|
246
|
+
Admin,
|
|
247
|
+
AdminPortal,
|
|
248
|
+
Analytics,
|
|
249
|
+
AnalyticsDashboard,
|
|
250
|
+
AuditLogs,
|
|
251
|
+
Cache,
|
|
252
|
+
CardIssuers,
|
|
253
|
+
Cards,
|
|
254
|
+
Configs,
|
|
255
|
+
Delopay,
|
|
256
|
+
DelopayAuthenticationError,
|
|
257
|
+
DelopayError,
|
|
258
|
+
DelopayInternal,
|
|
259
|
+
Export,
|
|
260
|
+
FeatureMatrix,
|
|
261
|
+
Files,
|
|
262
|
+
Forex,
|
|
263
|
+
Gsm,
|
|
264
|
+
PlatformFees,
|
|
265
|
+
Regions,
|
|
266
|
+
Subscriptions,
|
|
267
|
+
Webhooks
|
|
268
|
+
};
|
|
269
|
+
//# sourceMappingURL=internal.js.map
|