@mesh-sync/worker-backend-client 4.0.6 → 4.0.9

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 CHANGED
@@ -184,6 +184,8 @@ Used for:
184
184
 
185
185
  - `results` (array) [✗]: Analytics for each synced listing
186
186
 
187
+ - `credentialUpdate` (object) [✗]: New credentials if token was refreshed during operation
188
+
187
189
  - `errors` (array) [✗]: Errors for failed listings
188
190
 
189
191
  - `syncedAt` (string) [✗]:
@@ -210,6 +212,8 @@ Can sync: - Specific listings (provide listingIds) - All user listings (provide
210
212
 
211
213
  - `shopId` (string) [✗]: Etsy shop ID for shop-level analytics
212
214
 
215
+ - `credentials` (object) [✗]: Etsy OAuth credentials
216
+
213
217
  - `timeRange` (object) [✗]: Date range for historical analytics
214
218
 
215
219
  - `syncOptions` (object) [✗]:
@@ -245,6 +249,8 @@ Can sync: - Specific listings (provide listingIds) - All user listings (provide
245
249
 
246
250
  - `etsyListingUrl` (string) [✗]: URL to view listing on Etsy (only if status=SUCCESS)
247
251
 
252
+ - `credentialUpdate` (object) [✗]: New credentials if token was refreshed during operation
253
+
248
254
  - `etsyFileId` (string) [✗]: Etsy digital file ID (only if status=SUCCESS)
249
255
 
250
256
  - `error` (object) [✗]: Error details (only if status=FAILED)
@@ -274,6 +280,8 @@ Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
274
280
 
275
281
  - `ownerId` (string) [✗]: User ID who owns the metamodel
276
282
 
283
+ - `credentials` (object) [✗]: Etsy OAuth credentials
284
+
277
285
  - `materialVariant` (object) [✗]: Material-specific listing configuration
278
286
 
279
287
  - `baseListingData` (object) [✗]: Common listing information
@@ -314,7 +322,15 @@ Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
314
322
 
315
323
  ### file-download-request
316
324
 
317
- **Description:** Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
325
+ **Description:** Downloads model file from storage provider to MinIO for processing pipeline.
326
+ Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
327
+
328
+ Retry Configuration:
329
+ - Automatic retry enabled for transient failures (connection errors, timeouts)
330
+ - Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
331
+ - Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
332
+ - No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
333
+
318
334
 
319
335
  **Method:** `client.fileDownloadRequest(data)`
320
336
 
@@ -328,6 +344,10 @@ Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
328
344
 
329
345
  - `storageLocation` (object) [✗]: The storage location of the model.
330
346
 
347
+ - `metadata` (object) [✗]: Optional metadata from discovery. For Thingiverse, contains downloadUrl for direct file access.
348
+
349
+ - `credentials` (object) [✗]: Decrypted credentials required for this specific download operation. Injected by the backend.
350
+
331
351
  - `minioDestination` (object) [✗]: Destination in MinIO where file will be uploaded after download.
332
352
 
333
353
  - `autoEnqueueChildren` (boolean) [✗]: Automatically enqueue thumbnail generation, technical metadata analysis, and metadata generation jobs after download completes.
@@ -340,6 +360,44 @@ Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
340
360
 
341
361
 
342
362
 
363
+ ### file-vectorize-completed
364
+
365
+ **Description:** Result of the vectorization process containing the embedding vector.
366
+
367
+ **Method:** `client.fileVectorizeCompleted(data)`
368
+
369
+ **Payload Type:** `FileVectorizeCompletedMessage`
370
+
371
+ **Fields:**
372
+
373
+ - `fileId` (string) [✗]:
374
+
375
+ - `vector` (array) [✗]: The computed embedding vector
376
+
377
+ - `modelName` (string) [✗]:
378
+
379
+ - `dimension` (integer) [✗]: Length of the vector (e.g., 512)
380
+
381
+
382
+
383
+ ### file-vectorize-request
384
+
385
+ **Description:** Request to generate a vector embedding for an image file using CLIP.
386
+
387
+ **Method:** `client.fileVectorizeRequest(data)`
388
+
389
+ **Payload Type:** `FileVectorizeRequestMessage`
390
+
391
+ **Fields:**
392
+
393
+ - `fileId` (string) [✗]: The ID of the file in the database
394
+
395
+ - `storageItem` () [✗]: Location of the image file
396
+
397
+ - `modelName` (string) [✗]: Optional: Specific model version to use
398
+
399
+
400
+
343
401
  ### marketplace-analytics-sync-completed
344
402
 
345
403
  **Description:** Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
@@ -728,7 +786,19 @@ Includes bidirectional sync: - Pull: Fetch listings from marketplace to update l
728
786
  - `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.
729
787
 
730
788
 
731
- - `storageConnectionId` (string) [✗]: UUID of the StorageConnection entity from which to download the media files. Used to authenticate and access the source storage provider.
789
+ - `downloadStrategy` (string) [✗]: Download strategy for media files: - storage_provider: Download from authenticated storage connection (Google Drive, SFTP, etc.) - external_url: Download from public HTTP URLs (CDN, API responses, Thingiverse, etc.)
790
+
791
+
792
+ - `entityType` (string) [✗]: Type of entity these media files belong to. Used for linking downloaded media to the correct entity in the database.
793
+
794
+
795
+ - `entityId` (string) [✗]: UUID of the model or metamodel entity that owns these media files. Used for creating storage item associations after download.
796
+
797
+
798
+ - `storageConnectionId` (string) [✗]: UUID of the StorageConnection entity from which to download the media files. Required when downloadStrategy is 'storage_provider'. Used to authenticate and access the source storage provider.
799
+
800
+
801
+ - `credentials` (object) [✗]: Decrypted credentials for the storage provider (Fat Payload pattern). Required when downloadStrategy is 'storage_provider'.
732
802
 
733
803
 
734
804
  - `mediaFiles` (array) [✗]: Array of media files to download and process. Must contain at least one file. Each file includes metadata for identification and processing.
@@ -906,6 +976,60 @@ and stores aggregated statistics in Elasticsearch for trend analysis.
906
976
 
907
977
  - `path` (string) [✗]: The specific path within the storage connection to scan for this library.
908
978
 
979
+ - `credentials` (object) [✗]: Decrypted credentials for the storage provider.
980
+
981
+ - `configuration` (object) [✗]: Configuration for the storage connection (e.g. scanRootPath).
982
+
983
+
984
+
985
+ ### model-finder-index-request
986
+
987
+ **Description:** Request to index a 3D model for similarity search.
988
+
989
+ **Method:** `client.modelFinderIndexRequest(data)`
990
+
991
+ **Payload Type:** `ModelFinderIndexRequestMessage`
992
+
993
+ **Fields:**
994
+
995
+ - `modelId` (string) [✗]:
996
+
997
+ - `storageItem` () [✗]:
998
+
999
+
1000
+
1001
+ ### model-finder-response
1002
+
1003
+ **Description:** Response containing search results from the model finder.
1004
+
1005
+ **Method:** `client.modelFinderResponse(data)`
1006
+
1007
+ **Payload Type:** `ModelFinderResponseMessage`
1008
+
1009
+ **Fields:**
1010
+
1011
+ - `requestId` (string) [✗]:
1012
+
1013
+ - `results` (array) [✗]:
1014
+
1015
+
1016
+
1017
+ ### model-finder-search-request
1018
+
1019
+ **Description:** Request to search for similar 3D models.
1020
+
1021
+ **Method:** `client.modelFinderSearchRequest(data)`
1022
+
1023
+ **Payload Type:** `ModelFinderSearchRequestMessage`
1024
+
1025
+ **Fields:**
1026
+
1027
+ - `referenceModelId` (string) [✗]: Optional: Search using an existing model as reference
1028
+
1029
+ - `referenceImageId` (string) [✗]: Optional: Search using an uploaded image
1030
+
1031
+ - `limit` (integer) [✗]:
1032
+
909
1033
 
910
1034
 
911
1035
  ### model-metadata-generation-completed
@@ -926,7 +1050,7 @@ and stores aggregated statistics in Elasticsearch for trend analysis.
926
1050
 
927
1051
  ### model-metadata-generation-request
928
1052
 
929
- **Description:** Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis of thumbnails by default. Worker queries database by modelId to retrieve: Model (fileName, fileSize, ownerId, storageItem), TechnicalMetadata (geometry, quality, printability), and ThumbnailMedia (required for default vision analysis). Prerequisites: file download completed, technical metadata analysis completed (strongly recommended), thumbnail generation completed (REQUIRED for vision-enhanced analysis, default behavior). Vision analysis can be disabled via ENABLE_VISION_METADATA_GENERATION environment variable (default: true).
1053
+ **Description:** Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis. Worker receives all necessary data in the payload (Model, TechnicalMetadata, Thumbnails) and does NOT query the database. Prerequisites: file download, technical metadata, and thumbnail generation must be complete before this message is sent.
930
1054
 
931
1055
  **Method:** `client.modelMetadataGenerationRequest(data)`
932
1056
 
@@ -934,9 +1058,13 @@ and stores aggregated statistics in Elasticsearch for trend analysis.
934
1058
 
935
1059
  **Fields:**
936
1060
 
937
- - `modelId` (string) [✗]: UUID of the model to generate metadata for. Worker queries database to retrieve: 1) Model entity (name, fileName, fileSize, ownerId, storageItem relationship), 2) Model.technicalMetadata relationship (vertices, faces, quality scores, printability metrics), 3) AssociatedMedia.thumbnails (via associatedMediaId) for vision-enhanced analysis. All data fetched from PostgreSQL - no additional parameters required.
1061
+ - `modelId` (string) [✗]: UUID of the model (reference only)
1062
+
1063
+ - `model` (object) [✗]: Core model entity data
938
1064
 
939
- - `parentJobId` (string) [✗]: ID of parent thumbnail-generation job for BullMQ dependency tracking. SHOULD be set to thumbnail-generation job ID to ensure thumbnails are ready before metadata generation (required for default vision analysis). If omitted, worker will check for thumbnail existence and wait/retry if ENABLE_VISION_METADATA_GENERATION=true.
1065
+ - `technicalMetadata` (object) [✗]: Geometric and technical analysis results
1066
+
1067
+ - `thumbnails` (array) [✗]: List of 360 degree thumbnail views (URLs or paths)
940
1068
 
941
1069
 
942
1070
 
@@ -968,7 +1096,9 @@ and stores aggregated statistics in Elasticsearch for trend analysis.
968
1096
 
969
1097
  - `folderPath` (string) [✓]: The path to the folder that was processed.
970
1098
 
971
- - `discoveredFiles` (array) []: A list of files discovered in the folder.
1099
+ - `discoveredFiles` (array) []: A list of files discovered in the folder. Worker should check this first, then manifestUrl.
1100
+
1101
+ - `manifestUrl` (string) [✗]: URL to a JSON file containing the list of discovered files (for large folders)
972
1102
 
973
1103
  - `folderSignature` (object) [✓]: A signature representing the state of the folder.
974
1104
 
@@ -1022,10 +1152,14 @@ and stores aggregated statistics in Elasticsearch for trend analysis.
1022
1152
 
1023
1153
  **Fields:**
1024
1154
 
1025
- - `metamodelId` (string) [✗]: UUID of the metamodel to analyze. Worker will fetch all model metadata, technical metadata, enriched metadata, and child models from PostgreSQL.
1155
+ - `metamodelId` (string) [✗]: UUID of the metamodel to analyze.
1026
1156
 
1027
1157
  - `ownerId` (string) [✗]: UUID of the user who owns the metamodel
1028
1158
 
1159
+ - `metamodelData` (object) [✗]: Full metamodel data including technical metadata, enriched metadata, and child models. Injected by backend to avoid DB access.
1160
+
1161
+ - `manifestUrl` (string) [✗]: URL to a JSON manifest containing the metamodel data if it is too large for the message payload.
1162
+
1029
1163
  - `analysisOptions` (object) [✗]: Optional analysis configuration
1030
1164
 
1031
1165
 
@@ -1222,6 +1356,8 @@ and stores aggregated statistics in Elasticsearch for trend analysis.
1222
1356
 
1223
1357
  - `thumbnailPath` (string) [✗]: The path to the generated thumbnail.
1224
1358
 
1359
+ - `thumbnail360Views` (array) [✗]: Array of 360° thumbnail view paths (16 angles) for vision-based analysis.
1360
+
1225
1361
  - `errorMessage` (string) [✗]: An error message if the thumbnail generation failed.
1226
1362
 
1227
1363
  - `storageLocation` (object) [✗]: The storage location of the model.
@@ -1248,7 +1384,7 @@ and stores aggregated statistics in Elasticsearch for trend analysis.
1248
1384
 
1249
1385
  - `previewType` (string) [✗]: The type of preview to generate, e.g., 'default', 'static', 'glb'.
1250
1386
 
1251
- - `generate360Views` (boolean) [✗]: Generate 16 angle views for 360° preview (4 horizontal x 4 vertical angles).
1387
+ - `generate360Views` (boolean) [✗]: Generate 16 angle views for 360° preview (4 horizontal x 4 vertical angles) for enhanced vision-based metadata analysis.
1252
1388
 
1253
1389
  - `parentJobId` (string) [✗]: ID of parent file-download job (for BullMQ dependency tracking).
1254
1390
 
@@ -1508,7 +1644,21 @@ Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
1508
1644
  - Notifies that a file download has been processed, indicating success or failure.
1509
1645
 
1510
1646
  - `fileDownloadRequest(data: FileDownloadRequestMessage): Promise<JobResponse>`
1511
- - Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
1647
+ - Downloads model file from storage provider to MinIO for processing pipeline.
1648
+ Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
1649
+
1650
+ Retry Configuration:
1651
+ - Automatic retry enabled for transient failures (connection errors, timeouts)
1652
+ - Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
1653
+ - Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
1654
+ - No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
1655
+
1656
+
1657
+ - `fileVectorizeCompleted(data: FileVectorizeCompletedMessage): Promise<JobResponse>`
1658
+ - Result of the vectorization process containing the embedding vector.
1659
+
1660
+ - `fileVectorizeRequest(data: FileVectorizeRequestMessage): Promise<JobResponse>`
1661
+ - Request to generate a vector embedding for an image file using CLIP.
1512
1662
 
1513
1663
  - `marketplaceAnalyticsSyncCompleted(data: MarketplaceAnalyticsSyncCompletedMessage): Promise<JobResponse>`
1514
1664
  - Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
@@ -1581,11 +1731,20 @@ and stores aggregated statistics in Elasticsearch for trend analysis.
1581
1731
  - `modelDiscoveryScanRequest(data: ModelDiscoveryScanRequestMessage): Promise<JobResponse>`
1582
1732
  - Handles model discovery scan requests events.
1583
1733
 
1734
+ - `modelFinderIndexRequest(data: ModelFinderIndexRequestMessage): Promise<JobResponse>`
1735
+ - Request to index a 3D model for similarity search.
1736
+
1737
+ - `modelFinderResponse(data: ModelFinderResponseMessage): Promise<JobResponse>`
1738
+ - Response containing search results from the model finder.
1739
+
1740
+ - `modelFinderSearchRequest(data: ModelFinderSearchRequestMessage): Promise<JobResponse>`
1741
+ - Request to search for similar 3D models.
1742
+
1584
1743
  - `modelMetadataGenerationCompleted(data: ModelMetadataGenerationCompletedMessage): Promise<JobResponse>`
1585
1744
  - Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
1586
1745
 
1587
1746
  - `modelMetadataGenerationRequest(data: ModelMetadataGenerationRequestMessage): Promise<JobResponse>`
1588
- - Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis of thumbnails by default. Worker queries database by modelId to retrieve: Model (fileName, fileSize, ownerId, storageItem), TechnicalMetadata (geometry, quality, printability), and ThumbnailMedia (required for default vision analysis). Prerequisites: file download completed, technical metadata analysis completed (strongly recommended), thumbnail generation completed (REQUIRED for vision-enhanced analysis, default behavior). Vision analysis can be disabled via ENABLE_VISION_METADATA_GENERATION environment variable (default: true).
1747
+ - Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis. Worker receives all necessary data in the payload (Model, TechnicalMetadata, Thumbnails) and does NOT query the database. Prerequisites: file download, technical metadata, and thumbnail generation must be complete before this message is sent.
1589
1748
 
1590
1749
  - `modelMetamodelDetectionFound(data: ModelMetamodelDetectionFoundMessage): Promise<JobResponse>`
1591
1750
  - Handles model metamodel detection found with hierarchical relationships.
package/dist/client.d.ts CHANGED
@@ -96,11 +96,31 @@ export declare class WorkerClient {
96
96
  */
97
97
  fileDownloadCompleted(data: types.FileDownloadCompletedMessage): Promise<JobResponse>;
98
98
  /**
99
- * Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
99
+ * Downloads model file from storage provider to MinIO for processing pipeline.
100
+ Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
101
+
102
+ Retry Configuration:
103
+ - Automatic retry enabled for transient failures (connection errors, timeouts)
104
+ - Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
105
+ - Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
106
+ - No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
107
+
100
108
  * @param data - The message payload
101
109
  * @returns Job response with job ID
102
110
  */
103
111
  fileDownloadRequest(data: types.FileDownloadRequestMessage): Promise<JobResponse>;
112
+ /**
113
+ * Result of the vectorization process containing the embedding vector.
114
+ * @param data - The message payload
115
+ * @returns Job response with job ID
116
+ */
117
+ fileVectorizeCompleted(data: types.FileVectorizeCompletedMessage): Promise<JobResponse>;
118
+ /**
119
+ * Request to generate a vector embedding for an image file using CLIP.
120
+ * @param data - The message payload
121
+ * @returns Job response with job ID
122
+ */
123
+ fileVectorizeRequest(data: types.FileVectorizeRequestMessage): Promise<JobResponse>;
104
124
  /**
105
125
  * Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
106
126
  * @param data - The message payload
@@ -229,6 +249,24 @@ export declare class WorkerClient {
229
249
  * @returns Job response with job ID
230
250
  */
231
251
  modelDiscoveryScanRequest(data: types.ModelDiscoveryScanRequestMessage): Promise<JobResponse>;
252
+ /**
253
+ * Request to index a 3D model for similarity search.
254
+ * @param data - The message payload
255
+ * @returns Job response with job ID
256
+ */
257
+ modelFinderIndexRequest(data: types.ModelFinderIndexRequestMessage): Promise<JobResponse>;
258
+ /**
259
+ * Response containing search results from the model finder.
260
+ * @param data - The message payload
261
+ * @returns Job response with job ID
262
+ */
263
+ modelFinderResponse(data: types.ModelFinderResponseMessage): Promise<JobResponse>;
264
+ /**
265
+ * Request to search for similar 3D models.
266
+ * @param data - The message payload
267
+ * @returns Job response with job ID
268
+ */
269
+ modelFinderSearchRequest(data: types.ModelFinderSearchRequestMessage): Promise<JobResponse>;
232
270
  /**
233
271
  * Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
234
272
  * @param data - The message payload
@@ -236,7 +274,7 @@ export declare class WorkerClient {
236
274
  */
237
275
  modelMetadataGenerationCompleted(data: types.ModelMetadataGenerationCompletedMessage): Promise<JobResponse>;
238
276
  /**
239
- * Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis of thumbnails by default. Worker queries database by modelId to retrieve: Model (fileName, fileSize, ownerId, storageItem), TechnicalMetadata (geometry, quality, printability), and ThumbnailMedia (required for default vision analysis). Prerequisites: file download completed, technical metadata analysis completed (strongly recommended), thumbnail generation completed (REQUIRED for vision-enhanced analysis, default behavior). Vision analysis can be disabled via ENABLE_VISION_METADATA_GENERATION environment variable (default: true).
277
+ * Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis. Worker receives all necessary data in the payload (Model, TechnicalMetadata, Thumbnails) and does NOT query the database. Prerequisites: file download, technical metadata, and thumbnail generation must be complete before this message is sent.
240
278
  * @param data - The message payload
241
279
  * @returns Job response with job ID
242
280
  */
package/dist/client.js CHANGED
@@ -131,13 +131,37 @@ export class WorkerClient {
131
131
  return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_COMPLETED, data);
132
132
  }
133
133
  /**
134
- * Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
134
+ * Downloads model file from storage provider to MinIO for processing pipeline.
135
+ Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
136
+
137
+ Retry Configuration:
138
+ - Automatic retry enabled for transient failures (connection errors, timeouts)
139
+ - Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
140
+ - Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
141
+ - No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
142
+
135
143
  * @param data - The message payload
136
144
  * @returns Job response with job ID
137
145
  */
138
146
  async fileDownloadRequest(data) {
139
147
  return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_REQUEST, data);
140
148
  }
149
+ /**
150
+ * Result of the vectorization process containing the embedding vector.
151
+ * @param data - The message payload
152
+ * @returns Job response with job ID
153
+ */
154
+ async fileVectorizeCompleted(data) {
155
+ return this.sendToQueue(types.MessageTypes.FILE_VECTORIZE_COMPLETED, data);
156
+ }
157
+ /**
158
+ * Request to generate a vector embedding for an image file using CLIP.
159
+ * @param data - The message payload
160
+ * @returns Job response with job ID
161
+ */
162
+ async fileVectorizeRequest(data) {
163
+ return this.sendToQueue(types.MessageTypes.FILE_VECTORIZE_REQUEST, data);
164
+ }
141
165
  /**
142
166
  * Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
143
167
  * @param data - The message payload
@@ -304,6 +328,30 @@ export class WorkerClient {
304
328
  async modelDiscoveryScanRequest(data) {
305
329
  return this.sendToQueue(types.MessageTypes.MODEL_DISCOVERY_SCAN_REQUEST, data);
306
330
  }
331
+ /**
332
+ * Request to index a 3D model for similarity search.
333
+ * @param data - The message payload
334
+ * @returns Job response with job ID
335
+ */
336
+ async modelFinderIndexRequest(data) {
337
+ return this.sendToQueue(types.MessageTypes.MODEL_FINDER_INDEX_REQUEST, data);
338
+ }
339
+ /**
340
+ * Response containing search results from the model finder.
341
+ * @param data - The message payload
342
+ * @returns Job response with job ID
343
+ */
344
+ async modelFinderResponse(data) {
345
+ return this.sendToQueue(types.MessageTypes.MODEL_FINDER_RESPONSE, data);
346
+ }
347
+ /**
348
+ * Request to search for similar 3D models.
349
+ * @param data - The message payload
350
+ * @returns Job response with job ID
351
+ */
352
+ async modelFinderSearchRequest(data) {
353
+ return this.sendToQueue(types.MessageTypes.MODEL_FINDER_SEARCH_REQUEST, data);
354
+ }
307
355
  /**
308
356
  * Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
309
357
  * @param data - The message payload
@@ -313,7 +361,7 @@ export class WorkerClient {
313
361
  return this.sendToQueue(types.MessageTypes.MODEL_METADATA_GENERATION_COMPLETED, data);
314
362
  }
315
363
  /**
316
- * Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis of thumbnails by default. Worker queries database by modelId to retrieve: Model (fileName, fileSize, ownerId, storageItem), TechnicalMetadata (geometry, quality, printability), and ThumbnailMedia (required for default vision analysis). Prerequisites: file download completed, technical metadata analysis completed (strongly recommended), thumbnail generation completed (REQUIRED for vision-enhanced analysis, default behavior). Vision analysis can be disabled via ENABLE_VISION_METADATA_GENERATION environment variable (default: true).
364
+ * Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis. Worker receives all necessary data in the payload (Model, TechnicalMetadata, Thumbnails) and does NOT query the database. Prerequisites: file download, technical metadata, and thumbnail generation must be complete before this message is sent.
317
365
  * @param data - The message payload
318
366
  * @returns Job response with job ID
319
367
  */
package/dist/types.d.ts CHANGED
@@ -9,6 +9,8 @@ export declare const MessageTypes: {
9
9
  readonly ETSY_PUBLISH_LISTING_REQUEST: "etsy-publish-listing-request";
10
10
  readonly FILE_DOWNLOAD_COMPLETED: "file-download-completed";
11
11
  readonly FILE_DOWNLOAD_REQUEST: "file-download-request";
12
+ readonly FILE_VECTORIZE_COMPLETED: "file-vectorize-completed";
13
+ readonly FILE_VECTORIZE_REQUEST: "file-vectorize-request";
12
14
  readonly MARKETPLACE_ANALYTICS_SYNC_COMPLETED: "marketplace-analytics-sync-completed";
13
15
  readonly MARKETPLACE_ANALYTICS_SYNC_REQUEST: "marketplace-analytics-sync-request";
14
16
  readonly MARKETPLACE_CONNECTION_SYNC_COMPLETED: "marketplace-connection-sync-completed";
@@ -28,6 +30,9 @@ export declare const MessageTypes: {
28
30
  readonly MODEL_DISCOVERY_SCAN_FOUND_EVENT: "model-discovery-scan-found-event";
29
31
  readonly MODEL_DISCOVERY_SCAN_PROGRESS_EVENT: "model-discovery-scan-progress-event";
30
32
  readonly MODEL_DISCOVERY_SCAN_REQUEST: "model-discovery-scan-request";
33
+ readonly MODEL_FINDER_INDEX_REQUEST: "model-finder-index-request";
34
+ readonly MODEL_FINDER_RESPONSE: "model-finder-response";
35
+ readonly MODEL_FINDER_SEARCH_REQUEST: "model-finder-search-request";
31
36
  readonly MODEL_METADATA_GENERATION_COMPLETED: "model-metadata-generation-completed";
32
37
  readonly MODEL_METADATA_GENERATION_REQUEST: "model-metadata-generation-request";
33
38
  readonly MODEL_METAMODEL_DETECTION_FOUND: "model-metamodel-detection-found";
@@ -116,6 +121,8 @@ export interface EtsyAnalyticsSyncCompletedMessage {
116
121
  errorCount?: string | number | boolean;
117
122
  /** Analytics for each synced listing */
118
123
  results?: Array<Record<string, string | number | boolean>>;
124
+ /** New credentials if token was refreshed during operation */
125
+ credentialUpdate?: Record<string, string | number | boolean>;
119
126
  /** Errors for failed listings */
120
127
  errors?: Array<Record<string, string | number | boolean>>;
121
128
  /** */
@@ -135,6 +142,8 @@ export interface EtsyAnalyticsSyncRequestMessage {
135
142
  userId?: string;
136
143
  /** Etsy shop ID for shop-level analytics */
137
144
  shopId?: string;
145
+ /** Etsy OAuth credentials */
146
+ credentials?: Record<string, string | number | boolean>;
138
147
  /** Date range for historical analytics */
139
148
  timeRange?: Record<string, string | number | boolean>;
140
149
  /** */
@@ -163,6 +172,8 @@ export interface EtsyPublishListingCompletedMessage {
163
172
  etsyListingId?: string;
164
173
  /** URL to view listing on Etsy (only if status=SUCCESS) */
165
174
  etsyListingUrl?: string;
175
+ /** New credentials if token was refreshed during operation */
176
+ credentialUpdate?: Record<string, string | number | boolean>;
166
177
  /** Etsy digital file ID (only if status=SUCCESS) */
167
178
  etsyFileId?: string;
168
179
  /** Error details (only if status=FAILED) */
@@ -185,6 +196,8 @@ export interface EtsyPublishListingRequestMessage {
185
196
  metamodelId?: string;
186
197
  /** User ID who owns the metamodel */
187
198
  ownerId?: string;
199
+ /** Etsy OAuth credentials */
200
+ credentials?: Record<string, string | number | boolean>;
188
201
  /** Material-specific listing configuration */
189
202
  materialVariant?: Record<string, string | number | boolean>;
190
203
  /** Common listing information */
@@ -216,7 +229,15 @@ export interface FileDownloadCompletedMessage {
216
229
  downloadedAt?: string;
217
230
  }
218
231
  /**
219
- * Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
232
+ * Downloads model file from storage provider to MinIO for processing pipeline.
233
+ Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
234
+
235
+ Retry Configuration:
236
+ - Automatic retry enabled for transient failures (connection errors, timeouts)
237
+ - Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
238
+ - Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
239
+ - No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
240
+
220
241
  */
221
242
  export interface FileDownloadRequestMessage {
222
243
  /** The unique identifier for the model to be downloaded. */
@@ -225,6 +246,10 @@ export interface FileDownloadRequestMessage {
225
246
  ownerId?: string;
226
247
  /** The storage location of the model. */
227
248
  storageLocation?: Record<string, string | number | boolean>;
249
+ /** Optional metadata from discovery. For Thingiverse, contains downloadUrl for direct file access. */
250
+ metadata?: Record<string, string | number | boolean>;
251
+ /** Decrypted credentials required for this specific download operation. Injected by the backend. */
252
+ credentials?: Record<string, string | number | boolean>;
228
253
  /** Destination in MinIO where file will be uploaded after download. */
229
254
  minioDestination?: Record<string, string | number | boolean>;
230
255
  /** Automatically enqueue thumbnail generation, technical metadata analysis, and metadata generation jobs after download completes. */
@@ -236,6 +261,30 @@ export interface FileDownloadRequestMessage {
236
261
  /** Optional webhook URL to call when download completes. If provided, worker will POST completion status to this endpoint. */
237
262
  webhookUrl?: string;
238
263
  }
264
+ /**
265
+ * Result of the vectorization process containing the embedding vector.
266
+ */
267
+ export interface FileVectorizeCompletedMessage {
268
+ /** */
269
+ fileId?: string;
270
+ /** The computed embedding vector */
271
+ vector?: Array<Record<string, string | number | boolean>>;
272
+ /** */
273
+ modelName?: string;
274
+ /** Length of the vector (e.g., 512) */
275
+ dimension?: string | number | boolean;
276
+ }
277
+ /**
278
+ * Request to generate a vector embedding for an image file using CLIP.
279
+ */
280
+ export interface FileVectorizeRequestMessage {
281
+ /** The ID of the file in the database */
282
+ fileId?: string;
283
+ /** Location of the image file */
284
+ storageItem?: string | number | boolean;
285
+ /** Optional: Specific model version to use */
286
+ modelName?: string;
287
+ }
239
288
  /**
240
289
  * Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
241
290
  */
@@ -541,9 +590,21 @@ export interface MediaBatchDownloadRequestMessage {
541
590
  /** Unique identifier for this batch of media files. Used for organizing processed files in S3 storage (media/{batchId}/) and correlating with completion responses.
542
591
  */
543
592
  batchId?: string;
544
- /** UUID of the StorageConnection entity from which to download the media files. Used to authenticate and access the source storage provider.
593
+ /** Download strategy for media files: - storage_provider: Download from authenticated storage connection (Google Drive, SFTP, etc.) - external_url: Download from public HTTP URLs (CDN, API responses, Thingiverse, etc.)
594
+ */
595
+ downloadStrategy?: string;
596
+ /** Type of entity these media files belong to. Used for linking downloaded media to the correct entity in the database.
597
+ */
598
+ entityType?: string;
599
+ /** UUID of the model or metamodel entity that owns these media files. Used for creating storage item associations after download.
600
+ */
601
+ entityId?: string;
602
+ /** UUID of the StorageConnection entity from which to download the media files. Required when downloadStrategy is 'storage_provider'. Used to authenticate and access the source storage provider.
545
603
  */
546
604
  storageConnectionId?: string;
605
+ /** Decrypted credentials for the storage provider (Fat Payload pattern). Required when downloadStrategy is 'storage_provider'.
606
+ */
607
+ credentials?: Record<string, string | number | boolean>;
547
608
  /** Array of media files to download and process. Must contain at least one file. Each file includes metadata for identification and processing.
548
609
  */
549
610
  mediaFiles?: Array<Record<string, string | number | boolean>>;
@@ -670,6 +731,39 @@ export interface ModelDiscoveryScanRequestMessage {
670
731
  providerType?: string;
671
732
  /** The specific path within the storage connection to scan for this library. */
672
733
  path?: string;
734
+ /** Decrypted credentials for the storage provider. */
735
+ credentials?: Record<string, string | number | boolean>;
736
+ /** Configuration for the storage connection (e.g. scanRootPath). */
737
+ configuration?: Record<string, string | number | boolean>;
738
+ }
739
+ /**
740
+ * Request to index a 3D model for similarity search.
741
+ */
742
+ export interface ModelFinderIndexRequestMessage {
743
+ /** */
744
+ modelId?: string;
745
+ /** */
746
+ storageItem?: string | number | boolean;
747
+ }
748
+ /**
749
+ * Response containing search results from the model finder.
750
+ */
751
+ export interface ModelFinderResponseMessage {
752
+ /** */
753
+ requestId?: string;
754
+ /** */
755
+ results?: Array<Record<string, string | number | boolean>>;
756
+ }
757
+ /**
758
+ * Request to search for similar 3D models.
759
+ */
760
+ export interface ModelFinderSearchRequestMessage {
761
+ /** Optional: Search using an existing model as reference */
762
+ referenceModelId?: string;
763
+ /** Optional: Search using an uploaded image */
764
+ referenceImageId?: string;
765
+ /** */
766
+ limit?: string | number | boolean;
673
767
  }
674
768
  /**
675
769
  * Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
@@ -681,13 +775,17 @@ export interface ModelMetadataGenerationCompletedMessage {
681
775
  metadata: Record<string, string | number | boolean>;
682
776
  }
683
777
  /**
684
- * Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis of thumbnails by default. Worker queries database by modelId to retrieve: Model (fileName, fileSize, ownerId, storageItem), TechnicalMetadata (geometry, quality, printability), and ThumbnailMedia (required for default vision analysis). Prerequisites: file download completed, technical metadata analysis completed (strongly recommended), thumbnail generation completed (REQUIRED for vision-enhanced analysis, default behavior). Vision analysis can be disabled via ENABLE_VISION_METADATA_GENERATION environment variable (default: true).
778
+ * Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis. Worker receives all necessary data in the payload (Model, TechnicalMetadata, Thumbnails) and does NOT query the database. Prerequisites: file download, technical metadata, and thumbnail generation must be complete before this message is sent.
685
779
  */
686
780
  export interface ModelMetadataGenerationRequestMessage {
687
- /** UUID of the model to generate metadata for. Worker queries database to retrieve: 1) Model entity (name, fileName, fileSize, ownerId, storageItem relationship), 2) Model.technicalMetadata relationship (vertices, faces, quality scores, printability metrics), 3) AssociatedMedia.thumbnails (via associatedMediaId) for vision-enhanced analysis. All data fetched from PostgreSQL - no additional parameters required. */
781
+ /** UUID of the model (reference only) */
688
782
  modelId?: string;
689
- /** ID of parent thumbnail-generation job for BullMQ dependency tracking. SHOULD be set to thumbnail-generation job ID to ensure thumbnails are ready before metadata generation (required for default vision analysis). If omitted, worker will check for thumbnail existence and wait/retry if ENABLE_VISION_METADATA_GENERATION=true. */
690
- parentJobId?: string;
783
+ /** Core model entity data */
784
+ model?: Record<string, string | number | boolean>;
785
+ /** Geometric and technical analysis results */
786
+ technicalMetadata?: Record<string, string | number | boolean>;
787
+ /** List of 360 degree thumbnail views (URLs or paths) */
788
+ thumbnails?: Array<Record<string, string | number | boolean>>;
691
789
  }
692
790
  /**
693
791
  * Handles model metamodel detection found with hierarchical relationships.
@@ -704,8 +802,10 @@ export interface ModelMetamodelDetectionRequestMessage {
704
802
  connectionId: string;
705
803
  /** The path to the folder that was processed. */
706
804
  folderPath: string;
707
- /** A list of files discovered in the folder. */
708
- discoveredFiles: Array<Record<string, string | number | boolean>>;
805
+ /** A list of files discovered in the folder. Worker should check this first, then manifestUrl. */
806
+ discoveredFiles?: Array<Record<string, string | number | boolean>>;
807
+ /** URL to a JSON file containing the list of discovered files (for large folders) */
808
+ manifestUrl?: string;
709
809
  /** A signature representing the state of the folder. */
710
810
  folderSignature: Record<string, string | number | boolean>;
711
811
  /** The timestamp when the folder was processed. */
@@ -744,10 +844,14 @@ export interface ModelSellabilityAnalysisCompletedMessage {
744
844
  * Analyzes a metamodel to determine sellability score, pricing recommendations, and optimal marketplace selection. Enhanced with Etsy-specific analysis including competitor pricing, category demand trends, and material suitability.
745
845
  */
746
846
  export interface ModelSellabilityAnalysisRequestMessage {
747
- /** UUID of the metamodel to analyze. Worker will fetch all model metadata, technical metadata, enriched metadata, and child models from PostgreSQL. */
847
+ /** UUID of the metamodel to analyze. */
748
848
  metamodelId?: string;
749
849
  /** UUID of the user who owns the metamodel */
750
850
  ownerId?: string;
851
+ /** Full metamodel data including technical metadata, enriched metadata, and child models. Injected by backend to avoid DB access. */
852
+ metamodelData?: Record<string, string | number | boolean>;
853
+ /** URL to a JSON manifest containing the metamodel data if it is too large for the message payload. */
854
+ manifestUrl?: string;
751
855
  /** Optional analysis configuration */
752
856
  analysisOptions?: Record<string, string | number | boolean>;
753
857
  }
@@ -909,6 +1013,8 @@ export interface ThumbnailGenerationCompletedMessage {
909
1013
  status?: string;
910
1014
  /** The path to the generated thumbnail. */
911
1015
  thumbnailPath?: string;
1016
+ /** Array of 360° thumbnail view paths (16 angles) for vision-based analysis. */
1017
+ thumbnail360Views?: Array<Record<string, string | number | boolean>>;
912
1018
  /** An error message if the thumbnail generation failed. */
913
1019
  errorMessage?: string;
914
1020
  /** The storage location of the model. */
@@ -928,7 +1034,7 @@ export interface ThumbnailGenerationRequestMessage {
928
1034
  minioPath?: string;
929
1035
  /** The type of preview to generate, e.g., 'default', 'static', 'glb'. */
930
1036
  previewType?: string;
931
- /** Generate 16 angle views for 360° preview (4 horizontal x 4 vertical angles). */
1037
+ /** Generate 16 angle views for 360° preview (4 horizontal x 4 vertical angles) for enhanced vision-based metadata analysis. */
932
1038
  generate360Views?: boolean;
933
1039
  /** ID of parent file-download job (for BullMQ dependency tracking). */
934
1040
  parentJobId?: string;
package/dist/types.js CHANGED
@@ -10,6 +10,8 @@ export const MessageTypes = {
10
10
  ETSY_PUBLISH_LISTING_REQUEST: 'etsy-publish-listing-request',
11
11
  FILE_DOWNLOAD_COMPLETED: 'file-download-completed',
12
12
  FILE_DOWNLOAD_REQUEST: 'file-download-request',
13
+ FILE_VECTORIZE_COMPLETED: 'file-vectorize-completed',
14
+ FILE_VECTORIZE_REQUEST: 'file-vectorize-request',
13
15
  MARKETPLACE_ANALYTICS_SYNC_COMPLETED: 'marketplace-analytics-sync-completed',
14
16
  MARKETPLACE_ANALYTICS_SYNC_REQUEST: 'marketplace-analytics-sync-request',
15
17
  MARKETPLACE_CONNECTION_SYNC_COMPLETED: 'marketplace-connection-sync-completed',
@@ -29,6 +31,9 @@ export const MessageTypes = {
29
31
  MODEL_DISCOVERY_SCAN_FOUND_EVENT: 'model-discovery-scan-found-event',
30
32
  MODEL_DISCOVERY_SCAN_PROGRESS_EVENT: 'model-discovery-scan-progress-event',
31
33
  MODEL_DISCOVERY_SCAN_REQUEST: 'model-discovery-scan-request',
34
+ MODEL_FINDER_INDEX_REQUEST: 'model-finder-index-request',
35
+ MODEL_FINDER_RESPONSE: 'model-finder-response',
36
+ MODEL_FINDER_SEARCH_REQUEST: 'model-finder-search-request',
32
37
  MODEL_METADATA_GENERATION_COMPLETED: 'model-metadata-generation-completed',
33
38
  MODEL_METADATA_GENERATION_REQUEST: 'model-metadata-generation-request',
34
39
  MODEL_METAMODEL_DETECTION_FOUND: 'model-metamodel-detection-found',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mesh-sync/worker-backend-client",
3
- "version": "4.0.6",
3
+ "version": "4.0.9",
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",