@mesh-sync/worker-backend-client 1.0.6 → 4.0.3

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,27 @@ export declare class WorkerClient {
37
37
  * Get job status by job ID
38
38
  */
39
39
  getJobStatus(jobId: string): Promise<JobStatus>;
40
+ /**
41
+ * Centralized logging event for capturing all warn/error/failure logs from meshsync-backend.
42
+ This event is sent to ELK for centralized monitoring, alerting, and debugging.
43
+
44
+ Automatically emitted by the custom Pino logger interceptor when:
45
+ - logger.warn() is called
46
+ - logger.error() is called
47
+ - uncaught exceptions occur
48
+ - request failures happen (4xx, 5xx responses)
49
+
50
+ Used for:
51
+ - System health monitoring
52
+ - Error tracking and alerting
53
+ - Performance degradation detection
54
+ - Security incident tracking
55
+ - Compliance and audit trails
56
+
57
+ * @param data - The message payload
58
+ * @returns Job response with job ID
59
+ */
60
+ backendLoggingEvent(data: types.BackendLoggingEventMessage): Promise<JobResponse>;
40
61
  /**
41
62
  * Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
42
63
 
@@ -75,7 +96,7 @@ export declare class WorkerClient {
75
96
  */
76
97
  fileDownloadCompleted(data: types.FileDownloadCompletedMessage): Promise<JobResponse>;
77
98
  /**
78
- * Handles file download requests.
99
+ * Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
79
100
  * @param data - The message payload
80
101
  * @returns Job response with job ID
81
102
  */
@@ -92,6 +113,50 @@ export declare class WorkerClient {
92
113
  * @returns Job response with job ID
93
114
  */
94
115
  marketplaceAnalyticsSyncRequest(data: types.MarketplaceAnalyticsSyncRequestMessage): Promise<JobResponse>;
116
+ /**
117
+ * Notification that marketplace connection sync has completed. Contains updated connection metadata, profile information, and sync statistics.
118
+
119
+ * @param data - The message payload
120
+ * @returns Job response with job ID
121
+ */
122
+ marketplaceConnectionSyncCompleted(data: types.MarketplaceConnectionSyncCompletedMessage): Promise<JobResponse>;
123
+ /**
124
+ * 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
125
+ This is typically triggered after initial connection or periodically to keep marketplace metadata up to date.
126
+
127
+ * @param data - The message payload
128
+ * @returns Job response with job ID
129
+ */
130
+ marketplaceConnectionSyncRequest(data: types.MarketplaceConnectionSyncRequestMessage): Promise<JobResponse>;
131
+ /**
132
+ * Notification that marketplace credential rotation has completed. Contains the rotation results, new credential metadata, and any issues encountered.
133
+
134
+ * @param data - The message payload
135
+ * @returns Job response with job ID
136
+ */
137
+ marketplaceCredentialRotationCompleted(data: types.MarketplaceCredentialRotationCompletedMessage): Promise<JobResponse>;
138
+ /**
139
+ * 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
140
+
141
+ * @param data - The message payload
142
+ * @returns Job response with job ID
143
+ */
144
+ marketplaceCredentialRotationRequest(data: types.MarketplaceCredentialRotationRequestMessage): Promise<JobResponse>;
145
+ /**
146
+ * Notification that marketplace listing sync operation has completed. Contains detailed results of the sync including created/updated listings, errors encountered, and performance statistics.
147
+
148
+ * @param data - The message payload
149
+ * @returns Job response with job ID
150
+ */
151
+ marketplaceListingSyncCompleted(data: types.MarketplaceListingSyncCompletedMessage): Promise<JobResponse>;
152
+ /**
153
+ * Requests synchronization of marketplace listings for a connection. Can sync specific listings or all listings for a marketplace connection.
154
+ 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
155
+
156
+ * @param data - The message payload
157
+ * @returns Job response with job ID
158
+ */
159
+ marketplaceListingSyncRequest(data: types.MarketplaceListingSyncRequestMessage): Promise<JobResponse>;
95
160
  /**
96
161
  * 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.).
97
162
  * @param data - The message payload
@@ -129,6 +194,17 @@ export declare class WorkerClient {
129
194
  * @returns Job response with job ID
130
195
  */
131
196
  metamodelMetadataGenerationRequest(data: types.MetamodelMetadataGenerationRequestMessage): Promise<JobResponse>;
197
+ /**
198
+ * Request to collect marketplace analytics for a specific metamodel.
199
+ Triggered by backend scheduler every 6 hours for popular/tagged metamodels.
200
+
201
+ Worker performs targeted market searches based on metamodel metadata
202
+ and stores aggregated statistics in Elasticsearch for trend analysis.
203
+
204
+ * @param data - The message payload
205
+ * @returns Job response with job ID
206
+ */
207
+ modelAnalyticsCollectionRequest(data: types.ModelAnalyticsCollectionRequestMessage): Promise<JobResponse>;
132
208
  /**
133
209
  * Handles model discovery folder processed events.
134
210
  * @param data - The message payload
@@ -154,13 +230,13 @@ export declare class WorkerClient {
154
230
  */
155
231
  modelDiscoveryScanRequest(data: types.ModelDiscoveryScanRequestMessage): Promise<JobResponse>;
156
232
  /**
157
- * Handles model metadata generation completed.
233
+ * Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
158
234
  * @param data - The message payload
159
235
  * @returns Job response with job ID
160
236
  */
161
237
  modelMetadataGenerationCompleted(data: types.ModelMetadataGenerationCompletedMessage): Promise<JobResponse>;
162
238
  /**
163
- * Handles model metadata generation requests.
239
+ * Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM analysis with optional vision capabilities. Worker fetches model data from database and uses thumbnails for enhanced analysis when available. Prerequisites: file download, thumbnail generation (optional for vision), and technical metadata analysis (strongly recommended).
164
240
  * @param data - The message payload
165
241
  * @returns Job response with job ID
166
242
  */
@@ -189,6 +265,18 @@ export declare class WorkerClient {
189
265
  * @returns Job response with job ID
190
266
  */
191
267
  modelSellabilityAnalysisRequest(data: types.ModelSellabilityAnalysisRequestMessage): Promise<JobResponse>;
268
+ /**
269
+ * Handles completion of 3D model semantic analysis with generated tags and similarity results.
270
+ * @param data - The message payload
271
+ * @returns Job response with job ID
272
+ */
273
+ modelSemanticAnalysisCompleted(data: types.ModelSemanticAnalysisCompletedMessage): Promise<JobResponse>;
274
+ /**
275
+ * Handles 3D model semantic analysis requests using ULIP-2 neural networks and FAISS vector similarity search.
276
+ * @param data - The message payload
277
+ * @returns Job response with job ID
278
+ */
279
+ modelSemanticAnalysisRequest(data: types.ModelSemanticAnalysisRequestMessage): Promise<JobResponse>;
192
280
  /**
193
281
  * Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
194
282
  * @param data - The message payload
@@ -208,9 +296,58 @@ export declare class WorkerClient {
208
296
  */
209
297
  thumbnailGenerationCompleted(data: types.ThumbnailGenerationCompletedMessage): Promise<JobResponse>;
210
298
  /**
211
- * Handles thumbnail generation requests with customization options.
299
+ * Handles thumbnail generation requests with customization options. Supports both storage provider downloads and MinIO-cached files.
212
300
  * @param data - The message payload
213
301
  * @returns Job response with job ID
214
302
  */
215
303
  thumbnailGenerationRequest(data: types.ThumbnailGenerationRequestMessage): Promise<JobResponse>;
304
+ /**
305
+ * User engagement and onboarding tracking events for analytics and behavioral insights.
306
+
307
+ Captures key user actions throughout their journey:
308
+ - Account creation and onboarding steps
309
+ - Feature usage and adoption
310
+ - Model management activities
311
+ - Marketplace interactions
312
+ - Subscription changes
313
+
314
+ Used for:
315
+ - User onboarding funnel analysis
316
+ - Feature adoption tracking
317
+ - User retention metrics
318
+ - A/B testing and experimentation
319
+ - Personalization and recommendations
320
+ - Product analytics dashboards
321
+
322
+ * @param data - The message payload
323
+ * @returns Job response with job ID
324
+ */
325
+ userEngagementEvent(data: types.UserEngagementEventMessage): Promise<JobResponse>;
326
+ /**
327
+ * Analytics event emitted by workers for tracking processing metrics, user behavior,
328
+ and model statistics. Consumed by worker-analytic-collector and forwarded to ELK.
329
+
330
+ All workers MUST emit this event upon job completion (success or failure).
331
+ Each worker includes its specific metrics in the `metrics` object.
332
+
333
+ * @param data - The message payload
334
+ * @returns Job response with job ID
335
+ */
336
+ workerAnalyticsEvent(data: types.WorkerAnalyticsEventMessage): Promise<JobResponse>;
337
+ /**
338
+ * Enriched metrics event for detailed worker monitoring, cost tracking,
339
+ and performance analysis. Published to backend.logging.events for
340
+ centralized monitoring and cost attribution.
341
+
342
+ This event is emitted by all workers on job completion and includes:
343
+ - LLM token usage and cost breakdown
344
+ - System resource consumption (CPU, RAM, disk I/O)
345
+ - Detailed timing breakdown by stage
346
+ - User and context attribution
347
+ - Model-specific metadata
348
+
349
+ * @param data - The message payload
350
+ * @returns Job response with job ID
351
+ */
352
+ workerMetricsEnrichedEvent(data: types.WorkerMetricsEnrichedEventMessage): Promise<JobResponse>;
216
353
  }
package/dist/client.js CHANGED
@@ -60,6 +60,29 @@ export class WorkerClient {
60
60
  }
61
61
  return await response.json();
62
62
  }
63
+ /**
64
+ * Centralized logging event for capturing all warn/error/failure logs from meshsync-backend.
65
+ This event is sent to ELK for centralized monitoring, alerting, and debugging.
66
+
67
+ Automatically emitted by the custom Pino logger interceptor when:
68
+ - logger.warn() is called
69
+ - logger.error() is called
70
+ - uncaught exceptions occur
71
+ - request failures happen (4xx, 5xx responses)
72
+
73
+ Used for:
74
+ - System health monitoring
75
+ - Error tracking and alerting
76
+ - Performance degradation detection
77
+ - Security incident tracking
78
+ - Compliance and audit trails
79
+
80
+ * @param data - The message payload
81
+ * @returns Job response with job ID
82
+ */
83
+ async backendLoggingEvent(data) {
84
+ return this.sendToQueue(types.MessageTypes.BACKEND_LOGGING_EVENT, data);
85
+ }
63
86
  /**
64
87
  * Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
65
88
 
@@ -108,7 +131,7 @@ export class WorkerClient {
108
131
  return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_COMPLETED, data);
109
132
  }
110
133
  /**
111
- * Handles file download requests.
134
+ * Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
112
135
  * @param data - The message payload
113
136
  * @returns Job response with job ID
114
137
  */
@@ -131,6 +154,62 @@ export class WorkerClient {
131
154
  async marketplaceAnalyticsSyncRequest(data) {
132
155
  return this.sendToQueue(types.MessageTypes.MARKETPLACE_ANALYTICS_SYNC_REQUEST, data);
133
156
  }
157
+ /**
158
+ * Notification that marketplace connection sync has completed. Contains updated connection metadata, profile information, and sync statistics.
159
+
160
+ * @param data - The message payload
161
+ * @returns Job response with job ID
162
+ */
163
+ async marketplaceConnectionSyncCompleted(data) {
164
+ return this.sendToQueue(types.MessageTypes.MARKETPLACE_CONNECTION_SYNC_COMPLETED, data);
165
+ }
166
+ /**
167
+ * 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
168
+ This is typically triggered after initial connection or periodically to keep marketplace metadata up to date.
169
+
170
+ * @param data - The message payload
171
+ * @returns Job response with job ID
172
+ */
173
+ async marketplaceConnectionSyncRequest(data) {
174
+ return this.sendToQueue(types.MessageTypes.MARKETPLACE_CONNECTION_SYNC_REQUEST, data);
175
+ }
176
+ /**
177
+ * Notification that marketplace credential rotation has completed. Contains the rotation results, new credential metadata, and any issues encountered.
178
+
179
+ * @param data - The message payload
180
+ * @returns Job response with job ID
181
+ */
182
+ async marketplaceCredentialRotationCompleted(data) {
183
+ return this.sendToQueue(types.MessageTypes.MARKETPLACE_CREDENTIAL_ROTATION_COMPLETED, data);
184
+ }
185
+ /**
186
+ * 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
187
+
188
+ * @param data - The message payload
189
+ * @returns Job response with job ID
190
+ */
191
+ async marketplaceCredentialRotationRequest(data) {
192
+ return this.sendToQueue(types.MessageTypes.MARKETPLACE_CREDENTIAL_ROTATION_REQUEST, data);
193
+ }
194
+ /**
195
+ * Notification that marketplace listing sync operation has completed. Contains detailed results of the sync including created/updated listings, errors encountered, and performance statistics.
196
+
197
+ * @param data - The message payload
198
+ * @returns Job response with job ID
199
+ */
200
+ async marketplaceListingSyncCompleted(data) {
201
+ return this.sendToQueue(types.MessageTypes.MARKETPLACE_LISTING_SYNC_COMPLETED, data);
202
+ }
203
+ /**
204
+ * Requests synchronization of marketplace listings for a connection. Can sync specific listings or all listings for a marketplace connection.
205
+ 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
206
+
207
+ * @param data - The message payload
208
+ * @returns Job response with job ID
209
+ */
210
+ async marketplaceListingSyncRequest(data) {
211
+ return this.sendToQueue(types.MessageTypes.MARKETPLACE_LISTING_SYNC_REQUEST, data);
212
+ }
134
213
  /**
135
214
  * 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.).
136
215
  * @param data - The message payload
@@ -180,6 +259,19 @@ export class WorkerClient {
180
259
  async metamodelMetadataGenerationRequest(data) {
181
260
  return this.sendToQueue(types.MessageTypes.METAMODEL_METADATA_GENERATION_REQUEST, data);
182
261
  }
262
+ /**
263
+ * Request to collect marketplace analytics for a specific metamodel.
264
+ Triggered by backend scheduler every 6 hours for popular/tagged metamodels.
265
+
266
+ Worker performs targeted market searches based on metamodel metadata
267
+ and stores aggregated statistics in Elasticsearch for trend analysis.
268
+
269
+ * @param data - The message payload
270
+ * @returns Job response with job ID
271
+ */
272
+ async modelAnalyticsCollectionRequest(data) {
273
+ return this.sendToQueue(types.MessageTypes.MODEL_ANALYTICS_COLLECTION_REQUEST, data);
274
+ }
183
275
  /**
184
276
  * Handles model discovery folder processed events.
185
277
  * @param data - The message payload
@@ -213,7 +305,7 @@ export class WorkerClient {
213
305
  return this.sendToQueue(types.MessageTypes.MODEL_DISCOVERY_SCAN_REQUEST, data);
214
306
  }
215
307
  /**
216
- * Handles model metadata generation completed.
308
+ * Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
217
309
  * @param data - The message payload
218
310
  * @returns Job response with job ID
219
311
  */
@@ -221,7 +313,7 @@ export class WorkerClient {
221
313
  return this.sendToQueue(types.MessageTypes.MODEL_METADATA_GENERATION_COMPLETED, data);
222
314
  }
223
315
  /**
224
- * Handles model metadata generation requests.
316
+ * Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM analysis with optional vision capabilities. Worker fetches model data from database and uses thumbnails for enhanced analysis when available. Prerequisites: file download, thumbnail generation (optional for vision), and technical metadata analysis (strongly recommended).
225
317
  * @param data - The message payload
226
318
  * @returns Job response with job ID
227
319
  */
@@ -260,6 +352,22 @@ export class WorkerClient {
260
352
  async modelSellabilityAnalysisRequest(data) {
261
353
  return this.sendToQueue(types.MessageTypes.MODEL_SELLABILITY_ANALYSIS_REQUEST, data);
262
354
  }
355
+ /**
356
+ * Handles completion of 3D model semantic analysis with generated tags and similarity results.
357
+ * @param data - The message payload
358
+ * @returns Job response with job ID
359
+ */
360
+ async modelSemanticAnalysisCompleted(data) {
361
+ return this.sendToQueue(types.MessageTypes.MODEL_SEMANTIC_ANALYSIS_COMPLETED, data);
362
+ }
363
+ /**
364
+ * Handles 3D model semantic analysis requests using ULIP-2 neural networks and FAISS vector similarity search.
365
+ * @param data - The message payload
366
+ * @returns Job response with job ID
367
+ */
368
+ async modelSemanticAnalysisRequest(data) {
369
+ return this.sendToQueue(types.MessageTypes.MODEL_SEMANTIC_ANALYSIS_REQUEST, data);
370
+ }
263
371
  /**
264
372
  * Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
265
373
  * @param data - The message payload
@@ -285,11 +393,66 @@ export class WorkerClient {
285
393
  return this.sendToQueue(types.MessageTypes.THUMBNAIL_GENERATION_COMPLETED, data);
286
394
  }
287
395
  /**
288
- * Handles thumbnail generation requests with customization options.
396
+ * Handles thumbnail generation requests with customization options. Supports both storage provider downloads and MinIO-cached files.
289
397
  * @param data - The message payload
290
398
  * @returns Job response with job ID
291
399
  */
292
400
  async thumbnailGenerationRequest(data) {
293
401
  return this.sendToQueue(types.MessageTypes.THUMBNAIL_GENERATION_REQUEST, data);
294
402
  }
403
+ /**
404
+ * User engagement and onboarding tracking events for analytics and behavioral insights.
405
+
406
+ Captures key user actions throughout their journey:
407
+ - Account creation and onboarding steps
408
+ - Feature usage and adoption
409
+ - Model management activities
410
+ - Marketplace interactions
411
+ - Subscription changes
412
+
413
+ Used for:
414
+ - User onboarding funnel analysis
415
+ - Feature adoption tracking
416
+ - User retention metrics
417
+ - A/B testing and experimentation
418
+ - Personalization and recommendations
419
+ - Product analytics dashboards
420
+
421
+ * @param data - The message payload
422
+ * @returns Job response with job ID
423
+ */
424
+ async userEngagementEvent(data) {
425
+ return this.sendToQueue(types.MessageTypes.USER_ENGAGEMENT_EVENT, data);
426
+ }
427
+ /**
428
+ * Analytics event emitted by workers for tracking processing metrics, user behavior,
429
+ and model statistics. Consumed by worker-analytic-collector and forwarded to ELK.
430
+
431
+ All workers MUST emit this event upon job completion (success or failure).
432
+ Each worker includes its specific metrics in the `metrics` object.
433
+
434
+ * @param data - The message payload
435
+ * @returns Job response with job ID
436
+ */
437
+ async workerAnalyticsEvent(data) {
438
+ return this.sendToQueue(types.MessageTypes.WORKER_ANALYTICS_EVENT, data);
439
+ }
440
+ /**
441
+ * Enriched metrics event for detailed worker monitoring, cost tracking,
442
+ and performance analysis. Published to backend.logging.events for
443
+ centralized monitoring and cost attribution.
444
+
445
+ This event is emitted by all workers on job completion and includes:
446
+ - LLM token usage and cost breakdown
447
+ - System resource consumption (CPU, RAM, disk I/O)
448
+ - Detailed timing breakdown by stage
449
+ - User and context attribution
450
+ - Model-specific metadata
451
+
452
+ * @param data - The message payload
453
+ * @returns Job response with job ID
454
+ */
455
+ async workerMetricsEnrichedEvent(data) {
456
+ return this.sendToQueue(types.MessageTypes.WORKER_METRICS_ENRICHED_EVENT, data);
457
+ }
295
458
  }
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
File without changes