@djangocfg/api 1.2.18 → 1.2.20

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.
Files changed (91) hide show
  1. package/dist/index.cjs +13762 -11037
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +5828 -2659
  4. package/dist/index.d.ts +5828 -2659
  5. package/dist/index.mjs +11188 -8496
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_monitoring.ts +122 -0
  9. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_jobs.ts +105 -0
  10. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_monitoring.ts +77 -0
  11. package/src/cfg/generated/_utils/fetchers/{cfg__dashboard.ts → cfg__rq__rq_queues.ts} +21 -20
  12. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_registries.ts +132 -0
  13. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_schedules.ts +92 -0
  14. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_testing.ts +120 -0
  15. package/src/cfg/generated/_utils/fetchers/cfg__rq__rq_workers.ts +62 -0
  16. package/src/cfg/generated/_utils/fetchers/index.ts +8 -2
  17. package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_monitoring.ts +110 -0
  18. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_jobs.ts +106 -0
  19. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_monitoring.ts +65 -0
  20. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_queues.ts +82 -0
  21. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_registries.ts +132 -0
  22. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_schedules.ts +89 -0
  23. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_testing.ts +124 -0
  24. package/src/cfg/generated/_utils/hooks/cfg__rq__rq_workers.ts +50 -0
  25. package/src/cfg/generated/_utils/hooks/index.ts +8 -2
  26. package/src/cfg/generated/_utils/schemas/JobActionResponse.schema.ts +26 -0
  27. package/src/cfg/generated/_utils/schemas/JobDetail.schema.ts +40 -0
  28. package/src/cfg/generated/_utils/schemas/JobList.schema.ts +28 -0
  29. package/src/cfg/generated/_utils/schemas/MethodList.schema.ts +21 -0
  30. package/src/cfg/generated/_utils/schemas/MethodStatsSerializer.schema.ts +25 -0
  31. package/src/cfg/generated/_utils/schemas/QueueDetail.schema.ts +34 -0
  32. package/src/cfg/generated/_utils/schemas/QueueStats.schema.ts +31 -0
  33. package/src/cfg/generated/_utils/schemas/RQConfig.schema.ts +29 -0
  34. package/src/cfg/generated/_utils/schemas/RecentRequests.schema.ts +23 -0
  35. package/src/cfg/generated/_utils/schemas/RunDemoRequestRequest.schema.ts +24 -0
  36. package/src/cfg/generated/_utils/schemas/ScheduleActionResponse.schema.ts +22 -0
  37. package/src/cfg/generated/_utils/schemas/ScheduleCreateRequest.schema.ts +39 -0
  38. package/src/cfg/generated/_utils/schemas/ScheduledJob.schema.ts +32 -0
  39. package/src/cfg/generated/_utils/schemas/ServiceList.schema.ts +21 -0
  40. package/src/cfg/generated/_utils/schemas/ServiceStatsSerializer.schema.ts +24 -0
  41. package/src/cfg/generated/_utils/schemas/StressTestRequestRequest.schema.ts +23 -0
  42. package/src/cfg/generated/_utils/schemas/TestScenario.schema.ts +25 -0
  43. package/src/cfg/generated/_utils/schemas/TestingActionResponse.schema.ts +23 -0
  44. package/src/cfg/generated/_utils/schemas/Worker.schema.ts +31 -0
  45. package/src/cfg/generated/_utils/schemas/WorkerStats.schema.ts +31 -0
  46. package/src/cfg/generated/_utils/schemas/index.ts +20 -10
  47. package/src/cfg/generated/cfg__grpc__grpc_monitoring/client.ts +129 -0
  48. package/src/cfg/generated/cfg__grpc__grpc_monitoring/models.ts +124 -0
  49. package/src/cfg/generated/cfg__rq__rq_jobs/client.ts +76 -0
  50. package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +62 -0
  51. package/src/cfg/generated/cfg__rq__rq_monitoring/client.ts +45 -0
  52. package/src/cfg/generated/cfg__rq__rq_monitoring/index.ts +2 -0
  53. package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +39 -0
  54. package/src/cfg/generated/cfg__rq__rq_queues/client.ts +78 -0
  55. package/src/cfg/generated/cfg__rq__rq_queues/index.ts +2 -0
  56. package/src/cfg/generated/cfg__rq__rq_queues/models.ts +33 -0
  57. package/src/cfg/generated/cfg__rq__rq_registries/client.ts +161 -0
  58. package/src/cfg/generated/cfg__rq__rq_registries/index.ts +2 -0
  59. package/src/cfg/generated/cfg__rq__rq_registries/models.ts +17 -0
  60. package/src/cfg/generated/cfg__rq__rq_schedules/client.ts +91 -0
  61. package/src/cfg/generated/cfg__rq__rq_schedules/index.ts +2 -0
  62. package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +84 -0
  63. package/src/cfg/generated/cfg__rq__rq_testing/client.ts +96 -0
  64. package/src/cfg/generated/cfg__rq__rq_testing/index.ts +2 -0
  65. package/src/cfg/generated/cfg__rq__rq_testing/models.ts +68 -0
  66. package/src/cfg/generated/cfg__rq__rq_workers/client.ts +46 -0
  67. package/src/cfg/generated/cfg__rq__rq_workers/index.ts +2 -0
  68. package/src/cfg/generated/cfg__rq__rq_workers/models.ts +52 -0
  69. package/src/cfg/generated/client.ts +24 -6
  70. package/src/cfg/generated/enums.ts +36 -60
  71. package/src/cfg/generated/index.ts +40 -10
  72. package/src/cfg/generated/schema.ts +6391 -4704
  73. package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +0 -123
  74. package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +0 -77
  75. package/src/cfg/generated/_utils/hooks/cfg__tasks.ts +0 -111
  76. package/src/cfg/generated/_utils/schemas/PaginatedTaskLogListList.schema.ts +0 -24
  77. package/src/cfg/generated/_utils/schemas/TaskLog.schema.ts +0 -42
  78. package/src/cfg/generated/_utils/schemas/TaskLogDetail.schema.ts +0 -50
  79. package/src/cfg/generated/_utils/schemas/TaskLogList.schema.ts +0 -35
  80. package/src/cfg/generated/_utils/schemas/TaskLogOverview.schema.ts +0 -43
  81. package/src/cfg/generated/_utils/schemas/TaskLogStats.schema.ts +0 -30
  82. package/src/cfg/generated/_utils/schemas/TaskLogTimeline.schema.ts +0 -28
  83. package/src/cfg/generated/_utils/schemas/TaskLogTimelineItem.schema.ts +0 -28
  84. package/src/cfg/generated/_utils/schemas/TasksByQueue.schema.ts +0 -24
  85. package/src/cfg/generated/_utils/schemas/TasksByStatus.schema.ts +0 -24
  86. package/src/cfg/generated/cfg__dashboard/client.ts +0 -48
  87. package/src/cfg/generated/cfg__dashboard/models.ts +0 -0
  88. package/src/cfg/generated/cfg__tasks/client.ts +0 -104
  89. package/src/cfg/generated/cfg__tasks/models.ts +0 -285
  90. /package/src/cfg/generated/{cfg__dashboard → cfg__grpc__grpc_monitoring}/index.ts +0 -0
  91. /package/src/cfg/generated/{cfg__tasks → cfg__rq__rq_jobs}/index.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "1.2.18",
3
+ "version": "1.2.20",
4
4
  "author": {
5
5
  "name": "DjangoCFG",
6
6
  "url": "https://djangocfg.com"
@@ -68,7 +68,7 @@
68
68
  "@types/node": "^22.15.3",
69
69
  "@types/react": "19.2.2",
70
70
  "@types/react-dom": "19.2.1",
71
- "@djangocfg/typescript-config": "^1.2.18",
71
+ "@djangocfg/typescript-config": "^1.2.20",
72
72
  "react": "^19.1.0",
73
73
  "react-dom": "^19.1.0",
74
74
  "tsup": "^8.5.0",
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Typed fetchers for Grpc Monitoring
3
+ *
4
+ * Universal functions that work in any environment:
5
+ * - Next.js (App Router / Pages Router / Server Components)
6
+ * - React Native
7
+ * - Node.js backend
8
+ *
9
+ * These fetchers use Zod schemas for runtime validation.
10
+ *
11
+ * Usage:
12
+ * ```typescript
13
+ * // Configure API once (in your app entry point)
14
+ * import { configureAPI } from '../../api-instance'
15
+ * configureAPI({ baseUrl: 'https://api.example.com' })
16
+ *
17
+ * // Then use fetchers anywhere
18
+ * const users = await getUsers({ page: 1 })
19
+ *
20
+ * // With SWR
21
+ * const { data } = useSWR(['users', params], () => getUsers(params))
22
+ *
23
+ * // With React Query
24
+ * const { data } = useQuery(['users', params], () => getUsers(params))
25
+ *
26
+ * // In Server Component or SSR (pass custom client)
27
+ * import { API } from '../../index'
28
+ * const api = new API('https://api.example.com')
29
+ * const users = await getUsers({ page: 1 }, api)
30
+ * ```
31
+ */
32
+ import { HealthCheckSchema, type HealthCheck } from '../schemas/HealthCheck.schema'
33
+ import { MethodListSchema, type MethodList } from '../schemas/MethodList.schema'
34
+ import { OverviewStatsSchema, type OverviewStats } from '../schemas/OverviewStats.schema'
35
+ import { RecentRequestsSchema, type RecentRequests } from '../schemas/RecentRequests.schema'
36
+ import { ServiceListSchema, type ServiceList } from '../schemas/ServiceList.schema'
37
+ import { getAPIInstance } from '../../api-instance'
38
+
39
+ /**
40
+ * Get gRPC health status
41
+ *
42
+ * @method GET
43
+ * @path /cfg/grpc/monitor/health/
44
+ */
45
+ export async function getGrpcMonitorHealthRetrieve( client?: any
46
+ ): Promise<HealthCheck> {
47
+ const api = client || getAPIInstance()
48
+ const response = await api.cfg_grpc_monitoring.grpcMonitorHealthRetrieve()
49
+ return HealthCheckSchema.parse(response)
50
+ }
51
+
52
+
53
+ /**
54
+ * Get method statistics
55
+ *
56
+ * @method GET
57
+ * @path /cfg/grpc/monitor/methods/
58
+ */
59
+ export async function getGrpcMonitorMethodsRetrieve( params?: { hours?: number; service?: string }, client?: any
60
+ ): Promise<MethodList> {
61
+ const api = client || getAPIInstance()
62
+ const response = await api.cfg_grpc_monitoring.grpcMonitorMethodsRetrieve(params?.hours, params?.service)
63
+ return MethodListSchema.parse(response)
64
+ }
65
+
66
+
67
+ /**
68
+ * Get overview statistics
69
+ *
70
+ * @method GET
71
+ * @path /cfg/grpc/monitor/overview/
72
+ */
73
+ export async function getGrpcMonitorOverviewRetrieve( params?: { hours?: number }, client?: any
74
+ ): Promise<OverviewStats> {
75
+ const api = client || getAPIInstance()
76
+ const response = await api.cfg_grpc_monitoring.grpcMonitorOverviewRetrieve(params?.hours)
77
+ return OverviewStatsSchema.parse(response)
78
+ }
79
+
80
+
81
+ /**
82
+ * Get recent requests
83
+ *
84
+ * @method GET
85
+ * @path /cfg/grpc/monitor/requests/
86
+ */
87
+ export async function getGrpcMonitorRequestsRetrieve( params?: { count?: number; method?: string; offset?: number; service?: string; status?: string }, client?: any
88
+ ): Promise<RecentRequests> {
89
+ const api = client || getAPIInstance()
90
+ const response = await api.cfg_grpc_monitoring.grpcMonitorRequestsRetrieve(params?.count, params?.method, params?.offset, params?.service, params?.status)
91
+ return RecentRequestsSchema.parse(response)
92
+ }
93
+
94
+
95
+ /**
96
+ * Get service statistics
97
+ *
98
+ * @method GET
99
+ * @path /cfg/grpc/monitor/services/
100
+ */
101
+ export async function getGrpcMonitorServicesRetrieve( params?: { hours?: number }, client?: any
102
+ ): Promise<ServiceList> {
103
+ const api = client || getAPIInstance()
104
+ const response = await api.cfg_grpc_monitoring.grpcMonitorServicesRetrieve(params?.hours)
105
+ return ServiceListSchema.parse(response)
106
+ }
107
+
108
+
109
+ /**
110
+ * Get request timeline
111
+ *
112
+ * @method GET
113
+ * @path /cfg/grpc/monitor/timeline/
114
+ */
115
+ export async function getGrpcMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: any
116
+ ): Promise<any> {
117
+ const api = client || getAPIInstance()
118
+ const response = await api.cfg_grpc_monitoring.grpcMonitorTimelineRetrieve(params?.hours, params?.interval)
119
+ return response
120
+ }
121
+
122
+
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Typed fetchers for RQ Jobs
3
+ *
4
+ * Universal functions that work in any environment:
5
+ * - Next.js (App Router / Pages Router / Server Components)
6
+ * - React Native
7
+ * - Node.js backend
8
+ *
9
+ * These fetchers use Zod schemas for runtime validation.
10
+ *
11
+ * Usage:
12
+ * ```typescript
13
+ * // Configure API once (in your app entry point)
14
+ * import { configureAPI } from '../../api-instance'
15
+ * configureAPI({ baseUrl: 'https://api.example.com' })
16
+ *
17
+ * // Then use fetchers anywhere
18
+ * const users = await getUsers({ page: 1 })
19
+ *
20
+ * // With SWR
21
+ * const { data } = useSWR(['users', params], () => getUsers(params))
22
+ *
23
+ * // With React Query
24
+ * const { data } = useQuery(['users', params], () => getUsers(params))
25
+ *
26
+ * // In Server Component or SSR (pass custom client)
27
+ * import { API } from '../../index'
28
+ * const api = new API('https://api.example.com')
29
+ * const users = await getUsers({ page: 1 }, api)
30
+ * ```
31
+ */
32
+ import { JobActionResponseSchema, type JobActionResponse } from '../schemas/JobActionResponse.schema'
33
+ import { JobDetailSchema, type JobDetail } from '../schemas/JobDetail.schema'
34
+ import { getAPIInstance } from '../../api-instance'
35
+
36
+ /**
37
+ * List all jobs
38
+ *
39
+ * @method GET
40
+ * @path /cfg/rq/jobs/
41
+ */
42
+ export async function getRqJobsList( params?: { queue?: string; status?: string }, client?: any
43
+ ): Promise<any> {
44
+ const api = client || getAPIInstance()
45
+ const response = await api.cfg_rq_jobs.list(params?.queue, params?.status)
46
+ return response
47
+ }
48
+
49
+
50
+ /**
51
+ * Get job details
52
+ *
53
+ * @method GET
54
+ * @path /cfg/rq/jobs/{id}/
55
+ */
56
+ export async function getRqJobsRetrieve( id: string, client?: any
57
+ ): Promise<JobDetail> {
58
+ const api = client || getAPIInstance()
59
+ const response = await api.cfg_rq_jobs.retrieve(id)
60
+ return JobDetailSchema.parse(response)
61
+ }
62
+
63
+
64
+ /**
65
+ * Delete job
66
+ *
67
+ * @method DELETE
68
+ * @path /cfg/rq/jobs/{id}/
69
+ */
70
+ export async function deleteRqJobsDestroy( id: string, client?: any
71
+ ): Promise<JobActionResponse> {
72
+ const api = client || getAPIInstance()
73
+ const response = await api.cfg_rq_jobs.destroy(id)
74
+ return JobActionResponseSchema.parse(response)
75
+ }
76
+
77
+
78
+ /**
79
+ * Cancel job
80
+ *
81
+ * @method POST
82
+ * @path /cfg/rq/jobs/{id}/cancel/
83
+ */
84
+ export async function createRqJobsCancelCreate( id: string, client?: any
85
+ ): Promise<JobActionResponse> {
86
+ const api = client || getAPIInstance()
87
+ const response = await api.cfg_rq_jobs.cancelCreate(id)
88
+ return JobActionResponseSchema.parse(response)
89
+ }
90
+
91
+
92
+ /**
93
+ * Requeue job
94
+ *
95
+ * @method POST
96
+ * @path /cfg/rq/jobs/{id}/requeue/
97
+ */
98
+ export async function createRqJobsRequeueCreate( id: string, client?: any
99
+ ): Promise<JobActionResponse> {
100
+ const api = client || getAPIInstance()
101
+ const response = await api.cfg_rq_jobs.requeueCreate(id)
102
+ return JobActionResponseSchema.parse(response)
103
+ }
104
+
105
+
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Typed fetchers for RQ Monitoring
3
+ *
4
+ * Universal functions that work in any environment:
5
+ * - Next.js (App Router / Pages Router / Server Components)
6
+ * - React Native
7
+ * - Node.js backend
8
+ *
9
+ * These fetchers use Zod schemas for runtime validation.
10
+ *
11
+ * Usage:
12
+ * ```typescript
13
+ * // Configure API once (in your app entry point)
14
+ * import { configureAPI } from '../../api-instance'
15
+ * configureAPI({ baseUrl: 'https://api.example.com' })
16
+ *
17
+ * // Then use fetchers anywhere
18
+ * const users = await getUsers({ page: 1 })
19
+ *
20
+ * // With SWR
21
+ * const { data } = useSWR(['users', params], () => getUsers(params))
22
+ *
23
+ * // With React Query
24
+ * const { data } = useQuery(['users', params], () => getUsers(params))
25
+ *
26
+ * // In Server Component or SSR (pass custom client)
27
+ * import { API } from '../../index'
28
+ * const api = new API('https://api.example.com')
29
+ * const users = await getUsers({ page: 1 }, api)
30
+ * ```
31
+ */
32
+ import { HealthCheckSchema, type HealthCheck } from '../schemas/HealthCheck.schema'
33
+ import { RQConfigSchema, type RQConfig } from '../schemas/RQConfig.schema'
34
+ import { getAPIInstance } from '../../api-instance'
35
+
36
+ /**
37
+ * Get RQ configuration
38
+ *
39
+ * @method GET
40
+ * @path /cfg/rq/monitor/config/
41
+ */
42
+ export async function getRqMonitorConfigRetrieve( client?: any
43
+ ): Promise<RQConfig> {
44
+ const api = client || getAPIInstance()
45
+ const response = await api.cfg_rq_monitoring.rqMonitorConfigRetrieve()
46
+ return RQConfigSchema.parse(response)
47
+ }
48
+
49
+
50
+ /**
51
+ * Health check
52
+ *
53
+ * @method GET
54
+ * @path /cfg/rq/monitor/health/
55
+ */
56
+ export async function getRqMonitorHealthRetrieve( client?: any
57
+ ): Promise<HealthCheck> {
58
+ const api = client || getAPIInstance()
59
+ const response = await api.cfg_rq_monitoring.rqMonitorHealthRetrieve()
60
+ return HealthCheckSchema.parse(response)
61
+ }
62
+
63
+
64
+ /**
65
+ * Prometheus metrics
66
+ *
67
+ * @method GET
68
+ * @path /cfg/rq/monitor/metrics/
69
+ */
70
+ export async function getRqMonitorMetricsRetrieve( client?: any
71
+ ): Promise<any> {
72
+ const api = client || getAPIInstance()
73
+ const response = await api.cfg_rq_monitoring.rqMonitorMetricsRetrieve()
74
+ return response
75
+ }
76
+
77
+
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Typed fetchers for Dashboard
2
+ * Typed fetchers for RQ Queues
3
3
  *
4
4
  * Universal functions that work in any environment:
5
5
  * - Next.js (App Router / Pages Router / Server Components)
@@ -29,60 +29,61 @@
29
29
  * const users = await getUsers({ page: 1 }, api)
30
30
  * ```
31
31
  */
32
+ import { QueueDetailSchema, type QueueDetail } from '../schemas/QueueDetail.schema'
32
33
  import { getAPIInstance } from '../../api-instance'
33
34
 
34
35
  /**
35
- * API operation
36
+ * List all queues
36
37
  *
37
38
  * @method GET
38
- * @path /cfg/dashboard/api/django_q2/
39
+ * @path /cfg/rq/queues/
39
40
  */
40
- export async function getDashboardApiDjangoQ2Retrieve( client?: any
41
+ export async function getRqQueuesList( params?: { name?: string }, client?: any
41
42
  ): Promise<any> {
42
43
  const api = client || getAPIInstance()
43
- const response = await api.cfg_dashboard.apiDjangoQ2Retrieve()
44
+ const response = await api.cfg_rq_queues.list(params?.name)
44
45
  return response
45
46
  }
46
47
 
47
48
 
48
49
  /**
49
- * API operation
50
+ * Get queue details
50
51
  *
51
52
  * @method GET
52
- * @path /cfg/dashboard/api/django_q2/schedules/
53
+ * @path /cfg/rq/queues/{id}/
53
54
  */
54
- export async function getDashboardApiDjangoQ2SchedulesRetrieve( client?: any
55
- ): Promise<any> {
55
+ export async function getRqQueuesRetrieve( id: string, client?: any
56
+ ): Promise<QueueDetail> {
56
57
  const api = client || getAPIInstance()
57
- const response = await api.cfg_dashboard.apiDjangoQ2SchedulesRetrieve()
58
- return response
58
+ const response = await api.cfg_rq_queues.retrieve(id)
59
+ return QueueDetailSchema.parse(response)
59
60
  }
60
61
 
61
62
 
62
63
  /**
63
- * API operation
64
+ * Empty queue
64
65
  *
65
- * @method GET
66
- * @path /cfg/dashboard/api/django_q2/status/
66
+ * @method POST
67
+ * @path /cfg/rq/queues/{id}/empty/
67
68
  */
68
- export async function getDashboardApiDjangoQ2StatusRetrieve( client?: any
69
+ export async function createRqQueuesEmptyCreate( id: string, client?: any
69
70
  ): Promise<any> {
70
71
  const api = client || getAPIInstance()
71
- const response = await api.cfg_dashboard.apiDjangoQ2StatusRetrieve()
72
+ const response = await api.cfg_rq_queues.emptyCreate(id)
72
73
  return response
73
74
  }
74
75
 
75
76
 
76
77
  /**
77
- * API operation
78
+ * Get queue jobs
78
79
  *
79
80
  * @method GET
80
- * @path /cfg/dashboard/api/django_q2/tasks/
81
+ * @path /cfg/rq/queues/{id}/jobs/
81
82
  */
82
- export async function getDashboardApiDjangoQ2TasksRetrieve( client?: any
83
+ export async function getRqQueuesJobsRetrieve( id: string, params?: { limit?: number; offset?: number }, client?: any
83
84
  ): Promise<any> {
84
85
  const api = client || getAPIInstance()
85
- const response = await api.cfg_dashboard.apiDjangoQ2TasksRetrieve()
86
+ const response = await api.cfg_rq_queues.jobsRetrieve(id, params?.limit, params?.offset)
86
87
  return response
87
88
  }
88
89
 
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Typed fetchers for RQ Registries
3
+ *
4
+ * Universal functions that work in any environment:
5
+ * - Next.js (App Router / Pages Router / Server Components)
6
+ * - React Native
7
+ * - Node.js backend
8
+ *
9
+ * These fetchers use Zod schemas for runtime validation.
10
+ *
11
+ * Usage:
12
+ * ```typescript
13
+ * // Configure API once (in your app entry point)
14
+ * import { configureAPI } from '../../api-instance'
15
+ * configureAPI({ baseUrl: 'https://api.example.com' })
16
+ *
17
+ * // Then use fetchers anywhere
18
+ * const users = await getUsers({ page: 1 })
19
+ *
20
+ * // With SWR
21
+ * const { data } = useSWR(['users', params], () => getUsers(params))
22
+ *
23
+ * // With React Query
24
+ * const { data } = useQuery(['users', params], () => getUsers(params))
25
+ *
26
+ * // In Server Component or SSR (pass custom client)
27
+ * import { API } from '../../index'
28
+ * const api = new API('https://api.example.com')
29
+ * const users = await getUsers({ page: 1 }, api)
30
+ * ```
31
+ */
32
+ import { JobActionResponseSchema, type JobActionResponse } from '../schemas/JobActionResponse.schema'
33
+ import { getAPIInstance } from '../../api-instance'
34
+
35
+ /**
36
+ * List deferred jobs
37
+ *
38
+ * @method GET
39
+ * @path /cfg/rq/jobs/registries/deferred/
40
+ */
41
+ export async function getRqJobsRegistriesDeferredList( params?: { queue?: string }, client?: any
42
+ ): Promise<any> {
43
+ const api = client || getAPIInstance()
44
+ const response = await api.cfg_rq_registries.rqJobsRegistriesDeferredList(params?.queue)
45
+ return response
46
+ }
47
+
48
+
49
+ /**
50
+ * List failed jobs
51
+ *
52
+ * @method GET
53
+ * @path /cfg/rq/jobs/registries/failed/
54
+ */
55
+ export async function getRqJobsRegistriesFailedList( params?: { queue?: string }, client?: any
56
+ ): Promise<any> {
57
+ const api = client || getAPIInstance()
58
+ const response = await api.cfg_rq_registries.rqJobsRegistriesFailedList(params?.queue)
59
+ return response
60
+ }
61
+
62
+
63
+ /**
64
+ * Clear failed jobs registry
65
+ *
66
+ * @method POST
67
+ * @path /cfg/rq/jobs/registries/failed/clear/
68
+ */
69
+ export async function createRqJobsRegistriesFailedClearCreate( params: { queue: string }, client?: any
70
+ ): Promise<JobActionResponse> {
71
+ const api = client || getAPIInstance()
72
+ const response = await api.cfg_rq_registries.rqJobsRegistriesFailedClearCreate(params.queue)
73
+ return JobActionResponseSchema.parse(response)
74
+ }
75
+
76
+
77
+ /**
78
+ * Requeue all failed jobs
79
+ *
80
+ * @method POST
81
+ * @path /cfg/rq/jobs/registries/failed/requeue-all/
82
+ */
83
+ export async function createRqJobsRegistriesFailedRequeueAllCreate( params: { queue: string }, client?: any
84
+ ): Promise<JobActionResponse> {
85
+ const api = client || getAPIInstance()
86
+ const response = await api.cfg_rq_registries.rqJobsRegistriesFailedRequeueAllCreate(params.queue)
87
+ return JobActionResponseSchema.parse(response)
88
+ }
89
+
90
+
91
+ /**
92
+ * List finished jobs
93
+ *
94
+ * @method GET
95
+ * @path /cfg/rq/jobs/registries/finished/
96
+ */
97
+ export async function getRqJobsRegistriesFinishedList( params?: { queue?: string }, client?: any
98
+ ): Promise<any> {
99
+ const api = client || getAPIInstance()
100
+ const response = await api.cfg_rq_registries.rqJobsRegistriesFinishedList(params?.queue)
101
+ return response
102
+ }
103
+
104
+
105
+ /**
106
+ * Clear finished jobs registry
107
+ *
108
+ * @method POST
109
+ * @path /cfg/rq/jobs/registries/finished/clear/
110
+ */
111
+ export async function createRqJobsRegistriesFinishedClearCreate( params: { queue: string }, client?: any
112
+ ): Promise<JobActionResponse> {
113
+ const api = client || getAPIInstance()
114
+ const response = await api.cfg_rq_registries.rqJobsRegistriesFinishedClearCreate(params.queue)
115
+ return JobActionResponseSchema.parse(response)
116
+ }
117
+
118
+
119
+ /**
120
+ * List started jobs
121
+ *
122
+ * @method GET
123
+ * @path /cfg/rq/jobs/registries/started/
124
+ */
125
+ export async function getRqJobsRegistriesStartedList( params?: { queue?: string }, client?: any
126
+ ): Promise<any> {
127
+ const api = client || getAPIInstance()
128
+ const response = await api.cfg_rq_registries.rqJobsRegistriesStartedList(params?.queue)
129
+ return response
130
+ }
131
+
132
+
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Typed fetchers for RQ Schedules
3
+ *
4
+ * Universal functions that work in any environment:
5
+ * - Next.js (App Router / Pages Router / Server Components)
6
+ * - React Native
7
+ * - Node.js backend
8
+ *
9
+ * These fetchers use Zod schemas for runtime validation.
10
+ *
11
+ * Usage:
12
+ * ```typescript
13
+ * // Configure API once (in your app entry point)
14
+ * import { configureAPI } from '../../api-instance'
15
+ * configureAPI({ baseUrl: 'https://api.example.com' })
16
+ *
17
+ * // Then use fetchers anywhere
18
+ * const users = await getUsers({ page: 1 })
19
+ *
20
+ * // With SWR
21
+ * const { data } = useSWR(['users', params], () => getUsers(params))
22
+ *
23
+ * // With React Query
24
+ * const { data } = useQuery(['users', params], () => getUsers(params))
25
+ *
26
+ * // In Server Component or SSR (pass custom client)
27
+ * import { API } from '../../index'
28
+ * const api = new API('https://api.example.com')
29
+ * const users = await getUsers({ page: 1 }, api)
30
+ * ```
31
+ */
32
+ import { ScheduleActionResponseSchema, type ScheduleActionResponse } from '../schemas/ScheduleActionResponse.schema'
33
+ import { ScheduleCreateRequestSchema, type ScheduleCreateRequest } from '../schemas/ScheduleCreateRequest.schema'
34
+ import { ScheduledJobSchema, type ScheduledJob } from '../schemas/ScheduledJob.schema'
35
+ import { getAPIInstance } from '../../api-instance'
36
+
37
+ /**
38
+ * List scheduled jobs
39
+ *
40
+ * @method GET
41
+ * @path /cfg/rq/schedules/
42
+ */
43
+ export async function getRqSchedulesList( params?: { queue?: string }, client?: any
44
+ ): Promise<any> {
45
+ const api = client || getAPIInstance()
46
+ const response = await api.cfg_rq_schedules.list(params?.queue)
47
+ return response
48
+ }
49
+
50
+
51
+ /**
52
+ * Create scheduled job
53
+ *
54
+ * @method POST
55
+ * @path /cfg/rq/schedules/
56
+ */
57
+ export async function createRqSchedulesCreate( data: ScheduleCreateRequest, client?: any
58
+ ): Promise<ScheduleActionResponse> {
59
+ const api = client || getAPIInstance()
60
+ const response = await api.cfg_rq_schedules.create(data)
61
+ return ScheduleActionResponseSchema.parse(response)
62
+ }
63
+
64
+
65
+ /**
66
+ * Get scheduled job details
67
+ *
68
+ * @method GET
69
+ * @path /cfg/rq/schedules/{id}/
70
+ */
71
+ export async function getRqSchedulesRetrieve( id: string, pk: string, params?: { queue?: string }, client?: any
72
+ ): Promise<ScheduledJob> {
73
+ const api = client || getAPIInstance()
74
+ const response = await api.cfg_rq_schedules.retrieve(id, pk, params?.queue)
75
+ return ScheduledJobSchema.parse(response)
76
+ }
77
+
78
+
79
+ /**
80
+ * Cancel scheduled job
81
+ *
82
+ * @method DELETE
83
+ * @path /cfg/rq/schedules/{id}/
84
+ */
85
+ export async function deleteRqSchedulesDestroy( id: string, pk: string, params?: { queue?: string }, client?: any
86
+ ): Promise<ScheduleActionResponse> {
87
+ const api = client || getAPIInstance()
88
+ const response = await api.cfg_rq_schedules.destroy(id, pk, params?.queue)
89
+ return ScheduleActionResponseSchema.parse(response)
90
+ }
91
+
92
+