@delopay/sdk 0.272.0 → 0.277.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-42VYNDXJ.js → chunk-424242UX.js} +167 -6
- package/dist/chunk-424242UX.js.map +1 -0
- package/dist/index.cjs +166 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +327 -22
- package/dist/index.d.ts +327 -22
- package/dist/index.js +1 -1
- package/dist/internal.cjs +180 -5
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +49 -2
- package/dist/internal.d.ts +49 -2
- package/dist/internal.js +15 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-42VYNDXJ.js.map +0 -1
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/resources/admin.ts","../src/internal/resources/adminPortal.ts","../src/internal/resources/auditLogs.ts","../src/internal/resources/cache.ts","../src/internal/resources/cardIssuers.ts","../src/internal/resources/configs.ts","../src/internal/resources/connectorRestrictionRules.ts","../src/internal/resources/connectorRestrictions.ts","../src/internal/resources/diagnostic.ts","../src/internal/resources/gsm.ts","../src/internal/resources/platformBilling.ts","../src/internal/resources/platformFees.ts","../src/internal/resources/platformSettings.ts","../src/internal/resources/platformMessageTemplates.ts","../src/internal/resources/nativeRenewals.ts","../src/internal/client.ts"],"sourcesContent":["import type { AuthResponse, SignUpWithMerchantIdRequest } from '../../types';\nimport type {\n AdminSignInRequest,\n AuthorizeResponse,\n CreateInternalUserRequest,\n CreateTenantUserRequest,\n OnboardMerchantRequest,\n OnboardMerchantResponse,\n SignupToggleRequest,\n SignupToggleResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Admin {\n constructor(private readonly request: RequestFn) {}\n\n async signIn(params: AdminSignInRequest): Promise<AuthResponse> {\n return this.request('POST', '/admin/signin', { body: params });\n }\n\n async createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/internal-signup', { body: params });\n }\n\n async createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/tenant-signup', { body: params });\n }\n\n /**\n * Create a new merchant admin user and merchant account atomically.\n *\n * This is the correct endpoint for bootstrapping the first admin user in a\n * fresh deployment — `internal-signup`/`tenant-signup` both require\n * pre-existing merchant records that don't exist on a clean database.\n *\n * `POST /admin/signup-with-merchant-id`\n */\n async signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/signup-with-merchant-id', { body: params });\n }\n\n /** Toggle public signup on/off. `POST /admin/settings/signup` */\n async setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse> {\n return this.request('POST', '/admin/settings/signup', { body: params });\n }\n\n /** Read current public-signup status. `GET /admin/settings/signup` */\n async getSignupSettings(): Promise<SignupToggleResponse> {\n return this.request('GET', '/admin/settings/signup');\n }\n\n /** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard-merchant` */\n async onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse> {\n return this.request('POST', '/admin/onboard-merchant', { body: params });\n }\n}\n","import type {\n BinaryExportOptions,\n CsvExportOptions,\n DynamicLineExportOptions,\n ExportEnvelope,\n ExportOptions,\n JsonExportOptions,\n BulkCreateProcessorCostSchedulesRequest,\n BuyerRefundRequestList,\n BuyerRefundRequestPageQuery,\n CreateProcessorCostScheduleRequest,\n ProcessorCostEventsResponse,\n ProcessorCostScheduleResponse,\n ReplaceProcessorCostScheduleRequest,\n UpdateProcessorCostScheduleRequest,\n FeeStatementDetail,\n MerchantAccountResponse,\n MerchantAccountUpdateRequest,\n PaymentAttemptsListResponse,\n PaymentClientContextListResponse,\n PaymentResponse,\n PaymentProductLines,\n InvoiceList,\n InvoicePageQuery,\n PaymentsDeleteResponse,\n PaymentStatusHistoryResponse,\n PaymentLogsResponse,\n PaymentLogConnectorCallDetail,\n PaymentLogIncomingWebhookDetail,\n PaymentLogOutgoingWebhookDetail,\n ProfileResponse,\n RefundListResponse,\n SellToRestrictionsResponse,\n SettlementCurrentParams,\n SettlementCurrentResponse,\n SettlementOverviewParams,\n SettlementOverviewResponse,\n SettlementStatementListParams,\n SettlementStatementListResponse,\n StatementPdfParams,\n SubscriptionAnalyticsRequest,\n SubscriptionAnalyticsResponse,\n SubscriptionDrillRequest,\n ScopeDrillRequest,\n BuyerEvidenceInformationRequest,\n BuyerEvidenceNote,\n BuyerEvidenceQueue,\n BuyerEvidenceQueueQuery,\n BuyerEvidenceReply,\n BuyerEvidenceReviewCreate,\n BuyerEvidenceReviewDetail,\n} from '../../types';\nimport type {\n RefundVolumeQuery,\n RefundVolumeResponse,\n UpdateRefundVolumeRequest,\n PlatformFeeReturnListResponse,\n PlatformFeeReturnQuery,\n PlatformFeeReturnResponse,\n UpdatePlatformFeeReturnRequest,\n ConsolidateRolesRequest,\n ConsolidateRolesResponse,\n ConsolidationCandidatesResponse,\n CreateSharedRoleRequest,\n RetireSharedRolePreviewRequest,\n RetireSharedRolePreviewResponse,\n RetireSharedRoleRequest,\n SharedRoleApplied,\n SharedRoleChange,\n SharedRoleDetailResponse,\n SharedRoleListResponse,\n SharedRolePreviewResponse,\n UpdateSharedRoleRequest,\n AdminAttachVaultRequest,\n AdminAttachVaultResponse,\n AdminAttemptProcessorCost,\n AdminProcessorCostEventsParams,\n AdminVaultStateResponse,\n AdminCustomerListParams,\n AdminCustomerListResponse,\n AdminCustomerDetail,\n AdminTransactionExportParams,\n AdminTransactionExportRecord,\n AdminTransactionLineExportRecord,\n AdminTransactionListParams,\n AdminTransactionListResponse,\n AdminUnresolvedRefundListParams,\n AdminUnresolvedRefundListResponse,\n AdminAnalyticsRequest,\n PlatformAnalyticsResponse,\n OverviewStatsResponse,\n PaymentAnalyticsRequest,\n PaymentAnalyticsResponse,\n AnalyticsScopeRequest,\n ClientAnalyticsRequest,\n DeviceDrillRequest,\n GeoDrillRequest,\n DrillResponse,\n DevicesAnalyticsResponse,\n GeoAnalyticsResponse,\n AnalyticsScopeResponse,\n AdminLedgerAnalyticsRequest,\n AdminLedgerAnalyticsResponse,\n AdminOrphanedBillingProfilesResponse,\n AdminCreateUserForMerchantRequest,\n AdminUpdateUserRequest,\n AdminUserResponse,\n BuyerEvidenceAssign,\n BuyerEvidenceDeadlineChange,\n} from '../types';\nimport type { RequestExtras, RequestFn, RequestOptions } from '../../client';\nimport { runExport } from '../../exportDownload';\n\nexport class AdminPortal {\n /** Read refund treatment and the scope supplying its effective value. */\n async getRefundVolume(\n merchantId: string,\n query: RefundVolumeQuery = {},\n ): Promise<RefundVolumeResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/refund-volume`,\n {\n query: { ...query },\n },\n );\n }\n\n /** Change future monthly tier snapshots; existing snapshots and statement lines retain their prices. */\n async updateRefundVolume(\n merchantId: string,\n body: UpdateRefundVolumeRequest,\n query: RefundVolumeQuery = {},\n ): Promise<RefundVolumeResponse> {\n return this.request(\n 'PUT',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/refund-volume`,\n {\n query: { ...query },\n body,\n },\n );\n }\n\n /** Read whether refunds return their share of the platform fee, and the scope supplying it. */\n async getPlatformFeeReturn(\n merchantId: string,\n query: PlatformFeeReturnQuery = {},\n ): Promise<PlatformFeeReturnResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/platform-fee-return`,\n {\n query: { ...query },\n },\n );\n }\n\n /** Change the fee return for refunds that succeed from now on; earlier refunds keep their decision. */\n async updatePlatformFeeReturn(\n merchantId: string,\n body: UpdatePlatformFeeReturnRequest,\n query: PlatformFeeReturnQuery = {},\n ): Promise<PlatformFeeReturnResponse> {\n return this.request(\n 'PUT',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/platform-fee-return`,\n {\n query: { ...query },\n body,\n },\n );\n }\n\n /** What each successful refund of one payment returned of the platform fee. */\n async listPaymentPlatformFeeReturns(\n merchantId: string,\n paymentId: string,\n ): Promise<PlatformFeeReturnListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/transactions/${encodeURIComponent(paymentId)}/platform-fee-returns`,\n );\n }\n\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The deployment's merchant roles: shared roles, the roles defined in code,\n * and every merchant's own custom roles. `GET /admin-portal/merchant-roles`\n */\n async listSharedRoles(): Promise<SharedRoleListResponse> {\n return this.request('GET', '/admin-portal/merchant-roles');\n }\n\n /** `GET /admin-portal/merchant-roles/{roleId}` */\n async getSharedRole(roleId: string): Promise<SharedRoleDetailResponse> {\n return this.request('GET', `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}`);\n }\n\n /**\n * Define a role once and offer it to every merchant, or to the ones listed.\n * Offering never assigns it. `POST /admin-portal/merchant-roles`\n */\n async createSharedRole(body: CreateSharedRoleRequest): Promise<SharedRoleDetailResponse> {\n return this.request('POST', '/admin-portal/merchant-roles', { body });\n }\n\n /**\n * What a change would do, without writing anything. Apply it with\n * `updateSharedRole` and the `version` this returns.\n * `POST /admin-portal/merchant-roles/{roleId}/preview`\n */\n async previewSharedRole(\n roleId: string,\n change: SharedRoleChange,\n ): Promise<SharedRolePreviewResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/preview`,\n { body: change },\n );\n }\n\n /**\n * Apply a reviewed change. A change that takes access away needs\n * `acknowledge_sign_out` and signs out every holder.\n * `PUT /admin-portal/merchant-roles/{roleId}`\n */\n async updateSharedRole(\n roleId: string,\n body: UpdateSharedRoleRequest,\n ): Promise<SharedRoleApplied> {\n return this.request('PUT', `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}`, {\n body,\n });\n }\n\n /** `POST /admin-portal/merchant-roles/{roleId}/retire/preview` */\n async previewRetireSharedRole(\n roleId: string,\n body: RetireSharedRolePreviewRequest = {},\n ): Promise<RetireSharedRolePreviewResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/retire/preview`,\n { body },\n );\n }\n\n /**\n * Retire a shared role, moving its holders to the replacement.\n * `POST /admin-portal/merchant-roles/{roleId}/retire`\n */\n async retireSharedRole(\n roleId: string,\n body: RetireSharedRoleRequest,\n ): Promise<SharedRoleApplied> {\n return this.request(\n 'POST',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/retire`,\n { body },\n );\n }\n\n /**\n * Merchant-specific roles whose holders could move to this shared role, and\n * what each move would change. `GET /admin-portal/merchant-roles/{roleId}/consolidation`\n */\n async sharedRoleConsolidationCandidates(\n roleId: string,\n ): Promise<ConsolidationCandidatesResponse> {\n return this.request(\n 'GET',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/consolidation`,\n );\n }\n\n /** `POST /admin-portal/merchant-roles/{roleId}/consolidate` */\n async consolidateIntoSharedRole(\n roleId: string,\n body: ConsolidateRolesRequest,\n ): Promise<ConsolidateRolesResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/consolidate`,\n { body },\n );\n }\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 const query = transactionListQuery(params);\n return this.request('GET', '/admin-portal/transactions', {\n query,\n });\n }\n\n /**\n * The admin transaction search as a file. `GET /admin-portal/transactions/export`\n *\n * Takes the same filters as {@link AdminPortal.listTransactions}, sent the\n * same way, and returns the whole match set rather than a page — bounded at\n * 25,000 rows (500 for `pdf`) and refused past that with `DE_07` rather than\n * truncated. Every page of it is read inside one database snapshot, so a\n * payment updated while the file downloads is neither repeated nor skipped.\n *\n * `csv` and `json` are streamed and held to their `X-Delopay-Record-Count`;\n * see {@link ExportTransferOptions} for progress, cancellation and the\n * `EXPORT_INCOMPLETE` check. The format is negotiated by `Accept` and\n * defaults to `json`.\n */\n async exportTransactions(\n params?: AdminTransactionExportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionExportRecord>>;\n async exportTransactions(\n params: AdminTransactionExportParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async exportTransactions(\n params: AdminTransactionExportParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionExportRecord> | Blob>;\n async exportTransactions(\n params?: AdminTransactionExportParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/transactions/export',\n { query: transactionListQuery(params) },\n options,\n );\n }\n\n /**\n * The admin transaction search as a file, one row per product line.\n * `GET /admin-portal/transactions/export/lines`\n *\n * The same filters as {@link AdminPortal.exportTransactions}, sent the same\n * way; one row per product line the matched payments recorded, plus one\n * `row_kind: 'no_lines'` row for each payment that recorded none. `csv` or\n * `json` only: the server refuses a PDF with `422`.\n */\n async exportTransactionLines(\n params?: AdminTransactionExportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionLineExportRecord>>;\n async exportTransactionLines(\n params: AdminTransactionExportParams | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async exportTransactionLines(\n params: AdminTransactionExportParams | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionLineExportRecord> | Blob>;\n async exportTransactionLines(\n params?: AdminTransactionExportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/transactions/export/lines',\n { query: transactionListQuery(params) },\n options,\n );\n }\n\n /**\n * Full detail for a single transaction of ANY merchant — the same\n * `PaymentResponse` the merchant `payments.retrieve` returns. Admin-scoped:\n * the JWT (or admin API key) does not need to belong to the payment's\n * merchant; the backend resolves the owning merchant and reads it read-only\n * (no connector sync).\n */\n async getTransaction(paymentId: string): Promise<PaymentResponse> {\n return this.request('GET', `/admin-portal/transactions/${encodeURIComponent(paymentId)}`);\n }\n\n /** The same frozen purchase lines available on the merchant payment read. */\n async getTransactionProductLines(paymentId: string): Promise<PaymentProductLines> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/product-lines`,\n );\n }\n\n /**\n * Per-attempt history (retries across connectors, decline reasons) for a\n * single transaction of ANY merchant.\n */\n async getTransactionAttempts(paymentId: string): Promise<PaymentAttemptsListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/attempts`,\n );\n }\n\n /**\n * Status timeline (intent / attempt / refund / dispute transitions) for a\n * single transaction of ANY merchant. `complete: false` marks timelines\n * partially reconstructed from current records.\n */\n async getTransactionStatusHistory(paymentId: string): Promise<PaymentStatusHistoryResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/status-history`,\n );\n }\n\n /**\n * The traffic of a transaction of ANY merchant: provider requests, provider\n * webhooks and shop webhooks, oldest first, without payloads. Same shape as\n * `payments.listLogs`.\n */\n async getTransactionLogs(paymentId: string): Promise<PaymentLogsResponse> {\n return this.request('GET', `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs`);\n }\n\n /** One provider request of a transaction of ANY merchant, with its masked payloads. */\n async getTransactionLogConnectorCall(\n paymentId: string,\n callId: string,\n ): Promise<PaymentLogConnectorCallDetail> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/connector-calls/${encodeURIComponent(callId)}`,\n );\n }\n\n /** One provider webhook of a transaction of ANY merchant, with its masked headers and body. */\n async getTransactionLogIncomingWebhook(\n paymentId: string,\n eventId: string,\n ): Promise<PaymentLogIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/incoming-webhooks/${encodeURIComponent(eventId)}`,\n );\n }\n\n /** Every delivery attempt of one shop webhook of a transaction of ANY merchant. */\n async getTransactionLogOutgoingWebhook(\n paymentId: string,\n initialAttemptId: string,\n ): Promise<PaymentLogOutgoingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/outgoing-webhooks/${encodeURIComponent(initialAttemptId)}`,\n );\n }\n\n /**\n * The invoices and credit notes issued for a transaction of ANY merchant,\n * each its own row, newest first. At most 100 per page.\n * `GET /admin-portal/transactions/{paymentId}/invoices`\n */\n async getTransactionInvoices(paymentId: string, params?: InvoicePageQuery): Promise<InvoiceList> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/invoices`,\n { query: params === undefined ? undefined : { ...params } },\n );\n }\n\n /**\n * One invoice of ANY merchant as a PDF: the stored copy of an issued\n * document, a live render of a draft, the snapshot under a VOIDED banner for\n * a voided one.\n * `GET /admin-portal/invoices/{invoiceId}/pdf`\n */\n async downloadInvoicePdf(invoiceId: string): Promise<Blob> {\n return this.request('GET', `/admin-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n });\n }\n\n /**\n * Refunds for a single transaction of ANY merchant.\n */\n async getTransactionRefunds(paymentId: string): Promise<RefundListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/refunds`,\n );\n }\n\n /**\n * The refund requests buyers raised from the customer portal about a single\n * transaction of ANY merchant, newest first, one page at a time\n * (`total_count` counts them all). Read-only.\n * `GET /admin-portal/transactions/{paymentId}/refund-requests`\n */\n async getTransactionRefundRequests(\n paymentId: string,\n params?: BuyerRefundRequestPageQuery,\n ): Promise<BuyerRefundRequestList> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/refund-requests`,\n { query: params === undefined ? undefined : { ...params } },\n );\n }\n\n /**\n * Refunds of ANY merchant mirrored from a connector webhook at a\n * non-terminal status that no sync can advance. Newest first.\n */\n async listUnresolvedRefunds(\n params?: AdminUnresolvedRefundListParams,\n ): Promise<AdminUnresolvedRefundListResponse> {\n return this.request('GET', '/admin-portal/refunds/unresolved', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n // --- Buyer evidence review --------------------------------------------------\n\n /**\n * DeloPay's review queue of buyers' evidence, the nearest target first,\n * across merchants unless `merchant_id` narrows it.\n */\n async listBuyerEvidence(params?: BuyerEvidenceQueueQuery): Promise<BuyerEvidenceQueue> {\n return this.request('GET', '/admin-portal/buyer-evidence', {\n query: params as Record<string, string | number | boolean | null | undefined>,\n });\n }\n\n /** One case's evidence with every step and file, internal ones included. */\n async getBuyerEvidence(evidenceId: string): Promise<BuyerEvidenceReviewDetail> {\n return this.request('GET', `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}`);\n }\n\n /** Download a file of a case's evidence. */\n async downloadBuyerEvidenceFile(evidenceId: string, fileId: string): Promise<Blob> {\n return this.request(\n 'GET',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/files/${encodeURIComponent(fileId)}`,\n { responseType: 'blob' },\n );\n }\n\n /**\n * Ask the buyer for more, by a cut-off. Refused once a result has closed\n * the review.\n */\n async requestBuyerEvidenceInformation(\n evidenceId: string,\n params: BuyerEvidenceInformationRequest,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'POST',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/information-requests`,\n { body: params },\n );\n }\n\n /** An answer the buyer sees. */\n async replyToBuyerEvidence(\n evidenceId: string,\n params: BuyerEvidenceReply,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'POST',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/replies`,\n { body: params },\n );\n }\n\n /**\n * Record the result, which closes the review. It never refunds a payment\n * and never decides a dispute with the payment provider.\n */\n async reviewBuyerEvidence(\n evidenceId: string,\n params: BuyerEvidenceReviewCreate,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'POST',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/reviews`,\n { body: params },\n );\n }\n\n /** Move the buyer's cut-off, with a reason the buyer sees. */\n async moveBuyerEvidenceDeadline(\n evidenceId: string,\n params: BuyerEvidenceDeadlineChange,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'PUT',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/deadline`,\n { body: params },\n );\n }\n\n /** Make a user responsible for the review: an id, `me`, or `null` for nobody. */\n async assignBuyerEvidence(\n evidenceId: string,\n params: BuyerEvidenceAssign,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'PUT',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/reviewer`,\n { body: params },\n );\n }\n\n /** An internal note, never shown to the buyer. */\n async noteBuyerEvidence(\n evidenceId: string,\n params: BuyerEvidenceNote,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'POST',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/notes`,\n { body: params },\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 * One drill level of the analytics dashboard: the scope's daily series +\n * processor mix and its direct children's series. Range / metric / donut\n * toggles apply client-side; only a drill (passing merchant_id / project_id\n * / shop_id) fetches the next level.\n */\n async analyticsScope(params?: AnalyticsScopeRequest): Promise<AnalyticsScopeResponse> {\n return this.request('GET', '/admin-portal/analytics/scope', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Device analytics over the canonical client-context observation per\n * payment, rooted at all merchants and drillable via `merchant_id` /\n * `project_id` / `shop_id` like `analyticsScope`. Answers 200 with\n * `enabled: false` when the client-context optimisation-use switch is off.\n */\n async analyticsDevices(params?: ClientAnalyticsRequest): Promise<DevicesAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics/devices', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Geo analytics over the canonical client-context observation per payment,\n * rooted at all merchants. `mode` selects the location claim (`ip` default,\n * `billing`).\n */\n async analyticsGeo(params?: ClientAnalyticsRequest): Promise<GeoAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics/geo', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * The recent payments behind one clicked geo target (map country/city or\n * local-hours heatmap cell), rooted at all merchants. Capped at 50 rows,\n * newest first, with the full match count alongside.\n */\n async analyticsGeoTransactions(params: GeoDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/admin-portal/analytics/geo/transactions', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * The recent payments behind one clicked device target (browser/platform\n * family, device-model label or device class), rooted at all merchants.\n * 50 rows per page (`offset` for the next page), newest first.\n */\n async analyticsDeviceTransactions(params: DeviceDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/admin-portal/analytics/devices/transactions', {\n // A discriminated union carries no index signature, so the widening\n // goes via `unknown` — the union is the point.\n query: params as unknown as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * The payments behind one clicked element of the admin payments dashboard\n * (processor / method slice, outcome segment, series bucket or breakdown\n * row), rooted at all merchants. Same contract as the merchant surface's\n * `analytics.scopeTransactions`. `GET /admin-portal/analytics/scope/transactions`\n */\n async analyticsScopeTransactions(params: ScopeDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/admin-portal/analytics/scope/transactions', {\n query: params as unknown as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Subscription analytics over `subscription` and `invoice`, rooted at all\n * merchants and drillable via `merchant_id` / `project_id` / `shop_id` like\n * `analyticsScope`. The `children` block at the root is the merchant\n * breakdown — there is no separate endpoint for it.\n *\n * Half the figures are **stocks** (a snapshot at the window's end, not a sum\n * over it), so `est_monthly_volume_usd` and `active` can match across a\n * 7-day and a 30-day window while `billed_volume_usd` does not. Day\n * granularity only.\n */\n async analyticsSubscriptions(\n params?: SubscriptionAnalyticsRequest,\n ): Promise<SubscriptionAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics/subscriptions', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * The billing cycles behind one clicked element of the admin subscription\n * dashboard: an invoice outcome, a processor slice on either axis, a plan\n * row, a subscription status, a movement component, a series bucket or a\n * breakdown row. 50 rows per page (`offset` for the next), newest first,\n * with the full match count alongside.\n *\n * A cycle that never reached a payment is listed too — that is what \"still\n * unpaid\" means — and carries its invoice id as `payment_id` with\n * `invoice_id` set to the same value.\n */\n async analyticsSubscriptionsList(params: SubscriptionDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/admin-portal/analytics/subscriptions/list', {\n // A discriminated union carries no index signature, so the widening\n // goes via `unknown` — the union is the point, and the query builder\n // only ever reads own enumerable keys.\n query: params as unknown as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Platform billing dashboard: total balance across all ledger accounts (+\n * the net change), top-ups, fees collected, and the day-by-day ledger flow.\n * All amounts are in USD minor units.\n */\n async ledgerAnalytics(\n params?: AdminLedgerAnalyticsRequest,\n ): Promise<AdminLedgerAnalyticsResponse> {\n return this.request('GET', '/admin-portal/ledger-analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Billing profiles no operator listing can reach, and the accounts that may\n * have taken one over.\n *\n * Deleting a merchant account leaves its billing profile — with its\n * balance, its Stripe customer and its saved card — behind, and the\n * Merchants listing enumerates merchant accounts, so such a profile is\n * absent from every operator surface rather than flagged on one. This reads\n * from the billing side instead, so it finds them.\n *\n * Both lists come back complete rather than paged: the healthy answer is two\n * empty arrays, and a truncated answer to *\"is the set empty\"* would read as\n * a clean bill of health.\n *\n * `adoption_candidates` are candidates, not findings — confirm a row against\n * the audit log before acting on it.\n */\n async orphanedBillingProfiles(): Promise<AdminOrphanedBillingProfilesResponse> {\n return this.request('GET', '/admin-portal/billing/orphaned-profiles');\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 /**\n * Create a brand-new user attached to the given merchant. The user is\n * marked `is_verified = true` so the admin can hand off credentials\n * immediately — no email round-trip is sent.\n */\n async createUserForMerchant(\n customerId: string,\n body: AdminCreateUserForMerchantRequest,\n ): Promise<AdminUserResponse> {\n return this.request('POST', `/admin-portal/customers/${encodeURIComponent(customerId)}/users`, {\n body,\n });\n }\n\n /**\n * Edit a user record. Any subset of fields may be supplied. `role_id`\n * requires `merchant_id`. `password` triggers a password reset (validated\n * against signup policy + JWT blacklist). `reset_2fa` clears TOTP state\n * so the user re-enrolls on next login. `is_active` supports both\n * directions: false soft-disables, true reactivates a soft-disabled user.\n *\n * Throws a `400` with `code === 'UR_66'` when the change would leave a\n * merchant with no administrator — `is_active: false` or `is_verified:\n * false` on, or a `role_id` demoting, the only active user whose role can\n * manage that merchant's users. Nothing is written. `error.data` carries a\n * {@link LastAdministratorRefusal} naming the merchant and which change was\n * refused; render that rather than the generic message.\n */\n async updateUser(userId: string, body: AdminUpdateUserRequest): Promise<AdminUserResponse> {\n return this.request('PATCH', `/admin-portal/users/${encodeURIComponent(userId)}`, { body });\n }\n\n /**\n * Soft-delete a user globally: deactivates the row, blacklists existing\n * JWTs, and wipes credentials. Distinct from `deleteUserRole`, which\n * removes a single role binding while leaving the user signed-in elsewhere.\n *\n * Throws the same `UR_66` as {@link updateUser} when the user is the last\n * administrator of any merchant they belong to, with `route: 'delete'`.\n */\n async deleteUser(userId: string): Promise<void> {\n return this.request('DELETE', `/admin-portal/users/${encodeURIComponent(userId)}`);\n }\n\n /**\n * Set a target merchant's shop iframe-allowed origins. Internal-admin\n * route — accepts an admin JWT or admin API key without requiring the\n * caller to be scoped to the target merchant. Pass `null` (or an empty\n * array) to clear the allowlist back to same-origin only.\n *\n * Server validates each origin: full origin (scheme + host[:port]),\n * no path/query/fragment, no wildcards.\n */\n async updateShopIframeOrigins(\n merchantId: string,\n profileId: string,\n origins: string[] | null,\n ): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/business_profile/${encodeURIComponent(profileId)}/iframe-origins`,\n { body: { iframe_allowed_origins: origins } },\n );\n }\n\n /**\n * Set (or clear) a target merchant shop's home country — the geo\n * dashboard's cross-border baseline. Internal-admin route. Pass `null` to\n * clear back to \"international / no home country\" (the default).\n *\n * `POST /admin-portal/accounts/{merchantId}/business-profile/{profileId}/home-country`\n */\n async updateShopHomeCountry(\n merchantId: string,\n profileId: string,\n homeCountry: string | null,\n ): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/business-profile/${encodeURIComponent(profileId)}/home-country`,\n { body: { home_country: homeCountry } },\n );\n }\n\n /**\n * One merchant's sell-to restrictions — the merchant-wide policy and every\n * shop's effective policy. Read-only; staff change a policy through the\n * merchant routes.\n *\n * `GET /admin-portal/accounts/{merchantId}/sell-to-restrictions`\n */\n async getSellToRestrictions(merchantId: string): Promise<SellToRestrictionsResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/sell-to-restrictions`,\n );\n }\n\n /**\n * Soft-delete a transaction of ANY merchant. Only payments whose status\n * is in the admin delete policy can be deleted; the action is audited.\n *\n * `DELETE /admin-portal/transactions/{paymentId}`\n */\n async deleteTransaction(paymentId: string): Promise<PaymentsDeleteResponse> {\n return this.request('DELETE', `/admin-portal/transactions/${encodeURIComponent(paymentId)}`);\n }\n\n /**\n * Recover (undelete) a soft-deleted transaction. Audited.\n *\n * `POST /admin-portal/transactions/{paymentId}/recover`\n */\n async recoverTransaction(paymentId: string): Promise<PaymentsDeleteResponse> {\n return this.request(\n 'POST',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/recover`,\n );\n }\n\n /**\n * Client/device observations captured while the buyer interacted with a\n * transaction of ANY merchant, oldest first.\n *\n * `GET /admin-portal/transactions/{paymentId}/client-context`\n */\n async getTransactionClientContext(paymentId: string): Promise<PaymentClientContextListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/client-context`,\n );\n }\n\n /**\n * What the rail charged for one attempt of a transaction of ANY merchant,\n * off the attempt's settlement line. `line_recorded: false` means\n * no line exists for the attempt; an absent amount is \"no figure\", never\n * zero.\n *\n * `GET /admin-portal/transactions/{paymentId}/attempts/{attemptId}/processor-cost`\n */\n async getTransactionAttemptProcessorCost(\n paymentId: string,\n attemptId: string,\n ): Promise<AdminAttemptProcessorCost> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/attempts/${encodeURIComponent(attemptId)}/processor-cost`,\n );\n }\n\n /** Read or refresh signed processor fees for a payment. Internal admin access required. */\n async getTransactionProcessorCostEvents(\n paymentId: string,\n params: AdminProcessorCostEventsParams = {},\n ): Promise<ProcessorCostEventsResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/processor-cost-events`,\n {\n query: {\n test_mode: params.test_mode,\n year: params.year,\n month: params.month,\n limit: params.limit,\n offset: params.offset,\n force_sync: params.force_sync,\n },\n },\n );\n }\n\n /**\n * DeloPay's own processor cost schedules — our acquirer contract, which\n * prices every merchant that has no schedule of its own, except an account\n * a shop owner brought (that rate is in their contract, not ours, and lives\n * on the merchant surface).\n *\n * Never returned on the merchant surface: these rates are DeloPay's cost\n * base. The rows carry no merchant.\n *\n * `GET /admin-portal/processor-costs`\n */\n async listProcessorCostSchedules(): Promise<ProcessorCostScheduleResponse[]> {\n return this.request('GET', '/admin-portal/processor-costs');\n }\n\n /**\n * Record a DeloPay-wide cost schedule — what a rail charges DeloPay, for\n * rails that report no fee on the payment itself. A cost derived from one\n * of these is marked `estimated` on the settlement line, never `reported`.\n *\n * `POST /admin-portal/processor-costs`\n */\n async createProcessorCostSchedule(\n params: CreateProcessorCostScheduleRequest,\n ): Promise<ProcessorCostScheduleResponse> {\n return this.request('POST', '/admin-portal/processor-costs', { body: params });\n }\n\n /**\n * Record several DeloPay-wide schedules at once, all or none — copy a price\n * list across methods. 1 to 200 entries; an invalid entry is answered `422`\n * naming its index and nothing is stored. The answer lists them in request\n * order.\n *\n * `POST /admin-portal/processor-costs/bulk`\n */\n async bulkCreateProcessorCostSchedules(\n params: BulkCreateProcessorCostSchedulesRequest,\n ): Promise<ProcessorCostScheduleResponse[]> {\n return this.request('POST', '/admin-portal/processor-costs/bulk', { body: params });\n }\n\n /**\n * Close a window, deactivate a DeloPay-wide schedule or annotate it. The\n * rate itself is not editable: it priced transactions that already\n * happened, and a new rate is a new row.\n *\n * `PUT /admin-portal/processor-costs/{scheduleId}`\n */\n async updateProcessorCostSchedule(\n scheduleId: string,\n params: UpdateProcessorCostScheduleRequest,\n ): Promise<ProcessorCostScheduleResponse> {\n return this.request('PUT', `/admin-portal/processor-costs/${encodeURIComponent(scheduleId)}`, {\n body: params,\n });\n }\n\n /**\n * Close a DeloPay-wide schedule at `effective_from` and open its successor\n * with the same scope and the same end, in one step: no transaction is\n * priced by both rates, and none falls between them. Answers the successor.\n *\n * `POST /admin-portal/processor-costs/{scheduleId}/replace`\n */\n async replaceProcessorCostSchedule(\n scheduleId: string,\n params: ReplaceProcessorCostScheduleRequest,\n ): Promise<ProcessorCostScheduleResponse> {\n return this.request(\n 'POST',\n `/admin-portal/processor-costs/${encodeURIComponent(scheduleId)}/replace`,\n { body: params },\n );\n }\n\n /**\n * Delete a DeloPay-wide schedule. Restates nothing: every figure it derived\n * is already stamped on the settlement lines it priced.\n *\n * `DELETE /admin-portal/processor-costs/{scheduleId}`\n */\n async deleteProcessorCostSchedule(scheduleId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/processor-costs/${encodeURIComponent(scheduleId)}`,\n );\n }\n\n /**\n * A merchant's settlement statements. Same shapes as the merchant-facing\n * `settlement` resource, admin-authenticated.\n *\n * `GET /admin-portal/accounts/{merchantId}/settlement/statements`\n */\n async listSettlementStatements(\n merchantId: string,\n params: SettlementStatementListParams,\n ): Promise<SettlementStatementListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/statements`,\n {\n query: {\n test_mode: params.test_mode,\n profile_id: params.profile_id,\n limit: params.limit,\n offset: params.offset,\n },\n },\n );\n }\n\n /**\n * One settlement statement with its breakdown.\n * `GET /admin-portal/accounts/{merchantId}/settlement/statements/{statementId}`\n */\n async getSettlementStatement(\n merchantId: string,\n statementId: string,\n ): Promise<FeeStatementDetail> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/statements/${encodeURIComponent(statementId)}`,\n );\n }\n\n /**\n * Export a settlement statement as PDF. Returns the raw bytes as a `Blob`\n * with the same auth and error handling as every other call. `options`\n * takes a signal, a timeout and an `onDownloadProgress` listener for the\n * download's bytes (the PDF carries a `Content-Length`, so `total` is set).\n *\n * `GET /admin-portal/accounts/{merchantId}/settlement/statements/{statementId}/pdf`\n */\n async downloadSettlementStatementPdf(\n merchantId: string,\n statementId: string,\n params?: StatementPdfParams,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/statements/${encodeURIComponent(statementId)}/pdf`,\n {\n query: {\n currency: params?.currency,\n include_transactions: params?.include_transactions,\n },\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /**\n * A merchant's per-shop settlement overview.\n * `GET /admin-portal/accounts/{merchantId}/settlement/overview`\n */\n async settlementOverview(\n merchantId: string,\n params: SettlementOverviewParams,\n ): Promise<SettlementOverviewResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/overview`,\n { query: { test_mode: params.test_mode } },\n );\n }\n\n /**\n * A merchant's live current-period settlement rollup.\n * `GET /admin-portal/accounts/{merchantId}/settlement/current`\n */\n async settlementCurrent(\n merchantId: string,\n params: SettlementCurrentParams,\n ): Promise<SettlementCurrentResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/current`,\n { query: { test_mode: params.test_mode, profile_id: params.profile_id } },\n );\n }\n\n /**\n * A merchant's vault state: the attach entitlement, and the vault\n * configuration of every shop.\n *\n * `GET /admin-portal/accounts/{merchantId}/vault`\n */\n async getVaultState(merchantId: string): Promise<AdminVaultStateResponse> {\n return this.request('GET', `/admin-portal/accounts/${encodeURIComponent(merchantId)}/vault`);\n }\n\n /**\n * Attach a vault to one of a merchant's shops — creates the vault\n * connector account and points the profile at it in one request. The\n * Collect credentials are verified write-only before anything is stored.\n *\n * `POST /admin-portal/accounts/{merchantId}/vault/attach`\n */\n async attachVault(\n merchantId: string,\n params: AdminAttachVaultRequest,\n ): Promise<AdminAttachVaultResponse> {\n return this.request(\n 'POST',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/vault/attach`,\n { body: params },\n );\n }\n}\n\nfunction transactionListQuery(params?: AdminTransactionListParams): RequestOptions['query'] {\n if (!params) return undefined;\n const {\n statuses,\n connectors,\n payment_methods,\n payment_method_types,\n currencies,\n merchant_connector_ids,\n connector_settlement_statuses,\n routing_approaches,\n failure_substatuses,\n product_ids,\n ...query\n } = params;\n return {\n ...query,\n ...(statuses?.length ? { statuses: statuses.join(',') } : {}),\n ...(connectors?.length ? { connectors: connectors.join(',') } : {}),\n ...(payment_methods?.length ? { payment_methods: payment_methods.join(',') } : {}),\n ...(payment_method_types?.length\n ? { payment_method_types: payment_method_types.join(',') }\n : {}),\n ...(currencies?.length ? { currencies: currencies.join(',') } : {}),\n ...(merchant_connector_ids?.length\n ? { merchant_connector_ids: merchant_connector_ids.join(',') }\n : {}),\n ...(connector_settlement_statuses?.length\n ? { connector_settlement_statuses: connector_settlement_statuses.join(',') }\n : {}),\n ...(routing_approaches?.length ? { routing_approaches: routing_approaches.join(',') } : {}),\n ...(failure_substatuses?.length ? { failure_substatuses: failure_substatuses.join(',') } : {}),\n ...(product_ids?.length ? { product_ids: product_ids.join(',') } : {}),\n };\n}\n","import type { AuditLogListParams, AuditLogListResponse, AuditLogResponse } from '../types';\nimport type { AdminAuditLogExportRecord } from '../types';\nimport type {\n BinaryExportOptions,\n ExportEnvelope,\n ExportOptions,\n JsonExportOptions,\n} from '../../types';\nimport type { RequestFn } from '../../client';\nimport { runExport } from '../../exportDownload';\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 /**\n * The platform audit log as a file. `GET /admin-portal/audit/export`\n *\n * Takes the same filters as {@link AuditLogs.list}, and returns the whole\n * match set rather than a page — bounded at 25,000 rows (500 for `pdf`), and\n * refused past that with `DE_07` rather than truncated. `csv` and `json` are\n * streamed and held to their `X-Delopay-Record-Count`; see\n * {@link ExportTransferOptions} for progress, cancellation and the\n * `EXPORT_INCOMPLETE` check.\n *\n * Columns answer the question an audit asks rather than mirroring the\n * dashboard table: the actor, the real actor behind an impersonation, the\n * action, its target, when, and from where. `details` is deliberately absent —\n * an unbounded per-action blob is unreadable in a spreadsheet cell.\n */\n async export(\n params?: AuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord>>;\n async export(params: AuditLogListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async export(\n params: AuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob>;\n async export(\n params?: AuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/audit/export',\n // The format is negotiated by `Accept`, never a query field: the query\n // here is the list's own filter model, and adding a key to it would fork\n // the filter vocabulary the export exists to reuse.\n { query: params as Record<string, string | number | boolean | undefined> },\n options,\n );\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Cache {\n constructor(private readonly request: RequestFn) {}\n\n /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */\n async invalidate(key: string): Promise<Record<string, unknown>> {\n return this.request('POST', `/cache/invalidate/${encodeURIComponent(key)}`);\n }\n}\n","import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card-issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card-issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card-issuers');\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Configs {\n constructor(private readonly request: RequestFn) {}\n\n /** Create a config. `POST /configs` */\n async create(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/configs', { body: params });\n }\n\n /** Retrieve a config by key. `GET /configs/{key}` */\n async retrieve(key: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/configs/${encodeURIComponent(key)}`);\n }\n\n /** Update a config. `PUT /configs/{key}` */\n async update(key: string, params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('PUT', `/configs/${encodeURIComponent(key)}`, { body: params });\n }\n\n /** Delete a config. `DELETE /configs/{key}` */\n async delete(key: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/configs/${encodeURIComponent(key)}`);\n }\n}\n","import type {\n ConnectorRestrictionRuleResponse,\n CreateConnectorRestrictionRuleRequest,\n ListConnectorRestrictionRulesQuery,\n UpdateConnectorRestrictionRuleRequest,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nconst BASE = '/admin/connector-restriction-rules';\n\n/**\n * Per-shop / per-project connector restriction rules.\n *\n * Distinct from `connectorRestrictions` (the merchant-tier attach gate):\n * these rules allow/deny a connector for one shop (`scope: 'profile'`) or\n * project (`scope: 'project'`) at routing time. A `deny` is never routed even\n * when the connector is attached and enabled; once a scope has any `allow` it\n * becomes a whitelist, and the project scope takes precedence over the shop\n * scope. Admin-only, under `/admin/connector-restriction-rules`; exposed only\n * via `'@delopay/sdk/internal'`.\n */\nexport class ConnectorRestrictionRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create one allow/deny rule. A duplicate\n * `(merchant_id, scope, scope_id, connector)` is rejected — update or delete\n * the existing rule instead.\n */\n async create(\n body: CreateConnectorRestrictionRuleRequest,\n ): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('POST', BASE, { body });\n }\n\n /**\n * List rules for one scope (`scope` + `scope_id`) or a whole merchant\n * (`merchant_id`). Pass exactly one selector.\n */\n async list(\n query: ListConnectorRestrictionRulesQuery,\n ): Promise<ConnectorRestrictionRuleResponse[]> {\n // Spread into a fresh object literal so the typed query satisfies the\n // request layer's `Record<string, …>` index signature. `undefined` values\n // are dropped by `request()`.\n return this.request('GET', BASE, { query: { ...query } });\n }\n\n /** Retrieve a single rule by ID. */\n async retrieve(id: string): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('GET', `${BASE}/${encodeURIComponent(id)}`);\n }\n\n /** Update a rule's action and/or reason. */\n async update(\n id: string,\n body: UpdateConnectorRestrictionRuleRequest,\n ): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('PATCH', `${BASE}/${encodeURIComponent(id)}`, { body });\n }\n\n /** Delete a rule by ID. */\n async delete(id: string): Promise<{ id: string; deleted: boolean }> {\n return this.request('DELETE', `${BASE}/${encodeURIComponent(id)}`);\n }\n}\n","import type { ConnectorRestrictionResponse, UpsertConnectorRestrictionRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Admin-only allowlist for phased connector rollouts.\n *\n * Default-open semantics: a connector with no restriction row is\n * usable by every merchant (current behavior). A connector with a\n * row is gated — only merchants in `allowed_merchant_ids` can attach\n * a connector account. Enforced server-side at MCA-create time.\n */\nexport class ConnectorRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Idempotent upsert. If a row exists for `connector_name`, its\n * allowlist + reason are replaced. To open the connector to\n * everyone again, call `delete()`.\n */\n async upsert(body: UpsertConnectorRestrictionRequest): Promise<ConnectorRestrictionResponse> {\n return this.request('POST', '/admin/connector-restrictions', { body });\n }\n\n async list(): Promise<ConnectorRestrictionResponse[]> {\n return this.request('GET', '/admin/connector-restrictions');\n }\n\n async retrieve(connectorName: string): Promise<ConnectorRestrictionResponse> {\n return this.request(\n 'GET',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n\n /** Removing the row makes the connector public again. */\n async delete(connectorName: string): Promise<{ connector_name: string; deleted: boolean }> {\n return this.request(\n 'DELETE',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n}\n","import type {\n DiagnosticAttentionBoard,\n DiagnosticAttentionParams,\n DiagnosticChange,\n DiagnosticChangeListParams,\n DiagnosticConnectorCall,\n DiagnosticConnectorCallListParams,\n DiagnosticErrorCodeCount,\n DiagnosticFiringAlert,\n DiagnosticIncomingWebhook,\n DiagnosticIncomingWebhookDetail,\n DiagnosticIncomingWebhookListParams,\n DiagnosticInfrastructure,\n DiagnosticList,\n DiagnosticOutgoingWebhook,\n DiagnosticOutgoingWebhookListParams,\n DiagnosticOutgoingWebhookSummary,\n DiagnosticPanel,\n DiagnosticPayment,\n DiagnosticPaymentListParams,\n DiagnosticQueueItem,\n DiagnosticQueueListParams,\n DiagnosticQueueSummary,\n DiagnosticResolvedId,\n DiagnosticRevealRequest,\n DiagnosticRevealResponse,\n DiagnosticRouterLog,\n DiagnosticRouterLogParams,\n DiagnosticTrace,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * The diagnostic console — everything the router did, without a\n * shell.\n *\n * Cross-merchant by construction: one call answers across every merchant on the\n * deployment. The backend gates that on the `Diagnostic` permission, which is\n * granted to DeloPay's internal staff roles alone, which is why this lives in\n * `@delopay/sdk/internal` and never on the merchant-facing client.\n *\n * ## Two shapes worth knowing before you call anything\n *\n * **Lists answer {@link DiagnosticList}**, which carries `hidden_by_environment`\n * beside the rows. That number is what lets a UI say \"612 test-mode rows are\n * hidden\" rather than leaving an operator unable to tell an empty tab from a\n * filtered one.\n *\n * **Two reads answer {@link DiagnosticPanel} instead** — {@link routerLogs} and\n * {@link alerts} — because their sources can be down independently of the\n * router. A panel is `available` with data or `unavailable` with a reason, and\n * that distinction is the whole point: **an unreachable log store must never be\n * rendered as \"no errors found\"**, and a `T[]` gives a caller no way to tell the\n * two apart.\n *\n * ## The environment filter\n *\n * Every list takes `environment`. Omitting it is read by the backend as\n * `'live'`, never as `'all'` — a caller that forgot to say gets the safer of the\n * two, and a test payment never appears in a view that reads as live.\n */\nexport class Diagnostic {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The ranked attention board — the page's landing state, with nothing typed.\n *\n * Always carries `checks_run` and `vitals`, so an empty `items` reads as\n * \"checked these things at 14:02, all clear\" rather than as a panel that\n * failed to load. A check that could not run is **absent** from `checks_run`\n * rather than silently counted as clear.\n */\n async attention(body?: DiagnosticAttentionParams): Promise<DiagnosticAttentionBoard> {\n return this.request('POST', '/admin-portal/diagnostic/attention', { body: body ?? {} });\n }\n\n /**\n * Provider webhooks received, across every merchant.\n *\n * `source_verified: false` selects rows that failed verification **or** never\n * reached it — the deliveries that failed before verification was attempted\n * are exactly the ones an operator opens this tab for.\n */\n async listIncomingWebhooks(\n body?: DiagnosticIncomingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticIncomingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/incoming', {\n body: body ?? {},\n });\n }\n\n /**\n * One delivery in full: masked headers and body, the verification verdict,\n * and the router log lines for its request id.\n *\n * `router_logs` is `null` — not `[]` — when the log store is unreachable, and\n * `router_logs_unavailable` then says why. Render the first as *unavailable*,\n * never as \"the router logged nothing\".\n */\n async getIncomingWebhook(eventId: string): Promise<DiagnosticIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/webhooks/incoming/${encodeURIComponent(eventId)}`,\n );\n }\n\n /** Shop webhooks sent, across every merchant, with each event's attempts folded in. */\n async listOutgoingWebhooks(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticOutgoingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing', {\n body: body ?? {},\n });\n }\n\n /**\n * The four tiles above the shop-webhooks table.\n *\n * Counted under the same window and environment as the table but **without**\n * its delivery filter — the tiles say what the window holds, and applying the\n * filter would make every tile agree with whichever one is selected.\n */\n async outgoingWebhookSummary(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticOutgoingWebhookSummary> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing/summary', {\n body: body ?? {},\n });\n }\n\n /**\n * Connector calls the router made.\n *\n * List rows carry no payload. Fetch one with {@link getConnectorCall} for the\n * masked request and response.\n */\n async listConnectorCalls(\n body?: DiagnosticConnectorCallListParams,\n ): Promise<DiagnosticList<DiagnosticConnectorCall>> {\n return this.request('POST', '/admin-portal/diagnostic/connector-calls', { body: body ?? {} });\n }\n\n /** One connector call, with its masked payloads. */\n async getConnectorCall(id: string): Promise<DiagnosticConnectorCall> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/connector-calls/${encodeURIComponent(id)}`,\n );\n }\n\n /**\n * Router logs, proxied from the deployment's log store.\n *\n * Answers a {@link DiagnosticPanel}. Check `status` before reading `data`:\n * `'unavailable'` means the store did not answer, which is the opposite of\n * \"there were no errors\" and must be rendered as such.\n */\n async routerLogs(\n body?: DiagnosticRouterLogParams,\n ): Promise<DiagnosticPanel<DiagnosticList<DiagnosticRouterLog>>> {\n return this.request('POST', '/admin-portal/diagnostic/logs', { body: body ?? {} });\n }\n\n /**\n * Payments that are stuck or failed.\n *\n * Stuck means non-terminal for longer than `stuck_minutes`; failed means it\n * ended without succeeding inside the window. Omitting `stuck_minutes` turns\n * the first arm off rather than widening it.\n */\n async listPayments(\n body?: DiagnosticPaymentListParams,\n ): Promise<DiagnosticList<DiagnosticPayment>> {\n return this.request('POST', '/admin-portal/diagnostic/payments', { body: body ?? {} });\n }\n\n /**\n * The error codes in this window, each with its count in the previous window\n * of equal length.\n *\n * `previous_count: null` means the code did not appear before — render it as\n * \"new\" rather than as a fall to zero.\n */\n async paymentErrorCodes(body?: DiagnosticPaymentListParams): Promise<DiagnosticErrorCodeCount[]> {\n return this.request('POST', '/admin-portal/diagnostic/payments/error-codes', {\n body: body ?? {},\n });\n }\n\n /**\n * Everything about one payment, in one call: the payment, its attempts, its\n * status history, its client context, and what it produced — connector calls,\n * webhooks both ways, and scheduler jobs.\n *\n * Read `diagnostic_capture` before rendering an empty section. A payment with\n * no connector calls and a deployment that never recorded any are different\n * facts, and the second must not read as the first.\n *\n * Typed loosely on purpose: the payment, attempts, status-history and\n * client-context halves are the merchant-facing shapes this package already\n * exports, and re-declaring them here would give consumers two names for one\n * thing that could then drift apart.\n */\n async getPayment(paymentId: string): Promise<Record<string, unknown>> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/payments/${encodeURIComponent(paymentId)}`,\n );\n }\n\n /** Scheduler tasks, most overdue first. */\n async listQueues(body?: DiagnosticQueueListParams): Promise<DiagnosticList<DiagnosticQueueItem>> {\n return this.request('POST', '/admin-portal/diagnostic/queues', { body: body ?? {} });\n }\n\n /**\n * The four tiles above the queues table, plus the approvals count.\n *\n * `pending_approvals` is a **different** queue from `pending_count`: a stalled\n * scheduler needs a consumer, a full approvals queue needs a person, and\n * folding them into one number would point an operator at the wrong fix.\n */\n async queueSummary(): Promise<DiagnosticQueueSummary> {\n return this.request('GET', '/admin-portal/diagnostic/queues/summary');\n }\n\n /**\n * Replicas and their dependencies.\n *\n * `build_mismatch` is computed server-side rather than left for a caller to\n * notice by comparing strings: one replica in four answering differently\n * explains a whole class of \"it only fails sometimes\" incident, and is\n * invisible unless something says it out loud.\n */\n async infrastructure(): Promise<DiagnosticInfrastructure> {\n return this.request('GET', '/admin-portal/diagnostic/infrastructure');\n }\n\n /**\n * Firing alerts, proxied from Alertmanager.\n *\n * Answers a {@link DiagnosticPanel} for the same reason {@link routerLogs}\n * does: a strip that renders empty because Alertmanager is down says \"nothing\n * is firing\", which is the most dangerous sentence this page could print.\n */\n async alerts(): Promise<DiagnosticPanel<DiagnosticFiringAlert[]>> {\n return this.request('GET', '/admin-portal/diagnostic/alerts');\n }\n\n /** Config edits and admin actions inside the window. */\n async listChanges(body?: DiagnosticChangeListParams): Promise<DiagnosticList<DiagnosticChange>> {\n return this.request('POST', '/admin-portal/diagnostic/changes', { body: body ?? {} });\n }\n\n /**\n * What a pasted id is, and whether we hold it.\n *\n * `kind` and `found` are separate answers on purpose. A well-shaped id that\n * matches nothing comes back `found: false` with the three `reasons` and\n * their fixes — render that, never an empty table, which reads as \"no such\n * payment\" when the real answer is \"outside the window\" or \"it is a test\n * payment\".\n */\n async resolveId(id: string): Promise<DiagnosticResolvedId> {\n return this.request('GET', `/admin-portal/diagnostic/resolve/${encodeURIComponent(id)}`);\n }\n\n /**\n * One id across every source, as an ordered span list.\n *\n * Accepts a payment, attempt, event or request id. Sources that could not be\n * read are named in `unavailable_sources` rather than left out: a waterfall\n * with an unexplained gap reads as a period when nothing happened.\n */\n async trace(id: string): Promise<DiagnosticTrace> {\n return this.request('GET', `/admin-portal/diagnostic/trace/${encodeURIComponent(id)}`);\n }\n\n /**\n * Unmask one field of one object.\n *\n * **Writes an audit row** naming the operator, the field and the object,\n * before the value is returned — a reveal that could not be audited does not\n * happen. Needs a dashboard JWT holding `DiagnosticReveal`; an admin API key\n * cannot call it, because an API key names no person.\n *\n * `reason` is required and is stored verbatim.\n */\n async reveal(body: DiagnosticRevealRequest): Promise<DiagnosticRevealResponse> {\n return this.request('POST', '/admin-portal/diagnostic/reveal', { body });\n }\n}\n","import type { GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Gsm {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm', { body: params });\n }\n\n async retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/get', { body: params });\n }\n\n async update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/update', { body: params });\n }\n\n async delete(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/delete', { body: params });\n }\n}\n","import type {\n AdminAdjustmentRequest,\n AdminAdjustmentResponse,\n AdminCreateLedgerRequest,\n AdminCreateLedgerResponse,\n AdminResetLedgerRequest,\n AdminResetLedgerResponse,\n AdminSetFreeRequest,\n AdminSetHardFloorRequest,\n AdminSuspendRequest,\n AdminUnsuspendRequest,\n AdminSetTrustedRequest,\n UpdateLedgerEntryRequest,\n} from '../types';\nimport type { BillingProfileResponse } from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-level ledger adjustments on a merchant's balance. Admin-only\n * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only\n * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't\n * advertise the admin adjustment path in autocomplete.\n */\nexport class PlatformBilling {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Manually credit a merchant's balance (e.g. promotional credit,\n * dispute reversal, manual correction).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Credit amount and reason.\n */\n async credit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {\n body: params,\n });\n }\n\n /**\n * Manually debit a merchant's balance.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Debit amount and reason.\n */\n async debit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {\n body: params,\n });\n }\n\n /**\n * Edit a single ledger entry (amount and/or description), keeping the\n * merchant balance consistent: when `amount` changes, the balance is\n * atomically adjusted by the difference. Returns the entry id and new\n * balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to edit.\n * @param params - New amount / description (either optional).\n */\n async editLedgerEntry(\n merchantId: string,\n ledgerId: string,\n params: UpdateLedgerEntryRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'PATCH',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete a single ledger entry, reversing its amount from the merchant\n * balance. Returns the deleted entry id and the new balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to delete.\n */\n async deleteLedgerEntry(merchantId: string, ledgerId: string): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'DELETE',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n );\n }\n\n /**\n * Manually suspend a merchant (e.g. confirmed fraud or ToS violation),\n * independent of balance. A `reason` is required for audit. Throws 412 if\n * the merchant is trusted (clear the flag first) or already suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Suspension reason.\n * @returns The updated billing profile.\n */\n async suspend(merchantId: string, params: AdminSuspendRequest): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/suspend`, {\n body: params,\n });\n }\n\n /**\n * Lift a suspension. Restores the merchant to `active` (or `delinquent` if\n * the balance is at/below the hard floor) and resets the recharge-failure\n * counter. Throws 412 if the merchant is not suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional audit note.\n * @returns The updated billing profile.\n */\n async unsuspend(\n merchantId: string,\n params: AdminUnsuspendRequest = {},\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/unsuspend`, {\n body: params,\n });\n }\n\n /**\n * Set or clear the trusted (suspension-exempt) flag. Trusted merchants\n * cannot be suspended automatically or manually. Does not lift an existing\n * suspension — use {@link PlatformBilling.unsuspend} for that.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired trusted state.\n * @returns The updated billing profile.\n */\n async setTrusted(\n merchantId: string,\n params: AdminSetTrustedRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/trusted`, {\n body: params,\n });\n }\n\n /**\n * Set the merchant's hard floor — the balance at or below which the\n * merchant stops being active. A negative value grants a credit line; zero\n * means no negative balance at all. This moves the suspension line, it does\n * not remove it. The value and the caller are written to the audit log\n * before the floor changes, so the change is always attributable.\n *\n * Refused (412) for a positive amount, for a floor beyond the maximum\n * credit line of 10,000,000 minor units, or for an empty `reason`.\n *\n * Requires a router that serves the hard-floor admin route; older ones\n * answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The new floor (zero or negative) and the audit reason.\n * @returns The updated billing profile.\n */\n async setHardFloor(\n merchantId: string,\n params: AdminSetHardFloorRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/hard-floor`, {\n body: params,\n });\n }\n\n /**\n * Mark a merchant free (not billed), or put it back on the prepaid model.\n * While free, no platform fee is deducted, the payment gate never blocks on\n * billing status, top-ups are refused and auto-recharge is inert. Marking\n * free needs a `reason` and is refused (412) while an admin suspension is in\n * force — lift that first.\n *\n * Requires a router that supports the free flag; older ones answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired free state and, when marking free, the reason.\n * @returns The updated billing profile.\n */\n async setFree(merchantId: string, params: AdminSetFreeRequest): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/free`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant's **entire** ledger. Every live entry is soft-deleted —\n * kept, so a replayed fee deduction or top-up webhook still no-ops — the\n * balance is set to zero and the status re-derived (`active` for a free\n * merchant; an active paying merchant lands in `delinquent`). Refused (412)\n * while the merchant has shop allocations. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The reason, required for audit.\n * @returns What was removed and the post-reset profile.\n */\n async resetLedger(\n merchantId: string,\n params: AdminResetLedgerRequest,\n ): Promise<AdminResetLedgerResponse> {\n return this.request('DELETE', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n\n /**\n * (Re)create a merchant's ledger, optionally seeded with an opening\n * balance. Ensures the billing profile exists (created without the welcome\n * promo credit) and, when `opening_balance` is set, writes one\n * `opening_balance` entry through the same atomic helper an admin credit\n * uses. Refused (412) while live entries or a non-zero balance remain —\n * reset first. Does not clear the free flag. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Opening balance (minor units), currency for a new profile, and the reason.\n * @returns The opening entry id (if one was written) and the profile.\n */\n async createLedger(\n merchantId: string,\n params: AdminCreateLedgerRequest,\n ): Promise<AdminCreateLedgerResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n}\n","import type {\n FeeRulePreviewRequest,\n FeeRulePreviewResponse,\n FeeScheduleCreateRequest,\n FeeScheduleResponse,\n FeeScheduleUpdateRequest,\n PlatformFeeRuleInput,\n PlatformFeeRuleRecord,\n PlatformFeeRuleRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-wide fee schedule management. Admin-only routes under\n * `/admin/fees/*`. Exposed only via `'@delopay/sdk/internal'`.\n *\n * `platformFees.rules` manages the platform-owned Euclid fee-rule program per\n * merchant, which takes precedence over the flat platform schedules. Build the\n * program with `feeProgram()`.\n */\nexport class PlatformFees {\n /** Platform-owned Euclid fee-rule program (`/admin/fees/rules`). */\n readonly rules: PlatformFeeRulesManager;\n\n constructor(private readonly request: RequestFn) {\n this.rules = new PlatformFeeRulesManager(request);\n }\n\n /** Create a platform fee schedule for a specific merchant. */\n async create(params: FeeScheduleCreateRequest, merchantId: string): Promise<FeeScheduleResponse> {\n return this.request('POST', '/admin/fees', {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /** List every platform fee schedule assigned to a merchant. */\n async list(merchantId: string): Promise<FeeScheduleResponse[]> {\n return this.request('GET', '/admin/fees/list', {\n query: { merchant_id: merchantId },\n });\n }\n\n /** Retrieve a single platform fee schedule by ID. */\n async retrieve(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('GET', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n\n /** Update a platform fee schedule. */\n async update(feeId: string, params: FeeScheduleUpdateRequest): Promise<FeeScheduleResponse> {\n return this.request('PUT', `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });\n }\n\n /** Delete a platform fee schedule. */\n async delete(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('DELETE', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n}\n\n/**\n * Manages a merchant's platform-owned Euclid fee-rule programs (admin surface),\n * merchant-wide or per-shop (one active program per scope; a shop-scoped\n * program wins for its shop, else the merchant-wide one applies). Build the\n * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'platform'`; set\n * `profile_id` on the input to scope a program to a shop.\n */\nexport class PlatformFeeRulesManager {\n constructor(private readonly request: RequestFn) {}\n\n /** Create or replace the platform fee-rule program for a merchant. */\n async upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord> {\n const body: PlatformFeeRuleRequest = { ...params, fee_owner: 'platform' };\n return this.request('PUT', '/admin/fees/rules', {\n body,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Retrieve the active platform fee-rule program for a scope, or `null`.\n * `profileId` omitted = merchant-wide program; set = that shop's program.\n */\n async retrieve(merchantId: string, profileId?: string): Promise<PlatformFeeRuleRecord | null> {\n return this.request('GET', '/admin/fees/rules', {\n query: { merchant_id: merchantId, profile_id: profileId },\n });\n }\n\n /**\n * Deactivate a platform fee-rule program. Idempotent. `profileId` omitted\n * targets the merchant-wide program; set targets only that shop's program.\n */\n async delete(merchantId: string, profileId?: string): Promise<void> {\n await this.request('DELETE', '/admin/fees/rules', {\n query: { merchant_id: merchantId, profile_id: profileId },\n });\n }\n\n /**\n * Dry-run a candidate fee-rule program against a sample transaction.\n * Returns the matched rule name, whether it fell through, and the computed fee.\n * Does not persist anything.\n */\n async preview(input: FeeRulePreviewRequest, merchantId: string): Promise<FeeRulePreviewResponse> {\n return this.request('POST', '/admin/fees/rules/preview', {\n body: input,\n query: { merchant_id: merchantId },\n });\n }\n}\n","import type { RequestFn } from '../../client';\nimport type {\n ApplePayVerificationCatalogue,\n ApplePayVerificationSelection,\n MerchantSettingsQuery,\n SettingsResponse,\n UpdateSettingsRequest,\n} from '../../types';\n\n/**\n * Settings as the platform operator sees them: the platform's own, and the\n * operator's values at any merchant, project or shop.\n *\n * Each setting names the admin permission group needed to change it. Every\n * change is recorded in the audit log with the previous and the new value\n * (`entity_type: 'setting'`); `auditLogs.list({ entity_type: 'setting',\n * entity_id })` is one setting's history. A merchant's own values are listed\n * (`authority: 'merchant'`) but can only be changed by the merchant.\n */\nexport class PlatformSettings {\n constructor(private readonly request: RequestFn) {}\n\n /** Provider-issued presets for this backend environment. */\n async applePayVerificationCatalogue(): Promise<ApplePayVerificationCatalogue> {\n return this.request('GET', '/payment-link/apple-pay-verification/catalogue');\n }\n\n /** Atomic, audited update. A stale revision leaves the current file unchanged. */\n async updateApplePayVerification(\n selection: ApplePayVerificationSelection,\n expectedRevision: number,\n ): Promise<SettingsResponse> {\n return this.update({\n changes: [\n {\n key: 'checkout.apple_pay_verification',\n value: selection,\n expected_revision: expectedRevision,\n },\n ],\n });\n }\n\n /** `GET /admin-portal/settings` */\n async retrieve(): Promise<SettingsResponse> {\n return this.request('GET', '/admin-portal/settings');\n }\n\n /**\n * Change platform settings. All changes are applied or none is.\n *\n * `PATCH /admin-portal/settings`\n */\n async update(params: UpdateSettingsRequest): Promise<SettingsResponse> {\n return this.request('PATCH', '/admin-portal/settings', { body: params });\n }\n\n /** `GET /admin-portal/accounts/{merchantId}/settings` */\n async retrieveMerchant(\n merchantId: string,\n query: MerchantSettingsQuery = {},\n ): Promise<SettingsResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settings`,\n {\n query: projectQuery(query),\n },\n );\n }\n\n /** `PATCH /admin-portal/accounts/{merchantId}/settings` */\n async updateMerchant(\n merchantId: string,\n params: UpdateSettingsRequest,\n query: MerchantSettingsQuery = {},\n ): Promise<SettingsResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settings`,\n { body: params, query: projectQuery(query) },\n );\n }\n\n /** `GET /admin-portal/accounts/{merchantId}/shops/{profileId}/settings` */\n async retrieveShop(merchantId: string, profileId: string): Promise<SettingsResponse> {\n return this.request('GET', shopPath(merchantId, profileId));\n }\n\n /** `PATCH /admin-portal/accounts/{merchantId}/shops/{profileId}/settings` */\n async updateShop(\n merchantId: string,\n profileId: string,\n params: UpdateSettingsRequest,\n ): Promise<SettingsResponse> {\n return this.request('PATCH', shopPath(merchantId, profileId), { body: params });\n }\n}\n\nfunction shopPath(merchantId: string, profileId: string): string {\n return `/admin-portal/accounts/${encodeURIComponent(merchantId)}/shops/${encodeURIComponent(profileId)}/settings`;\n}\n\n/** The query string of a merchant-scope call; a null project is omitted. */\nfunction projectQuery(query: MerchantSettingsQuery): Record<string, string> {\n return query.project_id ? { project_id: query.project_id } : {};\n}\n","import type { RequestFn } from '../../client';\nimport type {\n MessageLanguage,\n MessageTemplateDetail,\n MessageTemplateLanguage,\n MessageTemplateList,\n MessageTemplatePreview,\n PreviewMessageTemplateRequest,\n ResetMessageTemplateLanguageQuery,\n SendTestMessageRequest,\n SendTestMessageResponse,\n UpdateMessageTemplateLanguageRequest,\n} from '../../types';\n\n/**\n * The texts of every message the platform sends, as the operator writes them\n * at the platform scope: dashboard and operator emails, and the platform\n * default of every buyer email. A shop's own text of a buyer email goes\n * before the platform's, and the built-in text applies where neither exists.\n *\n * Reading needs an admin login or API key; writes, resets and test sends need\n * `AccountManage`. Every change is recorded in the audit log\n * (`entity_type: 'message_template'`, `entity_id:\n * 'platform:platform:<channel>:<template_id>:<language>'`).\n */\nexport class PlatformMessageTemplates {\n constructor(private readonly request: RequestFn) {}\n\n /** `GET /admin-portal/message-templates` */\n async list(): Promise<MessageTemplateList> {\n return this.request('GET', '/admin-portal/message-templates');\n }\n\n /** `GET /admin-portal/message-templates/{template_id}` */\n async retrieve(templateId: string): Promise<MessageTemplateDetail> {\n return this.request('GET', `/admin-portal/message-templates/${encodeURIComponent(templateId)}`);\n }\n\n /**\n * Store the platform's text in one language.\n *\n * `PUT /admin-portal/message-templates/{template_id}/languages/{language}`\n */\n async updateLanguage(\n templateId: string,\n language: MessageLanguage,\n params: UpdateMessageTemplateLanguageRequest,\n ): Promise<MessageTemplateLanguage> {\n return this.request(\n 'PUT',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,\n {\n body: params,\n },\n );\n }\n\n /**\n * Remove the platform's text in one language, so the built-in text applies.\n *\n * `DELETE /admin-portal/message-templates/{template_id}/languages/{language}`\n */\n async resetLanguage(\n templateId: string,\n language: MessageLanguage,\n params: ResetMessageTemplateLanguageQuery = {},\n ): Promise<MessageTemplateLanguage> {\n return this.request(\n 'DELETE',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,\n {\n query: { expected_revision: params.expected_revision },\n },\n );\n }\n\n /** `POST /admin-portal/message-templates/{template_id}/preview` */\n async preview(\n templateId: string,\n params: PreviewMessageTemplateRequest,\n ): Promise<MessageTemplatePreview> {\n return this.request(\n 'POST',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/preview`,\n { body: params },\n );\n }\n\n /**\n * Send the template to the signed-in admin's own address.\n *\n * `POST /admin-portal/message-templates/{template_id}/test`\n */\n async sendTest(\n templateId: string,\n params: SendTestMessageRequest,\n ): Promise<SendTestMessageResponse> {\n return this.request(\n 'POST',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/test`,\n { body: params },\n );\n }\n}\n","import type { RequestExtras, RequestFn } from '../../client';\nimport type { NativeRenewalCloseResponse, NativeRenewalCloseTarget } from '../types';\n\n/** Service-authenticated renewal reconciliation. */\nexport class NativeRenewals {\n constructor(\n private readonly request: RequestFn,\n private readonly serviceKey: string,\n ) {}\n\n /** Close the previous renewal payment using the internal service key and its owner context. */\n async close(\n paymentId: string,\n target: NativeRenewalCloseTarget,\n options?: RequestExtras,\n ): Promise<NativeRenewalCloseResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/native-renewal-close`, {\n ...options,\n headers: {\n ...options?.headers,\n 'X-Internal-API-Key': this.serviceKey,\n 'X-Merchant-Id': target.merchant_id,\n 'X-Profile-Id': target.profile_id,\n },\n });\n }\n}\n","import type { RequestFn } from '../client';\nimport { Delopay } from '../client';\nimport { Admin } from './resources/admin';\nimport { AdminPortal } from './resources/adminPortal';\nimport { AuditLogs } from './resources/auditLogs';\nimport { Cache } from './resources/cache';\nimport { CardIssuers } from './resources/cardIssuers';\nimport { Configs } from './resources/configs';\nimport { ConnectorRestrictionRules } from './resources/connectorRestrictionRules';\nimport { ConnectorRestrictions } from './resources/connectorRestrictions';\nimport { Diagnostic } from './resources/diagnostic';\nimport { Gsm } from './resources/gsm';\nimport { PlatformBilling } from './resources/platformBilling';\nimport { PlatformFees } from './resources/platformFees';\nimport { PlatformSettings } from './resources/platformSettings';\nimport { PlatformMessageTemplates } from './resources/platformMessageTemplates';\nimport { NativeRenewals } from './resources/nativeRenewals';\n\n/**\n * Internal-only Delopay client for DeloPay staff tooling (the admin\n * control-center, audit UIs, etc.). Extends the public `Delopay` surface\n * with admin-plane resources that must **not** be discoverable from the\n * merchant-facing package entry.\n *\n * Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.\n * The merchant-facing `import { Delopay } from '@delopay/sdk'` never\n * surfaces these.\n */\nexport class DelopayInternal extends Delopay {\n /** Bootstrap admin endpoints — signup, signin, onboarding. */\n readonly admin: Admin;\n /** Platform-wide customer, transaction, analytics, merchant-account ops. */\n readonly adminPortal: AdminPortal;\n /** Audit log reads. */\n readonly auditLogs: AuditLogs;\n /** Backend cache invalidation. */\n readonly cache: Cache;\n /** Platform card-issuer program management. */\n readonly cardIssuers: CardIssuers;\n /** Generic platform config store. */\n readonly configs: Configs;\n /** Per-merchant connector allowlist for phased rollouts. */\n readonly connectorRestrictions: ConnectorRestrictions;\n /** Per-shop / per-project connector allow-deny rules (routing-time). */\n readonly connectorRestrictionRules: ConnectorRestrictionRules;\n /**\n * The diagnostic console — everything the router did, without a shell.\n * Cross-merchant, and gated on the staff-only `Diagnostic` permission.\n */\n readonly diagnostic: Diagnostic;\n /** GSM (Gateway Status Mapping) routing rules. */\n readonly gsm: Gsm;\n /** Admin-only ledger credits/debits against a merchant's balance. */\n readonly platformBilling: PlatformBilling;\n /** Platform-wide fee schedules assigned to merchants. */\n readonly platformFees: PlatformFees;\n /** Platform, merchant and shop settings as the operator sees them. */\n readonly platformSettings: PlatformSettings;\n /** The platform's texts of every message it sends. */\n readonly platformMessageTemplates: PlatformMessageTemplates;\n /** Uses the constructor credential as an internal service key for renewal reconciliation. */\n readonly nativeRenewals: NativeRenewals;\n\n constructor(...args: ConstructorParameters<typeof Delopay>) {\n super(...args);\n const request = this.request.bind(this) as RequestFn;\n this.admin = new Admin(request);\n this.adminPortal = new AdminPortal(request);\n this.auditLogs = new AuditLogs(request);\n this.cache = new Cache(request);\n this.cardIssuers = new CardIssuers(request);\n this.configs = new Configs(request);\n this.connectorRestrictions = new ConnectorRestrictions(request);\n this.connectorRestrictionRules = new ConnectorRestrictionRules(request);\n this.diagnostic = new Diagnostic(request);\n this.gsm = new Gsm(request);\n this.platformBilling = new PlatformBilling(request);\n this.platformFees = new PlatformFees(request);\n this.platformSettings = new PlatformSettings(request);\n this.platformMessageTemplates = new PlatformMessageTemplates(request);\n this.nativeRenewals = new NativeRenewals(request, args[0] ?? '');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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iBAAN,MAAqB;AAAA,EAC1B,YACmB,SACA,YACjB;AAFiB;AACA;AAAA,EAChB;AAAA;AAAA,EAGH,MAAM,MACJ,WACA,QACA,SACqC;AACrC,WAAO,KAAK,QAAQ,QAAQ,aAAa,mBAAmB,SAAS,CAAC,yBAAyB;AAAA,MAC7F,GAAG;AAAA,MACH,SAAS;AAAA,QACP,GAAG,SAAS;AAAA,QACZ,sBAAsB,KAAK;AAAA,QAC3B,iBAAiB,OAAO;AAAA,QACxB,gBAAgB,OAAO;AAAA,MACzB;AAAA,IACF,CAAC;AAAA,EACH;AACF;;;ACEO,IAAM,kBAAN,cAA8B,QAAQ;AAAA,EAmC3C,eAAe,MAA6C;AAC1D,UAAM,GAAG,IAAI;AACb,UAAM,UAAU,KAAK,QAAQ,KAAK,IAAI;AACtC,SAAK,QAAQ,IAAI,MAAM,OAAO;AAC9B,SAAK,cAAc,IAAI,YAAY,OAAO;AAC1C,SAAK,YAAY,IAAI,UAAU,OAAO;AACtC,SAAK,QAAQ,IAAI,MAAM,OAAO;AAC9B,SAAK,cAAc,IAAI,YAAY,OAAO;AAC1C,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,wBAAwB,IAAI,sBAAsB,OAAO;AAC9D,SAAK,4BAA4B,IAAI,0BAA0B,OAAO;AACtE,SAAK,aAAa,IAAI,WAAW,OAAO;AACxC,SAAK,MAAM,IAAI,IAAI,OAAO;AAC1B,SAAK,kBAAkB,IAAI,gBAAgB,OAAO;AAClD,SAAK,eAAe,IAAI,aAAa,OAAO;AAC5C,SAAK,mBAAmB,IAAI,iBAAiB,OAAO;AACpD,SAAK,2BAA2B,IAAI,yBAAyB,OAAO;AACpE,SAAK,iBAAiB,IAAI,eAAe,SAAS,KAAK,CAAC,KAAK,EAAE;AAAA,EACjE;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/internal/resources/admin.ts","../src/internal/resources/adminPortal.ts","../src/internal/resources/auditLogs.ts","../src/internal/resources/cache.ts","../src/internal/resources/cardIssuers.ts","../src/internal/resources/configs.ts","../src/internal/resources/connectorRestrictionRules.ts","../src/internal/resources/connectorRestrictions.ts","../src/internal/resources/diagnostic.ts","../src/internal/resources/gsm.ts","../src/internal/resources/platformBilling.ts","../src/internal/resources/platformFees.ts","../src/internal/resources/platformSettings.ts","../src/internal/resources/platformMessageTemplates.ts","../src/internal/resources/nativeRenewals.ts","../src/internal/client.ts"],"sourcesContent":["import type { AuthResponse, SignUpWithMerchantIdRequest } from '../../types';\nimport type {\n AdminSignInRequest,\n AuthorizeResponse,\n CreateInternalUserRequest,\n CreateTenantUserRequest,\n OnboardMerchantRequest,\n OnboardMerchantResponse,\n SignupToggleRequest,\n SignupToggleResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Admin {\n constructor(private readonly request: RequestFn) {}\n\n async signIn(params: AdminSignInRequest): Promise<AuthResponse> {\n return this.request('POST', '/admin/signin', { body: params });\n }\n\n async createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/internal-signup', { body: params });\n }\n\n async createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/tenant-signup', { body: params });\n }\n\n /**\n * Create a new merchant admin user and merchant account atomically.\n *\n * This is the correct endpoint for bootstrapping the first admin user in a\n * fresh deployment — `internal-signup`/`tenant-signup` both require\n * pre-existing merchant records that don't exist on a clean database.\n *\n * `POST /admin/signup-with-merchant-id`\n */\n async signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse> {\n return this.request('POST', '/admin/signup-with-merchant-id', { body: params });\n }\n\n /** Toggle public signup on/off. `POST /admin/settings/signup` */\n async setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse> {\n return this.request('POST', '/admin/settings/signup', { body: params });\n }\n\n /** Read current public-signup status. `GET /admin/settings/signup` */\n async getSignupSettings(): Promise<SignupToggleResponse> {\n return this.request('GET', '/admin/settings/signup');\n }\n\n /** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard-merchant` */\n async onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse> {\n return this.request('POST', '/admin/onboard-merchant', { body: params });\n }\n}\n","import type {\n BinaryExportOptions,\n CsvExportOptions,\n DynamicLineExportOptions,\n ExportEnvelope,\n ExportOptions,\n JsonExportOptions,\n BulkCreateProcessorCostSchedulesRequest,\n BuyerRefundRequestList,\n BuyerRefundRequestPageQuery,\n CreateProcessorCostScheduleRequest,\n ProcessorCostEventsResponse,\n ProcessorCostScheduleResponse,\n ReplaceProcessorCostScheduleRequest,\n UpdateProcessorCostScheduleRequest,\n FeeStatementDetail,\n MerchantAccountResponse,\n MerchantAccountUpdateRequest,\n PaymentAttemptsListResponse,\n PaymentClientContextListResponse,\n PaymentResponse,\n PaymentProductLines,\n InvoiceList,\n InvoicePageQuery,\n PaymentsDeleteResponse,\n PaymentStatusHistoryResponse,\n PaymentLogsResponse,\n PaymentLogConnectorCallDetail,\n PaymentLogIncomingWebhookDetail,\n PaymentLogOutgoingWebhookDetail,\n ProfileResponse,\n RefundListResponse,\n SellToRestrictionsResponse,\n SettlementCurrentParams,\n SettlementCurrentResponse,\n SettlementOverviewParams,\n SettlementOverviewResponse,\n SettlementStatementListParams,\n SettlementStatementListResponse,\n StatementPdfParams,\n SubscriptionAnalyticsRequest,\n SubscriptionAnalyticsResponse,\n SubscriptionDrillRequest,\n ScopeDrillRequest,\n BuyerEvidenceInformationRequest,\n BuyerEvidenceNote,\n BuyerEvidenceQueue,\n BuyerEvidenceQueueQuery,\n BuyerEvidenceReply,\n BuyerEvidenceReviewCreate,\n BuyerEvidenceReviewDetail,\n} from '../../types';\nimport type {\n RefundVolumeQuery,\n RefundVolumeResponse,\n UpdateRefundVolumeRequest,\n PlatformFeeReturnListResponse,\n PlatformFeeReturnQuery,\n PlatformFeeReturnResponse,\n UpdatePlatformFeeReturnRequest,\n ConsolidateRolesRequest,\n ConsolidateRolesResponse,\n ConsolidationCandidatesResponse,\n CreateSharedRoleRequest,\n RetireSharedRolePreviewRequest,\n RetireSharedRolePreviewResponse,\n RetireSharedRoleRequest,\n SharedRoleApplied,\n SharedRoleChange,\n SharedRoleDetailResponse,\n SharedRoleListResponse,\n SharedRolePreviewResponse,\n UpdateSharedRoleRequest,\n AdminAttachVaultRequest,\n AdminAttachVaultResponse,\n AdminAttemptProcessorCost,\n AdminProcessorCostEventsParams,\n AdminVaultStateResponse,\n CardFundingBackfillRequest,\n CardFundingBackfillResponse,\n AdminCustomerListParams,\n AdminCustomerListResponse,\n AdminCustomerDetail,\n AdminTransactionExportParams,\n AdminTransactionExportRecord,\n AdminTransactionLineExportRecord,\n AdminTransactionListParams,\n AdminTransactionListResponse,\n AdminUnresolvedRefundListParams,\n AdminUnresolvedRefundListResponse,\n AdminAnalyticsRequest,\n PlatformAnalyticsResponse,\n OverviewStatsResponse,\n PaymentAnalyticsRequest,\n PaymentAnalyticsResponse,\n AnalyticsScopeRequest,\n ClientAnalyticsRequest,\n DeviceDrillRequest,\n GeoDrillRequest,\n DrillResponse,\n DevicesAnalyticsResponse,\n GeoAnalyticsResponse,\n AnalyticsScopeResponse,\n AdminLedgerAnalyticsRequest,\n AdminLedgerAnalyticsResponse,\n AdminOrphanedBillingProfilesResponse,\n AdminCreateUserForMerchantRequest,\n AdminUpdateUserRequest,\n AdminUserResponse,\n BuyerEvidenceAssign,\n BuyerEvidenceDeadlineChange,\n} from '../types';\nimport type { RequestExtras, RequestFn, RequestOptions } from '../../client';\nimport { runExport } from '../../exportDownload';\n\nexport class AdminPortal {\n /** Read refund treatment and the scope supplying its effective value. */\n async getRefundVolume(\n merchantId: string,\n query: RefundVolumeQuery = {},\n ): Promise<RefundVolumeResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/refund-volume`,\n {\n query: { ...query },\n },\n );\n }\n\n /** Change future monthly tier snapshots; existing snapshots and statement lines retain their prices. */\n async updateRefundVolume(\n merchantId: string,\n body: UpdateRefundVolumeRequest,\n query: RefundVolumeQuery = {},\n ): Promise<RefundVolumeResponse> {\n return this.request(\n 'PUT',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/refund-volume`,\n {\n query: { ...query },\n body,\n },\n );\n }\n\n /** Read whether refunds return their share of the platform fee, and the scope supplying it. */\n async getPlatformFeeReturn(\n merchantId: string,\n query: PlatformFeeReturnQuery = {},\n ): Promise<PlatformFeeReturnResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/platform-fee-return`,\n {\n query: { ...query },\n },\n );\n }\n\n /** Change the fee return for refunds that succeed from now on; earlier refunds keep their decision. */\n async updatePlatformFeeReturn(\n merchantId: string,\n body: UpdatePlatformFeeReturnRequest,\n query: PlatformFeeReturnQuery = {},\n ): Promise<PlatformFeeReturnResponse> {\n return this.request(\n 'PUT',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/platform-fee-return`,\n {\n query: { ...query },\n body,\n },\n );\n }\n\n /** What each successful refund of one payment returned of the platform fee. */\n async listPaymentPlatformFeeReturns(\n merchantId: string,\n paymentId: string,\n ): Promise<PlatformFeeReturnListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/transactions/${encodeURIComponent(paymentId)}/platform-fee-returns`,\n );\n }\n\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The deployment's merchant roles: shared roles, the roles defined in code,\n * and every merchant's own custom roles. `GET /admin-portal/merchant-roles`\n */\n async listSharedRoles(): Promise<SharedRoleListResponse> {\n return this.request('GET', '/admin-portal/merchant-roles');\n }\n\n /** `GET /admin-portal/merchant-roles/{roleId}` */\n async getSharedRole(roleId: string): Promise<SharedRoleDetailResponse> {\n return this.request('GET', `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}`);\n }\n\n /**\n * Define a role once and offer it to every merchant, or to the ones listed.\n * Offering never assigns it. `POST /admin-portal/merchant-roles`\n */\n async createSharedRole(body: CreateSharedRoleRequest): Promise<SharedRoleDetailResponse> {\n return this.request('POST', '/admin-portal/merchant-roles', { body });\n }\n\n /**\n * What a change would do, without writing anything. Apply it with\n * `updateSharedRole` and the `version` this returns.\n * `POST /admin-portal/merchant-roles/{roleId}/preview`\n */\n async previewSharedRole(\n roleId: string,\n change: SharedRoleChange,\n ): Promise<SharedRolePreviewResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/preview`,\n { body: change },\n );\n }\n\n /**\n * Apply a reviewed change. A change that takes access away needs\n * `acknowledge_sign_out` and signs out every holder.\n * `PUT /admin-portal/merchant-roles/{roleId}`\n */\n async updateSharedRole(\n roleId: string,\n body: UpdateSharedRoleRequest,\n ): Promise<SharedRoleApplied> {\n return this.request('PUT', `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}`, {\n body,\n });\n }\n\n /** `POST /admin-portal/merchant-roles/{roleId}/retire/preview` */\n async previewRetireSharedRole(\n roleId: string,\n body: RetireSharedRolePreviewRequest = {},\n ): Promise<RetireSharedRolePreviewResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/retire/preview`,\n { body },\n );\n }\n\n /**\n * Retire a shared role, moving its holders to the replacement.\n * `POST /admin-portal/merchant-roles/{roleId}/retire`\n */\n async retireSharedRole(\n roleId: string,\n body: RetireSharedRoleRequest,\n ): Promise<SharedRoleApplied> {\n return this.request(\n 'POST',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/retire`,\n { body },\n );\n }\n\n /**\n * Merchant-specific roles whose holders could move to this shared role, and\n * what each move would change. `GET /admin-portal/merchant-roles/{roleId}/consolidation`\n */\n async sharedRoleConsolidationCandidates(\n roleId: string,\n ): Promise<ConsolidationCandidatesResponse> {\n return this.request(\n 'GET',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/consolidation`,\n );\n }\n\n /** `POST /admin-portal/merchant-roles/{roleId}/consolidate` */\n async consolidateIntoSharedRole(\n roleId: string,\n body: ConsolidateRolesRequest,\n ): Promise<ConsolidateRolesResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchant-roles/${encodeURIComponent(roleId)}/consolidate`,\n { body },\n );\n }\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 const query = transactionListQuery(params);\n return this.request('GET', '/admin-portal/transactions', {\n query,\n });\n }\n\n /**\n * The admin transaction search as a file. `GET /admin-portal/transactions/export`\n *\n * Takes the same filters as {@link AdminPortal.listTransactions}, sent the\n * same way, and returns the whole match set rather than a page — bounded at\n * 25,000 rows (500 for `pdf`) and refused past that with `DE_07` rather than\n * truncated. Every page of it is read inside one database snapshot, so a\n * payment updated while the file downloads is neither repeated nor skipped.\n *\n * `csv` and `json` are streamed and held to their `X-Delopay-Record-Count`;\n * see {@link ExportTransferOptions} for progress, cancellation and the\n * `EXPORT_INCOMPLETE` check. The format is negotiated by `Accept` and\n * defaults to `json`.\n */\n async exportTransactions(\n params?: AdminTransactionExportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionExportRecord>>;\n async exportTransactions(\n params: AdminTransactionExportParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async exportTransactions(\n params: AdminTransactionExportParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionExportRecord> | Blob>;\n async exportTransactions(\n params?: AdminTransactionExportParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/transactions/export',\n { query: transactionListQuery(params) },\n options,\n );\n }\n\n /**\n * The admin transaction search as a file, one row per product line.\n * `GET /admin-portal/transactions/export/lines`\n *\n * The same filters as {@link AdminPortal.exportTransactions}, sent the same\n * way; one row per product line the matched payments recorded, plus one\n * `row_kind: 'no_lines'` row for each payment that recorded none. `csv` or\n * `json` only: the server refuses a PDF with `422`.\n */\n async exportTransactionLines(\n params?: AdminTransactionExportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionLineExportRecord>>;\n async exportTransactionLines(\n params: AdminTransactionExportParams | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async exportTransactionLines(\n params: AdminTransactionExportParams | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionLineExportRecord> | Blob>;\n async exportTransactionLines(\n params?: AdminTransactionExportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<AdminTransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/transactions/export/lines',\n { query: transactionListQuery(params) },\n options,\n );\n }\n\n /**\n * Full detail for a single transaction of ANY merchant — the same\n * `PaymentResponse` the merchant `payments.retrieve` returns. Admin-scoped:\n * the JWT (or admin API key) does not need to belong to the payment's\n * merchant; the backend resolves the owning merchant and reads it read-only\n * (no connector sync).\n */\n async getTransaction(paymentId: string): Promise<PaymentResponse> {\n return this.request('GET', `/admin-portal/transactions/${encodeURIComponent(paymentId)}`);\n }\n\n /** The same frozen purchase lines available on the merchant payment read. */\n async getTransactionProductLines(paymentId: string): Promise<PaymentProductLines> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/product-lines`,\n );\n }\n\n /**\n * Per-attempt history (retries across connectors, decline reasons) for a\n * single transaction of ANY merchant.\n */\n async getTransactionAttempts(paymentId: string): Promise<PaymentAttemptsListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/attempts`,\n );\n }\n\n /**\n * Status timeline (intent / attempt / refund / dispute transitions) for a\n * single transaction of ANY merchant. `complete: false` marks timelines\n * partially reconstructed from current records.\n */\n async getTransactionStatusHistory(paymentId: string): Promise<PaymentStatusHistoryResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/status-history`,\n );\n }\n\n /**\n * The traffic of a transaction of ANY merchant: provider requests, provider\n * webhooks and shop webhooks, oldest first, without payloads. Same shape as\n * `payments.listLogs`.\n */\n async getTransactionLogs(paymentId: string): Promise<PaymentLogsResponse> {\n return this.request('GET', `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs`);\n }\n\n /** One provider request of a transaction of ANY merchant, with its masked payloads. */\n async getTransactionLogConnectorCall(\n paymentId: string,\n callId: string,\n ): Promise<PaymentLogConnectorCallDetail> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/connector-calls/${encodeURIComponent(callId)}`,\n );\n }\n\n /** One provider webhook of a transaction of ANY merchant, with its masked headers and body. */\n async getTransactionLogIncomingWebhook(\n paymentId: string,\n eventId: string,\n ): Promise<PaymentLogIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/incoming-webhooks/${encodeURIComponent(eventId)}`,\n );\n }\n\n /** Every delivery attempt of one shop webhook of a transaction of ANY merchant. */\n async getTransactionLogOutgoingWebhook(\n paymentId: string,\n initialAttemptId: string,\n ): Promise<PaymentLogOutgoingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/logs/outgoing-webhooks/${encodeURIComponent(initialAttemptId)}`,\n );\n }\n\n /**\n * The invoices and credit notes issued for a transaction of ANY merchant,\n * each its own row, newest first. At most 100 per page.\n * `GET /admin-portal/transactions/{paymentId}/invoices`\n */\n async getTransactionInvoices(paymentId: string, params?: InvoicePageQuery): Promise<InvoiceList> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/invoices`,\n { query: params === undefined ? undefined : { ...params } },\n );\n }\n\n /**\n * One invoice of ANY merchant as a PDF: the stored copy of an issued\n * document, a live render of a draft, the snapshot under a VOIDED banner for\n * a voided one.\n * `GET /admin-portal/invoices/{invoiceId}/pdf`\n */\n async downloadInvoicePdf(invoiceId: string): Promise<Blob> {\n return this.request('GET', `/admin-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n });\n }\n\n /**\n * Refunds for a single transaction of ANY merchant.\n */\n async getTransactionRefunds(paymentId: string): Promise<RefundListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/refunds`,\n );\n }\n\n /**\n * The refund requests buyers raised from the customer portal about a single\n * transaction of ANY merchant, newest first, one page at a time\n * (`total_count` counts them all). Read-only.\n * `GET /admin-portal/transactions/{paymentId}/refund-requests`\n */\n async getTransactionRefundRequests(\n paymentId: string,\n params?: BuyerRefundRequestPageQuery,\n ): Promise<BuyerRefundRequestList> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/refund-requests`,\n { query: params === undefined ? undefined : { ...params } },\n );\n }\n\n /**\n * Refunds of ANY merchant mirrored from a connector webhook at a\n * non-terminal status that no sync can advance. Newest first.\n */\n async listUnresolvedRefunds(\n params?: AdminUnresolvedRefundListParams,\n ): Promise<AdminUnresolvedRefundListResponse> {\n return this.request('GET', '/admin-portal/refunds/unresolved', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n // --- Buyer evidence review --------------------------------------------------\n\n /**\n * DeloPay's review queue of buyers' evidence, the nearest target first,\n * across merchants unless `merchant_id` narrows it.\n */\n async listBuyerEvidence(params?: BuyerEvidenceQueueQuery): Promise<BuyerEvidenceQueue> {\n return this.request('GET', '/admin-portal/buyer-evidence', {\n query: params as Record<string, string | number | boolean | null | undefined>,\n });\n }\n\n /** One case's evidence with every step and file, internal ones included. */\n async getBuyerEvidence(evidenceId: string): Promise<BuyerEvidenceReviewDetail> {\n return this.request('GET', `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}`);\n }\n\n /** Download a file of a case's evidence. */\n async downloadBuyerEvidenceFile(evidenceId: string, fileId: string): Promise<Blob> {\n return this.request(\n 'GET',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/files/${encodeURIComponent(fileId)}`,\n { responseType: 'blob' },\n );\n }\n\n /**\n * Ask the buyer for more, by a cut-off. Refused once a result has closed\n * the review.\n */\n async requestBuyerEvidenceInformation(\n evidenceId: string,\n params: BuyerEvidenceInformationRequest,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'POST',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/information-requests`,\n { body: params },\n );\n }\n\n /** An answer the buyer sees. */\n async replyToBuyerEvidence(\n evidenceId: string,\n params: BuyerEvidenceReply,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'POST',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/replies`,\n { body: params },\n );\n }\n\n /**\n * Record the result, which closes the review. It never refunds a payment\n * and never decides a dispute with the payment provider.\n */\n async reviewBuyerEvidence(\n evidenceId: string,\n params: BuyerEvidenceReviewCreate,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'POST',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/reviews`,\n { body: params },\n );\n }\n\n /** Move the buyer's cut-off, with a reason the buyer sees. */\n async moveBuyerEvidenceDeadline(\n evidenceId: string,\n params: BuyerEvidenceDeadlineChange,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'PUT',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/deadline`,\n { body: params },\n );\n }\n\n /** Make a user responsible for the review: an id, `me`, or `null` for nobody. */\n async assignBuyerEvidence(\n evidenceId: string,\n params: BuyerEvidenceAssign,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'PUT',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/reviewer`,\n { body: params },\n );\n }\n\n /** An internal note, never shown to the buyer. */\n async noteBuyerEvidence(\n evidenceId: string,\n params: BuyerEvidenceNote,\n ): Promise<BuyerEvidenceReviewDetail> {\n return this.request(\n 'POST',\n `/admin-portal/buyer-evidence/${encodeURIComponent(evidenceId)}/notes`,\n { body: params },\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 * One drill level of the analytics dashboard: the scope's daily series +\n * processor mix and its direct children's series. Range / metric / donut\n * toggles apply client-side; only a drill (passing merchant_id / project_id\n * / shop_id) fetches the next level.\n */\n async analyticsScope(params?: AnalyticsScopeRequest): Promise<AnalyticsScopeResponse> {\n return this.request('GET', '/admin-portal/analytics/scope', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Device analytics over the canonical client-context observation per\n * payment, rooted at all merchants and drillable via `merchant_id` /\n * `project_id` / `shop_id` like `analyticsScope`. Answers 200 with\n * `enabled: false` when the client-context optimisation-use switch is off.\n */\n async analyticsDevices(params?: ClientAnalyticsRequest): Promise<DevicesAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics/devices', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Geo analytics over the canonical client-context observation per payment,\n * rooted at all merchants. `mode` selects the location claim (`ip` default,\n * `billing`).\n */\n async analyticsGeo(params?: ClientAnalyticsRequest): Promise<GeoAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics/geo', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * The recent payments behind one clicked geo target (map country/city or\n * local-hours heatmap cell), rooted at all merchants. Capped at 50 rows,\n * newest first, with the full match count alongside.\n */\n async analyticsGeoTransactions(params: GeoDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/admin-portal/analytics/geo/transactions', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * The recent payments behind one clicked device target (browser/platform\n * family, device-model label or device class), rooted at all merchants.\n * 50 rows per page (`offset` for the next page), newest first.\n */\n async analyticsDeviceTransactions(params: DeviceDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/admin-portal/analytics/devices/transactions', {\n // A discriminated union carries no index signature, so the widening\n // goes via `unknown` — the union is the point.\n query: params as unknown as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * The payments behind one clicked element of the admin payments dashboard\n * (processor / method slice, outcome segment, series bucket or breakdown\n * row), rooted at all merchants. Same contract as the merchant surface's\n * `analytics.scopeTransactions`. `GET /admin-portal/analytics/scope/transactions`\n */\n async analyticsScopeTransactions(params: ScopeDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/admin-portal/analytics/scope/transactions', {\n query: params as unknown as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Subscription analytics over `subscription` and `invoice`, rooted at all\n * merchants and drillable via `merchant_id` / `project_id` / `shop_id` like\n * `analyticsScope`. The `children` block at the root is the merchant\n * breakdown — there is no separate endpoint for it.\n *\n * Half the figures are **stocks** (a snapshot at the window's end, not a sum\n * over it), so `est_monthly_volume_usd` and `active` can match across a\n * 7-day and a 30-day window while `billed_volume_usd` does not. Day\n * granularity only.\n */\n async analyticsSubscriptions(\n params?: SubscriptionAnalyticsRequest,\n ): Promise<SubscriptionAnalyticsResponse> {\n return this.request('GET', '/admin-portal/analytics/subscriptions', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * The billing cycles behind one clicked element of the admin subscription\n * dashboard: an invoice outcome, a processor slice on either axis, a plan\n * row, a subscription status, a movement component, a series bucket or a\n * breakdown row. 50 rows per page (`offset` for the next), newest first,\n * with the full match count alongside.\n *\n * A cycle that never reached a payment is listed too — that is what \"still\n * unpaid\" means — and carries its invoice id as `payment_id` with\n * `invoice_id` set to the same value.\n */\n async analyticsSubscriptionsList(params: SubscriptionDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/admin-portal/analytics/subscriptions/list', {\n // A discriminated union carries no index signature, so the widening\n // goes via `unknown` — the union is the point, and the query builder\n // only ever reads own enumerable keys.\n query: params as unknown as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Platform billing dashboard: total balance across all ledger accounts (+\n * the net change), top-ups, fees collected, and the day-by-day ledger flow.\n * All amounts are in USD minor units.\n */\n async ledgerAnalytics(\n params?: AdminLedgerAnalyticsRequest,\n ): Promise<AdminLedgerAnalyticsResponse> {\n return this.request('GET', '/admin-portal/ledger-analytics', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Billing profiles no operator listing can reach, and the accounts that may\n * have taken one over.\n *\n * Deleting a merchant account leaves its billing profile — with its\n * balance, its Stripe customer and its saved card — behind, and the\n * Merchants listing enumerates merchant accounts, so such a profile is\n * absent from every operator surface rather than flagged on one. This reads\n * from the billing side instead, so it finds them.\n *\n * Both lists come back complete rather than paged: the healthy answer is two\n * empty arrays, and a truncated answer to *\"is the set empty\"* would read as\n * a clean bill of health.\n *\n * `adoption_candidates` are candidates, not findings — confirm a row against\n * the audit log before acting on it.\n */\n async orphanedBillingProfiles(): Promise<AdminOrphanedBillingProfilesResponse> {\n return this.request('GET', '/admin-portal/billing/orphaned-profiles');\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 /**\n * Create a brand-new user attached to the given merchant. The user is\n * marked `is_verified = true` so the admin can hand off credentials\n * immediately — no email round-trip is sent.\n */\n async createUserForMerchant(\n customerId: string,\n body: AdminCreateUserForMerchantRequest,\n ): Promise<AdminUserResponse> {\n return this.request('POST', `/admin-portal/customers/${encodeURIComponent(customerId)}/users`, {\n body,\n });\n }\n\n /**\n * Edit a user record. Any subset of fields may be supplied. `role_id`\n * requires `merchant_id`. `password` triggers a password reset (validated\n * against signup policy + JWT blacklist). `reset_2fa` clears TOTP state\n * so the user re-enrolls on next login. `is_active` supports both\n * directions: false soft-disables, true reactivates a soft-disabled user.\n *\n * Throws a `400` with `code === 'UR_66'` when the change would leave a\n * merchant with no administrator — `is_active: false` or `is_verified:\n * false` on, or a `role_id` demoting, the only active user whose role can\n * manage that merchant's users. Nothing is written. `error.data` carries a\n * {@link LastAdministratorRefusal} naming the merchant and which change was\n * refused; render that rather than the generic message.\n */\n async updateUser(userId: string, body: AdminUpdateUserRequest): Promise<AdminUserResponse> {\n return this.request('PATCH', `/admin-portal/users/${encodeURIComponent(userId)}`, { body });\n }\n\n /**\n * Soft-delete a user globally: deactivates the row, blacklists existing\n * JWTs, and wipes credentials. Distinct from `deleteUserRole`, which\n * removes a single role binding while leaving the user signed-in elsewhere.\n *\n * Throws the same `UR_66` as {@link updateUser} when the user is the last\n * administrator of any merchant they belong to, with `route: 'delete'`.\n */\n async deleteUser(userId: string): Promise<void> {\n return this.request('DELETE', `/admin-portal/users/${encodeURIComponent(userId)}`);\n }\n\n /**\n * Set a target merchant's shop iframe-allowed origins. Internal-admin\n * route — accepts an admin JWT or admin API key without requiring the\n * caller to be scoped to the target merchant. Pass `null` (or an empty\n * array) to clear the allowlist back to same-origin only.\n *\n * Server validates each origin: full origin (scheme + host[:port]),\n * no path/query/fragment, no wildcards.\n */\n async updateShopIframeOrigins(\n merchantId: string,\n profileId: string,\n origins: string[] | null,\n ): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/business_profile/${encodeURIComponent(profileId)}/iframe-origins`,\n { body: { iframe_allowed_origins: origins } },\n );\n }\n\n /**\n * Set (or clear) a target merchant shop's home country — the geo\n * dashboard's cross-border baseline. Internal-admin route. Pass `null` to\n * clear back to \"international / no home country\" (the default).\n *\n * `POST /admin-portal/accounts/{merchantId}/business-profile/{profileId}/home-country`\n */\n async updateShopHomeCountry(\n merchantId: string,\n profileId: string,\n homeCountry: string | null,\n ): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/business-profile/${encodeURIComponent(profileId)}/home-country`,\n { body: { home_country: homeCountry } },\n );\n }\n\n /**\n * One merchant's sell-to restrictions — the merchant-wide policy and every\n * shop's effective policy. Read-only; staff change a policy through the\n * merchant routes.\n *\n * `GET /admin-portal/accounts/{merchantId}/sell-to-restrictions`\n */\n async getSellToRestrictions(merchantId: string): Promise<SellToRestrictionsResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/sell-to-restrictions`,\n );\n }\n\n /**\n * Soft-delete a transaction of ANY merchant. Only payments whose status\n * is in the admin delete policy can be deleted; the action is audited.\n *\n * `DELETE /admin-portal/transactions/{paymentId}`\n */\n async deleteTransaction(paymentId: string): Promise<PaymentsDeleteResponse> {\n return this.request('DELETE', `/admin-portal/transactions/${encodeURIComponent(paymentId)}`);\n }\n\n /**\n * Recover (undelete) a soft-deleted transaction. Audited.\n *\n * `POST /admin-portal/transactions/{paymentId}/recover`\n */\n async recoverTransaction(paymentId: string): Promise<PaymentsDeleteResponse> {\n return this.request(\n 'POST',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/recover`,\n );\n }\n\n /**\n * Client/device observations captured while the buyer interacted with a\n * transaction of ANY merchant, oldest first.\n *\n * `GET /admin-portal/transactions/{paymentId}/client-context`\n */\n async getTransactionClientContext(paymentId: string): Promise<PaymentClientContextListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/client-context`,\n );\n }\n\n /**\n * What the rail charged for one attempt of a transaction of ANY merchant,\n * off the attempt's settlement line. `line_recorded: false` means\n * no line exists for the attempt; an absent amount is \"no figure\", never\n * zero.\n *\n * `GET /admin-portal/transactions/{paymentId}/attempts/{attemptId}/processor-cost`\n */\n async getTransactionAttemptProcessorCost(\n paymentId: string,\n attemptId: string,\n ): Promise<AdminAttemptProcessorCost> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/attempts/${encodeURIComponent(attemptId)}/processor-cost`,\n );\n }\n\n /** Read or refresh signed processor fees for a payment. Internal admin access required. */\n async getTransactionProcessorCostEvents(\n paymentId: string,\n params: AdminProcessorCostEventsParams = {},\n ): Promise<ProcessorCostEventsResponse> {\n return this.request(\n 'GET',\n `/admin-portal/transactions/${encodeURIComponent(paymentId)}/processor-cost-events`,\n {\n query: {\n test_mode: params.test_mode,\n year: params.year,\n month: params.month,\n limit: params.limit,\n offset: params.offset,\n force_sync: params.force_sync,\n },\n },\n );\n }\n\n /**\n * DeloPay's own processor cost schedules — our acquirer contract, which\n * prices every merchant that has no schedule of its own, except an account\n * a shop owner brought (that rate is in their contract, not ours, and lives\n * on the merchant surface).\n *\n * Never returned on the merchant surface: these rates are DeloPay's cost\n * base. The rows carry no merchant.\n *\n * `GET /admin-portal/processor-costs`\n */\n async listProcessorCostSchedules(): Promise<ProcessorCostScheduleResponse[]> {\n return this.request('GET', '/admin-portal/processor-costs');\n }\n\n /**\n * Record a DeloPay-wide cost schedule — what a rail charges DeloPay, for\n * rails that report no fee on the payment itself. A cost derived from one\n * of these is marked `estimated` on the settlement line, never `reported`.\n *\n * `POST /admin-portal/processor-costs`\n */\n async createProcessorCostSchedule(\n params: CreateProcessorCostScheduleRequest,\n ): Promise<ProcessorCostScheduleResponse> {\n return this.request('POST', '/admin-portal/processor-costs', { body: params });\n }\n\n /**\n * Record several DeloPay-wide schedules at once, all or none — copy a price\n * list across methods. 1 to 200 entries; an invalid entry is answered `422`\n * naming its index and nothing is stored. The answer lists them in request\n * order.\n *\n * `POST /admin-portal/processor-costs/bulk`\n */\n async bulkCreateProcessorCostSchedules(\n params: BulkCreateProcessorCostSchedulesRequest,\n ): Promise<ProcessorCostScheduleResponse[]> {\n return this.request('POST', '/admin-portal/processor-costs/bulk', { body: params });\n }\n\n /**\n * Close a window, deactivate a DeloPay-wide schedule or annotate it. The\n * rate itself is not editable: it priced transactions that already\n * happened, and a new rate is a new row.\n *\n * `PUT /admin-portal/processor-costs/{scheduleId}`\n */\n async updateProcessorCostSchedule(\n scheduleId: string,\n params: UpdateProcessorCostScheduleRequest,\n ): Promise<ProcessorCostScheduleResponse> {\n return this.request('PUT', `/admin-portal/processor-costs/${encodeURIComponent(scheduleId)}`, {\n body: params,\n });\n }\n\n /**\n * Close a DeloPay-wide schedule at `effective_from` and open its successor\n * with the same scope and the same end, in one step: no transaction is\n * priced by both rates, and none falls between them. Answers the successor.\n *\n * `POST /admin-portal/processor-costs/{scheduleId}/replace`\n */\n async replaceProcessorCostSchedule(\n scheduleId: string,\n params: ReplaceProcessorCostScheduleRequest,\n ): Promise<ProcessorCostScheduleResponse> {\n return this.request(\n 'POST',\n `/admin-portal/processor-costs/${encodeURIComponent(scheduleId)}/replace`,\n { body: params },\n );\n }\n\n /**\n * Delete a DeloPay-wide schedule. Restates nothing: every figure it derived\n * is already stamped on the settlement lines it priced.\n *\n * `DELETE /admin-portal/processor-costs/{scheduleId}`\n */\n async deleteProcessorCostSchedule(scheduleId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/processor-costs/${encodeURIComponent(scheduleId)}`,\n );\n }\n\n /**\n * A merchant's settlement statements. Same shapes as the merchant-facing\n * `settlement` resource, admin-authenticated.\n *\n * `GET /admin-portal/accounts/{merchantId}/settlement/statements`\n */\n async listSettlementStatements(\n merchantId: string,\n params: SettlementStatementListParams,\n ): Promise<SettlementStatementListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/statements`,\n {\n query: {\n test_mode: params.test_mode,\n profile_id: params.profile_id,\n limit: params.limit,\n offset: params.offset,\n },\n },\n );\n }\n\n /**\n * One settlement statement with its breakdown.\n * `GET /admin-portal/accounts/{merchantId}/settlement/statements/{statementId}`\n */\n async getSettlementStatement(\n merchantId: string,\n statementId: string,\n ): Promise<FeeStatementDetail> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/statements/${encodeURIComponent(statementId)}`,\n );\n }\n\n /**\n * Export a settlement statement as PDF. Returns the raw bytes as a `Blob`\n * with the same auth and error handling as every other call. `options`\n * takes a signal, a timeout and an `onDownloadProgress` listener for the\n * download's bytes (the PDF carries a `Content-Length`, so `total` is set).\n *\n * `GET /admin-portal/accounts/{merchantId}/settlement/statements/{statementId}/pdf`\n */\n async downloadSettlementStatementPdf(\n merchantId: string,\n statementId: string,\n params?: StatementPdfParams,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/statements/${encodeURIComponent(statementId)}/pdf`,\n {\n query: {\n currency: params?.currency,\n include_transactions: params?.include_transactions,\n },\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /**\n * A merchant's per-shop settlement overview.\n * `GET /admin-portal/accounts/{merchantId}/settlement/overview`\n */\n async settlementOverview(\n merchantId: string,\n params: SettlementOverviewParams,\n ): Promise<SettlementOverviewResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/overview`,\n { query: { test_mode: params.test_mode } },\n );\n }\n\n /**\n * A merchant's live current-period settlement rollup.\n * `GET /admin-portal/accounts/{merchantId}/settlement/current`\n */\n async settlementCurrent(\n merchantId: string,\n params: SettlementCurrentParams,\n ): Promise<SettlementCurrentResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settlement/current`,\n { query: { test_mode: params.test_mode, profile_id: params.profile_id } },\n );\n }\n\n /**\n * A merchant's vault state: the attach entitlement, and the vault\n * configuration of every shop.\n *\n * `GET /admin-portal/accounts/{merchantId}/vault`\n */\n async getVaultState(merchantId: string): Promise<AdminVaultStateResponse> {\n return this.request('GET', `/admin-portal/accounts/${encodeURIComponent(merchantId)}/vault`);\n }\n\n /**\n * Attach a vault to one of a merchant's shops — creates the vault\n * connector account and points the profile at it in one request. The\n * Collect credentials are verified write-only before anything is stored.\n *\n * `POST /admin-portal/accounts/{merchantId}/vault/attach`\n */\n async attachVault(\n merchantId: string,\n params: AdminAttachVaultRequest,\n ): Promise<AdminAttachVaultResponse> {\n return this.request(\n 'POST',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/vault/attach`,\n { body: params },\n );\n }\n\n /**\n * Correct the funding type, issuing bank and issuing country recorded on\n * past card payments from the BIN table, across every merchant, oldest\n * first, one bounded page per call. Resume with the returned `next_after`\n * until it is `null`. A dry run, the default, reports without writing; a\n * payment that changed while the page ran is left alone and counted as a\n * conflict. Payments of merchants whose attempts are stored in Redis are\n * not corrected.\n *\n * `POST /admin-portal/card-funding/backfill`\n */\n async backfillCardFunding(\n params: CardFundingBackfillRequest = {},\n ): Promise<CardFundingBackfillResponse> {\n return this.request('POST', '/admin-portal/card-funding/backfill', { body: params });\n }\n}\n\nfunction transactionListQuery(params?: AdminTransactionListParams): RequestOptions['query'] {\n if (!params) return undefined;\n const {\n statuses,\n connectors,\n payment_methods,\n payment_method_types,\n currencies,\n merchant_connector_ids,\n connector_settlement_statuses,\n routing_approaches,\n failure_substatuses,\n product_ids,\n ...query\n } = params;\n return {\n ...query,\n ...(statuses?.length ? { statuses: statuses.join(',') } : {}),\n ...(connectors?.length ? { connectors: connectors.join(',') } : {}),\n ...(payment_methods?.length ? { payment_methods: payment_methods.join(',') } : {}),\n ...(payment_method_types?.length\n ? { payment_method_types: payment_method_types.join(',') }\n : {}),\n ...(currencies?.length ? { currencies: currencies.join(',') } : {}),\n ...(merchant_connector_ids?.length\n ? { merchant_connector_ids: merchant_connector_ids.join(',') }\n : {}),\n ...(connector_settlement_statuses?.length\n ? { connector_settlement_statuses: connector_settlement_statuses.join(',') }\n : {}),\n ...(routing_approaches?.length ? { routing_approaches: routing_approaches.join(',') } : {}),\n ...(failure_substatuses?.length ? { failure_substatuses: failure_substatuses.join(',') } : {}),\n ...(product_ids?.length ? { product_ids: product_ids.join(',') } : {}),\n };\n}\n","import type { AuditLogListParams, AuditLogListResponse, AuditLogResponse } from '../types';\nimport type { AdminAuditLogExportRecord } from '../types';\nimport type {\n BinaryExportOptions,\n ExportEnvelope,\n ExportOptions,\n JsonExportOptions,\n} from '../../types';\nimport type { RequestFn } from '../../client';\nimport { runExport } from '../../exportDownload';\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 /**\n * The platform audit log as a file. `GET /admin-portal/audit/export`\n *\n * Takes the same filters as {@link AuditLogs.list}, and returns the whole\n * match set rather than a page — bounded at 25,000 rows (500 for `pdf`), and\n * refused past that with `DE_07` rather than truncated. `csv` and `json` are\n * streamed and held to their `X-Delopay-Record-Count`; see\n * {@link ExportTransferOptions} for progress, cancellation and the\n * `EXPORT_INCOMPLETE` check.\n *\n * Columns answer the question an audit asks rather than mirroring the\n * dashboard table: the actor, the real actor behind an impersonation, the\n * action, its target, when, and from where. `details` is deliberately absent —\n * an unbounded per-action blob is unreadable in a spreadsheet cell.\n */\n async export(\n params?: AuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord>>;\n async export(params: AuditLogListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async export(\n params: AuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob>;\n async export(\n params?: AuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/audit/export',\n // The format is negotiated by `Accept`, never a query field: the query\n // here is the list's own filter model, and adding a key to it would fork\n // the filter vocabulary the export exists to reuse.\n { query: params as Record<string, string | number | boolean | undefined> },\n options,\n );\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Cache {\n constructor(private readonly request: RequestFn) {}\n\n /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */\n async invalidate(key: string): Promise<Record<string, unknown>> {\n return this.request('POST', `/cache/invalidate/${encodeURIComponent(key)}`);\n }\n}\n","import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card-issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card-issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card-issuers');\n }\n}\n","import type { RequestFn } from '../../client';\n\nexport class Configs {\n constructor(private readonly request: RequestFn) {}\n\n /** Create a config. `POST /configs` */\n async create(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/configs', { body: params });\n }\n\n /** Retrieve a config by key. `GET /configs/{key}` */\n async retrieve(key: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/configs/${encodeURIComponent(key)}`);\n }\n\n /** Update a config. `PUT /configs/{key}` */\n async update(key: string, params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('PUT', `/configs/${encodeURIComponent(key)}`, { body: params });\n }\n\n /** Delete a config. `DELETE /configs/{key}` */\n async delete(key: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/configs/${encodeURIComponent(key)}`);\n }\n}\n","import type {\n ConnectorRestrictionRuleResponse,\n CreateConnectorRestrictionRuleRequest,\n ListConnectorRestrictionRulesQuery,\n UpdateConnectorRestrictionRuleRequest,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nconst BASE = '/admin/connector-restriction-rules';\n\n/**\n * Per-shop / per-project connector restriction rules.\n *\n * Distinct from `connectorRestrictions` (the merchant-tier attach gate):\n * these rules allow/deny a connector for one shop (`scope: 'profile'`) or\n * project (`scope: 'project'`) at routing time. A `deny` is never routed even\n * when the connector is attached and enabled; once a scope has any `allow` it\n * becomes a whitelist, and the project scope takes precedence over the shop\n * scope. Admin-only, under `/admin/connector-restriction-rules`; exposed only\n * via `'@delopay/sdk/internal'`.\n */\nexport class ConnectorRestrictionRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create one allow/deny rule. A duplicate\n * `(merchant_id, scope, scope_id, connector)` is rejected — update or delete\n * the existing rule instead.\n */\n async create(\n body: CreateConnectorRestrictionRuleRequest,\n ): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('POST', BASE, { body });\n }\n\n /**\n * List rules for one scope (`scope` + `scope_id`) or a whole merchant\n * (`merchant_id`). Pass exactly one selector.\n */\n async list(\n query: ListConnectorRestrictionRulesQuery,\n ): Promise<ConnectorRestrictionRuleResponse[]> {\n // Spread into a fresh object literal so the typed query satisfies the\n // request layer's `Record<string, …>` index signature. `undefined` values\n // are dropped by `request()`.\n return this.request('GET', BASE, { query: { ...query } });\n }\n\n /** Retrieve a single rule by ID. */\n async retrieve(id: string): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('GET', `${BASE}/${encodeURIComponent(id)}`);\n }\n\n /** Update a rule's action and/or reason. */\n async update(\n id: string,\n body: UpdateConnectorRestrictionRuleRequest,\n ): Promise<ConnectorRestrictionRuleResponse> {\n return this.request('PATCH', `${BASE}/${encodeURIComponent(id)}`, { body });\n }\n\n /** Delete a rule by ID. */\n async delete(id: string): Promise<{ id: string; deleted: boolean }> {\n return this.request('DELETE', `${BASE}/${encodeURIComponent(id)}`);\n }\n}\n","import type { ConnectorRestrictionResponse, UpsertConnectorRestrictionRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Admin-only allowlist for phased connector rollouts.\n *\n * Default-open semantics: a connector with no restriction row is\n * usable by every merchant (current behavior). A connector with a\n * row is gated — only merchants in `allowed_merchant_ids` can attach\n * a connector account. Enforced server-side at MCA-create time.\n */\nexport class ConnectorRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Idempotent upsert. If a row exists for `connector_name`, its\n * allowlist + reason are replaced. To open the connector to\n * everyone again, call `delete()`.\n */\n async upsert(body: UpsertConnectorRestrictionRequest): Promise<ConnectorRestrictionResponse> {\n return this.request('POST', '/admin/connector-restrictions', { body });\n }\n\n async list(): Promise<ConnectorRestrictionResponse[]> {\n return this.request('GET', '/admin/connector-restrictions');\n }\n\n async retrieve(connectorName: string): Promise<ConnectorRestrictionResponse> {\n return this.request(\n 'GET',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n\n /** Removing the row makes the connector public again. */\n async delete(connectorName: string): Promise<{ connector_name: string; deleted: boolean }> {\n return this.request(\n 'DELETE',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n}\n","import type {\n DiagnosticAttentionBoard,\n DiagnosticAttentionParams,\n DiagnosticChange,\n DiagnosticChangeListParams,\n DiagnosticConnectorCall,\n DiagnosticConnectorCallListParams,\n DiagnosticErrorCodeCount,\n DiagnosticFiringAlert,\n DiagnosticIncomingWebhook,\n DiagnosticIncomingWebhookDetail,\n DiagnosticIncomingWebhookListParams,\n DiagnosticInfrastructure,\n DiagnosticList,\n DiagnosticOutgoingWebhook,\n DiagnosticOutgoingWebhookListParams,\n DiagnosticOutgoingWebhookSummary,\n DiagnosticPanel,\n DiagnosticPayment,\n DiagnosticPaymentListParams,\n DiagnosticQueueItem,\n DiagnosticQueueListParams,\n DiagnosticQueueSummary,\n DiagnosticResolvedId,\n DiagnosticRevealRequest,\n DiagnosticRevealResponse,\n DiagnosticRouterLog,\n DiagnosticRouterLogParams,\n DiagnosticTrace,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * The diagnostic console — everything the router did, without a\n * shell.\n *\n * Cross-merchant by construction: one call answers across every merchant on the\n * deployment. The backend gates that on the `Diagnostic` permission, which is\n * granted to DeloPay's internal staff roles alone, which is why this lives in\n * `@delopay/sdk/internal` and never on the merchant-facing client.\n *\n * ## Two shapes worth knowing before you call anything\n *\n * **Lists answer {@link DiagnosticList}**, which carries `hidden_by_environment`\n * beside the rows. That number is what lets a UI say \"612 test-mode rows are\n * hidden\" rather than leaving an operator unable to tell an empty tab from a\n * filtered one.\n *\n * **Two reads answer {@link DiagnosticPanel} instead** — {@link routerLogs} and\n * {@link alerts} — because their sources can be down independently of the\n * router. A panel is `available` with data or `unavailable` with a reason, and\n * that distinction is the whole point: **an unreachable log store must never be\n * rendered as \"no errors found\"**, and a `T[]` gives a caller no way to tell the\n * two apart.\n *\n * ## The environment filter\n *\n * Every list takes `environment`. Omitting it is read by the backend as\n * `'live'`, never as `'all'` — a caller that forgot to say gets the safer of the\n * two, and a test payment never appears in a view that reads as live.\n */\nexport class Diagnostic {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The ranked attention board — the page's landing state, with nothing typed.\n *\n * Always carries `checks_run` and `vitals`, so an empty `items` reads as\n * \"checked these things at 14:02, all clear\" rather than as a panel that\n * failed to load. A check that could not run is **absent** from `checks_run`\n * rather than silently counted as clear.\n */\n async attention(body?: DiagnosticAttentionParams): Promise<DiagnosticAttentionBoard> {\n return this.request('POST', '/admin-portal/diagnostic/attention', { body: body ?? {} });\n }\n\n /**\n * Provider webhooks received, across every merchant.\n *\n * `source_verified: false` selects rows that failed verification **or** never\n * reached it — the deliveries that failed before verification was attempted\n * are exactly the ones an operator opens this tab for.\n */\n async listIncomingWebhooks(\n body?: DiagnosticIncomingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticIncomingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/incoming', {\n body: body ?? {},\n });\n }\n\n /**\n * One delivery in full: masked headers and body, the verification verdict,\n * and the router log lines for its request id.\n *\n * `router_logs` is `null` — not `[]` — when the log store is unreachable, and\n * `router_logs_unavailable` then says why. Render the first as *unavailable*,\n * never as \"the router logged nothing\".\n */\n async getIncomingWebhook(eventId: string): Promise<DiagnosticIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/webhooks/incoming/${encodeURIComponent(eventId)}`,\n );\n }\n\n /** Shop webhooks sent, across every merchant, with each event's attempts folded in. */\n async listOutgoingWebhooks(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticOutgoingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing', {\n body: body ?? {},\n });\n }\n\n /**\n * The four tiles above the shop-webhooks table.\n *\n * Counted under the same window and environment as the table but **without**\n * its delivery filter — the tiles say what the window holds, and applying the\n * filter would make every tile agree with whichever one is selected.\n */\n async outgoingWebhookSummary(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticOutgoingWebhookSummary> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing/summary', {\n body: body ?? {},\n });\n }\n\n /**\n * Connector calls the router made.\n *\n * List rows carry no payload. Fetch one with {@link getConnectorCall} for the\n * masked request and response.\n */\n async listConnectorCalls(\n body?: DiagnosticConnectorCallListParams,\n ): Promise<DiagnosticList<DiagnosticConnectorCall>> {\n return this.request('POST', '/admin-portal/diagnostic/connector-calls', { body: body ?? {} });\n }\n\n /** One connector call, with its masked payloads. */\n async getConnectorCall(id: string): Promise<DiagnosticConnectorCall> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/connector-calls/${encodeURIComponent(id)}`,\n );\n }\n\n /**\n * Router logs, proxied from the deployment's log store.\n *\n * Answers a {@link DiagnosticPanel}. Check `status` before reading `data`:\n * `'unavailable'` means the store did not answer, which is the opposite of\n * \"there were no errors\" and must be rendered as such.\n */\n async routerLogs(\n body?: DiagnosticRouterLogParams,\n ): Promise<DiagnosticPanel<DiagnosticList<DiagnosticRouterLog>>> {\n return this.request('POST', '/admin-portal/diagnostic/logs', { body: body ?? {} });\n }\n\n /**\n * Payments that are stuck or failed.\n *\n * Stuck means non-terminal for longer than `stuck_minutes`; failed means it\n * ended without succeeding inside the window. Omitting `stuck_minutes` turns\n * the first arm off rather than widening it.\n */\n async listPayments(\n body?: DiagnosticPaymentListParams,\n ): Promise<DiagnosticList<DiagnosticPayment>> {\n return this.request('POST', '/admin-portal/diagnostic/payments', { body: body ?? {} });\n }\n\n /**\n * The error codes in this window, each with its count in the previous window\n * of equal length.\n *\n * `previous_count: null` means the code did not appear before — render it as\n * \"new\" rather than as a fall to zero.\n */\n async paymentErrorCodes(body?: DiagnosticPaymentListParams): Promise<DiagnosticErrorCodeCount[]> {\n return this.request('POST', '/admin-portal/diagnostic/payments/error-codes', {\n body: body ?? {},\n });\n }\n\n /**\n * Everything about one payment, in one call: the payment, its attempts, its\n * status history, its client context, and what it produced — connector calls,\n * webhooks both ways, and scheduler jobs.\n *\n * Read `diagnostic_capture` before rendering an empty section. A payment with\n * no connector calls and a deployment that never recorded any are different\n * facts, and the second must not read as the first.\n *\n * Typed loosely on purpose: the payment, attempts, status-history and\n * client-context halves are the merchant-facing shapes this package already\n * exports, and re-declaring them here would give consumers two names for one\n * thing that could then drift apart.\n */\n async getPayment(paymentId: string): Promise<Record<string, unknown>> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/payments/${encodeURIComponent(paymentId)}`,\n );\n }\n\n /** Scheduler tasks, most overdue first. */\n async listQueues(body?: DiagnosticQueueListParams): Promise<DiagnosticList<DiagnosticQueueItem>> {\n return this.request('POST', '/admin-portal/diagnostic/queues', { body: body ?? {} });\n }\n\n /**\n * The four tiles above the queues table, plus the approvals count.\n *\n * `pending_approvals` is a **different** queue from `pending_count`: a stalled\n * scheduler needs a consumer, a full approvals queue needs a person, and\n * folding them into one number would point an operator at the wrong fix.\n */\n async queueSummary(): Promise<DiagnosticQueueSummary> {\n return this.request('GET', '/admin-portal/diagnostic/queues/summary');\n }\n\n /**\n * Replicas and their dependencies.\n *\n * `build_mismatch` is computed server-side rather than left for a caller to\n * notice by comparing strings: one replica in four answering differently\n * explains a whole class of \"it only fails sometimes\" incident, and is\n * invisible unless something says it out loud.\n */\n async infrastructure(): Promise<DiagnosticInfrastructure> {\n return this.request('GET', '/admin-portal/diagnostic/infrastructure');\n }\n\n /**\n * Firing alerts, proxied from Alertmanager.\n *\n * Answers a {@link DiagnosticPanel} for the same reason {@link routerLogs}\n * does: a strip that renders empty because Alertmanager is down says \"nothing\n * is firing\", which is the most dangerous sentence this page could print.\n */\n async alerts(): Promise<DiagnosticPanel<DiagnosticFiringAlert[]>> {\n return this.request('GET', '/admin-portal/diagnostic/alerts');\n }\n\n /** Config edits and admin actions inside the window. */\n async listChanges(body?: DiagnosticChangeListParams): Promise<DiagnosticList<DiagnosticChange>> {\n return this.request('POST', '/admin-portal/diagnostic/changes', { body: body ?? {} });\n }\n\n /**\n * What a pasted id is, and whether we hold it.\n *\n * `kind` and `found` are separate answers on purpose. A well-shaped id that\n * matches nothing comes back `found: false` with the three `reasons` and\n * their fixes — render that, never an empty table, which reads as \"no such\n * payment\" when the real answer is \"outside the window\" or \"it is a test\n * payment\".\n */\n async resolveId(id: string): Promise<DiagnosticResolvedId> {\n return this.request('GET', `/admin-portal/diagnostic/resolve/${encodeURIComponent(id)}`);\n }\n\n /**\n * One id across every source, as an ordered span list.\n *\n * Accepts a payment, attempt, event or request id. Sources that could not be\n * read are named in `unavailable_sources` rather than left out: a waterfall\n * with an unexplained gap reads as a period when nothing happened.\n */\n async trace(id: string): Promise<DiagnosticTrace> {\n return this.request('GET', `/admin-portal/diagnostic/trace/${encodeURIComponent(id)}`);\n }\n\n /**\n * Unmask one field of one object.\n *\n * **Writes an audit row** naming the operator, the field and the object,\n * before the value is returned — a reveal that could not be audited does not\n * happen. Needs a dashboard JWT holding `DiagnosticReveal`; an admin API key\n * cannot call it, because an API key names no person.\n *\n * `reason` is required and is stored verbatim.\n */\n async reveal(body: DiagnosticRevealRequest): Promise<DiagnosticRevealResponse> {\n return this.request('POST', '/admin-portal/diagnostic/reveal', { body });\n }\n}\n","import type { GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Gsm {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm', { body: params });\n }\n\n async retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/get', { body: params });\n }\n\n async update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/update', { body: params });\n }\n\n async delete(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/delete', { body: params });\n }\n}\n","import type {\n AdminAdjustmentRequest,\n AdminAdjustmentResponse,\n AdminCreateLedgerRequest,\n AdminCreateLedgerResponse,\n AdminResetLedgerRequest,\n AdminResetLedgerResponse,\n AdminSetFreeRequest,\n AdminSetHardFloorRequest,\n AdminSuspendRequest,\n AdminUnsuspendRequest,\n AdminSetTrustedRequest,\n UpdateLedgerEntryRequest,\n} from '../types';\nimport type { BillingProfileResponse } from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-level ledger adjustments on a merchant's balance. Admin-only\n * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only\n * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't\n * advertise the admin adjustment path in autocomplete.\n */\nexport class PlatformBilling {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Manually credit a merchant's balance (e.g. promotional credit,\n * dispute reversal, manual correction).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Credit amount and reason.\n */\n async credit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {\n body: params,\n });\n }\n\n /**\n * Manually debit a merchant's balance.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Debit amount and reason.\n */\n async debit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {\n body: params,\n });\n }\n\n /**\n * Edit a single ledger entry (amount and/or description), keeping the\n * merchant balance consistent: when `amount` changes, the balance is\n * atomically adjusted by the difference. Returns the entry id and new\n * balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to edit.\n * @param params - New amount / description (either optional).\n */\n async editLedgerEntry(\n merchantId: string,\n ledgerId: string,\n params: UpdateLedgerEntryRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'PATCH',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete a single ledger entry, reversing its amount from the merchant\n * balance. Returns the deleted entry id and the new balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to delete.\n */\n async deleteLedgerEntry(merchantId: string, ledgerId: string): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'DELETE',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n );\n }\n\n /**\n * Manually suspend a merchant (e.g. confirmed fraud or ToS violation),\n * independent of balance. A `reason` is required for audit. Throws 412 if\n * the merchant is trusted (clear the flag first) or already suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Suspension reason.\n * @returns The updated billing profile.\n */\n async suspend(merchantId: string, params: AdminSuspendRequest): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/suspend`, {\n body: params,\n });\n }\n\n /**\n * Lift a suspension. Restores the merchant to `active` (or `delinquent` if\n * the balance is at/below the hard floor) and resets the recharge-failure\n * counter. Throws 412 if the merchant is not suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional audit note.\n * @returns The updated billing profile.\n */\n async unsuspend(\n merchantId: string,\n params: AdminUnsuspendRequest = {},\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/unsuspend`, {\n body: params,\n });\n }\n\n /**\n * Set or clear the trusted (suspension-exempt) flag. Trusted merchants\n * cannot be suspended automatically or manually. Does not lift an existing\n * suspension — use {@link PlatformBilling.unsuspend} for that.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired trusted state.\n * @returns The updated billing profile.\n */\n async setTrusted(\n merchantId: string,\n params: AdminSetTrustedRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/trusted`, {\n body: params,\n });\n }\n\n /**\n * Set the merchant's hard floor — the balance at or below which the\n * merchant stops being active. A negative value grants a credit line; zero\n * means no negative balance at all. This moves the suspension line, it does\n * not remove it. The value and the caller are written to the audit log\n * before the floor changes, so the change is always attributable.\n *\n * Refused (412) for a positive amount, for a floor beyond the maximum\n * credit line of 10,000,000 minor units, or for an empty `reason`.\n *\n * Requires a router that serves the hard-floor admin route; older ones\n * answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The new floor (zero or negative) and the audit reason.\n * @returns The updated billing profile.\n */\n async setHardFloor(\n merchantId: string,\n params: AdminSetHardFloorRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/hard-floor`, {\n body: params,\n });\n }\n\n /**\n * Mark a merchant free (not billed), or put it back on the prepaid model.\n * While free, no platform fee is deducted, the payment gate never blocks on\n * billing status, top-ups are refused and auto-recharge is inert. Marking\n * free needs a `reason` and is refused (412) while an admin suspension is in\n * force — lift that first.\n *\n * Requires a router that supports the free flag; older ones answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired free state and, when marking free, the reason.\n * @returns The updated billing profile.\n */\n async setFree(merchantId: string, params: AdminSetFreeRequest): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/free`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant's **entire** ledger. Every live entry is soft-deleted —\n * kept, so a replayed fee deduction or top-up webhook still no-ops — the\n * balance is set to zero and the status re-derived (`active` for a free\n * merchant; an active paying merchant lands in `delinquent`). Refused (412)\n * while the merchant has shop allocations. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The reason, required for audit.\n * @returns What was removed and the post-reset profile.\n */\n async resetLedger(\n merchantId: string,\n params: AdminResetLedgerRequest,\n ): Promise<AdminResetLedgerResponse> {\n return this.request('DELETE', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n\n /**\n * (Re)create a merchant's ledger, optionally seeded with an opening\n * balance. Ensures the billing profile exists (created without the welcome\n * promo credit) and, when `opening_balance` is set, writes one\n * `opening_balance` entry through the same atomic helper an admin credit\n * uses. Refused (412) while live entries or a non-zero balance remain —\n * reset first. Does not clear the free flag. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Opening balance (minor units), currency for a new profile, and the reason.\n * @returns The opening entry id (if one was written) and the profile.\n */\n async createLedger(\n merchantId: string,\n params: AdminCreateLedgerRequest,\n ): Promise<AdminCreateLedgerResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n}\n","import type {\n FeeRulePreviewRequest,\n FeeRulePreviewResponse,\n FeeScheduleCreateRequest,\n FeeScheduleResponse,\n FeeScheduleUpdateRequest,\n PlatformFeeRuleInput,\n PlatformFeeRuleRecord,\n PlatformFeeRuleRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-wide fee schedule management. Admin-only routes under\n * `/admin/fees/*`. Exposed only via `'@delopay/sdk/internal'`.\n *\n * `platformFees.rules` manages the platform-owned Euclid fee-rule program per\n * merchant, which takes precedence over the flat platform schedules. Build the\n * program with `feeProgram()`.\n */\nexport class PlatformFees {\n /** Platform-owned Euclid fee-rule program (`/admin/fees/rules`). */\n readonly rules: PlatformFeeRulesManager;\n\n constructor(private readonly request: RequestFn) {\n this.rules = new PlatformFeeRulesManager(request);\n }\n\n /** Create a platform fee schedule for a specific merchant. */\n async create(params: FeeScheduleCreateRequest, merchantId: string): Promise<FeeScheduleResponse> {\n return this.request('POST', '/admin/fees', {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /** List every platform fee schedule assigned to a merchant. */\n async list(merchantId: string): Promise<FeeScheduleResponse[]> {\n return this.request('GET', '/admin/fees/list', {\n query: { merchant_id: merchantId },\n });\n }\n\n /** Retrieve a single platform fee schedule by ID. */\n async retrieve(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('GET', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n\n /** Update a platform fee schedule. */\n async update(feeId: string, params: FeeScheduleUpdateRequest): Promise<FeeScheduleResponse> {\n return this.request('PUT', `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });\n }\n\n /** Delete a platform fee schedule. */\n async delete(feeId: string): Promise<FeeScheduleResponse> {\n return this.request('DELETE', `/admin/fees/${encodeURIComponent(feeId)}`);\n }\n}\n\n/**\n * Manages a merchant's platform-owned Euclid fee-rule programs (admin surface),\n * merchant-wide or per-shop (one active program per scope; a shop-scoped\n * program wins for its shop, else the merchant-wide one applies). Build the\n * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'platform'`; set\n * `profile_id` on the input to scope a program to a shop.\n */\nexport class PlatformFeeRulesManager {\n constructor(private readonly request: RequestFn) {}\n\n /** Create or replace the platform fee-rule program for a merchant. */\n async upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord> {\n const body: PlatformFeeRuleRequest = { ...params, fee_owner: 'platform' };\n return this.request('PUT', '/admin/fees/rules', {\n body,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Retrieve the active platform fee-rule program for a scope, or `null`.\n * `profileId` omitted = merchant-wide program; set = that shop's program.\n */\n async retrieve(merchantId: string, profileId?: string): Promise<PlatformFeeRuleRecord | null> {\n return this.request('GET', '/admin/fees/rules', {\n query: { merchant_id: merchantId, profile_id: profileId },\n });\n }\n\n /**\n * Deactivate a platform fee-rule program. Idempotent. `profileId` omitted\n * targets the merchant-wide program; set targets only that shop's program.\n */\n async delete(merchantId: string, profileId?: string): Promise<void> {\n await this.request('DELETE', '/admin/fees/rules', {\n query: { merchant_id: merchantId, profile_id: profileId },\n });\n }\n\n /**\n * Dry-run a candidate fee-rule program against a sample transaction.\n * Returns the matched rule name, whether it fell through, and the computed fee.\n * Does not persist anything.\n */\n async preview(input: FeeRulePreviewRequest, merchantId: string): Promise<FeeRulePreviewResponse> {\n return this.request('POST', '/admin/fees/rules/preview', {\n body: input,\n query: { merchant_id: merchantId },\n });\n }\n}\n","import type { RequestFn } from '../../client';\nimport type {\n ApplePayVerificationCatalogue,\n ApplePayVerificationSelection,\n MerchantSettingsQuery,\n SettingsResponse,\n UpdateSettingsRequest,\n} from '../../types';\n\n/**\n * Settings as the platform operator sees them: the platform's own, and the\n * operator's values at any merchant, project or shop.\n *\n * Each setting names the admin permission group needed to change it. Every\n * change is recorded in the audit log with the previous and the new value\n * (`entity_type: 'setting'`); `auditLogs.list({ entity_type: 'setting',\n * entity_id })` is one setting's history. A merchant's own values are listed\n * (`authority: 'merchant'`) but can only be changed by the merchant.\n */\nexport class PlatformSettings {\n constructor(private readonly request: RequestFn) {}\n\n /** Provider-issued presets for this backend environment. */\n async applePayVerificationCatalogue(): Promise<ApplePayVerificationCatalogue> {\n return this.request('GET', '/payment-link/apple-pay-verification/catalogue');\n }\n\n /** Atomic, audited update. A stale revision leaves the current file unchanged. */\n async updateApplePayVerification(\n selection: ApplePayVerificationSelection,\n expectedRevision: number,\n ): Promise<SettingsResponse> {\n return this.update({\n changes: [\n {\n key: 'checkout.apple_pay_verification',\n value: selection,\n expected_revision: expectedRevision,\n },\n ],\n });\n }\n\n /** `GET /admin-portal/settings` */\n async retrieve(): Promise<SettingsResponse> {\n return this.request('GET', '/admin-portal/settings');\n }\n\n /**\n * Change platform settings. All changes are applied or none is.\n *\n * `PATCH /admin-portal/settings`\n */\n async update(params: UpdateSettingsRequest): Promise<SettingsResponse> {\n return this.request('PATCH', '/admin-portal/settings', { body: params });\n }\n\n /** `GET /admin-portal/accounts/{merchantId}/settings` */\n async retrieveMerchant(\n merchantId: string,\n query: MerchantSettingsQuery = {},\n ): Promise<SettingsResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settings`,\n {\n query: projectQuery(query),\n },\n );\n }\n\n /** `PATCH /admin-portal/accounts/{merchantId}/settings` */\n async updateMerchant(\n merchantId: string,\n params: UpdateSettingsRequest,\n query: MerchantSettingsQuery = {},\n ): Promise<SettingsResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/settings`,\n { body: params, query: projectQuery(query) },\n );\n }\n\n /** `GET /admin-portal/accounts/{merchantId}/shops/{profileId}/settings` */\n async retrieveShop(merchantId: string, profileId: string): Promise<SettingsResponse> {\n return this.request('GET', shopPath(merchantId, profileId));\n }\n\n /** `PATCH /admin-portal/accounts/{merchantId}/shops/{profileId}/settings` */\n async updateShop(\n merchantId: string,\n profileId: string,\n params: UpdateSettingsRequest,\n ): Promise<SettingsResponse> {\n return this.request('PATCH', shopPath(merchantId, profileId), { body: params });\n }\n}\n\nfunction shopPath(merchantId: string, profileId: string): string {\n return `/admin-portal/accounts/${encodeURIComponent(merchantId)}/shops/${encodeURIComponent(profileId)}/settings`;\n}\n\n/** The query string of a merchant-scope call; a null project is omitted. */\nfunction projectQuery(query: MerchantSettingsQuery): Record<string, string> {\n return query.project_id ? { project_id: query.project_id } : {};\n}\n","import type { RequestFn } from '../../client';\nimport type {\n MessageLanguage,\n MessageTemplateDetail,\n MessageTemplateLanguage,\n MessageTemplateList,\n MessageTemplatePreview,\n PreviewMessageTemplateRequest,\n ResetMessageTemplateLanguageQuery,\n SendTestMessageRequest,\n SendTestMessageResponse,\n UpdateMessageTemplateLanguageRequest,\n} from '../../types';\n\n/**\n * The texts of every message the platform sends, as the operator writes them\n * at the platform scope: dashboard and operator emails, and the platform\n * default of every buyer email. A shop's own text of a buyer email goes\n * before the platform's, and the built-in text applies where neither exists.\n *\n * Reading needs an admin login or API key; writes, resets and test sends need\n * `AccountManage`. Every change is recorded in the audit log\n * (`entity_type: 'message_template'`, `entity_id:\n * 'platform:platform:<channel>:<template_id>:<language>'`).\n */\nexport class PlatformMessageTemplates {\n constructor(private readonly request: RequestFn) {}\n\n /** `GET /admin-portal/message-templates` */\n async list(): Promise<MessageTemplateList> {\n return this.request('GET', '/admin-portal/message-templates');\n }\n\n /** `GET /admin-portal/message-templates/{template_id}` */\n async retrieve(templateId: string): Promise<MessageTemplateDetail> {\n return this.request('GET', `/admin-portal/message-templates/${encodeURIComponent(templateId)}`);\n }\n\n /**\n * Store the platform's text in one language.\n *\n * `PUT /admin-portal/message-templates/{template_id}/languages/{language}`\n */\n async updateLanguage(\n templateId: string,\n language: MessageLanguage,\n params: UpdateMessageTemplateLanguageRequest,\n ): Promise<MessageTemplateLanguage> {\n return this.request(\n 'PUT',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,\n {\n body: params,\n },\n );\n }\n\n /**\n * Remove the platform's text in one language, so the built-in text applies.\n *\n * `DELETE /admin-portal/message-templates/{template_id}/languages/{language}`\n */\n async resetLanguage(\n templateId: string,\n language: MessageLanguage,\n params: ResetMessageTemplateLanguageQuery = {},\n ): Promise<MessageTemplateLanguage> {\n return this.request(\n 'DELETE',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,\n {\n query: { expected_revision: params.expected_revision },\n },\n );\n }\n\n /** `POST /admin-portal/message-templates/{template_id}/preview` */\n async preview(\n templateId: string,\n params: PreviewMessageTemplateRequest,\n ): Promise<MessageTemplatePreview> {\n return this.request(\n 'POST',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/preview`,\n { body: params },\n );\n }\n\n /**\n * Send the template to the signed-in admin's own address.\n *\n * `POST /admin-portal/message-templates/{template_id}/test`\n */\n async sendTest(\n templateId: string,\n params: SendTestMessageRequest,\n ): Promise<SendTestMessageResponse> {\n return this.request(\n 'POST',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/test`,\n { body: params },\n );\n }\n}\n","import type { RequestExtras, RequestFn } from '../../client';\nimport type { NativeRenewalCloseResponse, NativeRenewalCloseTarget } from '../types';\n\n/** Service-authenticated renewal reconciliation. */\nexport class NativeRenewals {\n constructor(\n private readonly request: RequestFn,\n private readonly serviceKey: string,\n ) {}\n\n /** Close the previous renewal payment using the internal service key and its owner context. */\n async close(\n paymentId: string,\n target: NativeRenewalCloseTarget,\n options?: RequestExtras,\n ): Promise<NativeRenewalCloseResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/native-renewal-close`, {\n ...options,\n headers: {\n ...options?.headers,\n 'X-Internal-API-Key': this.serviceKey,\n 'X-Merchant-Id': target.merchant_id,\n 'X-Profile-Id': target.profile_id,\n },\n });\n }\n}\n","import type { RequestFn } from '../client';\nimport { Delopay } from '../client';\nimport { Admin } from './resources/admin';\nimport { AdminPortal } from './resources/adminPortal';\nimport { AuditLogs } from './resources/auditLogs';\nimport { Cache } from './resources/cache';\nimport { CardIssuers } from './resources/cardIssuers';\nimport { Configs } from './resources/configs';\nimport { ConnectorRestrictionRules } from './resources/connectorRestrictionRules';\nimport { ConnectorRestrictions } from './resources/connectorRestrictions';\nimport { Diagnostic } from './resources/diagnostic';\nimport { Gsm } from './resources/gsm';\nimport { PlatformBilling } from './resources/platformBilling';\nimport { PlatformFees } from './resources/platformFees';\nimport { PlatformSettings } from './resources/platformSettings';\nimport { PlatformMessageTemplates } from './resources/platformMessageTemplates';\nimport { NativeRenewals } from './resources/nativeRenewals';\n\n/**\n * Internal-only Delopay client for DeloPay staff tooling (the admin\n * control-center, audit UIs, etc.). Extends the public `Delopay` surface\n * with admin-plane resources that must **not** be discoverable from the\n * merchant-facing package entry.\n *\n * Import path: `import { DelopayInternal } from '@delopay/sdk/internal'`.\n * The merchant-facing `import { Delopay } from '@delopay/sdk'` never\n * surfaces these.\n */\nexport class DelopayInternal extends Delopay {\n /** Bootstrap admin endpoints — signup, signin, onboarding. */\n readonly admin: Admin;\n /** Platform-wide customer, transaction, analytics, merchant-account ops. */\n readonly adminPortal: AdminPortal;\n /** Audit log reads. */\n readonly auditLogs: AuditLogs;\n /** Backend cache invalidation. */\n readonly cache: Cache;\n /** Platform card-issuer program management. */\n readonly cardIssuers: CardIssuers;\n /** Generic platform config store. */\n readonly configs: Configs;\n /** Per-merchant connector allowlist for phased rollouts. */\n readonly connectorRestrictions: ConnectorRestrictions;\n /** Per-shop / per-project connector allow-deny rules (routing-time). */\n readonly connectorRestrictionRules: ConnectorRestrictionRules;\n /**\n * The diagnostic console — everything the router did, without a shell.\n * Cross-merchant, and gated on the staff-only `Diagnostic` permission.\n */\n readonly diagnostic: Diagnostic;\n /** GSM (Gateway Status Mapping) routing rules. */\n readonly gsm: Gsm;\n /** Admin-only ledger credits/debits against a merchant's balance. */\n readonly platformBilling: PlatformBilling;\n /** Platform-wide fee schedules assigned to merchants. */\n readonly platformFees: PlatformFees;\n /** Platform, merchant and shop settings as the operator sees them. */\n readonly platformSettings: PlatformSettings;\n /** The platform's texts of every message it sends. */\n readonly platformMessageTemplates: PlatformMessageTemplates;\n /** Uses the constructor credential as an internal service key for renewal reconciliation. */\n readonly nativeRenewals: NativeRenewals;\n\n constructor(...args: ConstructorParameters<typeof Delopay>) {\n super(...args);\n const request = this.request.bind(this) as RequestFn;\n this.admin = new Admin(request);\n this.adminPortal = new AdminPortal(request);\n this.auditLogs = new AuditLogs(request);\n this.cache = new Cache(request);\n this.cardIssuers = new CardIssuers(request);\n this.configs = new Configs(request);\n this.connectorRestrictions = new ConnectorRestrictions(request);\n this.connectorRestrictionRules = new ConnectorRestrictionRules(request);\n this.diagnostic = new Diagnostic(request);\n this.gsm = new Gsm(request);\n this.platformBilling = new PlatformBilling(request);\n this.platformFees = new PlatformFees(request);\n this.platformSettings = new PlatformSettings(request);\n this.platformMessageTemplates = new PlatformMessageTemplates(request);\n this.nativeRenewals = new NativeRenewals(request, args[0] ?? '');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,I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