@mesh-sync/worker-backend-client
v4.0.21
Published
Auto-generated TypeScript client for worker-backend - provides type-safe methods for enqueueing jobs
Downloads
862
Maintainers
Readme
Worker Backend Client (TypeScript)
Auto-generated TypeScript client library for the Mesh-Sync worker-backend.
Installation
From npm (public registry)
npm install @mesh-sync/worker-backend-clientFrom GitHub Packages (Recommended for Private Access)
GitHub Packages provides package hosting with access control based on repository permissions.
Prerequisites:
- GitHub Personal Access Token (PAT) with
read:packagesscope - Repository access (for private packages)
Installation Steps:
- Create or update your
.npmrcfile in your project root:
@mesh-sync:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}- Set your GitHub token as an environment variable:
export GITHUB_TOKEN=your_github_personal_access_token- Install the package:
npm install @mesh-sync/worker-backend-clientAccess Control: Only users with read access to the repository can install private packages from GitHub Packages.
Generate GitHub PAT:
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Generate new token with
read:packagesscope - Copy the token and use it as
GITHUB_TOKEN
From a private npm registry
If you're using a private npm registry, configure your .npmrc:
@mesh-sync:registry=https://your-registry.example.com
//your-registry.example.com/:_authToken=${NPM_TOKEN}Usage
Basic Example
import { WorkerClient } from '@mesh-sync/worker-backend-client';
const client = new WorkerClient({
baseUrl: 'http://localhost:3000',
apiKey: process.env.API_KEY, // Optional
timeout: 30000 // Optional, default 30s
});
// Type-safe method call
const job = await client.fileDownloadRequest({
url: 'https://example.com/file.pdf',
destination: '/downloads/file.pdf'
});
console.log(`Job created: ${job.jobId}`);
// Check job status
const status = await client.getJobStatus(job.jobId);
console.log(`Job state: ${status.state}`);Using Message Type Constants
import { WorkerClient, MessageTypes } from '@mesh-sync/worker-backend-client';
const client = new WorkerClient({
baseUrl: 'http://localhost:3000'
});
// Dynamic message type
await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
url: 'https://example.com/file.pdf',
destination: '/downloads/file.pdf'
});Available Message Types
analytics-collection-request
Description: Request to trigger a manual market data collection job. Used for ad-hoc scraping of specific queries on marketplaces.
Method: client.analyticsCollectionRequest(data)
Payload Type: AnalyticsCollectionRequestMessage
Fields:
marketplace(string) [✗]: The marketplace to scrape (etsy, ebay, etc.)query(string) [✓]: The search query to useoptions(object) [✗]: Collection options (pages, filters, etc.)
backend-logging-event
Description: Centralized logging event for capturing all warn/error/failure logs from meshsync-backend. This event is sent to ELK for centralized monitoring, alerting, and debugging.
Automatically emitted by the custom Pino logger interceptor when:
- logger.warn() is called
- logger.error() is called
- uncaught exceptions occur
- request failures happen (4xx, 5xx responses)
Used for:
- System health monitoring
- Error tracking and alerting
- Performance degradation detection
- Security incident tracking
- Compliance and audit trails
Method: client.backendLoggingEvent(data)
Payload Type: BackendLoggingEventMessage
Fields:
eventType(string) [✓]: Type of logging eventtimestamp(string) [✓]: ISO 8601 timestamp when the log was generatedlevel(string) [✓]: Log level severitymessage(string) [✓]: Human-readable log messagecontext(string) [✓]: Logger context (typically the class/service name)requestId(string) [✗]: Unique request ID for correlation (X-Request-Id header)userId(string) [✗]: ID of the authenticated user (if available)httpMethod(string) [✗]: HTTP method of the requesthttpUrl(string) [✗]: Request URL path (without query params for privacy)httpStatusCode(integer) [✗]: HTTP response status codeerrorType(string) [✗]: Error class/type nameerrorStack(string) [✗]: Stack trace (sanitized, no sensitive data)errorCode(string) [✗]: Application-specific error code for categorizationmetadata(object) [✗]: Additional structured context (sanitized, no PII)environment(string) [✗]: Deployment environmentserviceVersion(string) [✗]: Backend service versionhostname(string) [✗]: Server hostname/pod namedurationMs(number) [✗]: Operation duration in milliseconds (if applicable)
ekg-edge-batch-create-completed
Description: Completion event for EKG edge batch creation with propagation results.
Method: client.ekgEdgeBatchCreateCompleted(data)
Payload Type: EkgEdgeBatchCreateCompletedMessage
Fields:
requestId(string) [✓]: Original request ID from ekg-edge-batch-create-requestsuccess(boolean) [✓]: Whether the batch operation succeededstatistics(object) [✓]: Batch operation statisticsconflicts(array) [✗]: List of high-conflict edges requiring reviewerrors(array) [✗]: Errors encountered during processinggraphMetrics(object) [✗]: Overall graph state after this batch
ekg-edge-batch-create-request
Description: Create multiple EKG edges with Dempster-Shafer mass functions. Triggered by metamodel detection completion.
Method: client.ekgEdgeBatchCreateRequest(data)
Payload Type: EkgEdgeBatchCreateRequestMessage
Fields:
requestId(string) [✓]: Unique request ID for tracking (e.g., metamodel detection job ID)source(string) [✓]: Source of the edges: metamodel-heuristic, manual, taxonomy-import, etc.edges(array) [✓]: Batch of edges to create/update in the EKGpropagationOptions(object) [✗]: Options for evidential edge propagation after edge creationwebhookUrl(string) [✗]: Optional webhook URL for async completion notification
etsy-analytics-sync-completed
Description: Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
Method: client.etsyAnalyticsSyncCompleted(data)
Payload Type: EtsyAnalyticsSyncCompletedMessage
Fields:
originalJobId(string) [✗]:status(string) [✗]:syncedCount(integer) [✗]: Number of listings successfully syncederrorCount(integer) [✗]: Number of listings that failedresults(array) [✗]: Analytics for each synced listingcredentialUpdate(object) [✗]: New credentials if token was refreshed during operationerrors(array) [✗]: Errors for failed listingssyncedAt(string) [✗]:nextScheduledSync(string) [✗]: When next automatic sync should occur
etsy-analytics-sync-request
Description: Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data. Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
Method: client.etsyAnalyticsSyncRequest(data)
Payload Type: EtsyAnalyticsSyncRequestMessage
Fields:
listingIds(array) [✗]: Internal listing IDs to sync. Empty = sync all for user.userId(string) [✗]: User whose listings to sync (if listingIds empty)shopId(string) [✗]: Etsy shop ID for shop-level analyticscredentials(object) [✗]: Etsy OAuth credentialstimeRange(object) [✗]: Date range for historical analyticssyncOptions(object) [✗]:etsyCredentials(object) [✗]: Encrypted Etsy OAuth credentialswebhookUrl(string) [✗]:
etsy-publish-listing-completed
Description: Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
Method: client.etsyPublishListingCompleted(data)
Payload Type: EtsyPublishListingCompletedMessage
Fields:
originalJobId(string) [✗]: BullMQ job ID from requestlistingId(string) [✗]: Internal marketplace_items IDmetamodelId(string) [✗]: Metamodel that was publishedmaterialName(string) [✗]: Material variant namestatus(string) [✗]: Publication resultetsyListingId(string) [✗]: External Etsy listing ID (only if status=SUCCESS)etsyListingUrl(string) [✗]: URL to view listing on Etsy (only if status=SUCCESS)credentialUpdate(object) [✗]: New credentials if token was refreshed during operationetsyFileId(string) [✗]: Etsy digital file ID (only if status=SUCCESS)error(object) [✗]: Error details (only if status=FAILED)publishedAt(string) [✗]: When the listing was created (only if status=SUCCESS)processingDuration(integer) [✗]: Processing time in milliseconds
etsy-publish-listing-request
Description: Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID. This message is enqueued for EACH material variant when publishing a metamodel. Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
Method: client.etsyPublishListingRequest(data)
Payload Type: EtsyPublishListingRequestMessage
Fields:
listingId(string) [✗]: Internal marketplace_items table IDmetamodelId(string) [✗]: Metamodel being publishedownerId(string) [✗]: User ID who owns the metamodelcredentials(object) [✗]: Etsy OAuth credentialsmaterialVariant(object) [✗]: Material-specific listing configurationbaseListingData(object) [✗]: Common listing informationpublishOptions(object) [✗]:etsyCredentials(object) [✗]: Encrypted Etsy OAuth credentialsfileMetadata(object) [✗]: Digital file to uploadwebhookUrl(string) [✗]: Callback URL for completion notification
file-download-completed
Description: Notifies that a file download has been processed, indicating success or failure.
Method: client.fileDownloadCompleted(data)
Payload Type: FileDownloadCompletedMessage
Fields:
originalJobId(string) [✗]: The ID of the initial 'file-download-request' job this event corresponds to.modelId(string) [✗]: The unique identifier for the downloaded model.status(string) [✗]: The final status of the download operation.s3Location(object) [✗]: Details of the file's location in Minio S3 (present on success).errorMessage(string) [✗]: Contains error details if the status is FAILED.downloadedAt(string) [✗]: The timestamp when the download was completed or failed.
file-download-request
Description: Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
Retry Configuration:
- Automatic retry enabled for transient failures (connection errors, timeouts)
- Default: 5 attempts with exponential backoff (2s, 4s, 8s, 16s, 32s)
- Retry on: STORAGE_TIMEOUT, NETWORK_ERROR, MINIO_UNAVAILABLE, CONNECTION_REFUSED
- No retry on: INVALID_CREDENTIALS, FILE_NOT_FOUND, PERMISSION_DENIED
Method: client.fileDownloadRequest(data)
Payload Type: FileDownloadRequestMessage
Fields:
modelId(string) [✗]: The unique identifier for the model to be downloaded.ownerId(string) [✗]: The identifier of the user who owns the model. Optional - if not provided, will be retrieved from StorageConnection.storageLocation(object) [✗]: The storage location of the model.metadata(object) [✗]: Optional metadata from discovery. For Thingiverse, contains downloadUrl for direct file access.credentials(object) [✗]: Decrypted credentials required for this specific download operation. Injected by the backend.minioDestination(object) [✗]: Destination in MinIO where file will be uploaded after download.autoEnqueueChildren(boolean) [✗]: Automatically enqueue thumbnail generation, technical metadata analysis, and metadata generation jobs after download completes.previewType(string) [✗]: Preview type for thumbnail generation (passed to child job).generate360Views(boolean) [✗]: Generate 16 angle views for 360° preview (passed to child job).webhookUrl(string) [✗]: Optional webhook URL to call when download completes. If provided, worker will POST completion status to this endpoint.
file-vectorize-completed
Description: Result of the vectorization process containing the embedding vector.
Method: client.fileVectorizeCompleted(data)
Payload Type: FileVectorizeCompletedMessage
Fields:
fileId(string) [✗]:vector(array) [✗]: The computed embedding vectormodelName(string) [✗]:dimension(integer) [✗]: Length of the vector (e.g., 512)
file-vectorize-request
Description: Request to generate a vector embedding for an image file using CLIP.
Method: client.fileVectorizeRequest(data)
Payload Type: FileVectorizeRequestMessage
Fields:
fileId(string) [✗]: The ID of the file in the databasestorageItem() [✗]: Location of the image filemodelName(string) [✗]: Optional: Specific model version to use
marketplace-analytics-sync-completed
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.
Method: client.marketplaceAnalyticsSyncCompleted(data)
Payload Type: MarketplaceAnalyticsSyncCompletedMessage
Fields:
originalJobId(string) [✗]: BullMQ job ID from original requestmarketplaceProvider(string) [✗]: Marketplace provider type (etsy, ebay, etc.)status(string) [✗]: Sync result (SUCCESS, PARTIAL_SUCCESS, or FAILED)syncedCount(integer) [✗]: Number of listings successfully syncederrorCount(integer) [✗]: Number of listings that failedresults(array) [✗]: Analytics for each synced listingerrors(array) [✗]: Errors for failed listingssyncedAt(string) [✗]: When sync completed (ISO 8601)nextScheduledSync(string) [✗]: When next automatic sync should occur (ISO 8601)
marketplace-analytics-sync-request
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.).
Method: client.marketplaceAnalyticsSyncRequest(data)
Payload Type: MarketplaceAnalyticsSyncRequestMessage
Fields:
marketplaceProvider(string) [✗]: Marketplace provider type (etsy, ebay, etc.)marketplaceConnectionId(string) [✗]: UUID of the marketplace connection configurationlistingIds(array) [✗]: Internal listing UUIDs to sync. Empty array = sync all for user.userId(string) [✗]: UUID of user whose listings to sync (if listingIds empty)externalShopId(string) [✗]: External marketplace shop ID for shop-level analyticstimeRange(object) [✗]: Date range for historical analyticssyncOptions(object) [✗]: Optional sync configurationmarketplaceCredentials(object) [✗]: Encrypted marketplace credentials (retrieved from marketplaceConnectionId)webhookUrl(string) [✗]: Callback URL for completion notification
marketplace-connection-sync-completed
Description: Notification that marketplace connection sync has completed. Contains updated connection metadata, profile information, and sync statistics.
Method: client.marketplaceConnectionSyncCompleted(data)
Payload Type: MarketplaceConnectionSyncCompletedMessage
Fields:
requestId(string) [✗]: Original request ID for correlationconnectionId(string) [✗]: Marketplace connection that was syncedmarketplaceId(string) [✗]: Marketplace provider IDuserId(string) [✗]: Connection owner user IDstatus(string) [✗]: Overall sync result statussyncType(string) [✗]: Type of sync that was performedconnectionData(object) [✗]: Updated connection informationcategories(array) [✗]: Available marketplace categoriesstatistics(object) [✗]: Sync operation statisticscompletedAt(string) [✗]: When sync completederror(object) [✗]: Error details if sync failed
marketplace-connection-sync-request
Description: Requests synchronization of marketplace connection data including: - Profile information and shop details - Account status and permissions - Available categories and shipping profiles - Rate limits and API quotas This is typically triggered after initial connection or periodically to keep marketplace metadata up to date.
Method: client.marketplaceConnectionSyncRequest(data)
Payload Type: MarketplaceConnectionSyncRequestMessage
Fields:
connectionId(string) [✗]: Internal marketplace connection IDmarketplaceId(string) [✗]: Marketplace provider ID (etsy, ebay, etc.)userId(string) [✗]: User who owns this connectionsyncType(string) [✗]: Type of sync to performpriority(string) [✗]: Processing priorityrequestId(string) [✗]: Unique request identifier for trackingwebhookUrl(string) [✗]: Webhook URL to call when sync completesmetadata(object) [✗]: Additional context data
marketplace-credential-rotation-completed
Description: Notification that marketplace credential rotation has completed. Contains the rotation results, new credential metadata, and any issues encountered.
Method: client.marketplaceCredentialRotationCompleted(data)
Payload Type: MarketplaceCredentialRotationCompletedMessage
Fields:
requestId(string) [✗]: Original rotation request IDconnectionId(string) [✗]: Marketplace connection that was rotatedmarketplaceId(string) [✗]: Marketplace provider IDuserId(string) [✗]: Connection owner user IDstatus(string) [✗]: Overall rotation operation statusrotationType(string) [✗]: Type of rotation that was performedreason(string) [✗]: Original reason for rotationnewCredentials(object) [✗]: Metadata about new credentialsoldCredentials(object) [✗]: Status of previous credentialsoperationDetails(object) [✗]: Details of the rotation operationconnectionStatus(object) [✗]: Connection status after credential rotationnextRotation(object) [✗]: Information about next scheduled rotationerror(object) [✗]: Error details if rotation failednotifications(array) [✗]: Notifications sent as part of rotation
marketplace-credential-rotation-request
Description: Requests rotation/refresh of marketplace connection credentials. This is used for: - OAuth token refresh when tokens are near expiry - API key rotation for enhanced security - Re-authentication after connection errors - Scheduled credential updates
Method: client.marketplaceCredentialRotationRequest(data)
Payload Type: MarketplaceCredentialRotationRequestMessage
Fields:
connectionId(string) [✗]: Marketplace connection ID requiring credential rotationmarketplaceId(string) [✗]: Marketplace provider ID (etsy, ebay, etc.)userId(string) [✗]: User who owns the connectionrotationType(string) [✗]: Type of credential rotation to performreason(string) [✗]: Reason for credential rotationurgency(string) [✗]: How urgently the rotation is neededcurrentCredentials(object) [✗]: Current credential metadata (no actual secrets)options(object) [✗]: Rotation configuration optionsrequestId(string) [✗]: Unique request identifierwebhookUrl(string) [✗]: Webhook URL for completion notificationscheduledAt(string) [✗]: When this rotation was scheduled (if scheduled)metadata(object) [✗]: Additional request context
marketplace-intelligence-event
Description: Public marketplace intelligence data scraped from external marketplaces.
This event contains:
- Listing details (title, price, images)
- Engagement metrics (views, favorites, reviews)
- Shop information
- Market positioning data
Unlike marketplace-listing-sync-request (private user data), this focuses on:
- Broad market trends and pricing analysis
- Competitive intelligence and demand signals
- Product popularity and sentiment
Consumed by worker-analytic-collector for Elasticsearch indexing. Used for market research, pricing optimization, and trend detection.
Method: client.marketplaceIntelligenceEvent(data)
Payload Type: MarketplaceIntelligenceEventMessage
Fields:
marketplace(string) [✓]: Source marketplaceexternalId(string) [✓]: Marketplace-native listing IDlisting(object) [✓]: Core listing informationmetrics(object) [✗]: Public engagement and sales metricsmetadata(object) [✗]: Additional listing context and categorizationqueryContext(object) [✗]: Search context that found this listingcollectedAt(string) [✓]: ISO 8601 timestamp when data was scrapedcollectorVersion(string) [✗]: Version of collector that scraped this datascrapingMethod(string) [✗]: Method used for scraping
marketplace-listing-description-generation-completed
Description: Notifies backend that marketplace description generation completed. Contains generated description with metadata tracking (AI model, confidence, generation timestamp) and suggested price.
Method: client.marketplaceListingDescriptionGenerationCompleted(data)
Payload Type: MarketplaceListingDescriptionGenerationCompletedMessage
Fields:
modelId(string) [✓]: UUID of the model that was processedentityType(string) [✓]: Type of entity processedtargetMarketplace(string) [✗]: Target marketplace ID (e.g., 'etsy', 'ebay')description(string) [✓]: SEO-optimized marketplace description (3-5 sentences)metadata(object) [✓]: Content generation metadata for trackingsuggestedPrice(object) [✗]: Volume-based price calculation for 3D printed itemerror(string) [✗]: Error message if generation failed
marketplace-listing-description-generation-request
Description: Generates SEO-optimized marketplace description for a 3D model using LLM vision analysis. Worker receives model data, technical metadata, and thumbnail URLs to generate compelling product descriptions tailored to the target marketplace.
Method: client.marketplaceListingDescriptionGenerationRequest(data)
Payload Type: MarketplaceListingDescriptionGenerationRequestMessage
Fields:
modelId(string) [✓]: UUID of the model (reference only)entityType(string) [✓]: Type of entity being processedentityName(string) [✓]: Name/title of the model or metamodeltargetMarketplace(string) [✓]: Target marketplace ID (e.g., 'etsy', 'ebay', 'thingiverse')userId(string) [✓]: UUID of the user requesting generationwebhookUrl(string) [✗]: Callback URL for completion notificationtechnicalMetadata(object) [✗]: Technical analysis data for contextthumbnailUrls(array) [✗]: URLs to 360-degree thumbnail viewsexistingTags(array) [✗]: Currently assigned tags for contextexistingCategory(string) [✗]: Current classification for contextbrandVoice(string) [✗]: Desired tone/voice for the listing (e.g., 'professional', 'playful')targetMarket(string) [✗]: Target geographic market (e.g., 'US', 'EU')keywords(array) [✗]: Specific keywords to include
marketplace-listing-sync-completed
Description: Notification that marketplace listing sync operation has completed. Contains detailed results of the sync including created/updated listings, errors encountered, and performance statistics.
Method: client.marketplaceListingSyncCompleted(data)
Payload Type: MarketplaceListingSyncCompletedMessage
Fields:
requestId(string) [✗]: Original request ID for correlationconnectionId(string) [✗]: Marketplace connection that was syncedmarketplaceId(string) [✗]: Marketplace provider IDuserId(string) [✗]: Connection owner user IDstatus(string) [✗]: Overall sync operation statussyncDirection(string) [✗]: Direction of sync that was performedstatistics(object) [✗]: Detailed sync operation statisticsresults(object) [✗]: Detailed sync results by operationsuccessfulListings(array) [✗]: Details of successfully processed listingsfailedListings(array) [✗]: Details of listings that failed to syncerrors(array) [✗]: Non-listing-specific errors encounteredcompletedAt(string) [✗]: When sync operation completednextSyncRecommendedAt(string) [✗]: When next sync is recommended
marketplace-listing-sync-request
Description: Requests synchronization of marketplace listings for a connection. Can sync specific listings or all listings for a marketplace connection. 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
Method: client.marketplaceListingSyncRequest(data)
Payload Type: MarketplaceListingSyncRequestMessage
Fields:
connectionId(string) [✗]: Marketplace connection IDmarketplaceId(string) [✗]: Marketplace provider ID (etsy, ebay, etc.)userId(string) [✗]: User who owns the connectionsyncDirection(string) [✗]: Direction of sync operationsyncScope(string) [✗]: Scope of listings to synclistingIds(array) [✗]: Specific listing IDs to sync (if syncScope=specific)externalListingIds(array) [✗]: External marketplace listing IDs to syncoptions(object) [✗]: Sync configuration optionspriority(string) [✗]: Processing priorityrequestId(string) [✗]: Unique request identifierwebhookUrl(string) [✗]: Webhook URL for completion notificationmetadata(object) [✗]: Additional request context
marketplace-listing-tags-generation-completed
Description: Notifies backend that marketplace tags generation completed. Contains generated tags optimized for discoverability with metadata tracking.
Method: client.marketplaceListingTagsGenerationCompleted(data)
Payload Type: MarketplaceListingTagsGenerationCompletedMessage
Fields:
modelId(string) [✓]: UUID of the model that was processedentityType(string) [✓]: Type of entity processedtags(array) [✓]: Generated searchability tags (style, technical, usage keywords)metadata(object) [✓]: Content generation metadata for trackingerror(string) [✗]: Error message if generation failed
marketplace-listing-tags-generation-request
Description: Generates searchability tags for a 3D model optimized for marketplace discoverability. Worker creates style, technical, and usage keywords following marketplace tag limits and SEO best practices.
Method: client.marketplaceListingTagsGenerationRequest(data)
Payload Type: MarketplaceListingTagsGenerationRequestMessage
Fields:
modelId(string) [✓]: UUID of the model (reference only)entityType(string) [✓]: Type of entity being processedentityName(string) [✓]: Name/title of the model or metamodeltargetMarketplace(string) [✓]: Target marketplace ID (e.g., 'etsy', 'ebay', 'thingiverse')userId(string) [✓]: UUID of the user requesting generationwebhookUrl(string) [✗]: Callback URL for completion notificationtechnicalMetadata(object) [✗]: Technical analysis data for tag generationthumbnailUrls(array) [✗]: URLs to 360-degree thumbnail views for visual analysisexistingTags(array) [✗]: Currently assigned tags to supplement or replaceexistingCategory(string) [✗]: Current classification for category-based tagstagLimit(number) [✗]: Maximum number of tags for marketplace (e.g., 13 for Etsy)targetMarket(string) [✗]: Target geographic market (e.g., 'US', 'EU')style(string) [✗]: Artistic style of the model (e.g., 'realistic', 'low-poly')useCases(array) [✗]: Intended uses for the model
marketplace-listing-title-generation-completed
Description: Notifies backend that marketplace title generation completed. Contains generated title with metadata tracking.
Method: client.marketplaceListingTitleGenerationCompleted(data)
Payload Type: MarketplaceListingTitleGenerationCompletedMessage
Fields:
modelId(string) [✓]: UUID of the model that was processedentityType(string) [✓]: Type of entity processedtitle(string) [✓]: Marketplace-optimized titlemetadata(object) [✓]: Content generation metadata for trackingerror(string) [✗]: Error message if generation failed
marketplace-listing-title-generation-request
Description: Generates marketplace-optimized title for a 3D model. Worker creates concise, SEO-friendly titles following marketplace character limits and best practices.
Method: client.marketplaceListingTitleGenerationRequest(data)
Payload Type: MarketplaceListingTitleGenerationRequestMessage
Fields:
modelId(string) [✓]: UUID of the model (reference only)entityType(string) [✓]: Type of entity being processedcurrentName(string) [✓]: Current model/metamodel nametargetMarketplace(string) [✓]: Target marketplace ID (e.g., 'etsy', 'ebay', 'thingiverse')userId(string) [✓]: UUID of the user requesting generationwebhookUrl(string) [✗]: Callback URL for completion notificationtechnicalMetadata(object) [✗]: Technical analysis data for contextexistingTags(array) [✗]: Currently assigned tags for SEO keywordsexistingCategory(string) [✗]: Current classification for categorizationcharacterLimit(number) [✗]: Maximum character count for marketplace (e.g., 140 for Etsy)brandVoice(string) [✗]: Desired tone/voice for the listing (e.g., 'professional', 'playful')targetMarket(string) [✗]: Target geographic market (e.g., 'US', 'EU')keywords(array) [✗]: Specific keywords to include
marketplace-listing-update-completed
Description: Result of a listing update operation
Method: client.marketplaceListingUpdateCompleted(data)
Payload Type: MarketplaceListingUpdateCompletedMessage
Fields:
marketplace(string) [✗]: Target marketplacelistingId(string) [✗]: External ID of the listingstatus(string) [✗]: Status of the update (success, failed)result(object) [✗]: Result details from the marketplace APIerror(string) [✗]: Error message if failed
marketplace-listing-update-request
Description: Request to update an existing listing on a marketplace (price, quantity, etc.)
Method: client.marketplaceListingUpdateRequest(data)
Payload Type: MarketplaceListingUpdateRequestMessage
Fields:
marketplace(string) [✗]: Target marketplace (etsy, ebay, etc.)listingId(string) [✗]: External ID of the listing to updateupdates(object) [✗]: Fields to updatecredentials(object) [✗]: User credentials for the marketplace
marketplace-publish-listing-completed
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.).
Method: client.marketplacePublishListingCompleted(data)
Payload Type: MarketplacePublishListingCompletedMessage
Fields:
originalJobId(string) [✗]: BullMQ job ID from original requestlistingId(string) [✗]: Internal marketplace_items UUIDmetamodelId(string) [✗]: UUID of the metamodel that was publishedmarketplaceProvider(string) [✗]: Marketplace provider type (etsy, ebay, etc.)materialName(string) [✗]: Material variant namestatus(string) [✗]: Publication result (SUCCESS or FAILED)externalListingId(string) [✗]: External marketplace listing ID (only if status=SUCCESS)externalListingUrl(string) [✗]: URL to view listing on marketplace (only if status=SUCCESS)externalFileId(string) [✗]: External marketplace file ID (only if status=SUCCESS)error(object) [✗]: Error details (only if status=FAILED)publishedAt(string) [✗]: When the listing was created (ISO 8601, only if status=SUCCESS)processingDuration(integer) [✗]: Processing time in milliseconds
marketplace-publish-listing-request
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.
Method: client.marketplacePublishListingRequest(data)
Payload Type: MarketplacePublishListingRequestMessage
Fields:
listingId(string) [✗]: Internal marketplace_items table UUIDmetamodelId(string) [✗]: UUID of the metamodel being publishedownerId(string) [✗]: UUID of the user who owns the metamodelmarketplaceProvider(string) [✗]: Marketplace provider type (etsy, ebay, leboncoin, etc.)marketplaceConnectionId(string) [✗]: UUID of the marketplace connection configurationmaterialVariant(object) [✗]: Material-specific listing configurationbaseListingData(object) [✗]: Common listing information shared across variantspublishOptions(object) [✗]: Publishing configuration (marketplace-specific options)marketplaceCredentials(object) [✗]: Encrypted marketplace credentials (retrieved from marketplaceConnectionId)fileMetadata(object) [✗]: Digital file to uploadwebhookUrl(string) [✗]: Callback URL for completion notification
media-batch-download-completed
Description: Notifies that a batch media download has been completed.
Method: client.mediaBatchDownloadCompleted(data)
Payload Type: MediaBatchDownloadCompletedMessage
Fields:
batchId(string) [✓]: The unique identifier for the batch download operation.status(string) [✓]: The final status of the batch download operation.processedFiles(array) [✗]: List of successfully processed files.failedFiles(array) [✗]: List of files that failed to process.processedAt(string) [✓]: Timestamp when the batch processing completed.statistics(object) [✗]: Statistics about the batch processing.
media-batch-download-request
Description: Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
Method: client.mediaBatchDownloadRequest(data)
Payload Type: MediaBatchDownloadRequestMessage
Fields:
batchId(string) [✗]: Unique identifier for this batch of media files. Used for organizing processed files in S3 storage (media/{batchId}/) and correlating with completion responses.downloadStrategy(string) [✗]: Download strategy for media files: - storage_provider: Download from authenticated storage connection (Google Drive, SFTP, etc.) - external_url: Download from public HTTP URLs (CDN, API responses, Thingiverse, etc.)entityType(string) [✗]: Type of entity these media files belong to. Used for linking downloaded media to the correct entity in the database.entityId(string) [✗]: UUID of the model or metamodel entity that owns these media files. Used for creating storage item associations after download.storageConnectionId(string) [✗]: UUID of the StorageConnection entity from which to download the media files. Required when downloadStrategy is 'storage_provider'. Used to authenticate and access the source storage provider.credentials(object) [✗]: Decrypted credentials for the storage provider (Fat Payload pattern). Required when downloadStrategy is 'storage_provider'.mediaFiles(array) [✗]: Array of media files to download and process. Must contain at least one file. Each file includes metadata for identification and processing.compressionSettings(object) [✗]: Optional compression settings that override deployment environment defaults. If not provided, uses values from MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT, IMAGE_QUALITY, and OUTPUT_FORMAT environment variables.
metamodel-metadata-generation-completed
Description: Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
Method: client.metamodelMetadataGenerationCompleted(data)
Payload Type: MetamodelMetadataGenerationCompletedMessage
Fields:
metamodelId(string) [✓]: The unique identifier for the metamodelmetadata(object) [✓]: AI-generated metadata for the metamodeltechnicalMetadata(object) [✓]: Aggregated technical analysis from constituent models
metamodel-metadata-generation-request
Description: Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
Method: client.metamodelMetadataGenerationRequest(data)
Payload Type: MetamodelMetadataGenerationRequestMessage
Fields:
metamodelId(string) [✗]: The unique identifier for the metamodelconstituentModelIds(array) [✗]: Array of model IDs that compose this metamodelname(string) [✗]: The name of the metamodelownerId(string) [✗]: The owner's user IDlibraryId(string) [✗]: The library containing this metamodelconstituentModels(array) [✗]: Enriched metadata for constituent models (includes storage items)webhookUrl(string) [✗]: Optional webhook URL for async completion notification
model-analytics-collection-request
Description: Request to collect marketplace analytics for a specific metamodel. Triggered by backend scheduler every 6 hours for popular/tagged metamodels.
Worker performs targeted market searches based on metamodel metadata and stores aggregated statistics in Elasticsearch for trend analysis.
Method: client.modelAnalyticsCollectionRequest(data)
Payload Type: ModelAnalyticsCollectionRequestMessage
Fields:
metamodelId(string) [✓]: The metamodel ID to collect analytics forownerId(string) [✓]: Owner user ID for audit trailprimaryCategory(string) [✗]: Primary classification category (e.g., "miniature", "terrain")subCategory(string) [✗]: Sub-category for more specific targetingtags(array) [✗]: Relevant tags from metamodel metadata (max 10)franchise(string) [✗]: Franchise name if detected (e.g., "Dungeons & Dragons")confidence(number) [✗]: Classification confidence scorepriority(string) [✗]: Collection priority leveltriggeredBy(string) [✗]: Source of trigger (e.g., "backend-scheduler", "manual")triggeredAt(string) [✗]: Timestamp when collection was triggered
model-discovery-folder-processed-event
Description: Handles model discovery folder processed events.
Method: client.modelDiscoveryFolderProcessedEvent(data)
Payload Type: ModelDiscoveryFolderProcessedEventMessage
Fields:
connectionId(string) [✗]: The unique identifier for the connection.folderPath(string) [✗]: The path to the processed folder.discoveredFiles(array) [✗]: A list of files discovered in the folder.folderSignature(object) [✗]: A signature representing the state of the folder.processedAt(string) [✗]: The timestamp when the folder was processed.statistics(object) [✗]: Statistics about the processed folder.
model-discovery-scan-found-event
Description: Handles model discovery scan found events.
Method: client.modelDiscoveryScanFoundEvent(data)
Payload Type: ModelDiscoveryScanFoundEventMessage
Fields:
modelId(string) [✗]: The unique identifier for the model.name(string) [✗]: The name of the model.fileName(string) [✗]: The name of the model file.description(string) [✗]: A description of the model.fileTypes(array) [✗]: An array of file types associated with the model.size(number) [✗]: The size of the model file in bytes.storageLocation(object) [✗]: The storage location of the model.providerType(string) [✗]: The type of the storage provider.metadata(object) [✗]: A flexible object for additional metadata.
model-discovery-scan-progress-event
Description: Handles model discovery scan progress events.
Method: client.modelDiscoveryScanProgressEvent(data)
Payload Type: ModelDiscoveryScanProgressEventMessage
Fields:
payload(object) [✗]: Contains the discovery scan progress details.
model-discovery-scan-request
Description: Handles model discovery scan requests events.
Method: client.modelDiscoveryScanRequest(data)
Payload Type: ModelDiscoveryScanRequestMessage
Fields:
libraryId(string) [✗]: The ID of the library to scan.storageConnectionId(string) [✗]: The ID of the storage connection to scan.providerType(string) [✗]: The type of the storage provider.path(string) [✗]: The specific path within the storage connection to scan for this library.credentials(object) [✗]: Decrypted credentials for the storage provider.configuration(object) [✗]: Configuration for the storage connection (e.g. scanRootPath).
model-finder-index-request
Description: Request to index a 3D model for similarity search.
Method: client.modelFinderIndexRequest(data)
Payload Type: ModelFinderIndexRequestMessage
Fields:
modelId(string) [✗]:storageItem() [✗]:
model-finder-response
Description: Response containing search results from the model finder.
Method: client.modelFinderResponse(data)
Payload Type: ModelFinderResponseMessage
Fields:
requestId(string) [✗]:results(array) [✗]:
model-finder-search-request
Description: Request to search for similar 3D models.
Method: client.modelFinderSearchRequest(data)
Payload Type: ModelFinderSearchRequestMessage
Fields:
referenceModelId(string) [✗]: Optional: Search using an existing model as referencereferenceImageId(string) [✗]: Optional: Search using an uploaded imagelimit(integer) [✗]:
model-metadata-generation-completed
Description: Notifies backend that enriched marketplace metadata generation completed. Backend updates Model entity with generated description, tags, classification, etc.
Method: client.modelMetadataGenerationCompleted(data)
Payload Type: ModelMetadataGenerationCompletedMessage
Fields:
modelId(string) [✓]: UUID of the model that was processed.metadata(object) [✓]: Enriched marketplace metadata generated by LLM.
model-metadata-generation-request
Description: Generates enriched marketplace metadata (SEO descriptions, tags, categories) for 3D models using LLM vision analysis. Worker receives all necessary data in the payload (Model, TechnicalMetadata, Thumbnails) and does NOT query the database. Prerequisites: file download, technical metadata, and thumbnail generation must be complete before this message is sent.
Method: client.modelMetadataGenerationRequest(data)
Payload Type: ModelMetadataGenerationRequestMessage
Fields:
modelId(string) [✗]: UUID of the model (reference only)model(object) [✗]: Core model entity datatechnicalMetadata(object) [✗]: Geometric and technical analysis resultsthumbnails(array) [✗]: List of 360 degree thumbnail views (URLs or paths)
model-metamodel-detection-found
Description: Handles model metamodel detection found with hierarchical relationships.
Method: client.modelMetamodelDetectionFound(data)
Payload Type: ModelMetamodelDetectionFoundMessage
Fields:
metamodels(array) [✓]: List of metamodel nodes in hierarchical structure (roots and children).ekgEdges(array) [✗]: EKG edges derived from Louvain clustering (OPTIONAL - new field)
model-metamodel-detection-request
Description: Handles model metamodel detection requests.
Method: client.modelMetamodelDetectionRequest(data)
Payload Type: ModelMetamodelDetectionRequestMessage
Fields:
connectionId(string) [✓]: The unique identifier for the storage connection.folderPath(string) [✓]: The path to the folder that was processed.discoveredFiles(array) [✗]: A list of files discovered in the folder. Worker should check this first, then manifestUrl.manifestUrl(string) [✗]: URL to a JSON file containing the list of discovered files (for large folders)folderSignature(object) [✓]: A signature representing the state of the folder.processedAt(string) [✓]: The timestamp when the folder was processed.statistics(object) [✓]: Statistics about the processed folder.
model-sellability-analysis-completed
Description: Contains sellability analysis results including Etsy-specific recommendations, material pricing, and marketplace compatibility scores
Method: client.modelSellabilityAnalysisCompleted(data)
Payload Type: ModelSellabilityAnalysisCompletedMessage
Fields:
metamodelId(string) [✗]: Metamodel UUIDownerId(string) [✗]: Owner user IDsellabilityScore(number) [✗]: Overall sellability score (0-100)pricingRecommendations(object) [✗]: Pricing analysis and recommendations with material-specific pricing (v2.0.0)marketplaceRecommendations(array) [✗]: Recommended marketplaces with Etsy-specific scoring (v2.0.0)demandAnalysis(object) [✗]: Market demand insightsqualityFactors(object) [✗]: Quality-related factors affecting sellabilityrecommendations(array) [✗]: Actionable recommendations to improve sellabilityanalyzedAt(string) [✗]: Analysis completion timestamp (ISO 8601)analysisVersion(string) [✗]: Analysis algorithm versionerror(object) [✗]: Error information if analysis failed
model-sellability-analysis-request
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.
Method: client.modelSellabilityAnalysisRequest(data)
Payload Type: ModelSellabilityAnalysisRequestMessage
Fields:
metamodelId(string) [✗]: UUID of the metamodel to analyze.ownerId(string) [✗]: UUID of the user who owns the metamodelmetamodelData(object) [✗]: Full metamodel data including technical metadata, enriched metadata, and child models. Injected by backend to avoid DB access.manifestUrl(string) [✗]: URL to a JSON manifest containing the metamodel data if it is too large for the message payload.analysisOptions(object) [✗]: Optional analysis configuration
model-semantic-analysis-completed
Description: Handles completion of 3D model semantic analysis with generated tags and similarity results.
Method: client.modelSemanticAnalysisCompleted(data)
Payload Type: ModelSemanticAnalysisCompletedMessage
Fields:
modelId(string) [✗]: The unique identifier for the model.userId(string) [✗]: The user ID who owns the model.processingStatus(string) [✗]: Final processing status.semanticMetadata(object) [✗]: Generated semantic metadata and analysis results.processingTime(object) [✗]: Processing performance metrics.qualityMetrics(object) [✗]: Processing quality and confidence metrics.error(object) [✗]: Error information if processing failed.debugInfo(object) [✗]: Additional debug information for troubleshooting.
model-semantic-analysis-request
Description: Handles 3D model semantic analysis requests using ULIP-2 neural networks and FAISS vector similarity search.
Method: client.modelSemanticAnalysisRequest(data)
Payload Type: ModelSemanticAnalysisRequestMessage
Fields:
modelId(string) [✗]: The unique identifier for the model.userId(string) [✗]: The user ID who owns the model.storageConnectionId(string) [✗]: The ID of the storage connection.filePath(string) [✗]: The path to the 3D model file in storage.fileName(string) [✗]: The name of the model file.fileSize(number) [✗]: The size of the model file in bytes.storageProviderType(string) [✗]: The type of the storage provider (S3, GoogleDrive, SFTP, etc).processingOptions(object) [✗]: Configuration options for semantic analysis.priority(number) [✗]: Processing priority (1=highest, 10=lowest).webhookUrl(string) [✗]: Optional webhook URL for completion notification.retryCount(number) [✗]: Current retry attempt number.
model-technical-metadata-completed
Description: Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
Method: client.modelTechnicalMetadataCompleted(data)
Payload Type: ModelTechnicalMetadataCompletedMessage
Fields:
originalJobId(string) [✗]: ID of the original analysis request jobmodelId(string) [✗]: ID of the analyzed modelstatus(string) [✗]: Analysis completion statusvertices(integer) [✗]: Number of vertices in the meshfaces(integer) [✗]: Number of faces/polygons in the meshedges(integer) [✗]: Number of edges in the meshdetailLevel(string) [✗]: Visual detail level based on polygon densityboundingBox(object) [✗]: 3D bounding box dimensions in millimetersvolumeCubicMm(number) [✗]: Model volume in cubic millimeters (for material calculation)surfaceAreaSqMm(number) [✗]: Total surface area in square millimetersminWallThickness(number) [✗]: Minimum wall thickness detected in millimeters (critical for printability)maxWallThickness(number) [✗]: Maximum wall thickness detected in millimetersmanifold(boolean) [✗]: Is the mesh watertight/manifold? Critical for 3D printing (true = printable)nonManifoldEdges(integer) [✗]: Number of non-manifold edges (repair needed if > 0)holes(integer) [✗]: Number of holes/boundary loops in the mesh (0 = closed mesh)flippedNormals(integer) [✗]: Number of faces with inverted normals (causes rendering/slicing issues)selfIntersections(integer) [✗]: Number of self-intersecting faces (0 = clean geometry)qualityScore(number) [✗]: Overall quality score 0-100 (100 = perfect for printing, <60 needs repair)printabilityScore(number) [✗]: Printability score 0-100 (considers supports, orientation, size constraints)requiresSupports(boolean) [✗]: Does this model require support structures for 3D printing?overhangs(array) [✗]: Detected overhang areas requiring support structuresestimatedPrintTimeMinutes(integer) [✗]: Estimated print time in minutes using normal quality settings (0.2mm layers, 20% infill)printTimeEstimates(object) [✗]: Print time estimates for different quality presetsestimatedMaterialGrams(number) [✗]: Estimated material usage in grams using 20% infill (assumes PLA density 1.24g/cm³)materialEstimates(object) [✗]: Material usage estimates for different infill percentagesrecommendedOrientation(object) [✗]: Recommended print orientation for minimal support material and best resultsoriginalUnit(string) [✗]: Original file format unit detected from metadata or inferred from scaleformatVersion(string) [✗]: File format version (e.g., 'STL Binary', 'OBJ v4', 'PLY 1.0')hasColorData(boolean) [✗]: Does the file contain per-vertex color information?hasTextureCoordinates(boolean) [✗]: Does the file contain UV texture mapping coordinates?hasVertexNormals(boolean) [✗]: Does the file contain per-vertex normal vectors?analyzedBy(string) [✗]: Tool/service that performed the analysisanalysisVersion(string) [✗]: Version of the analysis algorithm (for tracking improvements)analysisConfidence(number) [✗]: Confidence level of analysis results (0.0 = uncertain, 1.0 = highly confident)analysisWarnings(array) [✗]: Warnings or issues detected during analysis (structured for programmatic handling)analyzedAt(string) [✗]: ISO 8601 timestamp when analysis was performed (e.g., '2025-11-19T14:35:22Z')errorMessage(string) [✗]: Detailed error message if status is FAILEDerrorCode(string) [✗]: Machine-readable error code for programmatic error handling
model-technical-metadata-request
Description: Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
Method: client.modelTechnicalMetadataRequest(data)
Payload Type: ModelTechnicalMetadataRequestMessage
Fields:
modelId(string) [✗]: Unique identifier for the model to analyzeownerId(string) [✗]: User ID who owns the modelstorageLocation(object) [✗]: Location of the 3D model file (legacy - used for direct download if minioPath not provided)minioPath(string) [✗]: Path to model in MinIO (e.g., 'raw_models/{modelId}/original.glb'). If provided, file will be read from MinIO instead of downloading from storage provider.parentJobId(string) [✗]: ID of parent file-download job (for BullMQ dependency tracking).analysisOptions(object) [✗]: Optional analysis configuration parameters
thumbnail-generation-completed
Description: Handles thumbnail generation completed.
Method: client.thumbnailGenerationCompleted(data)
Payload Type: ThumbnailGenerationCompletedMessage
Fields:
originalJobId(string) [✗]: The ID of the original job that requested the thumbnail generation.modelId(string) [✗]: The ID of the model that the thumbnail was generated for.status(string) [✗]: The status of the thumbnail generation.thumbnailPath(string) [✗]: The path to the generated thumbnail.thumbnail360Views(array) [✗]: Array of 360° thumbnail view paths (16 angles) for vision-based analysis.gltfPreviewPath(string) [✗]: The path to the generated GLTF/GLB 3D preview file.errorMessage(string) [✗]: An error message if the thumbnail generation failed.storageLocation(object) [✗]: The storage location of the model.
thumbnail-generation-request
Description: Handles thumbnail generation requests with customization options. Supports both storage provider downloads and MinIO-cached files.
Method: client.thumbnailGenerationRequest(data)
Payload Type: ThumbnailGenerationRequestMessage
Fields:
modelId(string) [✗]: The unique identifier for the model requiring a thumbnail.ownerId(string) [✗]: The identifier of the user who owns the entity.storageLocation(object) [✗]: The storage location of the model (legacy - used for direct download if minioPath not provided).minioPath(string) [✗]: Path to model in MinIO (e.g., 'raw_models/{modelId}/original.glb'). If provided, file will be read from MinIO instead of downloading from storage provider.previewType(string) [✗]: The type of preview to generate, e.g., 'default', 'static', 'glb'.generate360Views(boolean) [✗]: Generate 16 angle views for 360° preview (4 horizontal x 4 vertical angles) for enhanced vision-based metadata analysis.parentJobId(string) [✗]: ID of parent file-download job (for BullMQ dependency tracking).customization(object) [✗]: User-defined customizations for the thumbnail.
user-engagement-event
Description: User engagement and onboarding tracking events for analytics and behavioral insights.
Captures key user actions throughout their journey:
- Account creation and onboarding steps
- Feature usage and adoption
- Model management activities
- Marketplace interactions
- Subscription changes
Used for:
- User onboarding funnel analysis
- Feature adoption tracking
- User retention metrics
- A/B testing and experimentation
- Personalization and recommendations
- Product analytics dashboards
Method: client.userEngagementEvent(data)
Payload Type: UserEngagementEventMessage
Fields:
eventType(string) [✓]: Category of user engagement eventaction(string) [✓]: Specific user action performedtimestamp(string) [✓]: ISO 8601 timestamp when the action occurreduserId(string) [✓]: Unique identifier of the useruserEmail(string) [✗]: User's email (hashed for privacy in analytics)userCreatedAt(string) [✗]: When the user account was created (for cohort analysis)userPlanTier(string) [✗]: Current subscription plan tiersessionId(string) [✗]: User session identifier for grouping actionsrequestId(string) [✗]: Request ID for correlation with logsactionDetails(object) [✗]: Additional context about the actionsource(string) [✗]: Where the action originatedhttpMethod(string) [✗]: HTTP method usedhttpUrl(string) [✗]: API endpoint pathhttpStatusCode(integer) [✗]: HTTP response status codedurationMs(number) [✗]: Action duration in millisecondsexperimentId(string) [✗]: A/B test or experiment IDexperimentVariant(string) [✗]: Experiment variant/groupenvironment(string) [✗]: Deployment environmentclientInfo(object) [✗]: Client/browser information (anonymized)
worker-analytics-event
Description: Analytics event emitted by workers for tracking processing metrics, user behavior, and model statistics. Consumed by worker-analytic-collector and forwarded to ELK.
All workers MUST emit this event upon job completion (success or failure).
Each worker includes its specific metrics in the metrics object.
Method: client.workerAnalyticsEvent(data)
Payload Type: WorkerAnalyticsEventMessage
Fields:
eventType(string) [✓]: Type of analytics eventworkerId(string) [✓]: Identifier of the worker that processed the jobjobId(string) [✓]: Unique job identifier from BullMQtimestamp(string) [✓]: ISO 8601 timestamp of event emissionuserId(string) [✗]: User who owns the model/triggered the jobmodelId(string) [✗]: Model identifier (if applicable)metamodelId(string) [✗]: Metamodel identifier (if applicable)storageItemId(string) [✗]: Storage item identifier (for download events)status(string) [✗]: Job completion statuserrorCode(string) [✗]: Error code if status is failureerrorMessage(string) [✗]: Error message if status is failuretiming(object) [✗]: Processing time metrics in millisecondsmetrics(object) [✗]: Worker-specific metrics. Structure varies by eventType.
worker-metrics-enriched-event
Description: Enriched metrics event for detailed worker monitoring, cost tracking, and performance analysis. Published to backend.logging.events for centralized monitoring and cost attribution.
This event is emitted by all workers on job completion and includes:
- LLM token usage and cost breakdown
- System resource consumption (CPU, RAM, disk I/O)
- Detailed timing breakdown by stage
- User and context attribution
- Model-specific metadata
Method: client.workerMetricsEnrichedEvent(data)
Payload Type: WorkerMetricsEnrichedEventMessage
Fields:
eventType(string) [✓]: Fixed type for enriched worker metricsworkerId(string) [✓]: Identifier of the workerjobId(string) [✓]: Unique BullMQ job identifiertimestamp(string) [✓]: ISO 8601 timestamp when job completedstatus(string) [✓]: Job completion statususerId(string) [✗]: User who owns the resource/triggered the jobtenantId(string) [✗]: Organization/tenant ID (for multi-tenant deployments)sessionId(string) [✗]: Session ID for correlating user actionsrequestId(string) [✗]: Request ID from originating API call (X-Request-Id)modelId(string) [✗]: Model ID being processedmetamodelId(string) [✗]: Metamodel ID being processedstorageItemId(string) [✗]: Storage item ID (for file operations)timing(object) [✗]: Comprehensive timing breakdownllmUsage(object) [✗]: LLM token usage and cost breakdownresources(object) [✗]: System resource consumption during jobworkerMetrics(object) [✗]: Worker-specific metrics (varies by worker type)error(object) [✗]: Error details if status is failureenvironment(string) [✗]: Deployment environmentregion(string) [✗]: Cloud region/datacenterworkerVersion(string) [✗]: Worker service versionhostname(string) [✗]: Pod/container hostname
Configuration
Environment Variables
WORKER_BACKEND_URL: Base URL of the worker backendWORKER_BACKEND_API_KEY: Optional API key for authenticationGITHUB_TOKEN: GitHub personal access token (for GitHub Packages installation)NPM_TOKEN: npm token (for private registry installation)
Worker Client Options
interface WorkerClientConfig {
baseUrl: string; // Required: Worker backend URL
apiKey?: string; // Optional: API key for authentication
timeout?: number; // Optional: Request timeout in ms (default: 30000)
}API Reference
WorkerClient
Constructor
new WorkerClient(config: WorkerClientConfig)Methods
sendToQueue(messageType: MessageType, payload: any): Promise<JobResponse>- Send a job to the queue with the specified message type
getJobStatus(jobId: string): Promise<JobStatus>- Get the current status of a job
analyticsCollectionRequest(data: AnalyticsCollectionRequestMessage): Promise<JobResponse>- Request to trigger a manual market data collection job. Used for ad-hoc scraping of specific queries on marketplaces.
backendLoggingEvent(data: BackendLoggingEventMessage): Promise<JobResponse>- Centralized logging event for capturing all warn/error/failure logs from meshsync-backend. This event is sent to ELK for centralized monitoring, alerting, and debugging.
Automatically emitted by the custom Pino logger interceptor when:
- logger.warn() is called
- logger.error() is called
- uncaught exceptions occur
- request failures happen (4xx, 5xx responses)
Used for:
System health monitoring
Error tracking and alerting
Performance degradation detection
Security incident tracking
Compliance and audit trails
ekgEdgeBatchCreateCompleted(data: EkgEdgeBatchCreateCompletedMessage): Promise<JobResponse>- Completion event for EKG edge batch creation with propagation results.
ekgEdgeBatchCreateRequest(data: EkgEdgeBatchCreateRequestMessage): Promise<JobResponse>- Create multiple EKG edges with Dempster-Shafer mass functions. Triggered by metamodel detection completion.
etsyAnalyticsSyncCompleted(data: EtsyAnalyticsSyncCompletedMessage): Promise<JobResponse>- Contains synced analytics data for Etsy listings. Backend stores this in etsy_analytics_snapshots table and indexes to ELK.
etsyAnalyticsSyncRequest(data: EtsyAnalyticsSyncRequestMessage): Promise<JobResponse>- Syncs analytics data from Etsy API for one or more listings. Fetches views, favorites, sales, revenue, and traffic source data. Can sync: - Specific listings (provide listingIds) - All user listings (provide userId, empty listingIds) - Shop-level analytics (provide shopId)
etsyPublishListingCompleted(data: EtsyPublishListingCompletedMessage): Promise<JobResponse>- Indicates completion of Etsy listing publication. Contains external Etsy listing ID and URL, or error details if failed.
etsyPublishListingRequest(data: EtsyPublishListingRequestMessage): Promise<JobResponse>- Publishes a single metamodel listing to Etsy for a specific material variant. Creates Etsy listing, uploads digital file, and returns external listing ID. This message is enqueued for EACH material variant when publishing a metamodel. Example: Publishing a metamodel with PLA, Resin, ABS materials creates 3 jobs.
fileDownloadCompleted(data: FileDownloadCompletedMessage): Promise<JobResponse>- Notifies that a file download has been processed, indicating success or failure.
fileDownloadRequest(data: FileDownloadRequestMessage): Promise<JobResponse>- Downloads model file from storage provider to MinIO for processing pipeline. Acts as parent job for thumbnail generation, technical metadata analysis, and metadata generation.
Retry Configuration:
- Automatic retry enabled for transient failures (connectio
