@djangocfg/api 1.0.4 → 1.0.5
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/index.cjs +15856 -34128
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15274 -34396
- package/dist/index.d.ts +15274 -34396
- package/dist/index.mjs +15853 -33956
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/contexts/payments/ApiKeysContext.tsx +21 -58
- package/src/cfg/contexts/payments/BalancesContext.tsx +19 -72
- package/src/cfg/contexts/payments/CurrenciesContext.tsx +5 -18
- package/src/cfg/contexts/payments/OverviewContext.tsx +78 -124
- package/src/cfg/contexts/payments/PaymentsContext.tsx +37 -36
- package/src/cfg/contexts/payments/RootPaymentsContext.tsx +7 -76
- package/src/cfg/contexts/payments/index.ts +5 -24
- package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +38 -2380
- package/src/cfg/generated/_utils/fetchers/index.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__payments.ts +41 -2615
- package/src/cfg/generated/_utils/hooks/index.ts +0 -1
- package/src/cfg/generated/_utils/schemas/ArchiveItem.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ArchiveItemChunk.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ArchiveItemChunkDetail.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ArchiveItemChunkRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ArchiveItemDetail.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ArchiveItemRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ChatMessage.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/ChatSession.schema.ts +3 -3
- package/src/cfg/generated/_utils/schemas/ChatSessionRequest.schema.ts +3 -3
- package/src/cfg/generated/_utils/schemas/Document.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/DocumentRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/PatchedArchiveItemChunkRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/PatchedArchiveItemRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/PatchedChatSessionRequest.schema.ts +3 -3
- package/src/cfg/generated/_utils/schemas/PatchedDocumentRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/PaymentDetail.schema.ts +44 -0
- package/src/cfg/generated/_utils/schemas/PaymentList.schema.ts +7 -11
- package/src/cfg/generated/_utils/schemas/index.ts +1 -81
- package/src/cfg/generated/cfg__payments/client.ts +40 -1732
- package/src/cfg/generated/cfg__payments/models.ts +50 -1795
- package/src/cfg/generated/client.ts +0 -3
- package/src/cfg/generated/enums.ts +5 -347
- package/src/cfg/generated/index.ts +0 -5
- package/src/cfg/generated/schema.ts +5918 -18352
- package/src/cfg/services/payments/ApiKeysService.ts +34 -116
- package/src/cfg/services/payments/DashboardService.ts +37 -122
- package/src/cfg/services/payments/PaymentsService.ts +36 -69
- package/src/cfg/services/payments/SubscriptionsService.ts +35 -136
- package/src/cfg/services/webhooks/WebhooksService.ts +24 -66
- package/src/index.ts +1 -6
- package/src/cfg/generated/_utils/fetchers/cfg__payments__webhooks.ts +0 -109
- package/src/cfg/generated/_utils/hooks/cfg__payments__webhooks.ts +0 -100
- package/src/cfg/generated/_utils/schemas/APIKeyCreate.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/APIKeyCreateRequest.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/APIKeyDetail.schema.ts +0 -35
- package/src/cfg/generated/_utils/schemas/APIKeyList.schema.ts +0 -32
- package/src/cfg/generated/_utils/schemas/APIKeyUpdate.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/APIKeyUpdateRequest.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/APIKeyValidationRequest.schema.ts +0 -23
- package/src/cfg/generated/_utils/schemas/APIKeyValidationResponse.schema.ts +0 -29
- package/src/cfg/generated/_utils/schemas/APIKeysOverview.schema.ts +0 -26
- package/src/cfg/generated/_utils/schemas/AdminPaymentCreate.schema.ts +0 -26
- package/src/cfg/generated/_utils/schemas/AdminPaymentCreateRequest.schema.ts +0 -27
- package/src/cfg/generated/_utils/schemas/AdminPaymentDetail.schema.ts +0 -50
- package/src/cfg/generated/_utils/schemas/AdminPaymentList.schema.ts +0 -38
- package/src/cfg/generated/_utils/schemas/AdminPaymentStats.schema.ts +0 -29
- package/src/cfg/generated/_utils/schemas/AdminPaymentUpdate.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/AdminPaymentUpdateRequest.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/AdminUser.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/BalanceOverview.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/ChartDataPoint.schema.ts +0 -20
- package/src/cfg/generated/_utils/schemas/ChartSeries.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/Currency.schema.ts +0 -35
- package/src/cfg/generated/_utils/schemas/CurrencyAnalyticsItem.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/CurrencyList.schema.ts +0 -32
- package/src/cfg/generated/_utils/schemas/CurrencyRates.schema.ts +0 -26
- package/src/cfg/generated/_utils/schemas/EndpointGroup.schema.ts +0 -28
- package/src/cfg/generated/_utils/schemas/Network.schema.ts +0 -30
- package/src/cfg/generated/_utils/schemas/PaginatedAPIKeyListList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedAdminPaymentListList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedAdminPaymentStatsList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedAdminUserList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedCurrencyListList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedEndpointGroupList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedNetworkList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedProviderCurrencyList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedRecentPaymentList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedRecentTransactionList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedSubscriptionListList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedTariffList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedTransactionList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedUserBalanceList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedWebhookEventListList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaginatedWebhookStatsList.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PatchedAPIKeyUpdateRequest.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PatchedAdminPaymentUpdateRequest.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/PatchedPaymentRequest.schema.ts +0 -30
- package/src/cfg/generated/_utils/schemas/PatchedSubscriptionRequest.schema.ts +0 -26
- package/src/cfg/generated/_utils/schemas/Payment.schema.ts +0 -49
- package/src/cfg/generated/_utils/schemas/PaymentAnalyticsResponse.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/PaymentCreate.schema.ts +0 -28
- package/src/cfg/generated/_utils/schemas/PaymentCreateRequest.schema.ts +0 -28
- package/src/cfg/generated/_utils/schemas/PaymentOverview.schema.ts +0 -31
- package/src/cfg/generated/_utils/schemas/PaymentRequest.schema.ts +0 -30
- package/src/cfg/generated/_utils/schemas/PaymentsChartResponse.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/PaymentsDashboardOverview.schema.ts +0 -26
- package/src/cfg/generated/_utils/schemas/PaymentsMetrics.schema.ts +0 -26
- package/src/cfg/generated/_utils/schemas/ProviderAnalyticsItem.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/ProviderCurrency.schema.ts +0 -36
- package/src/cfg/generated/_utils/schemas/RecentPayment.schema.ts +0 -32
- package/src/cfg/generated/_utils/schemas/RecentTransaction.schema.ts +0 -29
- package/src/cfg/generated/_utils/schemas/Subscription.schema.ts +0 -41
- package/src/cfg/generated/_utils/schemas/SubscriptionCreate.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/SubscriptionCreateRequest.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/SubscriptionList.schema.ts +0 -32
- package/src/cfg/generated/_utils/schemas/SubscriptionOverview.schema.ts +0 -37
- package/src/cfg/generated/_utils/schemas/SubscriptionRequest.schema.ts +0 -26
- package/src/cfg/generated/_utils/schemas/SupportedCurrencies.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/SupportedProviders.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/Tariff.schema.ts +0 -34
- package/src/cfg/generated/_utils/schemas/Transaction.schema.ts +0 -35
- package/src/cfg/generated/_utils/schemas/UserBalance.schema.ts +0 -29
- package/src/cfg/generated/_utils/schemas/WebhookEvent.schema.ts +0 -31
- package/src/cfg/generated/_utils/schemas/WebhookEventList.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/WebhookEventListRequest.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/WebhookEventRequest.schema.ts +0 -30
- package/src/cfg/generated/_utils/schemas/WebhookHealth.schema.ts +0 -21
- package/src/cfg/generated/_utils/schemas/WebhookProviderStats.schema.ts +0 -23
- package/src/cfg/generated/_utils/schemas/WebhookProviderStatsRequest.schema.ts +0 -23
- package/src/cfg/generated/_utils/schemas/WebhookResponse.schema.ts +0 -27
- package/src/cfg/generated/_utils/schemas/WebhookResponseRequest.schema.ts +0 -27
- package/src/cfg/generated/_utils/schemas/WebhookStats.schema.ts +0 -27
- package/src/cfg/generated/_utils/schemas/WebhookStatsRequest.schema.ts +0 -27
- package/src/cfg/generated/cfg__payments__webhooks/client.ts +0 -75
- package/src/cfg/generated/cfg__payments__webhooks/index.ts +0 -2
- package/src/cfg/generated/cfg__payments__webhooks/models.ts +0 -87
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for APIKeyList
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Lightweight API key serializer for lists.
|
|
6
|
-
|
|
7
|
-
Optimized for API key lists with minimal data (no key value).
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Lightweight API key serializer for lists.
|
|
13
|
-
|
|
14
|
-
Optimized for API key lists with minimal data (no key value).
|
|
15
|
-
*/
|
|
16
|
-
export const APIKeyListSchema = z.object({
|
|
17
|
-
id: z.uuid(),
|
|
18
|
-
user: z.string(),
|
|
19
|
-
name: z.string(),
|
|
20
|
-
is_active: z.boolean(),
|
|
21
|
-
is_expired: z.boolean(),
|
|
22
|
-
is_valid: z.boolean(),
|
|
23
|
-
total_requests: z.int(),
|
|
24
|
-
last_used_at: z.iso.datetime().nullable(),
|
|
25
|
-
expires_at: z.iso.datetime().nullable(),
|
|
26
|
-
created_at: z.iso.datetime(),
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Infer TypeScript type from Zod schema
|
|
31
|
-
*/
|
|
32
|
-
export type APIKeyList = z.infer<typeof APIKeyListSchema>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for APIKeyUpdate
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * API key update serializer for modifying API key properties.
|
|
6
|
-
|
|
7
|
-
Allows updating name and active status only.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* API key update serializer for modifying API key properties.
|
|
13
|
-
|
|
14
|
-
Allows updating name and active status only.
|
|
15
|
-
*/
|
|
16
|
-
export const APIKeyUpdateSchema = z.object({
|
|
17
|
-
name: z.string().max(100),
|
|
18
|
-
is_active: z.boolean().optional(),
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Infer TypeScript type from Zod schema
|
|
23
|
-
*/
|
|
24
|
-
export type APIKeyUpdate = z.infer<typeof APIKeyUpdateSchema>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for APIKeyUpdateRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * API key update serializer for modifying API key properties.
|
|
6
|
-
|
|
7
|
-
Allows updating name and active status only.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* API key update serializer for modifying API key properties.
|
|
13
|
-
|
|
14
|
-
Allows updating name and active status only.
|
|
15
|
-
*/
|
|
16
|
-
export const APIKeyUpdateRequestSchema = z.object({
|
|
17
|
-
name: z.string().min(1).max(100),
|
|
18
|
-
is_active: z.boolean().optional(),
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Infer TypeScript type from Zod schema
|
|
23
|
-
*/
|
|
24
|
-
export type APIKeyUpdateRequest = z.infer<typeof APIKeyUpdateRequestSchema>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for APIKeyValidationRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * API key validation serializer.
|
|
6
|
-
|
|
7
|
-
Validates API key and returns key information.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* API key validation serializer.
|
|
13
|
-
|
|
14
|
-
Validates API key and returns key information.
|
|
15
|
-
*/
|
|
16
|
-
export const APIKeyValidationRequestSchema = z.object({
|
|
17
|
-
key: z.string().min(32).max(64),
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Infer TypeScript type from Zod schema
|
|
22
|
-
*/
|
|
23
|
-
export type APIKeyValidationRequest = z.infer<typeof APIKeyValidationRequestSchema>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for APIKeyValidationResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * API key validation response serializer.
|
|
6
|
-
|
|
7
|
-
Defines the structure of API key validation response for OpenAPI schema.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
import { APIKeyDetailSchema } from './APIKeyDetail.schema'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* API key validation response serializer.
|
|
14
|
-
|
|
15
|
-
Defines the structure of API key validation response for OpenAPI schema.
|
|
16
|
-
*/
|
|
17
|
-
export const APIKeyValidationResponseSchema = z.object({
|
|
18
|
-
success: z.boolean(),
|
|
19
|
-
valid: z.boolean(),
|
|
20
|
-
api_key: APIKeyDetailSchema.nullable(),
|
|
21
|
-
message: z.string(),
|
|
22
|
-
error: z.string().optional(),
|
|
23
|
-
error_code: z.string().optional(),
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Infer TypeScript type from Zod schema
|
|
28
|
-
*/
|
|
29
|
-
export type APIKeyValidationResponse = z.infer<typeof APIKeyValidationResponseSchema>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for APIKeysOverview
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * API keys overview metrics
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* API keys overview metrics
|
|
11
|
-
*/
|
|
12
|
-
export const APIKeysOverviewSchema = z.object({
|
|
13
|
-
total_keys: z.int(),
|
|
14
|
-
active_keys: z.int(),
|
|
15
|
-
expired_keys: z.int(),
|
|
16
|
-
total_requests: z.int(),
|
|
17
|
-
last_used_at: z.iso.datetime().nullable(),
|
|
18
|
-
most_used_key_name: z.string().nullable(),
|
|
19
|
-
most_used_key_requests: z.int(),
|
|
20
|
-
expiring_soon_count: z.int(),
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Infer TypeScript type from Zod schema
|
|
25
|
-
*/
|
|
26
|
-
export type APIKeysOverview = z.infer<typeof APIKeysOverviewSchema>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AdminPaymentCreate
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for creating payments in admin interface.
|
|
6
|
-
Uses UniversalPayment only for data creation.
|
|
7
|
-
* */
|
|
8
|
-
import { z } from 'zod'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Serializer for creating payments in admin interface.
|
|
12
|
-
Uses UniversalPayment only for data creation.
|
|
13
|
-
*/
|
|
14
|
-
export const AdminPaymentCreateSchema = z.object({
|
|
15
|
-
user: z.int(),
|
|
16
|
-
amount_usd: z.number().min(1.0).max(100000.0),
|
|
17
|
-
provider: z.string().max(50),
|
|
18
|
-
description: z.string().optional(),
|
|
19
|
-
callback_url: z.url().optional(),
|
|
20
|
-
cancel_url: z.url().optional(),
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Infer TypeScript type from Zod schema
|
|
25
|
-
*/
|
|
26
|
-
export type AdminPaymentCreate = z.infer<typeof AdminPaymentCreateSchema>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AdminPaymentCreateRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for creating payments in admin interface.
|
|
6
|
-
Uses UniversalPayment only for data creation.
|
|
7
|
-
* */
|
|
8
|
-
import { z } from 'zod'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Serializer for creating payments in admin interface.
|
|
12
|
-
Uses UniversalPayment only for data creation.
|
|
13
|
-
*/
|
|
14
|
-
export const AdminPaymentCreateRequestSchema = z.object({
|
|
15
|
-
user: z.int(),
|
|
16
|
-
amount_usd: z.number().min(1.0).max(100000.0),
|
|
17
|
-
currency_code: z.string().min(1).max(20),
|
|
18
|
-
provider: z.string().min(1).max(50),
|
|
19
|
-
description: z.string().optional(),
|
|
20
|
-
callback_url: z.url().optional(),
|
|
21
|
-
cancel_url: z.url().optional(),
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Infer TypeScript type from Zod schema
|
|
26
|
-
*/
|
|
27
|
-
export type AdminPaymentCreateRequest = z.infer<typeof AdminPaymentCreateRequestSchema>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AdminPaymentDetail
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Detailed serializer for individual payment in admin interface.
|
|
6
|
-
Uses UniversalPayment only for data extraction.
|
|
7
|
-
* */
|
|
8
|
-
import { z } from 'zod'
|
|
9
|
-
import { AdminUserSchema } from './AdminUser.schema'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Detailed serializer for individual payment in admin interface.
|
|
13
|
-
Uses UniversalPayment only for data extraction.
|
|
14
|
-
*/
|
|
15
|
-
export const AdminPaymentDetailSchema = z.object({
|
|
16
|
-
id: z.uuid(),
|
|
17
|
-
user: AdminUserSchema,
|
|
18
|
-
internal_payment_id: z.string(),
|
|
19
|
-
amount_usd: z.number(),
|
|
20
|
-
actual_amount_usd: z.number(),
|
|
21
|
-
fee_amount_usd: z.number(),
|
|
22
|
-
currency_code: z.string(),
|
|
23
|
-
currency_name: z.string(),
|
|
24
|
-
provider: z.string(),
|
|
25
|
-
provider_display: z.string(),
|
|
26
|
-
status: z.string(),
|
|
27
|
-
status_display: z.string(),
|
|
28
|
-
pay_amount: z.string(),
|
|
29
|
-
pay_address: z.string(),
|
|
30
|
-
payment_url: z.url(),
|
|
31
|
-
transaction_hash: z.string(),
|
|
32
|
-
confirmations_count: z.int(),
|
|
33
|
-
security_nonce: z.string(),
|
|
34
|
-
expires_at: z.iso.datetime(),
|
|
35
|
-
completed_at: z.iso.datetime(),
|
|
36
|
-
status_changed_at: z.iso.datetime(),
|
|
37
|
-
description: z.string(),
|
|
38
|
-
callback_url: z.url(),
|
|
39
|
-
cancel_url: z.url(),
|
|
40
|
-
provider_data: z.string(),
|
|
41
|
-
webhook_data: z.string(),
|
|
42
|
-
created_at: z.iso.datetime(),
|
|
43
|
-
updated_at: z.iso.datetime(),
|
|
44
|
-
age: z.string(),
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Infer TypeScript type from Zod schema
|
|
49
|
-
*/
|
|
50
|
-
export type AdminPaymentDetail = z.infer<typeof AdminPaymentDetailSchema>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AdminPaymentList
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for payment list in admin interface.
|
|
6
|
-
Uses UniversalPayment only for data extraction.
|
|
7
|
-
* */
|
|
8
|
-
import { z } from 'zod'
|
|
9
|
-
import { AdminUserSchema } from './AdminUser.schema'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Serializer for payment list in admin interface.
|
|
13
|
-
Uses UniversalPayment only for data extraction.
|
|
14
|
-
*/
|
|
15
|
-
export const AdminPaymentListSchema = z.object({
|
|
16
|
-
id: z.uuid(),
|
|
17
|
-
internal_payment_id: z.string(),
|
|
18
|
-
user: AdminUserSchema,
|
|
19
|
-
amount_usd: z.number(),
|
|
20
|
-
currency_code: z.string(),
|
|
21
|
-
currency_name: z.string(),
|
|
22
|
-
provider: z.string(),
|
|
23
|
-
provider_display: z.string(),
|
|
24
|
-
status: z.string(),
|
|
25
|
-
status_display: z.string(),
|
|
26
|
-
pay_amount: z.string(),
|
|
27
|
-
pay_address: z.string(),
|
|
28
|
-
transaction_hash: z.string(),
|
|
29
|
-
created_at: z.iso.datetime(),
|
|
30
|
-
updated_at: z.iso.datetime(),
|
|
31
|
-
description: z.string(),
|
|
32
|
-
age: z.string(),
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Infer TypeScript type from Zod schema
|
|
37
|
-
*/
|
|
38
|
-
export type AdminPaymentList = z.infer<typeof AdminPaymentListSchema>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AdminPaymentStats
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for payment statistics in admin interface.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for payment statistics in admin interface.
|
|
11
|
-
*/
|
|
12
|
-
export const AdminPaymentStatsSchema = z.object({
|
|
13
|
-
total_payments: z.int(),
|
|
14
|
-
total_amount_usd: z.number(),
|
|
15
|
-
successful_payments: z.int(),
|
|
16
|
-
failed_payments: z.int(),
|
|
17
|
-
pending_payments: z.int(),
|
|
18
|
-
success_rate: z.number(),
|
|
19
|
-
by_provider: z.record(z.string(), z.any()),
|
|
20
|
-
by_currency: z.record(z.string(), z.any()),
|
|
21
|
-
last_24h: z.record(z.string(), z.any()),
|
|
22
|
-
last_7d: z.record(z.string(), z.any()),
|
|
23
|
-
last_30d: z.record(z.string(), z.any()),
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Infer TypeScript type from Zod schema
|
|
28
|
-
*/
|
|
29
|
-
export type AdminPaymentStats = z.infer<typeof AdminPaymentStatsSchema>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AdminPaymentUpdate
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for updating payments in admin interface.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
import * as Enums from '../../enums'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Serializer for updating payments in admin interface.
|
|
12
|
-
*/
|
|
13
|
-
export const AdminPaymentUpdateSchema = z.object({
|
|
14
|
-
status: z.nativeEnum(Enums.AdminPaymentUpdateStatus).optional(),
|
|
15
|
-
description: z.string().optional(),
|
|
16
|
-
callback_url: z.url().nullable().optional(),
|
|
17
|
-
cancel_url: z.url().nullable().optional(),
|
|
18
|
-
provider_data: z.string().optional(),
|
|
19
|
-
webhook_data: z.string().optional(),
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Infer TypeScript type from Zod schema
|
|
24
|
-
*/
|
|
25
|
-
export type AdminPaymentUpdate = z.infer<typeof AdminPaymentUpdateSchema>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AdminPaymentUpdateRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for updating payments in admin interface.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
import * as Enums from '../../enums'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Serializer for updating payments in admin interface.
|
|
12
|
-
*/
|
|
13
|
-
export const AdminPaymentUpdateRequestSchema = z.object({
|
|
14
|
-
status: z.nativeEnum(Enums.AdminPaymentUpdateRequestStatus).optional(),
|
|
15
|
-
description: z.string().optional(),
|
|
16
|
-
callback_url: z.url().nullable().optional(),
|
|
17
|
-
cancel_url: z.url().nullable().optional(),
|
|
18
|
-
provider_data: z.string().optional(),
|
|
19
|
-
webhook_data: z.string().optional(),
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Infer TypeScript type from Zod schema
|
|
24
|
-
*/
|
|
25
|
-
export type AdminPaymentUpdateRequest = z.infer<typeof AdminPaymentUpdateRequestSchema>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for AdminUser
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Simplified user serializer for admin interface.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Simplified user serializer for admin interface.
|
|
11
|
-
*/
|
|
12
|
-
export const AdminUserSchema = z.object({
|
|
13
|
-
id: z.int(),
|
|
14
|
-
username: z.string(),
|
|
15
|
-
email: z.email(),
|
|
16
|
-
first_name: z.string(),
|
|
17
|
-
last_name: z.string(),
|
|
18
|
-
is_active: z.boolean(),
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Infer TypeScript type from Zod schema
|
|
23
|
-
*/
|
|
24
|
-
export type AdminUser = z.infer<typeof AdminUserSchema>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for BalanceOverview
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * User balance overview metrics
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* User balance overview metrics
|
|
11
|
-
*/
|
|
12
|
-
export const BalanceOverviewSchema = z.object({
|
|
13
|
-
current_balance: z.number(),
|
|
14
|
-
balance_display: z.string(),
|
|
15
|
-
total_deposited: z.number(),
|
|
16
|
-
total_spent: z.number(),
|
|
17
|
-
last_transaction_at: z.iso.datetime().nullable(),
|
|
18
|
-
has_transactions: z.boolean(),
|
|
19
|
-
is_empty: z.boolean(),
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Infer TypeScript type from Zod schema
|
|
24
|
-
*/
|
|
25
|
-
export type BalanceOverview = z.infer<typeof BalanceOverviewSchema>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for ChartDataPoint
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Chart data point for payments analytics
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Chart data point for payments analytics
|
|
11
|
-
*/
|
|
12
|
-
export const ChartDataPointSchema = z.object({
|
|
13
|
-
x: z.string(),
|
|
14
|
-
y: z.number(),
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer TypeScript type from Zod schema
|
|
19
|
-
*/
|
|
20
|
-
export type ChartDataPoint = z.infer<typeof ChartDataPointSchema>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for ChartSeries
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Chart series data for payments visualization
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
import { ChartDataPointSchema } from './ChartDataPoint.schema'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Chart series data for payments visualization
|
|
12
|
-
*/
|
|
13
|
-
export const ChartSeriesSchema = z.object({
|
|
14
|
-
name: z.string(),
|
|
15
|
-
data: z.array(ChartDataPointSchema),
|
|
16
|
-
color: z.string(),
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Infer TypeScript type from Zod schema
|
|
21
|
-
*/
|
|
22
|
-
export type ChartSeries = z.infer<typeof ChartSeriesSchema>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for Currency
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Complete currency serializer with full details.
|
|
6
|
-
|
|
7
|
-
Used for currency information and management.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
import * as Enums from '../../enums'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Complete currency serializer with full details.
|
|
14
|
-
|
|
15
|
-
Used for currency information and management.
|
|
16
|
-
*/
|
|
17
|
-
export const CurrencySchema = z.object({
|
|
18
|
-
id: z.int(),
|
|
19
|
-
code: z.string(),
|
|
20
|
-
name: z.string(),
|
|
21
|
-
symbol: z.string(),
|
|
22
|
-
currency_type: z.nativeEnum(Enums.CurrencyCurrencyType),
|
|
23
|
-
type_display: z.string(),
|
|
24
|
-
decimal_places: z.int(),
|
|
25
|
-
is_active: z.boolean(),
|
|
26
|
-
is_crypto: z.boolean(),
|
|
27
|
-
is_fiat: z.boolean(),
|
|
28
|
-
created_at: z.iso.datetime(),
|
|
29
|
-
updated_at: z.iso.datetime(),
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Infer TypeScript type from Zod schema
|
|
34
|
-
*/
|
|
35
|
-
export type Currency = z.infer<typeof CurrencySchema>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for CurrencyAnalyticsItem
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Analytics data for a single currency
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Analytics data for a single currency
|
|
11
|
-
*/
|
|
12
|
-
export const CurrencyAnalyticsItemSchema = z.object({
|
|
13
|
-
currency_code: z.string(),
|
|
14
|
-
currency_name: z.string(),
|
|
15
|
-
total_payments: z.int(),
|
|
16
|
-
total_amount: z.number(),
|
|
17
|
-
completed_payments: z.int(),
|
|
18
|
-
average_amount: z.number(),
|
|
19
|
-
success_rate: z.number(),
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Infer TypeScript type from Zod schema
|
|
24
|
-
*/
|
|
25
|
-
export type CurrencyAnalyticsItem = z.infer<typeof CurrencyAnalyticsItemSchema>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for CurrencyList
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Lightweight currency serializer for lists.
|
|
6
|
-
|
|
7
|
-
Optimized for currency selection and lists.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
import * as Enums from '../../enums'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Lightweight currency serializer for lists.
|
|
14
|
-
|
|
15
|
-
Optimized for currency selection and lists.
|
|
16
|
-
*/
|
|
17
|
-
export const CurrencyListSchema = z.object({
|
|
18
|
-
id: z.int(),
|
|
19
|
-
code: z.string(),
|
|
20
|
-
name: z.string(),
|
|
21
|
-
symbol: z.string(),
|
|
22
|
-
currency_type: z.nativeEnum(Enums.CurrencyListCurrencyType),
|
|
23
|
-
type_display: z.string(),
|
|
24
|
-
is_active: z.boolean(),
|
|
25
|
-
usd_rate: z.number(),
|
|
26
|
-
usd_rate_updated_at: z.iso.datetime().nullable(),
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Infer TypeScript type from Zod schema
|
|
31
|
-
*/
|
|
32
|
-
export type CurrencyList = z.infer<typeof CurrencyListSchema>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for CurrencyRates
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Currency rates serializer for getting exchange rates.
|
|
6
|
-
|
|
7
|
-
Fetches current exchange rates through CurrencyService.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
import * as Enums from '../../enums'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Currency rates serializer for getting exchange rates.
|
|
14
|
-
|
|
15
|
-
Fetches current exchange rates through CurrencyService.
|
|
16
|
-
*/
|
|
17
|
-
export const CurrencyRatesSchema = z.object({
|
|
18
|
-
base_currency: z.string().max(10).optional(),
|
|
19
|
-
currencies: z.array(z.string().max(10)).optional(),
|
|
20
|
-
provider: z.nativeEnum(Enums.CurrencyRatesProvider).optional(),
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Infer TypeScript type from Zod schema
|
|
25
|
-
*/
|
|
26
|
-
export type CurrencyRates = z.infer<typeof CurrencyRatesSchema>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for EndpointGroup
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Endpoint group serializer for API access management.
|
|
6
|
-
|
|
7
|
-
Used for subscription endpoint group configuration.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Endpoint group serializer for API access management.
|
|
13
|
-
|
|
14
|
-
Used for subscription endpoint group configuration.
|
|
15
|
-
*/
|
|
16
|
-
export const EndpointGroupSchema = z.object({
|
|
17
|
-
id: z.int(),
|
|
18
|
-
name: z.string(),
|
|
19
|
-
description: z.string(),
|
|
20
|
-
is_enabled: z.boolean(),
|
|
21
|
-
created_at: z.iso.datetime(),
|
|
22
|
-
updated_at: z.iso.datetime(),
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Infer TypeScript type from Zod schema
|
|
27
|
-
*/
|
|
28
|
-
export type EndpointGroup = z.infer<typeof EndpointGroupSchema>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for Network
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Network serializer for blockchain networks.
|
|
6
|
-
|
|
7
|
-
Used for network information and selection.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
import { CurrencyListSchema } from './CurrencyList.schema'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Network serializer for blockchain networks.
|
|
14
|
-
|
|
15
|
-
Used for network information and selection.
|
|
16
|
-
*/
|
|
17
|
-
export const NetworkSchema = z.object({
|
|
18
|
-
id: z.int(),
|
|
19
|
-
currency: CurrencyListSchema.nullable(),
|
|
20
|
-
name: z.string(),
|
|
21
|
-
code: z.string(),
|
|
22
|
-
is_active: z.boolean(),
|
|
23
|
-
created_at: z.iso.datetime(),
|
|
24
|
-
updated_at: z.iso.datetime(),
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Infer TypeScript type from Zod schema
|
|
29
|
-
*/
|
|
30
|
-
export type Network = z.infer<typeof NetworkSchema>
|