@mesh-sync/worker-backend-client 1.0.5 → 4.0.0-pr.51.20260312131431

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
@@ -100,6 +100,222 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
100
100
  ## Available Message Types
101
101
 
102
102
 
103
+ ### analytics-collection-request
104
+
105
+ **Description:** Request to trigger a manual market data collection job.
106
+ Used for ad-hoc scraping of specific queries on marketplaces.
107
+
108
+
109
+ **Method:** `client.analyticsCollectionRequest(data)`
110
+
111
+ **Payload Type:** `AnalyticsCollectionRequestMessage`
112
+
113
+ **Fields:**
114
+
115
+ - `marketplace` (string) [✗]: The marketplace to scrape (etsy, ebay, etc.)
116
+
117
+ - `query` (string) [✓]: The search query to use
118
+
119
+ - `options` (object) [✗]: Collection options (pages, filters, etc.)
120
+
121
+
122
+
123
+ ### backend-logging-event
124
+
125
+ **Description:** Centralized logging event for capturing all warn/error/failure logs from meshsync-backend.
126
+ This event is sent to ELK for centralized monitoring, alerting, and debugging.
127
+
128
+ Automatically emitted by the custom Pino logger interceptor when:
129
+ - logger.warn() is called
130
+ - logger.error() is called
131
+ - uncaught exceptions occur
132
+ - request failures happen (4xx, 5xx responses)
133
+
134
+ Used for:
135
+ - System health monitoring
136
+ - Error tracking and alerting
137
+ - Performance degradation detection
138
+ - Security incident tracking
139
+ - Compliance and audit trails
140
+
141
+
142
+ **Method:** `client.backendLoggingEvent(data)`
143
+
144
+ **Payload Type:** `BackendLoggingEventMessage`
145
+
146
+ **Fields:**
147
+
148
+ - `eventType` (string) [✓]: Type of logging event
149
+
150
+ - `timestamp` (string) [✓]: ISO 8601 timestamp when the log was generated
151
+
152
+ - `level` (string) [✓]: Log level severity
153
+
154
+ - `message` (string) [✓]: Human-readable log message
155
+
156
+ - `context` (string) [✓]: Logger context (typically the class/service name)
157
+
158
+ - `requestId` (string) [✗]: Unique request ID for correlation (X-Request-Id header)
159
+
160
+ - `userId` (string) [✗]: ID of the authenticated user (if available)
161
+
162
+ - `httpMethod` (string) [✗]: HTTP method of the request
163
+
164
+ - `httpUrl` (string) [✗]: Request URL path (without query params for privacy)
165
+
166
+ - `httpStatusCode` (integer) [✗]: HTTP response status code
167
+
168
+ - `errorType` (string) [✗]: Error class/type name
169
+
170
+ - `errorStack` (string) [✗]: Stack trace (sanitized, no sensitive data)
171
+
172
+ - `errorCode` (string) [✗]: Application-specific error code for categorization
173
+
174
+ - `metadata` (object) [✗]: Additional structured context (sanitized, no PII)
175
+
176
+ - `environment` (string) [✗]: Deployment environment
177
+
178
+ - `serviceVersion` (string) [✗]: Backend service version
179
+
180
+ - `hostname` (string) [✗]: Server hostname/pod name
181
+
182
+ - `durationMs` (number) [✗]: Operation duration in milliseconds (if applicable)
183
+
184
+
185
+
186
+ ### etsy-analytics-sync-completed
187
+
188
+ **Description:** Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
189
+
190
+
191
+ **Method:** `client.etsyAnalyticsSyncCompleted(data)`
192
+
193
+ **Payload Type:** `EtsyAnalyticsSyncCompletedMessage`
194
+
195
+ **Fields:**
196
+
197
+ - `originalJobId` (string) [✗]:
198
+
199
+ - `status` (string) [✗]:
200
+
201
+ - `syncedCount` (integer) [✗]: Number of listings successfully synced
202
+
203
+ - `errorCount` (integer) [✗]: Number of listings that failed
204
+
205
+ - `results` (array) [✗]: Analytics for each synced listing
206
+
207
+ - `credentialUpdate` (object) [✗]: New credentials if token was refreshed during operation
208
+
209
+ - `errors` (array) [✗]: Errors for failed listings
210
+
211
+ - `syncedAt` (string) [✗]:
212
+
213
+ - `nextScheduledSync` (string) [✗]: When next automatic sync should occur
214
+
215
+
216
+
217
+ ### etsy-analytics-sync-request
218
+
219
+ **Description:** Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
220
+ Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
221
+
222
+
223
+ **Method:** `client.etsyAnalyticsSyncRequest(data)`
224
+
225
+ **Payload Type:** `EtsyAnalyticsSyncRequestMessage`
226
+
227
+ **Fields:**
228
+
229
+ - `listingIds` (array) [✗]: Internal listing IDs to sync. Empty = sync all for user.
230
+
231
+ - `userId` (string) [✗]: User whose listings to sync (if listingIds empty)
232
+
233
+ - `shopId` (string) [✗]: Etsy shop ID for shop-level analytics
234
+
235
+ - `credentials` (object) [✗]: Etsy OAuth credentials
236
+
237
+ - `timeRange` (object) [✗]: Date range for historical analytics
238
+
239
+ - `syncOptions` (object) [✗]:
240
+
241
+ - `etsyCredentials` (object) [✗]: Encrypted Etsy OAuth credentials
242
+
243
+ - `webhookUrl` (string) [✗]:
244
+
245
+
246
+
247
+ ### etsy-publish-listing-completed
248
+
249
+ **Description:** Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
250
+
251
+
252
+ **Method:** `client.etsyPublishListingCompleted(data)`
253
+
254
+ **Payload Type:** `EtsyPublishListingCompletedMessage`
255
+
256
+ **Fields:**
257
+
258
+ - `originalJobId` (string) [✗]: BullMQ job ID from request
259
+
260
+ - `listingId` (string) [✗]: Internal marketplace_items ID
261
+
262
+ - `metamodelId` (string) [✗]: Metamodel that was published
263
+
264
+ - `materialName` (string) [✗]: Material variant name
265
+
266
+ - `status` (string) [✗]: Publication result
267
+
268
+ - `etsyListingId` (string) [✗]: External Etsy listing ID (only if status=SUCCESS)
269
+
270
+ - `etsyListingUrl` (string) [✗]: URL to view listing on Etsy (only if status=SUCCESS)
271
+
272
+ - `credentialUpdate` (object) [✗]: New credentials if token was refreshed during operation
273
+
274
+ - `etsyFileId` (string) [✗]: Etsy digital file ID (only if status=SUCCESS)
275
+
276
+ - `error` (object) [✗]: Error details (only if status=FAILED)
277
+
278
+ - `publishedAt` (string) [✗]: When the listing was created (only if status=SUCCESS)
279
+
280
+ - `processingDuration` (integer) [✗]: Processing time in milliseconds
281
+
282
+
283
+
284
+ ### etsy-publish-listing-request
285
+
286
+ **Description:** Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
287
+ This message is enqueued for EACH material variant when publishing a metamodel.
288
+ Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
289
+
290
+
291
+ **Method:** `client.etsyPublishListingRequest(data)`
292
+
293
+ **Payload Type:** `EtsyPublishListingRequestMessage`
294
+
295
+ **Fields:**
296
+
297
+ - `listingId` (string) [✗]: Internal marketplace_items table ID
298
+
299
+ - `metamodelId` (string) [✗]: Metamodel being published
300
+
301
+ - `ownerId` (string) [✗]: User ID who owns the metamodel
302
+
303
+ - `credentials` (object) [✗]: Etsy OAuth credentials
304
+
305
+ - `materialVariant` (object) [✗]: Material-specific listing configuration
306
+
307
+ - `baseListingData` (object) [✗]: Common listing information
308
+
309
+ - `publishOptions` (object) [✗]:
310
+
311
+ - `etsyCredentials` (object) [✗]: Encrypted Etsy OAuth credentials
312
+
313
+ - `fileMetadata` (object) [✗]: Digital file to upload
314
+
315
+ - `webhookUrl` (string) [✗]: Callback URL for completion notification
316
+
317
+
318
+
103
319
  ### file-download-completed
104
320
 
105
321
  **Description:** Notifies that a file download has been processed, indicating success or failure.
@@ -126,7 +342,15 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
126
342
 
127
343
  ### file-download-request
128
344
 
129
- **Description:** Handles file download requests.
345
+ **Description:** Downloads model file from storage provider to MinIO for processing pipeline.
346
+ Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
347
+
348
+ Retry Configuration:
349
+ - Automatic retry enabled for transient failures (connection errors, timeouts)
350
+ - Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
351
+ - Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
352
+ - No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
353
+
130
354
 
131
355
  **Method:** `client.fileDownloadRequest(data)`
132
356
 
@@ -136,426 +360,1823 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
136
360
 
137
361
  - `modelId` (string) [✗]: The unique identifier for the model to be downloaded.
138
362
 
363
+ - `ownerId` (string) [✗]: The identifier of the user who owns the model. Optional - if not provided, will be retrieved from StorageConnection.
364
+
139
365
  - `storageLocation` (object) [✗]: The storage location of the model.
140
366
 
367
+ - `metadata` (object) [✗]: Optional metadata from discovery. For Thingiverse, contains downloadUrl for direct file access.
141
368
 
369
+ - `credentials` (object) [✗]: Decrypted credentials required for this specific download operation. Injected by the backend.
142
370
 
143
- ### media-batch-download-completed
371
+ - `minioDestination` (object) [✗]: Destination in MinIO where file will be uploaded after download.
144
372
 
145
- **Description:** Notifies that a batch media download has been completed.
373
+ - `autoEnqueueChildren` (boolean) [✗]: Automatically enqueue thumbnail generation, technical metadata analysis, and metadata generation jobs after download completes.
146
374
 
147
- **Method:** `client.mediaBatchDownloadCompleted(data)`
375
+ - `previewType` (string) [✗]: Preview type for thumbnail generation (passed to child job).
148
376
 
149
- **Payload Type:** `MediaBatchDownloadCompletedMessage`
377
+ - `generate360Views` (boolean) [✗]: Generate 16 angle views for 360° preview (passed to child job).
378
+
379
+ - `webhookUrl` (string) [✗]: Optional webhook URL to call when download completes. If provided, worker will POST completion status to this endpoint.
380
+
381
+
382
+
383
+ ### file-vectorize-completed
384
+
385
+ **Description:** Result of the vectorization process containing the embedding vector.
386
+
387
+ **Method:** `client.fileVectorizeCompleted(data)`
388
+
389
+ **Payload Type:** `FileVectorizeCompletedMessage`
150
390
 
151
391
  **Fields:**
152
392
 
153
- - `batchId` (string) []: The unique identifier for the batch download operation.
393
+ - `fileId` (string) []:
154
394
 
155
- - `status` (string) []: The final status of the batch download operation.
395
+ - `vector` (array) []: The computed embedding vector
156
396
 
157
- - `processedFiles` (array) [✗]: List of successfully processed files.
397
+ - `modelName` (string) [✗]:
158
398
 
159
- - `failedFiles` (array) [✗]: List of files that failed to process.
399
+ - `dimension` (integer) [✗]: Length of the vector (e.g., 512)
160
400
 
161
- - `processedAt` (string) [✓]: Timestamp when the batch processing completed.
162
401
 
163
- - `statistics` (object) [✗]: Statistics about the batch processing.
164
402
 
403
+ ### file-vectorize-request
165
404
 
405
+ **Description:** Request to generate a vector embedding for an image file using CLIP.
166
406
 
167
- ### media-batch-download-request
407
+ **Method:** `client.fileVectorizeRequest(data)`
168
408
 
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.
409
+ **Payload Type:** `FileVectorizeRequestMessage`
170
410
 
411
+ **Fields:**
412
+
413
+ - `fileId` (string) [✗]: The ID of the file in the database
414
+
415
+ - `storageItem` () [✗]: Location of the image file
416
+
417
+ - `modelName` (string) [✗]: Optional: Specific model version to use
171
418
 
172
- **Method:** `client.mediaBatchDownloadRequest(data)`
173
419
 
174
- **Payload Type:** `MediaBatchDownloadRequestMessage`
420
+
421
+ ### ip-check-completed
422
+
423
+ **Description:** Contains IP verification results including trademark risk, copyright risk, detected brands/franchises, and analysis confidence scores
424
+
425
+ **Method:** `client.ipCheckCompleted(data)`
426
+
427
+ **Payload Type:** `IpCheckCompletedMessage`
175
428
 
176
429
  **Fields:**
177
430
 
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.
431
+ - `modelId` (string) [✗]: Model UUID that was analyzed
179
432
 
433
+ - `ownerId` (string) [✗]: Owner user ID
180
434
 
181
- - `storageConnectionId` (string) [✗]: UUID of the StorageConnection entity from which to download the media files. Used to authenticate and access the source storage provider.
435
+ - `entityType` (string) [✗]: Type of entity checked: 'model' or 'metamodel'
182
436
 
437
+ - `status` (string) [✗]: Overall IP check outcome: 'clear', 'flagged', or 'error'
183
438
 
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.
439
+ - `trademarkRisk` (string) [✗]: Detected trademark infringement risk level: 'none', 'low', 'medium', 'high'
185
440
 
441
+ - `copyrightRisk` (string) [✗]: Detected copyright infringement risk level: 'none', 'low', 'medium', 'high'
186
442
 
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.
443
+ - `matchedBrands` (array) [✗]: Brand names detected in model name or content
188
444
 
445
+ - `matchedFranchises` (array) [✗]: Franchise/character names detected
189
446
 
447
+ - `similarModelsCount` (integer) [✗]: Number of visually similar models found
190
448
 
449
+ - `confidence` (number) [✗]: Overall confidence score for the analysis (0.0-1.0)
191
450
 
192
- ### metamodel-metadata-generation-completed
451
+ - `riskScorePercent` (integer) [✗]: Risk score as 0-100 integer (FR-024: >70 HIGH, 40-70 MEDIUM, <40 LOW)
193
452
 
194
- **Description:** Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
453
+ - `riskLevel` (string) [✗]: Overall risk level: 'none', 'low', 'medium', 'high'
195
454
 
196
- **Method:** `client.metamodelMetadataGenerationCompleted(data)`
455
+ - `recommendation` (string) [✗]: Recommended action: 'block' (HIGH risk), 'warn' (MEDIUM risk), 'allow' (LOW/NONE risk)
197
456
 
198
- **Payload Type:** `MetamodelMetadataGenerationCompletedMessage`
457
+ - `suggestedChanges` (object) [✗]: Suggested modifications to reduce IP risk
458
+
459
+ - `heuristicResults` (object) [✗]: Detailed results from each heuristic check
460
+
461
+ - `error` (object) [✗]: Error details if status is 'error'
462
+
463
+ - `processingDurationMs` (integer) [✗]: Total processing time in milliseconds
464
+
465
+
466
+
467
+ ### ip-check-request
468
+
469
+ **Description:** Triggers intellectual property verification analysis for a model thumbnail, detecting potential trademark and copyright issues using perceptual hashing, text analysis, and optional reverse image search.
470
+
471
+ **Method:** `client.ipCheckRequest(data)`
472
+
473
+ **Payload Type:** `IpCheckRequestMessage`
474
+
475
+ **Fields:**
476
+
477
+ - `modelId` (string) [✗]: Unique identifier for the model to analyze
478
+
479
+ - `ownerId` (string) [✗]: User ID who owns the model
480
+
481
+ - `entityType` (string) [✗]: Type of entity being checked: 'model' or 'metamodel'
482
+
483
+ - `modelName` (string) [✗]: Name of the model for trademark/franchise text detection
484
+
485
+ - `tags` (array) [✗]: Model tags for IP reference detection
486
+
487
+ - `description` (string) [✗]: Model description for text-based IP analysis
488
+
489
+ - `thumbnailUrl` (string) [✗]: URL to fetch the thumbnail image for visual analysis
490
+
491
+ - `minioPath` (string) [✗]: Path to thumbnail in MinIO if stored internally
492
+
493
+ - `additionalImageUrls` (array) [✗]: Optional additional images for more comprehensive analysis (e.g., 360° views)
494
+
495
+ - `analysisOptions` (object) [✗]: Optional analysis configuration
496
+
497
+
498
+
499
+ ### marketplace-connection-sync-completed
500
+
501
+ **Description:** Notification that marketplace connection sync has completed. Contains updated connection metadata, profile information, and sync statistics.
502
+
503
+
504
+ **Method:** `client.marketplaceConnectionSyncCompleted(data)`
505
+
506
+ **Payload Type:** `MarketplaceConnectionSyncCompletedMessage`
507
+
508
+ **Fields:**
509
+
510
+ - `requestId` (string) [✗]: Original request ID for correlation
511
+
512
+ - `connectionId` (string) [✗]: Marketplace connection that was synced
513
+
514
+ - `marketplaceId` (string) [✗]: Marketplace provider ID
515
+
516
+ - `userId` (string) [✗]: Connection owner user ID
517
+
518
+ - `status` (string) [✗]: Overall sync result status
519
+
520
+ - `syncType` (string) [✗]: Type of sync that was performed
521
+
522
+ - `connectionData` (object) [✗]: Updated connection information
523
+
524
+ - `categories` (array) [✗]: Available marketplace categories
525
+
526
+ - `statistics` (object) [✗]: Sync operation statistics
527
+
528
+ - `completedAt` (string) [✗]: When sync completed
529
+
530
+ - `error` (object) [✗]: Error details if sync failed
531
+
532
+
533
+
534
+ ### marketplace-connection-sync-request
535
+
536
+ **Description:** Requests synchronization of marketplace connection data including: - Profile information and shop details - Account status and permissions - Available categories and shipping profiles - Rate limits and API quotas
537
+ This is typically triggered after initial connection or periodically to keep marketplace metadata up to date.
538
+
539
+
540
+ **Method:** `client.marketplaceConnectionSyncRequest(data)`
541
+
542
+ **Payload Type:** `MarketplaceConnectionSyncRequestMessage`
543
+
544
+ **Fields:**
545
+
546
+ - `connectionId` (string) [✗]: Internal marketplace connection ID
547
+
548
+ - `marketplaceId` (string) [✗]: Marketplace provider ID (etsy, ebay, etc.)
549
+
550
+ - `userId` (string) [✗]: User who owns this connection
551
+
552
+ - `syncType` (string) [✗]: Type of sync to perform
553
+
554
+ - `priority` (string) [✗]: Processing priority
555
+
556
+ - `requestId` (string) [✗]: Unique request identifier for tracking
557
+
558
+ - `webhookUrl` (string) [✗]: Webhook URL to call when sync completes
559
+
560
+ - `metadata` (object) [✗]: Additional context data
561
+
562
+
563
+
564
+ ### marketplace-credential-rotation-completed
565
+
566
+ **Description:** Notification that marketplace credential rotation has completed. Contains the rotation results, new credential metadata, and any issues encountered.
567
+
568
+
569
+ **Method:** `client.marketplaceCredentialRotationCompleted(data)`
570
+
571
+ **Payload Type:** `MarketplaceCredentialRotationCompletedMessage`
572
+
573
+ **Fields:**
574
+
575
+ - `requestId` (string) [✗]: Original rotation request ID
576
+
577
+ - `connectionId` (string) [✗]: Marketplace connection that was rotated
578
+
579
+ - `marketplaceId` (string) [✗]: Marketplace provider ID
580
+
581
+ - `userId` (string) [✗]: Connection owner user ID
582
+
583
+ - `status` (string) [✗]: Overall rotation operation status
584
+
585
+ - `rotationType` (string) [✗]: Type of rotation that was performed
586
+
587
+ - `reason` (string) [✗]: Original reason for rotation
588
+
589
+ - `newCredentials` (object) [✗]: Metadata about new credentials
590
+
591
+ - `oldCredentials` (object) [✗]: Status of previous credentials
592
+
593
+ - `operationDetails` (object) [✗]: Details of the rotation operation
594
+
595
+ - `connectionStatus` (object) [✗]: Connection status after credential rotation
596
+
597
+ - `nextRotation` (object) [✗]: Information about next scheduled rotation
598
+
599
+ - `error` (object) [✗]: Error details if rotation failed
600
+
601
+ - `notifications` (array) [✗]: Notifications sent as part of rotation
602
+
603
+
604
+
605
+ ### marketplace-credential-rotation-request
606
+
607
+ **Description:** Requests rotation/refresh of marketplace connection credentials. This is used for: - OAuth token refresh when tokens are near expiry - API key rotation for enhanced security - Re-authentication after connection errors - Scheduled credential updates
608
+
609
+
610
+ **Method:** `client.marketplaceCredentialRotationRequest(data)`
611
+
612
+ **Payload Type:** `MarketplaceCredentialRotationRequestMessage`
199
613
 
200
614
  **Fields:**
201
615
 
202
- - `metamodelId` (string) []: The unique identifier for the metamodel
616
+ - `connectionId` (string) []: Marketplace connection ID requiring credential rotation
617
+
618
+ - `marketplaceId` (string) [✗]: Marketplace provider ID (etsy, ebay, etc.)
619
+
620
+ - `userId` (string) [✗]: User who owns the connection
621
+
622
+ - `rotationType` (string) [✗]: Type of credential rotation to perform
623
+
624
+ - `reason` (string) [✗]: Reason for credential rotation
625
+
626
+ - `urgency` (string) [✗]: How urgently the rotation is needed
627
+
628
+ - `currentCredentials` (object) [✗]: Current credential metadata (no actual secrets)
629
+
630
+ - `options` (object) [✗]: Rotation configuration options
631
+
632
+ - `requestId` (string) [✗]: Unique request identifier
633
+
634
+ - `webhookUrl` (string) [✗]: Webhook URL for completion notification
635
+
636
+ - `scheduledAt` (string) [✗]: When this rotation was scheduled (if scheduled)
637
+
638
+ - `metadata` (object) [✗]: Additional request context
639
+
640
+
641
+
642
+ ### marketplace-intelligence-completed
643
+
644
+ **Description:** Response from marketplace intelligence scraping.
645
+ Contains aggregated similarity data from marketplace searches.
646
+
647
+ Consumed by worker-backend to update pipeline context before
648
+ sellability analysis runs.
649
+
650
+
651
+ **Method:** `client.marketplaceIntelligenceCompleted(data)`
652
+
653
+ **Payload Type:** `MarketplaceIntelligenceCompletedMessage`
654
+
655
+ **Fields:**
656
+
657
+ - `modelId` (string) [✓]: UUID of the model that was researched
658
+
659
+ - `ownerId` (string) [✓]: UUID of the model owner
660
+
661
+ - `status` (string) [✓]: Result status
662
+
663
+ - `marketData` (object) [✗]: Aggregated market intelligence across all scraped marketplaces
664
+
665
+ - `marketplaceBreakdown` (array) [✗]: Results per marketplace
666
+
667
+ - `similarityScore` (number) [✗]: How saturated the market is for this model type (0=unique, 100=very common)
668
+
669
+ - `error` (object) [✗]: Error information if status is FAILED
670
+
671
+ - `analyzedAt` (string) [✗]: When the analysis completed
672
+
673
+ - `analysisVersion` (string) [✗]: Version of the intelligence collector
674
+
675
+
676
+
677
+ ### marketplace-intelligence-event
678
+
679
+ **Description:** Public marketplace intelligence data scraped from external marketplaces.
680
+
681
+ This event contains:
682
+ - Listing details (title, price, images)
683
+ - Engagement metrics (views, favorites, reviews)
684
+ - Shop information
685
+ - Market positioning data
686
+
687
+ Unlike marketplace-listing-sync-request (private user data), this focuses on:
688
+ - Broad market trends and pricing analysis
689
+ - Competitive intelligence and demand signals
690
+ - Product popularity and sentiment
691
+
692
+ Consumed by worker-analytic-collector for Elasticsearch indexing.
693
+ Used for market research, pricing optimization, and trend detection.
694
+
695
+
696
+ **Method:** `client.marketplaceIntelligenceEvent(data)`
697
+
698
+ **Payload Type:** `MarketplaceIntelligenceEventMessage`
699
+
700
+ **Fields:**
701
+
702
+ - `marketplace` (string) [✓]: Source marketplace
703
+
704
+ - `externalId` (string) [✓]: Marketplace-native listing ID
705
+
706
+ - `listing` (object) [✓]: Core listing information
707
+
708
+ - `metrics` (object) [✗]: Public engagement and sales metrics
709
+
710
+ - `metadata` (object) [✗]: Additional listing context and categorization
711
+
712
+ - `queryContext` (object) [✗]: Search context that found this listing
713
+
714
+ - `collectedAt` (string) [✓]: ISO 8601 timestamp when data was scraped
715
+
716
+ - `collectorVersion` (string) [✗]: Version of collector that scraped this data
717
+
718
+ - `scrapingMethod` (string) [✗]: Method used for scraping
719
+
720
+
721
+
722
+ ### marketplace-intelligence-request
723
+
724
+ **Description:** Triggers automated marketplace scraping to find similar/competing listings
725
+ for a given model. This is a pipeline stage that runs after metadata generation
726
+ to inform sellability analysis with real market data.
727
+
728
+ The worker-analytic-collector (or marketplace-connectors worker) will:
729
+ 1. Use model metadata (title, tags, category) to build search queries
730
+ 2. Scrape connected marketplaces (Etsy, eBay, etc.) for similar listings
731
+ 3. Emit marketplace-intelligence-event results for Elasticsearch indexing
732
+ 4. Return aggregated similarity data to the pipeline context
733
+
734
+ Pipeline integration:
735
+ - Triggered after: metadata-generation (needs model title/tags/category)
736
+ - Results feed into: sellability-analysis (market positioning data)
737
+
738
+
739
+ **Method:** `client.marketplaceIntelligenceRequest(data)`
740
+
741
+ **Payload Type:** `MarketplaceIntelligenceRequestMessage`
742
+
743
+ **Fields:**
744
+
745
+ - `modelId` (string) [✓]: UUID of the model to research
746
+
747
+ - `ownerId` (string) [✓]: UUID of the model owner
748
+
749
+ - `searchContext` (object) [✗]: Model metadata used to build marketplace search queries
750
+
751
+ - `scrapingOptions` (object) [✗]: Configuration for the marketplace scraping
752
+
753
+ - `pipelineId` (string) [✗]: Pipeline execution ID for correlation
754
+
755
+ - `executionId` (string) [✗]: Pipeline execution UUID for correlation
756
+
757
+
758
+
759
+ ### marketplace-listing-description-generation-completed
760
+
761
+ **Description:** Notifies backend that marketplace description generation completed. Contains generated description with metadata tracking (AI model, confidence, generation timestamp) and suggested price.
762
+
763
+ **Method:** `client.marketplaceListingDescriptionGenerationCompleted(data)`
764
+
765
+ **Payload Type:** `MarketplaceListingDescriptionGenerationCompletedMessage`
766
+
767
+ **Fields:**
768
+
769
+ - `modelId` (string) [✓]: UUID of the model that was processed
770
+
771
+ - `entityType` (string) [✓]: Type of entity processed
772
+
773
+ - `targetMarketplace` (string) [✗]: Target marketplace ID (e.g., 'etsy', 'ebay')
774
+
775
+ - `description` (string) [✓]: SEO-optimized marketplace description (3-5 sentences)
776
+
777
+ - `metadata` (object) [✓]: Content generation metadata for tracking
778
+
779
+ - `suggestedPrice` (object) [✗]: Volume-based price calculation for 3D printed item
780
+
781
+ - `error` (string) [✗]: Error message if generation failed
782
+
783
+
784
+
785
+ ### marketplace-listing-description-generation-request
786
+
787
+ **Description:** Generates SEO-optimized marketplace description for a 3D model using LLM vision analysis. Worker receives model data, technical metadata, and thumbnail URLs to generate compelling product descriptions tailored to the target marketplace.
788
+
789
+ **Method:** `client.marketplaceListingDescriptionGenerationRequest(data)`
790
+
791
+ **Payload Type:** `MarketplaceListingDescriptionGenerationRequestMessage`
792
+
793
+ **Fields:**
794
+
795
+ - `modelId` (string) [✓]: UUID of the model (reference only)
796
+
797
+ - `entityType` (string) [✓]: Type of entity being processed
798
+
799
+ - `entityName` (string) [✓]: Name/title of the model or metamodel
800
+
801
+ - `targetMarketplace` (string) [✓]: Target marketplace ID (e.g., 'etsy', 'ebay', 'thingiverse')
802
+
803
+ - `userId` (string) [✓]: UUID of the user requesting generation
804
+
805
+ - `webhookUrl` (string) [✗]: Callback URL for completion notification
806
+
807
+ - `technicalMetadata` (object) [✗]: Technical analysis data for context
808
+
809
+ - `thumbnailUrls` (array) [✗]: URLs to 360-degree thumbnail views
810
+
811
+ - `existingTags` (array) [✗]: Currently assigned tags for context
812
+
813
+ - `existingCategory` (string) [✗]: Current classification for context
814
+
815
+ - `brandVoice` (string) [✗]: Desired tone/voice for the listing (e.g., 'professional', 'playful')
816
+
817
+ - `targetMarket` (string) [✗]: Target geographic market (e.g., 'US', 'EU')
818
+
819
+ - `keywords` (array) [✗]: Specific keywords to include
820
+
821
+
822
+
823
+ ### marketplace-listing-sync-completed
824
+
825
+ **Description:** Notification that marketplace listing sync operation has completed. Contains detailed results of the sync including created/updated listings, errors encountered, and performance statistics.
826
+
827
+
828
+ **Method:** `client.marketplaceListingSyncCompleted(data)`
829
+
830
+ **Payload Type:** `MarketplaceListingSyncCompletedMessage`
831
+
832
+ **Fields:**
833
+
834
+ - `requestId` (string) [✗]: Original request ID for correlation
835
+
836
+ - `connectionId` (string) [✗]: Marketplace connection that was synced
837
+
838
+ - `marketplaceId` (string) [✗]: Marketplace provider ID
839
+
840
+ - `userId` (string) [✗]: Connection owner user ID
841
+
842
+ - `status` (string) [✗]: Overall sync operation status
843
+
844
+ - `syncDirection` (string) [✗]: Direction of sync that was performed
845
+
846
+ - `statistics` (object) [✗]: Detailed sync operation statistics
847
+
848
+ - `results` (object) [✗]: Detailed sync results by operation
849
+
850
+ - `successfulListings` (array) [✗]: Details of successfully processed listings
851
+
852
+ - `failedListings` (array) [✗]: Details of listings that failed to sync
853
+
854
+ - `errors` (array) [✗]: Non-listing-specific errors encountered
855
+
856
+ - `completedAt` (string) [✗]: When sync operation completed
857
+
858
+ - `nextSyncRecommendedAt` (string) [✗]: When next sync is recommended
859
+
860
+
861
+
862
+ ### marketplace-listing-sync-request
863
+
864
+ **Description:** Requests synchronization of marketplace listings for a connection. Can sync specific listings or all listings for a marketplace connection.
865
+ Includes bidirectional sync: - Pull: Fetch listings from marketplace to update local database - Push: Update marketplace listings with local changes - Full: Both pull and push operations
866
+
867
+
868
+ **Method:** `client.marketplaceListingSyncRequest(data)`
869
+
870
+ **Payload Type:** `MarketplaceListingSyncRequestMessage`
871
+
872
+ **Fields:**
873
+
874
+ - `connectionId` (string) [✗]: Marketplace connection ID
875
+
876
+ - `marketplaceId` (string) [✗]: Marketplace provider ID (etsy, ebay, etc.)
877
+
878
+ - `userId` (string) [✗]: User who owns the connection
879
+
880
+ - `syncDirection` (string) [✗]: Direction of sync operation
881
+
882
+ - `syncScope` (string) [✗]: Scope of listings to sync
883
+
884
+ - `listingIds` (array) [✗]: Specific listing IDs to sync (if syncScope=specific)
885
+
886
+ - `externalListingIds` (array) [✗]: External marketplace listing IDs to sync
887
+
888
+ - `options` (object) [✗]: Sync configuration options
889
+
890
+ - `priority` (string) [✗]: Processing priority
891
+
892
+ - `requestId` (string) [✗]: Unique request identifier
893
+
894
+ - `webhookUrl` (string) [✗]: Webhook URL for completion notification
895
+
896
+ - `metadata` (object) [✗]: Additional request context
897
+
898
+
899
+
900
+ ### marketplace-listing-tags-generation-completed
901
+
902
+ **Description:** Notifies backend that marketplace tags generation completed. Contains generated tags optimized for discoverability with metadata tracking.
903
+
904
+ **Method:** `client.marketplaceListingTagsGenerationCompleted(data)`
905
+
906
+ **Payload Type:** `MarketplaceListingTagsGenerationCompletedMessage`
907
+
908
+ **Fields:**
909
+
910
+ - `modelId` (string) [✓]: UUID of the model that was processed
911
+
912
+ - `entityType` (string) [✓]: Type of entity processed
913
+
914
+ - `tags` (array) [✓]: Generated searchability tags (style, technical, usage keywords)
915
+
916
+ - `metadata` (object) [✓]: Content generation metadata for tracking
917
+
918
+ - `error` (string) [✗]: Error message if generation failed
919
+
920
+
921
+
922
+ ### marketplace-listing-tags-generation-request
923
+
924
+ **Description:** Generates searchability tags for a 3D model optimized for marketplace discoverability. Worker creates style, technical, and usage keywords following marketplace tag limits and SEO best practices.
925
+
926
+ **Method:** `client.marketplaceListingTagsGenerationRequest(data)`
927
+
928
+ **Payload Type:** `MarketplaceListingTagsGenerationRequestMessage`
929
+
930
+ **Fields:**
931
+
932
+ - `modelId` (string) [✓]: UUID of the model (reference only)
933
+
934
+ - `entityType` (string) [✓]: Type of entity being processed
935
+
936
+ - `entityName` (string) [✓]: Name/title of the model or metamodel
937
+
938
+ - `targetMarketplace` (string) [✓]: Target marketplace ID (e.g., 'etsy', 'ebay', 'thingiverse')
939
+
940
+ - `userId` (string) [✓]: UUID of the user requesting generation
941
+
942
+ - `webhookUrl` (string) [✗]: Callback URL for completion notification
943
+
944
+ - `technicalMetadata` (object) [✗]: Technical analysis data for tag generation
945
+
946
+ - `thumbnailUrls` (array) [✗]: URLs to 360-degree thumbnail views for visual analysis
947
+
948
+ - `existingTags` (array) [✗]: Currently assigned tags to supplement or replace
949
+
950
+ - `existingCategory` (string) [✗]: Current classification for category-based tags
951
+
952
+ - `tagLimit` (number) [✗]: Maximum number of tags for marketplace (e.g., 13 for Etsy)
953
+
954
+ - `targetMarket` (string) [✗]: Target geographic market (e.g., 'US', 'EU')
955
+
956
+ - `style` (string) [✗]: Artistic style of the model (e.g., 'realistic', 'low-poly')
957
+
958
+ - `useCases` (array) [✗]: Intended uses for the model
959
+
960
+
961
+
962
+ ### marketplace-listing-title-generation-completed
963
+
964
+ **Description:** Notifies backend that marketplace title generation completed. Contains generated title with metadata tracking.
965
+
966
+ **Method:** `client.marketplaceListingTitleGenerationCompleted(data)`
967
+
968
+ **Payload Type:** `MarketplaceListingTitleGenerationCompletedMessage`
969
+
970
+ **Fields:**
971
+
972
+ - `modelId` (string) [✓]: UUID of the model that was processed
973
+
974
+ - `entityType` (string) [✓]: Type of entity processed
975
+
976
+ - `title` (string) [✓]: Marketplace-optimized title
977
+
978
+ - `metadata` (object) [✓]: Content generation metadata for tracking
979
+
980
+ - `error` (string) [✗]: Error message if generation failed
981
+
982
+
983
+
984
+ ### marketplace-listing-title-generation-request
985
+
986
+ **Description:** Generates marketplace-optimized title for a 3D model. Worker creates concise, SEO-friendly titles following marketplace character limits and best practices.
987
+
988
+ **Method:** `client.marketplaceListingTitleGenerationRequest(data)`
989
+
990
+ **Payload Type:** `MarketplaceListingTitleGenerationRequestMessage`
991
+
992
+ **Fields:**
993
+
994
+ - `modelId` (string) [✓]: UUID of the model (reference only)
995
+
996
+ - `entityType` (string) [✓]: Type of entity being processed
997
+
998
+ - `currentName` (string) [✓]: Current model/metamodel name
999
+
1000
+ - `targetMarketplace` (string) [✓]: Target marketplace ID (e.g., 'etsy', 'ebay', 'thingiverse')
1001
+
1002
+ - `userId` (string) [✓]: UUID of the user requesting generation
1003
+
1004
+ - `webhookUrl` (string) [✗]: Callback URL for completion notification
1005
+
1006
+ - `technicalMetadata` (object) [✗]: Technical analysis data for context
1007
+
1008
+ - `existingTags` (array) [✗]: Currently assigned tags for SEO keywords
1009
+
1010
+ - `existingCategory` (string) [✗]: Current classification for categorization
1011
+
1012
+ - `characterLimit` (number) [✗]: Maximum character count for marketplace (e.g., 140 for Etsy)
1013
+
1014
+ - `brandVoice` (string) [✗]: Desired tone/voice for the listing (e.g., 'professional', 'playful')
1015
+
1016
+ - `targetMarket` (string) [✗]: Target geographic market (e.g., 'US', 'EU')
1017
+
1018
+ - `keywords` (array) [✗]: Specific keywords to include
1019
+
1020
+
1021
+
1022
+ ### marketplace-listing-update-completed
1023
+
1024
+ **Description:** Result of a listing update operation
1025
+
1026
+ **Method:** `client.marketplaceListingUpdateCompleted(data)`
1027
+
1028
+ **Payload Type:** `MarketplaceListingUpdateCompletedMessage`
1029
+
1030
+ **Fields:**
1031
+
1032
+ - `marketplace` (string) [✗]: Target marketplace
1033
+
1034
+ - `listingId` (string) [✗]: External ID of the listing
1035
+
1036
+ - `status` (string) [✗]: Status of the update (success, failed)
1037
+
1038
+ - `result` (object) [✗]: Result details from the marketplace API
1039
+
1040
+ - `error` (string) [✗]: Error message if failed
1041
+
1042
+
1043
+
1044
+ ### marketplace-listing-update-request
1045
+
1046
+ **Description:** Request to update an existing listing on a marketplace (price, quantity, etc.)
1047
+
1048
+ **Method:** `client.marketplaceListingUpdateRequest(data)`
1049
+
1050
+ **Payload Type:** `MarketplaceListingUpdateRequestMessage`
1051
+
1052
+ **Fields:**
1053
+
1054
+ - `marketplace` (string) [✗]: Target marketplace (etsy, ebay, etc.)
1055
+
1056
+ - `listingId` (string) [✗]: External ID of the listing to update
1057
+
1058
+ - `updates` (object) [✗]: Fields to update
1059
+
1060
+ - `credentials` (object) [✗]: User credentials for the marketplace
1061
+
1062
+
1063
+
1064
+ ### media-batch-download-completed
1065
+
1066
+ **Description:** Notifies that a batch media download has been completed.
1067
+
1068
+ **Method:** `client.mediaBatchDownloadCompleted(data)`
1069
+
1070
+ **Payload Type:** `MediaBatchDownloadCompletedMessage`
1071
+
1072
+ **Fields:**
1073
+
1074
+ - `batchId` (string) [✓]: The unique identifier for the batch download operation.
1075
+
1076
+ - `status` (string) [✓]: The final status of the batch download operation.
1077
+
1078
+ - `processedFiles` (array) [✗]: List of successfully processed files.
1079
+
1080
+ - `failedFiles` (array) [✗]: List of files that failed to process.
1081
+
1082
+ - `processedAt` (string) [✓]: Timestamp when the batch processing completed.
1083
+
1084
+ - `statistics` (object) [✗]: Statistics about the batch processing.
1085
+
1086
+
1087
+
1088
+ ### media-batch-download-request
1089
+
1090
+ **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.
1091
+
1092
+
1093
+ **Method:** `client.mediaBatchDownloadRequest(data)`
1094
+
1095
+ **Payload Type:** `MediaBatchDownloadRequestMessage`
1096
+
1097
+ **Fields:**
1098
+
1099
+ - `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.
1100
+
1101
+
1102
+ - `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.)
1103
+
1104
+
1105
+ - `entityType` (string) [✗]: Type of entity these media files belong to. Used for linking downloaded media to the correct entity in the database.
1106
+
1107
+
1108
+ - `entityId` (string) [✗]: UUID of the model or metamodel entity that owns these media files. Used for creating storage item associations after download.
1109
+
1110
+
1111
+ - `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.
1112
+
1113
+
1114
+ - `credentials` (object) [✗]: Decrypted credentials for the storage provider (Fat Payload pattern). Required when downloadStrategy is 'storage_provider'.
1115
+
1116
+
1117
+ - `mediaFiles` (array) [✗]: Array of media files to download and process. Must contain at least one file. Each file includes metadata for identification and processing.
1118
+
1119
+
1120
+ - `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.
1121
+
1122
+
1123
+
1124
+
1125
+ ### metamodel-metadata-generation-completed
1126
+
1127
+ **Description:** Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
1128
+
1129
+ **Method:** `client.metamodelMetadataGenerationCompleted(data)`
1130
+
1131
+ **Payload Type:** `MetamodelMetadataGenerationCompletedMessage`
1132
+
1133
+ **Fields:**
1134
+
1135
+ - `metamodelId` (string) [✓]: The unique identifier for the metamodel
1136
+
1137
+ - `metadata` (object) [✓]: AI-generated metadata for the metamodel
1138
+
1139
+ - `technicalMetadata` (object) [✓]: Aggregated technical analysis from constituent models
1140
+
1141
+
1142
+
1143
+ ### metamodel-metadata-generation-request
1144
+
1145
+ **Description:** Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
1146
+
1147
+ **Method:** `client.metamodelMetadataGenerationRequest(data)`
1148
+
1149
+ **Payload Type:** `MetamodelMetadataGenerationRequestMessage`
1150
+
1151
+ **Fields:**
1152
+
1153
+ - `metamodelId` (string) [✗]: The unique identifier for the metamodel
1154
+
1155
+ - `constituentModelIds` (array) [✗]: Array of model IDs that compose this metamodel
1156
+
1157
+ - `name` (string) [✗]: The name of the metamodel
1158
+
1159
+ - `ownerId` (string) [✗]: The owner's user ID
1160
+
1161
+ - `libraryId` (string) [✗]: The library containing this metamodel
1162
+
1163
+ - `constituentModels` (array) [✗]: Enriched metadata for constituent models (includes storage items)
1164
+
1165
+ - `webhookUrl` (string) [✗]: Optional webhook URL for async completion notification
1166
+
1167
+
1168
+
1169
+ ### model-analytics-collection-request
1170
+
1171
+ **Description:** Request to collect marketplace analytics for a specific metamodel.
1172
+ Triggered by backend scheduler every 6 hours for popular/tagged metamodels.
1173
+
1174
+ Worker performs targeted market searches based on metamodel metadata
1175
+ and stores aggregated statistics in Elasticsearch for trend analysis.
1176
+
1177
+
1178
+ **Method:** `client.modelAnalyticsCollectionRequest(data)`
1179
+
1180
+ **Payload Type:** `ModelAnalyticsCollectionRequestMessage`
1181
+
1182
+ **Fields:**
1183
+
1184
+ - `metamodelId` (string) [✓]: The metamodel ID to collect analytics for
1185
+
1186
+ - `ownerId` (string) [✓]: Owner user ID for audit trail
1187
+
1188
+ - `primaryCategory` (string) [✗]: Primary classification category (e.g., "miniature", "terrain")
1189
+
1190
+ - `subCategory` (string) [✗]: Sub-category for more specific targeting
1191
+
1192
+ - `tags` (array) [✗]: Relevant tags from metamodel metadata (max 10)
1193
+
1194
+ - `franchise` (string) [✗]: Franchise name if detected (e.g., "Dungeons & Dragons")
1195
+
1196
+ - `confidence` (number) [✗]: Classification confidence score
1197
+
1198
+ - `priority` (string) [✗]: Collection priority level
1199
+
1200
+ - `triggeredBy` (string) [✗]: Source of trigger (e.g., "backend-scheduler", "manual")
1201
+
1202
+ - `triggeredAt` (string) [✗]: Timestamp when collection was triggered
1203
+
1204
+
1205
+
1206
+ ### model-discovery-folder-processed-event
1207
+
1208
+ **Description:** Handles model discovery folder processed events.
1209
+
1210
+ **Method:** `client.modelDiscoveryFolderProcessedEvent(data)`
1211
+
1212
+ **Payload Type:** `ModelDiscoveryFolderProcessedEventMessage`
1213
+
1214
+ **Fields:**
1215
+
1216
+ - `connectionId` (string) [✗]: The unique identifier for the connection.
1217
+
1218
+ - `folderPath` (string) [✗]: The path to the processed folder.
1219
+
1220
+ - `discoveredFiles` (array) [✗]: A list of files discovered in the folder.
1221
+
1222
+ - `folderSignature` (object) [✗]: A signature representing the state of the folder.
1223
+
1224
+ - `processedAt` (string) [✗]: The timestamp when the folder was processed.
1225
+
1226
+ - `statistics` (object) [✗]: Statistics about the processed folder.
1227
+
1228
+
1229
+
1230
+ ### model-discovery-scan-found-event
1231
+
1232
+ **Description:** Handles model discovery scan found events.
1233
+
1234
+ **Method:** `client.modelDiscoveryScanFoundEvent(data)`
1235
+
1236
+ **Payload Type:** `ModelDiscoveryScanFoundEventMessage`
1237
+
1238
+ **Fields:**
1239
+
1240
+ - `modelId` (string) [✗]: The unique identifier for the model.
1241
+
1242
+ - `name` (string) [✗]: The name of the model.
1243
+
1244
+ - `fileName` (string) [✗]: The name of the model file.
1245
+
1246
+ - `description` (string) [✗]: A description of the model.
1247
+
1248
+ - `fileTypes` (array) [✗]: An array of file types associated with the model.
1249
+
1250
+ - `size` (number) [✗]: The size of the model file in bytes.
1251
+
1252
+ - `storageLocation` (object) [✗]: The storage location of the model.
1253
+
1254
+ - `providerType` (string) [✗]: The type of the storage provider.
1255
+
1256
+ - `metadata` (object) [✗]: A flexible object for additional metadata.
1257
+
1258
+
1259
+
1260
+ ### model-discovery-scan-progress-event
1261
+
1262
+ **Description:** Handles model discovery scan progress events.
1263
+
1264
+ **Method:** `client.modelDiscoveryScanProgressEvent(data)`
1265
+
1266
+ **Payload Type:** `ModelDiscoveryScanProgressEventMessage`
1267
+
1268
+ **Fields:**
1269
+
1270
+ - `payload` (object) [✗]: Contains the discovery scan progress details.
1271
+
1272
+
1273
+
1274
+ ### model-discovery-scan-request
1275
+
1276
+ **Description:** Handles model discovery scan requests events.
1277
+
1278
+ **Method:** `client.modelDiscoveryScanRequest(data)`
1279
+
1280
+ **Payload Type:** `ModelDiscoveryScanRequestMessage`
1281
+
1282
+ **Fields:**
1283
+
1284
+ - `libraryId` (string) [✗]: The ID of the library to scan.
1285
+
1286
+ - `storageConnectionId` (string) [✗]: The ID of the storage connection to scan.
1287
+
1288
+ - `providerType` (string) [✗]: The type of the storage provider.
1289
+
1290
+ - `path` (string) [✗]: The specific path within the storage connection to scan for this library.
1291
+
1292
+ - `credentials` (object) [✗]: Decrypted credentials for the storage provider.
1293
+
1294
+ - `configuration` (object) [✗]: Configuration for the storage connection (e.g. scanRootPath).
1295
+
1296
+
1297
+
1298
+ ### model-finder-index-request
1299
+
1300
+ **Description:** DEPRECATED (2026-02-18) — FR-023 retired. Merge 3D rendering into worker-file-vectorize.
1301
+
1302
+ **Method:** `client.modelFinderIndexRequest(data)`
1303
+
1304
+ **Payload Type:** `ModelFinderIndexRequestMessage`
1305
+
1306
+ **Fields:**
1307
+
1308
+ - `modelId` (string) [✗]:
1309
+
1310
+ - `storageItem` () [✗]:
1311
+
1312
+
1313
+
1314
+ ### model-finder-response
1315
+
1316
+ **Description:** DEPRECATED (2026-02-18) — FR-023 retired. Merge 3D rendering into worker-file-vectorize.
1317
+
1318
+ **Method:** `client.modelFinderResponse(data)`
1319
+
1320
+ **Payload Type:** `ModelFinderResponseMessage`
1321
+
1322
+ **Fields:**
1323
+
1324
+ - `requestId` (string) [✗]:
1325
+
1326
+ - `results` (array) [✗]:
1327
+
1328
+
1329
+
1330
+ ### model-finder-search-request
1331
+
1332
+ **Description:** DEPRECATED (2026-02-18) — FR-023 retired. Merge 3D rendering into worker-file-vectorize.
1333
+
1334
+ **Method:** `client.modelFinderSearchRequest(data)`
1335
+
1336
+ **Payload Type:** `ModelFinderSearchRequestMessage`
1337
+
1338
+ **Fields:**
1339
+
1340
+ - `referenceModelId` (string) [✗]: Optional: Search using an existing model as reference
1341
+
1342
+ - `referenceImageId` (string) [✗]: Optional: Search using an uploaded image
1343
+
1344
+ - `limit` (integer) [✗]:
1345
+
1346
+
1347
+
1348
+ ### model-metadata-generation-completed
1349
+
1350
+ **Description:** Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
1351
+
1352
+ **Method:** `client.modelMetadataGenerationCompleted(data)`
1353
+
1354
+ **Payload Type:** `ModelMetadataGenerationCompletedMessage`
1355
+
1356
+ **Fields:**
1357
+
1358
+ - `modelId` (string) [✓]: UUID of the model that was processed.
1359
+
1360
+ - `metadata` (object) [✓]: Enriched marketplace metadata generated by LLM.
1361
+
1362
+
1363
+
1364
+ ### model-metadata-generation-request
1365
+
1366
+ **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.
1367
+
1368
+ **Method:** `client.modelMetadataGenerationRequest(data)`
1369
+
1370
+ **Payload Type:** `ModelMetadataGenerationRequestMessage`
1371
+
1372
+ **Fields:**
1373
+
1374
+ - `modelId` (string) [✗]: UUID of the model (reference only)
1375
+
1376
+ - `model` (object) [✗]: Core model entity data
1377
+
1378
+ - `technicalMetadata` (object) [✗]: Geometric and technical analysis results
1379
+
1380
+ - `thumbnails` (array) [✗]: List of 360 degree thumbnail views (URLs or paths)
1381
+
1382
+
1383
+
1384
+ ### model-metamodel-detection-found
1385
+
1386
+ **Description:** Handles model metamodel detection found with hierarchical relationships.
1387
+
1388
+ **Method:** `client.modelMetamodelDetectionFound(data)`
1389
+
1390
+ **Payload Type:** `ModelMetamodelDetectionFoundMessage`
1391
+
1392
+ **Fields:**
1393
+
1394
+ - `metamodels` (array) [✓]: List of metamodel nodes in hierarchical structure (roots and children).
1395
+
1396
+ - `ekgEdges` (array) [✗]: EKG edges derived from Louvain clustering (OPTIONAL - new field)
1397
+
1398
+
1399
+
1400
+ ### model-metamodel-detection-request
1401
+
1402
+ **Description:** Handles model metamodel detection requests.
1403
+
1404
+ **Method:** `client.modelMetamodelDetectionRequest(data)`
1405
+
1406
+ **Payload Type:** `ModelMetamodelDetectionRequestMessage`
1407
+
1408
+ **Fields:**
1409
+
1410
+ - `connectionId` (string) [✓]: The unique identifier for the storage connection.
1411
+
1412
+ - `folderPath` (string) [✓]: The path to the folder that was processed.
1413
+
1414
+ - `discoveredFiles` (array) [✗]: A list of files discovered in the folder. Worker should check this first, then manifestUrl.
1415
+
1416
+ - `manifestUrl` (string) [✗]: URL to a JSON file containing the list of discovered files (for large folders)
1417
+
1418
+ - `folderSignature` (object) [✓]: A signature representing the state of the folder.
1419
+
1420
+ - `processedAt` (string) [✓]: The timestamp when the folder was processed.
1421
+
1422
+ - `statistics` (object) [✓]: Statistics about the processed folder.
1423
+
1424
+
1425
+
1426
+ ### model-print-analysis-completed
1427
+
1428
+ **Description:** Reports completion of 3D print analysis — contains estimation, printability, and cost breakdown per FR-022
1429
+
1430
+ **Method:** `client.modelPrintAnalysisCompleted(data)`
1431
+
1432
+ **Payload Type:** `ModelPrintAnalysisCompletedMessage`
1433
+
1434
+ **Fields:**
1435
+
1436
+ - `originalJobId` (string) [✗]: ID of the original analysis request job
1437
+
1438
+ - `modelId` (string) [✗]: UUID of the analysed model
1439
+
1440
+ - `status` (string) [✗]: Analysis result status
1441
+
1442
+ - `errorMessage` (string) [✗]: Error description when status is FAILED
1443
+
1444
+ - `material` (string) [✗]: Material type used for estimation
1445
+
1446
+ - `quality` (string) [✗]: Quality preset used
1447
+
1448
+ - `printTimeMinutes` (number) [✗]: Estimated total print time in minutes
1449
+
1450
+ - `materialGrams` (number) [✗]: Estimated material consumption in grams (body only)
1451
+
1452
+ - `needsSupport` (boolean) [✗]: Whether the model requires support structures
1453
+
1454
+ - `supportMaterialGrams` (number) [✗]: Estimated support material in grams
1455
+
1456
+ - `overhangPercentage` (number) [✗]: Percentage of surface area with overhangs > 45°
1457
+
1458
+ - `minWallThicknessMm` (number) [✗]: Thinnest detected wall in millimeters
1459
+
1460
+ - `solidVolumeCm3` (number) [✗]: Solid volume of the mesh in cm³
1461
+
1462
+ - `surfaceAreaCm2` (number) [✗]: Total surface area in cm²
1463
+
1464
+ - `boundingBox` (object) [✗]: Bounding box in millimeters
1465
+
1466
+ - `estimatedCostEUR` (number) [✗]: Total estimated production cost in EUR
1467
+
1468
+ - `costBreakdown` (object) [✗]: Granular cost breakdown per WF-009 MaterialCostCalculatorService
1469
+
1470
+
1471
+
1472
+ ### model-print-analysis-request
1473
+
1474
+ **Description:** Triggers 3D print analysis for a model — estimates print time, material usage, support needs, and cost breakdown per FR-022
1475
+
1476
+ **Method:** `client.modelPrintAnalysisRequest(data)`
1477
+
1478
+ **Payload Type:** `ModelPrintAnalysisRequestMessage`
1479
+
1480
+ **Fields:**
1481
+
1482
+ - `modelId` (string) [✗]: UUID of the model to analyse
1483
+
1484
+ - `ownerId` (string) [✗]: UUID of the user who owns the model
1485
+
1486
+ - `material` (string) [✗]: Material type enum value (e.g. PLA, PETG, RESIN_STANDARD)
1487
+
1488
+ - `quality` (string) [✗]: Print quality preset
1489
+
1490
+ - `webhookUrl` (string) [✗]: URL called when analysis completes or fails
1491
+
1492
+ - `minioPath` (string) [✗]: Path to model in MinIO storage for geometry analysis (e.g. 'raw_models/{modelId}/original.glb')
1493
+
1494
+
1495
+
1496
+ ### model-sellability-analysis-completed
1497
+
1498
+ **Description:** Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
1499
+
1500
+ **Method:** `client.modelSellabilityAnalysisCompleted(data)`
1501
+
1502
+ **Payload Type:** `ModelSellabilityAnalysisCompletedMessage`
1503
+
1504
+ **Fields:**
1505
+
1506
+ - `metamodelId` (string) [✗]: Metamodel UUID
1507
+
1508
+ - `ownerId` (string) [✗]: Owner user ID
1509
+
1510
+ - `sellabilityScore` (number) [✗]: Overall sellability score (0-100)
1511
+
1512
+ - `pricingRecommendations` (object) [✗]: Pricing analysis and recommendations with material-specific pricing (v2.0.0)
1513
+
1514
+ - `marketplaceRecommendations` (array) [✗]: Recommended marketplaces with Etsy-specific scoring (v2.0.0)
1515
+
1516
+ - `demandAnalysis` (object) [✗]: Market demand insights
1517
+
1518
+ - `qualityFactors` (object) [✗]: Quality-related factors affecting sellability
1519
+
1520
+ - `recommendations` (array) [✗]: Actionable recommendations to improve sellability
1521
+
1522
+ - `analyzedAt` (string) [✗]: Analysis completion timestamp (ISO 8601)
1523
+
1524
+ - `analysisVersion` (string) [✗]: Analysis algorithm version
1525
+
1526
+ - `error` (object) [✗]: Error information if analysis failed
1527
+
1528
+
1529
+
1530
+ ### model-sellability-analysis-request
1531
+
1532
+ **Description:** 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.
1533
+
1534
+ **Method:** `client.modelSellabilityAnalysisRequest(data)`
1535
+
1536
+ **Payload Type:** `ModelSellabilityAnalysisRequestMessage`
1537
+
1538
+ **Fields:**
1539
+
1540
+ - `metamodelId` (string) [✗]: UUID of the metamodel to analyze.
1541
+
1542
+ - `ownerId` (string) [✗]: UUID of the user who owns the metamodel
1543
+
1544
+ - `metamodelData` (object) [✗]: Full metamodel data including technical metadata, enriched metadata, and child models. Injected by backend to avoid DB access.
1545
+
1546
+ - `manifestUrl` (string) [✗]: URL to a JSON manifest containing the metamodel data if it is too large for the message payload.
1547
+
1548
+ - `analysisOptions` (object) [✗]: Optional analysis configuration
1549
+
1550
+
1551
+
1552
+ ### model-semantic-analysis-completed
1553
+
1554
+ **Description:** Handles completion of 3D model semantic analysis with generated tags and similarity results.
1555
+
1556
+ **Method:** `client.modelSemanticAnalysisCompleted(data)`
1557
+
1558
+ **Payload Type:** `ModelSemanticAnalysisCompletedMessage`
1559
+
1560
+ **Fields:**
1561
+
1562
+ - `modelId` (string) [✗]: The unique identifier for the model.
1563
+
1564
+ - `userId` (string) [✗]: The user ID who owns the model.
1565
+
1566
+ - `processingStatus` (string) [✗]: Final processing status.
1567
+
1568
+ - `semanticMetadata` (object) [✗]: Generated semantic metadata and analysis results.
1569
+
1570
+ - `processingTime` (object) [✗]: Processing performance metrics.
1571
+
1572
+ - `qualityMetrics` (object) [✗]: Processing quality and confidence metrics.
1573
+
1574
+ - `error` (object) [✗]: Error information if processing failed.
1575
+
1576
+ - `debugInfo` (object) [✗]: Additional debug information for troubleshooting.
1577
+
1578
+
1579
+
1580
+ ### model-semantic-analysis-request
1581
+
1582
+ **Description:** Handles 3D model semantic analysis requests using ULIP-2 neural networks and FAISS vector similarity search.
1583
+
1584
+ **Method:** `client.modelSemanticAnalysisRequest(data)`
1585
+
1586
+ **Payload Type:** `ModelSemanticAnalysisRequestMessage`
1587
+
1588
+ **Fields:**
1589
+
1590
+ - `modelId` (string) [✗]: The unique identifier for the model.
1591
+
1592
+ - `userId` (string) [✗]: The user ID who owns the model.
1593
+
1594
+ - `storageConnectionId` (string) [✗]: The ID of the storage connection.
1595
+
1596
+ - `filePath` (string) [✗]: The path to the 3D model file in storage.
1597
+
1598
+ - `fileName` (string) [✗]: The name of the model file.
1599
+
1600
+ - `fileSize` (number) [✗]: The size of the model file in bytes.
1601
+
1602
+ - `storageProviderType` (string) [✗]: The type of the storage provider (S3, GoogleDrive, SFTP, etc).
1603
+
1604
+ - `processingOptions` (object) [✗]: Configuration options for semantic analysis.
1605
+
1606
+ - `priority` (number) [✗]: Processing priority (1=highest, 10=lowest).
1607
+
1608
+ - `webhookUrl` (string) [✗]: Optional webhook URL for completion notification.
1609
+
1610
+ - `retryCount` (number) [✗]: Current retry attempt number.
1611
+
1612
+
1613
+
1614
+ ### model-technical-metadata-completed
1615
+
1616
+ **Description:** Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
1617
+
1618
+ **Method:** `client.modelTechnicalMetadataCompleted(data)`
1619
+
1620
+ **Payload Type:** `ModelTechnicalMetadataCompletedMessage`
1621
+
1622
+ **Fields:**
1623
+
1624
+ - `originalJobId` (string) [✗]: ID of the original analysis request job
1625
+
1626
+ - `modelId` (string) [✗]: ID of the analyzed model
1627
+
1628
+ - `status` (string) [✗]: Analysis completion status
1629
+
1630
+ - `vertices` (integer) [✗]: Number of vertices in the mesh
1631
+
1632
+ - `faces` (integer) [✗]: Number of faces/polygons in the mesh
1633
+
1634
+ - `edges` (integer) [✗]: Number of edges in the mesh
1635
+
1636
+ - `detailLevel` (string) [✗]: Visual detail level based on polygon density
1637
+
1638
+ - `boundingBox` (object) [✗]: 3D bounding box dimensions in millimeters
1639
+
1640
+ - `volumeCubicMm` (number) [✗]: Model volume in cubic millimeters (for material calculation)
1641
+
1642
+ - `surfaceAreaSqMm` (number) [✗]: Total surface area in square millimeters
1643
+
1644
+ - `minWallThickness` (number) [✗]: Minimum wall thickness detected in millimeters (critical for printability)
1645
+
1646
+ - `maxWallThickness` (number) [✗]: Maximum wall thickness detected in millimeters
1647
+
1648
+ - `manifold` (boolean) [✗]: Is the mesh watertight/manifold? Critical for 3D printing (true = printable)
1649
+
1650
+ - `nonManifoldEdges` (integer) [✗]: Number of non-manifold edges (repair needed if > 0)
1651
+
1652
+ - `holes` (integer) [✗]: Number of holes/boundary loops in the mesh (0 = closed mesh)
1653
+
1654
+ - `flippedNormals` (integer) [✗]: Number of faces with inverted normals (causes rendering/slicing issues)
1655
+
1656
+ - `selfIntersections` (integer) [✗]: Number of self-intersecting faces (0 = clean geometry)
1657
+
1658
+ - `qualityScore` (number) [✗]: Overall quality score 0-100 (100 = perfect for printing, <60 needs repair)
1659
+
1660
+ - `printabilityScore` (number) [✗]: Printability score 0-100 (considers supports, orientation, size constraints)
1661
+
1662
+ - `requiresSupports` (boolean) [✗]: Does this model require support structures for 3D printing?
1663
+
1664
+ - `overhangs` (array) [✗]: Detected overhang areas requiring support structures
1665
+
1666
+ - `estimatedPrintTimeMinutes` (integer) [✗]: Estimated print time in minutes using normal quality settings (0.2mm layers, 20% infill)
1667
+
1668
+ - `printTimeEstimates` (object) [✗]: Print time estimates for different quality presets
1669
+
1670
+ - `estimatedMaterialGrams` (number) [✗]: Estimated material usage in grams using 20% infill (assumes PLA density 1.24g/cm³)
1671
+
1672
+ - `materialEstimates` (object) [✗]: Material usage estimates for different infill percentages
1673
+
1674
+ - `recommendedOrientation` (object) [✗]: Recommended print orientation for minimal support material and best results
1675
+
1676
+ - `slicerRecommendations` (object) [✗]: Slicer-derived recommended print settings based on model analysis (feeds into print job creation as defaults)
1677
+
1678
+ - `originalUnit` (string) [✗]: Original file format unit detected from metadata or inferred from scale
1679
+
1680
+ - `formatVersion` (string) [✗]: File format version (e.g., 'STL Binary', 'OBJ v4', 'PLY 1.0')
1681
+
1682
+ - `hasColorData` (boolean) [✗]: Does the file contain per-vertex color information?
1683
+
1684
+ - `hasTextureCoordinates` (boolean) [✗]: Does the file contain UV texture mapping coordinates?
1685
+
1686
+ - `hasVertexNormals` (boolean) [✗]: Does the file contain per-vertex normal vectors?
1687
+
1688
+ - `analyzedBy` (string) [✗]: Tool/service that performed the analysis
1689
+
1690
+ - `analysisVersion` (string) [✗]: Version of the analysis algorithm (for tracking improvements)
1691
+
1692
+ - `analysisConfidence` (number) [✗]: Confidence level of analysis results (0.0 = uncertain, 1.0 = highly confident)
1693
+
1694
+ - `analysisWarnings` (array) [✗]: Warnings or issues detected during analysis (structured for programmatic handling)
1695
+
1696
+ - `analyzedAt` (string) [✗]: ISO 8601 timestamp when analysis was performed (e.g., '2025-11-19T14:35:22Z')
1697
+
1698
+ - `errorMessage` (string) [✗]: Detailed error message if status is FAILED
1699
+
1700
+ - `errorCode` (string) [✗]: Machine-readable error code for programmatic error handling
1701
+
1702
+
1703
+
1704
+ ### model-technical-metadata-request
1705
+
1706
+ **Description:** Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
1707
+
1708
+ **Method:** `client.modelTechnicalMetadataRequest(data)`
1709
+
1710
+ **Payload Type:** `ModelTechnicalMetadataRequestMessage`
1711
+
1712
+ **Fields:**
1713
+
1714
+ - `modelId` (string) [✗]: Unique identifier for the model to analyze
1715
+
1716
+ - `ownerId` (string) [✗]: User ID who owns the model
1717
+
1718
+ - `storageLocation` (object) [✗]: Location of the 3D model file (legacy - used for direct download if minioPath not provided)
1719
+
1720
+ - `minioPath` (string) [✗]: Path to model in MinIO (e.g., 'raw_models/{modelId}/original.glb'). If provided, file will be read from MinIO instead of downloading from storage provider.
1721
+
1722
+ - `parentJobId` (string) [✗]: ID of parent file-download job (for BullMQ dependency tracking).
1723
+
1724
+ - `analysisOptions` (object) [✗]: Optional analysis configuration parameters
1725
+
1726
+
1727
+
1728
+ ### slicing-fdm-request
1729
+
1730
+ **Description:** Request FDM slicing simulation via OrcaSlicer (preferred) or heuristic fallback. Accepts OrcaSlicer-compatible printer/process/filament JSON profiles.
1731
+
1732
+ **Method:** `client.slicingFdmRequest(data)`
1733
+
1734
+ **Payload Type:** `SlicingFdmRequestMessage`
1735
+
1736
+ **Fields:**
1737
+
1738
+ - `modelId` (string) [✗]: UUID of the model
1739
+
1740
+ - `storageItemId` (string) [✗]: UUID or path of the storage item to download the STL/3MF
1741
+
1742
+ - `profileId` (string) [✗]: UUID of the user's slicer profile from the database
1743
+
1744
+ - `profileName` (string) [✗]: Human-readable profile name (e.g. 'My Bambu X1C - PLA Fine')
1745
+
1746
+ - `printerProfile` (object) [✗]: OrcaSlicer printer profile JSON: nozzle_diameter, bed_shape, max speeds, acceleration, retraction
1747
+
1748
+ - `processProfile` (object) [✗]: OrcaSlicer process profile JSON: layer_height, sparse_infill_density, wall_loops, speeds, support settings
1749
+
1750
+ - `filamentProfile` (object) [✗]: OrcaSlicer filament profile JSON: filament_type, filament_density, temperature, flow_ratio, retraction
1751
+
1752
+ - `layerHeight` (number) [✗]: Override: layer height in mm (takes precedence over processProfile)
1753
+
1754
+ - `infillPercentage` (number) [✗]: Override: infill percentage (0-100)
1755
+
1756
+ - `nozzleDiameter` (number) [✗]: Override: nozzle diameter in mm
1757
+
1758
+ - `printSpeed` (number) [✗]: Override: outer wall print speed in mm/s
1759
+
1760
+ - `wallCount` (integer) [✗]: Override: number of wall loops / perimeters
1761
+
1762
+ - `supportEnabled` (boolean) [✗]: Override: generate support structures
1763
+
1764
+ - `materialDensity` (number) [✗]: Override: filament density in g/cm³ (default: 1.24 PLA)
1765
+
1766
+ - `webhookUrl` (string) [✗]: URL to POST the slicing result back to
1767
+
1768
+
1769
+
1770
+ ### slicing-fdm-result
1771
+
1772
+ **Description:** Result of FDM slicing simulation from OrcaSlicer (toolpath) or heuristic fallback. Contains exact physical metrics for cost calculation.
1773
+
1774
+ **Method:** `client.slicingFdmResult(data)`
1775
+
1776
+ **Payload Type:** `SlicingFdmResultMessage`
1777
+
1778
+ **Fields:**
1779
+
1780
+ - `modelId` (string) [✗]: UUID of the model
1781
+
1782
+ - `status` (string) [✗]: Status of the simulation
1783
+
1784
+ - `printTimeHours` (number) [✗]: Exact print time in hours (from toolpath analysis)
1785
+
1786
+ - `materialWeightGrams` (number) [✗]: Total filament weight in grams (including supports)
1787
+
1788
+ - `materialVolumeCm3` (number) [✗]: Extruded material volume in cm³
1789
+
1790
+ - `maxZHeightMM` (number) [✗]: Maximum Z height in mm
1791
+
1792
+ - `supportMaterialWeightGrams` (number) [✗]: Support structure filament weight in grams
1793
+
1794
+ - `layerCount` (integer) [✗]: Total number of layers
1795
+
1796
+ - `totalExtrusionLengthMm` (number) [✗]: Total filament extrusion length in mm
1797
+
1798
+ - `slicingMethod` (string) [✗]: Engine that produced the result
1799
+
1800
+ - `slicerVersion` (string) [✗]: Version of the slicer engine used
1801
+
1802
+ - `profileUsed` (string) [✗]: Name or ID of the slicer profile used
203
1803
 
204
- - `metadata` (object) []: AI-generated metadata for the metamodel
1804
+ - `errorCode` (string) []: Error code if simulation failed
205
1805
 
206
- - `technicalMetadata` (object) []: Aggregated technical analysis from constituent models
1806
+ - `errorMessage` (string) []: Error message if simulation failed
207
1807
 
208
1808
 
209
1809
 
210
- ### metamodel-metadata-generation-request
1810
+ ### slicing-sla-request
211
1811
 
212
- **Description:** Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
1812
+ **Description:** Request SLA/MSLA slicing simulation via PySLM cross-sectional analysis. Accepts resin printer profile with exposure, lift, and layer parameters.
213
1813
 
214
- **Method:** `client.metamodelMetadataGenerationRequest(data)`
1814
+ **Method:** `client.slicingSlaRequest(data)`
215
1815
 
216
- **Payload Type:** `MetamodelMetadataGenerationRequestMessage`
1816
+ **Payload Type:** `SlicingSlaRequestMessage`
217
1817
 
218
1818
  **Fields:**
219
1819
 
220
- - `metamodelId` (string) [✗]: The unique identifier for the metamodel
1820
+ - `modelId` (string) [✗]: UUID of the model
221
1821
 
222
- - `constituentModelIds` (array) [✗]: Array of model IDs that compose this metamodel
1822
+ - `storageItemId` (string) [✗]: UUID or path of the storage item to download the STL/3MF
223
1823
 
224
- - `name` (string) [✗]: The name of the metamodel
1824
+ - `technology` (string) [✗]: SLA or MSLA
225
1825
 
226
- - `ownerId` (string) [✗]: The owner's user ID
1826
+ - `profileId` (string) [✗]: UUID of the user's slicer profile from the database
227
1827
 
228
- - `libraryId` (string) [✗]: The library containing this metamodel
1828
+ - `profileName` (string) [✗]: Human-readable profile name (e.g. 'Elegoo Mars 3 - Standard Grey')
229
1829
 
230
- - `constituentModels` (array) [✗]: Enriched metadata for constituent models (includes storage items)
1830
+ - `layerHeight` (number) [✗]: Layer height in mm (default: 0.05)
231
1831
 
232
- - `webhookUrl` (string) [✗]: Optional webhook URL for async completion notification
1832
+ - `exposureTime` (number) [✗]: Normal layer UV exposure time in seconds (default: 2.5)
233
1833
 
1834
+ - `bottomExposureTime` (number) [✗]: Bottom/burn-in layer exposure time in seconds (default: 30)
234
1835
 
1836
+ - `bottomLayers` (integer) [✗]: Number of bottom/burn-in layers (default: 5)
235
1837
 
236
- ### model-discovery-folder-processed-event
1838
+ - `liftHeight` (number) [✗]: Platform lift height in mm between layers (default: 5.0)
237
1839
 
238
- **Description:** Handles model discovery folder processed events.
1840
+ - `liftSpeed` (number) [✗]: Platform lift speed in mm/min (default: 60)
239
1841
 
240
- **Method:** `client.modelDiscoveryFolderProcessedEvent(data)`
1842
+ - `retractSpeed` (number) [✗]: Platform retract speed in mm/min (default: 150)
241
1843
 
242
- **Payload Type:** `ModelDiscoveryFolderProcessedEventMessage`
1844
+ - `resinDensity` (number) [✗]: Resin density in g/cm³ (default: 1.1)
243
1845
 
244
- **Fields:**
1846
+ - `supportEnabled` (boolean) [✗]: Generate support structures (default: true for SLA)
245
1847
 
246
- - `connectionId` (string) [✗]: The unique identifier for the connection.
1848
+ - `webhookUrl` (string) [✗]: URL to POST the slicing result back to
247
1849
 
248
- - `folderPath` (string) [✗]: The path to the processed folder.
249
1850
 
250
- - `discoveredFiles` (array) [✗]: A list of files discovered in the folder.
251
1851
 
252
- - `folderSignature` (object) [✗]: A signature representing the state of the folder.
1852
+ ### slicing-sla-result
253
1853
 
254
- - `processedAt` (string) [✗]: The timestamp when the folder was processed.
1854
+ **Description:** Result of SLA/MSLA slicing simulation from PySLM cross-sectional analysis. Contains exact resin usage and print time metrics.
255
1855
 
256
- - `statistics` (object) [✗]: Statistics about the processed folder.
1856
+ **Method:** `client.slicingSlaResult(data)`
257
1857
 
1858
+ **Payload Type:** `SlicingSlaResultMessage`
258
1859
 
1860
+ **Fields:**
259
1861
 
260
- ### model-discovery-scan-found-event
1862
+ - `modelId` (string) [✗]: UUID of the model
261
1863
 
262
- **Description:** Handles model discovery scan found events.
1864
+ - `status` (string) [✗]: Status of the simulation
263
1865
 
264
- **Method:** `client.modelDiscoveryScanFoundEvent(data)`
1866
+ - `printTimeHours` (number) [✗]: Exact print time in hours (from cross-sectional analysis)
265
1867
 
266
- **Payload Type:** `ModelDiscoveryScanFoundEventMessage`
1868
+ - `materialWeightGrams` (number) [✗]: Total resin weight in grams (including supports)
267
1869
 
268
- **Fields:**
1870
+ - `materialVolumeCm3` (number) [✗]: Cured resin volume in cm³ (from cross-sectional area integration)
269
1871
 
270
- - `modelId` (string) [✗]: The unique identifier for the model.
1872
+ - `maxZHeightMM` (number) [✗]: Maximum Z height in mm
271
1873
 
272
- - `name` (string) [✗]: The name of the model.
1874
+ - `supportMaterialWeightGrams` (number) [✗]: Support structure resin weight in grams
273
1875
 
274
- - `fileName` (string) [✗]: The name of the model file.
1876
+ - `layerCount` (integer) [✗]: Total number of layers
275
1877
 
276
- - `description` (string) [✗]: A description of the model.
1878
+ - `maxCrossSectionAreaMm2` (number) [✗]: Maximum cross-sectional area in mm² (affects MSLA peel force)
277
1879
 
278
- - `fileTypes` (array) [✗]: An array of file types associated with the model.
1880
+ - `slicingMethod` (string) [✗]: Engine that produced the result
279
1881
 
280
- - `size` (number) [✗]: The size of the model file in bytes.
1882
+ - `slicerVersion` (string) [✗]: Version of PySLM / trimesh used
281
1883
 
282
- - `storageLocation` (object) [✗]: The storage location of the model.
1884
+ - `profileUsed` (string) [✗]: Name or ID of the slicer profile used
283
1885
 
284
- - `providerType` (string) [✗]: The type of the storage provider.
1886
+ - `errorCode` (string) [✗]: Error code if simulation failed
285
1887
 
286
- - `metadata` (object) [✗]: A flexible object for additional metadata.
1888
+ - `errorMessage` (string) [✗]: Error message if simulation failed
287
1889
 
288
1890
 
289
1891
 
290
- ### model-discovery-scan-progress-event
1892
+ ### texture-generation-completed
291
1893
 
292
- **Description:** Handles model discovery scan progress events.
1894
+ **Description:** Emitted when AI texture generation completes (success or failure). Contains artifact S3 URLs on success, or error details on failure. The credit reservation should be confirmed (success) or released (failure) based on the status.
293
1895
 
294
- **Method:** `client.modelDiscoveryScanProgressEvent(data)`
1896
+ **Method:** `client.textureGenerationCompleted(data)`
295
1897
 
296
- **Payload Type:** `ModelDiscoveryScanProgressEventMessage`
1898
+ **Payload Type:** `TextureGenerationCompletedMessage`
297
1899
 
298
1900
  **Fields:**
299
1901
 
300
- - `payload` (object) [✗]: Contains the discovery scan progress details.
301
-
1902
+ - `jobId` (string) [✗]: The unique job identifier matching the original request.
302
1903
 
1904
+ - `modelId` (string) [✗]: The ID of the model that was textured.
303
1905
 
304
- ### model-discovery-scan-request
1906
+ - `tenantId` (string) [✗]: The tenant who owns the model.
305
1907
 
306
- **Description:** Handles model discovery scan requests events.
1908
+ - `status` (string) [✗]: The result status of the texture generation.
307
1909
 
308
- **Method:** `client.modelDiscoveryScanRequest(data)`
1910
+ - `artifacts` (object) [✗]: S3 URLs of generated texture artifacts. Present only when status is 'completed'.
309
1911
 
310
- **Payload Type:** `ModelDiscoveryScanRequestMessage`
1912
+ - `error` (object) [✗]: Error details. Present only when status is 'failed'.
311
1913
 
312
- **Fields:**
1914
+ - `metrics` (object) [✗]: Pipeline performance metrics.
313
1915
 
314
- - `libraryId` (string) [✗]: The ID of the library to scan.
1916
+ - `creditReservationId` (string) [✗]: Credit reservation ID to confirm (on success) or release (on failure).
315
1917
 
316
- - `storageConnectionId` (string) [✗]: The ID of the storage connection to scan.
317
1918
 
318
- - `providerType` (string) [✗]: The type of the storage provider.
319
1919
 
320
- - `path` (string) [✗]: The specific path within the storage connection to scan for this library.
1920
+ ### texture-generation-request
321
1921
 
1922
+ **Description:** Request AI-powered texture generation for a 3D model. Requires a mesh file URL and a text prompt describing the desired texture. Credits are reserved before dispatch.
322
1923
 
1924
+ **Method:** `client.textureGenerationRequest(data)`
323
1925
 
324
- ### model-metadata-generation-completed
1926
+ **Payload Type:** `TextureGenerationRequestMessage`
325
1927
 
326
- **Description:** Handles model metadata generation completed.
1928
+ **Fields:**
327
1929
 
328
- **Method:** `client.modelMetadataGenerationCompleted(data)`
1930
+ - `jobId` (string) [✗]: Unique job identifier for tracking.
329
1931
 
330
- **Payload Type:** `ModelMetadataGenerationCompletedMessage`
1932
+ - `modelId` (string) [✗]: The unique identifier for the model to texture.
331
1933
 
332
- **Fields:**
1934
+ - `tenantId` (string) [✗]: The identifier of the tenant requesting the generation.
333
1935
 
334
- - `modelId` (string) []: The unique identifier for the model.
1936
+ - `meshUrl` (string) []: S3 URL to the source mesh file (GLB, OBJ, or STL).
335
1937
 
336
- - `metadata` (object) []: The enriched metadata for the model.
1938
+ - `prompt` (string) []: Text description of the desired texture (1-500 characters). Example: 'weathered bronze with green patina'.
337
1939
 
1940
+ - `stylePreset` (string) [✗]: Style preset to guide the texture generation aesthetic.
338
1941
 
1942
+ - `resolution` (integer) [✗]: Output texture resolution (width = height in pixels).
339
1943
 
340
- ### model-metadata-generation-request
1944
+ - `creditReservationId` (string) [✗]: Credit reservation ID from the credit ledger. Must be confirmed on completion or released on failure.
341
1945
 
342
- **Description:** Handles model metadata generation requests.
343
1946
 
344
- **Method:** `client.modelMetadataGenerationRequest(data)`
345
1947
 
346
- **Payload Type:** `ModelMetadataGenerationRequestMessage`
1948
+ ### thumbnail-generation-completed
347
1949
 
348
- **Fields:**
1950
+ **Description:** Handles thumbnail generation completed.
349
1951
 
350
- - `modelId` (string) [✗]: The unique identifier for the model.
1952
+ **Method:** `client.thumbnailGenerationCompleted(data)`
351
1953
 
352
- - `storageConnectionId` (string) [✗]: The ID of the storage connection.
1954
+ **Payload Type:** `ThumbnailGenerationCompletedMessage`
353
1955
 
354
- - `filePath` (string) [✗]: The path to the model file.
1956
+ **Fields:**
355
1957
 
356
- - `fileName` (string) [✗]: The name of the model file.
1958
+ - `originalJobId` (string) [✗]: The ID of the original job that requested the thumbnail generation.
357
1959
 
358
- - `fileSize` (number) [✗]: The size of the model file in bytes.
1960
+ - `modelId` (string) [✗]: The ID of the model that the thumbnail was generated for.
359
1961
 
360
- - `fileLastModified` (string) [✗]: The last modified date of the model file.
1962
+ - `status` (string) [✗]: The status of the thumbnail generation.
361
1963
 
362
- - `storageProviderType` (string) [✗]: The type of the storage provider.
1964
+ - `thumbnailPath` (string) [✗]: The path to the generated thumbnail.
363
1965
 
364
- - `modelThumbnailUrl` (string) [✗]: The URL of the model thumbnail.
1966
+ - `thumbnail360Views` (array) [✗]: Array of 360° thumbnail view paths (16 angles) for vision-based analysis.
365
1967
 
366
- - `metamodel` (object) [✗]: The metamodel of the model.
1968
+ - `gltfPreviewPath` (string) [✗]: The path to the generated GLTF/GLB 3D preview file.
367
1969
 
1970
+ - `animatedPreviewPath` (string) [✗]: The path to the generated animated MP4 preview file.
368
1971
 
1972
+ - `errorMessage` (string) [✗]: An error message if the thumbnail generation failed.
369
1973
 
370
- ### model-metamodel-detection-found
1974
+ - `storageLocation` (object) [✗]: The storage location of the model.
371
1975
 
372
- **Description:** Handles model metamodel detection found with hierarchical relationships.
373
1976
 
374
- **Method:** `client.modelMetamodelDetectionFound(data)`
375
1977
 
376
- **Payload Type:** `ModelMetamodelDetectionFoundMessage`
1978
+ ### thumbnail-generation-request
377
1979
 
378
- **Fields:**
1980
+ **Description:** Handles thumbnail generation requests with customization options. Supports both storage provider downloads and MinIO-cached files.
379
1981
 
380
- - `metamodels` (array) [✓]: List of metamodel nodes in hierarchical structure (roots and children).
1982
+ **Method:** `client.thumbnailGenerationRequest(data)`
381
1983
 
1984
+ **Payload Type:** `ThumbnailGenerationRequestMessage`
382
1985
 
1986
+ **Fields:**
383
1987
 
384
- ### model-metamodel-detection-request
1988
+ - `modelId` (string) [✗]: The unique identifier for the model requiring a thumbnail.
385
1989
 
386
- **Description:** Handles model metamodel detection requests.
1990
+ - `ownerId` (string) [✗]: The identifier of the user who owns the entity.
387
1991
 
388
- **Method:** `client.modelMetamodelDetectionRequest(data)`
1992
+ - `storageLocation` (object) [✗]: The storage location of the model (legacy - used for direct download if minioPath not provided).
389
1993
 
390
- **Payload Type:** `ModelMetamodelDetectionRequestMessage`
1994
+ - `minioPath` (string) [✗]: Path to model in MinIO (e.g., 'raw_models/{modelId}/original.glb'). If provided, file will be read from MinIO instead of downloading from storage provider.
391
1995
 
392
- **Fields:**
1996
+ - `previewType` (string) [✗]: The type of preview to generate, e.g., 'default', 'static', 'glb'.
393
1997
 
394
- - `connectionId` (string) []: The unique identifier for the storage connection.
1998
+ - `generate360Views` (boolean) []: Generate 16 angle views for 360° preview (4 horizontal x 4 vertical angles) for enhanced vision-based metadata analysis.
395
1999
 
396
- - `folderPath` (string) []: The path to the folder that was processed.
2000
+ - `parentJobId` (string) []: ID of parent file-download job (for BullMQ dependency tracking).
397
2001
 
398
- - `discoveredFiles` (array) []: A list of files discovered in the folder.
2002
+ - `customization` (object) []: User-defined customizations for the thumbnail.
399
2003
 
400
- - `folderSignature` (object) [✓]: A signature representing the state of the folder.
401
2004
 
402
- - `processedAt` (string) [✓]: The timestamp when the folder was processed.
403
2005
 
404
- - `statistics` (object) [✓]: Statistics about the processed folder.
2006
+ ### user-engagement-event
405
2007
 
2008
+ **Description:** User engagement and onboarding tracking events for analytics and behavioral insights.
406
2009
 
2010
+ Captures key user actions throughout their journey:
2011
+ - Account creation and onboarding steps
2012
+ - Feature usage and adoption
2013
+ - Model management activities
2014
+ - Marketplace interactions
2015
+ - Subscription changes
407
2016
 
408
- ### model-technical-metadata-completed
2017
+ Used for:
2018
+ - User onboarding funnel analysis
2019
+ - Feature adoption tracking
2020
+ - User retention metrics
2021
+ - A/B testing and experimentation
2022
+ - Personalization and recommendations
2023
+ - Product analytics dashboards
409
2024
 
410
- **Description:** Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
411
2025
 
412
- **Method:** `client.modelTechnicalMetadataCompleted(data)`
2026
+ **Method:** `client.userEngagementEvent(data)`
413
2027
 
414
- **Payload Type:** `ModelTechnicalMetadataCompletedMessage`
2028
+ **Payload Type:** `UserEngagementEventMessage`
415
2029
 
416
2030
  **Fields:**
417
2031
 
418
- - `originalJobId` (string) []: ID of the original analysis request job
419
-
420
- - `modelId` (string) [✗]: ID of the analyzed model
2032
+ - `eventVersion` (string) []: Schema version for forward-compatible evolution
421
2033
 
422
- - `status` (string) []: Analysis completion status
2034
+ - `eventType` (string) []: Category of user engagement event
423
2035
 
424
- - `vertices` (integer) []: Number of vertices in the mesh
2036
+ - `action` (string) []: Specific user action performed
425
2037
 
426
- - `faces` (integer) []: Number of faces/polygons in the mesh
2038
+ - `timestamp` (string) []: ISO 8601 timestamp when the action occurred
427
2039
 
428
- - `edges` (integer) []: Number of edges in the mesh
2040
+ - `userId` (string) []: Unique identifier of the user
429
2041
 
430
- - `detailLevel` (string) [✗]: Visual detail level based on polygon density
2042
+ - `userEmail` (string) [✗]: User's email MUST be SHA-256 hashed at the producer side before publishing (GDPR/CNIL compliance). Never send raw email.
431
2043
 
432
- - `boundingBox` (object) [✗]: 3D bounding box dimensions in millimeters
2044
+ - `userCreatedAt` (string) [✗]: When the user account was created (for cohort analysis)
433
2045
 
434
- - `volumeCubicMm` (number) [✗]: Model volume in cubic millimeters (for material calculation)
2046
+ - `userPlanTier` (string) [✗]: Current subscription plan tier
435
2047
 
436
- - `surfaceAreaSqMm` (number) [✗]: Total surface area in square millimeters
2048
+ - `sessionId` (string) [✗]: User session identifier for grouping actions
437
2049
 
438
- - `minWallThickness` (number) [✗]: Minimum wall thickness detected in millimeters (critical for printability)
2050
+ - `requestId` (string) [✗]: Request ID for correlation with backend logs
439
2051
 
440
- - `maxWallThickness` (number) [✗]: Maximum wall thickness detected in millimeters
2052
+ - `correlationId` (string) [✗]: Correlation ID to link engagement events across frontend and backend boundaries, and to pipeline traces
441
2053
 
442
- - `manifold` (boolean) [✗]: Is the mesh watertight/manifold? Critical for 3D printing (true = printable)
2054
+ - `actionDetails` (object) [✗]: Additional context about the action
443
2055
 
444
- - `nonManifoldEdges` (integer) [✗]: Number of non-manifold edges (repair needed if > 0)
2056
+ - `source` (string) [✗]: Where the action originated
445
2057
 
446
- - `holes` (integer) [✗]: Number of holes/boundary loops in the mesh (0 = closed mesh)
2058
+ - `httpMethod` (string) [✗]: HTTP method used
447
2059
 
448
- - `flippedNormals` (integer) [✗]: Number of faces with inverted normals (causes rendering/slicing issues)
2060
+ - `httpUrl` (string) [✗]: API endpoint path
449
2061
 
450
- - `selfIntersections` (integer) [✗]: Number of self-intersecting faces (0 = clean geometry)
2062
+ - `httpStatusCode` (integer) [✗]: HTTP response status code
451
2063
 
452
- - `qualityScore` (number) [✗]: Overall quality score 0-100 (100 = perfect for printing, <60 needs repair)
2064
+ - `durationMs` (number) [✗]: Action duration in milliseconds
453
2065
 
454
- - `printabilityScore` (number) [✗]: Printability score 0-100 (considers supports, orientation, size constraints)
2066
+ - `experimentId` (string) [✗]: A/B test or experiment ID
455
2067
 
456
- - `requiresSupports` (boolean) [✗]: Does this model require support structures for 3D printing?
2068
+ - `experimentVariant` (string) [✗]: Experiment variant/group
457
2069
 
458
- - `overhangs` (array) [✗]: Detected overhang areas requiring support structures
2070
+ - `environment` (string) [✗]: Deployment environment
459
2071
 
460
- - `estimatedPrintTimeMinutes` (integer) [✗]: Estimated print time in minutes using normal quality settings (0.2mm layers, 20% infill)
2072
+ - `clientInfo` (object) [✗]: Client/browser information (anonymized)
461
2073
 
462
- - `printTimeEstimates` (object) [✗]: Print time estimates for different quality presets
463
2074
 
464
- - `estimatedMaterialGrams` (number) [✗]: Estimated material usage in grams using 20% infill (assumes PLA density 1.24g/cm³)
465
2075
 
466
- - `materialEstimates` (object) [✗]: Material usage estimates for different infill percentages
2076
+ ### worker-analytics-event
467
2077
 
468
- - `recommendedOrientation` (object) [✗]: Recommended print orientation for minimal support material and best results
2078
+ **Description:** Analytics event emitted by workers for tracking processing metrics, user behavior,
2079
+ and model statistics. Consumed by worker-analytic-collector and forwarded to ELK.
469
2080
 
470
- - `originalUnit` (string) [✗]: Original file format unit detected from metadata or inferred from scale
2081
+ All workers MUST emit this event upon job completion (success or failure).
2082
+ Each worker includes its specific metrics in the `metrics` object.
471
2083
 
472
- - `formatVersion` (string) [✗]: File format version (e.g., 'STL Binary', 'OBJ v4', 'PLY 1.0')
473
2084
 
474
- - `hasColorData` (boolean) [✗]: Does the file contain per-vertex color information?
2085
+ **Method:** `client.workerAnalyticsEvent(data)`
475
2086
 
476
- - `hasTextureCoordinates` (boolean) [✗]: Does the file contain UV texture mapping coordinates?
2087
+ **Payload Type:** `WorkerAnalyticsEventMessage`
477
2088
 
478
- - `hasVertexNormals` (boolean) [✗]: Does the file contain per-vertex normal vectors?
2089
+ **Fields:**
479
2090
 
480
- - `analyzedBy` (string) []: Tool/service that performed the analysis
2091
+ - `eventType` (string) []: Type of analytics event
481
2092
 
482
- - `analysisVersion` (string) []: Version of the analysis algorithm (for tracking improvements)
2093
+ - `workerId` (string) []: Identifier of the worker that processed the job
483
2094
 
484
- - `analysisConfidence` (number) []: Confidence level of analysis results (0.0 = uncertain, 1.0 = highly confident)
2095
+ - `jobId` (string) []: Unique job identifier from BullMQ
485
2096
 
486
- - `analysisWarnings` (array) []: Warnings or issues detected during analysis (structured for programmatic handling)
2097
+ - `timestamp` (string) []: ISO 8601 timestamp of event emission
487
2098
 
488
- - `analyzedAt` (string) [✗]: ISO 8601 timestamp when analysis was performed (e.g., '2025-11-19T14:35:22Z')
2099
+ - `userId` (string) [✗]: User who owns the model/triggered the job
489
2100
 
490
- - `errorMessage` (string) [✗]: Detailed error message if status is FAILED
2101
+ - `modelId` (string) [✗]: Model identifier (if applicable)
491
2102
 
492
- - `errorCode` (string) [✗]: Machine-readable error code for programmatic error handling
2103
+ - `metamodelId` (string) [✗]: Metamodel identifier (if applicable)
493
2104
 
2105
+ - `storageItemId` (string) [✗]: Storage item identifier (for download events)
494
2106
 
2107
+ - `status` (string) [✗]: Job completion status
495
2108
 
496
- ### model-technical-metadata-request
2109
+ - `errorCode` (string) [✗]: Error code if status is failure
497
2110
 
498
- **Description:** Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
2111
+ - `errorMessage` (string) [✗]: Error message if status is failure
499
2112
 
500
- **Method:** `client.modelTechnicalMetadataRequest(data)`
2113
+ - `timing` (object) [✗]: Processing time metrics in milliseconds
501
2114
 
502
- **Payload Type:** `ModelTechnicalMetadataRequestMessage`
2115
+ - `metrics` (object) [✗]: Worker-specific metrics. Structure varies by eventType.
503
2116
 
504
- **Fields:**
505
2117
 
506
- - `modelId` (string) [✗]: Unique identifier for the model to analyze
507
2118
 
508
- - `ownerId` (string) [✗]: User ID who owns the model
2119
+ ### worker-metrics-enriched-event
509
2120
 
510
- - `storageLocation` (object) [✗]: Location of the 3D model file
2121
+ **Description:** Enriched metrics event for detailed worker monitoring, cost tracking,
2122
+ and performance analysis. Published to backend.logging.events for
2123
+ centralized monitoring and cost attribution.
511
2124
 
512
- - `analysisOptions` (object) [✗]: Optional analysis configuration parameters
2125
+ This event is emitted by all workers on job completion and includes:
2126
+ - LLM token usage and cost breakdown
2127
+ - System resource consumption (CPU, RAM, disk I/O)
2128
+ - Detailed timing breakdown by stage
2129
+ - User and context attribution
2130
+ - Model-specific metadata
513
2131
 
514
2132
 
2133
+ **Method:** `client.workerMetricsEnrichedEvent(data)`
515
2134
 
516
- ### thumbnail-generation-completed
2135
+ **Payload Type:** `WorkerMetricsEnrichedEventMessage`
517
2136
 
518
- **Description:** Handles thumbnail generation completed.
2137
+ **Fields:**
519
2138
 
520
- **Method:** `client.thumbnailGenerationCompleted(data)`
2139
+ - `eventType` (string) [✓]: Fixed type for enriched worker metrics
521
2140
 
522
- **Payload Type:** `ThumbnailGenerationCompletedMessage`
2141
+ - `workerId` (string) [✓]: Identifier of the worker
523
2142
 
524
- **Fields:**
2143
+ - `jobId` (string) [✓]: Unique BullMQ job identifier
525
2144
 
526
- - `originalJobId` (string) []: The ID of the original job that requested the thumbnail generation.
2145
+ - `timestamp` (string) []: ISO 8601 timestamp when job completed
527
2146
 
528
- - `modelId` (string) []: The ID of the model that the thumbnail was generated for.
2147
+ - `status` (string) []: Job completion status
529
2148
 
530
- - `status` (string) [✗]: The status of the thumbnail generation.
2149
+ - `userId` (string) [✗]: User who owns the resource/triggered the job
531
2150
 
532
- - `thumbnailPath` (string) [✗]: The path to the generated thumbnail.
2151
+ - `tenantId` (string) [✗]: Organization/tenant ID (for multi-tenant deployments)
533
2152
 
534
- - `errorMessage` (string) [✗]: An error message if the thumbnail generation failed.
2153
+ - `sessionId` (string) [✗]: Session ID for correlating user actions
535
2154
 
536
- - `storageLocation` (object) [✗]: The storage location of the model.
2155
+ - `requestId` (string) [✗]: Request ID from originating API call (X-Request-Id)
537
2156
 
2157
+ - `modelId` (string) [✗]: Model ID being processed
538
2158
 
2159
+ - `metamodelId` (string) [✗]: Metamodel ID being processed
539
2160
 
540
- ### thumbnail-generation-request
2161
+ - `storageItemId` (string) [✗]: Storage item ID (for file operations)
541
2162
 
542
- **Description:** Handles thumbnail generation requests with customization options.
2163
+ - `timing` (object) [✗]: Comprehensive timing breakdown
543
2164
 
544
- **Method:** `client.thumbnailGenerationRequest(data)`
2165
+ - `llmUsage` (object) [✗]: LLM token usage and cost breakdown
545
2166
 
546
- **Payload Type:** `ThumbnailGenerationRequestMessage`
2167
+ - `resources` (object) [✗]: System resource consumption during job
547
2168
 
548
- **Fields:**
2169
+ - `workerMetrics` (object) [✗]: Worker-specific metrics (varies by worker type)
549
2170
 
550
- - `modelId` (string) [✗]: The unique identifier for the model requiring a thumbnail.
2171
+ - `error` (object) [✗]: Error details if status is failure
551
2172
 
552
- - `ownerId` (string) [✗]: The identifier of the user who owns the entity.
2173
+ - `environment` (string) [✗]: Deployment environment
553
2174
 
554
- - `storageLocation` (object) [✗]: The storage location of the model.
2175
+ - `region` (string) [✗]: Cloud region/datacenter
555
2176
 
556
- - `previewType` (string) [✗]: The type of preview to generate, e.g., 'default', 'static', 'glb'.
2177
+ - `workerVersion` (string) [✗]: Worker service version
557
2178
 
558
- - `customization` (object) [✗]: User-defined customizations for the thumbnail.
2179
+ - `hostname` (string) [✗]: Pod/container hostname
559
2180
 
560
2181
 
561
2182
 
@@ -597,11 +2218,165 @@ new WorkerClient(config: WorkerClientConfig)
597
2218
  - Get the current status of a job
598
2219
 
599
2220
 
2221
+ - `analyticsCollectionRequest(data: AnalyticsCollectionRequestMessage): Promise<JobResponse>`
2222
+ - Request to trigger a manual market data collection job.
2223
+ Used for ad-hoc scraping of specific queries on marketplaces.
2224
+
2225
+
2226
+ - `backendLoggingEvent(data: BackendLoggingEventMessage): Promise<JobResponse>`
2227
+ - Centralized logging event for capturing all warn/error/failure logs from meshsync-backend.
2228
+ This event is sent to ELK for centralized monitoring, alerting, and debugging.
2229
+
2230
+ Automatically emitted by the custom Pino logger interceptor when:
2231
+ - logger.warn() is called
2232
+ - logger.error() is called
2233
+ - uncaught exceptions occur
2234
+ - request failures happen (4xx, 5xx responses)
2235
+
2236
+ Used for:
2237
+ - System health monitoring
2238
+ - Error tracking and alerting
2239
+ - Performance degradation detection
2240
+ - Security incident tracking
2241
+ - Compliance and audit trails
2242
+
2243
+
2244
+ - `etsyAnalyticsSyncCompleted(data: EtsyAnalyticsSyncCompletedMessage): Promise<JobResponse>`
2245
+ - Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
2246
+
2247
+
2248
+ - `etsyAnalyticsSyncRequest(data: EtsyAnalyticsSyncRequestMessage): Promise<JobResponse>`
2249
+ - Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
2250
+ Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
2251
+
2252
+
2253
+ - `etsyPublishListingCompleted(data: EtsyPublishListingCompletedMessage): Promise<JobResponse>`
2254
+ - Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
2255
+
2256
+
2257
+ - `etsyPublishListingRequest(data: EtsyPublishListingRequestMessage): Promise<JobResponse>`
2258
+ - Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
2259
+ This message is enqueued for EACH material variant when publishing a metamodel.
2260
+ Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
2261
+
2262
+
600
2263
  - `fileDownloadCompleted(data: FileDownloadCompletedMessage): Promise<JobResponse>`
601
2264
  - Notifies that a file download has been processed, indicating success or failure.
602
2265
 
603
2266
  - `fileDownloadRequest(data: FileDownloadRequestMessage): Promise<JobResponse>`
604
- - Handles file download requests.
2267
+ - Downloads model file from storage provider to MinIO for processing pipeline.
2268
+ Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
2269
+
2270
+ Retry Configuration:
2271
+ - Automatic retry enabled for transient failures (connection errors, timeouts)
2272
+ - Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
2273
+ - Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
2274
+ - No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
2275
+
2276
+
2277
+ - `fileVectorizeCompleted(data: FileVectorizeCompletedMessage): Promise<JobResponse>`
2278
+ - Result of the vectorization process containing the embedding vector.
2279
+
2280
+ - `fileVectorizeRequest(data: FileVectorizeRequestMessage): Promise<JobResponse>`
2281
+ - Request to generate a vector embedding for an image file using CLIP.
2282
+
2283
+ - `ipCheckCompleted(data: IpCheckCompletedMessage): Promise<JobResponse>`
2284
+ - Contains IP verification results including trademark risk, copyright risk, detected brands/franchises, and analysis confidence scores
2285
+
2286
+ - `ipCheckRequest(data: IpCheckRequestMessage): Promise<JobResponse>`
2287
+ - Triggers intellectual property verification analysis for a model thumbnail, detecting potential trademark and copyright issues using perceptual hashing, text analysis, and optional reverse image search.
2288
+
2289
+ - `marketplaceConnectionSyncCompleted(data: MarketplaceConnectionSyncCompletedMessage): Promise<JobResponse>`
2290
+ - Notification that marketplace connection sync has completed. Contains updated connection metadata, profile information, and sync statistics.
2291
+
2292
+
2293
+ - `marketplaceConnectionSyncRequest(data: MarketplaceConnectionSyncRequestMessage): Promise<JobResponse>`
2294
+ - Requests synchronization of marketplace connection data including: - Profile information and shop details - Account status and permissions - Available categories and shipping profiles - Rate limits and API quotas
2295
+ This is typically triggered after initial connection or periodically to keep marketplace metadata up to date.
2296
+
2297
+
2298
+ - `marketplaceCredentialRotationCompleted(data: MarketplaceCredentialRotationCompletedMessage): Promise<JobResponse>`
2299
+ - Notification that marketplace credential rotation has completed. Contains the rotation results, new credential metadata, and any issues encountered.
2300
+
2301
+
2302
+ - `marketplaceCredentialRotationRequest(data: MarketplaceCredentialRotationRequestMessage): Promise<JobResponse>`
2303
+ - Requests rotation/refresh of marketplace connection credentials. This is used for: - OAuth token refresh when tokens are near expiry - API key rotation for enhanced security - Re-authentication after connection errors - Scheduled credential updates
2304
+
2305
+
2306
+ - `marketplaceIntelligenceCompleted(data: MarketplaceIntelligenceCompletedMessage): Promise<JobResponse>`
2307
+ - Response from marketplace intelligence scraping.
2308
+ Contains aggregated similarity data from marketplace searches.
2309
+
2310
+ Consumed by worker-backend to update pipeline context before
2311
+ sellability analysis runs.
2312
+
2313
+
2314
+ - `marketplaceIntelligenceEvent(data: MarketplaceIntelligenceEventMessage): Promise<JobResponse>`
2315
+ - Public marketplace intelligence data scraped from external marketplaces.
2316
+
2317
+ This event contains:
2318
+ - Listing details (title, price, images)
2319
+ - Engagement metrics (views, favorites, reviews)
2320
+ - Shop information
2321
+ - Market positioning data
2322
+
2323
+ Unlike marketplace-listing-sync-request (private user data), this focuses on:
2324
+ - Broad market trends and pricing analysis
2325
+ - Competitive intelligence and demand signals
2326
+ - Product popularity and sentiment
2327
+
2328
+ Consumed by worker-analytic-collector for Elasticsearch indexing.
2329
+ Used for market research, pricing optimization, and trend detection.
2330
+
2331
+
2332
+ - `marketplaceIntelligenceRequest(data: MarketplaceIntelligenceRequestMessage): Promise<JobResponse>`
2333
+ - Triggers automated marketplace scraping to find similar/competing listings
2334
+ for a given model. This is a pipeline stage that runs after metadata generation
2335
+ to inform sellability analysis with real market data.
2336
+
2337
+ The worker-analytic-collector (or marketplace-connectors worker) will:
2338
+ 1. Use model metadata (title, tags, category) to build search queries
2339
+ 2. Scrape connected marketplaces (Etsy, eBay, etc.) for similar listings
2340
+ 3. Emit marketplace-intelligence-event results for Elasticsearch indexing
2341
+ 4. Return aggregated similarity data to the pipeline context
2342
+
2343
+ Pipeline integration:
2344
+ - Triggered after: metadata-generation (needs model title/tags/category)
2345
+ - Results feed into: sellability-analysis (market positioning data)
2346
+
2347
+
2348
+ - `marketplaceListingDescriptionGenerationCompleted(data: MarketplaceListingDescriptionGenerationCompletedMessage): Promise<JobResponse>`
2349
+ - Notifies backend that marketplace description generation completed. Contains generated description with metadata tracking (AI model, confidence, generation timestamp) and suggested price.
2350
+
2351
+ - `marketplaceListingDescriptionGenerationRequest(data: MarketplaceListingDescriptionGenerationRequestMessage): Promise<JobResponse>`
2352
+ - Generates SEO-optimized marketplace description for a 3D model using LLM vision analysis. Worker receives model data, technical metadata, and thumbnail URLs to generate compelling product descriptions tailored to the target marketplace.
2353
+
2354
+ - `marketplaceListingSyncCompleted(data: MarketplaceListingSyncCompletedMessage): Promise<JobResponse>`
2355
+ - Notification that marketplace listing sync operation has completed. Contains detailed results of the sync including created/updated listings, errors encountered, and performance statistics.
2356
+
2357
+
2358
+ - `marketplaceListingSyncRequest(data: MarketplaceListingSyncRequestMessage): Promise<JobResponse>`
2359
+ - Requests synchronization of marketplace listings for a connection. Can sync specific listings or all listings for a marketplace connection.
2360
+ Includes bidirectional sync: - Pull: Fetch listings from marketplace to update local database - Push: Update marketplace listings with local changes - Full: Both pull and push operations
2361
+
2362
+
2363
+ - `marketplaceListingTagsGenerationCompleted(data: MarketplaceListingTagsGenerationCompletedMessage): Promise<JobResponse>`
2364
+ - Notifies backend that marketplace tags generation completed. Contains generated tags optimized for discoverability with metadata tracking.
2365
+
2366
+ - `marketplaceListingTagsGenerationRequest(data: MarketplaceListingTagsGenerationRequestMessage): Promise<JobResponse>`
2367
+ - Generates searchability tags for a 3D model optimized for marketplace discoverability. Worker creates style, technical, and usage keywords following marketplace tag limits and SEO best practices.
2368
+
2369
+ - `marketplaceListingTitleGenerationCompleted(data: MarketplaceListingTitleGenerationCompletedMessage): Promise<JobResponse>`
2370
+ - Notifies backend that marketplace title generation completed. Contains generated title with metadata tracking.
2371
+
2372
+ - `marketplaceListingTitleGenerationRequest(data: MarketplaceListingTitleGenerationRequestMessage): Promise<JobResponse>`
2373
+ - Generates marketplace-optimized title for a 3D model. Worker creates concise, SEO-friendly titles following marketplace character limits and best practices.
2374
+
2375
+ - `marketplaceListingUpdateCompleted(data: MarketplaceListingUpdateCompletedMessage): Promise<JobResponse>`
2376
+ - Result of a listing update operation
2377
+
2378
+ - `marketplaceListingUpdateRequest(data: MarketplaceListingUpdateRequestMessage): Promise<JobResponse>`
2379
+ - Request to update an existing listing on a marketplace (price, quantity, etc.)
605
2380
 
606
2381
  - `mediaBatchDownloadCompleted(data: MediaBatchDownloadCompletedMessage): Promise<JobResponse>`
607
2382
  - Notifies that a batch media download has been completed.
@@ -616,6 +2391,14 @@ new WorkerClient(config: WorkerClientConfig)
616
2391
  - `metamodelMetadataGenerationRequest(data: MetamodelMetadataGenerationRequestMessage): Promise<JobResponse>`
617
2392
  - Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
618
2393
 
2394
+ - `modelAnalyticsCollectionRequest(data: ModelAnalyticsCollectionRequestMessage): Promise<JobResponse>`
2395
+ - Request to collect marketplace analytics for a specific metamodel.
2396
+ Triggered by backend scheduler every 6 hours for popular/tagged metamodels.
2397
+
2398
+ Worker performs targeted market searches based on metamodel metadata
2399
+ and stores aggregated statistics in Elasticsearch for trend analysis.
2400
+
2401
+
619
2402
  - `modelDiscoveryFolderProcessedEvent(data: ModelDiscoveryFolderProcessedEventMessage): Promise<JobResponse>`
620
2403
  - Handles model discovery folder processed events.
621
2404
 
@@ -628,11 +2411,20 @@ new WorkerClient(config: WorkerClientConfig)
628
2411
  - `modelDiscoveryScanRequest(data: ModelDiscoveryScanRequestMessage): Promise<JobResponse>`
629
2412
  - Handles model discovery scan requests events.
630
2413
 
2414
+ - `modelFinderIndexRequest(data: ModelFinderIndexRequestMessage): Promise<JobResponse>`
2415
+ - DEPRECATED (2026-02-18) — FR-023 retired. Merge 3D rendering into worker-file-vectorize.
2416
+
2417
+ - `modelFinderResponse(data: ModelFinderResponseMessage): Promise<JobResponse>`
2418
+ - DEPRECATED (2026-02-18) — FR-023 retired. Merge 3D rendering into worker-file-vectorize.
2419
+
2420
+ - `modelFinderSearchRequest(data: ModelFinderSearchRequestMessage): Promise<JobResponse>`
2421
+ - DEPRECATED (2026-02-18) — FR-023 retired. Merge 3D rendering into worker-file-vectorize.
2422
+
631
2423
  - `modelMetadataGenerationCompleted(data: ModelMetadataGenerationCompletedMessage): Promise<JobResponse>`
632
- - Handles model metadata generation completed.
2424
+ - Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
633
2425
 
634
2426
  - `modelMetadataGenerationRequest(data: ModelMetadataGenerationRequestMessage): Promise<JobResponse>`
635
- - Handles model metadata generation requests.
2427
+ - 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.
636
2428
 
637
2429
  - `modelMetamodelDetectionFound(data: ModelMetamodelDetectionFoundMessage): Promise<JobResponse>`
638
2430
  - Handles model metamodel detection found with hierarchical relationships.
@@ -640,17 +2432,93 @@ new WorkerClient(config: WorkerClientConfig)
640
2432
  - `modelMetamodelDetectionRequest(data: ModelMetamodelDetectionRequestMessage): Promise<JobResponse>`
641
2433
  - Handles model metamodel detection requests.
642
2434
 
2435
+ - `modelPrintAnalysisCompleted(data: ModelPrintAnalysisCompletedMessage): Promise<JobResponse>`
2436
+ - Reports completion of 3D print analysis — contains estimation, printability, and cost breakdown per FR-022
2437
+
2438
+ - `modelPrintAnalysisRequest(data: ModelPrintAnalysisRequestMessage): Promise<JobResponse>`
2439
+ - Triggers 3D print analysis for a model — estimates print time, material usage, support needs, and cost breakdown per FR-022
2440
+
2441
+ - `modelSellabilityAnalysisCompleted(data: ModelSellabilityAnalysisCompletedMessage): Promise<JobResponse>`
2442
+ - Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
2443
+
2444
+ - `modelSellabilityAnalysisRequest(data: ModelSellabilityAnalysisRequestMessage): Promise<JobResponse>`
2445
+ - 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.
2446
+
2447
+ - `modelSemanticAnalysisCompleted(data: ModelSemanticAnalysisCompletedMessage): Promise<JobResponse>`
2448
+ - Handles completion of 3D model semantic analysis with generated tags and similarity results.
2449
+
2450
+ - `modelSemanticAnalysisRequest(data: ModelSemanticAnalysisRequestMessage): Promise<JobResponse>`
2451
+ - Handles 3D model semantic analysis requests using ULIP-2 neural networks and FAISS vector similarity search.
2452
+
643
2453
  - `modelTechnicalMetadataCompleted(data: ModelTechnicalMetadataCompletedMessage): Promise<JobResponse>`
644
2454
  - Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
645
2455
 
646
2456
  - `modelTechnicalMetadataRequest(data: ModelTechnicalMetadataRequestMessage): Promise<JobResponse>`
647
2457
  - Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
648
2458
 
2459
+ - `slicingFdmRequest(data: SlicingFdmRequestMessage): Promise<JobResponse>`
2460
+ - Request FDM slicing simulation via OrcaSlicer (preferred) or heuristic fallback. Accepts OrcaSlicer-compatible printer/process/filament JSON profiles.
2461
+
2462
+ - `slicingFdmResult(data: SlicingFdmResultMessage): Promise<JobResponse>`
2463
+ - Result of FDM slicing simulation from OrcaSlicer (toolpath) or heuristic fallback. Contains exact physical metrics for cost calculation.
2464
+
2465
+ - `slicingSlaRequest(data: SlicingSlaRequestMessage): Promise<JobResponse>`
2466
+ - Request SLA/MSLA slicing simulation via PySLM cross-sectional analysis. Accepts resin printer profile with exposure, lift, and layer parameters.
2467
+
2468
+ - `slicingSlaResult(data: SlicingSlaResultMessage): Promise<JobResponse>`
2469
+ - Result of SLA/MSLA slicing simulation from PySLM cross-sectional analysis. Contains exact resin usage and print time metrics.
2470
+
2471
+ - `textureGenerationCompleted(data: TextureGenerationCompletedMessage): Promise<JobResponse>`
2472
+ - Emitted when AI texture generation completes (success or failure). Contains artifact S3 URLs on success, or error details on failure. The credit reservation should be confirmed (success) or released (failure) based on the status.
2473
+
2474
+ - `textureGenerationRequest(data: TextureGenerationRequestMessage): Promise<JobResponse>`
2475
+ - Request AI-powered texture generation for a 3D model. Requires a mesh file URL and a text prompt describing the desired texture. Credits are reserved before dispatch.
2476
+
649
2477
  - `thumbnailGenerationCompleted(data: ThumbnailGenerationCompletedMessage): Promise<JobResponse>`
650
2478
  - Handles thumbnail generation completed.
651
2479
 
652
2480
  - `thumbnailGenerationRequest(data: ThumbnailGenerationRequestMessage): Promise<JobResponse>`
653
- - Handles thumbnail generation requests with customization options.
2481
+ - Handles thumbnail generation requests with customization options. Supports both storage provider downloads and MinIO-cached files.
2482
+
2483
+ - `userEngagementEvent(data: UserEngagementEventMessage): Promise<JobResponse>`
2484
+ - User engagement and onboarding tracking events for analytics and behavioral insights.
2485
+
2486
+ Captures key user actions throughout their journey:
2487
+ - Account creation and onboarding steps
2488
+ - Feature usage and adoption
2489
+ - Model management activities
2490
+ - Marketplace interactions
2491
+ - Subscription changes
2492
+
2493
+ Used for:
2494
+ - User onboarding funnel analysis
2495
+ - Feature adoption tracking
2496
+ - User retention metrics
2497
+ - A/B testing and experimentation
2498
+ - Personalization and recommendations
2499
+ - Product analytics dashboards
2500
+
2501
+
2502
+ - `workerAnalyticsEvent(data: WorkerAnalyticsEventMessage): Promise<JobResponse>`
2503
+ - Analytics event emitted by workers for tracking processing metrics, user behavior,
2504
+ and model statistics. Consumed by worker-analytic-collector and forwarded to ELK.
2505
+
2506
+ All workers MUST emit this event upon job completion (success or failure).
2507
+ Each worker includes its specific metrics in the `metrics` object.
2508
+
2509
+
2510
+ - `workerMetricsEnrichedEvent(data: WorkerMetricsEnrichedEventMessage): Promise<JobResponse>`
2511
+ - Enriched metrics event for detailed worker monitoring, cost tracking,
2512
+ and performance analysis. Published to backend.logging.events for
2513
+ centralized monitoring and cost attribution.
2514
+
2515
+ This event is emitted by all workers on job completion and includes:
2516
+ - LLM token usage and cost breakdown
2517
+ - System resource consumption (CPU, RAM, disk I/O)
2518
+ - Detailed timing breakdown by stage
2519
+ - User and context attribution
2520
+ - Model-specific metadata
2521
+
654
2522
 
655
2523
 
656
2524
  ### Response Types