@delopay/sdk 0.6.0 → 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.
@@ -1,5 +1,255 @@
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, 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
+ }
3
253
 
4
254
  declare class Admin {
5
255
  private readonly request;
@@ -59,6 +309,62 @@ declare class AuditLogs {
59
309
  retrieve(logId: string): Promise<AuditLogResponse>;
60
310
  }
61
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
+
62
368
  /**
63
369
  * Internal-only Delopay client for DeloPay staff tooling (the admin
64
370
  * control-center, audit UIs, etc.). Extends the public `Delopay` surface
@@ -68,19 +374,25 @@ declare class AuditLogs {
68
374
  * Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.
69
375
  * The merchant-facing `import { Delopay } from '@delopay/sdk'` never
70
376
  * 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
377
  */
79
378
  declare class DelopayInternal extends Delopay {
379
+ /** Bootstrap admin endpoints — signup, signin, onboarding. */
80
380
  readonly admin: Admin;
381
+ /** Platform-wide customer, transaction, analytics, merchant-account ops. */
81
382
  readonly adminPortal: AdminPortal;
383
+ /** Audit log reads. */
82
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;
83
395
  constructor(...args: ConstructorParameters<typeof Delopay>);
84
396
  }
85
397
 
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 };
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 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-NKSNI5HS.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,107 @@ 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/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
+
131
230
  // src/internal/client.ts
132
231
  var DelopayInternal = class extends Delopay {
133
232
  constructor(...args) {
@@ -136,6 +235,11 @@ var DelopayInternal = class extends Delopay {
136
235
  this.admin = new Admin(request);
137
236
  this.adminPortal = new AdminPortal(request);
138
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);
139
243
  }
140
244
  };
141
245
  export {
@@ -145,6 +249,7 @@ export {
145
249
  AnalyticsDashboard,
146
250
  AuditLogs,
147
251
  Cache,
252
+ CardIssuers,
148
253
  Cards,
149
254
  Configs,
150
255
  Delopay,
@@ -155,6 +260,8 @@ export {
155
260
  FeatureMatrix,
156
261
  Files,
157
262
  Forex,
263
+ Gsm,
264
+ PlatformFees,
158
265
  Regions,
159
266
  Subscriptions,
160
267
  Webhooks
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resources/admin.ts","../src/resources/adminPortal.ts","../src/resources/auditLogs.ts","../src/internal/client.ts"],"sourcesContent":["import type {\n AdminSignInRequest,\n AuthorizeResponse,\n AuthResponse,\n CreateInternalUserRequest,\n CreateTenantUserRequest,\n OnboardMerchantRequest,\n OnboardMerchantResponse,\n SignUpWithMerchantIdRequest,\n SignupToggleRequest,\n SignupToggleResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Admin {\n constructor(private readonly request: RequestFn) {}\n\n async signIn(params: AdminSignInRequest): Promise<AuthResponse> {\n return this.request('POST', '/admin/signin', { body: params });\n }\n\n async createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/internal_signup', { body: params });\n }\n\n async createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/tenant_signup', { body: params });\n }\n\n /**\n * Create a new merchant admin user and merchant account atomically.\n *\n * This is the correct endpoint for bootstrapping the first admin user in a\n * fresh deployment — `internal_signup`/`tenant_signup` both require\n * pre-existing merchant records that don't exist on a clean database.\n *\n * `POST /admin/signup_with_merchant_id`\n */\n async signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/signup_with_merchant_id', { body: params });\n }\n\n /** Toggle public signup on/off. `POST /admin/settings/signup` */\n async setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse> {\n return this.request('POST', '/admin/settings/signup', { body: params });\n }\n\n /** Read current public-signup status. `GET /admin/settings/signup` */\n async getSignupSettings(): Promise<SignupToggleResponse> {\n return this.request('GET', '/admin/settings/signup');\n }\n\n /** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */\n async onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse> {\n return this.request('POST', '/admin/onboard_merchant', { body: params });\n }\n}\n","import type {\n AdminCustomerListParams,\n AdminCustomerListResponse,\n AdminCustomerDetail,\n AdminTransactionListParams,\n AdminTransactionListResponse,\n AdminAnalyticsRequest,\n PlatformAnalyticsResponse,\n OverviewStatsResponse,\n PaymentAnalyticsRequest,\n PaymentAnalyticsResponse,\n MerchantAccountResponse,\n MerchantAccountUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class AdminPortal {\n constructor(private readonly request: RequestFn) {}\n\n async listCustomers(params?: AdminCustomerListParams): Promise<AdminCustomerListResponse> {\n return this.request('GET', '/admin-portal/customers', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async getCustomer(customerId: string): Promise<AdminCustomerDetail> {\n return this.request('GET', `/admin-portal/customers/${encodeURIComponent(customerId)}`);\n }\n\n async listTransactions(\n params?: AdminTransactionListParams,\n ): Promise<AdminTransactionListResponse> {\n return this.request('GET', '/admin-portal/transactions', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async analytics(params: AdminAnalyticsRequest): Promise<PlatformAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async overviewStats(): Promise<OverviewStatsResponse> {\n return this.request('GET', '/admin-portal/overview-stats');\n }\n\n async paymentAnalytics(params: PaymentAnalyticsRequest): Promise<PaymentAnalyticsResponse> {\n return this.request('GET', '/admin-portal/payment-analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Retrieve a merchant account via the admin portal. Unlike\n * `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API\n * key) and does not require the JWT to be scoped to the target merchant.\n */\n async retrieveAccount(merchantId: string): Promise<MerchantAccountResponse> {\n return this.request('GET', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Update a merchant account via the admin portal. Authenticated via admin JWT\n * or admin API key.\n */\n async updateAccount(\n merchantId: string,\n params: MerchantAccountUpdateRequest,\n ): Promise<MerchantAccountResponse> {\n return this.request('POST', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant account via the admin portal. Authenticated via admin JWT\n * or admin API key.\n */\n async deleteAccount(merchantId: string): Promise<MerchantAccountResponse> {\n return this.request('DELETE', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);\n }\n}\n","import type { AuditLogListParams, AuditLogListResponse, AuditLogResponse } from '../types';\nimport type { RequestFn } from '../client';\n\nexport class AuditLogs {\n constructor(private readonly request: RequestFn) {}\n\n async list(params?: AuditLogListParams): Promise<AuditLogListResponse> {\n return this.request('GET', '/admin-portal/audit', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async retrieve(logId: string): Promise<AuditLogResponse> {\n return this.request('GET', `/admin-portal/audit/${encodeURIComponent(logId)}`);\n }\n}\n","import type { RequestFn } from '../client';\nimport { Delopay } from '../client';\nimport { Admin } from '../resources/admin';\nimport { AdminPortal } from '../resources/adminPortal';\nimport { AuditLogs } from '../resources/auditLogs';\n\n/**\n * Internal-only Delopay client for DeloPay staff tooling (the admin\n * control-center, audit UIs, etc.). Extends the public `Delopay` surface\n * with admin-plane resources that must **not** be discoverable from the\n * merchant-facing package entry.\n *\n * Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.\n * The merchant-facing `import { Delopay } from '@delopay/sdk'` never\n * surfaces these.\n *\n * Security note: the admin plane code still physically ships in the\n * public npm tarball (merchants who crack the tarball can read it); the\n * split is a discoverability fence, not an authorization boundary. The\n * backend's authz is what actually protects the admin routes — this\n * split just stops the merchant SDK from documenting their shape on\n * autocompletion.\n */\nexport class DelopayInternal extends Delopay {\n readonly admin: Admin;\n readonly adminPortal: AdminPortal;\n readonly auditLogs: AuditLogs;\n\n constructor(...args: ConstructorParameters<typeof Delopay>) {\n super(...args);\n const request = this.request.bind(this) as RequestFn;\n this.admin = new Admin(request);\n this.adminPortal = new AdminPortal(request);\n this.auditLogs = new AuditLogs(request);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAcO,IAAM,QAAN,MAAY;AAAA,EACjB,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA,EAElD,MAAM,OAAO,QAAmD;AAC9D,WAAO,KAAK,QAAQ,QAAQ,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAAA,EAC/D;AAAA,EAEA,MAAM,mBAAmB,QAA+D;AACtF,WAAO,KAAK,QAAQ,QAAQ,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAAA,EACxE;AAAA,EAEA,MAAM,aAAa,QAA6D;AAC9E,WAAO,KAAK,QAAQ,QAAQ,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,qBAAqB,QAAiE;AAC1F,WAAO,KAAK,QAAQ,QAAQ,kCAAkC,EAAE,MAAM,OAAO,CAAC;AAAA,EAChF;AAAA;AAAA,EAGA,MAAM,kBAAkB,QAA4D;AAClF,WAAO,KAAK,QAAQ,QAAQ,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAAA,EACxE;AAAA;AAAA,EAGA,MAAM,oBAAmD;AACvD,WAAO,KAAK,QAAQ,OAAO,wBAAwB;AAAA,EACrD;AAAA;AAAA,EAGA,MAAM,gBAAgB,QAAkE;AACtF,WAAO,KAAK,QAAQ,QAAQ,2BAA2B,EAAE,MAAM,OAAO,CAAC;AAAA,EACzE;AACF;;;ACxCO,IAAM,cAAN,MAAkB;AAAA,EACvB,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA,EAElD,MAAM,cAAc,QAAsE;AACxF,WAAO,KAAK,Q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,IACT,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,SAAS,OAA0C;AACvD,WAAO,KAAK,QAAQ,OAAO,uBAAuB,mBAAmB,KAAK,CAAC,EAAE;AAAA,EAC/E;AACF;;;ACQO,IAAM,kBAAN,cAA8B,QAAQ;AAAA,EAK3C,eAAe,MAA6C;AAC1D,UAAM,GAAG,IAAI;AACb,UAAM,UAAU,KAAK,QAAQ,KAAK,IAAI;AACtC,SAAK,QAAQ,IAAI,MAAM,OAAO;AAC9B,SAAK,cAAc,IAAI,YAAY,OAAO;AAC1C,SAAK,YAAY,IAAI,UAAU,OAAO;AAAA,EACxC;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/internal/resources/admin.ts","../src/internal/resources/adminPortal.ts","../src/internal/resources/auditLogs.ts","../src/internal/resources/cache.ts","../src/internal/resources/cardIssuers.ts","../src/internal/resources/configs.ts","../src/internal/resources/gsm.ts","../src/internal/resources/platformFees.ts","../src/internal/client.ts"],"sourcesContent":["import type { AuthResponse, SignUpWithMerchantIdRequest } from '../../types';\nimport type {\n AdminSignInRequest,\n AuthorizeResponse,\n CreateInternalUserRequest,\n CreateTenantUserRequest,\n OnboardMerchantRequest,\n OnboardMerchantResponse,\n SignupToggleRequest,\n SignupToggleResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Admin {\n constructor(private readonly request: RequestFn) {}\n\n async signIn(params: AdminSignInRequest): Promise<AuthResponse> {\n return this.request('POST', '/admin/signin', { body: params });\n }\n\n async createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/internal_signup', { body: params });\n }\n\n async createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/tenant_signup', { body: params });\n }\n\n /**\n * Create a new merchant admin user and merchant account atomically.\n *\n * This is the correct endpoint for bootstrapping the first admin user in a\n * fresh deployment — `internal_signup`/`tenant_signup` both require\n * pre-existing merchant records that don't exist on a clean database.\n *\n * `POST /admin/signup_with_merchant_id`\n */\n async signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/signup_with_merchant_id', { body: params });\n }\n\n /** Toggle public signup on/off. `POST /admin/settings/signup` */\n async setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse> {\n return this.request('POST', '/admin/settings/signup', { body: params });\n }\n\n /** Read current public-signup status. `GET /admin/settings/signup` */\n async getSignupSettings(): Promise<SignupToggleResponse> {\n return this.request('GET', '/admin/settings/signup');\n }\n\n /** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */\n async onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse> {\n return this.request('POST', '/admin/onboard_merchant', { body: params });\n }\n}\n","import type { MerchantAccountResponse, MerchantAccountUpdateRequest } from '../../types';\nimport type {\n AdminCustomerListParams,\n AdminCustomerListResponse,\n AdminCustomerDetail,\n AdminTransactionListParams,\n AdminTransactionListResponse,\n AdminAnalyticsRequest,\n PlatformAnalyticsResponse,\n OverviewStatsResponse,\n PaymentAnalyticsRequest,\n PaymentAnalyticsResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class AdminPortal {\n constructor(private readonly request: RequestFn) {}\n\n async listCustomers(params?: AdminCustomerListParams): Promise<AdminCustomerListResponse> {\n return this.request('GET', '/admin-portal/customers', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async getCustomer(customerId: string): Promise<AdminCustomerDetail> {\n return this.request('GET', `/admin-portal/customers/${encodeURIComponent(customerId)}`);\n }\n\n async listTransactions(\n params?: AdminTransactionListParams,\n ): Promise<AdminTransactionListResponse> {\n return this.request('GET', '/admin-portal/transactions', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async analytics(params: AdminAnalyticsRequest): Promise<PlatformAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async overviewStats(): Promise<OverviewStatsResponse> {\n return this.request('GET', '/admin-portal/overview-stats');\n }\n\n async paymentAnalytics(params: PaymentAnalyticsRequest): Promise<PaymentAnalyticsResponse> {\n return this.request('GET', '/admin-portal/payment-analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Retrieve a merchant account via the admin portal. Unlike\n * `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API\n * key) and does not require the JWT to be scoped to the target merchant.\n */\n async retrieveAccount(merchantId: string): Promise<MerchantAccountResponse> {\n return this.request('GET', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Update a merchant account via the admin portal. Authenticated via admin JWT\n * or admin API key.\n */\n async updateAccount(\n merchantId: string,\n params: MerchantAccountUpdateRequest,\n ): Promise<MerchantAccountResponse> {\n return this.request('POST', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant account via the admin portal. Authenticated via admin JWT\n * or admin API key.\n */\n async deleteAccount(merchantId: string): Promise<MerchantAccountResponse> {\n return this.request('DELETE', `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);\n }\n}\n","import type { AuditLogListParams, AuditLogListResponse, AuditLogResponse } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class AuditLogs {\n constructor(private readonly request: RequestFn) {}\n\n async list(params?: AuditLogListParams): Promise<AuditLogListResponse> {\n return this.request('GET', '/admin-portal/audit', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n async retrieve(logId: string): Promise<AuditLogResponse> {\n return this.request('GET', `/admin-portal/audit/${encodeURIComponent(logId)}`);\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Cache {\n constructor(private readonly request: RequestFn) {}\n\n /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */\n async invalidate(key: string): Promise<Record<string, unknown>> {\n return this.request('POST', `/cache/invalidate/${encodeURIComponent(key)}`);\n }\n}\n","import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card_issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card_issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card_issuers');\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Configs {\n constructor(private readonly request: RequestFn) {}\n\n /** Create a config. `POST /configs` */\n async create(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/configs', { body: params });\n }\n\n /** Retrieve a config by key. `GET /configs/{key}` */\n async retrieve(key: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/configs/${encodeURIComponent(key)}`);\n }\n\n /** Update a config. `PUT /configs/{key}` */\n async update(key: string, params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('PUT', `/configs/${encodeURIComponent(key)}`, { body: params });\n }\n\n /** Delete a config. `DELETE /configs/{key}` */\n async delete(key: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/configs/${encodeURIComponent(key)}`);\n }\n}\n","import type { GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Gsm {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm', { body: params });\n }\n\n async retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/get', { body: params });\n }\n\n async update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/update', { body: params });\n }\n\n async delete(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/delete', { body: params });\n }\n}\n","import type {\n FeeScheduleCreateRequest,\n FeeScheduleResponse,\n FeeScheduleUpdateRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-wide fee schedule management. Admin-only routes under\n * `/admin/fees/*`. Exposed only via `'@delopay/sdk/internal'`.\n */\nexport class PlatformFees {\n constructor(private readonly request: RequestFn) {}\n\n /** Create a platform fee schedule for a specific merchant. */\n async create(params: FeeScheduleCreateRequest, merchantId: string): Promise<FeeScheduleResponse> {\n return this.request('POST', '/admin/fees', {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /** List every platform fee schedule assigned to a merchant. */\n async list(merchantId: string): Promise<FeeScheduleResponse[]> {\n return this.request('GET', '/admin/fees/list', {\n query: { merchant_id: merchantId },\n });\n }\n\n /** Retrieve a single platform fee schedule by ID. */\n async retrieve(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('GET', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n\n /** Update a platform fee schedule. */\n async update(feeId: string, params: FeeScheduleUpdateRequest): Promise<FeeScheduleResponse> {\n return this.request('PUT', `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });\n }\n\n /** Delete a platform fee schedule. */\n async delete(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('DELETE', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n}\n","import type { RequestFn } from '../client';\nimport { Delopay } from '../client';\nimport { Admin } from './resources/admin';\nimport { AdminPortal } from './resources/adminPortal';\nimport { AuditLogs } from './resources/auditLogs';\nimport { Cache } from './resources/cache';\nimport { CardIssuers } from './resources/cardIssuers';\nimport { Configs } from './resources/configs';\nimport { Gsm } from './resources/gsm';\nimport { PlatformFees } from './resources/platformFees';\n\n/**\n * Internal-only Delopay client for DeloPay staff tooling (the admin\n * control-center, audit UIs, etc.). Extends the public `Delopay` surface\n * with admin-plane resources that must **not** be discoverable from the\n * merchant-facing package entry.\n *\n * Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.\n * The merchant-facing `import { Delopay } from '@delopay/sdk'` never\n * surfaces these.\n */\nexport class DelopayInternal extends Delopay {\n /** Bootstrap admin endpoints — signup, signin, onboarding. */\n readonly admin: Admin;\n /** Platform-wide customer, transaction, analytics, merchant-account ops. */\n readonly adminPortal: AdminPortal;\n /** Audit log reads. */\n readonly auditLogs: AuditLogs;\n /** Backend cache invalidation. */\n readonly cache: Cache;\n /** Platform card-issuer program management. */\n readonly cardIssuers: CardIssuers;\n /** Generic platform config store. */\n readonly configs: Configs;\n /** GSM (Gateway Status Mapping) routing rules. */\n readonly gsm: Gsm;\n /** Platform-wide fee schedules assigned to merchants. */\n readonly platformFees: PlatformFees;\n\n constructor(...args: ConstructorParameters<typeof Delopay>) {\n super(...args);\n const request = this.request.bind(this) as RequestFn;\n this.admin = new Admin(request);\n this.adminPortal = new AdminPortal(request);\n this.auditLogs = new AuditLogs(request);\n this.cache = new Cache(request);\n this.cardIssuers = new CardIssuers(request);\n this.configs = new Configs(request);\n this.gsm = new Gsm(request);\n this.platformFees = new PlatformFees(request);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAaO,IAAM,QAAN,MAAY;AAAA,EACjB,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA,EAElD,MAAM,OAAO,QAAmD;AAC9D,WAAO,KAAK,QAAQ,QAAQ,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAAA,EAC/D;AAAA,EAEA,MAAM,mBAAmB,QAA+D;AACtF,WAAO,KAAK,QAAQ,QAAQ,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAAA,EACxE;AAAA,EAEA,MAAM,aAAa,QAA6D;AAC9E,WAAO,KAAK,QAAQ,QAAQ,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,qBAAqB,QAAiE;AAC1F,WAAO,KAAK,QAAQ,QAAQ,k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e;AAAA,MACzC,MAAM;AAAA,MACN,OAAO,EAAE,aAAa,WAAW;AAAA,IACnC,CAAC;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,KAAK,YAAoD;AAC7D,WAAO,KAAK,QAAQ,OAAO,oBAAoB;AAAA,MAC7C,OAAO,EAAE,aAAa,WAAW;AAAA,IACnC,CAAC;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,SAAS,OAA6C;AAC1D,WAAO,KAAK,QAAQ,OAAO,eAAe,mBAAmB,KAAK,CAAC,EAAE;AAAA,EACvE;AAAA;AAAA,EAGA,MAAM,OAAO,OAAe,QAAgE;AAC1F,WAAO,KAAK,QAAQ,OAAO,eAAe,mBAAmB,KAAK,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC;AAAA,EACzF;AAAA;AAAA,EAGA,MAAM,OAAO,OAA6C;AACxD,WAAO,KAAK,QAAQ,UAAU,eAAe,mBAAmB,KAAK,CAAC,EAAE;AAAA,EAC1E;AACF;;;ACtBO,IAAM,kBAAN,cAA8B,QAAQ;AAAA,EAkB3C,eAAe,MAA6C;AAC1D,UAAM,GAAG,IAAI;AACb,UAAM,UAAU,KAAK,QAAQ,KAAK,IAAI;AACtC,SAAK,QAAQ,IAAI,MAAM,OAAO;AAC9B,SAAK,cAAc,IAAI,YAAY,OAAO;AAC1C,SAAK,YAAY,IAAI,UAAU,OAAO;AACtC,SAAK,QAAQ,IAAI,MAAM,OAAO;AAC9B,SAAK,cAAc,IAAI,YAAY,OAAO;AAC1C,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,MAAM,IAAI,IAAI,OAAO;AAC1B,SAAK,eAAe,IAAI,aAAa,OAAO;AAAA,EAC9C;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delopay/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Official Delopay TypeScript SDK",
5
5
  "type": "module",
6
6
  "sideEffects": false,