@djangocfg/api 1.0.3 → 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 +16105 -33860
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15267 -34486
- package/dist/index.d.ts +15267 -34486
- package/dist/index.mjs +15970 -33847
- 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 -1823
- package/src/cfg/generated/client.ts +0 -3
- package/src/cfg/generated/enums.ts +5 -391
- package/src/cfg/generated/index.ts +3 -7
- package/src/cfg/generated/schema.ts +5918 -18389
- 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 -32
- 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 -29
- package/src/cfg/generated/_utils/schemas/PaymentCreateRequest.schema.ts +0 -29
- package/src/cfg/generated/_utils/schemas/PaymentOverview.schema.ts +0 -31
- package/src/cfg/generated/_utils/schemas/PaymentRequest.schema.ts +0 -32
- 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,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookEventListRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for paginated webhook events list.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
import { WebhookEventRequestSchema } from './WebhookEventRequest.schema'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Serializer for paginated webhook events list.
|
|
12
|
-
*/
|
|
13
|
-
export const WebhookEventListRequestSchema = z.object({
|
|
14
|
-
events: z.array(WebhookEventRequestSchema),
|
|
15
|
-
total: z.int(),
|
|
16
|
-
page: z.int(),
|
|
17
|
-
per_page: z.int(),
|
|
18
|
-
has_next: z.boolean(),
|
|
19
|
-
has_previous: z.boolean(),
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Infer TypeScript type from Zod schema
|
|
24
|
-
*/
|
|
25
|
-
export type WebhookEventListRequest = z.infer<typeof WebhookEventListRequestSchema>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookEventRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for individual webhook event.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
import * as Enums from '../../enums'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Serializer for individual webhook event.
|
|
12
|
-
*/
|
|
13
|
-
export const WebhookEventRequestSchema = z.object({
|
|
14
|
-
provider: z.string().min(1).max(50),
|
|
15
|
-
event_type: z.string().min(1).max(100),
|
|
16
|
-
status: z.nativeEnum(Enums.WebhookEventRequestStatus),
|
|
17
|
-
timestamp: z.iso.datetime(),
|
|
18
|
-
payload_size: z.int(),
|
|
19
|
-
response_time: z.int(),
|
|
20
|
-
retry_count: z.int().optional(),
|
|
21
|
-
error_message: z.string().max(500).optional(),
|
|
22
|
-
payload_preview: z.string().max(200).optional(),
|
|
23
|
-
response_status_code: z.int().optional(),
|
|
24
|
-
webhook_url: z.url().optional(),
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Infer TypeScript type from Zod schema
|
|
29
|
-
*/
|
|
30
|
-
export type WebhookEventRequest = z.infer<typeof WebhookEventRequestSchema>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookHealth
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for webhook health check response.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for webhook health check response.
|
|
11
|
-
*/
|
|
12
|
-
export const WebhookHealthSchema = z.object({
|
|
13
|
-
status: z.string().max(20),
|
|
14
|
-
timestamp: z.iso.datetime(),
|
|
15
|
-
providers: z.string(),
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Infer TypeScript type from Zod schema
|
|
20
|
-
*/
|
|
21
|
-
export type WebhookHealth = z.infer<typeof WebhookHealthSchema>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookProviderStats
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for provider-specific webhook statistics.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for provider-specific webhook statistics.
|
|
11
|
-
*/
|
|
12
|
-
export const WebhookProviderStatsSchema = z.object({
|
|
13
|
-
total: z.int(),
|
|
14
|
-
successful: z.int(),
|
|
15
|
-
failed: z.int(),
|
|
16
|
-
pending: z.int().optional(),
|
|
17
|
-
success_rate: z.number(),
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Infer TypeScript type from Zod schema
|
|
22
|
-
*/
|
|
23
|
-
export type WebhookProviderStats = z.infer<typeof WebhookProviderStatsSchema>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookProviderStatsRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for provider-specific webhook statistics.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for provider-specific webhook statistics.
|
|
11
|
-
*/
|
|
12
|
-
export const WebhookProviderStatsRequestSchema = z.object({
|
|
13
|
-
total: z.int(),
|
|
14
|
-
successful: z.int(),
|
|
15
|
-
failed: z.int(),
|
|
16
|
-
pending: z.int().optional(),
|
|
17
|
-
success_rate: z.number(),
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Infer TypeScript type from Zod schema
|
|
22
|
-
*/
|
|
23
|
-
export type WebhookProviderStatsRequest = z.infer<typeof WebhookProviderStatsRequestSchema>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookResponse
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for webhook processing response.
|
|
6
|
-
|
|
7
|
-
Standard response format for all webhook endpoints.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Serializer for webhook processing response.
|
|
13
|
-
|
|
14
|
-
Standard response format for all webhook endpoints.
|
|
15
|
-
*/
|
|
16
|
-
export const WebhookResponseSchema = z.object({
|
|
17
|
-
success: z.boolean(),
|
|
18
|
-
message: z.string().max(500),
|
|
19
|
-
payment_id: z.string().max(256).optional(),
|
|
20
|
-
provider_payment_id: z.string().max(256).optional(),
|
|
21
|
-
processed_at: z.iso.datetime().optional(),
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Infer TypeScript type from Zod schema
|
|
26
|
-
*/
|
|
27
|
-
export type WebhookResponse = z.infer<typeof WebhookResponseSchema>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookResponseRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for webhook processing response.
|
|
6
|
-
|
|
7
|
-
Standard response format for all webhook endpoints.
|
|
8
|
-
* */
|
|
9
|
-
import { z } from 'zod'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Serializer for webhook processing response.
|
|
13
|
-
|
|
14
|
-
Standard response format for all webhook endpoints.
|
|
15
|
-
*/
|
|
16
|
-
export const WebhookResponseRequestSchema = z.object({
|
|
17
|
-
success: z.boolean(),
|
|
18
|
-
message: z.string().min(1).max(500),
|
|
19
|
-
payment_id: z.string().min(1).max(256).optional(),
|
|
20
|
-
provider_payment_id: z.string().min(1).max(256).optional(),
|
|
21
|
-
processed_at: z.iso.datetime().optional(),
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Infer TypeScript type from Zod schema
|
|
26
|
-
*/
|
|
27
|
-
export type WebhookResponseRequest = z.infer<typeof WebhookResponseRequestSchema>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookStats
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for comprehensive webhook statistics.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for comprehensive webhook statistics.
|
|
11
|
-
*/
|
|
12
|
-
export const WebhookStatsSchema = z.object({
|
|
13
|
-
total: z.int(),
|
|
14
|
-
successful: z.int(),
|
|
15
|
-
failed: z.int(),
|
|
16
|
-
pending: z.int(),
|
|
17
|
-
success_rate: z.number(),
|
|
18
|
-
providers: z.record(z.string(), z.any()),
|
|
19
|
-
last_24h: z.record(z.string(), z.any()),
|
|
20
|
-
avg_response_time: z.number(),
|
|
21
|
-
max_response_time: z.int(),
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Infer TypeScript type from Zod schema
|
|
26
|
-
*/
|
|
27
|
-
export type WebhookStats = z.infer<typeof WebhookStatsSchema>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zod schema for WebhookStatsRequest
|
|
3
|
-
*
|
|
4
|
-
* This schema provides runtime validation and type inference.
|
|
5
|
-
* * Serializer for comprehensive webhook statistics.
|
|
6
|
-
* */
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Serializer for comprehensive webhook statistics.
|
|
11
|
-
*/
|
|
12
|
-
export const WebhookStatsRequestSchema = z.object({
|
|
13
|
-
total: z.int(),
|
|
14
|
-
successful: z.int(),
|
|
15
|
-
failed: z.int(),
|
|
16
|
-
pending: z.int(),
|
|
17
|
-
success_rate: z.number(),
|
|
18
|
-
providers: z.record(z.string(), z.any()),
|
|
19
|
-
last_24h: z.record(z.string(), z.any()),
|
|
20
|
-
avg_response_time: z.number(),
|
|
21
|
-
max_response_time: z.int(),
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Infer TypeScript type from Zod schema
|
|
26
|
-
*/
|
|
27
|
-
export type WebhookStatsRequest = z.infer<typeof WebhookStatsRequestSchema>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import * as Models from "./models";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* API endpoints for Webhooks.
|
|
6
|
-
*/
|
|
7
|
-
export class CfgWebhooks {
|
|
8
|
-
private client: any;
|
|
9
|
-
|
|
10
|
-
constructor(client: any) {
|
|
11
|
-
this.client = client;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Webhook Endpoint Info
|
|
16
|
-
*
|
|
17
|
-
* Get webhook endpoint information for debugging and configuration
|
|
18
|
-
*/
|
|
19
|
-
async paymentsWebhooksRetrieve(provider: string): Promise<Models.WebhookResponse> {
|
|
20
|
-
const response = await this.client.request('GET', `/cfg/payments/webhooks/${provider}/`);
|
|
21
|
-
return response;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Process Webhook
|
|
26
|
-
*
|
|
27
|
-
* Process incoming webhook from payment provider
|
|
28
|
-
*/
|
|
29
|
-
async paymentsWebhooksCreate(provider: string, data: Models.WebhookResponseRequest): Promise<Models.WebhookResponse> {
|
|
30
|
-
const response = await this.client.request('POST', `/cfg/payments/webhooks/${provider}/`, { body: data });
|
|
31
|
-
return response;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Webhook Health Check
|
|
36
|
-
*
|
|
37
|
-
* Check webhook service health status and recent activity metrics
|
|
38
|
-
*/
|
|
39
|
-
async paymentsWebhooksHealthRetrieve(): Promise<Models.WebhookHealth> {
|
|
40
|
-
const response = await this.client.request('GET', "/cfg/payments/webhooks/health/");
|
|
41
|
-
return response;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Supported Webhook Providers
|
|
46
|
-
*
|
|
47
|
-
* Get list of supported webhook providers with configuration details
|
|
48
|
-
*/
|
|
49
|
-
async paymentsWebhooksProvidersRetrieve(): Promise<Models.SupportedProviders> {
|
|
50
|
-
const response = await this.client.request('GET', "/cfg/payments/webhooks/providers/");
|
|
51
|
-
return response;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async paymentsWebhooksStatsRetrieve(days?: number): Promise<Models.WebhookStats>;
|
|
55
|
-
async paymentsWebhooksStatsRetrieve(params?: { days?: number }): Promise<Models.WebhookStats>;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Webhook Statistics
|
|
59
|
-
*
|
|
60
|
-
* Get webhook processing statistics for a given time period
|
|
61
|
-
*/
|
|
62
|
-
async paymentsWebhooksStatsRetrieve(...args: any[]): Promise<Models.WebhookStats> {
|
|
63
|
-
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
64
|
-
|
|
65
|
-
let params;
|
|
66
|
-
if (isParamsObject) {
|
|
67
|
-
params = args[0];
|
|
68
|
-
} else {
|
|
69
|
-
params = { days: args[0] };
|
|
70
|
-
}
|
|
71
|
-
const response = await this.client.request('GET', "/cfg/payments/webhooks/stats/", { params });
|
|
72
|
-
return response;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Serializer for webhook processing response. Standard response format for all
|
|
3
|
-
* webhook endpoints.
|
|
4
|
-
*
|
|
5
|
-
* Response model (includes read-only fields).
|
|
6
|
-
*/
|
|
7
|
-
export interface WebhookResponse {
|
|
8
|
-
/** Whether webhook was processed successfully */
|
|
9
|
-
success: boolean;
|
|
10
|
-
/** Processing result message */
|
|
11
|
-
message: string;
|
|
12
|
-
/** Internal payment ID */
|
|
13
|
-
payment_id?: string;
|
|
14
|
-
/** Provider payment ID */
|
|
15
|
-
provider_payment_id?: string;
|
|
16
|
-
/** Processing timestamp */
|
|
17
|
-
processed_at?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Serializer for webhook processing response. Standard response format for all
|
|
22
|
-
* webhook endpoints.
|
|
23
|
-
*
|
|
24
|
-
* Request model (no read-only fields).
|
|
25
|
-
*/
|
|
26
|
-
export interface WebhookResponseRequest {
|
|
27
|
-
/** Whether webhook was processed successfully */
|
|
28
|
-
success: boolean;
|
|
29
|
-
/** Processing result message */
|
|
30
|
-
message: string;
|
|
31
|
-
/** Internal payment ID */
|
|
32
|
-
payment_id?: string;
|
|
33
|
-
/** Provider payment ID */
|
|
34
|
-
provider_payment_id?: string;
|
|
35
|
-
/** Processing timestamp */
|
|
36
|
-
processed_at?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Serializer for webhook health check response.
|
|
41
|
-
*
|
|
42
|
-
* Response model (includes read-only fields).
|
|
43
|
-
*/
|
|
44
|
-
export interface WebhookHealth {
|
|
45
|
-
/** Health status */
|
|
46
|
-
status: string;
|
|
47
|
-
/** Check timestamp */
|
|
48
|
-
timestamp: string;
|
|
49
|
-
/** Provider health status */
|
|
50
|
-
providers: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Serializer for supported providers response.
|
|
55
|
-
*
|
|
56
|
-
* Response model (includes read-only fields).
|
|
57
|
-
*/
|
|
58
|
-
export interface SupportedProviders {
|
|
59
|
-
/** Request success status */
|
|
60
|
-
success: boolean;
|
|
61
|
-
/** List of supported providers */
|
|
62
|
-
providers: string;
|
|
63
|
-
/** Total number of providers */
|
|
64
|
-
total_count: number;
|
|
65
|
-
/** Response timestamp */
|
|
66
|
-
timestamp: string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Serializer for comprehensive webhook statistics.
|
|
71
|
-
*
|
|
72
|
-
* Response model (includes read-only fields).
|
|
73
|
-
*/
|
|
74
|
-
export interface WebhookStats {
|
|
75
|
-
total: number;
|
|
76
|
-
successful: number;
|
|
77
|
-
failed: number;
|
|
78
|
-
pending: number;
|
|
79
|
-
success_rate: number;
|
|
80
|
-
/** Statistics by provider */
|
|
81
|
-
providers: Record<string, any>;
|
|
82
|
-
/** Events in last 24 hours */
|
|
83
|
-
last_24h: Record<string, any>;
|
|
84
|
-
avg_response_time: number;
|
|
85
|
-
max_response_time: number;
|
|
86
|
-
}
|
|
87
|
-
|