@delopay/sdk 0.5.0 → 0.6.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-LCF7ILAH.js +2959 -0
- package/dist/chunk-LCF7ILAH.js.map +1 -0
- package/dist/index.cjs +8 -131
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -70
- package/dist/index.d.ts +5 -70
- package/dist/index.js +17 -3063
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +3130 -0
- package/dist/internal.cjs.map +1 -0
- package/dist/internal.d.cts +86 -0
- package/dist/internal.d.ts +86 -0
- package/dist/internal.js +162 -0
- package/dist/internal.js.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1,86 @@
|
|
|
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.cjs';
|
|
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.cjs';
|
|
3
|
+
|
|
4
|
+
declare class Admin {
|
|
5
|
+
private readonly request;
|
|
6
|
+
constructor(request: RequestFn);
|
|
7
|
+
signIn(params: AdminSignInRequest): Promise<AuthResponse>;
|
|
8
|
+
createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse>;
|
|
9
|
+
createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Create a new merchant admin user and merchant account atomically.
|
|
12
|
+
*
|
|
13
|
+
* This is the correct endpoint for bootstrapping the first admin user in a
|
|
14
|
+
* fresh deployment — `internal_signup`/`tenant_signup` both require
|
|
15
|
+
* pre-existing merchant records that don't exist on a clean database.
|
|
16
|
+
*
|
|
17
|
+
* `POST /admin/signup_with_merchant_id`
|
|
18
|
+
*/
|
|
19
|
+
signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse>;
|
|
20
|
+
/** Toggle public signup on/off. `POST /admin/settings/signup` */
|
|
21
|
+
setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse>;
|
|
22
|
+
/** Read current public-signup status. `GET /admin/settings/signup` */
|
|
23
|
+
getSignupSettings(): Promise<SignupToggleResponse>;
|
|
24
|
+
/** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */
|
|
25
|
+
onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class AdminPortal {
|
|
29
|
+
private readonly request;
|
|
30
|
+
constructor(request: RequestFn);
|
|
31
|
+
listCustomers(params?: AdminCustomerListParams): Promise<AdminCustomerListResponse>;
|
|
32
|
+
getCustomer(customerId: string): Promise<AdminCustomerDetail>;
|
|
33
|
+
listTransactions(params?: AdminTransactionListParams): Promise<AdminTransactionListResponse>;
|
|
34
|
+
analytics(params: AdminAnalyticsRequest): Promise<PlatformAnalyticsResponse>;
|
|
35
|
+
overviewStats(): Promise<OverviewStatsResponse>;
|
|
36
|
+
paymentAnalytics(params: PaymentAnalyticsRequest): Promise<PaymentAnalyticsResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve a merchant account via the admin portal. Unlike
|
|
39
|
+
* `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API
|
|
40
|
+
* key) and does not require the JWT to be scoped to the target merchant.
|
|
41
|
+
*/
|
|
42
|
+
retrieveAccount(merchantId: string): Promise<MerchantAccountResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Update a merchant account via the admin portal. Authenticated via admin JWT
|
|
45
|
+
* or admin API key.
|
|
46
|
+
*/
|
|
47
|
+
updateAccount(merchantId: string, params: MerchantAccountUpdateRequest): Promise<MerchantAccountResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete a merchant account via the admin portal. Authenticated via admin JWT
|
|
50
|
+
* or admin API key.
|
|
51
|
+
*/
|
|
52
|
+
deleteAccount(merchantId: string): Promise<MerchantAccountResponse>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare class AuditLogs {
|
|
56
|
+
private readonly request;
|
|
57
|
+
constructor(request: RequestFn);
|
|
58
|
+
list(params?: AuditLogListParams): Promise<AuditLogListResponse>;
|
|
59
|
+
retrieve(logId: string): Promise<AuditLogResponse>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Internal-only Delopay client for DeloPay staff tooling (the admin
|
|
64
|
+
* control-center, audit UIs, etc.). Extends the public `Delopay` surface
|
|
65
|
+
* with admin-plane resources that must **not** be discoverable from the
|
|
66
|
+
* merchant-facing package entry.
|
|
67
|
+
*
|
|
68
|
+
* Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.
|
|
69
|
+
* The merchant-facing `import { Delopay } from '@delopay/sdk'` never
|
|
70
|
+
* 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
|
+
*/
|
|
79
|
+
declare class DelopayInternal extends Delopay {
|
|
80
|
+
readonly admin: Admin;
|
|
81
|
+
readonly adminPortal: AdminPortal;
|
|
82
|
+
readonly auditLogs: AuditLogs;
|
|
83
|
+
constructor(...args: ConstructorParameters<typeof Delopay>);
|
|
84
|
+
}
|
|
85
|
+
|
|
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 };
|
|
@@ -0,0 +1,86 @@
|
|
|
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';
|
|
3
|
+
|
|
4
|
+
declare class Admin {
|
|
5
|
+
private readonly request;
|
|
6
|
+
constructor(request: RequestFn);
|
|
7
|
+
signIn(params: AdminSignInRequest): Promise<AuthResponse>;
|
|
8
|
+
createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse>;
|
|
9
|
+
createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Create a new merchant admin user and merchant account atomically.
|
|
12
|
+
*
|
|
13
|
+
* This is the correct endpoint for bootstrapping the first admin user in a
|
|
14
|
+
* fresh deployment — `internal_signup`/`tenant_signup` both require
|
|
15
|
+
* pre-existing merchant records that don't exist on a clean database.
|
|
16
|
+
*
|
|
17
|
+
* `POST /admin/signup_with_merchant_id`
|
|
18
|
+
*/
|
|
19
|
+
signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse>;
|
|
20
|
+
/** Toggle public signup on/off. `POST /admin/settings/signup` */
|
|
21
|
+
setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse>;
|
|
22
|
+
/** Read current public-signup status. `GET /admin/settings/signup` */
|
|
23
|
+
getSignupSettings(): Promise<SignupToggleResponse>;
|
|
24
|
+
/** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */
|
|
25
|
+
onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class AdminPortal {
|
|
29
|
+
private readonly request;
|
|
30
|
+
constructor(request: RequestFn);
|
|
31
|
+
listCustomers(params?: AdminCustomerListParams): Promise<AdminCustomerListResponse>;
|
|
32
|
+
getCustomer(customerId: string): Promise<AdminCustomerDetail>;
|
|
33
|
+
listTransactions(params?: AdminTransactionListParams): Promise<AdminTransactionListResponse>;
|
|
34
|
+
analytics(params: AdminAnalyticsRequest): Promise<PlatformAnalyticsResponse>;
|
|
35
|
+
overviewStats(): Promise<OverviewStatsResponse>;
|
|
36
|
+
paymentAnalytics(params: PaymentAnalyticsRequest): Promise<PaymentAnalyticsResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve a merchant account via the admin portal. Unlike
|
|
39
|
+
* `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API
|
|
40
|
+
* key) and does not require the JWT to be scoped to the target merchant.
|
|
41
|
+
*/
|
|
42
|
+
retrieveAccount(merchantId: string): Promise<MerchantAccountResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Update a merchant account via the admin portal. Authenticated via admin JWT
|
|
45
|
+
* or admin API key.
|
|
46
|
+
*/
|
|
47
|
+
updateAccount(merchantId: string, params: MerchantAccountUpdateRequest): Promise<MerchantAccountResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete a merchant account via the admin portal. Authenticated via admin JWT
|
|
50
|
+
* or admin API key.
|
|
51
|
+
*/
|
|
52
|
+
deleteAccount(merchantId: string): Promise<MerchantAccountResponse>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare class AuditLogs {
|
|
56
|
+
private readonly request;
|
|
57
|
+
constructor(request: RequestFn);
|
|
58
|
+
list(params?: AuditLogListParams): Promise<AuditLogListResponse>;
|
|
59
|
+
retrieve(logId: string): Promise<AuditLogResponse>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Internal-only Delopay client for DeloPay staff tooling (the admin
|
|
64
|
+
* control-center, audit UIs, etc.). Extends the public `Delopay` surface
|
|
65
|
+
* with admin-plane resources that must **not** be discoverable from the
|
|
66
|
+
* merchant-facing package entry.
|
|
67
|
+
*
|
|
68
|
+
* Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.
|
|
69
|
+
* The merchant-facing `import { Delopay } from '@delopay/sdk'` never
|
|
70
|
+
* 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
|
+
*/
|
|
79
|
+
declare class DelopayInternal extends Delopay {
|
|
80
|
+
readonly admin: Admin;
|
|
81
|
+
readonly adminPortal: AdminPortal;
|
|
82
|
+
readonly auditLogs: AuditLogs;
|
|
83
|
+
constructor(...args: ConstructorParameters<typeof Delopay>);
|
|
84
|
+
}
|
|
85
|
+
|
|
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 };
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Analytics,
|
|
3
|
+
AnalyticsDashboard,
|
|
4
|
+
Cache,
|
|
5
|
+
Cards,
|
|
6
|
+
Configs,
|
|
7
|
+
Delopay,
|
|
8
|
+
DelopayAuthenticationError,
|
|
9
|
+
DelopayError,
|
|
10
|
+
Export,
|
|
11
|
+
FeatureMatrix,
|
|
12
|
+
Files,
|
|
13
|
+
Forex,
|
|
14
|
+
Regions,
|
|
15
|
+
Subscriptions,
|
|
16
|
+
Webhooks
|
|
17
|
+
} from "./chunk-LCF7ILAH.js";
|
|
18
|
+
|
|
19
|
+
// src/resources/admin.ts
|
|
20
|
+
var Admin = class {
|
|
21
|
+
constructor(request) {
|
|
22
|
+
this.request = request;
|
|
23
|
+
}
|
|
24
|
+
async signIn(params) {
|
|
25
|
+
return this.request("POST", "/admin/signin", { body: params });
|
|
26
|
+
}
|
|
27
|
+
async createInternalUser(params) {
|
|
28
|
+
return this.request("POST", "/admin/internal_signup", { body: params });
|
|
29
|
+
}
|
|
30
|
+
async createTenant(params) {
|
|
31
|
+
return this.request("POST", "/admin/tenant_signup", { body: params });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create a new merchant admin user and merchant account atomically.
|
|
35
|
+
*
|
|
36
|
+
* This is the correct endpoint for bootstrapping the first admin user in a
|
|
37
|
+
* fresh deployment — `internal_signup`/`tenant_signup` both require
|
|
38
|
+
* pre-existing merchant records that don't exist on a clean database.
|
|
39
|
+
*
|
|
40
|
+
* `POST /admin/signup_with_merchant_id`
|
|
41
|
+
*/
|
|
42
|
+
async signupWithMerchantId(params) {
|
|
43
|
+
return this.request("POST", "/admin/signup_with_merchant_id", { body: params });
|
|
44
|
+
}
|
|
45
|
+
/** Toggle public signup on/off. `POST /admin/settings/signup` */
|
|
46
|
+
async setSignupSettings(params) {
|
|
47
|
+
return this.request("POST", "/admin/settings/signup", { body: params });
|
|
48
|
+
}
|
|
49
|
+
/** Read current public-signup status. `GET /admin/settings/signup` */
|
|
50
|
+
async getSignupSettings() {
|
|
51
|
+
return this.request("GET", "/admin/settings/signup");
|
|
52
|
+
}
|
|
53
|
+
/** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */
|
|
54
|
+
async onboardMerchant(params) {
|
|
55
|
+
return this.request("POST", "/admin/onboard_merchant", { body: params });
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/resources/adminPortal.ts
|
|
60
|
+
var AdminPortal = class {
|
|
61
|
+
constructor(request) {
|
|
62
|
+
this.request = request;
|
|
63
|
+
}
|
|
64
|
+
async listCustomers(params) {
|
|
65
|
+
return this.request("GET", "/admin-portal/customers", {
|
|
66
|
+
query: params
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async getCustomer(customerId) {
|
|
70
|
+
return this.request("GET", `/admin-portal/customers/${encodeURIComponent(customerId)}`);
|
|
71
|
+
}
|
|
72
|
+
async listTransactions(params) {
|
|
73
|
+
return this.request("GET", "/admin-portal/transactions", {
|
|
74
|
+
query: params
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
async analytics(params) {
|
|
78
|
+
return this.request("GET", "/admin-portal/analytics", {
|
|
79
|
+
query: params
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
async overviewStats() {
|
|
83
|
+
return this.request("GET", "/admin-portal/overview-stats");
|
|
84
|
+
}
|
|
85
|
+
async paymentAnalytics(params) {
|
|
86
|
+
return this.request("GET", "/admin-portal/payment-analytics", {
|
|
87
|
+
query: params
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Retrieve a merchant account via the admin portal. Unlike
|
|
92
|
+
* `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API
|
|
93
|
+
* key) and does not require the JWT to be scoped to the target merchant.
|
|
94
|
+
*/
|
|
95
|
+
async retrieveAccount(merchantId) {
|
|
96
|
+
return this.request("GET", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Update a merchant account via the admin portal. Authenticated via admin JWT
|
|
100
|
+
* or admin API key.
|
|
101
|
+
*/
|
|
102
|
+
async updateAccount(merchantId, params) {
|
|
103
|
+
return this.request("POST", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`, {
|
|
104
|
+
body: params
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Delete a merchant account via the admin portal. Authenticated via admin JWT
|
|
109
|
+
* or admin API key.
|
|
110
|
+
*/
|
|
111
|
+
async deleteAccount(merchantId) {
|
|
112
|
+
return this.request("DELETE", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// src/resources/auditLogs.ts
|
|
117
|
+
var AuditLogs = class {
|
|
118
|
+
constructor(request) {
|
|
119
|
+
this.request = request;
|
|
120
|
+
}
|
|
121
|
+
async list(params) {
|
|
122
|
+
return this.request("GET", "/admin-portal/audit", {
|
|
123
|
+
query: params
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
async retrieve(logId) {
|
|
127
|
+
return this.request("GET", `/admin-portal/audit/${encodeURIComponent(logId)}`);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// src/internal/client.ts
|
|
132
|
+
var DelopayInternal = class extends Delopay {
|
|
133
|
+
constructor(...args) {
|
|
134
|
+
super(...args);
|
|
135
|
+
const request = this.request.bind(this);
|
|
136
|
+
this.admin = new Admin(request);
|
|
137
|
+
this.adminPortal = new AdminPortal(request);
|
|
138
|
+
this.auditLogs = new AuditLogs(request);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
Admin,
|
|
143
|
+
AdminPortal,
|
|
144
|
+
Analytics,
|
|
145
|
+
AnalyticsDashboard,
|
|
146
|
+
AuditLogs,
|
|
147
|
+
Cache,
|
|
148
|
+
Cards,
|
|
149
|
+
Configs,
|
|
150
|
+
Delopay,
|
|
151
|
+
DelopayAuthenticationError,
|
|
152
|
+
DelopayError,
|
|
153
|
+
DelopayInternal,
|
|
154
|
+
Export,
|
|
155
|
+
FeatureMatrix,
|
|
156
|
+
Files,
|
|
157
|
+
Forex,
|
|
158
|
+
Regions,
|
|
159
|
+
Subscriptions,
|
|
160
|
+
Webhooks
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +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":"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","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delopay/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Official Delopay TypeScript SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -17,6 +17,16 @@
|
|
|
17
17
|
"types": "./dist/index.d.cts",
|
|
18
18
|
"default": "./dist/index.cjs"
|
|
19
19
|
}
|
|
20
|
+
},
|
|
21
|
+
"./internal": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./dist/internal.d.ts",
|
|
24
|
+
"default": "./dist/internal.js"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./dist/internal.d.cts",
|
|
28
|
+
"default": "./dist/internal.cjs"
|
|
29
|
+
}
|
|
20
30
|
}
|
|
21
31
|
},
|
|
22
32
|
"files": [
|