@djangocfg/api 1.2.24 → 1.2.26
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 +6859 -24179
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1243 -20744
- package/dist/index.d.ts +1243 -20744
- package/dist/index.mjs +6766 -24089
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/contexts/index.ts +0 -11
- package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +175 -6
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +146 -5
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_auth.ts +77 -0
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +117 -4
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +88 -19
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_activity.ts +1 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_api_zones.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_charts.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_commands.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_config.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_overview.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_statistics.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_system.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_api_keys.ts +88 -3
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_charts.ts +204 -7
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_configuration.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_monitoring.ts +119 -21
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_proto_files.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_services.ts +92 -6
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_testing.ts +88 -3
- package/src/cfg/generated/_utils/fetchers/cfg__health.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +1422 -49
- package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +146 -5
- package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +88 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +146 -5
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +88 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +175 -6
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_jobs.ts +146 -5
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_monitoring.ts +59 -2
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_queues.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_registries.ts +204 -7
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_schedules.ts +117 -4
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_testing.ts +117 -4
- package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_workers.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__support.ts +291 -10
- package/src/cfg/generated/_utils/fetchers/index.ts +1 -0
- package/src/cfg/generated/_utils/hooks/cfg__accounts.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__accounts__auth.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_admin_api.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_auth.ts +35 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_testing.ts +0 -21
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_activity.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_api_zones.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_charts.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_config.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_overview.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_statistics.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_system.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_api_keys.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_charts.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_configuration.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_monitoring.ts +5 -21
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_services.ts +3 -3
- package/src/cfg/generated/_utils/hooks/cfg__health.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__leads__lead_submission.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__bulk_email.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__logs.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__newsletters.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__newsletter__testing.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_monitoring.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__rq__rq_workers.ts +0 -1
- package/src/cfg/generated/_utils/hooks/index.ts +1 -0
- package/src/cfg/generated/_utils/schemas/ApiKeyStats.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/AppStatistics.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/AppStatisticsData.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/AxesConfig.schema.ts +35 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsResult.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/CentrifugoMetrics.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceResult.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/CentrifugoToken.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/ConnectionTokenResponse.schema.ts +3 -2
- package/src/cfg/generated/_utils/schemas/ConstanceConfig.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/DjangoConfig.schema.ts +14 -7
- package/src/cfg/generated/_utils/schemas/DjangoRQConfig.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/GRPCOverviewStats.schema.ts +2 -0
- package/src/cfg/generated/_utils/schemas/GRPCRegisteredService.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/GRPCServerConfig.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/GRPCServerStatus.schema.ts +34 -0
- package/src/cfg/generated/_utils/schemas/NextJSAdminConfig.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/NgrokConfig.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/OpenAPIClientConfig.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/PaginatedRecentRequestList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PaginatedServiceSummaryList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/RQSchedule.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/ServiceSummary.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/TelegramConfig.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/User.schema.ts +2 -0
- package/src/cfg/generated/_utils/schemas/index.ts +14 -3
- package/src/cfg/generated/cfg__accounts/models.ts +20 -3
- package/src/cfg/generated/cfg__accounts__user_profile/models.ts +19 -2
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +27 -17
- package/src/cfg/generated/cfg__centrifugo__centrifugo_auth/client.ts +26 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_auth/index.ts +2 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_auth/models.ts +16 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/client.ts +0 -10
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/models.ts +0 -26
- package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/models.ts +1 -1
- package/src/cfg/generated/cfg__dashboard__dashboard_commands/models.ts +2 -2
- package/src/cfg/generated/cfg__dashboard__dashboard_config/models.ts +159 -26
- package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +18 -5
- package/src/cfg/generated/cfg__grpc__grpc_api_keys/models.ts +1 -1
- package/src/cfg/generated/cfg__grpc__grpc_charts/models.ts +5 -5
- package/src/cfg/generated/cfg__grpc__grpc_configuration/models.ts +6 -6
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/client.ts +4 -25
- package/src/cfg/generated/cfg__grpc__grpc_monitoring/models.ts +99 -47
- package/src/cfg/generated/cfg__grpc__grpc_services/client.ts +6 -5
- package/src/cfg/generated/cfg__grpc__grpc_services/models.ts +51 -2
- package/src/cfg/generated/cfg__grpc__grpc_testing/models.ts +6 -6
- package/src/cfg/generated/cfg__knowbase/models.ts +12 -12
- package/src/cfg/generated/cfg__leads__lead_submission/models.ts +1 -1
- package/src/cfg/generated/cfg__newsletter/models.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__campaigns/models.ts +1 -1
- package/src/cfg/generated/cfg__newsletter__logs/models.ts +4 -4
- package/src/cfg/generated/cfg__newsletter__subscriptions/models.ts +1 -1
- package/src/cfg/generated/cfg__payments/models.ts +12 -12
- package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +2 -2
- package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +1 -1
- package/src/cfg/generated/cfg__rq__rq_queues/models.ts +1 -1
- package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +3 -3
- package/src/cfg/generated/cfg__rq__rq_testing/models.ts +2 -2
- package/src/cfg/generated/cfg__support/models.ts +2 -2
- package/src/cfg/generated/client.ts +3 -0
- package/src/cfg/generated/index.ts +17 -8
- package/src/cfg/generated/{schema.ts → schema.json} +19349 -18798
- package/src/index.ts +7 -2
- package/src/types/auth.ts +40 -0
- package/src/types/index.ts +7 -0
- package/src/cfg/contexts/AccountsContext.tsx +0 -205
- package/src/cfg/generated/_utils/schemas/ConnectionTokenRequestRequest.schema.ts +0 -20
- package/src/cfg/generated/_utils/schemas/MonitoringServiceStats.schema.ts +0 -24
- package/src/cfg/generated/_utils/schemas/ServiceList.schema.ts +0 -21
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { NewsletterSchema, type Newsletter } from '../schemas/Newsletter.schema'
|
|
33
34
|
import { PaginatedNewsletterListSchema, type PaginatedNewsletterList } from '../schemas/PaginatedNewsletterList.schema'
|
|
34
35
|
import { getAPIInstance } from '../../api-instance'
|
|
@@ -43,7 +44,35 @@ export async function getNewsletterNewslettersList( params?: { page?: number; p
|
|
|
43
44
|
): Promise<PaginatedNewsletterList> {
|
|
44
45
|
const api = client || getAPIInstance()
|
|
45
46
|
const response = await api.cfg_newsletters.newsletterNewslettersList(params?.page, params?.page_size)
|
|
46
|
-
|
|
47
|
+
try {
|
|
48
|
+
return PaginatedNewsletterListSchema.parse(response)
|
|
49
|
+
} catch (error) {
|
|
50
|
+
// Zod validation error - log detailed information
|
|
51
|
+
consola.error('❌ Zod Validation Failed');
|
|
52
|
+
consola.box({
|
|
53
|
+
title: 'getNewsletterNewslettersList',
|
|
54
|
+
message: `Path: /cfg/newsletter/newsletters/\nMethod: GET`,
|
|
55
|
+
style: {
|
|
56
|
+
borderColor: 'red',
|
|
57
|
+
borderStyle: 'rounded'
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
62
|
+
consola.error('Validation Issues:');
|
|
63
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
64
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
65
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
66
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
67
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
consola.error('Response data:', response);
|
|
72
|
+
|
|
73
|
+
// Re-throw the error
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
47
76
|
}
|
|
48
77
|
|
|
49
78
|
|
|
@@ -57,7 +86,35 @@ export async function getNewsletterNewslettersRetrieve( id: number, client?: a
|
|
|
57
86
|
): Promise<Newsletter> {
|
|
58
87
|
const api = client || getAPIInstance()
|
|
59
88
|
const response = await api.cfg_newsletters.newsletterNewslettersRetrieve(id)
|
|
60
|
-
|
|
89
|
+
try {
|
|
90
|
+
return NewsletterSchema.parse(response)
|
|
91
|
+
} catch (error) {
|
|
92
|
+
// Zod validation error - log detailed information
|
|
93
|
+
consola.error('❌ Zod Validation Failed');
|
|
94
|
+
consola.box({
|
|
95
|
+
title: 'getNewsletterNewslettersRetrieve',
|
|
96
|
+
message: `Path: /cfg/newsletter/newsletters/{id}/\nMethod: GET`,
|
|
97
|
+
style: {
|
|
98
|
+
borderColor: 'red',
|
|
99
|
+
borderStyle: 'rounded'
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
104
|
+
consola.error('Validation Issues:');
|
|
105
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
106
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
107
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
108
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
109
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
consola.error('Response data:', response);
|
|
114
|
+
|
|
115
|
+
// Re-throw the error
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
61
118
|
}
|
|
62
119
|
|
|
63
120
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { PaginatedNewsletterSubscriptionListSchema, type PaginatedNewsletterSubscriptionList } from '../schemas/PaginatedNewsletterSubscriptionList.schema'
|
|
33
34
|
import { SubscribeRequestSchema, type SubscribeRequest } from '../schemas/SubscribeRequest.schema'
|
|
34
35
|
import { SubscribeResponseSchema, type SubscribeResponse } from '../schemas/SubscribeResponse.schema'
|
|
@@ -46,7 +47,35 @@ export async function createNewsletterSubscribeCreate( data: SubscribeRequest,
|
|
|
46
47
|
): Promise<SubscribeResponse> {
|
|
47
48
|
const api = client || getAPIInstance()
|
|
48
49
|
const response = await api.cfg_subscriptions.newsletterSubscribeCreate(data)
|
|
49
|
-
|
|
50
|
+
try {
|
|
51
|
+
return SubscribeResponseSchema.parse(response)
|
|
52
|
+
} catch (error) {
|
|
53
|
+
// Zod validation error - log detailed information
|
|
54
|
+
consola.error('❌ Zod Validation Failed');
|
|
55
|
+
consola.box({
|
|
56
|
+
title: 'createNewsletterSubscribeCreate',
|
|
57
|
+
message: `Path: /cfg/newsletter/subscribe/\nMethod: POST`,
|
|
58
|
+
style: {
|
|
59
|
+
borderColor: 'red',
|
|
60
|
+
borderStyle: 'rounded'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
65
|
+
consola.error('Validation Issues:');
|
|
66
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
67
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
68
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
69
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
70
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
consola.error('Response data:', response);
|
|
75
|
+
|
|
76
|
+
// Re-throw the error
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
50
79
|
}
|
|
51
80
|
|
|
52
81
|
|
|
@@ -60,7 +89,35 @@ export async function getNewsletterSubscriptionsList( params?: { page?: number;
|
|
|
60
89
|
): Promise<PaginatedNewsletterSubscriptionList> {
|
|
61
90
|
const api = client || getAPIInstance()
|
|
62
91
|
const response = await api.cfg_subscriptions.newsletterSubscriptionsList(params?.page, params?.page_size)
|
|
63
|
-
|
|
92
|
+
try {
|
|
93
|
+
return PaginatedNewsletterSubscriptionListSchema.parse(response)
|
|
94
|
+
} catch (error) {
|
|
95
|
+
// Zod validation error - log detailed information
|
|
96
|
+
consola.error('❌ Zod Validation Failed');
|
|
97
|
+
consola.box({
|
|
98
|
+
title: 'getNewsletterSubscriptionsList',
|
|
99
|
+
message: `Path: /cfg/newsletter/subscriptions/\nMethod: GET`,
|
|
100
|
+
style: {
|
|
101
|
+
borderColor: 'red',
|
|
102
|
+
borderStyle: 'rounded'
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
107
|
+
consola.error('Validation Issues:');
|
|
108
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
109
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
110
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
111
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
112
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
consola.error('Response data:', response);
|
|
117
|
+
|
|
118
|
+
// Re-throw the error
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
64
121
|
}
|
|
65
122
|
|
|
66
123
|
|
|
@@ -74,7 +131,35 @@ export async function createNewsletterUnsubscribeCreate( data: UnsubscribeReque
|
|
|
74
131
|
): Promise<SuccessResponse> {
|
|
75
132
|
const api = client || getAPIInstance()
|
|
76
133
|
const response = await api.cfg_subscriptions.newsletterUnsubscribeCreate(data)
|
|
77
|
-
|
|
134
|
+
try {
|
|
135
|
+
return SuccessResponseSchema.parse(response)
|
|
136
|
+
} catch (error) {
|
|
137
|
+
// Zod validation error - log detailed information
|
|
138
|
+
consola.error('❌ Zod Validation Failed');
|
|
139
|
+
consola.box({
|
|
140
|
+
title: 'createNewsletterUnsubscribeCreate',
|
|
141
|
+
message: `Path: /cfg/newsletter/unsubscribe/\nMethod: POST`,
|
|
142
|
+
style: {
|
|
143
|
+
borderColor: 'red',
|
|
144
|
+
borderStyle: 'rounded'
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
149
|
+
consola.error('Validation Issues:');
|
|
150
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
151
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
152
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
153
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
154
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
consola.error('Response data:', response);
|
|
159
|
+
|
|
160
|
+
// Re-throw the error
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
78
163
|
}
|
|
79
164
|
|
|
80
165
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { BulkEmailResponseSchema, type BulkEmailResponse } from '../schemas/BulkEmailResponse.schema'
|
|
33
34
|
import { TestEmailRequestSchema, type TestEmailRequest } from '../schemas/TestEmailRequest.schema'
|
|
34
35
|
import { getAPIInstance } from '../../api-instance'
|
|
@@ -43,7 +44,35 @@ export async function createNewsletterTestCreate( data: TestEmailRequest, clie
|
|
|
43
44
|
): Promise<BulkEmailResponse> {
|
|
44
45
|
const api = client || getAPIInstance()
|
|
45
46
|
const response = await api.cfg_testing.newsletterTestCreate(data)
|
|
46
|
-
|
|
47
|
+
try {
|
|
48
|
+
return BulkEmailResponseSchema.parse(response)
|
|
49
|
+
} catch (error) {
|
|
50
|
+
// Zod validation error - log detailed information
|
|
51
|
+
consola.error('❌ Zod Validation Failed');
|
|
52
|
+
consola.box({
|
|
53
|
+
title: 'createNewsletterTestCreate',
|
|
54
|
+
message: `Path: /cfg/newsletter/test/\nMethod: POST`,
|
|
55
|
+
style: {
|
|
56
|
+
borderColor: 'red',
|
|
57
|
+
borderStyle: 'rounded'
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
62
|
+
consola.error('Validation Issues:');
|
|
63
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
64
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
65
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
66
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
67
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
consola.error('Response data:', response);
|
|
72
|
+
|
|
73
|
+
// Re-throw the error
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
47
76
|
}
|
|
48
77
|
|
|
49
78
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { BalanceSchema, type Balance } from '../schemas/Balance.schema'
|
|
33
34
|
import { PaginatedPaymentListListSchema, type PaginatedPaymentListList } from '../schemas/PaginatedPaymentListList.schema'
|
|
34
35
|
import { PaymentDetailSchema, type PaymentDetail } from '../schemas/PaymentDetail.schema'
|
|
@@ -45,7 +46,35 @@ export async function getPaymentsBalanceRetrieve( client?: any
|
|
|
45
46
|
): Promise<Balance> {
|
|
46
47
|
const api = client || getAPIInstance()
|
|
47
48
|
const response = await api.cfg_payments.balanceRetrieve()
|
|
48
|
-
|
|
49
|
+
try {
|
|
50
|
+
return BalanceSchema.parse(response)
|
|
51
|
+
} catch (error) {
|
|
52
|
+
// Zod validation error - log detailed information
|
|
53
|
+
consola.error('❌ Zod Validation Failed');
|
|
54
|
+
consola.box({
|
|
55
|
+
title: 'getPaymentsBalanceRetrieve',
|
|
56
|
+
message: `Path: /cfg/payments/balance/\nMethod: GET`,
|
|
57
|
+
style: {
|
|
58
|
+
borderColor: 'red',
|
|
59
|
+
borderStyle: 'rounded'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
64
|
+
consola.error('Validation Issues:');
|
|
65
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
66
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
67
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
68
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
69
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
consola.error('Response data:', response);
|
|
74
|
+
|
|
75
|
+
// Re-throw the error
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
49
78
|
}
|
|
50
79
|
|
|
51
80
|
|
|
@@ -73,7 +102,35 @@ export async function getPaymentsPaymentsList( params?: { page?: number; page_s
|
|
|
73
102
|
): Promise<PaginatedPaymentListList> {
|
|
74
103
|
const api = client || getAPIInstance()
|
|
75
104
|
const response = await api.cfg_payments.paymentsList(params?.page, params?.page_size)
|
|
76
|
-
|
|
105
|
+
try {
|
|
106
|
+
return PaginatedPaymentListListSchema.parse(response)
|
|
107
|
+
} catch (error) {
|
|
108
|
+
// Zod validation error - log detailed information
|
|
109
|
+
consola.error('❌ Zod Validation Failed');
|
|
110
|
+
consola.box({
|
|
111
|
+
title: 'getPaymentsPaymentsList',
|
|
112
|
+
message: `Path: /cfg/payments/payments/\nMethod: GET`,
|
|
113
|
+
style: {
|
|
114
|
+
borderColor: 'red',
|
|
115
|
+
borderStyle: 'rounded'
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
120
|
+
consola.error('Validation Issues:');
|
|
121
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
122
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
123
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
124
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
125
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
consola.error('Response data:', response);
|
|
130
|
+
|
|
131
|
+
// Re-throw the error
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
77
134
|
}
|
|
78
135
|
|
|
79
136
|
|
|
@@ -87,7 +144,35 @@ export async function getPaymentsPaymentsRetrieve( id: string, client?: any
|
|
|
87
144
|
): Promise<PaymentDetail> {
|
|
88
145
|
const api = client || getAPIInstance()
|
|
89
146
|
const response = await api.cfg_payments.paymentsRetrieve(id)
|
|
90
|
-
|
|
147
|
+
try {
|
|
148
|
+
return PaymentDetailSchema.parse(response)
|
|
149
|
+
} catch (error) {
|
|
150
|
+
// Zod validation error - log detailed information
|
|
151
|
+
consola.error('❌ Zod Validation Failed');
|
|
152
|
+
consola.box({
|
|
153
|
+
title: 'getPaymentsPaymentsRetrieve',
|
|
154
|
+
message: `Path: /cfg/payments/payments/{id}/\nMethod: GET`,
|
|
155
|
+
style: {
|
|
156
|
+
borderColor: 'red',
|
|
157
|
+
borderStyle: 'rounded'
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
162
|
+
consola.error('Validation Issues:');
|
|
163
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
164
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
165
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
166
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
167
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
consola.error('Response data:', response);
|
|
172
|
+
|
|
173
|
+
// Re-throw the error
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
91
176
|
}
|
|
92
177
|
|
|
93
178
|
|
|
@@ -101,7 +186,35 @@ export async function createPaymentsPaymentsConfirmCreate( id: string, client?
|
|
|
101
186
|
): Promise<PaymentList> {
|
|
102
187
|
const api = client || getAPIInstance()
|
|
103
188
|
const response = await api.cfg_payments.paymentsConfirmCreate(id)
|
|
104
|
-
|
|
189
|
+
try {
|
|
190
|
+
return PaymentListSchema.parse(response)
|
|
191
|
+
} catch (error) {
|
|
192
|
+
// Zod validation error - log detailed information
|
|
193
|
+
consola.error('❌ Zod Validation Failed');
|
|
194
|
+
consola.box({
|
|
195
|
+
title: 'createPaymentsPaymentsConfirmCreate',
|
|
196
|
+
message: `Path: /cfg/payments/payments/{id}/confirm/\nMethod: POST`,
|
|
197
|
+
style: {
|
|
198
|
+
borderColor: 'red',
|
|
199
|
+
borderStyle: 'rounded'
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
204
|
+
consola.error('Validation Issues:');
|
|
205
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
206
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
207
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
208
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
209
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
consola.error('Response data:', response);
|
|
214
|
+
|
|
215
|
+
// Re-throw the error
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
105
218
|
}
|
|
106
219
|
|
|
107
220
|
|
|
@@ -115,7 +228,35 @@ export async function getPaymentsPaymentsStatusRetrieve( id: string, client?:
|
|
|
115
228
|
): Promise<PaymentList> {
|
|
116
229
|
const api = client || getAPIInstance()
|
|
117
230
|
const response = await api.cfg_payments.paymentsStatusRetrieve(id)
|
|
118
|
-
|
|
231
|
+
try {
|
|
232
|
+
return PaymentListSchema.parse(response)
|
|
233
|
+
} catch (error) {
|
|
234
|
+
// Zod validation error - log detailed information
|
|
235
|
+
consola.error('❌ Zod Validation Failed');
|
|
236
|
+
consola.box({
|
|
237
|
+
title: 'getPaymentsPaymentsStatusRetrieve',
|
|
238
|
+
message: `Path: /cfg/payments/payments/{id}/status/\nMethod: GET`,
|
|
239
|
+
style: {
|
|
240
|
+
borderColor: 'red',
|
|
241
|
+
borderStyle: 'rounded'
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
246
|
+
consola.error('Validation Issues:');
|
|
247
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
248
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
249
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
250
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
251
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
consola.error('Response data:', response);
|
|
256
|
+
|
|
257
|
+
// Re-throw the error
|
|
258
|
+
throw error;
|
|
259
|
+
}
|
|
119
260
|
}
|
|
120
261
|
|
|
121
262
|
|
|
@@ -129,7 +270,35 @@ export async function createPaymentsPaymentsCreateCreate( client?: any
|
|
|
129
270
|
): Promise<PaymentList> {
|
|
130
271
|
const api = client || getAPIInstance()
|
|
131
272
|
const response = await api.cfg_payments.paymentsCreateCreate()
|
|
132
|
-
|
|
273
|
+
try {
|
|
274
|
+
return PaymentListSchema.parse(response)
|
|
275
|
+
} catch (error) {
|
|
276
|
+
// Zod validation error - log detailed information
|
|
277
|
+
consola.error('❌ Zod Validation Failed');
|
|
278
|
+
consola.box({
|
|
279
|
+
title: 'createPaymentsPaymentsCreateCreate',
|
|
280
|
+
message: `Path: /cfg/payments/payments/create/\nMethod: POST`,
|
|
281
|
+
style: {
|
|
282
|
+
borderColor: 'red',
|
|
283
|
+
borderStyle: 'rounded'
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
288
|
+
consola.error('Validation Issues:');
|
|
289
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
290
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
291
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
292
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
293
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
consola.error('Response data:', response);
|
|
298
|
+
|
|
299
|
+
// Re-throw the error
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
133
302
|
}
|
|
134
303
|
|
|
135
304
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* const users = await getUsers({ page: 1 }, api)
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
+
import { consola } from 'consola'
|
|
32
33
|
import { JobActionResponseSchema, type JobActionResponse } from '../schemas/JobActionResponse.schema'
|
|
33
34
|
import { JobDetailSchema, type JobDetail } from '../schemas/JobDetail.schema'
|
|
34
35
|
import { JobListRequestSchema, type JobListRequest } from '../schemas/JobListRequest.schema'
|
|
@@ -45,7 +46,35 @@ export async function getRqJobsList( params?: { page?: number; page_size?: numb
|
|
|
45
46
|
): Promise<PaginatedJobListList> {
|
|
46
47
|
const api = client || getAPIInstance()
|
|
47
48
|
const response = await api.cfg_rq_jobs.list(params?.page, params?.page_size, params?.queue, params?.status)
|
|
48
|
-
|
|
49
|
+
try {
|
|
50
|
+
return PaginatedJobListListSchema.parse(response)
|
|
51
|
+
} catch (error) {
|
|
52
|
+
// Zod validation error - log detailed information
|
|
53
|
+
consola.error('❌ Zod Validation Failed');
|
|
54
|
+
consola.box({
|
|
55
|
+
title: 'getRqJobsList',
|
|
56
|
+
message: `Path: /cfg/rq/jobs/\nMethod: GET`,
|
|
57
|
+
style: {
|
|
58
|
+
borderColor: 'red',
|
|
59
|
+
borderStyle: 'rounded'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
64
|
+
consola.error('Validation Issues:');
|
|
65
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
66
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
67
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
68
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
69
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
consola.error('Response data:', response);
|
|
74
|
+
|
|
75
|
+
// Re-throw the error
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
49
78
|
}
|
|
50
79
|
|
|
51
80
|
|
|
@@ -59,7 +88,35 @@ export async function getRqJobsRetrieve( id: string, client?: any
|
|
|
59
88
|
): Promise<JobDetail> {
|
|
60
89
|
const api = client || getAPIInstance()
|
|
61
90
|
const response = await api.cfg_rq_jobs.retrieve(id)
|
|
62
|
-
|
|
91
|
+
try {
|
|
92
|
+
return JobDetailSchema.parse(response)
|
|
93
|
+
} catch (error) {
|
|
94
|
+
// Zod validation error - log detailed information
|
|
95
|
+
consola.error('❌ Zod Validation Failed');
|
|
96
|
+
consola.box({
|
|
97
|
+
title: 'getRqJobsRetrieve',
|
|
98
|
+
message: `Path: /cfg/rq/jobs/{id}/\nMethod: GET`,
|
|
99
|
+
style: {
|
|
100
|
+
borderColor: 'red',
|
|
101
|
+
borderStyle: 'rounded'
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
106
|
+
consola.error('Validation Issues:');
|
|
107
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
108
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
109
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
110
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
111
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
consola.error('Response data:', response);
|
|
116
|
+
|
|
117
|
+
// Re-throw the error
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
63
120
|
}
|
|
64
121
|
|
|
65
122
|
|
|
@@ -73,7 +130,35 @@ export async function deleteRqJobsDestroy( id: string, client?: any
|
|
|
73
130
|
): Promise<JobActionResponse> {
|
|
74
131
|
const api = client || getAPIInstance()
|
|
75
132
|
const response = await api.cfg_rq_jobs.destroy(id)
|
|
76
|
-
|
|
133
|
+
try {
|
|
134
|
+
return JobActionResponseSchema.parse(response)
|
|
135
|
+
} catch (error) {
|
|
136
|
+
// Zod validation error - log detailed information
|
|
137
|
+
consola.error('❌ Zod Validation Failed');
|
|
138
|
+
consola.box({
|
|
139
|
+
title: 'deleteRqJobsDestroy',
|
|
140
|
+
message: `Path: /cfg/rq/jobs/{id}/\nMethod: DELETE`,
|
|
141
|
+
style: {
|
|
142
|
+
borderColor: 'red',
|
|
143
|
+
borderStyle: 'rounded'
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
148
|
+
consola.error('Validation Issues:');
|
|
149
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
150
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
151
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
152
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
153
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
consola.error('Response data:', response);
|
|
158
|
+
|
|
159
|
+
// Re-throw the error
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
77
162
|
}
|
|
78
163
|
|
|
79
164
|
|
|
@@ -87,7 +172,35 @@ export async function createRqJobsCancelCreate( id: string, data: JobListReques
|
|
|
87
172
|
): Promise<JobActionResponse> {
|
|
88
173
|
const api = client || getAPIInstance()
|
|
89
174
|
const response = await api.cfg_rq_jobs.cancelCreate(id, data)
|
|
90
|
-
|
|
175
|
+
try {
|
|
176
|
+
return JobActionResponseSchema.parse(response)
|
|
177
|
+
} catch (error) {
|
|
178
|
+
// Zod validation error - log detailed information
|
|
179
|
+
consola.error('❌ Zod Validation Failed');
|
|
180
|
+
consola.box({
|
|
181
|
+
title: 'createRqJobsCancelCreate',
|
|
182
|
+
message: `Path: /cfg/rq/jobs/{id}/cancel/\nMethod: POST`,
|
|
183
|
+
style: {
|
|
184
|
+
borderColor: 'red',
|
|
185
|
+
borderStyle: 'rounded'
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
190
|
+
consola.error('Validation Issues:');
|
|
191
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
192
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
193
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
194
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
195
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
consola.error('Response data:', response);
|
|
200
|
+
|
|
201
|
+
// Re-throw the error
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
91
204
|
}
|
|
92
205
|
|
|
93
206
|
|
|
@@ -101,7 +214,35 @@ export async function createRqJobsRequeueCreate( id: string, data: JobListReque
|
|
|
101
214
|
): Promise<JobActionResponse> {
|
|
102
215
|
const api = client || getAPIInstance()
|
|
103
216
|
const response = await api.cfg_rq_jobs.requeueCreate(id, data)
|
|
104
|
-
|
|
217
|
+
try {
|
|
218
|
+
return JobActionResponseSchema.parse(response)
|
|
219
|
+
} catch (error) {
|
|
220
|
+
// Zod validation error - log detailed information
|
|
221
|
+
consola.error('❌ Zod Validation Failed');
|
|
222
|
+
consola.box({
|
|
223
|
+
title: 'createRqJobsRequeueCreate',
|
|
224
|
+
message: `Path: /cfg/rq/jobs/{id}/requeue/\nMethod: POST`,
|
|
225
|
+
style: {
|
|
226
|
+
borderColor: 'red',
|
|
227
|
+
borderStyle: 'rounded'
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
232
|
+
consola.error('Validation Issues:');
|
|
233
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
234
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
235
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
236
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
237
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
consola.error('Response data:', response);
|
|
242
|
+
|
|
243
|
+
// Re-throw the error
|
|
244
|
+
throw error;
|
|
245
|
+
}
|
|
105
246
|
}
|
|
106
247
|
|
|
107
248
|
|