@djangocfg/api 1.0.1
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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/index.cjs +28422 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +31214 -0
- package/dist/index.d.ts +31214 -0
- package/dist/index.mjs +28334 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +83 -0
- package/src/cfg/BaseClient.ts +56 -0
- package/src/cfg/contexts/AccountsContext.tsx +205 -0
- package/src/cfg/contexts/LeadsContext.tsx +145 -0
- package/src/cfg/contexts/NewsletterContext.tsx +244 -0
- package/src/cfg/contexts/SupportContext.tsx +256 -0
- package/src/cfg/contexts/index.ts +48 -0
- package/src/cfg/contexts/knowbase/ChatContext.tsx +174 -0
- package/src/cfg/contexts/knowbase/DocumentsContext.tsx +304 -0
- package/src/cfg/contexts/knowbase/SessionsContext.tsx +174 -0
- package/src/cfg/contexts/knowbase/index.ts +58 -0
- package/src/cfg/contexts/payments/ApiKeysContext.tsx +115 -0
- package/src/cfg/contexts/payments/BalancesContext.tsx +118 -0
- package/src/cfg/contexts/payments/CurrenciesContext.tsx +105 -0
- package/src/cfg/contexts/payments/OverviewContext.tsx +141 -0
- package/src/cfg/contexts/payments/PaymentsContext.tsx +131 -0
- package/src/cfg/contexts/payments/README.md +201 -0
- package/src/cfg/contexts/payments/index.ts +65 -0
- package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +66 -0
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +50 -0
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +121 -0
- package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +49 -0
- package/src/cfg/generated/_utils/fetchers/cfg__health.ts +64 -0
- package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +122 -0
- package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +50 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +81 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +50 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +123 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +49 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +64 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +81 -0
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +50 -0
- package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +2489 -0
- package/src/cfg/generated/_utils/fetchers/cfg__payments__webhooks.ts +109 -0
- package/src/cfg/generated/_utils/fetchers/cfg__support.ts +212 -0
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +182 -0
- package/src/cfg/generated/_utils/fetchers/index.ts +45 -0
- package/src/cfg/generated/_utils/hooks/cfg__accounts.ts +61 -0
- package/src/cfg/generated/_utils/hooks/cfg__accounts__auth.ts +41 -0
- package/src/cfg/generated/_utils/hooks/cfg__accounts__user_profile.ts +128 -0
- package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +36 -0
- package/src/cfg/generated/_utils/hooks/cfg__health.ts +51 -0
- package/src/cfg/generated/_utils/hooks/cfg__leads.ts +127 -0
- package/src/cfg/generated/_utils/hooks/cfg__leads__lead_submission.ts +41 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter.ts +80 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__bulk_email.ts +41 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__campaigns.ts +128 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__logs.ts +36 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__newsletters.ts +51 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__subscriptions.ts +76 -0
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__testing.ts +41 -0
- package/src/cfg/generated/_utils/hooks/cfg__payments.ts +2716 -0
- package/src/cfg/generated/_utils/hooks/cfg__payments__webhooks.ts +100 -0
- package/src/cfg/generated/_utils/hooks/cfg__support.ts +235 -0
- package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +193 -0
- package/src/cfg/generated/_utils/hooks/index.ts +43 -0
- package/src/cfg/generated/_utils/schemas/APIKeyCreate.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/APIKeyCreateRequest.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/APIKeyDetail.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/APIKeyList.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/APIKeyUpdate.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/APIKeyUpdateRequest.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/APIKeyValidationRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/APIKeyValidationResponse.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/APIKeysOverview.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/APIResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/APIResponseRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentCreate.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentCreateRequest.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentDetail.schema.ts +50 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentList.schema.ts +38 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentStats.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentUpdate.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/AdminPaymentUpdateRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/AdminUser.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/BalanceOverview.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/BulkEmailRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/BulkEmailResponse.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/ChartDataPoint.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ChartSeries.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/Currency.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/CurrencyAnalyticsItem.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/CurrencyList.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/EmailLog.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/Endpoint.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/EndpointGroup.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/EndpointsStatus.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/ErrorResponse.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/HealthCheck.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/LeadSubmission.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/LeadSubmissionError.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/LeadSubmissionRequest.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/LeadSubmissionResponse.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/Message.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/MessageCreate.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/MessageCreateRequest.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/MessageRequest.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/Network.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/Newsletter.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/NewsletterCampaign.schema.ts +33 -0
- package/src/cfg/generated/_utils/schemas/NewsletterCampaignRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/NewsletterSubscription.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/OTPErrorResponse.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/OTPRequestRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/OTPRequestResponse.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/OTPVerifyRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/OTPVerifyResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/PaginatedAPIKeyListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedAdminPaymentListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedAdminPaymentStatsList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedAdminUserList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedCurrencyListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedEmailLogList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedEndpointGroupList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedLeadSubmissionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedMessageList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedNetworkList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedNewsletterCampaignList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedNewsletterList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedNewsletterSubscriptionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedPaymentListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedProviderCurrencyList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedRecentPaymentList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedRecentTransactionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedSubscriptionListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedTariffList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedTicketList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedTransactionList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedUserBalanceList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedWebhookEventListList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedWebhookStatsList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PatchedAPIKeyUpdateRequest.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PatchedAdminPaymentUpdateRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/PatchedLeadSubmissionRequest.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/PatchedMessageRequest.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/PatchedNewsletterCampaignRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PatchedPaymentRequest.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/PatchedSubscriptionRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PatchedTicketRequest.schema.ts +18 -0
- package/src/cfg/generated/_utils/schemas/PatchedUnsubscribeRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/Payment.schema.ts +48 -0
- package/src/cfg/generated/_utils/schemas/PaymentAnalyticsResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/PaymentCreate.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/PaymentCreateRequest.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/PaymentList.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/PaymentOverview.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/PaymentRequest.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/PaymentsChartResponse.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaymentsDashboardOverview.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PaymentsMetrics.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/ProviderAnalyticsItem.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ProviderCurrency.schema.ts +36 -0
- package/src/cfg/generated/_utils/schemas/QueueAction.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/QueueActionRequest.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/QueueStatus.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/QuickHealth.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/RecentPayment.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/RecentTransaction.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/SendCampaignRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/SendCampaignResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/Sender.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/SubscribeRequest.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/SubscribeResponse.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/Subscription.schema.ts +41 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionCreate.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionCreateRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionList.schema.ts +32 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionOverview.schema.ts +37 -0
- package/src/cfg/generated/_utils/schemas/SubscriptionRequest.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/SuccessResponse.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/SupportedProviders.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/Tariff.schema.ts +34 -0
- package/src/cfg/generated/_utils/schemas/TaskStatistics.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/TestEmailRequest.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/Ticket.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/TicketRequest.schema.ts +18 -0
- package/src/cfg/generated/_utils/schemas/TokenRefresh.schema.ts +16 -0
- package/src/cfg/generated/_utils/schemas/TokenRefreshRequest.schema.ts +15 -0
- package/src/cfg/generated/_utils/schemas/Transaction.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/Unsubscribe.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/UnsubscribeRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/User.schema.ts +34 -0
- package/src/cfg/generated/_utils/schemas/UserBalance.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/UserProfileUpdateRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/WebhookEvent.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/WebhookEventList.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/WebhookEventListRequest.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/WebhookEventRequest.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/WebhookHealth.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/WebhookProviderStats.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/WebhookProviderStatsRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/WebhookResponse.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/WebhookResponseRequest.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/WebhookStats.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/WebhookStatsRequest.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/WorkerAction.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/WorkerActionRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/index.ts +160 -0
- package/src/cfg/generated/api-instance.ts +131 -0
- package/src/cfg/generated/cfg__accounts/client.ts +30 -0
- package/src/cfg/generated/cfg__accounts/index.ts +2 -0
- package/src/cfg/generated/cfg__accounts/models.ts +100 -0
- package/src/cfg/generated/cfg__accounts__auth/client.ts +22 -0
- package/src/cfg/generated/cfg__accounts__auth/index.ts +2 -0
- package/src/cfg/generated/cfg__accounts__auth/models.ts +17 -0
- package/src/cfg/generated/cfg__accounts__user_profile/client.ts +77 -0
- package/src/cfg/generated/cfg__accounts__user_profile/index.ts +2 -0
- package/src/cfg/generated/cfg__accounts__user_profile/models.ts +56 -0
- package/src/cfg/generated/cfg__endpoints/client.ts +22 -0
- package/src/cfg/generated/cfg__endpoints/index.ts +2 -0
- package/src/cfg/generated/cfg__endpoints/models.ts +68 -0
- package/src/cfg/generated/cfg__health/client.ts +30 -0
- package/src/cfg/generated/cfg__health/index.ts +2 -0
- package/src/cfg/generated/cfg__health/models.ts +34 -0
- package/src/cfg/generated/cfg__leads/client.ts +79 -0
- package/src/cfg/generated/cfg__leads/index.ts +2 -0
- package/src/cfg/generated/cfg__leads/models.ts +99 -0
- package/src/cfg/generated/cfg__leads__lead_submission/client.ts +25 -0
- package/src/cfg/generated/cfg__leads__lead_submission/index.ts +2 -0
- package/src/cfg/generated/cfg__leads__lead_submission/models.ts +48 -0
- package/src/cfg/generated/cfg__newsletter/client.ts +38 -0
- package/src/cfg/generated/cfg__newsletter/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter/models.ts +71 -0
- package/src/cfg/generated/cfg__newsletter__bulk_email/client.ts +24 -0
- package/src/cfg/generated/cfg__newsletter__bulk_email/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__bulk_email/models.ts +29 -0
- package/src/cfg/generated/cfg__newsletter__campaigns/client.ts +85 -0
- package/src/cfg/generated/cfg__newsletter__campaigns/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__campaigns/models.ts +100 -0
- package/src/cfg/generated/cfg__newsletter__logs/client.ts +35 -0
- package/src/cfg/generated/cfg__newsletter__logs/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__logs/models.ts +51 -0
- package/src/cfg/generated/cfg__newsletter__newsletters/client.ts +45 -0
- package/src/cfg/generated/cfg__newsletter__newsletters/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__newsletters/models.ts +42 -0
- package/src/cfg/generated/cfg__newsletter__subscriptions/client.ts +55 -0
- package/src/cfg/generated/cfg__newsletter__subscriptions/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__subscriptions/models.ts +92 -0
- package/src/cfg/generated/cfg__newsletter__testing/client.ts +24 -0
- package/src/cfg/generated/cfg__newsletter__testing/index.ts +2 -0
- package/src/cfg/generated/cfg__newsletter__testing/models.ts +24 -0
- package/src/cfg/generated/cfg__payments/client.ts +1814 -0
- package/src/cfg/generated/cfg__payments/index.ts +2 -0
- package/src/cfg/generated/cfg__payments/models.ts +1855 -0
- package/src/cfg/generated/cfg__payments__webhooks/client.ts +75 -0
- package/src/cfg/generated/cfg__payments__webhooks/index.ts +2 -0
- package/src/cfg/generated/cfg__payments__webhooks/models.ts +87 -0
- package/src/cfg/generated/cfg__support/client.ts +133 -0
- package/src/cfg/generated/cfg__support/index.ts +2 -0
- package/src/cfg/generated/cfg__support/models.ts +165 -0
- package/src/cfg/generated/cfg__tasks/client.ts +94 -0
- package/src/cfg/generated/cfg__tasks/index.ts +2 -0
- package/src/cfg/generated/cfg__tasks/models.ts +140 -0
- package/src/cfg/generated/client.ts +302 -0
- package/src/cfg/generated/enums.ts +608 -0
- package/src/cfg/generated/errors.ts +116 -0
- package/src/cfg/generated/http.ts +98 -0
- package/src/cfg/generated/index.ts +299 -0
- package/src/cfg/generated/logger.ts +259 -0
- package/src/cfg/generated/package.json +39 -0
- package/src/cfg/generated/retry.ts +175 -0
- package/src/cfg/generated/schema.ts +18399 -0
- package/src/cfg/generated/storage.ts +158 -0
- package/src/cfg/generated/tsconfig.json +20 -0
- package/src/cfg/services/auth/AuthService.ts +165 -0
- package/src/cfg/services/auth/index.ts +7 -0
- package/src/cfg/services/index.ts +31 -0
- package/src/cfg/services/leads/LeadsService.ts +133 -0
- package/src/cfg/services/leads/index.ts +7 -0
- package/src/cfg/services/newsletter/BulkEmailService.ts +35 -0
- package/src/cfg/services/newsletter/CampaignsService.ts +138 -0
- package/src/cfg/services/newsletter/NewsletterService.ts +79 -0
- package/src/cfg/services/newsletter/NewslettersListService.ts +48 -0
- package/src/cfg/services/newsletter/index.ts +10 -0
- package/src/cfg/services/payments/ApiKeysService.ts +183 -0
- package/src/cfg/services/payments/DashboardService.ts +197 -0
- package/src/cfg/services/payments/PaymentsService.ts +192 -0
- package/src/cfg/services/payments/SubscriptionsService.ts +202 -0
- package/src/cfg/services/payments/index.ts +10 -0
- package/src/cfg/services/support/SupportService.ts +142 -0
- package/src/cfg/services/support/index.ts +7 -0
- package/src/cfg/services/tasks/TasksService.ts +170 -0
- package/src/cfg/services/tasks/index.ts +7 -0
- package/src/cfg/services/webhooks/WebhooksService.ts +108 -0
- package/src/cfg/services/webhooks/index.ts +7 -0
- package/src/index.ts +35 -0
|
@@ -0,0 +1,1855 @@
|
|
|
1
|
+
import * as Enums from "../enums";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* Response model (includes read-only fields).
|
|
6
|
+
*/
|
|
7
|
+
export interface PaginatedAdminPaymentListList {
|
|
8
|
+
/** Total number of items across all pages */
|
|
9
|
+
count: number;
|
|
10
|
+
/** Current page number (1-based) */
|
|
11
|
+
page: number;
|
|
12
|
+
/** Total number of pages */
|
|
13
|
+
pages: number;
|
|
14
|
+
/** Number of items per page */
|
|
15
|
+
page_size: number;
|
|
16
|
+
/** Whether there is a next page */
|
|
17
|
+
has_next: boolean;
|
|
18
|
+
/** Whether there is a previous page */
|
|
19
|
+
has_previous: boolean;
|
|
20
|
+
/** Next page number (null if no next page) */
|
|
21
|
+
next_page?: number | null;
|
|
22
|
+
/** Previous page number (null if no previous page) */
|
|
23
|
+
previous_page?: number | null;
|
|
24
|
+
/** Array of items for current page */
|
|
25
|
+
results: Array<AdminPaymentList>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Serializer for creating payments in admin interface. Uses UniversalPayment
|
|
30
|
+
* only for data creation.
|
|
31
|
+
*
|
|
32
|
+
* Request model (no read-only fields).
|
|
33
|
+
*/
|
|
34
|
+
export interface AdminPaymentCreateRequest {
|
|
35
|
+
user: number;
|
|
36
|
+
amount_usd: number;
|
|
37
|
+
/** Provider currency code (e.g., BTC, ZROERC20) */
|
|
38
|
+
currency_code: string;
|
|
39
|
+
provider: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
callback_url?: string;
|
|
42
|
+
cancel_url?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Serializer for creating payments in admin interface. Uses UniversalPayment
|
|
47
|
+
* only for data creation.
|
|
48
|
+
*
|
|
49
|
+
* Response model (includes read-only fields).
|
|
50
|
+
*/
|
|
51
|
+
export interface AdminPaymentCreate {
|
|
52
|
+
user: number;
|
|
53
|
+
amount_usd: number;
|
|
54
|
+
provider: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
callback_url?: string;
|
|
57
|
+
cancel_url?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Detailed serializer for individual payment in admin interface. Uses
|
|
62
|
+
* UniversalPayment only for data extraction.
|
|
63
|
+
*
|
|
64
|
+
* Response model (includes read-only fields).
|
|
65
|
+
*/
|
|
66
|
+
export interface AdminPaymentDetail {
|
|
67
|
+
id: string;
|
|
68
|
+
user: Record<string, any>;
|
|
69
|
+
internal_payment_id: string;
|
|
70
|
+
amount_usd: number;
|
|
71
|
+
actual_amount_usd: number;
|
|
72
|
+
fee_amount_usd: number;
|
|
73
|
+
currency_code: string;
|
|
74
|
+
currency_name: string;
|
|
75
|
+
provider: string;
|
|
76
|
+
provider_display: string;
|
|
77
|
+
status: string;
|
|
78
|
+
status_display: string;
|
|
79
|
+
pay_amount: string;
|
|
80
|
+
pay_address: string;
|
|
81
|
+
payment_url: string;
|
|
82
|
+
transaction_hash: string;
|
|
83
|
+
confirmations_count: number;
|
|
84
|
+
security_nonce: string;
|
|
85
|
+
expires_at: string;
|
|
86
|
+
completed_at: string;
|
|
87
|
+
status_changed_at: string;
|
|
88
|
+
description: string;
|
|
89
|
+
callback_url: string;
|
|
90
|
+
cancel_url: string;
|
|
91
|
+
provider_data: string;
|
|
92
|
+
webhook_data: string;
|
|
93
|
+
created_at: string;
|
|
94
|
+
updated_at: string;
|
|
95
|
+
age: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Serializer for updating payments in admin interface.
|
|
100
|
+
*
|
|
101
|
+
* Request model (no read-only fields).
|
|
102
|
+
*/
|
|
103
|
+
export interface AdminPaymentUpdateRequest {
|
|
104
|
+
/** Current payment status
|
|
105
|
+
|
|
106
|
+
* `pending` - Pending
|
|
107
|
+
* `confirming` - Confirming
|
|
108
|
+
* `confirmed` - Confirmed
|
|
109
|
+
* `completed` - Completed
|
|
110
|
+
* `failed` - Failed
|
|
111
|
+
* `expired` - Expired
|
|
112
|
+
* `cancelled` - Cancelled
|
|
113
|
+
* `refunded` - Refunded */
|
|
114
|
+
status?: Enums.AdminPaymentUpdateRequestStatus;
|
|
115
|
+
/** Payment description */
|
|
116
|
+
description?: string;
|
|
117
|
+
/** Success callback URL */
|
|
118
|
+
callback_url?: string | null;
|
|
119
|
+
/** Cancellation URL */
|
|
120
|
+
cancel_url?: string | null;
|
|
121
|
+
/** Provider-specific data (validated by Pydantic) */
|
|
122
|
+
provider_data?: string;
|
|
123
|
+
/** Webhook data (validated by Pydantic) */
|
|
124
|
+
webhook_data?: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Serializer for updating payments in admin interface.
|
|
129
|
+
*
|
|
130
|
+
* Response model (includes read-only fields).
|
|
131
|
+
*/
|
|
132
|
+
export interface AdminPaymentUpdate {
|
|
133
|
+
/** Current payment status
|
|
134
|
+
|
|
135
|
+
* `pending` - Pending
|
|
136
|
+
* `confirming` - Confirming
|
|
137
|
+
* `confirmed` - Confirmed
|
|
138
|
+
* `completed` - Completed
|
|
139
|
+
* `failed` - Failed
|
|
140
|
+
* `expired` - Expired
|
|
141
|
+
* `cancelled` - Cancelled
|
|
142
|
+
* `refunded` - Refunded */
|
|
143
|
+
status?: Enums.AdminPaymentUpdateStatus;
|
|
144
|
+
/** Payment description */
|
|
145
|
+
description?: string;
|
|
146
|
+
/** Success callback URL */
|
|
147
|
+
callback_url?: string | null;
|
|
148
|
+
/** Cancellation URL */
|
|
149
|
+
cancel_url?: string | null;
|
|
150
|
+
/** Provider-specific data (validated by Pydantic) */
|
|
151
|
+
provider_data?: string;
|
|
152
|
+
/** Webhook data (validated by Pydantic) */
|
|
153
|
+
webhook_data?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Serializer for updating payments in admin interface.
|
|
158
|
+
*
|
|
159
|
+
* Request model (no read-only fields).
|
|
160
|
+
*/
|
|
161
|
+
export interface PatchedAdminPaymentUpdateRequest {
|
|
162
|
+
/** Current payment status
|
|
163
|
+
|
|
164
|
+
* `pending` - Pending
|
|
165
|
+
* `confirming` - Confirming
|
|
166
|
+
* `confirmed` - Confirmed
|
|
167
|
+
* `completed` - Completed
|
|
168
|
+
* `failed` - Failed
|
|
169
|
+
* `expired` - Expired
|
|
170
|
+
* `cancelled` - Cancelled
|
|
171
|
+
* `refunded` - Refunded */
|
|
172
|
+
status?: Enums.PatchedAdminPaymentUpdateRequestStatus;
|
|
173
|
+
/** Payment description */
|
|
174
|
+
description?: string;
|
|
175
|
+
/** Success callback URL */
|
|
176
|
+
callback_url?: string | null;
|
|
177
|
+
/** Cancellation URL */
|
|
178
|
+
cancel_url?: string | null;
|
|
179
|
+
/** Provider-specific data (validated by Pydantic) */
|
|
180
|
+
provider_data?: string;
|
|
181
|
+
/** Webhook data (validated by Pydantic) */
|
|
182
|
+
webhook_data?: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Serializer for payment statistics in admin interface.
|
|
187
|
+
*
|
|
188
|
+
* Response model (includes read-only fields).
|
|
189
|
+
*/
|
|
190
|
+
export interface AdminPaymentStats {
|
|
191
|
+
total_payments: number;
|
|
192
|
+
total_amount_usd: number;
|
|
193
|
+
successful_payments: number;
|
|
194
|
+
failed_payments: number;
|
|
195
|
+
pending_payments: number;
|
|
196
|
+
success_rate: number;
|
|
197
|
+
/** Statistics by provider */
|
|
198
|
+
by_provider: Record<string, any>;
|
|
199
|
+
/** Statistics by currency */
|
|
200
|
+
by_currency: Record<string, any>;
|
|
201
|
+
/** Payments in last 24 hours */
|
|
202
|
+
last_24h: Record<string, any>;
|
|
203
|
+
/** Payments in last 7 days */
|
|
204
|
+
last_7d: Record<string, any>;
|
|
205
|
+
/** Payments in last 30 days */
|
|
206
|
+
last_30d: Record<string, any>;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
*
|
|
211
|
+
* Response model (includes read-only fields).
|
|
212
|
+
*/
|
|
213
|
+
export interface PaginatedAdminPaymentStatsList {
|
|
214
|
+
/** Total number of items across all pages */
|
|
215
|
+
count: number;
|
|
216
|
+
/** Current page number (1-based) */
|
|
217
|
+
page: number;
|
|
218
|
+
/** Total number of pages */
|
|
219
|
+
pages: number;
|
|
220
|
+
/** Number of items per page */
|
|
221
|
+
page_size: number;
|
|
222
|
+
/** Whether there is a next page */
|
|
223
|
+
has_next: boolean;
|
|
224
|
+
/** Whether there is a previous page */
|
|
225
|
+
has_previous: boolean;
|
|
226
|
+
/** Next page number (null if no next page) */
|
|
227
|
+
next_page?: number | null;
|
|
228
|
+
/** Previous page number (null if no previous page) */
|
|
229
|
+
previous_page?: number | null;
|
|
230
|
+
/** Array of items for current page */
|
|
231
|
+
results: Array<AdminPaymentStats>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
*
|
|
236
|
+
* Response model (includes read-only fields).
|
|
237
|
+
*/
|
|
238
|
+
export interface PaginatedAdminUserList {
|
|
239
|
+
/** Total number of items across all pages */
|
|
240
|
+
count: number;
|
|
241
|
+
/** Current page number (1-based) */
|
|
242
|
+
page: number;
|
|
243
|
+
/** Total number of pages */
|
|
244
|
+
pages: number;
|
|
245
|
+
/** Number of items per page */
|
|
246
|
+
page_size: number;
|
|
247
|
+
/** Whether there is a next page */
|
|
248
|
+
has_next: boolean;
|
|
249
|
+
/** Whether there is a previous page */
|
|
250
|
+
has_previous: boolean;
|
|
251
|
+
/** Next page number (null if no next page) */
|
|
252
|
+
next_page?: number | null;
|
|
253
|
+
/** Previous page number (null if no previous page) */
|
|
254
|
+
previous_page?: number | null;
|
|
255
|
+
/** Array of items for current page */
|
|
256
|
+
results: Array<AdminUser>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Simplified user serializer for admin interface.
|
|
261
|
+
*
|
|
262
|
+
* Response model (includes read-only fields).
|
|
263
|
+
*/
|
|
264
|
+
export interface AdminUser {
|
|
265
|
+
id: number;
|
|
266
|
+
/** Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. */
|
|
267
|
+
username: string;
|
|
268
|
+
email: string;
|
|
269
|
+
first_name: string;
|
|
270
|
+
last_name: string;
|
|
271
|
+
/** Designates whether this user should be treated as active. Unselect this instead of deleting accounts. */
|
|
272
|
+
is_active: boolean;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Serializer for comprehensive webhook statistics.
|
|
277
|
+
*
|
|
278
|
+
* Request model (no read-only fields).
|
|
279
|
+
*/
|
|
280
|
+
export interface WebhookStatsRequest {
|
|
281
|
+
total: number;
|
|
282
|
+
successful: number;
|
|
283
|
+
failed: number;
|
|
284
|
+
pending: number;
|
|
285
|
+
success_rate: number;
|
|
286
|
+
/** Statistics by provider */
|
|
287
|
+
providers: Record<string, any>;
|
|
288
|
+
/** Events in last 24 hours */
|
|
289
|
+
last_24h: Record<string, any>;
|
|
290
|
+
avg_response_time: number;
|
|
291
|
+
max_response_time: number;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Serializer for comprehensive webhook statistics.
|
|
296
|
+
*
|
|
297
|
+
* Response model (includes read-only fields).
|
|
298
|
+
*/
|
|
299
|
+
export interface WebhookStats {
|
|
300
|
+
total: number;
|
|
301
|
+
successful: number;
|
|
302
|
+
failed: number;
|
|
303
|
+
pending: number;
|
|
304
|
+
success_rate: number;
|
|
305
|
+
/** Statistics by provider */
|
|
306
|
+
providers: Record<string, any>;
|
|
307
|
+
/** Events in last 24 hours */
|
|
308
|
+
last_24h: Record<string, any>;
|
|
309
|
+
avg_response_time: number;
|
|
310
|
+
max_response_time: number;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
*
|
|
315
|
+
* Response model (includes read-only fields).
|
|
316
|
+
*/
|
|
317
|
+
export interface PaginatedWebhookStatsList {
|
|
318
|
+
/** Total number of items across all pages */
|
|
319
|
+
count: number;
|
|
320
|
+
/** Current page number (1-based) */
|
|
321
|
+
page: number;
|
|
322
|
+
/** Total number of pages */
|
|
323
|
+
pages: number;
|
|
324
|
+
/** Number of items per page */
|
|
325
|
+
page_size: number;
|
|
326
|
+
/** Whether there is a next page */
|
|
327
|
+
has_next: boolean;
|
|
328
|
+
/** Whether there is a previous page */
|
|
329
|
+
has_previous: boolean;
|
|
330
|
+
/** Next page number (null if no next page) */
|
|
331
|
+
next_page?: number | null;
|
|
332
|
+
/** Previous page number (null if no previous page) */
|
|
333
|
+
previous_page?: number | null;
|
|
334
|
+
/** Array of items for current page */
|
|
335
|
+
results: Array<WebhookStats>;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
*
|
|
340
|
+
* Response model (includes read-only fields).
|
|
341
|
+
*/
|
|
342
|
+
export interface PaginatedWebhookEventListList {
|
|
343
|
+
/** Total number of items across all pages */
|
|
344
|
+
count: number;
|
|
345
|
+
/** Current page number (1-based) */
|
|
346
|
+
page: number;
|
|
347
|
+
/** Total number of pages */
|
|
348
|
+
pages: number;
|
|
349
|
+
/** Number of items per page */
|
|
350
|
+
page_size: number;
|
|
351
|
+
/** Whether there is a next page */
|
|
352
|
+
has_next: boolean;
|
|
353
|
+
/** Whether there is a previous page */
|
|
354
|
+
has_previous: boolean;
|
|
355
|
+
/** Next page number (null if no next page) */
|
|
356
|
+
next_page?: number | null;
|
|
357
|
+
/** Previous page number (null if no previous page) */
|
|
358
|
+
previous_page?: number | null;
|
|
359
|
+
/** Array of items for current page */
|
|
360
|
+
results: Array<WebhookEventList>;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Serializer for paginated webhook events list.
|
|
365
|
+
*
|
|
366
|
+
* Response model (includes read-only fields).
|
|
367
|
+
*/
|
|
368
|
+
export interface WebhookEventList {
|
|
369
|
+
events: Array<WebhookEvent>;
|
|
370
|
+
total: number;
|
|
371
|
+
page: number;
|
|
372
|
+
per_page: number;
|
|
373
|
+
has_next: boolean;
|
|
374
|
+
has_previous: boolean;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Serializer for paginated webhook events list.
|
|
379
|
+
*
|
|
380
|
+
* Request model (no read-only fields).
|
|
381
|
+
*/
|
|
382
|
+
export interface WebhookEventListRequest {
|
|
383
|
+
events: Array<WebhookEventRequest>;
|
|
384
|
+
total: number;
|
|
385
|
+
page: number;
|
|
386
|
+
per_page: number;
|
|
387
|
+
has_next: boolean;
|
|
388
|
+
has_previous: boolean;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
*
|
|
393
|
+
* Response model (includes read-only fields).
|
|
394
|
+
*/
|
|
395
|
+
export interface PaginatedAPIKeyListList {
|
|
396
|
+
/** Total number of items across all pages */
|
|
397
|
+
count: number;
|
|
398
|
+
/** Current page number (1-based) */
|
|
399
|
+
page: number;
|
|
400
|
+
/** Total number of pages */
|
|
401
|
+
pages: number;
|
|
402
|
+
/** Number of items per page */
|
|
403
|
+
page_size: number;
|
|
404
|
+
/** Whether there is a next page */
|
|
405
|
+
has_next: boolean;
|
|
406
|
+
/** Whether there is a previous page */
|
|
407
|
+
has_previous: boolean;
|
|
408
|
+
/** Next page number (null if no next page) */
|
|
409
|
+
next_page?: number | null;
|
|
410
|
+
/** Previous page number (null if no previous page) */
|
|
411
|
+
previous_page?: number | null;
|
|
412
|
+
/** Array of items for current page */
|
|
413
|
+
results: Array<APIKeyList>;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* API key creation serializer with service integration. Creates new API keys
|
|
418
|
+
* and returns the full key value (only once).
|
|
419
|
+
*
|
|
420
|
+
* Request model (no read-only fields).
|
|
421
|
+
*/
|
|
422
|
+
export interface APIKeyCreateRequest {
|
|
423
|
+
/** Descriptive name for the API key */
|
|
424
|
+
name: string;
|
|
425
|
+
/** Expiration in days (optional, null for no expiration) */
|
|
426
|
+
expires_in_days?: number | null;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* API key creation serializer with service integration. Creates new API keys
|
|
431
|
+
* and returns the full key value (only once).
|
|
432
|
+
*
|
|
433
|
+
* Response model (includes read-only fields).
|
|
434
|
+
*/
|
|
435
|
+
export interface APIKeyCreate {
|
|
436
|
+
/** Descriptive name for the API key */
|
|
437
|
+
name: string;
|
|
438
|
+
/** Expiration in days (optional, null for no expiration) */
|
|
439
|
+
expires_in_days?: number | null;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Complete API key serializer with full details. Used for API key detail views
|
|
444
|
+
* (no key value for security).
|
|
445
|
+
*
|
|
446
|
+
* Response model (includes read-only fields).
|
|
447
|
+
*/
|
|
448
|
+
export interface APIKeyDetail {
|
|
449
|
+
/** Unique identifier for this record */
|
|
450
|
+
id: string;
|
|
451
|
+
user: string;
|
|
452
|
+
/** Human-readable name for this API key */
|
|
453
|
+
name: string;
|
|
454
|
+
key_preview: string;
|
|
455
|
+
/** Whether this API key is active */
|
|
456
|
+
is_active: boolean;
|
|
457
|
+
is_expired: boolean;
|
|
458
|
+
is_valid: boolean;
|
|
459
|
+
days_until_expiry: number;
|
|
460
|
+
/** Total number of requests made with this key */
|
|
461
|
+
total_requests: number;
|
|
462
|
+
/** When this API key was last used */
|
|
463
|
+
last_used_at: string | null;
|
|
464
|
+
/** When this API key expires (null = never expires) */
|
|
465
|
+
expires_at: string | null;
|
|
466
|
+
/** When this record was created */
|
|
467
|
+
created_at: string;
|
|
468
|
+
/** When this record was last updated */
|
|
469
|
+
updated_at: string;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* API key update serializer for modifying API key properties. Allows updating
|
|
474
|
+
* name and active status only.
|
|
475
|
+
*
|
|
476
|
+
* Request model (no read-only fields).
|
|
477
|
+
*/
|
|
478
|
+
export interface APIKeyUpdateRequest {
|
|
479
|
+
/** Human-readable name for this API key */
|
|
480
|
+
name: string;
|
|
481
|
+
/** Whether this API key is active */
|
|
482
|
+
is_active?: boolean;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* API key update serializer for modifying API key properties. Allows updating
|
|
487
|
+
* name and active status only.
|
|
488
|
+
*
|
|
489
|
+
* Response model (includes read-only fields).
|
|
490
|
+
*/
|
|
491
|
+
export interface APIKeyUpdate {
|
|
492
|
+
/** Human-readable name for this API key */
|
|
493
|
+
name: string;
|
|
494
|
+
/** Whether this API key is active */
|
|
495
|
+
is_active?: boolean;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* API key update serializer for modifying API key properties. Allows updating
|
|
500
|
+
* name and active status only.
|
|
501
|
+
*
|
|
502
|
+
* Request model (no read-only fields).
|
|
503
|
+
*/
|
|
504
|
+
export interface PatchedAPIKeyUpdateRequest {
|
|
505
|
+
/** Human-readable name for this API key */
|
|
506
|
+
name?: string;
|
|
507
|
+
/** Whether this API key is active */
|
|
508
|
+
is_active?: boolean;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* API key validation serializer. Validates API key and returns key
|
|
513
|
+
* information.
|
|
514
|
+
*
|
|
515
|
+
* Request model (no read-only fields).
|
|
516
|
+
*/
|
|
517
|
+
export interface APIKeyValidationRequest {
|
|
518
|
+
/** API key to validate */
|
|
519
|
+
key: string;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* API key validation response serializer. Defines the structure of API key
|
|
524
|
+
* validation response for OpenAPI schema.
|
|
525
|
+
*
|
|
526
|
+
* Response model (includes read-only fields).
|
|
527
|
+
*/
|
|
528
|
+
export interface APIKeyValidationResponse {
|
|
529
|
+
/** Whether the validation was successful */
|
|
530
|
+
success: boolean;
|
|
531
|
+
/** Whether the API key is valid */
|
|
532
|
+
valid: boolean;
|
|
533
|
+
api_key: Record<string, any>;
|
|
534
|
+
/** Validation message */
|
|
535
|
+
message: string;
|
|
536
|
+
/** Error message if validation failed */
|
|
537
|
+
error?: string;
|
|
538
|
+
/** Error code if validation failed */
|
|
539
|
+
error_code?: string;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
*
|
|
544
|
+
* Response model (includes read-only fields).
|
|
545
|
+
*/
|
|
546
|
+
export interface PaginatedUserBalanceList {
|
|
547
|
+
/** Total number of items across all pages */
|
|
548
|
+
count: number;
|
|
549
|
+
/** Current page number (1-based) */
|
|
550
|
+
page: number;
|
|
551
|
+
/** Total number of pages */
|
|
552
|
+
pages: number;
|
|
553
|
+
/** Number of items per page */
|
|
554
|
+
page_size: number;
|
|
555
|
+
/** Whether there is a next page */
|
|
556
|
+
has_next: boolean;
|
|
557
|
+
/** Whether there is a previous page */
|
|
558
|
+
has_previous: boolean;
|
|
559
|
+
/** Next page number (null if no next page) */
|
|
560
|
+
next_page?: number | null;
|
|
561
|
+
/** Previous page number (null if no previous page) */
|
|
562
|
+
previous_page?: number | null;
|
|
563
|
+
/** Array of items for current page */
|
|
564
|
+
results: Array<UserBalance>;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* User balance serializer with computed fields. Provides balance information
|
|
569
|
+
* with display helpers.
|
|
570
|
+
*
|
|
571
|
+
* Response model (includes read-only fields).
|
|
572
|
+
*/
|
|
573
|
+
export interface UserBalance {
|
|
574
|
+
user: string;
|
|
575
|
+
/** Current balance in USD (float for performance) */
|
|
576
|
+
balance_usd: number;
|
|
577
|
+
/** Formatted balance display. */
|
|
578
|
+
balance_display: string;
|
|
579
|
+
/** Check if balance is zero. */
|
|
580
|
+
is_empty: boolean;
|
|
581
|
+
/** Check if user has any transactions. */
|
|
582
|
+
has_transactions: boolean;
|
|
583
|
+
created_at: string;
|
|
584
|
+
updated_at: string;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
*
|
|
589
|
+
* Response model (includes read-only fields).
|
|
590
|
+
*/
|
|
591
|
+
export interface PaginatedCurrencyListList {
|
|
592
|
+
/** Total number of items across all pages */
|
|
593
|
+
count: number;
|
|
594
|
+
/** Current page number (1-based) */
|
|
595
|
+
page: number;
|
|
596
|
+
/** Total number of pages */
|
|
597
|
+
pages: number;
|
|
598
|
+
/** Number of items per page */
|
|
599
|
+
page_size: number;
|
|
600
|
+
/** Whether there is a next page */
|
|
601
|
+
has_next: boolean;
|
|
602
|
+
/** Whether there is a previous page */
|
|
603
|
+
has_previous: boolean;
|
|
604
|
+
/** Next page number (null if no next page) */
|
|
605
|
+
next_page?: number | null;
|
|
606
|
+
/** Previous page number (null if no previous page) */
|
|
607
|
+
previous_page?: number | null;
|
|
608
|
+
/** Array of items for current page */
|
|
609
|
+
results: Array<CurrencyList>;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Complete currency serializer with full details. Used for currency
|
|
614
|
+
* information and management.
|
|
615
|
+
*
|
|
616
|
+
* Response model (includes read-only fields).
|
|
617
|
+
*/
|
|
618
|
+
export interface Currency {
|
|
619
|
+
id: number;
|
|
620
|
+
/** Currency code (e.g., BTC, USD, ETH) */
|
|
621
|
+
code: string;
|
|
622
|
+
/** Full currency name (e.g., Bitcoin, US Dollar) */
|
|
623
|
+
name: string;
|
|
624
|
+
/** Currency symbol (e.g., $, ₿, Ξ) */
|
|
625
|
+
symbol: string;
|
|
626
|
+
/** Type of currency
|
|
627
|
+
|
|
628
|
+
* `fiat` - Fiat Currency
|
|
629
|
+
* `crypto` - Cryptocurrency */
|
|
630
|
+
currency_type: Enums.CurrencyCurrencyType;
|
|
631
|
+
type_display: string;
|
|
632
|
+
/** Number of decimal places for this currency */
|
|
633
|
+
decimal_places: number;
|
|
634
|
+
/** Whether this currency is available for payments */
|
|
635
|
+
is_active: boolean;
|
|
636
|
+
/** Check if this is a cryptocurrency. */
|
|
637
|
+
is_crypto: boolean;
|
|
638
|
+
/** Check if this is a fiat currency. */
|
|
639
|
+
is_fiat: boolean;
|
|
640
|
+
/** When this record was created */
|
|
641
|
+
created_at: string;
|
|
642
|
+
/** When this record was last updated */
|
|
643
|
+
updated_at: string;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
*
|
|
648
|
+
* Response model (includes read-only fields).
|
|
649
|
+
*/
|
|
650
|
+
export interface PaginatedEndpointGroupList {
|
|
651
|
+
/** Total number of items across all pages */
|
|
652
|
+
count: number;
|
|
653
|
+
/** Current page number (1-based) */
|
|
654
|
+
page: number;
|
|
655
|
+
/** Total number of pages */
|
|
656
|
+
pages: number;
|
|
657
|
+
/** Number of items per page */
|
|
658
|
+
page_size: number;
|
|
659
|
+
/** Whether there is a next page */
|
|
660
|
+
has_next: boolean;
|
|
661
|
+
/** Whether there is a previous page */
|
|
662
|
+
has_previous: boolean;
|
|
663
|
+
/** Next page number (null if no next page) */
|
|
664
|
+
next_page?: number | null;
|
|
665
|
+
/** Previous page number (null if no previous page) */
|
|
666
|
+
previous_page?: number | null;
|
|
667
|
+
/** Array of items for current page */
|
|
668
|
+
results: Array<EndpointGroup>;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Endpoint group serializer for API access management. Used for subscription
|
|
673
|
+
* endpoint group configuration.
|
|
674
|
+
*
|
|
675
|
+
* Response model (includes read-only fields).
|
|
676
|
+
*/
|
|
677
|
+
export interface EndpointGroup {
|
|
678
|
+
id: number;
|
|
679
|
+
/** Endpoint group name (e.g., 'Payment API', 'Balance API') */
|
|
680
|
+
name: string;
|
|
681
|
+
/** Description of what this endpoint group provides */
|
|
682
|
+
description: string;
|
|
683
|
+
/** Whether this endpoint group is available */
|
|
684
|
+
is_enabled: boolean;
|
|
685
|
+
created_at: string;
|
|
686
|
+
updated_at: string;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Complete payment serializer with full details. Used for detail views and
|
|
691
|
+
* updates.
|
|
692
|
+
*
|
|
693
|
+
* Response model (includes read-only fields).
|
|
694
|
+
*/
|
|
695
|
+
export interface Payment {
|
|
696
|
+
/** Unique identifier for this record */
|
|
697
|
+
id: string;
|
|
698
|
+
user: string;
|
|
699
|
+
/** Payment amount in USD (float for performance) */
|
|
700
|
+
amount_usd: number;
|
|
701
|
+
/** Payment currency */
|
|
702
|
+
currency: number;
|
|
703
|
+
/** Blockchain network (for crypto payments) */
|
|
704
|
+
network?: number | null;
|
|
705
|
+
/** Payment provider
|
|
706
|
+
|
|
707
|
+
* `nowpayments` - NowPayments */
|
|
708
|
+
provider?: Enums.PaymentProvider;
|
|
709
|
+
/** Current payment status
|
|
710
|
+
|
|
711
|
+
* `pending` - Pending
|
|
712
|
+
* `confirming` - Confirming
|
|
713
|
+
* `confirmed` - Confirmed
|
|
714
|
+
* `completed` - Completed
|
|
715
|
+
* `failed` - Failed
|
|
716
|
+
* `expired` - Expired
|
|
717
|
+
* `cancelled` - Cancelled
|
|
718
|
+
* `refunded` - Refunded */
|
|
719
|
+
status?: Enums.PaymentStatus;
|
|
720
|
+
status_display: string;
|
|
721
|
+
/** Get formatted amount display. */
|
|
722
|
+
amount_display: string;
|
|
723
|
+
/** Provider's payment ID */
|
|
724
|
+
provider_payment_id: string | null;
|
|
725
|
+
/** Payment page URL */
|
|
726
|
+
payment_url: string | null;
|
|
727
|
+
/** Cryptocurrency payment address */
|
|
728
|
+
pay_address: string | null;
|
|
729
|
+
/** Success callback URL */
|
|
730
|
+
callback_url?: string | null;
|
|
731
|
+
/** Cancellation URL */
|
|
732
|
+
cancel_url?: string | null;
|
|
733
|
+
/** Payment description */
|
|
734
|
+
description?: string;
|
|
735
|
+
/** Blockchain transaction hash */
|
|
736
|
+
transaction_hash: string | null;
|
|
737
|
+
/** Number of blockchain confirmations */
|
|
738
|
+
confirmations_count: number;
|
|
739
|
+
/** When this record was created */
|
|
740
|
+
created_at: string;
|
|
741
|
+
/** When this record was last updated */
|
|
742
|
+
updated_at: string;
|
|
743
|
+
/** When this payment expires */
|
|
744
|
+
expires_at?: string | null;
|
|
745
|
+
/** When this payment was completed */
|
|
746
|
+
completed_at: string | null;
|
|
747
|
+
/** Check if payment is pending. */
|
|
748
|
+
is_pending: boolean;
|
|
749
|
+
/** Check if payment is completed. */
|
|
750
|
+
is_completed: boolean;
|
|
751
|
+
/** Check if payment is failed. */
|
|
752
|
+
is_failed: boolean;
|
|
753
|
+
/** Check if payment is expired. */
|
|
754
|
+
is_expired: boolean;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
*
|
|
759
|
+
* Response model (includes read-only fields).
|
|
760
|
+
*/
|
|
761
|
+
export interface PaginatedNetworkList {
|
|
762
|
+
/** Total number of items across all pages */
|
|
763
|
+
count: number;
|
|
764
|
+
/** Current page number (1-based) */
|
|
765
|
+
page: number;
|
|
766
|
+
/** Total number of pages */
|
|
767
|
+
pages: number;
|
|
768
|
+
/** Number of items per page */
|
|
769
|
+
page_size: number;
|
|
770
|
+
/** Whether there is a next page */
|
|
771
|
+
has_next: boolean;
|
|
772
|
+
/** Whether there is a previous page */
|
|
773
|
+
has_previous: boolean;
|
|
774
|
+
/** Next page number (null if no next page) */
|
|
775
|
+
next_page?: number | null;
|
|
776
|
+
/** Previous page number (null if no previous page) */
|
|
777
|
+
previous_page?: number | null;
|
|
778
|
+
/** Array of items for current page */
|
|
779
|
+
results: Array<Network>;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* Network serializer for blockchain networks. Used for network information and
|
|
784
|
+
* selection.
|
|
785
|
+
*
|
|
786
|
+
* Response model (includes read-only fields).
|
|
787
|
+
*/
|
|
788
|
+
export interface Network {
|
|
789
|
+
id: number;
|
|
790
|
+
currency: Record<string, any>;
|
|
791
|
+
/** Network name (e.g., Ethereum, Bitcoin, Polygon) */
|
|
792
|
+
name: string;
|
|
793
|
+
/** Network code (e.g., ETH, BTC, MATIC) */
|
|
794
|
+
code: string;
|
|
795
|
+
/** Whether this network is available for payments */
|
|
796
|
+
is_active: boolean;
|
|
797
|
+
/** When this record was created */
|
|
798
|
+
created_at: string;
|
|
799
|
+
/** When this record was last updated */
|
|
800
|
+
updated_at: string;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* API keys overview metrics
|
|
805
|
+
*
|
|
806
|
+
* Response model (includes read-only fields).
|
|
807
|
+
*/
|
|
808
|
+
export interface APIKeysOverview {
|
|
809
|
+
/** Total number of API keys */
|
|
810
|
+
total_keys: number;
|
|
811
|
+
/** Number of active API keys */
|
|
812
|
+
active_keys: number;
|
|
813
|
+
/** Number of expired API keys */
|
|
814
|
+
expired_keys: number;
|
|
815
|
+
/** Total requests across all keys */
|
|
816
|
+
total_requests: number;
|
|
817
|
+
/** When any key was last used */
|
|
818
|
+
last_used_at: string | null;
|
|
819
|
+
/** Name of most used API key */
|
|
820
|
+
most_used_key_name: string | null;
|
|
821
|
+
/** Requests count for most used key */
|
|
822
|
+
most_used_key_requests: number;
|
|
823
|
+
/** Number of keys expiring within 7 days */
|
|
824
|
+
expiring_soon_count: number;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* User balance overview metrics
|
|
829
|
+
*
|
|
830
|
+
* Response model (includes read-only fields).
|
|
831
|
+
*/
|
|
832
|
+
export interface BalanceOverview {
|
|
833
|
+
/** Current balance in USD */
|
|
834
|
+
current_balance: number;
|
|
835
|
+
/** Formatted balance display */
|
|
836
|
+
balance_display: string;
|
|
837
|
+
/** Total amount deposited (lifetime) */
|
|
838
|
+
total_deposited: number;
|
|
839
|
+
/** Total amount spent (lifetime) */
|
|
840
|
+
total_spent: number;
|
|
841
|
+
/** Last transaction timestamp */
|
|
842
|
+
last_transaction_at: string | null;
|
|
843
|
+
/** Whether user has any transactions */
|
|
844
|
+
has_transactions: boolean;
|
|
845
|
+
/** Whether balance is zero */
|
|
846
|
+
is_empty: boolean;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Complete chart response for payments analytics
|
|
851
|
+
*
|
|
852
|
+
* Response model (includes read-only fields).
|
|
853
|
+
*/
|
|
854
|
+
export interface PaymentsChartResponse {
|
|
855
|
+
/** Chart series data */
|
|
856
|
+
series: Array<ChartSeries>;
|
|
857
|
+
/** Time period */
|
|
858
|
+
period: string;
|
|
859
|
+
/** Total amount for period */
|
|
860
|
+
total_amount: number;
|
|
861
|
+
/** Total payments for period */
|
|
862
|
+
total_payments: number;
|
|
863
|
+
/** Success rate for period */
|
|
864
|
+
success_rate: number;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Complete payments dashboard metrics
|
|
869
|
+
*
|
|
870
|
+
* Response model (includes read-only fields).
|
|
871
|
+
*/
|
|
872
|
+
export interface PaymentsMetrics {
|
|
873
|
+
balance: Record<string, any>;
|
|
874
|
+
subscription: Record<string, any>;
|
|
875
|
+
api_keys: Record<string, any>;
|
|
876
|
+
payments: Record<string, any>;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Complete payments dashboard overview response
|
|
881
|
+
*
|
|
882
|
+
* Response model (includes read-only fields).
|
|
883
|
+
*/
|
|
884
|
+
export interface PaymentsDashboardOverview {
|
|
885
|
+
metrics: Record<string, any>;
|
|
886
|
+
/** Recent payments */
|
|
887
|
+
recent_payments: Array<RecentPayment>;
|
|
888
|
+
/** Recent transactions */
|
|
889
|
+
recent_transactions: Array<RecentTransaction>;
|
|
890
|
+
chart_data: Record<string, any>;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Payment analytics response with currency and provider breakdown
|
|
895
|
+
*
|
|
896
|
+
* Response model (includes read-only fields).
|
|
897
|
+
*/
|
|
898
|
+
export interface PaymentAnalyticsResponse {
|
|
899
|
+
/** Analytics by currency */
|
|
900
|
+
currency_analytics: Array<CurrencyAnalyticsItem>;
|
|
901
|
+
/** Analytics by provider */
|
|
902
|
+
provider_analytics: Array<ProviderAnalyticsItem>;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
*
|
|
907
|
+
* Response model (includes read-only fields).
|
|
908
|
+
*/
|
|
909
|
+
export interface PaginatedRecentPaymentList {
|
|
910
|
+
/** Total number of items across all pages */
|
|
911
|
+
count: number;
|
|
912
|
+
/** Current page number (1-based) */
|
|
913
|
+
page: number;
|
|
914
|
+
/** Total number of pages */
|
|
915
|
+
pages: number;
|
|
916
|
+
/** Number of items per page */
|
|
917
|
+
page_size: number;
|
|
918
|
+
/** Whether there is a next page */
|
|
919
|
+
has_next: boolean;
|
|
920
|
+
/** Whether there is a previous page */
|
|
921
|
+
has_previous: boolean;
|
|
922
|
+
/** Next page number (null if no next page) */
|
|
923
|
+
next_page?: number | null;
|
|
924
|
+
/** Previous page number (null if no previous page) */
|
|
925
|
+
previous_page?: number | null;
|
|
926
|
+
/** Array of items for current page */
|
|
927
|
+
results: Array<RecentPayment>;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
*
|
|
932
|
+
* Response model (includes read-only fields).
|
|
933
|
+
*/
|
|
934
|
+
export interface PaginatedRecentTransactionList {
|
|
935
|
+
/** Total number of items across all pages */
|
|
936
|
+
count: number;
|
|
937
|
+
/** Current page number (1-based) */
|
|
938
|
+
page: number;
|
|
939
|
+
/** Total number of pages */
|
|
940
|
+
pages: number;
|
|
941
|
+
/** Number of items per page */
|
|
942
|
+
page_size: number;
|
|
943
|
+
/** Whether there is a next page */
|
|
944
|
+
has_next: boolean;
|
|
945
|
+
/** Whether there is a previous page */
|
|
946
|
+
has_previous: boolean;
|
|
947
|
+
/** Next page number (null if no next page) */
|
|
948
|
+
next_page?: number | null;
|
|
949
|
+
/** Previous page number (null if no previous page) */
|
|
950
|
+
previous_page?: number | null;
|
|
951
|
+
/** Array of items for current page */
|
|
952
|
+
results: Array<RecentTransaction>;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Current subscription overview
|
|
957
|
+
*
|
|
958
|
+
* Response model (includes read-only fields).
|
|
959
|
+
*/
|
|
960
|
+
export interface SubscriptionOverview {
|
|
961
|
+
/** Subscription tier */
|
|
962
|
+
tier: string;
|
|
963
|
+
/** Human-readable tier name */
|
|
964
|
+
tier_display: string;
|
|
965
|
+
/** Subscription status */
|
|
966
|
+
status: string;
|
|
967
|
+
/** Human-readable status */
|
|
968
|
+
status_display: string;
|
|
969
|
+
/** Color for status display */
|
|
970
|
+
status_color: string;
|
|
971
|
+
/** Whether subscription is active */
|
|
972
|
+
is_active: boolean;
|
|
973
|
+
/** Whether subscription is expired */
|
|
974
|
+
is_expired: boolean;
|
|
975
|
+
/** Days until expiration */
|
|
976
|
+
days_remaining: number;
|
|
977
|
+
/** Hourly request limit */
|
|
978
|
+
requests_per_hour: number;
|
|
979
|
+
/** Daily request limit */
|
|
980
|
+
requests_per_day: number;
|
|
981
|
+
/** Total requests made */
|
|
982
|
+
total_requests: number;
|
|
983
|
+
/** Usage percentage for current period */
|
|
984
|
+
usage_percentage: number;
|
|
985
|
+
/** Monthly cost in USD */
|
|
986
|
+
monthly_cost_usd: number;
|
|
987
|
+
/** Formatted cost display */
|
|
988
|
+
cost_display: string;
|
|
989
|
+
/** Subscription start date */
|
|
990
|
+
starts_at: string;
|
|
991
|
+
/** Subscription expiration date */
|
|
992
|
+
expires_at: string;
|
|
993
|
+
/** Last API request timestamp */
|
|
994
|
+
last_request_at: string | null;
|
|
995
|
+
/** Number of accessible endpoint groups */
|
|
996
|
+
endpoint_groups_count: number;
|
|
997
|
+
/** List of accessible endpoint group names */
|
|
998
|
+
endpoint_groups: Array<string>;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
*
|
|
1003
|
+
* Response model (includes read-only fields).
|
|
1004
|
+
*/
|
|
1005
|
+
export interface PaginatedPaymentListList {
|
|
1006
|
+
/** Total number of items across all pages */
|
|
1007
|
+
count: number;
|
|
1008
|
+
/** Current page number (1-based) */
|
|
1009
|
+
page: number;
|
|
1010
|
+
/** Total number of pages */
|
|
1011
|
+
pages: number;
|
|
1012
|
+
/** Number of items per page */
|
|
1013
|
+
page_size: number;
|
|
1014
|
+
/** Whether there is a next page */
|
|
1015
|
+
has_next: boolean;
|
|
1016
|
+
/** Whether there is a previous page */
|
|
1017
|
+
has_previous: boolean;
|
|
1018
|
+
/** Next page number (null if no next page) */
|
|
1019
|
+
next_page?: number | null;
|
|
1020
|
+
/** Previous page number (null if no previous page) */
|
|
1021
|
+
previous_page?: number | null;
|
|
1022
|
+
/** Array of items for current page */
|
|
1023
|
+
results: Array<PaymentList>;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Payment creation serializer with Pydantic integration. Validates input and
|
|
1028
|
+
* delegates to PaymentService.
|
|
1029
|
+
*
|
|
1030
|
+
* Request model (no read-only fields).
|
|
1031
|
+
*/
|
|
1032
|
+
export interface PaymentCreateRequest {
|
|
1033
|
+
/** Amount in USD (1.00 - 50,000.00) */
|
|
1034
|
+
amount_usd: number;
|
|
1035
|
+
/** Cryptocurrency to receive
|
|
1036
|
+
|
|
1037
|
+
* `BTC` - Bitcoin
|
|
1038
|
+
* `ETH` - Ethereum
|
|
1039
|
+
* `LTC` - Litecoin
|
|
1040
|
+
* `XMR` - Monero
|
|
1041
|
+
* `USDT` - Tether
|
|
1042
|
+
* `USDC` - USD Coin
|
|
1043
|
+
* `ADA` - Cardano
|
|
1044
|
+
* `DOT` - Polkadot */
|
|
1045
|
+
currency_code: Enums.PaymentCreateRequestCurrencyCode;
|
|
1046
|
+
/** Payment provider
|
|
1047
|
+
|
|
1048
|
+
* `nowpayments` - NowPayments */
|
|
1049
|
+
provider?: Enums.PaymentCreateRequestProvider;
|
|
1050
|
+
/** Success callback URL */
|
|
1051
|
+
callback_url?: string;
|
|
1052
|
+
/** Cancellation URL */
|
|
1053
|
+
cancel_url?: string;
|
|
1054
|
+
/** Payment description */
|
|
1055
|
+
description?: string;
|
|
1056
|
+
/** Additional metadata */
|
|
1057
|
+
metadata?: string;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* Payment creation serializer with Pydantic integration. Validates input and
|
|
1062
|
+
* delegates to PaymentService.
|
|
1063
|
+
*
|
|
1064
|
+
* Response model (includes read-only fields).
|
|
1065
|
+
*/
|
|
1066
|
+
export interface PaymentCreate {
|
|
1067
|
+
/** Amount in USD (1.00 - 50,000.00) */
|
|
1068
|
+
amount_usd: number;
|
|
1069
|
+
/** Cryptocurrency to receive
|
|
1070
|
+
|
|
1071
|
+
* `BTC` - Bitcoin
|
|
1072
|
+
* `ETH` - Ethereum
|
|
1073
|
+
* `LTC` - Litecoin
|
|
1074
|
+
* `XMR` - Monero
|
|
1075
|
+
* `USDT` - Tether
|
|
1076
|
+
* `USDC` - USD Coin
|
|
1077
|
+
* `ADA` - Cardano
|
|
1078
|
+
* `DOT` - Polkadot */
|
|
1079
|
+
currency_code: Enums.PaymentCreateCurrencyCode;
|
|
1080
|
+
/** Payment provider
|
|
1081
|
+
|
|
1082
|
+
* `nowpayments` - NowPayments */
|
|
1083
|
+
provider?: Enums.PaymentCreateProvider;
|
|
1084
|
+
/** Success callback URL */
|
|
1085
|
+
callback_url?: string;
|
|
1086
|
+
/** Cancellation URL */
|
|
1087
|
+
cancel_url?: string;
|
|
1088
|
+
/** Payment description */
|
|
1089
|
+
description?: string;
|
|
1090
|
+
/** Additional metadata */
|
|
1091
|
+
metadata?: string;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* Complete payment serializer with full details. Used for detail views and
|
|
1096
|
+
* updates.
|
|
1097
|
+
*
|
|
1098
|
+
* Request model (no read-only fields).
|
|
1099
|
+
*/
|
|
1100
|
+
export interface PaymentRequest {
|
|
1101
|
+
/** Payment amount in USD (float for performance) */
|
|
1102
|
+
amount_usd: number;
|
|
1103
|
+
/** Payment currency */
|
|
1104
|
+
currency: number;
|
|
1105
|
+
/** Blockchain network (for crypto payments) */
|
|
1106
|
+
network?: number | null;
|
|
1107
|
+
/** Payment provider
|
|
1108
|
+
|
|
1109
|
+
* `nowpayments` - NowPayments */
|
|
1110
|
+
provider?: Enums.PaymentRequestProvider;
|
|
1111
|
+
/** Current payment status
|
|
1112
|
+
|
|
1113
|
+
* `pending` - Pending
|
|
1114
|
+
* `confirming` - Confirming
|
|
1115
|
+
* `confirmed` - Confirmed
|
|
1116
|
+
* `completed` - Completed
|
|
1117
|
+
* `failed` - Failed
|
|
1118
|
+
* `expired` - Expired
|
|
1119
|
+
* `cancelled` - Cancelled
|
|
1120
|
+
* `refunded` - Refunded */
|
|
1121
|
+
status?: Enums.PaymentRequestStatus;
|
|
1122
|
+
/** Success callback URL */
|
|
1123
|
+
callback_url?: string | null;
|
|
1124
|
+
/** Cancellation URL */
|
|
1125
|
+
cancel_url?: string | null;
|
|
1126
|
+
/** Payment description */
|
|
1127
|
+
description?: string;
|
|
1128
|
+
/** When this payment expires */
|
|
1129
|
+
expires_at?: string | null;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* Complete payment serializer with full details. Used for detail views and
|
|
1134
|
+
* updates.
|
|
1135
|
+
*
|
|
1136
|
+
* Request model (no read-only fields).
|
|
1137
|
+
*/
|
|
1138
|
+
export interface PatchedPaymentRequest {
|
|
1139
|
+
/** Payment amount in USD (float for performance) */
|
|
1140
|
+
amount_usd?: number;
|
|
1141
|
+
/** Payment currency */
|
|
1142
|
+
currency?: number;
|
|
1143
|
+
/** Blockchain network (for crypto payments) */
|
|
1144
|
+
network?: number | null;
|
|
1145
|
+
/** Payment provider
|
|
1146
|
+
|
|
1147
|
+
* `nowpayments` - NowPayments */
|
|
1148
|
+
provider?: Enums.PatchedPaymentRequestProvider;
|
|
1149
|
+
/** Current payment status
|
|
1150
|
+
|
|
1151
|
+
* `pending` - Pending
|
|
1152
|
+
* `confirming` - Confirming
|
|
1153
|
+
* `confirmed` - Confirmed
|
|
1154
|
+
* `completed` - Completed
|
|
1155
|
+
* `failed` - Failed
|
|
1156
|
+
* `expired` - Expired
|
|
1157
|
+
* `cancelled` - Cancelled
|
|
1158
|
+
* `refunded` - Refunded */
|
|
1159
|
+
status?: Enums.PatchedPaymentRequestStatus;
|
|
1160
|
+
/** Success callback URL */
|
|
1161
|
+
callback_url?: string | null;
|
|
1162
|
+
/** Cancellation URL */
|
|
1163
|
+
cancel_url?: string | null;
|
|
1164
|
+
/** Payment description */
|
|
1165
|
+
description?: string;
|
|
1166
|
+
/** When this payment expires */
|
|
1167
|
+
expires_at?: string | null;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
/**
|
|
1171
|
+
*
|
|
1172
|
+
* Response model (includes read-only fields).
|
|
1173
|
+
*/
|
|
1174
|
+
export interface PaginatedProviderCurrencyList {
|
|
1175
|
+
/** Total number of items across all pages */
|
|
1176
|
+
count: number;
|
|
1177
|
+
/** Current page number (1-based) */
|
|
1178
|
+
page: number;
|
|
1179
|
+
/** Total number of pages */
|
|
1180
|
+
pages: number;
|
|
1181
|
+
/** Number of items per page */
|
|
1182
|
+
page_size: number;
|
|
1183
|
+
/** Whether there is a next page */
|
|
1184
|
+
has_next: boolean;
|
|
1185
|
+
/** Whether there is a previous page */
|
|
1186
|
+
has_previous: boolean;
|
|
1187
|
+
/** Next page number (null if no next page) */
|
|
1188
|
+
next_page?: number | null;
|
|
1189
|
+
/** Previous page number (null if no previous page) */
|
|
1190
|
+
previous_page?: number | null;
|
|
1191
|
+
/** Array of items for current page */
|
|
1192
|
+
results: Array<ProviderCurrency>;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* Provider currency serializer for provider-specific currency info. Used for
|
|
1197
|
+
* provider currency management and rates.
|
|
1198
|
+
*
|
|
1199
|
+
* Response model (includes read-only fields).
|
|
1200
|
+
*/
|
|
1201
|
+
export interface ProviderCurrency {
|
|
1202
|
+
id: number;
|
|
1203
|
+
currency: Record<string, any>;
|
|
1204
|
+
network: Record<string, any>;
|
|
1205
|
+
/** Payment provider name (e.g., nowpayments) */
|
|
1206
|
+
provider: string;
|
|
1207
|
+
/** Currency code as used by the provider */
|
|
1208
|
+
provider_currency_code: string;
|
|
1209
|
+
/** Get minimum amount from provider configuration. */
|
|
1210
|
+
provider_min_amount_usd: number;
|
|
1211
|
+
/** Get maximum amount from provider configuration. */
|
|
1212
|
+
provider_max_amount_usd: number;
|
|
1213
|
+
/** Get fee percentage from provider configuration. */
|
|
1214
|
+
provider_fee_percentage: number;
|
|
1215
|
+
/** Get fixed fee from provider configuration. */
|
|
1216
|
+
provider_fixed_fee_usd: number;
|
|
1217
|
+
/** Whether this currency is enabled for this provider */
|
|
1218
|
+
is_enabled: boolean;
|
|
1219
|
+
/** When this record was created */
|
|
1220
|
+
created_at: string;
|
|
1221
|
+
/** When this record was last updated */
|
|
1222
|
+
updated_at: string;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
*
|
|
1227
|
+
* Response model (includes read-only fields).
|
|
1228
|
+
*/
|
|
1229
|
+
export interface PaginatedSubscriptionListList {
|
|
1230
|
+
/** Total number of items across all pages */
|
|
1231
|
+
count: number;
|
|
1232
|
+
/** Current page number (1-based) */
|
|
1233
|
+
page: number;
|
|
1234
|
+
/** Total number of pages */
|
|
1235
|
+
pages: number;
|
|
1236
|
+
/** Number of items per page */
|
|
1237
|
+
page_size: number;
|
|
1238
|
+
/** Whether there is a next page */
|
|
1239
|
+
has_next: boolean;
|
|
1240
|
+
/** Whether there is a previous page */
|
|
1241
|
+
has_previous: boolean;
|
|
1242
|
+
/** Next page number (null if no next page) */
|
|
1243
|
+
next_page?: number | null;
|
|
1244
|
+
/** Previous page number (null if no previous page) */
|
|
1245
|
+
previous_page?: number | null;
|
|
1246
|
+
/** Array of items for current page */
|
|
1247
|
+
results: Array<SubscriptionList>;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Subscription creation serializer with service integration. Validates input
|
|
1252
|
+
* and delegates to SubscriptionService.
|
|
1253
|
+
*
|
|
1254
|
+
* Request model (no read-only fields).
|
|
1255
|
+
*/
|
|
1256
|
+
export interface SubscriptionCreateRequest {
|
|
1257
|
+
/** Tariff ID for the subscription */
|
|
1258
|
+
tariff_id: number;
|
|
1259
|
+
/** Endpoint group ID (optional) */
|
|
1260
|
+
endpoint_group_id?: number | null;
|
|
1261
|
+
/** Subscription duration in days */
|
|
1262
|
+
duration_days?: number;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* Subscription creation serializer with service integration. Validates input
|
|
1267
|
+
* and delegates to SubscriptionService.
|
|
1268
|
+
*
|
|
1269
|
+
* Response model (includes read-only fields).
|
|
1270
|
+
*/
|
|
1271
|
+
export interface SubscriptionCreate {
|
|
1272
|
+
/** Tariff ID for the subscription */
|
|
1273
|
+
tariff_id: number;
|
|
1274
|
+
/** Endpoint group ID (optional) */
|
|
1275
|
+
endpoint_group_id?: number | null;
|
|
1276
|
+
/** Subscription duration in days */
|
|
1277
|
+
duration_days?: number;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
/**
|
|
1281
|
+
* Complete subscription serializer with full details. Used for subscription
|
|
1282
|
+
* detail views and updates.
|
|
1283
|
+
*
|
|
1284
|
+
* Response model (includes read-only fields).
|
|
1285
|
+
*/
|
|
1286
|
+
export interface Subscription {
|
|
1287
|
+
/** Unique identifier for this record */
|
|
1288
|
+
id: string;
|
|
1289
|
+
user: string;
|
|
1290
|
+
tariff: Record<string, any>;
|
|
1291
|
+
endpoint_group: Record<string, any>;
|
|
1292
|
+
/** Subscription status
|
|
1293
|
+
|
|
1294
|
+
* `active` - Active
|
|
1295
|
+
* `inactive` - Inactive
|
|
1296
|
+
* `suspended` - Suspended
|
|
1297
|
+
* `cancelled` - Cancelled
|
|
1298
|
+
* `expired` - Expired */
|
|
1299
|
+
status?: Enums.SubscriptionStatus;
|
|
1300
|
+
status_display: string;
|
|
1301
|
+
/** Get color for status display. */
|
|
1302
|
+
status_color: string;
|
|
1303
|
+
/** Subscription tier
|
|
1304
|
+
|
|
1305
|
+
* `free` - Free Tier
|
|
1306
|
+
* `basic` - Basic Tier
|
|
1307
|
+
* `pro` - Pro Tier
|
|
1308
|
+
* `enterprise` - Enterprise Tier */
|
|
1309
|
+
tier?: Enums.SubscriptionTier;
|
|
1310
|
+
/** Total API requests made with this subscription */
|
|
1311
|
+
total_requests: number;
|
|
1312
|
+
/** Get usage percentage for current period. */
|
|
1313
|
+
usage_percentage: number;
|
|
1314
|
+
/** When the last API request was made */
|
|
1315
|
+
last_request_at: string | null;
|
|
1316
|
+
/** When this subscription expires */
|
|
1317
|
+
expires_at: string;
|
|
1318
|
+
/** Check if subscription is active and not expired. */
|
|
1319
|
+
is_active: boolean;
|
|
1320
|
+
/** Check if subscription is expired. */
|
|
1321
|
+
is_expired: boolean;
|
|
1322
|
+
/** When this record was created */
|
|
1323
|
+
created_at: string;
|
|
1324
|
+
/** When this record was last updated */
|
|
1325
|
+
updated_at: string;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* Complete subscription serializer with full details. Used for subscription
|
|
1330
|
+
* detail views and updates.
|
|
1331
|
+
*
|
|
1332
|
+
* Request model (no read-only fields).
|
|
1333
|
+
*/
|
|
1334
|
+
export interface SubscriptionRequest {
|
|
1335
|
+
/** Subscription status
|
|
1336
|
+
|
|
1337
|
+
* `active` - Active
|
|
1338
|
+
* `inactive` - Inactive
|
|
1339
|
+
* `suspended` - Suspended
|
|
1340
|
+
* `cancelled` - Cancelled
|
|
1341
|
+
* `expired` - Expired */
|
|
1342
|
+
status?: Enums.SubscriptionRequestStatus;
|
|
1343
|
+
/** Subscription tier
|
|
1344
|
+
|
|
1345
|
+
* `free` - Free Tier
|
|
1346
|
+
* `basic` - Basic Tier
|
|
1347
|
+
* `pro` - Pro Tier
|
|
1348
|
+
* `enterprise` - Enterprise Tier */
|
|
1349
|
+
tier?: Enums.SubscriptionRequestTier;
|
|
1350
|
+
/** When this subscription expires */
|
|
1351
|
+
expires_at: string;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
/**
|
|
1355
|
+
* Complete subscription serializer with full details. Used for subscription
|
|
1356
|
+
* detail views and updates.
|
|
1357
|
+
*
|
|
1358
|
+
* Request model (no read-only fields).
|
|
1359
|
+
*/
|
|
1360
|
+
export interface PatchedSubscriptionRequest {
|
|
1361
|
+
/** Subscription status
|
|
1362
|
+
|
|
1363
|
+
* `active` - Active
|
|
1364
|
+
* `inactive` - Inactive
|
|
1365
|
+
* `suspended` - Suspended
|
|
1366
|
+
* `cancelled` - Cancelled
|
|
1367
|
+
* `expired` - Expired */
|
|
1368
|
+
status?: Enums.PatchedSubscriptionRequestStatus;
|
|
1369
|
+
/** Subscription tier
|
|
1370
|
+
|
|
1371
|
+
* `free` - Free Tier
|
|
1372
|
+
* `basic` - Basic Tier
|
|
1373
|
+
* `pro` - Pro Tier
|
|
1374
|
+
* `enterprise` - Enterprise Tier */
|
|
1375
|
+
tier?: Enums.PatchedSubscriptionRequestTier;
|
|
1376
|
+
/** When this subscription expires */
|
|
1377
|
+
expires_at?: string;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
*
|
|
1382
|
+
* Response model (includes read-only fields).
|
|
1383
|
+
*/
|
|
1384
|
+
export interface PaginatedTariffList {
|
|
1385
|
+
/** Total number of items across all pages */
|
|
1386
|
+
count: number;
|
|
1387
|
+
/** Current page number (1-based) */
|
|
1388
|
+
page: number;
|
|
1389
|
+
/** Total number of pages */
|
|
1390
|
+
pages: number;
|
|
1391
|
+
/** Number of items per page */
|
|
1392
|
+
page_size: number;
|
|
1393
|
+
/** Whether there is a next page */
|
|
1394
|
+
has_next: boolean;
|
|
1395
|
+
/** Whether there is a previous page */
|
|
1396
|
+
has_previous: boolean;
|
|
1397
|
+
/** Next page number (null if no next page) */
|
|
1398
|
+
next_page?: number | null;
|
|
1399
|
+
/** Previous page number (null if no previous page) */
|
|
1400
|
+
previous_page?: number | null;
|
|
1401
|
+
/** Array of items for current page */
|
|
1402
|
+
results: Array<Tariff>;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* Tariff serializer for subscription pricing. Used for tariff information and
|
|
1407
|
+
* selection.
|
|
1408
|
+
*
|
|
1409
|
+
* Response model (includes read-only fields).
|
|
1410
|
+
*/
|
|
1411
|
+
export interface Tariff {
|
|
1412
|
+
id: number;
|
|
1413
|
+
/** Tariff name (e.g., 'Free', 'Basic', 'Pro') */
|
|
1414
|
+
name: string;
|
|
1415
|
+
/** Detailed description of what this tariff includes */
|
|
1416
|
+
description: string;
|
|
1417
|
+
/** Monthly price in USD */
|
|
1418
|
+
monthly_price_usd: number;
|
|
1419
|
+
/** API requests allowed per month */
|
|
1420
|
+
requests_per_month: number;
|
|
1421
|
+
/** API requests allowed per hour */
|
|
1422
|
+
requests_per_hour: number;
|
|
1423
|
+
/** Whether this tariff is available for new subscriptions */
|
|
1424
|
+
is_active: boolean;
|
|
1425
|
+
endpoint_groups: Array<EndpointGroup>;
|
|
1426
|
+
endpoint_groups_count: number;
|
|
1427
|
+
/** When this record was created */
|
|
1428
|
+
created_at: string;
|
|
1429
|
+
/** When this record was last updated */
|
|
1430
|
+
updated_at: string;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
*
|
|
1435
|
+
* Response model (includes read-only fields).
|
|
1436
|
+
*/
|
|
1437
|
+
export interface PaginatedTransactionList {
|
|
1438
|
+
/** Total number of items across all pages */
|
|
1439
|
+
count: number;
|
|
1440
|
+
/** Current page number (1-based) */
|
|
1441
|
+
page: number;
|
|
1442
|
+
/** Total number of pages */
|
|
1443
|
+
pages: number;
|
|
1444
|
+
/** Number of items per page */
|
|
1445
|
+
page_size: number;
|
|
1446
|
+
/** Whether there is a next page */
|
|
1447
|
+
has_next: boolean;
|
|
1448
|
+
/** Whether there is a previous page */
|
|
1449
|
+
has_previous: boolean;
|
|
1450
|
+
/** Next page number (null if no next page) */
|
|
1451
|
+
next_page?: number | null;
|
|
1452
|
+
/** Previous page number (null if no previous page) */
|
|
1453
|
+
previous_page?: number | null;
|
|
1454
|
+
/** Array of items for current page */
|
|
1455
|
+
results: Array<Transaction>;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* Transaction serializer with full details. Used for transaction history and
|
|
1460
|
+
* details.
|
|
1461
|
+
*
|
|
1462
|
+
* Response model (includes read-only fields).
|
|
1463
|
+
*/
|
|
1464
|
+
export interface Transaction {
|
|
1465
|
+
/** Unique identifier for this record */
|
|
1466
|
+
id: string;
|
|
1467
|
+
user: string;
|
|
1468
|
+
/** Transaction amount in USD (positive=credit, negative=debit) */
|
|
1469
|
+
amount_usd: number;
|
|
1470
|
+
amount_display: string;
|
|
1471
|
+
/** Type of transaction
|
|
1472
|
+
|
|
1473
|
+
* `deposit` - Deposit
|
|
1474
|
+
* `withdrawal` - Withdrawal
|
|
1475
|
+
* `payment` - Payment
|
|
1476
|
+
* `refund` - Refund
|
|
1477
|
+
* `fee` - Fee
|
|
1478
|
+
* `bonus` - Bonus
|
|
1479
|
+
* `adjustment` - Adjustment */
|
|
1480
|
+
transaction_type: Enums.TransactionTransactionType;
|
|
1481
|
+
type_color: string;
|
|
1482
|
+
/** Transaction description */
|
|
1483
|
+
description: string;
|
|
1484
|
+
/** Related payment ID (if applicable) */
|
|
1485
|
+
payment_id: string | null;
|
|
1486
|
+
/** Additional transaction metadata */
|
|
1487
|
+
metadata: string;
|
|
1488
|
+
is_credit: boolean;
|
|
1489
|
+
is_debit: boolean;
|
|
1490
|
+
/** When this record was created */
|
|
1491
|
+
created_at: string;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* Serializer for payment list in admin interface. Uses UniversalPayment only
|
|
1496
|
+
* for data extraction.
|
|
1497
|
+
*
|
|
1498
|
+
* Response model (includes read-only fields).
|
|
1499
|
+
*/
|
|
1500
|
+
export interface AdminPaymentList {
|
|
1501
|
+
id: string;
|
|
1502
|
+
internal_payment_id: string;
|
|
1503
|
+
user: Record<string, any>;
|
|
1504
|
+
amount_usd: number;
|
|
1505
|
+
currency_code: string;
|
|
1506
|
+
currency_name: string;
|
|
1507
|
+
provider: string;
|
|
1508
|
+
provider_display: string;
|
|
1509
|
+
status: string;
|
|
1510
|
+
status_display: string;
|
|
1511
|
+
pay_amount: string;
|
|
1512
|
+
pay_address: string;
|
|
1513
|
+
transaction_hash: string;
|
|
1514
|
+
created_at: string;
|
|
1515
|
+
updated_at: string;
|
|
1516
|
+
description: string;
|
|
1517
|
+
age: string;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Serializer for individual webhook event.
|
|
1522
|
+
*
|
|
1523
|
+
* Response model (includes read-only fields).
|
|
1524
|
+
*/
|
|
1525
|
+
export interface WebhookEvent {
|
|
1526
|
+
id: number;
|
|
1527
|
+
provider: string;
|
|
1528
|
+
event_type: string;
|
|
1529
|
+
/** * `success` - Success
|
|
1530
|
+
* `failed` - Failed
|
|
1531
|
+
* `pending` - Pending
|
|
1532
|
+
* `retry` - Retry */
|
|
1533
|
+
status: Enums.WebhookEventStatus;
|
|
1534
|
+
timestamp: string;
|
|
1535
|
+
/** Size in bytes */
|
|
1536
|
+
payload_size: number;
|
|
1537
|
+
/** Response time in ms */
|
|
1538
|
+
response_time: number;
|
|
1539
|
+
retry_count?: number;
|
|
1540
|
+
error_message?: string;
|
|
1541
|
+
payload_preview?: string;
|
|
1542
|
+
response_status_code?: number;
|
|
1543
|
+
webhook_url?: string;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Serializer for individual webhook event.
|
|
1548
|
+
*
|
|
1549
|
+
* Request model (no read-only fields).
|
|
1550
|
+
*/
|
|
1551
|
+
export interface WebhookEventRequest {
|
|
1552
|
+
provider: string;
|
|
1553
|
+
event_type: string;
|
|
1554
|
+
/** * `success` - Success
|
|
1555
|
+
* `failed` - Failed
|
|
1556
|
+
* `pending` - Pending
|
|
1557
|
+
* `retry` - Retry */
|
|
1558
|
+
status: Enums.WebhookEventRequestStatus;
|
|
1559
|
+
timestamp: string;
|
|
1560
|
+
/** Size in bytes */
|
|
1561
|
+
payload_size: number;
|
|
1562
|
+
/** Response time in ms */
|
|
1563
|
+
response_time: number;
|
|
1564
|
+
retry_count?: number;
|
|
1565
|
+
error_message?: string;
|
|
1566
|
+
payload_preview?: string;
|
|
1567
|
+
response_status_code?: number;
|
|
1568
|
+
webhook_url?: string;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* Lightweight API key serializer for lists. Optimized for API key lists with
|
|
1573
|
+
* minimal data (no key value).
|
|
1574
|
+
*
|
|
1575
|
+
* Response model (includes read-only fields).
|
|
1576
|
+
*/
|
|
1577
|
+
export interface APIKeyList {
|
|
1578
|
+
/** Unique identifier for this record */
|
|
1579
|
+
id: string;
|
|
1580
|
+
user: string;
|
|
1581
|
+
/** Human-readable name for this API key */
|
|
1582
|
+
name: string;
|
|
1583
|
+
/** Whether this API key is active */
|
|
1584
|
+
is_active: boolean;
|
|
1585
|
+
is_expired: boolean;
|
|
1586
|
+
is_valid: boolean;
|
|
1587
|
+
/** Total number of requests made with this key */
|
|
1588
|
+
total_requests: number;
|
|
1589
|
+
/** When this API key was last used */
|
|
1590
|
+
last_used_at: string | null;
|
|
1591
|
+
/** When this API key expires (null = never expires) */
|
|
1592
|
+
expires_at: string | null;
|
|
1593
|
+
/** When this record was created */
|
|
1594
|
+
created_at: string;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* Lightweight currency serializer for lists. Optimized for currency selection
|
|
1599
|
+
* and lists.
|
|
1600
|
+
*
|
|
1601
|
+
* Response model (includes read-only fields).
|
|
1602
|
+
*/
|
|
1603
|
+
export interface CurrencyList {
|
|
1604
|
+
id: number;
|
|
1605
|
+
/** Currency code (e.g., BTC, USD, ETH) */
|
|
1606
|
+
code: string;
|
|
1607
|
+
/** Full currency name (e.g., Bitcoin, US Dollar) */
|
|
1608
|
+
name: string;
|
|
1609
|
+
/** Currency symbol (e.g., $, ₿, Ξ) */
|
|
1610
|
+
symbol: string;
|
|
1611
|
+
/** Type of currency
|
|
1612
|
+
|
|
1613
|
+
* `fiat` - Fiat Currency
|
|
1614
|
+
* `crypto` - Cryptocurrency */
|
|
1615
|
+
currency_type: Enums.CurrencyListCurrencyType;
|
|
1616
|
+
type_display: string;
|
|
1617
|
+
/** Whether this currency is available for payments */
|
|
1618
|
+
is_active: boolean;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* Chart series data for payments visualization
|
|
1623
|
+
*
|
|
1624
|
+
* Response model (includes read-only fields).
|
|
1625
|
+
*/
|
|
1626
|
+
export interface ChartSeries {
|
|
1627
|
+
/** Series name */
|
|
1628
|
+
name: string;
|
|
1629
|
+
/** Data points */
|
|
1630
|
+
data: Array<ChartDataPoint>;
|
|
1631
|
+
/** Series color */
|
|
1632
|
+
color: string;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
/**
|
|
1636
|
+
* Payments overview metrics
|
|
1637
|
+
*
|
|
1638
|
+
* Response model (includes read-only fields).
|
|
1639
|
+
*/
|
|
1640
|
+
export interface PaymentOverview {
|
|
1641
|
+
/** Total number of payments */
|
|
1642
|
+
total_payments: number;
|
|
1643
|
+
/** Number of completed payments */
|
|
1644
|
+
completed_payments: number;
|
|
1645
|
+
/** Number of pending payments */
|
|
1646
|
+
pending_payments: number;
|
|
1647
|
+
/** Number of failed payments */
|
|
1648
|
+
failed_payments: number;
|
|
1649
|
+
/** Total payment amount in USD */
|
|
1650
|
+
total_amount_usd: number;
|
|
1651
|
+
/** Total completed amount in USD */
|
|
1652
|
+
completed_amount_usd: number;
|
|
1653
|
+
/** Average payment amount in USD */
|
|
1654
|
+
average_payment_usd: number;
|
|
1655
|
+
/** Payment success rate percentage */
|
|
1656
|
+
success_rate: number;
|
|
1657
|
+
/** Last payment timestamp */
|
|
1658
|
+
last_payment_at: string | null;
|
|
1659
|
+
/** Number of payments this month */
|
|
1660
|
+
payments_this_month: number;
|
|
1661
|
+
/** Total amount this month */
|
|
1662
|
+
amount_this_month: number;
|
|
1663
|
+
/** Most used currency */
|
|
1664
|
+
top_currency: string | null;
|
|
1665
|
+
/** Usage count for top currency */
|
|
1666
|
+
top_currency_count: number;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* Recent payment item
|
|
1671
|
+
*
|
|
1672
|
+
* Response model (includes read-only fields).
|
|
1673
|
+
*/
|
|
1674
|
+
export interface RecentPayment {
|
|
1675
|
+
/** Payment ID */
|
|
1676
|
+
id: string;
|
|
1677
|
+
/** Internal payment ID */
|
|
1678
|
+
internal_payment_id: string;
|
|
1679
|
+
/** Payment amount in USD */
|
|
1680
|
+
amount_usd: number;
|
|
1681
|
+
/** Formatted amount display */
|
|
1682
|
+
amount_display: string;
|
|
1683
|
+
/** Currency code */
|
|
1684
|
+
currency_code: string;
|
|
1685
|
+
/** Payment status */
|
|
1686
|
+
status: string;
|
|
1687
|
+
/** Human-readable status */
|
|
1688
|
+
status_display: string;
|
|
1689
|
+
/** Color for status display */
|
|
1690
|
+
status_color: string;
|
|
1691
|
+
/** Payment provider */
|
|
1692
|
+
provider: string;
|
|
1693
|
+
/** Payment creation timestamp */
|
|
1694
|
+
created_at: string;
|
|
1695
|
+
/** Payment completion timestamp */
|
|
1696
|
+
completed_at: string | null;
|
|
1697
|
+
/** Whether payment is pending */
|
|
1698
|
+
is_pending: boolean;
|
|
1699
|
+
/** Whether payment is completed */
|
|
1700
|
+
is_completed: boolean;
|
|
1701
|
+
/** Whether payment failed */
|
|
1702
|
+
is_failed: boolean;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* Recent transaction item
|
|
1707
|
+
*
|
|
1708
|
+
* Response model (includes read-only fields).
|
|
1709
|
+
*/
|
|
1710
|
+
export interface RecentTransaction {
|
|
1711
|
+
/** Transaction ID */
|
|
1712
|
+
id: string;
|
|
1713
|
+
/** Transaction type */
|
|
1714
|
+
transaction_type: string;
|
|
1715
|
+
/** Transaction amount in USD */
|
|
1716
|
+
amount_usd: number;
|
|
1717
|
+
/** Formatted amount display */
|
|
1718
|
+
amount_display: string;
|
|
1719
|
+
/** Balance after transaction */
|
|
1720
|
+
balance_after: number;
|
|
1721
|
+
/** Transaction description */
|
|
1722
|
+
description: string;
|
|
1723
|
+
/** Transaction timestamp */
|
|
1724
|
+
created_at: string;
|
|
1725
|
+
/** Related payment ID */
|
|
1726
|
+
payment_id: string | null;
|
|
1727
|
+
/** Whether this is a credit transaction */
|
|
1728
|
+
is_credit: boolean;
|
|
1729
|
+
/** Whether this is a debit transaction */
|
|
1730
|
+
is_debit: boolean;
|
|
1731
|
+
/** Color for transaction type display */
|
|
1732
|
+
type_color: string;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
/**
|
|
1736
|
+
* Analytics data for a single currency
|
|
1737
|
+
*
|
|
1738
|
+
* Response model (includes read-only fields).
|
|
1739
|
+
*/
|
|
1740
|
+
export interface CurrencyAnalyticsItem {
|
|
1741
|
+
/** Currency code (e.g., BTC) */
|
|
1742
|
+
currency_code: string;
|
|
1743
|
+
/** Currency name (e.g., Bitcoin) */
|
|
1744
|
+
currency_name: string;
|
|
1745
|
+
/** Total number of payments */
|
|
1746
|
+
total_payments: number;
|
|
1747
|
+
/** Total amount in USD */
|
|
1748
|
+
total_amount: number;
|
|
1749
|
+
/** Number of completed payments */
|
|
1750
|
+
completed_payments: number;
|
|
1751
|
+
/** Average payment amount in USD */
|
|
1752
|
+
average_amount: number;
|
|
1753
|
+
/** Success rate percentage */
|
|
1754
|
+
success_rate: number;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* Analytics data for a single payment provider
|
|
1759
|
+
*
|
|
1760
|
+
* Response model (includes read-only fields).
|
|
1761
|
+
*/
|
|
1762
|
+
export interface ProviderAnalyticsItem {
|
|
1763
|
+
/** Provider code */
|
|
1764
|
+
provider: string;
|
|
1765
|
+
/** Provider display name */
|
|
1766
|
+
provider_display: string;
|
|
1767
|
+
/** Total number of payments */
|
|
1768
|
+
total_payments: number;
|
|
1769
|
+
/** Total amount in USD */
|
|
1770
|
+
total_amount: number;
|
|
1771
|
+
/** Number of completed payments */
|
|
1772
|
+
completed_payments: number;
|
|
1773
|
+
/** Success rate percentage */
|
|
1774
|
+
success_rate: number;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* Lightweight serializer for payment lists. Optimized for list views with
|
|
1779
|
+
* minimal data.
|
|
1780
|
+
*
|
|
1781
|
+
* Response model (includes read-only fields).
|
|
1782
|
+
*/
|
|
1783
|
+
export interface PaymentList {
|
|
1784
|
+
/** Unique identifier for this record */
|
|
1785
|
+
id: string;
|
|
1786
|
+
/** Payment amount in USD (float for performance) */
|
|
1787
|
+
amount_usd: number;
|
|
1788
|
+
/** Payment currency */
|
|
1789
|
+
currency: number;
|
|
1790
|
+
/** Payment provider
|
|
1791
|
+
|
|
1792
|
+
* `nowpayments` - NowPayments */
|
|
1793
|
+
provider: Enums.PaymentListProvider;
|
|
1794
|
+
/** Current payment status
|
|
1795
|
+
|
|
1796
|
+
* `pending` - Pending
|
|
1797
|
+
* `confirming` - Confirming
|
|
1798
|
+
* `confirmed` - Confirmed
|
|
1799
|
+
* `completed` - Completed
|
|
1800
|
+
* `failed` - Failed
|
|
1801
|
+
* `expired` - Expired
|
|
1802
|
+
* `cancelled` - Cancelled
|
|
1803
|
+
* `refunded` - Refunded */
|
|
1804
|
+
status: Enums.PaymentListStatus;
|
|
1805
|
+
status_display: string;
|
|
1806
|
+
/** Get formatted amount display. */
|
|
1807
|
+
amount_display: string;
|
|
1808
|
+
/** When this record was created */
|
|
1809
|
+
created_at: string;
|
|
1810
|
+
/** When this payment expires */
|
|
1811
|
+
expires_at: string | null;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* Lightweight subscription serializer for lists. Optimized for subscription
|
|
1816
|
+
* lists with minimal data.
|
|
1817
|
+
*
|
|
1818
|
+
* Response model (includes read-only fields).
|
|
1819
|
+
*/
|
|
1820
|
+
export interface SubscriptionList {
|
|
1821
|
+
/** Unique identifier for this record */
|
|
1822
|
+
id: string;
|
|
1823
|
+
user: string;
|
|
1824
|
+
tariff_name: string;
|
|
1825
|
+
/** Subscription status
|
|
1826
|
+
|
|
1827
|
+
* `active` - Active
|
|
1828
|
+
* `inactive` - Inactive
|
|
1829
|
+
* `suspended` - Suspended
|
|
1830
|
+
* `cancelled` - Cancelled
|
|
1831
|
+
* `expired` - Expired */
|
|
1832
|
+
status: Enums.SubscriptionListStatus;
|
|
1833
|
+
status_display: string;
|
|
1834
|
+
/** Check if subscription is active and not expired. */
|
|
1835
|
+
is_active: boolean;
|
|
1836
|
+
/** Check if subscription is expired. */
|
|
1837
|
+
is_expired: boolean;
|
|
1838
|
+
/** When this subscription expires */
|
|
1839
|
+
expires_at: string;
|
|
1840
|
+
/** When this record was created */
|
|
1841
|
+
created_at: string;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
/**
|
|
1845
|
+
* Chart data point for payments analytics
|
|
1846
|
+
*
|
|
1847
|
+
* Response model (includes read-only fields).
|
|
1848
|
+
*/
|
|
1849
|
+
export interface ChartDataPoint {
|
|
1850
|
+
/** X-axis value (date) */
|
|
1851
|
+
x: string;
|
|
1852
|
+
/** Y-axis value (amount or count) */
|
|
1853
|
+
y: number;
|
|
1854
|
+
}
|
|
1855
|
+
|