@mesh-sync/worker-backend-client 1.0.4 → 1.0.6
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 +349 -3
- package/dist/client.d.ts +68 -1
- package/dist/client.js +88 -1
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/types.d.ts +252 -3
- package/dist/types.js +10 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -100,6 +100,131 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
100
100
|
## Available Message Types
|
|
101
101
|
|
|
102
102
|
|
|
103
|
+
### etsy-analytics-sync-completed
|
|
104
|
+
|
|
105
|
+
**Description:** Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
**Method:** `client.etsyAnalyticsSyncCompleted(data)`
|
|
109
|
+
|
|
110
|
+
**Payload Type:** `EtsyAnalyticsSyncCompletedMessage`
|
|
111
|
+
|
|
112
|
+
**Fields:**
|
|
113
|
+
|
|
114
|
+
- `originalJobId` (string) [✗]:
|
|
115
|
+
|
|
116
|
+
- `status` (string) [✗]:
|
|
117
|
+
|
|
118
|
+
- `syncedCount` (integer) [✗]: Number of listings successfully synced
|
|
119
|
+
|
|
120
|
+
- `errorCount` (integer) [✗]: Number of listings that failed
|
|
121
|
+
|
|
122
|
+
- `results` (array) [✗]: Analytics for each synced listing
|
|
123
|
+
|
|
124
|
+
- `errors` (array) [✗]: Errors for failed listings
|
|
125
|
+
|
|
126
|
+
- `syncedAt` (string) [✗]:
|
|
127
|
+
|
|
128
|
+
- `nextScheduledSync` (string) [✗]: When next automatic sync should occur
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### etsy-analytics-sync-request
|
|
133
|
+
|
|
134
|
+
**Description:** Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
|
|
135
|
+
Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
**Method:** `client.etsyAnalyticsSyncRequest(data)`
|
|
139
|
+
|
|
140
|
+
**Payload Type:** `EtsyAnalyticsSyncRequestMessage`
|
|
141
|
+
|
|
142
|
+
**Fields:**
|
|
143
|
+
|
|
144
|
+
- `listingIds` (array) [✗]: Internal listing IDs to sync. Empty = sync all for user.
|
|
145
|
+
|
|
146
|
+
- `userId` (string) [✗]: User whose listings to sync (if listingIds empty)
|
|
147
|
+
|
|
148
|
+
- `shopId` (string) [✗]: Etsy shop ID for shop-level analytics
|
|
149
|
+
|
|
150
|
+
- `timeRange` (object) [✗]: Date range for historical analytics
|
|
151
|
+
|
|
152
|
+
- `syncOptions` (object) [✗]:
|
|
153
|
+
|
|
154
|
+
- `etsyCredentials` (object) [✗]: Encrypted Etsy OAuth credentials
|
|
155
|
+
|
|
156
|
+
- `webhookUrl` (string) [✗]:
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
### etsy-publish-listing-completed
|
|
161
|
+
|
|
162
|
+
**Description:** Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
**Method:** `client.etsyPublishListingCompleted(data)`
|
|
166
|
+
|
|
167
|
+
**Payload Type:** `EtsyPublishListingCompletedMessage`
|
|
168
|
+
|
|
169
|
+
**Fields:**
|
|
170
|
+
|
|
171
|
+
- `originalJobId` (string) [✗]: BullMQ job ID from request
|
|
172
|
+
|
|
173
|
+
- `listingId` (string) [✗]: Internal marketplace_items ID
|
|
174
|
+
|
|
175
|
+
- `metamodelId` (string) [✗]: Metamodel that was published
|
|
176
|
+
|
|
177
|
+
- `materialName` (string) [✗]: Material variant name
|
|
178
|
+
|
|
179
|
+
- `status` (string) [✗]: Publication result
|
|
180
|
+
|
|
181
|
+
- `etsyListingId` (string) [✗]: External Etsy listing ID (only if status=SUCCESS)
|
|
182
|
+
|
|
183
|
+
- `etsyListingUrl` (string) [✗]: URL to view listing on Etsy (only if status=SUCCESS)
|
|
184
|
+
|
|
185
|
+
- `etsyFileId` (string) [✗]: Etsy digital file ID (only if status=SUCCESS)
|
|
186
|
+
|
|
187
|
+
- `error` (object) [✗]: Error details (only if status=FAILED)
|
|
188
|
+
|
|
189
|
+
- `publishedAt` (string) [✗]: When the listing was created (only if status=SUCCESS)
|
|
190
|
+
|
|
191
|
+
- `processingDuration` (integer) [✗]: Processing time in milliseconds
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
### etsy-publish-listing-request
|
|
196
|
+
|
|
197
|
+
**Description:** Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
|
|
198
|
+
This message is enqueued for EACH material variant when publishing a metamodel.
|
|
199
|
+
Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
**Method:** `client.etsyPublishListingRequest(data)`
|
|
203
|
+
|
|
204
|
+
**Payload Type:** `EtsyPublishListingRequestMessage`
|
|
205
|
+
|
|
206
|
+
**Fields:**
|
|
207
|
+
|
|
208
|
+
- `listingId` (string) [✗]: Internal marketplace_items table ID
|
|
209
|
+
|
|
210
|
+
- `metamodelId` (string) [✗]: Metamodel being published
|
|
211
|
+
|
|
212
|
+
- `ownerId` (string) [✗]: User ID who owns the metamodel
|
|
213
|
+
|
|
214
|
+
- `materialVariant` (object) [✗]: Material-specific listing configuration
|
|
215
|
+
|
|
216
|
+
- `baseListingData` (object) [✗]: Common listing information
|
|
217
|
+
|
|
218
|
+
- `publishOptions` (object) [✗]:
|
|
219
|
+
|
|
220
|
+
- `etsyCredentials` (object) [✗]: Encrypted Etsy OAuth credentials
|
|
221
|
+
|
|
222
|
+
- `fileMetadata` (object) [✗]: Digital file to upload
|
|
223
|
+
|
|
224
|
+
- `webhookUrl` (string) [✗]: Callback URL for completion notification
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
103
228
|
### file-download-completed
|
|
104
229
|
|
|
105
230
|
**Description:** Notifies that a file download has been processed, indicating success or failure.
|
|
@@ -140,6 +265,136 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
140
265
|
|
|
141
266
|
|
|
142
267
|
|
|
268
|
+
### marketplace-analytics-sync-completed
|
|
269
|
+
|
|
270
|
+
**Description:** Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
|
|
271
|
+
|
|
272
|
+
**Method:** `client.marketplaceAnalyticsSyncCompleted(data)`
|
|
273
|
+
|
|
274
|
+
**Payload Type:** `MarketplaceAnalyticsSyncCompletedMessage`
|
|
275
|
+
|
|
276
|
+
**Fields:**
|
|
277
|
+
|
|
278
|
+
- `originalJobId` (string) [✗]: BullMQ job ID from original request
|
|
279
|
+
|
|
280
|
+
- `marketplaceProvider` (string) [✗]: Marketplace provider type (etsy, ebay, etc.)
|
|
281
|
+
|
|
282
|
+
- `status` (string) [✗]: Sync result (SUCCESS, PARTIAL_SUCCESS, or FAILED)
|
|
283
|
+
|
|
284
|
+
- `syncedCount` (integer) [✗]: Number of listings successfully synced
|
|
285
|
+
|
|
286
|
+
- `errorCount` (integer) [✗]: Number of listings that failed
|
|
287
|
+
|
|
288
|
+
- `results` (array) [✗]: Analytics for each synced listing
|
|
289
|
+
|
|
290
|
+
- `errors` (array) [✗]: Errors for failed listings
|
|
291
|
+
|
|
292
|
+
- `syncedAt` (string) [✗]: When sync completed (ISO 8601)
|
|
293
|
+
|
|
294
|
+
- `nextScheduledSync` (string) [✗]: When next automatic sync should occur (ISO 8601)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
### marketplace-analytics-sync-request
|
|
299
|
+
|
|
300
|
+
**Description:** 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.).
|
|
301
|
+
|
|
302
|
+
**Method:** `client.marketplaceAnalyticsSyncRequest(data)`
|
|
303
|
+
|
|
304
|
+
**Payload Type:** `MarketplaceAnalyticsSyncRequestMessage`
|
|
305
|
+
|
|
306
|
+
**Fields:**
|
|
307
|
+
|
|
308
|
+
- `marketplaceProvider` (string) [✗]: Marketplace provider type (etsy, ebay, etc.)
|
|
309
|
+
|
|
310
|
+
- `marketplaceConnectionId` (string) [✗]: UUID of the marketplace connection configuration
|
|
311
|
+
|
|
312
|
+
- `listingIds` (array) [✗]: Internal listing UUIDs to sync. Empty array = sync all for user.
|
|
313
|
+
|
|
314
|
+
- `userId` (string) [✗]: UUID of user whose listings to sync (if listingIds empty)
|
|
315
|
+
|
|
316
|
+
- `externalShopId` (string) [✗]: External marketplace shop ID for shop-level analytics
|
|
317
|
+
|
|
318
|
+
- `timeRange` (object) [✗]: Date range for historical analytics
|
|
319
|
+
|
|
320
|
+
- `syncOptions` (object) [✗]: Optional sync configuration
|
|
321
|
+
|
|
322
|
+
- `marketplaceCredentials` (object) [✗]: Encrypted marketplace credentials (retrieved from marketplaceConnectionId)
|
|
323
|
+
|
|
324
|
+
- `webhookUrl` (string) [✗]: Callback URL for completion notification
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
### marketplace-publish-listing-completed
|
|
329
|
+
|
|
330
|
+
**Description:** 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.).
|
|
331
|
+
|
|
332
|
+
**Method:** `client.marketplacePublishListingCompleted(data)`
|
|
333
|
+
|
|
334
|
+
**Payload Type:** `MarketplacePublishListingCompletedMessage`
|
|
335
|
+
|
|
336
|
+
**Fields:**
|
|
337
|
+
|
|
338
|
+
- `originalJobId` (string) [✗]: BullMQ job ID from original request
|
|
339
|
+
|
|
340
|
+
- `listingId` (string) [✗]: Internal marketplace_items UUID
|
|
341
|
+
|
|
342
|
+
- `metamodelId` (string) [✗]: UUID of the metamodel that was published
|
|
343
|
+
|
|
344
|
+
- `marketplaceProvider` (string) [✗]: Marketplace provider type (etsy, ebay, etc.)
|
|
345
|
+
|
|
346
|
+
- `materialName` (string) [✗]: Material variant name
|
|
347
|
+
|
|
348
|
+
- `status` (string) [✗]: Publication result (SUCCESS or FAILED)
|
|
349
|
+
|
|
350
|
+
- `externalListingId` (string) [✗]: External marketplace listing ID (only if status=SUCCESS)
|
|
351
|
+
|
|
352
|
+
- `externalListingUrl` (string) [✗]: URL to view listing on marketplace (only if status=SUCCESS)
|
|
353
|
+
|
|
354
|
+
- `externalFileId` (string) [✗]: External marketplace file ID (only if status=SUCCESS)
|
|
355
|
+
|
|
356
|
+
- `error` (object) [✗]: Error details (only if status=FAILED)
|
|
357
|
+
|
|
358
|
+
- `publishedAt` (string) [✗]: When the listing was created (ISO 8601, only if status=SUCCESS)
|
|
359
|
+
|
|
360
|
+
- `processingDuration` (integer) [✗]: Processing time in milliseconds
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
### marketplace-publish-listing-request
|
|
365
|
+
|
|
366
|
+
**Description:** 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.
|
|
367
|
+
|
|
368
|
+
**Method:** `client.marketplacePublishListingRequest(data)`
|
|
369
|
+
|
|
370
|
+
**Payload Type:** `MarketplacePublishListingRequestMessage`
|
|
371
|
+
|
|
372
|
+
**Fields:**
|
|
373
|
+
|
|
374
|
+
- `listingId` (string) [✗]: Internal marketplace_items table UUID
|
|
375
|
+
|
|
376
|
+
- `metamodelId` (string) [✗]: UUID of the metamodel being published
|
|
377
|
+
|
|
378
|
+
- `ownerId` (string) [✗]: UUID of the user who owns the metamodel
|
|
379
|
+
|
|
380
|
+
- `marketplaceProvider` (string) [✗]: Marketplace provider type (etsy, ebay, leboncoin, etc.)
|
|
381
|
+
|
|
382
|
+
- `marketplaceConnectionId` (string) [✗]: UUID of the marketplace connection configuration
|
|
383
|
+
|
|
384
|
+
- `materialVariant` (object) [✗]: Material-specific listing configuration
|
|
385
|
+
|
|
386
|
+
- `baseListingData` (object) [✗]: Common listing information shared across variants
|
|
387
|
+
|
|
388
|
+
- `publishOptions` (object) [✗]: Publishing configuration (marketplace-specific options)
|
|
389
|
+
|
|
390
|
+
- `marketplaceCredentials` (object) [✗]: Encrypted marketplace credentials (retrieved from marketplaceConnectionId)
|
|
391
|
+
|
|
392
|
+
- `fileMetadata` (object) [✗]: Digital file to upload
|
|
393
|
+
|
|
394
|
+
- `webhookUrl` (string) [✗]: Callback URL for completion notification
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
143
398
|
### media-batch-download-completed
|
|
144
399
|
|
|
145
400
|
**Description:** Notifies that a batch media download has been completed.
|
|
@@ -227,6 +482,8 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
227
482
|
|
|
228
483
|
- `libraryId` (string) [✗]: The library containing this metamodel
|
|
229
484
|
|
|
485
|
+
- `constituentModels` (array) [✗]: Enriched metadata for constituent models (includes storage items)
|
|
486
|
+
|
|
230
487
|
- `webhookUrl` (string) [✗]: Optional webhook URL for async completion notification
|
|
231
488
|
|
|
232
489
|
|
|
@@ -367,7 +624,7 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
367
624
|
|
|
368
625
|
### model-metamodel-detection-found
|
|
369
626
|
|
|
370
|
-
**Description:** Handles model metamodel detection found.
|
|
627
|
+
**Description:** Handles model metamodel detection found with hierarchical relationships.
|
|
371
628
|
|
|
372
629
|
**Method:** `client.modelMetamodelDetectionFound(data)`
|
|
373
630
|
|
|
@@ -375,7 +632,7 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
375
632
|
|
|
376
633
|
**Fields:**
|
|
377
634
|
|
|
378
|
-
- `
|
|
635
|
+
- `metamodels` (array) [✓]: List of metamodel nodes in hierarchical structure (roots and children).
|
|
379
636
|
|
|
380
637
|
|
|
381
638
|
|
|
@@ -403,6 +660,58 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
|
|
|
403
660
|
|
|
404
661
|
|
|
405
662
|
|
|
663
|
+
### model-sellability-analysis-completed
|
|
664
|
+
|
|
665
|
+
**Description:** Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
|
|
666
|
+
|
|
667
|
+
**Method:** `client.modelSellabilityAnalysisCompleted(data)`
|
|
668
|
+
|
|
669
|
+
**Payload Type:** `ModelSellabilityAnalysisCompletedMessage`
|
|
670
|
+
|
|
671
|
+
**Fields:**
|
|
672
|
+
|
|
673
|
+
- `metamodelId` (string) [✗]: Metamodel UUID
|
|
674
|
+
|
|
675
|
+
- `ownerId` (string) [✗]: Owner user ID
|
|
676
|
+
|
|
677
|
+
- `sellabilityScore` (number) [✗]: Overall sellability score (0-100)
|
|
678
|
+
|
|
679
|
+
- `pricingRecommendations` (object) [✗]: Pricing analysis and recommendations with material-specific pricing (v2.0.0)
|
|
680
|
+
|
|
681
|
+
- `marketplaceRecommendations` (array) [✗]: Recommended marketplaces with Etsy-specific scoring (v2.0.0)
|
|
682
|
+
|
|
683
|
+
- `demandAnalysis` (object) [✗]: Market demand insights
|
|
684
|
+
|
|
685
|
+
- `qualityFactors` (object) [✗]: Quality-related factors affecting sellability
|
|
686
|
+
|
|
687
|
+
- `recommendations` (array) [✗]: Actionable recommendations to improve sellability
|
|
688
|
+
|
|
689
|
+
- `analyzedAt` (string) [✗]: Analysis completion timestamp (ISO 8601)
|
|
690
|
+
|
|
691
|
+
- `analysisVersion` (string) [✗]: Analysis algorithm version
|
|
692
|
+
|
|
693
|
+
- `error` (object) [✗]: Error information if analysis failed
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
### model-sellability-analysis-request
|
|
698
|
+
|
|
699
|
+
**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.
|
|
700
|
+
|
|
701
|
+
**Method:** `client.modelSellabilityAnalysisRequest(data)`
|
|
702
|
+
|
|
703
|
+
**Payload Type:** `ModelSellabilityAnalysisRequestMessage`
|
|
704
|
+
|
|
705
|
+
**Fields:**
|
|
706
|
+
|
|
707
|
+
- `metamodelId` (string) [✗]: UUID of the metamodel to analyze. Worker will fetch all model metadata, technical metadata, enriched metadata, and child models from PostgreSQL.
|
|
708
|
+
|
|
709
|
+
- `ownerId` (string) [✗]: UUID of the user who owns the metamodel
|
|
710
|
+
|
|
711
|
+
- `analysisOptions` (object) [✗]: Optional analysis configuration
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
406
715
|
### model-technical-metadata-completed
|
|
407
716
|
|
|
408
717
|
**Description:** Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
@@ -595,12 +904,43 @@ new WorkerClient(config: WorkerClientConfig)
|
|
|
595
904
|
- Get the current status of a job
|
|
596
905
|
|
|
597
906
|
|
|
907
|
+
- `etsyAnalyticsSyncCompleted(data: EtsyAnalyticsSyncCompletedMessage): Promise<JobResponse>`
|
|
908
|
+
- Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
- `etsyAnalyticsSyncRequest(data: EtsyAnalyticsSyncRequestMessage): Promise<JobResponse>`
|
|
912
|
+
- Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
|
|
913
|
+
Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
- `etsyPublishListingCompleted(data: EtsyPublishListingCompletedMessage): Promise<JobResponse>`
|
|
917
|
+
- Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
- `etsyPublishListingRequest(data: EtsyPublishListingRequestMessage): Promise<JobResponse>`
|
|
921
|
+
- Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
|
|
922
|
+
This message is enqueued for EACH material variant when publishing a metamodel.
|
|
923
|
+
Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
|
|
924
|
+
|
|
925
|
+
|
|
598
926
|
- `fileDownloadCompleted(data: FileDownloadCompletedMessage): Promise<JobResponse>`
|
|
599
927
|
- Notifies that a file download has been processed, indicating success or failure.
|
|
600
928
|
|
|
601
929
|
- `fileDownloadRequest(data: FileDownloadRequestMessage): Promise<JobResponse>`
|
|
602
930
|
- Handles file download requests.
|
|
603
931
|
|
|
932
|
+
- `marketplaceAnalyticsSyncCompleted(data: MarketplaceAnalyticsSyncCompletedMessage): Promise<JobResponse>`
|
|
933
|
+
- Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
|
|
934
|
+
|
|
935
|
+
- `marketplaceAnalyticsSyncRequest(data: MarketplaceAnalyticsSyncRequestMessage): Promise<JobResponse>`
|
|
936
|
+
- 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.).
|
|
937
|
+
|
|
938
|
+
- `marketplacePublishListingCompleted(data: MarketplacePublishListingCompletedMessage): Promise<JobResponse>`
|
|
939
|
+
- 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.).
|
|
940
|
+
|
|
941
|
+
- `marketplacePublishListingRequest(data: MarketplacePublishListingRequestMessage): Promise<JobResponse>`
|
|
942
|
+
- 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.
|
|
943
|
+
|
|
604
944
|
- `mediaBatchDownloadCompleted(data: MediaBatchDownloadCompletedMessage): Promise<JobResponse>`
|
|
605
945
|
- Notifies that a batch media download has been completed.
|
|
606
946
|
|
|
@@ -633,11 +973,17 @@ new WorkerClient(config: WorkerClientConfig)
|
|
|
633
973
|
- Handles model metadata generation requests.
|
|
634
974
|
|
|
635
975
|
- `modelMetamodelDetectionFound(data: ModelMetamodelDetectionFoundMessage): Promise<JobResponse>`
|
|
636
|
-
- Handles model metamodel detection found.
|
|
976
|
+
- Handles model metamodel detection found with hierarchical relationships.
|
|
637
977
|
|
|
638
978
|
- `modelMetamodelDetectionRequest(data: ModelMetamodelDetectionRequestMessage): Promise<JobResponse>`
|
|
639
979
|
- Handles model metamodel detection requests.
|
|
640
980
|
|
|
981
|
+
- `modelSellabilityAnalysisCompleted(data: ModelSellabilityAnalysisCompletedMessage): Promise<JobResponse>`
|
|
982
|
+
- Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
|
|
983
|
+
|
|
984
|
+
- `modelSellabilityAnalysisRequest(data: ModelSellabilityAnalysisRequestMessage): Promise<JobResponse>`
|
|
985
|
+
- 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.
|
|
986
|
+
|
|
641
987
|
- `modelTechnicalMetadataCompleted(data: ModelTechnicalMetadataCompletedMessage): Promise<JobResponse>`
|
|
642
988
|
- Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
643
989
|
|
package/dist/client.d.ts
CHANGED
|
@@ -37,6 +37,37 @@ export declare class WorkerClient {
|
|
|
37
37
|
* Get job status by job ID
|
|
38
38
|
*/
|
|
39
39
|
getJobStatus(jobId: string): Promise<JobStatus>;
|
|
40
|
+
/**
|
|
41
|
+
* Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
|
|
42
|
+
|
|
43
|
+
* @param data - The message payload
|
|
44
|
+
* @returns Job response with job ID
|
|
45
|
+
*/
|
|
46
|
+
etsyAnalyticsSyncCompleted(data: types.EtsyAnalyticsSyncCompletedMessage): Promise<JobResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
|
|
49
|
+
Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
|
|
50
|
+
|
|
51
|
+
* @param data - The message payload
|
|
52
|
+
* @returns Job response with job ID
|
|
53
|
+
*/
|
|
54
|
+
etsyAnalyticsSyncRequest(data: types.EtsyAnalyticsSyncRequestMessage): Promise<JobResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
|
|
57
|
+
|
|
58
|
+
* @param data - The message payload
|
|
59
|
+
* @returns Job response with job ID
|
|
60
|
+
*/
|
|
61
|
+
etsyPublishListingCompleted(data: types.EtsyPublishListingCompletedMessage): Promise<JobResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
|
|
64
|
+
This message is enqueued for EACH material variant when publishing a metamodel.
|
|
65
|
+
Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
|
|
66
|
+
|
|
67
|
+
* @param data - The message payload
|
|
68
|
+
* @returns Job response with job ID
|
|
69
|
+
*/
|
|
70
|
+
etsyPublishListingRequest(data: types.EtsyPublishListingRequestMessage): Promise<JobResponse>;
|
|
40
71
|
/**
|
|
41
72
|
* Notifies that a file download has been processed, indicating success or failure.
|
|
42
73
|
* @param data - The message payload
|
|
@@ -49,6 +80,30 @@ export declare class WorkerClient {
|
|
|
49
80
|
* @returns Job response with job ID
|
|
50
81
|
*/
|
|
51
82
|
fileDownloadRequest(data: types.FileDownloadRequestMessage): Promise<JobResponse>;
|
|
83
|
+
/**
|
|
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.
|
|
85
|
+
* @param data - The message payload
|
|
86
|
+
* @returns Job response with job ID
|
|
87
|
+
*/
|
|
88
|
+
marketplaceAnalyticsSyncCompleted(data: types.MarketplaceAnalyticsSyncCompletedMessage): Promise<JobResponse>;
|
|
89
|
+
/**
|
|
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.).
|
|
91
|
+
* @param data - The message payload
|
|
92
|
+
* @returns Job response with job ID
|
|
93
|
+
*/
|
|
94
|
+
marketplaceAnalyticsSyncRequest(data: types.MarketplaceAnalyticsSyncRequestMessage): Promise<JobResponse>;
|
|
95
|
+
/**
|
|
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.).
|
|
97
|
+
* @param data - The message payload
|
|
98
|
+
* @returns Job response with job ID
|
|
99
|
+
*/
|
|
100
|
+
marketplacePublishListingCompleted(data: types.MarketplacePublishListingCompletedMessage): Promise<JobResponse>;
|
|
101
|
+
/**
|
|
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.
|
|
103
|
+
* @param data - The message payload
|
|
104
|
+
* @returns Job response with job ID
|
|
105
|
+
*/
|
|
106
|
+
marketplacePublishListingRequest(data: types.MarketplacePublishListingRequestMessage): Promise<JobResponse>;
|
|
52
107
|
/**
|
|
53
108
|
* Notifies that a batch media download has been completed.
|
|
54
109
|
* @param data - The message payload
|
|
@@ -111,7 +166,7 @@ export declare class WorkerClient {
|
|
|
111
166
|
*/
|
|
112
167
|
modelMetadataGenerationRequest(data: types.ModelMetadataGenerationRequestMessage): Promise<JobResponse>;
|
|
113
168
|
/**
|
|
114
|
-
* Handles model metamodel detection found.
|
|
169
|
+
* Handles model metamodel detection found with hierarchical relationships.
|
|
115
170
|
* @param data - The message payload
|
|
116
171
|
* @returns Job response with job ID
|
|
117
172
|
*/
|
|
@@ -122,6 +177,18 @@ export declare class WorkerClient {
|
|
|
122
177
|
* @returns Job response with job ID
|
|
123
178
|
*/
|
|
124
179
|
modelMetamodelDetectionRequest(data: types.ModelMetamodelDetectionRequestMessage): Promise<JobResponse>;
|
|
180
|
+
/**
|
|
181
|
+
* Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
|
|
182
|
+
* @param data - The message payload
|
|
183
|
+
* @returns Job response with job ID
|
|
184
|
+
*/
|
|
185
|
+
modelSellabilityAnalysisCompleted(data: types.ModelSellabilityAnalysisCompletedMessage): Promise<JobResponse>;
|
|
186
|
+
/**
|
|
187
|
+
* 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.
|
|
188
|
+
* @param data - The message payload
|
|
189
|
+
* @returns Job response with job ID
|
|
190
|
+
*/
|
|
191
|
+
modelSellabilityAnalysisRequest(data: types.ModelSellabilityAnalysisRequestMessage): Promise<JobResponse>;
|
|
125
192
|
/**
|
|
126
193
|
* Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
127
194
|
* @param data - The message payload
|
package/dist/client.js
CHANGED
|
@@ -60,6 +60,45 @@ export class WorkerClient {
|
|
|
60
60
|
}
|
|
61
61
|
return await response.json();
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
|
|
65
|
+
|
|
66
|
+
* @param data - The message payload
|
|
67
|
+
* @returns Job response with job ID
|
|
68
|
+
*/
|
|
69
|
+
async etsyAnalyticsSyncCompleted(data) {
|
|
70
|
+
return this.sendToQueue(types.MessageTypes.ETSY_ANALYTICS_SYNC_COMPLETED, data);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
|
|
74
|
+
Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
|
|
75
|
+
|
|
76
|
+
* @param data - The message payload
|
|
77
|
+
* @returns Job response with job ID
|
|
78
|
+
*/
|
|
79
|
+
async etsyAnalyticsSyncRequest(data) {
|
|
80
|
+
return this.sendToQueue(types.MessageTypes.ETSY_ANALYTICS_SYNC_REQUEST, data);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
|
|
84
|
+
|
|
85
|
+
* @param data - The message payload
|
|
86
|
+
* @returns Job response with job ID
|
|
87
|
+
*/
|
|
88
|
+
async etsyPublishListingCompleted(data) {
|
|
89
|
+
return this.sendToQueue(types.MessageTypes.ETSY_PUBLISH_LISTING_COMPLETED, data);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
|
|
93
|
+
This message is enqueued for EACH material variant when publishing a metamodel.
|
|
94
|
+
Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
|
|
95
|
+
|
|
96
|
+
* @param data - The message payload
|
|
97
|
+
* @returns Job response with job ID
|
|
98
|
+
*/
|
|
99
|
+
async etsyPublishListingRequest(data) {
|
|
100
|
+
return this.sendToQueue(types.MessageTypes.ETSY_PUBLISH_LISTING_REQUEST, data);
|
|
101
|
+
}
|
|
63
102
|
/**
|
|
64
103
|
* Notifies that a file download has been processed, indicating success or failure.
|
|
65
104
|
* @param data - The message payload
|
|
@@ -76,6 +115,38 @@ export class WorkerClient {
|
|
|
76
115
|
async fileDownloadRequest(data) {
|
|
77
116
|
return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_REQUEST, data);
|
|
78
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
|
|
120
|
+
* @param data - The message payload
|
|
121
|
+
* @returns Job response with job ID
|
|
122
|
+
*/
|
|
123
|
+
async marketplaceAnalyticsSyncCompleted(data) {
|
|
124
|
+
return this.sendToQueue(types.MessageTypes.MARKETPLACE_ANALYTICS_SYNC_COMPLETED, data);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 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.).
|
|
128
|
+
* @param data - The message payload
|
|
129
|
+
* @returns Job response with job ID
|
|
130
|
+
*/
|
|
131
|
+
async marketplaceAnalyticsSyncRequest(data) {
|
|
132
|
+
return this.sendToQueue(types.MessageTypes.MARKETPLACE_ANALYTICS_SYNC_REQUEST, data);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 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
|
+
* @param data - The message payload
|
|
137
|
+
* @returns Job response with job ID
|
|
138
|
+
*/
|
|
139
|
+
async marketplacePublishListingCompleted(data) {
|
|
140
|
+
return this.sendToQueue(types.MessageTypes.MARKETPLACE_PUBLISH_LISTING_COMPLETED, data);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 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.
|
|
144
|
+
* @param data - The message payload
|
|
145
|
+
* @returns Job response with job ID
|
|
146
|
+
*/
|
|
147
|
+
async marketplacePublishListingRequest(data) {
|
|
148
|
+
return this.sendToQueue(types.MessageTypes.MARKETPLACE_PUBLISH_LISTING_REQUEST, data);
|
|
149
|
+
}
|
|
79
150
|
/**
|
|
80
151
|
* Notifies that a batch media download has been completed.
|
|
81
152
|
* @param data - The message payload
|
|
@@ -158,7 +229,7 @@ export class WorkerClient {
|
|
|
158
229
|
return this.sendToQueue(types.MessageTypes.MODEL_METADATA_GENERATION_REQUEST, data);
|
|
159
230
|
}
|
|
160
231
|
/**
|
|
161
|
-
* Handles model metamodel detection found.
|
|
232
|
+
* Handles model metamodel detection found with hierarchical relationships.
|
|
162
233
|
* @param data - The message payload
|
|
163
234
|
* @returns Job response with job ID
|
|
164
235
|
*/
|
|
@@ -173,6 +244,22 @@ export class WorkerClient {
|
|
|
173
244
|
async modelMetamodelDetectionRequest(data) {
|
|
174
245
|
return this.sendToQueue(types.MessageTypes.MODEL_METAMODEL_DETECTION_REQUEST, data);
|
|
175
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
|
|
249
|
+
* @param data - The message payload
|
|
250
|
+
* @returns Job response with job ID
|
|
251
|
+
*/
|
|
252
|
+
async modelSellabilityAnalysisCompleted(data) {
|
|
253
|
+
return this.sendToQueue(types.MessageTypes.MODEL_SELLABILITY_ANALYSIS_COMPLETED, data);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* 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.
|
|
257
|
+
* @param data - The message payload
|
|
258
|
+
* @returns Job response with job ID
|
|
259
|
+
*/
|
|
260
|
+
async modelSellabilityAnalysisRequest(data) {
|
|
261
|
+
return this.sendToQueue(types.MessageTypes.MODEL_SELLABILITY_ANALYSIS_REQUEST, data);
|
|
262
|
+
}
|
|
176
263
|
/**
|
|
177
264
|
* Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
178
265
|
* @param data - The message payload
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/types.d.ts
CHANGED
|
@@ -2,8 +2,16 @@
|
|
|
2
2
|
* Message type constants
|
|
3
3
|
*/
|
|
4
4
|
export declare const MessageTypes: {
|
|
5
|
+
readonly ETSY_ANALYTICS_SYNC_COMPLETED: "etsy-analytics-sync-completed";
|
|
6
|
+
readonly ETSY_ANALYTICS_SYNC_REQUEST: "etsy-analytics-sync-request";
|
|
7
|
+
readonly ETSY_PUBLISH_LISTING_COMPLETED: "etsy-publish-listing-completed";
|
|
8
|
+
readonly ETSY_PUBLISH_LISTING_REQUEST: "etsy-publish-listing-request";
|
|
5
9
|
readonly FILE_DOWNLOAD_COMPLETED: "file-download-completed";
|
|
6
10
|
readonly FILE_DOWNLOAD_REQUEST: "file-download-request";
|
|
11
|
+
readonly MARKETPLACE_ANALYTICS_SYNC_COMPLETED: "marketplace-analytics-sync-completed";
|
|
12
|
+
readonly MARKETPLACE_ANALYTICS_SYNC_REQUEST: "marketplace-analytics-sync-request";
|
|
13
|
+
readonly MARKETPLACE_PUBLISH_LISTING_COMPLETED: "marketplace-publish-listing-completed";
|
|
14
|
+
readonly MARKETPLACE_PUBLISH_LISTING_REQUEST: "marketplace-publish-listing-request";
|
|
7
15
|
readonly MEDIA_BATCH_DOWNLOAD_COMPLETED: "media-batch-download-completed";
|
|
8
16
|
readonly MEDIA_BATCH_DOWNLOAD_REQUEST: "media-batch-download-request";
|
|
9
17
|
readonly METAMODEL_METADATA_GENERATION_COMPLETED: "metamodel-metadata-generation-completed";
|
|
@@ -16,12 +24,111 @@ export declare const MessageTypes: {
|
|
|
16
24
|
readonly MODEL_METADATA_GENERATION_REQUEST: "model-metadata-generation-request";
|
|
17
25
|
readonly MODEL_METAMODEL_DETECTION_FOUND: "model-metamodel-detection-found";
|
|
18
26
|
readonly MODEL_METAMODEL_DETECTION_REQUEST: "model-metamodel-detection-request";
|
|
27
|
+
readonly MODEL_SELLABILITY_ANALYSIS_COMPLETED: "model-sellability-analysis-completed";
|
|
28
|
+
readonly MODEL_SELLABILITY_ANALYSIS_REQUEST: "model-sellability-analysis-request";
|
|
19
29
|
readonly MODEL_TECHNICAL_METADATA_COMPLETED: "model-technical-metadata-completed";
|
|
20
30
|
readonly MODEL_TECHNICAL_METADATA_REQUEST: "model-technical-metadata-request";
|
|
21
31
|
readonly THUMBNAIL_GENERATION_COMPLETED: "thumbnail-generation-completed";
|
|
22
32
|
readonly THUMBNAIL_GENERATION_REQUEST: "thumbnail-generation-request";
|
|
23
33
|
};
|
|
24
34
|
export type MessageType = typeof MessageTypes[keyof typeof MessageTypes];
|
|
35
|
+
/**
|
|
36
|
+
* Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
|
|
37
|
+
|
|
38
|
+
*/
|
|
39
|
+
export interface EtsyAnalyticsSyncCompletedMessage {
|
|
40
|
+
/** */
|
|
41
|
+
originalJobId?: string;
|
|
42
|
+
/** */
|
|
43
|
+
status?: string;
|
|
44
|
+
/** Number of listings successfully synced */
|
|
45
|
+
syncedCount?: string | number | boolean;
|
|
46
|
+
/** Number of listings that failed */
|
|
47
|
+
errorCount?: string | number | boolean;
|
|
48
|
+
/** Analytics for each synced listing */
|
|
49
|
+
results?: Array<Record<string, string | number | boolean>>;
|
|
50
|
+
/** Errors for failed listings */
|
|
51
|
+
errors?: Array<Record<string, string | number | boolean>>;
|
|
52
|
+
/** */
|
|
53
|
+
syncedAt?: string;
|
|
54
|
+
/** When next automatic sync should occur */
|
|
55
|
+
nextScheduledSync?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data.
|
|
59
|
+
Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
|
|
60
|
+
|
|
61
|
+
*/
|
|
62
|
+
export interface EtsyAnalyticsSyncRequestMessage {
|
|
63
|
+
/** Internal listing IDs to sync. Empty = sync all for user. */
|
|
64
|
+
listingIds?: Array<Record<string, string | number | boolean>>;
|
|
65
|
+
/** User whose listings to sync (if listingIds empty) */
|
|
66
|
+
userId?: string;
|
|
67
|
+
/** Etsy shop ID for shop-level analytics */
|
|
68
|
+
shopId?: string;
|
|
69
|
+
/** Date range for historical analytics */
|
|
70
|
+
timeRange?: Record<string, string | number | boolean>;
|
|
71
|
+
/** */
|
|
72
|
+
syncOptions?: Record<string, string | number | boolean>;
|
|
73
|
+
/** Encrypted Etsy OAuth credentials */
|
|
74
|
+
etsyCredentials?: Record<string, string | number | boolean>;
|
|
75
|
+
/** */
|
|
76
|
+
webhookUrl?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
|
|
80
|
+
|
|
81
|
+
*/
|
|
82
|
+
export interface EtsyPublishListingCompletedMessage {
|
|
83
|
+
/** BullMQ job ID from request */
|
|
84
|
+
originalJobId?: string;
|
|
85
|
+
/** Internal marketplace_items ID */
|
|
86
|
+
listingId?: string;
|
|
87
|
+
/** Metamodel that was published */
|
|
88
|
+
metamodelId?: string;
|
|
89
|
+
/** Material variant name */
|
|
90
|
+
materialName?: string;
|
|
91
|
+
/** Publication result */
|
|
92
|
+
status?: string;
|
|
93
|
+
/** External Etsy listing ID (only if status=SUCCESS) */
|
|
94
|
+
etsyListingId?: string;
|
|
95
|
+
/** URL to view listing on Etsy (only if status=SUCCESS) */
|
|
96
|
+
etsyListingUrl?: string;
|
|
97
|
+
/** Etsy digital file ID (only if status=SUCCESS) */
|
|
98
|
+
etsyFileId?: string;
|
|
99
|
+
/** Error details (only if status=FAILED) */
|
|
100
|
+
error?: Record<string, string | number | boolean>;
|
|
101
|
+
/** When the listing was created (only if status=SUCCESS) */
|
|
102
|
+
publishedAt?: string;
|
|
103
|
+
/** Processing time in milliseconds */
|
|
104
|
+
processingDuration?: string | number | boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID.
|
|
108
|
+
This message is enqueued for EACH material variant when publishing a metamodel.
|
|
109
|
+
Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
|
|
110
|
+
|
|
111
|
+
*/
|
|
112
|
+
export interface EtsyPublishListingRequestMessage {
|
|
113
|
+
/** Internal marketplace_items table ID */
|
|
114
|
+
listingId?: string;
|
|
115
|
+
/** Metamodel being published */
|
|
116
|
+
metamodelId?: string;
|
|
117
|
+
/** User ID who owns the metamodel */
|
|
118
|
+
ownerId?: string;
|
|
119
|
+
/** Material-specific listing configuration */
|
|
120
|
+
materialVariant?: Record<string, string | number | boolean>;
|
|
121
|
+
/** Common listing information */
|
|
122
|
+
baseListingData?: Record<string, string | number | boolean>;
|
|
123
|
+
/** */
|
|
124
|
+
publishOptions?: Record<string, string | number | boolean>;
|
|
125
|
+
/** Encrypted Etsy OAuth credentials */
|
|
126
|
+
etsyCredentials?: Record<string, string | number | boolean>;
|
|
127
|
+
/** Digital file to upload */
|
|
128
|
+
fileMetadata?: Record<string, string | number | boolean>;
|
|
129
|
+
/** Callback URL for completion notification */
|
|
130
|
+
webhookUrl?: string;
|
|
131
|
+
}
|
|
25
132
|
/**
|
|
26
133
|
* Notifies that a file download has been processed, indicating success or failure.
|
|
27
134
|
*/
|
|
@@ -48,6 +155,108 @@ export interface FileDownloadRequestMessage {
|
|
|
48
155
|
/** The storage location of the model. */
|
|
49
156
|
storageLocation?: Record<string, string | number | boolean>;
|
|
50
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Contains synced analytics data for marketplace listings. Backend stores this in marketplace_analytics_snapshots table and indexes to ELK. Works with any marketplace provider.
|
|
160
|
+
*/
|
|
161
|
+
export interface MarketplaceAnalyticsSyncCompletedMessage {
|
|
162
|
+
/** BullMQ job ID from original request */
|
|
163
|
+
originalJobId?: string;
|
|
164
|
+
/** Marketplace provider type (etsy, ebay, etc.) */
|
|
165
|
+
marketplaceProvider?: string;
|
|
166
|
+
/** Sync result (SUCCESS, PARTIAL_SUCCESS, or FAILED) */
|
|
167
|
+
status?: string;
|
|
168
|
+
/** Number of listings successfully synced */
|
|
169
|
+
syncedCount?: string | number | boolean;
|
|
170
|
+
/** Number of listings that failed */
|
|
171
|
+
errorCount?: string | number | boolean;
|
|
172
|
+
/** Analytics for each synced listing */
|
|
173
|
+
results?: Array<Record<string, string | number | boolean>>;
|
|
174
|
+
/** Errors for failed listings */
|
|
175
|
+
errors?: Array<Record<string, string | number | boolean>>;
|
|
176
|
+
/** When sync completed (ISO 8601) */
|
|
177
|
+
syncedAt?: string;
|
|
178
|
+
/** When next automatic sync should occur (ISO 8601) */
|
|
179
|
+
nextScheduledSync?: string;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 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.).
|
|
183
|
+
*/
|
|
184
|
+
export interface MarketplaceAnalyticsSyncRequestMessage {
|
|
185
|
+
/** Marketplace provider type (etsy, ebay, etc.) */
|
|
186
|
+
marketplaceProvider?: string;
|
|
187
|
+
/** UUID of the marketplace connection configuration */
|
|
188
|
+
marketplaceConnectionId?: string;
|
|
189
|
+
/** Internal listing UUIDs to sync. Empty array = sync all for user. */
|
|
190
|
+
listingIds?: Array<Record<string, string | number | boolean>>;
|
|
191
|
+
/** UUID of user whose listings to sync (if listingIds empty) */
|
|
192
|
+
userId?: string;
|
|
193
|
+
/** External marketplace shop ID for shop-level analytics */
|
|
194
|
+
externalShopId?: string;
|
|
195
|
+
/** Date range for historical analytics */
|
|
196
|
+
timeRange?: Record<string, string | number | boolean>;
|
|
197
|
+
/** Optional sync configuration */
|
|
198
|
+
syncOptions?: Record<string, string | number | boolean>;
|
|
199
|
+
/** Encrypted marketplace credentials (retrieved from marketplaceConnectionId) */
|
|
200
|
+
marketplaceCredentials?: Record<string, string | number | boolean>;
|
|
201
|
+
/** Callback URL for completion notification */
|
|
202
|
+
webhookUrl?: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* 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.).
|
|
206
|
+
*/
|
|
207
|
+
export interface MarketplacePublishListingCompletedMessage {
|
|
208
|
+
/** BullMQ job ID from original request */
|
|
209
|
+
originalJobId?: string;
|
|
210
|
+
/** Internal marketplace_items UUID */
|
|
211
|
+
listingId?: string;
|
|
212
|
+
/** UUID of the metamodel that was published */
|
|
213
|
+
metamodelId?: string;
|
|
214
|
+
/** Marketplace provider type (etsy, ebay, etc.) */
|
|
215
|
+
marketplaceProvider?: string;
|
|
216
|
+
/** Material variant name */
|
|
217
|
+
materialName?: string;
|
|
218
|
+
/** Publication result (SUCCESS or FAILED) */
|
|
219
|
+
status?: string;
|
|
220
|
+
/** External marketplace listing ID (only if status=SUCCESS) */
|
|
221
|
+
externalListingId?: string;
|
|
222
|
+
/** URL to view listing on marketplace (only if status=SUCCESS) */
|
|
223
|
+
externalListingUrl?: string;
|
|
224
|
+
/** External marketplace file ID (only if status=SUCCESS) */
|
|
225
|
+
externalFileId?: string;
|
|
226
|
+
/** Error details (only if status=FAILED) */
|
|
227
|
+
error?: Record<string, string | number | boolean>;
|
|
228
|
+
/** When the listing was created (ISO 8601, only if status=SUCCESS) */
|
|
229
|
+
publishedAt?: string;
|
|
230
|
+
/** Processing time in milliseconds */
|
|
231
|
+
processingDuration?: string | number | boolean;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* 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.
|
|
235
|
+
*/
|
|
236
|
+
export interface MarketplacePublishListingRequestMessage {
|
|
237
|
+
/** Internal marketplace_items table UUID */
|
|
238
|
+
listingId?: string;
|
|
239
|
+
/** UUID of the metamodel being published */
|
|
240
|
+
metamodelId?: string;
|
|
241
|
+
/** UUID of the user who owns the metamodel */
|
|
242
|
+
ownerId?: string;
|
|
243
|
+
/** Marketplace provider type (etsy, ebay, leboncoin, etc.) */
|
|
244
|
+
marketplaceProvider?: string;
|
|
245
|
+
/** UUID of the marketplace connection configuration */
|
|
246
|
+
marketplaceConnectionId?: string;
|
|
247
|
+
/** Material-specific listing configuration */
|
|
248
|
+
materialVariant?: Record<string, string | number | boolean>;
|
|
249
|
+
/** Common listing information shared across variants */
|
|
250
|
+
baseListingData?: Record<string, string | number | boolean>;
|
|
251
|
+
/** Publishing configuration (marketplace-specific options) */
|
|
252
|
+
publishOptions?: Record<string, string | number | boolean>;
|
|
253
|
+
/** Encrypted marketplace credentials (retrieved from marketplaceConnectionId) */
|
|
254
|
+
marketplaceCredentials?: Record<string, string | number | boolean>;
|
|
255
|
+
/** Digital file to upload */
|
|
256
|
+
fileMetadata?: Record<string, string | number | boolean>;
|
|
257
|
+
/** Callback URL for completion notification */
|
|
258
|
+
webhookUrl?: string;
|
|
259
|
+
}
|
|
51
260
|
/**
|
|
52
261
|
* Notifies that a batch media download has been completed.
|
|
53
262
|
*/
|
|
@@ -108,6 +317,8 @@ export interface MetamodelMetadataGenerationRequestMessage {
|
|
|
108
317
|
ownerId?: string;
|
|
109
318
|
/** The library containing this metamodel */
|
|
110
319
|
libraryId?: string;
|
|
320
|
+
/** Enriched metadata for constituent models (includes storage items) */
|
|
321
|
+
constituentModels?: Array<Record<string, string | number | boolean>>;
|
|
111
322
|
/** Optional webhook URL for async completion notification */
|
|
112
323
|
webhookUrl?: string;
|
|
113
324
|
}
|
|
@@ -204,11 +415,11 @@ export interface ModelMetadataGenerationRequestMessage {
|
|
|
204
415
|
metamodel?: Record<string, string | number | boolean>;
|
|
205
416
|
}
|
|
206
417
|
/**
|
|
207
|
-
* Handles model metamodel detection found.
|
|
418
|
+
* Handles model metamodel detection found with hierarchical relationships.
|
|
208
419
|
*/
|
|
209
420
|
export interface ModelMetamodelDetectionFoundMessage {
|
|
210
|
-
/** List of metamodel
|
|
211
|
-
|
|
421
|
+
/** List of metamodel nodes in hierarchical structure (roots and children). */
|
|
422
|
+
metamodels: Array<Record<string, string | number | boolean>>;
|
|
212
423
|
}
|
|
213
424
|
/**
|
|
214
425
|
* Handles model metamodel detection requests.
|
|
@@ -227,6 +438,44 @@ export interface ModelMetamodelDetectionRequestMessage {
|
|
|
227
438
|
/** Statistics about the processed folder. */
|
|
228
439
|
statistics: Record<string, string | number | boolean>;
|
|
229
440
|
}
|
|
441
|
+
/**
|
|
442
|
+
* Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
|
|
443
|
+
*/
|
|
444
|
+
export interface ModelSellabilityAnalysisCompletedMessage {
|
|
445
|
+
/** Metamodel UUID */
|
|
446
|
+
metamodelId?: string;
|
|
447
|
+
/** Owner user ID */
|
|
448
|
+
ownerId?: string;
|
|
449
|
+
/** Overall sellability score (0-100) */
|
|
450
|
+
sellabilityScore?: number;
|
|
451
|
+
/** Pricing analysis and recommendations with material-specific pricing (v2.0.0) */
|
|
452
|
+
pricingRecommendations?: Record<string, string | number | boolean>;
|
|
453
|
+
/** Recommended marketplaces with Etsy-specific scoring (v2.0.0) */
|
|
454
|
+
marketplaceRecommendations?: Array<Record<string, string | number | boolean>>;
|
|
455
|
+
/** Market demand insights */
|
|
456
|
+
demandAnalysis?: Record<string, string | number | boolean>;
|
|
457
|
+
/** Quality-related factors affecting sellability */
|
|
458
|
+
qualityFactors?: Record<string, string | number | boolean>;
|
|
459
|
+
/** Actionable recommendations to improve sellability */
|
|
460
|
+
recommendations?: Array<Record<string, string | number | boolean>>;
|
|
461
|
+
/** Analysis completion timestamp (ISO 8601) */
|
|
462
|
+
analyzedAt?: string;
|
|
463
|
+
/** Analysis algorithm version */
|
|
464
|
+
analysisVersion?: string;
|
|
465
|
+
/** Error information if analysis failed */
|
|
466
|
+
error?: Record<string, string | number | boolean>;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* 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.
|
|
470
|
+
*/
|
|
471
|
+
export interface ModelSellabilityAnalysisRequestMessage {
|
|
472
|
+
/** UUID of the metamodel to analyze. Worker will fetch all model metadata, technical metadata, enriched metadata, and child models from PostgreSQL. */
|
|
473
|
+
metamodelId?: string;
|
|
474
|
+
/** UUID of the user who owns the metamodel */
|
|
475
|
+
ownerId?: string;
|
|
476
|
+
/** Optional analysis configuration */
|
|
477
|
+
analysisOptions?: Record<string, string | number | boolean>;
|
|
478
|
+
}
|
|
230
479
|
/**
|
|
231
480
|
* Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
|
|
232
481
|
*/
|
package/dist/types.js
CHANGED
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
* Message type constants
|
|
4
4
|
*/
|
|
5
5
|
export const MessageTypes = {
|
|
6
|
+
ETSY_ANALYTICS_SYNC_COMPLETED: 'etsy-analytics-sync-completed',
|
|
7
|
+
ETSY_ANALYTICS_SYNC_REQUEST: 'etsy-analytics-sync-request',
|
|
8
|
+
ETSY_PUBLISH_LISTING_COMPLETED: 'etsy-publish-listing-completed',
|
|
9
|
+
ETSY_PUBLISH_LISTING_REQUEST: 'etsy-publish-listing-request',
|
|
6
10
|
FILE_DOWNLOAD_COMPLETED: 'file-download-completed',
|
|
7
11
|
FILE_DOWNLOAD_REQUEST: 'file-download-request',
|
|
12
|
+
MARKETPLACE_ANALYTICS_SYNC_COMPLETED: 'marketplace-analytics-sync-completed',
|
|
13
|
+
MARKETPLACE_ANALYTICS_SYNC_REQUEST: 'marketplace-analytics-sync-request',
|
|
14
|
+
MARKETPLACE_PUBLISH_LISTING_COMPLETED: 'marketplace-publish-listing-completed',
|
|
15
|
+
MARKETPLACE_PUBLISH_LISTING_REQUEST: 'marketplace-publish-listing-request',
|
|
8
16
|
MEDIA_BATCH_DOWNLOAD_COMPLETED: 'media-batch-download-completed',
|
|
9
17
|
MEDIA_BATCH_DOWNLOAD_REQUEST: 'media-batch-download-request',
|
|
10
18
|
METAMODEL_METADATA_GENERATION_COMPLETED: 'metamodel-metadata-generation-completed',
|
|
@@ -17,6 +25,8 @@ export const MessageTypes = {
|
|
|
17
25
|
MODEL_METADATA_GENERATION_REQUEST: 'model-metadata-generation-request',
|
|
18
26
|
MODEL_METAMODEL_DETECTION_FOUND: 'model-metamodel-detection-found',
|
|
19
27
|
MODEL_METAMODEL_DETECTION_REQUEST: 'model-metamodel-detection-request',
|
|
28
|
+
MODEL_SELLABILITY_ANALYSIS_COMPLETED: 'model-sellability-analysis-completed',
|
|
29
|
+
MODEL_SELLABILITY_ANALYSIS_REQUEST: 'model-sellability-analysis-request',
|
|
20
30
|
MODEL_TECHNICAL_METADATA_COMPLETED: 'model-technical-metadata-completed',
|
|
21
31
|
MODEL_TECHNICAL_METADATA_REQUEST: 'model-technical-metadata-request',
|
|
22
32
|
THUMBNAIL_GENERATION_COMPLETED: 'thumbnail-generation-completed',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mesh-sync/worker-backend-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Auto-generated TypeScript client for worker-backend - provides type-safe methods for enqueueing jobs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"license": "ISC",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/Mesh-Sync/worker-backend.git",
|
|
28
|
+
"url": "git+https://github.com/Mesh-Sync/worker-backend.git",
|
|
29
29
|
"directory": "generated/typescript"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|