@wildo-ai/zod-decorators 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.
Files changed (94) hide show
  1. package/dist/esm/__mocks__/mime.d.ts +12 -0
  2. package/dist/esm/__mocks__/mime.d.ts.map +1 -0
  3. package/dist/esm/__mocks__/mime.js +75 -0
  4. package/dist/esm/__mocks__/mime.js.map +1 -0
  5. package/dist/esm/commons.d.ts +26 -0
  6. package/dist/esm/commons.d.ts.map +1 -0
  7. package/dist/esm/commons.js +41 -0
  8. package/dist/esm/commons.js.map +1 -0
  9. package/dist/esm/currencies.shared.schemas.d.ts +208 -0
  10. package/dist/esm/currencies.shared.schemas.d.ts.map +1 -0
  11. package/dist/esm/currencies.shared.schemas.js +228 -0
  12. package/dist/esm/currencies.shared.schemas.js.map +1 -0
  13. package/dist/esm/files/agent-file-formats.d.ts +99 -0
  14. package/dist/esm/files/agent-file-formats.d.ts.map +1 -0
  15. package/dist/esm/files/agent-file-formats.js +163 -0
  16. package/dist/esm/files/agent-file-formats.js.map +1 -0
  17. package/dist/esm/files/extension-nature-map.d.ts +12 -0
  18. package/dist/esm/files/extension-nature-map.d.ts.map +1 -0
  19. package/dist/esm/files/extension-nature-map.js +63 -0
  20. package/dist/esm/files/extension-nature-map.js.map +1 -0
  21. package/dist/esm/files/file-extensions.enum.d.ts +58 -0
  22. package/dist/esm/files/file-extensions.enum.d.ts.map +1 -0
  23. package/dist/esm/files/file-extensions.enum.js +65 -0
  24. package/dist/esm/files/file-extensions.enum.js.map +1 -0
  25. package/dist/esm/files/mime-registry.d.ts +72 -0
  26. package/dist/esm/files/mime-registry.d.ts.map +1 -0
  27. package/dist/esm/files/mime-registry.js +174 -0
  28. package/dist/esm/files/mime-registry.js.map +1 -0
  29. package/dist/esm/files/unified-registry.d.ts +112 -0
  30. package/dist/esm/files/unified-registry.d.ts.map +1 -0
  31. package/dist/esm/files/unified-registry.js +190 -0
  32. package/dist/esm/files/unified-registry.js.map +1 -0
  33. package/dist/esm/index.d.ts +29 -0
  34. package/dist/esm/index.d.ts.map +1 -0
  35. package/dist/esm/index.js +36 -0
  36. package/dist/esm/index.js.map +1 -0
  37. package/dist/esm/testing/decorated-test-schemas.d.ts +27 -0
  38. package/dist/esm/testing/decorated-test-schemas.d.ts.map +1 -0
  39. package/dist/esm/testing/decorated-test-schemas.js +26 -0
  40. package/dist/esm/testing/decorated-test-schemas.js.map +1 -0
  41. package/dist/esm/testing.d.ts +6 -0
  42. package/dist/esm/testing.d.ts.map +1 -0
  43. package/dist/esm/testing.js +6 -0
  44. package/dist/esm/testing.js.map +1 -0
  45. package/dist/esm/zod-bigdecimal.d.ts +193 -0
  46. package/dist/esm/zod-bigdecimal.d.ts.map +1 -0
  47. package/dist/esm/zod-bigdecimal.js +274 -0
  48. package/dist/esm/zod-bigdecimal.js.map +1 -0
  49. package/dist/esm/zod-code.d.ts +95 -0
  50. package/dist/esm/zod-code.d.ts.map +1 -0
  51. package/dist/esm/zod-code.js +160 -0
  52. package/dist/esm/zod-code.js.map +1 -0
  53. package/dist/esm/zod-color.d.ts +8 -0
  54. package/dist/esm/zod-color.d.ts.map +1 -0
  55. package/dist/esm/zod-color.js +88 -0
  56. package/dist/esm/zod-color.js.map +1 -0
  57. package/dist/esm/zod-decorators.types.d.ts +2207 -0
  58. package/dist/esm/zod-decorators.types.d.ts.map +1 -0
  59. package/dist/esm/zod-decorators.types.js +771 -0
  60. package/dist/esm/zod-decorators.types.js.map +1 -0
  61. package/dist/esm/zod-duration.d.ts +128 -0
  62. package/dist/esm/zod-duration.d.ts.map +1 -0
  63. package/dist/esm/zod-duration.js +174 -0
  64. package/dist/esm/zod-duration.js.map +1 -0
  65. package/dist/esm/zod-file.d.ts +219 -0
  66. package/dist/esm/zod-file.d.ts.map +1 -0
  67. package/dist/esm/zod-file.js +469 -0
  68. package/dist/esm/zod-file.js.map +1 -0
  69. package/dist/esm/zod-money.d.ts +223 -0
  70. package/dist/esm/zod-money.d.ts.map +1 -0
  71. package/dist/esm/zod-money.js +293 -0
  72. package/dist/esm/zod-money.js.map +1 -0
  73. package/dist/esm/zod-phone.d.ts +75 -0
  74. package/dist/esm/zod-phone.d.ts.map +1 -0
  75. package/dist/esm/zod-phone.js +116 -0
  76. package/dist/esm/zod-phone.js.map +1 -0
  77. package/dist/esm/zod-range.d.ts +87 -0
  78. package/dist/esm/zod-range.d.ts.map +1 -0
  79. package/dist/esm/zod-range.js +138 -0
  80. package/dist/esm/zod-range.js.map +1 -0
  81. package/dist/esm/zod-utils.shared.d.ts +783 -0
  82. package/dist/esm/zod-utils.shared.d.ts.map +1 -0
  83. package/dist/esm/zod-utils.shared.js +2647 -0
  84. package/dist/esm/zod-utils.shared.js.map +1 -0
  85. package/dist/esm/zod-versioned.d.ts +150 -0
  86. package/dist/esm/zod-versioned.d.ts.map +1 -0
  87. package/dist/esm/zod-versioned.js +172 -0
  88. package/dist/esm/zod-versioned.js.map +1 -0
  89. package/dist/esm/zod.module-override.d.ts +413 -0
  90. package/dist/esm/zod.module-override.d.ts.map +1 -0
  91. package/dist/esm/zod.module-override.js +1093 -0
  92. package/dist/esm/zod.module-override.js.map +1 -0
  93. package/dist/tsconfig.build.tsbuildinfo +1 -0
  94. package/package.json +63 -0
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Agent/Blueprint File Format Registry
3
+ *
4
+ * Handles file formats specific to agent/blueprint operations.
5
+ * Maps AppsBlueprint_FileFormat to extensions and MIME types.
6
+ *
7
+ * NOTE: This registry uses string literals that match AppsBlueprint_FileFormat
8
+ * and AppsBlueprint_FileMimes from @wildo-ai/saas-models to avoid circular
9
+ * dependencies. The registry methods return/accept these string values which
10
+ * are compatible with the enums defined in saas-models.
11
+ */
12
+ /**
13
+ * Agent/Blueprint file format string literals.
14
+ * These match AppsBlueprint_FileFormat enum values from @wildo-ai/saas-models.
15
+ */
16
+ export declare const AgentFileFormat: {
17
+ readonly TEXT: "text";
18
+ readonly TYPESCRIPT: "typescript";
19
+ readonly TYPESCRIPT_JSX: "typescript_react";
20
+ readonly MARKDOWN: "markdown";
21
+ readonly JSON: "json";
22
+ readonly YAML: "yaml";
23
+ };
24
+ /**
25
+ * Agent/Blueprint file MIME type string literals.
26
+ * These match AppsBlueprint_FileMimes enum values from @wildo-ai/saas-models.
27
+ */
28
+ export declare const AgentFileMime: {
29
+ readonly TEXT_PLAIN: "text/plain";
30
+ readonly MARKDOWN: "text/markdown";
31
+ readonly JSON: "application/json";
32
+ readonly TYPESCRIPT: "application/typescript";
33
+ readonly TYPESCRIPT_JSX: "application/typescript-jsx";
34
+ readonly YAML: "application/yaml";
35
+ };
36
+ /**
37
+ * Type for agent file format (compatible with AppsBlueprint_FileFormat).
38
+ */
39
+ export type AgentFileFormatType = typeof AgentFileFormat[keyof typeof AgentFileFormat];
40
+ /**
41
+ * Registry for agent/blueprint file formats.
42
+ */
43
+ export declare class AgentFileFormatRegistry {
44
+ /**
45
+ * Get MIME type for AppsBlueprint_FileFormat.
46
+ *
47
+ * @param format - AppsBlueprint_FileFormat enum value (or compatible string)
48
+ * @returns MIME type string
49
+ */
50
+ static getMimeType(format: string): string;
51
+ /**
52
+ * Get extension for AppsBlueprint_FileFormat.
53
+ *
54
+ * @param format - AppsBlueprint_FileFormat enum value (or compatible string)
55
+ * @returns Extension string (without dot)
56
+ */
57
+ static getExtension(format: string): string;
58
+ /**
59
+ * Get AppsBlueprint_FileFormat from extension.
60
+ *
61
+ * @param extension - File extension (without dot)
62
+ * @returns Format string (compatible with AppsBlueprint_FileFormat) or undefined
63
+ */
64
+ static getFormatFromExtension(extension: string): string | undefined;
65
+ /**
66
+ * Get AppsBlueprint_FileFormat from MIME type.
67
+ *
68
+ * @param mimeType - MIME type string
69
+ * @returns Format string (compatible with AppsBlueprint_FileFormat) or undefined
70
+ */
71
+ static getFormatFromMimeType(mimeType: string): string | undefined;
72
+ /**
73
+ * Check if extension is an agent file format.
74
+ *
75
+ * @param extension - File extension (without dot)
76
+ * @returns true if extension is an agent format
77
+ */
78
+ static isAgentFormat(extension: string): boolean;
79
+ /**
80
+ * Check if MIME type is an agent file format.
81
+ *
82
+ * @param mimeType - MIME type string
83
+ * @returns true if MIME type is an agent format
84
+ */
85
+ static isAgentMimeType(mimeType: string): boolean;
86
+ /**
87
+ * Get all agent format extensions.
88
+ *
89
+ * @returns Array of extension strings
90
+ */
91
+ static getAllExtensions(): string[];
92
+ /**
93
+ * Get all agent format MIME types.
94
+ *
95
+ * @returns Array of MIME type strings
96
+ */
97
+ static getAllMimeTypes(): string[];
98
+ }
99
+ //# sourceMappingURL=agent-file-formats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-file-formats.d.ts","sourceRoot":"","sources":["../../../src/files/agent-file-formats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAoDvF;;GAEG;AACH,qBAAa,uBAAuB;IAClC;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI1C;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI3C;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAOpE;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAOlE;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIhD;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIjD;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,IAAI,MAAM,EAAE;IAInC;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM,EAAE;CAGnC"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Agent/Blueprint File Format Registry
3
+ *
4
+ * Handles file formats specific to agent/blueprint operations.
5
+ * Maps AppsBlueprint_FileFormat to extensions and MIME types.
6
+ *
7
+ * NOTE: This registry uses string literals that match AppsBlueprint_FileFormat
8
+ * and AppsBlueprint_FileMimes from @wildo-ai/saas-models to avoid circular
9
+ * dependencies. The registry methods return/accept these string values which
10
+ * are compatible with the enums defined in saas-models.
11
+ */
12
+ /**
13
+ * Agent/Blueprint file format string literals.
14
+ * These match AppsBlueprint_FileFormat enum values from @wildo-ai/saas-models.
15
+ */
16
+ export const AgentFileFormat = {
17
+ TEXT: 'text',
18
+ TYPESCRIPT: 'typescript',
19
+ TYPESCRIPT_JSX: 'typescript_react',
20
+ MARKDOWN: 'markdown',
21
+ JSON: 'json',
22
+ YAML: 'yaml',
23
+ };
24
+ /**
25
+ * Agent/Blueprint file MIME type string literals.
26
+ * These match AppsBlueprint_FileMimes enum values from @wildo-ai/saas-models.
27
+ */
28
+ export const AgentFileMime = {
29
+ TEXT_PLAIN: 'text/plain',
30
+ MARKDOWN: 'text/markdown',
31
+ JSON: 'application/json',
32
+ TYPESCRIPT: 'application/typescript',
33
+ TYPESCRIPT_JSX: 'application/typescript-jsx',
34
+ YAML: 'application/yaml',
35
+ };
36
+ /**
37
+ * Maps AppsBlueprint_FileFormat to MIME types.
38
+ */
39
+ const FORMAT_TO_MIME = {
40
+ [AgentFileFormat.TEXT]: AgentFileMime.TEXT_PLAIN,
41
+ [AgentFileFormat.MARKDOWN]: AgentFileMime.MARKDOWN,
42
+ [AgentFileFormat.JSON]: AgentFileMime.JSON,
43
+ [AgentFileFormat.TYPESCRIPT]: AgentFileMime.TYPESCRIPT,
44
+ [AgentFileFormat.TYPESCRIPT_JSX]: AgentFileMime.TYPESCRIPT_JSX,
45
+ [AgentFileFormat.YAML]: AgentFileMime.YAML,
46
+ };
47
+ /**
48
+ * Maps AppsBlueprint_FileFormat to extensions.
49
+ */
50
+ const FORMAT_TO_EXTENSION = {
51
+ [AgentFileFormat.TEXT]: 'txt',
52
+ [AgentFileFormat.MARKDOWN]: 'md',
53
+ [AgentFileFormat.JSON]: 'json',
54
+ [AgentFileFormat.TYPESCRIPT]: 'ts',
55
+ [AgentFileFormat.TYPESCRIPT_JSX]: 'tsx',
56
+ [AgentFileFormat.YAML]: 'yaml',
57
+ };
58
+ /**
59
+ * Reverse mapping: extension to AppsBlueprint_FileFormat.
60
+ */
61
+ const EXTENSION_TO_FORMAT = {
62
+ 'txt': AgentFileFormat.TEXT,
63
+ 'md': AgentFileFormat.MARKDOWN,
64
+ 'json': AgentFileFormat.JSON,
65
+ 'ts': AgentFileFormat.TYPESCRIPT,
66
+ 'tsx': AgentFileFormat.TYPESCRIPT_JSX,
67
+ 'yaml': AgentFileFormat.YAML,
68
+ 'yml': AgentFileFormat.YAML, // Alternative extension for YAML
69
+ };
70
+ /**
71
+ * Reverse mapping: MIME type to AppsBlueprint_FileFormat.
72
+ */
73
+ const MIME_TO_FORMAT = {
74
+ 'text/plain': AgentFileFormat.TEXT,
75
+ 'text/markdown': AgentFileFormat.MARKDOWN,
76
+ 'application/json': AgentFileFormat.JSON,
77
+ 'application/typescript': AgentFileFormat.TYPESCRIPT,
78
+ 'application/typescript-jsx': AgentFileFormat.TYPESCRIPT_JSX,
79
+ 'application/yaml': AgentFileFormat.YAML,
80
+ 'text/yaml': AgentFileFormat.YAML, // Alternative MIME type
81
+ };
82
+ /**
83
+ * Registry for agent/blueprint file formats.
84
+ */
85
+ export class AgentFileFormatRegistry {
86
+ /**
87
+ * Get MIME type for AppsBlueprint_FileFormat.
88
+ *
89
+ * @param format - AppsBlueprint_FileFormat enum value (or compatible string)
90
+ * @returns MIME type string
91
+ */
92
+ static getMimeType(format) {
93
+ return FORMAT_TO_MIME[format] || '';
94
+ }
95
+ /**
96
+ * Get extension for AppsBlueprint_FileFormat.
97
+ *
98
+ * @param format - AppsBlueprint_FileFormat enum value (or compatible string)
99
+ * @returns Extension string (without dot)
100
+ */
101
+ static getExtension(format) {
102
+ return FORMAT_TO_EXTENSION[format] || '';
103
+ }
104
+ /**
105
+ * Get AppsBlueprint_FileFormat from extension.
106
+ *
107
+ * @param extension - File extension (without dot)
108
+ * @returns Format string (compatible with AppsBlueprint_FileFormat) or undefined
109
+ */
110
+ static getFormatFromExtension(extension) {
111
+ if (!extension)
112
+ return undefined;
113
+ const normalizedExt = extension.toLowerCase().trim();
114
+ return EXTENSION_TO_FORMAT[normalizedExt];
115
+ }
116
+ /**
117
+ * Get AppsBlueprint_FileFormat from MIME type.
118
+ *
119
+ * @param mimeType - MIME type string
120
+ * @returns Format string (compatible with AppsBlueprint_FileFormat) or undefined
121
+ */
122
+ static getFormatFromMimeType(mimeType) {
123
+ if (!mimeType)
124
+ return undefined;
125
+ const normalizedMime = mimeType.toLowerCase().trim();
126
+ return MIME_TO_FORMAT[normalizedMime];
127
+ }
128
+ /**
129
+ * Check if extension is an agent file format.
130
+ *
131
+ * @param extension - File extension (without dot)
132
+ * @returns true if extension is an agent format
133
+ */
134
+ static isAgentFormat(extension) {
135
+ return this.getFormatFromExtension(extension) !== undefined;
136
+ }
137
+ /**
138
+ * Check if MIME type is an agent file format.
139
+ *
140
+ * @param mimeType - MIME type string
141
+ * @returns true if MIME type is an agent format
142
+ */
143
+ static isAgentMimeType(mimeType) {
144
+ return this.getFormatFromMimeType(mimeType) !== undefined;
145
+ }
146
+ /**
147
+ * Get all agent format extensions.
148
+ *
149
+ * @returns Array of extension strings
150
+ */
151
+ static getAllExtensions() {
152
+ return Object.values(FORMAT_TO_EXTENSION);
153
+ }
154
+ /**
155
+ * Get all agent format MIME types.
156
+ *
157
+ * @returns Array of MIME type strings
158
+ */
159
+ static getAllMimeTypes() {
160
+ return Object.values(FORMAT_TO_MIME);
161
+ }
162
+ }
163
+ //# sourceMappingURL=agent-file-formats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-file-formats.js","sourceRoot":"","sources":["../../../src/files/agent-file-formats.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Extension to FileNature Mapping
3
+ *
4
+ * Maps file extensions to their FileNature classification.
5
+ * Used for automatic nature detection from file extensions.
6
+ */
7
+ import { FileNature } from '../zod-decorators.types.js';
8
+ /**
9
+ * Maps file extensions (lowercase, without dot) to FileNature.
10
+ */
11
+ export declare const ExtensionToNatureMap: Record<string, FileNature>;
12
+ //# sourceMappingURL=extension-nature-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-nature-map.d.ts","sourceRoot":"","sources":["../../../src/files/extension-nature-map.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAwD3D,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Extension to FileNature Mapping
3
+ *
4
+ * Maps file extensions to their FileNature classification.
5
+ * Used for automatic nature detection from file extensions.
6
+ */
7
+ import { FileNature } from '../zod-decorators.types.js';
8
+ /**
9
+ * Maps file extensions (lowercase, without dot) to FileNature.
10
+ */
11
+ export const ExtensionToNatureMap = {
12
+ // Images
13
+ 'jpeg': FileNature.IMAGE,
14
+ 'jpg': FileNature.IMAGE,
15
+ 'jfif': FileNature.IMAGE,
16
+ 'png': FileNature.IMAGE,
17
+ 'gif': FileNature.IMAGE,
18
+ 'webp': FileNature.IMAGE,
19
+ 'svg': FileNature.IMAGE,
20
+ 'bmp': FileNature.IMAGE,
21
+ 'tiff': FileNature.IMAGE,
22
+ 'tif': FileNature.IMAGE,
23
+ 'ico': FileNature.IMAGE,
24
+ 'heic': FileNature.IMAGE,
25
+ 'heif': FileNature.IMAGE,
26
+ // Videos
27
+ 'mp4': FileNature.VIDEO,
28
+ 'webm': FileNature.VIDEO,
29
+ 'ogg': FileNature.VIDEO,
30
+ 'avi': FileNature.VIDEO,
31
+ 'mov': FileNature.VIDEO,
32
+ 'wmv': FileNature.VIDEO,
33
+ 'mpeg': FileNature.VIDEO,
34
+ 'mpg': FileNature.VIDEO,
35
+ '3gp': FileNature.VIDEO,
36
+ '3gpp': FileNature.VIDEO,
37
+ // Audio
38
+ 'mp3': FileNature.AUDIO,
39
+ 'wav': FileNature.AUDIO,
40
+ 'aac': FileNature.AUDIO,
41
+ 'flac': FileNature.AUDIO,
42
+ 'm4a': FileNature.AUDIO,
43
+ 'm4b': FileNature.AUDIO,
44
+ // PDF
45
+ 'pdf': FileNature.PDF,
46
+ // Office documents
47
+ 'doc': FileNature.OFFICE,
48
+ 'docx': FileNature.OFFICE,
49
+ 'xls': FileNature.OFFICE,
50
+ 'xlsx': FileNature.OFFICE,
51
+ 'ppt': FileNature.OFFICE,
52
+ 'pptx': FileNature.OFFICE,
53
+ 'odt': FileNature.OFFICE,
54
+ 'ods': FileNature.OFFICE,
55
+ 'odp': FileNature.OFFICE,
56
+ // Archives
57
+ 'zip': FileNature.ARCHIVE,
58
+ 'rar': FileNature.ARCHIVE,
59
+ '7z': FileNature.ARCHIVE,
60
+ 'gz': FileNature.ARCHIVE,
61
+ 'tar': FileNature.ARCHIVE,
62
+ };
63
+ //# sourceMappingURL=extension-nature-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-nature-map.js","sourceRoot":"","sources":["../../../src/files/extension-nature-map.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA+B;IAC9D,SAAS;IACT,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,MAAM,EAAE,UAAU,CAAC,KAAK;IAExB,SAAS;IACT,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,MAAM,EAAE,UAAU,CAAC,KAAK;IAExB,QAAQ;IACR,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,MAAM,EAAE,UAAU,CAAC,KAAK;IACxB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,UAAU,CAAC,KAAK;IAEvB,MAAM;IACN,KAAK,EAAE,UAAU,CAAC,GAAG;IAErB,mBAAmB;IACnB,KAAK,EAAE,UAAU,CAAC,MAAM;IACxB,MAAM,EAAE,UAAU,CAAC,MAAM;IACzB,KAAK,EAAE,UAAU,CAAC,MAAM;IACxB,MAAM,EAAE,UAAU,CAAC,MAAM;IACzB,KAAK,EAAE,UAAU,CAAC,MAAM;IACxB,MAAM,EAAE,UAAU,CAAC,MAAM;IACzB,KAAK,EAAE,UAAU,CAAC,MAAM;IACxB,KAAK,EAAE,UAAU,CAAC,MAAM;IACxB,KAAK,EAAE,UAAU,CAAC,MAAM;IAExB,WAAW;IACX,KAAK,EAAE,UAAU,CAAC,OAAO;IACzB,KAAK,EAAE,UAAU,CAAC,OAAO;IACzB,IAAI,EAAE,UAAU,CAAC,OAAO;IACxB,IAAI,EAAE,UAAU,CAAC,OAAO;IACxB,KAAK,EAAE,UAAU,CAAC,OAAO;CAC1B,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * File Extension Enum
3
+ *
4
+ * Common file extensions grouped by category.
5
+ * Used for type-safe extension handling and validation.
6
+ */
7
+ export declare enum FileExtension {
8
+ JPEG = "jpeg",
9
+ JPG = "jpg",
10
+ PNG = "png",
11
+ GIF = "gif",
12
+ WEBP = "webp",
13
+ SVG = "svg",
14
+ BMP = "bmp",
15
+ TIFF = "tiff",
16
+ ICO = "ico",
17
+ HEIC = "heic",
18
+ HEIF = "heif",
19
+ JFIF = "jfif",
20
+ MP4 = "mp4",
21
+ WEBM = "webm",
22
+ OGG_VIDEO = "ogg",
23
+ AVI = "avi",
24
+ MOV = "mov",
25
+ WMV = "wmv",
26
+ MPEG = "mpeg",
27
+ THREE_GP = "3gp",
28
+ MP3 = "mp3",
29
+ WAV = "wav",
30
+ OGG_AUDIO = "ogg",
31
+ AAC = "aac",
32
+ FLAC = "flac",
33
+ M4A = "m4a",
34
+ M4B = "m4b",
35
+ PDF = "pdf",
36
+ DOC = "doc",
37
+ DOCX = "docx",
38
+ XLS = "xls",
39
+ XLSX = "xlsx",
40
+ PPT = "ppt",
41
+ PPTX = "pptx",
42
+ ODT = "odt",
43
+ ODS = "ods",
44
+ ODP = "odp",
45
+ ZIP = "zip",
46
+ RAR = "rar",
47
+ SEVEN_Z = "7z",
48
+ GZ = "gz",
49
+ TAR = "tar",
50
+ TXT = "txt",
51
+ MD = "md",
52
+ JSON = "json",
53
+ TS = "ts",
54
+ TSX = "tsx",
55
+ YAML = "yaml",
56
+ YML = "yml"
57
+ }
58
+ //# sourceMappingURL=file-extensions.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-extensions.enum.d.ts","sourceRoot":"","sources":["../../../src/files/file-extensions.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,oBAAY,aAAa;IAEvB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IAGb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,SAAS,QAAQ;IACjB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,QAAQ,QAAQ;IAGhB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,SAAS,QAAQ;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IAGX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;IAGX,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,OAAO,OAAO;IACd,EAAE,OAAO;IACT,GAAG,QAAQ;IAGX,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,IAAI,SAAS;IACb,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * File Extension Enum
3
+ *
4
+ * Common file extensions grouped by category.
5
+ * Used for type-safe extension handling and validation.
6
+ */
7
+ export var FileExtension;
8
+ (function (FileExtension) {
9
+ // Images
10
+ FileExtension["JPEG"] = "jpeg";
11
+ FileExtension["JPG"] = "jpg";
12
+ FileExtension["PNG"] = "png";
13
+ FileExtension["GIF"] = "gif";
14
+ FileExtension["WEBP"] = "webp";
15
+ FileExtension["SVG"] = "svg";
16
+ FileExtension["BMP"] = "bmp";
17
+ FileExtension["TIFF"] = "tiff";
18
+ FileExtension["ICO"] = "ico";
19
+ FileExtension["HEIC"] = "heic";
20
+ FileExtension["HEIF"] = "heif";
21
+ FileExtension["JFIF"] = "jfif";
22
+ // Videos
23
+ FileExtension["MP4"] = "mp4";
24
+ FileExtension["WEBM"] = "webm";
25
+ FileExtension["OGG_VIDEO"] = "ogg";
26
+ FileExtension["AVI"] = "avi";
27
+ FileExtension["MOV"] = "mov";
28
+ FileExtension["WMV"] = "wmv";
29
+ FileExtension["MPEG"] = "mpeg";
30
+ FileExtension["THREE_GP"] = "3gp";
31
+ // Audio
32
+ FileExtension["MP3"] = "mp3";
33
+ FileExtension["WAV"] = "wav";
34
+ FileExtension["OGG_AUDIO"] = "ogg";
35
+ FileExtension["AAC"] = "aac";
36
+ FileExtension["FLAC"] = "flac";
37
+ FileExtension["M4A"] = "m4a";
38
+ FileExtension["M4B"] = "m4b";
39
+ // Documents
40
+ FileExtension["PDF"] = "pdf";
41
+ FileExtension["DOC"] = "doc";
42
+ FileExtension["DOCX"] = "docx";
43
+ FileExtension["XLS"] = "xls";
44
+ FileExtension["XLSX"] = "xlsx";
45
+ FileExtension["PPT"] = "ppt";
46
+ FileExtension["PPTX"] = "pptx";
47
+ FileExtension["ODT"] = "odt";
48
+ FileExtension["ODS"] = "ods";
49
+ FileExtension["ODP"] = "odp";
50
+ // Archives
51
+ FileExtension["ZIP"] = "zip";
52
+ FileExtension["RAR"] = "rar";
53
+ FileExtension["SEVEN_Z"] = "7z";
54
+ FileExtension["GZ"] = "gz";
55
+ FileExtension["TAR"] = "tar";
56
+ // Agent/Blueprint formats (text-based)
57
+ FileExtension["TXT"] = "txt";
58
+ FileExtension["MD"] = "md";
59
+ FileExtension["JSON"] = "json";
60
+ FileExtension["TS"] = "ts";
61
+ FileExtension["TSX"] = "tsx";
62
+ FileExtension["YAML"] = "yaml";
63
+ FileExtension["YML"] = "yml";
64
+ })(FileExtension || (FileExtension = {}));
65
+ //# sourceMappingURL=file-extensions.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-extensions.enum.js","sourceRoot":"","sources":["../../../src/files/file-extensions.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAN,IAAY,aA6DX;AA7DD,WAAY,aAAa;IACvB,SAAS;IACT,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,8BAAa,CAAA;IACb,8BAAa,CAAA;IAEb,SAAS;IACT,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,kCAAiB,CAAA;IACjB,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,iCAAgB,CAAA;IAEhB,QAAQ;IACR,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,kCAAiB,CAAA;IACjB,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,4BAAW,CAAA;IAEX,YAAY;IACZ,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,4BAAW,CAAA;IAEX,WAAW;IACX,4BAAW,CAAA;IACX,4BAAW,CAAA;IACX,+BAAc,CAAA;IACd,0BAAS,CAAA;IACT,4BAAW,CAAA;IAEX,uCAAuC;IACvC,4BAAW,CAAA;IACX,0BAAS,CAAA;IACT,8BAAa,CAAA;IACb,0BAAS,CAAA;IACT,4BAAW,CAAA;IACX,8BAAa,CAAA;IACb,4BAAW,CAAA;AACb,CAAC,EA7DW,aAAa,KAAb,aAAa,QA6DxB"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * File MIME Type Registry
3
+ *
4
+ * Core registry for general file types (images, videos, documents, etc.).
5
+ * Uses the `mime` library for authoritative extension ↔ MIME type mapping.
6
+ */
7
+ import { FileNature } from '../zod-decorators.types.js';
8
+ /**
9
+ * Core registry for general file types.
10
+ */
11
+ export declare class FileMimeTypeRegistry {
12
+ /**
13
+ * Get MIME type from extension (using mime library + custom mappings).
14
+ *
15
+ * @param extension - File extension (without dot, case-insensitive)
16
+ * @returns MIME type string or undefined if not found
17
+ */
18
+ static getMimeType(extension: string): string | undefined;
19
+ /**
20
+ * Get all extensions for a MIME type.
21
+ *
22
+ * @param mimeType - MIME type string
23
+ * @returns Array of extensions (without dots)
24
+ */
25
+ static getExtensions(mimeType: string): string[];
26
+ /**
27
+ * Normalize extension to canonical format name.
28
+ * Maps common extension variations to standard format names.
29
+ * Examples: 'jpg' → 'jpeg', 'jfif' → 'jpeg', 'm4a' → 'aac'
30
+ *
31
+ * @param extension - File extension (without dot)
32
+ * @returns Normalized format name
33
+ */
34
+ static normalizeExtension(extension: string): string;
35
+ /**
36
+ * Get FileNature from extension.
37
+ *
38
+ * @param extension - File extension (without dot)
39
+ * @returns FileNature or undefined if not found
40
+ */
41
+ static getNatureFromExtension(extension: string): FileNature | undefined;
42
+ /**
43
+ * Get FileNature from MIME type.
44
+ *
45
+ * @param mimeType - MIME type string
46
+ * @returns FileNature or undefined if not found
47
+ */
48
+ static getNatureFromMimeType(mimeType: string): FileNature | undefined;
49
+ /**
50
+ * Validate that extension matches MIME type.
51
+ *
52
+ * @param extension - File extension (without dot)
53
+ * @param mimeType - MIME type string
54
+ * @returns true if extension matches MIME type, false otherwise
55
+ */
56
+ static validateExtensionMimeMatch(extension: string, mimeType: string): boolean;
57
+ /**
58
+ * Get extensions for a FileNature.
59
+ *
60
+ * @param nature - FileNature enum value
61
+ * @returns Array of extensions (without dots)
62
+ */
63
+ static getExtensionsForNature(nature: FileNature): string[];
64
+ /**
65
+ * Get MIME types for a FileNature.
66
+ *
67
+ * @param nature - FileNature enum value
68
+ * @returns Array of MIME type strings
69
+ */
70
+ static getMimeTypesForNature(nature: FileNature): string[];
71
+ }
72
+ //# sourceMappingURL=mime-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mime-registry.d.ts","sourceRoot":"","sources":["../../../src/files/mime-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAsC7D;;GAEG;AACH,qBAAa,oBAAoB;IAC/B;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAezD;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAWhD;;;;;;;OAOG;IACH,MAAM,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAOpD;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAOxE;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAUtE;;;;;;OAMG;IACH,MAAM,CAAC,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO;IAoB/E;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE;IAM3D;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE;CAa3D"}