@plyaz/types 1.15.20 → 1.16.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.
Files changed (41) hide show
  1. package/dist/api/aws/index.d.ts +5 -0
  2. package/dist/api/aws/signature.d.ts +42 -0
  3. package/dist/api/endpoints/cdn/endpoints.d.ts +57 -0
  4. package/dist/api/endpoints/cdn/index.d.ts +6 -0
  5. package/dist/api/endpoints/cdn/types.d.ts +151 -0
  6. package/dist/api/endpoints/index.d.ts +2 -0
  7. package/dist/api/endpoints/types.d.ts +3 -1
  8. package/dist/api/endpoints/virustotal/endpoints.d.ts +37 -0
  9. package/dist/api/endpoints/virustotal/index.d.ts +6 -0
  10. package/dist/api/endpoints/virustotal/types.d.ts +202 -0
  11. package/dist/api/index.cjs +1317 -1
  12. package/dist/api/index.cjs.map +1 -1
  13. package/dist/api/index.d.ts +3 -0
  14. package/dist/api/index.js +1317 -1
  15. package/dist/api/index.js.map +1 -1
  16. package/dist/core/idempotency.d.ts +48 -0
  17. package/dist/core/index.d.ts +1 -0
  18. package/dist/errors/codes.d.ts +296 -0
  19. package/dist/errors/enums.d.ts +10 -0
  20. package/dist/errors/index.cjs +1482 -1
  21. package/dist/errors/index.cjs.map +1 -1
  22. package/dist/errors/index.d.ts +1 -0
  23. package/dist/errors/index.js +1482 -2
  24. package/dist/errors/index.js.map +1 -1
  25. package/dist/errors/validation.d.ts +71 -0
  26. package/dist/index.cjs +2268 -132
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.ts +11 -0
  29. package/dist/index.js +2227 -133
  30. package/dist/index.js.map +1 -1
  31. package/dist/logger/enums.d.ts +10 -0
  32. package/dist/notifications/types.d.ts +1 -2
  33. package/dist/storage/compliance.d.ts +247 -0
  34. package/dist/storage/enums.d.ts +527 -0
  35. package/dist/storage/event-handler-mapping.d.ts +69 -0
  36. package/dist/storage/index.d.ts +13 -0
  37. package/dist/storage/interfaces.d.ts +2242 -0
  38. package/dist/storage/plugins.d.ts +996 -0
  39. package/dist/storage/schemas.d.ts +224 -0
  40. package/dist/storage/webhooks.d.ts +340 -0
  41. package/package.json +6 -1
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Validation types - abstraction over underlying validation library (Zod)
3
+ * These types are exposed to consumers and should not leak implementation details
4
+ *
5
+ * @module @plyaz/types/validation
6
+ */
7
+ /**
8
+ * A single validation issue
9
+ * Abstraction over ZodIssue - consumers don't need to know about Zod
10
+ */
11
+ export interface ValidationIssue {
12
+ /** Path to the field that failed validation (e.g., ['user', 'email']) */
13
+ path: (string | number)[];
14
+ /** Error message */
15
+ message: string;
16
+ /** Error code (e.g., 'invalid_type', 'too_small', 'invalid_string') */
17
+ code: string;
18
+ /** Additional metadata about the error */
19
+ [key: string]: unknown;
20
+ }
21
+ /**
22
+ * Result of schema validation
23
+ * Generic result type that doesn't expose Zod
24
+ * Named SchemaValidationResult to avoid conflict with common ValidationResult
25
+ */
26
+ export type SchemaValidationResult<T> = {
27
+ success: true;
28
+ data: T;
29
+ } | {
30
+ success: false;
31
+ errors: ValidationIssue[];
32
+ };
33
+ /**
34
+ * Validation schema interface
35
+ * Minimal interface that any validation schema must implement
36
+ * Abstracts away the underlying validation library
37
+ */
38
+ export interface ValidationSchema<T = unknown> {
39
+ /** Parse and validate data, throwing on error */
40
+ parse(data: unknown): T;
41
+ /** Safely parse and validate data, returning result */
42
+ safeParse(data: unknown): SchemaValidationResult<T>;
43
+ }
44
+ /**
45
+ * Internal validation issue structure
46
+ * Matches Zod's actual ZodIssue structure
47
+ * NOT exposed to consumers - this is an implementation detail
48
+ *
49
+ * @internal
50
+ */
51
+ export interface InternalValidationIssue {
52
+ readonly path: PropertyKey[];
53
+ readonly message: string;
54
+ readonly code: string;
55
+ }
56
+ /**
57
+ * Internal validation schema interface
58
+ * Used internally by validation utilities - matches Zod's actual API
59
+ * NOT exposed to consumers - this is an implementation detail
60
+ *
61
+ * @internal
62
+ */
63
+ export interface InternalValidationSchema<T> {
64
+ safeParse(data: unknown): {
65
+ success: boolean;
66
+ data?: T;
67
+ error?: {
68
+ issues: ReadonlyArray<InternalValidationIssue>;
69
+ };
70
+ };
71
+ }