@zintrust/workers 0.1.27

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 (178) hide show
  1. package/README.md +861 -0
  2. package/dist/AnomalyDetection.d.ts +102 -0
  3. package/dist/AnomalyDetection.js +321 -0
  4. package/dist/AutoScaler.d.ts +127 -0
  5. package/dist/AutoScaler.js +425 -0
  6. package/dist/BroadcastWorker.d.ts +21 -0
  7. package/dist/BroadcastWorker.js +24 -0
  8. package/dist/CanaryController.d.ts +103 -0
  9. package/dist/CanaryController.js +380 -0
  10. package/dist/ChaosEngineering.d.ts +79 -0
  11. package/dist/ChaosEngineering.js +216 -0
  12. package/dist/CircuitBreaker.d.ts +106 -0
  13. package/dist/CircuitBreaker.js +374 -0
  14. package/dist/ClusterLock.d.ts +90 -0
  15. package/dist/ClusterLock.js +385 -0
  16. package/dist/ComplianceManager.d.ts +177 -0
  17. package/dist/ComplianceManager.js +556 -0
  18. package/dist/DatacenterOrchestrator.d.ts +133 -0
  19. package/dist/DatacenterOrchestrator.js +404 -0
  20. package/dist/DeadLetterQueue.d.ts +122 -0
  21. package/dist/DeadLetterQueue.js +539 -0
  22. package/dist/HealthMonitor.d.ts +42 -0
  23. package/dist/HealthMonitor.js +301 -0
  24. package/dist/MultiQueueWorker.d.ts +89 -0
  25. package/dist/MultiQueueWorker.js +277 -0
  26. package/dist/NotificationWorker.d.ts +21 -0
  27. package/dist/NotificationWorker.js +23 -0
  28. package/dist/Observability.d.ts +153 -0
  29. package/dist/Observability.js +530 -0
  30. package/dist/PluginManager.d.ts +123 -0
  31. package/dist/PluginManager.js +392 -0
  32. package/dist/PriorityQueue.d.ts +117 -0
  33. package/dist/PriorityQueue.js +244 -0
  34. package/dist/ResourceMonitor.d.ts +164 -0
  35. package/dist/ResourceMonitor.js +605 -0
  36. package/dist/SLAMonitor.d.ts +110 -0
  37. package/dist/SLAMonitor.js +274 -0
  38. package/dist/WorkerFactory.d.ts +193 -0
  39. package/dist/WorkerFactory.js +1507 -0
  40. package/dist/WorkerInit.d.ts +85 -0
  41. package/dist/WorkerInit.js +223 -0
  42. package/dist/WorkerMetrics.d.ts +114 -0
  43. package/dist/WorkerMetrics.js +509 -0
  44. package/dist/WorkerRegistry.d.ts +145 -0
  45. package/dist/WorkerRegistry.js +319 -0
  46. package/dist/WorkerShutdown.d.ts +61 -0
  47. package/dist/WorkerShutdown.js +159 -0
  48. package/dist/WorkerVersioning.d.ts +107 -0
  49. package/dist/WorkerVersioning.js +300 -0
  50. package/dist/build-manifest.json +462 -0
  51. package/dist/config/workerConfig.d.ts +3 -0
  52. package/dist/config/workerConfig.js +19 -0
  53. package/dist/createQueueWorker.d.ts +23 -0
  54. package/dist/createQueueWorker.js +113 -0
  55. package/dist/dashboard/index.d.ts +1 -0
  56. package/dist/dashboard/index.js +1 -0
  57. package/dist/dashboard/types.d.ts +117 -0
  58. package/dist/dashboard/types.js +1 -0
  59. package/dist/dashboard/workers-api.d.ts +4 -0
  60. package/dist/dashboard/workers-api.js +638 -0
  61. package/dist/dashboard/workers-dashboard-ui.d.ts +3 -0
  62. package/dist/dashboard/workers-dashboard-ui.js +1026 -0
  63. package/dist/dashboard/workers-dashboard.d.ts +4 -0
  64. package/dist/dashboard/workers-dashboard.js +904 -0
  65. package/dist/helper/index.d.ts +5 -0
  66. package/dist/helper/index.js +10 -0
  67. package/dist/http/WorkerApiController.d.ts +38 -0
  68. package/dist/http/WorkerApiController.js +312 -0
  69. package/dist/http/WorkerController.d.ts +374 -0
  70. package/dist/http/WorkerController.js +1351 -0
  71. package/dist/http/middleware/CustomValidation.d.ts +92 -0
  72. package/dist/http/middleware/CustomValidation.js +270 -0
  73. package/dist/http/middleware/DatacenterValidator.d.ts +3 -0
  74. package/dist/http/middleware/DatacenterValidator.js +94 -0
  75. package/dist/http/middleware/EditWorkerValidation.d.ts +7 -0
  76. package/dist/http/middleware/EditWorkerValidation.js +55 -0
  77. package/dist/http/middleware/FeaturesValidator.d.ts +3 -0
  78. package/dist/http/middleware/FeaturesValidator.js +60 -0
  79. package/dist/http/middleware/InfrastructureValidator.d.ts +31 -0
  80. package/dist/http/middleware/InfrastructureValidator.js +226 -0
  81. package/dist/http/middleware/OptionsValidator.d.ts +3 -0
  82. package/dist/http/middleware/OptionsValidator.js +112 -0
  83. package/dist/http/middleware/PayloadSanitizer.d.ts +7 -0
  84. package/dist/http/middleware/PayloadSanitizer.js +42 -0
  85. package/dist/http/middleware/ProcessorPathSanitizer.d.ts +3 -0
  86. package/dist/http/middleware/ProcessorPathSanitizer.js +74 -0
  87. package/dist/http/middleware/QueueNameSanitizer.d.ts +3 -0
  88. package/dist/http/middleware/QueueNameSanitizer.js +45 -0
  89. package/dist/http/middleware/ValidateDriver.d.ts +7 -0
  90. package/dist/http/middleware/ValidateDriver.js +20 -0
  91. package/dist/http/middleware/VersionSanitizer.d.ts +3 -0
  92. package/dist/http/middleware/VersionSanitizer.js +25 -0
  93. package/dist/http/middleware/WorkerNameSanitizer.d.ts +3 -0
  94. package/dist/http/middleware/WorkerNameSanitizer.js +46 -0
  95. package/dist/http/middleware/WorkerValidationChain.d.ts +27 -0
  96. package/dist/http/middleware/WorkerValidationChain.js +185 -0
  97. package/dist/index.d.ts +46 -0
  98. package/dist/index.js +48 -0
  99. package/dist/routes/workers.d.ts +12 -0
  100. package/dist/routes/workers.js +81 -0
  101. package/dist/storage/WorkerStore.d.ts +45 -0
  102. package/dist/storage/WorkerStore.js +195 -0
  103. package/dist/type.d.ts +76 -0
  104. package/dist/type.js +1 -0
  105. package/dist/ui/router/ui.d.ts +3 -0
  106. package/dist/ui/router/ui.js +83 -0
  107. package/dist/ui/types/worker-ui.d.ts +229 -0
  108. package/dist/ui/types/worker-ui.js +5 -0
  109. package/package.json +53 -0
  110. package/src/AnomalyDetection.ts +434 -0
  111. package/src/AutoScaler.ts +654 -0
  112. package/src/BroadcastWorker.ts +34 -0
  113. package/src/CanaryController.ts +531 -0
  114. package/src/ChaosEngineering.ts +301 -0
  115. package/src/CircuitBreaker.ts +495 -0
  116. package/src/ClusterLock.ts +499 -0
  117. package/src/ComplianceManager.ts +815 -0
  118. package/src/DatacenterOrchestrator.ts +561 -0
  119. package/src/DeadLetterQueue.ts +733 -0
  120. package/src/HealthMonitor.ts +390 -0
  121. package/src/MultiQueueWorker.ts +431 -0
  122. package/src/NotificationWorker.ts +33 -0
  123. package/src/Observability.ts +696 -0
  124. package/src/PluginManager.ts +551 -0
  125. package/src/PriorityQueue.ts +351 -0
  126. package/src/ResourceMonitor.ts +769 -0
  127. package/src/SLAMonitor.ts +408 -0
  128. package/src/WorkerFactory.ts +2108 -0
  129. package/src/WorkerInit.ts +313 -0
  130. package/src/WorkerMetrics.ts +709 -0
  131. package/src/WorkerRegistry.ts +443 -0
  132. package/src/WorkerShutdown.ts +210 -0
  133. package/src/WorkerVersioning.ts +422 -0
  134. package/src/config/workerConfig.ts +25 -0
  135. package/src/createQueueWorker.ts +174 -0
  136. package/src/dashboard/index.ts +6 -0
  137. package/src/dashboard/types.ts +141 -0
  138. package/src/dashboard/workers-api.ts +785 -0
  139. package/src/dashboard/zintrust.svg +30 -0
  140. package/src/helper/index.ts +11 -0
  141. package/src/http/WorkerApiController.ts +369 -0
  142. package/src/http/WorkerController.ts +1512 -0
  143. package/src/http/middleware/CustomValidation.ts +360 -0
  144. package/src/http/middleware/DatacenterValidator.ts +124 -0
  145. package/src/http/middleware/EditWorkerValidation.ts +74 -0
  146. package/src/http/middleware/FeaturesValidator.ts +82 -0
  147. package/src/http/middleware/InfrastructureValidator.ts +295 -0
  148. package/src/http/middleware/OptionsValidator.ts +144 -0
  149. package/src/http/middleware/PayloadSanitizer.ts +52 -0
  150. package/src/http/middleware/ProcessorPathSanitizer.ts +86 -0
  151. package/src/http/middleware/QueueNameSanitizer.ts +55 -0
  152. package/src/http/middleware/ValidateDriver.ts +29 -0
  153. package/src/http/middleware/VersionSanitizer.ts +30 -0
  154. package/src/http/middleware/WorkerNameSanitizer.ts +56 -0
  155. package/src/http/middleware/WorkerValidationChain.ts +230 -0
  156. package/src/index.ts +98 -0
  157. package/src/routes/workers.ts +154 -0
  158. package/src/storage/WorkerStore.ts +240 -0
  159. package/src/type.ts +89 -0
  160. package/src/types/queue-monitor.d.ts +38 -0
  161. package/src/types/queue-redis.d.ts +38 -0
  162. package/src/ui/README.md +13 -0
  163. package/src/ui/components/JsonEditor.js +670 -0
  164. package/src/ui/components/JsonViewer.js +387 -0
  165. package/src/ui/components/WorkerCard.js +178 -0
  166. package/src/ui/components/WorkerExpandPanel.js +257 -0
  167. package/src/ui/components/fetcher.js +42 -0
  168. package/src/ui/components/sla-scorecard.js +32 -0
  169. package/src/ui/components/styles.css +30 -0
  170. package/src/ui/components/table-expander.js +34 -0
  171. package/src/ui/integration/worker-ui-integration.js +565 -0
  172. package/src/ui/router/ui.ts +99 -0
  173. package/src/ui/services/workerApi.js +240 -0
  174. package/src/ui/types/worker-ui.ts +283 -0
  175. package/src/ui/utils/jsonValidator.js +444 -0
  176. package/src/ui/workers/index.html +202 -0
  177. package/src/ui/workers/main.js +1781 -0
  178. package/src/ui/workers/styles.css +1350 -0
@@ -0,0 +1,240 @@
1
+ /* eslint-disable @typescript-eslint/explicit-function-return-type */
2
+ /**
3
+ * Worker API Service
4
+ * HTTP client for worker management operations
5
+ */
6
+
7
+ /**
8
+ * Create HTTP request handler for worker API
9
+ * @param {string} baseUrl - The base URL for the API
10
+ * @returns {Function} HTTP request handler function
11
+ */
12
+ const createRequestHandler = (baseUrl) => {
13
+ return async (endpoint, options = {}) => {
14
+ const url = `${baseUrl}${endpoint}`;
15
+ const config = {
16
+ headers: {
17
+ 'Content-Type': 'application/json',
18
+ ...options.headers,
19
+ },
20
+ ...options,
21
+ };
22
+
23
+ try {
24
+ const response = await fetch(url, config);
25
+ const data = await response.json();
26
+
27
+ if (!response.ok) {
28
+ return {
29
+ success: false,
30
+ error: data.error || `HTTP ${response.status}: ${response.statusText}`,
31
+ code: data.code || 'HTTP_ERROR',
32
+ status: response.status,
33
+ };
34
+ }
35
+
36
+ return {
37
+ success: true,
38
+ data: data.data || data,
39
+ message: data.message,
40
+ };
41
+ } catch (error) {
42
+ return {
43
+ success: false,
44
+ error: error.message || 'Network error',
45
+ code: 'NETWORK_ERROR',
46
+ };
47
+ }
48
+ };
49
+ };
50
+
51
+ /**
52
+ * Create query operations for worker API
53
+ * @param {Function} request - HTTP request handler function
54
+ * @returns {Object} Query operations object
55
+ */
56
+ const createQueryOperations = (request) => ({
57
+ /**
58
+ * Get all workers with optional query parameters
59
+ * @param {Object} params - Query parameters
60
+ * @returns {Promise<Object>} API response
61
+ */
62
+ getWorkers: async (params = {}) => {
63
+ const queryString = new URLSearchParams(params).toString();
64
+ const endpoint = queryString ? `?${queryString}` : '';
65
+
66
+ return await request(endpoint);
67
+ },
68
+
69
+ /**
70
+ * Get a specific worker by ID
71
+ * @param {string} workerId - Worker ID
72
+ * @returns {Promise<Object>} API response
73
+ */
74
+ getWorker: async (workerId) => {
75
+ return await request(`/${workerId}`);
76
+ },
77
+
78
+ /**
79
+ * Get worker data as JSON
80
+ * @param {string} workerId - Worker ID
81
+ * @returns {Promise<Object>} API response
82
+ */
83
+ getWorkerJson: async (workerId) => {
84
+ return await request(`/${workerId}/json`);
85
+ },
86
+
87
+ /**
88
+ * Get worker metrics
89
+ * @param {string} workerId - Worker ID
90
+ * @returns {Promise<Object>} API response
91
+ */
92
+ getWorkerMetrics: async (workerId) => {
93
+ return await request(`/${workerId}/metrics`);
94
+ },
95
+
96
+ /**
97
+ * Get worker logs with optional query parameters
98
+ * @param {string} workerId - Worker ID
99
+ * @param {Object} params - Query parameters
100
+ * @returns {Promise<Object>} API response
101
+ */
102
+ getWorkerLogs: async (workerId, params = {}) => {
103
+ const queryString = new URLSearchParams(params).toString();
104
+ const endpoint = queryString ? `/${workerId}/logs?${queryString}` : `/${workerId}/logs`;
105
+
106
+ return await request(endpoint);
107
+ },
108
+ });
109
+
110
+ /**
111
+ * Create mutation operations for worker API
112
+ * @param {Function} request - HTTP request handler function
113
+ * @returns {Object} Mutation operations object
114
+ */
115
+ const createMutationOperations = (request) => ({
116
+ /**
117
+ * Update a worker
118
+ * @param {string} workerId - Worker ID
119
+ * @param {Object} workerData - Worker data to update
120
+ * @returns {Promise<Object>} API response
121
+ */
122
+ updateWorker: async (workerId, workerData) => {
123
+ return await request(`/${workerId}`, {
124
+ method: 'PUT',
125
+ body: JSON.stringify(workerData),
126
+ });
127
+ },
128
+
129
+ /**
130
+ * Update worker data as JSON
131
+ * @param {string} workerId - Worker ID
132
+ * @param {Object} workerData - Worker data to update
133
+ * @returns {Promise<Object>} API response
134
+ */
135
+ updateWorkerJson: async (workerId, workerData) => {
136
+ return await request(`/${workerId}/json`, {
137
+ method: 'PUT',
138
+ body: JSON.stringify(workerData),
139
+ });
140
+ },
141
+
142
+ /**
143
+ * Create a new worker
144
+ * @param {Object} workerData - Worker data to create
145
+ * @returns {Promise<Object>} API response
146
+ */
147
+ createWorker: async (workerData) => {
148
+ return await request('', {
149
+ method: 'POST',
150
+ body: JSON.stringify(workerData),
151
+ });
152
+ },
153
+
154
+ /**
155
+ * Delete a worker
156
+ * @param {string} workerId - Worker ID
157
+ * @returns {Promise<Object>} API response
158
+ */
159
+ deleteWorker: async (workerId) => {
160
+ return await request(`/${workerId}`, {
161
+ method: 'DELETE',
162
+ });
163
+ },
164
+ });
165
+
166
+ /**
167
+ * Create control operations for worker API
168
+ * @param {Function} request - HTTP request handler function
169
+ * @returns {Object} Control operations object
170
+ */
171
+ const createControlOperations = (request) => ({
172
+ /**
173
+ * Start a worker
174
+ * @param {string} workerId - Worker ID
175
+ * @param {string} driver - Driver type
176
+ * @returns {Promise<Object>} API response
177
+ */
178
+ startWorker: async (workerId, driver) => {
179
+ return await request(`/${workerId}/start`, {
180
+ method: 'POST',
181
+ body: JSON.stringify({ driver }),
182
+ });
183
+ },
184
+
185
+ /**
186
+ * Stop a worker
187
+ * @param {string} workerId - Worker ID
188
+ * @param {string} driver - Driver type
189
+ * @returns {Promise<Object>} API response
190
+ */
191
+ stopWorker: async (workerId, driver) => {
192
+ return await request(`/${workerId}/stop`, {
193
+ method: 'POST',
194
+ body: JSON.stringify({ driver }),
195
+ });
196
+ },
197
+
198
+ /**
199
+ * Set auto-start configuration for a worker
200
+ * @param {string} workerId - Worker ID
201
+ * @param {boolean} autoStart - Auto-start setting
202
+ * @param {string} driver - Driver type
203
+ * @returns {Promise<Object>} API response
204
+ */
205
+ setAutoStart: async (workerId, autoStart, driver) => {
206
+ return await request(`/${workerId}/auto-start`, {
207
+ method: 'POST',
208
+ body: JSON.stringify({ autoStart, driver }),
209
+ });
210
+ },
211
+ });
212
+
213
+ /**
214
+ * Worker API service for HTTP requests
215
+ * @returns {Object} Worker API instance with all operations
216
+ */
217
+ const createWorkerApi = () => {
218
+ const baseUrl = '/api/workers';
219
+ const request = createRequestHandler(baseUrl);
220
+
221
+ const queryOps = createQueryOperations(request);
222
+ const mutationOps = createMutationOperations(request);
223
+ const controlOps = createControlOperations(request);
224
+
225
+ return {
226
+ ...queryOps,
227
+ ...mutationOps,
228
+ ...controlOps,
229
+ };
230
+ };
231
+
232
+ /**
233
+ * Sealed namespace for Worker API
234
+ */
235
+ export const workerApi = Object.freeze({
236
+ create: createWorkerApi,
237
+ });
238
+
239
+ // Create default instance
240
+ export default createWorkerApi();
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Worker UI Types
3
+ * Type definitions for worker management UI components
4
+ */
5
+
6
+ // DOM types for browser environment
7
+ declare global {
8
+ interface HTMLElement {
9
+ appendChild(node: Node): Node;
10
+ remove(): void;
11
+ classList: DOMTokenList;
12
+ style: CSSStyleDeclaration;
13
+ textContent: string;
14
+ // Note: innerHTML is included for legitimate use cases (JSON highlighting, safe HTML templates)
15
+ // Always sanitize content before using innerHTML to prevent XSS attacks
16
+ // eslint-disable-next-line no-restricted-syntax
17
+ innerHTML: string;
18
+ className: string;
19
+ id: string;
20
+ querySelector(selector: string): Element | null;
21
+ addEventListener(type: string, listener: UIEventListener): void;
22
+ dataset: DOMStringMap;
23
+ }
24
+
25
+ // UIEventListener type for browser environment
26
+ type UIEventListener = (evt: Event) => void;
27
+
28
+ interface Event {
29
+ target: EventTarget | null;
30
+ }
31
+
32
+ interface Element {
33
+ querySelector(selector: string): Element | null;
34
+ }
35
+
36
+ interface EventTarget {
37
+ addEventListener(type: string, listener: UIEventListener): void;
38
+ }
39
+
40
+ interface DOMTokenList {
41
+ add(token: string): void;
42
+ remove(token: string): void;
43
+ }
44
+
45
+ interface CSSStyleDeclaration {
46
+ display:
47
+ | 'block'
48
+ | 'none'
49
+ | 'inline'
50
+ | 'inline-block'
51
+ | 'flex'
52
+ | 'grid'
53
+ | 'hidden'
54
+ | 'inherit'
55
+ | 'initial'
56
+ | 'revert'
57
+ | 'unset'
58
+ | number;
59
+ [property: string]: string | number;
60
+ }
61
+
62
+ interface DOMStringMap {
63
+ [key: string]: string;
64
+ }
65
+
66
+ interface Node {
67
+ remove(): void;
68
+ }
69
+ }
70
+
71
+ // Make DOM types available for exported interfaces
72
+ export interface Node {
73
+ remove(): void;
74
+ }
75
+
76
+ export interface DOMTokenList {
77
+ add(token: string): void;
78
+ remove(token: string): void;
79
+ }
80
+
81
+ export interface CSSStyleDeclaration {
82
+ display: string | number;
83
+ [property: string]: string | number;
84
+ }
85
+
86
+ export interface DOMStringMap {
87
+ [key: string]: string;
88
+ }
89
+
90
+ export interface Element {
91
+ querySelector(selector: string): Element | null;
92
+ }
93
+
94
+ export interface EventTarget {
95
+ addEventListener(type: string, listener: UIEventListener): void;
96
+ }
97
+
98
+ export interface Event {
99
+ target: EventTarget | null;
100
+ }
101
+
102
+ // UIEventListener type for browser environment
103
+ export type UIEventListener = (evt: Event) => void;
104
+
105
+ export interface HTMLElement {
106
+ appendChild(node: Node): Node;
107
+ remove(): void;
108
+ classList: DOMTokenList;
109
+ style: CSSStyleDeclaration;
110
+ textContent: string;
111
+ // Note: innerHTML is included for legitimate use cases (JSON highlighting, safe HTML templates)
112
+ // Always sanitize content before using innerHTML to prevent XSS attacks
113
+ // eslint-disable-next-line no-restricted-syntax
114
+ innerHTML: string;
115
+ className: string;
116
+ id: string;
117
+ querySelector(selector: string): Element | null;
118
+ addEventListener(type: string, listener: UIEventListener): void;
119
+ dataset: DOMStringMap;
120
+ }
121
+
122
+ /**
123
+ * Worker instance interface for UI components
124
+ */
125
+ export interface WorkerInstance {
126
+ id: string;
127
+ name: string;
128
+ status: 'running' | 'stopped' | 'failed' | 'paused';
129
+ queueName: string;
130
+ driver: 'database' | 'redis' | 'memory';
131
+ concurrency: number;
132
+ autoStart: boolean;
133
+ createdAt: string;
134
+ updatedAt: string;
135
+ lastHealthCheck?: string;
136
+ lastError?: string;
137
+ connectionState?: 'connected' | 'disconnected' | 'connecting';
138
+ version?: string;
139
+ region?: string;
140
+ processor?: string;
141
+ features?: Record<string, boolean>;
142
+ infrastructure?: Record<string, unknown>;
143
+ datacenter?: Record<string, unknown>;
144
+ }
145
+
146
+ /**
147
+ * Worker card instance interface
148
+ */
149
+ export interface WorkerCardInstance {
150
+ element: HTMLElement;
151
+ worker: WorkerInstance;
152
+ isExpanded: () => boolean;
153
+ toggleExpand: () => void;
154
+ updateWorker: (worker: WorkerInstance) => void;
155
+ destroy: () => void;
156
+ }
157
+
158
+ /**
159
+ * Worker expand panel instance interface
160
+ */
161
+ export interface WorkerExpandPanelInstance {
162
+ element: HTMLElement;
163
+ worker: WorkerInstance;
164
+ render: () => void;
165
+ destroy: () => void;
166
+ }
167
+
168
+ /**
169
+ * JSON viewer modal instance interface
170
+ */
171
+ export interface JsonViewerInstance {
172
+ element: HTMLElement;
173
+ isOpen: () => boolean;
174
+ open: (data: unknown) => void;
175
+ close: () => void;
176
+ destroy: () => void;
177
+ }
178
+
179
+ /**
180
+ * JSON editor modal instance interface
181
+ */
182
+ export interface JsonEditorInstance {
183
+ element: HTMLElement;
184
+ isOpen: () => boolean;
185
+ open: (data: unknown) => void;
186
+ close: () => void;
187
+ getJsonData: () => unknown;
188
+ setJsonData: (data: unknown) => void;
189
+ validate: () => ValidationResult;
190
+ destroy: () => void;
191
+ }
192
+
193
+ /**
194
+ * Validation result interface
195
+ */
196
+ export interface ValidationResult {
197
+ isValid: boolean;
198
+ errors: ValidationError[];
199
+ warnings: ValidationWarning[];
200
+ }
201
+
202
+ /**
203
+ * Validation error interface
204
+ */
205
+ export interface ValidationError {
206
+ path: string;
207
+ message: string;
208
+ code: string;
209
+ field?: string;
210
+ }
211
+
212
+ /**
213
+ * Validation warning interface
214
+ */
215
+ export interface ValidationWarning {
216
+ path: string;
217
+ message: string;
218
+ code: string;
219
+ field?: string;
220
+ }
221
+
222
+ /**
223
+ * Modal options interface
224
+ */
225
+ export interface ModalOptions {
226
+ title?: string;
227
+ width?: string;
228
+ height?: string;
229
+ closable?: boolean;
230
+ backdrop?: boolean;
231
+ }
232
+
233
+ /**
234
+ * JSON viewer options interface
235
+ */
236
+ export interface JsonViewerOptions extends ModalOptions {
237
+ expandAll?: boolean;
238
+ searchEnabled?: boolean;
239
+ copyEnabled?: boolean;
240
+ theme?: 'light' | 'dark';
241
+ }
242
+
243
+ /**
244
+ * JSON editor options interface
245
+ */
246
+ export interface JsonEditorOptions extends ModalOptions {
247
+ validateOnChange?: boolean;
248
+ autoFormat?: boolean;
249
+ theme?: 'light' | 'dark';
250
+ fontSize?: number;
251
+ wordWrap?: boolean;
252
+ }
253
+
254
+ /**
255
+ * API response interface
256
+ */
257
+ export interface ApiResponse<T = unknown> {
258
+ success: boolean;
259
+ data?: T;
260
+ error?: string;
261
+ message?: string;
262
+ code?: string;
263
+ }
264
+
265
+ /**
266
+ * Worker API response interface
267
+ */
268
+ export interface WorkerApiResponse extends ApiResponse<WorkerInstance> {
269
+ data?: WorkerInstance;
270
+ }
271
+
272
+ /**
273
+ * Workers list API response interface
274
+ */
275
+ export interface WorkersListApiResponse extends ApiResponse<WorkerInstance[]> {
276
+ data?: WorkerInstance[];
277
+ pagination?: {
278
+ page: number;
279
+ limit: number;
280
+ total: number;
281
+ totalPages: number;
282
+ };
283
+ }