@mesh-sync/worker-backend-client 1.0.2 → 1.0.4
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/README.md +220 -0
- package/dist/client.d.ts +37 -0
- package/dist/client.js +49 -0
- package/dist/types.d.ts +165 -0
- package/dist/types.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,6 +140,97 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
|
|
143
|
+
### media-batch-download-completed
|
|
144
|
+
|
|
145
|
+
**Description:** Notifies that a batch media download has been completed.
|
|
146
|
+
|
|
147
|
+
**Method:** `client.mediaBatchDownloadCompleted(data)`
|
|
148
|
+
|
|
149
|
+
**Payload Type:** `MediaBatchDownloadCompletedMessage`
|
|
150
|
+
|
|
151
|
+
**Fields:**
|
|
152
|
+
|
|
153
|
+
- `batchId` (string) [✓]: The unique identifier for the batch download operation.
|
|
154
|
+
|
|
155
|
+
- `status` (string) [✓]: The final status of the batch download operation.
|
|
156
|
+
|
|
157
|
+
- `processedFiles` (array) [✗]: List of successfully processed files.
|
|
158
|
+
|
|
159
|
+
- `failedFiles` (array) [✗]: List of files that failed to process.
|
|
160
|
+
|
|
161
|
+
- `processedAt` (string) [✓]: Timestamp when the batch processing completed.
|
|
162
|
+
|
|
163
|
+
- `statistics` (object) [✗]: Statistics about the batch processing.
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
### media-batch-download-request
|
|
168
|
+
|
|
169
|
+
**Description:** Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
**Method:** `client.mediaBatchDownloadRequest(data)`
|
|
173
|
+
|
|
174
|
+
**Payload Type:** `MediaBatchDownloadRequestMessage`
|
|
175
|
+
|
|
176
|
+
**Fields:**
|
|
177
|
+
|
|
178
|
+
- `batchId` (string) [✗]: Unique identifier for this batch of media files. Used for organizing processed files in S3 storage (media/{batchId}/) and correlating with completion responses.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
- `storageConnectionId` (string) [✗]: UUID of the StorageConnection entity from which to download the media files. Used to authenticate and access the source storage provider.
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
- `mediaFiles` (array) [✗]: Array of media files to download and process. Must contain at least one file. Each file includes metadata for identification and processing.
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
- `compressionSettings` (object) [✗]: Optional compression settings that override deployment environment defaults. If not provided, uses values from MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT, IMAGE_QUALITY, and OUTPUT_FORMAT environment variables.
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
### metamodel-metadata-generation-completed
|
|
193
|
+
|
|
194
|
+
**Description:** Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
|
|
195
|
+
|
|
196
|
+
**Method:** `client.metamodelMetadataGenerationCompleted(data)`
|
|
197
|
+
|
|
198
|
+
**Payload Type:** `MetamodelMetadataGenerationCompletedMessage`
|
|
199
|
+
|
|
200
|
+
**Fields:**
|
|
201
|
+
|
|
202
|
+
- `metamodelId` (string) [✓]: The unique identifier for the metamodel
|
|
203
|
+
|
|
204
|
+
- `metadata` (object) [✓]: AI-generated metadata for the metamodel
|
|
205
|
+
|
|
206
|
+
- `technicalMetadata` (object) [✓]: Aggregated technical analysis from constituent models
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
### metamodel-metadata-generation-request
|
|
211
|
+
|
|
212
|
+
**Description:** Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
|
|
213
|
+
|
|
214
|
+
**Method:** `client.metamodelMetadataGenerationRequest(data)`
|
|
215
|
+
|
|
216
|
+
**Payload Type:** `MetamodelMetadataGenerationRequestMessage`
|
|
217
|
+
|
|
218
|
+
**Fields:**
|
|
219
|
+
|
|
220
|
+
- `metamodelId` (string) [✗]: The unique identifier for the metamodel
|
|
221
|
+
|
|
222
|
+
- `constituentModelIds` (array) [✗]: Array of model IDs that compose this metamodel
|
|
223
|
+
|
|
224
|
+
- `name` (string) [✗]: The name of the metamodel
|
|
225
|
+
|
|
226
|
+
- `ownerId` (string) [✗]: The owner's user ID
|
|
227
|
+
|
|
228
|
+
- `libraryId` (string) [✗]: The library containing this metamodel
|
|
229
|
+
|
|
230
|
+
- `webhookUrl` (string) [✗]: Optional webhook URL for async completion notification
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
143
234
|
### model-discovery-folder-processed-event
|
|
144
235
|
|
|
145
236
|
**Description:** Handles model discovery folder processed events.
|
|
@@ -224,6 +315,8 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
224
315
|
|
|
225
316
|
- `providerType` (string) [✗]: The type of the storage provider.
|
|
226
317
|
|
|
318
|
+
- `path` (string) [✗]: The specific path within the storage connection to scan for this library.
|
|
319
|
+
|
|
227
320
|
|
|
228
321
|
|
|
229
322
|
### model-metadata-generation-completed
|
|
@@ -310,6 +403,114 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
310
403
|
|
|
311
404
|
|
|
312
405
|
|
|
406
|
+
### model-technical-metadata-completed
|
|
407
|
+
|
|
408
|
+
**Description:** Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
409
|
+
|
|
410
|
+
**Method:** `client.modelTechnicalMetadataCompleted(data)`
|
|
411
|
+
|
|
412
|
+
**Payload Type:** `ModelTechnicalMetadataCompletedMessage`
|
|
413
|
+
|
|
414
|
+
**Fields:**
|
|
415
|
+
|
|
416
|
+
- `originalJobId` (string) [✗]: ID of the original analysis request job
|
|
417
|
+
|
|
418
|
+
- `modelId` (string) [✗]: ID of the analyzed model
|
|
419
|
+
|
|
420
|
+
- `status` (string) [✗]: Analysis completion status
|
|
421
|
+
|
|
422
|
+
- `vertices` (integer) [✗]: Number of vertices in the mesh
|
|
423
|
+
|
|
424
|
+
- `faces` (integer) [✗]: Number of faces/polygons in the mesh
|
|
425
|
+
|
|
426
|
+
- `edges` (integer) [✗]: Number of edges in the mesh
|
|
427
|
+
|
|
428
|
+
- `detailLevel` (string) [✗]: Visual detail level based on polygon density
|
|
429
|
+
|
|
430
|
+
- `boundingBox` (object) [✗]: 3D bounding box dimensions in millimeters
|
|
431
|
+
|
|
432
|
+
- `volumeCubicMm` (number) [✗]: Model volume in cubic millimeters (for material calculation)
|
|
433
|
+
|
|
434
|
+
- `surfaceAreaSqMm` (number) [✗]: Total surface area in square millimeters
|
|
435
|
+
|
|
436
|
+
- `minWallThickness` (number) [✗]: Minimum wall thickness detected in millimeters (critical for printability)
|
|
437
|
+
|
|
438
|
+
- `maxWallThickness` (number) [✗]: Maximum wall thickness detected in millimeters
|
|
439
|
+
|
|
440
|
+
- `manifold` (boolean) [✗]: Is the mesh watertight/manifold? Critical for 3D printing (true = printable)
|
|
441
|
+
|
|
442
|
+
- `nonManifoldEdges` (integer) [✗]: Number of non-manifold edges (repair needed if > 0)
|
|
443
|
+
|
|
444
|
+
- `holes` (integer) [✗]: Number of holes/boundary loops in the mesh (0 = closed mesh)
|
|
445
|
+
|
|
446
|
+
- `flippedNormals` (integer) [✗]: Number of faces with inverted normals (causes rendering/slicing issues)
|
|
447
|
+
|
|
448
|
+
- `selfIntersections` (integer) [✗]: Number of self-intersecting faces (0 = clean geometry)
|
|
449
|
+
|
|
450
|
+
- `qualityScore` (number) [✗]: Overall quality score 0-100 (100 = perfect for printing, <60 needs repair)
|
|
451
|
+
|
|
452
|
+
- `printabilityScore` (number) [✗]: Printability score 0-100 (considers supports, orientation, size constraints)
|
|
453
|
+
|
|
454
|
+
- `requiresSupports` (boolean) [✗]: Does this model require support structures for 3D printing?
|
|
455
|
+
|
|
456
|
+
- `overhangs` (array) [✗]: Detected overhang areas requiring support structures
|
|
457
|
+
|
|
458
|
+
- `estimatedPrintTimeMinutes` (integer) [✗]: Estimated print time in minutes using normal quality settings (0.2mm layers, 20% infill)
|
|
459
|
+
|
|
460
|
+
- `printTimeEstimates` (object) [✗]: Print time estimates for different quality presets
|
|
461
|
+
|
|
462
|
+
- `estimatedMaterialGrams` (number) [✗]: Estimated material usage in grams using 20% infill (assumes PLA density 1.24g/cm³)
|
|
463
|
+
|
|
464
|
+
- `materialEstimates` (object) [✗]: Material usage estimates for different infill percentages
|
|
465
|
+
|
|
466
|
+
- `recommendedOrientation` (object) [✗]: Recommended print orientation for minimal support material and best results
|
|
467
|
+
|
|
468
|
+
- `originalUnit` (string) [✗]: Original file format unit detected from metadata or inferred from scale
|
|
469
|
+
|
|
470
|
+
- `formatVersion` (string) [✗]: File format version (e.g., 'STL Binary', 'OBJ v4', 'PLY 1.0')
|
|
471
|
+
|
|
472
|
+
- `hasColorData` (boolean) [✗]: Does the file contain per-vertex color information?
|
|
473
|
+
|
|
474
|
+
- `hasTextureCoordinates` (boolean) [✗]: Does the file contain UV texture mapping coordinates?
|
|
475
|
+
|
|
476
|
+
- `hasVertexNormals` (boolean) [✗]: Does the file contain per-vertex normal vectors?
|
|
477
|
+
|
|
478
|
+
- `analyzedBy` (string) [✗]: Tool/service that performed the analysis
|
|
479
|
+
|
|
480
|
+
- `analysisVersion` (string) [✗]: Version of the analysis algorithm (for tracking improvements)
|
|
481
|
+
|
|
482
|
+
- `analysisConfidence` (number) [✗]: Confidence level of analysis results (0.0 = uncertain, 1.0 = highly confident)
|
|
483
|
+
|
|
484
|
+
- `analysisWarnings` (array) [✗]: Warnings or issues detected during analysis (structured for programmatic handling)
|
|
485
|
+
|
|
486
|
+
- `analyzedAt` (string) [✗]: ISO 8601 timestamp when analysis was performed (e.g., '2025-11-19T14:35:22Z')
|
|
487
|
+
|
|
488
|
+
- `errorMessage` (string) [✗]: Detailed error message if status is FAILED
|
|
489
|
+
|
|
490
|
+
- `errorCode` (string) [✗]: Machine-readable error code for programmatic error handling
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
### model-technical-metadata-request
|
|
495
|
+
|
|
496
|
+
**Description:** Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
|
|
497
|
+
|
|
498
|
+
**Method:** `client.modelTechnicalMetadataRequest(data)`
|
|
499
|
+
|
|
500
|
+
**Payload Type:** `ModelTechnicalMetadataRequestMessage`
|
|
501
|
+
|
|
502
|
+
**Fields:**
|
|
503
|
+
|
|
504
|
+
- `modelId` (string) [✗]: Unique identifier for the model to analyze
|
|
505
|
+
|
|
506
|
+
- `ownerId` (string) [✗]: User ID who owns the model
|
|
507
|
+
|
|
508
|
+
- `storageLocation` (object) [✗]: Location of the 3D model file
|
|
509
|
+
|
|
510
|
+
- `analysisOptions` (object) [✗]: Optional analysis configuration parameters
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
313
514
|
### thumbnail-generation-completed
|
|
314
515
|
|
|
315
516
|
**Description:** Handles thumbnail generation completed.
|
|
@@ -400,6 +601,19 @@ new WorkerClient(config: WorkerClientConfig)
|
|
|
400
601
|
- `fileDownloadRequest(data: FileDownloadRequestMessage): Promise<JobResponse>`
|
|
401
602
|
- Handles file download requests.
|
|
402
603
|
|
|
604
|
+
- `mediaBatchDownloadCompleted(data: MediaBatchDownloadCompletedMessage): Promise<JobResponse>`
|
|
605
|
+
- Notifies that a batch media download has been completed.
|
|
606
|
+
|
|
607
|
+
- `mediaBatchDownloadRequest(data: MediaBatchDownloadRequestMessage): Promise<JobResponse>`
|
|
608
|
+
- Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
- `metamodelMetadataGenerationCompleted(data: MetamodelMetadataGenerationCompletedMessage): Promise<JobResponse>`
|
|
612
|
+
- Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
|
|
613
|
+
|
|
614
|
+
- `metamodelMetadataGenerationRequest(data: MetamodelMetadataGenerationRequestMessage): Promise<JobResponse>`
|
|
615
|
+
- Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
|
|
616
|
+
|
|
403
617
|
- `modelDiscoveryFolderProcessedEvent(data: ModelDiscoveryFolderProcessedEventMessage): Promise<JobResponse>`
|
|
404
618
|
- Handles model discovery folder processed events.
|
|
405
619
|
|
|
@@ -424,6 +638,12 @@ new WorkerClient(config: WorkerClientConfig)
|
|
|
424
638
|
- `modelMetamodelDetectionRequest(data: ModelMetamodelDetectionRequestMessage): Promise<JobResponse>`
|
|
425
639
|
- Handles model metamodel detection requests.
|
|
426
640
|
|
|
641
|
+
- `modelTechnicalMetadataCompleted(data: ModelTechnicalMetadataCompletedMessage): Promise<JobResponse>`
|
|
642
|
+
- Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
643
|
+
|
|
644
|
+
- `modelTechnicalMetadataRequest(data: ModelTechnicalMetadataRequestMessage): Promise<JobResponse>`
|
|
645
|
+
- Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
|
|
646
|
+
|
|
427
647
|
- `thumbnailGenerationCompleted(data: ThumbnailGenerationCompletedMessage): Promise<JobResponse>`
|
|
428
648
|
- Handles thumbnail generation completed.
|
|
429
649
|
|
package/dist/client.d.ts
CHANGED
|
@@ -49,6 +49,31 @@ export declare class WorkerClient {
|
|
|
49
49
|
* @returns Job response with job ID
|
|
50
50
|
*/
|
|
51
51
|
fileDownloadRequest(data: types.FileDownloadRequestMessage): Promise<JobResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Notifies that a batch media download has been completed.
|
|
54
|
+
* @param data - The message payload
|
|
55
|
+
* @returns Job response with job ID
|
|
56
|
+
*/
|
|
57
|
+
mediaBatchDownloadCompleted(data: types.MediaBatchDownloadCompletedMessage): Promise<JobResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
|
|
60
|
+
|
|
61
|
+
* @param data - The message payload
|
|
62
|
+
* @returns Job response with job ID
|
|
63
|
+
*/
|
|
64
|
+
mediaBatchDownloadRequest(data: types.MediaBatchDownloadRequestMessage): Promise<JobResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
|
|
67
|
+
* @param data - The message payload
|
|
68
|
+
* @returns Job response with job ID
|
|
69
|
+
*/
|
|
70
|
+
metamodelMetadataGenerationCompleted(data: types.MetamodelMetadataGenerationCompletedMessage): Promise<JobResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
|
|
73
|
+
* @param data - The message payload
|
|
74
|
+
* @returns Job response with job ID
|
|
75
|
+
*/
|
|
76
|
+
metamodelMetadataGenerationRequest(data: types.MetamodelMetadataGenerationRequestMessage): Promise<JobResponse>;
|
|
52
77
|
/**
|
|
53
78
|
* Handles model discovery folder processed events.
|
|
54
79
|
* @param data - The message payload
|
|
@@ -97,6 +122,18 @@ export declare class WorkerClient {
|
|
|
97
122
|
* @returns Job response with job ID
|
|
98
123
|
*/
|
|
99
124
|
modelMetamodelDetectionRequest(data: types.ModelMetamodelDetectionRequestMessage): Promise<JobResponse>;
|
|
125
|
+
/**
|
|
126
|
+
* Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
127
|
+
* @param data - The message payload
|
|
128
|
+
* @returns Job response with job ID
|
|
129
|
+
*/
|
|
130
|
+
modelTechnicalMetadataCompleted(data: types.ModelTechnicalMetadataCompletedMessage): Promise<JobResponse>;
|
|
131
|
+
/**
|
|
132
|
+
* Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
|
|
133
|
+
* @param data - The message payload
|
|
134
|
+
* @returns Job response with job ID
|
|
135
|
+
*/
|
|
136
|
+
modelTechnicalMetadataRequest(data: types.ModelTechnicalMetadataRequestMessage): Promise<JobResponse>;
|
|
100
137
|
/**
|
|
101
138
|
* Handles thumbnail generation completed.
|
|
102
139
|
* @param data - The message payload
|
package/dist/client.js
CHANGED
|
@@ -76,6 +76,39 @@ export class WorkerClient {
|
|
|
76
76
|
async fileDownloadRequest(data) {
|
|
77
77
|
return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_REQUEST, data);
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Notifies that a batch media download has been completed.
|
|
81
|
+
* @param data - The message payload
|
|
82
|
+
* @returns Job response with job ID
|
|
83
|
+
*/
|
|
84
|
+
async mediaBatchDownloadCompleted(data) {
|
|
85
|
+
return this.sendToQueue(types.MessageTypes.MEDIA_BATCH_DOWNLOAD_COMPLETED, data);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
|
|
89
|
+
|
|
90
|
+
* @param data - The message payload
|
|
91
|
+
* @returns Job response with job ID
|
|
92
|
+
*/
|
|
93
|
+
async mediaBatchDownloadRequest(data) {
|
|
94
|
+
return this.sendToQueue(types.MessageTypes.MEDIA_BATCH_DOWNLOAD_REQUEST, data);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
|
|
98
|
+
* @param data - The message payload
|
|
99
|
+
* @returns Job response with job ID
|
|
100
|
+
*/
|
|
101
|
+
async metamodelMetadataGenerationCompleted(data) {
|
|
102
|
+
return this.sendToQueue(types.MessageTypes.METAMODEL_METADATA_GENERATION_COMPLETED, data);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
|
|
106
|
+
* @param data - The message payload
|
|
107
|
+
* @returns Job response with job ID
|
|
108
|
+
*/
|
|
109
|
+
async metamodelMetadataGenerationRequest(data) {
|
|
110
|
+
return this.sendToQueue(types.MessageTypes.METAMODEL_METADATA_GENERATION_REQUEST, data);
|
|
111
|
+
}
|
|
79
112
|
/**
|
|
80
113
|
* Handles model discovery folder processed events.
|
|
81
114
|
* @param data - The message payload
|
|
@@ -140,6 +173,22 @@ export class WorkerClient {
|
|
|
140
173
|
async modelMetamodelDetectionRequest(data) {
|
|
141
174
|
return this.sendToQueue(types.MessageTypes.MODEL_METAMODEL_DETECTION_REQUEST, data);
|
|
142
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
178
|
+
* @param data - The message payload
|
|
179
|
+
* @returns Job response with job ID
|
|
180
|
+
*/
|
|
181
|
+
async modelTechnicalMetadataCompleted(data) {
|
|
182
|
+
return this.sendToQueue(types.MessageTypes.MODEL_TECHNICAL_METADATA_COMPLETED, data);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
|
|
186
|
+
* @param data - The message payload
|
|
187
|
+
* @returns Job response with job ID
|
|
188
|
+
*/
|
|
189
|
+
async modelTechnicalMetadataRequest(data) {
|
|
190
|
+
return this.sendToQueue(types.MessageTypes.MODEL_TECHNICAL_METADATA_REQUEST, data);
|
|
191
|
+
}
|
|
143
192
|
/**
|
|
144
193
|
* Handles thumbnail generation completed.
|
|
145
194
|
* @param data - The message payload
|
package/dist/types.d.ts
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
export declare const MessageTypes: {
|
|
5
5
|
readonly FILE_DOWNLOAD_COMPLETED: "file-download-completed";
|
|
6
6
|
readonly FILE_DOWNLOAD_REQUEST: "file-download-request";
|
|
7
|
+
readonly MEDIA_BATCH_DOWNLOAD_COMPLETED: "media-batch-download-completed";
|
|
8
|
+
readonly MEDIA_BATCH_DOWNLOAD_REQUEST: "media-batch-download-request";
|
|
9
|
+
readonly METAMODEL_METADATA_GENERATION_COMPLETED: "metamodel-metadata-generation-completed";
|
|
10
|
+
readonly METAMODEL_METADATA_GENERATION_REQUEST: "metamodel-metadata-generation-request";
|
|
7
11
|
readonly MODEL_DISCOVERY_FOLDER_PROCESSED_EVENT: "model-discovery-folder-processed-event";
|
|
8
12
|
readonly MODEL_DISCOVERY_SCAN_FOUND_EVENT: "model-discovery-scan-found-event";
|
|
9
13
|
readonly MODEL_DISCOVERY_SCAN_PROGRESS_EVENT: "model-discovery-scan-progress-event";
|
|
@@ -12,6 +16,8 @@ export declare const MessageTypes: {
|
|
|
12
16
|
readonly MODEL_METADATA_GENERATION_REQUEST: "model-metadata-generation-request";
|
|
13
17
|
readonly MODEL_METAMODEL_DETECTION_FOUND: "model-metamodel-detection-found";
|
|
14
18
|
readonly MODEL_METAMODEL_DETECTION_REQUEST: "model-metamodel-detection-request";
|
|
19
|
+
readonly MODEL_TECHNICAL_METADATA_COMPLETED: "model-technical-metadata-completed";
|
|
20
|
+
readonly MODEL_TECHNICAL_METADATA_REQUEST: "model-technical-metadata-request";
|
|
15
21
|
readonly THUMBNAIL_GENERATION_COMPLETED: "thumbnail-generation-completed";
|
|
16
22
|
readonly THUMBNAIL_GENERATION_REQUEST: "thumbnail-generation-request";
|
|
17
23
|
};
|
|
@@ -42,6 +48,69 @@ export interface FileDownloadRequestMessage {
|
|
|
42
48
|
/** The storage location of the model. */
|
|
43
49
|
storageLocation?: Record<string, string | number | boolean>;
|
|
44
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Notifies that a batch media download has been completed.
|
|
53
|
+
*/
|
|
54
|
+
export interface MediaBatchDownloadCompletedMessage {
|
|
55
|
+
/** The unique identifier for the batch download operation. */
|
|
56
|
+
batchId: string;
|
|
57
|
+
/** The final status of the batch download operation. */
|
|
58
|
+
status: string;
|
|
59
|
+
/** List of successfully processed files. */
|
|
60
|
+
processedFiles?: Array<Record<string, string | number | boolean>>;
|
|
61
|
+
/** List of files that failed to process. */
|
|
62
|
+
failedFiles?: Array<Record<string, string | number | boolean>>;
|
|
63
|
+
/** Timestamp when the batch processing completed. */
|
|
64
|
+
processedAt: string;
|
|
65
|
+
/** Statistics about the batch processing. */
|
|
66
|
+
statistics?: Record<string, string | number | boolean>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
|
|
70
|
+
|
|
71
|
+
*/
|
|
72
|
+
export interface MediaBatchDownloadRequestMessage {
|
|
73
|
+
/** Unique identifier for this batch of media files. Used for organizing processed files in S3 storage (media/{batchId}/) and correlating with completion responses.
|
|
74
|
+
*/
|
|
75
|
+
batchId?: string;
|
|
76
|
+
/** UUID of the StorageConnection entity from which to download the media files. Used to authenticate and access the source storage provider.
|
|
77
|
+
*/
|
|
78
|
+
storageConnectionId?: string;
|
|
79
|
+
/** Array of media files to download and process. Must contain at least one file. Each file includes metadata for identification and processing.
|
|
80
|
+
*/
|
|
81
|
+
mediaFiles?: Array<Record<string, string | number | boolean>>;
|
|
82
|
+
/** Optional compression settings that override deployment environment defaults. If not provided, uses values from MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT, IMAGE_QUALITY, and OUTPUT_FORMAT environment variables.
|
|
83
|
+
*/
|
|
84
|
+
compressionSettings?: Record<string, string | number | boolean>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
|
|
88
|
+
*/
|
|
89
|
+
export interface MetamodelMetadataGenerationCompletedMessage {
|
|
90
|
+
/** The unique identifier for the metamodel */
|
|
91
|
+
metamodelId: string;
|
|
92
|
+
/** AI-generated metadata for the metamodel */
|
|
93
|
+
metadata: Record<string, string | number | boolean>;
|
|
94
|
+
/** Aggregated technical analysis from constituent models */
|
|
95
|
+
technicalMetadata: Record<string, string | number | boolean>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
|
|
99
|
+
*/
|
|
100
|
+
export interface MetamodelMetadataGenerationRequestMessage {
|
|
101
|
+
/** The unique identifier for the metamodel */
|
|
102
|
+
metamodelId?: string;
|
|
103
|
+
/** Array of model IDs that compose this metamodel */
|
|
104
|
+
constituentModelIds?: Array<Record<string, string | number | boolean>>;
|
|
105
|
+
/** The name of the metamodel */
|
|
106
|
+
name?: string;
|
|
107
|
+
/** The owner's user ID */
|
|
108
|
+
ownerId?: string;
|
|
109
|
+
/** The library containing this metamodel */
|
|
110
|
+
libraryId?: string;
|
|
111
|
+
/** Optional webhook URL for async completion notification */
|
|
112
|
+
webhookUrl?: string;
|
|
113
|
+
}
|
|
45
114
|
/**
|
|
46
115
|
* Handles model discovery folder processed events.
|
|
47
116
|
*/
|
|
@@ -99,6 +168,8 @@ export interface ModelDiscoveryScanRequestMessage {
|
|
|
99
168
|
storageConnectionId?: string;
|
|
100
169
|
/** The type of the storage provider. */
|
|
101
170
|
providerType?: string;
|
|
171
|
+
/** The specific path within the storage connection to scan for this library. */
|
|
172
|
+
path?: string;
|
|
102
173
|
}
|
|
103
174
|
/**
|
|
104
175
|
* Handles model metadata generation completed.
|
|
@@ -156,6 +227,100 @@ export interface ModelMetamodelDetectionRequestMessage {
|
|
|
156
227
|
/** Statistics about the processed folder. */
|
|
157
228
|
statistics: Record<string, string | number | boolean>;
|
|
158
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
232
|
+
*/
|
|
233
|
+
export interface ModelTechnicalMetadataCompletedMessage {
|
|
234
|
+
/** ID of the original analysis request job */
|
|
235
|
+
originalJobId?: string;
|
|
236
|
+
/** ID of the analyzed model */
|
|
237
|
+
modelId?: string;
|
|
238
|
+
/** Analysis completion status */
|
|
239
|
+
status?: string;
|
|
240
|
+
/** Number of vertices in the mesh */
|
|
241
|
+
vertices?: string | number | boolean;
|
|
242
|
+
/** Number of faces/polygons in the mesh */
|
|
243
|
+
faces?: string | number | boolean;
|
|
244
|
+
/** Number of edges in the mesh */
|
|
245
|
+
edges?: string | number | boolean;
|
|
246
|
+
/** Visual detail level based on polygon density */
|
|
247
|
+
detailLevel?: string;
|
|
248
|
+
/** 3D bounding box dimensions in millimeters */
|
|
249
|
+
boundingBox?: Record<string, string | number | boolean>;
|
|
250
|
+
/** Model volume in cubic millimeters (for material calculation) */
|
|
251
|
+
volumeCubicMm?: number;
|
|
252
|
+
/** Total surface area in square millimeters */
|
|
253
|
+
surfaceAreaSqMm?: number;
|
|
254
|
+
/** Minimum wall thickness detected in millimeters (critical for printability) */
|
|
255
|
+
minWallThickness?: number;
|
|
256
|
+
/** Maximum wall thickness detected in millimeters */
|
|
257
|
+
maxWallThickness?: number;
|
|
258
|
+
/** Is the mesh watertight/manifold? Critical for 3D printing (true = printable) */
|
|
259
|
+
manifold?: boolean;
|
|
260
|
+
/** Number of non-manifold edges (repair needed if > 0) */
|
|
261
|
+
nonManifoldEdges?: string | number | boolean;
|
|
262
|
+
/** Number of holes/boundary loops in the mesh (0 = closed mesh) */
|
|
263
|
+
holes?: string | number | boolean;
|
|
264
|
+
/** Number of faces with inverted normals (causes rendering/slicing issues) */
|
|
265
|
+
flippedNormals?: string | number | boolean;
|
|
266
|
+
/** Number of self-intersecting faces (0 = clean geometry) */
|
|
267
|
+
selfIntersections?: string | number | boolean;
|
|
268
|
+
/** Overall quality score 0-100 (100 = perfect for printing, <60 needs repair) */
|
|
269
|
+
qualityScore?: number;
|
|
270
|
+
/** Printability score 0-100 (considers supports, orientation, size constraints) */
|
|
271
|
+
printabilityScore?: number;
|
|
272
|
+
/** Does this model require support structures for 3D printing? */
|
|
273
|
+
requiresSupports?: boolean;
|
|
274
|
+
/** Detected overhang areas requiring support structures */
|
|
275
|
+
overhangs?: Array<Record<string, string | number | boolean>>;
|
|
276
|
+
/** Estimated print time in minutes using normal quality settings (0.2mm layers, 20% infill) */
|
|
277
|
+
estimatedPrintTimeMinutes?: string | number | boolean;
|
|
278
|
+
/** Print time estimates for different quality presets */
|
|
279
|
+
printTimeEstimates?: Record<string, string | number | boolean>;
|
|
280
|
+
/** Estimated material usage in grams using 20% infill (assumes PLA density 1.24g/cm³) */
|
|
281
|
+
estimatedMaterialGrams?: number;
|
|
282
|
+
/** Material usage estimates for different infill percentages */
|
|
283
|
+
materialEstimates?: Record<string, string | number | boolean>;
|
|
284
|
+
/** Recommended print orientation for minimal support material and best results */
|
|
285
|
+
recommendedOrientation?: Record<string, string | number | boolean>;
|
|
286
|
+
/** Original file format unit detected from metadata or inferred from scale */
|
|
287
|
+
originalUnit?: string;
|
|
288
|
+
/** File format version (e.g., 'STL Binary', 'OBJ v4', 'PLY 1.0') */
|
|
289
|
+
formatVersion?: string;
|
|
290
|
+
/** Does the file contain per-vertex color information? */
|
|
291
|
+
hasColorData?: boolean;
|
|
292
|
+
/** Does the file contain UV texture mapping coordinates? */
|
|
293
|
+
hasTextureCoordinates?: boolean;
|
|
294
|
+
/** Does the file contain per-vertex normal vectors? */
|
|
295
|
+
hasVertexNormals?: boolean;
|
|
296
|
+
/** Tool/service that performed the analysis */
|
|
297
|
+
analyzedBy?: string;
|
|
298
|
+
/** Version of the analysis algorithm (for tracking improvements) */
|
|
299
|
+
analysisVersion?: string;
|
|
300
|
+
/** Confidence level of analysis results (0.0 = uncertain, 1.0 = highly confident) */
|
|
301
|
+
analysisConfidence?: number;
|
|
302
|
+
/** Warnings or issues detected during analysis (structured for programmatic handling) */
|
|
303
|
+
analysisWarnings?: Array<Record<string, string | number | boolean>>;
|
|
304
|
+
/** ISO 8601 timestamp when analysis was performed (e.g., '2025-11-19T14:35:22Z') */
|
|
305
|
+
analyzedAt?: string;
|
|
306
|
+
/** Detailed error message if status is FAILED */
|
|
307
|
+
errorMessage?: string;
|
|
308
|
+
/** Machine-readable error code for programmatic error handling */
|
|
309
|
+
errorCode?: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
|
|
313
|
+
*/
|
|
314
|
+
export interface ModelTechnicalMetadataRequestMessage {
|
|
315
|
+
/** Unique identifier for the model to analyze */
|
|
316
|
+
modelId?: string;
|
|
317
|
+
/** User ID who owns the model */
|
|
318
|
+
ownerId?: string;
|
|
319
|
+
/** Location of the 3D model file */
|
|
320
|
+
storageLocation?: Record<string, string | number | boolean>;
|
|
321
|
+
/** Optional analysis configuration parameters */
|
|
322
|
+
analysisOptions?: Record<string, string | number | boolean>;
|
|
323
|
+
}
|
|
159
324
|
/**
|
|
160
325
|
* Handles thumbnail generation completed.
|
|
161
326
|
*/
|
package/dist/types.js
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
export const MessageTypes = {
|
|
6
6
|
FILE_DOWNLOAD_COMPLETED: 'file-download-completed',
|
|
7
7
|
FILE_DOWNLOAD_REQUEST: 'file-download-request',
|
|
8
|
+
MEDIA_BATCH_DOWNLOAD_COMPLETED: 'media-batch-download-completed',
|
|
9
|
+
MEDIA_BATCH_DOWNLOAD_REQUEST: 'media-batch-download-request',
|
|
10
|
+
METAMODEL_METADATA_GENERATION_COMPLETED: 'metamodel-metadata-generation-completed',
|
|
11
|
+
METAMODEL_METADATA_GENERATION_REQUEST: 'metamodel-metadata-generation-request',
|
|
8
12
|
MODEL_DISCOVERY_FOLDER_PROCESSED_EVENT: 'model-discovery-folder-processed-event',
|
|
9
13
|
MODEL_DISCOVERY_SCAN_FOUND_EVENT: 'model-discovery-scan-found-event',
|
|
10
14
|
MODEL_DISCOVERY_SCAN_PROGRESS_EVENT: 'model-discovery-scan-progress-event',
|
|
@@ -13,6 +17,8 @@ export const MessageTypes = {
|
|
|
13
17
|
MODEL_METADATA_GENERATION_REQUEST: 'model-metadata-generation-request',
|
|
14
18
|
MODEL_METAMODEL_DETECTION_FOUND: 'model-metamodel-detection-found',
|
|
15
19
|
MODEL_METAMODEL_DETECTION_REQUEST: 'model-metamodel-detection-request',
|
|
20
|
+
MODEL_TECHNICAL_METADATA_COMPLETED: 'model-technical-metadata-completed',
|
|
21
|
+
MODEL_TECHNICAL_METADATA_REQUEST: 'model-technical-metadata-request',
|
|
16
22
|
THUMBNAIL_GENERATION_COMPLETED: 'thumbnail-generation-completed',
|
|
17
23
|
THUMBNAIL_GENERATION_REQUEST: 'thumbnail-generation-request',
|
|
18
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mesh-sync/worker-backend-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Auto-generated TypeScript client for worker-backend - provides type-safe methods for enqueueing jobs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|