@djangocfg/ext-support 1.0.0 → 1.0.2
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/README.md +8 -0
- package/package.json +18 -12
- package/preview.png +0 -0
- package/src/config.ts +34 -13
- package/src/index.ts +2 -0
- package/dist/chunk-AZ4LWZB7.js +0 -2630
- package/dist/hooks.cjs +0 -2716
- package/dist/hooks.d.cts +0 -255
- package/dist/hooks.d.ts +0 -255
- package/dist/hooks.js +0 -1
- package/dist/index.cjs +0 -2693
- package/dist/index.d.cts +0 -1392
- package/dist/index.d.ts +0 -1392
- package/dist/index.js +0 -1
package/dist/index.d.cts
DELETED
|
@@ -1,1392 +0,0 @@
|
|
|
1
|
-
import { ConsolaInstance } from 'consola';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { z, ZodError } from 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* * `open` - Open
|
|
7
|
-
* * `waiting_for_user` - Waiting for User
|
|
8
|
-
* * `waiting_for_admin` - Waiting for Admin
|
|
9
|
-
* * `resolved` - Resolved
|
|
10
|
-
* * `closed` - Closed
|
|
11
|
-
*/
|
|
12
|
-
declare enum PatchedTicketRequestStatus {
|
|
13
|
-
OPEN = "open",
|
|
14
|
-
WAITING_FOR_USER = "waiting_for_user",
|
|
15
|
-
WAITING_FOR_ADMIN = "waiting_for_admin",
|
|
16
|
-
RESOLVED = "resolved",
|
|
17
|
-
CLOSED = "closed"
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* * `open` - Open
|
|
21
|
-
* * `waiting_for_user` - Waiting for User
|
|
22
|
-
* * `waiting_for_admin` - Waiting for Admin
|
|
23
|
-
* * `resolved` - Resolved
|
|
24
|
-
* * `closed` - Closed
|
|
25
|
-
*/
|
|
26
|
-
declare enum TicketStatus {
|
|
27
|
-
OPEN = "open",
|
|
28
|
-
WAITING_FOR_USER = "waiting_for_user",
|
|
29
|
-
WAITING_FOR_ADMIN = "waiting_for_admin",
|
|
30
|
-
RESOLVED = "resolved",
|
|
31
|
-
CLOSED = "closed"
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* * `open` - Open
|
|
35
|
-
* * `waiting_for_user` - Waiting for User
|
|
36
|
-
* * `waiting_for_admin` - Waiting for Admin
|
|
37
|
-
* * `resolved` - Resolved
|
|
38
|
-
* * `closed` - Closed
|
|
39
|
-
*/
|
|
40
|
-
declare enum TicketRequestStatus {
|
|
41
|
-
OPEN = "open",
|
|
42
|
-
WAITING_FOR_USER = "waiting_for_user",
|
|
43
|
-
WAITING_FOR_ADMIN = "waiting_for_admin",
|
|
44
|
-
RESOLVED = "resolved",
|
|
45
|
-
CLOSED = "closed"
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type enums_PatchedTicketRequestStatus = PatchedTicketRequestStatus;
|
|
49
|
-
declare const enums_PatchedTicketRequestStatus: typeof PatchedTicketRequestStatus;
|
|
50
|
-
type enums_TicketRequestStatus = TicketRequestStatus;
|
|
51
|
-
declare const enums_TicketRequestStatus: typeof TicketRequestStatus;
|
|
52
|
-
type enums_TicketStatus = TicketStatus;
|
|
53
|
-
declare const enums_TicketStatus: typeof TicketStatus;
|
|
54
|
-
declare namespace enums {
|
|
55
|
-
export { enums_PatchedTicketRequestStatus as PatchedTicketRequestStatus, enums_TicketRequestStatus as TicketRequestStatus, enums_TicketStatus as TicketStatus };
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* Response model (includes read-only fields).
|
|
61
|
-
*/
|
|
62
|
-
interface PaginatedTicketList$1 {
|
|
63
|
-
/** Total number of items across all pages */
|
|
64
|
-
count: number;
|
|
65
|
-
/** Current page number (1-based) */
|
|
66
|
-
page: number;
|
|
67
|
-
/** Total number of pages */
|
|
68
|
-
pages: number;
|
|
69
|
-
/** Number of items per page */
|
|
70
|
-
page_size: number;
|
|
71
|
-
/** Whether there is a next page */
|
|
72
|
-
has_next: boolean;
|
|
73
|
-
/** Whether there is a previous page */
|
|
74
|
-
has_previous: boolean;
|
|
75
|
-
/** Next page number (null if no next page) */
|
|
76
|
-
next_page?: number | null;
|
|
77
|
-
/** Previous page number (null if no previous page) */
|
|
78
|
-
previous_page?: number | null;
|
|
79
|
-
/** Array of items for current page */
|
|
80
|
-
results: Array<Ticket$1>;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
* Request model (no read-only fields).
|
|
85
|
-
*/
|
|
86
|
-
interface TicketRequest$1 {
|
|
87
|
-
user: number;
|
|
88
|
-
subject: string;
|
|
89
|
-
/** * `open` - Open
|
|
90
|
-
* `waiting_for_user` - Waiting for User
|
|
91
|
-
* `waiting_for_admin` - Waiting for Admin
|
|
92
|
-
* `resolved` - Resolved
|
|
93
|
-
* `closed` - Closed */
|
|
94
|
-
status?: TicketRequestStatus;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
* Response model (includes read-only fields).
|
|
99
|
-
*/
|
|
100
|
-
interface Ticket$1 {
|
|
101
|
-
uuid: string;
|
|
102
|
-
user: number;
|
|
103
|
-
subject: string;
|
|
104
|
-
/** * `open` - Open
|
|
105
|
-
* `waiting_for_user` - Waiting for User
|
|
106
|
-
* `waiting_for_admin` - Waiting for Admin
|
|
107
|
-
* `resolved` - Resolved
|
|
108
|
-
* `closed` - Closed */
|
|
109
|
-
status?: TicketStatus;
|
|
110
|
-
created_at: string;
|
|
111
|
-
/** Get count of unanswered messages for this specific ticket. */
|
|
112
|
-
unanswered_messages_count: number;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
*
|
|
116
|
-
* Response model (includes read-only fields).
|
|
117
|
-
*/
|
|
118
|
-
interface PaginatedMessageList$1 {
|
|
119
|
-
/** Total number of items across all pages */
|
|
120
|
-
count: number;
|
|
121
|
-
/** Current page number (1-based) */
|
|
122
|
-
page: number;
|
|
123
|
-
/** Total number of pages */
|
|
124
|
-
pages: number;
|
|
125
|
-
/** Number of items per page */
|
|
126
|
-
page_size: number;
|
|
127
|
-
/** Whether there is a next page */
|
|
128
|
-
has_next: boolean;
|
|
129
|
-
/** Whether there is a previous page */
|
|
130
|
-
has_previous: boolean;
|
|
131
|
-
/** Next page number (null if no next page) */
|
|
132
|
-
next_page?: number | null;
|
|
133
|
-
/** Previous page number (null if no previous page) */
|
|
134
|
-
previous_page?: number | null;
|
|
135
|
-
/** Array of items for current page */
|
|
136
|
-
results: Array<Message$1>;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
*
|
|
140
|
-
* Request model (no read-only fields).
|
|
141
|
-
*/
|
|
142
|
-
interface MessageCreateRequest$1 {
|
|
143
|
-
text: string;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
*
|
|
147
|
-
* Response model (includes read-only fields).
|
|
148
|
-
*/
|
|
149
|
-
interface MessageCreate$1 {
|
|
150
|
-
text: string;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
*
|
|
154
|
-
* Response model (includes read-only fields).
|
|
155
|
-
*/
|
|
156
|
-
interface Message$1 {
|
|
157
|
-
uuid: string;
|
|
158
|
-
ticket: string;
|
|
159
|
-
sender: Sender$1;
|
|
160
|
-
/** Check if this message is from the ticket author. */
|
|
161
|
-
is_from_author: boolean;
|
|
162
|
-
text: string;
|
|
163
|
-
created_at: string;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
*
|
|
167
|
-
* Request model (no read-only fields).
|
|
168
|
-
*/
|
|
169
|
-
interface MessageRequest$1 {
|
|
170
|
-
text: string;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
*
|
|
174
|
-
* Request model (no read-only fields).
|
|
175
|
-
*/
|
|
176
|
-
interface PatchedMessageRequest$1 {
|
|
177
|
-
text?: string;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
*
|
|
181
|
-
* Request model (no read-only fields).
|
|
182
|
-
*/
|
|
183
|
-
interface PatchedTicketRequest$1 {
|
|
184
|
-
user?: number;
|
|
185
|
-
subject?: string;
|
|
186
|
-
/** * `open` - Open
|
|
187
|
-
* `waiting_for_user` - Waiting for User
|
|
188
|
-
* `waiting_for_admin` - Waiting for Admin
|
|
189
|
-
* `resolved` - Resolved
|
|
190
|
-
* `closed` - Closed */
|
|
191
|
-
status?: PatchedTicketRequestStatus;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
*
|
|
195
|
-
* Response model (includes read-only fields).
|
|
196
|
-
*/
|
|
197
|
-
interface Sender$1 {
|
|
198
|
-
id: number;
|
|
199
|
-
/** Get formatted username for display. */
|
|
200
|
-
display_username: string;
|
|
201
|
-
email: string;
|
|
202
|
-
avatar?: string | null;
|
|
203
|
-
/** Get user's initials for avatar fallback. */
|
|
204
|
-
initials: string;
|
|
205
|
-
/** Designates whether the user can log into this admin site. */
|
|
206
|
-
is_staff: boolean;
|
|
207
|
-
/** Designates that this user has all permissions without explicitly assigning them. */
|
|
208
|
-
is_superuser: boolean;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
declare namespace models {
|
|
212
|
-
export type { Message$1 as Message, MessageCreate$1 as MessageCreate, MessageCreateRequest$1 as MessageCreateRequest, MessageRequest$1 as MessageRequest, PaginatedMessageList$1 as PaginatedMessageList, PaginatedTicketList$1 as PaginatedTicketList, PatchedMessageRequest$1 as PatchedMessageRequest, PatchedTicketRequest$1 as PatchedTicketRequest, Sender$1 as Sender, Ticket$1 as Ticket, TicketRequest$1 as TicketRequest };
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* API endpoints for Support.
|
|
217
|
-
*/
|
|
218
|
-
declare class ExtSupportSupport {
|
|
219
|
-
private client;
|
|
220
|
-
constructor(client: any);
|
|
221
|
-
ticketsList(page?: number, page_size?: number): Promise<PaginatedTicketList$1>;
|
|
222
|
-
ticketsList(params?: {
|
|
223
|
-
page?: number;
|
|
224
|
-
page_size?: number;
|
|
225
|
-
}): Promise<PaginatedTicketList$1>;
|
|
226
|
-
/**
|
|
227
|
-
* ViewSet for managing support tickets. Requires authenticated user (JWT
|
|
228
|
-
* or Session). Staff users can see all tickets, regular users see only
|
|
229
|
-
* their own.
|
|
230
|
-
*/
|
|
231
|
-
ticketsCreate(data: TicketRequest$1): Promise<Ticket$1>;
|
|
232
|
-
ticketsMessagesList(ticket_uuid: string, page?: number, page_size?: number): Promise<PaginatedMessageList$1>;
|
|
233
|
-
ticketsMessagesList(ticket_uuid: string, params?: {
|
|
234
|
-
page?: number;
|
|
235
|
-
page_size?: number;
|
|
236
|
-
}): Promise<PaginatedMessageList$1>;
|
|
237
|
-
/**
|
|
238
|
-
* ViewSet for managing support messages. Requires authenticated user (JWT
|
|
239
|
-
* or Session). Users can only access messages for their own tickets.
|
|
240
|
-
*/
|
|
241
|
-
ticketsMessagesCreate(ticket_uuid: string, data: MessageCreateRequest$1): Promise<MessageCreate$1>;
|
|
242
|
-
/**
|
|
243
|
-
* ViewSet for managing support messages. Requires authenticated user (JWT
|
|
244
|
-
* or Session). Users can only access messages for their own tickets.
|
|
245
|
-
*/
|
|
246
|
-
ticketsMessagesRetrieve(ticket_uuid: string, uuid: string): Promise<Message$1>;
|
|
247
|
-
/**
|
|
248
|
-
* ViewSet for managing support messages. Requires authenticated user (JWT
|
|
249
|
-
* or Session). Users can only access messages for their own tickets.
|
|
250
|
-
*/
|
|
251
|
-
ticketsMessagesUpdate(ticket_uuid: string, uuid: string, data: MessageRequest$1): Promise<Message$1>;
|
|
252
|
-
/**
|
|
253
|
-
* ViewSet for managing support messages. Requires authenticated user (JWT
|
|
254
|
-
* or Session). Users can only access messages for their own tickets.
|
|
255
|
-
*/
|
|
256
|
-
ticketsMessagesPartialUpdate(ticket_uuid: string, uuid: string, data?: PatchedMessageRequest$1): Promise<Message$1>;
|
|
257
|
-
/**
|
|
258
|
-
* ViewSet for managing support messages. Requires authenticated user (JWT
|
|
259
|
-
* or Session). Users can only access messages for their own tickets.
|
|
260
|
-
*/
|
|
261
|
-
ticketsMessagesDestroy(ticket_uuid: string, uuid: string): Promise<void>;
|
|
262
|
-
/**
|
|
263
|
-
* ViewSet for managing support tickets. Requires authenticated user (JWT
|
|
264
|
-
* or Session). Staff users can see all tickets, regular users see only
|
|
265
|
-
* their own.
|
|
266
|
-
*/
|
|
267
|
-
ticketsRetrieve(uuid: string): Promise<Ticket$1>;
|
|
268
|
-
/**
|
|
269
|
-
* ViewSet for managing support tickets. Requires authenticated user (JWT
|
|
270
|
-
* or Session). Staff users can see all tickets, regular users see only
|
|
271
|
-
* their own.
|
|
272
|
-
*/
|
|
273
|
-
ticketsUpdate(uuid: string, data: TicketRequest$1): Promise<Ticket$1>;
|
|
274
|
-
/**
|
|
275
|
-
* ViewSet for managing support tickets. Requires authenticated user (JWT
|
|
276
|
-
* or Session). Staff users can see all tickets, regular users see only
|
|
277
|
-
* their own.
|
|
278
|
-
*/
|
|
279
|
-
ticketsPartialUpdate(uuid: string, data?: PatchedTicketRequest$1): Promise<Ticket$1>;
|
|
280
|
-
/**
|
|
281
|
-
* ViewSet for managing support tickets. Requires authenticated user (JWT
|
|
282
|
-
* or Session). Staff users can see all tickets, regular users see only
|
|
283
|
-
* their own.
|
|
284
|
-
*/
|
|
285
|
-
ticketsDestroy(uuid: string): Promise<void>;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* HTTP Client Adapter Pattern
|
|
290
|
-
*
|
|
291
|
-
* Allows switching between fetch/axios/httpx without changing generated code.
|
|
292
|
-
* Provides unified interface for making HTTP requests.
|
|
293
|
-
*/
|
|
294
|
-
interface HttpRequest {
|
|
295
|
-
method: string;
|
|
296
|
-
url: string;
|
|
297
|
-
headers?: Record<string, string>;
|
|
298
|
-
body?: any;
|
|
299
|
-
params?: Record<string, any>;
|
|
300
|
-
/** FormData for file uploads (multipart/form-data) */
|
|
301
|
-
formData?: FormData;
|
|
302
|
-
}
|
|
303
|
-
interface HttpResponse<T = any> {
|
|
304
|
-
data: T;
|
|
305
|
-
status: number;
|
|
306
|
-
statusText: string;
|
|
307
|
-
headers: Record<string, string>;
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* HTTP Client Adapter Interface.
|
|
311
|
-
* Implement this to use custom HTTP clients (axios, httpx, etc.)
|
|
312
|
-
*/
|
|
313
|
-
interface HttpClientAdapter {
|
|
314
|
-
request<T = any>(request: HttpRequest): Promise<HttpResponse<T>>;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Default Fetch API adapter.
|
|
318
|
-
* Uses native browser fetch() with proper error handling.
|
|
319
|
-
*/
|
|
320
|
-
declare class FetchAdapter implements HttpClientAdapter {
|
|
321
|
-
request<T = any>(request: HttpRequest): Promise<HttpResponse<T>>;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* API Logger with Consola
|
|
326
|
-
* Beautiful console logging for API requests and responses
|
|
327
|
-
*
|
|
328
|
-
* Installation:
|
|
329
|
-
* npm install consola
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Request log data
|
|
334
|
-
*/
|
|
335
|
-
interface RequestLog {
|
|
336
|
-
method: string;
|
|
337
|
-
url: string;
|
|
338
|
-
headers?: Record<string, string>;
|
|
339
|
-
body?: any;
|
|
340
|
-
timestamp: number;
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Response log data
|
|
344
|
-
*/
|
|
345
|
-
interface ResponseLog {
|
|
346
|
-
status: number;
|
|
347
|
-
statusText: string;
|
|
348
|
-
data?: any;
|
|
349
|
-
duration: number;
|
|
350
|
-
timestamp: number;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Error log data
|
|
354
|
-
*/
|
|
355
|
-
interface ErrorLog {
|
|
356
|
-
message: string;
|
|
357
|
-
statusCode?: number;
|
|
358
|
-
fieldErrors?: Record<string, string[]>;
|
|
359
|
-
duration: number;
|
|
360
|
-
timestamp: number;
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Logger configuration
|
|
364
|
-
*/
|
|
365
|
-
interface LoggerConfig {
|
|
366
|
-
/** Enable logging */
|
|
367
|
-
enabled: boolean;
|
|
368
|
-
/** Log requests */
|
|
369
|
-
logRequests: boolean;
|
|
370
|
-
/** Log responses */
|
|
371
|
-
logResponses: boolean;
|
|
372
|
-
/** Log errors */
|
|
373
|
-
logErrors: boolean;
|
|
374
|
-
/** Log request/response bodies */
|
|
375
|
-
logBodies: boolean;
|
|
376
|
-
/** Log headers (excluding sensitive ones) */
|
|
377
|
-
logHeaders: boolean;
|
|
378
|
-
/** Custom consola instance */
|
|
379
|
-
consola?: ConsolaInstance;
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* API Logger class
|
|
383
|
-
*/
|
|
384
|
-
declare class APILogger {
|
|
385
|
-
private config;
|
|
386
|
-
private consola;
|
|
387
|
-
constructor(config?: Partial<LoggerConfig>);
|
|
388
|
-
/**
|
|
389
|
-
* Enable logging
|
|
390
|
-
*/
|
|
391
|
-
enable(): void;
|
|
392
|
-
/**
|
|
393
|
-
* Disable logging
|
|
394
|
-
*/
|
|
395
|
-
disable(): void;
|
|
396
|
-
/**
|
|
397
|
-
* Update configuration
|
|
398
|
-
*/
|
|
399
|
-
setConfig(config: Partial<LoggerConfig>): void;
|
|
400
|
-
/**
|
|
401
|
-
* Filter sensitive headers
|
|
402
|
-
*/
|
|
403
|
-
private filterHeaders;
|
|
404
|
-
/**
|
|
405
|
-
* Log request
|
|
406
|
-
*/
|
|
407
|
-
logRequest(request: RequestLog): void;
|
|
408
|
-
/**
|
|
409
|
-
* Log response
|
|
410
|
-
*/
|
|
411
|
-
logResponse(request: RequestLog, response: ResponseLog): void;
|
|
412
|
-
/**
|
|
413
|
-
* Log error
|
|
414
|
-
*/
|
|
415
|
-
logError(request: RequestLog, error: ErrorLog): void;
|
|
416
|
-
/**
|
|
417
|
-
* Log general info
|
|
418
|
-
*/
|
|
419
|
-
info(message: string, ...args: any[]): void;
|
|
420
|
-
/**
|
|
421
|
-
* Log warning
|
|
422
|
-
*/
|
|
423
|
-
warn(message: string, ...args: any[]): void;
|
|
424
|
-
/**
|
|
425
|
-
* Log error
|
|
426
|
-
*/
|
|
427
|
-
error(message: string, ...args: any[]): void;
|
|
428
|
-
/**
|
|
429
|
-
* Log debug
|
|
430
|
-
*/
|
|
431
|
-
debug(message: string, ...args: any[]): void;
|
|
432
|
-
/**
|
|
433
|
-
* Log success
|
|
434
|
-
*/
|
|
435
|
-
success(message: string, ...args: any[]): void;
|
|
436
|
-
/**
|
|
437
|
-
* Create a sub-logger with prefix
|
|
438
|
-
*/
|
|
439
|
-
withTag(tag: string): ConsolaInstance;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* Retry Configuration and Utilities
|
|
444
|
-
*
|
|
445
|
-
* Provides automatic retry logic for failed HTTP requests using p-retry.
|
|
446
|
-
* Retries only on network errors and server errors (5xx), not client errors (4xx).
|
|
447
|
-
*/
|
|
448
|
-
/**
|
|
449
|
-
* Information about a failed retry attempt.
|
|
450
|
-
*/
|
|
451
|
-
interface FailedAttemptInfo {
|
|
452
|
-
/** The error that caused the failure */
|
|
453
|
-
error: Error;
|
|
454
|
-
/** The attempt number (1-indexed) */
|
|
455
|
-
attemptNumber: number;
|
|
456
|
-
/** Number of retries left */
|
|
457
|
-
retriesLeft: number;
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* Retry configuration options.
|
|
461
|
-
*
|
|
462
|
-
* Uses exponential backoff with jitter by default to avoid thundering herd.
|
|
463
|
-
*/
|
|
464
|
-
interface RetryConfig {
|
|
465
|
-
/**
|
|
466
|
-
* Maximum number of retry attempts.
|
|
467
|
-
* @default 3
|
|
468
|
-
*/
|
|
469
|
-
retries?: number;
|
|
470
|
-
/**
|
|
471
|
-
* Exponential backoff factor.
|
|
472
|
-
* @default 2
|
|
473
|
-
*/
|
|
474
|
-
factor?: number;
|
|
475
|
-
/**
|
|
476
|
-
* Minimum wait time between retries (ms).
|
|
477
|
-
* @default 1000
|
|
478
|
-
*/
|
|
479
|
-
minTimeout?: number;
|
|
480
|
-
/**
|
|
481
|
-
* Maximum wait time between retries (ms).
|
|
482
|
-
* @default 60000
|
|
483
|
-
*/
|
|
484
|
-
maxTimeout?: number;
|
|
485
|
-
/**
|
|
486
|
-
* Add randomness to wait times (jitter).
|
|
487
|
-
* Helps avoid thundering herd problem.
|
|
488
|
-
* @default true
|
|
489
|
-
*/
|
|
490
|
-
randomize?: boolean;
|
|
491
|
-
/**
|
|
492
|
-
* Callback called on each failed attempt.
|
|
493
|
-
*/
|
|
494
|
-
onFailedAttempt?: (info: FailedAttemptInfo) => void;
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Default retry configuration.
|
|
498
|
-
*/
|
|
499
|
-
declare const DEFAULT_RETRY_CONFIG: Required<RetryConfig>;
|
|
500
|
-
/**
|
|
501
|
-
* Determine if an error should trigger a retry.
|
|
502
|
-
*
|
|
503
|
-
* Retries on:
|
|
504
|
-
* - Network errors (connection refused, timeout, etc.)
|
|
505
|
-
* - Server errors (5xx status codes)
|
|
506
|
-
* - Rate limiting (429 status code)
|
|
507
|
-
*
|
|
508
|
-
* Does NOT retry on:
|
|
509
|
-
* - Client errors (4xx except 429)
|
|
510
|
-
* - Authentication errors (401, 403)
|
|
511
|
-
* - Not found (404)
|
|
512
|
-
*
|
|
513
|
-
* @param error - The error to check
|
|
514
|
-
* @returns true if should retry, false otherwise
|
|
515
|
-
*/
|
|
516
|
-
declare function shouldRetry(error: any): boolean;
|
|
517
|
-
/**
|
|
518
|
-
* Wrap a function with retry logic.
|
|
519
|
-
*
|
|
520
|
-
* @param fn - Async function to retry
|
|
521
|
-
* @param config - Retry configuration
|
|
522
|
-
* @returns Result of the function
|
|
523
|
-
*
|
|
524
|
-
* @example
|
|
525
|
-
* ```typescript
|
|
526
|
-
* const result = await withRetry(
|
|
527
|
-
* async () => fetch('https://api.example.com/users'),
|
|
528
|
-
* { retries: 5, minTimeout: 2000 }
|
|
529
|
-
* );
|
|
530
|
-
* ```
|
|
531
|
-
*/
|
|
532
|
-
declare function withRetry<T>(fn: () => Promise<T>, config?: RetryConfig): Promise<T>;
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* Async API client for Django CFG API.
|
|
536
|
-
*
|
|
537
|
-
* Usage:
|
|
538
|
-
* ```typescript
|
|
539
|
-
* const client = new APIClient('https://api.example.com');
|
|
540
|
-
* const users = await client.users.list();
|
|
541
|
-
* const post = await client.posts.create(newPost);
|
|
542
|
-
*
|
|
543
|
-
* // Custom HTTP adapter (e.g., Axios)
|
|
544
|
-
* const client = new APIClient('https://api.example.com', {
|
|
545
|
-
* httpClient: new AxiosAdapter()
|
|
546
|
-
* });
|
|
547
|
-
* ```
|
|
548
|
-
*/
|
|
549
|
-
declare class APIClient {
|
|
550
|
-
private baseUrl;
|
|
551
|
-
private httpClient;
|
|
552
|
-
private logger;
|
|
553
|
-
private retryConfig;
|
|
554
|
-
ext_support_support: ExtSupportSupport;
|
|
555
|
-
constructor(baseUrl: string, options?: {
|
|
556
|
-
httpClient?: HttpClientAdapter;
|
|
557
|
-
loggerConfig?: Partial<LoggerConfig>;
|
|
558
|
-
retryConfig?: RetryConfig;
|
|
559
|
-
});
|
|
560
|
-
/**
|
|
561
|
-
* Get CSRF token from cookies (for SessionAuthentication).
|
|
562
|
-
*
|
|
563
|
-
* Returns null if cookie doesn't exist (JWT-only auth).
|
|
564
|
-
*/
|
|
565
|
-
getCsrfToken(): string | null;
|
|
566
|
-
/**
|
|
567
|
-
* Make HTTP request with Django CSRF and session handling.
|
|
568
|
-
* Automatically retries on network errors and 5xx server errors.
|
|
569
|
-
*/
|
|
570
|
-
request<T>(method: string, path: string, options?: {
|
|
571
|
-
params?: Record<string, any>;
|
|
572
|
-
body?: any;
|
|
573
|
-
formData?: FormData;
|
|
574
|
-
headers?: Record<string, string>;
|
|
575
|
-
}): Promise<T>;
|
|
576
|
-
/**
|
|
577
|
-
* Internal request method (without retry wrapper).
|
|
578
|
-
* Used by request() method with optional retry logic.
|
|
579
|
-
*/
|
|
580
|
-
private _makeRequest;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Storage adapters for cross-platform token storage.
|
|
585
|
-
*
|
|
586
|
-
* Supports:
|
|
587
|
-
* - LocalStorage (browser)
|
|
588
|
-
* - Cookies (SSR/browser)
|
|
589
|
-
* - Memory (Node.js/Electron/testing)
|
|
590
|
-
*/
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Storage adapter interface for cross-platform token storage.
|
|
594
|
-
*/
|
|
595
|
-
interface StorageAdapter {
|
|
596
|
-
getItem(key: string): string | null;
|
|
597
|
-
setItem(key: string, value: string): void;
|
|
598
|
-
removeItem(key: string): void;
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* LocalStorage adapter with safe try-catch for browser environments.
|
|
602
|
-
* Works in modern browsers with localStorage support.
|
|
603
|
-
*
|
|
604
|
-
* Note: This adapter uses window.localStorage and should only be used in browser/client environments.
|
|
605
|
-
* For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead.
|
|
606
|
-
*/
|
|
607
|
-
declare class LocalStorageAdapter implements StorageAdapter {
|
|
608
|
-
private logger?;
|
|
609
|
-
constructor(logger?: APILogger);
|
|
610
|
-
getItem(key: string): string | null;
|
|
611
|
-
setItem(key: string, value: string): void;
|
|
612
|
-
removeItem(key: string): void;
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* Cookie-based storage adapter for SSR and browser environments.
|
|
616
|
-
* Useful for Next.js, Nuxt.js, and other SSR frameworks.
|
|
617
|
-
*/
|
|
618
|
-
declare class CookieStorageAdapter implements StorageAdapter {
|
|
619
|
-
private logger?;
|
|
620
|
-
constructor(logger?: APILogger);
|
|
621
|
-
getItem(key: string): string | null;
|
|
622
|
-
setItem(key: string, value: string): void;
|
|
623
|
-
removeItem(key: string): void;
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* In-memory storage adapter for Node.js, Electron, and testing environments.
|
|
627
|
-
* Data is stored in RAM and cleared when process exits.
|
|
628
|
-
*/
|
|
629
|
-
declare class MemoryStorageAdapter implements StorageAdapter {
|
|
630
|
-
private storage;
|
|
631
|
-
private logger?;
|
|
632
|
-
constructor(logger?: APILogger);
|
|
633
|
-
getItem(key: string): string | null;
|
|
634
|
-
setItem(key: string, value: string): void;
|
|
635
|
-
removeItem(key: string): void;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* Zod schema for Message
|
|
640
|
-
*
|
|
641
|
-
* This schema provides runtime validation and type inference.
|
|
642
|
-
* */
|
|
643
|
-
|
|
644
|
-
declare const MessageSchema: z.ZodObject<{
|
|
645
|
-
uuid: z.ZodString;
|
|
646
|
-
ticket: z.ZodString;
|
|
647
|
-
sender: z.ZodObject<{
|
|
648
|
-
id: z.ZodInt;
|
|
649
|
-
display_username: z.ZodString;
|
|
650
|
-
email: z.ZodEmail;
|
|
651
|
-
avatar: z.ZodNullable<z.ZodString>;
|
|
652
|
-
initials: z.ZodString;
|
|
653
|
-
is_staff: z.ZodBoolean;
|
|
654
|
-
is_superuser: z.ZodBoolean;
|
|
655
|
-
}, z.core.$strip>;
|
|
656
|
-
is_from_author: z.ZodBoolean;
|
|
657
|
-
text: z.ZodString;
|
|
658
|
-
created_at: z.ZodISODateTime;
|
|
659
|
-
}, z.core.$strip>;
|
|
660
|
-
/**
|
|
661
|
-
* Infer TypeScript type from Zod schema
|
|
662
|
-
*/
|
|
663
|
-
type Message = z.infer<typeof MessageSchema>;
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* Zod schema for MessageCreate
|
|
667
|
-
*
|
|
668
|
-
* This schema provides runtime validation and type inference.
|
|
669
|
-
* */
|
|
670
|
-
|
|
671
|
-
declare const MessageCreateSchema: z.ZodObject<{
|
|
672
|
-
text: z.ZodString;
|
|
673
|
-
}, z.core.$strip>;
|
|
674
|
-
/**
|
|
675
|
-
* Infer TypeScript type from Zod schema
|
|
676
|
-
*/
|
|
677
|
-
type MessageCreate = z.infer<typeof MessageCreateSchema>;
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* Zod schema for MessageCreateRequest
|
|
681
|
-
*
|
|
682
|
-
* This schema provides runtime validation and type inference.
|
|
683
|
-
* */
|
|
684
|
-
|
|
685
|
-
declare const MessageCreateRequestSchema: z.ZodObject<{
|
|
686
|
-
text: z.ZodString;
|
|
687
|
-
}, z.core.$strip>;
|
|
688
|
-
/**
|
|
689
|
-
* Infer TypeScript type from Zod schema
|
|
690
|
-
*/
|
|
691
|
-
type MessageCreateRequest = z.infer<typeof MessageCreateRequestSchema>;
|
|
692
|
-
|
|
693
|
-
/**
|
|
694
|
-
* Zod schema for MessageRequest
|
|
695
|
-
*
|
|
696
|
-
* This schema provides runtime validation and type inference.
|
|
697
|
-
* */
|
|
698
|
-
|
|
699
|
-
declare const MessageRequestSchema: z.ZodObject<{
|
|
700
|
-
text: z.ZodString;
|
|
701
|
-
}, z.core.$strip>;
|
|
702
|
-
/**
|
|
703
|
-
* Infer TypeScript type from Zod schema
|
|
704
|
-
*/
|
|
705
|
-
type MessageRequest = z.infer<typeof MessageRequestSchema>;
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* Zod schema for PaginatedMessageList
|
|
709
|
-
*
|
|
710
|
-
* This schema provides runtime validation and type inference.
|
|
711
|
-
* */
|
|
712
|
-
|
|
713
|
-
declare const PaginatedMessageListSchema: z.ZodObject<{
|
|
714
|
-
count: z.ZodInt;
|
|
715
|
-
page: z.ZodInt;
|
|
716
|
-
pages: z.ZodInt;
|
|
717
|
-
page_size: z.ZodInt;
|
|
718
|
-
has_next: z.ZodBoolean;
|
|
719
|
-
has_previous: z.ZodBoolean;
|
|
720
|
-
next_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
721
|
-
previous_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
722
|
-
results: z.ZodArray<z.ZodObject<{
|
|
723
|
-
uuid: z.ZodString;
|
|
724
|
-
ticket: z.ZodString;
|
|
725
|
-
sender: z.ZodObject<{
|
|
726
|
-
id: z.ZodInt;
|
|
727
|
-
display_username: z.ZodString;
|
|
728
|
-
email: z.ZodEmail;
|
|
729
|
-
avatar: z.ZodNullable<z.ZodString>;
|
|
730
|
-
initials: z.ZodString;
|
|
731
|
-
is_staff: z.ZodBoolean;
|
|
732
|
-
is_superuser: z.ZodBoolean;
|
|
733
|
-
}, z.core.$strip>;
|
|
734
|
-
is_from_author: z.ZodBoolean;
|
|
735
|
-
text: z.ZodString;
|
|
736
|
-
created_at: z.ZodISODateTime;
|
|
737
|
-
}, z.core.$strip>>;
|
|
738
|
-
}, z.core.$strip>;
|
|
739
|
-
/**
|
|
740
|
-
* Infer TypeScript type from Zod schema
|
|
741
|
-
*/
|
|
742
|
-
type PaginatedMessageList = z.infer<typeof PaginatedMessageListSchema>;
|
|
743
|
-
|
|
744
|
-
declare const PaginatedTicketListSchema: z.ZodObject<{
|
|
745
|
-
count: z.ZodInt;
|
|
746
|
-
page: z.ZodInt;
|
|
747
|
-
pages: z.ZodInt;
|
|
748
|
-
page_size: z.ZodInt;
|
|
749
|
-
has_next: z.ZodBoolean;
|
|
750
|
-
has_previous: z.ZodBoolean;
|
|
751
|
-
next_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
752
|
-
previous_page: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
753
|
-
results: z.ZodArray<z.ZodObject<{
|
|
754
|
-
uuid: z.ZodString;
|
|
755
|
-
user: z.ZodInt;
|
|
756
|
-
subject: z.ZodString;
|
|
757
|
-
status: z.ZodOptional<z.ZodEnum<typeof TicketStatus>>;
|
|
758
|
-
created_at: z.ZodISODateTime;
|
|
759
|
-
unanswered_messages_count: z.ZodInt;
|
|
760
|
-
}, z.core.$strip>>;
|
|
761
|
-
}, z.core.$strip>;
|
|
762
|
-
/**
|
|
763
|
-
* Infer TypeScript type from Zod schema
|
|
764
|
-
*/
|
|
765
|
-
type PaginatedTicketList = z.infer<typeof PaginatedTicketListSchema>;
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* Zod schema for PatchedMessageRequest
|
|
769
|
-
*
|
|
770
|
-
* This schema provides runtime validation and type inference.
|
|
771
|
-
* */
|
|
772
|
-
|
|
773
|
-
declare const PatchedMessageRequestSchema: z.ZodObject<{
|
|
774
|
-
text: z.ZodOptional<z.ZodString>;
|
|
775
|
-
}, z.core.$strip>;
|
|
776
|
-
/**
|
|
777
|
-
* Infer TypeScript type from Zod schema
|
|
778
|
-
*/
|
|
779
|
-
type PatchedMessageRequest = z.infer<typeof PatchedMessageRequestSchema>;
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
* Zod schema for PatchedTicketRequest
|
|
783
|
-
*
|
|
784
|
-
* This schema provides runtime validation and type inference.
|
|
785
|
-
* */
|
|
786
|
-
|
|
787
|
-
declare const PatchedTicketRequestSchema: z.ZodObject<{
|
|
788
|
-
user: z.ZodOptional<z.ZodInt>;
|
|
789
|
-
subject: z.ZodOptional<z.ZodString>;
|
|
790
|
-
status: z.ZodOptional<z.ZodEnum<typeof PatchedTicketRequestStatus>>;
|
|
791
|
-
}, z.core.$strip>;
|
|
792
|
-
/**
|
|
793
|
-
* Infer TypeScript type from Zod schema
|
|
794
|
-
*/
|
|
795
|
-
type PatchedTicketRequest = z.infer<typeof PatchedTicketRequestSchema>;
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
* Zod schema for Sender
|
|
799
|
-
*
|
|
800
|
-
* This schema provides runtime validation and type inference.
|
|
801
|
-
* */
|
|
802
|
-
|
|
803
|
-
declare const SenderSchema: z.ZodObject<{
|
|
804
|
-
id: z.ZodInt;
|
|
805
|
-
display_username: z.ZodString;
|
|
806
|
-
email: z.ZodEmail;
|
|
807
|
-
avatar: z.ZodNullable<z.ZodString>;
|
|
808
|
-
initials: z.ZodString;
|
|
809
|
-
is_staff: z.ZodBoolean;
|
|
810
|
-
is_superuser: z.ZodBoolean;
|
|
811
|
-
}, z.core.$strip>;
|
|
812
|
-
/**
|
|
813
|
-
* Infer TypeScript type from Zod schema
|
|
814
|
-
*/
|
|
815
|
-
type Sender = z.infer<typeof SenderSchema>;
|
|
816
|
-
|
|
817
|
-
/**
|
|
818
|
-
* Zod schema for Ticket
|
|
819
|
-
*
|
|
820
|
-
* This schema provides runtime validation and type inference.
|
|
821
|
-
* */
|
|
822
|
-
|
|
823
|
-
declare const TicketSchema: z.ZodObject<{
|
|
824
|
-
uuid: z.ZodString;
|
|
825
|
-
user: z.ZodInt;
|
|
826
|
-
subject: z.ZodString;
|
|
827
|
-
status: z.ZodOptional<z.ZodEnum<typeof TicketStatus>>;
|
|
828
|
-
created_at: z.ZodISODateTime;
|
|
829
|
-
unanswered_messages_count: z.ZodInt;
|
|
830
|
-
}, z.core.$strip>;
|
|
831
|
-
/**
|
|
832
|
-
* Infer TypeScript type from Zod schema
|
|
833
|
-
*/
|
|
834
|
-
type Ticket = z.infer<typeof TicketSchema>;
|
|
835
|
-
|
|
836
|
-
/**
|
|
837
|
-
* Zod schema for TicketRequest
|
|
838
|
-
*
|
|
839
|
-
* This schema provides runtime validation and type inference.
|
|
840
|
-
* */
|
|
841
|
-
|
|
842
|
-
declare const TicketRequestSchema: z.ZodObject<{
|
|
843
|
-
user: z.ZodInt;
|
|
844
|
-
subject: z.ZodString;
|
|
845
|
-
status: z.ZodOptional<z.ZodEnum<typeof TicketRequestStatus>>;
|
|
846
|
-
}, z.core.$strip>;
|
|
847
|
-
/**
|
|
848
|
-
* Infer TypeScript type from Zod schema
|
|
849
|
-
*/
|
|
850
|
-
type TicketRequest = z.infer<typeof TicketRequestSchema>;
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* Zod Schemas - Runtime validation and type inference
|
|
854
|
-
*
|
|
855
|
-
* Auto-generated from OpenAPI specification.
|
|
856
|
-
* Provides runtime validation for API requests and responses.
|
|
857
|
-
*
|
|
858
|
-
* Usage:
|
|
859
|
-
* ```typescript
|
|
860
|
-
* import { UserSchema } from './schemas'
|
|
861
|
-
*
|
|
862
|
-
* // Validate data
|
|
863
|
-
* const user = UserSchema.parse(data)
|
|
864
|
-
*
|
|
865
|
-
* // Type inference
|
|
866
|
-
* type User = z.infer<typeof UserSchema>
|
|
867
|
-
* ```
|
|
868
|
-
*/
|
|
869
|
-
|
|
870
|
-
type index$1_Message = Message;
|
|
871
|
-
type index$1_MessageCreate = MessageCreate;
|
|
872
|
-
type index$1_MessageCreateRequest = MessageCreateRequest;
|
|
873
|
-
declare const index$1_MessageCreateRequestSchema: typeof MessageCreateRequestSchema;
|
|
874
|
-
declare const index$1_MessageCreateSchema: typeof MessageCreateSchema;
|
|
875
|
-
type index$1_MessageRequest = MessageRequest;
|
|
876
|
-
declare const index$1_MessageRequestSchema: typeof MessageRequestSchema;
|
|
877
|
-
declare const index$1_MessageSchema: typeof MessageSchema;
|
|
878
|
-
type index$1_PaginatedMessageList = PaginatedMessageList;
|
|
879
|
-
declare const index$1_PaginatedMessageListSchema: typeof PaginatedMessageListSchema;
|
|
880
|
-
type index$1_PaginatedTicketList = PaginatedTicketList;
|
|
881
|
-
declare const index$1_PaginatedTicketListSchema: typeof PaginatedTicketListSchema;
|
|
882
|
-
type index$1_PatchedMessageRequest = PatchedMessageRequest;
|
|
883
|
-
declare const index$1_PatchedMessageRequestSchema: typeof PatchedMessageRequestSchema;
|
|
884
|
-
type index$1_PatchedTicketRequest = PatchedTicketRequest;
|
|
885
|
-
declare const index$1_PatchedTicketRequestSchema: typeof PatchedTicketRequestSchema;
|
|
886
|
-
type index$1_Sender = Sender;
|
|
887
|
-
declare const index$1_SenderSchema: typeof SenderSchema;
|
|
888
|
-
type index$1_Ticket = Ticket;
|
|
889
|
-
type index$1_TicketRequest = TicketRequest;
|
|
890
|
-
declare const index$1_TicketRequestSchema: typeof TicketRequestSchema;
|
|
891
|
-
declare const index$1_TicketSchema: typeof TicketSchema;
|
|
892
|
-
declare namespace index$1 {
|
|
893
|
-
export { type index$1_Message as Message, type index$1_MessageCreate as MessageCreate, type index$1_MessageCreateRequest as MessageCreateRequest, index$1_MessageCreateRequestSchema as MessageCreateRequestSchema, index$1_MessageCreateSchema as MessageCreateSchema, type index$1_MessageRequest as MessageRequest, index$1_MessageRequestSchema as MessageRequestSchema, index$1_MessageSchema as MessageSchema, type index$1_PaginatedMessageList as PaginatedMessageList, index$1_PaginatedMessageListSchema as PaginatedMessageListSchema, type index$1_PaginatedTicketList as PaginatedTicketList, index$1_PaginatedTicketListSchema as PaginatedTicketListSchema, type index$1_PatchedMessageRequest as PatchedMessageRequest, index$1_PatchedMessageRequestSchema as PatchedMessageRequestSchema, type index$1_PatchedTicketRequest as PatchedTicketRequest, index$1_PatchedTicketRequestSchema as PatchedTicketRequestSchema, type index$1_Sender as Sender, index$1_SenderSchema as SenderSchema, type index$1_Ticket as Ticket, type index$1_TicketRequest as TicketRequest, index$1_TicketRequestSchema as TicketRequestSchema, index$1_TicketSchema as TicketSchema };
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
/**
|
|
897
|
-
* Zod Validation Events - Browser CustomEvent integration
|
|
898
|
-
*
|
|
899
|
-
* Dispatches browser CustomEvents when Zod validation fails, allowing
|
|
900
|
-
* React/frontend apps to listen and handle validation errors globally.
|
|
901
|
-
*
|
|
902
|
-
* @example
|
|
903
|
-
* ```typescript
|
|
904
|
-
* // In your React app
|
|
905
|
-
* window.addEventListener('zod-validation-error', (event) => {
|
|
906
|
-
* const { operation, path, method, error, response } = event.detail;
|
|
907
|
-
* console.error(`Validation failed for ${method} ${path}`, error);
|
|
908
|
-
* // Show toast notification, log to Sentry, etc.
|
|
909
|
-
* });
|
|
910
|
-
* ```
|
|
911
|
-
*/
|
|
912
|
-
|
|
913
|
-
/**
|
|
914
|
-
* Validation error event detail
|
|
915
|
-
*/
|
|
916
|
-
interface ValidationErrorDetail {
|
|
917
|
-
/** Operation/function name that failed validation */
|
|
918
|
-
operation: string;
|
|
919
|
-
/** API endpoint path */
|
|
920
|
-
path: string;
|
|
921
|
-
/** HTTP method */
|
|
922
|
-
method: string;
|
|
923
|
-
/** Zod validation error */
|
|
924
|
-
error: ZodError;
|
|
925
|
-
/** Raw response data that failed validation */
|
|
926
|
-
response: any;
|
|
927
|
-
/** Timestamp of the error */
|
|
928
|
-
timestamp: Date;
|
|
929
|
-
}
|
|
930
|
-
/**
|
|
931
|
-
* Custom event type for Zod validation errors
|
|
932
|
-
*/
|
|
933
|
-
type ValidationErrorEvent = CustomEvent<ValidationErrorDetail>;
|
|
934
|
-
/**
|
|
935
|
-
* Dispatch a Zod validation error event.
|
|
936
|
-
*
|
|
937
|
-
* Only dispatches in browser environment (when window is defined).
|
|
938
|
-
* Safe to call in Node.js/SSR - will be a no-op.
|
|
939
|
-
*
|
|
940
|
-
* @param detail - Validation error details
|
|
941
|
-
*/
|
|
942
|
-
declare function dispatchValidationError(detail: ValidationErrorDetail): void;
|
|
943
|
-
/**
|
|
944
|
-
* Add a global listener for Zod validation errors.
|
|
945
|
-
*
|
|
946
|
-
* @param callback - Function to call when validation error occurs
|
|
947
|
-
* @returns Cleanup function to remove the listener
|
|
948
|
-
*
|
|
949
|
-
* @example
|
|
950
|
-
* ```typescript
|
|
951
|
-
* const cleanup = onValidationError(({ operation, error }) => {
|
|
952
|
-
* toast.error(`Validation failed in ${operation}`);
|
|
953
|
-
* logToSentry(error);
|
|
954
|
-
* });
|
|
955
|
-
*
|
|
956
|
-
* // Later, remove listener
|
|
957
|
-
* cleanup();
|
|
958
|
-
* ```
|
|
959
|
-
*/
|
|
960
|
-
declare function onValidationError(callback: (detail: ValidationErrorDetail) => void): () => void;
|
|
961
|
-
/**
|
|
962
|
-
* Format Zod error for logging/display.
|
|
963
|
-
*
|
|
964
|
-
* @param error - Zod validation error
|
|
965
|
-
* @returns Formatted error message
|
|
966
|
-
*/
|
|
967
|
-
declare function formatZodError(error: ZodError): string;
|
|
968
|
-
|
|
969
|
-
/**
|
|
970
|
-
* API operation
|
|
971
|
-
*
|
|
972
|
-
* @method GET
|
|
973
|
-
* @path /cfg/support/tickets/
|
|
974
|
-
*/
|
|
975
|
-
declare function getSupportTicketsList(params?: {
|
|
976
|
-
page?: number;
|
|
977
|
-
page_size?: number;
|
|
978
|
-
}, client?: any): Promise<PaginatedTicketList>;
|
|
979
|
-
/**
|
|
980
|
-
* API operation
|
|
981
|
-
*
|
|
982
|
-
* @method POST
|
|
983
|
-
* @path /cfg/support/tickets/
|
|
984
|
-
*/
|
|
985
|
-
declare function createSupportTicketsCreate(data: TicketRequest, client?: any): Promise<Ticket>;
|
|
986
|
-
/**
|
|
987
|
-
* API operation
|
|
988
|
-
*
|
|
989
|
-
* @method GET
|
|
990
|
-
* @path /cfg/support/tickets/{ticket_uuid}/messages/
|
|
991
|
-
*/
|
|
992
|
-
declare function getSupportTicketsMessagesList(ticket_uuid: string, params?: {
|
|
993
|
-
page?: number;
|
|
994
|
-
page_size?: number;
|
|
995
|
-
}, client?: any): Promise<PaginatedMessageList>;
|
|
996
|
-
/**
|
|
997
|
-
* API operation
|
|
998
|
-
*
|
|
999
|
-
* @method POST
|
|
1000
|
-
* @path /cfg/support/tickets/{ticket_uuid}/messages/
|
|
1001
|
-
*/
|
|
1002
|
-
declare function createSupportTicketsMessagesCreate(ticket_uuid: string, data: MessageCreateRequest, client?: any): Promise<MessageCreate>;
|
|
1003
|
-
/**
|
|
1004
|
-
* API operation
|
|
1005
|
-
*
|
|
1006
|
-
* @method GET
|
|
1007
|
-
* @path /cfg/support/tickets/{ticket_uuid}/messages/{uuid}/
|
|
1008
|
-
*/
|
|
1009
|
-
declare function getSupportTicketsMessagesRetrieve(ticket_uuid: string, uuid: string, client?: any): Promise<Message>;
|
|
1010
|
-
/**
|
|
1011
|
-
* API operation
|
|
1012
|
-
*
|
|
1013
|
-
* @method PUT
|
|
1014
|
-
* @path /cfg/support/tickets/{ticket_uuid}/messages/{uuid}/
|
|
1015
|
-
*/
|
|
1016
|
-
declare function updateSupportTicketsMessagesUpdate(ticket_uuid: string, uuid: string, data: MessageRequest, client?: any): Promise<Message>;
|
|
1017
|
-
/**
|
|
1018
|
-
* API operation
|
|
1019
|
-
*
|
|
1020
|
-
* @method PATCH
|
|
1021
|
-
* @path /cfg/support/tickets/{ticket_uuid}/messages/{uuid}/
|
|
1022
|
-
*/
|
|
1023
|
-
declare function partialUpdateSupportTicketsMessagesPartialUpdate(ticket_uuid: string, uuid: string, data?: PatchedMessageRequest, client?: any): Promise<Message>;
|
|
1024
|
-
/**
|
|
1025
|
-
* API operation
|
|
1026
|
-
*
|
|
1027
|
-
* @method DELETE
|
|
1028
|
-
* @path /cfg/support/tickets/{ticket_uuid}/messages/{uuid}/
|
|
1029
|
-
*/
|
|
1030
|
-
declare function deleteSupportTicketsMessagesDestroy(ticket_uuid: string, uuid: string, client?: any): Promise<void>;
|
|
1031
|
-
/**
|
|
1032
|
-
* API operation
|
|
1033
|
-
*
|
|
1034
|
-
* @method GET
|
|
1035
|
-
* @path /cfg/support/tickets/{uuid}/
|
|
1036
|
-
*/
|
|
1037
|
-
declare function getSupportTicketsRetrieve(uuid: string, client?: any): Promise<Ticket>;
|
|
1038
|
-
/**
|
|
1039
|
-
* API operation
|
|
1040
|
-
*
|
|
1041
|
-
* @method PUT
|
|
1042
|
-
* @path /cfg/support/tickets/{uuid}/
|
|
1043
|
-
*/
|
|
1044
|
-
declare function updateSupportTicketsUpdate(uuid: string, data: TicketRequest, client?: any): Promise<Ticket>;
|
|
1045
|
-
/**
|
|
1046
|
-
* API operation
|
|
1047
|
-
*
|
|
1048
|
-
* @method PATCH
|
|
1049
|
-
* @path /cfg/support/tickets/{uuid}/
|
|
1050
|
-
*/
|
|
1051
|
-
declare function partialUpdateSupportTicketsPartialUpdate(uuid: string, data?: PatchedTicketRequest, client?: any): Promise<Ticket>;
|
|
1052
|
-
/**
|
|
1053
|
-
* API operation
|
|
1054
|
-
*
|
|
1055
|
-
* @method DELETE
|
|
1056
|
-
* @path /cfg/support/tickets/{uuid}/
|
|
1057
|
-
*/
|
|
1058
|
-
declare function deleteSupportTicketsDestroy(uuid: string, client?: any): Promise<void>;
|
|
1059
|
-
|
|
1060
|
-
/**
|
|
1061
|
-
* Typed Fetchers - Universal API functions
|
|
1062
|
-
*
|
|
1063
|
-
* Auto-generated from OpenAPI specification.
|
|
1064
|
-
* These functions work in any JavaScript environment.
|
|
1065
|
-
*
|
|
1066
|
-
* Features:
|
|
1067
|
-
* - Runtime validation with Zod
|
|
1068
|
-
* - Type-safe parameters and responses
|
|
1069
|
-
* - Works with any data-fetching library (SWR, React Query, etc)
|
|
1070
|
-
* - Server Component compatible
|
|
1071
|
-
*
|
|
1072
|
-
* Usage:
|
|
1073
|
-
* ```typescript
|
|
1074
|
-
* import * as fetchers from './fetchers'
|
|
1075
|
-
*
|
|
1076
|
-
* // Direct usage
|
|
1077
|
-
* const user = await fetchers.getUser(1)
|
|
1078
|
-
*
|
|
1079
|
-
* // With SWR
|
|
1080
|
-
* const { data } = useSWR('user-1', () => fetchers.getUser(1))
|
|
1081
|
-
*
|
|
1082
|
-
* // With React Query
|
|
1083
|
-
* const { data } = useQuery(['user', 1], () => fetchers.getUser(1))
|
|
1084
|
-
* ```
|
|
1085
|
-
*/
|
|
1086
|
-
|
|
1087
|
-
declare const index_createSupportTicketsCreate: typeof createSupportTicketsCreate;
|
|
1088
|
-
declare const index_createSupportTicketsMessagesCreate: typeof createSupportTicketsMessagesCreate;
|
|
1089
|
-
declare const index_deleteSupportTicketsDestroy: typeof deleteSupportTicketsDestroy;
|
|
1090
|
-
declare const index_deleteSupportTicketsMessagesDestroy: typeof deleteSupportTicketsMessagesDestroy;
|
|
1091
|
-
declare const index_getSupportTicketsList: typeof getSupportTicketsList;
|
|
1092
|
-
declare const index_getSupportTicketsMessagesList: typeof getSupportTicketsMessagesList;
|
|
1093
|
-
declare const index_getSupportTicketsMessagesRetrieve: typeof getSupportTicketsMessagesRetrieve;
|
|
1094
|
-
declare const index_getSupportTicketsRetrieve: typeof getSupportTicketsRetrieve;
|
|
1095
|
-
declare const index_partialUpdateSupportTicketsMessagesPartialUpdate: typeof partialUpdateSupportTicketsMessagesPartialUpdate;
|
|
1096
|
-
declare const index_partialUpdateSupportTicketsPartialUpdate: typeof partialUpdateSupportTicketsPartialUpdate;
|
|
1097
|
-
declare const index_updateSupportTicketsMessagesUpdate: typeof updateSupportTicketsMessagesUpdate;
|
|
1098
|
-
declare const index_updateSupportTicketsUpdate: typeof updateSupportTicketsUpdate;
|
|
1099
|
-
declare namespace index {
|
|
1100
|
-
export { index_createSupportTicketsCreate as createSupportTicketsCreate, index_createSupportTicketsMessagesCreate as createSupportTicketsMessagesCreate, index_deleteSupportTicketsDestroy as deleteSupportTicketsDestroy, index_deleteSupportTicketsMessagesDestroy as deleteSupportTicketsMessagesDestroy, index_getSupportTicketsList as getSupportTicketsList, index_getSupportTicketsMessagesList as getSupportTicketsMessagesList, index_getSupportTicketsMessagesRetrieve as getSupportTicketsMessagesRetrieve, index_getSupportTicketsRetrieve as getSupportTicketsRetrieve, index_partialUpdateSupportTicketsMessagesPartialUpdate as partialUpdateSupportTicketsMessagesPartialUpdate, index_partialUpdateSupportTicketsPartialUpdate as partialUpdateSupportTicketsPartialUpdate, index_updateSupportTicketsMessagesUpdate as updateSupportTicketsMessagesUpdate, index_updateSupportTicketsUpdate as updateSupportTicketsUpdate };
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
/**
|
|
1104
|
-
* Global API Instance - Singleton configuration
|
|
1105
|
-
*
|
|
1106
|
-
* This module provides a global API instance that can be configured once
|
|
1107
|
-
* and used throughout your application.
|
|
1108
|
-
*
|
|
1109
|
-
* Usage:
|
|
1110
|
-
* ```typescript
|
|
1111
|
-
* // Configure once (e.g., in your app entry point)
|
|
1112
|
-
* import { configureAPI } from './api-instance'
|
|
1113
|
-
*
|
|
1114
|
-
* configureAPI({
|
|
1115
|
-
* baseUrl: 'https://api.example.com',
|
|
1116
|
-
* token: 'your-jwt-token'
|
|
1117
|
-
* })
|
|
1118
|
-
*
|
|
1119
|
-
* // Then use fetchers and hooks anywhere without configuration
|
|
1120
|
-
* import { getUsers } from './fetchers'
|
|
1121
|
-
* const users = await getUsers({ page: 1 })
|
|
1122
|
-
* ```
|
|
1123
|
-
*
|
|
1124
|
-
* For SSR or multiple instances:
|
|
1125
|
-
* ```typescript
|
|
1126
|
-
* import { API } from './index'
|
|
1127
|
-
* import { getUsers } from './fetchers'
|
|
1128
|
-
*
|
|
1129
|
-
* const api = new API('https://api.example.com')
|
|
1130
|
-
* const users = await getUsers({ page: 1 }, api)
|
|
1131
|
-
* ```
|
|
1132
|
-
*/
|
|
1133
|
-
|
|
1134
|
-
/**
|
|
1135
|
-
* Get the global API instance
|
|
1136
|
-
* @throws Error if API is not configured
|
|
1137
|
-
*/
|
|
1138
|
-
declare function getAPIInstance(): API;
|
|
1139
|
-
/**
|
|
1140
|
-
* Check if API is configured
|
|
1141
|
-
*/
|
|
1142
|
-
declare function isAPIConfigured(): boolean;
|
|
1143
|
-
/**
|
|
1144
|
-
* Configure the global API instance
|
|
1145
|
-
*
|
|
1146
|
-
* @param baseUrl - Base URL for the API
|
|
1147
|
-
* @param options - Optional configuration (storage, retry, logger)
|
|
1148
|
-
*
|
|
1149
|
-
* @example
|
|
1150
|
-
* ```typescript
|
|
1151
|
-
* configureAPI({
|
|
1152
|
-
* baseUrl: 'https://api.example.com',
|
|
1153
|
-
* token: 'jwt-token',
|
|
1154
|
-
* options: {
|
|
1155
|
-
* retryConfig: { maxRetries: 3 },
|
|
1156
|
-
* loggerConfig: { enabled: true }
|
|
1157
|
-
* }
|
|
1158
|
-
* })
|
|
1159
|
-
* ```
|
|
1160
|
-
*/
|
|
1161
|
-
declare function configureAPI(config: {
|
|
1162
|
-
baseUrl: string;
|
|
1163
|
-
token?: string;
|
|
1164
|
-
refreshToken?: string;
|
|
1165
|
-
options?: APIOptions;
|
|
1166
|
-
}): API;
|
|
1167
|
-
/**
|
|
1168
|
-
* Reconfigure the global API instance with new settings
|
|
1169
|
-
* Useful for updating tokens or base URL
|
|
1170
|
-
*/
|
|
1171
|
-
declare function reconfigureAPI(updates: {
|
|
1172
|
-
baseUrl?: string;
|
|
1173
|
-
token?: string;
|
|
1174
|
-
refreshToken?: string;
|
|
1175
|
-
}): API;
|
|
1176
|
-
/**
|
|
1177
|
-
* Clear tokens from the global API instance
|
|
1178
|
-
*/
|
|
1179
|
-
declare function clearAPITokens(): void;
|
|
1180
|
-
/**
|
|
1181
|
-
* Reset the global API instance
|
|
1182
|
-
* Useful for testing or logout scenarios
|
|
1183
|
-
*/
|
|
1184
|
-
declare function resetAPI(): void;
|
|
1185
|
-
|
|
1186
|
-
/**
|
|
1187
|
-
* API Error Classes
|
|
1188
|
-
*
|
|
1189
|
-
* Typed error classes with Django REST Framework support.
|
|
1190
|
-
*/
|
|
1191
|
-
/**
|
|
1192
|
-
* HTTP API Error with DRF field-specific validation errors.
|
|
1193
|
-
*
|
|
1194
|
-
* Usage:
|
|
1195
|
-
* ```typescript
|
|
1196
|
-
* try {
|
|
1197
|
-
* await api.users.create(userData);
|
|
1198
|
-
* } catch (error) {
|
|
1199
|
-
* if (error instanceof APIError) {
|
|
1200
|
-
* if (error.isValidationError) {
|
|
1201
|
-
* console.log('Field errors:', error.fieldErrors);
|
|
1202
|
-
* // { "email": ["Email already exists"], "username": ["Required"] }
|
|
1203
|
-
* }
|
|
1204
|
-
* }
|
|
1205
|
-
* }
|
|
1206
|
-
* ```
|
|
1207
|
-
*/
|
|
1208
|
-
declare class APIError extends Error {
|
|
1209
|
-
statusCode: number;
|
|
1210
|
-
statusText: string;
|
|
1211
|
-
response: any;
|
|
1212
|
-
url: string;
|
|
1213
|
-
constructor(statusCode: number, statusText: string, response: any, url: string, message?: string);
|
|
1214
|
-
/**
|
|
1215
|
-
* Get error details from response.
|
|
1216
|
-
* DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] }
|
|
1217
|
-
*/
|
|
1218
|
-
get details(): Record<string, any> | null;
|
|
1219
|
-
/**
|
|
1220
|
-
* Get field-specific validation errors from DRF.
|
|
1221
|
-
* Returns: { "field_name": ["error1", "error2"], ... }
|
|
1222
|
-
*/
|
|
1223
|
-
get fieldErrors(): Record<string, string[]> | null;
|
|
1224
|
-
/**
|
|
1225
|
-
* Get single error message from DRF.
|
|
1226
|
-
* Checks for "detail", "message", or first field error.
|
|
1227
|
-
*/
|
|
1228
|
-
get errorMessage(): string;
|
|
1229
|
-
get isValidationError(): boolean;
|
|
1230
|
-
get isAuthError(): boolean;
|
|
1231
|
-
get isPermissionError(): boolean;
|
|
1232
|
-
get isNotFoundError(): boolean;
|
|
1233
|
-
get isServerError(): boolean;
|
|
1234
|
-
}
|
|
1235
|
-
/**
|
|
1236
|
-
* Network Error (connection failed, timeout, etc.)
|
|
1237
|
-
*/
|
|
1238
|
-
declare class NetworkError extends Error {
|
|
1239
|
-
url: string;
|
|
1240
|
-
originalError?: Error;
|
|
1241
|
-
constructor(message: string, url: string, originalError?: Error);
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
/**
|
|
1245
|
-
* Django CFG API - API Client with JWT Management
|
|
1246
|
-
*
|
|
1247
|
-
* Usage:
|
|
1248
|
-
* ```typescript
|
|
1249
|
-
* import { API } from './api';
|
|
1250
|
-
*
|
|
1251
|
-
* const api = new API('https://api.example.com');
|
|
1252
|
-
*
|
|
1253
|
-
* // Set JWT token
|
|
1254
|
-
* api.setToken('your-jwt-token', 'refresh-token');
|
|
1255
|
-
*
|
|
1256
|
-
* // Use API
|
|
1257
|
-
* const posts = await api.posts.list();
|
|
1258
|
-
* const user = await api.users.retrieve(1);
|
|
1259
|
-
*
|
|
1260
|
-
* // Check authentication
|
|
1261
|
-
* if (api.isAuthenticated()) {
|
|
1262
|
-
* // ...
|
|
1263
|
-
* }
|
|
1264
|
-
*
|
|
1265
|
-
* // Custom storage with logging (for Electron/Node.js)
|
|
1266
|
-
* import { MemoryStorageAdapter, APILogger } from './storage';
|
|
1267
|
-
* const logger = new APILogger({ enabled: true, logLevel: 'debug' });
|
|
1268
|
-
* const api = new API('https://api.example.com', {
|
|
1269
|
-
* storage: new MemoryStorageAdapter(logger),
|
|
1270
|
-
* loggerConfig: { enabled: true, logLevel: 'debug' }
|
|
1271
|
-
* });
|
|
1272
|
-
*
|
|
1273
|
-
* // Get OpenAPI schema
|
|
1274
|
-
* const schema = api.getSchema();
|
|
1275
|
-
* ```
|
|
1276
|
-
*/
|
|
1277
|
-
|
|
1278
|
-
declare const TOKEN_KEY = "auth_token";
|
|
1279
|
-
declare const REFRESH_TOKEN_KEY = "refresh_token";
|
|
1280
|
-
interface APIOptions {
|
|
1281
|
-
/** Custom storage adapter (defaults to LocalStorageAdapter) */
|
|
1282
|
-
storage?: StorageAdapter;
|
|
1283
|
-
/** Retry configuration for failed requests */
|
|
1284
|
-
retryConfig?: RetryConfig;
|
|
1285
|
-
/** Logger configuration */
|
|
1286
|
-
loggerConfig?: Partial<LoggerConfig>;
|
|
1287
|
-
}
|
|
1288
|
-
declare class API {
|
|
1289
|
-
private baseUrl;
|
|
1290
|
-
private _client;
|
|
1291
|
-
private _token;
|
|
1292
|
-
private _refreshToken;
|
|
1293
|
-
private storage;
|
|
1294
|
-
private options?;
|
|
1295
|
-
ext_support_support: ExtSupportSupport;
|
|
1296
|
-
constructor(baseUrl: string, options?: APIOptions);
|
|
1297
|
-
private _loadTokensFromStorage;
|
|
1298
|
-
private _reinitClients;
|
|
1299
|
-
private _injectAuthHeader;
|
|
1300
|
-
/**
|
|
1301
|
-
* Get current JWT token
|
|
1302
|
-
*/
|
|
1303
|
-
getToken(): string | null;
|
|
1304
|
-
/**
|
|
1305
|
-
* Get current refresh token
|
|
1306
|
-
*/
|
|
1307
|
-
getRefreshToken(): string | null;
|
|
1308
|
-
/**
|
|
1309
|
-
* Set JWT token and refresh token
|
|
1310
|
-
* @param token - JWT access token
|
|
1311
|
-
* @param refreshToken - JWT refresh token (optional)
|
|
1312
|
-
*/
|
|
1313
|
-
setToken(token: string, refreshToken?: string): void;
|
|
1314
|
-
/**
|
|
1315
|
-
* Clear all tokens
|
|
1316
|
-
*/
|
|
1317
|
-
clearTokens(): void;
|
|
1318
|
-
/**
|
|
1319
|
-
* Check if user is authenticated
|
|
1320
|
-
*/
|
|
1321
|
-
isAuthenticated(): boolean;
|
|
1322
|
-
/**
|
|
1323
|
-
* Update base URL and reinitialize clients
|
|
1324
|
-
* @param url - New base URL
|
|
1325
|
-
*/
|
|
1326
|
-
setBaseUrl(url: string): void;
|
|
1327
|
-
/**
|
|
1328
|
-
* Get current base URL
|
|
1329
|
-
*/
|
|
1330
|
-
getBaseUrl(): string;
|
|
1331
|
-
/**
|
|
1332
|
-
* Get OpenAPI schema path
|
|
1333
|
-
* @returns Path to the OpenAPI schema JSON file
|
|
1334
|
-
*
|
|
1335
|
-
* Note: The OpenAPI schema is available in the schema.json file.
|
|
1336
|
-
* You can load it dynamically using:
|
|
1337
|
-
* ```typescript
|
|
1338
|
-
* const schema = await fetch('./schema.json').then(r => r.json());
|
|
1339
|
-
* // or using fs in Node.js:
|
|
1340
|
-
* // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
|
|
1341
|
-
* ```
|
|
1342
|
-
*/
|
|
1343
|
-
getSchemaPath(): string;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
/**
|
|
1347
|
-
* Support Extension API
|
|
1348
|
-
*
|
|
1349
|
-
* Pre-configured API instance with shared authentication
|
|
1350
|
-
*/
|
|
1351
|
-
|
|
1352
|
-
declare const apiSupport: API;
|
|
1353
|
-
|
|
1354
|
-
/**
|
|
1355
|
-
* Support Layout
|
|
1356
|
-
* Modern support layout with resizable panels for desktop and mobile-optimized view
|
|
1357
|
-
*/
|
|
1358
|
-
|
|
1359
|
-
interface SupportLayoutProps {
|
|
1360
|
-
children?: React.ReactNode;
|
|
1361
|
-
}
|
|
1362
|
-
declare const SupportLayout: React.FC<SupportLayoutProps>;
|
|
1363
|
-
|
|
1364
|
-
/**
|
|
1365
|
-
* Support Layout Types
|
|
1366
|
-
* UI state types for SupportLayout
|
|
1367
|
-
*/
|
|
1368
|
-
interface SupportUIState {
|
|
1369
|
-
selectedTicketUuid: string | null;
|
|
1370
|
-
isCreateDialogOpen: boolean;
|
|
1371
|
-
viewMode: 'list' | 'grid';
|
|
1372
|
-
}
|
|
1373
|
-
interface TicketFormData {
|
|
1374
|
-
subject: string;
|
|
1375
|
-
message: string;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
/**
|
|
1379
|
-
* Support Layout Events
|
|
1380
|
-
* Event system for SupportLayout
|
|
1381
|
-
*/
|
|
1382
|
-
declare const SUPPORT_LAYOUT_EVENTS: {
|
|
1383
|
-
readonly OPEN_CREATE_DIALOG: "support-layout:open-create-dialog";
|
|
1384
|
-
readonly CLOSE_CREATE_DIALOG: "support-layout:close-create-dialog";
|
|
1385
|
-
readonly TICKET_SELECTED: "support-layout:ticket-selected";
|
|
1386
|
-
readonly TICKET_CREATED: "support-layout:ticket-created";
|
|
1387
|
-
readonly MESSAGE_SENT: "support-layout:message-sent";
|
|
1388
|
-
};
|
|
1389
|
-
declare const openCreateTicketDialog: () => void;
|
|
1390
|
-
declare const closeCreateTicketDialog: () => void;
|
|
1391
|
-
|
|
1392
|
-
export { API, APIClient, APIError, APILogger, type APIOptions, CookieStorageAdapter, DEFAULT_RETRY_CONFIG, enums as Enums, type ErrorLog, models as ExtSupportSupportTypes, type FailedAttemptInfo, FetchAdapter, index as Fetchers, type HttpClientAdapter, type HttpRequest, type HttpResponse, LocalStorageAdapter, type LoggerConfig, MemoryStorageAdapter, type Message, type MessageCreate, type MessageCreateRequest, MessageCreateRequestSchema, MessageCreateSchema, type MessageRequest, MessageRequestSchema, MessageSchema, NetworkError, type PaginatedMessageList, PaginatedMessageListSchema, type PaginatedTicketList, PaginatedTicketListSchema, type PatchedMessageRequest, PatchedMessageRequestSchema, type PatchedTicketRequest, PatchedTicketRequestSchema, REFRESH_TOKEN_KEY, type RequestLog, type ResponseLog, type RetryConfig, SUPPORT_LAYOUT_EVENTS, index$1 as Schemas, type Sender, SenderSchema, type StorageAdapter, SupportLayout, type SupportLayoutProps, type SupportUIState, TOKEN_KEY, type Ticket, type TicketFormData, type TicketRequest, TicketRequestSchema, TicketSchema, type ValidationErrorDetail, type ValidationErrorEvent, apiSupport, clearAPITokens, closeCreateTicketDialog, configureAPI, createSupportTicketsCreate, createSupportTicketsMessagesCreate, deleteSupportTicketsDestroy, deleteSupportTicketsMessagesDestroy, dispatchValidationError, formatZodError, getAPIInstance, getSupportTicketsList, getSupportTicketsMessagesList, getSupportTicketsMessagesRetrieve, getSupportTicketsRetrieve, isAPIConfigured, onValidationError, openCreateTicketDialog, partialUpdateSupportTicketsMessagesPartialUpdate, partialUpdateSupportTicketsPartialUpdate, reconfigureAPI, resetAPI, shouldRetry, updateSupportTicketsMessagesUpdate, updateSupportTicketsUpdate, withRetry };
|