@mesh-sync/worker-backend-client 1.0.5 → 4.0.2
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 +956 -10
- package/dist/client.d.ts +191 -3
- package/dist/client.js +235 -3
- package/dist/types.d.ts +699 -7
- package/dist/types.js +22 -0
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -37,6 +37,58 @@ 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>;
|
|
61
|
+
/**
|
|
62
|
+
* Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
|
|
63
|
+
|
|
64
|
+
* @param data - The message payload
|
|
65
|
+
* @returns Job response with job ID
|
|
66
|
+
*/
|
|
67
|
+
etsyAnalyticsSyncCompleted(data: types.EtsyAnalyticsSyncCompletedMessage): Promise<JobResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
|
|
70
|
+
Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
|
|
71
|
+
|
|
72
|
+
* @param data - The message payload
|
|
73
|
+
* @returns Job response with job ID
|
|
74
|
+
*/
|
|
75
|
+
etsyAnalyticsSyncRequest(data: types.EtsyAnalyticsSyncRequestMessage): Promise<JobResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
|
|
78
|
+
|
|
79
|
+
* @param data - The message payload
|
|
80
|
+
* @returns Job response with job ID
|
|
81
|
+
*/
|
|
82
|
+
etsyPublishListingCompleted(data: types.EtsyPublishListingCompletedMessage): Promise<JobResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
|
|
85
|
+
This message is enqueued for EACH material variant when publishing a metamodel.
|
|
86
|
+
Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
|
|
87
|
+
|
|
88
|
+
* @param data - The message payload
|
|
89
|
+
* @returns Job response with job ID
|
|
90
|
+
*/
|
|
91
|
+
etsyPublishListingRequest(data: types.EtsyPublishListingRequestMessage): Promise<JobResponse>;
|
|
40
92
|
/**
|
|
41
93
|
* Notifies that a file download has been processed, indicating success or failure.
|
|
42
94
|
* @param data - The message payload
|
|
@@ -44,11 +96,79 @@ export declare class WorkerClient {
|
|
|
44
96
|
*/
|
|
45
97
|
fileDownloadCompleted(data: types.FileDownloadCompletedMessage): Promise<JobResponse>;
|
|
46
98
|
/**
|
|
47
|
-
*
|
|
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.
|
|
48
100
|
* @param data - The message payload
|
|
49
101
|
* @returns Job response with job ID
|
|
50
102
|
*/
|
|
51
103
|
fileDownloadRequest(data: types.FileDownloadRequestMessage): Promise<JobResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
|
|
106
|
+
* @param data - The message payload
|
|
107
|
+
* @returns Job response with job ID
|
|
108
|
+
*/
|
|
109
|
+
marketplaceAnalyticsSyncCompleted(data: types.MarketplaceAnalyticsSyncCompletedMessage): Promise<JobResponse>;
|
|
110
|
+
/**
|
|
111
|
+
* 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.).
|
|
112
|
+
* @param data - The message payload
|
|
113
|
+
* @returns Job response with job ID
|
|
114
|
+
*/
|
|
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>;
|
|
160
|
+
/**
|
|
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.).
|
|
162
|
+
* @param data - The message payload
|
|
163
|
+
* @returns Job response with job ID
|
|
164
|
+
*/
|
|
165
|
+
marketplacePublishListingCompleted(data: types.MarketplacePublishListingCompletedMessage): Promise<JobResponse>;
|
|
166
|
+
/**
|
|
167
|
+
* 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.
|
|
168
|
+
* @param data - The message payload
|
|
169
|
+
* @returns Job response with job ID
|
|
170
|
+
*/
|
|
171
|
+
marketplacePublishListingRequest(data: types.MarketplacePublishListingRequestMessage): Promise<JobResponse>;
|
|
52
172
|
/**
|
|
53
173
|
* Notifies that a batch media download has been completed.
|
|
54
174
|
* @param data - The message payload
|
|
@@ -74,6 +194,17 @@ export declare class WorkerClient {
|
|
|
74
194
|
* @returns Job response with job ID
|
|
75
195
|
*/
|
|
76
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>;
|
|
77
208
|
/**
|
|
78
209
|
* Handles model discovery folder processed events.
|
|
79
210
|
* @param data - The message payload
|
|
@@ -105,7 +236,7 @@ export declare class WorkerClient {
|
|
|
105
236
|
*/
|
|
106
237
|
modelMetadataGenerationCompleted(data: types.ModelMetadataGenerationCompletedMessage): Promise<JobResponse>;
|
|
107
238
|
/**
|
|
108
|
-
* Handles model metadata generation requests.
|
|
239
|
+
* Handles model metadata generation requests. Supports both storage provider downloads and MinIO-cached files.
|
|
109
240
|
* @param data - The message payload
|
|
110
241
|
* @returns Job response with job ID
|
|
111
242
|
*/
|
|
@@ -122,6 +253,30 @@ export declare class WorkerClient {
|
|
|
122
253
|
* @returns Job response with job ID
|
|
123
254
|
*/
|
|
124
255
|
modelMetamodelDetectionRequest(data: types.ModelMetamodelDetectionRequestMessage): Promise<JobResponse>;
|
|
256
|
+
/**
|
|
257
|
+
* Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
|
|
258
|
+
* @param data - The message payload
|
|
259
|
+
* @returns Job response with job ID
|
|
260
|
+
*/
|
|
261
|
+
modelSellabilityAnalysisCompleted(data: types.ModelSellabilityAnalysisCompletedMessage): Promise<JobResponse>;
|
|
262
|
+
/**
|
|
263
|
+
* 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.
|
|
264
|
+
* @param data - The message payload
|
|
265
|
+
* @returns Job response with job ID
|
|
266
|
+
*/
|
|
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>;
|
|
125
280
|
/**
|
|
126
281
|
* Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
127
282
|
* @param data - The message payload
|
|
@@ -141,9 +296,42 @@ export declare class WorkerClient {
|
|
|
141
296
|
*/
|
|
142
297
|
thumbnailGenerationCompleted(data: types.ThumbnailGenerationCompletedMessage): Promise<JobResponse>;
|
|
143
298
|
/**
|
|
144
|
-
* Handles thumbnail generation requests with customization options.
|
|
299
|
+
* Handles thumbnail generation requests with customization options. Supports both storage provider downloads and MinIO-cached files.
|
|
145
300
|
* @param data - The message payload
|
|
146
301
|
* @returns Job response with job ID
|
|
147
302
|
*/
|
|
148
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>;
|
|
149
337
|
}
|
package/dist/client.js
CHANGED
|
@@ -60,6 +60,68 @@ 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
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
|
|
88
|
+
|
|
89
|
+
* @param data - The message payload
|
|
90
|
+
* @returns Job response with job ID
|
|
91
|
+
*/
|
|
92
|
+
async etsyAnalyticsSyncCompleted(data) {
|
|
93
|
+
return this.sendToQueue(types.MessageTypes.ETSY_ANALYTICS_SYNC_COMPLETED, data);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
|
|
97
|
+
Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
|
|
98
|
+
|
|
99
|
+
* @param data - The message payload
|
|
100
|
+
* @returns Job response with job ID
|
|
101
|
+
*/
|
|
102
|
+
async etsyAnalyticsSyncRequest(data) {
|
|
103
|
+
return this.sendToQueue(types.MessageTypes.ETSY_ANALYTICS_SYNC_REQUEST, data);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
|
|
107
|
+
|
|
108
|
+
* @param data - The message payload
|
|
109
|
+
* @returns Job response with job ID
|
|
110
|
+
*/
|
|
111
|
+
async etsyPublishListingCompleted(data) {
|
|
112
|
+
return this.sendToQueue(types.MessageTypes.ETSY_PUBLISH_LISTING_COMPLETED, data);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
|
|
116
|
+
This message is enqueued for EACH material variant when publishing a metamodel.
|
|
117
|
+
Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
|
|
118
|
+
|
|
119
|
+
* @param data - The message payload
|
|
120
|
+
* @returns Job response with job ID
|
|
121
|
+
*/
|
|
122
|
+
async etsyPublishListingRequest(data) {
|
|
123
|
+
return this.sendToQueue(types.MessageTypes.ETSY_PUBLISH_LISTING_REQUEST, data);
|
|
124
|
+
}
|
|
63
125
|
/**
|
|
64
126
|
* Notifies that a file download has been processed, indicating success or failure.
|
|
65
127
|
* @param data - The message payload
|
|
@@ -69,13 +131,101 @@ export class WorkerClient {
|
|
|
69
131
|
return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_COMPLETED, data);
|
|
70
132
|
}
|
|
71
133
|
/**
|
|
72
|
-
*
|
|
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.
|
|
73
135
|
* @param data - The message payload
|
|
74
136
|
* @returns Job response with job ID
|
|
75
137
|
*/
|
|
76
138
|
async fileDownloadRequest(data) {
|
|
77
139
|
return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_REQUEST, data);
|
|
78
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
|
|
143
|
+
* @param data - The message payload
|
|
144
|
+
* @returns Job response with job ID
|
|
145
|
+
*/
|
|
146
|
+
async marketplaceAnalyticsSyncCompleted(data) {
|
|
147
|
+
return this.sendToQueue(types.MessageTypes.MARKETPLACE_ANALYTICS_SYNC_COMPLETED, data);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* 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.).
|
|
151
|
+
* @param data - The message payload
|
|
152
|
+
* @returns Job response with job ID
|
|
153
|
+
*/
|
|
154
|
+
async marketplaceAnalyticsSyncRequest(data) {
|
|
155
|
+
return this.sendToQueue(types.MessageTypes.MARKETPLACE_ANALYTICS_SYNC_REQUEST, data);
|
|
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
|
+
}
|
|
213
|
+
/**
|
|
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.).
|
|
215
|
+
* @param data - The message payload
|
|
216
|
+
* @returns Job response with job ID
|
|
217
|
+
*/
|
|
218
|
+
async marketplacePublishListingCompleted(data) {
|
|
219
|
+
return this.sendToQueue(types.MessageTypes.MARKETPLACE_PUBLISH_LISTING_COMPLETED, data);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* 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.
|
|
223
|
+
* @param data - The message payload
|
|
224
|
+
* @returns Job response with job ID
|
|
225
|
+
*/
|
|
226
|
+
async marketplacePublishListingRequest(data) {
|
|
227
|
+
return this.sendToQueue(types.MessageTypes.MARKETPLACE_PUBLISH_LISTING_REQUEST, data);
|
|
228
|
+
}
|
|
79
229
|
/**
|
|
80
230
|
* Notifies that a batch media download has been completed.
|
|
81
231
|
* @param data - The message payload
|
|
@@ -109,6 +259,19 @@ export class WorkerClient {
|
|
|
109
259
|
async metamodelMetadataGenerationRequest(data) {
|
|
110
260
|
return this.sendToQueue(types.MessageTypes.METAMODEL_METADATA_GENERATION_REQUEST, data);
|
|
111
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
|
+
}
|
|
112
275
|
/**
|
|
113
276
|
* Handles model discovery folder processed events.
|
|
114
277
|
* @param data - The message payload
|
|
@@ -150,7 +313,7 @@ export class WorkerClient {
|
|
|
150
313
|
return this.sendToQueue(types.MessageTypes.MODEL_METADATA_GENERATION_COMPLETED, data);
|
|
151
314
|
}
|
|
152
315
|
/**
|
|
153
|
-
* Handles model metadata generation requests.
|
|
316
|
+
* Handles model metadata generation requests. Supports both storage provider downloads and MinIO-cached files.
|
|
154
317
|
* @param data - The message payload
|
|
155
318
|
* @returns Job response with job ID
|
|
156
319
|
*/
|
|
@@ -173,6 +336,38 @@ export class WorkerClient {
|
|
|
173
336
|
async modelMetamodelDetectionRequest(data) {
|
|
174
337
|
return this.sendToQueue(types.MessageTypes.MODEL_METAMODEL_DETECTION_REQUEST, data);
|
|
175
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
|
|
341
|
+
* @param data - The message payload
|
|
342
|
+
* @returns Job response with job ID
|
|
343
|
+
*/
|
|
344
|
+
async modelSellabilityAnalysisCompleted(data) {
|
|
345
|
+
return this.sendToQueue(types.MessageTypes.MODEL_SELLABILITY_ANALYSIS_COMPLETED, data);
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* 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.
|
|
349
|
+
* @param data - The message payload
|
|
350
|
+
* @returns Job response with job ID
|
|
351
|
+
*/
|
|
352
|
+
async modelSellabilityAnalysisRequest(data) {
|
|
353
|
+
return this.sendToQueue(types.MessageTypes.MODEL_SELLABILITY_ANALYSIS_REQUEST, data);
|
|
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
|
+
}
|
|
176
371
|
/**
|
|
177
372
|
* Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
178
373
|
* @param data - The message payload
|
|
@@ -198,11 +393,48 @@ export class WorkerClient {
|
|
|
198
393
|
return this.sendToQueue(types.MessageTypes.THUMBNAIL_GENERATION_COMPLETED, data);
|
|
199
394
|
}
|
|
200
395
|
/**
|
|
201
|
-
* Handles thumbnail generation requests with customization options.
|
|
396
|
+
* Handles thumbnail generation requests with customization options. Supports both storage provider downloads and MinIO-cached files.
|
|
202
397
|
* @param data - The message payload
|
|
203
398
|
* @returns Job response with job ID
|
|
204
399
|
*/
|
|
205
400
|
async thumbnailGenerationRequest(data) {
|
|
206
401
|
return this.sendToQueue(types.MessageTypes.THUMBNAIL_GENERATION_REQUEST, data);
|
|
207
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
|
+
}
|
|
208
440
|
}
|