@delopay/sdk 0.6.0 → 0.8.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.
@@ -1,5 +1,263 @@
1
- import { RequestFn, AdminSignInRequest, AuthResponse, CreateInternalUserRequest, AuthorizeResponse, CreateTenantUserRequest, SignUpWithMerchantIdRequest, SignupToggleRequest, SignupToggleResponse, OnboardMerchantRequest, OnboardMerchantResponse, AdminCustomerListParams, AdminCustomerListResponse, AdminCustomerDetail, AdminTransactionListParams, AdminTransactionListResponse, AdminAnalyticsRequest, PlatformAnalyticsResponse, OverviewStatsResponse, PaymentAnalyticsRequest, PaymentAnalyticsResponse, MerchantAccountResponse, MerchantAccountUpdateRequest, AuditLogListParams, AuditLogListResponse, AuditLogResponse, 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, Cache, CaptureMethod, CardDetail, CardDetailFromLocker, CardIssuerCreateRequest, CardIssuerListResponse, CardIssuerResponse, CardIssuerUpdateRequest, Cards, ChangePasswordRequest, Configs, ConnectorCreateRequest, ConnectorListResponse, ConnectorResponse, ConnectorType, ConnectorUpdateRequest, Currency, CustomerCreateRequest, CustomerListParams, CustomerPaymentMethodsListParams, CustomerPaymentMethodsListResponse, CustomerResponse, CustomerSummary, CustomerUpdateRequest, CustomerUser, DelopayAuthenticationError, DelopayError, DelopayLogger, DelopayOptions, DisputeEvidenceRequest, DisputeListParams, DisputeResponse, DisputeStage, DisputeStatus, EphemeralKeyCreateRequest, EphemeralKeyCreateResponse, EventClass, EventDeliveryAttemptResponse, EventDetailResponse, EventListParams, EventListResponse, EventResponse, EventType, Export, FeatureMatrix, FeeOwner, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, FeeType, Files, Forex, ForgotPasswordRequest, FromEmailRequest, GatewayConnectRequest, GatewayResponse, GsmDecision, GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest, IntentStatus, InviteUsersRequest, InviteUsersResponse, LedgerEntry, LedgerListParams, LedgerResponse, MandateListParams, MandateResponse, MandateRevokedResponse, MandateStatus, MandateType, MerchantAccountCreateRequest, MerchantAccountType, MerchantOverviewResponse, MerchantOverviewStat, OverviewStat, PaymentCancelRequest, PaymentCaptureRequest, PaymentConfirmRequest, PaymentCreateRequest, PaymentLinkListParams, PaymentLinkListResponse, PaymentLinkResponse, PaymentListParams, PaymentListResponse, PaymentMethod, PaymentMethodCreateRequest, PaymentMethodDeleteResponse, PaymentMethodListParams, PaymentMethodResponse, PaymentMethodType, PaymentMethodUpdateRequest, PaymentResponse, PaymentStat, PaymentUpdateRequest, PayoutCreateRequest, PayoutListParams, PayoutListResponse, PayoutResponse, PayoutStatus, PayoutType, PayoutUpdateRequest, PhoneDetails, PhoneOtpRequest, PhoneOtpResponse, PhoneOtpVerifyRequest, PhoneOtpVerifyResponse, PollStatus, PollStatusResponse, ProfileAcquirerCreateRequest, ProfileAcquirerResponse, ProfileAcquirerUpdateRequest, ProfileCreateRequest, ProfileResponse, ProfileUpdateRequest, ProjectCreateRequest, ProjectResponse, ProjectStats, ProjectStatsResponse, ProjectUpdateRequest, RecoveryCodesResponse, RefundCreateRequest, RefundListParams, RefundListResponse, RefundResponse, RefundStatus, RefundType, RefundUpdateRequest, RegionCreateRequest, RegionResponse, RegionUpdateRequest, Regions, RelayRequest, RelayResponse, RelayStatus, RelayType, RequestOptions, ResetPasswordRequest, RoutingConfigCreateRequest, RoutingConfigResponse, ShopCreateRequest, ShopResponse, 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';
1
+ import { ProjectResponse, ShopResponse, PaymentResponse, RequestFn, AuthResponse, SignUpWithMerchantIdRequest, MerchantAccountResponse, MerchantAccountUpdateRequest, FeeScheduleCreateRequest, FeeScheduleResponse, FeeScheduleUpdateRequest, Delopay } from './index.js';
2
+ export { Address, AddressDetails, 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 AdminAdjustmentRequest {
197
+ amount: number;
198
+ description: string;
199
+ }
200
+ interface AdminAdjustmentResponse {
201
+ ledger_entry_id: string;
202
+ new_balance: number;
203
+ }
204
+ interface CardIssuerCreateRequest {
205
+ issuer_name: string;
206
+ }
207
+ interface CardIssuerUpdateRequest {
208
+ issuer_name: string;
209
+ }
210
+ interface CardIssuerResponse {
211
+ id: string;
212
+ issuer_name: string;
213
+ }
214
+ interface CardIssuerListResponse {
215
+ issuers: CardIssuerResponse[];
216
+ }
217
+ type GsmDecision = 'retry' | 'do_default';
218
+ interface GsmRuleCreateRequest {
219
+ connector: string;
220
+ flow: string;
221
+ sub_flow: string;
222
+ code: string;
223
+ message: string;
224
+ status: string;
225
+ decision: GsmDecision;
226
+ step_up_possible: boolean;
227
+ clear_pan_possible: boolean;
228
+ router_error?: string | null;
229
+ unified_code?: string | null;
230
+ unified_message?: string | null;
231
+ }
232
+ interface GsmRuleUpdateRequest {
233
+ connector: string;
234
+ flow: string;
235
+ sub_flow: string;
236
+ code: string;
237
+ message: string;
238
+ status?: string | null;
239
+ router_error?: string | null;
240
+ decision?: GsmDecision | null;
241
+ step_up_possible?: boolean | null;
242
+ unified_code?: string | null;
243
+ unified_message?: string | null;
244
+ }
245
+ interface GsmRuleResponse {
246
+ connector: string;
247
+ flow: string;
248
+ sub_flow: string;
249
+ code: string;
250
+ message: string;
251
+ status: string;
252
+ decision: GsmDecision;
253
+ step_up_possible: boolean;
254
+ clear_pan_possible: boolean;
255
+ feature: string;
256
+ feature_data: unknown;
257
+ router_error?: string | null;
258
+ unified_code?: string | null;
259
+ unified_message?: string | null;
260
+ }
3
261
 
4
262
  declare class Admin {
5
263
  private readonly request;
@@ -59,6 +317,88 @@ declare class AuditLogs {
59
317
  retrieve(logId: string): Promise<AuditLogResponse>;
60
318
  }
61
319
 
320
+ declare class Cache {
321
+ private readonly request;
322
+ constructor(request: RequestFn);
323
+ /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */
324
+ invalidate(key: string): Promise<Record<string, unknown>>;
325
+ }
326
+
327
+ declare class CardIssuers {
328
+ private readonly request;
329
+ constructor(request: RequestFn);
330
+ create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse>;
331
+ update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse>;
332
+ list(): Promise<CardIssuerListResponse>;
333
+ }
334
+
335
+ declare class Configs {
336
+ private readonly request;
337
+ constructor(request: RequestFn);
338
+ /** Create a config. `POST /configs` */
339
+ create(params: Record<string, unknown>): Promise<Record<string, unknown>>;
340
+ /** Retrieve a config by key. `GET /configs/{key}` */
341
+ retrieve(key: string): Promise<Record<string, unknown>>;
342
+ /** Update a config. `PUT /configs/{key}` */
343
+ update(key: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
344
+ /** Delete a config. `DELETE /configs/{key}` */
345
+ delete(key: string): Promise<Record<string, unknown>>;
346
+ }
347
+
348
+ declare class Gsm {
349
+ private readonly request;
350
+ constructor(request: RequestFn);
351
+ create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse>;
352
+ retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse>;
353
+ update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse>;
354
+ delete(params: Record<string, unknown>): Promise<GsmRuleResponse>;
355
+ }
356
+
357
+ /**
358
+ * Platform-level ledger adjustments on a merchant's balance. Admin-only
359
+ * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only
360
+ * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't
361
+ * advertise the admin adjustment path in autocomplete.
362
+ */
363
+ declare class PlatformBilling {
364
+ private readonly request;
365
+ constructor(request: RequestFn);
366
+ /**
367
+ * Manually credit a merchant's balance (e.g. promotional credit,
368
+ * dispute reversal, manual correction).
369
+ *
370
+ * @param merchantId - The merchant account ID.
371
+ * @param params - Credit amount and reason.
372
+ */
373
+ credit(merchantId: string, params: AdminAdjustmentRequest): Promise<AdminAdjustmentResponse>;
374
+ /**
375
+ * Manually debit a merchant's balance.
376
+ *
377
+ * @param merchantId - The merchant account ID.
378
+ * @param params - Debit amount and reason.
379
+ */
380
+ debit(merchantId: string, params: AdminAdjustmentRequest): Promise<AdminAdjustmentResponse>;
381
+ }
382
+
383
+ /**
384
+ * Platform-wide fee schedule management. Admin-only routes under
385
+ * `/admin/fees/*`. Exposed only via `'@delopay/sdk/internal'`.
386
+ */
387
+ declare class PlatformFees {
388
+ private readonly request;
389
+ constructor(request: RequestFn);
390
+ /** Create a platform fee schedule for a specific merchant. */
391
+ create(params: FeeScheduleCreateRequest, merchantId: string): Promise<FeeScheduleResponse>;
392
+ /** List every platform fee schedule assigned to a merchant. */
393
+ list(merchantId: string): Promise<FeeScheduleResponse[]>;
394
+ /** Retrieve a single platform fee schedule by ID. */
395
+ retrieve(feeId: string): Promise<FeeScheduleResponse>;
396
+ /** Update a platform fee schedule. */
397
+ update(feeId: string, params: FeeScheduleUpdateRequest): Promise<FeeScheduleResponse>;
398
+ /** Delete a platform fee schedule. */
399
+ delete(feeId: string): Promise<FeeScheduleResponse>;
400
+ }
401
+
62
402
  /**
63
403
  * Internal-only Delopay client for DeloPay staff tooling (the admin
64
404
  * control-center, audit UIs, etc.). Extends the public `Delopay` surface
@@ -68,19 +408,27 @@ declare class AuditLogs {
68
408
  * Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.
69
409
  * The merchant-facing `import { Delopay } from '@delopay/sdk'` never
70
410
  * surfaces these.
71
- *
72
- * Security note: the admin plane code still physically ships in the
73
- * public npm tarball (merchants who crack the tarball can read it); the
74
- * split is a discoverability fence, not an authorization boundary. The
75
- * backend's authz is what actually protects the admin routes — this
76
- * split just stops the merchant SDK from documenting their shape on
77
- * autocompletion.
78
411
  */
79
412
  declare class DelopayInternal extends Delopay {
413
+ /** Bootstrap admin endpoints — signup, signin, onboarding. */
80
414
  readonly admin: Admin;
415
+ /** Platform-wide customer, transaction, analytics, merchant-account ops. */
81
416
  readonly adminPortal: AdminPortal;
417
+ /** Audit log reads. */
82
418
  readonly auditLogs: AuditLogs;
419
+ /** Backend cache invalidation. */
420
+ readonly cache: Cache;
421
+ /** Platform card-issuer program management. */
422
+ readonly cardIssuers: CardIssuers;
423
+ /** Generic platform config store. */
424
+ readonly configs: Configs;
425
+ /** GSM (Gateway Status Mapping) routing rules. */
426
+ readonly gsm: Gsm;
427
+ /** Admin-only ledger credits/debits against a merchant's balance. */
428
+ readonly platformBilling: PlatformBilling;
429
+ /** Platform-wide fee schedules assigned to merchants. */
430
+ readonly platformFees: PlatformFees;
83
431
  constructor(...args: ConstructorParameters<typeof Delopay>);
84
432
  }
85
433
 
86
- export { Admin, AdminAnalyticsRequest, AdminCustomerDetail, AdminCustomerListParams, AdminCustomerListResponse, AdminPortal, AdminSignInRequest, AdminTransactionListParams, AdminTransactionListResponse, AuditLogListParams, AuditLogListResponse, AuditLogResponse, AuditLogs, AuthResponse, AuthorizeResponse, CreateInternalUserRequest, CreateTenantUserRequest, Delopay, DelopayInternal, MerchantAccountResponse, MerchantAccountUpdateRequest, OnboardMerchantRequest, OnboardMerchantResponse, OverviewStatsResponse, PaymentAnalyticsRequest, PaymentAnalyticsResponse, PlatformAnalyticsResponse, RequestFn, SignUpWithMerchantIdRequest, SignupToggleRequest, SignupToggleResponse };
434
+ export { Admin, type AdminAdjustmentRequest, type AdminAdjustmentResponse, 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, PlatformBilling, PlatformFees, ProjectResponse, RequestFn, ShopResponse, SignUpWithMerchantIdRequest, type SignupToggleRequest, type SignupToggleResponse };
package/dist/internal.js CHANGED
@@ -1,9 +1,7 @@
1
1
  import {
2
2
  Analytics,
3
3
  AnalyticsDashboard,
4
- Cache,
5
4
  Cards,
6
- Configs,
7
5
  Delopay,
8
6
  DelopayAuthenticationError,
9
7
  DelopayError,
@@ -14,9 +12,9 @@ import {
14
12
  Regions,
15
13
  Subscriptions,
16
14
  Webhooks
17
- } from "./chunk-LCF7ILAH.js";
15
+ } from "./chunk-SPWI4Z6T.js";
18
16
 
19
- // src/resources/admin.ts
17
+ // src/internal/resources/admin.ts
20
18
  var Admin = class {
21
19
  constructor(request) {
22
20
  this.request = request;
@@ -56,7 +54,7 @@ var Admin = class {
56
54
  }
57
55
  };
58
56
 
59
- // src/resources/adminPortal.ts
57
+ // src/internal/resources/adminPortal.ts
60
58
  var AdminPortal = class {
61
59
  constructor(request) {
62
60
  this.request = request;
@@ -113,7 +111,7 @@ var AdminPortal = class {
113
111
  }
114
112
  };
115
113
 
116
- // src/resources/auditLogs.ts
114
+ // src/internal/resources/auditLogs.ts
117
115
  var AuditLogs = class {
118
116
  constructor(request) {
119
117
  this.request = request;
@@ -128,6 +126,137 @@ var AuditLogs = class {
128
126
  }
129
127
  };
130
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/platformBilling.ts
199
+ var PlatformBilling = class {
200
+ constructor(request) {
201
+ this.request = request;
202
+ }
203
+ /**
204
+ * Manually credit a merchant's balance (e.g. promotional credit,
205
+ * dispute reversal, manual correction).
206
+ *
207
+ * @param merchantId - The merchant account ID.
208
+ * @param params - Credit amount and reason.
209
+ */
210
+ async credit(merchantId, params) {
211
+ return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {
212
+ body: params
213
+ });
214
+ }
215
+ /**
216
+ * Manually debit a merchant's balance.
217
+ *
218
+ * @param merchantId - The merchant account ID.
219
+ * @param params - Debit amount and reason.
220
+ */
221
+ async debit(merchantId, params) {
222
+ return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {
223
+ body: params
224
+ });
225
+ }
226
+ };
227
+
228
+ // src/internal/resources/platformFees.ts
229
+ var PlatformFees = class {
230
+ constructor(request) {
231
+ this.request = request;
232
+ }
233
+ /** Create a platform fee schedule for a specific merchant. */
234
+ async create(params, merchantId) {
235
+ return this.request("POST", "/admin/fees", {
236
+ body: params,
237
+ query: { merchant_id: merchantId }
238
+ });
239
+ }
240
+ /** List every platform fee schedule assigned to a merchant. */
241
+ async list(merchantId) {
242
+ return this.request("GET", "/admin/fees/list", {
243
+ query: { merchant_id: merchantId }
244
+ });
245
+ }
246
+ /** Retrieve a single platform fee schedule by ID. */
247
+ async retrieve(feeId) {
248
+ return this.request("GET", `/admin/fees/${encodeURIComponent(feeId)}`);
249
+ }
250
+ /** Update a platform fee schedule. */
251
+ async update(feeId, params) {
252
+ return this.request("PUT", `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });
253
+ }
254
+ /** Delete a platform fee schedule. */
255
+ async delete(feeId) {
256
+ return this.request("DELETE", `/admin/fees/${encodeURIComponent(feeId)}`);
257
+ }
258
+ };
259
+
131
260
  // src/internal/client.ts
132
261
  var DelopayInternal = class extends Delopay {
133
262
  constructor(...args) {
@@ -136,6 +265,12 @@ var DelopayInternal = class extends Delopay {
136
265
  this.admin = new Admin(request);
137
266
  this.adminPortal = new AdminPortal(request);
138
267
  this.auditLogs = new AuditLogs(request);
268
+ this.cache = new Cache(request);
269
+ this.cardIssuers = new CardIssuers(request);
270
+ this.configs = new Configs(request);
271
+ this.gsm = new Gsm(request);
272
+ this.platformBilling = new PlatformBilling(request);
273
+ this.platformFees = new PlatformFees(request);
139
274
  }
140
275
  };
141
276
  export {
@@ -145,6 +280,7 @@ export {
145
280
  AnalyticsDashboard,
146
281
  AuditLogs,
147
282
  Cache,
283
+ CardIssuers,
148
284
  Cards,
149
285
  Configs,
150
286
  Delopay,
@@ -155,6 +291,9 @@ export {
155
291
  FeatureMatrix,
156
292
  Files,
157
293
  Forex,
294
+ Gsm,
295
+ PlatformBilling,
296
+ PlatformFees,
158
297
  Regions,
159
298
  Subscriptions,
160
299
  Webhooks