@vocoweb/kernel 1.0.0
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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/index.d.mts +2670 -0
- package/dist/index.d.ts +2670 -0
- package/dist/index.js +5560 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5370 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react-CSDXc0m4.d.mts +446 -0
- package/dist/react-CSDXc0m4.d.ts +446 -0
- package/dist/react.d.mts +3 -0
- package/dist/react.d.ts +3 -0
- package/dist/react.js +1854 -0
- package/dist/react.js.map +1 -0
- package/dist/react.mjs +1845 -0
- package/dist/react.mjs.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shared type definitions for @vocoweb/kernel
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base user identity
|
|
9
|
+
*/
|
|
10
|
+
interface UserId {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Auth session information
|
|
15
|
+
*/
|
|
16
|
+
interface AuthSession {
|
|
17
|
+
user: {
|
|
18
|
+
id: string;
|
|
19
|
+
email: string;
|
|
20
|
+
role?: string;
|
|
21
|
+
};
|
|
22
|
+
accessToken: string;
|
|
23
|
+
expiresAt?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* API response wrapper
|
|
27
|
+
*/
|
|
28
|
+
interface ApiResponse<T> {
|
|
29
|
+
data: T;
|
|
30
|
+
error?: null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* API error wrapper
|
|
34
|
+
*/
|
|
35
|
+
interface ApiError {
|
|
36
|
+
data?: null;
|
|
37
|
+
error: {
|
|
38
|
+
message: string;
|
|
39
|
+
code?: string;
|
|
40
|
+
statusCode?: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Pagination parameters
|
|
45
|
+
*/
|
|
46
|
+
interface PaginationParams {
|
|
47
|
+
page?: number;
|
|
48
|
+
limit?: number;
|
|
49
|
+
offset?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Paginated response
|
|
53
|
+
*/
|
|
54
|
+
interface PaginatedResponse<T> {
|
|
55
|
+
data: T[];
|
|
56
|
+
pagination: {
|
|
57
|
+
total: number;
|
|
58
|
+
page: number;
|
|
59
|
+
limit: number;
|
|
60
|
+
hasMore: boolean;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Cookie consent choices
|
|
65
|
+
*/
|
|
66
|
+
type CookieConsentChoice = 'accept' | 'reject' | 'partial';
|
|
67
|
+
/**
|
|
68
|
+
* Data residency region
|
|
69
|
+
*/
|
|
70
|
+
type DataRegion = 'eu' | 'us' | 'apac' | 'global';
|
|
71
|
+
/**
|
|
72
|
+
* Request destination info
|
|
73
|
+
*/
|
|
74
|
+
interface RequestDestination {
|
|
75
|
+
url: string;
|
|
76
|
+
ip?: string;
|
|
77
|
+
region: DataRegion;
|
|
78
|
+
allowed: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* VocoAuth Component
|
|
83
|
+
*
|
|
84
|
+
* A pre-styled, high-converting authentication component.
|
|
85
|
+
* Handles Google OAuth login with loading states and error handling.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* <VocoAuth redirectUrl="/dashboard" />
|
|
89
|
+
*/
|
|
90
|
+
interface VocoAuthProps {
|
|
91
|
+
/**
|
|
92
|
+
* URL to redirect to after successful authentication
|
|
93
|
+
*/
|
|
94
|
+
redirectUrl?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Custom CSS class name
|
|
97
|
+
*/
|
|
98
|
+
className?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Authentication mode
|
|
101
|
+
*/
|
|
102
|
+
mode?: 'oauth' | 'password' | 'both';
|
|
103
|
+
/**
|
|
104
|
+
* OAuth providers to show
|
|
105
|
+
*/
|
|
106
|
+
providers?: Array<'google' | 'github'>;
|
|
107
|
+
/**
|
|
108
|
+
* Show sign up form
|
|
109
|
+
*/
|
|
110
|
+
showSignUp?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Custom success callback
|
|
113
|
+
*/
|
|
114
|
+
onSuccess?: (user: {
|
|
115
|
+
id: string;
|
|
116
|
+
email: string;
|
|
117
|
+
}) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Custom error callback
|
|
120
|
+
*/
|
|
121
|
+
onError?: (error: {
|
|
122
|
+
message: string;
|
|
123
|
+
code: string;
|
|
124
|
+
}) => void;
|
|
125
|
+
}
|
|
126
|
+
declare function VocoAuth({ redirectUrl, className, mode, providers, showSignUp, onSuccess, onError, }: VocoAuthProps): react_jsx_runtime.JSX.Element;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Type definitions for the Legal module
|
|
130
|
+
*/
|
|
131
|
+
/**
|
|
132
|
+
* Privacy policy section types
|
|
133
|
+
*/
|
|
134
|
+
interface PrivacyPolicySection {
|
|
135
|
+
title: string;
|
|
136
|
+
content: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Privacy policy props
|
|
140
|
+
*/
|
|
141
|
+
interface PrivacyPolicyProps {
|
|
142
|
+
companyName: string;
|
|
143
|
+
email: string;
|
|
144
|
+
updatedAt?: string | Date;
|
|
145
|
+
websiteUrl?: string;
|
|
146
|
+
supportEmail?: string;
|
|
147
|
+
retentionDays?: number;
|
|
148
|
+
dataCategories?: string[];
|
|
149
|
+
sections?: Partial<Record<'dataCollection' | 'dataUsage' | 'dataSharing' | 'dataRetention' | 'userRights' | 'cookies' | 'security' | 'contact', PrivacyPolicySection>>;
|
|
150
|
+
className?: string;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Terms of service props
|
|
154
|
+
*/
|
|
155
|
+
interface TermsOfServiceProps {
|
|
156
|
+
companyName: string;
|
|
157
|
+
email: string;
|
|
158
|
+
updatedAt?: string | Date;
|
|
159
|
+
websiteUrl?: string;
|
|
160
|
+
jurisdiction?: string;
|
|
161
|
+
governingLaw?: string;
|
|
162
|
+
limitationOfLiability?: boolean;
|
|
163
|
+
intellectualProperty?: boolean;
|
|
164
|
+
terminationClause?: boolean;
|
|
165
|
+
className?: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Cookie category configuration
|
|
169
|
+
*/
|
|
170
|
+
interface CookieCategory {
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
description: string;
|
|
174
|
+
required: boolean;
|
|
175
|
+
scripts?: string[];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Cookie consent banner props
|
|
179
|
+
*/
|
|
180
|
+
interface CookieConsentProps {
|
|
181
|
+
onAccept?: () => void;
|
|
182
|
+
onReject?: () => void;
|
|
183
|
+
onCustomize?: (categories: Record<string, boolean>) => void;
|
|
184
|
+
position?: 'top' | 'bottom';
|
|
185
|
+
style?: 'banner' | 'modal' | 'bar';
|
|
186
|
+
categories?: CookieCategory[];
|
|
187
|
+
privacyPolicyUrl?: string;
|
|
188
|
+
acceptAllText?: string;
|
|
189
|
+
rejectAllText?: string;
|
|
190
|
+
customizeText?: string;
|
|
191
|
+
className?: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* User data export result
|
|
195
|
+
*/
|
|
196
|
+
interface UserDataExport {
|
|
197
|
+
userId: string;
|
|
198
|
+
exportedAt: Date;
|
|
199
|
+
data: {
|
|
200
|
+
profile?: Record<string, unknown>;
|
|
201
|
+
projects?: Array<Record<string, unknown>>;
|
|
202
|
+
websites?: Array<Record<string, unknown>>;
|
|
203
|
+
usageLogs?: Array<Record<string, unknown>>;
|
|
204
|
+
subscriptions?: Array<Record<string, unknown>>;
|
|
205
|
+
invoices?: Array<Record<string, unknown>>;
|
|
206
|
+
auditLogs?: Array<Record<string, unknown>>;
|
|
207
|
+
};
|
|
208
|
+
format: 'json';
|
|
209
|
+
encrypted: boolean;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare function PrivacyPolicy({ companyName, email, updatedAt, websiteUrl, supportEmail, retentionDays, dataCategories, sections, className, }: PrivacyPolicyProps): react_jsx_runtime.JSX.Element;
|
|
213
|
+
|
|
214
|
+
declare function TermsOfService({ companyName, email, updatedAt, websiteUrl, jurisdiction, governingLaw, limitationOfLiability, intellectualProperty, terminationClause, className, }: TermsOfServiceProps): react_jsx_runtime.JSX.Element;
|
|
215
|
+
|
|
216
|
+
declare function CookieConsent({ onAccept, onReject, onCustomize, position, style, categories, privacyPolicyUrl, acceptAllText, rejectAllText, customizeText, className, }: CookieConsentProps): react_jsx_runtime.JSX.Element | null;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Accessibility type definitions for WCAG 2.1 AA compliance
|
|
220
|
+
*/
|
|
221
|
+
/**
|
|
222
|
+
* Accessibility props base interface
|
|
223
|
+
*/
|
|
224
|
+
interface AccessibilityProps {
|
|
225
|
+
'aria-label'?: string;
|
|
226
|
+
'aria-labelledby'?: string;
|
|
227
|
+
'aria-describedby'?: string;
|
|
228
|
+
role?: string;
|
|
229
|
+
className?: string;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Button component props with accessibility requirements
|
|
233
|
+
*/
|
|
234
|
+
interface ButtonProps extends AccessibilityProps {
|
|
235
|
+
children: React.ReactNode;
|
|
236
|
+
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
237
|
+
size?: 'default' | 'sm' | 'lg' | 'icon';
|
|
238
|
+
disabled?: boolean;
|
|
239
|
+
type?: 'button' | 'submit' | 'reset';
|
|
240
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Input component props with accessibility requirements
|
|
244
|
+
*/
|
|
245
|
+
interface InputProps extends AccessibilityProps {
|
|
246
|
+
id?: string;
|
|
247
|
+
label?: string;
|
|
248
|
+
error?: string;
|
|
249
|
+
hint?: string;
|
|
250
|
+
required?: boolean;
|
|
251
|
+
placeholder?: string;
|
|
252
|
+
type?: string;
|
|
253
|
+
disabled?: boolean;
|
|
254
|
+
name?: string;
|
|
255
|
+
value?: string;
|
|
256
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Form component props with accessibility requirements
|
|
260
|
+
*/
|
|
261
|
+
interface FormProps extends AccessibilityProps {
|
|
262
|
+
children: React.ReactNode;
|
|
263
|
+
onSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
264
|
+
'aria-live'?: 'polite' | 'assertive' | 'off';
|
|
265
|
+
noValidate?: boolean;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* WCAG compliance level
|
|
269
|
+
*/
|
|
270
|
+
type ComplianceLevel = 'A' | 'AA' | 'AAA';
|
|
271
|
+
/**
|
|
272
|
+
* Color contrast result
|
|
273
|
+
*/
|
|
274
|
+
interface ContrastResult {
|
|
275
|
+
ratio: number;
|
|
276
|
+
aa: boolean;
|
|
277
|
+
aaa: boolean;
|
|
278
|
+
passesLargeText: boolean;
|
|
279
|
+
passesNormalText: boolean;
|
|
280
|
+
foreground: string;
|
|
281
|
+
background: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* ARIA validation result
|
|
285
|
+
*/
|
|
286
|
+
interface AriaValidationResult {
|
|
287
|
+
valid: boolean;
|
|
288
|
+
element: string;
|
|
289
|
+
issues: Array<{
|
|
290
|
+
severity: 'error' | 'warning';
|
|
291
|
+
message: string;
|
|
292
|
+
attribute?: string;
|
|
293
|
+
}>;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Keyboard navigation result
|
|
297
|
+
*/
|
|
298
|
+
interface KeyboardNavigationResult {
|
|
299
|
+
navigable: boolean;
|
|
300
|
+
focusable: boolean;
|
|
301
|
+
tabOrder: number[];
|
|
302
|
+
issues: string[];
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Accessibility violation
|
|
306
|
+
*/
|
|
307
|
+
interface AccessibilityViolation {
|
|
308
|
+
rule: string;
|
|
309
|
+
description: string;
|
|
310
|
+
impact: 'critical' | 'serious' | 'moderate' | 'minor';
|
|
311
|
+
element?: string;
|
|
312
|
+
help: string;
|
|
313
|
+
helpUrl: string;
|
|
314
|
+
wcagLevel: ComplianceLevel;
|
|
315
|
+
wcagCriteria: string;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Accessibility audit result
|
|
319
|
+
*/
|
|
320
|
+
interface AccessibilityAudit {
|
|
321
|
+
violations: AccessibilityViolation[];
|
|
322
|
+
passes: number;
|
|
323
|
+
incomplete: number;
|
|
324
|
+
url?: string;
|
|
325
|
+
timestamp: Date;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
declare const VocoButton: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
329
|
+
|
|
330
|
+
declare const VocoInput: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
331
|
+
|
|
332
|
+
declare const VocoForm: react.ForwardRefExoticComponent<FormProps & react.RefAttributes<HTMLFormElement>>;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Audit Log type definitions for enterprise compliance
|
|
336
|
+
*/
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Audit action types
|
|
340
|
+
*/
|
|
341
|
+
type AuditAction = 'INSERT' | 'UPDATE' | 'DELETE' | 'SELECT' | 'LOGIN' | 'LOGOUT' | 'EXPORT' | 'DELETE_REQUEST';
|
|
342
|
+
/**
|
|
343
|
+
* Audit log entry
|
|
344
|
+
*/
|
|
345
|
+
interface AuditLogEntry {
|
|
346
|
+
id: string;
|
|
347
|
+
tableName: string;
|
|
348
|
+
recordId: string;
|
|
349
|
+
action: AuditAction;
|
|
350
|
+
oldValue: Record<string, unknown> | null;
|
|
351
|
+
newValue: Record<string, unknown> | null;
|
|
352
|
+
userId: string;
|
|
353
|
+
userEmail?: string;
|
|
354
|
+
timestamp: Date;
|
|
355
|
+
ip?: string;
|
|
356
|
+
region?: DataRegion;
|
|
357
|
+
metadata?: Record<string, unknown>;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Audit record for storing changes
|
|
361
|
+
*/
|
|
362
|
+
interface AuditRecord {
|
|
363
|
+
id: string;
|
|
364
|
+
userId: string;
|
|
365
|
+
action: AuditAction;
|
|
366
|
+
tableName: string;
|
|
367
|
+
recordId: string;
|
|
368
|
+
changes: Array<{
|
|
369
|
+
field: string;
|
|
370
|
+
oldValue: unknown;
|
|
371
|
+
newValue: unknown;
|
|
372
|
+
}>;
|
|
373
|
+
timestamp: Date;
|
|
374
|
+
ip?: string;
|
|
375
|
+
userAgent?: string;
|
|
376
|
+
metadata?: Record<string, unknown>;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Audit log query filters
|
|
380
|
+
*/
|
|
381
|
+
interface AuditQueryFilters {
|
|
382
|
+
userId?: string;
|
|
383
|
+
action?: AuditAction;
|
|
384
|
+
tableName?: string;
|
|
385
|
+
recordId?: string;
|
|
386
|
+
startDate?: Date;
|
|
387
|
+
endDate?: Date;
|
|
388
|
+
limit?: number;
|
|
389
|
+
offset?: number;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Audit log query result
|
|
393
|
+
*/
|
|
394
|
+
interface AuditQueryResult {
|
|
395
|
+
logs: AuditLogEntry[];
|
|
396
|
+
total: number;
|
|
397
|
+
hasMore: boolean;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Audit log export format
|
|
401
|
+
*/
|
|
402
|
+
interface AuditExport {
|
|
403
|
+
format: 'csv' | 'json';
|
|
404
|
+
data: AuditLogEntry[];
|
|
405
|
+
exportedAt: Date;
|
|
406
|
+
filters: AuditQueryFilters;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Database trigger configuration
|
|
410
|
+
*/
|
|
411
|
+
interface TriggerConfig {
|
|
412
|
+
tableName: string;
|
|
413
|
+
enabled: boolean;
|
|
414
|
+
trackFields?: string[];
|
|
415
|
+
excludeFields?: string[];
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Audit recorder configuration
|
|
419
|
+
*/
|
|
420
|
+
interface AuditRecorderConfig {
|
|
421
|
+
enabled: boolean;
|
|
422
|
+
batchSize?: number;
|
|
423
|
+
flushInterval?: number;
|
|
424
|
+
excludeTables?: string[];
|
|
425
|
+
excludeFields?: Record<string, string[]>;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
interface VocoAuditLogProps {
|
|
429
|
+
userId: string;
|
|
430
|
+
filters?: {
|
|
431
|
+
action?: AuditAction;
|
|
432
|
+
table?: string;
|
|
433
|
+
recordId?: string;
|
|
434
|
+
startDate?: Date;
|
|
435
|
+
endDate?: Date;
|
|
436
|
+
};
|
|
437
|
+
limit?: number;
|
|
438
|
+
className?: string;
|
|
439
|
+
onExport?: (format: 'csv' | 'json') => void;
|
|
440
|
+
onLogClick?: (logId: string) => void;
|
|
441
|
+
showFilters?: boolean;
|
|
442
|
+
showExport?: boolean;
|
|
443
|
+
}
|
|
444
|
+
declare function VocoAuditLog({ userId: _userId, filters, limit, className, onExport, onLogClick, showFilters, showExport, }: VocoAuditLogProps): react_jsx_runtime.JSX.Element;
|
|
445
|
+
|
|
446
|
+
export { type AriaValidationResult as A, type ButtonProps as B, type ContrastResult as C, type DataRegion as D, VocoForm as E, type FormProps as F, VocoInput as G, type InputProps as I, type KeyboardNavigationResult as K, type PaginatedResponse as P, type RequestDestination as R, TermsOfService as T, type UserDataExport as U, VocoAuditLog as V, type ComplianceLevel as a, type AccessibilityViolation as b, type AuditRecorderConfig as c, type AuditAction as d, type AuditQueryFilters as e, type AccessibilityAudit as f, type AccessibilityProps as g, type ApiError as h, type ApiResponse as i, type AuditExport as j, type AuditLogEntry as k, type AuditQueryResult as l, type AuditRecord as m, type AuthSession as n, CookieConsent as o, type CookieConsentChoice as p, type CookieConsentProps as q, type PaginationParams as r, PrivacyPolicy as s, type PrivacyPolicyProps as t, type TermsOfServiceProps as u, type TriggerConfig as v, type UserId as w, type VocoAuditLogProps as x, VocoAuth as y, VocoButton as z };
|
package/dist/react.d.mts
ADDED
package/dist/react.d.ts
ADDED