@things-factory/dataset 9.1.17 → 9.1.19
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/EXPLORATION_INDEX.md +252 -0
- package/FRONTEND_ARCHITECTURE.md +732 -0
- package/QUICK_REFERENCE.md +365 -0
- package/dist-client/pages/data-set/data-item-list.js +15 -1
- package/dist-client/pages/data-set/data-item-list.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/create-data-sample.js +57 -5
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/service/data-set/data-item-type.d.ts +259 -0
- package/dist-server/service/data-set/data-item-type.js +259 -0
- package/dist-server/service/data-set/data-item-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/utils/index.d.ts +1 -0
- package/dist-server/utils/index.js +1 -0
- package/dist-server/utils/index.js.map +1 -1
- package/dist-server/utils/media-validation.d.ts +51 -0
- package/dist-server/utils/media-validation.js +148 -0
- package/dist-server/utils/media-validation.js.map +1 -0
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/utils/index.ts"],"names":[],"mappings":";;;AAAA,+DAAoC","sourcesContent":["export * from './config-resolver.js'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/utils/index.ts"],"names":[],"mappings":";;;AAAA,+DAAoC;AACpC,gEAAqC","sourcesContent":["export * from './config-resolver.js'\nexport * from './media-validation.js'\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DataItemType } from '../service/data-set/data-item-type.js';
|
|
2
|
+
/**
|
|
3
|
+
* MIME type mappings for media types
|
|
4
|
+
*/
|
|
5
|
+
export declare const MEDIA_MIME_TYPES: {
|
|
6
|
+
image: string[];
|
|
7
|
+
video: string[];
|
|
8
|
+
audio: string[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* File extension to MIME type mapping
|
|
12
|
+
*/
|
|
13
|
+
export declare const EXTENSION_TO_MIME: Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a MIME type is valid for a given media type
|
|
16
|
+
*/
|
|
17
|
+
export declare function isValidMimeType(mediaType: DataItemType, mimetype: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Check if file extension is allowed based on options.accept
|
|
20
|
+
*/
|
|
21
|
+
export declare function isAcceptedFormat(filename: string, acceptFormats?: string[]): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Validate file size against options.maxSize
|
|
24
|
+
*/
|
|
25
|
+
export declare function isValidFileSize(fileSize: number, maxSize?: number): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Validation result
|
|
28
|
+
*/
|
|
29
|
+
export interface MediaValidationResult {
|
|
30
|
+
valid: boolean;
|
|
31
|
+
errors: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Validate media file against DataItem options
|
|
35
|
+
*/
|
|
36
|
+
export declare function validateMediaFile(file: {
|
|
37
|
+
mimetype: string;
|
|
38
|
+
size?: number;
|
|
39
|
+
name: string;
|
|
40
|
+
}, mediaType: DataItemType, options?: {
|
|
41
|
+
accept?: string[];
|
|
42
|
+
maxSize?: number;
|
|
43
|
+
}): MediaValidationResult;
|
|
44
|
+
/**
|
|
45
|
+
* Check if a DataItemType is a media type
|
|
46
|
+
*/
|
|
47
|
+
export declare function isMediaType(type: DataItemType): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a DataItemType is a file or media type
|
|
50
|
+
*/
|
|
51
|
+
export declare function isFileOrMediaType(type: DataItemType): boolean;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXTENSION_TO_MIME = exports.MEDIA_MIME_TYPES = void 0;
|
|
4
|
+
exports.isValidMimeType = isValidMimeType;
|
|
5
|
+
exports.isAcceptedFormat = isAcceptedFormat;
|
|
6
|
+
exports.isValidFileSize = isValidFileSize;
|
|
7
|
+
exports.validateMediaFile = validateMediaFile;
|
|
8
|
+
exports.isMediaType = isMediaType;
|
|
9
|
+
exports.isFileOrMediaType = isFileOrMediaType;
|
|
10
|
+
const data_item_type_js_1 = require("../service/data-set/data-item-type.js");
|
|
11
|
+
/**
|
|
12
|
+
* MIME type mappings for media types
|
|
13
|
+
*/
|
|
14
|
+
exports.MEDIA_MIME_TYPES = {
|
|
15
|
+
image: [
|
|
16
|
+
'image/jpeg',
|
|
17
|
+
'image/jpg',
|
|
18
|
+
'image/png',
|
|
19
|
+
'image/gif',
|
|
20
|
+
'image/webp',
|
|
21
|
+
'image/bmp',
|
|
22
|
+
'image/svg+xml',
|
|
23
|
+
'image/tiff'
|
|
24
|
+
],
|
|
25
|
+
video: [
|
|
26
|
+
'video/mp4',
|
|
27
|
+
'video/webm',
|
|
28
|
+
'video/ogg',
|
|
29
|
+
'video/quicktime', // .mov
|
|
30
|
+
'video/x-msvideo', // .avi
|
|
31
|
+
'video/x-matroska', // .mkv
|
|
32
|
+
'video/mpeg'
|
|
33
|
+
],
|
|
34
|
+
audio: [
|
|
35
|
+
'audio/mpeg', // .mp3
|
|
36
|
+
'audio/wav',
|
|
37
|
+
'audio/wave',
|
|
38
|
+
'audio/x-wav',
|
|
39
|
+
'audio/ogg',
|
|
40
|
+
'audio/mp4', // .m4a
|
|
41
|
+
'audio/aac',
|
|
42
|
+
'audio/webm',
|
|
43
|
+
'audio/flac'
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* File extension to MIME type mapping
|
|
48
|
+
*/
|
|
49
|
+
exports.EXTENSION_TO_MIME = {
|
|
50
|
+
// Images
|
|
51
|
+
jpg: 'image/jpeg',
|
|
52
|
+
jpeg: 'image/jpeg',
|
|
53
|
+
png: 'image/png',
|
|
54
|
+
gif: 'image/gif',
|
|
55
|
+
webp: 'image/webp',
|
|
56
|
+
bmp: 'image/bmp',
|
|
57
|
+
svg: 'image/svg+xml',
|
|
58
|
+
tiff: 'image/tiff',
|
|
59
|
+
tif: 'image/tiff',
|
|
60
|
+
// Videos
|
|
61
|
+
mp4: 'video/mp4',
|
|
62
|
+
webm: 'video/webm',
|
|
63
|
+
ogv: 'video/ogg',
|
|
64
|
+
mov: 'video/quicktime',
|
|
65
|
+
avi: 'video/x-msvideo',
|
|
66
|
+
mkv: 'video/x-matroska',
|
|
67
|
+
mpeg: 'video/mpeg',
|
|
68
|
+
mpg: 'video/mpeg',
|
|
69
|
+
// Audio
|
|
70
|
+
mp3: 'audio/mpeg',
|
|
71
|
+
wav: 'audio/wav',
|
|
72
|
+
wave: 'audio/wave',
|
|
73
|
+
ogg: 'audio/ogg',
|
|
74
|
+
oga: 'audio/ogg',
|
|
75
|
+
m4a: 'audio/mp4',
|
|
76
|
+
aac: 'audio/aac',
|
|
77
|
+
flac: 'audio/flac'
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Check if a MIME type is valid for a given media type
|
|
81
|
+
*/
|
|
82
|
+
function isValidMimeType(mediaType, mimetype) {
|
|
83
|
+
if (!mimetype)
|
|
84
|
+
return false;
|
|
85
|
+
const allowedTypes = exports.MEDIA_MIME_TYPES[mediaType];
|
|
86
|
+
if (!allowedTypes)
|
|
87
|
+
return false;
|
|
88
|
+
return allowedTypes.some(type => mimetype.toLowerCase().startsWith(type.toLowerCase()));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Check if file extension is allowed based on options.accept
|
|
92
|
+
*/
|
|
93
|
+
function isAcceptedFormat(filename, acceptFormats) {
|
|
94
|
+
if (!acceptFormats || acceptFormats.length === 0)
|
|
95
|
+
return true;
|
|
96
|
+
const ext = filename.split('.').pop()?.toLowerCase();
|
|
97
|
+
if (!ext)
|
|
98
|
+
return false;
|
|
99
|
+
return acceptFormats.some(format => format.toLowerCase() === ext);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Validate file size against options.maxSize
|
|
103
|
+
*/
|
|
104
|
+
function isValidFileSize(fileSize, maxSize) {
|
|
105
|
+
if (!maxSize)
|
|
106
|
+
return true;
|
|
107
|
+
return fileSize <= maxSize;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Validate media file against DataItem options
|
|
111
|
+
*/
|
|
112
|
+
function validateMediaFile(file, mediaType, options) {
|
|
113
|
+
const errors = [];
|
|
114
|
+
// Check MIME type
|
|
115
|
+
if (!isValidMimeType(mediaType, file.mimetype)) {
|
|
116
|
+
errors.push(`Invalid file type '${file.mimetype}' for ${mediaType}. Expected: ${exports.MEDIA_MIME_TYPES[mediaType]?.join(', ')}`);
|
|
117
|
+
}
|
|
118
|
+
// Check accepted formats (if specified in options)
|
|
119
|
+
if (options?.accept && !isAcceptedFormat(file.name, options.accept)) {
|
|
120
|
+
errors.push(`File format not accepted. Allowed formats: ${options.accept.join(', ')}`);
|
|
121
|
+
}
|
|
122
|
+
// Check file size (if specified in options)
|
|
123
|
+
if (file.size && options?.maxSize && !isValidFileSize(file.size, options.maxSize)) {
|
|
124
|
+
const maxSizeMB = (options.maxSize / 1024 / 1024).toFixed(2);
|
|
125
|
+
const fileSizeMB = (file.size / 1024 / 1024).toFixed(2);
|
|
126
|
+
errors.push(`File size (${fileSizeMB}MB) exceeds maximum allowed size (${maxSizeMB}MB)`);
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
valid: errors.length === 0,
|
|
130
|
+
errors
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Check if a DataItemType is a media type
|
|
135
|
+
*/
|
|
136
|
+
function isMediaType(type) {
|
|
137
|
+
return type === data_item_type_js_1.DataItemType.image || type === data_item_type_js_1.DataItemType.video || type === data_item_type_js_1.DataItemType.audio;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Check if a DataItemType is a file or media type
|
|
141
|
+
*/
|
|
142
|
+
function isFileOrMediaType(type) {
|
|
143
|
+
return (type === data_item_type_js_1.DataItemType.file ||
|
|
144
|
+
type === data_item_type_js_1.DataItemType.image ||
|
|
145
|
+
type === data_item_type_js_1.DataItemType.video ||
|
|
146
|
+
type === data_item_type_js_1.DataItemType.audio);
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=media-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-validation.js","sourceRoot":"","sources":["../../server/utils/media-validation.ts"],"names":[],"mappings":";;;AA6EA,0CAOC;AAKD,4CAOC;AAKD,0CAGC;AAaD,8CA8BC;AAKD,kCAEC;AAKD,8CAOC;AAtKD,6EAAoE;AAEpE;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,KAAK,EAAE;QACL,YAAY;QACZ,WAAW;QACX,WAAW;QACX,WAAW;QACX,YAAY;QACZ,WAAW;QACX,eAAe;QACf,YAAY;KACb;IACD,KAAK,EAAE;QACL,WAAW;QACX,YAAY;QACZ,WAAW;QACX,iBAAiB,EAAE,OAAO;QAC1B,iBAAiB,EAAE,OAAO;QAC1B,kBAAkB,EAAE,OAAO;QAC3B,YAAY;KACb;IACD,KAAK,EAAE;QACL,YAAY,EAAE,OAAO;QACrB,WAAW;QACX,YAAY;QACZ,aAAa;QACb,WAAW;QACX,WAAW,EAAE,OAAO;QACpB,WAAW;QACX,YAAY;QACZ,YAAY;KACb;CACF,CAAA;AAED;;GAEG;AACU,QAAA,iBAAiB,GAA2B;IACvD,SAAS;IACT,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,eAAe;IACpB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,YAAY;IAEjB,SAAS;IACT,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,WAAW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,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,IAAkB;IAC5C,OAAO,IAAI,KAAK,gCAAY,CAAC,KAAK,IAAI,IAAI,KAAK,gCAAY,CAAC,KAAK,IAAI,IAAI,KAAK,gCAAY,CAAC,KAAK,CAAA;AAClG,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,IAAkB;IAClD,OAAO,CACL,IAAI,KAAK,gCAAY,CAAC,IAAI;QAC1B,IAAI,KAAK,gCAAY,CAAC,KAAK;QAC3B,IAAI,KAAK,gCAAY,CAAC,KAAK;QAC3B,IAAI,KAAK,gCAAY,CAAC,KAAK,CAC5B,CAAA;AACH,CAAC","sourcesContent":["import { DataItemType } from '../service/data-set/data-item-type.js'\n\n/**\n * MIME type mappings for media types\n */\nexport const MEDIA_MIME_TYPES = {\n image: [\n 'image/jpeg',\n 'image/jpg',\n 'image/png',\n 'image/gif',\n 'image/webp',\n 'image/bmp',\n 'image/svg+xml',\n 'image/tiff'\n ],\n video: [\n 'video/mp4',\n 'video/webm',\n 'video/ogg',\n 'video/quicktime', // .mov\n 'video/x-msvideo', // .avi\n 'video/x-matroska', // .mkv\n 'video/mpeg'\n ],\n audio: [\n 'audio/mpeg', // .mp3\n 'audio/wav',\n 'audio/wave',\n 'audio/x-wav',\n 'audio/ogg',\n 'audio/mp4', // .m4a\n 'audio/aac',\n 'audio/webm',\n 'audio/flac'\n ]\n}\n\n/**\n * File extension to MIME type mapping\n */\nexport const EXTENSION_TO_MIME: Record<string, string> = {\n // Images\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n webp: 'image/webp',\n bmp: 'image/bmp',\n svg: 'image/svg+xml',\n tiff: 'image/tiff',\n tif: 'image/tiff',\n\n // Videos\n mp4: 'video/mp4',\n webm: 'video/webm',\n ogv: 'video/ogg',\n mov: 'video/quicktime',\n avi: 'video/x-msvideo',\n mkv: 'video/x-matroska',\n mpeg: 'video/mpeg',\n mpg: 'video/mpeg',\n\n // Audio\n mp3: 'audio/mpeg',\n wav: 'audio/wav',\n wave: 'audio/wave',\n ogg: 'audio/ogg',\n oga: 'audio/ogg',\n m4a: 'audio/mp4',\n aac: 'audio/aac',\n flac: 'audio/flac'\n}\n\n/**\n * Check if a MIME type is valid for a given media type\n */\nexport function isValidMimeType(mediaType: DataItemType, mimetype: string): boolean {\n if (!mimetype) return false\n\n const allowedTypes = MEDIA_MIME_TYPES[mediaType as keyof typeof MEDIA_MIME_TYPES]\n if (!allowedTypes) return false\n\n return allowedTypes.some(type => mimetype.toLowerCase().startsWith(type.toLowerCase()))\n}\n\n/**\n * Check if file extension is allowed based on options.accept\n */\nexport function isAcceptedFormat(filename: string, acceptFormats?: string[]): boolean {\n if (!acceptFormats || acceptFormats.length === 0) return true\n\n const ext = filename.split('.').pop()?.toLowerCase()\n if (!ext) return false\n\n return acceptFormats.some(format => format.toLowerCase() === ext)\n}\n\n/**\n * Validate file size against options.maxSize\n */\nexport function isValidFileSize(fileSize: number, maxSize?: number): boolean {\n if (!maxSize) return true\n return fileSize <= maxSize\n}\n\n/**\n * Validation result\n */\nexport interface MediaValidationResult {\n valid: boolean\n errors: string[]\n}\n\n/**\n * Validate media file against DataItem options\n */\nexport function validateMediaFile(\n file: { mimetype: string; size?: number; name: string },\n mediaType: DataItemType,\n options?: { accept?: string[]; maxSize?: number }\n): MediaValidationResult {\n const errors: string[] = []\n\n // Check MIME type\n if (!isValidMimeType(mediaType, file.mimetype)) {\n errors.push(\n `Invalid file type '${file.mimetype}' for ${mediaType}. Expected: ${MEDIA_MIME_TYPES[mediaType as keyof typeof MEDIA_MIME_TYPES]?.join(', ')}`\n )\n }\n\n // Check accepted formats (if specified in options)\n if (options?.accept && !isAcceptedFormat(file.name, options.accept)) {\n errors.push(`File format not accepted. Allowed formats: ${options.accept.join(', ')}`)\n }\n\n // Check file size (if specified in options)\n if (file.size && options?.maxSize && !isValidFileSize(file.size, options.maxSize)) {\n const maxSizeMB = (options.maxSize / 1024 / 1024).toFixed(2)\n const fileSizeMB = (file.size / 1024 / 1024).toFixed(2)\n errors.push(`File size (${fileSizeMB}MB) exceeds maximum allowed size (${maxSizeMB}MB)`)\n }\n\n return {\n valid: errors.length === 0,\n errors\n }\n}\n\n/**\n * Check if a DataItemType is a media type\n */\nexport function isMediaType(type: DataItemType): boolean {\n return type === DataItemType.image || type === DataItemType.video || type === DataItemType.audio\n}\n\n/**\n * Check if a DataItemType is a file or media type\n */\nexport function isFileOrMediaType(type: DataItemType): boolean {\n return (\n type === DataItemType.file ||\n type === DataItemType.image ||\n type === DataItemType.video ||\n type === DataItemType.audio\n )\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/dataset",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.19",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -40,21 +40,21 @@
|
|
|
40
40
|
"@operato/shell": "^9.0.0",
|
|
41
41
|
"@operato/styles": "^9.0.0",
|
|
42
42
|
"@operato/utils": "^9.0.0",
|
|
43
|
-
"@things-factory/auth-base": "^9.1.
|
|
44
|
-
"@things-factory/aws-base": "^9.1.
|
|
45
|
-
"@things-factory/board-service": "^9.1.
|
|
43
|
+
"@things-factory/auth-base": "^9.1.19",
|
|
44
|
+
"@things-factory/aws-base": "^9.1.19",
|
|
45
|
+
"@things-factory/board-service": "^9.1.19",
|
|
46
46
|
"@things-factory/env": "^9.1.13",
|
|
47
|
-
"@things-factory/integration-base": "^9.1.
|
|
48
|
-
"@things-factory/organization": "^9.1.
|
|
49
|
-
"@things-factory/personalization": "^9.1.
|
|
50
|
-
"@things-factory/scheduler-client": "^9.1.
|
|
51
|
-
"@things-factory/shell": "^9.1.
|
|
52
|
-
"@things-factory/work-shift": "^9.1.
|
|
53
|
-
"@things-factory/worklist": "^9.1.
|
|
47
|
+
"@things-factory/integration-base": "^9.1.19",
|
|
48
|
+
"@things-factory/organization": "^9.1.19",
|
|
49
|
+
"@things-factory/personalization": "^9.1.19",
|
|
50
|
+
"@things-factory/scheduler-client": "^9.1.19",
|
|
51
|
+
"@things-factory/shell": "^9.1.19",
|
|
52
|
+
"@things-factory/work-shift": "^9.1.19",
|
|
53
|
+
"@things-factory/worklist": "^9.1.19",
|
|
54
54
|
"cron-parser": "^4.3.0",
|
|
55
55
|
"moment-timezone": "^0.5.45",
|
|
56
56
|
"simple-statistics": "^7.8.3",
|
|
57
57
|
"statistics": "^3.3.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "078438034dbe19915108e89ff24024f7044a85a9"
|
|
60
60
|
}
|