@mesh-sync/worker-backend-client 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -99,6 +99,31 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
99
99
 
100
100
  ## Available Message Types
101
101
 
102
+
103
+ ### file-download-completed
104
+
105
+ **Description:** Notifies that a file download has been processed, indicating success or failure.
106
+
107
+ **Method:** `client.fileDownloadCompleted(data)`
108
+
109
+ **Payload Type:** `FileDownloadCompletedMessage`
110
+
111
+ **Fields:**
112
+
113
+ - `originalJobId` (string) [✗]: The ID of the initial 'file-download-request' job this event corresponds to.
114
+
115
+ - `modelId` (string) [✗]: The unique identifier for the downloaded model.
116
+
117
+ - `status` (string) [✗]: The final status of the download operation.
118
+
119
+ - `s3Location` (object) [✗]: Details of the file's location in Minio S3 (present on success).
120
+
121
+ - `errorMessage` (string) [✗]: Contains error details if the status is FAILED.
122
+
123
+ - `downloadedAt` (string) [✗]: The timestamp when the download was completed or failed.
124
+
125
+
126
+
102
127
  ### file-download-request
103
128
 
104
129
  **Description:** Handles file download requests.
@@ -108,8 +133,12 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
108
133
  **Payload Type:** `FileDownloadRequestMessage`
109
134
 
110
135
  **Fields:**
111
- - `modelId` (string) [✓]: The unique identifier for the model to be downloaded.
112
- - `storageLocation` (object) []: The storage location of the model.
136
+
137
+ - `modelId` (string) []: The unique identifier for the model to be downloaded.
138
+
139
+ - `storageLocation` (object) [✗]: The storage location of the model.
140
+
141
+
113
142
 
114
143
  ### model-discovery-folder-processed-event
115
144
 
@@ -120,12 +149,20 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
120
149
  **Payload Type:** `ModelDiscoveryFolderProcessedEventMessage`
121
150
 
122
151
  **Fields:**
123
- - `connectionId` (string) [✓]: The unique identifier for the connection.
124
- - `folderPath` (string) []: The path to the processed folder.
125
- - `discoveredFiles` (array) [✓]: A list of files discovered in the folder.
152
+
153
+ - `connectionId` (string) []: The unique identifier for the connection.
154
+
155
+ - `folderPath` (string) [✗]: The path to the processed folder.
156
+
157
+ - `discoveredFiles` (array) [✗]: A list of files discovered in the folder.
158
+
126
159
  - `folderSignature` (object) [✗]: A signature representing the state of the folder.
127
- - `processedAt` (string) [✓]: The timestamp when the folder was processed.
128
- - `statistics` (object) []: Statistics about the processed folder.
160
+
161
+ - `processedAt` (string) []: The timestamp when the folder was processed.
162
+
163
+ - `statistics` (object) [✗]: Statistics about the processed folder.
164
+
165
+
129
166
 
130
167
  ### model-discovery-scan-found-event
131
168
 
@@ -136,15 +173,26 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
136
173
  **Payload Type:** `ModelDiscoveryScanFoundEventMessage`
137
174
 
138
175
  **Fields:**
139
- - `modelId` (string) [✓]: The unique identifier for the model.
140
- - `name` (string) []: The name of the model.
141
- - `fileName` (string) [✓]: The name of the model file.
142
- - `description` (string) []: A description of the model.
143
- - `fileTypes` (array) [✓]: An array of file types associated with the model.
144
- - `size` (number) []: The size of the model file in bytes.
145
- - `storageLocation` (object) [✓]: The storage location of the model.
146
- - `providerType` (string) []: The type of the storage provider.
147
- - `metadata` (object) [✓]: A flexible object for additional metadata.
176
+
177
+ - `modelId` (string) []: The unique identifier for the model.
178
+
179
+ - `name` (string) []: The name of the model.
180
+
181
+ - `fileName` (string) []: The name of the model file.
182
+
183
+ - `description` (string) []: A description of the model.
184
+
185
+ - `fileTypes` (array) [✗]: An array of file types associated with the model.
186
+
187
+ - `size` (number) [✗]: The size of the model file in bytes.
188
+
189
+ - `storageLocation` (object) [✗]: The storage location of the model.
190
+
191
+ - `providerType` (string) [✗]: The type of the storage provider.
192
+
193
+ - `metadata` (object) [✗]: A flexible object for additional metadata.
194
+
195
+
148
196
 
149
197
  ### model-discovery-scan-progress-event
150
198
 
@@ -155,7 +203,10 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
155
203
  **Payload Type:** `ModelDiscoveryScanProgressEventMessage`
156
204
 
157
205
  **Fields:**
158
- - `payload` (object) [✓]: Contains the discovery scan progress details.
206
+
207
+ - `payload` (object) [✗]: Contains the discovery scan progress details.
208
+
209
+
159
210
 
160
211
  ### model-discovery-scan-request
161
212
 
@@ -166,7 +217,14 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
166
217
  **Payload Type:** `ModelDiscoveryScanRequestMessage`
167
218
 
168
219
  **Fields:**
169
- - `libraryId` (string) [✓]: The ID of the library to scan.
220
+
221
+ - `libraryId` (string) [✗]: The ID of the library to scan.
222
+
223
+ - `storageConnectionId` (string) [✗]: The ID of the storage connection to scan.
224
+
225
+ - `providerType` (string) [✗]: The type of the storage provider.
226
+
227
+
170
228
 
171
229
  ### model-metadata-generation-completed
172
230
 
@@ -177,9 +235,13 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
177
235
  **Payload Type:** `ModelMetadataGenerationCompletedMessage`
178
236
 
179
237
  **Fields:**
180
- - `modelId` (string) [✗]: The unique identifier for the model.
238
+
239
+ - `modelId` (string) [✓]: The unique identifier for the model.
240
+
181
241
  - `metadata` (object) [✓]: The enriched metadata for the model.
182
242
 
243
+
244
+
183
245
  ### model-metadata-generation-request
184
246
 
185
247
  **Description:** Handles model metadata generation requests.
@@ -189,16 +251,27 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
189
251
  **Payload Type:** `ModelMetadataGenerationRequestMessage`
190
252
 
191
253
  **Fields:**
192
- - `modelId` (string) [✓]: The unique identifier for the model.
193
- - `storageConnectionId` (string) []: The ID of the storage connection.
194
- - `filePath` (string) [✓]: The path to the model file.
195
- - `fileName` (string) []: The name of the model file.
196
- - `fileSize` (number) [✓]: The size of the model file in bytes.
197
- - `fileLastModified` (string) []: The last modified date of the model file.
198
- - `storageProviderType` (string) [✓]: The type of the storage provider.
254
+
255
+ - `modelId` (string) []: The unique identifier for the model.
256
+
257
+ - `storageConnectionId` (string) []: The ID of the storage connection.
258
+
259
+ - `filePath` (string) []: The path to the model file.
260
+
261
+ - `fileName` (string) [✗]: The name of the model file.
262
+
263
+ - `fileSize` (number) [✗]: The size of the model file in bytes.
264
+
265
+ - `fileLastModified` (string) [✗]: The last modified date of the model file.
266
+
267
+ - `storageProviderType` (string) [✗]: The type of the storage provider.
268
+
199
269
  - `modelThumbnailUrl` (string) [✗]: The URL of the model thumbnail.
270
+
200
271
  - `metamodel` (object) [✗]: The metamodel of the model.
201
272
 
273
+
274
+
202
275
  ### model-metamodel-detection-found
203
276
 
204
277
  **Description:** Handles model metamodel detection found.
@@ -208,7 +281,10 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
208
281
  **Payload Type:** `ModelMetamodelDetectionFoundMessage`
209
282
 
210
283
  **Fields:**
211
- - `suggestions` (array) [✗]: List of metamodel suggestions.
284
+
285
+ - `suggestions` (array) [✓]: List of metamodel suggestions.
286
+
287
+
212
288
 
213
289
  ### model-metamodel-detection-request
214
290
 
@@ -219,13 +295,21 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
219
295
  **Payload Type:** `ModelMetamodelDetectionRequestMessage`
220
296
 
221
297
  **Fields:**
222
- - `connectionId` (string) [✗]: The unique identifier for the storage connection.
223
- - `folderPath` (string) []: The path to the folder that was processed.
224
- - `discoveredFiles` (array) [✗]: A list of files discovered in the folder.
298
+
299
+ - `connectionId` (string) []: The unique identifier for the storage connection.
300
+
301
+ - `folderPath` (string) [✓]: The path to the folder that was processed.
302
+
303
+ - `discoveredFiles` (array) [✓]: A list of files discovered in the folder.
304
+
225
305
  - `folderSignature` (object) [✓]: A signature representing the state of the folder.
226
- - `processedAt` (string) [✗]: The timestamp when the folder was processed.
306
+
307
+ - `processedAt` (string) [✓]: The timestamp when the folder was processed.
308
+
227
309
  - `statistics` (object) [✓]: Statistics about the processed folder.
228
310
 
311
+
312
+
229
313
  ### thumbnail-generation-completed
230
314
 
231
315
  **Description:** Handles thumbnail generation completed.
@@ -235,26 +319,42 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
235
319
  **Payload Type:** `ThumbnailGenerationCompletedMessage`
236
320
 
237
321
  **Fields:**
238
- - `originalJobId` (string) [✓]: The ID of the original job that requested the thumbnail generation.
239
- - `modelId` (string) []: The ID of the model that the thumbnail was generated for.
240
- - `status` (string) [✓]: The status of the thumbnail generation.
322
+
323
+ - `originalJobId` (string) []: The ID of the original job that requested the thumbnail generation.
324
+
325
+ - `modelId` (string) [✗]: The ID of the model that the thumbnail was generated for.
326
+
327
+ - `status` (string) [✗]: The status of the thumbnail generation.
328
+
241
329
  - `thumbnailPath` (string) [✗]: The path to the generated thumbnail.
330
+
242
331
  - `errorMessage` (string) [✗]: An error message if the thumbnail generation failed.
243
- - `storageLocation` (object) [✓]: The storage location of the model.
332
+
333
+ - `storageLocation` (object) [✗]: The storage location of the model.
334
+
335
+
244
336
 
245
337
  ### thumbnail-generation-request
246
338
 
247
- **Description:** Handles thumbnail generation requests.
339
+ **Description:** Handles thumbnail generation requests with customization options.
248
340
 
249
341
  **Method:** `client.thumbnailGenerationRequest(data)`
250
342
 
251
343
  **Payload Type:** `ThumbnailGenerationRequestMessage`
252
344
 
253
345
  **Fields:**
254
- - `modelId` (string) [✓]: The unique identifier for the model requiring a thumbnail.
255
- - `ownerId` (string) []: The identifier of the user who owns the entity.
256
- - `storageLocation` (object) [✓]: The storage location of the model.
257
- - `previewType` (string) []: The type of preview to generate, e.g., 'default', 'static', 'glb'.
346
+
347
+ - `modelId` (string) []: The unique identifier for the model requiring a thumbnail.
348
+
349
+ - `ownerId` (string) []: The identifier of the user who owns the entity.
350
+
351
+ - `storageLocation` (object) [✗]: The storage location of the model.
352
+
353
+ - `previewType` (string) [✗]: The type of preview to generate, e.g., 'default', 'static', 'glb'.
354
+
355
+ - `customization` (object) [✗]: User-defined customizations for the thumbnail.
356
+
357
+
258
358
 
259
359
  ## Configuration
260
360
 
@@ -293,28 +393,43 @@ new WorkerClient(config: WorkerClientConfig)
293
393
  - `getJobStatus(jobId: string): Promise<JobStatus>`
294
394
  - Get the current status of a job
295
395
 
396
+
397
+ - `fileDownloadCompleted(data: FileDownloadCompletedMessage): Promise<JobResponse>`
398
+ - Notifies that a file download has been processed, indicating success or failure.
399
+
296
400
  - `fileDownloadRequest(data: FileDownloadRequestMessage): Promise<JobResponse>`
297
401
  - Handles file download requests.
402
+
298
403
  - `modelDiscoveryFolderProcessedEvent(data: ModelDiscoveryFolderProcessedEventMessage): Promise<JobResponse>`
299
404
  - Handles model discovery folder processed events.
405
+
300
406
  - `modelDiscoveryScanFoundEvent(data: ModelDiscoveryScanFoundEventMessage): Promise<JobResponse>`
301
407
  - Handles model discovery scan found events.
408
+
302
409
  - `modelDiscoveryScanProgressEvent(data: ModelDiscoveryScanProgressEventMessage): Promise<JobResponse>`
303
410
  - Handles model discovery scan progress events.
411
+
304
412
  - `modelDiscoveryScanRequest(data: ModelDiscoveryScanRequestMessage): Promise<JobResponse>`
305
413
  - Handles model discovery scan requests events.
414
+
306
415
  - `modelMetadataGenerationCompleted(data: ModelMetadataGenerationCompletedMessage): Promise<JobResponse>`
307
416
  - Handles model metadata generation completed.
417
+
308
418
  - `modelMetadataGenerationRequest(data: ModelMetadataGenerationRequestMessage): Promise<JobResponse>`
309
419
  - Handles model metadata generation requests.
420
+
310
421
  - `modelMetamodelDetectionFound(data: ModelMetamodelDetectionFoundMessage): Promise<JobResponse>`
311
422
  - Handles model metamodel detection found.
423
+
312
424
  - `modelMetamodelDetectionRequest(data: ModelMetamodelDetectionRequestMessage): Promise<JobResponse>`
313
425
  - Handles model metamodel detection requests.
426
+
314
427
  - `thumbnailGenerationCompleted(data: ThumbnailGenerationCompletedMessage): Promise<JobResponse>`
315
428
  - Handles thumbnail generation completed.
429
+
316
430
  - `thumbnailGenerationRequest(data: ThumbnailGenerationRequestMessage): Promise<JobResponse>`
317
- - Handles thumbnail generation requests.
431
+ - Handles thumbnail generation requests with customization options.
432
+
318
433
 
319
434
  ### Response Types
320
435
 
package/dist/client.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as types from './types.js';
2
2
  export interface WorkerClientConfig {
3
3
  baseUrl: string;
4
- apiKey?: string;
5
- timeout?: number;
4
+ apiKey: string;
5
+ timeout: number;
6
6
  }
7
7
  export interface JobResponse {
8
8
  success: boolean;
@@ -15,9 +15,9 @@ export interface JobStatus {
15
15
  name: string;
16
16
  queue: string;
17
17
  state: 'waiting' | 'active' | 'completed' | 'failed' | 'delayed';
18
- data: any;
19
- returnvalue?: any;
20
- progress?: number;
18
+ data: Record<string, string | number | boolean>;
19
+ returnvalue: string | number | boolean;
20
+ progress: number;
21
21
  timestamp: number;
22
22
  }
23
23
  /**
@@ -26,17 +26,23 @@ export interface JobStatus {
26
26
  */
27
27
  export declare class WorkerClient {
28
28
  private baseUrl;
29
- private apiKey?;
29
+ private apiKey;
30
30
  private timeout;
31
31
  constructor(config: WorkerClientConfig);
32
32
  /**
33
33
  * Send a job to the queue
34
34
  */
35
- sendToQueue(messageType: types.MessageType, payload: any): Promise<JobResponse>;
35
+ sendToQueue<T>(messageType: types.MessageType, payload: T): Promise<JobResponse>;
36
36
  /**
37
37
  * Get job status by job ID
38
38
  */
39
39
  getJobStatus(jobId: string): Promise<JobStatus>;
40
+ /**
41
+ * Notifies that a file download has been processed, indicating success or failure.
42
+ * @param data - The message payload
43
+ * @returns Job response with job ID
44
+ */
45
+ fileDownloadCompleted(data: types.FileDownloadCompletedMessage): Promise<JobResponse>;
40
46
  /**
41
47
  * Handles file download requests.
42
48
  * @param data - The message payload
@@ -98,7 +104,7 @@ export declare class WorkerClient {
98
104
  */
99
105
  thumbnailGenerationCompleted(data: types.ThumbnailGenerationCompletedMessage): Promise<JobResponse>;
100
106
  /**
101
- * Handles thumbnail generation requests.
107
+ * Handles thumbnail generation requests with customization options.
102
108
  * @param data - The message payload
103
109
  * @returns Job response with job ID
104
110
  */
package/dist/client.js CHANGED
@@ -7,7 +7,7 @@ export class WorkerClient {
7
7
  constructor(config) {
8
8
  this.baseUrl = config.baseUrl.replace(/\/$/, '');
9
9
  this.apiKey = config.apiKey;
10
- this.timeout = config.timeout || 30000;
10
+ this.timeout = config.timeout;
11
11
  }
12
12
  /**
13
13
  * Send a job to the queue
@@ -60,6 +60,14 @@ export class WorkerClient {
60
60
  }
61
61
  return await response.json();
62
62
  }
63
+ /**
64
+ * Notifies that a file download has been processed, indicating success or failure.
65
+ * @param data - The message payload
66
+ * @returns Job response with job ID
67
+ */
68
+ async fileDownloadCompleted(data) {
69
+ return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_COMPLETED, data);
70
+ }
63
71
  /**
64
72
  * Handles file download requests.
65
73
  * @param data - The message payload
@@ -141,7 +149,7 @@ export class WorkerClient {
141
149
  return this.sendToQueue(types.MessageTypes.THUMBNAIL_GENERATION_COMPLETED, data);
142
150
  }
143
151
  /**
144
- * Handles thumbnail generation requests.
152
+ * Handles thumbnail generation requests with customization options.
145
153
  * @param data - The message payload
146
154
  * @returns Job response with job ID
147
155
  */
package/dist/types.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Message type constants
3
3
  */
4
4
  export declare const MessageTypes: {
5
+ readonly FILE_DOWNLOAD_COMPLETED: "file-download-completed";
5
6
  readonly FILE_DOWNLOAD_REQUEST: "file-download-request";
6
7
  readonly MODEL_DISCOVERY_FOLDER_PROCESSED_EVENT: "model-discovery-folder-processed-event";
7
8
  readonly MODEL_DISCOVERY_SCAN_FOUND_EVENT: "model-discovery-scan-found-event";
@@ -15,152 +16,175 @@ export declare const MessageTypes: {
15
16
  readonly THUMBNAIL_GENERATION_REQUEST: "thumbnail-generation-request";
16
17
  };
17
18
  export type MessageType = typeof MessageTypes[keyof typeof MessageTypes];
19
+ /**
20
+ * Notifies that a file download has been processed, indicating success or failure.
21
+ */
22
+ export interface FileDownloadCompletedMessage {
23
+ /** The ID of the initial 'file-download-request' job this event corresponds to. */
24
+ originalJobId?: string;
25
+ /** The unique identifier for the downloaded model. */
26
+ modelId?: string;
27
+ /** The final status of the download operation. */
28
+ status?: string;
29
+ /** Details of the file's location in Minio S3 (present on success). */
30
+ s3Location?: Record<string, string | number | boolean>;
31
+ /** Contains error details if the status is FAILED. */
32
+ errorMessage?: string;
33
+ /** The timestamp when the download was completed or failed. */
34
+ downloadedAt?: string;
35
+ }
18
36
  /**
19
37
  * Handles file download requests.
20
38
  */
21
39
  export interface FileDownloadRequestMessage {
22
40
  /** The unique identifier for the model to be downloaded. */
23
- modelId: string;
41
+ modelId?: string;
24
42
  /** The storage location of the model. */
25
- storageLocation: Record<string, any>;
43
+ storageLocation?: Record<string, string | number | boolean>;
26
44
  }
27
45
  /**
28
46
  * Handles model discovery folder processed events.
29
47
  */
30
48
  export interface ModelDiscoveryFolderProcessedEventMessage {
31
49
  /** The unique identifier for the connection. */
32
- connectionId: string;
50
+ connectionId?: string;
33
51
  /** The path to the processed folder. */
34
- folderPath: string;
52
+ folderPath?: string;
35
53
  /** A list of files discovered in the folder. */
36
- discoveredFiles: any[];
54
+ discoveredFiles?: Array<Record<string, string | number | boolean>>;
37
55
  /** A signature representing the state of the folder. */
38
- folderSignature?: Record<string, any>;
56
+ folderSignature?: Record<string, string | number | boolean>;
39
57
  /** The timestamp when the folder was processed. */
40
- processedAt: string;
58
+ processedAt?: string;
41
59
  /** Statistics about the processed folder. */
42
- statistics: Record<string, any>;
60
+ statistics?: Record<string, string | number | boolean>;
43
61
  }
44
62
  /**
45
63
  * Handles model discovery scan found events.
46
64
  */
47
65
  export interface ModelDiscoveryScanFoundEventMessage {
48
66
  /** The unique identifier for the model. */
49
- modelId: string;
67
+ modelId?: string;
50
68
  /** The name of the model. */
51
- name: string;
69
+ name?: string;
52
70
  /** The name of the model file. */
53
- fileName: string;
71
+ fileName?: string;
54
72
  /** A description of the model. */
55
- description: string;
73
+ description?: string;
56
74
  /** An array of file types associated with the model. */
57
- fileTypes: any[];
75
+ fileTypes?: Array<Record<string, string | number | boolean>>;
58
76
  /** The size of the model file in bytes. */
59
- size: number;
77
+ size?: number;
60
78
  /** The storage location of the model. */
61
- storageLocation: Record<string, any>;
79
+ storageLocation?: Record<string, string | number | boolean>;
62
80
  /** The type of the storage provider. */
63
- providerType: string;
81
+ providerType?: string;
64
82
  /** A flexible object for additional metadata. */
65
- metadata: Record<string, any>;
83
+ metadata?: Record<string, string | number | boolean>;
66
84
  }
67
85
  /**
68
86
  * Handles model discovery scan progress events.
69
87
  */
70
88
  export interface ModelDiscoveryScanProgressEventMessage {
71
89
  /** Contains the discovery scan progress details. */
72
- payload: Record<string, any>;
90
+ payload?: Record<string, string | number | boolean>;
73
91
  }
74
92
  /**
75
93
  * Handles model discovery scan requests events.
76
94
  */
77
95
  export interface ModelDiscoveryScanRequestMessage {
78
96
  /** The ID of the library to scan. */
79
- libraryId: string;
97
+ libraryId?: string;
98
+ /** The ID of the storage connection to scan. */
99
+ storageConnectionId?: string;
100
+ /** The type of the storage provider. */
101
+ providerType?: string;
80
102
  }
81
103
  /**
82
104
  * Handles model metadata generation completed.
83
105
  */
84
106
  export interface ModelMetadataGenerationCompletedMessage {
85
107
  /** The unique identifier for the model. */
86
- modelId?: string;
108
+ modelId: string;
87
109
  /** The enriched metadata for the model. */
88
- metadata: Record<string, any>;
110
+ metadata: Record<string, string | number | boolean>;
89
111
  }
90
112
  /**
91
113
  * Handles model metadata generation requests.
92
114
  */
93
115
  export interface ModelMetadataGenerationRequestMessage {
94
116
  /** The unique identifier for the model. */
95
- modelId: string;
117
+ modelId?: string;
96
118
  /** The ID of the storage connection. */
97
- storageConnectionId: string;
119
+ storageConnectionId?: string;
98
120
  /** The path to the model file. */
99
- filePath: string;
121
+ filePath?: string;
100
122
  /** The name of the model file. */
101
- fileName: string;
123
+ fileName?: string;
102
124
  /** The size of the model file in bytes. */
103
- fileSize: number;
125
+ fileSize?: number;
104
126
  /** The last modified date of the model file. */
105
- fileLastModified: string;
127
+ fileLastModified?: string;
106
128
  /** The type of the storage provider. */
107
- storageProviderType: string;
129
+ storageProviderType?: string;
108
130
  /** The URL of the model thumbnail. */
109
131
  modelThumbnailUrl?: string;
110
132
  /** The metamodel of the model. */
111
- metamodel?: Record<string, any>;
133
+ metamodel?: Record<string, string | number | boolean>;
112
134
  }
113
135
  /**
114
136
  * Handles model metamodel detection found.
115
137
  */
116
138
  export interface ModelMetamodelDetectionFoundMessage {
117
139
  /** List of metamodel suggestions. */
118
- suggestions?: any[];
140
+ suggestions: Array<Record<string, string | number | boolean>>;
119
141
  }
120
142
  /**
121
143
  * Handles model metamodel detection requests.
122
144
  */
123
145
  export interface ModelMetamodelDetectionRequestMessage {
124
146
  /** The unique identifier for the storage connection. */
125
- connectionId?: string;
147
+ connectionId: string;
126
148
  /** The path to the folder that was processed. */
127
- folderPath?: string;
149
+ folderPath: string;
128
150
  /** A list of files discovered in the folder. */
129
- discoveredFiles?: any[];
151
+ discoveredFiles: Array<Record<string, string | number | boolean>>;
130
152
  /** A signature representing the state of the folder. */
131
- folderSignature: Record<string, any>;
153
+ folderSignature: Record<string, string | number | boolean>;
132
154
  /** The timestamp when the folder was processed. */
133
- processedAt?: string;
155
+ processedAt: string;
134
156
  /** Statistics about the processed folder. */
135
- statistics: Record<string, any>;
157
+ statistics: Record<string, string | number | boolean>;
136
158
  }
137
159
  /**
138
160
  * Handles thumbnail generation completed.
139
161
  */
140
162
  export interface ThumbnailGenerationCompletedMessage {
141
163
  /** The ID of the original job that requested the thumbnail generation. */
142
- originalJobId: string;
164
+ originalJobId?: string;
143
165
  /** The ID of the model that the thumbnail was generated for. */
144
- modelId: string;
166
+ modelId?: string;
145
167
  /** The status of the thumbnail generation. */
146
- status: string;
168
+ status?: string;
147
169
  /** The path to the generated thumbnail. */
148
170
  thumbnailPath?: string;
149
171
  /** An error message if the thumbnail generation failed. */
150
172
  errorMessage?: string;
151
173
  /** The storage location of the model. */
152
- storageLocation: Record<string, any>;
174
+ storageLocation?: Record<string, string | number | boolean>;
153
175
  }
154
176
  /**
155
- * Handles thumbnail generation requests.
177
+ * Handles thumbnail generation requests with customization options.
156
178
  */
157
179
  export interface ThumbnailGenerationRequestMessage {
158
180
  /** The unique identifier for the model requiring a thumbnail. */
159
- modelId: string;
181
+ modelId?: string;
160
182
  /** The identifier of the user who owns the entity. */
161
- ownerId: string;
183
+ ownerId?: string;
162
184
  /** The storage location of the model. */
163
- storageLocation: Record<string, any>;
185
+ storageLocation?: Record<string, string | number | boolean>;
164
186
  /** The type of preview to generate, e.g., 'default', 'static', 'glb'. */
165
- previewType: string;
187
+ previewType?: string;
188
+ /** User-defined customizations for the thumbnail. */
189
+ customization?: Record<string, string | number | boolean>;
166
190
  }
package/dist/types.js CHANGED
@@ -3,6 +3,7 @@
3
3
  * Message type constants
4
4
  */
5
5
  export const MessageTypes = {
6
+ FILE_DOWNLOAD_COMPLETED: 'file-download-completed',
6
7
  FILE_DOWNLOAD_REQUEST: 'file-download-request',
7
8
  MODEL_DISCOVERY_FOLDER_PROCESSED_EVENT: 'model-discovery-folder-processed-event',
8
9
  MODEL_DISCOVERY_SCAN_FOUND_EVENT: 'model-discovery-scan-found-event',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mesh-sync/worker-backend-client",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
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",
@@ -35,4 +35,4 @@
35
35
  "typescript": "^5.9.3"
36
36
  },
37
37
  "dependencies": {}
38
- }
38
+ }