flowscale 1.3.4 → 1.3.5

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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/dist/index.js +19 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -331,6 +331,10 @@ const result = await flowscale.executeWorkflowAsync(
331
331
  }
332
332
  ```
333
333
 
334
+ Each output entry contains either:
335
+ - `download_url` for binary/media outputs
336
+ - `file_content` for text/non-binary outputs
337
+
334
338
  #### ⚠️ **Migration Notice - executeWorkflowAsync Response Format**
335
339
 
336
340
  Starting from **v1.0.18**, `executeWorkflowAsync` automatically detects single vs multiple outputs and returns the appropriate format for backward compatibility:
package/dist/index.js CHANGED
@@ -236,7 +236,7 @@ var FlowscaleAPI = /** @class */ (function () {
236
236
  */
237
237
  FlowscaleAPI.prototype.executeWorkflowAsync = function (workflowId_1, data_1, groupId_1) {
238
238
  return __awaiter(this, arguments, void 0, function (workflowId, data, groupId, pollIntervalMs, timeoutMs, returnAllOutputsOrOptions) {
239
- var _a, returnAllOutputs, onIntermediateResponse, startTime, executeResponse, runId, resolvedWorkflowId, run_status, output_names, runResponse, attempts, runResponse, latestOutputNames, outputPromises, outputResults, successfulOutputs, pendingOutputs, hasErrors, _i, outputResults_1, result, deprecationWarning, legacyResponse, allOutputsResponse, error_1, errorMessage, isIntentionalError;
239
+ var _a, returnAllOutputs, onIntermediateResponse, startTime, executeResponse, runId, resolvedWorkflowId, run_status, output_names, runResponse, attempts, runResponse, latestOutputNames, outputPromises, outputResults, successfulOutputs, pendingOutputs, hasErrors, _i, outputResults_1, result, outputData, hasFileContent, hasDownloadUrl, deprecationWarning, legacyResponse, allOutputsResponse, error_1, errorMessage, isIntentionalError;
240
240
  var _this = this;
241
241
  var _b, _c, _d, _e, _f, _g, _h, _j;
242
242
  if (pollIntervalMs === void 0) { pollIntervalMs = 2000; }
@@ -414,20 +414,27 @@ var FlowscaleAPI = /** @class */ (function () {
414
414
  continue;
415
415
  }
416
416
  if (result.output.status === 'success') {
417
- if (result.output.data.file_content !== null) {
417
+ outputData = result.output.data || {};
418
+ hasFileContent = outputData.file_content !== undefined && outputData.file_content !== null;
419
+ hasDownloadUrl = typeof outputData.download_url === 'string' && outputData.download_url.trim() !== '';
420
+ if (hasFileContent) {
418
421
  successfulOutputs.push({
419
422
  filename: result.filename,
420
- download_url: undefined,
421
- file_content: result.output.data.file_content || '',
422
- generation_status: result.output.data.generation_status || 'success'
423
+ file_content: outputData.file_content,
424
+ generation_status: outputData.generation_status || 'success'
423
425
  });
424
426
  }
425
- successfulOutputs.push({
426
- filename: result.filename,
427
- file_content: undefined,
428
- download_url: result.output.data.download_url || '',
429
- generation_status: result.output.data.generation_status || 'success'
430
- });
427
+ else if (hasDownloadUrl) {
428
+ successfulOutputs.push({
429
+ filename: result.filename,
430
+ download_url: outputData.download_url,
431
+ generation_status: outputData.generation_status || 'success'
432
+ });
433
+ }
434
+ else {
435
+ this.logWarn("Output ".concat(result.filename, " marked success but has no download_url or file_content"));
436
+ pendingOutputs.push(result.filename);
437
+ }
431
438
  }
432
439
  else if (result.output.status === 'in_progress') {
433
440
  this.logDebug("Output ".concat(result.filename, " still in progress"));
@@ -463,6 +470,7 @@ var FlowscaleAPI = /** @class */ (function () {
463
470
  status: 'success',
464
471
  data: {
465
472
  download_url: successfulOutputs[0].download_url,
473
+ file_content: successfulOutputs[0].file_content,
466
474
  generation_status: successfulOutputs[0].generation_status
467
475
  },
468
476
  _deprecation: deprecationWarning
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowscale",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "An NPM library for communicating with the Flowscale APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",