@delopay/sdk 0.60.0 → 0.62.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/README.md +430 -421
- package/dist/{chunk-6GBHQKUX.js → chunk-2OWZIFZO.js} +104 -1
- package/dist/chunk-2OWZIFZO.js.map +1 -0
- package/dist/index.cjs +103 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +114 -6
- package/dist/index.d.ts +114 -6
- package/dist/index.js +1 -1
- package/dist/internal.cjs +103 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/package.json +64 -63
- package/dist/chunk-6GBHQKUX.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -692,15 +692,20 @@ interface DisputeResponse {
|
|
|
692
692
|
}
|
|
693
693
|
interface DisputeListParams {
|
|
694
694
|
limit?: number | null;
|
|
695
|
+
offset?: number | null;
|
|
696
|
+
dispute_id?: string | null;
|
|
697
|
+
/** Filter disputes raised against one payment. */
|
|
698
|
+
payment_id?: string | null;
|
|
699
|
+
profile_id?: string | null;
|
|
695
700
|
dispute_status?: DisputeStatus | null;
|
|
696
701
|
dispute_stage?: DisputeStage | null;
|
|
697
702
|
reason?: string | null;
|
|
698
703
|
connector?: string | null;
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
+
currency?: Currency | null;
|
|
705
|
+
/** ISO 8601 creation-time range start (required to time-filter). */
|
|
706
|
+
start_time?: string | null;
|
|
707
|
+
/** ISO 8601 creation-time range end; defaults to now. */
|
|
708
|
+
end_time?: string | null;
|
|
704
709
|
}
|
|
705
710
|
interface DisputeEvidenceRequest {
|
|
706
711
|
cancel_dispute?: boolean | null;
|
|
@@ -1337,6 +1342,12 @@ interface ApiKeyCreateResponse {
|
|
|
1337
1342
|
created: string;
|
|
1338
1343
|
expiration: ApiKeyExpiration;
|
|
1339
1344
|
description?: string | null;
|
|
1345
|
+
/**
|
|
1346
|
+
* The shop (business profile) this key is pinned to, or `null`/absent for
|
|
1347
|
+
* merchant-wide keys. Only populated by backends with profile-scoped API
|
|
1348
|
+
* key support (DeloPay-net/delopay-backend#344); absent on older backends.
|
|
1349
|
+
*/
|
|
1350
|
+
profile_id?: string | null;
|
|
1340
1351
|
}
|
|
1341
1352
|
/** Returned on retrieve/list — no plaintext key, only prefix */
|
|
1342
1353
|
interface ApiKeyResponse {
|
|
@@ -1347,12 +1358,25 @@ interface ApiKeyResponse {
|
|
|
1347
1358
|
created: string;
|
|
1348
1359
|
expiration: ApiKeyExpiration;
|
|
1349
1360
|
description?: string | null;
|
|
1361
|
+
/**
|
|
1362
|
+
* The shop (business profile) this key is pinned to, or `null`/absent for
|
|
1363
|
+
* merchant-wide keys. Only populated by backends with profile-scoped API
|
|
1364
|
+
* key support (DeloPay-net/delopay-backend#344); absent on older backends.
|
|
1365
|
+
*/
|
|
1366
|
+
profile_id?: string | null;
|
|
1350
1367
|
}
|
|
1351
1368
|
interface ApiKeyRevokeResponse {
|
|
1352
1369
|
merchant_id: string;
|
|
1353
1370
|
key_id: string;
|
|
1354
1371
|
revoked: boolean;
|
|
1355
1372
|
}
|
|
1373
|
+
/** Pagination constraints for listing API keys. */
|
|
1374
|
+
interface ApiKeyListConstraints {
|
|
1375
|
+
/** Maximum number of keys to return. */
|
|
1376
|
+
limit?: number | null;
|
|
1377
|
+
/** Number of keys to skip (offset). */
|
|
1378
|
+
skip?: number | null;
|
|
1379
|
+
}
|
|
1356
1380
|
interface EphemeralKeyCreateRequest {
|
|
1357
1381
|
customer_id: string;
|
|
1358
1382
|
}
|
|
@@ -1682,6 +1706,20 @@ interface SwitchMerchantRequest {
|
|
|
1682
1706
|
interface SwitchProfileRequest {
|
|
1683
1707
|
profile_id: string;
|
|
1684
1708
|
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Body for `POST /user/employees/impersonate` — act as one of your own team
|
|
1711
|
+
* members. The member's role must rank strictly below the caller's (enforced
|
|
1712
|
+
* server-side). The returned token is meant for a fresh, isolated tab (e.g.
|
|
1713
|
+
* `/auth/impersonate?token=…`), not the caller's own session.
|
|
1714
|
+
*/
|
|
1715
|
+
interface ImpersonateEmployeeRequest {
|
|
1716
|
+
/** Email of the team member to impersonate. */
|
|
1717
|
+
email: string;
|
|
1718
|
+
/** Disambiguates when the member holds several roles under this merchant. */
|
|
1719
|
+
role_id?: string;
|
|
1720
|
+
/** Shop context — restricts the membership lookup to this shop's role row. */
|
|
1721
|
+
profile_id?: string;
|
|
1722
|
+
}
|
|
1685
1723
|
interface InviteUsersRequest {
|
|
1686
1724
|
email: string;
|
|
1687
1725
|
name: string;
|
|
@@ -2800,6 +2838,61 @@ declare class ApiKeys {
|
|
|
2800
2838
|
* @returns Array of API key metadata objects.
|
|
2801
2839
|
*/
|
|
2802
2840
|
list(merchantId: string): Promise<ApiKeyResponse[]>;
|
|
2841
|
+
/**
|
|
2842
|
+
* Create a new API key pinned to the caller's shop (business profile).
|
|
2843
|
+
* `POST /account/{merchantId}/profile/api-keys`
|
|
2844
|
+
*
|
|
2845
|
+
* @param merchantId - The merchant account ID.
|
|
2846
|
+
* @param params - Key creation parameters (name, expiry, etc.).
|
|
2847
|
+
* @returns The newly created key including the plaintext secret (shown once
|
|
2848
|
+
* only) and the `profile_id` it is pinned to.
|
|
2849
|
+
*
|
|
2850
|
+
* @example
|
|
2851
|
+
* ```typescript
|
|
2852
|
+
* const { api_key } = await delopay.apiKeys.createByProfile('merch_123', {
|
|
2853
|
+
* name: 'Shop key',
|
|
2854
|
+
* expiration: 'never',
|
|
2855
|
+
* });
|
|
2856
|
+
* ```
|
|
2857
|
+
*/
|
|
2858
|
+
createByProfile(merchantId: string, params: ApiKeyCreateRequest): Promise<ApiKeyCreateResponse>;
|
|
2859
|
+
/**
|
|
2860
|
+
* List API keys pinned to the caller's shop (business profile) only.
|
|
2861
|
+
* `GET /account/{merchantId}/profile/api-keys`
|
|
2862
|
+
*
|
|
2863
|
+
* @param merchantId - The merchant account ID.
|
|
2864
|
+
* @param params - Optional pagination constraints (`limit`, `skip`).
|
|
2865
|
+
* @returns Array of API key metadata objects belonging to the caller's shop.
|
|
2866
|
+
*/
|
|
2867
|
+
listByProfile(merchantId: string, params?: ApiKeyListConstraints): Promise<ApiKeyResponse[]>;
|
|
2868
|
+
/**
|
|
2869
|
+
* Retrieve metadata about a shop-pinned API key (does not return the
|
|
2870
|
+
* plaintext secret). `GET /account/{merchantId}/profile/api-keys/{keyId}`
|
|
2871
|
+
*
|
|
2872
|
+
* @param merchantId - The merchant account ID.
|
|
2873
|
+
* @param keyId - The API key ID.
|
|
2874
|
+
* @returns The API key metadata.
|
|
2875
|
+
*/
|
|
2876
|
+
retrieveByProfile(merchantId: string, keyId: string): Promise<ApiKeyResponse>;
|
|
2877
|
+
/**
|
|
2878
|
+
* Update a shop-pinned API key's name, description, or expiry.
|
|
2879
|
+
* `POST /account/{merchantId}/profile/api-keys/{keyId}`
|
|
2880
|
+
*
|
|
2881
|
+
* @param merchantId - The merchant account ID.
|
|
2882
|
+
* @param keyId - The API key ID to update.
|
|
2883
|
+
* @param params - Fields to update.
|
|
2884
|
+
* @returns The updated API key metadata.
|
|
2885
|
+
*/
|
|
2886
|
+
updateByProfile(merchantId: string, keyId: string, params: ApiKeyUpdateRequest): Promise<ApiKeyResponse>;
|
|
2887
|
+
/**
|
|
2888
|
+
* Revoke a shop-pinned API key, immediately invalidating it.
|
|
2889
|
+
* `DELETE /account/{merchantId}/profile/api-keys/{keyId}`
|
|
2890
|
+
*
|
|
2891
|
+
* @param merchantId - The merchant account ID.
|
|
2892
|
+
* @param keyId - The API key ID to revoke.
|
|
2893
|
+
* @returns Revocation confirmation.
|
|
2894
|
+
*/
|
|
2895
|
+
revokeByProfile(merchantId: string, keyId: string): Promise<ApiKeyRevokeResponse>;
|
|
2803
2896
|
}
|
|
2804
2897
|
|
|
2805
2898
|
declare class Authentication {
|
|
@@ -4257,6 +4350,21 @@ declare class Users {
|
|
|
4257
4350
|
* shop-scoped caller can only target their own shop.
|
|
4258
4351
|
*/
|
|
4259
4352
|
addUser(params: AddUserRequest): Promise<AddUserResponse>;
|
|
4353
|
+
/**
|
|
4354
|
+
* Impersonate one of your own team members — `POST /user/employees/impersonate`.
|
|
4355
|
+
*
|
|
4356
|
+
* Mints a session token **as** the given member, so the dashboard renders
|
|
4357
|
+
* exactly what they see (useful for support and role verification). The
|
|
4358
|
+
* caller needs the *Impersonation* permission, and the member's role must
|
|
4359
|
+
* rank **strictly below** the caller's (`Profile < Merchant < Organization`);
|
|
4360
|
+
* the server rejects self-impersonation, cross-merchant targets, and
|
|
4361
|
+
* equal/higher roles.
|
|
4362
|
+
*
|
|
4363
|
+
* The returned token is tab-scoped by design: open it in a fresh tab (e.g.
|
|
4364
|
+
* `/auth/impersonate?token=…`) rather than replacing the caller's own
|
|
4365
|
+
* session. No auth cookie is set on the response.
|
|
4366
|
+
*/
|
|
4367
|
+
impersonateEmployee(params: ImpersonateEmployeeRequest): Promise<TokenResponse>;
|
|
4260
4368
|
acceptInvitation(params: Record<string, unknown>): Promise<AuthResponse>;
|
|
4261
4369
|
/**
|
|
4262
4370
|
* Accept an invitation via the email-link flow.
|
|
@@ -5234,4 +5342,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
5234
5342
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
5235
5343
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
5236
5344
|
|
|
5237
|
-
export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
|
5345
|
+
export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -692,15 +692,20 @@ interface DisputeResponse {
|
|
|
692
692
|
}
|
|
693
693
|
interface DisputeListParams {
|
|
694
694
|
limit?: number | null;
|
|
695
|
+
offset?: number | null;
|
|
696
|
+
dispute_id?: string | null;
|
|
697
|
+
/** Filter disputes raised against one payment. */
|
|
698
|
+
payment_id?: string | null;
|
|
699
|
+
profile_id?: string | null;
|
|
695
700
|
dispute_status?: DisputeStatus | null;
|
|
696
701
|
dispute_stage?: DisputeStage | null;
|
|
697
702
|
reason?: string | null;
|
|
698
703
|
connector?: string | null;
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
+
currency?: Currency | null;
|
|
705
|
+
/** ISO 8601 creation-time range start (required to time-filter). */
|
|
706
|
+
start_time?: string | null;
|
|
707
|
+
/** ISO 8601 creation-time range end; defaults to now. */
|
|
708
|
+
end_time?: string | null;
|
|
704
709
|
}
|
|
705
710
|
interface DisputeEvidenceRequest {
|
|
706
711
|
cancel_dispute?: boolean | null;
|
|
@@ -1337,6 +1342,12 @@ interface ApiKeyCreateResponse {
|
|
|
1337
1342
|
created: string;
|
|
1338
1343
|
expiration: ApiKeyExpiration;
|
|
1339
1344
|
description?: string | null;
|
|
1345
|
+
/**
|
|
1346
|
+
* The shop (business profile) this key is pinned to, or `null`/absent for
|
|
1347
|
+
* merchant-wide keys. Only populated by backends with profile-scoped API
|
|
1348
|
+
* key support (DeloPay-net/delopay-backend#344); absent on older backends.
|
|
1349
|
+
*/
|
|
1350
|
+
profile_id?: string | null;
|
|
1340
1351
|
}
|
|
1341
1352
|
/** Returned on retrieve/list — no plaintext key, only prefix */
|
|
1342
1353
|
interface ApiKeyResponse {
|
|
@@ -1347,12 +1358,25 @@ interface ApiKeyResponse {
|
|
|
1347
1358
|
created: string;
|
|
1348
1359
|
expiration: ApiKeyExpiration;
|
|
1349
1360
|
description?: string | null;
|
|
1361
|
+
/**
|
|
1362
|
+
* The shop (business profile) this key is pinned to, or `null`/absent for
|
|
1363
|
+
* merchant-wide keys. Only populated by backends with profile-scoped API
|
|
1364
|
+
* key support (DeloPay-net/delopay-backend#344); absent on older backends.
|
|
1365
|
+
*/
|
|
1366
|
+
profile_id?: string | null;
|
|
1350
1367
|
}
|
|
1351
1368
|
interface ApiKeyRevokeResponse {
|
|
1352
1369
|
merchant_id: string;
|
|
1353
1370
|
key_id: string;
|
|
1354
1371
|
revoked: boolean;
|
|
1355
1372
|
}
|
|
1373
|
+
/** Pagination constraints for listing API keys. */
|
|
1374
|
+
interface ApiKeyListConstraints {
|
|
1375
|
+
/** Maximum number of keys to return. */
|
|
1376
|
+
limit?: number | null;
|
|
1377
|
+
/** Number of keys to skip (offset). */
|
|
1378
|
+
skip?: number | null;
|
|
1379
|
+
}
|
|
1356
1380
|
interface EphemeralKeyCreateRequest {
|
|
1357
1381
|
customer_id: string;
|
|
1358
1382
|
}
|
|
@@ -1682,6 +1706,20 @@ interface SwitchMerchantRequest {
|
|
|
1682
1706
|
interface SwitchProfileRequest {
|
|
1683
1707
|
profile_id: string;
|
|
1684
1708
|
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Body for `POST /user/employees/impersonate` — act as one of your own team
|
|
1711
|
+
* members. The member's role must rank strictly below the caller's (enforced
|
|
1712
|
+
* server-side). The returned token is meant for a fresh, isolated tab (e.g.
|
|
1713
|
+
* `/auth/impersonate?token=…`), not the caller's own session.
|
|
1714
|
+
*/
|
|
1715
|
+
interface ImpersonateEmployeeRequest {
|
|
1716
|
+
/** Email of the team member to impersonate. */
|
|
1717
|
+
email: string;
|
|
1718
|
+
/** Disambiguates when the member holds several roles under this merchant. */
|
|
1719
|
+
role_id?: string;
|
|
1720
|
+
/** Shop context — restricts the membership lookup to this shop's role row. */
|
|
1721
|
+
profile_id?: string;
|
|
1722
|
+
}
|
|
1685
1723
|
interface InviteUsersRequest {
|
|
1686
1724
|
email: string;
|
|
1687
1725
|
name: string;
|
|
@@ -2800,6 +2838,61 @@ declare class ApiKeys {
|
|
|
2800
2838
|
* @returns Array of API key metadata objects.
|
|
2801
2839
|
*/
|
|
2802
2840
|
list(merchantId: string): Promise<ApiKeyResponse[]>;
|
|
2841
|
+
/**
|
|
2842
|
+
* Create a new API key pinned to the caller's shop (business profile).
|
|
2843
|
+
* `POST /account/{merchantId}/profile/api-keys`
|
|
2844
|
+
*
|
|
2845
|
+
* @param merchantId - The merchant account ID.
|
|
2846
|
+
* @param params - Key creation parameters (name, expiry, etc.).
|
|
2847
|
+
* @returns The newly created key including the plaintext secret (shown once
|
|
2848
|
+
* only) and the `profile_id` it is pinned to.
|
|
2849
|
+
*
|
|
2850
|
+
* @example
|
|
2851
|
+
* ```typescript
|
|
2852
|
+
* const { api_key } = await delopay.apiKeys.createByProfile('merch_123', {
|
|
2853
|
+
* name: 'Shop key',
|
|
2854
|
+
* expiration: 'never',
|
|
2855
|
+
* });
|
|
2856
|
+
* ```
|
|
2857
|
+
*/
|
|
2858
|
+
createByProfile(merchantId: string, params: ApiKeyCreateRequest): Promise<ApiKeyCreateResponse>;
|
|
2859
|
+
/**
|
|
2860
|
+
* List API keys pinned to the caller's shop (business profile) only.
|
|
2861
|
+
* `GET /account/{merchantId}/profile/api-keys`
|
|
2862
|
+
*
|
|
2863
|
+
* @param merchantId - The merchant account ID.
|
|
2864
|
+
* @param params - Optional pagination constraints (`limit`, `skip`).
|
|
2865
|
+
* @returns Array of API key metadata objects belonging to the caller's shop.
|
|
2866
|
+
*/
|
|
2867
|
+
listByProfile(merchantId: string, params?: ApiKeyListConstraints): Promise<ApiKeyResponse[]>;
|
|
2868
|
+
/**
|
|
2869
|
+
* Retrieve metadata about a shop-pinned API key (does not return the
|
|
2870
|
+
* plaintext secret). `GET /account/{merchantId}/profile/api-keys/{keyId}`
|
|
2871
|
+
*
|
|
2872
|
+
* @param merchantId - The merchant account ID.
|
|
2873
|
+
* @param keyId - The API key ID.
|
|
2874
|
+
* @returns The API key metadata.
|
|
2875
|
+
*/
|
|
2876
|
+
retrieveByProfile(merchantId: string, keyId: string): Promise<ApiKeyResponse>;
|
|
2877
|
+
/**
|
|
2878
|
+
* Update a shop-pinned API key's name, description, or expiry.
|
|
2879
|
+
* `POST /account/{merchantId}/profile/api-keys/{keyId}`
|
|
2880
|
+
*
|
|
2881
|
+
* @param merchantId - The merchant account ID.
|
|
2882
|
+
* @param keyId - The API key ID to update.
|
|
2883
|
+
* @param params - Fields to update.
|
|
2884
|
+
* @returns The updated API key metadata.
|
|
2885
|
+
*/
|
|
2886
|
+
updateByProfile(merchantId: string, keyId: string, params: ApiKeyUpdateRequest): Promise<ApiKeyResponse>;
|
|
2887
|
+
/**
|
|
2888
|
+
* Revoke a shop-pinned API key, immediately invalidating it.
|
|
2889
|
+
* `DELETE /account/{merchantId}/profile/api-keys/{keyId}`
|
|
2890
|
+
*
|
|
2891
|
+
* @param merchantId - The merchant account ID.
|
|
2892
|
+
* @param keyId - The API key ID to revoke.
|
|
2893
|
+
* @returns Revocation confirmation.
|
|
2894
|
+
*/
|
|
2895
|
+
revokeByProfile(merchantId: string, keyId: string): Promise<ApiKeyRevokeResponse>;
|
|
2803
2896
|
}
|
|
2804
2897
|
|
|
2805
2898
|
declare class Authentication {
|
|
@@ -4257,6 +4350,21 @@ declare class Users {
|
|
|
4257
4350
|
* shop-scoped caller can only target their own shop.
|
|
4258
4351
|
*/
|
|
4259
4352
|
addUser(params: AddUserRequest): Promise<AddUserResponse>;
|
|
4353
|
+
/**
|
|
4354
|
+
* Impersonate one of your own team members — `POST /user/employees/impersonate`.
|
|
4355
|
+
*
|
|
4356
|
+
* Mints a session token **as** the given member, so the dashboard renders
|
|
4357
|
+
* exactly what they see (useful for support and role verification). The
|
|
4358
|
+
* caller needs the *Impersonation* permission, and the member's role must
|
|
4359
|
+
* rank **strictly below** the caller's (`Profile < Merchant < Organization`);
|
|
4360
|
+
* the server rejects self-impersonation, cross-merchant targets, and
|
|
4361
|
+
* equal/higher roles.
|
|
4362
|
+
*
|
|
4363
|
+
* The returned token is tab-scoped by design: open it in a fresh tab (e.g.
|
|
4364
|
+
* `/auth/impersonate?token=…`) rather than replacing the caller's own
|
|
4365
|
+
* session. No auth cookie is set on the response.
|
|
4366
|
+
*/
|
|
4367
|
+
impersonateEmployee(params: ImpersonateEmployeeRequest): Promise<TokenResponse>;
|
|
4260
4368
|
acceptInvitation(params: Record<string, unknown>): Promise<AuthResponse>;
|
|
4261
4369
|
/**
|
|
4262
4370
|
* Accept an invitation via the email-link flow.
|
|
@@ -5234,4 +5342,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
|
|
|
5234
5342
|
declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
|
|
5235
5343
|
declare function shadowFor(style: SurfaceStyle): string;
|
|
5236
5344
|
|
|
5237
|
-
export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
|
5345
|
+
export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
|
package/dist/index.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -187,6 +187,92 @@ var ApiKeys = class {
|
|
|
187
187
|
async list(merchantId) {
|
|
188
188
|
return this.request("GET", `/api-keys/${encodeURIComponent(merchantId)}/list`);
|
|
189
189
|
}
|
|
190
|
+
// --- Profile-scoped (shop-level) API keys ---------------------------------
|
|
191
|
+
//
|
|
192
|
+
// JWT-authenticated routes under `/account/{merchantId}/profile/api-keys`.
|
|
193
|
+
// The caller's shop (business profile) comes from the JWT, never from the
|
|
194
|
+
// request, so a shop-scoped user can only mint/list/manage keys pinned to
|
|
195
|
+
// their own shop. Requires a backend with profile-scoped API key support
|
|
196
|
+
// (DeloPay-net/delopay-backend#344).
|
|
197
|
+
/**
|
|
198
|
+
* Create a new API key pinned to the caller's shop (business profile).
|
|
199
|
+
* `POST /account/{merchantId}/profile/api-keys`
|
|
200
|
+
*
|
|
201
|
+
* @param merchantId - The merchant account ID.
|
|
202
|
+
* @param params - Key creation parameters (name, expiry, etc.).
|
|
203
|
+
* @returns The newly created key including the plaintext secret (shown once
|
|
204
|
+
* only) and the `profile_id` it is pinned to.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```typescript
|
|
208
|
+
* const { api_key } = await delopay.apiKeys.createByProfile('merch_123', {
|
|
209
|
+
* name: 'Shop key',
|
|
210
|
+
* expiration: 'never',
|
|
211
|
+
* });
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
async createByProfile(merchantId, params) {
|
|
215
|
+
return this.request("POST", `/account/${encodeURIComponent(merchantId)}/profile/api-keys`, {
|
|
216
|
+
body: params
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* List API keys pinned to the caller's shop (business profile) only.
|
|
221
|
+
* `GET /account/{merchantId}/profile/api-keys`
|
|
222
|
+
*
|
|
223
|
+
* @param merchantId - The merchant account ID.
|
|
224
|
+
* @param params - Optional pagination constraints (`limit`, `skip`).
|
|
225
|
+
* @returns Array of API key metadata objects belonging to the caller's shop.
|
|
226
|
+
*/
|
|
227
|
+
async listByProfile(merchantId, params) {
|
|
228
|
+
return this.request("GET", `/account/${encodeURIComponent(merchantId)}/profile/api-keys`, {
|
|
229
|
+
query: params
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Retrieve metadata about a shop-pinned API key (does not return the
|
|
234
|
+
* plaintext secret). `GET /account/{merchantId}/profile/api-keys/{keyId}`
|
|
235
|
+
*
|
|
236
|
+
* @param merchantId - The merchant account ID.
|
|
237
|
+
* @param keyId - The API key ID.
|
|
238
|
+
* @returns The API key metadata.
|
|
239
|
+
*/
|
|
240
|
+
async retrieveByProfile(merchantId, keyId) {
|
|
241
|
+
return this.request(
|
|
242
|
+
"GET",
|
|
243
|
+
`/account/${encodeURIComponent(merchantId)}/profile/api-keys/${encodeURIComponent(keyId)}`
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Update a shop-pinned API key's name, description, or expiry.
|
|
248
|
+
* `POST /account/{merchantId}/profile/api-keys/{keyId}`
|
|
249
|
+
*
|
|
250
|
+
* @param merchantId - The merchant account ID.
|
|
251
|
+
* @param keyId - The API key ID to update.
|
|
252
|
+
* @param params - Fields to update.
|
|
253
|
+
* @returns The updated API key metadata.
|
|
254
|
+
*/
|
|
255
|
+
async updateByProfile(merchantId, keyId, params) {
|
|
256
|
+
return this.request(
|
|
257
|
+
"POST",
|
|
258
|
+
`/account/${encodeURIComponent(merchantId)}/profile/api-keys/${encodeURIComponent(keyId)}`,
|
|
259
|
+
{ body: params }
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Revoke a shop-pinned API key, immediately invalidating it.
|
|
264
|
+
* `DELETE /account/{merchantId}/profile/api-keys/{keyId}`
|
|
265
|
+
*
|
|
266
|
+
* @param merchantId - The merchant account ID.
|
|
267
|
+
* @param keyId - The API key ID to revoke.
|
|
268
|
+
* @returns Revocation confirmation.
|
|
269
|
+
*/
|
|
270
|
+
async revokeByProfile(merchantId, keyId) {
|
|
271
|
+
return this.request(
|
|
272
|
+
"DELETE",
|
|
273
|
+
`/account/${encodeURIComponent(merchantId)}/profile/api-keys/${encodeURIComponent(keyId)}`
|
|
274
|
+
);
|
|
275
|
+
}
|
|
190
276
|
};
|
|
191
277
|
|
|
192
278
|
// src/resources/authentication.ts
|
|
@@ -2341,6 +2427,23 @@ var Users = class {
|
|
|
2341
2427
|
async addUser(params) {
|
|
2342
2428
|
return this.request("POST", "/user/employees/add", { body: params });
|
|
2343
2429
|
}
|
|
2430
|
+
/**
|
|
2431
|
+
* Impersonate one of your own team members — `POST /user/employees/impersonate`.
|
|
2432
|
+
*
|
|
2433
|
+
* Mints a session token **as** the given member, so the dashboard renders
|
|
2434
|
+
* exactly what they see (useful for support and role verification). The
|
|
2435
|
+
* caller needs the *Impersonation* permission, and the member's role must
|
|
2436
|
+
* rank **strictly below** the caller's (`Profile < Merchant < Organization`);
|
|
2437
|
+
* the server rejects self-impersonation, cross-merchant targets, and
|
|
2438
|
+
* equal/higher roles.
|
|
2439
|
+
*
|
|
2440
|
+
* The returned token is tab-scoped by design: open it in a fresh tab (e.g.
|
|
2441
|
+
* `/auth/impersonate?token=…`) rather than replacing the caller's own
|
|
2442
|
+
* session. No auth cookie is set on the response.
|
|
2443
|
+
*/
|
|
2444
|
+
async impersonateEmployee(params) {
|
|
2445
|
+
return this.request("POST", "/user/employees/impersonate", { body: params });
|
|
2446
|
+
}
|
|
2344
2447
|
async acceptInvitation(params) {
|
|
2345
2448
|
return this.request("POST", "/user/employees/invite/accept", { body: params });
|
|
2346
2449
|
}
|