@things-factory/dataset 9.1.18 → 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/pages/data-set/data-set-list-page.js +0 -1
- package/dist-client/pages/data-set/data-set-list-page.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
|
@@ -14,6 +14,9 @@ var DataItemType;
|
|
|
14
14
|
DataItemType["date"] = "date";
|
|
15
15
|
DataItemType["datetime"] = "datetime";
|
|
16
16
|
DataItemType["file"] = "file";
|
|
17
|
+
DataItemType["image"] = "image";
|
|
18
|
+
DataItemType["video"] = "video";
|
|
19
|
+
DataItemType["audio"] = "audio";
|
|
17
20
|
DataItemType["signature"] = "signature";
|
|
18
21
|
})(DataItemType || (exports.DataItemType = DataItemType = {}));
|
|
19
22
|
(0, type_graphql_1.registerEnumType)(DataItemType, {
|
|
@@ -196,4 +199,260 @@ tslib_1.__decorate([
|
|
|
196
199
|
exports.DataItemPatch = DataItemPatch = tslib_1.__decorate([
|
|
197
200
|
(0, type_graphql_1.InputType)()
|
|
198
201
|
], DataItemPatch);
|
|
202
|
+
/**
|
|
203
|
+
* ============================================================================
|
|
204
|
+
* Media Type Options Schema
|
|
205
|
+
* ============================================================================
|
|
206
|
+
*
|
|
207
|
+
* The `options` field provides type-specific configuration for media types
|
|
208
|
+
* (image, video, audio). Below are the recommended schemas for each type.
|
|
209
|
+
*
|
|
210
|
+
* ============================================================================
|
|
211
|
+
* IMAGE Type Options
|
|
212
|
+
* ============================================================================
|
|
213
|
+
*
|
|
214
|
+
* Example:
|
|
215
|
+
* {
|
|
216
|
+
* type: 'image',
|
|
217
|
+
* options: {
|
|
218
|
+
* // File formats
|
|
219
|
+
* accept: ['jpeg', 'png', 'webp', 'gif'], // Allowed formats
|
|
220
|
+
*
|
|
221
|
+
* // Size constraints
|
|
222
|
+
* maxSize: 10485760, // Max file size in bytes (10MB)
|
|
223
|
+
* maxWidth: 4096, // Max width in pixels
|
|
224
|
+
* maxHeight: 4096, // Max height in pixels
|
|
225
|
+
* minWidth: 224, // Min width in pixels
|
|
226
|
+
* minHeight: 224, // Min height in pixels
|
|
227
|
+
*
|
|
228
|
+
* // Multiple uploads
|
|
229
|
+
* multiple: true, // Allow multiple images
|
|
230
|
+
* maxFiles: 10, // Max number of files
|
|
231
|
+
*
|
|
232
|
+
* // Thumbnail generation
|
|
233
|
+
* thumbnail: {
|
|
234
|
+
* enabled: true,
|
|
235
|
+
* width: 200,
|
|
236
|
+
* height: 200,
|
|
237
|
+
* format: 'jpeg', // 'jpeg' | 'png' | 'webp'
|
|
238
|
+
* quality: 85 // 1-100
|
|
239
|
+
* },
|
|
240
|
+
*
|
|
241
|
+
* // Preview settings
|
|
242
|
+
* preview: {
|
|
243
|
+
* enabled: true,
|
|
244
|
+
* maxWidth: 1024,
|
|
245
|
+
* maxHeight: 1024
|
|
246
|
+
* },
|
|
247
|
+
*
|
|
248
|
+
* // Metadata extraction
|
|
249
|
+
* metadata: {
|
|
250
|
+
* extractExif: true, // Extract EXIF data
|
|
251
|
+
* extractDimensions: true, // Extract width/height
|
|
252
|
+
* extractFormat: true, // Extract image format
|
|
253
|
+
* extractColorProfile: true // Extract color profile
|
|
254
|
+
* },
|
|
255
|
+
*
|
|
256
|
+
* // Compression/conversion
|
|
257
|
+
* compression: {
|
|
258
|
+
* enabled: true,
|
|
259
|
+
* format: 'webp', // Target format
|
|
260
|
+
* quality: 85, // Compression quality
|
|
261
|
+
* maxDimension: 2048 // Max width or height
|
|
262
|
+
* }
|
|
263
|
+
* }
|
|
264
|
+
* }
|
|
265
|
+
*
|
|
266
|
+
* ============================================================================
|
|
267
|
+
* VIDEO Type Options
|
|
268
|
+
* ============================================================================
|
|
269
|
+
*
|
|
270
|
+
* Example:
|
|
271
|
+
* {
|
|
272
|
+
* type: 'video',
|
|
273
|
+
* options: {
|
|
274
|
+
* // File formats
|
|
275
|
+
* accept: ['mp4', 'webm', 'mov', 'avi'], // Allowed formats
|
|
276
|
+
*
|
|
277
|
+
* // Size constraints
|
|
278
|
+
* maxSize: 104857600, // Max file size in bytes (100MB)
|
|
279
|
+
* maxDuration: 300, // Max duration in seconds (5 minutes)
|
|
280
|
+
* maxWidth: 1920, // Max resolution width
|
|
281
|
+
* maxHeight: 1080, // Max resolution height
|
|
282
|
+
*
|
|
283
|
+
* // Multiple uploads
|
|
284
|
+
* multiple: false, // Usually single video per field
|
|
285
|
+
* maxFiles: 1,
|
|
286
|
+
*
|
|
287
|
+
* // Thumbnail generation
|
|
288
|
+
* thumbnail: {
|
|
289
|
+
* enabled: true,
|
|
290
|
+
* width: 320,
|
|
291
|
+
* height: 180,
|
|
292
|
+
* format: 'jpeg',
|
|
293
|
+
* quality: 85,
|
|
294
|
+
* captureTime: 1 // Capture thumbnail at N seconds
|
|
295
|
+
* },
|
|
296
|
+
*
|
|
297
|
+
* // Preview settings
|
|
298
|
+
* preview: {
|
|
299
|
+
* enabled: true,
|
|
300
|
+
* maxWidth: 640,
|
|
301
|
+
* maxHeight: 480,
|
|
302
|
+
* controls: true, // Show video controls
|
|
303
|
+
* autoplay: false, // Autoplay preview
|
|
304
|
+
* muted: true // Mute by default
|
|
305
|
+
* },
|
|
306
|
+
*
|
|
307
|
+
* // Metadata extraction
|
|
308
|
+
* metadata: {
|
|
309
|
+
* extractDuration: true, // Extract video duration
|
|
310
|
+
* extractResolution: true, // Extract width/height
|
|
311
|
+
* extractFormat: true, // Extract video format
|
|
312
|
+
* extractCodec: true, // Extract video/audio codec
|
|
313
|
+
* extractFrameRate: true, // Extract FPS
|
|
314
|
+
* extractBitrate: true // Extract bitrate
|
|
315
|
+
* },
|
|
316
|
+
*
|
|
317
|
+
* // Transcoding
|
|
318
|
+
* transcoding: {
|
|
319
|
+
* enabled: true,
|
|
320
|
+
* format: 'mp4', // Target format
|
|
321
|
+
* codec: 'h264', // Video codec
|
|
322
|
+
* quality: 'medium', // 'low' | 'medium' | 'high'
|
|
323
|
+
* maxDimension: 1280 // Scale down if larger
|
|
324
|
+
* }
|
|
325
|
+
* }
|
|
326
|
+
* }
|
|
327
|
+
*
|
|
328
|
+
* ============================================================================
|
|
329
|
+
* AUDIO Type Options
|
|
330
|
+
* ============================================================================
|
|
331
|
+
*
|
|
332
|
+
* Example:
|
|
333
|
+
* {
|
|
334
|
+
* type: 'audio',
|
|
335
|
+
* options: {
|
|
336
|
+
* // File formats
|
|
337
|
+
* accept: ['mp3', 'wav', 'ogg', 'm4a', 'aac'], // Allowed formats
|
|
338
|
+
*
|
|
339
|
+
* // Size constraints
|
|
340
|
+
* maxSize: 52428800, // Max file size in bytes (50MB)
|
|
341
|
+
* maxDuration: 600, // Max duration in seconds (10 minutes)
|
|
342
|
+
*
|
|
343
|
+
* // Multiple uploads
|
|
344
|
+
* multiple: false,
|
|
345
|
+
* maxFiles: 1,
|
|
346
|
+
*
|
|
347
|
+
* // Waveform visualization
|
|
348
|
+
* waveform: {
|
|
349
|
+
* enabled: true,
|
|
350
|
+
* width: 800,
|
|
351
|
+
* height: 100,
|
|
352
|
+
* color: '#3498db'
|
|
353
|
+
* },
|
|
354
|
+
*
|
|
355
|
+
* // Preview settings
|
|
356
|
+
* preview: {
|
|
357
|
+
* enabled: true,
|
|
358
|
+
* controls: true, // Show audio controls
|
|
359
|
+
* autoplay: false, // Autoplay preview
|
|
360
|
+
* visualizer: true // Show audio visualizer
|
|
361
|
+
* },
|
|
362
|
+
*
|
|
363
|
+
* // Metadata extraction
|
|
364
|
+
* metadata: {
|
|
365
|
+
* extractDuration: true, // Extract audio duration
|
|
366
|
+
* extractFormat: true, // Extract audio format
|
|
367
|
+
* extractCodec: true, // Extract audio codec
|
|
368
|
+
* extractBitrate: true, // Extract bitrate
|
|
369
|
+
* extractSampleRate: true, // Extract sample rate
|
|
370
|
+
* extractChannels: true, // Extract channel count
|
|
371
|
+
* extractID3Tags: true // Extract ID3 tags (artist, title, etc.)
|
|
372
|
+
* },
|
|
373
|
+
*
|
|
374
|
+
* // Transcoding
|
|
375
|
+
* transcoding: {
|
|
376
|
+
* enabled: true,
|
|
377
|
+
* format: 'mp3', // Target format
|
|
378
|
+
* codec: 'mp3', // Audio codec
|
|
379
|
+
* bitrate: 128, // kbps
|
|
380
|
+
* sampleRate: 44100, // Hz
|
|
381
|
+
* channels: 2 // Stereo
|
|
382
|
+
* }
|
|
383
|
+
* }
|
|
384
|
+
* }
|
|
385
|
+
*
|
|
386
|
+
* ============================================================================
|
|
387
|
+
* Usage in GraphQL
|
|
388
|
+
* ============================================================================
|
|
389
|
+
*
|
|
390
|
+
* mutation {
|
|
391
|
+
* updateDataSet(
|
|
392
|
+
* name: "product_inspection"
|
|
393
|
+
* patch: {
|
|
394
|
+
* dataItems: [
|
|
395
|
+
* {
|
|
396
|
+
* name: "product_image"
|
|
397
|
+
* type: image
|
|
398
|
+
* options: {
|
|
399
|
+
* accept: ["jpeg", "png"]
|
|
400
|
+
* maxSize: 10485760
|
|
401
|
+
* thumbnail: { enabled: true, width: 200, height: 200 }
|
|
402
|
+
* metadata: { extractExif: true, extractDimensions: true }
|
|
403
|
+
* }
|
|
404
|
+
* },
|
|
405
|
+
* {
|
|
406
|
+
* name: "inspection_video"
|
|
407
|
+
* type: video
|
|
408
|
+
* options: {
|
|
409
|
+
* accept: ["mp4", "webm"]
|
|
410
|
+
* maxSize: 104857600
|
|
411
|
+
* maxDuration: 120
|
|
412
|
+
* thumbnail: { enabled: true, captureTime: 1 }
|
|
413
|
+
* }
|
|
414
|
+
* },
|
|
415
|
+
* {
|
|
416
|
+
* name: "operator_note_audio"
|
|
417
|
+
* type: audio
|
|
418
|
+
* options: {
|
|
419
|
+
* accept: ["mp3", "wav"]
|
|
420
|
+
* maxSize: 10485760
|
|
421
|
+
* maxDuration: 60
|
|
422
|
+
* waveform: { enabled: true }
|
|
423
|
+
* }
|
|
424
|
+
* }
|
|
425
|
+
* ]
|
|
426
|
+
* }
|
|
427
|
+
* ) {
|
|
428
|
+
* id
|
|
429
|
+
* name
|
|
430
|
+
* }
|
|
431
|
+
* }
|
|
432
|
+
*
|
|
433
|
+
* ============================================================================
|
|
434
|
+
* Label Studio Integration
|
|
435
|
+
* ============================================================================
|
|
436
|
+
*
|
|
437
|
+
* Dataset media types map to Label Studio annotation types:
|
|
438
|
+
*
|
|
439
|
+
* - image → <Image name="image" value="$image"/>
|
|
440
|
+
* - video → <Video name="video" value="$video"/>
|
|
441
|
+
* - audio → <Audio name="audio" value="$audio"/>
|
|
442
|
+
*
|
|
443
|
+
* Example Label Studio config generation:
|
|
444
|
+
*
|
|
445
|
+
* const dataItem = { name: 'product_image', type: 'image' }
|
|
446
|
+
*
|
|
447
|
+
* // → Label Studio config
|
|
448
|
+
* <View>
|
|
449
|
+
* <Image name="product_image" value="$product_image"/>
|
|
450
|
+
* <Choices name="classification" toName="product_image">
|
|
451
|
+
* <Choice value="Good"/>
|
|
452
|
+
* <Choice value="Defect"/>
|
|
453
|
+
* </Choices>
|
|
454
|
+
* </View>
|
|
455
|
+
*
|
|
456
|
+
* ============================================================================
|
|
457
|
+
*/
|
|
199
458
|
//# sourceMappingURL=data-item-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-item-type.js","sourceRoot":"","sources":["../../../server/service/data-set/data-item-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAkF;AAElF,iDAAoD;AAEpD,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,6BAAa,CAAA;IACb,qCAAqB,CAAA;IACrB,6BAAa,CAAA;IACb,uCAAuB,CAAA;AACzB,CAAC,EAVW,YAAY,4BAAZ,YAAY,QAUvB;AAED,IAAA,+BAAgB,EAAC,YAAY,EAAE;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,iCAAiC;CAC/C,CAAC,CAAA;AAEF,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,iCAAa,CAAA;IACb,qCAAiB,CAAA;IACjB,yCAAqB,CAAA;IACrB,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,mCAAe,CAAA;IACf,qCAAiB,CAAA;IACjB,iCAAa,CAAA;AACf,CAAC,EAVW,gBAAgB,gCAAhB,gBAAgB,QAU3B;AAED,IAAA,+BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,0CAA0C;CACxD,CAAC,CAAA;AAGK,IAAM,QAAQ,GAAd,MAAM,QAAQ;CA+DpB,CAAA;AA/DY,4BAAQ;AAEnB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;sCACxC;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;;6CACrD;AAOpB;IALC,IAAA,oBAAK,EAAC;QACL,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,mHAAmH;KACtH,CAAC;;qCACU;AAOZ;I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EAAE,2CAA2C,EAAE,CAAC;;2CACvE;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0DAA0D,EAAE,CAAC;;4CAClG;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;;6CAC/D;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;;6CAC/D;AAMhB;IAJC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE;QAC3B,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,+DAA+D;KAC7E,CAAC;;2CAC2B;wBA9DlB,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CA+DzB","sourcesContent":["import { Field, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\n\nimport { ScalarObject } from '@things-factory/shell'\n\nexport enum DataItemType {\n number = 'number',\n text = 'text',\n boolean = 'boolean',\n select = 'select',\n radio = 'radio',\n date = 'date',\n datetime = 'datetime',\n file = 'file',\n signature = 'signature'\n}\n\nregisterEnumType(DataItemType, {\n name: 'DataItemType',\n description: 'type enumeration of a data-item'\n})\n\nexport enum DataItemStatType {\n sum = 'sum',\n mean = 'mean',\n stddev = 'stddev',\n variance = 'variance',\n min = 'min',\n max = 'max',\n range = 'range',\n median = 'median',\n mode = 'mode'\n}\n\nregisterEnumType(DataItemStatType, {\n name: 'DataItemStatType',\n description: 'stat/agg type enumeration of a data-item'\n})\n\n@ObjectType({ description: 'Entity for DataItem' })\nexport class DataItem {\n @Field({ description: 'The name of the data item' })\n name: string\n\n @Field({ nullable: true, description: 'A description of the data item' })\n description?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a key name to be used as a property in a JSON-like object, representing a subfield of a dataset record.'\n })\n tag?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n group?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a secondary grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n subgroup?: string\n\n @Field({ nullable: true, description: 'Indicates if the data item is active' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Indicates if the data item is hidden' })\n hidden?: boolean\n\n @Field({ nullable: true, description: 'The type of the data item' })\n type?: DataItemType\n\n @Field(type => ScalarObject, { nullable: true, description: 'Options associated with the data item type' })\n options?: { [option: string]: any }\n\n @Field({\n nullable: true,\n description: 'The grouping logic for data finalize in the given field during periodic task deadlines.'\n })\n stat?: DataItemStatType\n\n @Field({\n nullable: true,\n description: 'Aggregation functions to be used in data summarizing logic for a given period.'\n })\n agg?: DataItemStatType\n\n @Field({ nullable: true, description: 'The unit of measurement for the data item' })\n unit?: string\n\n @Field(type => Int, { nullable: true, description: 'The maximum number of data values allowed for this field' })\n quota?: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'Specifies the valid ranges and parameters for this data item.'\n })\n spec?: { [key: string]: any }\n}\n\n@InputType()\nexport class DataItemPatch {\n @Field({ nullable: true, description: 'The name of the data item' })\n name?: string\n\n @Field({ nullable: true, description: 'A description of the data item' })\n description?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a key name to be used as a property in a JSON-like object, representing a subfield of a dataset record.'\n })\n tag?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n group?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a secondary grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n subgroup?: string\n\n @Field(type => DataItemType, { nullable: true, description: 'The type of the data item' })\n type?: DataItemType\n\n @Field(type => ScalarObject, { nullable: true, description: 'Options associated with the data item type' })\n options?: { [option: string]: any }\n\n @Field({\n nullable: true,\n description: 'The grouping logic for data summarization in the given field during periodic task deadlines.'\n })\n stat?: DataItemStatType\n\n @Field({\n nullable: true,\n description: 'Aggregation functions to be used in data summarizing logic for a given period.'\n })\n agg?: DataItemStatType\n\n @Field({ nullable: true, description: 'The unit of measurement for the data item' })\n unit?: string\n\n @Field(type => Int, { nullable: true, description: 'The maximum number of data values allowed for this field' })\n quota?: number\n\n @Field({ nullable: true, description: 'Indicates if the data item is active' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Indicates if the data item is hidden' })\n hidden?: boolean\n\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'Specifies the valid ranges and parameters for this data item.'\n })\n spec?: { [key: string]: any }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"data-item-type.js","sourceRoot":"","sources":["../../../server/service/data-set/data-item-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAkF;AAElF,iDAAoD;AAEpD,IAAY,YAaX;AAbD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,6BAAa,CAAA;IACb,qCAAqB,CAAA;IACrB,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,uCAAuB,CAAA;AACzB,CAAC,EAbW,YAAY,4BAAZ,YAAY,QAavB;AAED,IAAA,+BAAgB,EAAC,YAAY,EAAE;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,iCAAiC;CAC/C,CAAC,CAAA;AAEF,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,iCAAa,CAAA;IACb,qCAAiB,CAAA;IACjB,yCAAqB,CAAA;IACrB,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,mCAAe,CAAA;IACf,qCAAiB,CAAA;IACjB,iCAAa,CAAA;AACf,CAAC,EAVW,gBAAgB,gC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+PG","sourcesContent":["import { Field, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\n\nimport { ScalarObject } from '@things-factory/shell'\n\nexport enum DataItemType {\n number = 'number',\n text = 'text',\n boolean = 'boolean',\n select = 'select',\n radio = 'radio',\n date = 'date',\n datetime = 'datetime',\n file = 'file',\n image = 'image',\n video = 'video',\n audio = 'audio',\n signature = 'signature'\n}\n\nregisterEnumType(DataItemType, {\n name: 'DataItemType',\n description: 'type enumeration of a data-item'\n})\n\nexport enum DataItemStatType {\n sum = 'sum',\n mean = 'mean',\n stddev = 'stddev',\n variance = 'variance',\n min = 'min',\n max = 'max',\n range = 'range',\n median = 'median',\n mode = 'mode'\n}\n\nregisterEnumType(DataItemStatType, {\n name: 'DataItemStatType',\n description: 'stat/agg type enumeration of a data-item'\n})\n\n@ObjectType({ description: 'Entity for DataItem' })\nexport class DataItem {\n @Field({ description: 'The name of the data item' })\n name: string\n\n @Field({ nullable: true, description: 'A description of the data item' })\n description?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a key name to be used as a property in a JSON-like object, representing a subfield of a dataset record.'\n })\n tag?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n group?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a secondary grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n subgroup?: string\n\n @Field({ nullable: true, description: 'Indicates if the data item is active' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Indicates if the data item is hidden' })\n hidden?: boolean\n\n @Field({ nullable: true, description: 'The type of the data item' })\n type?: DataItemType\n\n @Field(type => ScalarObject, { nullable: true, description: 'Options associated with the data item type' })\n options?: { [option: string]: any }\n\n @Field({\n nullable: true,\n description: 'The grouping logic for data finalize in the given field during periodic task deadlines.'\n })\n stat?: DataItemStatType\n\n @Field({\n nullable: true,\n description: 'Aggregation functions to be used in data summarizing logic for a given period.'\n })\n agg?: DataItemStatType\n\n @Field({ nullable: true, description: 'The unit of measurement for the data item' })\n unit?: string\n\n @Field(type => Int, { nullable: true, description: 'The maximum number of data values allowed for this field' })\n quota?: number\n\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'Specifies the valid ranges and parameters for this data item.'\n })\n spec?: { [key: string]: any }\n}\n\n@InputType()\nexport class DataItemPatch {\n @Field({ nullable: true, description: 'The name of the data item' })\n name?: string\n\n @Field({ nullable: true, description: 'A description of the data item' })\n description?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a key name to be used as a property in a JSON-like object, representing a subfield of a dataset record.'\n })\n tag?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n group?: string\n\n @Field({\n nullable: true,\n description:\n 'Specifies a secondary grouping identifier for data items with related content, allowing them to be displayed as subgroups within the overall dataset.'\n })\n subgroup?: string\n\n @Field(type => DataItemType, { nullable: true, description: 'The type of the data item' })\n type?: DataItemType\n\n @Field(type => ScalarObject, { nullable: true, description: 'Options associated with the data item type' })\n options?: { [option: string]: any }\n\n @Field({\n nullable: true,\n description: 'The grouping logic for data summarization in the given field during periodic task deadlines.'\n })\n stat?: DataItemStatType\n\n @Field({\n nullable: true,\n description: 'Aggregation functions to be used in data summarizing logic for a given period.'\n })\n agg?: DataItemStatType\n\n @Field({ nullable: true, description: 'The unit of measurement for the data item' })\n unit?: string\n\n @Field(type => Int, { nullable: true, description: 'The maximum number of data values allowed for this field' })\n quota?: number\n\n @Field({ nullable: true, description: 'Indicates if the data item is active' })\n active?: boolean\n\n @Field({ nullable: true, description: 'Indicates if the data item is hidden' })\n hidden?: boolean\n\n @Field(type => ScalarObject, {\n nullable: true,\n description: 'Specifies the valid ranges and parameters for this data item.'\n })\n spec?: { [key: string]: any }\n}\n\n/**\n * ============================================================================\n * Media Type Options Schema\n * ============================================================================\n *\n * The `options` field provides type-specific configuration for media types\n * (image, video, audio). Below are the recommended schemas for each type.\n *\n * ============================================================================\n * IMAGE Type Options\n * ============================================================================\n *\n * Example:\n * {\n * type: 'image',\n * options: {\n * // File formats\n * accept: ['jpeg', 'png', 'webp', 'gif'], // Allowed formats\n *\n * // Size constraints\n * maxSize: 10485760, // Max file size in bytes (10MB)\n * maxWidth: 4096, // Max width in pixels\n * maxHeight: 4096, // Max height in pixels\n * minWidth: 224, // Min width in pixels\n * minHeight: 224, // Min height in pixels\n *\n * // Multiple uploads\n * multiple: true, // Allow multiple images\n * maxFiles: 10, // Max number of files\n *\n * // Thumbnail generation\n * thumbnail: {\n * enabled: true,\n * width: 200,\n * height: 200,\n * format: 'jpeg', // 'jpeg' | 'png' | 'webp'\n * quality: 85 // 1-100\n * },\n *\n * // Preview settings\n * preview: {\n * enabled: true,\n * maxWidth: 1024,\n * maxHeight: 1024\n * },\n *\n * // Metadata extraction\n * metadata: {\n * extractExif: true, // Extract EXIF data\n * extractDimensions: true, // Extract width/height\n * extractFormat: true, // Extract image format\n * extractColorProfile: true // Extract color profile\n * },\n *\n * // Compression/conversion\n * compression: {\n * enabled: true,\n * format: 'webp', // Target format\n * quality: 85, // Compression quality\n * maxDimension: 2048 // Max width or height\n * }\n * }\n * }\n *\n * ============================================================================\n * VIDEO Type Options\n * ============================================================================\n *\n * Example:\n * {\n * type: 'video',\n * options: {\n * // File formats\n * accept: ['mp4', 'webm', 'mov', 'avi'], // Allowed formats\n *\n * // Size constraints\n * maxSize: 104857600, // Max file size in bytes (100MB)\n * maxDuration: 300, // Max duration in seconds (5 minutes)\n * maxWidth: 1920, // Max resolution width\n * maxHeight: 1080, // Max resolution height\n *\n * // Multiple uploads\n * multiple: false, // Usually single video per field\n * maxFiles: 1,\n *\n * // Thumbnail generation\n * thumbnail: {\n * enabled: true,\n * width: 320,\n * height: 180,\n * format: 'jpeg',\n * quality: 85,\n * captureTime: 1 // Capture thumbnail at N seconds\n * },\n *\n * // Preview settings\n * preview: {\n * enabled: true,\n * maxWidth: 640,\n * maxHeight: 480,\n * controls: true, // Show video controls\n * autoplay: false, // Autoplay preview\n * muted: true // Mute by default\n * },\n *\n * // Metadata extraction\n * metadata: {\n * extractDuration: true, // Extract video duration\n * extractResolution: true, // Extract width/height\n * extractFormat: true, // Extract video format\n * extractCodec: true, // Extract video/audio codec\n * extractFrameRate: true, // Extract FPS\n * extractBitrate: true // Extract bitrate\n * },\n *\n * // Transcoding\n * transcoding: {\n * enabled: true,\n * format: 'mp4', // Target format\n * codec: 'h264', // Video codec\n * quality: 'medium', // 'low' | 'medium' | 'high'\n * maxDimension: 1280 // Scale down if larger\n * }\n * }\n * }\n *\n * ============================================================================\n * AUDIO Type Options\n * ============================================================================\n *\n * Example:\n * {\n * type: 'audio',\n * options: {\n * // File formats\n * accept: ['mp3', 'wav', 'ogg', 'm4a', 'aac'], // Allowed formats\n *\n * // Size constraints\n * maxSize: 52428800, // Max file size in bytes (50MB)\n * maxDuration: 600, // Max duration in seconds (10 minutes)\n *\n * // Multiple uploads\n * multiple: false,\n * maxFiles: 1,\n *\n * // Waveform visualization\n * waveform: {\n * enabled: true,\n * width: 800,\n * height: 100,\n * color: '#3498db'\n * },\n *\n * // Preview settings\n * preview: {\n * enabled: true,\n * controls: true, // Show audio controls\n * autoplay: false, // Autoplay preview\n * visualizer: true // Show audio visualizer\n * },\n *\n * // Metadata extraction\n * metadata: {\n * extractDuration: true, // Extract audio duration\n * extractFormat: true, // Extract audio format\n * extractCodec: true, // Extract audio codec\n * extractBitrate: true, // Extract bitrate\n * extractSampleRate: true, // Extract sample rate\n * extractChannels: true, // Extract channel count\n * extractID3Tags: true // Extract ID3 tags (artist, title, etc.)\n * },\n *\n * // Transcoding\n * transcoding: {\n * enabled: true,\n * format: 'mp3', // Target format\n * codec: 'mp3', // Audio codec\n * bitrate: 128, // kbps\n * sampleRate: 44100, // Hz\n * channels: 2 // Stereo\n * }\n * }\n * }\n *\n * ============================================================================\n * Usage in GraphQL\n * ============================================================================\n *\n * mutation {\n * updateDataSet(\n * name: \"product_inspection\"\n * patch: {\n * dataItems: [\n * {\n * name: \"product_image\"\n * type: image\n * options: {\n * accept: [\"jpeg\", \"png\"]\n * maxSize: 10485760\n * thumbnail: { enabled: true, width: 200, height: 200 }\n * metadata: { extractExif: true, extractDimensions: true }\n * }\n * },\n * {\n * name: \"inspection_video\"\n * type: video\n * options: {\n * accept: [\"mp4\", \"webm\"]\n * maxSize: 104857600\n * maxDuration: 120\n * thumbnail: { enabled: true, captureTime: 1 }\n * }\n * },\n * {\n * name: \"operator_note_audio\"\n * type: audio\n * options: {\n * accept: [\"mp3\", \"wav\"]\n * maxSize: 10485760\n * maxDuration: 60\n * waveform: { enabled: true }\n * }\n * }\n * ]\n * }\n * ) {\n * id\n * name\n * }\n * }\n *\n * ============================================================================\n * Label Studio Integration\n * ============================================================================\n *\n * Dataset media types map to Label Studio annotation types:\n *\n * - image → <Image name=\"image\" value=\"$image\"/>\n * - video → <Video name=\"video\" value=\"$video\"/>\n * - audio → <Audio name=\"audio\" value=\"$audio\"/>\n *\n * Example Label Studio config generation:\n *\n * const dataItem = { name: 'product_image', type: 'image' }\n *\n * // → Label Studio config\n * <View>\n * <Image name=\"product_image\" value=\"$product_image\"/>\n * <Choices name=\"classification\" toName=\"product_image\">\n * <Choice value=\"Good\"/>\n * <Choice value=\"Defect\"/>\n * </Choices>\n * </View>\n *\n * ============================================================================\n */\n"]}
|