@mesh-sync/worker-backend-client 1.0.6 → 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/dist/client.d.ts CHANGED
@@ -37,6 +37,35 @@ export declare class WorkerClient {
37
37
  * Get job status by job ID
38
38
  */
39
39
  getJobStatus(jobId: string): Promise<JobStatus>;
40
+ /**
41
+ * Request to trigger a manual market data collection job.
42
+ Used for ad-hoc scraping of specific queries on marketplaces.
43
+
44
+ * @param data - The message payload
45
+ * @returns Job response with job ID
46
+ */
47
+ analyticsCollectionRequest(data: types.AnalyticsCollectionRequestMessage): Promise<JobResponse>;
48
+ /**
49
+ * Centralized logging event for capturing all warn/error/failure logs from meshsync-backend.
50
+ This event is sent to ELK for centralized monitoring, alerting, and debugging.
51
+
52
+ Automatically emitted by the custom Pino logger interceptor when:
53
+ - logger.warn() is called
54
+ - logger.error() is called
55
+ - uncaught exceptions occur
56
+ - request failures happen (4xx, 5xx responses)
57
+
58
+ Used for:
59
+ - System health monitoring
60
+ - Error tracking and alerting
61
+ - Performance degradation detection
62
+ - Security incident tracking
63
+ - Compliance and audit trails
64
+
65
+ * @param data - The message payload
66
+ * @returns Job response with job ID
67
+ */
68
+ backendLoggingEvent(data: types.BackendLoggingEventMessage): Promise<JobResponse>;
40
69
  /**
41
70
  * Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
42
71
 
@@ -75,35 +104,186 @@ export declare class WorkerClient {
75
104
  */
76
105
  fileDownloadCompleted(data: types.FileDownloadCompletedMessage): Promise<JobResponse>;
77
106
  /**
78
- * Handles file download requests.
107
+ * Downloads model file from storage provider to MinIO for processing pipeline.
108
+ Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
109
+
110
+ Retry Configuration:
111
+ - Automatic retry enabled for transient failures (connection errors, timeouts)
112
+ - Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
113
+ - Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
114
+ - No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
115
+
79
116
  * @param data - The message payload
80
117
  * @returns Job response with job ID
81
118
  */
82
119
  fileDownloadRequest(data: types.FileDownloadRequestMessage): Promise<JobResponse>;
83
120
  /**
84
- * Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
121
+ * Result of the vectorization process containing the embedding vector.
122
+ * @param data - The message payload
123
+ * @returns Job response with job ID
124
+ */
125
+ fileVectorizeCompleted(data: types.FileVectorizeCompletedMessage): Promise<JobResponse>;
126
+ /**
127
+ * Request to generate a vector embedding for an image file using CLIP.
128
+ * @param data - The message payload
129
+ * @returns Job response with job ID
130
+ */
131
+ fileVectorizeRequest(data: types.FileVectorizeRequestMessage): Promise<JobResponse>;
132
+ /**
133
+ * Contains IP verification results including trademark risk, copyright risk, detected brands/franchises, and analysis confidence scores
134
+ * @param data - The message payload
135
+ * @returns Job response with job ID
136
+ */
137
+ ipCheckCompleted(data: types.IpCheckCompletedMessage): Promise<JobResponse>;
138
+ /**
139
+ * 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.
140
+ * @param data - The message payload
141
+ * @returns Job response with job ID
142
+ */
143
+ ipCheckRequest(data: types.IpCheckRequestMessage): Promise<JobResponse>;
144
+ /**
145
+ * Notification that marketplace connection sync has completed. Contains updated connection metadata, profile information, and sync statistics.
146
+
147
+ * @param data - The message payload
148
+ * @returns Job response with job ID
149
+ */
150
+ marketplaceConnectionSyncCompleted(data: types.MarketplaceConnectionSyncCompletedMessage): Promise<JobResponse>;
151
+ /**
152
+ * 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
153
+ This is typically triggered after initial connection or periodically to keep marketplace metadata up to date.
154
+
155
+ * @param data - The message payload
156
+ * @returns Job response with job ID
157
+ */
158
+ marketplaceConnectionSyncRequest(data: types.MarketplaceConnectionSyncRequestMessage): Promise<JobResponse>;
159
+ /**
160
+ * Notification that marketplace credential rotation has completed. Contains the rotation results, new credential metadata, and any issues encountered.
161
+
162
+ * @param data - The message payload
163
+ * @returns Job response with job ID
164
+ */
165
+ marketplaceCredentialRotationCompleted(data: types.MarketplaceCredentialRotationCompletedMessage): Promise<JobResponse>;
166
+ /**
167
+ * 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
168
+
169
+ * @param data - The message payload
170
+ * @returns Job response with job ID
171
+ */
172
+ marketplaceCredentialRotationRequest(data: types.MarketplaceCredentialRotationRequestMessage): Promise<JobResponse>;
173
+ /**
174
+ * Response from marketplace intelligence scraping.
175
+ Contains aggregated similarity data from marketplace searches.
176
+
177
+ Consumed by worker-backend to update pipeline context before
178
+ sellability analysis runs.
179
+
180
+ * @param data - The message payload
181
+ * @returns Job response with job ID
182
+ */
183
+ marketplaceIntelligenceCompleted(data: types.MarketplaceIntelligenceCompletedMessage): Promise<JobResponse>;
184
+ /**
185
+ * Public marketplace intelligence data scraped from external marketplaces.
186
+
187
+ This event contains:
188
+ - Listing details (title, price, images)
189
+ - Engagement metrics (views, favorites, reviews)
190
+ - Shop information
191
+ - Market positioning data
192
+
193
+ Unlike marketplace-listing-sync-request (private user data), this focuses on:
194
+ - Broad market trends and pricing analysis
195
+ - Competitive intelligence and demand signals
196
+ - Product popularity and sentiment
197
+
198
+ Consumed by worker-analytic-collector for Elasticsearch indexing.
199
+ Used for market research, pricing optimization, and trend detection.
200
+
201
+ * @param data - The message payload
202
+ * @returns Job response with job ID
203
+ */
204
+ marketplaceIntelligenceEvent(data: types.MarketplaceIntelligenceEventMessage): Promise<JobResponse>;
205
+ /**
206
+ * Triggers automated marketplace scraping to find similar/competing listings
207
+ for a given model. This is a pipeline stage that runs after metadata generation
208
+ to inform sellability analysis with real market data.
209
+
210
+ The worker-analytic-collector (or marketplace-connectors worker) will:
211
+ 1. Use model metadata (title, tags, category) to build search queries
212
+ 2. Scrape connected marketplaces (Etsy, eBay, etc.) for similar listings
213
+ 3. Emit marketplace-intelligence-event results for Elasticsearch indexing
214
+ 4. Return aggregated similarity data to the pipeline context
215
+
216
+ Pipeline integration:
217
+ - Triggered after: metadata-generation (needs model title/tags/category)
218
+ - Results feed into: sellability-analysis (market positioning data)
219
+
220
+ * @param data - The message payload
221
+ * @returns Job response with job ID
222
+ */
223
+ marketplaceIntelligenceRequest(data: types.MarketplaceIntelligenceRequestMessage): Promise<JobResponse>;
224
+ /**
225
+ * Notifies backend that marketplace description generation completed. Contains generated description with metadata tracking (AI model, confidence, generation timestamp) and suggested price.
226
+ * @param data - The message payload
227
+ * @returns Job response with job ID
228
+ */
229
+ marketplaceListingDescriptionGenerationCompleted(data: types.MarketplaceListingDescriptionGenerationCompletedMessage): Promise<JobResponse>;
230
+ /**
231
+ * 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.
232
+ * @param data - The message payload
233
+ * @returns Job response with job ID
234
+ */
235
+ marketplaceListingDescriptionGenerationRequest(data: types.MarketplaceListingDescriptionGenerationRequestMessage): Promise<JobResponse>;
236
+ /**
237
+ * Notification that marketplace listing sync operation has completed. Contains detailed results of the sync including created/updated listings, errors encountered, and performance statistics.
238
+
239
+ * @param data - The message payload
240
+ * @returns Job response with job ID
241
+ */
242
+ marketplaceListingSyncCompleted(data: types.MarketplaceListingSyncCompletedMessage): Promise<JobResponse>;
243
+ /**
244
+ * Requests synchronization of marketplace listings for a connection. Can sync specific listings or all listings for a marketplace connection.
245
+ 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
246
+
247
+ * @param data - The message payload
248
+ * @returns Job response with job ID
249
+ */
250
+ marketplaceListingSyncRequest(data: types.MarketplaceListingSyncRequestMessage): Promise<JobResponse>;
251
+ /**
252
+ * Notifies backend that marketplace tags generation completed. Contains generated tags optimized for discoverability with metadata tracking.
253
+ * @param data - The message payload
254
+ * @returns Job response with job ID
255
+ */
256
+ marketplaceListingTagsGenerationCompleted(data: types.MarketplaceListingTagsGenerationCompletedMessage): Promise<JobResponse>;
257
+ /**
258
+ * 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.
85
259
  * @param data - The message payload
86
260
  * @returns Job response with job ID
87
261
  */
88
- marketplaceAnalyticsSyncCompleted(data: types.MarketplaceAnalyticsSyncCompletedMessage): Promise<JobResponse>;
262
+ marketplaceListingTagsGenerationRequest(data: types.MarketplaceListingTagsGenerationRequestMessage): Promise<JobResponse>;
89
263
  /**
90
- * Syncs analytics data from marketplace API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data. Can sync: specific listings, all user listings, or shop-level analytics. Works with any marketplace provider that supports analytics (etsy, ebay, etc.).
264
+ * Notifies backend that marketplace title generation completed. Contains generated title with metadata tracking.
91
265
  * @param data - The message payload
92
266
  * @returns Job response with job ID
93
267
  */
94
- marketplaceAnalyticsSyncRequest(data: types.MarketplaceAnalyticsSyncRequestMessage): Promise<JobResponse>;
268
+ marketplaceListingTitleGenerationCompleted(data: types.MarketplaceListingTitleGenerationCompletedMessage): Promise<JobResponse>;
95
269
  /**
96
- * Indicates completion of marketplace listing publication. Contains external listing ID and URL, or error details if failed. Works with any marketplace provider (etsy, ebay, etc.).
270
+ * Generates marketplace-optimized title for a 3D model. Worker creates concise, SEO-friendly titles following marketplace character limits and best practices.
97
271
  * @param data - The message payload
98
272
  * @returns Job response with job ID
99
273
  */
100
- marketplacePublishListingCompleted(data: types.MarketplacePublishListingCompletedMessage): Promise<JobResponse>;
274
+ marketplaceListingTitleGenerationRequest(data: types.MarketplaceListingTitleGenerationRequestMessage): Promise<JobResponse>;
101
275
  /**
102
- * Publishes a single metamodel listing to a marketplace for a specific material variant. Creates listing, uploads digital file, and returns external listing ID. This message is enqueued for EACH material variant when publishing a metamodel. The marketplace type (etsy, ebay, etc.) is determined by the marketplaceProvider field.
276
+ * Result of a listing update operation
103
277
  * @param data - The message payload
104
278
  * @returns Job response with job ID
105
279
  */
106
- marketplacePublishListingRequest(data: types.MarketplacePublishListingRequestMessage): Promise<JobResponse>;
280
+ marketplaceListingUpdateCompleted(data: types.MarketplaceListingUpdateCompletedMessage): Promise<JobResponse>;
281
+ /**
282
+ * Request to update an existing listing on a marketplace (price, quantity, etc.)
283
+ * @param data - The message payload
284
+ * @returns Job response with job ID
285
+ */
286
+ marketplaceListingUpdateRequest(data: types.MarketplaceListingUpdateRequestMessage): Promise<JobResponse>;
107
287
  /**
108
288
  * Notifies that a batch media download has been completed.
109
289
  * @param data - The message payload
@@ -129,6 +309,17 @@ export declare class WorkerClient {
129
309
  * @returns Job response with job ID
130
310
  */
131
311
  metamodelMetadataGenerationRequest(data: types.MetamodelMetadataGenerationRequestMessage): Promise<JobResponse>;
312
+ /**
313
+ * Request to collect marketplace analytics for a specific metamodel.
314
+ Triggered by backend scheduler every 6 hours for popular/tagged metamodels.
315
+
316
+ Worker performs targeted market searches based on metamodel metadata
317
+ and stores aggregated statistics in Elasticsearch for trend analysis.
318
+
319
+ * @param data - The message payload
320
+ * @returns Job response with job ID
321
+ */
322
+ modelAnalyticsCollectionRequest(data: types.ModelAnalyticsCollectionRequestMessage): Promise<JobResponse>;
132
323
  /**
133
324
  * Handles model discovery folder processed events.
134
325
  * @param data - The message payload
@@ -154,13 +345,31 @@ export declare class WorkerClient {
154
345
  */
155
346
  modelDiscoveryScanRequest(data: types.ModelDiscoveryScanRequestMessage): Promise<JobResponse>;
156
347
  /**
157
- * Handles model metadata generation completed.
348
+ * DEPRECATED (2026-02-18) FR-023 retired. Merge 3D rendering into worker-file-vectorize.
349
+ * @param data - The message payload
350
+ * @returns Job response with job ID
351
+ */
352
+ modelFinderIndexRequest(data: types.ModelFinderIndexRequestMessage): Promise<JobResponse>;
353
+ /**
354
+ * DEPRECATED (2026-02-18) — FR-023 retired. Merge 3D rendering into worker-file-vectorize.
355
+ * @param data - The message payload
356
+ * @returns Job response with job ID
357
+ */
358
+ modelFinderResponse(data: types.ModelFinderResponseMessage): Promise<JobResponse>;
359
+ /**
360
+ * DEPRECATED (2026-02-18) — FR-023 retired. Merge 3D rendering into worker-file-vectorize.
361
+ * @param data - The message payload
362
+ * @returns Job response with job ID
363
+ */
364
+ modelFinderSearchRequest(data: types.ModelFinderSearchRequestMessage): Promise<JobResponse>;
365
+ /**
366
+ * Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
158
367
  * @param data - The message payload
159
368
  * @returns Job response with job ID
160
369
  */
161
370
  modelMetadataGenerationCompleted(data: types.ModelMetadataGenerationCompletedMessage): Promise<JobResponse>;
162
371
  /**
163
- * Handles model metadata generation requests.
372
+ * 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.
164
373
  * @param data - The message payload
165
374
  * @returns Job response with job ID
166
375
  */
@@ -177,6 +386,18 @@ export declare class WorkerClient {
177
386
  * @returns Job response with job ID
178
387
  */
179
388
  modelMetamodelDetectionRequest(data: types.ModelMetamodelDetectionRequestMessage): Promise<JobResponse>;
389
+ /**
390
+ * Reports completion of 3D print analysis — contains estimation, printability, and cost breakdown per FR-022
391
+ * @param data - The message payload
392
+ * @returns Job response with job ID
393
+ */
394
+ modelPrintAnalysisCompleted(data: types.ModelPrintAnalysisCompletedMessage): Promise<JobResponse>;
395
+ /**
396
+ * Triggers 3D print analysis for a model — estimates print time, material usage, support needs, and cost breakdown per FR-022
397
+ * @param data - The message payload
398
+ * @returns Job response with job ID
399
+ */
400
+ modelPrintAnalysisRequest(data: types.ModelPrintAnalysisRequestMessage): Promise<JobResponse>;
180
401
  /**
181
402
  * Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
182
403
  * @param data - The message payload
@@ -189,6 +410,18 @@ export declare class WorkerClient {
189
410
  * @returns Job response with job ID
190
411
  */
191
412
  modelSellabilityAnalysisRequest(data: types.ModelSellabilityAnalysisRequestMessage): Promise<JobResponse>;
413
+ /**
414
+ * Handles completion of 3D model semantic analysis with generated tags and similarity results.
415
+ * @param data - The message payload
416
+ * @returns Job response with job ID
417
+ */
418
+ modelSemanticAnalysisCompleted(data: types.ModelSemanticAnalysisCompletedMessage): Promise<JobResponse>;
419
+ /**
420
+ * Handles 3D model semantic analysis requests using ULIP-2 neural networks and FAISS vector similarity search.
421
+ * @param data - The message payload
422
+ * @returns Job response with job ID
423
+ */
424
+ modelSemanticAnalysisRequest(data: types.ModelSemanticAnalysisRequestMessage): Promise<JobResponse>;
192
425
  /**
193
426
  * Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
194
427
  * @param data - The message payload
@@ -201,6 +434,42 @@ export declare class WorkerClient {
201
434
  * @returns Job response with job ID
202
435
  */
203
436
  modelTechnicalMetadataRequest(data: types.ModelTechnicalMetadataRequestMessage): Promise<JobResponse>;
437
+ /**
438
+ * Request FDM slicing simulation via OrcaSlicer (preferred) or heuristic fallback. Accepts OrcaSlicer-compatible printer/process/filament JSON profiles.
439
+ * @param data - The message payload
440
+ * @returns Job response with job ID
441
+ */
442
+ slicingFdmRequest(data: types.SlicingFdmRequestMessage): Promise<JobResponse>;
443
+ /**
444
+ * Result of FDM slicing simulation from OrcaSlicer (toolpath) or heuristic fallback. Contains exact physical metrics for cost calculation.
445
+ * @param data - The message payload
446
+ * @returns Job response with job ID
447
+ */
448
+ slicingFdmResult(data: types.SlicingFdmResultMessage): Promise<JobResponse>;
449
+ /**
450
+ * Request SLA/MSLA slicing simulation via PySLM cross-sectional analysis. Accepts resin printer profile with exposure, lift, and layer parameters.
451
+ * @param data - The message payload
452
+ * @returns Job response with job ID
453
+ */
454
+ slicingSlaRequest(data: types.SlicingSlaRequestMessage): Promise<JobResponse>;
455
+ /**
456
+ * Result of SLA/MSLA slicing simulation from PySLM cross-sectional analysis. Contains exact resin usage and print time metrics.
457
+ * @param data - The message payload
458
+ * @returns Job response with job ID
459
+ */
460
+ slicingSlaResult(data: types.SlicingSlaResultMessage): Promise<JobResponse>;
461
+ /**
462
+ * 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.
463
+ * @param data - The message payload
464
+ * @returns Job response with job ID
465
+ */
466
+ textureGenerationCompleted(data: types.TextureGenerationCompletedMessage): Promise<JobResponse>;
467
+ /**
468
+ * 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.
469
+ * @param data - The message payload
470
+ * @returns Job response with job ID
471
+ */
472
+ textureGenerationRequest(data: types.TextureGenerationRequestMessage): Promise<JobResponse>;
204
473
  /**
205
474
  * Handles thumbnail generation completed.
206
475
  * @param data - The message payload
@@ -208,9 +477,58 @@ export declare class WorkerClient {
208
477
  */
209
478
  thumbnailGenerationCompleted(data: types.ThumbnailGenerationCompletedMessage): Promise<JobResponse>;
210
479
  /**
211
- * Handles thumbnail generation requests with customization options.
480
+ * Handles thumbnail generation requests with customization options. Supports both storage provider downloads and MinIO-cached files.
212
481
  * @param data - The message payload
213
482
  * @returns Job response with job ID
214
483
  */
215
484
  thumbnailGenerationRequest(data: types.ThumbnailGenerationRequestMessage): Promise<JobResponse>;
485
+ /**
486
+ * User engagement and onboarding tracking events for analytics and behavioral insights.
487
+
488
+ Captures key user actions throughout their journey:
489
+ - Account creation and onboarding steps
490
+ - Feature usage and adoption
491
+ - Model management activities
492
+ - Marketplace interactions
493
+ - Subscription changes
494
+
495
+ Used for:
496
+ - User onboarding funnel analysis
497
+ - Feature adoption tracking
498
+ - User retention metrics
499
+ - A/B testing and experimentation
500
+ - Personalization and recommendations
501
+ - Product analytics dashboards
502
+
503
+ * @param data - The message payload
504
+ * @returns Job response with job ID
505
+ */
506
+ userEngagementEvent(data: types.UserEngagementEventMessage): Promise<JobResponse>;
507
+ /**
508
+ * Analytics event emitted by workers for tracking processing metrics, user behavior,
509
+ and model statistics. Consumed by worker-analytic-collector and forwarded to ELK.
510
+
511
+ All workers MUST emit this event upon job completion (success or failure).
512
+ Each worker includes its specific metrics in the `metrics` object.
513
+
514
+ * @param data - The message payload
515
+ * @returns Job response with job ID
516
+ */
517
+ workerAnalyticsEvent(data: types.WorkerAnalyticsEventMessage): Promise<JobResponse>;
518
+ /**
519
+ * Enriched metrics event for detailed worker monitoring, cost tracking,
520
+ and performance analysis. Published to backend.logging.events for
521
+ centralized monitoring and cost attribution.
522
+
523
+ This event is emitted by all workers on job completion and includes:
524
+ - LLM token usage and cost breakdown
525
+ - System resource consumption (CPU, RAM, disk I/O)
526
+ - Detailed timing breakdown by stage
527
+ - User and context attribution
528
+ - Model-specific metadata
529
+
530
+ * @param data - The message payload
531
+ * @returns Job response with job ID
532
+ */
533
+ workerMetricsEnrichedEvent(data: types.WorkerMetricsEnrichedEventMessage): Promise<JobResponse>;
216
534
  }