@vertesia/workflow 0.66.0 → 0.67.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/workflow",
3
- "version": "0.66.0",
3
+ "version": "0.67.0",
4
4
  "type": "module",
5
5
  "description": "Composable prompts workflow dsl",
6
6
  "main": "./lib/esm/index.js",
@@ -50,10 +50,10 @@
50
50
  "tmp": "^0.2.3",
51
51
  "tmp-promise": "^3.0.3",
52
52
  "yaml": "^2.6.0",
53
+ "@vertesia/client": "0.67.0",
54
+ "@vertesia/api-fetch-client": "0.67.0",
53
55
  "@llumiverse/common": "0.20.0",
54
- "@vertesia/common": "0.66.0",
55
- "@vertesia/client": "0.66.0",
56
- "@vertesia/api-fetch-client": "0.66.0"
56
+ "@vertesia/common": "0.67.0"
57
57
  },
58
58
  "ts_dual_module": {
59
59
  "outDir": "lib",
@@ -49,7 +49,7 @@ export async function generateImageRendition(
49
49
  throw new DocumentNotFoundError(`Document ${objectId} not found`, [objectId]);
50
50
  }
51
51
 
52
- if (!inputObject.content?.etag || !inputObject.content?.source) {
52
+ if (!inputObject.content?.source) {
53
53
  log.error(`Document ${objectId} has no etag or source`);
54
54
  throw new DocumentNotFoundError(`Document ${objectId} has no etag or source`, [objectId]);
55
55
  }
@@ -87,9 +87,16 @@ export async function generateImageRendition(
87
87
  log.info(`Image ${objectId} copied to ${imageFile}`);
88
88
  renditionPages.push(imageFile);
89
89
 
90
+
91
+ //IF no etag, log and use use object id as etag
92
+ if (!inputObject.content.etag) {
93
+ log.warn(`Document ${objectId} has no etag, using object id as etag`);
94
+ }
95
+ const contentEtag = inputObject.content.etag ?? inputObject.id;
96
+
90
97
  const uploaded = await uploadRenditionPages(
91
98
  client,
92
- inputObject.content.etag,
99
+ contentEtag,
93
100
  [imageFile],
94
101
  params,
95
102
  );
@@ -154,12 +154,6 @@ export async function generateVideoRendition(
154
154
  objectId,
155
155
  ]);
156
156
  }
157
- if (!inputObject.content?.etag) {
158
- log.error(`Document ${objectId} has no etag`);
159
- throw new DocumentNotFoundError(`Document ${objectId} has no etag`, [
160
- objectId,
161
- ]);
162
- }
163
157
 
164
158
  if (
165
159
  !inputObject.content.type ||
@@ -277,10 +271,15 @@ export async function generateVideoRendition(
277
271
  }
278
272
  }
279
273
 
274
+ if (!inputObject.content?.etag) {
275
+ log.warn(`Document ${objectId} has no etag, using object id as etag`);
276
+ }
277
+ const etag = inputObject.content.etag ?? inputObject.id;
278
+
280
279
  // Update the final upload call to handle multiple thumbnails
281
280
  const uploaded = await uploadRenditionPages(
282
281
  client,
283
- inputObject.content.etag,
282
+ etag,
284
283
  renditionPages,
285
284
  params,
286
285
  );